changeset 478:6718f9a5c1f1

Applying Thomas Mueller's patch for the autoreconf command. Closes #59
author wbell
date Thu, 13 Mar 2008 22:49:39 +0000
parents 3fa47d2052a0
children 07148aa7667e
files bitten/build/ctools.py doc/commands.txt setup.py
diffstat 3 files changed, 81 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/build/ctools.py
+++ b/bitten/build/ctools.py
@@ -60,6 +60,40 @@
     if returncode != 0:
         ctxt.error('configure failed (%s)' % returncode)
 
+def autoreconf(ctxt, file_='configure', force=None, install=None, symlink=None,
+              warnings=None, prepend_include=None, include =None):
+    """Run the autotoll ``autoreconf``.
+    
+    :param ctxt: the build context
+    :type ctxt: `Context`
+    :param force: consider all files obsolete
+    :param install: copy missing auxiliary files
+    :param symlink: install symbolic links instead of copies
+    :param warnings: report the warnings falling in CATEGORY
+    :prepend_include: prepend directories to search path
+    :include: append directories to search path
+
+    """
+    args = []
+    if install:
+        args.append('--install')
+        if symlink:
+            args.append('--symlink')
+    if force:
+        args.append('--force')
+    if warnings:
+        args.append('--warnings=%s' % warnings)
+        
+    if include:
+        args += ['--include=%s' % inc for inc in include.split()]
+    if prepend_include:
+        args += ['--prepend-include=%s' % pinc for pinc in prepend_include.split()]
+            
+    from bitten.build import shtools
+    returncode = shtools.execute(ctxt, 'autoreconf', args=args)
+    if returncode != 0:
+        ctxt.error('autoreconf failed (%s)' % returncode)
+
 def make(ctxt, target=None, file_=None, keep_going=False):
     """Execute a Makefile target.
     
--- a/doc/commands.txt
+++ b/doc/commands.txt
@@ -128,6 +128,52 @@
 
 
 -----------------
+``<c:autoreconf>``
+-----------------
+
+Executes ths autotool autoreconf.
+
+Parameters
+----------
+
+    :param force: consider all files obsolete
+    :param install: copy missing auxiliary files
+    :param symlink: install symbolic links instead of copies
+    :param warnings: report the warnings falling in CATEGORY
+    :prepend_include: prepend directories to search path
+    :include: append directories to search path
+
+
++--------------+-------------------------------------------------------------+
+| Name         | Description                                                 |
++==============+=============================================================+
+| ``force``    | Consider all files obsolete                                 |
++--------------+-------------------------------------------------------------+
+| ``install``  | Copy missing auxiliary files                                |
++--------------+-------------------------------------------------------------+
+| ``symlink``  | Install symbolic links instead of copies                    |
++--------------+-------------------------------------------------------------+
+| ``warnings`` | Report the warnings related to category (which can actually be a comma separated list)           |
++--------------+-------------------------------------------------------------+
+| ``prepend_include``  | Prepend directories to search path                  |
++--------------+-------------------------------------------------------------+
+| ``include``   | Append directories to search path                          |
++--------------+-------------------------------------------------------------+
+
+Examples
+--------
+
+.. code-block:: xml
+
+  <c:autoreconf force="1" install="1" warnings="cross,syntax,error"/>
+
+Runs the ``autoreconf`` tool in the base directory with the option: force, install
+and 3 warning categories active: cross,syntax,error. This is equivalent to::
+
+  autoreconf --force --install --warnings=cross,syntax,error
+
+
+-----------------
 ``<c:configure>``
 -----------------
 
--- a/setup.py
+++ b/setup.py
@@ -60,6 +60,7 @@
             NS + 'sh#exec = bitten.build.shtools:exec_',
             NS + 'sh#pipe = bitten.build.shtools:pipe',
             NS + 'c#configure = bitten.build.ctools:configure',
+            NS + 'c#autoreconf = bitten.build.ctools:autoreconf',
             NS + 'c#cppunit = bitten.build.ctools:cppunit',
             NS + 'c#gcov = bitten.build.ctools:gcov',
             NS + 'c#make = bitten.build.ctools:make',
Copyright (C) 2012-2017 Edgewall Software