]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Work around a VPATH difference in FreeBSD's 'make' command
authorHarlan Stenn <stenn@ntp.org>
Fri, 9 Nov 2007 07:10:13 +0000 (02:10 -0500)
committerHarlan Stenn <stenn@ntp.org>
Fri, 9 Nov 2007 07:10:13 +0000 (02:10 -0500)
bk: 473407d5r4opj4TViuDTNP-JWvRN4A

ChangeLog
configure.ac
m4/ntp_vpathhack.m4 [new file with mode: 0644]
ntpd/Makefile.am

index b858da5da985dbcef01a104bd21c2cb951b0f83c..14c138a5f851f82e574e1b8d854303a5df16e5ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Work around a VPATH difference in FreeBSD's 'make' command.
 * Update bugreport URL.
 * Update -I documentation.
 * [Bug 713] Fix bug reporting information.
index acd46dd6f0a8cad0157e1827bdb439817ff4d6df..f69b9c6ff2c2326d57b64ffa17701bd075f1fbe5 100644 (file)
@@ -70,6 +70,7 @@ esac
 
 AMU_OS_CFLAGS
 NTP_DIR_SEP
+NTP_VPATH_HACK
 
 # NTP has (so far) been relying on leading-edge autogen.
 # Therefore, by default:
diff --git a/m4/ntp_vpathhack.m4 b/m4/ntp_vpathhack.m4
new file mode 100644 (file)
index 0000000..d6d3abb
--- /dev/null
@@ -0,0 +1,23 @@
+dnl ######################################################################
+dnl Are we using FreeBSD's make?
+AC_DEFUN([NTP_VPATH_HACK], [
+AC_CACHE_CHECK([to see if we need a VPATH hack], ac_cv_vpath_hack,
+[
+  case "$ac_cv_vpath_hack" in
+   '')
+    ac_cv_vpath_hack="no"
+    case "$srcdir::$host_os" in
+     ??*::freebsd*)
+       case "`${MAKE-make} -v -f /dev/null 2>/dev/null | grep 'GNU Make version '`" in
+        '')
+           ac_cv_vpath_hack="yes"
+           ;;
+       esac
+       ;;
+    esac
+    ;;
+  esac
+])
+AM_CONDITIONAL([VPATH_HACK], [test x$ac_cv_vpath_hack = xyes])
+])
+dnl ======================================================================
index a46031ea1d24132a485f813c27f9790bdb55ab05..452aec9e0c0305d4cb93a44aa1b6c1e2ea7e1086 100644 (file)
@@ -11,7 +11,17 @@ AM_CPPFLAGS= -I$(top_srcdir)/include -I../include $(LIBOPTS_CFLAGS)
 LDADD= version.o libntpd.a @LIBPARSE@
 AM_YFLAGS=     -d -t
 
-BUILT_SOURCES= ntp_parser.c ntp_parser.h       \
+if VPATH_HACK
+VPHACK=        vphack
+else
+VPHACK=
+endif
+
+vphack:
+       test -e ntp_parser.c || ln -s $(srcdir)/ntp_parser.c .
+       test -e ntp_parser.h || ln -s $(srcdir)/ntp_parser.h .
+
+BUILT_SOURCES= ${VPHACK} ntp_parser.c ntp_parser.h     \
                ntpd-opts.c ntpd-opts.h ntpd.1 ntpd-opts.texi ntpd-opts.menu
 
 man_MANS=      ntpd.1