* [PATCH] configure.ac: fix bashism in configure.ac @ 2022-03-21 23:03 Sam James 2022-03-22 12:46 ` Adhemerval Zanella 2022-03-22 17:33 ` [PATCH v3] configure.ac: fix bashisms " Sam James 0 siblings, 2 replies; 6+ messages in thread From: Sam James @ 2022-03-21 23:03 UTC (permalink / raw) To: libc-alpha 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 +- 2 files changed, 2 insertions(+), 2 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]) -- 2.35.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] configure.ac: fix bashism in configure.ac 2022-03-21 23:03 [PATCH] configure.ac: fix bashism in configure.ac Sam James @ 2022-03-22 12:46 ` Adhemerval Zanella 2022-03-22 17:15 ` Sam James 2022-03-22 17:33 ` [PATCH v3] configure.ac: fix bashisms " Sam James 1 sibling, 1 reply; 6+ messages in thread From: Adhemerval Zanella @ 2022-03-22 12:46 UTC (permalink / raw) To: Sam James, libc-alpha On 21/03/2022 20:03, Sam James via Libc-alpha 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 > ``` > > Signed-off-by: Sam James <sam@gentoo.org> There are other occurrences of this bashism as on other configure.ac: sysdeps/powerpc/powerpc64/le/configure.ac:66:AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"], sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac:12:AS_IF([[test "$libc_cv_mcpu_power10" == "yes"]],[ Should we fix it them as well? Beside LGTM, thanks. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> > --- > configure | 2 +- > configure.ac | 2 +- > 2 files changed, 2 insertions(+), 2 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]) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] configure.ac: fix bashism in configure.ac 2022-03-22 12:46 ` Adhemerval Zanella @ 2022-03-22 17:15 ` Sam James 0 siblings, 0 replies; 6+ messages in thread From: Sam James @ 2022-03-22 17:15 UTC (permalink / raw) To: Adhemerval Zanella; +Cc: libc-alpha [-- Attachment #1: Type: text/plain, Size: 1404 bytes --] > On 22 Mar 2022, at 12:46, Adhemerval Zanella <adhemerval.zanella@linaro.org> wrote: > > > > On 21/03/2022 20:03, Sam James via Libc-alpha 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 >> ``` >> >> Signed-off-by: Sam James <sam@gentoo.org> > > There are other occurrences of this bashism as on other configure.ac: > > sysdeps/powerpc/powerpc64/le/configure.ac:66:AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" == "no"], > sysdeps/powerpc/powerpc64/le/fpu/multiarch/configure.ac:12:AS_IF([[test "$libc_cv_mcpu_power10" == "yes"]],[ > > Should we fix it them as well? > Thanks, I goofed up the grep. Fixed! > Beside LGTM, thanks. > > Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> I forgot to add your tag on sending v2, but I didn't want to send a v3 for it (unless I should?) Best, sam [-- Attachment #2: Message signed with OpenPGP --] [-- Type: application/pgp-signature, Size: 618 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3] configure.ac: fix bashisms in configure.ac @ 2022-03-22 17:33 ` Sam James 2022-03-22 17:45 ` Adhemerval Zanella 2022-03-23 1:53 ` Mike Frysinger 0 siblings, 2 replies; 6+ messages in thread From: Sam James @ 2022-03-22 17:33 UTC (permalink / raw) To: libc-alpha 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 <adhemerval.zanella@linaro.org> Signed-off-by: Sam James <sam@gentoo.org> --- 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" -- 2.35.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] configure.ac: fix bashisms in configure.ac 2022-03-22 17:33 ` [PATCH v3] configure.ac: fix bashisms " Sam James @ 2022-03-22 17:45 ` Adhemerval Zanella 2022-03-23 1:53 ` Mike Frysinger 1 sibling, 0 replies; 6+ messages in thread From: Adhemerval Zanella @ 2022-03-22 17:45 UTC (permalink / raw) To: Sam James, libc-alpha 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 <adhemerval.zanella@linaro.org> > Signed-off-by: Sam James <sam@gentoo.org> 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" ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3] configure.ac: fix bashisms in configure.ac 2022-03-22 17:33 ` [PATCH v3] configure.ac: fix bashisms " Sam James 2022-03-22 17:45 ` Adhemerval Zanella @ 2022-03-23 1:53 ` Mike Frysinger 1 sibling, 0 replies; 6+ messages in thread From: Mike Frysinger @ 2022-03-23 1:53 UTC (permalink / raw) To: Sam James; +Cc: libc-alpha [-- Attachment #1: Type: text/plain, Size: 659 bytes --] On 22 Mar 2022 17:33, Sam James via Libc-alpha 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 > ``` lgtm, pushed! -mike [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-03-23 1:53 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-03-21 23:03 [PATCH] configure.ac: fix bashism in configure.ac Sam James 2022-03-22 12:46 ` Adhemerval Zanella 2022-03-22 17:15 ` Sam James 2022-03-22 17:33 ` [PATCH v3] configure.ac: fix bashisms " Sam James 2022-03-22 17:45 ` Adhemerval Zanella 2022-03-23 1:53 ` Mike Frysinger
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).