diff --git a/config/opal_setup_cc.m4 b/config/opal_setup_cc.m4 index aac1d950af..ddb897f0b2 100644 --- a/config/opal_setup_cc.m4 +++ b/config/opal_setup_cc.m4 @@ -196,12 +196,26 @@ AC_DEFUN([OPAL_SETUP_CC],[ if test "$GCC" = "yes"; then CFLAGS_orig="$CFLAGS" + # Note: Some versions of clang (at least >= 3.5 -- perhaps + # older versions, too?) will *warn* about -finline-functions, + # but still allow it. This is very annoying, so check for + # that warning, too. CFLAGS="$CFLAGS_orig -finline-functions" add= AC_CACHE_CHECK([if $CC supports -finline-functions], [opal_cv_cc_finline_functions], [AC_TRY_COMPILE([], [], - [opal_cv_cc_finline_functions="yes"], + [opal_cv_cc_finline_functions="yes" + if test -s conftest.err ; then + for i in unused 'not supported' ; do + $GREP -iq "$i" conftest.err + if test $? -eq 0; then + opal_cv_cc_finline_functions="no" + break; + fi + done + fi + ], [opal_cv_cc_finline_functions="no"])]) if test "$opal_cv_cc_finline_functions" = "yes" ; then add=" -finline-functions"