# HG changeset patch # User Jan Nieuwenhuizen # Date 1250536390 -7200 # Node ID 9d90cca4c2a6df3209cf2ef53286136b45c1ff5d # Parent 29c354d0e78b9b3657e1781672291ab02ffe7508 Plain [non-GUB/ BOOTSTRAP] build fixes. diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/build.py --- a/gub/build.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/build.py Mon Aug 17 21:13:10 2009 +0200 @@ -114,7 +114,7 @@ return [] def with_platform (self, name): - if 'BOOTSTRAP' in os.environ.keys () or True: + if 'BOOTSTRAP' in os.environ.keys (): if 'tools::' in name: return misc.with_platform (name.replace ('tools::', ''), self.settings.build_platform) diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/cross.py --- a/gub/cross.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/cross.py Mon Aug 17 21:13:10 2009 +0200 @@ -30,7 +30,9 @@ return d def configure_command (self): return ( - '''LDFLAGS='-L%(system_prefix)s/lib -Wl,--as-needed' ''' + # BOOTSTRAP -- do we need this? + #'''LDFLAGS='-L%(system_prefix)s/lib -Wl,--as-needed' ''' + '''LDFLAGS=-L%(system_prefix)s/lib ''' + build.AutoBuild.configure_command (self) + misc.join_lines (''' --program-prefix=%(target_architecture)s- @@ -61,13 +63,16 @@ # GNU tar --strip-component # /usr/bin/install: coreutils # SVN -bootstrap_names = ['system::gcc', 'tools::gub-utils', 'tools::librestrict', 'tools::make'] +bootstrap_names = ['system::gcc', 'tools::librestrict', 'tools::make'] def set_cross_dependencies (package_object_dict): + global bootstrap_names if 'stat' in misc.librestrict (): - global bootstrap_names bootstrap_names += ['tools::coreutils', 'tools::dash', 'tools::gawk', 'tools::grep', 'tools::sed'] + if 'BOOTSTRAP' in os.environ.keys (): + bootstrap_names += ['tools::gub-utils'] + packs = list (package_object_dict.values ()) cross_packs = [p for p in packs if isinstance (p, AutoBuild)] diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/gup.py --- a/gub/gup.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/gup.py Mon Aug 17 21:13:10 2009 +0200 @@ -446,7 +446,7 @@ def name_to_dependencies_via_gub (url): platform, url = split_platform (url) - if platform == 'tools': + if 'BOOTSTRAP' in os.environ.keys () and platform == 'tools': platform = settings.build_platform if ':' in url: base, unused_parameters = misc.dissect_url (url) diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/settings.py --- a/gub/settings.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/settings.py Mon Aug 17 21:13:10 2009 +0200 @@ -68,7 +68,7 @@ if not platform: platform = self.build_platform self.target_platform = platform - if platform == 'tools': + if 'BOOTSTRAP' in os.environ.keys () and platform == 'tools': self.target_platform = self.build_platform if self.target_platform not in list (platforms.keys ()): raise UnknownPlatform (self.target_platform) @@ -94,10 +94,10 @@ self.target_bits = self.build_bits # config dirs - self.root_dir = '/' + self.target_architecture - self.tools_root_dir = '/' + self.build_architecture + self.root_dir = '/root' + self.tools_root_dir = '/tools/root' self.prefix_dir = '/usr' - self.cross_dir = '' + self.cross_dir = '/cross' # Support GUB tools building directly in $HOME/{bin,lib,share}, # use GUB_TOOLS_PREFIX=$HOME @@ -128,21 +128,33 @@ # workdir based; may be changed self.downloads = self.workdir_prefix + '/downloads' self.alltargetdir = self.workdir_prefix + '/target' - if 'BOOTSTRAP' in os.environ.keys () or True: + self.targetdir = self.alltargetdir + '/' + self.target_platform + self.system_root = self.targetdir + self.root_dir + if 'BOOTSTRAP' in os.environ.keys (): # this is for: BOOTSTRAP *and* for running in [fake]chroot + self.root_dir = '/' + self.target_architecture + self.tools_root_dir = '/' + self.build_architecture self.alltargetdir = '/GUB' + self.system_root = self.alltargetdir + self.root_dir + self.cross_dir = '' - self.system_root = self.alltargetdir + self.root_dir if self.platform == 'tools' and GUB_TOOLS_PREFIX: self.system_root = GUB_TOOLS_PREFIX self.system_prefix = self.system_root + self.prefix_dir self.system_cross_prefix = self.system_prefix + '/' + self.target_architecture + self.cross_prefix = self.system_prefix + self.cross_dir + if 'BOOTSTRAP' in os.environ.keys (): + self.targetdir = self.system_root + # Hmm, cross now == system, isn't that is silly? + self.cross_prefix = self.system_prefix + self.tools_root = self.alltargetdir + self.tools_root_dir self.tools_prefix = self.tools_root + self.prefix_dir - self.tools_cross_prefix = self.tools_prefix + '/' + self.build_architecture + self.tools_cross_prefix = self.tools_prefix + self.cross_dir + if 'BOOTSTRAP' in os.environ.keys (): + self.tools_cross_prefix = self.tools_prefix + '/' + self.build_architecture - self.targetdir = self.system_root self.logdir = self.targetdir + '/log' ## Patches are architecture dependent, @@ -157,9 +169,6 @@ self.uploads = self.workdir_prefix + '/uploads' self.platform_uploads = self.uploads + '/' + self.platform - # Hmm, cross now == system, isn't that is silly? - self.cross_prefix = self.system_prefix - info = logging.default_logger.harmless info.write ('\n') info.write ('SYSTEM_ROOT=%(system_root)s\n' % self.__dict__) @@ -262,7 +271,8 @@ dir = self.__dict__[a] if not os.path.isdir (dir): loggedos.makedirs (logging.default_logger, dir) - if not os.path.exists (self.alltargetdir + self.alltargetdir): + if ('BOOTSTRAP' in os.environ.keys () + and not os.path.exists (self.alltargetdir + self.alltargetdir)): self.lib = 'lib' if self.build_bits == '64': self.lib = 'lib64' diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/coreutils.py --- a/gub/specs/coreutils.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/coreutils.py Mon Aug 17 21:13:10 2009 +0200 @@ -1,3 +1,5 @@ +import os +# from gub import tools ''' @@ -7,14 +9,17 @@ class Coreutils__tools (tools.AutoBuild): source = 'ftp://ftp.gnu.org/pub/gnu/coreutils/coreutils-6.12.tar.gz' - #patches = ['coreutils-6.12-shared-automake.patch'] - patches = ['coreutils-6.12-shared-autoconf.patch'] + if 'BOOTSTRAP' in os.environ.keys (): + patches = ['coreutils-6.12-shared-autoconf.patch'] + else: + patches = ['coreutils-6.12-shared-automake.patch'] def _get_build_dependencies (self): return ['tools::autoconf', 'tools::automake'] - def NO_force_autoupdate (self): - return True - def NO_autoupdate (self): - self.system (''' + def force_autoupdate (self): + return 'BOOTSTRAP' not in os.environ.keys () + def autoupdate (self): + if not 'BOOTSTRAP' in os.environ.keys (): + self.system (''' cd %(srcdir)s && autoreconf ''') def configure_command (self): @@ -23,8 +28,12 @@ def makeflags (self): return ''' LDFLAGS='%(rpath)s' LIBS='$(cp_LDADD) $(ls_LDADD) -lm' RANLIB='mvaso () { mv $$1 $$(dirname $$1)/$$(basename $$1 .a).so; }; mvaso ' libcoreutils_a_AR='gcc -shared -o' ''' def wrap_executables (self): - return False + # using rpath + pass def install (self): # The RANLIB/mvaso trick needs libcoreutils.a to exist at install time. self.system ('cd %(builddir)s/lib && ln libcoreutils.so libcoreutils.a') tools.AutoBuild.install (self) + if 'BOOTSTRAP' in os.environ.keys (): + self.system ('mkdir -p %(install_prefix)/lib') + self.system ('cp -pv lib/libcoreutils* %(install_prefix)/lib') diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/expat.py --- a/gub/specs/expat.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/expat.py Mon Aug 17 21:13:10 2009 +0200 @@ -1,3 +1,5 @@ +import os +# from gub import misc from gub import target from gub import tools @@ -13,8 +15,10 @@ self.system ("rm %(srcdir)s/configure") self.system ("touch %(srcdir)s/tests/xmltest.sh.in") def makeflags (self): - return misc.join_lines (''' -SHELL=%(tools_prefix)s/bin/bash + SHELL = '' + if 'BOOTSTRAP' in os.environ.keys (): + SHELL = '%(tools_prefix)s/bin/bash' + return SHELL + misc.join_lines (''' CFLAGS="-O2 -DHAVE_EXPAT_CONFIG_H" EXEEXT= RUN_FC_CACHE_TEST=false diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/fontconfig.py --- a/gub/specs/fontconfig.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/fontconfig.py Mon Aug 17 21:13:10 2009 +0200 @@ -20,9 +20,16 @@ source = 'git://anongit.freedesktop.org/git/fontconfig?branch=master&revision=' + version + def __init__ (self, settings, source): + target.AutoBuild.__init__ (self, settings, source) + if 'stat' in misc.librestrict (): + target.add_target_dict (self, {'LIBRESTRICT_IGNORE': '%(tools_prefix)s/bin/bash:%(tools_prefix)s/bin/make'}) + #target.add_target_dict (self, {'LIBRESTRICT_VERBOSE': '1'}) def patch (self): self.dump ('\nAC_SUBST(LT_AGE)', '%(srcdir)s/configure.in', mode='a', permissions=octal.o755) target.AutoBuild.patch (self) + def autoupdate (self): + self.system ('cd %(autodir)s && NOCONFIGURE=1 LIBRESTRICT_VERBOSE=1 LIBRESTRICT_IGNORE=%(tools_prefix)s/bin/bash bash autogen.sh --noconfigure') @context.subst_method def freetype_cflags (self): # this is shady: we're using the flags from the tools version diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/freetype.py --- a/gub/specs/freetype.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/freetype.py Mon Aug 17 21:13:10 2009 +0200 @@ -107,4 +107,5 @@ return Freetype.license_files (self) def install (self): tools.AutoBuild.install (self) - self.munge_ft_config ('%(install_root)s/%(tools_prefix)s/bin/.freetype-config') + #self.munge_ft_config ('%(install_root)s/%(tools_prefix)s/bin/.freetype-config') + self.munge_ft_config ('%(install_root)s/%(tools_prefix)s/bin/freetype-config') diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/gub-utils.py --- a/gub/specs/gub-utils.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/gub-utils.py Mon Aug 17 21:13:10 2009 +0200 @@ -1,6 +1,9 @@ from gub import build -class Gub_utils (build.SdkBuild): +import os +if 'BOOTSTRAP' in os.environ.keys (): from gub import target as tools + +class Gub_utils__tools (build.SdkBuild): source = 'url://host/gub-utils-1.0.tar.gz' def install (self): build.SdkBuild.install (self) diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/m4.py --- a/gub/specs/m4.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/m4.py Mon Aug 17 21:13:10 2009 +0200 @@ -10,4 +10,4 @@ return string + '\ngl_cv_lib_sigsegv=${gl_cv_lib_sigsegv=no}\n' def wrap_executables (self): # no dynamic executables [other than /lib:libc] - return + pass diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/make.py --- a/gub/specs/make.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/make.py Mon Aug 17 21:13:10 2009 +0200 @@ -20,7 +20,7 @@ return ['librestrict'] def wrap_executables (self): # no dynamic executables [other than /lib:libc] - return + pass class Make_build_sh__tools (Make_make__tools): def compile_command (self): diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/openoffice.py --- a/gub/specs/openoffice.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/openoffice.py Mon Aug 17 21:13:10 2009 +0200 @@ -804,7 +804,7 @@ def wrap_executables (self): # using rpath, and also openoffice has data files in bin/, # such as types.rdb. - return + pass Openoffice = OpenOffice Openoffice__mingw = OpenOffice__mingw diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/patch.py --- a/gub/specs/patch.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/patch.py Mon Aug 17 21:13:10 2009 +0200 @@ -18,4 +18,4 @@ return self.broken_install_command () def wrap_executables (self): # no dynamic executables [other than /lib:libc] - return + pass diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/specs/tar.py --- a/gub/specs/tar.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/specs/tar.py Mon Aug 17 21:13:10 2009 +0200 @@ -9,4 +9,4 @@ self.source._unpack = self.source._unpack_promise_well_behaved def wrap_executables (self): # no dynamic executables [other than /lib:libc] - return + pass diff -r 29c354d0e78b -r 9d90cca4c2a6 gub/tools.py --- a/gub/tools.py Mon Aug 17 14:21:44 2009 +0200 +++ b/gub/tools.py Mon Aug 17 21:13:10 2009 +0200 @@ -79,10 +79,12 @@ --enable-static ''' + config_cache) # FIXME: promoteme to build.py? Most Fragile operation... + # BOOTSTRAP -- do we need this? + # LDFLAGS='-L%(system_prefix)s/lib -Wl,--as-needed' def configure_variables (self): return misc.join_lines (''' CFLAGS=-I%(system_prefix)s/include -LDFLAGS='-L%(system_prefix)s/lib -Wl,--as-needed' +LDFLAGS=-L%(system_prefix)s/lib ''') ## ugh: prefix= will trigger libtool relinks. diff -r 29c354d0e78b -r 9d90cca4c2a6 patches/coreutils-6.12-shared-automake.patch --- a/patches/coreutils-6.12-shared-automake.patch Mon Aug 17 14:21:44 2009 +0200 +++ b/patches/coreutils-6.12-shared-automake.patch Mon Aug 17 21:13:10 2009 +0200 @@ -23,8 +23,8 @@ libcoreutils_a_SOURCES = libcoreutils_a_LIBADD = $(gl_LIBOBJS) ---- coreutils-6.12/src/Makefile.im~ 2007-03-20 08:24:27.000000000 +0100 -+++ coreutils-6.12/src/Makefile.im 2009-02-13 10:35:04.000000000 +0100 +--- coreutils-6.12/src/Makefile.am~ 2007-03-20 08:24:27.000000000 +0100 ++++ coreutils-6.12/src/Makefile.am 2009-02-13 10:35:04.000000000 +0100 @@ -57,7 +57,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib # must precede $(LIBINTL) in order to ensure we use GNU getopt. # But libcoreutils.a must also follow $(LIBINTL), since libintl uses