diff --git a/configure b/configure index 7d5d3ff16..2b4b594ed 100755 --- a/configure +++ b/configure @@ -41,6 +41,14 @@ if [ "$srcdir" != "." ]; then fi machs=$machs$sep2$last +if [ "${CFLAGS}" != "" ] ; then + cflagsset=yes +elif [ "${CFLAGS-default}" = "" ] ; then + cflagsset=yes +else + cflagsset=no +fi + m="" w="" pb=no @@ -65,7 +73,6 @@ installpetitename="petite" installscriptname="scheme-script" unamebits="" relativeBootFiles=yes -cflagsset=no disablex11=no disablecurses=no disableiconv=no @@ -83,6 +90,7 @@ default_warning_flags="-Wpointer-arith -Wall -Wextra -Wno-implicit-fallthrough" : ${RANLIB:="ranlib"} : ${WINDRES:="windres"} : ${STRIP:="strip"} +CFLAGS_ADD= zlibLib= LZ4Lib= Kernel=KernelLib @@ -389,10 +397,16 @@ while [ $# != 0 ] ; do CPPFLAGS=*) CPPFLAGS=`echo $1 | sed -e 's/^CPPFLAGS=//'` ;; + CPPFLAGS+=*) + CPPFLAGS="$CPPFLAGS "`echo $1 | sed -e 's/^CPPFLAGS+=//'` + ;; CFLAGS=*) CFLAGS=`echo $1 | sed -e 's/^CFLAGS=//'` cflagsset=yes ;; + CFLAGS+=*) + CFLAGS_ADD="$CFLAGS_ADD "`echo $1 | sed -e 's/^CFLAGS+=//'` + ;; CC_FOR_BUILD=*) CC_FOR_BUILD=`echo $1 | sed -e 's/^CC_FOR_BUILD=//'` ;; @@ -402,9 +416,15 @@ while [ $# != 0 ] ; do LDFLAGS=*) LDFLAGS=`echo $1 | sed -e 's/^LDFLAGS=//'` ;; + LDFLAGS+=*) + LDFLAGS=`echo $1 | sed -e 's/^LDFLAGS+=//'` + ;; LIBS=*) LIBS=`echo $1 | sed -e 's/^LIBS=//'` ;; + LIBS+=*) + LIBS="${LIBS} "`echo $1 | sed -e 's/^LIBS+=//'` + ;; AR=*) AR=`echo $1 | sed -e 's/^AR=//'` ;; @@ -636,11 +656,15 @@ if [ "$help" = "yes" ]; then echo " --as-is skip Git submodule update" echo " CC= C compiler" echo " CPPFLAGS= C preprocessor flags" + echo " CPPFLAGS+= add C preprocessor flags" echo " CFLAGS= C compiler flags" + echo " CFLAGS+= add C compiler flags" echo " CC_FOR_BUILD= C compiler and flags for build machine" echo " LD= linker" echo " LDFLAGS= additional linker flags" + echo " LDFLAGS+= add additional linker flags" echo " LIBS= additional libraries" + echo " LIBS+= add additional libraries" echo " AR= archiver" echo " ARFLAGS= archiver flags" echo " RANLIB= archive indexer" @@ -767,6 +791,8 @@ if [ "$cflagsset" = "no" ] ; then esac fi +CFLAGS="${CFLAGS}${CFLAGS_ADD}" + if [ "$CC_FOR_BUILD" = "" ] ; then CC_FOR_BUILD="${CC} ${CFLAGS}" else