Initial patches against actionmonkey from my Linux tree
authorbenjamin@smedbergs.us
Mon, 22 Oct 2007 11:04:14 -0400
changeset 0 2e0056fabeed0bac675b880ab9d95aeaf1771bd6
child 2 8b0ebf10667ee784780547bc06319abb3b2682c2
push id1
push userbsmedberg@mozilla.com
push dateMon, 21 Apr 2008 01:54:18 +0000
Initial patches against actionmonkey from my Linux tree
.hgignore
cross-compile.patch
series
new file mode 100644
--- /dev/null
+++ b/.hgignore
@@ -0,0 +1,3 @@
+syntax: glob
+status
+guards
new file mode 100644
--- /dev/null
+++ b/cross-compile.patch
@@ -0,0 +1,93 @@
+diff --git a/build/configuration.py b/build/configuration.py
+--- a/build/configuration.py
++++ b/build/configuration.py
+@@ -65,18 +65,21 @@ def writeFileIfChanged(path, contents):
+ 
+ def _configGuess():
+     ostest = sys.platform
++    cputest = build.process.run_for_output(['uname', '-m'])
++    return _configSub(ostest, cputest)
++
++def _configSub(ostest, cputest):
+     if ostest.startswith('win'):
+         os = 'windows'
+     elif ostest == 'darwin':
+         os = 'darwin'
+-    elif ostest.startswith('linux'):
++    elif ostest.startswith('linux') or ostest.startswith('pc-linux'):
+         os = 'linux'
+     elif ostest.startswith('sunos'):
+         os = 'sunos'
+     else:
+         raise Exception('Unrecognized OS: ' + ostest)
+ 
+-    cputest = build.process.run_for_output(['uname', '-m'])
+     if re.search(r'^i(\d86|86pc|x86)$', cputest):
+         cpu = 'i686'
+     elif re.search('^(x86_64|amd64)$', cputest):
+@@ -128,10 +131,12 @@ class Configuration:
+                 self._debug = d
+ 
+             if options.host:
+-                self._host = _configSub(options.host)
++                hostcpu, hostos = options.host.split('-', 1)
++                self._host = _configSub(hostos, hostcpu)
+ 
+             if options.target:
+-                self._target = _configSub(options.target)
++                targetcpu, targetos = options.target.split('-', 1)
++                self._target = _configSub(targetos, targetcpu)
+ 
+         self._acvars = {
+             'topsrcdir': self._topsrcdir,
+@@ -218,7 +223,9 @@ class Configuration:
+ 
+ # -Wno-trigraphs -Wreturn-type -Wnon-virtual-dtor -Wmissing-braces -Wparentheses -Wunused-label  -Wunused-parameter -Wunused-variable -Wunused-value -Wuninitialized
+ 
+-            if self._target[1] == 'i686':
++            if 'CXX' in os.environ:
++                self._acvars['CXX'] = os.environ['CXX']
++            elif self._target[1] == 'i686':
+                 self._acvars['CXX'] = 'g++-4.0'
+             elif self._target[1] == 'powerpc':
+                 self._acvars['CXX'] = 'g++-3.3'
+@@ -227,9 +234,9 @@ class Configuration:
+ 
+         elif self._target[0] == 'linux':
+             self._acvars.update({
+-                'CPPFLAGS'     : '',
+-                'CXX'          : 'g++',
+-                'CXXFLAGS'     : '',
++                'CPPFLAGS'     : os.environ.get('CPPFLAGS', ''),
++                'CXX'          : os.environ.get('CXX', 'g++'),
++                'CXXFLAGS'     : os.environ.get('CXXFLAGS', ''),
+                 'DLL_CFLAGS'   : '-fPIC',
+                 'LD'           : 'ar',
+                 'LDFLAGS'      : '',
+diff --git a/build/getopt.py b/build/getopt.py
+--- a/build/getopt.py
++++ b/build/getopt.py
+@@ -39,7 +39,7 @@ import re
+ import re
+ 
+ _target = re.compile("^--target=(.*)$")
+-_host = re.compile("^--host=.*$")
++_host = re.compile("^--host=(.*)$")
+ _ignore = re.compile(r"^--(srcdir|cache-file)=")
+ _arg = re.compile(r"^--(enable|disable|with|without)-([\w-]+)(?:=(.*)|$)$")
+ _yes = re.compile("^(t|true|yes|y|1)$", re.I)
+@@ -56,12 +56,12 @@ class Options:
+         for arg in argv[1:]:
+             m = _target.search(arg)
+             if m:
+-                self.target = m.groups(0)
++                self.target = m.group(1)
+                 continue
+ 
+             m = _host.search(arg)
+             if m:
+-                self.host = m.groups(0)
++                self.host = m.group(1)
+                 continue
+ 
+             if _ignore.search(arg) is not None:
new file mode 100644
--- /dev/null
+++ b/series
@@ -0,0 +1,1 @@
+cross-compile.patch