Re: Possible regressions with trunk autoconf (vs 2.71)

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

 



On 2022-11-17 04:41, Frederic Berat wrote:
They have the following code in their aclocal.m4{,.cross} files:

Does the attached, self-contained configure.ac illustrate the problem for you? I don't want to have to figure out all of Wine.

Also, can you narrow down which Autoconf commit causes Wine's buggy configure.ac to stop working? Is it the attached one?

Attachment: configure.ac
Description: application/pkix-attr-cert

From 0c762675366bb7ce256812bbc40aa8afa004f1f2 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@xxxxxxxxxxx>
Date: Sun, 5 Jun 2022 14:19:21 -0700
Subject: [PATCH] Fix bug: AC_EGREP_CPP with leading '-' in pattern

Also, port AC_EGREP_CPP to AT&T UnixPC.
Latter problem reported by Alain Knaff [sr #110657].
* lib/autoconf/general.m4 (AC_EGREP_CPP): Use new _AC_PROG_GREP.
Work even if the pattern starts with "-".
* lib/autoconf/programs.m4 (_AC_PROG_GREP):
New optional arg ACTION-IF-NOT-FOUND.
(_AC_PROG_EGREP_TRADITIONAL): New macro.
---
 lib/autoconf/general.m4  |  4 ++--
 lib/autoconf/programs.m4 | 22 +++++++++++++++++++---
 2 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index 3a0e47b9..5540ae05 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2770,13 +2770,13 @@ AU_DEFUN([AC_TRY_CPP],
 # come early, it is not included in AC_BEFORE checks.
 AC_DEFUN([AC_EGREP_CPP],
 [AC_LANG_PREPROC_REQUIRE()dnl
-AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([_AC_PROG_EGREP_TRADITIONAL])dnl
 AC_LANG_CONFTEST([AC_LANG_SOURCE([[$2]])])
 AS_IF([dnl eval is necessary to expand ac_cpp.
 dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
 (eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
 dnl Quote $1 to prevent m4 from eating character classes
-  $EGREP "[$1]" >/dev/null 2>&1],
+  $EGREP_TRADITIONAL "m4_bregexp([$1],[^[$-]],[.?])[$1]" >/dev/null 2>&1],
   [$3],
   [$4])
 rm -rf conftest*
diff --git a/lib/autoconf/programs.m4 b/lib/autoconf/programs.m4
index 67435a9f..f29d6162 100644
--- a/lib/autoconf/programs.m4
+++ b/lib/autoconf/programs.m4
@@ -373,6 +373,21 @@ AC_CACHE_CHECK([for egrep], ac_cv_path_EGREP,
  AC_SUBST([EGREP])
 ])# AC_PROG_EGREP
 
+# _AC_PROG_EGREP_TRADITIONAL
+# --------------------------
+# Check for a grep -E program or equivalent.
+# Less stringent than AC_PROG_EGREP, as it succeeds even if there
+# is no working 'grep' or if the -e option does not work (e.g., AT&T UnixPC).
+AC_DEFUN([_AC_PROG_EGREP_TRADITIONAL],
+[AC_CACHE_CHECK([for egrep -e], [ac_cv_path_EGREP_TRADITIONAL],
+   [_AC_PROG_GREP([EGREP_TRADITIONAL], [grep ggrep],
+      [-E 'EGR(EP|AC)_TRADITIONAL$'], [:])
+    AS_IF([test "$ac_cv_path_EGREP_TRADITIONAL"],
+      [ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E"],
+      [_AC_PROG_GREP([EGREP_TRADITIONAL], [egrep],
+	 ['EGR(EP|AC)_TRADITIONAL$'])])])
+ EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL
+])
 
 # AC_PROG_FGREP
 # -------------
@@ -402,15 +417,16 @@ AC_DEFUN([AC_PROG_GREP],
 ])
 
 
-# _AC_PROG_GREP(VARIABLE, PROGNAME-LIST, PROG-ARGUMENTS)
-# ------------------------------------------------------
+# _AC_PROG_GREP(VARIABLE, PROGNAME-LIST, [PROG-ARGUMENTS],
+# 		[ACTION-IF-NOT-FOUND])
+# --------------------------------------------------------
 # Solaris 9 /usr/xpg4/bin/*grep is suitable, but /usr/bin/*grep lacks -e.
 # AIX silently truncates long lines before matching.
 # NeXT understands only one -e and truncates long lines.
 m4_define([_AC_PROG_GREP],
 [_AC_PATH_PROGS_FEATURE_CHECK([$1], [$2],
 	[_AC_FEATURE_CHECK_LENGTH([ac_path_$1], [ac_cv_path_$1],
-		["$ac_path_$1" $3], [$1])], [],
+		["$ac_path_$1" $3], [$1])], [$4],
 	[$PATH$PATH_SEPARATOR/usr/xpg4/bin])dnl
 ])
 
-- 
2.37.2


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

  Powered by Linux