diff --git a/AUTHORS b/AUTHORS index 99da03ab11..cdf267e5cf 100644 --- a/AUTHORS +++ b/AUTHORS @@ -184,6 +184,7 @@ Alessandro Seveso messages Italian translations Mike Simons misc configure.in patches Keld Simonsen messages Danish translation Richard Skelton for Solaris cleanup +Thomas Vander Stichele Macro for filtering system directories Henning Spruth for German text & euro date rework Ben Stanley test infrastructure Robby Stephenson register & file history patches diff --git a/ChangeLog b/ChangeLog index 9da691c2c1..28a7c0f1b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-11-17 David Hampton + + * macros/as-scrub-include.m4: New macro. + + * configure.in: Use the new AS_SCRUB_INCLUDE macro to remove + system directories from the compile search path. Prevents GCC 3.x + from complaining. + 2002-11-17 Christian Stimming * src/import-export/hbci/gnc-hbci-utils.c: Fix caching of HBCI_API diff --git a/configure.in b/configure.in index ac64e3445f..c7b0d76b0e 100644 --- a/configure.in +++ b/configure.in @@ -140,6 +140,7 @@ esac ### the Gnome check?) GNOME_CHECK_GUILE +AS_SCRUB_INCLUDE(GUILE_INCS) ### -------------------------------------------------------------------------- ### G-wrap (libraries and executable) @@ -185,6 +186,8 @@ AC_SUBST(G_WRAP_LINK_ARGS) AC_SUBST(G_WRAP_MODULE_DIR) AC_SUBST(G_WRAP_LIB_DIR) +AS_SCRUB_INCLUDE(CFLAGS) + ### Check size of long_long - some guile's are broken. AC_MSG_CHECKING(if guile long_long is at least as big as gint64) GNC_OLDCFLAGS="$CFLAGS" @@ -710,6 +713,8 @@ then AC_MSG_WARN([****** ghttp does not have SSL support.]), $GHTTP_LIBS) + AS_SCRUB_INCLUDE(GHTTP_CFLAGS) + AS_SCRUB_INCLUDE(GTKHTML_CFLAGS) AC_SUBST(GTKHTML_LIBS) AC_SUBST(GTKHTML_CFLAGS) AC_SUBST(GHTTP_LIBS) @@ -767,6 +772,7 @@ then GUPPI_LIBS=`$GNOME_CONFIG --libs libguppi` GUPPI_CFLAGS=`$GNOME_CONFIG --cflags libguppi` LIBGUPPI_CHECK + AS_SCRUB_INCLUDE(GUPPI_CFLAGS) AC_SUBST(GUPPI_LIBS) AC_SUBST(GUPPI_CFLAGS) diff --git a/macros/as-scrub-include.m4 b/macros/as-scrub-include.m4 new file mode 100644 index 0000000000..f559ee8798 --- /dev/null +++ b/macros/as-scrub-include.m4 @@ -0,0 +1,33 @@ +dnl as-scrub-include.m4 0.0.1 +dnl autostars m4 macro for scrubbing CFLAGS of system include dirs +dnl because gcc 3.x complains about including system including dirs +dnl +dnl thomas@apestaart.org +dnl +dnl This macro uses output of cpp -v and expects it to contain text that +dnl looks a little bit like this: +dnl #include <...> search starts here: +dnl /usr/local/include +dnl /usr/lib/gcc-lib/i386-redhat-linux/3.2/include +dnl /usr/include +dnl End of search list. + +dnl AS_SCRUB_INCLUDE(VAR) +dnl example +dnl AS_SCRUB_INCLUDE(CFLAGS) +dnl will remove all system include dirs from the given CFLAGS + +AC_DEFUN(AS_SCRUB_INCLUDE, +[ + GIVEN_CFLAGS=$[$1] + INCLUDE_DIRS=`echo | cpp -v 2>&1` + + dnl remove everything from this output between the "starts here" and "End of" + dnl line + INCLUDE_DIRS=`echo $INCLUDE_DIRS | sed -e 's/.*<...> search starts here://' | sed -e 's/End of search list.*//'` + for dir in $INCLUDE_DIRS; do + command="sed -e s#-I$dir##" + GIVEN_CFLAGS=`echo $GIVEN_CFLAGS | $command` + done + [$1]=$GIVEN_CFLAGS +])