changeset 5592:d7d576acba6c

configure_command cleanup and thinko.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Tue, 22 Sep 2009 21:41:01 +0200
parents 8c4c67e75cab
children 767e70bc5653
files gub/build.py gub/specs/a52dec.py gub/specs/base-passwd.py gub/specs/cairomm.py gub/specs/denemo.py gub/specs/expat.py gub/specs/ghostscript.py gub/specs/glibc-core.py gub/specs/guile.py gub/specs/libjpeg.py gub/specs/lilypond.py gub/specs/msys.py gub/specs/openoffice.py gub/specs/perl.py gub/specs/pjproject.py gub/specs/python.py gub/specs/sqlite.py gub/specs/texlive.py gub/specs/xerces-c.py gub/specs/xulrunner.py gub/target.py
diffstat 21 files changed, 65 insertions(+), 87 deletions(-) [+]
line wrap: on
line diff
--- a/gub/build.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/build.py	Tue Sep 22 21:41:01 2009 +0200
@@ -23,6 +23,7 @@
     branch = ''
     patches = []
     build_dependencies = []
+    config_cache_flag_broken = True
     install_after_build = True
     parallel_build_broken = False
     srcdir_build_broken = False
@@ -328,7 +329,10 @@
 
     @context.subst_method
     def configure_command (self):
-        return ' sh %(configure_binary)s %(configure_flags)s %(configure_variables)s'
+        return (' sh '
+                + self.configure_binary ()
+                + self.configure_flags ()
+                + self.configure_variables ())
 
     @context.subst_method
     def configure_flags (self):
@@ -396,17 +400,17 @@
         else:
             self.runner._execute (commands.AutogenMagic (self))
 
-    def config_cache_overrides (self, str):
-        return str
+    def config_cache_overrides (self, string):
+        return string
 
     def config_cache_settings (self):
         return self.config_cache_overrides ('')
 
     def config_cache (self):
-        str = self.config_cache_settings ()
-        if str:
+        string = self.config_cache_settings ()
+        if string:
             self.system ('mkdir -p %(builddir)s || true')
-            self.dump (str, self.cache_file (), permissions=octal.o755)
+            self.dump (string, self.cache_file (), permissions=octal.o755)
 
     def configure (self):
         if self.srcdir_build_broken:
--- a/gub/specs/a52dec.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/a52dec.py	Tue Sep 22 21:41:01 2009 +0200
@@ -2,7 +2,7 @@
 
 class A52dec (target.AutoBuild):
     source = 'http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz'
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self)
+    def configure_variables (self):
+        return (target.AutoBuild.configure_variables (self)
                 + ' CFLAGS=-fPIC')
         
--- a/gub/specs/base-passwd.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/base-passwd.py	Tue Sep 22 21:41:01 2009 +0200
@@ -5,6 +5,3 @@
     srcdir_build_broken = True
     def get_subpackage_names (self):
         return ['']
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self)
-                .replace ('--config-cache', '--cache-file=%(builddir)s/config.cache'))
--- a/gub/specs/cairomm.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/cairomm.py	Tue Sep 22 21:41:01 2009 +0200
@@ -6,6 +6,6 @@
         return ['cairo-devel', 'libsig++-devel']
 
 class Cairomm__freebsd (Cairomm):
-    def configure_command (self):
+    def configure_variables (self):
         return (Cairomm.configure_command (self)
                 + ' CFLAGS=-pthread CXXFLAGS=-pthread')
--- a/gub/specs/denemo.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/denemo.py	Tue Sep 22 21:41:01 2009 +0200
@@ -67,8 +67,8 @@
                 'cross/gcc-c++-runtime',
                 ]
                 }
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self)
+    def configure_flags (self):
+        return (target.AutoBuild.configure_flags (self)
                 + ' --enable-binreloc'
                 + ' --enable-jack'
                 + ' --program-prefix=')
@@ -96,8 +96,8 @@
                 'jack',
                 'lash',
                 ]] + ['lilypad']
