1 # Process this file with autoconf to produce a configure script.
3 AM_INIT_AUTOMAKE([msntp],[1.6])
4 AC_CONFIG_SRCDIR([header.h])
6 AM_CONFIG_HEADER(config.h)
11 # So far, the only shared library we might use is libopts.
12 # It's a small library - we might as well use a static version of it.
15 m4_defun([_LT_AC_LANG_CXX_CONFIG], [:])
16 m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
20 # NTP has (so far) been relying on leading-edge autogen.
21 # Therefore, by default:
22 # - use the version we ship with
24 # - build a static copy (AC_DISABLE_SHARED - done earlier)
25 case "${enable_local_libopts+set}" in
27 *) enable_local_libopts=yes ;;
29 case "${enable_libopts_install+set}" in
31 *) enable_libopts_install=no ;;
35 AC_MSG_CHECKING([[if $CC can handle #warning]])
36 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#warning foo]])],[ac_cv_cpp_warning=yes],[ac_cv_cpp_warning=no])
37 AC_MSG_RESULT([$ac_cv_cpp_warning])
39 case "$ac_cv_cpp_warning" in
41 AC_DEFINE([NO_OPTION_NAME_WARNINGS], [1], [Should we avoid #warning on option name collisions?])
42 AC_MSG_RESULT([[Enabling NO_OPTION_NAME_WARNINGS as #warning does not work]])
48 case "$ac_cv_c_inline" in
52 AC_DEFINE(HAVE_INLINE,1,[inline keyword or macro available])
57 # Checks for libraries.
59 # Checks for header files.
61 AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h limits.h netdb.h netinet/in.h stdlib.h string.h sys/socket.h sys/time.h syslog.h unistd.h])
63 # Checks for typedefs, structures, and compiler characteristics.
69 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
70 ac_cv_have_ss_family_in_struct_ss, [
73 #include <sys/types.h>
74 #include <sys/socket.h>
76 [ struct sockaddr_storage s; s.ss_family = 1; ],
77 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
78 [ ac_cv_have_ss_family_in_struct_ss="no" ],
81 case "$ac_cv_have_ss_family_in_struct_ss" in
83 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?])
87 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
88 ac_cv_have___ss_family_in_struct_ss, [
91 #include <sys/types.h>
92 #include <sys/socket.h>
94 [ struct sockaddr_storage s; s.__ss_family = 1; ],
95 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
96 [ ac_cv_have___ss_family_in_struct_ss="no" ]
99 case "$ac_cv_have___ss_family_in_struct_ss" in
101 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?])
105 case "$ac_cv_have_ss_family_in_struct_ss$ac_cv_have___ss_family_in_struct_ss" in
107 AC_DEFINE_UNQUOTED([ss_family], [__ss_family], [normalize ss_family access])
108 AC_DEFINE_UNQUOTED([ss_len], [__ss_len], [normalize ss_len access])
112 # Checks for library functions.
113 #AC_FUNC_MEMCMP dnl HMS: we don't have a memcmp.c to use here, so why bother?
114 AC_FUNC_SETVBUF_REVERSED
116 AC_CHECK_FUNCS([alarm])
117 AC_CHECK_FUNC([gethostent], , AC_SEARCH_LIBS([gethostent], [nsl], , , [-lsocket]))
118 AC_CHECK_FUNCS([gettimeofday inet_ntoa memset])
119 AC_CHECK_FUNCS([socket], , AC_SEARCH_LIBS([socket], [socket]))
120 AC_CHECK_FUNCS([sqrt], , AC_SEARCH_LIBS([sqrt], [m]))
121 AC_CHECK_FUNCS([strrchr])
124 *-*-hpux10.*) # at least for hppa2.0-hp-hpux10.20
128 *) CFLAGS="$CFLAGS -Wp,-H18816"
133 CFLAGS="$CFLAGS -DADJTIME_MISSING"
136 CFLAGS="$CFLAGS -DNONBLOCK_BROKEN"
140 AC_MSG_CHECKING(for bin subdirectory)
141 AC_ARG_WITH(binsubdir,
142 AC_HELP_STRING([--with-binsubdir], [bin ={bin,sbin}]),
143 use_binsubdir="$withval", use_binsubdir="bin")
145 case "$use_binsubdir" in
151 AC_MSG_ERROR([<$use_binsubdir> is illegal - must be "bin" or "sbin"])
154 AC_MSG_RESULT($use_binsubdir)
155 BINSUBDIR=$use_binsubdir
158 AC_CONFIG_FILES([Makefile])