From 775699b8ee69764c65aa7edfa06b1376df0759a3 Mon Sep 17 00:00:00 2001 From: John Ellson Date: Mon, 25 Jul 2016 20:37:54 -0400 Subject: [PATCH] improve handling of extra warnings if C99 available --- configure.ac | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 33c157e08..4c1a980e3 100644 --- a/configure.ac +++ b/configure.ac @@ -304,17 +304,22 @@ if test "x$TCLSH" = "x"; then # fi fi + +dnl ----------------------------------- +dnl checks for compilers + +AM_PROG_CC_C_O +AC_PROG_CC_C99 +AC_PROG_CXX +AC_PROG_OBJC + +AC_C_INLINE + dnl =========================================================================== dnl Set GCC compiler flags if [test "${GCC}" == "yes"] then - # Enable c99 - CFLAGS="${CFLAGS} -std=c99" - - # When enabling c99 on this codebase, this POSIX version should be defined - CFLAGS="${CFLAGS} -D_POSIX_C_SOURCE=200112L" - # Enable common warnings flags CFLAGS="${CFLAGS} -Wall" @@ -324,21 +329,13 @@ then # Enable specific warning flags not included by -Wall or -Wextra CFLAGS="${CFLAGS} -Wmissing-include-dirs -Wswitch-default -Wfloat-equal -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs" -# FIXME - The are not available of centos [6] - need smarter config: -# -Wdouble-promotion -Wtrampolines -Wlogical-op - + # if C99, then enable additional warnings + if [test "${ac_cv_prog_cc_c99}" != "no"] + then + # When enabling c99 on this codebase, this POSIX version should be defined + CFLAGS="${CFLAGS} -D_POSIX_C_SOURCE=200112L -Wdouble-promotion -Wtrampolines -Wlogical-op" + fi fi - -dnl ----------------------------------- -dnl checks for compilers - -AM_PROG_CC_C_O -#AC_PROG_CC -AC_PROG_CXX -AC_PROG_OBJC - -AC_C_INLINE - # Workaround for native compilers # HP : http://bugs.gnome.org/db/31/3163.html # DEC : Enable NaN/Inf -- 2.40.0