change log for rtems-tools (2011-12-07)

rtems-vc at rtems.org rtems-vc at rtems.org
Wed Dec 7 20:53:23 UTC 2011


 *ccj*:
Add FreeBSD support.

M    1.9  specbuilder/specbuilder/defaults.py
A    1.1  specbuilder/specbuilder/freebsd.py

diff -u rtems-tools/specbuilder/specbuilder/defaults.py:1.8 rtems-tools/specbuilder/specbuilder/defaults.py:1.9
--- rtems-tools/specbuilder/specbuilder/defaults.py:1.8	Thu Jun  9 00:59:32 2011
+++ rtems-tools/specbuilder/specbuilder/defaults.py	Mon Dec  5 05:32:44 2011
@@ -430,6 +430,9 @@
         if uname[0] == 'Darwin':
             import darwin
             overrides = darwin.load()
+        elif uname[0] == 'FreeBSD':
+            import freebsd
+            overrides = freebsd.load()
         elif uname[0] == 'Linux':
             import linux 
             overrides = linux.load()
@@ -461,6 +464,3 @@
         print ierr
         sys.exit(1)
     sys.exit(0)
-
-
-

diff -u /dev/null rtems-tools/specbuilder/specbuilder/freebsd.py:1.1
--- /dev/null	Wed Dec  7 14:53:23 2011
+++ rtems-tools/specbuilder/specbuilder/freebsd.py	Mon Dec  5 05:32:44 2011
@@ -0,0 +1,67 @@
+#
+# $Id$
+#
+# RTEMS Tools Project (http://www.rtems.org/)
+# Copyright 2010 Chris Johns (chrisj at rtems.org)
+# All rights reserved.
+#
+# This file is part of the RTEMS Tools package in 'rtems-tools'.
+#
+# RTEMS Tools is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# RTEMS Tools is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with RTEMS Tools.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+#
+# This code is based on what ever doco about spec files I could find and 
+# RTEMS project's spec files.
+#
+
+import pprint
+import os
+
+import execute
+
+def load():
+    uname = os.uname()
+    sysctl = '/sbin/sysctl '
+    e = execute.capture_execution()
+    exit_code, proc, output = e.shell(sysctl + 'hw.ncpu')
+    if exit_code == 0:
+        smp_mflags = '-j' + output.split(' ')[1].strip()
+    else:
+        smp_mflags = ''
+    if uname[4] == 'amd64':
+        cpu = 'x86_64'
+    else:
+        cpu = uname[4]
+    version = uname[2]
+    if version.find('-') > 0:
+        version = version.split('-')[0]
+    defines = { 
+        '_os':                     'freebsd',
+        '_host':                   cpu + '-freebsd' + uname[2],
+        '_host_vendor':            'freebsd',
+        '_host_os':                'freebsd',
+        '_host_cpu':               cpu,
+        '_host_alias':             '%{nil}',
+        '_host_arch':              cpu,
+        '_usr':                    '/usr/local',
+        '_var':                    '/usr/local/var',
+        'optflags':                '-O2 -fasynchronous-unwind-tables',
+        '_smp_mflags':             smp_mflags,
+        '__xz':                    '/usr/bin/xz',
+        }
+    return defines
+
+if __name__ == '__main__':
+    pprint.pprint(load())


 *ccj*:
Fix the host verison in FreeBSD. Allow the top of the src to crossrpms.

M    1.2  specbuilder/specbuilder/freebsd.py
M    1.7  specbuilder/specbuilder/setup.py

diff -u rtems-tools/specbuilder/specbuilder/freebsd.py:1.1 rtems-tools/specbuilder/specbuilder/freebsd.py:1.2
--- rtems-tools/specbuilder/specbuilder/freebsd.py:1.1	Mon Dec  5 05:32:44 2011
+++ rtems-tools/specbuilder/specbuilder/freebsd.py	Mon Dec  5 14:53:17 2011
@@ -49,7 +49,7 @@
         version = version.split('-')[0]
     defines = { 
         '_os':                     'freebsd',
-        '_host':                   cpu + '-freebsd' + uname[2],
+        '_host':                   cpu + '-freebsd' + version,
         '_host_vendor':            'freebsd',
         '_host_os':                'freebsd',
         '_host_cpu':               cpu,
@@ -57,9 +57,10 @@
         '_host_arch':              cpu,
         '_usr':                    '/usr/local',
         '_var':                    '/usr/local/var',
-        'optflags':                '-O2 -fasynchronous-unwind-tables',
+        'optflags':                '-O2',
         '_smp_mflags':             smp_mflags,
         '__xz':                    '/usr/bin/xz',
+        '__make':                  '/usr/bin/gmake',
         }
     return defines
 

