summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/TLpatches/patch-02-grep
blob: 4a545b28af6b47d72256ee59ee1f70dda5bf7080 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
grep -E is not supported by system grep on Solaris 5.10.
But egrep is no longer universally supported either; GNU grep 3.8
intentionally broke it. So test.

--- configure	(revision 66134)
+++ configure	(working copy)
@@ -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