# Process this file with autoconf to produce a configure script. # Now you only need to update the version number in two places - below, # and in the README AC_INIT([libtrace],[4.0.0],[contact@wand.net.nz],[libtrace]) LIBTRACE_MAJOR=4 LIBTRACE_MID=0 LIBTRACE_MINOR=0 # OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not # searched by default - add it to LDFLAGS so we at least have a chance of # finding it if test -d "/usr/gnu/lib"; then LDFLAGS+=" -L/usr/gnu/lib" fi AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(lib/trace.c) AM_INIT_AUTOMAKE([subdir-objects]) # Make sure we use the relatively silent automake output m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) # Define our libtrace version number externally so we can use it in the source # as well, if needed. AC_DEFINE([LIBTRACE_MAJOR],${LIBTRACE_MAJOR},[libtrace major version]) AC_DEFINE([LIBTRACE_MID],${LIBTRACE_MID},[libtrace mid version]) AC_DEFINE([LIBTRACE_MINOR],${LIBTRACE_MINOR},[libtrace minor version]) # These are all the files we want to be built for us by configure AC_CONFIG_FILES([Makefile lib/Makefile docs/Makefile libpacketdump/Makefile tools/Makefile tools/traceanon/Makefile tools/tracepktdump/Makefile tools/tracemerge/Makefile tools/tracereport/Makefile tools/tracertstats/Makefile tools/tracesplit/Makefile tools/tracestats/Makefile tools/tracetop/Makefile tools/tracereplay/Makefile tools/tracediff/Makefile tools/traceends/Makefile examples/Makefile examples/skeleton/Makefile examples/rate/Makefile examples/stats/Makefile examples/tutorial/Makefile examples/parallel/Makefile docs/libtrace.doxygen lib/libtrace.h ]) # Function that checks if the C++ compiler actually works - there's a bit of # oversight in autoconf that will set the C++ compiler to g++ if no compiler # is found, even if g++ is not present! So we need an extra test to make sure # that the compiler works :( AC_DEFUN([rw_PROG_CXX_WORKS], [AC_REQUIRE([AC_PROG_CXX])dnl AC_CACHE_CHECK([whether the C++ compiler works], [rw_cv_prog_cxx_works], [AC_LANG_PUSH([C++]) AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [rw_cv_prog_cxx_works=yes], [rw_cv_prog_cxx_works=no]) AC_LANG_POP([C++])]) ]) # Put all our automake definitions in config.h AM_CONFIG_HEADER([config.h]) # Checks for C and C++ compilers AC_PROG_CC AC_PROG_CXX rw_PROG_CXX_WORKS if test "$rw_cv_prog_cxx_works" = "no"; then AC_MSG_ERROR("Failed to find working C++ compiler") fi # Checking for 'install' AC_PROG_INSTALL # Checking for bison and flex AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc) AM_PROG_LEX # All our source files for function replacements are in lib/ AC_CONFIG_LIBOBJ_DIR(lib) # Check for various "replacement" functions AC_FUNC_MALLOC AC_FUNC_REALLOC # *BSD doesn't have strndup. Currently provide our own. AC_REPLACE_FUNCS(strndup) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_C_BIGENDIAN AC_TYPE_SIZE_T AC_HEADER_TIME AC_SYS_LARGEFILE LIBPKTDUMP_LIBS="-ltrace " ADD_LDFLAGS="$ADD_LDFLAGS -L\$(abs_top_srcdir)/lib" LIBTRACE_LIBS="" TOOLS_LIBS="" CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wextra -DLT_BUILDING_DLL=1" CXXFLAGS="$CXXFLAGS -Wall -DLT_BUILDING_DLL=1" # Check for -fvisibility gl_VISIBILITY gcc_PACKED gcc_DEPRECATED gcc_UNUSED gcc_PURE gcc_FORMAT # Check for gcc style TLS (__thread) gcc_TLS # Check for libtool AC_PROG_LIBTOOL # Checks for library functions. AC_PROG_GCC_TRADITIONAL # Fail if any of these functions are missing AC_CHECK_FUNCS(socket strdup strlcpy strcasecmp strncasecmp snprintf vsnprintf) AC_CHECK_SIZEOF([long int]) # Checks for header files. AC_HEADER_STDC AC_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) # OpenSolaris puts ncurses.h in /usr/include/ncurses rather than /usr/include, # so check for that AC_CHECK_HEADERS(ncurses.h,,[missing_ncurses=true]) if test "x$missing_ncurses" = xtrue; then if test -f "/usr/include/ncurses/ncurses.h"; then AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Has nested ncurses header]) fi fi # Check for the presence of various networking headers and define appropriate # macros AC_CHECK_HEADERS(netinet/in.h) AC_CHECK_HEADERS(netpacket/packet.h,[ libtrace_netpacket_packet_h=true AC_DEFINE(HAVE_NETPACKET_PACKET_H,1,[has net]) ]) AC_CHECK_HEADER(net/if.h, AC_DEFINE(HAVE_NET_IF_H,1,[has net/if.h header]),,[ #include #include ]) AC_CHECK_HEADER(netinet/ether.h, AC_DEFINE(HAVE_NETINET_ETHER_H,1,[has netinet/ether.h header]),,[ #include #include #include #include ]) AC_CHECK_HEADER(netinet/if_ether.h, AC_DEFINE(HAVE_NETINET_IF_ETHER_H,1,[has netinet/if_ether.h]),,[ #include #include #include #include ]) AC_CHECK_HEADER(net/if_arp.h, AC_DEFINE(HAVE_NET_IF_ARP_H,1,[has net/if_arp.h]),,[ #include #include #include #include ]) # Check for sdl_len in sockaddr_dl - sockaddr_dl is used on BSD systems if test "$libtrace_netpacket_packet_h" != "true"; then AC_CHECK_MEMBER([struct sockaddr_dl.sdl_len], AC_DEFINE(HAVE_SDL_LEN,1,[Has sdl_len in sockaddr_dl]),,[ #include #include #include ]) fi # Checking for the right bpf header to include AC_CHECK_HEADER(pcap-bpf.h) AC_CHECK_HEADER(net/bpf.h) # Checking for libgdc AC_CHECK_HEADER(gdc.h,AC_DEFINE(HAVE_LIBGDC,1,[has gdc.h])) # Check for libwandio (no longer bundled with libtrace) AC_CHECK_LIB(wandio,wandio_create,wandiofound=1,wandiofound=0) if test "$wandiofound" = 0; then 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) else LIBTRACE_LIBS="$LIBTRACE_LIBS -lwandio" TOOLS_LIBS="$TOOLS_LIBS -lwandio" AC_DEFINE([HAVE_LIBWANDIO],1,[compile with libwandio support]) fi AC_CHECK_LIB(crypto, EVP_EncryptInit_ex, cryptofound=1, cryptofound=0) # Check for libpcap AC_CHECK_LIB(pcap,pcap_next_ex,pcapfound=1,pcapfound=0) AC_CHECK_LIB(pcap,pcap_create,pcapcreate=1,pcapcreate=0) AC_CHECK_LIB(pcap,pcap_set_immediate_mode,pcapimmediate=1,pcapimmediate=0) AC_CHECK_DECLS([BIOCSETIF],,,[ #include #include #include #include ]) AC_ARG_ENABLE(memory-debugging, AS_HELP_STRING(--enable-memory-debugging, prints internal memory statistics),[ if test "$HAVE_TLS" = 1 then AC_DEFINE([ENABLE_MEM_STATS], 1, [print debug memory statistics]) fi ],[]) # Configure options for man pages AC_ARG_WITH(man, AS_HELP_STRING(--with-man,install man pages by default),[ if test "$withval" = yes then MANPAGES="docs/man/man3/[a-zA-Z]*.3" else MANPAGES="" fi ]) # Complain if we didn't find a suitable libpcap if test "$pcapfound" = 0; then 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) else TOOL_LIBS="$TOOL_LIBS -lpcap" LIBTRACE_LIBS="$LIBTRACE_LIBS -lpcap" AC_DEFINE([HAVE_LIBPCAP],1,[compile with libpcap support]) AC_DEFINE([HAVE_BPF_FILTER],1,[compile with bpf filter support]) LIBS="-lpcap" AC_CHECK_FUNCS(pcap_inject pcap_sendpacket pcap_setnonblock) LIBS="" fi if test "$pcapcreate" = 1; then AC_DEFINE([HAVE_PCAP_CREATE],1,[compile with libpcap 1.0 support]) fi if test "$pcapimmediate" = 1; then AC_DEFINE([HAVE_PCAP_IMMEDIATE],1,[able to use pcap_set_immediate_mode]) fi # Configure options for use of DAG cards # Originally borrowed from libpcap, but extended quite a bit :) # More details on how this check works: # http://wand.net.nz/trac/libtrace/wiki/DAGNotes AC_ARG_WITH(dag, AS_HELP_STRING(--with-dag[=DIR],include DAG live capture support (located in directory DIR, if supplied)), [ if test "$withval" = no then want_dag=no elif test "$withval" = yes then want_dag=yes dag_root=/usr/local/dag else want_dag=yes dag_root=$withval fi ],[ # # Use DAG API if present, otherwise don't # want_dag=ifpresent dag_root=/usr/local/dag ]) # DAG 3.0 actually puts header files and shared libraries into sensible # places now, so we should be able to do a simple CHECK_LIB to see if # they're there! # Addendum: It turns out DAG 2.5 does this too, so we'll match DAG2.5 in here # also. This isn't such a bad thing, the DAG2.5 API is essentially the same as # DAG 3.0 and libtrace will use the same format_dagXX source for both libtrace_dag=false libtrace_dag_version=none if test "$with_dag" != no; then AC_CHECK_LIB(dag, dag_open, dag_found=1, dag_found=0) if test "$dag_found" = 1; then ADD_LIBS="$ADD_LIBS -ldag" LIBTRACE_LIBS="$LIBTRACE_LIBS -ldag" AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API]) AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG live capture support]) libtrace_dag=true AC_DEFINE(DAG_VERSION,25,[defines the DAG driver version]) libtrace_dag_version=25 AC_CHECK_HEADERS(dag_config_api.h,[csapi_found=1],,) if test "$csapi_found" = 1; then LIBTRACE_LIBS="$LIBTRACE_LIBS -ldagconf" fi fi fi # TODO: turn the test part of the next block into a function, so it can be # called multiple times for $dag_root, /root/dag, /usr/local/lib dag_drv_v="DAG not present" # Now check for 2.4 DAG drivers which don't install as cleanly! if test "$with_dag" != no -a "$libtrace_dag" = false; then AC_MSG_CHECKING(whether we have DAG 2.4 API instead) if test -r "$dag_root/lib"; then dag_lib_dir="$dag_root/lib" else dag_lib_dir="$dag_root" fi if test -r "$dag_root/include"; then dag_tools_dir="$dag_root/tools" dag_include_dir="$dag_root/include" else dag_tools_dir="$dag_root" dag_include_dir="$dag_root" fi if test -r "$dag_include_dir/dagapi.h" -a -r "$dag_lib_dir/libdag.a"; then ADD_INCLS="$ADD_INCLS -I $dag_include_dir" ADD_LIBS="$ADD_LIBS -ldag" ADD_LDFLAGS="$ADD_LDFLAGS -L$dag_lib_dir" DAG_TOOLS_DIR=$dag_tools_dir AC_SUBST([DAG_TOOLS_DIR]) libtrace_dag=true AC_DEFINE(HAVE_DAG_API, 1, [define if you have the DAG API]) AC_DEFINE(HAVE_DAG,1,[conditional for building with DAG live capture support]) AC_DEFINE(DAG_VERSION, 24, [defines the DAG driver version]) libtrace_dag_version=24 else if test "$want_dag" = yes; then AC_MSG_ERROR(DAG API not found under directory $dag_root ; use --without-dag) fi libtrace_dag=false fi AC_MSG_RESULT($libtrace_dag) fi # Try to determine the DAG driver version #if test x"$libtrace_dag" = xtrue; then # dag_drv_v="Unknown" # files=`locate /usr/*dag*/VERSION` # file_count=0 # # for i in $files; do # if $file_count > 0; then # dag_drv_v="Indeterminate" # break # fi # dag_drv_v=`cat $i` # file_count=$file_count+1 # done #fi #DAG_VERSION_NUM=$dag_drv_v # Check for DPDK AC_ARG_WITH(dpdk, AS_HELP_STRING(--with-dpdk,include DPDK live capture support (From either the RTE_SDK/_TARGET environment variable or the dpdk-dev package)), [ if test "$withval" = no then want_dpdk=no else want_dpdk=ifpresent fi ],[ # Default to building without DPDK format want_dpdk=no ]) libtrace_dpdk=false if test "$want_dpdk" != no; then # So instead simply check for existence if test "$RTE_SDK" != ""; then AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libintel_dpdk.a", dpdk_found="libintel_dpdk.a", dpdk_found=0) fi # DPDK 2.1.0+ renames this to libdpdk from libintel_dpdk if test "$dpdk_found" = 0 -a "$RTE_SDK" != ""; then AC_CHECK_FILE("$RTE_SDK/$RTE_TARGET/lib/libdpdk.a", dpdk_found="libdpdk.a", dpdk_found=0) fi if test "$dpdk_found" != 0 -a "$RTE_SDK" != ""; then # Save these now so that they can be re-exported later AC_SUBST([RTE_TARGET]) AC_SUBST([RTE_SDK]) # Force dpdk library to be statically linked to allow compiler optimisations LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,--whole-archive -Wl,-l:$dpdk_found -Wl,--no-whole-archive -Wl,-lm" AC_DEFINE(HAVE_DPDK,1,[conditional for building with DPDK live capture support]) libtrace_dpdk=true fi if test "$RTE_SDK" = ""; then AC_MSG_NOTICE([No RTE_SDK given, checking for system dpdk-dev package]) # Search the system, maybe it is installed? Ethdev is one of the main libraries AC_CHECK_LIB(ethdev, rte_eth_dev_configure, dpdk_found="system", dpdk_found=0) # We also need to check that rte.vars.mk is installed from dpdk-dev (as well as libdpdk-dev) if test "$dpdk_found" != 0 -a -e /usr/share/dpdk/mk/rte.vars.mk ; then RTE_TARGET="x86_64-default-linuxapp-gcc" RTE_SDK="/usr/share/dpdk/" RTE_INCLUDE="/usr/include/dpdk" AC_SUBST([RTE_TARGET]) AC_SUBST([RTE_SDK]) AC_SUBST([RTE_INCLUDE]) # include libethdev this is part of DPDK LIBTRACE_LIBS="$LIBTRACE_LIBS -lethdev" # Include all rte libs note we need to escape '[' and ']' LIBTRACE_LIBS="$LIBTRACE_LIBS $(ldconfig -p | sed 's/.*lib\([[^.]]*\).*/-l\1/' | grep rte_ | tr '\n' ' ')" AC_MSG_NOTICE([Building against system DPDK]) AC_DEFINE(HAVE_DPDK,1,[conditional for building with DPDK live capture support]) libtrace_dpdk=true fi fi fi # Check for PACKET_FANOUT (borrowed from Suricata) AC_CHECK_DECL([PACKET_FANOUT], AC_DEFINE([HAVE_PACKET_FANOUT],[1], [Recent packet fanout support is available]), [], [[#include ]]) # If we use DPDK we might be able to use libnuma AC_CHECK_LIB(numa, numa_node_to_cpus, have_numa=1, have_numa=0) # Checks for various "optional" libraries AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0) AC_CHECK_LIB(pthread, pthread_setname_np, have_pthread_setname_np=1, have_pthread_setname_np=0) # Check for ncurses # These libraries have to be explicitly linked in OpenSolaris AC_SEARCH_LIBS(getservent, socket, have_socket=1, have_socket=0, -lnsl) LIBS= AC_SEARCH_LIBS(inet_ntop, nsl, have_nsl=1, have_nsl=0, -lsocket) LIBS= # Check to see if we have libdl - *BSD has built-in libdl AC_SEARCH_LIBS(dlopen,dl, dlfound=1,dlfound=0 ) LIBS= # Check for clock_gettime AC_CHECK_LIB(rt, clock_gettime, have_clock_gettime=1, have_clock_gettime=0) LIBS= if test "$have_numa" = 1; then LIBTRACE_LIBS="$LIBTRACE_LIBS -lnuma" AC_DEFINE(HAVE_LIBNUMA, 1, [Set to 1 if libnuma is supported]) with_numa=yes else AC_DEFINE(HAVE_LIBNUMA, 0, [Set to 1 if libnuma is supported]) with_numa=no fi if test "$dlfound" = 0; then AC_MSG_ERROR("Unable to find dlopen. Please use LDFLAGS to specify the location of libdl and re-run configure") fi if test "$ac_cv_search_dlopen" != "none required"; then LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_dlopen" if test "$dpdk_found" != 0; then LIBTRACE_LIBS="$LIBTRACE_LIBS -Wl,$ac_cv_search_dlopen" fi fi if test "$have_pthread" = 1; then AC_DEFINE(HAVE_LIBPTHREAD, 1, [Set to 1 if pthreads are supported]) fi if test "$have_pthread_setname_np" = 1; then AC_DEFINE(HAVE_PTHREAD_SETNAME_NP, 1, [Set to 1 if pthread_setname_np is found]) fi if test "$cryptofound" = 1; then AC_DEFINE(HAVE_LIBCRYPTO, 1, [Set to 1 if libcrypto is available]) TOOLS_LIBS="$TOOLS_LIBS -lcrypto" have_crypto=yes else have_crypto=no fi if test "$have_nsl" = 1; then if test "$ac_cv_search_inet_ntop" != "none required"; then LIBTRACE_LIBS="$LIBTRACE_LIBS $ac_cv_search_inet_ntop" LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_inet_ntop" fi fi if test "$have_socket" = 1; then if test "$ac_cv_search_getservent" != "none required"; then LIBTRACE_LIBS="$LIBTRACE_LIBS $ac_cv_search_getservent" LIBPKTDUMP_LIBS="$LIBPKTDUMP_LIBS $ac_cv_search_getservent" fi fi if test "$have_clock_gettime" = 1; then LIBTRACE_LIBS="$LIBTRACE_LIBS -lrt" AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Set to 1 if clock_gettime is supported]) with_clock_gettime=yes else AC_DEFINE(HAVE_CLOCK_GETTIME, 0, [Set to 1 if clock_gettime is supported]) with_clock_gettime=no fi # Stupid AC_SEARCH_LIB appends stuff to LIBS even when I don't want it to, so # just set libs to null here to avoid linking against them by default LIBS= # For now, the user has to explicitly ask for the LLVM stuff, as it's a bit # rough around the edges :( AC_ARG_WITH([llvm], [AC_HELP_STRING([--with-llvm], [support Just In Time compiler])], use_llvm="yes", use_llvm="no") JIT=no # Search for LLVM and the libraries that it requires if (test "$use_llvm" != "no"); then AC_PATH_PROG(LLVM_CONFIG, llvm-config, no) # XXX Hard coding the path is REALLY bad. # llvm-gcc is installed in a stupid place in Debian / Ubuntu. Hard luck # if you've installed it somewhere custom. # Hopefully in future we can replace this with clang, which may or may # not be installed somewhere intelligent. AC_PATH_PROG(LLVM_GCC, llvm-gcc, no, /usr/lib/llvm/llvm/gcc-4.2/bin) AC_LANG_PUSH([C++]) AC_CHECK_HEADERS([boost/lexical_cast.hpp], boost="yes", boost="no") AC_LANG_POP([C++]) if test "$boost" = "no"; then AC_MSG_NOTICE([Unabled to find boost libraries. JIT support disabled.]) JIT=no elif test "$LLVM_CONFIG" = "no" ; then AC_MSG_NOTICE([Unable to find llvm-config. JIT support disabled.]) JIT=no elif test "$LLVM_GCC" = "no"; then AC_MSG_NOTICE([Unable to find llvm-gcc. JIT support disabled.]) JIT=no else LIBCXXFLAGS="`$LLVM_CONFIG --cxxflags` $CXXFLAGS" LIBTRACE_LIBS="$LIBRACE_LIBS `$LLVM_CONFIG --libs all`"; LDFLAGS="`$LLVM_CONFIG --ldflags` $LDFLAGS"; JIT=yes AC_DEFINE(HAVE_LLVM, 1, [Set to 1 if you have LLVM installed]) fi fi AC_ARG_WITH([ncurses], AC_HELP_STRING([--with-ncurses], [build tracetop (requires ncurses)])) AS_IF([test "x$with_ncurses" != "xno"], [AC_SEARCH_LIBS(mvprintw, ncurses, have_ncurses=yes, have_ncurses=no) LIBS= ], [have_ncurses=no]) AS_IF([test "x$have_ncurses" = "xyes"], [ if test "$ac_cv_search_mvprintw" != "none required"; then TOOLS_LIBS="$TOOLS_LIBS $ac_cv_search_mvprintw" fi AC_DEFINE(HAVE_NCURSES, 1, "Compiled with ncurses support") with_ncurses=yes], [AS_IF([test "x$with_ncurses" = "xyes"], [AC_MSG_ERROR([ncurses requested but not found])]) AC_DEFINE(HAVE_NCURSES, 0, "Compiled with ncurses support") with_ncurses=no] ) # Define automake conditionals for use in our Makefile.am files AM_CONDITIONAL([HAVE_BPF_CAPTURE], [test "$ac_cv_have_decl_BIOCSETIF" = yes ]) AM_CONDITIONAL([HAVE_DAG], [test "$libtrace_dag" = true]) AM_CONDITIONAL([HAVE_DPDK], [test "$libtrace_dpdk" = true]) AM_CONDITIONAL([DAG2_4], [test "$libtrace_dag_version" = 24]) AM_CONDITIONAL([DAG2_5], [test "$libtrace_dag_version" = 25]) AM_CONDITIONAL([HAVE_NETPACKET_PACKET_H], [test "$libtrace_netpacket_packet_h" = true]) AM_CONDITIONAL([HAVE_LIBGDC], [test "$ac_cv_header_gdc_h" = yes]) AM_CONDITIONAL([HAVE_LLVM], [test "x$JIT" != "xno" ]) AM_CONDITIONAL([HAVE_NCURSES], [test "x$with_ncurses" != "xno"]) # Check for miscellaneous programs AC_CHECK_PROG([libtrace_doxygen], [doxygen], [true], [false]) AM_CONDITIONAL(HAS_DOXYGEN, [test x"$libtrace_doxygen" = xtrue]) # Set all our output variables AC_SUBST([LIBTRACE_LIBS]) AC_SUBST([LIBPKTDUMP_LIBS]) AC_SUBST([TOOLS_LIBS]) #AC_SUBST([ADD_LIBS]) AC_SUBST([ADD_LDFLAGS]) AC_SUBST([ADD_INCLS]) AC_SUBST([LTLIBOBJS]) AC_SUBST([MANPAGES]) AC_SUBST([PACKAGE_VERSION]) AC_SUBST([LIBTRACE_MAJOR]) AC_SUBST([LIBTRACE_MID]) AC_SUBST([LIBTRACE_MINOR]) AC_SUBST([DAG_VERSION_NUM]) AC_SUBST([HAVE_BPF_CAPTURE]) AC_SUBST([HAVE_LIBGDC]) AC_SUBST([HAVE_LLVM]) AC_SUBST([HAVE_NCURSES]) AC_SUBST([LIBCFLAGS]) AC_SUBST([LIBCXXFLAGS]) # Finally, output our Makefiles AC_OUTPUT # Function for reporting whether an option was set or not reportopt() { if test x"$2" = xtrue -o x"$2" = xyes; then AC_MSG_NOTICE([$1: Yes]) else AC_MSG_NOTICE([$1: No]) fi } # Report which configure options were set echo AC_MSG_NOTICE([Libtrace version $PACKAGE_VERSION]) if test "$pcapcreate" = 1; then AC_MSG_NOTICE([Compiled with PCAP support: >= 1.0]) else AC_MSG_NOTICE([Compiled with PCAP support: < 1.0]) fi if test x"$libtrace_dag" = xtrue; then if test "$libtrace_dag_version" = 24; then AC_MSG_NOTICE([Compiled with DAG live capture support: 2.4]) elif test "$libtrace_dag_version" = 30; then AC_MSG_NOTICE([Compiled with DAG live capture support: 3.0]) else AC_MSG_NOTICE([Compiled with DAG live capture support: 2.5]) fi else AC_MSG_NOTICE([Compiled with DAG live capture support: No]) fi if test x"$libtrace_dpdk" = xtrue; then AC_MSG_NOTICE([Compiled with DPDK live capture support: Yes]) reportopt "Compiled with DPDK trace NUMA support" $with_numa reportopt "Compiled with clock_gettime support" $with_clock_gettime elif test x"$want_dpdk" != "xno"; then # We don't officially support DPDK so only report failure if the user # explicitly asked for DPDK. That way, we can hopefully keep it hidden # from most users for now... AC_MSG_NOTICE([Compiled with DPDK live capture support: No]) AC_MSG_NOTICE([Note: Requires DPDK v1.5 or newer]) fi reportopt "Compiled with LLVM BPF JIT support" $JIT reportopt "Building man pages/documentation" $libtrace_doxygen reportopt "Building tracetop (requires libncurses)" $with_ncurses reportopt "Building traceanon with CryptoPan (requires libcrypto)" $have_crypto # Report any errors relating to missing bison, flex, etc. echo ac_cv_errcount=0; if test -z "$YACC"; then AC_MSG_WARN(bison or yacc not found. Please install bison before continuing) ac_cv_errcount=$((ac_cv_errcount + 1)) fi if test "x$LEX" != xflex -a "x$LEX" != xlex; then AC_MSG_WARN(flex or lex not found. Please install flex before continuing) ac_cv_errcount=$((ac_cv_errcount + 1)) fi if test $ac_cv_errcount -gt 0; then AC_MSG_ERROR(Critical packages are missing and compilation will fail. Please install the packages listed above and rerun ./configure) fi