source: configure.in @ 11346a5

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

No point in checking for headers we're going to check for further down
The parser/ directory is gone (as well as it's makefile)

  • Property mode set to 100644
File size: 7.7 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
31AC_CONFIG_HEADERS([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)
130
131# configure time options for man pages
132AC_ARG_WITH(man,
133            AS_HELP_STRING(--with-man,install man pages by default),
134
135             if test "$withval" = yes
136             then
137                     MANPAGES="docs/man/man3/[a-zA-Z]*.3]"
138             else
139                     MANPAGES=""
140             fi
141)
142
143AC_PROG_CXX
144
145# configure time options for use of DAG cards
146# borrowed from libpcap!
147AC_ARG_WITH(dag,
148            AS_HELP_STRING(--with-dag[=DIR],include DAG support (located in directory DIR, if supplied)),
149[
150        if test "$withval" = no
151        then
152                want_dag=no
153        elif test "$withval" = yes
154        then
155                want_dag=yes
156                dag_root=/root/dag
157        else
158                want_dag=yes
159                dag_root=$withval
160        fi
161],[
162        #
163        # Use DAG API if present, otherwise don't
164        #
165        want_dag=ifpresent
166        dag_root=/root/dag/
167])
168
169# turn the test part of the next block into a function, so it can be
170# called multiple times for $dag_root, /root/dag, /usr/local/lib
171libtrace_dag=false
172libtrace_dag2_4=false
173if test "$with_dag" != no; then
174        AC_MSG_CHECKING(whether we have DAG API)
175
176        if test -r "$dag_root/lib"; then
177                dag_lib_dir="$dag_root/lib"
178        else
179                dag_lib_dir="$dag_root"
180        fi
181       
182        if test -r "$dag_root/tools" -a -r "$dag_root/include"; then
183                dag_tools_dir="$dag_root/tools"
184                dag_include_dir="$dag_root/include"
185        else
186                dag_tools_dir="$dag_root"
187                dag_include_dir="$dag_root"
188        fi
189
190        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
191        then
192                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
193                ADD_LIBS="$ADD_LIBS -ldag"
194                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
195                DAG_TOOLS_DIR=$dag_tools_dir
196                AC_SUBST([DAG_TOOLS_DIR])
197                libtrace_dag=true
198               
199                AC_DEFINE(HAVE_DAG_API, 1, [define if you have a DAG API])
200                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG support])
201        else
202                if test "$want_dag" = yes; then
203                        AC_MSG_ERROR(DAG API not found under directory $dag_root
204; use --without-dag)
205                fi
206                libtrace_dag=false
207        fi
208        AC_MSG_RESULT($libtrace_dag)
209       
210        AC_MSG_CHECKING(if we are using DAG 2.4)
211        if grep '2.4.' $dag_root/VERSION > /dev/null 2>&1; then
212                libtrace_dag2_4=true
213                AC_DEFINE(DAG_VERSION_2_4, 1, [define if using DAG 2.4])
214        else
215                libtrace_dag2_4=false
216        fi
217        AC_MSG_RESULT($libtrace_dag2_4)
218fi
219
220AC_CHECK_LIB(z, gzopen)
221
222libtrace_swig=false;
223if test -n "$SWIG"; then
224        libtrace_swig=true;
225fi
226libtrace_python=false;
227if test -n "$PYTHON"; then
228        libtrace_python=true;
229fi
230
231AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
232AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag2_4" = true])
233AM_CONDITIONAL([HAVE_ZLIB], [test "$ac_cv_lib_z_gzopen" = yes])
234AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true])
235AM_CONDITIONAL([LIBGDC], [test "$ac_cv_header_gdc_h" = yes])
236AM_CONDITIONAL([LIBTRACE_SWIG], [test "$libtrace_swig" = true])
237#AM_CONDITIONAL([HAVE_PYTHON], [test "$libtrace_python" = true])
238
239# Check for miscellaneous programs
240AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false])
241
242AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue])
243
244
245AC_SUBST([ADD_LIBS])
246AC_SUBST([ADD_LDFLAGS])
247AC_SUBST([ADD_INCLS])
248AC_SUBST([LTLIBOBJS])
249AC_SUBST([MANPAGES])
250AC_SUBST([PACKAGE_VERSION])
251AC_SUBST([LIBTRACE_MAJOR])
252AC_SUBST([LIBTRACE_MID])
253AC_SUBST([LIBTRACE_MINOR])
254
255dnl and finally, output our Makefiles
256AC_OUTPUT
257
258reportopt() {
259        if test x"$2" = xtrue -o x"$2" = xyes; then
260                AC_MSG_NOTICE([$1: Yes])
261        else
262                AC_MSG_NOTICE([$1: No])
263        fi
264}
265
266echo
267AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION])
268reportopt "Compiled with PCAP support" $ac_cv_lib_pcap_pcap_open_live
269reportopt "Compiled with compressed trace (zlib) support" $ac_cv_lib_z_gzopen
270if test x"$libtrace_dag" = xtrue; then
271        if test x"$libtrace_dag2_4"; then
272                AC_MSG_NOTICE([Compiled with DAG support: 2.4])
273        else
274                AC_MSG_NOTICE([Compiled with DAG support: 2.5])
275        fi
276else
277        AC_MSG_NOTICE([Compiled with DAG support: No])
278fi
279reportopt "Building man pages/documentation" $libtrace_doxygen
280
281if test x"$libtrace_swig" = xtrue; then
282        if test x"$libtrace_python" = xtrue; then
283                AC_MSG_NOTICE([Building swig bindings for: python])
284        else
285                AC_MSG_NOTICE([Building swig bindings for: Nothing])
286        fi
287else
288        AC_MSG_NOTICE([Not building swig bindings])
289fi
Note: See TracBrowser for help on using the repository browser.