changeset 2147:b45c8654e594 draft

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.
author Roy Marples <roy@marples.name>
date Sun, 10 Nov 2013 11:17:40 +0000
parents 90787e63ccab
children 404a5ea19f84
files configure
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/configure	Sun Nov 10 10:32:01 2013 +0000
+++ b/configure	Sun Nov 10 11:17:40 2013 +0000
@@ -265,15 +265,21 @@
 $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