]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1382] p245 configure --disable-dependency-tracking won't build
authorDave Hart <hart@ntp.org>
Mon, 16 Nov 2009 05:41:46 +0000 (05:41 +0000)
committerDave Hart <hart@ntp.org>
Mon, 16 Nov 2009 05:41:46 +0000 (05:41 +0000)
bk: 4b00e61ae9E6e7FxMwprbRgAvlSvFA

15 files changed:
ChangeLog
Makefile.am
adjtimed/Makefile.am
clockstuff/Makefile.am
depsver.mf
include/ntpd.h
libntp/Makefile.am
ntpd/cmd_args.c
ntpd/ntpd.c
ntpdate/Makefile.am
ntpq/Makefile.am
ntpsnmpd/Makefile.am
parseutil/Makefile.am
sntp/Makefile.am
util/Makefile.am

index f8007b687101fd30c3d116061393e3055714f81a..53467f583f287d9b01bebfc92d9ff51ed08706fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 1382] p245 configure --disable-dependency-tracking won't build.
 (4.2.5p245-RC) 2009/11/14 Released by Harlan Stenn <stenn@ntp.org>
 * Cleanup from Dave Mills.
 * [Bug 1343] sntp illegal C does not compile on Solaris 7.
index f90234f225f6c375b64961f75284f2816f1587cf..b871e65c25c833d2224246134b6e86391d961489 100644 (file)
@@ -93,6 +93,7 @@ EXTRA_DIST =                  \
        \
        $(NULL)
 
+CLEANFILES =
 DISTCLEANFILES = .gcc-warning
 
 ETAGS_ARGS = Makefile.am configure.ac
index 61335905736fb5b9917af4be64b4ef836afbe1ea..cad9dd02eb44a2db9a8eb09f9fe3a267d147bd63 100644 (file)
@@ -3,6 +3,7 @@ AUTOMAKE_OPTIONS=
 bindir=                ${exec_prefix}/${BINSUBDIR}
 bin_PROGRAMS=  @MAKE_ADJTIMED@
 BUILT_SOURCES=
+CLEANFILES=
 EXTRA_PROGRAMS=        adjtimed
 AM_CPPFLAGS=   -I$(top_srcdir)/include
 LDADD=         ../libntp/libntp.a
index f2e31798e2b91a7e95a8bf07dd948c1151f80f21..7521678619ecfc6f48bdb5877064fb3dffaee54f 100644 (file)
@@ -11,6 +11,7 @@ clktest_LDADD = ../libntp/libntp.a
 ETAGS_ARGS = Makefile.am
 #EXTRA_DIST = TAGS
 BUILT_SOURCES =
+CLEANFILES =
 
 # clktest-opts.def wants ../include/copyright.def ../include/homerc.def
 
index 4b51a92e090c2addd20ad884ed7618a2ed3787c7..3e4a6185a13c2ac5d4d9232dea87d45fa22743fe 100644 (file)
@@ -5,19 +5,38 @@ $(DEPDIR)/deps-ver: $(top_srcdir)/deps-ver
                chmod ug+w $@
        @cmp $(top_srcdir)/deps-ver $@ > /dev/null || (                 \
                $(MAKE) clean &&                                        \
-               echo -n "Prior $(abs_builddir)/$(DEPDIR) version " &&   \
+               echo -n "Prior $(subdir)/$(DEPDIR) version " &&         \
                cat $@ &&                                               \
                rm -rf $(DEPDIR) &&                                     \
-               mkdir $(DEPDIR) && (                                    \
-                       cd $(top_builddir) &&                           \
-                       ./config.status                                 \
-                       ) &&                                            \
-               echo -n "Cleaned $(abs_builddir)/$(DEPDIR) version " && \
+               mkdir $(DEPDIR) &&                                      \
+               case "$(top_builddir)" in                               \
+                .)                                                     \
+                   ./config.status Makefile depfiles                   \
+                   ;;                                                  \
+                ..)                                                    \
+                       cd .. &&                                        \
+                       ./config.status $(subdir)/Makefile depfiles &&  \
+                       cd $(subdir)                                    \
+                   ;;                                                  \
+                *)                                                     \
+                   echo 'Fatal: depsver.mf Automake fragment limited'  \
+                        'to immediate subdirectories.' &&              \
+                   echo "top_builddir: $(top_builddir)" &&             \
+                   echo "subdir:       $(subdir)" &&                   \
+                   exit 1                                              \
+                   ;;                                                  \
+               esac &&                                                 \
+               echo -n "Cleaned $(subdir)/$(DEPDIR) version " &&       \
                cat $(top_srcdir)/deps-ver                              \
        )
        cp $(top_srcdir)/deps-ver $@
 
