Bug 598261: Cannot cross compile JS on OSX. r+a=ted
authorDave Townsend <dtownsend@oxymoronical.com>
Fri, 15 Oct 2010 09:56:09 -0700
changeset 55884 f0be8a373b08854e67b95a154071360985a7de81
parent 55883 567d2e1f8f680c7affa777505c75c58b0fad78f2
child 55885 0b6940d11a43402fb315681100994ad1366a2258
push idunknown
push userunknown
push dateunknown
bugs598261
milestone2.0b8pre
Bug 598261: Cannot cross compile JS on OSX. r+a=ted
js/src/configure.in
js/src/jscpucfg.cpp
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -1590,18 +1590,16 @@ case "$host" in
         ;;
     esac
     ;;
 
 *-darwin*)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
     HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
-    LDFLAGS="$LDFLAGS -lobjc"
-    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
     ;;
 
 *-linux*|*-kfreebsd*-gnu|*-gnu*)
     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
     HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
     ;;
 
@@ -1731,17 +1729,18 @@ case "$target" in
     _PEDANTIC=
     CFLAGS="$CFLAGS -fpascal-strings -fno-common"
     CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
     DLL_SUFFIX=".dylib"
     DSO_LDOPTS=''
     STRIP="$STRIP -x -S"
     _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
     TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
-    LDFLAGS="$LDFLAGS -framework Cocoa"
+    LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
+    LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
     # The ExceptionHandling framework is needed for Objective-C exception
     # logging code in nsObjCExceptions.h. Currently we only use that in debug
     # builds.
     MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
 
     dnl DTrace and -dead_strip don't interact well. See bug 403132.
     dnl ===================================================================
     if test "x$enable_dtrace" = "xyes"; then
@@ -5466,17 +5465,17 @@ if test "$JS_HAS_CTYPES"; then
     *-mingw*)
       ac_configure_args="$ac_configure_args --build=$build --host=${target_cpu}-${target_os} HOST_CC=\"$HOST_CC\" CC=\"$CC\""
       ;;
     *-android*)
       CFLAGS="$ANDROID_CFLAGS"
       CPPFLAGS="$ANDROID_CPPFLAGS"
       LDFLAGS="$ANDROID_LDFLAGS"
 
-      export CC CPP LD CPPFLAGS CFLAGS LDFLAGS
+      export AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS CFLAGS LDFLAGS
 
       ac_configure_args="$ac_configure_args --build=$build --host=${target_cpu}-${target_os} HOST_CC=\"$HOST_CC\""
       ;;
     *)
       ac_configure_args="$ac_configure_args --build=$build --host=$target HOST_CC=\"$HOST_CC\" CC=\"$CC\""
       ;;
     esac
   fi
--- a/js/src/jscpucfg.cpp
+++ b/js/src/jscpucfg.cpp
@@ -53,17 +53,17 @@
 int main(int argc, char **argv)
 {
     printf("#ifndef js_cpucfg___\n");
     printf("#define js_cpucfg___\n\n");
 
     printf("/* AUTOMATICALLY GENERATED - DO NOT EDIT */\n\n");
 
 #ifdef CROSS_COMPILE
-#if defined(__APPLE__)
+#if defined(__APPLE__) && !defined(FORCE_BIG_ENDIAN) && !defined(FORCE_LITTLE_ENDIAN)
     /*
      * Darwin NSPR uses the same MDCPUCFG (_darwin.cfg) for multiple
      * processors, and determines which processor to configure for based
      * on compiler predefined macros.  We do the same thing here.
      */
     printf("#ifdef __LITTLE_ENDIAN__\n");
     printf("#define IS_LITTLE_ENDIAN 1\n");
     printf("#undef  IS_BIG_ENDIAN\n");