changeset 3381:d5dcea53e366

Update freebsd to get_cross_build_dependencies
author Jan Nieuwenhuizen <janneke@gnu.org>
date Tue, 01 May 2007 17:36:09 +0200
parents 343180675292
children 9545aeebe79e
files TODO gub/freebsd.py gub/specs/cross/binutils.py gub/specs/cross/gcc.py gub/specs/freebsd-runtime.py
diffstat 5 files changed, 55 insertions(+), 61 deletions(-) [+]
line wrap: on
line diff
--- a/TODO	Tue May 01 17:03:37 2007 +0200
+++ b/TODO	Tue May 01 17:36:09 2007 +0200
@@ -1,12 +1,14 @@
 * update platform packages to use get_cross_build_dependencies
-  - cywgin 
   - darwin
-  - freebsd
   - debian?
+  - mipsel?
+  - linux-arm-...
 
   DONE
+  - cygwin
   - linux
   - mingw
+  - freebsd
 
 * Split build recipe's into Basic (configure??; make; make install),
   AutoTools; move Scons, Bjam recipes to gub lib.  Softcode stages,
--- a/gub/freebsd.py	Tue May 01 17:03:37 2007 +0200
+++ b/gub/freebsd.py	Tue May 01 17:36:09 2007 +0200
@@ -1,65 +1,16 @@
-import os
-import re
-
-from gub import cross
-from gub import mirrors
-from gub import gubb
-from gub import misc
-from gub import targetpackage
-
-class Binutils (cross.Binutils):
-    def configure_command (self):
-        # Add --program-prefix, otherwise we get
-        # i686-freebsd-FOO iso i686-freebsd4-FOO.
-        return (cross.Binutils.configure_command (self)
-            + misc.join_lines ('''
---program-prefix=%(tool_prefix)s
-'''))
-
-class Gcc (cross.Gcc):
-    def configure_command (self):
-        # Add --program-prefix, otherwise we get
-        # i686-freebsd-FOO iso i686-freebsd4-FOO.
-        return (cross.Gcc.configure_command (self)
-            + misc.join_lines ('''
---program-prefix=%(tool_prefix)s
-'''))
+def get_cross_packages (settings):
+    # obsolete
+    return []
 
-class Freebsd_runtime (gubb.BinarySpec, gubb.SdkBuildSpec):
-    def untar (self):
-        gubb.BinarySpec.untar (self)
-    def patch (self):
-        self.system ('rm -rf %(srcdir)s/usr/include/g++')
-
-def _get_cross_packages (settings, libc_version):
-    return (
-        Freebsd_runtime (settings).with (version=libc_version,
-                                         strip_components=0,
-                                         mirror=mirrors.lilypondorg),
-        Binutils (settings).with (version='2.16.1', format='bz2', mirror=mirrors.gnu),
-        Gcc (settings).with (version='4.1.1', mirror=mirrors.gcc_41,
-                             format='bz2'),
-        )
-
-def get_cross_packages_41 (settings):
-    return _get_cross_packages (settings, '4.10-2')
-
-def get_cross_packages_61 (settings):
-    return _get_cross_packages (settings, '6.1-RELEASE')
-
-def get_cross_packages (settings):
-    return get_cross_packages_41 (settings)
-
-    if settings.target_architecture == 'i686-freebsd4':
-        return get_cross_packages_41 (settings)
-    return get_cross_packages_61 (settings)
+def get_cross_build_dependencies (settings):
+    return ['cross/gcc']
 
 def change_target_package (package):
+    from gub import cross
     cross.change_target_package (package)
 
-        
-    
-# FIXME: download from sane place.
+# FIXME: download from sane place; or rather download only kernel
+# headers and build full toolchain from source?
 def get_sdk():
     '''
 
--- a/gub/specs/cross/binutils.py	Tue May 01 17:03:37 2007 +0200
+++ b/gub/specs/cross/binutils.py	Tue May 01 17:36:09 2007 +0200
@@ -8,9 +8,9 @@
 
 # FIXME: setting binutil's tooldir and/or gcc's gcc_tooldir may fix
 # -luser32 (ie -L .../w32api/) problem without having to set LDFLAGS.
-class Binutils__cygwin (cross.Binutils):
+class Binutils__cygwin (Binutils):
     def __init__ (self, settings):
-        cross.Binutils.__init__ (self, settings)
+        Binutils.__init__ (self, settings)
         self.with (version='2.17', format='bz2', mirror=mirrors.gnu)
     def makeflags (self):
         from gub import misc
@@ -23,3 +23,13 @@
     def configure_command (self):
         return ( cross.Binutils.configure_command (self)
                  + ' --disable-werror ')
+
+class Binutils__freebsd (Binutils):
+    def configure_command (self):
+        # Add --program-prefix, otherwise we get
+        # i686-freebsd-FOO iso i686-freebsd4-FOO.
+        from gub import misc
+        return (cross.Binutils.configure_command (self)
+            + misc.join_lines ('''
+--program-prefix=%(tool_prefix)s
+'''))
--- a/gub/specs/cross/gcc.py	Tue May 01 17:03:37 2007 +0200
+++ b/gub/specs/cross/gcc.py	Tue May 01 17:36:09 2007 +0200
@@ -37,6 +37,7 @@
 ''')
 
 class Gcc__mingw (cross.Gcc):
+    #REMOVEME
     def __init__ (self, settings):
         cross.Gcc.__init__ (self, settings)
         self.with_tarball (mirror=mirrors.gnu, version='4.1.1', format='bz2')
@@ -68,3 +69,19 @@
 --with-newlib
 --enable-threads
 '''))
+
+class Gcc (cross.Gcc):
+    #REMOVEME
+    def __init__ (self, settings):
+        cross.Gcc.__init__ (self, settings)
+        self.with_tarball (mirror=mirrors.gnu, version='4.1.1', format='bz2')
+    def get_build_dependencies (self):
+        return (cross.Gcc.get_build_dependencies (self)
+                + ['freebsd-runtime'])
+    def configure_command (self):
+        # Add --program-prefix, otherwise we get
+        # i686-freebsd-FOO iso i686-freebsd4-FOO.
+        return (cross.Gcc.configure_command (self)
+            + misc.join_lines ('''
+--program-prefix=%(tool_prefix)s
+'''))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gub/specs/freebsd-runtime.py	Tue May 01 17:36:09 2007 +0200
@@ -0,0 +1,14 @@
+from gub import gubb
+from gub import mirrors
+
+class Freebsd_runtime (gubb.BinarySpec, gubb.SdkBuildSpec):
+    def __init__ (self, settings):
+        gubb.BinarySpec.__init__ (self, settings)
+        version = '4.10-2'
+        if 0 and settings.target_architecture == 'i686-freebsd6':
+            version = '6.1-RELEASE'
+        self. with (version=version, strip_components=0, mirror=mirrors.lilypondorg)
+    def untar (self):
+        gubb.BinarySpec.untar (self)
+    def patch (self):
+        self.system ('rm -rf %(srcdir)s/usr/include/g++')