diff --git a/config/lam_setup_cc.m4 b/config/lam_setup_cc.m4 index e40bc7a8d1..efd33d6cc7 100644 --- a/config/lam_setup_cc.m4 +++ b/config/lam_setup_cc.m4 @@ -57,6 +57,18 @@ if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then unset add fi +# See if this version of gcc allows -finline-functions +if test "$GCC" = "yes"; then + CFLAGS_orig="$CFLAGS" + CFLAGS="$CFLAGS -finline-functions" + add= + AC_TRY_COMPILE([], [], add=" -finline-functions") + CFLAGS="$CFLAGS_orig$add" + LAM_UNIQ(CFLAGS) + AC_MSG_WARN([$add has been added to CFLAGS]) + unset add +fi + # Preload the optflags for the case where the user didn't specify any. # If we're using GNU compilers, use -O3 (since it GNU doesn't require # all compilation units to be compiled with the same level of diff --git a/config/lam_setup_cxx.m4 b/config/lam_setup_cxx.m4 index 0bdec0bca1..a1448587cf 100644 --- a/config/lam_setup_cxx.m4 +++ b/config/lam_setup_cxx.m4 @@ -44,6 +44,18 @@ if test "$GCC" = "yes" -a "$WANT_PICKY_COMPILER" = 1; then unset add fi +# See if this version of gcc allows -finline-functions +if test "$GCC" = "yes"; then + CXXFLAGS_orig="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS -finline-functions" + add= + AC_TRY_COMPILE([], [], add=" -finline-functions") + CXXFLAGS="$CXXFLAGS_orig$add" + LAM_UNIQ(CXXFLAGS) + AC_MSG_WARN([$add has been added to CXXFLAGS]) + unset add +fi + # Check for special things due to C++ exceptions WRAPPER_EXTRA_CFLAGS=