From b03647d3c8be357389770831d31ab255ef96617a Mon Sep 17 00:00:00 2001 From: das Date: Thu, 25 Jan 2007 02:07:29 +0000 Subject: * unix/tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to avoid errors about multiple -isysroot flags from some older gcc builds. * unix/configure: autoconf-2.59 --- ChangeLog | 8 ++++++++ unix/configure | 13 +++++++++---- unix/tcl.m4 | 16 ++++++++++++---- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1c20b7..26079d89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-01-25 Daniel Steffen + + * unix/tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and + move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to + avoid errors about multiple -isysroot flags from some older gcc builds. + + * unix/configure: autoconf-2.59 + 2007-01-19 Joe Mistachkin * win/makefile.vc: Properly build man2tcl.c for MSVC8. diff --git a/unix/configure b/unix/configure index ac93cfb..f062a2d 100755 --- a/unix/configure +++ b/unix/configure @@ -4747,7 +4747,6 @@ fi TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok - CFLAGS="${CPPFLAGS} ${CFLAGS}" CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then @@ -5644,11 +5643,14 @@ echo "${ECHO_T}$tcl_cv_ld_elf" >&6 CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, add any -isysroot and - # -mmacosx-version-min flags present in CFLAGS to CPPFLAGS: + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=1;i<=NF;i++) \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ($i~/^(isysroot|mmacosx-version-min)/) print "-"$i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!($i~/^(isysroot|mmacosx-version-min)/)) print "-"$i}'`" if test $do64bit = yes; then case `arch` in ppc) @@ -6437,6 +6439,8 @@ _ACEOF fi + + # Step 4: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. @@ -10195,6 +10199,7 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS="" : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 34b9f7a..4e90aaf 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -1113,7 +1113,6 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [ TCL_TRIM_DOTS='`echo ${VERSION} | tr -d .`' ECHO_VERSION='`echo ${VERSION}`' TCL_LIB_VERSIONS_OK=ok - CFLAGS="${CPPFLAGS} ${CFLAGS}" CFLAGS_DEBUG=-g CFLAGS_OPTIMIZE=-O if test "$GCC" = "yes" ; then @@ -1576,11 +1575,14 @@ dnl AC_CHECK_TOOL(AR, ar) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during - # preprocessing tests and compiling tests, add any -isysroot and - # -mmacosx-version-min flags present in CFLAGS to CPPFLAGS: + # preprocessing tests and compiling tests, move any -isysroot and + # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ - awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=1;i<=NF;i++) \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" + CFLAGS="`echo " ${CFLAGS}" | \ + awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ + if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" if test $do64bit = yes; then case `arch` in ppc) @@ -1962,6 +1964,12 @@ dnl AC_CHECK_TOOL(AR, ar) AC_DEFINE(TCL_CFG_DO64BIT, 1, [Is this a 64-bit build?]) fi +dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so +dnl # until the end of configure, as configure's compile and link tests use +dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's +dnl # preprocessing tests use only CPPFLAGS. + AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) + # Step 4: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, -- cgit v0.12