xref: /freebsd/contrib/ntp/sntp/configure.ac (revision 02e9120893770924227138ba49df1edb3896112a)
1dnl SNTP subpackage configure.ac			-*- Autoconf -*-
2dnl
3m4_include([m4/version.m4])
4AC_PREREQ([2.68])
5AC_INIT(
6    [sntp],
7    [VERSION_NUMBER],
8    [https://bugs.ntp.org/],
9    [],
10    [https://www.ntp.org/]dnl
11)
12AC_CONFIG_MACRO_DIR([m4])
13AC_CONFIG_AUX_DIR([libevent/build-aux])
14AC_LANG([C])
15
16# Bump sntp_configure_cache_version for each change to configure.ac or
17# .m4 files which invalidates cached values from previous configure
18# runs.
19#
20# If the change affects cache variables used only by the main NTP
21# configure.ac, then only its version number should be bumped, while
22# the subdir configure.ac version numbers should be unchanged.  The
23# same is true for a test/variable that is used only by one subdir
24# being changed incompatibly; only that subdir's cache version needs
25# bumping.
26#
27# If a change affects variables shared by all NTP configure scripts,
28# please bump the version numbers of each.  If you are not sure, the
29# safe choice is to bump all on any cache-invalidating change.
30#
31# In order to avoid the risk of version stamp collision between -stable
32# and -dev branches, do not simply increment the version, instead use
33# the date YYYYMMDD optionally with -HHMM if there is more than one
34# bump in a day.
35
36sntp_configure_cache_version=20120806
37
38# When the version of config.cache and configure do not
39# match, NTP_CACHEVERSION will flush the cache.
40
41NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
42
43AM_INIT_AUTOMAKE([1.15 foreign subdir-objects -Wall -Wno-gnu])
44
45AM_SILENT_RULES([yes])
46
47AC_CANONICAL_BUILD
48AC_CANONICAL_HOST
49dnl the 'build' machine is where we run configure and compile
50dnl the 'host' machine is where the resulting stuff runs.
51AC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
52AC_CONFIG_HEADER([config.h])
53dnl AC_ARG_PROGRAM
54
55NTP_PROG_CC
56NTP_COMPILER
57NTP_HARDEN
58
59NTP_LOCINFO()
60
61AM_PROG_AR
62
63NTP_LIBNTP
64
65AC_DISABLE_SHARED
66AC_PROG_LIBTOOL
67AC_SUBST([LIBTOOL_DEPS])
68
69NTP_WITHSNTP
70
71case "$SNTP" in
72 '')
73    SNTP_DB=
74    SNTP_DL=
75    SNTP_DS=
76    ;;
77esac
78
79###
80
81# NTP has (so far) been relying on leading-edge autogen.
82# Therefore, by default:
83# - use the version we ship with
84# - do not install it
85# - build a static copy (AC_DISABLE_SHARED - done earlier)
86case "${enable_local_libopts+set}" in
87 set) ;;
88 *) enable_local_libopts=yes ;;
89esac
90case "${enable_libopts_install+set}" in
91 set) ;;
92 *) enable_libopts_install=no ;;
93esac
94enable_nls=no
95LIBOPTS_CHECK
96
97# From when we only used libevent for sntp:
98#AM_COND_IF(
99#    [BUILD_SNTP],
100#    [NTP_LIBEVENT_CHECK],
101#    [NTP_LIBEVENT_CHECK_NOBUILD]
102#)
103
104NTP_LIBEVENT_CHECK([2])
105
106# Checks for libraries.
107
108dnl NTP_LIBNTP checks for inet_XtoY
109dnl AC_SEARCH_LIBS([inet_pton], [nsl])
110
111dnl AC_SEARCH_LIBS([openlog], [gen syslog])
112LIB_SYSLOG=''
113AC_SUBST([LIB_SYSLOG])
114HMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
115
116# Checks for header files.
117AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
118NTP_SYSEXITS_H
119NTP_FACILITYNAMES
120
121# Checks for typedefs, structures, and compiler characteristics.
122AC_HEADER_STDBOOL
123
124NTP_OPENSSL
125NTP_IPV6
126
127###
128
129# Hacks
130# these need work if we're to move libntp under sntp
131AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
132AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
133
134# Checks for library functions.
135AC_CHECK_FUNCS([socket])
136
137NTP_UNITYBUILD
138
139SNTP_PROBLEM_TESTS
140
141# All libraries should be in various LIB_* variables now.
142#LIBS=
143# Sadly not.  There is a gettext() check somewhere, and on Solaris this pulls
144# in -lintl -lgen, outside our "scope".
145
146AC_CONFIG_FILES([Makefile])
147AC_CONFIG_FILES([include/Makefile])
148AC_CONFIG_FILES([scripts/Makefile])
149AC_CONFIG_FILES([tests/Makefile])
150AC_CONFIG_FILES([tests/fileHandlingTest.h])
151AC_CONFIG_FILES([unity/Makefile])
152
153AC_OUTPUT
154