From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 6A532385DC31; Fri, 7 Oct 2022 11:56:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6A532385DC31 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1665143811; bh=I39NcEn511YgRQ/zxdW2eNZsn8VdmsUdo+ugj9Je3J8=; h=From:To:Subject:Date:From; b=LZV/LjwWjyDtQvZ8wT9bDhd9+H9nzfFexPV9vY3UozMT7R7DI8Nksfc/ztAvj12bP WLFZWlCP7If4TB84Z6lwDiCz+U4A/Ofysi6Qo9dUw1mQN3rrJPLJruSIGWgYcnNL41 PLTuUEvqRZjyeu1DtEY4xu2EaSIsvnV/AL6f/0y8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-3160] libstdc++: Add --disable-libstdcxx-hosted as an alias for hosted-libstdcxx X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 93b3ab6c0c6a44df50e9312c8106b4d1001d6205 X-Git-Newrev: 6bd2c1231a95e257dd590754430bdb191b3bca11 Message-Id: <20221007115651.6A532385DC31@sourceware.org> Date: Fri, 7 Oct 2022 11:56:51 +0000 (GMT) List-Id: https://gcc.gnu.org/g:6bd2c1231a95e257dd590754430bdb191b3bca11 commit r13-3160-g6bd2c1231a95e257dd590754430bdb191b3bca11 Author: Jonathan Wakely Date: Thu Oct 6 18:41:22 2022 +0100 libstdc++: Add --disable-libstdcxx-hosted as an alias for hosted-libstdcxx 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. Diff: --- 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]) diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 4f2c12f6b69..7ead77a5c80 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -922,6 +922,7 @@ enable_fast_install with_gnu_ld enable_libtool_lock enable_hosted_libstdcxx +enable_libstdcxx_hosted enable_libstdcxx_verbose enable_libstdcxx_pch with_libstdcxx_lock_policy @@ -1610,6 +1611,8 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --disable-hosted-libstdcxx only build freestanding C++ runtime support + --disable-libstdcxx-hosted + alias for --disable-hosted-libstdcxx --disable-libstdcxx-verbose disable termination messages to standard error --enable-libstdcxx-pch build pre-compiled libstdc++ headers @@ -12200,7 +12203,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12203 "configure" +#line 12206 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12306,7 +12309,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12309 "configure" +#line 12312 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15635,7 +15638,7 @@ postdeps_CXX=`echo " $postdeps_CXX " | sed 's, -lstdc++ ,,g'` # Check whether --enable-hosted-libstdcxx was given. if test "${enable_hosted_libstdcxx+set}" = set; then : - enableval=$enable_hosted_libstdcxx; + enableval=$enable_hosted_libstdcxx; enable_hosted_libstdcxx_was_given=yes else case "$host" in arm*-*-symbianelf*) @@ -15647,6 +15650,22 @@ else esac fi + + # Because most configure args are --enable-libstdcxx-foo add an alias + # of that form for --enable-hosted-libstdcxx. + # Check whether --enable-libstdcxx-hosted was given. +if test "${enable_libstdcxx_hosted+set}" = set; then : + enableval=$enable_libstdcxx_hosted; if test "$enable_hosted_libstdcxx_was_given" = yes; then + if test "$enable_hosted_libstdcxx" != "$enableval"; then + as_fn_error $? "--enable-libstdcxx-hosted=$enableval conflicts with --enable-hosted-libstdcxx=$enable_hosted_libstdcxx" "$LINENO" 5 + fi + else + enable_hosted_libstdcxx=${enableval} + fi + +fi + + freestanding_flags= if test "$enable_hosted_libstdcxx" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: Only freestanding libraries will be built" >&5 @@ -15990,7 +16009,7 @@ $as_echo "$glibcxx_cv_atomic_long_long" >&6; } # Fake what AC_TRY_COMPILE does. cat > conftest.$ac_ext << EOF -#line 15993 "configure" +#line 16012 "configure" int main() { typedef bool atomic_type; @@ -16025,7 +16044,7 @@ $as_echo "$glibcxx_cv_atomic_bool" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16028 "configure" +#line 16047 "configure" int main() { typedef short atomic_type; @@ -16060,7 +16079,7 @@ $as_echo "$glibcxx_cv_atomic_short" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16063 "configure" +#line 16082 "configure" int main() { // NB: _Atomic_word not necessarily int. @@ -16096,7 +16115,7 @@ $as_echo "$glibcxx_cv_atomic_int" >&6; } rm -f conftest* cat > conftest.$ac_ext << EOF -#line 16099 "configure" +#line 16118 "configure" int main() { typedef long long atomic_type; @@ -16252,7 +16271,7 @@ $as_echo "mutex" >&6; } # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16255 "configure" +#line 16274 "configure" int main() { _Decimal32 d1; @@ -16294,7 +16313,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # unnecessary for this test. cat > conftest.$ac_ext << EOF -#line 16297 "configure" +#line 16316 "configure" template struct same { typedef T2 type; };