changeset 19839:d3dcc62512d7

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.
author John W. Eaton <jwe@octave.org>
date Mon, 23 Feb 2015 20:10:05 -0500
parents 8aa2fc37650a
children 4006a7377a19
files configure.ac
diffstat 1 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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"])