Bug 1283678 - pass variables to libffi's subconfigure directly rather than exporting them; r=glandium
authorNathan Froyd <froydnj@gmail.com>
Mon, 04 Jul 2016 16:24:40 -0700
changeset 303605 879d2cba0b039b517fa7f65e63b14a08b942cab1
parent 303604 441bc43054900d751b43870a3d0f6f7ccab4317e
child 303606 fb45e03a6c2e916025b177e4bf421ecaf05525a6
push id79129
push userjgilbert@mozilla.com
push dateTue, 05 Jul 2016 05:26:18 +0000
treeherdermozilla-inbound@879d2cba0b03 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1283678
milestone50.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 1283678 - pass variables to libffi's subconfigure directly rather than exporting them; r=glandium MozReview-Commit-ID: C0m0rURELqf
build/autoconf/ffi.m4
--- a/build/autoconf/ffi.m4
+++ b/build/autoconf/ffi.m4
@@ -38,20 +38,24 @@ if test "$MOZ_BUILD_APP" != js -o -n "$J
       ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
     done
     old_cflags="$CFLAGS"
     # The libffi sources (especially the ARM ones) are written expecting gas
     # syntax, and clang's integrated assembler doesn't handle all of gas syntax.
     if test -n "$CLANG_CC" -a "$CPU_ARCH" = arm; then
       CFLAGS="-no-integrated-as $CFLAGS"
     fi
+    ac_configure_args="$ac_configure_args --build=$build --host=$target"
     if test "$CROSS_COMPILE"; then
-      export CPPFLAGS CFLAGS LDFLAGS
+      ac_configure_args="$ac_configure_args \
+                         CFLAGS=\"$CFLAGS\" \
+                         CPPFLAGS=\"$CPPFLAGS\" \
+                         LDFLAGS=\"$LDFLAGS\""
     fi
-    ac_configure_args="$ac_configure_args --build=$build --host=$target"
+    CFLAGS="$old_cflags"
     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=\"$CC -nologo -EP\" \
                          CXXCPP=\"$CXX -nologo -EP\" SHELL=sh.exe"
       flags=
@@ -78,14 +82,13 @@ if test "$MOZ_BUILD_APP" != js -o -n "$J
 
     # Use a separate cache file for libffi, since it does things differently
     # from our configure.
     old_config_files=$CONFIG_FILES
     unset CONFIG_FILES
     AC_OUTPUT_SUBDIRS(js/src/ctypes/libffi)
     ac_configure_args="$_SUBDIR_CONFIG_ARGS"
     CONFIG_FILES=$old_config_files
-    CFLAGS="$old_cflags"
   fi
 
 fi
 ])