summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2013-11-10 11:17:40 +0000
committerRoy Marples <roy@marples.name>2013-11-10 11:17:40 +0000
commit2e9244794f3def04bd8421f35dd09498636bb6a3 (patch)
treeb29c5a8adbfdd79032fe09aa3abc63146c9e4762 /configure
parent587b9b7f7407a93f72bb027089ca7de16a5147e8 (diff)
downloaddhcpcd-2e9244794f3def04bd8421f35dd09498636bb6a3.tar.xz
Set blank CFLAGS/CPPFLAGS and then append user CFLAGS/CPPFLAGS.
This allows us to pass them to the configure tests and keep our sed to extract them portable.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure12
1 files changed, 9 insertions, 3 deletions
diff --git a/configure b/configure
index d1738381..e420bf7e 100755
--- a/configure
+++ b/configure
@@ -265,15 +265,21 @@ fi
$CC --version | $SED -e '1!d'
echo "CC= $CC" >>$CONFIG_MK
+# Set to blank, then append user config
+# We do this so our SED call to append to XCC remains portable
+echo "CFLAGS=" >>$CONFIG_MK
+echo "CPPFLAGS=" >>$CONFIG_MK
+echo "LDFLAGS=" >>$CONFIG_MK
if [ -n "$CFLAGS" ]; then
- echo "CFLAGS= $CFLAGS" >>$CONFIG_MK
+ echo "CFLAGS+= $CFLAGS" >>$CONFIG_MK
fi
if [ -n "$CPPFLAGS" ]; then
- echo "CPPFLAGS= $CPPFLAGS" >>$CONFIG_MK
+ echo "CPPFLAGS+= $CPPFLAGS" >>$CONFIG_MK
fi
if [ -n "$LDFLAGS" ]; then
- echo "LDFLAGS= $LDFLAGS" >>$CONFIG_MK
+ echo "LDFLAGS+= $LDFLAGS" >>$CONFIG_MK
fi
+
if [ "$STATIC" = yes ]; then
echo "LDFLAGS+= -static" >>$CONFIG_MK
fi