Bug 1457162 Include CFLAGS and CPPFLAGS during the EXPAND_LIBS_LIST_STYLE check r?ted draft
authorTom Ritter <tom@mozilla.com>
Thu, 26 Apr 2018 14:44:00 +0000
changeset 797534 beb54366c87c97adb04d801d6777ffa7d226c666
parent 797533 86754c40396301a6b839d01200e65a28713b54ee
push id110506
push userbmo:tom@mozilla.com
push dateSun, 20 May 2018 13:52:14 +0000
reviewersted
bugs1457162
milestone62.0a1
Bug 1457162 Include CFLAGS and CPPFLAGS during the EXPAND_LIBS_LIST_STYLE check r?ted MozReview-Commit-ID: Eu82jfRZTk4
build/autoconf/expandlibs.m4
--- a/build/autoconf/expandlibs.m4
+++ b/build/autoconf/expandlibs.m4
@@ -11,27 +11,27 @@ dnl = linker
 dnl =
 dnl ========================================================
 
 AC_CACHE_CHECK(what kind of list files are supported by the linker,
     EXPAND_LIBS_LIST_STYLE,
     [echo "int main() {return 0;}" > conftest.${ac_ext}
      if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&5) && test -s conftest.${OBJ_SUFFIX}; then
          echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
-         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
+         if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
              EXPAND_LIBS_LIST_STYLE=linkerscript
          else
              echo "conftest.${OBJ_SUFFIX}" > conftest.list
              dnl -filelist is for the OS X linker.  We need to try -filelist
              dnl first because clang understands @file, but may pass an
              dnl oversized argument list to the linker depending on the
              dnl contents of @file.
-             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
+             if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS [-Wl,-filelist,conftest.list] $LIBS 1>&5) && test -s conftest${ac_exeext}; then
                  EXPAND_LIBS_LIST_STYLE=filelist
-             elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
+             elif AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS @conftest.list $LIBS 1>&5) && test -s conftest${ac_exeext}; then
                  EXPAND_LIBS_LIST_STYLE=list
              else
                  EXPAND_LIBS_LIST_STYLE=none
              fi
          fi
      else
          dnl We really don't expect to get here, but just in case
          AC_ERROR([couldn't compile a simple C file])