From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2c.google.com (mail-oa1-x2c.google.com [IPv6:2001:4860:4864:20::2c]) by sourceware.org (Postfix) with ESMTPS id 94ABC394742A for ; Tue, 22 Mar 2022 17:45:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 94ABC394742A Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-de2cb87f6aso2415428fac.10 for ; Tue, 22 Mar 2022 10:45:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=+yfMvhHZ7V286B5lXI5gA+Fn6ZuuqcxMjere9m+rn7U=; b=E4r34Wgh9a88tENwnEjaoyn8bxeoOd8M9FkjVaqrApgtZpozB6B2/6rfzXesSQ1wi5 ErmZuN/hjloVzdaD6VEft96nZW5NBjWrbh3V0sQjdt8/QfA3VFLn8Ky7V0W2URfwu+vC rpsK0nLeH2ULt5eqrg8/UnTJGS+CF3sTKlo45HdOy/iooTxcgXw8dL/8BOOEV7iYeQBb tcTXmq2c6CUDuk2s00KZz13kOZiI5LzcmqGIBl2tiiLPDoFTb6Gj6h/5gmWoC2JkeokS JJ+J7RfNH81rwMcLHq6lBKsoBxU/qfHzIL+UUGpH5E2LREkThHmAqBA0/rHUHkB0K6W8 wPVg== X-Gm-Message-State: AOAM5335sFydEH+KAAZHHzyjjjVNCXHEGJ3hoEgxekPSmKdwMaWxP2aH wykcveIG+82MD1guJ4IV1iFJYXnD85khIw== X-Google-Smtp-Source: ABdhPJxTxtnM3xn+ALoo3tUXyUH1kfcXLz18ifcsQJS4M0t9727FYoWwQQuTc8mdxXmByiant+6znw== X-Received: by 2002:a05:6870:589b:b0:da:b3f:2b68 with SMTP id be27-20020a056870589b00b000da0b3f2b68mr2181036oab.263.1647971152348; Tue, 22 Mar 2022 10:45:52 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:2d55:3e27:6bd1:b1d4:af84? ([2804:431:c7ca:2d55:3e27:6bd1:b1d4:af84]) by smtp.gmail.com with ESMTPSA id v7-20020a056830140700b005cd9f212402sm897237otp.0.2022.03.22.10.45.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 22 Mar 2022 10:45:51 -0700 (PDT) Message-ID: <290768f3-697f-caa6-be4a-3f5e0dd94e5d@linaro.org> Date: Tue, 22 Mar 2022 14:45:48 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v3] configure.ac: fix bashisms in configure.ac Content-Language: en-US To: Sam James , libc-alpha@sourceware.org References: <20220322173309.2024872-1-sam@gentoo.org> From: Adhemerval Zanella In-Reply-To: <20220322173309.2024872-1-sam@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2022 17:45:57 -0000 On 22/03/2022 14:33, Sam James wrote: > configure scripts need to be runnable with a POSIX-compliant /bin/sh. > > On many (but not all!) systems, /bin/sh is provided by Bash, so errors > like this aren't spotted. Notably Debian defaults to /bin/sh provided > by dash which doesn't tolerate such bashisms as '=='. > > This retains compatibility with bash. > > Fixes configure warnings/errors like: > ``` > checking if compiler warns about alias for function with incompatible types... yes > /var/tmp/portage/sys-libs/glibc-2.34-r10/work/glibc-2.34/configure: 4209: test: xyes: unexpected operator > ``` > > Reviewed-by: Adhemerval Zanella > Signed-off-by: Sam James LGTM ;) > --- > configure | 2 +- > configure.ac | 2 +- > sysdeps/powerpc/powerpc64/le/configure | 2 +- > sysdeps/powerpc/powerpc64/le/configure.ac | 2 +- > sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure | 2 +- > sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac | 2 +- > 6 files changed, 6 insertions(+), 6 deletions(-) > > diff --git a/configure b/configure > index 8e5bee775a..2a3cb49b0b 100755 > --- a/configure > +++ b/configure > @@ -4232,7 +4232,7 @@ if test x"$libc_cv_gcc_indirect_function" != xyes; then > # GCC 8+ emits a warning for alias with incompatible types and it might > # fail to build ifunc resolvers aliases to either weak or internal > # symbols. Disables multiarch build in this case. > - if test x"$libc_cv_gcc_incompatible_alias" == xyes; then > + if test x"$libc_cv_gcc_incompatible_alias" = xyes; then > { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gcc emits a warning for alias between functions of incompatible types" >&5 > $as_echo "$as_me: WARNING: gcc emits a warning for alias between functions of incompatible types" >&2;} > if test x"$multi_arch" = xyes; then > diff --git a/configure.ac b/configure.ac > index 87f67d25ec..fa7d3c025b 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -767,7 +767,7 @@ if test x"$libc_cv_gcc_indirect_function" != xyes; then > # GCC 8+ emits a warning for alias with incompatible types and it might > # fail to build ifunc resolvers aliases to either weak or internal > # symbols. Disables multiarch build in this case. > - if test x"$libc_cv_gcc_incompatible_alias" == xyes; then > + if test x"$libc_cv_gcc_incompatible_alias" = xyes; then > AC_MSG_WARN([gcc emits a warning for alias between functions of incompatible types]) > if test x"$multi_arch" = xyes; then > AC_MSG_ERROR([--enable-multi-arch support requires a gcc with gnu-indirect-function support]) > diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure > index 35950a6ddd..395f9f7309 100644 > --- a/sysdeps/powerpc/powerpc64/le/configure > +++ b/sysdeps/powerpc/powerpc64/le/configure > @@ -113,7 +113,7 @@ CFLAGS="$save_CFLAGS" > fi > { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_powerpc64le_ldbl128_mabi" >&5 > $as_echo "$libc_cv_compiler_powerpc64le_ldbl128_mabi" >&6; } > -if test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"; then : > +if test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"; then : > critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously." > fi > > diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac > index 9f0423ede2..48d7089b63 100644 > --- a/sysdeps/powerpc/powerpc64/le/configure.ac > +++ b/sysdeps/powerpc/powerpc64/le/configure.ac > @@ -63,7 +63,7 @@ long double x; > [libc_cv_compiler_powerpc64le_ldbl128_mabi=yes], > [libc_cv_compiler_powerpc64le_ldbl128_mabi=no]) > CFLAGS="$save_CFLAGS"]) > -AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"], > +AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"], > [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."]) > > dnl objcopy (binutils) 2.26 or newer required to support the --update-section > diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure > index 4ca1d15833..b95a720549 100644 > --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure > +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure > @@ -25,7 +25,7 @@ fi > $as_echo "$libc_cv_mcpu_power10" >&6; } > config_vars="$config_vars > mcpu-power10 = $libc_cv_mcpu_power10" > -if test "$libc_cv_mcpu_power10" == "yes"; then : > +if test "$libc_cv_mcpu_power10" = "yes"; then : > > $as_echo "#define USE_PPC64_MCPU_POWER10 1" >>confdefs.h > > diff --git a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac > index ceb578cc59..257ca6c110 100644 > --- a/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac > +++ b/sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac > @@ -9,6 +9,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ > [libc_cv_mcpu_power10=yes], > [libc_cv_mcpu_power10=no])]) > LIBC_CONFIG_VAR([mcpu-power10], [$libc_cv_mcpu_power10]) > -AS_IF([[test "$libc_cv_mcpu_power10" == "yes"]],[ > +AS_IF([[test "$libc_cv_mcpu_power10" = "yes"]],[ > AC_DEFINE(USE_PPC64_MCPU_POWER10)]) > CFLAGS="$OLD_CFLAGS"