]> CyberLeo.Net >> Repos - FreeBSD/releng/10.3.git/blob - contrib/ntp/sntp/configure.ac
Fix multiple vulnerabilities of ntp. [SA-17:03]
[FreeBSD/releng/10.3.git] / contrib / ntp / sntp / configure.ac
1 dnl SNTP subpackage configure.ac                        -*- Autoconf -*-
2 dnl
3 m4_include([m4/version.m4])
4 AC_PREREQ([2.61])
5 AC_INIT(
6     [sntp],
7     [VERSION_NUMBER],
8     [http://bugs.ntp.org./],
9     [],
10     [http://www.ntp.org./]dnl
11 )
12 AC_CONFIG_MACRO_DIR([m4])
13 AC_CONFIG_AUX_DIR([libevent/build-aux])
14 AC_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
36 sntp_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
41 NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
42
43 AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
44 dnl AM_SILENT_RULES req. automake 1.11.  [yes] defaults V=0
45 m4_ifdef(
46     [AM_SILENT_RULES],
47     [AM_SILENT_RULES([yes])]
48 )
49 AC_CANONICAL_BUILD
50 AC_CANONICAL_HOST
51 dnl the 'build' machine is where we run configure and compile
52 dnl the 'host' machine is where the resulting stuff runs.
53 AC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
54 AC_CONFIG_HEADER([config.h])
55 dnl AC_ARG_PROGRAM
56
57 NTP_PROG_CC
58 NTP_COMPILER
59 NTP_HARDEN
60
61 NTP_LOCINFO()
62
63 dnl AM_PROG_AR req. automake 1.12
64 m4_ifdef(
65     [AM_PROG_AR],
66     [AM_PROG_AR]
67 )
68
69 NTP_LIBNTP
70
71 AC_DISABLE_SHARED
72 AC_PROG_LIBTOOL
73 AC_SUBST([LIBTOOL_DEPS])
74
75 NTP_WITHSNTP
76
77 case "$SNTP" in
78  '')
79     SNTP_DB=
80     SNTP_DL=
81     SNTP_DS=
82     ;;
83 esac
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)
92 case "${enable_local_libopts+set}" in
93  set) ;;
94  *) enable_local_libopts=yes ;;
95 esac
96 case "${enable_libopts_install+set}" in
97  set) ;;
98  *) enable_libopts_install=no ;;
99 esac
100 enable_nls=no
101 LIBOPTS_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
110 NTP_LIBEVENT_CHECK([2])
111
112 # Checks for libraries.
113
114 dnl NTP_LIBNTP checks for inet_XtoY
115 dnl AC_SEARCH_LIBS([inet_pton], [nsl])
116
117 dnl AC_SEARCH_LIBS([openlog], [gen syslog])
118 LIB_SYSLOG=''
119 AC_SUBST([LIB_SYSLOG])
120 HMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
121
122 # Checks for header files.
123 AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
124 NTP_SYSEXITS_H
125 NTP_FACILITYNAMES
126
127 # Checks for typedefs, structures, and compiler characteristics.
128 AC_HEADER_STDBOOL
129
130 NTP_OPENSSL
131 NTP_IPV6
132
133 ###
134
135 # Hacks
136 # these need work if we're to move libntp under sntp
137 AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
138 AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
139
140 # Checks for library functions.
141 AC_CHECK_FUNCS([socket])
142
143 NTP_UNITYBUILD
144 ## HMS: if we don't find c++ we should not look for gtest.
145 #AC_PROG_CXX
146 #NTP_GOOGLETEST
147
148 SNTP_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
155 AC_CONFIG_FILES([Makefile])
156 AC_CONFIG_FILES([include/Makefile])
157 AC_CONFIG_FILES([scripts/Makefile])
158 AC_CONFIG_FILES([tests/Makefile])
159 AC_CONFIG_FILES([tests/fileHandlingTest.h])
160 AC_CONFIG_FILES([unity/Makefile])
161
162 AC_OUTPUT