automake-patches
[Top][All Lists]
Advanced

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

[FYI] {maint} test defs: backport optimized 'using_gmake' implementation


From: Stefano Lattarini
Subject: [FYI] {maint} test defs: backport optimized 'using_gmake' implementation
Date: Sat, 14 Jan 2012 10:32:49 +0100

* tests/defs.in (using_gmake): Backport optimized, result-caching
implementation from master.
---
 tests/defs.in |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/tests/defs.in b/tests/defs.in
index 0ee53c2..31426f2 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -493,13 +493,30 @@ is_newest ()
 # using_gmake
 # -----------
 # Return success if $MAKE is GNU make, return failure otherwise.
+# Caches the result for speed reasons.
 using_gmake ()
 {
-  # Use --version AND -v, because SGI Make doesn't fail on --version.
-  # Also grep for GNU because newer versions of FreeBSD make do
-  # not complain about `--version' (they seem to silently ignore it).
-  $MAKE --version -v | grep GNU
+  case $am__using_gmake in
+    yes)
+      return 0;;
+    no)
+      return 1;;
+    '')
+      # Use --version AND -v, because SGI Make doesn't fail on --version.
+      # Also grep for GNU because newer versions of FreeBSD make do
+      # not complain about `--version' (they seem to silently ignore it).
+      if $MAKE --version -v | grep GNU; then
+        am__using_gmake=yes
+        return 0
+      else
+        am__using_gmake=no
+        return 1
+      fi;;
+    *)
+      fatal_ "invalid value for \$am__using_gmake: '$am__using_gmake'";;
+  esac
 }
+am__using_gmake="" # Avoid interferences from the environment.
 
 # AUTOMAKE_run status [options...]
 # --------------------------------
-- 
1.7.7.3




reply via email to

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