source: configure.in @ 45236fe

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

Remove old libpacketdump/parser/Makefile.in

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