From: Dave Hart Date: Mon, 16 Nov 2009 05:41:46 +0000 (+0000) Subject: [Bug 1382] p245 configure --disable-dependency-tracking won't build X-Git-Tag: NTP_4_2_5P246_RC~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27efbab3f0e69aa7cd3fa1e94210a360d6144752;p=thirdparty%2Fntp.git [Bug 1382] p245 configure --disable-dependency-tracking won't build bk: 4b00e61ae9E6e7FxMwprbRgAvlSvFA --- diff --git a/ChangeLog b/ChangeLog index f8007b687..53467f583 100644 --- 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 * Cleanup from Dave Mills. * [Bug 1343] sntp illegal C does not compile on Solaris 7. diff --git a/Makefile.am b/Makefile.am index f90234f22..b871e65c2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -93,6 +93,7 @@ EXTRA_DIST = \ \ $(NULL) +CLEANFILES = DISTCLEANFILES = .gcc-warning ETAGS_ARGS = Makefile.am configure.ac diff --git a/adjtimed/Makefile.am b/adjtimed/Makefile.am index 613359057..cad9dd02e 100644 --- a/adjtimed/Makefile.am +++ b/adjtimed/Makefile.am @@ -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 diff --git a/clockstuff/Makefile.am b/clockstuff/Makefile.am index f2e31798e..752167861 100644 --- a/clockstuff/Makefile.am +++ b/clockstuff/Makefile.am @@ -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 diff --git a/depsver.mf b/depsver.mf index 4b51a92e0..3e4a6185a 100644 --- a/depsver.mf +++ b/depsver.mf @@ -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. # diff --git a/include/ntpd.h b/include/ntpd.h index bdd574dd5..14cf0add2 100644 --- a/include/ntpd.h +++ b/include/ntpd.h @@ -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 */ diff --git a/libntp/Makefile.am b/libntp/Makefile.am index c40b7d904..a47972103 100644 --- a/libntp/Makefile.am +++ b/libntp/Makefile.am @@ -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 = \ diff --git a/ntpd/cmd_args.c b/ntpd/cmd_args.c index 2cda181ce..246209b8d 100644 --- a/ntpd/cmd_args.c +++ b/ntpd/cmd_args.c @@ -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 ':' */ diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index 062fc5654..62e4f9805 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -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; diff --git a/ntpdate/Makefile.am b/ntpdate/Makefile.am index 665ebfc53..b162637d9 100644 --- a/ntpdate/Makefile.am +++ b/ntpdate/Makefile.am @@ -2,6 +2,7 @@ NULL= AUTOMAKE_OPTIONS= BUILT_SOURCES= +CLEANFILES= bindir= ${exec_prefix}/${BINSUBDIR} #bin_PROGRAMS= ntpdate ntptimeset bin_PROGRAMS= ntpdate diff --git a/ntpq/Makefile.am b/ntpq/Makefile.am index 6d618a278..5b87cc16f 100644 --- a/ntpq/Makefile.am +++ b/ntpq/Makefile.am @@ -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 diff --git a/ntpsnmpd/Makefile.am b/ntpsnmpd/Makefile.am index 4cdd342e7..2d95d19e0 100644 --- a/ntpsnmpd/Makefile.am +++ b/ntpsnmpd/Makefile.am @@ -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 \ diff --git a/parseutil/Makefile.am b/parseutil/Makefile.am index 1f4bf9072..e06b34990 100644 --- a/parseutil/Makefile.am +++ b/parseutil/Makefile.am @@ -2,6 +2,7 @@ NULL= #AUTOMAKE_OPTIONS = ../util/ansi2knr no-dependencies AUTOMAKE_OPTIONS = BUILT_SOURCES = +CLEANFILES = noinst_PROGRAMS = @TESTDCF@ @DCFD@ EXTRA_PROGRAMS = testdcf dcfd diff --git a/sntp/Makefile.am b/sntp/Makefile.am index eac175ea1..69287f19d 100644 --- a/sntp/Makefile.am +++ b/sntp/Makefile.am @@ -16,6 +16,7 @@ run_ag= cd $(srcdir) && autogen -L ../include --writable bindir= ${exec_prefix}/${BINSUBDIR} bin_PROGRAMS= sntp +CLEANFILES= SUBDIRS= if NEED_LIBOPTS diff --git a/util/Makefile.am b/util/Makefile.am index aa2d09591..92fba9af1 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -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 \