Mercurial > gub
changeset 5660:f1cc9e07d8a9
Grand compile_command () -> class.compile_command hack.
author | Jan Nieuwenhuizen <janneke@gnu.org> |
---|---|
date | Sat, 26 Sep 2009 22:52:26 +0200 |
parents | 26f31a07e8f3 |
children | 9cc45009b221 |
files | gub/build.py gub/specs/boost.py gub/specs/cygwin/ghostscript.py gub/specs/guile.py gub/specs/libpng.py gub/specs/librestrict.py gub/specs/lilypond-installer.py gub/specs/lilypond.py gub/specs/make.py gub/specs/nsis.py gub/specs/sysvinit.py gub/target.py gub/tools.py |
diffstat | 13 files changed, 49 insertions(+), 73 deletions(-) [+] |
line wrap: on
line diff
--- a/gub/build.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/build.py Sat Sep 26 22:52:26 2009 +0200 @@ -331,9 +331,7 @@ configure_command = ' sh %(configure_binary)s%(configure_flags)s%(configure_variables)s' - @context.subst_method - def compile_command (self): - return 'make %(job_spec)s %(make_flags)s %(compile_flags)s' + compile_command = 'make %(job_spec)s %(make_flags)s %(compile_flags)s' @context.subst_method def compile_command_native (self):
--- a/gub/specs/boost.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/boost.py Sat Sep 26 22:52:26 2009 +0200 @@ -31,8 +31,7 @@ ['build_bjam']) def build_bjam (self): self.system ('cd %(builddir)s/tools/jam/src && CC=gcc sh build.sh gcc && mv bin.*/bjam %(builddir)s') - def boost_modules (self): - return [ + boost_modules = [ 'date_time', 'filesystem', 'function_types', @@ -49,12 +48,11 @@ 'thread', #'wave' ] - def compile_command (self): - return (target.BjamBuild_v2.compile_command (self) + compile_command = (target.BjamBuild_v2.compile_command .replace ('bjam ', '%(builddir)s/bjam ') + ' -sNO_BZIP2=1' + ' -sNO_ZLIB=1' - + ' --with-'.join ([''] + self.boost_modules ())) + + ' --with-'.join ([''] + boost_modules)) def license_files (self): return ['%(srcdir)s/LICENSE_1_0.txt'] def install (self): @@ -68,8 +66,7 @@ class Boost__freebsd__x86 (Boost): patches = ['boost-1.38.0-freebsd4.patch'] - def compile_command (self): - return (Boost.compile_command (self) + compile_command = (Boost.compile_command .replace ('--with-serialization', '')) class UGLYFIXBoost__mingw (Boost): @@ -110,8 +107,7 @@ @context.subst_method def CFLAGS (self): return '' - def compile_command (self): - return misc.join_lines (''' + compile_command = misc.join_lines (''' bjam -q '-sTOOLS=gcc' @@ -129,7 +125,7 @@ --verbose ''') def install_command (self): - return (self.compile_command () + return (self.compile_command + ' install').replace ('=%(prefix_dir)s', '=%(install_prefix)s') class Boost_v1 (BjamBuild_v1): @@ -144,8 +140,7 @@ self.system ('cd %(builddir)s/tools/build/jam_src && CC=gcc sh build.sh gcc && mv bin.*/bjam %(builddir)s') def license_files (self): return ['%(srcdir)s/LICENSE_1_0.txt'] - def boost_modules (self): - return [ + boost_modules = [ 'date_time', 'filesystem', 'function_types', @@ -162,12 +157,11 @@ 'thread', #'wave' ] - def compile_command (self): - return (BjamBuild_v1.compile_command (self) + compile_command = (BjamBuild_v1.compile_command .replace ('bjam ', '%(builddir)s/bjam ') + ' -sNO_BZIP2=1' + ' -sNO_ZLIB=1' - + ' --with-'.join ([''] + self.boost_modules ())) + + ' --with-'.join ([''] + boost_modules)) def install (self): BjamBuild_v1.install (self) # Bjam `installs' header files by using symlinks to the source dir? @@ -178,8 +172,7 @@ self.map_locate (replace_links, '%(install_prefix)s/include/boost', '*') class Boost__mingw (Boost_v1): - def compile_command (self): - return (Boost_v1.compile_command (self) + compile_command = (Boost_v1.compile_command .replace ('linux.hpp', 'win32.hpp')) class Boost__tools (tools.BjamBuild_v2, Boost): @@ -192,12 +185,11 @@ # the separately available boost-jam is terribly broken wrt # building boost: build included bjam self.system ('cd %(builddir)s/tools/jam/src && CC=gcc sh build.sh gcc && mv bin.*/bjam %(builddir)s') - def compile_command (self): - return (tools.BjamBuild_v2.compile_command (self) + compile_command = (tools.BjamBuild_v2.compile_command .replace ('bjam ', '%(builddir)s/bjam ') + ' -sNO_BZIP2=1' + ' -sNO_ZLIB=1' - + ' --with-'.join ([''] + Boost.boost_modules (self))) + + ' --with-'.join ([''] + Boost.boost_modules)) def install (self): tools.BjamBuild_v2.install (self) # Bjam `installs' header files by using symlinks to the source dir?
--- a/gub/specs/cygwin/ghostscript.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/cygwin/ghostscript.py Sat Sep 26 22:52:26 2009 +0200 @@ -84,7 +84,7 @@ self.makefile_fixup ('%(builddir)s/Makefile-x11') @context.subst_method def compile_command_x11 (self): - return ghostscript.Ghostscript.compile_command (self) + ' -f Makefile-x11 GS=gs-x11.exe' + return ghostscript.Ghostscript.compile_command + ' -f Makefile-x11 GS=gs-x11.exe' def compile_x11 (self): self.system (''' cd %(builddir)s && rm -f obj/*.tr
--- a/gub/specs/guile.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/guile.py Sat Sep 26 22:52:26 2009 +0200 @@ -75,9 +75,8 @@ self.file_sub ([('guile-readline', '')], '%(srcdir)s/Makefile.in') self.dump ('', '%(srcdir)s/doc/ref/version.texi') self.dump ('', '%(srcdir)s/doc/tutorial/version.texi') - def compile_command (self): - return ('preinstguile=%(tools_prefix)s/bin/guile ' - + target.AutoBuild.compile_command (self)) + compile_command = ('preinstguile=%(tools_prefix)s/bin/guile ' + + target.AutoBuild.compile_command) def compile (self): ## Ugh: broken dependencies break parallel build with make -jX self.system ('cd %(builddir)s/libguile && make %(compile_flags_native)s gen-scmconfig guile_filter_doc_snarfage') @@ -150,9 +149,8 @@ self.system ('''mv %(install_prefix)s/lib/lib*[0-9].la %(install_prefix)s/bin''') class Guile__linux (Guile): - def compile_command (self): - return ('export LD_LIBRARY_PATH=%(builddir)s/libguile/.libs:$LD_LIBRARY_PATH;' - + Guile.compile_command (self)) + compile_command = ('export LD_LIBRARY_PATH=%(builddir)s/libguile/.libs:$LD_LIBRARY_PATH;' + + Guile.compile_command) class Guile__linux__ppc (Guile__linux): def config_cache_overrides (self, string): @@ -213,11 +211,10 @@ Guile.autopatch (self) # FIXME: when configuring, guile runs binaries linked against # libltdl. - def compile_command (self): # FIXME: when not x-building, guile runs gen_scmconfig, guile without # setting the proper LD_LIBRARY_PATH. - return ('export LD_LIBRARY_PATH=%(builddir)s/libguile/.libs:%(system_prefix)s/lib:${LD_LIBRARY_PATH-/foe};' - + Guile.compile_command (self)) + compile_command = ('export LD_LIBRARY_PATH=%(builddir)s/libguile/.libs:%(system_prefix)s/lib:${LD_LIBRARY_PATH-/foe};' + + Guile.compile_command) def install (self): tools.AutoBuild.install (self) # Ugh: remove development stuff from tools
--- a/gub/specs/libpng.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/libpng.py Sat Sep 26 22:52:26 2009 +0200 @@ -15,12 +15,11 @@ self.file_sub ([('(@INSTALL.*)@PKGCONFIGDIR@', r'\1${DESTDIR}@PKGCONFIGDIR@')], '%(srcdir)s/Makefile.am') - configure_command = ('LIBRESTRICT_ALLOW=/var/mail ' - + target.AutoBuild.configure_command) - def compile_command (self): - c = target.AutoBuild.compile_command (self) - ## need to call twice, first one triggers spurious Automake stuff. - return '(%s) || (%s)' % (c,c) + configure_command = ('LIBRESTRICT_ALLOW=/var/mail ' + + target.AutoBuild.configure_command) + ## need to call twice, first one triggers spurious Automake stuff. + compile_command = '(%s) || (%s)' % (target.AutoBuild.compile_command, + target.AutoBuild.compile_command) class Libpng__tools (tools.AutoBuild, Libpng): dependencies = ['libtool']
--- a/gub/specs/librestrict.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/librestrict.py Sat Sep 26 22:52:26 2009 +0200 @@ -1,3 +1,4 @@ +from gub import context from gub import tools from gub import misc @@ -41,6 +42,7 @@ return '' class Librestrict_nomake__tools (Librestrict_make__tools): + @context.subst_method def compile_command (self): # URG, must *not* have U __stack_chk_fail@@GLIBC_2.4 # because glibc-[core-]2.3 will not install with LD_PRELOAD
--- a/gub/specs/lilypond-installer.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/lilypond-installer.py Sat Sep 26 22:52:26 2009 +0200 @@ -13,15 +13,14 @@ class LilyPond_installer (lilypond.LilyPond_base): dependencies = [self.settings.target_platform + '::lilypond'] def compile (self): - self.system (self.compile_command ()) - def compile_command (self): + self.system (self.compile_command) # FIXME: ugh, no branches anymore in self.settings.branches['guile'], # let's hope/assume the user did not override guile source or branch... dir = os.path.join (self.settings.downloads, 'guile') guile_branch = repository.get_repository_proxy (dir, guile.Guile.source, guile.Guile.branch).full_branch_name () #guile_branch = guile.Guile (self.settings, guile.Guile.source).source.full_branch_name () lilypond_branch = self.source.full_branch_name () - return (sys.executable + compile_command = (sys.executable + misc.join_lines (''' bin/gib --platform=%%(target_platform)s
--- a/gub/specs/lilypond.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/lilypond.py Sat Sep 26 22:52:26 2009 +0200 @@ -256,10 +256,9 @@ MALLOC_CHECK_=2 LD_LIBRARY_PATH=%(tools_prefix)s/lib:%(system_prefix)s/lib:${LD_LIBRARY_PATH-/foe} ''') - def compile_command (self): - return ('%(doc_limits)s ' + compile_command = ('%(doc_limits)s ' '&& %(doc_relocation)s ' - + target.AutoBuild.compile_command (self)) + + target.AutoBuild.compile_command) def install_command (self): return ('%(doc_limits)s ' '&& %(doc_relocation)s '
--- a/gub/specs/make.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/make.py Sat Sep 26 22:52:26 2009 +0200 @@ -19,16 +19,14 @@ dependencies = ['librestrict'] class Make_build_sh__tools (Make_make__tools): - def compile_command (self): - return 'sh build.sh' + compile_command = 'sh build.sh' def install_command (self): return ('mkdir -p %(install_prefix)s/bin' ' && cp -p make %(install_prefix)s/bin') class Make_build_sh_newmake__tools (Make_make__tools): - def compile_command (self): - return ('sh build.sh && PATH=$(pwd):$PATH ' - + Make_make__tools.compile_command (self)) + compile_command = ('sh build.sh && PATH=$(pwd):$PATH ' + + Make_make__tools.compile_command) def install_command (self): return 'PATH=$(pwd):$PATH ' + Make_make__tools.install_command (self)
--- a/gub/specs/nsis.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/nsis.py Sat Sep 26 22:52:26 2009 +0200 @@ -18,6 +18,10 @@ if 'x86_64-linux' in self.settings.build_architecture: self.dependencies += ['linux-x86::glibc'] cross.change_target_package_x86 (self, self.add_mingw_env ()) + if 'stat' in misc.librestrict (): + self.compile_command = ('LIBRESTRICT_IGNORE=%(tools_prefix)s/bin/python ' + + tools.SConsBuild.compile_command) + return tools.SConsBuild.compile_command def add_mingw_env (self): # Do not use 'root', 'usr', 'cross', rather use from settings, # that enables changing system root, prefix, etc. @@ -47,11 +51,6 @@ Export('defenv') ''')], '%(srcdir)s/SConstruct') - def compile_command (self): - if 'stat' in misc.librestrict (): - return ('LIBRESTRICT_IGNORE=%(tools_prefix)s/bin/python ' - + tools.SConsBuild.compile_command (self)) - return tools.SConsBuild.compile_command (self) # this method is overwritten for x86-64_linux def build_environment (self): return self.add_mingw_env ()
--- a/gub/specs/sysvinit.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/specs/sysvinit.py Sat Sep 26 22:52:26 2009 +0200 @@ -4,8 +4,7 @@ source = 'ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.86.tar.gz' subpackage_names = [''] make_flags = 'CC=%(toolchain_prefix)sgcc ROOT=%(install_root)s' - def compile_command (self): - return 'cd %(builddir)s/src && make %(make_flags)s' + compile_command = 'cd %(builddir)s/src && make %(make_flags)s' def install (self): fakeroot_cache = self.builddir () + '/fakeroot.cache' self.fakeroot (self.expand (self.settings.fakeroot, locals ()))
--- a/gub/target.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/target.py Sat Sep 26 22:52:26 2009 +0200 @@ -189,14 +189,13 @@ scons_flags = '' def stages (self): return [s for s in AutoBuild.stages (self) if s not in ['autoupdate', 'configure']] - def compile_command (self): # SCons barfs on trailing / on directory names - return ('scons PREFIX=%(system_prefix)s' + compile_command = ('scons PREFIX=%(system_prefix)s' ' PREFIX_DEST=%(install_root)s' ' %(compile_flags)s' ' %(scons_flags)s') def install_command (self): - return self.compile_command () + ' %(install_flags)s' + return self.compile_command + ' %(install_flags)s' class WafBuild (AutoBuild): def stages (self): @@ -205,8 +204,7 @@ def configure_binary (self): return '%(autodir)s/waf' configure_command = '%(configure_binary)s configure --prefix=%(install_prefix)s' - def compile_command (self): - return '%(configure_binary)s build' + compile_command = '%(configure_binary)s build' def install_command (self): return '%(configure_binary)s install' @@ -229,8 +227,7 @@ ''', '%(srcdir)s/tools/build/v2/user-config.jam', env=locals ()) - def compile_command (self): - return misc.join_lines (''' + compile_command = misc.join_lines (''' bjam -q --layout=system @@ -250,7 +247,7 @@ release ''') def install_command (self): - return (self.compile_command () + return (self.compile_command + ' install').replace ('=%(prefix_dir)s', '=%(install_prefix)s') class NullBuild (AutoBuild):
--- a/gub/tools.py Sat Sep 26 22:15:38 2009 +0200 +++ b/gub/tools.py Sat Sep 26 22:52:26 2009 +0200 @@ -148,8 +148,7 @@ class ShBuild (AutoBuild): def stages (self): return [s.replace ('configure', 'shadow') for s in AutoBuild.stages (self) if s not in ['autoupdate']] - def compile_command (self): - return 'bash build.sh %(make_flags)s %(compile_flags)s' + compile_command = 'bash build.sh %(make_flags)s %(compile_flags)s' def install_command (self): print ('Override me.') assert False @@ -166,21 +165,19 @@ scons_flags = '' def stages (self): return [s for s in AutoBuild.stages (self) if s not in ['autoupdate', 'configure']] - def compile_command (self): # SCons barfs on trailing / on directory names - return ('scons PREFIX=%(system_prefix)s' + compile_command = ('scons PREFIX=%(system_prefix)s' ' PREFIX_DEST=%(install_root)s' ' %(compile_flags)s' ' %(scons_flags)s') def install_command (self): - return self.compile_command () + ' %(install_flags)s' + return self.compile_command + ' %(install_flags)s' class BjamBuild_v2 (MakeBuild): dependencies = ['boost-jam'] def patch (self): MakeBuild.patch (self) - def compile_command (self): - return misc.join_lines (''' + compile_command = misc.join_lines (''' bjam -q --layout=system @@ -199,7 +196,7 @@ release ''') def install_command (self): - return (self.compile_command () + return (self.compile_command + ' install').replace ('=%(system_prefix)s', '=%(install_prefix)s') class NullBuild (AutoBuild):