Patch to remove GCC3 warning:

cc1plus: warning: changing search order for system directory "/usr/include"
cc1plus: warning: as it has already been specified as a non-system directory

I've used this patch for Guile and Tcl only as these seem to be the only 2 languages that actually use system include directories.

Older versions of Perl (pre 5.8 I think) also use -I for system include directories, but the -I part is obtained from the perl configuration file, so I've added a sed to modify it.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4669 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-04-07 09:22:27 +00:00
commit ce5c416e9d

View file

@ -43,6 +43,15 @@ AC_DEFINE_UNQUOTED(SWIG_CXX, ["$CXX"], [Compiler that built SWIG])
dnl Checks for header files. dnl Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
dnl How to specify include directories that may be system directories.
# -I should not be used on system directories (GCC)
if test "$GCC" = yes; then
ISYSTEM="-isystem "
else
ISYSTEM="-I"
fi
dnl Checks for library functions. dnl Checks for library functions.
# Set info about shared libraries. # Set info about shared libraries.
@ -346,7 +355,7 @@ AC_ARG_WITH(tclconfig,[ --with-tclconfig=path Set location of tclConfig.sh],
AC_ARG_WITH(tcl,[ --with-tcl=path Set location of Tcl package],[ AC_ARG_WITH(tcl,[ --with-tcl=path Set location of Tcl package],[
TCLPACKAGE="$withval"], [TCLPACKAGE=]) TCLPACKAGE="$withval"], [TCLPACKAGE=])
AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[ AC_ARG_WITH(tclincl,[ --with-tclincl=path Set location of Tcl include directory],[
TCLINCLUDE="-I$withval"], [TCLINCLUDE=]) TCLINCLUDE="$ISYSTEM$withval"], [TCLINCLUDE=])
AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[ AC_ARG_WITH(tcllib,[ --with-tcllib=path Set location of Tcl library directory],[
TCLLIB="-L$withval"], [TCLLIB=]) TCLLIB="-L$withval"], [TCLLIB=])
@ -374,13 +383,13 @@ if test x"${TCLCONFIG}" = x ; then
else else
AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh) AC_MSG_RESULT(found $TCLCONFIG/tclConfig.sh)
. $TCLCONFIG/tclConfig.sh . $TCLCONFIG/tclConfig.sh
TCLINCLUDE=-I$TCL_PREFIX/include TCLINCLUDE=$ISYSTEM$TCL_PREFIX/include
TCLLIB=$TCL_LIB_SPEC TCLLIB=$TCL_LIB_SPEC
fi fi
if test -z "$TCLINCLUDE"; then if test -z "$TCLINCLUDE"; then
if test -n "$TCLPACKAGE"; then if test -n "$TCLPACKAGE"; then
TCLINCLUDE="-I$TCLPACKAGE/include" TCLINCLUDE="$ISYSTEM$TCLPACKAGE/include"
fi fi
fi fi
@ -398,13 +407,12 @@ if test -z "$TCLINCLUDE"; then
for i in $dirs ; do for i in $dirs ; do
if test -r $i/tcl.h; then if test -r $i/tcl.h; then
AC_MSG_RESULT($i) AC_MSG_RESULT($i)
TCLINCLUDE="-I$i" TCLINCLUDE="$ISYSTEM$i"
break break
fi fi
done done
fi fi
if test -z "$TCLINCLUDE"; then if test -z "$TCLINCLUDE"; then
# TCLINCLUDE="-I/usr/local/include"
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
fi fi
else else
@ -423,7 +431,6 @@ for i in $dirs ; do
done done
if test -z "$TCLLIB"; then if test -z "$TCLLIB"; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
# TCLLIB="-L/usr/local/lib"
fi fi
else else
AC_MSG_RESULT($TCLLIB) AC_MSG_RESULT($TCLLIB)
@ -592,7 +599,7 @@ if test -n "$PERL"; then
AC_MSG_RESULT($PERL5LIB) AC_MSG_RESULT($PERL5LIB)
fi fi
AC_MSG_CHECKING(for Perl5 compiler options) AC_MSG_CHECKING(for Perl5 compiler options)
PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}') 2>/dev/null` PERL5CCFLAGS=`($PERL -e 'use Config; print $Config{ccflags}' | sed "s/-I/$ISYSTEM/") 2>/dev/null`
if test "$PERL5CCFLAGS" = "" ; then if test "$PERL5CCFLAGS" = "" ; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
else else
@ -604,7 +611,6 @@ if test -n "$PERL"; then
fi fi
else else
AC_MSG_RESULT(could not figure out how to run perl5) AC_MSG_RESULT(could not figure out how to run perl5)
# PERL5EXT="/usr/local/lib/perl/archname/5.003/CORE"
fi fi
# Cygwin (Windows) needs the library for dynamic linking # Cygwin (Windows) needs the library for dynamic linking
@ -646,7 +652,7 @@ AC_MSG_CHECKING(for java include file jni.h)
AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=]) AC_ARG_WITH(javaincl, [ --with-javaincl=path Set location of Java include directory], [JAVAINCDIR="$withval"], [JAVAINCDIR=])
if test -z "$JAVAINCDIR"; then if test -z "$JAVAINCDIR"; then
JAVAINCDIR="/usr/j2sdk*/include /usr/local/j2sdk*/include /usr/jdk*/include /usr/local/jdk*/include /opt/j2sdk*/include /opt/jdk*/include /usr/java/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/include/kaffe /usr/local/include/kaffe /usr/include /usr/local/include" JAVAINCDIR="/usr/j2sdk*/include /usr/local/j2sdk*/include /usr/jdk*/include /usr/local/jdk*/include /opt/j2sdk*/include /opt/jdk*/include /usr/java/include /usr/local/java/include /opt/java/include /usr/include/java /usr/local/include/java /usr/include/kaffe /usr/local/include/kaffe"
# Add in default installation directory on Windows for Cygwin # Add in default installation directory on Windows for Cygwin
case $host in case $host in
@ -743,12 +749,11 @@ if test -n "$GUILE_CONFIG" ; then
for i in $dirs ; do for i in $dirs ; do
if test -r $i/guile/gh.h; then if test -r $i/guile/gh.h; then
AC_MSG_RESULT($i) AC_MSG_RESULT($i)
GUILEINCLUDE="-I$i" GUILEINCLUDE="$ISYSTEM$i"
break break
fi fi
done done
if test -z "$GUILEINCLUDE"; then if test -z "$GUILEINCLUDE"; then
# GUILEINCLUDE="-I/usr/local/include"
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
fi fi
@ -763,7 +768,6 @@ if test -n "$GUILE_CONFIG" ; then
done done
if test -z "$GUILELIB"; then if test -z "$GUILELIB"; then
AC_MSG_RESULT(not found) AC_MSG_RESULT(not found)
# GUILELIB="/usr/local/lib"
fi fi
GUILELINK="`guile-config link`" GUILELINK="`guile-config link`"