From: Art Cancro Date: Sun, 20 Aug 2023 03:18:42 +0000 (-0900) Subject: Apply patch sent by UFarx to support CPPFLAGS X-Git-Tag: v989~61 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=d637d621607d2a3ad56be7c3b2ae04def3371d00;p=citadel.git Apply patch sent by UFarx to support CPPFLAGS --- diff --git a/citadel/configure b/citadel/configure index 9fe4e8819..823a0c5bf 100755 --- a/citadel/configure +++ b/citadel/configure @@ -44,14 +44,19 @@ done # Set any missing values ######################################################################## +# GCC is the default C compiler +[ "${CC}" = "" ] && export CC=gcc + # Accept PREFIX as a substitute for CTDLDIR, but only if CTDLDIR is not already set [ "$CTDLDIR" = "" ] && [ "$PREFIX" != "" ] && CTDLDIR=$PREFIX # Configure the directory into which Citadel Server will be installed. -[ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel +[ "$CTDLDIR" = "" ] && CTDLDIR=/usr/local/citadel + # Permit override of CFLAGS and LDFLAGS using environment variables -[ "$CFLAGS" = "" ] && CFLAGS='-ggdb' +[ "$CFLAGS" = "" ] && CFLAGS='' +[ "$CPPFLAGS" = "" ] && CPPFLAGS='' [ "$LDFLAGS" = "" ] && LDFLAGS='' @@ -68,7 +73,7 @@ int main(int argc, char **argv) { exit(0); } ! -cc $tempcc -lssl -lcrypto -o $tempfile && $tempfile && { +$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -lssl -lcrypto && $tempfile && { CFLAGS=${CFLAGS}' -DHAVE_OPENSSL' LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz' } || { @@ -94,12 +99,12 @@ int main(int argc, char **argv) { } ! -cc $tempcc -o $tempfile && { +$CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile && { ICONV='yes' echo iconv.h is present and requires no additional libraries } || { echo Trying again with -liconv... - cc $tempcc -liconv -o $tempfile && { + $CC $CFLAGS $CPPFLAGS $tempcc -o $tempfile $LDFLAGS -liconv && { ICONV='yes' LDFLAGS=${LDFLAGS}' -liconv' } || { @@ -122,7 +127,7 @@ CFLAGS=${CFLAGS}' -DCTDLDIR=\"'${CTDLDIR}'\"' ( echo '# config.mk is generated by configure' echo "CTDLDIR := ${CTDLDIR}" - echo "CFLAGS := ${CFLAGS}" + echo "CFLAGS := ${CFLAGS} ${CPPFLAGS}" echo "LDFLAGS := ${LDFLAGS}" ) >config.mk