1 AC_INIT(liboping, 0.3.1)
2 AC_CONFIG_SRCDIR(src/liboping.c)
3 AC_CONFIG_HEADERS(src/config.h)
4 AM_INIT_AUTOMAKE(dist-bzip2)
7 AC_PREFIX_DEFAULT("/opt/oping")
10 # Check for programs/utilities
17 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
27 # Checks for header files.
30 AC_CHECK_HEADERS(unistd.h)
31 AC_CHECK_HEADERS(math.h)
32 AC_CHECK_HEADERS(fcntl.h)
33 AC_CHECK_HEADERS(sys/types.h)
34 AC_CHECK_HEADERS(sys/stat.h)
36 AC_CHECK_HEADERS(sys/socket.h)
37 AC_CHECK_HEADERS(netdb.h)
38 AC_CHECK_HEADERS(signal.h)
40 # This sucks, but what can I do..?
41 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
46 # include <sys/types.h>
49 AC_CHECK_HEADERS(netinet/in.h, [], [],
54 # include <sys/types.h>
56 #if HAVE_NETINET_IN_SYSTM_H
57 # include <netinet/in_systm.h>
60 AC_CHECK_HEADERS(netinet/ip.h, [], [],
65 # include <sys/types.h>
67 #if HAVE_NETINET_IN_SYSTM_H
68 # include <netinet/in_systm.h>
71 # include <netinet/in.h>
74 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
79 # include <sys/types.h>
81 #if HAVE_NETINET_IN_SYSTM_H
82 # include <netinet/in_systm.h>
85 # include <netinet/in.h>
88 # include <netinet/ip.h>
91 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
96 # include <sys/types.h>
98 #if HAVE_NETINET_IN_SYSTM_H
99 # include <netinet/in_systm.h>
101 #if HAVE_NETINET_IN_H
102 # include <netinet/in.h>
104 #if HAVE_NETINET_IP_H
105 # include <netinet/ip.h>
108 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
113 # include <sys/types.h>
116 # include <sys/types.h>
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
125 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
130 # include <sys/types.h>
132 #if HAVE_NETINET_IN_SYSTM_H
133 # include <netinet/in_systm.h>
135 #if HAVE_NETINET_IN_H
136 # include <netinet/in.h>
138 #if HAVE_NETINET_IP6_H
139 # include <netinet/ip6.h>
143 socket_needs_socket="no"
144 AC_CHECK_FUNCS(socket, [],
145 AC_CHECK_LIB(socket, socket,
146 [socket_needs_socket="yes"],
147 AC_MSG_ERROR(cannot find socket)))
148 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
150 nanosleep_needs_rt="no"
151 AC_CHECK_FUNCS(nanosleep, [],
152 AC_CHECK_LIB(rt, nanosleep,
153 [nanosleep_needs_rt="yes"],
154 AC_MSG_ERROR(cannot find nanosleep)))
155 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
157 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable extensive debugging output.])],
159 if test "x$enable_debug" = "xyes"
161 AC_DEFINE(WITH_DEBUG, 1, [Define to 1 if you want to get debugging output.])
164 AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
166 AC_OUTPUT(Makefile src/Makefile src/mans/Makefile)