From patchwork Thu Jun 1 15:58:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 102065 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp435788vqr; Thu, 1 Jun 2023 09:00:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ52Zb+EZoXGbr74Murn3nj17LTroGCSGDgfPIqP1ujbJLakKl4LvVQkLvUslesh+t2Ae7ko X-Received: by 2002:a17:907:9495:b0:967:a127:7e79 with SMTP id dm21-20020a170907949500b00967a1277e79mr7936381ejc.28.1685635259415; Thu, 01 Jun 2023 09:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685635259; cv=none; d=google.com; s=arc-20160816; b=xXMGBbgeFz0jguF+W9zxpBpvCKblTAif9s4E2JrQhJh0nw6Ixk7H1Jsk011MIrj0bt jV4e75ZuKQd1Qnjo9i6rwa95HRnezcA8yhZQqlXm98AWTriLbehG86/FtGFulYkB6/lQ gZ3/zfy0++HQrx3TUm9y18cx/AASJyZgHWxCQoIfu5xIJeYTIFa6CZe/KLFRGlckP/ge V8bX57N7i9dL1/WSdoR9a3woVrZRFUNStwTD7i132JisXlF4N7Amt/vBEt6T8tWTpiDL 5bDbAXvjd/ETkmd8FNAcDTfDqbaYogJqbVt6hYWdpG0cKvwWR93Go7FYzqohb4KzR08m khpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=N0fnFvGHesJuMlE/Y6bXGHNaeJ6trniPr0nYYika914=; b=alQR0DY+GVOCfG6gZlC/2fQoyFMQtBzkk+cI9bk/ji+uiiYAyv03EX0yxp5A4irjBM ouFdlsZsfcB17uDJSTTvVWHhsgoYysBrrT7piEwA5aEt2R6PdeItJG0yOQ8ucBwNRhe7 mJ0981BZQx2i0dalD9IxJHA10FpZ96hOqGlyHCYY39V4tsp+RE/5ypJdTcy05sL/l8TO EUFI7QJMasL89nR0+EOZk9HgcQ/uBxNg0B/pLQ8tNyRqmX6QBm4fYWDtJghEdA/hUc5b fus7xOJryL0NE1NwTboTp8Tr/rulVwZac3MXisMSkaB0o0pL8jfWenRriqUlkpStTU2p KMCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CRE9rmbT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id k11-20020a1709062a4b00b0096a0b8e2cf8si4304432eje.1016.2023.06.01.09.00.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 09:00:59 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=CRE9rmbT; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C3A443854E72 for ; Thu, 1 Jun 2023 16:00:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C3A443854E72 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685635221; bh=N0fnFvGHesJuMlE/Y6bXGHNaeJ6trniPr0nYYika914=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CRE9rmbTvOJoDqS5HYTzThF6XiojuwAboBnmXlPcnNjItnRO9+SY8ZNdCKirVhZdT ladYxhqkHxXWNxS3kv90UI28EELsECuvU+S1QGjdTWBBsSWC4VQsy67/A2qzgDodMP cULTMWL9Xj3bwVSsy4G2uznoezsrOQlHsyIFCqMk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F10F6385840D for ; Thu, 1 Jun 2023 15:59:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F10F6385840D Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-230-MwmByQwcPgKREk_rcyvNeg-1; Thu, 01 Jun 2023 11:58:58 -0400 X-MC-Unique: MwmByQwcPgKREk_rcyvNeg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5CB5B85A5BB; Thu, 1 Jun 2023 15:58:58 +0000 (UTC) Received: from localhost (unknown [10.42.28.9]) by smtp.corp.redhat.com (Postfix) with ESMTP id E7DB72029F6D; Thu, 1 Jun 2023 15:58:57 +0000 (UTC) To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH] libstdc++: Use AS_IF in configure.ac Date: Thu, 1 Jun 2023 16:58:56 +0100 Message-Id: <20230601155856.305565-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jonathan Wakely via Gcc-patches From: Jonathan Wakely Reply-To: Jonathan Wakely Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767516677776748954?= X-GMAIL-MSGID: =?utf-8?q?1767516677776748954?= Tested x86_64-linux. I'd appreciate a second set of eyeballs on this before I push it. -- >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)