2014-12-20 22:52:39 +00:00
|
|
|
dnl SNTP subpackage configure.ac -*- Autoconf -*-
|
|
|
|
dnl
|
|
|
|
m4_include([m4/version.m4])
|
2013-12-04 21:33:17 +00:00
|
|
|
AC_PREREQ([2.61])
|
2014-12-20 22:52:39 +00:00
|
|
|
AC_INIT(
|
|
|
|
[sntp],
|
|
|
|
[VERSION_NUMBER],
|
|
|
|
[http://bugs.ntp.org./],
|
|
|
|
[],
|
|
|
|
[http://www.ntp.org./]dnl
|
|
|
|
)
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
AC_CONFIG_AUX_DIR([libevent/build-aux])
|
|
|
|
|
|
|
|
# Bump sntp_configure_cache_version for each change to configure.ac or
|
|
|
|
# .m4 files which invalidates cached values from previous configure
|
|
|
|
# runs.
|
2013-12-04 21:33:17 +00:00
|
|
|
#
|
|
|
|
# If the change affects cache variables used only by the main NTP
|
|
|
|
# configure.ac, then only its version number should be bumped, while
|
|
|
|
# the subdir configure.ac version numbers should be unchanged. The
|
|
|
|
# same is true for a test/variable that is used only by one subdir
|
|
|
|
# being changed incompatibly; only that subdir's cache version needs
|
|
|
|
# bumping.
|
|
|
|
#
|
|
|
|
# If a change affects variables shared by all NTP configure scripts,
|
2014-12-20 22:52:39 +00:00
|
|
|
# please bump the version numbers of each. If you are not sure, the
|
|
|
|
# safe choice is to bump all on any cache-invalidating change.
|
2013-12-04 21:33:17 +00:00
|
|
|
#
|
|
|
|
# In order to avoid the risk of version stamp collision between -stable
|
|
|
|
# and -dev branches, do not simply increment the version, instead use
|
|
|
|
# the date YYYYMMDD optionally with -HHMM if there is more than one
|
|
|
|
# bump in a day.
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
sntp_configure_cache_version=20120806
|
2013-12-04 21:33:17 +00:00
|
|
|
|
|
|
|
# When the version of config.cache and configure do not
|
|
|
|
# match, NTP_CACHEVERSION will flush the cache.
|
|
|
|
|
|
|
|
NTP_CACHEVERSION([sntp], [$sntp_configure_cache_version])
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu])
|
|
|
|
dnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0
|
|
|
|
m4_ifdef(
|
|
|
|
[AM_SILENT_RULES],
|
|
|
|
[AM_SILENT_RULES([yes])]
|
|
|
|
)
|
2013-12-04 21:33:17 +00:00
|
|
|
AC_CANONICAL_BUILD
|
2008-08-18 14:26:05 +00:00
|
|
|
AC_CANONICAL_HOST
|
2013-12-04 21:33:17 +00:00
|
|
|
dnl the 'build' machine is where we run configure and compile
|
|
|
|
dnl the 'host' machine is where the resulting stuff runs.
|
|
|
|
AC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
|
|
|
dnl AC_ARG_PROGRAM
|
2004-07-20 15:01:56 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
NTP_PROG_CC
|
2004-07-20 15:01:56 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
NTP_LOCINFO()
|
2008-08-18 14:26:05 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
dnl AM_PROG_AR req. automake 1.12
|
|
|
|
m4_ifdef(
|
|
|
|
[AM_PROG_AR],
|
|
|
|
[AM_PROG_AR]
|
|
|
|
)
|
2009-12-12 22:29:30 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
NTP_LIBNTP
|
2013-12-04 21:33:17 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
AC_DISABLE_SHARED
|
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_SUBST([LIBTOOL_DEPS])
|
2013-12-04 21:33:17 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
NTP_WITHSNTP
|
2013-12-04 21:33:17 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
case "$SNTP" in
|
|
|
|
'')
|
|
|
|
SNTP_DB=
|
|
|
|
SNTP_DL=
|
|
|
|
SNTP_DS=
|
2013-12-04 21:33:17 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
###
|
2008-08-18 14:26:05 +00:00
|
|
|
|
|
|
|
# NTP has (so far) been relying on leading-edge autogen.
|
|
|
|
# Therefore, by default:
|
|
|
|
# - use the version we ship with
|
|
|
|
# - do not install it
|
|
|
|
# - build a static copy (AC_DISABLE_SHARED - done earlier)
|
|
|
|
case "${enable_local_libopts+set}" in
|
|
|
|
set) ;;
|
|
|
|
*) enable_local_libopts=yes ;;
|
|
|
|
esac
|
|
|
|
case "${enable_libopts_install+set}" in
|
|
|
|
set) ;;
|
|
|
|
*) enable_libopts_install=no ;;
|
|
|
|
esac
|
2014-12-20 22:52:39 +00:00
|
|
|
enable_nls=no
|
2008-08-18 14:26:05 +00:00
|
|
|
LIBOPTS_CHECK
|
|
|
|
|
2015-02-05 20:53:33 +00:00
|
|
|
# From when we only used libevent for sntp:
|
|
|
|
#AM_COND_IF(
|
|
|
|
# [BUILD_SNTP],
|
|
|
|
# [NTP_LIBEVENT_CHECK],
|
|
|
|
# [NTP_LIBEVENT_CHECK_NOBUILD]
|
|
|
|
#)
|
|
|
|
|
|
|
|
NTP_LIBEVENT_CHECK([2])
|
2008-08-18 14:26:05 +00:00
|
|
|
|
2013-12-04 21:33:17 +00:00
|
|
|
# Checks for libraries.
|
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
dnl NTP_LIBNTP checks for inet_XtoY
|
|
|
|
dnl AC_SEARCH_LIBS([inet_pton], [nsl])
|
2013-12-04 21:33:17 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
dnl AC_SEARCH_LIBS([openlog], [gen syslog])
|
|
|
|
LIB_SYSLOG=''
|
|
|
|
AC_SUBST([LIB_SYSLOG])
|
|
|
|
HMS_SEARCH_LIBS([LIB_SYSLOG], [openlog], [gen syslog])
|
2013-12-04 21:33:17 +00:00
|
|
|
|
|
|
|
# Checks for header files.
|
2014-12-20 22:52:39 +00:00
|
|
|
AC_CHECK_HEADERS([netdb.h string.h strings.h syslog.h])
|
|
|
|
NTP_SYSEXITS_H
|
|
|
|
NTP_FACILITYNAMES
|
2013-12-04 21:33:17 +00:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_HEADER_STDBOOL
|
2004-07-20 15:01:56 +00:00
|
|
|
|
2013-12-04 21:33:17 +00:00
|
|
|
NTP_OPENSSL
|
2014-12-20 22:52:39 +00:00
|
|
|
NTP_IPV6
|
2013-12-04 21:33:17 +00:00
|
|
|
|
|
|
|
###
|
|
|
|
|
|
|
|
# Hacks
|
|
|
|
# these need work if we're to move libntp under sntp
|
|
|
|
AC_DEFINE([HAVE_NO_NICE], 1, [sntp does not care about 'nice'])
|
|
|
|
AC_DEFINE([HAVE_TERMIOS], 1, [sntp does not care about TTY stuff])
|
|
|
|
|
|
|
|
# Checks for library functions.
|
2014-12-20 22:52:39 +00:00
|
|
|
AC_CHECK_FUNCS([socket])
|
2013-12-04 21:33:17 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
# HMS: if we don't find c++ we should not look for gtest.
|
|
|
|
AC_PROG_CXX
|
|
|
|
NTP_GOOGLETEST
|
2013-12-04 21:33:17 +00:00
|
|
|
|
2014-12-20 22:52:39 +00:00
|
|
|
# All libraries should be in various LIB_* variables now.
|
|
|
|
#LIBS=
|
|
|
|
# Sadly not. There is a gettext() check somewhere, and on Solaris this pulls
|
|
|
|
# in -lintl -lgen, outside our "scope".
|
2008-08-18 14:26:05 +00:00
|
|
|
|
2004-07-20 15:01:56 +00:00
|
|
|
AC_CONFIG_FILES([Makefile])
|
2014-12-20 22:52:39 +00:00
|
|
|
AC_CONFIG_FILES([include/Makefile])
|
|
|
|
AC_CONFIG_FILES([scripts/Makefile])
|
|
|
|
AC_CONFIG_FILES([tests/Makefile])
|
|
|
|
|
2004-07-20 15:01:56 +00:00
|
|
|
AC_OUTPUT
|