configure.ac revision 296373
150276Speterdnl SNTP subpackage configure.ac -*- Autoconf -*- 276726Speterdnl 350276Speterm4_include([m4/version.m4]) 450276SpeterAC_PREREQ([2.61]) 550276SpeterAC_INIT( 650276Speter [sntp], 750276Speter [VERSION_NUMBER], 850276Speter [http://bugs.ntp.org./], 950276Speter [], 1050276Speter [http://www.ntp.org./]dnl 1150276Speter) 1250276SpeterAC_CONFIG_MACRO_DIR([m4]) 1350276SpeterAC_CONFIG_AUX_DIR([libevent/build-aux]) 1450276SpeterAC_LANG([C]) 1550276Speter 1650276Speter# Bump sntp_configure_cache_version for each change to configure.ac or 1750276Speter# .m4 files which invalidates cached values from previous configure 1850276Speter# runs. 1950276Speter# 2050276Speter# If the change affects cache variables used only by the main NTP 2150276Speter# configure.ac, then only its version number should be bumped, while 2250276Speter# the subdir configure.ac version numbers should be unchanged. The 2350276Speter# same is true for a test/variable that is used only by one subdir 2450276Speter# being changed incompatibly; only that subdir's cache version needs 2550276Speter# bumping. 2650276Speter# 2750276Speter# If a change affects variables shared by all NTP configure scripts, 2850276Speter# please bump the version numbers of each. If you are not sure, the 2950276Speter# safe choice is to bump all on any cache-invalidating change. 3050276Speter# 3150276Speter# In order to avoid the risk of version stamp collision between -stable 3250276Speter# and -dev branches, do not simply increment the version, instead use 3350276Speter# the date YYYYMMDD optionally with -HHMM if there is more than one 3450276Speter# bump in a day. 3576726Speter 3650276Spetersntp_configure_cache_version=20120806 3750276Speter 3850276Speter# When the version of config.cache and configure do not 3950276Speter# match, NTP_CACHEVERSION will flush the cache. 4050276Speter 4150276SpeterNTP_CACHEVERSION([sntp], [$sntp_configure_cache_version]) 4250276Speter 4350276SpeterAM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-gnu]) 4450276Speterdnl AM_SILENT_RULES req. automake 1.11. [yes] defaults V=0 4550276Speterm4_ifdef( 4676726Speter [AM_SILENT_RULES], 4776726Speter [AM_SILENT_RULES([yes])] 4850276Speter) 4950276SpeterAC_CANONICAL_BUILD 5050276SpeterAC_CANONICAL_HOST 5150276Speterdnl the 'build' machine is where we run configure and compile 5250276Speterdnl the 'host' machine is where the resulting stuff runs. 5350276SpeterAC_DEFINE_UNQUOTED([STR_SYSTEM], "$host", [canonical system (cpu-vendor-os) of where we should run]) 5450276SpeterAC_CONFIG_HEADER([config.h]) 5550276Speterdnl AC_ARG_PROGRAM 5650276Speter 5750276SpeterNTP_PROG_CC 5850276Speter 5950276SpeterNTP_LOCINFO() 6050276Speter 6150276Speterdnl AM_PROG_AR req. automake 1.12 6250276Speterm4_ifdef( 6376726Speter [AM_PROG_AR], 6476726Speter [AM_PROG_AR] 6550276Speter) 6650276Speter 6750276SpeterNTP_LIBNTP 6850276Speter 6950276SpeterAC_DISABLE_SHARED 70AC_PROG_LIBTOOL 71AC_SUBST([LIBTOOL_DEPS]) 72 73NTP_WITHSNTP 74 75case "$SNTP" in 76 '') 77 SNTP_DB= 78 SNTP_DL= 79 SNTP_DS= 80 ;; 81esac 82 83### 84 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 146# All libraries should be in various LIB_* variables now. 147#LIBS= 148# Sadly not. There is a gettext() check somewhere, and on Solaris this pulls 149# in -lintl -lgen, outside our "scope". 150 151AC_CONFIG_FILES([Makefile]) 152AC_CONFIG_FILES([include/Makefile]) 153AC_CONFIG_FILES([scripts/Makefile]) 154AC_CONFIG_FILES([tests/Makefile]) 155AC_CONFIG_FILES([tests/fileHandlingTest.h]) 156AC_CONFIG_FILES([unity/Makefile]) 157 158AC_OUTPUT 159