From 05f4f62db12ba4ba45b4d3c0c84740b57077da1a Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 13 Nov 2013 15:08:01 +0000 Subject: [PATCH] Update -Wno-long-double test to support clang. This prevents bazillions of warnings from clang tha -Wno-long-double isn't supported. The warning that clang issues when it see -Wno-long-double is does not use any of the words we were looking for, so I added "unknown" to the list of words to look for. I also re-indented the two m4 tests so that they're a bit more readable. cmr=v1.7.4:reviewer=brbarret:subject=Update -Wno-long-double test to support clang This commit was SVN r29681. --- config/opal_setup_cc.m4 | 44 +++++++++++++++++++++------------------- config/opal_setup_cxx.m4 | 44 ++++++++++++++++++++++------------------ 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/config/opal_setup_cc.m4 b/config/opal_setup_cc.m4 index 00e3c28076..4560ebb0b6 100644 --- a/config/opal_setup_cc.m4 +++ b/config/opal_setup_cc.m4 @@ -145,27 +145,29 @@ AC_DEFUN([OPAL_SETUP_CC],[ CFLAGS="$CFLAGS $add -Wno-long-double -Wstrict-prototypes" AC_CACHE_CHECK([if $CC supports -Wno-long-double], - [ompi_cv_cc_wno_long_double], - [AC_TRY_COMPILE([], [], - [ - dnl Alright, the -Wno-long-double did not produce any errors... - dnl Well well, try to extract a warning regarding unrecognized or ignored options - AC_TRY_COMPILE([], [long double test;], - [ - ompi_cv_cc_wno_long_double="yes" - if test -s conftest.err ; then - dnl Yes, it should be "ignor", in order to catch ignoring and ignore - for i in invalid ignor unrecognized ; do - $GREP -iq $i conftest.err - if test "$?" = "0" ; then - ompi_cv_cc_wno_long_double="no" - break; - fi - done - fi - ], - [ompi_cv_cc_wno_long_double="no"])], - [ompi_cv_cc_wno_long_double="no"])]) + [ompi_cv_cc_wno_long_double], + [AC_TRY_COMPILE([], [], + [ + dnl So -Wno-long-double did not produce any errors... + dnl We will try to extract a warning regarding + dnl unrecognized or ignored options + AC_TRY_COMPILE([], [long double test;], + [ + ompi_cv_cc_wno_long_double="yes" + if test -s conftest.err ; then + dnl Yes, it should be "ignor", in order to catch ignoring and ignore + for i in unknown invalid ignor unrecognized ; do + $GREP -iq $i conftest.err + if test "$?" = "0" ; then + ompi_cv_cc_wno_long_double="no" + break; + fi + done + fi + ], + [ompi_cv_cc_wno_long_double="no"])], + [ompi_cv_cc_wno_long_double="no"]) + ]) CFLAGS="$CFLAGS_orig" if test "$ompi_cv_cc_wno_long_double" = "yes" ; then diff --git a/config/opal_setup_cxx.m4 b/config/opal_setup_cxx.m4 index 65cd5b6303..b96fa97278 100644 --- a/config/opal_setup_cxx.m4 +++ b/config/opal_setup_cxx.m4 @@ -109,26 +109,30 @@ AC_DEFUN([_OPAL_SETUP_CXX_COMPILER_BACKEND],[ CXXFLAGS_orig="$CXXFLAGS" CXXFLAGS="$CXXFLAGS $add -Wno-long-double -fstrict-prototype" AC_CACHE_CHECK([if $CXX supports -Wno-long-double], - [opal_cv_cxx_wno_long_double], - [AC_TRY_COMPILE([], [], - [dnl Alright, the -Wno-long-double did not produce any errors... - dnl Well well, try to extract a warning regarding unrecognized or ignored options - AC_TRY_COMPILE([], [long double test;], - [ - opal_cv_cxx_wno_long_double="yes" - if test -s conftest.err ; then - dnl Yes, it should be "ignor", in order to catch ignoring and ignore - for i in invalid ignor unrecognized ; do - $GREP -iq $i conftest.err - if test "$?" = "0" ; then - opal_cv_cxx_wno_long_double="no", - break; - fi - done - fi - ], - [opal_cv_cxx_wno_long_double="no"])], - [opal_cv_cxx_wno_long_double="no"])]) + [opal_cv_cxx_wno_long_double], + [AC_TRY_COMPILE([], [], + [ + dnl So -Wno-long-double did not produce any errors... + dnl We will try to extract a warning regarding + dnl unrecognized or ignored options + AC_TRY_COMPILE([], [long double test;], + [ + ompi_cv_cxx_wno_long_double="yes" + if test -s conftest.err ; then + dnl Yes, it should be "ignor", in order to catch ignoring and ignore + for i in unknown invalid ignor unrecognized ; do + $GREP -iq $i conftest.err + if test "$?" = "0" ; then + ompi_cv_cxx_wno_long_double="no" + break; + fi + done + fi + ], + [ompi_cv_cxx_wno_long_double="no"])], + [ompi_cv_cxx_wno_long_double="no"]) + ]) + CXXFLAGS="$CXXFLAGS_orig" AC_LANG_POP(C++) if test "$opal_cv_cxx_wno_long_double" = "yes" ; then