From: Harlan Stenn Date: Fri, 9 Nov 2007 07:10:13 +0000 (-0500) Subject: Work around a VPATH difference in FreeBSD's 'make' command X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=034ff5739d2bdc60f7526e6de4b9f468f675daee;p=thirdparty%2Fntp.git Work around a VPATH difference in FreeBSD's 'make' command bk: 473407d5r4opj4TViuDTNP-JWvRN4A --- diff --git a/ChangeLog b/ChangeLog index b858da5da9..14c138a5f8 100644 --- 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. diff --git a/configure.ac b/configure.ac index acd46dd6f0..f69b9c6ff2 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 0000000000..d6d3abbefb --- /dev/null +++ b/m4/ntp_vpathhack.m4 @@ -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 ====================================================================== diff --git a/ntpd/Makefile.am b/ntpd/Makefile.am index a46031ea1d..452aec9e0c 100644 --- a/ntpd/Makefile.am +++ b/ntpd/Makefile.am @@ -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