diff options
author | Omar Polo <op@omarpolo.com> | 2021-01-27 16:05:55 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-01-27 16:05:55 +0000 |
commit | 40dc608f1fa19319e07a762a416073d6c9b5e2c2 (patch) | |
tree | 367caf085e77cb533285c0eb062c0bc02e015b88 /configure | |
parent | fe5967cd02fce0a3b5db0dc4f05ff342083ba1d0 (diff) |
adjust CFLAGS detection
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 30 |
1 files changed, 7 insertions, 23 deletions
@@ -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" +COMP="${CC} ${CFLAGS} -Wno-unused -Werror" -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 - -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 |