From e1a3e44e2ad9ed4141aeec3559aa401335a1cc03 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 18 Nov 2013 19:54:38 +0100 Subject: [PATCH] configure: append {C{,XX,PP},LD}FLAGS after checking compilter features. --- configure | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/configure b/configure index a8cd07b7..037c73d1 100755 --- a/configure +++ b/configure @@ -178,14 +178,8 @@ fi echo "CC = $CC" >>$CONFIG_MK echo "CFLAGS = -O2 -pthread" >>$CONFIG_MK -if [ -n "$CFLAGS" ]; then - echo "CFLAGS += $CFLAGS" >>$CONFIG_MK -fi echo "LDFLAGS = -L\$(TOPDIR)/lib" >>$CONFIG_MK -if [ -n "$LDFLAGS" ]; then - echo "LDFLAGS += $LDFLAGS" >>$CONFIG_MK -fi echo "CPPFLAGS = -I. -I\$(TOPDIR) -I\$(TOPDIR)/include" >>$CONFIG_MK echo "CPPFLAGS += -DHAVE_CONFIG_H" >>$CONFIG_MK echo "CPPFLAGS += -DXBPS_SYSCONF_PATH=\\\"${ETCDIR}\\\"" >>$CONFIG_MK @@ -212,10 +206,6 @@ linux) ;; esac -if [ -n "$CPPFLAGS" ]; then - echo "CPPFLAGS += $CPPFLAGS" >>$CONFIG_MK -fi - # Add CPPFLAGS/CFLAGS/LDFLAGS to CC for testing features XCC="$CC $CFLAGS $CPPFLAGS $LDFLAGS" # Make sure to disable --as-needed for CC tests. @@ -323,6 +313,16 @@ if [ $? -ne 0 ]; then exit 1 fi +if [ -n "$CFLAGS" ]; then + echo "CFLAGS += $CFLAGS" >>$CONFIG_MK +fi +if [ -n "$LDFLAGS" ]; then + echo "LDFLAGS += $LDFLAGS" >>$CONFIG_MK +fi +if [ -n "$CPPFLAGS" ]; then + echo "CPPFLAGS += $CPPFLAGS" >>$CONFIG_MK +fi + # libfetch echo "CPPFLAGS += -I\$(TOPDIR)/lib/fetch" >>$CONFIG_MK echo "LDFLAGS += -lssl" >>$CONFIG_MK