]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
configure: add --enable-ntp
authorRoy Marples <roy@marples.name>
Sat, 15 Jun 2024 13:02:30 +0000 (14:02 +0100)
committerRoy Marples <roy@marples.name>
Sat, 15 Jun 2024 13:02:30 +0000 (14:02 +0100)
It just uncomments the option to request ntp_servers in dhcpcd.conf.
Fixes #331.

configure
src/Makefile

index 0a28a0cff7775f58cb1df8e16797273dc4f14014..1a772b02b7cf10c7173ddb7c4ca3bc87f3370860 100755 (executable)
--- 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
index ff998b386fcfa3642e979c32fc0bcb636bcf0cf8..caafde03bd7ddbda23258fddb0f0d1589fae3f8a 100644 (file)
@@ -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: