configure.ac revision 302408
188757Sachednl SNTP subpackage configure.ac			-*- Autoconf -*-
288757Sachednl
388757Sachem4_include([m4/version.m4])
488757SacheAC_PREREQ([2.61])
588757SacheAC_INIT(
688757Sache    [sntp],
788757Sache    [VERSION_NUMBER],
888757Sache    [http://bugs.ntp.org./],
988757Sache    [],
1088757Sache    [http://www.ntp.org./]dnl
1188757Sache)
1288757SacheAC_CONFIG_MACRO_DIR([m4])
1388757SacheAC_CONFIG_AUX_DIR([libevent/build-aux])
1488757SacheAC_LANG([C])
1588757Sache
1688757Sache# Bump sntp_configure_cache_version for each change to configure.ac or
1788757Sache# .m4 files which invalidates cached values from previous configure 
1888757Sache# runs.
1988757Sache#
2088757Sache# If the change affects cache variables used only by the main NTP
2188757Sache# configure.ac, then only its version number should be bumped, while
2288757Sache# the subdir configure.ac version numbers should be unchanged.  The
2388757Sache# same is true for a test/variable that is used only by one subdir
2488757Sache# being changed incompatibly; only that subdir's cache version needs
2588757Sache# bumping.
2688757Sache#
2788757Sache# If a change affects variables shared by all NTP configure scripts,
2888757Sache# please bump the version numbers of each.  If you are not sure, the
2988757Sache# safe choice is to bump all on any cache-invalidating change.
3088757Sache#
3188757Sache# In order to avoid the risk of version stamp collision between -stable
3288757Sache# and -dev branches, do not simply increment the version, instead use
3388757Sache# the date YYYYMMDD optionally with -HHMM if there is more than one
3488757Sache# bump in a day.
3588757Sache
3688757Sachesntp_configure_cache_version=20120806
3788757Sache
3888757Sache# When the version of config.cache and configure do not
3988757Sache# match, NTP_CACHEVERSION will flush the cache.
4088757Sache
4188757SacheNTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
4288757Sache
4388757SacheAM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
4488757Sachednl AM_SILENT_RULES req. automake 1.11.  [yes] defaults V=0
4588757Sachem4_ifdef(
4688757Sache    [AM_SILENT_RULES],
4788757Sache    [AM_SILENT_RULES([yes])]
4888757Sache)
4988757SacheAC_CANONICAL_BUILD
5088757SacheAC_CANONICAL_HOST
5188757Sachednl the 'build' machine is where we run configure and compile
5288757Sachednl the 'host' machine is where the resulting stuff runs.
5388757SacheAC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
5488757SacheAC_CONFIG_HEADER([config.h])
5588757Sachednl AC_ARG_PROGRAM
5688757Sache
5788757SacheNTP_PROG_CC
5888757Sache
5988757SacheNTP_LOCINFO()
6088757Sache
6188757Sachednl AM_PROG_AR req. automake 1.12
6288757Sachem4_ifdef(
6388757Sache    [AM_PROG_AR],
6488757Sache    [AM_PROG_AR]
6588757Sache)
6688757Sache
6788757SacheNTP_LIBNTP
6888757Sache
6988757SacheAC_DISABLE_SHARED
7088757SacheAC_PROG_LIBTOOL
7188757SacheAC_SUBST([LIBTOOL_DEPS])
7288757Sache
7388757SacheNTP_WITHSNTP
7488757Sache
7588757Sachecase "$SNTP" in
7688757Sache '')
7788757Sache    SNTP_DB=
7888757Sache    SNTP_DL=
7988757Sache    SNTP_DS=
8088757Sache    ;;
8188757Sacheesac
8288757Sache
8388757Sache###
8488757Sache
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