From: Roy Marples Date: Sat, 6 Sep 2008 15:53:31 +0000 (+0000) Subject: Always test our cc options with a valid input file. X-Git-Tag: v5.0.0~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e63c314dbd5bdbda6e6897504721e789b963df5c;p=thirdparty%2Fdhcpcd.git Always test our cc options with a valid input file. --- diff --git a/mk/cc.mk b/mk/cc.mk index 6ea204c5..56777eb7 100644 --- a/mk/cc.mk +++ b/mk/cc.mk @@ -16,16 +16,13 @@ _CCFLAGS= -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 \ -Wmissing-prototypes -Wmissing-declarations \ -Wmissing-noreturn -Wmissing-format-attribute \ -Wredundant-decls -Wnested-externs \ - -Winline -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith \ + -Winline -Wwrite-strings -Wcast-align -Wcast-qual \ + -Wpointer-arith \ -Wdeclaration-after-statement -Wsequence-point _CC_FLAGS_SH= if ! test -d .git; then echo ""; else for f in ${_CCFLAGS}; do \ - if ${CC} $$f -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \ + if echo "int main(void) { return 0;} " | \ + ${CC} $$f - -E -o /dev/null >/dev/null 2>&1; \ then printf "%s" "$$f "; fi \ done; fi _CC_FLAGS!= ${_CC_FLAGS_SH} CFLAGS+= ${_CC_FLAGS}$(shell ${_CC_FLAGS_SH}) - -_GGDB_SH= if test "${DEBUG}" = "yes"; then echo "-ggdb -DDEBUG"; else echo ""; fi -_GGDB!= ${_GGDB_SH} -GGDB= ${_GGDB}$(shell ${_GGDB_SH}) -CFLAGS+= ${GGDB}