From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2CFE63858D33 for ; Tue, 6 Jun 2023 15:30:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2CFE63858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686065427; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nkAZgntloynoZJb/3/NygzOw9eaiE8S9mkn0Ee3cFmc=; b=RTWqvmX8FfKXkHX0Nbr8NVvwAalXBT+jp+7HQrzg9r1qam60o3SP/zbmS4oGJYUS1LUuiC Oj9OmI+kmCI53pFD+8xMw5hBe1ic5uv28i9KO+U+SmaOf2fEpeVBhBhHPWYdDVWWnfLyTT VTbg4SHmaUTMCLNSa5xfBwto9IZf5aw= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-655-fcrG_zcONAaTg4J015vY2w-1; Tue, 06 Jun 2023 11:30:26 -0400 X-MC-Unique: fcrG_zcONAaTg4J015vY2w-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2b1b1693338so30581401fa.3 for ; Tue, 06 Jun 2023 08:30:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686065424; x=1688657424; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nkAZgntloynoZJb/3/NygzOw9eaiE8S9mkn0Ee3cFmc=; b=bDJrbAbr3b7anINFqAbplHt2Qv95pckBVqpGqVmxQskmY7S4PUMHHGaNSLMOfPdbk9 R34P/CjhLkOKBDrTuRm2zSP54a000QBE85QHyPqSXBs7OcObqgFlUlvnvhWySqtOEW6n Bu2Y2GiwjDsZukG+Zkzx5qtXOQbgTU61Do1BCYJB+L6T9CN1YQMXUMPE1gza2uZ9Ascg Iib6iX6U3xpyUQgezBJZH/wbZv929YTIday8OcYraVVpwEwLgcJehP2FWL9Oh2yXtHOn Q/Yz+P2lQ7LgGPL/HR7Q1qr1AexTwrSBeC3jyci01esgkp3rJQnPF/TN3CEuGNgBkqcx Nycg== X-Gm-Message-State: AC+VfDzfepsNhA7Zjjs3Q7Wr7TsH5iRrY9hd/zcMOrnveUNa6VIku4y/ qTpt8znTzsgYCRHiSuw5e0eXZix68TNhjRgp91XxzipYFwy3chLCi4/RHC+lxRD4CH0ZlrOEgdo 3OqdKnULv0FT53NV9OGOY0ysuGJIaXcw4gw== X-Received: by 2002:ac2:538a:0:b0:4f3:78c2:2a6d with SMTP id g10-20020ac2538a000000b004f378c22a6dmr1071813lfh.3.1686065424466; Tue, 06 Jun 2023 08:30:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7CGm7BkpYqB6G6hHMhPKuSGjEeSVjx0waYqqu2e4hJfCOml962nsz+3cKKP1rOT4Ic5v8Zh/LOZCo4W5niFTA= X-Received: by 2002:ac2:538a:0:b0:4f3:78c2:2a6d with SMTP id g10-20020ac2538a000000b004f378c22a6dmr1071804lfh.3.1686065424138; Tue, 06 Jun 2023 08:30:24 -0700 (PDT) MIME-Version: 1.0 References: <20230601155856.305565-1-jwakely@redhat.com> In-Reply-To: <20230601155856.305565-1-jwakely@redhat.com> From: Jonathan Wakely Date: Tue, 6 Jun 2023 16:30:12 +0100 Message-ID: Subject: Re: [PATCH] libstdc++: Use AS_IF in configure.ac To: Jonathan Wakely Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000ac9fb005fd77b26a" X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --000000000000ac9fb005fd77b26a Content-Type: text/plain; charset="UTF-8" On Thu, 1 Jun 2023 at 16:59, Jonathan Wakely via Libstdc++ < libstdc++@gcc.gnu.org> wrote: > Tested x86_64-linux. I'd appreciate a second set of eyeballs on this > before I push it. > Pushed to trunk now. > > -- >8 -- > > This ensures that anything that depends on AC_REQUIRE is hoisted out of > the conditional block. > > The always-false test x"long_double_math_on_this_cpu" = x"yes" condition > is not altered by this commit, only changed to use the AS_IF syntax. > > libstdc++-v3/ChangeLog: > > * configure.ac: Use AS_IF. > * configure: Regenerate. > --- > libstdc++-v3/configure | 1148 +++++++++++++++++++------------------ > libstdc++-v3/configure.ac | 20 +- > 2 files changed, 590 insertions(+), 578 deletions(-) > > diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac > index 0abe54e7b9a..f3bcf7affdd 100644 > --- a/libstdc++-v3/configure.ac > +++ b/libstdc++-v3/configure.ac > @@ -266,7 +266,7 @@ AC_CHECK_HEADERS([linux/random.h], [], [], > AC_CHECK_HEADERS([xlocale.h]) > > # Only do link tests if native. Else, hardcode. > -if $GLIBCXX_IS_NATIVE; then > +AS_IF([$GLIBCXX_IS_NATIVE],[ > > # We can do more elaborate tests that assume a working linker. > CANADIAN=no > @@ -298,7 +298,7 @@ if $GLIBCXX_IS_NATIVE; then > # For iconv support. > AM_ICONV > > -else > +],[ > > # This lets us hard-code the functionality we know we'll have in the > cross > # target environment. "Let" is a sugar-coated word placed on an > especially > @@ -330,7 +330,7 @@ else > > # First, test for "known" system libraries. We may be using newlib even > # on a hosted environment. > - if test "x${with_newlib}" = "xyes"; then > + AS_IF([test "x${with_newlib}" = "xyes"],[ > os_include_dir="os/newlib" > AC_DEFINE(HAVE_HYPOT) > > @@ -386,14 +386,14 @@ else > AC_DEFINE(HAVE_USLEEP) > ;; > esac > - elif test "x$with_headers" != "xno"; then > + ],[test "x$with_headers" != "xno" ],[ > GLIBCXX_CROSSCONFIG > - fi > + ]) > > # At some point, we should differentiate between architectures > # like x86, which have long double versions, and alpha/powerpc/etc., > # which don't. For the time being, punt. > - if test x"long_double_math_on_this_cpu" = x"yes"; then > + AS_IF([test x"long_double_math_on_this_cpu" = x"yes"],[ > AC_DEFINE(HAVE_ACOSL) > AC_DEFINE(HAVE_ASINL) > AC_DEFINE(HAVE_ATAN2L) > @@ -417,8 +417,8 @@ else > AC_DEFINE(HAVE_SQRTL) > AC_DEFINE(HAVE_TANL) > AC_DEFINE(HAVE_TANHL) > - fi > -fi > + ]) > +]) > > # Check for _Unwind_GetIPInfo. > GCC_CHECK_UNWIND_GETIPINFO > @@ -449,7 +449,7 @@ case "$target" in > #error no need for long double compatibility > #endif > ], [ac_ldbl_compat=yes], [ac_ldbl_compat=no]) > - if test "$ac_ldbl_compat" = yes; then > + AS_IF([test "$ac_ldbl_compat" = yes],[ > AC_DEFINE([_GLIBCXX_LONG_DOUBLE_COMPAT],1, > [Define if compatibility should be provided for > -mlong-double-64.]) > > port_specific_symbol_files="\$(top_srcdir)/config/os/gnu-linux/ldbl-extra.ver" > @@ -485,7 +485,7 @@ case "$target" in > fi > ;; > esac > - fi > + ]) > esac > AC_SUBST(LONG_DOUBLE_COMPAT_FLAGS) > AC_SUBST(LONG_DOUBLE_128_FLAGS) > -- > 2.40.1 > > --000000000000ac9fb005fd77b26a--