Annotation of embedaddon/arping/configure.ac, revision 1.1.1.3
1.1 misho 1: # -*- Autoconf -*-
2: # Process this file with autoconf to produce a configure script.
3:
4: AC_PREREQ(2.61)
1.1.1.3 ! misho 5: AC_INIT(arping, 2.15, thomas@habets.se)
1.1 misho 6: AC_CANONICAL_SYSTEM
7: AC_CONFIG_SRCDIR([src/arping.c])
8: AM_INIT_AUTOMAKE
9: AM_MAINTAINER_MODE
10: AC_CONFIG_HEADER(config.h)
11:
12:
13: # Checks for programs.
14: AC_PROG_CC
15: AC_PROG_INSTALL
16: AC_PROG_MAKE_SET
17:
18: # Checks for libraries.
1.1.1.2 misho 19: AC_CHECK_LIB([m], [sqrt])
1.1 misho 20: AC_CHECK_LIB([socket], [socket])
21: AC_CHECK_LIB([nsl], [gethostbyname])
1.1.1.3 ! misho 22: AC_CHECK_LIB([cap], [cap_init])
1.1.1.2 misho 23: AC_CHECK_LIB([rt], [clock_gettime])
1.1 misho 24: AC_CHECK_LIB([net], [libnet_name_resolve],
25: [AC_MSG_ERROR([libnet 1.0.x found. Arping 2.x requires libnet 1.1.x])])
26: AC_CHECK_LIB([net], [libnet_init], ,[AC_MSG_ERROR([libnet 1.1.x not found])])
27: AC_CHECK_LIB([pcap], [pcap_open_live], ,[AC_MSG_ERROR([libpcap not found])])
1.1.1.2 misho 28: AC_SEARCH_LIBS([clock_gettime], [rt])
1.1 misho 29:
30: # Checks for header files.
31: AC_HEADER_STDC
32: AC_CHECK_HEADERS([\
33: arpa/inet.h \
34: netinet/in.h \
35: stdlib.h \
36: sys/socket.h \
1.1.1.2 misho 37: time.h \
1.1 misho 38: sys/time.h \
39: sys/types.h \
1.1.1.3 ! misho 40: sys/capability.h \
1.1 misho 41: stdint.h \
42: libnet.h \
43: win32/libnet.h \
44: net/bpf.h \
1.1.1.3 ! misho 45: pwd.h \
1.1 misho 46: unistd.h])
47:
48: # Libnet include file is not optional
49: if test ! x$ac_cv_header_libnet_h = xyes; then
50: AC_MSG_ERROR([Can't find libnet.h. See INSTALL file for where to get Libnet])
51: fi
52:
53: # Checks for typedefs, structures, and compiler characteristics.
54: AC_C_CONST
55: AC_HEADER_TIME
56: AC_C_VOLATILE
57: AC_TYPE_UINT8_T
58: AC_TYPE_UINT16_T
59: AC_TYPE_UINT32_T
60: AC_TYPE_UINT64_T
61:
62: # Checks for library functions.
63: AC_PROG_GCC_TRADITIONAL
64: AC_FUNC_SELECT_ARGTYPES
65: AC_FUNC_SETVBUF_REVERSED
66: AC_TYPE_SIGNAL
1.1.1.2 misho 67: AC_CHECK_FUNCS([gettimeofday memset select strchr strdup strerror strstr \
1.1.1.3 ! misho 68: getifaddrs cap_init pcap_create pcap_list_tstamp_types pcap_set_immediate_mode])
1.1.1.2 misho 69:
70: if test x$ac_cv_func_getifaddrs = xyes; then
71: AC_LIBOBJ([findif_getifaddrs])
72: else
73: case "$target_os" in
74: *linux*)
75: AC_LIBOBJ([findif_linux])
76: ;;
77: *freebsd*|*openbsd*|*darwin*)
78: AC_LIBOBJ([findif_sysctl])
79: ;;
80: *solaris*)
81: AC_LIBOBJ([findif_bsdroute])
82: ;;
83: *)
84: AC_LIBOBJ([findif_other])
85: ;;
86: esac
87: fi
88:
89:
90:
91: # check for CLOCK_MONOTONIC
92: AC_CACHE_CHECK([for CLOCK_MONOTONIC],
93: ac_cv_have_clock_monotonic, [
94: AC_TRY_RUN(
95: [
96: #include <time.h>
97: #include <sys/time.h>
98: int main() {
99: struct timespec ts;
100: exit(!!clock_gettime(CLOCK_MONOTONIC, &ts));
101: }
102: ],
103: [ ac_cv_have_clock_monotonic="yes" ],
104: [ ac_cv_have_clock_monotonic="no" ]
105: )
106: ])
107: AM_CONDITIONAL(HAVE_CLOCK_MONOTONIC, test x$ac_cv_have_clock_monotonic = xyes)
108: if test x$ac_cv_have_clock_monotonic = xyes; then
109: AC_DEFINE([HAVE_CLOCK_MONOTONIC], [1], [Monotonic clock])
110: fi
1.1 misho 111:
112: AC_CONFIG_FILES([Makefile])
113: AC_CONFIG_FILES([src/Makefile])
114: AC_CONFIG_FILES([doc/Makefile])
115: AC_OUTPUT
116:
117: echo "
118: $PACKAGE_NAME version $PACKAGE_VERSION
119: Prefix.........: $prefix
120: Debug Build....: $debug
121: C Compiler.....: $CC $CFLAGS $CPPFLAGS
122: Linker.........: $LD $LDFLAGS $LIBS
123: "
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>