diff --git a/Makefile.in b/Makefile.in index 7bec521..23a83fe 100644 --- a/Makefile.in +++ b/Makefile.in @@ -25,6 +25,7 @@ # # Makefile template +SYSCONFDIR=@SYSCONFDIR@ BINDIR=@BINDIR@ SBINDIR=@SBINDIR@ MANDIR=@MANDIR@ @@ -76,6 +77,9 @@ chronyd : $(OBJS) $(EXTRA_OBJS) chronyc : $(CLI_OBJS) $(CC) $(OPTFLAGS) -o chronyc $(CLI_OBJS) $(LDFLAGS) @READLINE_LINK@ $(LIBS) $(EXTRA_CLI_LIBS) +conf.o : conf.c + $(CC) $(CFLAGS) $(CPPFLAGS) -DDEFAULT_CONF_DIR=\"$(SYSCONFDIR)\" -c $< + client.o : client.c $(CC) $(CFLAGS) $(CPPFLAGS) @READLINE_COMPILE@ -c $< diff --git a/conf.c b/conf.c index 1c1b4f0..04cdab9 100644 --- a/conf.c +++ b/conf.c @@ -58,7 +58,11 @@ /* ================================================== */ -#define DEFAULT_CONF_FILE "/etc/chrony.conf" +#ifndef DEFAULT_CONF_DIR +#define DEFAULT_CONF_DIR "/etc" +#endif + +#define DEFAULT_CONF_FILE DEFAULT_CONF_DIR"/chrony.conf" /* ================================================== */ /* Forward prototypes */