From e7586c7a671ea10004afc3d8e48718eed8c7ce26 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Tue, 29 Jun 2010 19:55:15 -0700 Subject: [PATCH] Remove last internal use of cpp and src/{m,s}/*.h files in configure.in. * configure.in (CFLAGS, REAL_CFLAGS): Set with shell, not cpp. * configure, src/config.in: Regenerate. --- ChangeLog | 3 +- configure | 137 ++++++++++++++++++-------------------------------- configure.in | 63 +++++++---------------- src/config.in | 9 ++++ 4 files changed, 76 insertions(+), 136 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c3aeec2020..d7f52eb6ed6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2010-06-30 Glenn Morris * configure.in (C_OPTIMIZE_SWITCH, CANNOT_DUMP, SYSTEM_MALLOC): - (USE_MMAP_FOR_BUFFERS, C_WARNING_SWITCH): Set with shell, not cpp. + (USE_MMAP_FOR_BUFFERS, C_WARNING_SWITCH, CFLAGS, REAL_CFLAGS): + Set with shell, not cpp. (LIBX): Remove, just use -lX11 in the one place this was used. (cannot_dump): Replace with CANNOT_DUMP. diff --git a/configure b/configure index f283e840290..686320b3622 100755 --- a/configure +++ b/configure @@ -718,7 +718,7 @@ C_SWITCH_SYSTEM UNEXEC_OBJ C_SWITCH_MACHINE LD_SWITCH_SYSTEM -cannot_dump +CANNOT_DUMP MAKEINFO GZIP_PROG INSTALL_INFO @@ -4286,14 +4286,12 @@ then CC="$NON_GNU_CC" fi -if test x$GCC = xyes && test "x$GCC_TEST_OPTIONS" != x -then - CC="$CC $GCC_TEST_OPTIONS" -fi - -if test x$GCC = x && test "x$NON_GCC_TEST_OPTIONS" != x -then - CC="$CC $NON_GCC_TEST_OPTIONS" +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 ac_ext=c @@ -5428,14 +5426,13 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -#### Extract some information from the operating system and machine files. +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"` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the machine- and system-dependent files to find out - - which libraries the lib-src programs will want, and - - whether the GNU malloc routines are usable..." >&5 -$as_echo "$as_me: checking the machine- and system-dependent files to find out - - which libraries the lib-src programs will want, and - - whether the GNU malloc routines are usable..." >&6;} ### First figure out CFLAGS (which we use for running the compiler here) ### and REAL_CFLAGS (which we use for real compilation). @@ -5447,84 +5444,29 @@ $as_echo "$as_me: checking the machine- and system-dependent files to find out ### If the CFLAGS env var is specified, we use that value ### instead of the default. -### 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 ' -#include "'${srcdir}'/src/'${opsysfile}'" -#include "'${srcdir}'/src/'${machfile}'" - -configure___ LIBX=-lX11 - -#ifdef CANNOT_DUMP -configure___ cannot_dump=yes -#else -configure___ cannot_dump=no -#endif - -#ifdef SYSTEM_MALLOC -configure___ system_malloc=yes -#else -configure___ system_malloc=no -#endif - -#ifdef USE_MMAP_FOR_BUFFERS -configure___ use_mmap_for_buffers=yes -#else -configure___ use_mmap_for_buffers=no -#endif - -#ifndef C_OPTIMIZE_SWITCH -#ifdef __GNUC__ -#define C_OPTIMIZE_SWITCH -O2 -#else -#define C_OPTIMIZE_SWITCH -O -#endif -#endif - -#ifndef C_WARNINGS_SWITCH -#define C_WARNINGS_SWITCH ${C_WARNINGS_SWITCH} -#endif - -#ifdef THIS_IS_CONFIGURE - -/* Get the CFLAGS for tests in configure. */ -#ifdef __GNUC__ -configure___ CFLAGS=-g C_OPTIMIZE_SWITCH '${SPECIFIED_CFLAGS}' -#else -configure___ CFLAGS='${SPECIFIED_CFLAGS}' -#endif - -#else /* not THIS_IS_CONFIGURE */ - -/* Get the CFLAGS for real compilation. */ -#ifdef __GNUC__ -configure___ REAL_CFLAGS=-g C_OPTIMIZE_SWITCH C_WARNINGS_SWITCH ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}' -#else -configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}' -#endif - -#endif /* not THIS_IS_CONFIGURE */ -' > ${tempcname} - -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"` -eval `${CPP} -Isrc ${tempcname} \ - | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'` if test "x$SPECIFIED_CFLAGS" = x; then - eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \ - | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'` + if test x$GCC = xyes; then + CFLAGS="-g $C_OPTIMIZE_SWITCH" + REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS" + else + CFLAGS= + REAL_CFLAGS= + fi else REAL_CFLAGS="$CFLAGS" fi -rm ${tempcname} +CANNOT_DUMP=no +case "$opsys" in + your-opsys-here) + CANNOT_DUMP=yes + +$as_echo "#define CANNOT_DUMP 1" >>confdefs.h + + ;; +esac + UNEXEC_OBJ=unexelf.o @@ -7623,7 +7565,17 @@ if test $emacs_cv_var___after_morecore_hook = no; then doug_lea_malloc=no fi + +system_malloc=no +case "$opsys" in + ## darwin ld insists on the use of malloc routines in the System framework. + darwin|sol2-10) system_malloc=yes ;; +esac + if test "${system_malloc}" = "yes"; then + +$as_echo "#define SYSTEM_MALLOC 1" >>confdefs.h + GNU_MALLOC=no GNU_MALLOC_reason=" (The GNU allocators don't work with this system configuration.)" @@ -7658,6 +7610,10 @@ if test x"${REL_ALLOC}" = x; then REL_ALLOC=${GNU_MALLOC} fi +use_mmap_for_buffers=no +case "$opsys" in + freebsd|irix6-5) use_mmap_for_buffers=yes ;; +esac @@ -7861,6 +7817,9 @@ fi rm -f conftest.mmap conftest.txt if test $use_mmap_for_buffers = yes; then + +$as_echo "#define USE_MMAP_FOR_BUFFERS 1" >>confdefs.h + REL_ALLOC=no fi @@ -8054,7 +8013,7 @@ REAL_CPPFLAGS="$CPPFLAGS" if test "${HAVE_X11}" = "yes"; then DEFS="$C_SWITCH_X_SITE $DEFS" LDFLAGS="$LDFLAGS $LD_SWITCH_X_SITE" - LIBS="$LIBX $LIBS" + LIBS="-lX11 $LIBS" CFLAGS="$C_SWITCH_X_SITE $CFLAGS" CPPFLAGS="$C_SWITCH_X_SITE $CPPFLAGS" diff --git a/configure.in b/configure.in index 6fcea08bb63..2e5ed9497b7 100644 --- a/configure.in +++ b/configure.in @@ -837,11 +837,13 @@ AC_LINK_IFELSE([main(){return 0;}], LDFLAGS=$late_LDFLAGS [AC_MSG_RESULT(no)]) -#### Extract some information from the operating system and machine files. +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"` -AC_CHECKING([the machine- and system-dependent files to find out - - which libraries the lib-src programs will want, and - - 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). @@ -853,50 +855,19 @@ AC_CHECKING([the machine- and system-dependent files to find out ### If the CFLAGS env var is specified, we use that value ### instead of the default. -### 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 ' -#include "'${srcdir}'/src/'${opsysfile}'" -#include "'${srcdir}'/src/'${machfile}'" - -#ifdef THIS_IS_CONFIGURE - -/* Get the CFLAGS for tests in configure. */ -#ifdef __GNUC__ -configure___ CFLAGS=-g ${C_OPTIMIZE_SWITCH} '${SPECIFIED_CFLAGS}' -#else -configure___ CFLAGS='${SPECIFIED_CFLAGS}' -#endif - -#else /* not THIS_IS_CONFIGURE */ - -/* Get the CFLAGS for real compilation. */ -#ifdef __GNUC__ -configure___ REAL_CFLAGS=-g ${C_OPTIMIZE_SWITCH} ${C_WARNINGS_SWITCH} ${PROFILING_CFLAGS} '${SPECIFIED_CFLAGS}' -#else -configure___ REAL_CFLAGS='${SPECIFIED_CFLAGS}' -#endif - -#endif /* not THIS_IS_CONFIGURE */ -' > ${tempcname} - -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"` -[eval `${CPP} -Isrc ${tempcname} \ - | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'` +dnl C_OPTIMIZE_SWITCH unused save for gcc, so why set it for non-gcc? +dnl Note AC_PROG_CC sets CFLAGS to -g -O2 for gcc anyway. if test "x$SPECIFIED_CFLAGS" = x; then - eval `${CPP} -Isrc -DTHIS_IS_CONFIGURE ${tempcname} \ - | sed -n -e 's/^configure___ \([^=]*=\)\(.*\)$/\1"\2"/p'` + if test x$GCC = xyes; then + CFLAGS="-g $C_OPTIMIZE_SWITCH" + REAL_CFLAGS="$CFLAGS $C_WARNINGS_SWITCH $PROFILING_CFLAGS" + else + CFLAGS= + REAL_CFLAGS= + fi else - REAL_CFLAGS="$CFLAGS" -fi] -rm ${tempcname} + REAL_CFLAGS="$CFLAGS" +fi dnl Not used by any currently supported platform. diff --git a/src/config.in b/src/config.in index ef4caf58b8c..098edeafd4a 100644 --- a/src/config.in +++ b/src/config.in @@ -30,6 +30,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if the mktime function is broken. */ #undef BROKEN_MKTIME +/* Define if Emacs cannot be dumped on your system. */ +#undef CANNOT_DUMP + /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ @@ -899,6 +902,9 @@ along with GNU Emacs. If not, see . */ /* Process async input synchronously. */ #undef SYNC_INPUT +/* Define to use system malloc. */ +#undef SYSTEM_MALLOC + /* Define to 1 if you use terminfo instead of termcap. */ #undef TERMINFO @@ -921,6 +927,9 @@ along with GNU Emacs. If not, see . */ /* Define to 1 if using the Lucid X toolkit. */ #undef USE_LUCID +/* Define to use mmap to allocate buffer text. */ +#undef USE_MMAP_FOR_BUFFERS + /* Define to 1 if using the Motif X toolkit. */ #undef USE_MOTIF -- 2.39.2