Re: AC_PROG_EGREP and $EGREP_TRADITIONAL and shell conditional statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-03-31 23:19, Khem Raj wrote:

I am also seeing this issue with packages using AC_EGREP_CPP
e.g. mcpp https://mcpp.sourceforge.net/download.html

when reconfigured it fails to run the resulting configure script


checking printf length modifier for the longest integer... (cached) ll
checking for value of __GNUC__... 4
checking for value of __GNUC_MINOR__... 2
../mcpp-2.7.2/configure: line 14378: syntax error near unexpected token `;;'
../mcpp-2.7.2/configure: line 14378: `    '' ;;'

This is surely a bug in mcpp's configure.ac: it's greatly underquoted. I don't recall ever seeing a script that underquoted before.

We're starting to reach the limit of what we can reasonably do in Autoconf to work around buggy usage. That being said, in this particular case the attached simple workaround causes an mcpp 2.7.2 (2008) build to fail on Ubuntu 22.10 the same way that the build fails when running the Autoconf 2.71 that comes with Ubuntu, so I suppose that's progress. I installed the attached.
From 794182506c3c5814d48b2fc4d832770f608ce0ef Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@xxxxxxxxxxx>
Date: Sat, 1 Apr 2023 20:25:13 -0700
Subject: [PATCH] Support underquoted callers better
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem reported bh Khem Raj for mcpp 2.7.2 (2008) in:
https://lists.gnu.org/r/autoconf/2023-04/msg00001.html
* lib/autoconf/programs.m4 (_AC_PATH_PROG_FLAVOR_GNU):
Add two ‘@%:@(’s to cater to underquoted callers.
* lib/m4sugar/m4sh.m4 (_AS_PATH_WALK): Use quadrigraph instead of
‘#’, for underquoted callers.
---
 lib/autoconf/programs.m4 | 5 +++--
 lib/m4sugar/m4sh.m4      | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index 62ba6b8b..d06d18c4 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -543,11 +543,12 @@ dnl   # for best performing tool in a list breaks down.
 # ----------------------------------------------------------------
 m4_define([_AC_PATH_PROG_FLAVOR_GNU],
 [# Check for GNU $1
-case `"$1" --version 2>&1` in
+case `"$1" --version 2>&1` in @%:@(
 *GNU*)
   $2;;
 m4_ifval([$3],
-[*)
+[@%:@(
+*)
   $3;;
 ])esac
 ])# _AC_PATH_PROG_FLAVOR_GNU
diff --git a/lib/m4sugar/m4sh.m4 b/lib/m4sugar/m4sh.m4
index ab5ca7db..368487fa 100644
--- a/lib/m4sugar/m4sh.m4
+++ b/lib/m4sugar/m4sh.m4
@@ -1389,7 +1389,7 @@ m4_if([$1], m4_translit([[$1]], [:;]),
 for as_dir in $as_dummy])
 do
   IFS=$as_save_IFS
-  case $as_dir in #(((
+  case $as_dir in @%:@(((
     '') as_dir=./ ;;
     */) ;;
     *) as_dir=$as_dir/ ;;
-- 
2.37.2


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux