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