1290001Sglebiusdnl SNTP subpackage configure.ac			-*- Autoconf -*-
2290001Sglebiusdnl
3290001Sglebiusm4_include([m4/version.m4])
4290001SglebiusAC_PREREQ([2.61])
5290001SglebiusAC_INIT(
6290001Sglebius    [sntp],
7290001Sglebius    [VERSION_NUMBER],
8290001Sglebius    [http://bugs.ntp.org./],
9290001Sglebius    [],
10290001Sglebius    [http://www.ntp.org./]dnl
11290001Sglebius)
12290001SglebiusAC_CONFIG_MACRO_DIR([m4])
13290001SglebiusAC_CONFIG_AUX_DIR([libevent/build-aux])
14290001SglebiusAC_LANG([C])
15290001Sglebius
16290001Sglebius# Bump sntp_configure_cache_version for each change to configure.ac or
17290001Sglebius# .m4 files which invalidates cached values from previous configure 
18290001Sglebius# runs.
19290001Sglebius#
20290001Sglebius# If the change affects cache variables used only by the main NTP
21290001Sglebius# configure.ac, then only its version number should be bumped, while
22290001Sglebius# the subdir configure.ac version numbers should be unchanged.  The
23290001Sglebius# same is true for a test/variable that is used only by one subdir
24290001Sglebius# being changed incompatibly; only that subdir's cache version needs
25290001Sglebius# bumping.
26290001Sglebius#
27290001Sglebius# If a change affects variables shared by all NTP configure scripts,
28290001Sglebius# please bump the version numbers of each.  If you are not sure, the
29290001Sglebius# safe choice is to bump all on any cache-invalidating change.
30290001Sglebius#
31290001Sglebius# In order to avoid the risk of version stamp collision between -stable
32290001Sglebius# and -dev branches, do not simply increment the version, instead use
33290001Sglebius# the date YYYYMMDD optionally with -HHMM if there is more than one
34290001Sglebius# bump in a day.
35290001Sglebius
36290001Sglebiussntp_configure_cache_version=20120806
37290001Sglebius
38290001Sglebius# When the version of config.cache and configure do not
39290001Sglebius# match, NTP_CACHEVERSION will flush the cache.
40290001Sglebius
41290001SglebiusNTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
42290001Sglebius
43290001SglebiusAM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
44290001Sglebiusdnl AM_SILENT_RULES req. automake 1.11.  [yes] defaults V=0
45290001Sglebiusm4_ifdef(
46290001Sglebius    [AM_SILENT_RULES],
47290001Sglebius    [AM_SILENT_RULES([yes])]
48290001Sglebius)
49290001SglebiusAC_CANONICAL_BUILD
50182007SrobertoAC_CANONICAL_HOST
51290001Sglebiusdnl the 'build' machine is where we run configure and compile
52290001Sglebiusdnl the 'host' machine is where the resulting stuff runs.
53290001SglebiusAC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
54290001SglebiusAC_CONFIG_HEADER([config.h])
55290001Sglebiusdnl AC_ARG_PROGRAM
56132451Sroberto
57290001SglebiusNTP_PROG_CC
58132451Sroberto
59290001SglebiusNTP_LOCINFO()
60182007Sroberto
61290001Sglebiusdnl AM_PROG_AR req. automake 1.12
62290001Sglebiusm4_ifdef(
63290001Sglebius    [AM_PROG_AR],
64290001Sglebius    [AM_PROG_AR]
65290001Sglebius)
66200576Sroberto
67290001SglebiusNTP_LIBNTP
68290001Sglebius
69290001SglebiusAC_DISABLE_SHARED
70182007SrobertoAC_PROG_LIBTOOL
71290001SglebiusAC_SUBST([LIBTOOL_DEPS])
72182007Sroberto
73290001SglebiusNTP_WITHSNTP
74290001Sglebius
75290001Sglebiuscase "$SNTP" in
76290001Sglebius '')
77290001Sglebius    SNTP_DB=
78290001Sglebius    SNTP_DL=
79290001Sglebius    SNTP_DS=
80290001Sglebius    ;;
81290001Sglebiusesac
82290001Sglebius
83290001Sglebius###
84290001Sglebius
85182007Sroberto# NTP has (so far) been relying on leading-edge autogen.
86182007Sroberto# Therefore, by default:
87182007Sroberto# - use the version we ship with
88182007Sroberto# - do not install it
89182007Sroberto# - build a static copy (AC_DISABLE_SHARED - done earlier)
90182007Srobertocase "${enable_local_libopts+set}" in
91182007Sroberto set) ;;
92182007Sroberto *) enable_local_libopts=yes ;;
93182007Srobertoesac
94182007Srobertocase "${enable_libopts_install+set}" in
95182007Sroberto set) ;;
96182007Sroberto *) enable_libopts_install=no ;;
97182007Srobertoesac
98290001Sglebiusenable_nls=no
99182007SrobertoLIBOPTS_CHECK
100182007Sroberto
101290001Sglebius# From when we only used libevent for sntp:
102290001Sglebius#AM_COND_IF(
103290001Sglebius#    [BUILD_SNTP],
104290001Sglebius#    [NTP_LIBEVENT_CHECK],
105290001Sglebius#    [NTP_LIBEVENT_CHECK_NOBUILD]
106290001Sglebius#)
107182007Sroberto
108290001SglebiusNTP_LIBEVENT_CHECK([2])
109182007Sroberto
110290001Sglebius# Checks for libraries.
111200576Sroberto
112290001Sglebiusdnl NTP_LIBNTP checks for inet_XtoY
113290001Sglebiusdnl AC_SEARCH_LIBS([inet_pton], [nsl])
114200576Sroberto
115290001Sglebiusdnl AC_SEARCH_LIBS([openlog], [gen syslog])
116290001SglebiusLIB_SYSLOG=''
117290001SglebiusAC_SUBST([LIB_SYSLOG])
118290001SglebiusHMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
119200576Sroberto
120132451Sroberto# Checks for header files.
121290001SglebiusAC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
122290001SglebiusNTP_SYSEXITS_H
123290001SglebiusNTP_FACILITYNAMES
124132451Sroberto
125132451Sroberto# Checks for typedefs, structures, and compiler characteristics.
126290001SglebiusAC_HEADER_STDBOOL
127132451Sroberto
128290001SglebiusNTP_OPENSSL
129290001SglebiusNTP_IPV6
130132451Sroberto
131290001Sglebius###
132132451Sroberto
133290001Sglebius# Hacks
134290001Sglebius# these need work if we're to move libntp under sntp
135290001SglebiusAC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
136290001SglebiusAC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
137132451Sroberto
138132451Sroberto# Checks for library functions.
139290001SglebiusAC_CHECK_FUNCS([socket])
140132451Sroberto
141290001SglebiusNTP_UNITYBUILD
142290001Sglebius# HMS: if we don't find c++ we should not look for gtest.
143290001SglebiusAC_PROG_CXX
144290001SglebiusNTP_GOOGLETEST
145132451Sroberto
146301301SdelphijSNTP_PROBLEM_TESTS
147301301Sdelphij
148290001Sglebius# All libraries should be in various LIB_* variables now. 
149290001Sglebius#LIBS=
150290001Sglebius# Sadly not.  There is a gettext() check somewhere, and on Solaris this pulls
151290001Sglebius# in -lintl -lgen, outside our "scope".
152182007Sroberto
153290001SglebiusAC_CONFIG_FILES([Makefile])
154290001SglebiusAC_CONFIG_FILES([include/Makefile])
155290001SglebiusAC_CONFIG_FILES([scripts/Makefile])
156290001SglebiusAC_CONFIG_FILES([tests/Makefile])
157290001SglebiusAC_CONFIG_FILES([tests/fileHandlingTest.h])
158290001SglebiusAC_CONFIG_FILES([unity/Makefile])
159182007Sroberto
160132451SrobertoAC_OUTPUT
161