xref: /netbsd-src/external/bsd/ntp/dist/sntp/configure.ac (revision 897be3a4bac39d8b2e92077bf29f4a2e67d31983)
18585484eSchristosdnl SNTP subpackage configure.ac			-*- Autoconf -*-
28585484eSchristosdnl
38585484eSchristosm4_include([m4/version.m4])
4067f5680SchristosAC_PREREQ([2.68])
58585484eSchristosAC_INIT(
68585484eSchristos    [sntp],
78585484eSchristos    [VERSION_NUMBER],
8*897be3a4Schristos    [https://bugs.ntp.org/],
98585484eSchristos    [],
10*897be3a4Schristos    [https://www.ntp.org/]dnl
118585484eSchristos)
128585484eSchristosAC_CONFIG_MACRO_DIR([m4])
138585484eSchristosAC_CONFIG_AUX_DIR([libevent/build-aux])
14a6f3f22fSchristosAC_LANG([C])
15abb0f93cSkardel
168585484eSchristos# Bump sntp_configure_cache_version for each change to configure.ac or
178585484eSchristos# .m4 files which invalidates cached values from previous configure
188585484eSchristos# runs.
19abb0f93cSkardel#
20abb0f93cSkardel# If the change affects cache variables used only by the main NTP
21abb0f93cSkardel# configure.ac, then only its version number should be bumped, while
22abb0f93cSkardel# the subdir configure.ac version numbers should be unchanged.  The
23abb0f93cSkardel# same is true for a test/variable that is used only by one subdir
24abb0f93cSkardel# being changed incompatibly; only that subdir's cache version needs
25abb0f93cSkardel# bumping.
26abb0f93cSkardel#
27abb0f93cSkardel# If a change affects variables shared by all NTP configure scripts,
288585484eSchristos# please bump the version numbers of each.  If you are not sure, the
298585484eSchristos# safe choice is to bump all on any cache-invalidating change.
30abb0f93cSkardel#
31abb0f93cSkardel# In order to avoid the risk of version stamp collision between -stable
32abb0f93cSkardel# and -dev branches, do not simply increment the version, instead use
33abb0f93cSkardel# the date YYYYMMDD optionally with -HHMM if there is more than one
34abb0f93cSkardel# bump in a day.
35abb0f93cSkardel
36*897be3a4Schristossntp_configure_cache_version=20240218
37abb0f93cSkardel
38abb0f93cSkardel# When the version of config.cache and configure do not
39abb0f93cSkardel# match, NTP_CACHEVERSION will flush the cache.
40abb0f93cSkardel
41abb0f93cSkardelNTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
42abb0f93cSkardel
43*897be3a4SchristosAM_INIT_AUTOMAKE([1.15 foreign subdir-objects -Wall -Wno-gnu])
44067f5680Schristos
45067f5680SchristosAM_SILENT_RULES([yes])
46067f5680Schristos
47abb0f93cSkardelAC_CANONICAL_BUILD
48abb0f93cSkardelAC_CANONICAL_HOST
49abb0f93cSkardeldnl the 'build' machine is where we run configure and compile
50abb0f93cSkardeldnl the 'host' machine is where the resulting stuff runs.
51abb0f93cSkardelAC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
52abb0f93cSkardelAC_CONFIG_HEADER([config.h])
53abb0f93cSkardeldnl AC_ARG_PROGRAM
54abb0f93cSkardel
558585484eSchristosNTP_PROG_CC
563e3909feSchristosNTP_COMPILER
573e3909feSchristosNTP_HARDEN
58abb0f93cSkardel
598585484eSchristosNTP_LOCINFO()
60abb0f93cSkardel
61*897be3a4SchristosAM_PROG_AR
62f003fb54Skardel
638585484eSchristosNTP_LIBNTP
64abb0f93cSkardel
65*897be3a4SchristosLT_INIT([disable-shared])
668585484eSchristosAC_SUBST([LIBTOOL_DEPS])
678585484eSchristos
688585484eSchristosNTP_WITHSNTP
698585484eSchristos
708585484eSchristoscase "$SNTP" in
718585484eSchristos '')
728585484eSchristos    SNTP_DB=
738585484eSchristos    SNTP_DL=
748585484eSchristos    SNTP_DS=
75abb0f93cSkardel    ;;
76abb0f93cSkardelesac
77abb0f93cSkardel
788585484eSchristos###
79abb0f93cSkardel
80abb0f93cSkardel# NTP has (so far) been relying on leading-edge autogen.
81abb0f93cSkardel# Therefore, by default:
82abb0f93cSkardel# - use the version we ship with
83abb0f93cSkardel# - do not install it
84*897be3a4Schristos# - build a static copy (disable-shared - done earlier)
85abb0f93cSkardelcase "${enable_local_libopts+set}" in
86abb0f93cSkardel set) ;;
87abb0f93cSkardel *) enable_local_libopts=yes ;;
88abb0f93cSkardelesac
89abb0f93cSkardelcase "${enable_libopts_install+set}" in
90abb0f93cSkardel set) ;;
91abb0f93cSkardel *) enable_libopts_install=no ;;
92abb0f93cSkardelesac
938585484eSchristosenable_nls=no
94f003fb54SkardelLIBOPTS_CHECK
95abb0f93cSkardel
96b5bbe2e3Schristos# From when we only used libevent for sntp:
97b5bbe2e3Schristos#AM_COND_IF(
98b5bbe2e3Schristos#    [BUILD_SNTP],
99b5bbe2e3Schristos#    [NTP_LIBEVENT_CHECK],
100b5bbe2e3Schristos#    [NTP_LIBEVENT_CHECK_NOBUILD]
101b5bbe2e3Schristos#)
102b5bbe2e3Schristos
103b5bbe2e3SchristosNTP_LIBEVENT_CHECK([2])
104abb0f93cSkardel
105abb0f93cSkardel# Checks for libraries.
106f003fb54Skardel
1078585484eSchristosdnl NTP_LIBNTP checks for inet_XtoY
1088585484eSchristosdnl AC_SEARCH_LIBS([inet_pton], [nsl])
109abb0f93cSkardel
1108585484eSchristosdnl AC_SEARCH_LIBS([openlog], [gen syslog])
1118585484eSchristosLIB_SYSLOG=''
1128585484eSchristosAC_SUBST([LIB_SYSLOG])
1138585484eSchristosHMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
114abb0f93cSkardel
115abb0f93cSkardel# Checks for header files.
1168585484eSchristosAC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
1178585484eSchristosNTP_SYSEXITS_H
1188585484eSchristosNTP_FACILITYNAMES
119abb0f93cSkardel
120abb0f93cSkardel# Checks for typedefs, structures, and compiler characteristics.
121abb0f93cSkardelAC_HEADER_STDBOOL
122abb0f93cSkardel
1238585484eSchristosNTP_IPV6
124abb0f93cSkardel
125abb0f93cSkardel###
126abb0f93cSkardel
127abb0f93cSkardel# Hacks
128f003fb54Skardel# these need work if we're to move libntp under sntp
129f003fb54SkardelAC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
130f003fb54SkardelAC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
131abb0f93cSkardel
132abb0f93cSkardel# Checks for library functions.
1338585484eSchristosAC_CHECK_FUNCS([socket])
134abb0f93cSkardel
135f17b710fSchristosNTP_UNITYBUILD
136f003fb54Skardel
13742c29440SchristosSNTP_PROBLEM_TESTS
13842c29440Schristos
1398585484eSchristos# All libraries should be in various LIB_* variables now.
1408585484eSchristos#LIBS=
1418585484eSchristos# Sadly not.  There is a gettext() check somewhere, and on Solaris this pulls
1428585484eSchristos# in -lintl -lgen, outside our "scope".
143abb0f93cSkardel
144abb0f93cSkardelAC_CONFIG_FILES([Makefile])
1458585484eSchristosAC_CONFIG_FILES([include/Makefile])
1468585484eSchristosAC_CONFIG_FILES([scripts/Makefile])
1478585484eSchristosAC_CONFIG_FILES([tests/Makefile])
148f17b710fSchristosAC_CONFIG_FILES([tests/fileHandlingTest.h])
149f17b710fSchristosAC_CONFIG_FILES([unity/Makefile])
1508585484eSchristos
151abb0f93cSkardelAC_OUTPUT
152