From e87e23e76e9d133ce78e3ee56f2a60a2453875ae Mon Sep 17 00:00:00 2001 From: msweet Date: Tue, 23 Jun 2015 14:48:53 +0000 Subject: [PATCH] Add a check for whether the compiler supports the -Wno-unused-result option. git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12742 a1ca3aef-8c08-0410-bb20-df032aa958be --- config-scripts/cups-compiler.m4 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/config-scripts/cups-compiler.m4 b/config-scripts/cups-compiler.m4 index 5f92d8b68d..3c2076aa1b 100644 --- a/config-scripts/cups-compiler.m4 +++ b/config-scripts/cups-compiler.m4 @@ -154,7 +154,16 @@ if test -n "$GCC"; then if test "x$with_optim" = x; then # Add useful warning options for tracking down problems... - OPTIM="-Wall -Wno-format-y2k -Wunused -Wno-unused-result $OPTIM" + OPTIM="-Wall -Wno-format-y2k -Wunused $OPTIM" + + AC_MSG_CHECKING(whether compiler supports -Wno-unused-result) + OLDCFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wno-unused-result" + AC_TRY_COMPILE(,, + [OPTIM="$OPTIM -Wno-unused-result" + AC_MSG_RESULT(yes)], + AC_MSG_RESULT(no)) + CFLAGS="$OLDCFLAGS" AC_MSG_CHECKING(whether compiler supports -Wsign-conversion) OLDCFLAGS="$CFLAGS" -- 2.47.2