From 4a053eee4b8389cbb190728d981399c1ef80d5c6 Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Tue, 25 Mar 2008 11:10:25 +0000
Subject: [PATCH] add mandatory check for GNU Make >= 3.80.

git-svn-id: http://root.cern.ch/svn/root/trunk@22823 27541ba8-7e3a-0410-8455-c3a389f83636
---
 configure | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index a7f5611d24e..202bd2d2e55 100755
--- a/configure
+++ b/configure
@@ -1082,12 +1082,6 @@ hpuxia64acc)
    checkhpux64="yes" ;;
 esac
 
-# check for (g)make
-case $platform in
-win32|linux|macosx) gnumake="make"  ;;
-*)                  gnumake="gmake" ;;
-esac
-
 # check for which
 case $platform in
 macosx) cwhich="type -path" ;;
@@ -1352,6 +1346,35 @@ if test "x$platform" = "xwin32"; then
     enable_shared="no"
 fi
 
+######################################################################
+#
+### echo %%% check for GNU make >= 3.80 - Mandatory version of make
+#
+# Mandatory test, must succeed
+# Check for GNU make >= 3.80
+#
+message "Checking for GNU Make version >= 3.80"
+gnumake="make"
+gnu=`$gnumake -v | awk 'BEGIN { FS=" "} { if (NR==1) print $1 }'`
+if test ! "x$gnu" = "xGNU" ; then
+    gnumake="gmake"
+    gnu=`$gnumake -v | awk 'BEGIN { FS=" "} { if (NR==1) print $1 }'`
+    if test ! "x$gnu" = "xGNU" ; then
+        gnumake=""
+    fi
+fi
+if test ! "x$gnumake" = "x" ; then
+    gnuv=`$gnumake -v | tr '.' ' ' | awk 'BEGIN { FS=" "} { if (NR==1) printf "%d", $3*100+$4 }'`
+    if test $gnuv -lt 380 ; then
+        result "`basename $0`: GNU Make >= 3.80 MUST be installed, current version $gnuv is too old"
+        exit 1
+    fi
+    result "ok"
+else
+    result "`basename $0`: GNU Make >= 3.80 MUST be installed"
+    exit 1
+fi
+
 ######################################################################
 #
 ### echo %%% X11 and XPM Library - Mandatory lib on Unix
@@ -1413,7 +1436,6 @@ if test ! "$platform" = "win32"; then
     fi
 fi
 
-
 ######################################################################
 #
 ### echo %%%Xft support (X11 antialiased fonts)
@@ -1971,7 +1993,7 @@ check_qtvers()
     if test $? -eq 0 ; then
 	logmsg " Got Qt version $qtverstr"
 	qtgot=`echo $qtverstr | \
-	    awk 'BEGIN {FS="."} {printf "%d", ((($1*2^8)+$2)*2^8)+$3; }'`;
+	    awk 'BEGIN {FS="."} {printf "%d", ((($1*2^8)+$2)*2^8)+$3; }'`
 	qtneed=`echo $qtverneed | \
 	    awk 'BEGIN {FS="."}{ printf "%d", (($1*2^8)+$2)*2^8+$3; }'`
 	qtnew=`echo $qttoonew | \
@@ -1985,7 +2007,7 @@ check_qtvers()
 	    res="no"
 	else
 	    res="$qtverstr"
-	    qtvers=`echo $qtverstr | awk 'BEGIN{FS="."}{print $1}'`
+	    qtvers=`echo $qtverstr | awk 'BEGIN {FS="."} {print $1}'`
 	fi
     else
 	res="no"
-- 
GitLab