]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Allow 'configure.host' to pre-set 'EXTRA_CFLAGS', 'EXTRA_CXX_FLAGS'
authorThomas Schwinge <tschwinge@baylibre.com>
Wed, 26 Feb 2025 09:13:51 +0000 (10:13 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Thu, 13 Mar 2025 12:07:27 +0000 (13:07 +0100)
In particular, 'GLIBCXX_ENABLE_CXX_FLAGS' shouldn't overwrite 'EXTRA_CXX_FLAGS'
(and instead append any additional '--enable-cxx-flags=[...]').

libstdc++-v3/
* acinclude.m4 (GLIBCXX_ENABLE_CXX_FLAGS): Append to
'EXTRA_CXX_FLAGS' any additional flags.
* configure: Regenerate.
* configure.host: Document 'EXTRA_CFLAGS', 'EXTRA_CXX_FLAGS'.

libstdc++-v3/acinclude.m4
libstdc++-v3/configure
libstdc++-v3/configure.host

index b3423d7957ac6326ca090107b6d7ea8c45141ee3..e668d2dba2748fc813944fb83a764ca01d221e34 100644 (file)
@@ -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)
 ])
index e115ee55739f4820a8eca6e0d30a1451d7735d4b..78758285f21178f01b04e76ff8d3c63d453ba1ec 100755 (executable)
             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; }
 
index 7bc430716168748b96053d0c4d7785268706dd1c..933a43f241c3af4f62980a2dfd50479f7fa79543 100644 (file)
 #
 # 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)