xref: /freebsd/contrib/ntp/sntp/configure.ac (revision 5dae51da3da0cc94d17bd67b308fad304ebec7e0)
1dnl SNTP subpackage configure.ac			-*- Autoconf -*-
2dnl
3m4_include([m4/version.m4])
4AC_PREREQ([2.61])
5AC_INIT(
6    [sntp],
7    [VERSION_NUMBER],
8    [http://bugs.ntp.org./],
9    [],
10    [http://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.10 foreign -Wall -Wno-gnu])
44dnl AM_SILENT_RULES req. automake 1.11.  [yes] defaults V=0
45m4_ifdef(
46    [AM_SILENT_RULES],
47    [AM_SILENT_RULES([yes])]
48)
49AC_CANONICAL_BUILD
50AC_CANONICAL_HOST
51dnl the 'build' machine is where we run configure and compile
52dnl the 'host' machine is where the resulting stuff runs.
53AC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
54AC_CONFIG_HEADER([config.h])
55dnl AC_ARG_PROGRAM
56
57NTP_PROG_CC
58
59NTP_LOCINFO()
60
61dnl AM_PROG_AR req. automake 1.12
62m4_ifdef(
63    [AM_PROG_AR],
64    [AM_PROG_AR]
65)
66
67NTP_LIBNTP
68
69AC_DISABLE_SHARED
70AC_PROG_LIBTOOL
71AC_SUBST([LIBTOOL_DEPS])
72
73NTP_WITHSNTP
74
75case "$SNTP" in
76 '')
77    SNTP_DB=
78    SNTP_DL=
79    SNTP_DS=
80    ;;
81esac
82
83###
84
85# NTP has (so far) been relying on leading-edge autogen.
86# Therefore, by default:
87# - use the version we ship with
88# - do not install it
89# - build a static copy (AC_DISABLE_SHARED - done earlier)
90case "${enable_local_libopts+set}" in
91 set) ;;
92 *) enable_local_libopts=yes ;;
93esac
94case "${enable_libopts_install+set}" in
95 set) ;;
96 *) enable_libopts_install=no ;;
97esac
98enable_nls=no
99LIBOPTS_CHECK
100
101# From when we only used libevent for sntp:
102#AM_COND_IF(
103#    [BUILD_SNTP],
104#    [NTP_LIBEVENT_CHECK],
105#    [NTP_LIBEVENT_CHECK_NOBUILD]
106#)
107
108NTP_LIBEVENT_CHECK([2])
109
110# Checks for libraries.
111
112dnl NTP_LIBNTP checks for inet_XtoY
113dnl AC_SEARCH_LIBS([inet_pton], [nsl])
114
115dnl AC_SEARCH_LIBS([openlog], [gen syslog])
116LIB_SYSLOG=''
117AC_SUBST([LIB_SYSLOG])
118HMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
119
120# Checks for header files.
121AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
122NTP_SYSEXITS_H
123NTP_FACILITYNAMES
124
125# Checks for typedefs, structures, and compiler characteristics.
126AC_HEADER_STDBOOL
127
128NTP_OPENSSL
129NTP_IPV6
130
131###
132
133# Hacks
134# these need work if we're to move libntp under sntp
135AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
136AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
137
138# Checks for library functions.
139AC_CHECK_FUNCS([socket])
140
141NTP_UNITYBUILD
142# HMS: if we don't find c++ we should not look for gtest.
143AC_PROG_CXX
144NTP_GOOGLETEST
145
146SNTP_PROBLEM_TESTS
147
148# All libraries should be in various LIB_* variables now.
149#LIBS=
150# Sadly not.  There is a gettext() check somewhere, and on Solaris this pulls
151# in -lintl -lgen, outside our "scope".
152
153AC_CONFIG_FILES([Makefile])
154AC_CONFIG_FILES([include/Makefile])
155AC_CONFIG_FILES([scripts/Makefile])
156AC_CONFIG_FILES([tests/Makefile])
157AC_CONFIG_FILES([tests/fileHandlingTest.h])
158AC_CONFIG_FILES([unity/Makefile])
159
160AC_OUTPUT
161