]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Always test our cc options with a valid input file.
authorRoy Marples <roy@marples.name>
Sat, 6 Sep 2008 15:53:31 +0000 (15:53 +0000)
committerRoy Marples <roy@marples.name>
Sat, 6 Sep 2008 15:53:31 +0000 (15:53 +0000)
mk/cc.mk

index 6ea204c5ab0ff8e3399516e1e76cf3827fbfadf5..56777eb7e9d40701ccce3098e883987c193fa25d 100644 (file)
--- 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}