changeset 5174:8ee86f3c06c7

Merge branch 'master' of git@github.com:janneke/gub
author Jan Nieuwenhuizen <janneke@gnu.org>
date Tue, 17 Feb 2009 14:49:05 +0100
parents 8602011649e7 (current diff) ab0dccc775b4 (diff)
children e218b5a2bd41
files
diffstat 10 files changed, 30 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/gub/cross.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/cross.py	Tue Feb 17 14:49:05 2009 +0100
@@ -64,6 +64,10 @@
 # SVN
 bootstrap_names = ['tools::librestrict', 'tools::make']
 def set_cross_dependencies (package_object_dict):
+    if 'stat' in misc.librestrict ():
+        global bootstrap_names
+        bootstrap_names += ['tools::dash', 'tools::coreutils']
+
     packs = list (package_object_dict.values ())
 
     cross_packs = [p for p in packs if isinstance (p, AutoBuild)]
--- a/gub/misc.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/misc.py	Tue Feb 17 14:49:05 2009 +0100
@@ -622,6 +622,10 @@
          to_name=python_config)
     self.chmod (python_config, octal.o755)
 
+def librestrict ():
+    return list (sorted (os.environ.get ('LIBRESTRICT',
+                                         'open').replace (':', ' ').split (' ')))
+
 def test ():
     printf (forall (x for x in [1, 1]))
     printf (dissect_url ('git://anongit.freedesktop.org/git/fontconfig?revision=1234'))
--- a/gub/specs/fontconfig.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/fontconfig.py	Tue Feb 17 14:49:05 2009 +0100
@@ -1,6 +1,3 @@
-import os
-#
-from gub import build
 from gub import context
 from gub import logging
 from gub import misc
@@ -83,7 +80,7 @@
         cflags = '-I%(srcdir)s -I%(srcdir)s/src %(freetype_cflags)s' 
         libs = '%(freetype_libs)s'
         relax = ''
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             relax = 'LIBRESTRICT_IGNORE=%(tools_prefix)s/bin/make '
         for i in ('fc-case', 'fc-lang', 'fc-glyphname', 'fc-arch'):
             self.system ('''
--- a/gub/specs/freetype.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/freetype.py	Tue Feb 17 14:49:05 2009 +0100
@@ -1,6 +1,4 @@
-import os
-#
-from gub import build
+from gub import misc
 from gub import target
 from gub import tools
 
@@ -18,7 +16,7 @@
         # Freetype stats /sbin, /usr/sbin and /hurd to determine if
         # build system is unix??
         # target.append_target_dict (self, {'LIBRESTRICT_ALLOW': '/sbin:/usr/sbin:/hurd'})
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             target.add_target_dict (self, {'LIBRESTRICT_ALLOW': '/usr/lib/gcc:/usr/libexec/gcc:/sbin:/usr/sbin:/hurd'})
     def license_files (self):
         return ['%(srcdir)s/docs/LICENSE.TXT']
--- a/gub/specs/glib.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/glib.py	Tue Feb 17 14:49:05 2009 +0100
@@ -1,5 +1,4 @@
-import os
-#
+from gub import misc
 from gub import tools
 from gub import target
 from gub import w32
@@ -9,7 +8,7 @@
     source = 'http://ftp.gnome.org/pub/GNOME/platform/2.22/2.22.0/sources/glib-2.16.1.tar.bz2'
     source = 'http://ftp.gnome.org/pub/GNOME/platform/2.25/2.25.5/sources/glib-2.19.5.tar.gz'
     def _get_build_dependencies (self):
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             return ['tools::glib', 'gettext-devel', 'libtool']
         return ['gettext-devel', 'libtool']
     def config_cache_overrides (self, str):
--- a/gub/specs/guile.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/guile.py	Tue Feb 17 14:49:05 2009 +0100
@@ -36,7 +36,7 @@
         # Guile [doc] does not compile with dash *and* not with
         # librestrict-stat.so; patch out.
         target.AutoBuild.patch (self)
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             self.file_sub ([(' doc ', ' ')], '%(srcdir)s/Makefile.am')
     def autogen_sh (self):
         self.file_sub ([(r'AC_CONFIG_SUBDIRS\(guile-readline\)', '')],
@@ -120,14 +120,10 @@
         return (Guile.makeflags (self)
                 + ''' 'LIBTOOL=%(tools_prefix)s/bin/dash $(top_builddir)/libtool' ''')
     def _get_build_dependencies (self):
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
-            return (Guile._get_build_dependencies (self)
-                    + ['tools::dash', 'tools::coreutils']
-                    + ['regex-devel'])
         return Guile._get_build_dependencies (self) +  ['regex-devel']
     def configure_command (self):
         SHELL = ''
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             SHELL = ' SHELL=%(tools_prefix)s/bin/dash'
         return (Guile.configure_command (self)
                 + SHELL
@@ -291,7 +287,7 @@
         # Guile [doc] does not compile with dash *and* not with
         # librestrict-stat.so; patch out.
         tools.AutoBuild.patch (self)
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             self.file_sub ([(' doc ', ' ')], '%(srcdir)s/Makefile.am')
     def configure_command (self):
         # FIXME: when configuring, guile runs binaries linked against
--- a/gub/specs/librestrict.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/librestrict.py	Tue Feb 17 14:49:05 2009 +0100
@@ -1,16 +1,13 @@
-import os
-#
 from gub import tools
 from gub import misc
 
 class Librestrict_make__tools (tools.MakeBuild):
     source = 'url://host/librestrict-1.9a.tar.gz'
     def librestrict_flavours (self):
-        return list (sorted (os.environ.get ('LIBRESTRICT',
-                                             'open').replace (':', ' ').split (' ')))
+        return misc.librestrict ()
     def flavours (self):
         return ['exec', 'open', 'stat']
-    def name (self):
+    def BARFS_WITH_2_5_1_name (self):
         return 'librestrict-' + '-'.join (self.librestrict_flavours ())
     def get_conflict_dict (self):
         # Ugly hack: if the user is not explicitly tightening the
@@ -20,7 +17,9 @@
         relax_restrictions = ['coreutils', 'dash']
         if 'stat' in self.librestrict_flavours ():
             relax_restrictions = []
-        return {'': ['librestrict',
+        return {'': ['coreutils',
+                     'dash',
+                     'librestrict',
                      'librestrict-exec',
                      'librestrict-exec-open',
                      'librestrict-exec-open-stat',
@@ -44,7 +43,7 @@
         # URG, must *not* have U __stack_chk_fail@@GLIBC_2.4
         # because glibc-[core-]2.3 will not install with LD_PRELOAD
         CFLAGS = '-fno-stack-protector'
-        compile = 'gcc -W -Wall %(CFLAGS)s -fPIC -shared -o lib%(name)s.so %(name)s.c'
+        compile = 'gcc -W -Wall %(CFLAGS)s -I. -fPIC -shared -o lib%(name)s.so %(name)s.c'
         sources = ' '.join (['restrict-%s.c' % name for name in self.librestrict_flavours ()])
         b = 'cd %(builddir)s && '
         command = b + 'cat %(sources)s > restrict-all.c\n' % locals ()
@@ -68,3 +67,4 @@
 '''))
 
 Librestrict__tools = Librestrict_nomake__tools
