source: configure.in @ e502f76

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since e502f76 was e502f76, checked in by Shane Alcock <salcock@…>, 14 years ago

Added a pause function to format_rt
Moved the rt_connect call to rt_start
Got rid of blocking in rt_read_versatile by remembering the rt header
Removed 'restrict' from trace.c as some compilers didn't like it
Fixed bugs in configure that was causing failure to detect DAG
Added a new rt type for lost connections

  • Property mode set to 100644
File size: 7.9 KB
Line 
1# Process this file with autoconf to produce a configure script.
2
3# Now you only need to update the version number in two places - below,
4# and in the README
5
6AC_INIT([libtrace],[3.0.0-beta4],[contact@wand.net.nz],[libtrace])
7
8LIBTRACE_MAJOR=3
9LIBTRACE_MID=0
10LIBTRACE_MINOR=0
11
12AC_CONFIG_SRCDIR(lib/trace.c)
13AM_INIT_AUTOMAKE
14
15AC_DEFINE([LIBTRACE_MAJOR],${LIBTRACE_MAJOR},[libtrace major version])
16AC_DEFINE([LIBTRACE_MID],${LIBTRACE_MID},[libtrace mid version])
17AC_DEFINE([LIBTRACE_MINOR],${LIBTRACE_MINOR},[libtrace minor version])
18
19AC_CONFIG_FILES([Makefile lib/Makefile docs/Makefile libpacketdump/Makefile
20        tools/Makefile tools/traceanon/Makefile tools/tracedump/Makefile
21        tools/tracemerge/Makefile tools/tracereport/Makefile
22        tools/tracertstats/Makefile tools/tracesplit/Makefile
23        tools/tracestats/Makefile
24        docs/libtrace.doxygen
25        lib/libtrace.h
26        swig/Makefile])
27dnl GNU C library
28dnl AC_GNU_SOURCE
29
30
31AM_CONFIG_HEADER([config.h])
32dnl Checks for programs.
33AC_PROG_CC
34AC_PROG_CXX
35AC_PROG_INSTALL
36AC_PROG_YACC
37AM_PROG_LEX
38
39AC_CONFIG_LIBOBJ_DIR(lib)
40
41# Checks for typedefs, structures, and compiler characteristics.
42AC_C_CONST
43AC_C_INLINE
44AC_C_BIGENDIAN
45AC_TYPE_SIZE_T
46AC_HEADER_TIME
47AC_SYS_LARGEFILE
48
49AC_PROG_LIBTOOL
50
51AC_ARG_ENABLE(swig,
52[  --disable-swig               don't generate python bindings],
53lt_use_python=true,lt_use_python=false)
54
55if test "x$lt_use_python" = "xtrue"
56then
57        AM_PATH_PYTHON(2.3)
58        AC_PROG_SWIG(1.3.21)
59        SWIG_PYTHON
60fi
61
62# Checks for library functions.
63AC_PROG_GCC_TRADITIONAL
64AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf)
65
66AC_CHECK_SIZEOF([long int])
67
68
69
70# Check for various broken functions
71AC_FUNC_MALLOC
72AC_FUNC_REALLOC
73
74# *BSD doesn't have strndup. Currently provide our own.
75AC_REPLACE_FUNCS(strndup)
76
77# Checks for header files.
78AC_HEADER_STDC
79dnl AC_CHECK_HEADERS(errno.h stdlib.h stdio.h assert.h string.h netinet/in.h assert.h errno.h fcntl.h net/ethernet.h netdb.h pcap.h stdio.h stdlib.h string.h sys/stat.h sys/types.h sys/socket.h sys/un.h unistd.h time.h sys/ioctl.h net/bpf.h pcap.h zlib.h pcap-bpf.h)
80AC_CHECK_HEADERS(pcap.h pcap-int.h pcap-bpf.h net/bpf.h sys/limits.h stddef.h inttypes.h limits.h net/ethernet.h )
81
82AC_CHECK_HEADERS(netinet/in.h)
83AC_CHECK_HEADERS(netpacket/packet.h,[
84        libtrace_netpacket_packet_h=true
85        AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net])
86])
87AC_CHECK_HEADER(net/if.h,
88        AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[
89 #include <sys/types.h>
90 #include <sys/socket.h>
91])
92
93AC_CHECK_HEADER(netinet/ether.h,
94        AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[
95 #include <sys/types.h>
96 #include <sys/socket.h>
97 #include <netinet/in.h>
98 #include <net/if.h>
99])
100
101AC_CHECK_HEADER(netinet/if_ether.h,
102        AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[
103 #include <sys/types.h>
104 #include <sys/socket.h>
105 #include <netinet/in.h>
106 #include <net/if.h>
107])
108
109AC_CHECK_HEADER(net/if_arp.h,
110        AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[
111 #include <sys/types.h>
112 #include <sys/socket.h>
113 #include <netinet/in.h>
114 #include <net/if.h>
115])
116
117# Checking for the right bpf header to include
118AC_CHECK_HEADER(pcap-bpf.h)
119AC_CHECK_HEADER(net/bpf.h)
120AC_CHECK_HEADER(gdc.h)
121
122# Check to see if we have libdl - *BSD has built-in libdl
123AC_CHECK_LIB(dl, dlopen)
124# check pcap
125AC_CHECK_LIB(pcap,pcap_open_live)
126AC_REPLACE_FUNCS(pcap_open_dead)
127AC_REPLACE_FUNCS(pcap_dump_flush)
128AC_REPLACE_FUNCS(pcap_next_ex)
129AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock)
130AC_CHECK_DECLS([BIOCSETIF],,,[
131#include <sys/types.h>
132#include <sys/time.h>
133#include <sys/ioctl.h>
134#include <net/bpf.h>
135])
136
137# configure time options for man pages
138AC_ARG_WITH(man,
139            AS_HELP_STRING(--with-man,install man pages by default),
140
141             if test "$withval" = yes
142             then
143                     MANPAGES="docs/man/man3/[a-zA-Z]*.3]"
144             else
145                     MANPAGES=""
146             fi
147)
148
149AC_PROG_CXX
150
151# configure time options for use of DAG cards
152# borrowed from libpcap!
153AC_ARG_WITH(dag,
154            AS_HELP_STRING(--with-dag[=DIR],include DAG support (located in directory DIR, if supplied)),
155[
156        if test "$withval" = no
157        then
158                want_dag=no
159        elif test "$withval" = yes
160        then
161                want_dag=yes
162                dag_root=/root/dag
163        else
164                want_dag=yes
165                dag_root=$withval
166        fi
167],[
168        #
169        # Use DAG API if present, otherwise don't
170        #
171        want_dag=ifpresent
172        dag_root=/root/dag/
173])
174
175# turn the test part of the next block into a function, so it can be
176# called multiple times for $dag_root, /root/dag, /usr/local/lib
177libtrace_dag=false
178libtrace_dag2_4=false
179if test "$with_dag" != no; then
180        AC_MSG_CHECKING(whether we have DAG API)
181
182        if test -r "$dag_root/lib"; then
183                dag_lib_dir="$dag_root/lib"
184        else
185                dag_lib_dir="$dag_root"
186        fi
187       
188        #if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
189        if test -r "$dag_root/include"; then
190                dag_tools_dir="$dag_root/tools"
191                dag_include_dir="$dag_root/include"
192        else
193                dag_tools_dir="$dag_root"
194                dag_include_dir="$dag_root"
195        fi
196
197        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
198        then
199                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
200                ADD_LIBS="$ADD_LIBS -ldag"
201                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
202                DAG_TOOLS_DIR=$dag_tools_dir
203                AC_SUBST([DAG_TOOLS_DIR])
204                libtrace_dag=true
205               
206                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
207                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
208        else
209                if test "$want_dag" = yes; then
210                        AC_MSG_ERROR(DAG API not found under directory $dag_root
211; use --without-dag)
212                fi
213                libtrace_dag=false
214        fi
215        AC_MSG_RESULT($libtrace_dag)
216       
217        AC_MSG_CHECKING(if we are using DAG 2.4)
218        if grep '2.4.' $dag_root/VERSION > /dev/null 2>&1; then
219                libtrace_dag2_4=true
220                AC_DEFINE(DAG_VERSION_2_4, 1, [define if using DAG 2.4])
221        else
222                libtrace_dag2_4=false
223        fi
224        AC_MSG_RESULT($libtrace_dag2_4)
225fi
226
227AC_CHECK_LIB(z, gzopen)
228
229libtrace_swig=false;
230if test -n "$SWIG"; then
231        libtrace_swig=true;
232fi
233libtrace_python=false;
234if test -n "$PYTHON"; then
235        libtrace_python=true;
236fi
237
238AM_CONDITIONAL([HAVE_BPF], [test "$ac_cv_have_decl_BIOCSETIF" = yes ])
239AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
240AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag2_4" = true])
241AM_CONDITIONAL([HAVE_ZLIB], [test "$ac_cv_lib_z_gzopen" = yes])
242AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true])
243AM_CONDITIONAL([LIBGDC], [test "$ac_cv_header_gdc_h" = yes])
244AM_CONDITIONAL([LIBTRACE_SWIG], [test "$libtrace_swig" = true])
245#AM_CONDITIONAL([HAVE_PYTHON], [test "$libtrace_python" = true])
246
247# Check for miscellaneous programs
248AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false])
249
250AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue])
251
252
253AC_SUBST([ADD_LIBS])
254AC_SUBST([ADD_LDFLAGS])
255AC_SUBST([ADD_INCLS])
256AC_SUBST([LTLIBOBJS])
257AC_SUBST([MANPAGES])
258AC_SUBST([PACKAGE_VERSION])
259AC_SUBST([LIBTRACE_MAJOR])
260AC_SUBST([LIBTRACE_MID])
261AC_SUBST([LIBTRACE_MINOR])
262
263dnl and finally, output our Makefiles
264AC_OUTPUT
265
266reportopt() {
267        if test x"$2" = xtrue -o x"$2" = xyes; then
268                AC_MSG_NOTICE([$1: Yes])
269        else
270                AC_MSG_NOTICE([$1: No])
271        fi
272}
273
274echo
275AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION])
276reportopt "Compiled with PCAP support" $ac_cv_lib_pcap_pcap_open_live
277reportopt "Compiled with compressed trace (zlib) support" $ac_cv_lib_z_gzopen
278if test x"$libtrace_dag" = xtrue; then
279        if test x"$libtrace_dag2_4"; then
280                AC_MSG_NOTICE([Compiled with DAG support: 2.4])
281        else
282                AC_MSG_NOTICE([Compiled with DAG support: 2.5])
283        fi
284else
285        AC_MSG_NOTICE([Compiled with DAG support: No])
286fi
287reportopt "Building man pages/documentation" $libtrace_doxygen
288
289if test x"$libtrace_swig" = xtrue; then
290H
291        if test x"$libtrace_python" = xtrue; then
292                AC_MSG_NOTICE([Building swig bindings for: python])
293        else
294                AC_MSG_NOTICE([Building swig bindings for: Nothing])
295        fi
296else
297        AC_MSG_NOTICE([Not building swig bindings])
298fi
Note: See TracBrowser for help on using the repository browser.