This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Try to avoid doubling the cppflags if rerun without removing config.sh
authorJarkko Hietaniemi <jhi@iki.fi>
Fri, 16 Oct 2015 12:10:40 +0000 (08:10 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Fri, 16 Oct 2015 16:19:32 +0000 (12:19 -0400)
This bug has been here since 2001, introduced by yours truly
in 58e77565.  Hasn't been too harmful, obviously.  It doubles
the cppflags only once, thankfully, unlimited doubling would
probably have been noticed earlier.

The avoidance maneuver is far from fool-proof.  To be more
fooler-proofer, some sort of order-preserving deduping would
be needed.

Configure

index e751dd9..0d7796c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -5533,7 +5533,12 @@ esac
 : the following weeds options from ccflags that are of no interest to cpp
 case "$cppflags" in
 '') cppflags="$ccflags" ;;
-*)  cppflags="$cppflags $ccflags" ;;
+*)  set X $ccflags; shift
+    case " $cppflags " in
+    *" $1 "*) ;;  # Try to avoid doubling the cppflags.
+    *) cppflags="$cppflags $ccflags" ;;
+    esac
+    ;;
 esac
 case "$gccversion" in
 1*) cppflags="$cppflags -D__GNUC__"