configure: Append extra cflags and ldflags
PATCH 1/1 configure: Append extra cflags and ldflags
In order to allow overriding flags that are set by configure, we have to append them instead of prepending as it is done so far.
---
configure | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
configure +4 -4
@@ -380,9 +380,9 @@ for opt do ;; --install=*) install="$optarg" ;; - --extra-cflags=*) CFLAGS="$optarg" + --extra-cflags=*) EXTRA_CFLAGS="$optarg" ;; - --extra-ldflags=*) LDFLAGS="$optarg" + --extra-ldflags=*) EXTRA_LDFLAGS="$optarg" ;; --cpu=*) cpu="$optarg" ;;
@@ -1432,8 +1432,8 @@ echo "OS_CFLAGS=$OS_CFLAGS" >> $config_mak echo "OS_LDFLAGS=$OS_LDFLAGS" >> $config_mak echo "ARCH_CFLAGS=$ARCH_CFLAGS" >> $config_mak echo "ARCH_LDFLAGS=$ARCH_LDFLAGS" >> $config_mak -echo "CFLAGS=$CFLAGS" >> $config_mak -echo "LDFLAGS=$LDFLAGS" >> $config_mak +echo "CFLAGS=$CFLAGS $EXTRA_CFLAGS" >> $config_mak +echo "LDFLAGS=$LDFLAGS $EXTRA_LDFLAGS" >> $config_mak echo "EXESUF=$EXESUF" >> $config_mak echo "PTHREADLIBS=$PTHREADLIBS" >> $config_mak echo "CLOCKLIBS=$CLOCKLIBS" >> $config_mak
Quoted 2 lines · Jan Kiszka
In order to allow overriding flags that are set by configure, we have to
append them instead of prepending as it is done so far.
The help message from configure does not mention about overriding but adding flags. Which one is this?
Quoted 6 lines · Blue Swirl
Quoted 2 lines · Jan Kiszka
In order to allow overriding flags that are set by configure, we have to
append them instead of prepending as it is done so far.The help message from configure does not mention about overriding but adding flags. Which one is this?
I didn't derive this from the help, but from common practice when using EXTRA_* flags and the fact the gcc switches that come last override what comes first. Without the patch, adding your personal -W* switches to the build is impossible when they collide with some set by configure.
Jan
Quoted 3 lines · Jan Kiszka
In order to allow overriding flags that are set by configure, we have to append them instead of prepending as it is done so far.
Ah, this is useful for -O0 when debugging.
Signature · 1 line
error compiling committee.c: too many arguments to function