From 127c0b77a85494235fdf6c350e077b11271b9895 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Sat, 15 Jun 2024 14:02:30 +0100 Subject: [PATCH] configure: add --enable-ntp It just uncomments the option to request ntp_servers in dhcpcd.conf. Fixes #331. --- configure | 7 +++++++ src/Makefile | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 0a28a0cff..1a772b02b 100755 --- a/configure +++ b/configure @@ -33,6 +33,7 @@ STATIC= DEVS= EMBEDDED= AUTH= +NTP= POLL= SMALL= SANITIZE=no @@ -74,6 +75,8 @@ for x do --enable-privsep) PRIVSEP=yes;; --disable-seccomp) SECCOMP=no;; --enable-seccomp) SECCOMP=yes;; + --disable-ntp) NTP=no;; + --enable-ntp) NTP=yes;; --privsepuser) PRIVSEP_USER=$var;; --prefix) PREFIX=$var;prefix=$var;; # prefix is set for autotools compat --sysconfdir) SYSCONFDIR=$var;; @@ -1943,6 +1946,10 @@ if ! $HOOKSET; then fi fi fi +if [ "$NTP" = yes ]; then + # --enable-ntp + echo "UNCOMMENT_NTP= yes" >>$CONFIG_MK +fi echo >>$CONFIG_H echo "#endif /*CONFIG_H*/">>$CONFIG_H diff --git a/src/Makefile b/src/Makefile index ff998b386..caafde03b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -96,8 +96,14 @@ _maninstall: ${MAN5} ${MAN8} _confinstall: ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} # Install a new default config if not present - test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \ - ${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR} + if ! [ -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf ]; then \ + ${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR}; \ + if [ "${UNCOMMENT_NTP}" = yes ]; then \ + ${SED} -i \ + -e 's/#option ntp_servers/option ntp_servers/' \ + ${DESTDIR}/${SYSCONFDIR}/dhcpcd.conf; \ + fi; \ + fi eginstall: