Skip to contentSkip to conversation

configure.ac: avoid bashisms

PATCH In review Lars Wendler via Grub-devel 3 participants 5 messages Oct 29, 2025 – Nov 5, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure.ac: avoid bashisms

or else configure check doesn't succeed with non-bash shell (e.g. dash):

checking whether to enable AMD64 as(1) feature detection... /var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/configure: 39176: test: xx86_64: unexpected operator no

and later build fails with

/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c: In function ‘detect_x86_gnuc’:
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:252:17: error: ‘HWF_INTEL_CPU’ undeclared (first use in this function)

    252 |       result |= HWF_INTEL_CPU;
        |                 ^~~~~~~~~~~~~

and other corresponding HWF_INTEL_* definitions because HAVE_CPU_ARCH_X86 was erroneously not defined by configure script.

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index 8a72c078e..17937baf4 100644
@@ -1150,7 +1150,7 @@ fi
 
 # Implementation of the --disable-amd64-as-feature-detection switch.
 AC_MSG_CHECKING([whether to enable AMD64 as(1) feature detection])
-if test x$target_cpu == xx86_64 -a x$platform == xefi; then
+if test x$target_cpu = xx86_64 -a x$platform = xefi; then
   CPPFLAGS_GCRY_ASM="-D__x86_64 -DHAVE_CPU_ARCH_X86"
   AC_ARG_ENABLE(amd64-as-feature-detection,
     AS_HELP_STRING([--disable-amd64-as-feature-detection],
Signature · 7 lines
2.51.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
author Reviewed-by Gary Lin on v1 1/1
#1 lore raw

On Wed, Oct 29, 2025 at 10:31:31AM +0100, Lars Wendler via Grub-devel wrote:
Hi Lars,

Quoted 7 lines

or else configure check doesn't succeed with non-bash shell (e.g. dash):

checking whether to enable AMD64 as(1) feature detection... /var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/configure: 39176: test: xx86_64: unexpected operator no

and later build fails with

Quoted 7 lines

/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c: In function ‘detect_x86_gnuc’:
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:252:17: error: ‘HWF_INTEL_CPU’ undeclared (first use in this function)

    252 |       result |= HWF_INTEL_CPU;
        |                 ^~~~~~~~~~~~~

and other corresponding HWF_INTEL_* definitions because HAVE_CPU_ARCH_X86 was erroneously not defined by configure script.

Thanks for fixing the error.

Could you add your "Signed-off" to this patch?
With that fixed,

Cheers,

Gary Lin

Quoted 25 lines
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index 8a72c078e..17937baf4 100644
@@ -1150,7 +1150,7 @@ fi
 
 # Implementation of the --disable-amd64-as-feature-detection switch.
 AC_MSG_CHECKING([whether to enable AMD64 as(1) feature detection])
-if test x$target_cpu == xx86_64 -a x$platform == xefi; then
+if test x$target_cpu = xx86_64 -a x$platform = xefi; then
   CPPFLAGS_GCRY_ASM="-D__x86_64 -DHAVE_CPU_ARCH_X86"
   AC_ARG_ENABLE(amd64-as-feature-detection,
     AS_HELP_STRING([--disable-amd64-as-feature-detection],
Signature · 7 lines
2.51.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

#2 lore raw

PATCH 1/1 configure.ac: avoid bashisms

or else configure check doesn't succeed with non-bash shell (e.g. dash):

checking whether to enable AMD64 as(1) feature detection... /var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/configure: 39176: test: xx86_64: unexpected operator no

and later build fails with

/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c: In function ‘detect_x86_gnuc’:
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:252:17: error: ‘HWF_INTEL_CPU’ undeclared (first use in this function)

    252 |       result |= HWF_INTEL_CPU;
        |                 ^~~~~~~~~~~~~

and other corresponding HWF_INTEL_* definitions because HAVE_CPU_ARCH_X86 was erroneously not defined by configure script.

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index 8a72c078e..17937baf4 100644
@@ -1150,7 +1150,7 @@ fi
 
 # Implementation of the --disable-amd64-as-feature-detection switch.
 AC_MSG_CHECKING([whether to enable AMD64 as(1) feature detection])
-if test x$target_cpu == xx86_64 -a x$platform == xefi; then
+if test x$target_cpu = xx86_64 -a x$platform = xefi; then
   CPPFLAGS_GCRY_ASM="-D__x86_64 -DHAVE_CPU_ARCH_X86"
   AC_ARG_ENABLE(amd64-as-feature-detection,
     AS_HELP_STRING([--disable-amd64-as-feature-detection],
Signature · 7 lines
2.51.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Reviewed-by on v1 1/1
#3 lore raw
Quoted 10 lines · Lars Wendler via Grub-devel

or else configure check doesn't succeed with non-bash shell (e.g. dash):

checking whether to enable AMD64 as(1) feature detection... /var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/configure: 39176: test: xx86_64: unexpected operator no

and later build fails with

/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c: In function ‘detect_x86_gnuc’:
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:252:17: error: ‘HWF_INTEL_CPU’ undeclared (first use in this function)

Quoted 7 lines
   252 |       result |= HWF_INTEL_CPU;
       |                 ^~~~~~~~~~~~~

and other corresponding HWF_INTEL_* definitions because HAVE_CPU_ARCH_X86 was erroneously not defined by configure script.

Quoted 25 lines

---
configure.ac | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index 8a72c078e..17937baf4 100644
@@ -1150,7 +1150,7 @@ fi
 
 # Implementation of the --disable-amd64-as-feature-detection switch.
 AC_MSG_CHECKING([whether to enable AMD64 as(1) feature detection])
-if test x$target_cpu == xx86_64 -a x$platform == xefi; then
+if test x$target_cpu = xx86_64 -a x$platform = xefi; then
  CPPFLAGS_GCRY_ASM="-D__x86_64 -DHAVE_CPU_ARCH_X86"
  AC_ARG_ENABLE(amd64-as-feature-detection,
    AS_HELP_STRING([--disable-amd64-as-feature-detection],
Signature · 7 lines
2.51.2


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel

Reviewed-by on v1 1/1
#4 lore raw
In reply to Lars Wendler via Grub-devel
Quoted 9 lines · Lars Wendler via Grub-devel

or else configure check doesn't succeed with non-bash shell (e.g. dash):

checking whether to enable AMD64 as(1) feature detection... /var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/configure: 39176: test: xx86_64: unexpected operator no

and later build fails with

/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c: In function ‘detect_x86_gnuc’:
/var/tmp/portage/sys-boot/grub-2.14_rc1/work/grub-2.14~rc1/grub-core/lib/libgcrypt-grub/src/hwf-x86.c:252:17: error: ‘HWF_INTEL_CPU’ undeclared (first use in this function)

Quoted 7 lines
    252 |       result |= HWF_INTEL_CPU;
        |                 ^~~~~~~~~~~~~

and other corresponding HWF_INTEL_* definitions because HAVE_CPU_ARCH_X86 was erroneously not defined by configure script.

Daniel

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel