diff configure.in @ 109359:b7e047772c64

Properly handle C_WARNINGS_SWITCH, PROFILING_CFLAGS, PROFILING_LDFLAGS * configure.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) (PROFILING_LDFLAGS): Substitute, don't add them to CFLAGS/LDFLAGS. (C_OPTIMIZE_SWITCH): Remove. (TEMACS_LDFLAGS2): Add ${PROFILING_LDFLAGS}. * lib-src/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) (PROFILING_LDFLAGS): Set from substitution. (BASE_CFLAGS): Add ${C_WARNINGS_SWITCH}. (ALL_CFLAGS, CPP_CFLAGS): Add ${PROFILING_CFLAGS}. (LINK_CFLAGS): Add ${PROFILING_LDFLAGS}. * lwlib/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS): Set from substitution. (ALL_CFLAGS): Add ${C_WARNINGS_SWITCH} and ${PROFILING_CFLAGS}. * oldXMenu/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS): Set from substitution. (ALL_CFLAGS): Add ${C_WARNINGS_SWITCH} and ${PROFILING_CFLAGS}. * src/Makefile.in (C_WARNINGS_SWITCH, PROFILING_CFLAGS) (PROFILING_LDFLAGS): Set from substitution. (ALL_CFLAGS): Add C_WARNINGS_SWITCH and PROFILING_CFLAGS, put CFLAGS last.
author Andreas Schwab <schwab@linux-m68k.org>
date Mon, 12 Jul 2010 16:16:38 +0200
parents 8f3464b85afb
children 9bc9a6ac1dd8
line wrap: on
line diff
--- a/configure.in	Mon Jul 12 12:22:20 2010 +0300
+++ b/configure.in	Mon Jul 12 16:16:38 2010 +0200
@@ -327,6 +327,8 @@
    PROFILING_CFLAGS=
    PROFILING_LDFLAGS=
 fi
+AC_SUBST(PROFILING_CFLAGS)
+AC_SUBST(PROFILING_LDFLAGS)
 
 AC_ARG_ENABLE(autodepend,
 [AS_HELP_STRING([--enable-autodepend],
@@ -720,14 +722,6 @@
   CC="$NON_GNU_CC"
 fi
 
-if test x$GCC = xyes; then
-  C_OPTIMIZE_SWITCH=-O2
-  test "x$GCC_TEST_OPTIONS" != x && CC="$CC $GCC_TEST_OPTIONS"
-else
-  C_OPTIMIZE_SWITCH=-O
-  test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
-fi
-
 dnl checks for Unix variants
 AC_USE_SYSTEM_EXTENSIONS
 
@@ -770,6 +764,7 @@
 CFLAGS="$SAVE_CFLAGS"
 unset has_option
 unset SAVE_CFLAGS
+AC_SUBST(C_WARNINGS_SWITCH)
 
 
 #### Some other nice autoconf tests.
@@ -861,35 +856,12 @@
   LDFLAGS=$late_LDFLAGS
   [AC_MSG_RESULT(no)])
 
-LDFLAGS="${LDFLAGS} ${PROFILING_LDFLAGS}"
-
 
 # The value of CPP is a quoted variable reference, so we need to do this
 # to get its actual value...
 CPP=`eval "echo $CPP"`
 
 
-### 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 when using GCC where we might use
-### extra warning and profiling flags.
-
-### If the CFLAGS env var is specified, we use that value
-### instead of the default.
-
-dnl Note AC_PROG_CC sets CFLAGS to -g -O2 for gcc anyway.
-if test "x$SPECIFIED_CFLAGS" = x; then
-  CFLAGS="-g $C_OPTIMIZE_SWITCH"
-  if test x$GCC = xyes; then
-    REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS"
-  else
-    REAL_CFLAGS="$CFLAGS"
-  fi
-else
-  REAL_CFLAGS="$CFLAGS"
-fi
-
-
 dnl Not used by any currently supported platform.
 dnl The function dump-emacs will not be defined and temacs will do
 dnl (load "loadup") automatically unless told otherwise.
@@ -1497,7 +1469,7 @@
 tmp_CFLAGS="$CFLAGS"
 CPPFLAGS="$CPPFLAGS -x objective-c"
 CFLAGS="$CFLAGS -x objective-c"
-TEMACS_LDFLAGS2="\${LDFLAGS}"
+TEMACS_LDFLAGS2="\${LDFLAGS} \${PROFILING_LDFLAGS}"
 dnl I don't think it's especially important, but src/Makefile.in
 dnl (now the only user of ns_appdir) used to go to the trouble of adding a
 dnl trailing "/" to it, so now we do it here.
@@ -1526,7 +1498,6 @@
        GNUSTEP_LOCAL_LIBRARIES="-L${GNUSTEP_LOCAL_LIBRARIES}"
      CPPFLAGS="$CPPFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
      CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
-     REAL_CFLAGS="$REAL_CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
      LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
      LIB_STANDARD=
      START_FILES=
@@ -1732,6 +1703,7 @@
 # used for the tests that follow.  We set them back to REAL_CFLAGS and
 # REAL_CPPFLAGS later on.
 
+REAL_CFLAGS="$CFLAGS"
 REAL_CPPFLAGS="$CPPFLAGS"
 
 if test "${HAVE_X11}" = "yes"; then