]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Set blank CFLAGS/CPPFLAGS and then append user CFLAGS/CPPFLAGS.
authorRoy Marples <roy@marples.name>
Sun, 10 Nov 2013 11:17:40 +0000 (11:17 +0000)
committerRoy Marples <roy@marples.name>
Sun, 10 Nov 2013 11:17:40 +0000 (11:17 +0000)
This allows us to pass them to the configure tests and keep our
sed to extract them portable.

configure

index d1738381836e4aa59c19c46380d98b13a2c1c0bf..e420bf7eec32db6d5099825f0dc6a9dc77509837 100755 (executable)
--- 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