[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GUILE_CFLAGS contains warning options
From: |
Bruno Haible |
Subject: |
Re: GUILE_CFLAGS contains warning options |
Date: |
Sun, 27 Feb 2011 22:59:52 +0100 |
User-agent: |
KMail/1.9.9 |
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>
- GUILE_CFLAGS contains warning options, Bruno Haible, 2011/02/19
- Re: GUILE_CFLAGS contains warning options, Bruno Haible, 2011/02/19
- Re: GUILE_CFLAGS contains warning options, Andy Wingo, 2011/02/20
- Re: GUILE_CFLAGS contains warning options, Bruno Haible, 2011/02/20
- Re: GUILE_CFLAGS contains warning options, Ken Raeburn, 2011/02/20
- Re: GUILE_CFLAGS contains warning options, Ludovic Courtès, 2011/02/22
- Re: GUILE_CFLAGS contains warning options, Bruno Haible, 2011/02/22
- Re: GUILE_CFLAGS contains warning options, Ludovic Courtès, 2011/02/23
- Re: GUILE_CFLAGS contains warning options, Bruno Haible, 2011/02/23
- Re: GUILE_CFLAGS contains warning options, Ludovic Courtès, 2011/02/27
- Re: GUILE_CFLAGS contains warning options,
Bruno Haible <=
- Re: GUILE_CFLAGS contains warning options, Ludovic Courtès, 2011/02/27