summaryrefslogtreecommitdiff
path: root/source4/build/m4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-03-20 15:34:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:58:53 -0500
commit61ec62fb2757253a509b57b3e7815c1fb6d0a94b (patch)
tree83a91f5ff0d9cb9e1d0c1a530fe942cf9950bc25 /source4/build/m4
parent9ef4e90539c6d262a5fbc36bdde2c8355be3aa56 (diff)
downloadsamba-61ec62fb2757253a509b57b3e7815c1fb6d0a94b.tar.gz
samba-61ec62fb2757253a509b57b3e7815c1fb6d0a94b.tar.bz2
samba-61ec62fb2757253a509b57b3e7815c1fb6d0a94b.zip
r14583: Enable automatic dependencies only if GNU make >= 3.81 is present.
(This used to be commit 2b22f1853306625a4c59763ef11965ac8900d4ff)
Diffstat (limited to 'source4/build/m4')
-rw-r--r--source4/build/m4/check_cc.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/source4/build/m4/check_cc.m4 b/source4/build/m4/check_cc.m4
index bdee2b99c3..277afc18c6 100644
--- a/source4/build/m4/check_cc.m4
+++ b/source4/build/m4/check_cc.m4
@@ -193,3 +193,34 @@ if test x"$samba_cv_HAVE_FUNCTION_MACRO" = x"yes"; then
AC_DEFINE(HAVE_FUNCTION_MACRO,1,[Whether there is a __FUNCTION__ macro])
fi
+AC_PATH_PROG(MAKE,make)
+
+AC_CACHE_CHECK([whether we have GNU make], samba_cv_gnu_make, [
+if $ac_cv_path_MAKE --version | head -1 | grep GNU 2>/dev/null >/dev/null
+then
+ samba_cv_gnu_make=yes
+else
+ samba_cv_gnu_make=no
+fi
+])
+
+GNU_MAKE=$samba_cv_gnu_make
+AC_SUBST(GNU_MAKE)
+
+if test "x$GNU_MAKE" = x"yes"; then
+ AC_CACHE_CHECK([GNU make version], samba_cv_gnu_make_version,[
+ samba_cv_gnu_make_version=`$ac_cv_path_MAKE --version | head -1 | cut -d " " -f 3 2>/dev/null`
+ ])
+ GNU_MAKE_VERSION=$samba_cv_gnu_make_version
+ AC_SUBST(GNU_MAKE_VERSION)
+fi
+
+automatic_dependencies=no
+AC_MSG_CHECKING([for GNU make >= 3.81])
+if test x$GNU_MAKE = x"yes"; then
+ if $PERL -e " \$_ = '$GNU_MAKE_VERSION'; s/@<:@^\d\.@:>@.*//g; exit (\$_ < 3.81);"; then
+ automatic_dependencies=yes
+ fi
+fi
+AC_MSG_RESULT($automatic_dependencies)
+AC_SUBST(automatic_dependencies)