changeset 5612:ba8cabbbb308

Autoupdate-magic fixes. Fixes building GNU packages from git. bootstrap.sh now also is a name for non-make building of essential tools. Check for autogen.sh first and try to determine if bootstrap.sh is an auto-tool script.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Wed, 23 Sep 2009 20:37:26 +0200
parents 64662bdcca0c
children b98ed96f9cf3
files gub/build.py gub/commands.py
diffstat 2 files changed, 15 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gub/build.py	Wed Sep 23 19:58:40 2009 +0200
+++ b/gub/build.py	Wed Sep 23 20:37:26 2009 +0200
@@ -321,7 +321,10 @@
         return '%(srcdir)s'
 
     def aclocal_path (self):
-        return ['%(system_prefix)s/share/aclocal']
+        return [
+            '%(tools_prefix)s/share/aclocal',
+            '%(system_prefix)s/share/aclocal',
+            ]
 
     @context.subst_method
     def configure_binary (self):
--- a/gub/commands.py	Wed Sep 23 19:58:40 2009 +0200
+++ b/gub/commands.py	Wed Sep 23 20:37:26 2009 +0200
@@ -362,17 +362,19 @@
         package = self.package
         autodir = package.expand ('%(autodir)s')
         PATH = package.expand ('%(PATH)s')
-        if os.path.exists (os.path.join (autodir, 'bootstrap')):
-            self.system ('cd %(autodir)s && ./bootstrap' % locals (), logger)
-        elif os.path.exists (os.path.join (autodir, 'bootstrap.sh')):
-            self.system ('cd %(autodir)s && ./bootstrap.sh' % locals (), logger)
-        elif os.path.exists (os.path.join (autodir, 'autogen.sh')):
+        if os.path.exists (os.path.join (autodir, 'autogen.sh')):
             s = open ('%(autodir)s/autogen.sh' % locals ()).read ()
             noconfigure = ' --help'
             if '--noconfigure' in s:
                 noconfigure = ' --noconfigure' + noconfigure
             self.system ('cd %(autodir)s && NOCONFIGURE=1 sh autogen.sh %(noconfigure)s' % locals (),
                          logger)
+        elif (os.path.exists (os.path.join (autodir, 'bootstrap'))
+              and not 'CC=' in open (os.path.join (autodir, 'bootstrap')).read ()):
+            self.system ('cd %(autodir)s && ./bootstrap' % locals (), logger)
+        elif (os.path.exists (os.path.join (autodir, 'bootstrap.sh'))
+              and not 'CC=' in open (os.path.join (autodir, 'bootstrap.sh')).read ()):
+            self.system ('cd %(autodir)s && ./bootstrap.sh' % locals (), logger)
         else:
             libtoolize = misc.path_find (PATH, 'libtoolize')
             if libtoolize:
@@ -392,15 +394,15 @@
                              % locals (), logger)
             aclocal_flags = ''
             for dir in package.aclocal_path ():
-                d = package.expand (os.path.join (autodir, dir))
+                d = package.expand (dir)
                 if os.path.exists (d):
                     aclocal_flags += '-I%(d)s' % locals ()
             headcmd = ''
-            configure = ''
+            configure_ac = ''
             for c in ('configure.in','configure.ac'):
                 try:
                     string = open ('%(autodir)s/%(c)s' % locals ()).read ()
-                    configure = c
+                    configure_ac = c
                     m = re.search ('A[CM]_CONFIG_HEADER', string)
                     string = 0   ## don't want to expand string
                     if m:
@@ -408,7 +410,7 @@
                         break
                 except IOError:
                     pass
-            if configure:
+            if configure_ac:
                 self.system ('''
 cd %(autodir)s && aclocal %(aclocal_flags)s
 %(headcmd)s