commit 40dc608f1fa19319e07a762a416073d6c9b5e2c2 from: Omar Polo date: Wed Jan 27 16:05:55 2021 UTC adjust CFLAGS detection commit - fe5967cd02fce0a3b5db0dc4f05ff342083ba1d0 commit + 40dc608f1fa19319e07a762a416073d6c9b5e2c2 blob - d87a56d1c857468517f6c39478a2c9298b5253f4 blob + c01d4d1a1687321c2fa69e2600a5880421e44ce9 --- configure +++ configure @@ -31,10 +31,13 @@ exec 3> config.log echo "file config.log: writing..." # -------- -# default settings: initialize all vars here +# default settings: initialize all vars here such that nothing is +# leaked from the environment except for CC and CFLAGS -CC=cc -CFLAGS= +CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make ${MAKE_FLAGS} -sf -` +CFLAGS=`printf "all:\\n\\t@echo \\\$(CFLAGS)\\n" | make ${MAKE_FLAGS} -sf -` +CFLAGS="${CFLAGS} -g -W -Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes" +CFLAGS="${CFLAGS} -Wwrite-strings -Wno-unused-parameter" LDFLAGS=-ltls YACC=yacc LEX=lex @@ -192,31 +195,12 @@ runtest() { # -------- # compiler options -DEFCFLAGS="-g -W -Wall -Wmissing-prototypes -Wstrict-prototypes -Wwrite-strings -Wno-unused-parameter" - -if [ -n "${CFLAGS}" ]; then - COMP="${CC} ${CFLAGS} -Wno-unused -Werror" -else - COMP="${CC} ${CDEFCFLAGS} -Wno-unused -Werror" -fi -echo -n "testing ${CC} -W: " 1>&2 -echo -n "testing ${CC} -W: " 1>&3 -runtest noop WFLAG || true +COMP="${CC} ${CFLAGS} -Wno-unused -Werror" -if [ -n "${CFLAGS}" ]; then - echo "CFLAGS specified manually:" 1>&3 -elif [ ${HAVE_WFLAG} -eq 0 ]; then - CFLAGS="-g" -else - CFLAGS="${DEFCFLAGS}" -fi echo "selected CFLAGS=\"${CFLAGS}\"" 1>&2 echo "selected CFLAGS=\"${CFLAGS}\"" 1>&3 echo 1>&3 -COMP="${CC} ${CFLAGS}" -[ ${HAVE_WFLAG} -eq 0 ] || COMP="${COMP} -Wno-unused -Werror" - if [ -n "${STATIC}" ]; then echo "selected STATIC=\"${STATIC}\" (manual)" 1>&2 echo "selected STATIC=\"${STATIC}\" (manual)" 1>&3