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.
: 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__"