source: configure.in @ 5cd3ff3

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

Release 3.0.0 (!)

  • Property mode set to 100644
File size: 7.3 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],[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        ])
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
50if test "$GCC" = "yes"; then
51        CFLAGS="$CFLAGS -Wall -W"
52fi
53
54AC_PROG_LIBTOOL
55
56# Checks for library functions.
57AC_PROG_GCC_TRADITIONAL
58AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf)
59
60AC_CHECK_SIZEOF([long int])
61
62
63
64# Check for various broken functions
65AC_FUNC_MALLOC
66AC_FUNC_REALLOC
67
68# *BSD doesn't have strndup. Currently provide our own.
69AC_REPLACE_FUNCS(strndup)
70
71# Checks for header files.
72AC_HEADER_STDC
73AC_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 )
74
75AC_CHECK_HEADERS(netinet/in.h)
76AC_CHECK_HEADERS(netpacket/packet.h,[
77        libtrace_netpacket_packet_h=true
78        AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net])
79])
80AC_CHECK_HEADER(net/if.h,
81        AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[
82 #include <sys/types.h>
83 #include <sys/socket.h>
84])
85
86AC_CHECK_HEADER(netinet/ether.h,
87        AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[
88 #include <sys/types.h>
89 #include <sys/socket.h>
90 #include <netinet/in.h>
91 #include <net/if.h>
92])
93
94AC_CHECK_HEADER(netinet/if_ether.h,
95        AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[
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(net/if_arp.h,
103        AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[
104 #include <sys/types.h>
105 #include <sys/socket.h>
106 #include <netinet/in.h>
107 #include <net/if.h>
108])
109
110# Checking for the right bpf header to include
111AC_CHECK_HEADER(pcap-bpf.h)
112AC_CHECK_HEADER(net/bpf.h)
113AC_CHECK_HEADER(gdc.h)
114
115# Check to see if we have libdl - *BSD has built-in libdl
116AC_CHECK_LIB(dl, dlopen)
117# check pcap
118AC_CHECK_LIB(pcap,pcap_next_ex,pcapfound=1,pcapfound=0)
119#AC_CHECK_LIB(pcap,pcap_next_ex)
120#AC_REPLACE_FUNCS(pcap_open_dead)
121#AC_REPLACE_FUNCS(pcap_dump_flush)
122#AC_REPLACE_FUNCS(pcap_next_ex)
123AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock)
124AC_CHECK_DECLS([BIOCSETIF],,,[
125#include <sys/types.h>
126#include <sys/time.h>
127#include <sys/ioctl.h>
128#include <net/bpf.h>
129])
130
131# configure time options for man pages
132AC_ARG_WITH(man,
133            AS_HELP_STRING(--with-man,install man pages by default),[
134             if test "$withval" = yes
135             then
136                     MANPAGES="docs/man/man3/[a-zA-Z]*.3"
137             else
138                     MANPAGES=""
139             fi
140])
141
142AC_PROG_CXX
143
144if test "$pcapfound" = 0; then
145        AC_MSG_ERROR(libpcap0.8 or greater is required to compile libtrace. If you have installed it in a non-standard location please use LDFLAGS to specify the location of the library)
146else
147        ADD_LIBS="$ADD_LIBS -lpcap"
148        AC_DEFINE([HAVE_LIBPCAP],1,[compile with libpcap support])
149fi
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=/usr/local/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=/usr/local/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/include"; then
189                dag_tools_dir="$dag_root/tools"
190                dag_include_dir="$dag_root/include"
191        else
192                dag_tools_dir="$dag_root"
193                dag_include_dir="$dag_root"
194        fi
195
196        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
197        then
198                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
199                ADD_LIBS="$ADD_LIBS -ldag"
200                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
201                DAG_TOOLS_DIR=$dag_tools_dir
202                AC_SUBST([DAG_TOOLS_DIR])
203                libtrace_dag=true
204               
205                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
206                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
207        else
208                if test "$want_dag" = yes; then
209                        AC_MSG_ERROR(DAG API not found under directory $dag_root
210; use --without-dag)
211                fi
212                libtrace_dag=false
213        fi
214        AC_MSG_RESULT($libtrace_dag)
215       
216        AC_MSG_CHECKING(if we are using DAG 2.4)
217        if grep '2.4.' $dag_root/VERSION > /dev/null 2>&1; then
218                libtrace_dag2_4=true
219                AC_DEFINE(DAG_VERSION_2_4, 1, [define if using DAG 2.4])
220        else
221                libtrace_dag2_4=false
222        fi
223        AC_MSG_RESULT($libtrace_dag2_4)
224fi
225
226AC_CHECK_LIB(z, gzopen)
227
228AM_CONDITIONAL([HAVE_BPF], [test "$ac_cv_have_decl_BIOCSETIF" = yes ])
229AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
230AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag2_4" = true])
231AM_CONDITIONAL([HAVE_ZLIB], [test "$ac_cv_lib_z_gzopen" = yes])
232AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true])
233AM_CONDITIONAL([LIBGDC], [test "$ac_cv_header_gdc_h" = yes])
234
235# Check for miscellaneous programs
236AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false])
237
238AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue])
239
240
241AC_SUBST([ADD_LIBS])
242AC_SUBST([ADD_LDFLAGS])
243AC_SUBST([ADD_INCLS])
244AC_SUBST([LTLIBOBJS])
245AC_SUBST([MANPAGES])
246AC_SUBST([PACKAGE_VERSION])
247AC_SUBST([LIBTRACE_MAJOR])
248AC_SUBST([LIBTRACE_MID])
249AC_SUBST([LIBTRACE_MINOR])
250
251dnl and finally, output our Makefiles
252AC_OUTPUT
253
254reportopt() {
255        if test x"$2" = xtrue -o x"$2" = xyes; then
256                AC_MSG_NOTICE([$1: Yes])
257        else
258                AC_MSG_NOTICE([$1: No])
259        fi
260}
261
262echo
263AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION])
264reportopt "Compiled with PCAP 0.8 support" $ac_cv_lib_pcap_pcap_next_ex
265reportopt "Compiled with compressed trace (zlib) support" $ac_cv_lib_z_gzopen
266if test x"$libtrace_dag" = xtrue; then
267        if test x"$libtrace_dag2_4"; then
268                AC_MSG_NOTICE([Compiled with DAG support: 2.4])
269        else
270                AC_MSG_NOTICE([Compiled with DAG support: 2.5])
271        fi
272else
273        AC_MSG_NOTICE([Compiled with DAG support: No])
274fi
275reportopt "Building man pages/documentation" $libtrace_doxygen
276
Note: See TracBrowser for help on using the repository browser.