1 AC_INIT(liboping, 0.3.5)
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")
19 if test "x$PERL" = "x"
23 AC_ARG_VAR(PERL, [Perl interpreter command])
33 # Checks for header files.
36 AC_CHECK_HEADERS(unistd.h)
37 AC_CHECK_HEADERS(math.h)
38 AC_CHECK_HEADERS(fcntl.h)
39 AC_CHECK_HEADERS(sys/types.h)
40 AC_CHECK_HEADERS(sys/stat.h)
42 AC_CHECK_HEADERS(sys/socket.h)
43 AC_CHECK_HEADERS(netdb.h)
44 AC_CHECK_HEADERS(signal.h)
46 # This sucks, but what can I do..?
47 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
52 # include <sys/types.h>
55 AC_CHECK_HEADERS(netinet/in.h, [], [],
60 # include <sys/types.h>
62 #if HAVE_NETINET_IN_SYSTM_H
63 # include <netinet/in_systm.h>
66 AC_CHECK_HEADERS(netinet/ip.h, [], [],
71 # include <sys/types.h>
73 #if HAVE_NETINET_IN_SYSTM_H
74 # include <netinet/in_systm.h>
77 # include <netinet/in.h>
80 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
85 # include <sys/types.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/ip_var.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>
110 #if HAVE_NETINET_IP_H
111 # include <netinet/ip.h>
114 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
119 # include <sys/types.h>
122 # include <sys/types.h>
124 #if HAVE_NETINET_IN_SYSTM_H
125 # include <netinet/in_systm.h>
127 #if HAVE_NETINET_IN_H
128 # include <netinet/in.h>
131 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
136 # include <sys/types.h>
138 #if HAVE_NETINET_IN_SYSTM_H
139 # include <netinet/in_systm.h>
141 #if HAVE_NETINET_IN_H
142 # include <netinet/in.h>
144 #if HAVE_NETINET_IP6_H
145 # include <netinet/ip6.h>
149 socket_needs_socket="no"
150 AC_CHECK_FUNCS(socket, [],
151 AC_CHECK_LIB(socket, socket,
152 [socket_needs_socket="yes"],
153 AC_MSG_ERROR(cannot find socket)))
154 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
156 nanosleep_needs_rt="no"
157 AC_CHECK_FUNCS(nanosleep, [],
158 AC_CHECK_LIB(rt, nanosleep,
159 [nanosleep_needs_rt="yes"],
160 AC_MSG_ERROR(cannot find nanosleep)))
161 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
163 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable extensive debugging output.])],
165 if test "x$enable_debug" = "xyes"
167 AC_DEFINE(WITH_DEBUG, 1, [Define to 1 if you want to get debugging output.])
170 AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
172 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
174 if test "x$withval" != "xno" && test "x$withval" != "xyes"
176 PERL_BINDINGS_OPTIONS="$withval"
177 with_perl_bindings="yes"
179 PERL_BINDINGS_OPTIONS=""
180 with_perl_bindings="$withval"
184 PERL_BINDINGS_OPTIONS=""
185 with_perl_bindings="yes"
188 if test "x$with_perl_bindings" = "xyes"
190 BINDINGS="perl-bindings"
195 AC_SUBST(PERL_BINDINGS_OPTIONS)
199 AC_OUTPUT(Makefile src/Makefile src/mans/Makefile bindings/Makefile)