Makefiles: Enable "dist-hook-git" check only when GNU make is in use.
authorBen Pfaff <blp@nicira.com>
Wed, 25 Jul 2012 17:25:55 +0000 (10:25 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 25 Jul 2012 19:39:41 +0000 (12:39 -0700)
Otherwise, it will always fail because the Makefile in datapath/linux
requires GNU make to generate the list of distributed files.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reported-by: Ed Maste <emaste@freebsd.org>
Makefile.am
acinclude.m4
configure.ac

index 6615fd6..50c4b14 100644 (file)
@@ -133,6 +133,11 @@ CLEAN_LOCAL += clean-pycov
 
 # If we're checked out from a Git repository, make sure that every
 # file that is in Git is distributed.
+#
+# We only enable this check when GNU make is in use because the
+# Makefile in datapath/linux, needed to get the list of files to
+# distribute, requires GNU make extensions.
+if GNU_MAKE
 ALL_LOCAL += dist-hook-git
 dist-hook-git: distfiles
        @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1; then \
@@ -148,7 +153,6 @@ dist-hook-git: distfiles
            exit 1;                                                         \
          fi;                                                               \
        fi
-.PHONY: dist-hook-git
 CLEANFILES += all-distfiles all-gitfiles missing-distfiles
 # The following is based on commands for the Automake "distdir" target.
 distfiles: Makefile
@@ -159,6 +163,8 @@ distfiles: Makefile
          sed -e "s|^$$srcdirstrip/||;t" \
              -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t" | sort -u > $@
 CLEANFILES += distfiles
+endif
+.PHONY: dist-hook-git
 
 # Check that "struct vlog_ratelimit" is always declared "static".
 ALL_LOCAL += rate-limit-check
index 8bd4544..c332b41 100644 (file)
@@ -427,6 +427,27 @@ EOF
         ovs_cv_gnu_make_if=no
       fi])])
 
+dnl OVS_CHECK_GNU_MAKE
+dnl
+dnl Checks whether make is GNU make (because Linux kernel Makefiles
+dnl only work with GNU make).
+AC_DEFUN([OVS_CHECK_GNU_MAKE],
+  [AC_CACHE_CHECK(
+     [whether ${MAKE-make} is GNU make],
+     [ovs_cv_gnu_make],
+     [rm -f conftest.out
+      AS_ECHO(["$as_me:$LINENO: invoking ${MAKE-make} --version:"]) >&AS_MESSAGE_LOG_FD 2>&1
+      ${MAKE-make} --version >conftest.out 2>&1
+      cat conftest.out >&AS_MESSAGE_LOG_FD 2>&1
+      result=`cat conftest.out`
+      rm -f conftest.mk conftest.out
+
+      case $result in # (
+        GNU*) ovs_cv_gnu_make=yes ;; # (
+        *) ovs_cv_gnu_make=no ;;
+      esac])
+   AM_CONDITIONAL([GNU_MAKE], [test $ovs_cv_gnu_make = yes])])
+
 dnl OVS_CHECK_SPARSE_TARGET
 dnl
 dnl The "cgcc" script from "sparse" isn't very good at detecting the
index 4a89fba..6006766 100644 (file)
@@ -69,6 +69,7 @@ OVS_CHECK_LINKER_SECTIONS
 OVS_CHECK_XENSERVER_VERSION
 OVS_CHECK_GROFF
 OVS_CHECK_BRCOMPAT
+OVS_CHECK_GNU_MAKE
 
 OVS_ENABLE_OPTION([-Wall])
 OVS_ENABLE_OPTION([-Wno-sign-compare])