Bug 1283678 - Reset CFLAGS ASAP. - r=glandium draft
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 30 Jun 2016 17:36:23 -0700
changeset 383172 058b88b33eba720fd78440a563d7d4dd22c8d995
parent 382798 82e1f1b9c0559f38a8460e2f2f3044de4c7712d6
child 524418 09a96d2f50dd2fd3a025721fa8a7974cef43d5bb
push id21962
push userbmo:jgilbert@mozilla.com
push dateFri, 01 Jul 2016 19:29:42 +0000
reviewersglandium
bugs1283678
milestone50.0a1
Bug 1283678 - Reset CFLAGS ASAP. - r=glandium MozReview-Commit-ID: CivgCiwuZRI
build/autoconf/ffi.m4
--- a/build/autoconf/ffi.m4
+++ b/build/autoconf/ffi.m4
@@ -32,25 +32,28 @@ if test "$MOZ_BUILD_APP" != js -o -n "$J
       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
+
     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
     if test "$CROSS_COMPILE"; then
       export CPPFLAGS CFLAGS LDFLAGS
     fi
+    CFLAGS="$old_cflags"
+
     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=\"$CC -nologo -EP\" \
                          CXXCPP=\"$CXX -nologo -EP\" SHELL=sh.exe"
@@ -78,14 +81,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
 ])