Make sure we test the right variable for the AC_DEFINE
[oota-llvm.git] / autoconf / m4 / check_gnu_make.m4
1 #
2 # Check for GNU Make.  This is from
3 # http://www.gnu.org/software/ac-archive/htmldoc/check_gnu_make.html
4 #
5 AC_DEFUN([AC_CHECK_GNU_MAKE],
6 [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
7                 _cv_gnu_make_command='' ;
8 dnl Search all the common names for GNU make
9                 for a in "$MAKE" make gmake gnumake ; do
10                         if test -z "$a" ; then continue ; fi ;
11                         if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
12                                 _cv_gnu_make_command=$a ;
13                                 break;
14                         fi
15                 done ;
16         ) ;
17 dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
18         if test  "x$_cv_gnu_make_command" != "x"  ; then
19                 ifGNUmake='' ;
20         else
21                 ifGNUmake='#' ;
22                 AC_MSG_RESULT("Not found");
23         fi
24         AC_SUBST(ifGNUmake)
25 ])