+Librestrict_open__tools = Librestrict__tools
--- a/gub/specs/make.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/make.py	Tue Feb 17 14:49:05 2009 +0100
@@ -1,3 +1,4 @@
+from gub import misc
 from gub import tools
 
 class Make_make__tools (tools.AutoBuild):
@@ -10,7 +11,10 @@
         self.file_sub ([('"/usr', '"%(system_prefix)s')], '%(srcdir)s/read.c')
         self.file_sub ([('"/usr', '"%(system_prefix)s'),
                         ('"/lib', '"%(system_root)s/lib')], '%(srcdir)s/remake.c')
+    def librestrict_name (self):
+        return 'librestrict-' + '-'.join (misc.librestrict ())
     def _get_build_dependencies (self):
+        #return [self.librestrict_name ()]
         return ['librestrict']
     def wrap_executables (self):
         # no dynamic executables [other than /lib:libc]
--- a/gub/specs/nsis.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/nsis.py	Tue Feb 17 14:49:05 2009 +0100
@@ -47,7 +47,7 @@
                        '%(srcdir)s/SConstruct')
     def compile_command (self):
         relax = ''
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             relax = 'LIBRESTRICT_IGNORE=%(tools_prefix)s/bin/python '
         return (relax
                 + tools.SConsBuild.compile_command (self)
--- a/gub/specs/python.py	Tue Feb 17 14:48:29 2009 +0100
+++ b/gub/specs/python.py	Tue Feb 17 14:49:05 2009 +0100
@@ -1,6 +1,4 @@
-import os
 import re
-import sys
 #
 from gub import build
 from gub import context
@@ -57,7 +55,7 @@
 ''')
     def install_command (self):
         relax = ''
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             relax = 'LIBRESTRICT_ALLOW=/usr/lib/python2.4/lib-dynload:$LIBRESTRICT_ALLOW '
         return (relax
                 + target.AutoBuild.install_command (self))
@@ -148,7 +146,7 @@
         return Python.makeflags (self)
     def install_command (self):
         relax = ''
-        if 'stat' in os.environ.get ('LIBRESTRICT', ''):
+        if 'stat' in misc.librestrict ():
             relax = 'LIBRESTRICT_ALLOW=/usr/lib/python2.4/lib-dynload:$LIBRESTRICT_ALLOW '
         return (relax
                 + tools.AutoBuild.install_command (self))