r25068: Older samba3 DCs will return DCERPC_FAULT_OP_RNG_ERROR for every opcode on the
[Samba.git] / source / m4 / check_gnu_make.m4
blob44e1d9aa20efa72706749747dc4356b800bd5a15
1 ##### http://autoconf-archive.cryp.to/check_gnu_make.html
3 # SYNOPSIS
5 #   CHECK_GNU_MAKE()
7 # DESCRIPTION
9 #   This macro searches for a GNU version of make. If a match is found,
10 #   the makefile variable `ifGNUmake' is set to the empty string,
11 #   otherwise it is set to "#". This is useful for including a special
12 #   features in a Makefile, which cannot be handled by other versions
13 #   of make. The variable _cv_gnu_make_command is set to the command to
14 #   invoke GNU make if it exists, the empty string otherwise.
16 #   Here is an example of its use:
18 #   Makefile.in might contain:
20 #       # A failsafe way of putting a dependency rule into a makefile
21 #       $(DEPEND):
22 #               $(CC) -MM $(srcdir)/*.c > $(DEPEND)
24 #       @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND)))
25 #       @ifGNUmake@ include $(DEPEND)
26 #       @ifGNUmake@ endif
28 #   Then configure.in would normally contain:
30 #       CHECK_GNU_MAKE()
31 #       AC_OUTPUT(Makefile)
33 #   Then perhaps to cause gnu make to override any other make, we could
34 #   do something like this (note that GNU make always looks for
35 #   GNUmakefile first):
37 #       if  ! test x$_cv_gnu_make_command = x ; then
38 #               mv Makefile GNUmakefile
39 #               echo .DEFAULT: > Makefile ;
40 #               echo \  $_cv_gnu_make_command \$@ >> Makefile;
41 #       fi
43 #   Then, if any (well almost any) other make is called, and GNU make
44 #   also exists, then the other make wraps the GNU make.
46 # LAST MODIFICATION
48 #   2002-01-04
50 # COPYLEFT
52 #   Copyright (c) 2002 John Darrington <j.darrington@elvis.murdoch.edu.au>
54 #   Copying and distribution of this file, with or without
55 #   modification, are permitted in any medium without royalty provided
56 #   the copyright notice and this notice are preserved.
58 AC_DEFUN(
59         [CHECK_GNU_MAKE], [ AC_CACHE_CHECK( for GNU make,_cv_gnu_make_command,
60                 _cv_gnu_make_command='' ;
61 dnl Search all the common names for GNU make
62                 for a in "$MAKE" make gmake gnumake ; do
63                         if test -z "$a" ; then continue ; fi ;
64                         if  ( sh -c "$a --version" 2> /dev/null | grep GNU  2>&1 > /dev/null ) ;  then
65                                 _cv_gnu_make_command=$a ;
66                                 break;
67                         fi
68                 done ;
69         ) ;
70 dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
71         if test  "x$_cv_gnu_make_command" != "x"  ; then
72                 ifGNUmake='' ;
73         else
74                 ifGNUmake='#' ;
75                 AC_MSG_RESULT("Not found");
76         fi
77         AC_SUBST(ifGNUmake)
78 ] )