freetype-devel
[Top][All Lists]
Advanced

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

grep -E vs. egrep


From: Karl Berry
Subject: grep -E vs. egrep
Date: Sat, 25 Feb 2023 16:19:16 -0700

Hi Werner and all - a recent change replaced egrep with grep -E in
freetype's top-level configure script.

    2022-07-24  Werner Lemberg  <wl@gnu.org>

            * configure: s/egrep/grep -E/
            `egrep` is deprecated.

I'm aware of the egrep issues, but grep -E does not work with the system
grep on Solaris5.10, for which we still build TeX Live. Nor is there an
easy way for us to use a different grep (automatic builds, etc.).

Since neither grep -E nor egrep is portable any more, here is a patch
that does essentially the same test as AC_PROG_EGREP for the top-level
configure.  Can be overridden with the EGREP envvar.

Sorry, I guess I should submit this as an issue, but I don't have an
account on your gitlab and couldn't easily create one right now. Hoping
you'll accept it like this, in the interests of time. --thanks, karl.

--- ORIG/configure
+++ configure
@@ -15,10 +15,19 @@
 
 rm -f config.mk builds/unix/unix-def.mk builds/unix/unix-cc.mk
 
+if test -z "$EGREP"; then
+  if echo a | grep -E '(a|b)' >/dev/null 2>&1; then 
+    EGREP="grep -E"
+  else
+    # if grep -E doesn't work, assume egrep does.
+    EGREP=egrep
+  fi
+fi   
+
 # respect GNUMAKE environment variable for backward compatibility
 if test "x$GNUMAKE" = x; then
   if test "x$MAKE" = x; then
-    if test "x`make -v 2>/dev/null | grep -E 'GNU|makepp'`" = x; then
+    if test "x`make -v 2>/dev/null | $EGREP 'GNU|makepp'`" = x; then
       MAKE=gmake
     else
       MAKE=make
@@ -28,7 +37,7 @@
   MAKE=$GNUMAKE
 fi
 
-if test "x`$MAKE -v 2>/dev/null | grep -E 'GNU|makepp'`" = x; then
+if test "x`$MAKE -v 2>/dev/null | $EGREP 'GNU|makepp'`" = x; then
   echo "GNU make (>= 3.81) or makepp (>= 2.0) is required to build FreeType2." 
>&2
   echo "Please try" >&2
   echo >&2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]