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 789166 2b7e60984fc6e2ac2e3cb164e83af6cd84df0310
parent 789165 8e86309204227eea963213cff2cec61291d0b8c5
push id108207
push userbmo:tom@mozilla.com
push dateFri, 27 Apr 2018 18:32:53 +0000
reviewersted
bugs1457162
milestone61.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])