1 AC_INIT(liboping, 0.1.0)
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")
22 AC_LIBLTDL_CONVENIENCE
28 AC_CONFIG_SUBDIRS(libltdl src)
31 # Checks for header files.
34 AC_CHECK_HEADERS(unistd.h)
35 AC_CHECK_HEADERS(math.h)
36 AC_CHECK_HEADERS(fcntl.h)
37 AC_CHECK_HEADERS(sys/types.h)
38 AC_CHECK_HEADERS(sys/stat.h)
40 AC_CHECK_HEADERS(sys/socket.h)
41 AC_CHECK_HEADERS(netdb.h)
42 AC_CHECK_HEADERS(signal.h)
44 # This sucks, but what can I do..?
45 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
50 AC_CHECK_HEADERS(netinet/in.h, [], [],
54 #if HAVE_NETINET_IN_SYSTM_H
55 # include <netinet/in_systm.h>
58 AC_CHECK_HEADERS(netinet/ip.h, [], [],
62 #if HAVE_NETINET_IN_SYSTM_H
63 # include <netinet/in_systm.h>
66 # include <netinet/in.h>
69 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
73 #if HAVE_NETINET_IN_SYSTM_H
74 # include <netinet/in_systm.h>
77 # include <netinet/in.h>
80 # include <netinet/ip.h>
83 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
91 # include <netinet/in.h>
94 # include <netinet/ip.h>
97 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
102 # include <sys/types.h>
104 #if HAVE_NETINET_IN_SYSTM_H
105 # include <netinet/in_systm.h>
107 #if HAVE_NETINET_IN_H
108 # include <netinet/in.h>
111 AC_CHECK_HEADERS(netinet/icmp6.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>
124 #if HAVE_NETINET_IP6_H
125 # include <netinet/ip6.h>
129 socket_needs_socket="no"
130 AC_CHECK_FUNCS(socket, [],
131 AC_CHECK_LIB(socket, socket,
132 [socket_needs_socket="yes"],
133 AC_MSG_ERROR(cannot find socket)))
134 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
136 nanosleep_needs_rt="no"
137 AC_CHECK_FUNCS(nanosleep, [],
138 AC_CHECK_LIB(rt, nanosleep,
139 [nanosleep_needs_rt="yes"],
140 AC_MSG_ERROR(cannot find nanosleep)))
141 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
143 AC_OUTPUT(Makefile src/Makefile src/mans/Makefile)