-BUILT_SOURCES += $(DEPDIR)/deps-ver
+.deps-ver: $(top_srcdir)/deps-ver
+       @[ ! -d $(DEPDIR) ] || $(MAKE) $(DEPDIR)/deps-ver
+       @touch $@
+
+BUILT_SOURCES += .deps-ver
+CLEANFILES += .deps-ver
 
 #
 # depsver.mf   included in Makefile.am for directories with .deps
@@ -35,6 +54,11 @@ BUILT_SOURCES += $(DEPDIR)/deps-ver
 # their updated .deps files, then remove $(DEPDIR) and recreate it as
 # empty stubs.
 #
+# It is normal when configured with --disable-dependency-tracking for
+# the DEPDIR to not have been created.  For this reason, we use the
+# intermediate target .deps-ver, which invokes make recursively if
+# DEPDIR exists.
+#
 # If you modify depsver.mf, please make the changes to the master
 # copy, the one in sntp is copied by the bootstrap script from it.
 #
index bdd574dd57373905581bb2ac82f07bb19fd06947..14cf0add2c9ae433ab4ac3ebe969de610aff9679 100644 (file)
@@ -482,7 +482,7 @@ extern int  initializing;           /* initializing flag */
 extern int droproot;                   /* flag: try to drop root privileges after startup */
 extern char *user;                     /* user to switch to */
 extern char *group;                    /* group to switch to */
-extern char *chrootdir;                        /* directory to chroot to */
+extern const char *chrootdir;          /* directory to chroot to */
 #endif
 
 /* refclock_conf.c */
index c40b7d9044de6e10b61ff9e33bfe0411b6efc6c3..a47972103d598fbfbedd63ea25aa916907503c05 100644 (file)
@@ -2,6 +2,7 @@ NULL=
 #AUTOMAKE_OPTIONS = ../ansi2knr no-dependencies
 AUTOMAKE_OPTIONS = 
 BUILT_SOURCES =
+CLEANFILES =
 noinst_LIBRARIES = libntp.a @MAKE_LIBNTPSIM@
 EXTRA_LIBRARIES = libntpsim.a
 libntp_a_SRCS =                                                \
