diff --git a/configure.ac b/configure.ac index 7a5d747..679e633 100644 --- a/configure.ac +++ b/configure.ac @@ -808,18 +808,32 @@ else fi AC_SUBST(TESTDATADIR) +# some compilers do not support this flag (see bug #76963) +fno_check_new= +AC_MSG_CHECKING([for -fno-check-new compiler flag]) +AC_LANG_PUSH([C++]) +saved_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-fno-check-new $CXXFLAGS" +AC_TRY_COMPILE([], [], + [AC_MSG_RESULT([yes]) + fno_check_new="-fno-check-new"], + AC_MSG_RESULT([no]) +) +CXXFLAGS=$saved_CXXFLAGS +AC_LANG_POP + if test "x$GCC" != xyes; then enable_compile_warnings=no fi case "$enable_compile_warnings" in no) ;; - yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions -fno-check-new -fno-common $CXXFLAGS"; + yes) CXXFLAGS="-Wall -Woverloaded-virtual -Wnon-virtual-dtor -Wcast-align -fno-exceptions $fno_check_new -fno-common $CXXFLAGS"; CFLAGS="-Wall $CFLAGS" ;; kde) CXXFLAGS="-Wnon-virtual-dtor -Wno-long-long -Wundef \ -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -Wcast-align \ -Wconversion -Wall -W -Wpointer-arith \ -Wwrite-strings -O2 -Wformat-security \ - -Wmissing-format-attribute -fno-exceptions -fno-check-new \ + -Wmissing-format-attribute -fno-exceptions $fno_check_new \ -fno-common $CXXFLAGS" ;; esac