1 AC_INIT(liboping, 1.3.4)
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 LIBOPING_MAJOR=`echo $PACKAGE_VERSION | cut -d'.' -f1`
11 LIBOPING_MINOR=`echo $PACKAGE_VERSION | cut -d'.' -f2`
12 LIBOPING_PATCH=`echo $PACKAGE_VERSION | cut -d'.' -f3`
13 AC_SUBST(LIBOPING_MAJOR)
14 AC_SUBST(LIBOPING_MINOR)
15 AC_SUBST(LIBOPING_PATCH)
21 AC_SUBST(LIBOPING_CURRENT)
22 AC_SUBST(LIBOPING_REVISION)
23 AC_SUBST(LIBOPING_AGE)
26 # Check for programs/utilities
33 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
35 if test "x$PERL" = "x"
39 AC_ARG_VAR(PERL, [Perl interpreter command])
49 # Checks for header files.
52 AC_CHECK_HEADERS(unistd.h)
53 AC_CHECK_HEADERS(math.h)
54 AC_CHECK_HEADERS(fcntl.h)
55 AC_CHECK_HEADERS(sys/types.h)
56 AC_CHECK_HEADERS(sys/stat.h)
58 AC_CHECK_HEADERS(sys/socket.h)
59 AC_CHECK_HEADERS(netdb.h)
60 AC_CHECK_HEADERS(signal.h)
62 # This sucks, but what can I do..?
63 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
68 # include <sys/types.h>
71 AC_CHECK_HEADERS(netinet/in.h, [], [],
76 # include <sys/types.h>
78 #if HAVE_NETINET_IN_SYSTM_H
79 # include <netinet/in_systm.h>
82 AC_CHECK_HEADERS(netinet/ip.h, [], [],
87 # include <sys/types.h>
89 #if HAVE_NETINET_IN_SYSTM_H
90 # include <netinet/in_systm.h>
93 # include <netinet/in.h>
96 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
101 # include <sys/types.h>
103 #if HAVE_NETINET_IN_SYSTM_H
104 # include <netinet/in_systm.h>
106 #if HAVE_NETINET_IN_H
107 # include <netinet/in.h>
109 #if HAVE_NETINET_IP_H
110 # include <netinet/ip.h>
113 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
118 # include <sys/types.h>
120 #if HAVE_NETINET_IN_SYSTM_H
121 # include <netinet/in_systm.h>
123 #if HAVE_NETINET_IN_H
124 # include <netinet/in.h>
126 #if HAVE_NETINET_IP_H
127 # include <netinet/ip.h>
130 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
135 # include <sys/types.h>
138 # include <sys/types.h>
140 #if HAVE_NETINET_IN_SYSTM_H
141 # include <netinet/in_systm.h>
143 #if HAVE_NETINET_IN_H
144 # include <netinet/in.h>
147 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
152 # include <sys/types.h>
154 #if HAVE_NETINET_IN_SYSTM_H
155 # include <netinet/in_systm.h>
157 #if HAVE_NETINET_IN_H
158 # include <netinet/in.h>
160 #if HAVE_NETINET_IP6_H
161 # include <netinet/ip6.h>
165 socket_needs_socket="no"
166 AC_CHECK_FUNCS(socket, [],
167 AC_CHECK_LIB(socket, socket,
168 [socket_needs_socket="yes"],
169 AC_MSG_ERROR(cannot find socket)))
170 AM_CONDITIONAL(BUILD_WITH_LIBSOCKET, test "x$socket_needs_socket" = "xyes")
172 # Under Solaris, the `xnet' library provides `recvmsg' which complies with the
173 # X/Open CAE Specification.
175 AC_CHECK_LIB(xnet, __xnet_recvmsg, [with_libxnet="yes"],[])
176 if test "x$with_libxnet" = "xyes"
178 CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
180 AM_CONDITIONAL(BUILD_WITH_LIBXNET, test "x$with_libxnet" = "xyes")
182 nanosleep_needs_rt="no"
183 AC_CHECK_FUNCS(nanosleep, [],
184 AC_CHECK_LIB(rt, nanosleep,
185 [nanosleep_needs_rt="yes"],
186 AC_MSG_ERROR(cannot find nanosleep)))
187 AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes")
190 AC_CHECK_HEADERS(ncurses.h, [with_ncurses="yes"], [with_ncurses="no"])
191 if test "x$with_ncurses" = "xyes"
193 AC_CHECK_LIB(ncurses, mvwprintw, [with_ncurses="yes"], [with_ncurses="no"])
195 AM_CONDITIONAL(BUILD_WITH_LIBNCURSES, test "x$with_ncurses" = "xyes")
199 AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable extensive debugging output.])],
201 if test "x$enable_debug" = "xyes"
203 AC_DEFINE(WITH_DEBUG, 1, [Define to 1 if you want to get debugging output.])
206 AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
208 AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
210 if test "x$withval" != "xno" && test "x$withval" != "xyes"
212 PERL_BINDINGS_OPTIONS="$withval"
213 with_perl_bindings="yes"
215 PERL_BINDINGS_OPTIONS=""
216 with_perl_bindings="$withval"
220 PERL_BINDINGS_OPTIONS=""
221 with_perl_bindings="yes"
224 if test "x$with_perl_bindings" = "xyes"
226 BINDINGS="perl-bindings"
231 AC_SUBST(PERL_BINDINGS_OPTIONS)
235 AC_OUTPUT(Makefile src/Makefile src/mans/Makefile bindings/Makefile)