Bug 674647 - Fix mozconfig.leopard for machines without universal IDL builds.
authorRafael Ávila de Espíndola <respindola@mozilla.com>
Wed, 24 Aug 2011 13:42:20 -0400
changeset 75807 45bce33d2bd7001fe0bb53ead42a4ecc6752d9b1
parent 75806 22e2f80c2983978e9d2a6ef5b131bc75e8913263
child 75808 cc68eeea347f4aeb411b39ea6e80b96db9c6728d
push id1453
push userrespindola@mozilla.com
push dateWed, 24 Aug 2011 17:43:10 +0000
treeherdermozilla-inbound@45bce33d2bd7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs674647
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 674647 - Fix mozconfig.leopard for machines without universal IDL builds. Our 10.6 bots only have a 64 bit version of IDL, so we have to do a cross compile when targeting a 32 bit 10.5. DONTBUILD
build/macosx/mozconfig.leopard
--- a/build/macosx/mozconfig.leopard
+++ b/build/macosx/mozconfig.leopard
@@ -1,15 +1,36 @@
 if test -z "$CC" ; then
    CC=gcc-4.2
 fi
 
 if test -z "$CXX" ; then
    CXX=g++-4.2
 fi
 
+# Mac builds don't nomally have to be handled as cross
+# compilation, but some of the libraries on the bots
+# (IDL for example) are built only for one arch.
+
+HOST_CC=$CC
+HOST_CXX=$CXX
+
+# These must be set for cross builds, and don't hurt straight builds.
+RANLIB=ranlib
+AR=ar
+AS=$CC
+LD=ld
+STRIP="strip -x -S"
+
 # We do 32 bit builds for leopard
-CC="$CC -arch i386"
-CXX="$CXX -arch i386"
+TARGET_CPU=i386
+CC="$CC -arch $TARGET_CPU"
+CXX="$CXX -arch $TARGET_CPU"
+
+NATIVE_CPU=`$topsrcdir/build/autoconf/config.guess | cut -f1 -d-`
+
+if test "$NATIVE_CPU" != "$TARGET_CPU" ; then
+  CROSS_COMPILE=1
+fi
 
 # Note, the version (10) is used by libffi's configure.
 ac_add_options --target=i386-apple-darwin10
 ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.5.sdk