Set default chrony.conf path according to sysconfdir

This commit is contained in:
Miroslav Lichvar 2009-12-04 12:30:30 +01:00
parent fb538c3947
commit 1f6e508a3d
2 changed files with 9 additions and 1 deletions

View file

@ -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 $<

6
conf.c
View file

@ -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 */