source: configure.in @ d420777

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

Merge remote branch 'parallel/develop' into libtrace4

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