From 2fa92a58e827aec77c8b4dbe50d06e54d185f316 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 22 Nov 2010 22:54:32 -0500 Subject: [PATCH] Only specify CFLAGS_NO* with --enable-checking Currently we are always specifying e.g. CFLAGS_NOUNUSED as -Wno-unused when we think we are compiling with gcc. Since autoconf always tries to use gcc when possible, this breaks the build if we have a gcc available but we use another cc for building. This should be fixed otherwise, but in the meantime at least make this only happen if warnings are actually turned on, so the build is less likely to break with a default ./configure invocation. Reviewed-on: http://gerrit.openafs.org/3366 Reviewed-by: Derrick Brashear Tested-by: BuildBot (cherry picked from commit 18793d4bfaeb88fd456c8d489165139126c0d293) Change-Id: Ifd31548dfecdd1a4838047e2548a8b2265422d26 Reviewed-on: http://gerrit.openafs.org/3557 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/cf/osconf.m4 | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index 402050880..1cca4f5a5 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -1048,6 +1048,9 @@ else fi CFLAGS_NOERROR= +CFLAGS_NOSTRICT= +CFLAGS_NOUNUSED= +CFLAGS_NOOLDSTYLE= if test "x$GCC" = "xyes"; then if test "x$enable_warnings" = "xyes"; then @@ -1057,29 +1060,14 @@ if test "x$GCC" = "xyes"; then XCFLAGS="${XCFLAGS} -Wall -Wstrict-prototypes -Wold-style-definition -Werror -fdiagnostics-show-option -Wpointer-arith" if test "x$enable_checking" != "xall"; then CFLAGS_NOERROR="-Wno-error" + CFLAGS_NOSTRICT="-fno-strict-aliasing" + CFLAGS_NOUNUSED="-Wno-unused" + CFLAGS_NOOLDSTYLE="-Wno-old-style-definition" AC_DEFINE(IGNORE_SOME_GCC_WARNINGS, 1, [define to disable some gcc warnings in warnings-as-errors mode]) fi fi fi -CFLAGS_NOSTRICT= - -if test "x$GCC" = "xyes"; then - CFLAGS_NOSTRICT="-fno-strict-aliasing" -fi - -if test "x$GCC" = "xyes"; then - CFLAGS_NOUNUSED="-Wno-unused" -else - CFLAGS_NOUNUSED= -fi - -if test "x$GCC" = "xyes"; then - CFLAGS_NOOLDSTYLE="-Wno-old-style-definition" -else - CFLAGS_NOOLDSTYLE= -fi - dnl horribly cheating, assuming double / is ok. case $INSTALL in ./* ) -- 2.39.5