Configure locincpth vs Jaguar gcc 3
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 9 Sep 2002 00:07:46 +0000 (03:07 +0300)
committerhv <hv@crypt.org>
Mon, 9 Sep 2002 09:23:53 +0000 (09:23 +0000)
Message-ID: <20020908210746.GB4136@lyta.hut.fi>

p4raw-id: //depot/perl@17879

Configure

index 00fcdd5..19f71f7 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -3853,14 +3853,17 @@ case "$ccname" in
 '') ccname="$cc" ;;
 esac
 
-# gcc 3.1 complains about adding -Idirectories that it already knows about,
+# gcc 3.* complain about adding -Idirectories that they already know about,
 # so we will take those off from locincpth.
 case "$gccversion" in
 3*)
     echo "main(){}">try.c
-    for incdir in `$cc -v -c try.c 2>&1 | \
-       sed '1,/^#include <\.\.\.>/d;/^End of search list/,$d;s/^ //'` ; do
-       locincpth=`echo $locincpth | sed s!$incdir!!`
+    for incdir in $locincpth; do
+       warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
+             grep '^cc1: warning: changing search order '`
+       if test "X$warn" != X; then
+           locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
+       fi
     done
     $rm -f try try.*
 esac