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 6615fd66e1d70111224e860080292b11343047eb..50c4b14283781d5efdae2a84a32db228a0e25bcb 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 8bd4544b5d27431255dc07c5aebf973994a71bde..c332b41a8158e1cd8bd420d63020584bf8ef5ca9 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 4a89fba4105240b977b6654ed65bd5976a0e5397..6006766d764bd6cf3be4b8cee587ffd605d7fbd3 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])