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