diff -u rtems-tools/specbuilder/specbuilder/setup.py:1.6 rtems-tools/specbuilder/specbuilder/setup.py:1.7
--- rtems-tools/specbuilder/specbuilder/setup.py:1.6	Mon Feb 21 21:46:44 2011
+++ rtems-tools/specbuilder/specbuilder/setup.py	Mon Dec  5 14:53:17 2011
@@ -144,7 +144,9 @@
             rtemssrc = os.path.abspath(os.path.expanduser(self.opts.opts['rtems']))
             crossrpms = os.path.join(rtemssrc, 'contrib', 'crossrpms')
             if not os.path.isdir(crossrpms):
-                raise error.general('no crossrpms directory found under: ' + crossrpms)
+                crossrpms = os.path.join(rtemssrc)
+                if not os.path.isdir(crossrpms):
+                    raise error.general('no crossrpms directory found under: ' + crossrpms)
             if self.opts.rebuild():
                 if self.check_version('autoconf', '%{__setup_autoconf}'):
                     self.run('../../bootstrap -c', '-c', crossrpms)


 *ccj*:
Add a hack to work around make not being a macro in the spec files.

M   1.10  specbuilder/specbuilder/defaults.py
M    1.3  specbuilder/specbuilder/freebsd.py

diff -u rtems-tools/specbuilder/specbuilder/defaults.py:1.9 rtems-tools/specbuilder/specbuilder/defaults.py:1.10
--- rtems-tools/specbuilder/specbuilder/defaults.py:1.9	Mon Dec  5 05:32:44 2011
+++ rtems-tools/specbuilder/specbuilder/defaults.py	Tue Dec  6 00:37:54 2011
@@ -82,6 +82,8 @@
 export LANG
 unset DISPLAY || :
 umask 022
+# hack around make not being a macro and hard code in spec files
+alias make=%{__make}
 cd "%{_builddir}"''',
 '___build_shell': '%{?_buildshell:%{_buildshell}}%{!?_buildshell:/bin/sh}',
 '___build_template': '''#!%{___build_shell}
@@ -117,7 +119,7 @@
 '__ld':                '/usr/bin/ld',
 '__ldconfig':          '/sbin/ldconfig',
 '__ln_s':              'ln -s',
-'__make':              '/usr/bin/make',
+'__make':              'make',
 '__mkdir':             '/bin/mkdir',
 '__mkdir_p':           '/bin/mkdir -p',
 '__mv':                '/bin/mv',

diff -u rtems-tools/specbuilder/specbuilder/freebsd.py:1.2 rtems-tools/specbuilder/specbuilder/freebsd.py:1.3
--- rtems-tools/specbuilder/specbuilder/freebsd.py:1.2	Mon Dec  5 14:53:17 2011
+++ rtems-tools/specbuilder/specbuilder/freebsd.py	Tue Dec  6 00:37:57 2011
@@ -50,7 +50,7 @@
     defines = { 
         '_os':                     'freebsd',
         '_host':                   cpu + '-freebsd' + version,
-        '_host_vendor':            'freebsd',
+        '_host_vendor':            'pc',
         '_host_os':                'freebsd',
         '_host_cpu':               cpu,
         '_host_alias':             '%{nil}',
@@ -60,7 +60,7 @@
         'optflags':                '-O2',
         '_smp_mflags':             smp_mflags,
         '__xz':                    '/usr/bin/xz',
-        '__make':                  '/usr/bin/gmake',
+        '__make':                  'gmake',
         }
     return defines
 


 *ccj*:
Add /usr/local to the host cflags on FreeBSD.

M    1.4  specbuilder/specbuilder/freebsd.py

diff -u rtems-tools/specbuilder/specbuilder/freebsd.py:1.3 rtems-tools/specbuilder/specbuilder/freebsd.py:1.4
--- rtems-tools/specbuilder/specbuilder/freebsd.py:1.3	Tue Dec  6 00:37:57 2011
+++ rtems-tools/specbuilder/specbuilder/freebsd.py	Tue Dec  6 17:44:37 2011
@@ -57,7 +57,7 @@
         '_host_arch':              cpu,
         '_usr':                    '/usr/local',
         '_var':                    '/usr/local/var',
-        'optflags':                '-O2',
+        'optflags':                '-O2 -I/usr/local/include -L/usr/local/lib',
         '_smp_mflags':             smp_mflags,
         '__xz':                    '/usr/bin/xz',
         '__make':                  'gmake',



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20111207/6732d94b/attachment.html>


More information about the vc mailing list