index 2cda181ce12cda18918641745529dfbf727e20a0..246209b8d40c372d29cdaf5302f7d2d82d36ec1f 100644 (file)
@@ -141,11 +141,8 @@ getCmdOpts(
 
        if (HAVE_OPT( USER )) {
 #ifdef HAVE_DROPROOT
-               char *ntp_optarg = OPT_ARG( USER );
-
                droproot = 1;
-               user = emalloc(strlen(ntp_optarg) + 1);
-               (void)strncpy(user, ntp_optarg, strlen(ntp_optarg) + 1);
+               user = estrdup(OPT_ARG( USER ));
                group = rindex(user, ':');
                if (group)
                        *group++ = '\0'; /* get rid of the ':' */
index 062fc5654c47e0bd0704b2ad3d0023b9c8aa81f5..62e4f98052e511372b1caff85cb6f11abfe39d65 100644 (file)
@@ -174,7 +174,7 @@ int mdnstries = 5;
 int droproot = 0;
 char *user = NULL;             /* User to switch to */
 char *group = NULL;            /* group to switch to */
-char *chrootdir = NULL;                /* directory to chroot to */
+const char *chrootdir = NULL;  /* directory to chroot to */
 int sw_uid;
 int sw_gid;
 char *endp;
index 665ebfc53915e5ffc1ea706701b8bec5aca21467..b162637d9fe8258fc90a28adf7300d8b93421c73 100644 (file)
@@ -2,6 +2,7 @@ NULL=
 AUTOMAKE_OPTIONS=
 
 BUILT_SOURCES=
+CLEANFILES=
 bindir=                ${exec_prefix}/${BINSUBDIR}
 #bin_PROGRAMS= ntpdate ntptimeset
 bin_PROGRAMS=  ntpdate
index 6d618a27820ef4e3a3a847998110c5dac064635c..5b87cc16f17f62d0288be1854aa7e1ef86f01759 100644 (file)
@@ -15,6 +15,7 @@ noinst_LIBRARIES=     libntpq.a
 # HMS: I don't think we need libntpq_a_LIBADD...
 #libntpq_a_LIBADD=     version.o @EDITLINE_LIBS@ $(LIBOPTS_LDADD) ../libntp/libntp.a
 libntpq_a_CFLAGS=      -DNO_MAIN_ALLOWED -DBUILD_AS_LIB
+CLEANFILES=
 DISTCLEANFILES=        .version version.c
 ETAGS_ARGS=    Makefile.am
 EXTRA_DIST=    ntpq-opts.def ntpq.1 ntpq-opts.texi ntpq-opts.menu
index 4cdd342e7e1a779c6a5867dfdcacfdf33ae9b56c..2d95d19e07e9a087ced8696847b705e6fa3926f2 100644 (file)
@@ -20,6 +20,7 @@ EXTRA_DIST=   ntpsnmpd-opts.def ntpsnmpd.1 ntpsnmpd-opts.texi \
                ntpsnmpd-opts.menu ntpv4-mib.mib
 BUILT_SOURCES= ntpsnmpd-opts.c ntpsnmpd-opts.h ntpsnmpd.1 ntpsnmpd-opts.texi \
                ntpsnmpd-opts.menu
+CLEANFILES=
 man_MANS=      ntpsnmpd.1
 run_ag=                cd $(srcdir) && autogen -L ../include --writable
 std_def_list=  $(top_srcdir)/include/autogen-version.def       \
index 1f4bf90729320432fc75fecec8c56c1edce9011a..e06b34990d755052969ea711539da12bdd8e20ed 100644 (file)
@@ -2,6 +2,7 @@ NULL=
 #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies
 AUTOMAKE_OPTIONS = 
 BUILT_SOURCES =
+CLEANFILES =
 noinst_PROGRAMS = @TESTDCF@ @DCFD@
 EXTRA_PROGRAMS = testdcf dcfd
 
index eac175ea12eba7020fecbdabe630988d8b2a336f..69287f19d7538c35dd5dabfeda01b574a8c2dc38 100644 (file)
@@ -16,6 +16,7 @@ run_ag=         cd $(srcdir) && autogen -L ../include --writable
 
 bindir=        ${exec_prefix}/${BINSUBDIR}
 bin_PROGRAMS=  sntp
+CLEANFILES=
 
 SUBDIRS=
 if NEED_LIBOPTS
index aa2d09591e253bd0fbf98ae5fb804f9a59927658..92fba9af16db23f95ba64a54e895c34f96d0461c 100644 (file)
@@ -21,6 +21,7 @@ ETAGS_ARGS=   Makefile.am
 EXTRA_DIST=    ntp-keygen-opts.def ntp-keygen.1 ntp-keygen-opts.texi ntp-keygen-opts.menu
 BUILT_SOURCES= ntp-keygen-opts.c ntp-keygen-opts.h ntp-keygen.1        \
                ntp-keygen-opts.texi ntp-keygen-opts.menu
+CLEANFILES=
 man_MANS=      ntp-keygen.1
 run_ag=                cd $(srcdir) && autogen -L ../include --writable
 std_def_list=  $(top_srcdir)/include/debug-opt.def             \