Bumped the version to 0.2.0. Completed the ChangeLog entry.
[liboping.git] / configure.ac
1 AC_INIT(liboping, 0.2.0)
2 AC_CONFIG_SRCDIR(src/liboping.c)
3 AC_CONFIG_HEADERS(src/config.h)
4 AM_INIT_AUTOMAKE(dist-bzip2)
5 AC_LANG(C)
6
7 AC_PREFIX_DEFAULT("/opt/oping")
8
9 #
10 # Check for programs/utilities
11 #
12 AC_PROG_CC
13 AC_PROG_CPP
14 AC_PROG_INSTALL
15 AC_PROG_LN_S
16 AC_PROG_MAKE_SET
17 AM_CONDITIONAL(COMPILER_IS_GCC, test "x$GCC" = "xyes")
18
19 #
20 # configure libtool
21 #
22 AC_LIBLTDL_CONVENIENCE
23 AC_SUBST(LTDLINCL)
24 AC_SUBST(LIBLTDL)
25 AC_LIBTOOL_DLOPEN
26 AC_PROG_LIBTOOL
27 #AC_PROG_RANLIB
28 AC_CONFIG_SUBDIRS(libltdl src)
29
30 #
31 # Checks for header files.
32 #
33 AC_HEADER_STDC
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)
39 AC_HEADER_TIME
40 AC_CHECK_HEADERS(sys/socket.h)
41 AC_CHECK_HEADERS(netdb.h)
42 AC_CHECK_HEADERS(signal.h)
43
44 # This sucks, but what can I do..?
45 AC_CHECK_HEADERS(netinet/in_systm.h, [], [],
46 [#if HAVE_STDINT_H
47 # include <stdint.h>
48 #endif
49 ])
50 AC_CHECK_HEADERS(netinet/in.h, [], [],
51 [#if HAVE_STDINT_H
52 # include <stdint.h>
53 #endif
54 #if HAVE_NETINET_IN_SYSTM_H
55 # include <netinet/in_systm.h>
56 #endif
57 ])
58 AC_CHECK_HEADERS(netinet/ip.h, [], [],
59 [#if HAVE_STDINT_H
60 # include <stdint.h>
61 #endif
62 #if HAVE_NETINET_IN_SYSTM_H
63 # include <netinet/in_systm.h>
64 #endif
65 #if HAVE_NETINET_IN_H
66 # include <netinet/in.h>
67 #endif
68 ])
69 AC_CHECK_HEADERS(netinet/ip_icmp.h, [], [],
70 [#if HAVE_STDINT_H
71 # include <stdint.h>
72 #endif
73 #if HAVE_NETINET_IN_SYSTM_H
74 # include <netinet/in_systm.h>
75 #endif
76 #if HAVE_NETINET_IN_H
77 # include <netinet/in.h>
78 #endif
79 #if HAVE_NETINET_IP_H
80 # include <netinet/ip.h>
81 #endif
82 ])
83 AC_CHECK_HEADERS(netinet/ip_var.h, [], [],
84 [#if HAVE_STDINT_H
85 # include <stdint.h>
86 #endif
87 #if HAVE_NETINET_IN_SYSTM_H
88 # include <netinet/in_systm.h>
89 #endif
90 #if HAVE_NETINET_IN_H
91 # include <netinet/in.h>
92 #endif
93 #if HAVE_NETINET_IP_H
94 # include <netinet/ip.h>
95 #endif
96 ])
97 AC_CHECK_HEADERS(netinet/ip6.h, [], [],
98 [#if HAVE_STDINT_H
99 # include <stdint.h>
100 #endif
101 #if HAVE_SYS_TYPES_H
102 # include <sys/types.h>
103 #endif
104 #if HAVE_NETINET_IN_SYSTM_H
105 # include <netinet/in_systm.h>
106 #endif
107 #if HAVE_NETINET_IN_H
108 # include <netinet/in.h>
109 #endif
110 ])
111 AC_CHECK_HEADERS(netinet/icmp6.h, [], [],
112 [#if HAVE_STDINT_H
113 # include <stdint.h>
114 #endif
115 #if HAVE_SYS_TYPES_H
116 # include <sys/types.h>
117 #endif
118 #if HAVE_NETINET_IN_SYSTM_H
119 # include <netinet/in_systm.h>
120 #endif
121 #if HAVE_NETINET_IN_H
122 # include <netinet/in.h>
123 #endif
124 #if HAVE_NETINET_IP6_H
125 # include <netinet/ip6.h>
126 #endif
127 ])
128
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")
135
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")
142
143 AC_OUTPUT(Makefile src/Makefile src/mans/Makefile)