changeset 7965:a563319a7968

Get CFLAGS both with and without THIS_IS_CONFIGURE, for two different uses.
author Richard M. Stallman <rms@gnu.org>
date Sun, 19 Jun 1994 15:40:27 +0000
parents 613f7a7d5778
children 76118755a179
files configure1.in
diffstat 1 files changed, 26 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/configure1.in	Sun Jun 19 15:24:14 1994 +0000
+++ b/configure1.in	Sun Jun 19 15:40:27 1994 +0000
@@ -1323,13 +1323,19 @@
 echo " - which libraries the lib-src programs will want, and"
 echo " - whether the GNU malloc routines are usable."
 
+### First figure out CFLAGS (which we use for running the compiler here)
+### and REAL_CFLAGS (which we use for real compilation).
+### The two are the same except on a few systems, where they are made
+### different to work around various lossages.  For example,
+### GCC 2.5 on Linux needs them to be different because it treats -g
+### as implying static linking.
+
 ### It's not important that this name contain the PID; you can't run
 ### two configures in the same directory and have anything work
 ### anyway.
 tempcname="conftest.c"
 
 echo '
-#define THIS_IS_CONFIGURE
 #include "'${srcdir}'/src/'${opsysfile}'"
 #include "'${srcdir}'/src/'${machfile}'"
 #ifndef LIBS_MACHINE
@@ -1381,11 +1387,25 @@
 #define C_OPTIMIZE_SWITCH -O
 #endif
 
+#ifdef THIS_IS_CONFIGURE
+
+/* Get the CFLAGS for tests in configure.  */
 #ifdef __GNUC__
 configure___ CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
 #else
 configure___ CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
 #endif
+
+#else /* not THIS_IS_CONFIGURE */
+
+/* Get the CFLAGS for real compilation.  */
+#ifdef __GNUC__
+configure___ REAL_CFLAGS=C_DEBUG_SWITCH C_OPTIMIZE_SWITCH '${CFLAGS}'
+#else
+configure___ REAL_CFLAGS=C_DEBUG_SWITCH '${CFLAGS}'
+#endif
+
+#endif /* not THIS_IS_CONFIGURE */
 ' > ${tempcname}
 # The value of CPP is a quoted variable reference, so we need to do this
 # to get its actual value...
@@ -1393,6 +1413,9 @@
 eval `${CPP} -Isrc ${tempcname} \
        | grep 'configure___' \
        | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'`
+eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \
+       | grep 'configure___' \
+       | sed -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/'`
 rm ${tempcname}
 
 ### Compute the unexec source name from the object name.
@@ -1437,7 +1460,6 @@
 
 # We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
 # for the tests that follow.
-orig_cflags="$CFLAGS"
 
 if test "${HAVE_X11}" = "yes"; then
   DEFS="$C_SWITCH_X_SITE $DEFS"
@@ -1478,8 +1500,8 @@
   AC_DEFINE(HAVE_INET_SOCKETS)
 fi
 
-# Restore the original CFLAGS value.
-CFLAGS="$orig_cflags"
+# Set up the CFLAGS for real compilation, so we can substitute it.
+CFLAGS="$REAL_CFLAGS"
 
 [
 #### Find out which version of Emacs this is.