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: 70464 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF174385C6EA for ; Thu, 1 Jun 2023 16:00:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DF174385C6EA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685635205; bh=N0fnFvGHesJuMlE/Y6bXGHNaeJ6trniPr0nYYika914=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=TuH4y7u+EOHHsHtqwQ/H7gKoFnR6XjICqbCPyE02LB+ObGoO21YtKL0iTpslkIS/7 9rinvqKwAck5heDlLM+MVGm2bFdviiZr6kEzkSHQ2cjoAbkHDwJmBqyGKPhfBY6wmi hLPDOdwiQfC1L8VIEUSobQqJ0mke56MzvqGbwf7A= 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" 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)