source: configure.in @ c66bc26

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

Cleaned up configure.in (by autoupdate)

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