diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4 index b3423d7957a..e668d2dba27 100644 --- a/libstdc++-v3/acinclude.m4 +++ b/libstdc++-v3/acinclude.m4 @@ -3267,9 +3267,11 @@ AC_DEFUN([GLIBCXX_ENABLE_CXX_FLAGS], [dnl AC_MSG_ERROR([compiler flags start with a -]) ;; esac done + + # Append the additional flags to any that came from 'configure.host'. + EXTRA_CXX_FLAGS="$EXTRA_CXX_FLAGS $enable_cxx_flags" fi - EXTRA_CXX_FLAGS="$enable_cxx_flags" AC_MSG_RESULT($EXTRA_CXX_FLAGS) AC_SUBST(EXTRA_CXX_FLAGS) ]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index e115ee55739..78758285f21 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -19450,9 +19450,11 @@ fi as_fn_error $? "compiler flags start with a -" "$LINENO" 5 ;; esac done + + # Append the additional flags to any that came from 'configure.host'. + EXTRA_CXX_FLAGS="$EXTRA_CXX_FLAGS $enable_cxx_flags" fi - EXTRA_CXX_FLAGS="$enable_cxx_flags" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EXTRA_CXX_FLAGS" >&5 $as_echo "$EXTRA_CXX_FLAGS" >&6; } diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host index 7bc43071616..933a43f241c 100644 --- a/libstdc++-v3/configure.host +++ b/libstdc++-v3/configure.host @@ -61,6 +61,10 @@ # # It possibly modifies the following variables: # +# EXTRA_CFLAGS extra flags to pass when compiling C code +# +# EXTRA_CXX_FLAGS extra flags to pass when compiling C++ code +# # OPT_LDFLAGS extra flags to pass when linking the library, of # the form '-Wl,blah' # (defaults to empty in acinclude.m4)