From b4e1bf8b7ef8704d857a9ee93d40719289b2139e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 25 Jul 2012 10:25:55 -0700 Subject: [PATCH] Makefiles: Enable "dist-hook-git" check only when GNU make is in use. 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 Reported-by: Ed Maste --- Makefile.am | 8 +++++++- acinclude.m4 | 21 +++++++++++++++++++++ configure.ac | 1 + 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 6615fd66..50c4b142 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/acinclude.m4 b/acinclude.m4 index 8bd4544b..c332b41a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/configure.ac b/configure.ac index 4a89fba4..6006766d 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) -- 2.30.2