source: configure.in @ 01bc623

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

Add extra [] around the man page tests

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