r18500: move make related checks into its own file
[ira/wip.git] / source / build / m4 / check_make.m4
1 dnl SMB Build Environment make Checks
2 dnl -------------------------------------------------------
3 dnl  Copyright (C) Stefan (metze) Metzmacher 2004
4 dnl  Released under the GNU GPL
5 dnl -------------------------------------------------------
6 dnl
7
8 AC_PATH_PROG(MAKE,make)
9
10 AC_CACHE_CHECK([whether we have GNU make], samba_cv_gnu_make, [
11 if $ac_cv_path_MAKE --version | head -1 | grep GNU 2>/dev/null >/dev/null
12 then
13         samba_cv_gnu_make=yes
14 else
15         samba_cv_gnu_make=no
16 fi
17 ])
18
19 GNU_MAKE=$samba_cv_gnu_make
20 AC_SUBST(GNU_MAKE)
21
22 if test "x$GNU_MAKE" = x"yes"; then
23         AC_CACHE_CHECK([GNU make version], samba_cv_gnu_make_version,[
24                 samba_cv_gnu_make_version=`$ac_cv_path_MAKE --version | head -1 | cut -d " " -f 3 2>/dev/null`
25         ])
26         GNU_MAKE_VERSION=$samba_cv_gnu_make_version
27         AC_SUBST(GNU_MAKE_VERSION)
28 fi
29
30
31 new_make=no
32 AC_MSG_CHECKING([for GNU make >= 3.81])
33 if test x$GNU_MAKE = x"yes"; then
34         if $PERL -e " \$_ = '$GNU_MAKE_VERSION'; s/@<:@^\d\.@:>@.*//g; exit (\$_ < 3.81);"; then
35                 new_make=yes
36         fi
37 fi
38 AC_MSG_RESULT($new_make)
39 automatic_dependencies=no
40 AX_CFLAGS_GCC_OPTION([-M -MT conftest.d -MF conftest.o], [], [ automatic_dependencies=$new_make ], [])
41 AC_MSG_CHECKING([Whether to use automatic dependencies])
42 AC_MSG_RESULT($automatic_dependencies)
43 AC_SUBST(automatic_dependencies)