# HG changeset patch # User John W. Eaton # Date 1424740205 18000 # Node ID d3dcc62512d786d89042c2014bbf227d1cd3dcc3 # Parent 8aa2fc37650aba1179075b8b276db542b3cc033a do a better job of saving and restoring compiler flags (bug #44353) * configure.ac: Save and restore configure flags after AC_PROG_CXX, AC_PROG_CC, and friends. diff -r 8aa2fc37650a -r d3dcc62512d7 configure.ac --- a/configure.ac Mon Feb 23 12:48:23 2015 -0500 +++ b/configure.ac Mon Feb 23 20:10:05 2015 -0500 @@ -305,17 +305,6 @@ AC_DEFINE(__NO_MATH_INLINES, 1, [Define to 1 if your version of GNU libc has buggy inline assembly code for math functions like exp.]) -## Save and restore CFLAGS, CXXFLAGS, and FFLAGS globally. These variables -## are for users, so we shouldn't be touching them. Instead, we should set -## the corresponding AM_ flags (currently by way of the XTRA_ variables). -## However, for the duration of the configure script, we may set CFLAGS, -## CXXFLAGS, or FFLAGS so that subsequent tests succeed. Temporary -## settings like this are currently done for pthreads and openmp, for -## example. -octave_configure_save_CFLAGS="$CFLAGS" -octave_configure_save_CXXFLAGS="$CXXFLAGS" -octave_configure_save_FFLAGS="$FFLAGS" - ### Determine which C++ compiler to use (we expect to find g++). AC_PROG_CXX @@ -327,6 +316,17 @@ AC_PROG_CPP AC_PROG_GCC_TRADITIONAL +## Save and restore CFLAGS, CXXFLAGS, and FFLAGS globally. These variables +## are for users, so we shouldn't be touching them. Instead, we should set +## the corresponding AM_ flags (currently by way of the XTRA_ variables). +## However, for the duration of the configure script, we may set CFLAGS, +## CXXFLAGS, or FFLAGS so that subsequent tests succeed. Temporary +## settings like this are currently done for pthreads and openmp, for +## example. +original_octave_configure_CFLAGS="$CFLAGS" +original_octave_configure_CXXFLAGS="$CXXFLAGS" +original_octave_configure_FFLAGS="$FFLAGS" + ## Check for MSVC have_msvc=no case $host_os in @@ -2967,9 +2967,9 @@ AC_SUBST(QT_LDFLAGS) AC_SUBST(QT_LIBS) -CFLAGS="$octave_configure_save_CFLAGS" -CXXFLAGS="$octave_configure_save_CXXFLAGS" -FFLAGS="$octave_configure_save_FFLAGS" +CFLAGS="$original_octave_configure_CFLAGS" +CXXFLAGS="$original_octave_configure_CXXFLAGS" +FFLAGS="$original_octave_configure_FFLAGS" AH_BOTTOM([#include "oct-conf-post.h"])