source: configure.in @ 306f91c

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

Fix problems with zlib in the new build environment

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