public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Sam James <sam@gentoo.org>
To: libc-alpha@sourceware.org
Subject: [PATCH v2] configure.ac: fix bashisms in configure.ac
Date: Tue, 22 Mar 2022 17:11:17 +0000	[thread overview]
Message-ID: <20220322171117.1945898-1-sam@gentoo.org> (raw)

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
```

Signed-off-by: Sam James <sam@gentoo.org>
---
 configure                                               | 2 +-
 configure.ac                                            | 2 +-
 sysdeps/powerpc/powerpc64/le/configure.ac               | 2 +-
 sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac | 2 +-
 4 files changed, 4 insertions(+), 4 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.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.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"
-- 
2.35.1



             reply	other threads:[~2022-03-22 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-22 17:11 Sam James [this message]
2022-03-22 17:30 ` Adhemerval Zanella
2022-03-22 17:32   ` Sam James

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220322171117.1945898-1-sam@gentoo.org \
    --to=sam@gentoo.org \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).