-    def configure_command (self):
-        return (Denemo.configure_command (self)
+    def configure_flags (self):
+        return (Denemo.configure_flags (self)
                 .replace ('--enable-jack', '--disable-jack'))
     def makeflags (self):
         return ''
@@ -125,6 +125,6 @@
             'fondu',
             'osx-lilypad',
             ]
-    def configure_command (self):
-        return (Denemo.configure_command (self)
+    def configure_flags (self):
+        return (Denemo.configure_flags (self)
                 .replace ('--enable-jack', '--disable-jack'))
--- a/gub/specs/expat.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/expat.py	Tue Sep 22 21:41:01 2009 +0200
@@ -25,9 +25,9 @@
 ''')
 
 class Expat__mingw (Expat):
-    def configure_command (self):
+    def configure_variables (self):
         # mingw's expat libtool build breaks with DASH
-        return (Expat.configure_command (self)
+        return (Expat.configure_variables (self)
                 .replace ('SHELL=', 'XSHELL='))
 
 class Expat__linux__arm__vfp (Expat):
--- a/gub/specs/ghostscript.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/ghostscript.py	Tue Sep 22 21:41:01 2009 +0200
@@ -291,8 +291,8 @@
         d = Ghostscript.get_subpackage_definitions (self)
         d['base'] = []
         return d
-    def configure_command (self):
-        return (Ghostscript.configure_command (self)
+    def configure_flags (self):
+        return (Ghostscript.configure_flags (self)
                 .replace (' --with-drivers=FILES', ' --with-drivers=ALL'))
     def compile (self):
         self.system ('''
@@ -310,15 +310,19 @@
         Ghostscript.config_cache (self)
         self.system ('cd %(builddir)s && cp -p config.cache config-x11.cache')
     @context.subst_method
-    def configure_command_x11 (self):
+    def configure_variables_x11 (self):
         return ('CONFIG_FILES=Makefile-x11'
-                + ' CONFIG_STATUS=config-x11.status'
-                + ' ' + self.configure_command ()
+                + ' CONFIG_STATUS=config-x11.status')
+    @context.subst_method
+    def configure_command_x11 (self):
+        return ' sh %(configure_binary)s %(configure_flags_x11)s %(configure_variables_x11)s Makefile'
+    @context.subst_method
+    def configure_flags_x11 (self):
+        return (self.configure_flags ()
                 .replace ('--without-x', '--with-x')
-                .replace ('--config-cache', '--cache-file=config-x11.cache')
+                .replace ('config.cache', 'config-x11.cache')
                 + ' --x-includes=%(system_prefix)s/X11R6/include'
-                + ' --x-libraries=%(system_prefix)s/X11R6/lib'
-                + ' Makefile')
+                + ' --x-libraries=%(system_prefix)s/X11R6/lib')
     def configure_x11 (self):
         self.system ('''
 mkdir -p %(builddir)s
--- a/gub/specs/glibc-core.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/glibc-core.py	Tue Sep 22 21:41:01 2009 +0200
@@ -15,9 +15,8 @@
         return {'': ['glibc', 'glibc-devel', 'glibc-doc', 'glibc-runtime']}
     def get_add_ons (self):
         return ('linuxthreads',)
-    def configure_command (self):
-        return (glibc.Glibc.configure_command (self)
-#                .replace ('--disable-versioning', '--enable-versioning')
+    def configure_flags (self):
+        return (glibc.Glibc.configure_flags (self)
                 + misc.join_lines ('''
 --without-tls
 --without-__thread
--- a/gub/specs/guile.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/guile.py	Tue Sep 22 21:41:01 2009 +0200
@@ -287,25 +287,6 @@
 
 class Guile__linux__x86 (Guile):
     patches = Guile.patches + ['guile-1.8.6-pthreads-cross.patch']
-    def FIXED_in_1_8_7_configure_command (self):
-        return (Guile.configure_command (self)
-                .replace ('--without-threads', '--with-threads=pthread'))
-    # all of a sudden, with linux-x86 guile I get this, so let's try using
-    # threads?
-    '''
-/home/janneke/vc/gub/target/linux-x86/build/guile-1.8.6/pre-inst-guile -s /home/janneke/vc/gub/target/linux-x86/src/guile-1.8.6/ice-9/compile-psyntax.scm \
-                /home/janneke/vc/gub/target/linux-x86/src/guile-1.8.6/ice-9/psyntax.ss /home/janneke/vc/gub/target/linux-x86/src/guile-1.8.6/ice-9/psyntax.pp
-ERROR: Stack overflow
-make[3]: *** [psyntax.pp] Error 1
-'''
-    def FIXED_in_1_8_7_config_cache_overrides (self, string):
-        return string + '''
-ac_cv_pthread_attr_getstack_works=${ac_cv_pthread_attr_getstack_works=no}
-ac_cv_func_pthread_attr_getstack=${ac_cv_func_pthread_attr_getstack=yes}
-ac_cv_func_pthread_get_stackaddr_np=${ac_cv_func_pthread_get_stackaddr_np=no}
-ac_cv_func_pthread_getattr_np=${ac_cv_func_pthread_getattr_np=yes}
-ac_cv_func_pthread_sigmask=${ac_cv_func_pthread_sigmask=yes}
-'''
 
 class Guile__tools (tools.AutoBuild, Guile):
     def _get_build_dependencies (self):
--- a/gub/specs/libjpeg.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/libjpeg.py	Tue Sep 22 21:41:01 2009 +0200
@@ -8,6 +8,7 @@
 
 class Libjpeg (target.AutoBuild):
     source = 'ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.gz'
+    config_cache_flag_broken = True
     def __init__ (self, settings, source):
         target.AutoBuild.__init__ (self, settings, source)
         source._version = 'v6b'
@@ -19,9 +20,6 @@
         return ['devel', '']
     def srcdir (self):
         return re.sub (r'src\.v', '-', target.AutoBuild.srcdir (self))
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self)
-                .replace ('--config-cache', '--cache-file=config.cache'))
     def update_libtool (self):
         self.system ('''
 cd %(builddir)s && %(srcdir)s/ltconfig --srcdir %(srcdir)s %(srcdir)s/ltmain.sh %(target_architecture)s'''
--- a/gub/specs/lilypond.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/lilypond.py	Tue Sep 22 21:41:01 2009 +0200
@@ -213,8 +213,8 @@
             'ghostscript',
             'lilypond-doc',
             ]
