source: configure.in @ 10f924c

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

Fixed broken -fvisibility check in configure

  • Added a m4 script that does this properly rather than our hax gcc version check.
  • Tidied up CFLAGS in configure so we aren't adding the same sets of flags multiple times
  • Created a wandio_internal.h file for storing global variables that shouldn't be made public

Thanks to Alistair King, whose patch to try and make this work for
non-gcc systems brought my attention to just how broken this was :)

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