From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Add --disable-libstdcxx-hosted as an alias for hosted-libstdcxx
Date: Fri, 7 Oct 2022 12:57:13 +0100 [thread overview]
Message-ID: <20221007115713.1226717-1-jwakely@redhat.com> (raw)
Tested x86_64-linux, Pushed to trunk.
-- >8 --
Most libstdc++ configure args are of the form --enable-libstdcxx-xxx but
the option to build freestanding is --disable-hosted-libstdcxx. If you
accidentally type --disable-libstdcxx-hosted then it will be ignored.
This adds --disable-libstdcxx-hosted as an alias for the existing arg,
so it works whichever way you say it. If both args are used explicitly
and their values do not agree, configure fails with an error.
libstdc++-v3/ChangeLog:
* acinclude.m4 (GLIBCXX_ENABLE_HOSTED): Add libstdcxx-hosted
enable arg as an alias for hosted-libstdcxx enable arg.
* configure: Regenerate.
---
libstdc++-v3/acinclude.m4 | 22 +++++++++++++++++++++-
libstdc++-v3/configure | 37 ++++++++++++++++++++++++++++---------
2 files changed, 49 insertions(+), 10 deletions(-)
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 1b404d7df22..719eab15c77 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2962,6 +2962,10 @@ dnl installing only the headers required by [17.4.1.3] and the language
dnl support library. More than that will be built (to keep the Makefiles
dnl conveniently clean), but not installed.
dnl
+dnl Also define --disable-libstdcxx-hosted as an alias for
+dnl --disable-hosted-libstdcxx but fail if both are given
+dnl and their values do not agree.
+dnl
dnl Sets:
dnl is_hosted (yes/no)
dnl
@@ -2971,7 +2975,8 @@ dnl
AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
AC_ARG_ENABLE([hosted-libstdcxx],
AC_HELP_STRING([--disable-hosted-libstdcxx],
- [only build freestanding C++ runtime support]),,
+ [only build freestanding C++ runtime support]),
+ [enable_hosted_libstdcxx_was_given=yes],
[case "$host" in
arm*-*-symbianelf*)
enable_hosted_libstdcxx=no
@@ -2980,6 +2985,21 @@ AC_DEFUN([GLIBCXX_ENABLE_HOSTED], [
enable_hosted_libstdcxx=yes
;;
esac])
+
+ # Because most configure args are --enable-libstdcxx-foo add an alias
+ # of that form for --enable-hosted-libstdcxx.
+ AC_ARG_ENABLE([libstdcxx-hosted],
+ AC_HELP_STRING([--disable-libstdcxx-hosted],
+ [alias for --disable-hosted-libstdcxx]),
+ [if test "$enable_hosted_libstdcxx_was_given" = yes; then
+ if test "$enable_hosted_libstdcxx" != "$enableval"; then
+ AC_MSG_ERROR([--enable-libstdcxx-hosted=$enableval conflicts with --enable-hosted-libstdcxx=$enable_hosted_libstdcxx])
+ fi
+ else
+ enable_hosted_libstdcxx=${enableval}
+ fi
+ ],)
+
freestanding_flags=
if test "$enable_hosted_libstdcxx" = no; then
AC_MSG_NOTICE([Only freestanding libraries will be built])
reply other threads:[~2022-10-07 11:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221007115713.1226717-1-jwakely@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).