-    def configure_command (self):
-        return (LilyPond.configure_command (self)
+    def configure_flags (self):
+        return (LilyPond.configure_flags (self)
                 .replace ('--enable-relocation', '--disable-relocation'))
     def makeflags (self):
         python_lib = '%(system_prefix)s/bin/libpython*.dll'
@@ -369,8 +369,8 @@
                 'fondu',
                 'osx-lilypad',
                 ])
-    def configure_command (self):
-        return (LilyPond.configure_command (self)
+    def configure_flags (self):
+        return (LilyPond.configure_flags (self)
                 .replace ('--enable-rpath', '--disable-rpath'))
     def makeflags (self):
         return ' TARGET_PYTHON="/usr/bin/env python"'
--- a/gub/specs/msys.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/msys.py	Tue Sep 22 21:41:01 2009 +0200
@@ -8,7 +8,6 @@
     def configure (self):
         self.shadow ()
         c = self.expand ('%(configure_command)s')
-        c = c.replace ('--config-cache', '')
         self.system ('mkdir %(builddir)s ', ignore_errors=True)
         self.system ('cd  %(builddir)s && %(c)s', locals ())
         return c
--- a/gub/specs/openoffice.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/openoffice.py	Tue Sep 22 21:41:01 2009 +0200
@@ -589,8 +589,8 @@
             self.system ('''cp -pvf $OOO_TOOLS_DIR/../../../../sal/unx*/bin/gen_makefile $OOO_TOOLS_DIR/gen_makefile''')
             self.system ('''cp -pvf $OOO_TOOLS_DIR/../../../../icc/unx*/bin/create_sRGB_profile $OOO_TOOLS_DIR/create_sRGB_profile''')
             self.system ('''cp -pvf $OOO_TOOLS_DIR/../../../../i18npool/unx*/bin/* $OOO_TOOLS_DIR''')
-    def configure_command (self):
-        return (OpenOffice.configure_command (self)
+    def configure_flags (self):
+        return (OpenOffice.configure_flags (self)
                 .replace ('--with-system-xrender-headers', '')
                 + ' --disable-xrender-link'
                 + ' --with-distro=Win32')
@@ -779,7 +779,9 @@
 ''', '%(srcdir)s/Makefile.in', env=locals ())
     def configure_command (self):
         return ('x_libraries=no_x_libraries x_includes=no_x_includes '
-                + tools.AutoBuild.configure_command (self)
+                + tools.AutoBuild.configure_command (self))
+    def configure_flags (self):
+        return (tools.AutoBuild.configure_flags (self)
                 + re.sub ('--with-system-[^ ]*', '', OpenOffice.configure_options (self))
                 .replace ('--disable-crypt-link', '--enable-crypt-link')
                 + ' --with-system-db '
--- a/gub/specs/perl.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/perl.py	Tue Sep 22 21:41:01 2009 +0200
@@ -15,17 +15,6 @@
         self.file_sub ([('-c (/dev/null)', r'-e \1')], '%(srcdir)s/Configure')
     def configure_binary (self):
         return '%(autodir)s/configure.gnu'
-    def GNU_NOT_HAHA_configure_command (self):
-        # Handy, a GNU configure frontend...  Not.
-        command = (tools.AutoBuild.configure_command (self)
-                   .replace ('--config-cache', '')
-                   .replace ('--enable-shared', '')
-                   .replace ('--disable-static', ''))
-        command = re.sub ('--(build|host|target)=[^ ]* ', '', command)
-        command = re.sub ('--(includedir|infodir|libdir|mandir|sysconfdir|)=[^ ]* ', '', command)
-        
-        return ('''CC=%(CC)s'''
-                + command)
     def configure_command (self):
 # -Dcc=%(CC)s
 # -Dprefix=%(prefix_dir)s -- BOOTSTRAP
--- a/gub/specs/pjproject.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/pjproject.py	Tue Sep 22 21:41:01 2009 +0200
@@ -6,9 +6,11 @@
     srcdir_build_broken = True
     def patch (self):
         self.system ('cd %(srcdir)s && patch -p0 < %(patchdir)s/pjproject-install.patch')
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self).replace ('%(srcdir)s/configure', './aconfigure')
+    def configure_flags (self):
+        return (target.AutoBuild.configure_flags (self)
                 + ' --disable-sound')
+    def configure_binary (self):
+        return './aconfigure'
     def install_command (self):
         return (target.AutoBuild.install_command (self)
                 + ' prefix=%(prefix_dir)s')
--- a/gub/specs/python.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/python.py	Tue Sep 22 21:41:01 2009 +0200
@@ -125,12 +125,12 @@
                 ("import fcntl", ""),
                 ], "%(srcdir)s/Lib/subprocess.py",
                must_succeed=True)
-    def config_cache_overrides (self, str):
+    def config_cache_overrides (self, string):
         # Ok, I give up.  The python build system wins.  Once
         # someone manages to get -lwsock32 on the
         # sharedmodules link command line, *after*
         # timesmodule.o, this can go away.
-        return (str.replace ('ac_cv_func_select=yes', 'ac_cv_func_select=no')
+        return (string.replace ('ac_cv_func_select=yes', 'ac_cv_func_select=no')
                 + '''
 ac_cv_pthread_system_supported=yes,
 ac_cv_sizeof_pthread_t=12
--- a/gub/specs/sqlite.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/sqlite.py	Tue Sep 22 21:41:01 2009 +0200
@@ -3,8 +3,8 @@
 
 class Sqlite (target.AutoBuild):
     source = 'http://www.sqlite.org/sqlite-3.6.4.tar.gz' # 3.3.16
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self)
+    def configure_flags (self):
+        return (target.AutoBuild.configure_flags (self)
                 + misc.join_lines ('''
 --disable-tcl
 --enable-threadsafe
@@ -21,4 +21,5 @@
 class Sqlite__mingw (Sqlite):
     def configure_command (self):
         return ('config_TARGET_EXEEXT=.exe '
-                + Sqlite.configure_command (self).replace ('--enable-threadsafe', '--disable-threadsafe'))
+                + Sqlite.configure_command (self)
+                .replace ('--enable-threadsafe', '--disable-threadsafe'))
--- a/gub/specs/texlive.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/texlive.py	Tue Sep 22 21:41:01 2009 +0200
@@ -29,6 +29,7 @@
 packages.'''
 
     source = texlive_svn + '&branch=trunk&branchmodule=Build/source&revision=HEAD'
+    config_cache_flag_broken = True
     def _get_build_dependencies (self):
         return [
             'tools::automake',
@@ -145,7 +146,6 @@
         if 'stat' in misc.librestrict ():
             SHELL = ' SHELL=%(tools_prefix)s/bin/bash'
         return ('export TEXMFMAIN=%(srcdir)s/texmf;'
-                + target.AutoBuild.configure_command (self).replace ('--config-cache', '--cache-file=config.cache')
                 + self.common_configure_flags ()
                 + misc.join_lines ('''
 --with-x
@@ -274,7 +274,6 @@
         if 'stat' in misc.librestrict ():
             SHELL = ' SHELL=%(tools_prefix)s/bin/bash'
         return ('export TEXMFMAIN=%(srcdir)s/texmf;'
-                + tools.AutoBuild.configure_command (self).replace ('--config-cache', '--cache-file=config.cache')
                 + Texlive.common_configure_flags (self)
                 + misc.join_lines ('''
 --without-x
--- a/gub/specs/xerces-c.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/xerces-c.py	Tue Sep 22 21:41:01 2009 +0200
@@ -5,6 +5,7 @@
 class Xerces_c (target.AutoBuild):
     source = 'http://www.apache.org/dist/xerces/c/2/sources/xerces-c-src_2_8_0.tar.gz'
     parallel_build_broken = True
+    config_cache_flag_broken = True
     def _get_build_dependencies (self):
         return ['tools::autoconf']
     def __init__ (self, settings, source):
@@ -30,8 +31,7 @@
         # cool, it can serve the INSTALL file!  Let's remove it from
         # the tarball!
         return (self.makeflags () + ' '
-                + target.AutoBuild.configure_command (self)
-                .replace ('--config-cache', '--cache-file=%(builddir)s/config.cache'))
+                + target.AutoBuild.configure_command (self))
     def makeflags (self):
         s = ''
         for i in list (self.compile_dict.keys ()):
--- a/gub/specs/xulrunner.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/specs/xulrunner.py	Tue Sep 22 21:41:01 2009 +0200
@@ -2,9 +2,7 @@
 
 class Xulrunner (target.AutoBuild):
     source = 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.3/source/xulrunner-1.9.0.3-source.tar.bz2'
-    def configure_command (self):
-        return (target.AutoBuild.configure_command (self)
-                .replace ('--config-cache', '--cache-file=%(builddir)s/config.cache'))
+    config_cache_flag_broken = True
 
 class Xulrunner__mingw (Xulrunner):
     def patch (self):
--- a/gub/target.py	Tue Sep 22 20:33:14 2009 +0200
+++ b/gub/target.py	Tue Sep 22 21:41:01 2009 +0200
@@ -20,10 +20,15 @@
         build.AutoBuild.autoupdate (self)
         self.file_sub ([('cross_compiling=(maybe|no|yes)',
                          'cross_compiling=yes')], '%(configure_binary)s')
+    @context.subst_method
+    def config_cache_flag (self):
+        if True or self.config_cache_flag_broken:
+            return ' --cache-file=config.cache'
+        return ' --config-cache'
     def configure_flags (self):
         return (build.AutoBuild.configure_flags (self)
                 + misc.join_lines ('''
---config-cache
+--cache-file=config.cache
 --enable-shared
 --disable-static
 --disable-silent-rules