source: configure.in @ 3e5518a

4.0.1-hotfixescachetimestampsdevelopdpdk-ndagetsilivelibtrace4ndag_formatpfringrc-4.0.1rc-4.0.2rc-4.0.3rc-4.0.4ringdecrementfixringperformanceringtimestampfixes
Last change on this file since 3e5518a was 3e5518a, checked in by Shane Alcock <salcock@…>, 6 years ago

Update version number to 3.0.22

  • Property mode set to 100644
File size: 21.5 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.22],[contact@wand.net.nz],[libtrace])
7
8LIBTRACE_MAJOR=3
9LIBTRACE_MID=0
10LIBTRACE_MINOR=22
11
12# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
13# searched by default - add it to LDFLAGS so we at least have a chance of
14# finding it
15if test -d "/usr/gnu/lib"; then
16        LDFLAGS+=" -L/usr/gnu/lib"
17fi
18
19AC_CONFIG_MACRO_DIR([m4])
20AC_CONFIG_SRCDIR(lib/trace.c)
21AM_INIT_AUTOMAKE([subdir-objects])
22
23# Make sure we use the relatively silent automake output
24m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
25
26# Define our libtrace version number externally so we can use it in the source
27# as well, if needed.
28AC_DEFINE([LIBTRACE_MAJOR],${LIBTRACE_MAJOR},[libtrace major version])
29AC_DEFINE([LIBTRACE_MID],${LIBTRACE_MID},[libtrace mid version])
30AC_DEFINE([LIBTRACE_MINOR],${LIBTRACE_MINOR},[libtrace minor version])
31
32# These are all the files we want to be built for us by configure
33AC_CONFIG_FILES([Makefile lib/Makefile docs/Makefile libpacketdump/Makefile
34        tools/Makefile tools/traceanon/Makefile tools/tracepktdump/Makefile
35        tools/tracemerge/Makefile tools/tracereport/Makefile
36        tools/tracertstats/Makefile tools/tracesplit/Makefile
37        tools/tracestats/Makefile tools/tracetop/Makefile
38        tools/tracereplay/Makefile tools/tracediff/Makefile
39        tools/traceends/Makefile
40        examples/Makefile examples/skeleton/Makefile examples/rate/Makefile
41        examples/stats/Makefile examples/tutorial/Makefile
42        docs/libtrace.doxygen
43        lib/libtrace.h libwandio/Makefile libwandio/tools/wandiocat/Makefile
44        ])
45
46
47# Function that checks if the C++ compiler actually works - there's a bit of
48# oversight in autoconf that will set the C++ compiler to g++ if no compiler
49# is found, even if g++ is not present! So we need an extra test to make sure
50# that the compiler works :(
51
52AC_DEFUN([rw_PROG_CXX_WORKS],
53[AC_REQUIRE([AC_PROG_CXX])dnl
54AC_CACHE_CHECK([whether the C++ compiler works],
55        [rw_cv_prog_cxx_works],
56        [AC_LANG_PUSH([C++])
57        AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
58                [rw_cv_prog_cxx_works=yes],
59                [rw_cv_prog_cxx_works=no])
60        AC_LANG_POP([C++])])
61])
62
63# Put all our automake definitions in config.h
64AM_CONFIG_HEADER([config.h])
65
66# Checks for C and C++ compilers
67AC_PROG_CC
68AC_PROG_CXX
69rw_PROG_CXX_WORKS
70
71if test "$rw_cv_prog_cxx_works" = "no"; then
72        AC_MSG_ERROR("Failed to find working C++ compiler")
73fi
74
75# Checking for 'install'
76AC_PROG_INSTALL
77
78# Checking for bison and flex
79AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc)
80AM_PROG_LEX
81
82# All our source files for function replacements are in lib/
83AC_CONFIG_LIBOBJ_DIR(lib)
84
85# Check for various "replacement" functions
86AC_FUNC_MALLOC
87AC_FUNC_REALLOC
88
89# *BSD doesn't have strndup. Currently provide our own.
90AC_REPLACE_FUNCS(strndup)
91
92
93# Checks for typedefs, structures, and compiler characteristics.
94AC_C_CONST
95AC_C_INLINE
96AC_C_BIGENDIAN
97AC_TYPE_SIZE_T
98AC_HEADER_TIME
99AC_SYS_LARGEFILE
100
101LIBPKTDUMP_LIBS="-ltrace "
102ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/libwandio -L\$(abs_top_srcdir)/lib"
103LIBTRACE_LIBS="-lwandio"
104TOOLS_LIBS=""
105LIBWANDIO_LIBS=""
106
107CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1"
108CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1"
109
110# Check for -fvisibility
111gl_VISIBILITY
112
113gcc_PACKED
114gcc_DEPRECATED
115gcc_UNUSED
116gcc_PURE
117gcc_FORMAT
118       
119# Check for libtool
120AC_PROG_LIBTOOL
121
122# Checks for library functions.
123AC_PROG_GCC_TRADITIONAL
124
125# Fail if any of these functions are missing
126AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf vsnprintf)
127
128AC_CHECK_SIZEOF([long int])
129
130
131# Checks for header files.
132AC_HEADER_STDC
133AC_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 sys/prctl.h)
134
135
136# OpenSolaris puts ncurses.h in /usr/include/ncurses rather than /usr/include,
137# so check for that
138AC_CHECK_HEADERS(ncurses.h,,[missing_ncurses=true])
139
140if test "x$missing_ncurses" = xtrue; then
141        if test -f "/usr/include/ncurses/ncurses.h"; then
142                AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Has nested ncurses header])
143        fi
144fi
145
146
147# Check for the presence of various networking headers and define appropriate
148# macros
149AC_CHECK_HEADERS(netinet/in.h)
150AC_CHECK_HEADERS(netpacket/packet.h,[
151        libtrace_netpacket_packet_h=true
152        AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net])
153])
154AC_CHECK_HEADER(net/if.h,
155        AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[
156 #include <sys/types.h>
157 #include <sys/socket.h>
158])
159
160AC_CHECK_HEADER(netinet/ether.h,
161        AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[
162 #include <sys/types.h>
163 #include <sys/socket.h>
164 #include <netinet/in.h>
165 #include <net/if.h>
166])
167
168AC_CHECK_HEADER(netinet/if_ether.h,
169        AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[
170 #include <sys/types.h>
171 #include <sys/socket.h>
172 #include <netinet/in.h>
173 #include <net/if.h>
174])
175
176AC_CHECK_HEADER(net/if_arp.h,
177        AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[
178 #include <sys/types.h>
179 #include <sys/socket.h>
180 #include <netinet/in.h>
181 #include <net/if.h>
182])
183
184# Check for sdl_len in sockaddr_dl - sockaddr_dl is used on BSD systems
185if test "$libtrace_netpacket_packet_h" != "true"; then
186        AC_CHECK_MEMBER([struct sockaddr_dl.sdl_len],
187                AC_DEFINE(HAVE_SDL_LEN,1,[Has sdl_len in sockaddr_dl]),,[
188 #include <sys/types.h>
189 #include <sys/socket.h>
190 #include <net/if_dl.h>
191                ])
192fi
193
194# Checking for the right bpf header to include
195AC_CHECK_HEADER(pcap-bpf.h)
196AC_CHECK_HEADER(net/bpf.h)
197
198# Checking for libgdc
199AC_CHECK_HEADER(gdc.h,AC_DEFINE(HAVE_LIBGDC,1,[has gdc.h]))
200
201# Check for libpcap
202AC_CHECK_LIB(pcap,pcap_next_ex,pcapfound=1,pcapfound=0)
203AC_CHECK_LIB(pcap,pcap_create,pcapcreate=1,pcapcreate=0)
204AC_CHECK_DECLS([BIOCSETIF],,,[
205#include <sys/types.h>
206#include <sys/time.h>
207#include <sys/ioctl.h>
208#include <net/bpf.h>
209])
210
211# Configure options for man pages
212AC_ARG_WITH(man,
213            AS_HELP_STRING(--with-man,install man pages by default),[
214             if test "$withval" = yes
215             then
216                     MANPAGES="docs/man/man3/[a-zA-Z]*.3"
217             else
218                     MANPAGES=""
219             fi
220])
221
222# Complain if we didn't find a suitable libpcap
223if test "$pcapfound" = 0; then
224        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)
225else
226        TOOL_LIBS="$TOOL_LIBS -lpcap"
227        LIBTRACE_LIBS="$LIBTRACE_LIBS -lpcap"
228        AC_DEFINE([HAVE_LIBPCAP],1,[compile with libpcap support])
229        AC_DEFINE([HAVE_BPF_FILTER],1,[compile with bpf filter support])
230
231        LIBS="-lpcap"
232        AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock)
233        LIBS=""
234
235fi
236
237if test "$pcapcreate" = 1; then
238        AC_DEFINE([HAVE_PCAP_CREATE],1,[compile with libpcap 1.0 support])
239fi
240
241# Configure options for use of DAG cards
242# Originally borrowed from libpcap, but extended quite a bit :)
243# More details on how this check works:
244#       http://wand.net.nz/trac/libtrace/wiki/DAGNotes
245
246AC_ARG_WITH(dag,
247            AS_HELP_STRING(--with-dag[=DIR],include DAG live capture support (located in directory DIR, if supplied)),
248[
249        if test "$withval" = no
250        then
251                want_dag=no
252        elif test "$withval" = yes
253        then
254                want_dag=yes
255                dag_root=/usr/local/dag
256        else
257                want_dag=yes
258                dag_root=$withval
259        fi
260],[
261        #
262        # Use DAG API if present, otherwise don't
263        #
264        want_dag=ifpresent
265        dag_root=/usr/local/dag
266])
267
268# DAG 3.0 actually puts header files and shared libraries into sensible
269# places now, so we should be able to do a simple CHECK_LIB to see if
270# they're there!
271
272# Addendum: It turns out DAG 2.5 does this too, so we'll match DAG2.5 in here
273# also. This isn't such a bad thing, the DAG2.5 API is essentially the same as
274# DAG 3.0 and libtrace will use the same format_dagXX source for both
275libtrace_dag=false
276libtrace_dag_version=none
277
278if test "$with_dag" != no; then
279        AC_CHECK_LIB(dag, dag_open, dag_found=1, dag_found=0)
280        if test "$dag_found" = 1; then
281                ADD_LIBS="$ADD_LIBS -ldag"
282                LIBTRACE_LIBS="$LIBTRACE_LIBS -ldag"
283                AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
284                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG live capture support])
285                libtrace_dag=true
286               
287                AC_DEFINE(DAG_VERSION,25,[defines the DAG driver version])
288                libtrace_dag_version=25
289        fi
290fi
291
292# TODO: turn the test part of the next block into a function, so it can be
293# called multiple times for $dag_root, /root/dag, /usr/local/lib
294dag_drv_v="DAG not present"
295
296# Now check for 2.4 DAG drivers which don't install as cleanly!
297if test "$with_dag" != no -a "$libtrace_dag" = false; then
298        AC_MSG_CHECKING(whether we have DAG 2.4 API instead)
299
300        if test -r "$dag_root/lib"; then
301                dag_lib_dir="$dag_root/lib"
302        else
303                dag_lib_dir="$dag_root"
304        fi
305       
306        if test -r "$dag_root/include"; then
307                dag_tools_dir="$dag_root/tools"
308                dag_include_dir="$dag_root/include"
309        else
310                dag_tools_dir="$dag_root"
311                dag_include_dir="$dag_root"
312        fi
313
314        if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a";
315        then
316                ADD_INCLS="$ADD_INCLS -I $dag_include_dir"
317                ADD_LIBS="$ADD_LIBS -ldag"
318                ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir"
319                DAG_TOOLS_DIR=$dag_tools_dir
320                AC_SUBST([DAG_TOOLS_DIR])
321                libtrace_dag=true
322               
323                AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API])
324                AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG live capture support])
325                AC_DEFINE(DAG_VERSION, 24, [defines the DAG driver version])
326                libtrace_dag_version=24
327        else
328                if test "$want_dag" = yes; then
329                        AC_MSG_ERROR(DAG API not found under directory $dag_root
330; use --without-dag)
331                fi
332                libtrace_dag=false
333        fi
334        AC_MSG_RESULT($libtrace_dag)
335
336fi
337
338# Try to determine the DAG driver version
339#if test x"$libtrace_dag" = xtrue; then
340#       dag_drv_v="Unknown"
341#       files=`locate /usr/*dag*/VERSION`
342#       file_count=0
343#
344#       for i in $files; do
345#                if $file_count > 0; then
346#                        dag_drv_v="Indeterminate"
347#                        break
348#                fi
349#                dag_drv_v=`cat $i`
350#                file_count=$file_count+1
351#        done
352#fi
353#DAG_VERSION_NUM=$dag_drv_v
354
355# Check for DPDK
356AC_ARG_WITH(dpdk,
357            AS_HELP_STRING(--with-dpdk,include DPDK live capture support (Must set RTE_SDK/_TARGET environment variable)),
358[
359        if test "$withval" = no
360        then
361            want_dpdk=no
362        else
363            want_dpdk=ifpresent
364        fi
365],[
366        # Default to building without DPDK format
367        want_dpdk=no
368])
369
370libtrace_dpdk=false
371if test "$want_dpdk" != no; then
372    saved_ldflags="$LDFLAGS"
373    # Add to our libpath location
374    LDFLAGS="$LDFLAGS -L$RTE_SDK/$RTE_TARGET/lib/"
375    # Test that the library exists, we cannot be sure of what extra library flags need to be added
376    # this could change in the next version which would make the test fail
377    #AC_CHECK_LIB(intel_dpdk, rte_eal_init, dpdk_found=1, dpdk_found=0, -lpthread -lm -lrt)
378
379    # So instead simply check for existence
380    AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libintel_dpdk.a", dpdk_found=1, dpdk_found=0)
381    # Revert back
382    LDFLAGS="$saved_ldflags"
383    if test "$dpdk_found" = 1; then
384        # Save these now so that they can be re-exported later
385                AC_SUBST([RTE_TARGET])
386        AC_SUBST([RTE_SDK])
387        # Force dpdk library to be statically linked to allow compiler optimisations
388        LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,--whole-archive -Wl,-l:libintel_dpdk.a -Wl,--no-whole-archive -Wl,-lm"
389                AC_DEFINE(HAVE_DPDK,1,[conditional for building with DPDK live capture support])
390                libtrace_dpdk=true
391        fi
392fi
393
394# Checks for various "optional" libraries
395AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0)
396
397# Check for ncurses
398
399# These libraries have to be explicitly linked in OpenSolaris
400AC_SEARCH_LIBS(getservent, socket, have_socket=1, have_socket=0, -lnsl)
401LIBS=
402
403AC_SEARCH_LIBS(inet_ntop, nsl, have_nsl=1, have_nsl=0, -lsocket)
404LIBS=
405
406# Check to see if we have libdl - *BSD has built-in libdl
407AC_SEARCH_LIBS(dlopen,dl, dlfound=1,dlfound=0 )
408LIBS=
409
410# Check for clock_gettime
411AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=1, have_clock_gettime=0)
412LIBS=
413
414if test "$dlfound" = 0; then
415        AC_MSG_ERROR("Unable to find dlopen. Please use LDFLAGS to specify the location of libdl and re-run configure")
416fi
417
418if test "$ac_cv_search_dlopen" != "none required"; then
419        LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_dlopen"
420        if test "$dpdk_found" = 1; then
421                LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,$ac_cv_search_dlopen"
422        fi
423fi
424
425if test "$have_pthread" = 1; then
426        LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lpthread"
427        AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported])
428fi
429
430
431if test "$have_nsl" = 1; then
432        if test "$ac_cv_search_inet_ntop" != "none required"; then
433                LIBTRACE_LIBS="$LIBTRACE_LIBS $ac_cv_search_inet_ntop"
434                LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_inet_ntop"
435        fi
436fi
437
438if test "$have_socket" = 1; then
439        if test "$ac_cv_search_getservent" != "none required"; then
440                LIBTRACE_LIBS="$LIBTRACE_LIBS $ac_cv_search_getservent"
441                LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_getservent"
442        fi
443fi
444
445
446if test "$have_clock_gettime" = 1; then
447    LIBTRACE_LIBS="$LIBTRACE_LIBS -lrt"
448fi
449
450
451# Stupid AC_SEARCH_LIB appends stuff to LIBS even when I don't want it to, so
452# just set libs to null here to avoid linking against them by default
453LIBS=
454
455# For now, the user has to explicitly ask for the LLVM stuff, as it's a bit
456# rough around the edges :(
457AC_ARG_WITH([llvm],
458        [AC_HELP_STRING([--with-llvm],
459                [support Just In Time compiler])],
460        use_llvm="yes",
461        use_llvm="no")
462JIT=no
463
464# Search for LLVM and the libraries that it requires
465if (test "$use_llvm" != "no"); then
466        AC_PATH_PROG(LLVM_CONFIG, llvm-config, no)
467
468        # XXX Hard coding the path is REALLY bad.
469        # llvm-gcc is installed in a stupid place in Debian / Ubuntu. Hard luck
470        # if you've installed it somewhere custom.
471        # Hopefully in future we can replace this with clang, which may or may
472        # not be installed somewhere intelligent.
473        AC_PATH_PROG(LLVM_GCC, llvm-gcc, no, /usr/lib/llvm/llvm/gcc-4.2/bin)
474
475        AC_LANG_PUSH([C++])
476        AC_CHECK_HEADERS([boost/lexical_cast.hpp], boost="yes", boost="no")
477        AC_LANG_POP([C++])
478
479               
480        if test "$boost" = "no"; then
481                AC_MSG_NOTICE([Unabled to find boost libraries.  JIT support disabled.])
482                JIT=no
483        elif test "$LLVM_CONFIG" = "no" ; then
484                AC_MSG_NOTICE([Unable to find llvm-config.  JIT support disabled.])
485                JIT=no
486        elif test "$LLVM_GCC" = "no"; then
487                AC_MSG_NOTICE([Unable to find llvm-gcc.  JIT support disabled.])
488                JIT=no
489        else
490                LIBCXXFLAGS="`$LLVM_CONFIG --cxxflags` $CXXFLAGS"
491                LIBTRACE_LIBS="$LIBRACE_LIBS `$LLVM_CONFIG --libs all`";
492                LDFLAGS="`$LLVM_CONFIG --ldflags` $LDFLAGS";
493                JIT=yes
494                AC_DEFINE(HAVE_LLVM, 1, [Set to 1 if you have LLVM installed])
495        fi
496fi
497
498AC_ARG_WITH([ncurses],
499        AC_HELP_STRING([--with-ncurses], [build tracetop (requires ncurses)]))
500
501AS_IF([test "x$with_ncurses" != "xno"],
502        [AC_SEARCH_LIBS(mvprintw, ncurses, have_ncurses=yes, have_ncurses=no)
503         LIBS=
504        ], [have_ncurses=no])
505
506AS_IF([test "x$have_ncurses" = "xyes"], [
507        if test "$ac_cv_search_mvprintw" != "none required"; then
508                TOOLS_LIBS="$TOOLS_LIBS $ac_cv_search_mvprintw"
509        fi
510        AC_DEFINE(HAVE_NCURSES, 1, "Compiled with ncurses support")
511        with_ncurses=yes],
512
513       
514        [AS_IF([test "x$with_ncurses" = "xyes"],
515                [AC_MSG_ERROR([ncurses requested but not found])])
516        AC_DEFINE(HAVE_NCURSES, 0, "Compiled with ncurses support")
517        with_ncurses=no]
518)
519                       
520AC_ARG_WITH([bzip2],
521        AC_HELP_STRING([--with-bzip2], [build with support for bzip2 compressed files]))
522
523AS_IF([test "x$with_bzip2" != "xno"],
524        [
525        AC_CHECK_LIB(bz2, BZ2_bzDecompressInit, have_bzip=yes, have_bzip=no)
526        ], [have_bzip=no])
527
528AS_IF([test "x$have_bzip" = "xyes"], [
529        if test "$ac_cv_lib_bz2_BZ2_bzDecompressInit" != "none required"; then
530                LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lbz2"
531        fi
532        with_bzip2=yes
533        AC_DEFINE(HAVE_LIBBZ2, 1, "Compiled with bzip2 support")],
534       
535        [AS_IF([test "x$with_bzip2" = "xyes"],
536                [AC_MSG_ERROR([bzip2 requested but not found])])
537        AC_DEFINE(HAVE_LIBBZ2, 0, "Compiled with bzip2 support")
538        with_bzip2=no]
539)
540
541AC_ARG_WITH([zlib],
542        AC_HELP_STRING([--with-zlib], [build with support for zlib compressed files]))
543
544AS_IF([test "x$with_zlib" != "xno"],
545        [
546        AC_CHECK_LIB(z, deflate, have_zlib=yes, have_zlib=no)
547        ], [have_zlib=no])
548
549AS_IF([test "x$have_zlib" = "xyes"], [
550        if test "$ac_cv_lib_z_deflate" != "none required"; then
551                LIBWANDIO_LIBS="$LIBWANDIO_LIBS -lz"
552        fi
553        AC_DEFINE(HAVE_LIBZ, 1, "Compiled with zlib support")
554        with_zlib=yes],
555
556       
557        [AS_IF([test "x$with_zlib" = "xyes"],
558                [AC_MSG_ERROR([zlib requested but not found])])
559        AC_DEFINE(HAVE_LIBZ, 0, "Compiled with zlib support")
560        with_zlib=no]
561)
562
563AC_ARG_WITH([lzo],
564        AC_HELP_STRING([--with-lzo], [build with support for writing lzo compressed files]))
565
566AS_IF([test "x$with_lzo" != "xno"],
567        [
568        AC_CHECK_LIB(lzo2, lzo1x_1_compress, have_lzo=yes, have_lzo=no)
569        ], [have_lzo=no])
570
571AS_IF([test "x$have_lzo" = "xyes"], [
572        if test "$ac_cv_lib_lzo2_lzo1x_1_compress" != "none required"; then
573                LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzo2"
574        fi
575        AC_DEFINE(HAVE_LIBLZO2, 1, "Compiled with lzo2 support")
576        with_lzo=yes],
577
578       
579        [AS_IF([test "x$with_lzo" = "xyes"],
580                [AC_MSG_ERROR([lzo requested but not found])])
581        AC_DEFINE(HAVE_LIBLZO2, 0, "Compiled with lzo2 support")
582        with_lzo=no]
583)
584
585AC_ARG_WITH([lzma],
586        AC_HELP_STRING([--with-lzma], [build with support for lzma compressed files]))
587
588AS_IF([test "x$with_lzma" != "xno"],
589        [
590        AC_CHECK_HEADER(lzma.h, have_lzma=yes, have_lzma=no)
591        ], [have_lzma=no])
592
593AS_IF([test "x$have_lzma" = "xyes"], [
594        if test "$ac_cv_lib_lzma_code" != "none required"; then
595                LIBWANDIO_LIBS="$LIBWANDIO_LIBS -llzma"
596        fi
597        AC_DEFINE(HAVE_LIBLZMA, 1, "Compiled with lzma support")
598        with_lzma=yes],
599
600       
601        [AS_IF([test "x$with_lzma" = "xyes"],
602                [AC_MSG_ERROR([lzma requested but not found])])
603        AC_DEFINE(HAVE_LIBLZMA, 0, "Compiled with lzma support")
604        with_lzma=no]
605)
606
607# Define automake conditionals for use in our Makefile.am files
608AM_CONDITIONAL([HAVE_BPF_CAPTURE], [test "$ac_cv_have_decl_BIOCSETIF" = yes ])
609AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true])
610AM_CONDITIONAL([HAVE_DPDK], [test "$libtrace_dpdk" = true])
611AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24])
612AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25])
613AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true])
614AM_CONDITIONAL([HAVE_LIBGDC], [test "$ac_cv_header_gdc_h" = yes])
615AM_CONDITIONAL([HAVE_LLVM], [test "x$JIT" != "xno" ])
616AM_CONDITIONAL([HAVE_NCURSES], [test "x$with_ncurses" != "xno"])
617AM_CONDITIONAL([HAVE_BZLIB], [test "x$with_bzip2" != "xno"])
618AM_CONDITIONAL([HAVE_ZLIB], [test "x$with_zlib" != "xno"])
619AM_CONDITIONAL([HAVE_LZO], [ test "x$with_lzo" != "xno"])
620AM_CONDITIONAL([HAVE_LZMA], [ test "x$with_lzma" != "xno"])
621
622# Check for miscellaneous programs
623AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false])
624
625AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue])
626
627# Set all our output variables
628AC_SUBST([LIBTRACE_LIBS])
629AC_SUBST([LIBPKTDUMP_LIBS])
630AC_SUBST([LIBWANDIO_LIBS])
631AC_SUBST([TOOLS_LIBS])
632#AC_SUBST([ADD_LIBS])
633AC_SUBST([ADD_LDFLAGS])
634AC_SUBST([ADD_INCLS])
635AC_SUBST([LTLIBOBJS])
636AC_SUBST([MANPAGES])
637AC_SUBST([PACKAGE_VERSION])
638AC_SUBST([LIBTRACE_MAJOR])
639AC_SUBST([LIBTRACE_MID])
640AC_SUBST([LIBTRACE_MINOR])
641AC_SUBST([DAG_VERSION_NUM])
642AC_SUBST([HAVE_BPF_CAPTURE])
643AC_SUBST([HAVE_LIBGDC])
644AC_SUBST([HAVE_LLVM])
645AC_SUBST([HAVE_NCURSES])
646AC_SUBST([LIBCFLAGS])
647AC_SUBST([LIBCXXFLAGS])
648
649
650# Finally, output our Makefiles
651AC_OUTPUT
652
653# Function for reporting whether an option was set or not
654reportopt() {
655        if test x"$2" = xtrue -o x"$2" = xyes; then
656                AC_MSG_NOTICE([$1: Yes])
657        else
658                AC_MSG_NOTICE([$1: No])
659        fi
660}
661
662
663# Report which configure options were set
664echo
665AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION])
666if test "$pcapcreate" = 1; then
667        AC_MSG_NOTICE([Compiled with PCAP support: >= 1.0])
668else
669        AC_MSG_NOTICE([Compiled with PCAP support: < 1.0])
670fi
671
672reportopt "Compiled with compressed trace (zlib) support" $with_zlib
673reportopt "Compiled with compressed trace (bz2) support" $with_bzip2
674reportopt "Compiled with compressed trace (lzo write only) support" $with_lzo
675reportopt "Compiled with compressed trace (lzma) support" $with_lzma
676if test x"$libtrace_dag" = xtrue; then
677        if test "$libtrace_dag_version" = 24; then
678                AC_MSG_NOTICE([Compiled with DAG live capture support: 2.4])
679        elif test "$libtrace_dag_version" = 30; then
680                AC_MSG_NOTICE([Compiled with DAG live capture support: 3.0])
681        else
682                AC_MSG_NOTICE([Compiled with DAG live capture support: 2.5])
683        fi     
684else
685        AC_MSG_NOTICE([Compiled with DAG live capture support: No])
686fi
687
688if test x"$libtrace_dpdk" = xtrue; then
689    AC_MSG_NOTICE([Compiled with DPDK live capture support: Yes])
690elif test x"$want_dpdk" != "xno"; then
691#   We don't officially support DPDK so only report failure if the user
692#   explicitly asked for DPDK. That way, we can hopefully keep it hidden
693#   from most users for now...
694       
695    AC_MSG_NOTICE([Compiled with DPDK live capture support: No])
696    AC_MSG_NOTICE([Note: Requires DPDK v1.5 or newer])
697fi
698reportopt "Compiled with LLVM BPF JIT support" $JIT
699reportopt "Building man pages/documentation" $libtrace_doxygen
700reportopt "Building tracetop (requires libncurses)" $with_ncurses
701
702# Report any errors relating to missing bison, flex, etc.
703echo
704ac_cv_errcount=0;
705if test -z "$YACC"; then
706        AC_MSG_WARN(bison or yacc not found. Please install bison before continuing)
707        ac_cv_errcount=$((ac_cv_errcount + 1))
708fi
709
710if test "x$LEX" != xflex -a "x$LEX" != xlex; then
711        AC_MSG_WARN(flex or lex not found. Please install flex before continuing)
712        ac_cv_errcount=$((ac_cv_errcount + 1))
713fi
714
715if test $ac_cv_errcount -gt 0; then
716        AC_MSG_ERROR(Critical packages are missing and compilation will fail. Please install the packages listed above and rerun ./configure)
717fi
718
Note: See TracBrowser for help on using the repository browser.