[Mesa-dev] [PATCH 1/2] configure: Keep track of user compiler/linker flags, but don't restore
Dan Nicholson
dbn.lists at gmail.com
Mon Jan 7 05:15:39 PST 2013
Since mesa occasionally alters the users's compiler and linker flags, it's
useful to keep track of their original settings so the user's intentions are
respected. However, since mesa may alter the variables with settings required
for the build, they should not be restored to their original settings.
Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
---
configure.ac | 21 +++++++++------------
1 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1414ce8..eebfef8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,15 @@ dnl http://people.gnome.org/~walters/docs/build-api.txt
dnl We don't support srcdir != builddir.
echo \#buildapi-variable-no-builddir >/dev/null
+dnl Keep track of user's compiler/linker flags so we know their original
+dnl settings in case we need to alter the variables.
+_USER_CFLAGS=$CFLAGS
+_USER_CXXFLAGS=$CXXFLAGS
+_USER_CFLAGS_FOR_BUILD=$CFLAGS_FOR_BUILD
+_USER_CXXFLAGS_FOR_BUILD=$CXXFLAGS_FOR_BUILD
+_USER_LDFLAGS=$LDFLAGS
+_USER_CPPFLAGS=$CPPFLAGS
+
# Support silent build rules, requires at least automake-1.11. Disable
# by either passing --disable-silent-rules to configure or passing V=1
# to make
@@ -153,10 +162,6 @@ dnl LIB_DIR - library basename
LIB_DIR=`echo $libdir | $SED 's%.*/%%'`
AC_SUBST([LIB_DIR])
-dnl Cache LDFLAGS and CPPFLAGS so we can add to them and restore later
-_SAVE_LDFLAGS="$LDFLAGS"
-_SAVE_CPPFLAGS="$CPPFLAGS"
-
dnl build host compiler macros
DEFINES_FOR_BUILD=""
AC_SUBST([DEFINES_FOR_BUILD])
@@ -1962,14 +1967,6 @@ AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&
dnl prepend CORE_DIRS to SRC_DIRS
SRC_DIRS="$CORE_DIRS $SRC_DIRS"
-dnl Restore LDFLAGS and CPPFLAGS
-LDFLAGS="$_SAVE_LDFLAGS"
-CPPFLAGS="$_SAVE_CPPFLAGS"
-
-dnl Add user CFLAGS and CXXFLAGS
-CFLAGS="$CFLAGS $USER_CFLAGS"
-CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
-
dnl Substitute the config
AC_CONFIG_FILES([configs/current
Makefile
--
1.7.7.6
More information about the mesa-dev
mailing list