--with-ncurses-library=DIR Specify where ncurses lib directory is
--without-nss Don't use NSS even if it is available
--without-tomcrypt Don't use libtomcrypt even if it is available
+ --disable-cmdmon Disable command and monitoring support
+ --disable-ntp Disable NTP support
+ --disable-refclock Disable reference clock support
+ --disable-phc Disable PHC refclock driver
+ --disable-pps Disable PPS refclock driver
--disable-ipv6 Disable IPv6 support
- --disable-phc Disable PHC support
- --disable-pps Disable PPS API support
--disable-rtc Don't include RTC even on Linux
--disable-linuxcaps Disable Linux capabilities support
--disable-asyncdns Disable asynchronous name resolving
SYSDEFS=""
debug=0
+feat_cmdmon=1
+feat_ntp=1
+feat_refclock=1
feat_readline=1
try_readline=1
try_editline=1
--chronyvardir=* )
SETCHRONYVARDIR=`echo $option | sed -e 's/^.*=//;'`
;;
+ --disable-cmdmon)
+ feat_cmdmon=0
+ ;;
+ --disable-ntp)
+ feat_ntp=0
+ ;;
+ --disable-refclock)
+ feat_refclock=0
+ ;;
--disable-rtc)
feat_rtc=0
;;
;;
esac
+if [ $feat_cmdmon = "1" ]; then
+ add_def FEAT_CMDMON
+ EXTRA_OBJECTS="$EXTRA_OBJECTS cmdmon.o manual.o pktlength.o"
+fi
+
+if [ $feat_ntp = "1" ]; then
+ add_def FEAT_NTP
+ EXTRA_OBJECTS="$EXTRA_OBJECTS broadcast.o nameserv_async.o ntp_core.o ntp_io.o ntp_sources.o"
+else
+ feat_asyncdns=0
+fi
+
+if [ "$feat_cmdmon" = "1" ] || [ $feat_ntp = "1" ]; then
+ EXTRA_OBJECTS="$EXTRA_OBJECTS addrfilt.o clientlog.o keys.o nameserv.o"
+else
+ feat_ipv6=0
+fi
+
+if [ $feat_refclock = "1" ]; then
+ add_def FEAT_REFCLOCK
+ EXTRA_OBJECTS="$EXTRA_OBJECTS refclock.o refclock_phc.o refclock_pps.o refclock_shm.o refclock_sock.o"
+fi
+
if test_code '64-bit time_t' 'time.h' '' '' '
char x[sizeof(time_t) > 4 ? 1 : -1] = {0};
return x[0];'
fi
timepps_h=""
-if [ $feat_pps = "1" ]; then
+if [ $feat_refclock = "1" ] && [ $feat_pps = "1" ]; then
if test_code '<sys/timepps.h>' 'sys/timepps.h' '' '' ''; then
timepps_h="sys/timepps.h"
add_def HAVE_SYS_TIMEPPS_H
add_def FEAT_RTC
fi
-if [ $feat_phc = "1" ] && [ $try_phc = "1" ] && \
+if [ $feat_refclock = "1" ] && [ $feat_phc = "1" ] && [ $try_phc = "1" ] && \
test_code '<linux/ptp_clock.h>' 'sys/ioctl.h linux/ptp_clock.h' '' '' \
'ioctl(1, PTP_CLOCK_GETCAPS, 0);'
then
--- /dev/null
+/*
+ chronyd/chronyc - Programs for keeping computer clocks accurate.
+
+ **********************************************************************
+ * Copyright (C) Miroslav Lichvar 2014
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ **********************************************************************
+
+ =======================================================================
+
+ Function replacements needed when optional features are disabled.
+
+ */
+
+#include "config.h"
+
+#include "broadcast.h"
+#include "clientlog.h"
+#include "cmdmon.h"
+#include "keys.h"
+#include "logging.h"
+#include "manual.h"
+#include "nameserv.h"
+#include "ntp_core.h"
+#include "ntp_io.h"
+#include "ntp_sources.h"
+#include "refclock.h"
+
+#ifndef FEAT_CMDMON
+
+void
+CAM_Initialise(int family)
+{
+}
+
+void
+CAM_Finalise(void)
+{
+}
+
+int
+CAM_AddAccessRestriction(IPAddr *ip_addr, int subnet_bits, int allow, int all)
+{
+ return 1;
+}
+
+void
+MNL_Initialise(void)
+{
+}
+
+void
+MNL_Finalise(void)
+{
+}
+
+#endif /* !FEAT_CMDMON */
+
+#ifndef FEAT_NTP
+
+void
+BRD_Initialise(void)
+{
+}
+
+void
+BRD_Finalise(void)
+{
+}
+
+void
+BRD_AddDestination(IPAddr *addr, unsigned short port, int interval)
+{
+}
+
+void
+NCR_Initialise(void)
+{
+}
+
+void
+NCR_Finalise(void)
+{
+}
+
+int
+NCR_AddAccessRestriction(IPAddr *ip_addr, int subnet_bits, int allow, int all)
+{
+ return 1;
+}
+
+int
+NCR_CheckAccessRestriction(IPAddr *ip_addr)
+{
+ return 0;
+}
+
+void
+NIO_Initialise(int family)
+{
+}
+
+void
+NIO_Finalise(void)
+{
+}
+
+void
+NSR_Initialise(void)
+{
+}
+
+void
+NSR_Finalise(void)
+{
+}
+
+NSR_Status
+NSR_AddSource(NTP_Remote_Address *remote_addr, NTP_Source_Type type, SourceParameters *params)
+{
+ return NSR_TooManySources;
+}
+
+void
+NSR_AddUnresolvedSource(char *name, int port, NTP_Source_Type type, SourceParameters *params)
+{
+}
+
+NSR_Status
+NSR_RemoveSource(NTP_Remote_Address *remote_addr)
+{
+ return NSR_NoSuchSource;
+}
+
+void
+NSR_RemoveAllSources(void)
+{
+}
+
+void
+NSR_SetSourceResolvingEndHandler(NSR_SourceResolvingEndHandler handler)
+{
+ if (handler)
+ (handler)();
+}
+
+void
+NSR_ResolveSources(void)
+{
+}
+
+void NSR_StartSources(void)
+{
+}
+
+void NSR_AutoStartSources(void)
+{
+}
+
+int
+NSR_InitiateSampleBurst(int n_good_samples, int n_total_samples,
+ IPAddr *mask, IPAddr *address)
+{
+ return 0;
+}
+
+int
+NSR_TakeSourcesOnline(IPAddr *mask, IPAddr *address)
+{
+ return 0;
+}
+
+int
+NSR_TakeSourcesOffline(IPAddr *mask, IPAddr *address)
+{
+ return 0;
+}
+
+int
+NSR_ModifyMinpoll(IPAddr *address, int new_minpoll)
+{
+ return 0;
+}
+
+int
+NSR_ModifyMaxpoll(IPAddr *address, int new_maxpoll)
+{
+ return 0;
+}
+
+int
+NSR_ModifyMaxdelay(IPAddr *address, double new_max_delay)
+{
+ return 0;
+}
+
+int
+NSR_ModifyMaxdelayratio(IPAddr *address, double new_max_delay_ratio)
+{
+ return 0;
+}
+
+int
+NSR_ModifyMaxdelaydevratio(IPAddr *address, double new_max_delay_dev_ratio)
+{
+ return 0;
+}
+
+int
+NSR_ModifyMinstratum(IPAddr *address, int new_min_stratum)
+{
+ return 0;
+}
+
+int
+NSR_ModifyPolltarget(IPAddr *address, int new_poll_target)
+{
+ return 0;
+}
+
+void
+NSR_ReportSource(RPT_SourceReport *report, struct timeval *now)
+{
+ memset(report, 0, sizeof (*report));
+}
+
+void
+NSR_GetActivityReport(RPT_ActivityReport *report)
+{
+ memset(report, 0, sizeof (*report));
+}
+
+#ifndef FEAT_CMDMON
+
+void
+CLG_Initialise(void)
+{
+}
+
+void
+CLG_Finalise(void)
+{
+}
+
+void
+DNS_SetAddressFamily(int family)
+{
+}
+
+DNS_Status
+DNS_Name2IPAddress(const char *name, IPAddr *addr)
+{
+ return DNS_Failure;
+}
+
+void
+KEY_Initialise(void)
+{
+}
+
+void
+KEY_Finalise(void)
+{
+}
+
+#endif /* !FEAT_CMDMON */
+#endif /* !FEAT_NTP */
+
+#ifndef FEAT_REFCLOCK
+void
+RCL_Initialise(void)
+{
+}
+
+void
+RCL_Finalise(void)
+{
+}
+
+int
+RCL_AddRefclock(RefclockParameters *params)
+{
+ return 0;
+}
+
+void
+RCL_StartRefclocks(void)
+{
+}
+
+void
+RCL_ReportSource(RPT_SourceReport *report, struct timeval *now)
+{
+ memset(report, 0, sizeof (*report));
+}
+
+#endif /* !FEAT_REFCLOCK */