source: configure.in @ 6187a46

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivegetfragoffhelplibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 6187a46 was 6187a46, checked in by Perry Lorier <perry@…>, 14 years ago

Distribute the samples(!)

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