Hello Ludo',
> I’ll commit the patch below:
Thanks; this is what I was aiming at.
But the patch contains two small mistakes:
1) In this line
for flag in "$CPPFLAGS"
you should not use double-quotes, because the intent is to do word-splitting
on the contents of $CPPFLAGS.
See:
$ CPPFLAGS="-I/opt/local/include -Wall"
$ for flag in "$CPPFLAGS"; do echo $flag; done
-I/opt/local/include -Wall
$ for flag in $CPPFLAGS; do echo $flag; done
-I/opt/local/include
-Wall
2) Include options can also written with whitespace after the -I:
-I/somedir is equivalent to -I /somedir
To take this into account, rewrite the loop like this:
next_is_includedir=false
for flag in $CPPFLAGS
do
if $next_is_includedir; then
GUILE_CFLAGS="$GUILE_CFLAGS -I $flag"
next_is_includedir=false
else
case "$flag" in
-I) next_is_includedir=true;;
-I*) GUILE_CFLAGS="$GUILE_CFLAGS $flag";;
*) ;;
esac
fi
done
Bruno
--
In memoriam Hedwig Burgheim <http://de.wikipedia.org/wiki/Hedwig_Burgheim>