Bug 969164 - Move libffi subconfigure invocation in build/autoconf/ffi.m4. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 11 Feb 2014 10:37:47 +0900
changeset 167967 c13cfe6108e5a77505d74ed73520e3832d601df0
parent 167966 46f8c871942ce6714ef55fb69a6ec37bd0709c1d
child 167968 ff614668cec33023bca622859a01594ea499d080
push id39611
push usermh@glandium.org
push dateTue, 11 Feb 2014 01:41:03 +0000
treeherdermozilla-inbound@4e3b435b7d39 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs969164
milestone30.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 969164 - Move libffi subconfigure invocation in build/autoconf/ffi.m4. r=gps
build/autoconf/ffi.m4
js/src/configure.in
--- a/build/autoconf/ffi.m4
+++ b/build/autoconf/ffi.m4
@@ -16,8 +16,73 @@ if test -n "$MOZ_NATIVE_FFI"; then
     else
         PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
     fi
 fi
 
 AC_SUBST(MOZ_NATIVE_FFI)
 
 ])
+
+AC_DEFUN([MOZ_SUBCONFIGURE_FFI], [
+if test "$BUILD_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
+  # Run the libffi 'configure' script.
+  ac_configure_args="--disable-shared --enable-static --disable-raw-api"
+  if test "$MOZ_DEBUG"; then
+    ac_configure_args="$ac_configure_args --enable-debug"
+  fi
+  if test "$DSO_PIC_CFLAGS"; then
+    ac_configure_args="$ac_configure_args --with-pic"
+  fi
+  for var in AS CC CXX CPP LD AR RANLIB STRIP; do
+    ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
+  done
+  if test "$CROSS_COMPILE"; then
+    export CPPFLAGS CFLAGS LDFLAGS
+  fi
+  ac_configure_args="$ac_configure_args --build=$build --host=$target"
+  if test "$_MSC_VER"; then
+    # Use a wrapper script for cl and ml that looks more like gcc.
+    # autotools can't quite handle an MSVC build environment yet.
+    LDFLAGS=
+    CFLAGS=
+    ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
+    case "${target_cpu}" in
+    x86_64)
+      # Need target since MSYS tools into mozilla-build may be 32bit
+      ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\""
+      ;;
+    *)
+      ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh"
+      ;;
+    esac
+  fi
+  if test "$SOLARIS_SUNPRO_CC"; then
+    # Always use gcc for libffi on Solaris
+    if test ! "$HAVE_64BIT_OS"; then
+      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m32 LD= LDFLAGS="
+    else
+      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m64 LD= LDFLAGS="
+    fi
+  fi
+  if test "$AIX_IBM_XLC"; then
+    # Always use gcc for libffi on IBM AIX5/AIX6
+    if test ! "$HAVE_64BIT_OS"; then
+      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix32"
+    else
+      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix64"
+    fi
+  fi
+
+  # Use a separate cache file for libffi, since it does things differently
+  # from our configure.
+  mkdir -p $_objdir/js/src/ctypes/libffi
+  old_cache_file=$cache_file
+  cache_file=$_objdir/js/src/ctypes/libffi/config.cache
+  old_config_files=$CONFIG_FILES
+  unset CONFIG_FILES
+  AC_OUTPUT_SUBDIRS(js/src/ctypes/libffi)
+  cache_file=$old_cache_file
+  ac_configure_args="$_SUBDIR_CONFIG_ARGS"
+  CONFIG_FILES=$old_config_files
+fi
+])
+
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -3801,18 +3801,19 @@ dnl =
 dnl ========================================================
 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
 
 dnl ========================================================
 dnl = Build jsctypes if it's enabled
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(ctypes,
 [  --enable-ctypes         Enable js-ctypes (default=no)],
-    JS_HAS_CTYPES=1,
-    JS_HAS_CTYPES= )
+    BUILD_CTYPES=1,
+    BUILD_CTYPES= )
+JS_HAS_CTYPES=$BUILD_CTYPES
 AC_SUBST(JS_HAS_CTYPES)
 if test "$JS_HAS_CTYPES"; then
   dnl Error out if we're on MSVC and MASM is unavailable.
   if test -n "$_MSC_VER" -a \( "$AS" != "ml.exe" -a "$AS" != "ml64.exe" \); then
     AC_MSG_ERROR([\"$AS\" is not a suitable assembler to build js-ctypes. If you are building with MS Visual Studio 8 Express, you may download the MASM 8.0 package, upgrade to Visual Studio 9 Express, or install the Vista SDK. Or do not use --enable-ctypes.])
   fi
   AC_DEFINE(JS_HAS_CTYPES)
 fi
@@ -4302,70 +4303,9 @@ fi
 AC_SUBST(JS_LIBRARY_NAME)
 AC_SUBST(JS_CONFIG_MOZ_JS_LIBS)
 AC_SUBST(JS_CONFIG_LIBS)
 
 dnl Spit out some output
 dnl ========================================================
 AC_OUTPUT()
 
-# Build jsctypes if it's enabled.
-if test "$JS_HAS_CTYPES" -a -z "$MOZ_NATIVE_FFI"; then
-  # Run the libffi 'configure' script.
-  ac_configure_args="--disable-shared --enable-static --disable-raw-api"
-  if test "$MOZ_DEBUG"; then
-    ac_configure_args="$ac_configure_args --enable-debug"
-  fi
-  if test "$DSO_PIC_CFLAGS"; then
-    ac_configure_args="$ac_configure_args --with-pic"
-  fi
-  for var in AS CC CXX CPP LD AR RANLIB STRIP; do
-    ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
-  done
-  if test "$CROSS_COMPILE"; then
-    export CPPFLAGS CFLAGS LDFLAGS
-  fi
-  ac_configure_args="$ac_configure_args --build=$build --host=$target"
-  if test "$_MSC_VER"; then
-    # Use a wrapper script for cl and ml that looks more like gcc.
-    # autotools can't quite handle an MSVC build environment yet.
-    LDFLAGS=
-    CFLAGS=
-    ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
-    case "${target_cpu}" in
-    x86_64)
-      # Need target since MSYS tools into mozilla-build may be 32bit
-      ac_configure_args="$ac_configure_args CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64\""
-      ;;
-    *)
-      ac_configure_args="$ac_configure_args CC=$_topsrcdir/js/src/ctypes/libffi/msvcc.sh"
-      ;;
-    esac
-  fi
-  if test "$SOLARIS_SUNPRO_CC"; then
-    # Always use gcc for libffi on Solaris
-    if test ! "$HAVE_64BIT_OS"; then
-      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m32 LD= LDFLAGS="
-    else
-      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-m64 LD= LDFLAGS="
-    fi
-  fi
-  if test "$AIX_IBM_XLC"; then
-    # Always use gcc for libffi on IBM AIX5/AIX6
-    if test ! "$HAVE_64BIT_OS"; then
-      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix32"
-    else
-      ac_configure_args="$ac_configure_args CC=gcc CFLAGS=-maix64"
-    fi
-  fi
-
-  # Use a separate cache file for libffi, since it does things differently
-  # from our configure.
-  mkdir -p $_objdir/js/src/ctypes/libffi
-  old_cache_file=$cache_file
-  cache_file=$_objdir/js/src/ctypes/libffi/config.cache
-  old_config_files=$CONFIG_FILES
-  unset CONFIG_FILES
-  AC_OUTPUT_SUBDIRS(js/src/ctypes/libffi)
-  cache_file=$old_cache_file
-  ac_configure_args="$_SUBDIR_CONFIG_ARGS"
-  CONFIG_FILES=$old_config_files
-fi
+MOZ_SUBCONFIGURE_FFI()