From 6ec6d652bde6ee2c00ad8e38a684ec6f690ec7e2 Mon Sep 17 00:00:00 2001
From: Russell Bryant <russell@russellbryant.com>
Date: Thu, 17 Aug 2006 06:16:00 +0000
Subject: [PATCH] print a warning at the end of the configure script if the
 version of GNU Make in use is a version earlier than 3.81

This is for file :)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40153 65c4cc65-6c06-0410-ace0-fbb531ad65f3
---
 acinclude.m4 |  4 ++++
 configure    | 23 ++++++++++++++++++++++-
 configure.ac | 10 ++++++++++
 3 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 1817736970..521b180143 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -84,10 +84,14 @@ fi
 AC_DEFUN(
 [AST_CHECK_GNU_MAKE], [AC_CACHE_CHECK(for GNU make, GNU_MAKE,
    GNU_MAKE='Not Found' ;
+   GNU_MAKE_VERSION_MAJOR=0 ;
+   GNU_MAKE_VERSION_MINOR=0 ;
    for a in make gmake gnumake ; do
       if test -z "$a" ; then continue ; fi ;
       if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
          GNU_MAKE=$a ;
+	 GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
+	 GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.'`
          break;
       fi
    done ;
diff --git a/configure b/configure
index 47b7d6440d..9813923dee 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.ac Revision: 37678 .
+# From configure.ac Revision: 39615 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.60.
 #
@@ -5148,10 +5148,14 @@ if test "${GNU_MAKE+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   GNU_MAKE='Not Found' ;
+   GNU_MAKE_VERSION_MAJOR=0 ;
+   GNU_MAKE_VERSION_MINOR=0 ;
    for a in make gmake gnumake ; do
       if test -z "$a" ; then continue ; fi ;
       if ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
          GNU_MAKE=$a ;
+	 GNU_MAKE_VERSION_MAJOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f3 -d' ' | cut -f1 -d'.'`
+	 GNU_MAKE_VERSION_MINOR=`$GNU_MAKE --version | grep "GNU Make" | cut -f2 -d'.'`
          break;
       fi
    done ;
@@ -29090,3 +29094,20 @@ echo "$as_me: Cross Compilation = YES" >&6;}
    { echo "$as_me:$LINENO: Target            = ${host}" >&5
 echo "$as_me: Target            = ${host}" >&6;}
 fi
+
+if test ${GNU_MAKE_VERSION_MAJOR} -lt 3 || test ${GNU_MAKE_VERSION_MINOR} -lt 81 ; then
+   { echo "$as_me:$LINENO: " >&5
+echo "$as_me: " >&6;}
+   { echo "$as_me:$LINENO: ***** WARNING ******" >&5
+echo "$as_me: ***** WARNING ******" >&6;}
+   { echo "$as_me:$LINENO: You are currently using GNU Make version ${GNU_MAKE_VERSION_MAJOR}.${GNU_MAKE_VERSION_MINOR}." >&5
+echo "$as_me: You are currently using GNU Make version ${GNU_MAKE_VERSION_MAJOR}.${GNU_MAKE_VERSION_MINOR}." >&6;}
+   { echo "$as_me:$LINENO: The Asterisk build system uses features that may not work correctly prior to 3.81." >&5
+echo "$as_me: The Asterisk build system uses features that may not work correctly prior to 3.81." >&6;}
+   { echo "$as_me:$LINENO: Please consider upgrading GNU Make or you may experience problems." >&5
+echo "$as_me: Please consider upgrading GNU Make or you may experience problems." >&6;}
+   { echo "$as_me:$LINENO: ********************" >&5
+echo "$as_me: ********************" >&6;}
+   { echo "$as_me:$LINENO: " >&5
+echo "$as_me: " >&6;}
+fi
diff --git a/configure.ac b/configure.ac
index ff1e026260..83cf0242ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -932,3 +932,13 @@ if test "x${crossCompile}" = xYes; then
    AC_MSG_NOTICE( Cross Compilation = YES)
    AC_MSG_NOTICE( Target            = ${host})
 fi
+
+if test ${GNU_MAKE_VERSION_MAJOR} -lt 3 || test ${GNU_MAKE_VERSION_MINOR} -lt 81 ; then
+   AC_MSG_NOTICE()
+   AC_MSG_NOTICE(***** WARNING ******)
+   AC_MSG_NOTICE(You are currently using GNU Make version ${GNU_MAKE_VERSION_MAJOR}.${GNU_MAKE_VERSION_MINOR}.)
+   AC_MSG_NOTICE(The Asterisk build system uses features that may not work correctly prior to 3.81.)
+   AC_MSG_NOTICE(Please consider upgrading GNU Make or you may experience problems.)
+   AC_MSG_NOTICE(********************)
+   AC_MSG_NOTICE()
+fi
-- 
GitLab