configure.ac revision 316068
1211554Srpaulodnl SNTP subpackage configure.ac			-*- Autoconf -*-
2211554Srpaulodnl
3211554Srpaulom4_include([m4/version.m4])
4211554SrpauloAC_PREREQ([2.61])
5211554SrpauloAC_INIT(
6211554Srpaulo    [sntp],
7333617Sdteske    [VERSION_NUMBER],
8211554Srpaulo    [http://bugs.ntp.org./],
9211554Srpaulo    [],
10211554Srpaulo    [http://www.ntp.org./]dnl
11211554Srpaulo)
12211554SrpauloAC_CONFIG_MACRO_DIR([m4])
13211554SrpauloAC_CONFIG_AUX_DIR([libevent/build-aux])
14211554SrpauloAC_LANG([C])
15211554Srpaulo
16211554Srpaulo# Bump sntp_configure_cache_version for each change to configure.ac or
17211554Srpaulo# .m4 files which invalidates cached values from previous configure 
18211554Srpaulo# runs.
19211554Srpaulo#
20211554Srpaulo# If the change affects cache variables used only by the main NTP
21211554Srpaulo# configure.ac, then only its version number should be bumped, while
22211554Srpaulo# the subdir configure.ac version numbers should be unchanged.  The
23211554Srpaulo# same is true for a test/variable that is used only by one subdir
24211554Srpaulo# being changed incompatibly; only that subdir's cache version needs
25211554Srpaulo# bumping.
26211554Srpaulo#
27211554Srpaulo# If a change affects variables shared by all NTP configure scripts,
28211554Srpaulo# please bump the version numbers of each.  If you are not sure, the
29211554Srpaulo# safe choice is to bump all on any cache-invalidating change.
30211554Srpaulo#
31211554Srpaulo# In order to avoid the risk of version stamp collision between -stable
32211554Srpaulo# and -dev branches, do not simply increment the version, instead use
33211554Srpaulo# the date YYYYMMDD optionally with -HHMM if there is more than one
34211554Srpaulo# bump in a day.
35211554Srpaulo
36211554Srpaulosntp_configure_cache_version=20120806
37211554Srpaulo
38211554Srpaulo# When the version of config.cache and configure do not
39211554Srpaulo# match, NTP_CACHEVERSION will flush the cache.
40211554Srpaulo
41272488SmarkjNTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
42211554Srpaulo
43211554SrpauloAM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
44211554Srpaulodnl AM_SILENT_RULES req. automake 1.11.  [yes] defaults V=0
45211554Srpaulom4_ifdef(
46270358Sdelphij    [AM_SILENT_RULES],
47211554Srpaulo    [AM_SILENT_RULES([yes])]
48211554Srpaulo)
49272488SmarkjAC_CANONICAL_BUILD
50211554SrpauloAC_CANONICAL_HOST
51211554Srpaulodnl the 'build' machine is where we run configure and compile
52272488Smarkjdnl the 'host' machine is where the resulting stuff runs.
53211554SrpauloAC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
54211554SrpauloAC_CONFIG_HEADER([config.h])
55211554Srpaulodnl AC_ARG_PROGRAM
56211554Srpaulo
57211554SrpauloNTP_PROG_CC
58211554SrpauloNTP_COMPILER
59211554SrpauloNTP_HARDEN
60211554Srpaulo
61211554SrpauloNTP_LOCINFO()
62281257Smarkj
63211554Srpaulodnl AM_PROG_AR req. automake 1.12
64211554Srpaulom4_ifdef(
65    [AM_PROG_AR],
66    [AM_PROG_AR]
67)
68
69NTP_LIBNTP
70
71AC_DISABLE_SHARED
72AC_PROG_LIBTOOL
73AC_SUBST([LIBTOOL_DEPS])
74
75NTP_WITHSNTP
76
77case "$SNTP" in
78 '')
79    SNTP_DB=
80    SNTP_DL=
81    SNTP_DS=
82    ;;
83esac
84
85###
86
87# NTP has (so far) been relying on leading-edge autogen.
88# Therefore, by default:
89# - use the version we ship with
90# - do not install it
91# - build a static copy (AC_DISABLE_SHARED - done earlier)
92case "${enable_local_libopts+set}" in
93 set) ;;
94 *) enable_local_libopts=yes ;;
95esac
96case "${enable_libopts_install+set}" in
97 set) ;;
98 *) enable_libopts_install=no ;;
99esac
100enable_nls=no
101LIBOPTS_CHECK
102
103# From when we only used libevent for sntp:
104#AM_COND_IF(
105#    [BUILD_SNTP],
106#    [NTP_LIBEVENT_CHECK],
107#    [NTP_LIBEVENT_CHECK_NOBUILD]
108#)
109
110NTP_LIBEVENT_CHECK([2])
111
112# Checks for libraries.
113
114dnl NTP_LIBNTP checks for inet_XtoY
115dnl AC_SEARCH_LIBS([inet_pton], [nsl])
116
117dnl AC_SEARCH_LIBS([openlog], [gen syslog])
118LIB_SYSLOG=''
119AC_SUBST([LIB_SYSLOG])
120HMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
121
122# Checks for header files.
123AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
124NTP_SYSEXITS_H
125NTP_FACILITYNAMES
126
127# Checks for typedefs, structures, and compiler characteristics.
128AC_HEADER_STDBOOL
129
130NTP_OPENSSL
131NTP_IPV6
132
133###
134
135# Hacks
136# these need work if we're to move libntp under sntp
137AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
138AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
139
140# Checks for library functions.
141AC_CHECK_FUNCS([socket])
142
143NTP_UNITYBUILD
144## HMS: if we don't find c++ we should not look for gtest.
145#AC_PROG_CXX
146#NTP_GOOGLETEST
147
148SNTP_PROBLEM_TESTS
149
150# All libraries should be in various LIB_* variables now. 
151#LIBS=
152# Sadly not.  There is a gettext() check somewhere, and on Solaris this pulls
153# in -lintl -lgen, outside our "scope".
154
155AC_CONFIG_FILES([Makefile])
156AC_CONFIG_FILES([include/Makefile])
157AC_CONFIG_FILES([scripts/Makefile])
158AC_CONFIG_FILES([tests/Makefile])
159AC_CONFIG_FILES([tests/fileHandlingTest.h])
160AC_CONFIG_FILES([unity/Makefile])
161
162AC_OUTPUT
163