1# Process this file with autoconf to produce a configure script. 2AC_INIT(main.c) 3AM_INIT_AUTOMAKE([msntp],[1.6]) 4AC_CONFIG_SRCDIR([header.h]) 5AC_CANONICAL_SYSTEM 6 7# Checks for programs. 8AC_PROG_CC 9 10# Checks for libraries. 11 12# Checks for header files. 13AC_HEADER_STDC 14AC_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]) 15 16# Checks for typedefs, structures, and compiler characteristics. 17AC_C_CONST 18AC_TYPE_SIZE_T 19AC_HEADER_TIME 20AC_STRUCT_TM 21 22AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], 23 ac_cv_have_ss_family_in_struct_ss, [ 24 AC_TRY_COMPILE( 25 [ 26#include <sys/types.h> 27#include <sys/socket.h> 28 ], 29 [ struct sockaddr_storage s; s.ss_family = 1; ], 30 [ ac_cv_have_ss_family_in_struct_ss="yes" ], 31 [ ac_cv_have_ss_family_in_struct_ss="no" ], 32 ) 33]) 34if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then 35 AC_DEFINE(HAVE_SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have ss_family?]) 36fi 37 38AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage], 39 ac_cv_have___ss_family_in_struct_ss, [ 40 AC_TRY_COMPILE( 41 [ 42#include <sys/types.h> 43#include <sys/socket.h> 44 ], 45 [ struct sockaddr_storage s; s.__ss_family = 1; ], 46 [ ac_cv_have___ss_family_in_struct_ss="yes" ], 47 [ ac_cv_have___ss_family_in_struct_ss="no" ] 48 ) 49]) 50if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then 51 AC_DEFINE(HAVE___SS_FAMILY_IN_SS, 1, [Does struct sockaddr_storage have __ss_family?]) 52fi 53 54case "$ac_cv_have_ss_family_in_struct_ss$ac_cv_have___ss_family_in_struct_ss" in 55 noyes) 56 AC_DEFINE_UNQUOTED(ss_family, __ss_family, []) 57 AC_DEFINE_UNQUOTED(ss_len, __ss_len, []) 58 ;; 59esac 60 61# Checks for library functions. 62AC_FUNC_MEMCMP 63AC_FUNC_SETVBUF_REVERSED 64AC_TYPE_SIGNAL 65AC_CHECK_FUNCS([alarm]) 66AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent, , , -lsocket)) 67AC_CHECK_FUNCS([gettimeofday inet_ntoa memset]) 68AC_CHECK_FUNCS(socket, , AC_CHECK_LIB(socket, socket)) 69AC_CHECK_FUNCS(sqrt, , AC_CHECK_LIB(m, sqrt)) 70AC_CHECK_FUNCS([strrchr]) 71 72case "$host" in 73 *-*-linux*) 74 CFLAGS="$CFLAGS -DADJTIME_MISSING" 75 ;; 76 *-*-sunos*) 77 CFLAGS="$CFLAGS -DNONBLOCK_BROKEN" 78 ;; 79esac 80 81AC_CONFIG_FILES([Makefile]) 82AC_OUTPUT 83