xref: /OK3568_Linux_fs/buildroot/package/ntp/ntp.mk (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun################################################################################
2*4882a593Smuzhiyun#
3*4882a593Smuzhiyun# ntp
4*4882a593Smuzhiyun#
5*4882a593Smuzhiyun################################################################################
6*4882a593Smuzhiyun
7*4882a593SmuzhiyunNTP_VERSION_MAJOR = 4.2
8*4882a593SmuzhiyunNTP_VERSION_MINOR = 8
9*4882a593SmuzhiyunNTP_VERSION_POINT = 15
10*4882a593SmuzhiyunNTP_VERSION = $(NTP_VERSION_MAJOR).$(NTP_VERSION_MINOR)p$(NTP_VERSION_POINT)
11*4882a593SmuzhiyunNTP_SITE = https://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-$(NTP_VERSION_MAJOR)
12*4882a593SmuzhiyunNTP_DEPENDENCIES = host-pkgconf libevent
13*4882a593SmuzhiyunNTP_LICENSE = NTP
14*4882a593SmuzhiyunNTP_LICENSE_FILES = COPYRIGHT
15*4882a593SmuzhiyunNTP_CPE_ID_VENDOR = ntp
16*4882a593SmuzhiyunNTP_CPE_ID_VERSION = $(NTP_VERSION_MAJOR).$(NTP_VERSION_MINOR)
17*4882a593SmuzhiyunNTP_CPE_ID_UPDATE = p$(NTP_VERSION_POINT)
18*4882a593SmuzhiyunNTP_SELINUX_MODULES = ntp
19*4882a593SmuzhiyunNTP_CONF_ENV = ac_cv_lib_md5_MD5Init=no POSIX_SHELL=/bin/sh
20*4882a593SmuzhiyunNTP_CONF_OPTS = \
21*4882a593Smuzhiyun	--with-shared \
22*4882a593Smuzhiyun	--program-transform-name=s,,, \
23*4882a593Smuzhiyun	--disable-tickadj \
24*4882a593Smuzhiyun	--disable-debugging \
25*4882a593Smuzhiyun	--with-yielding-select=yes \
26*4882a593Smuzhiyun	--disable-local-libevent
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun# 0002-ntp-syscalls-fallback.patch
29*4882a593SmuzhiyunNTP_AUTORECONF = YES
30*4882a593Smuzhiyun
31*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_OPENSSL),y)
32*4882a593SmuzhiyunNTP_CONF_OPTS += --with-crypto --enable-openssl-random
33*4882a593SmuzhiyunNTP_DEPENDENCIES += openssl
34*4882a593Smuzhiyunelse
35*4882a593SmuzhiyunNTP_CONF_OPTS += --without-crypto --disable-openssl-random
36*4882a593Smuzhiyunendif
37*4882a593Smuzhiyun
38*4882a593Smuzhiyunifeq ($(BR2_TOOLCHAIN_HAS_SSP),y)
39*4882a593SmuzhiyunNTP_CONF_OPTS += --with-hardenfile=linux
40*4882a593Smuzhiyunelse
41*4882a593SmuzhiyunNTP_CONF_OPTS += --with-hardenfile=default
42*4882a593Smuzhiyunendif
43*4882a593Smuzhiyun
44*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBCAP),y)
45*4882a593SmuzhiyunNTP_CONF_OPTS += --enable-linuxcaps
46*4882a593SmuzhiyunNTP_DEPENDENCIES += libcap
47*4882a593Smuzhiyunelse
48*4882a593SmuzhiyunNTP_CONF_OPTS += --disable-linuxcaps
49*4882a593Smuzhiyunendif
50*4882a593Smuzhiyun
51*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_LIBEDIT),y)
52*4882a593SmuzhiyunNTP_CONF_OPTS += --with-lineeditlibs=edit
53*4882a593SmuzhiyunNTP_DEPENDENCIES += libedit
54*4882a593Smuzhiyunelse
55*4882a593SmuzhiyunNTP_CONF_OPTS += --without-lineeditlibs
56*4882a593Smuzhiyunendif
57*4882a593Smuzhiyun
58*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NTP_NTPSNMPD),y)
59*4882a593SmuzhiyunNTP_CONF_OPTS += \
60*4882a593Smuzhiyun	--with-net-snmp-config=$(STAGING_DIR)/usr/bin/net-snmp-config
61*4882a593SmuzhiyunNTP_DEPENDENCIES += netsnmp
62*4882a593Smuzhiyunelse
63*4882a593SmuzhiyunNTP_CONF_OPTS += --without-ntpsnmpd
64*4882a593Smuzhiyunendif
65*4882a593Smuzhiyun
66*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NTP_NTPD_ATOM_PPS),y)
67*4882a593SmuzhiyunNTP_CONF_OPTS += --enable-ATOM
68*4882a593SmuzhiyunNTP_DEPENDENCIES += pps-tools
69*4882a593Smuzhiyunelse
70*4882a593SmuzhiyunNTP_CONF_OPTS += --disable-ATOM
71*4882a593Smuzhiyunendif
72*4882a593Smuzhiyun
73*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NTP_NTP_SHM_CLK),y)
74*4882a593SmuzhiyunNTP_CONF_OPTS += --enable-SHM
75*4882a593Smuzhiyunelse
76*4882a593SmuzhiyunNTP_CONF_OPTS += --disable-SHM
77*4882a593Smuzhiyunendif
78*4882a593Smuzhiyun
79*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NTP_SNTP),y)
80*4882a593SmuzhiyunNTP_CONF_OPTS += --with-sntp
81*4882a593Smuzhiyunelse
82*4882a593SmuzhiyunNTP_CONF_OPTS += --without-sntp
83*4882a593Smuzhiyunendif
84*4882a593Smuzhiyun
85*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_KEYGEN) += util/ntp-keygen
86*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTP_WAIT) += scripts/ntp-wait/ntp-wait
87*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDATE) += ntpdate/ntpdate
88*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPDC) += ntpdc/ntpdc
89*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPQ) += ntpq/ntpq
90*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPSNMPD) += ntpsnmpd/ntpsnmpd
91*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTIME) += util/ntptime
92*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_NTPTRACE) += scripts/ntptrace/ntptrace
93*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_SNTP) += sntp/sntp
94*4882a593SmuzhiyunNTP_INSTALL_FILES_$(BR2_PACKAGE_NTP_TICKADJ) += util/tickadj
95*4882a593Smuzhiyun
96*4882a593Smuzhiyundefine NTP_INSTALL_TARGET_CMDS
97*4882a593Smuzhiyun	$(if $(BR2_PACKAGE_NTP_NTPD), install -m 755 $(@D)/ntpd/ntpd $(TARGET_DIR)/usr/sbin/ntpd)
98*4882a593Smuzhiyun	test -z "$(NTP_INSTALL_FILES_y)" || install -m 755 $(addprefix $(@D)/,$(NTP_INSTALL_FILES_y)) $(TARGET_DIR)/usr/bin/
99*4882a593Smuzhiyun	$(INSTALL) -m 644 package/ntp/ntpd.etc.conf $(TARGET_DIR)/etc/ntp.conf
100*4882a593Smuzhiyunendef
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun# This script will step the time if there is a large difference
103*4882a593Smuzhiyun# before ntpd takes over the necessary slew adjustments
104*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NTP_SNTP),y)
105*4882a593Smuzhiyundefine NTP_INSTALL_INIT_SYSV_SNTP
106*4882a593Smuzhiyun	$(INSTALL) -D -m 755 package/ntp/S48sntp $(TARGET_DIR)/etc/init.d/S48sntp
107*4882a593Smuzhiyunendef
108*4882a593Smuzhiyunendif
109*4882a593Smuzhiyun
110*4882a593Smuzhiyunifeq ($(BR2_PACKAGE_NTP_NTPD),y)
111*4882a593Smuzhiyundefine NTP_INSTALL_INIT_SYSV_NTPD
112*4882a593Smuzhiyun	$(INSTALL) -D -m 755 package/ntp/S49ntp $(TARGET_DIR)/etc/init.d/S49ntp
113*4882a593Smuzhiyunendef
114*4882a593Smuzhiyun
115*4882a593Smuzhiyundefine NTP_INSTALL_INIT_SYSTEMD
116*4882a593Smuzhiyun	$(INSTALL) -D -m 644 package/ntp/ntpd.service $(TARGET_DIR)/usr/lib/systemd/system/ntpd.service
117*4882a593Smuzhiyunendef
118*4882a593Smuzhiyunendif
119*4882a593Smuzhiyun
120*4882a593Smuzhiyundefine NTP_INSTALL_INIT_SYSV
121*4882a593Smuzhiyun	$(NTP_INSTALL_INIT_SYSV_NTPD)
122*4882a593Smuzhiyun	$(NTP_INSTALL_INIT_SYSV_SNTP)
123*4882a593Smuzhiyunendef
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun$(eval $(autotools-package))
126