33# Now you only need to update the version number in two places - below,
44# and in the README
55
6- AC_INIT([libtrace],[4.0.19 ],[contact@wand.net .nz],[libtrace])
6+ AC_INIT([libtrace],[4.0.20 ],[shane@alcock.co .nz],[libtrace])
77
88LIBTRACE_MAJOR=4
99LIBTRACE_MID=0
10- LIBTRACE_MINOR=19
10+ LIBTRACE_MINOR=20
1111
1212# OpenSolaris hides libraries like libncurses in /usr/gnu/lib, which is not
1313# searched by default - add it to LDFLAGS so we at least have a chance of
@@ -61,7 +61,7 @@ AC_CACHE_CHECK([whether the C++ compiler works],
6161])
6262
6363# Put all our automake definitions in config.h
64- AM_CONFIG_HEADER ([config.h])
64+ AC_CONFIG_HEADERS ([config.h])
6565
6666# Checks for C and C++ compilers
6767AC_PROG_CC
@@ -73,11 +73,11 @@ if test "$rw_cv_prog_cxx_works" = "no"; then
7373fi
7474
7575# Checking for 'install'
76- AC_PROG_INSTALL
76+ LT_INIT
7777
7878# Checking for bison and flex
7979AC_CHECK_PROGS(YACC, 'bison -y' byacc yacc)
80- AM_PROG_LEX
80+ AC_PROG_LEX(yywrap)
8181
8282PKG_PROG_PKG_CONFIG
8383
@@ -93,7 +93,8 @@ AC_C_CONST
9393AC_C_INLINE
9494AC_C_BIGENDIAN
9595AC_TYPE_SIZE_T
96- AC_HEADER_TIME
96+ AC_CHECK_HEADERS_ONCE([sys/time.h])
97+
9798AC_SYS_LARGEFILE
9899
99100LIBPKTDUMP_LIBS="-ltrace "
@@ -147,7 +148,7 @@ gcc_FORMAT
147148gcc_TLS
148149
149150# Check for libtool
150- AC_PROG_LIBTOOL
151+ LT_INIT
151152
152153# Checks for library functions.
153154AC_PROG_GCC_TRADITIONAL
@@ -160,7 +161,6 @@ AC_CHECK_SIZEOF([long int])
160161
161162
162163# Checks for header files.
163- AC_HEADER_STDC
164164AC_CHECK_HEADERS(pcap.h pcap-bpf.h net/bpf.h sys/limits.h stddef.h inttypes.h limits.h net/ethernet.h sys/prctl.h)
165165
166166
@@ -238,7 +238,7 @@ AC_CHECK_HEADER(gdc.h,AC_DEFINE(HAVE_LIBGDC,1,[has gdc.h]))
238238# Check for libwandio (no longer bundled with libtrace)
239239AC_CHECK_LIB(wandio,wandio_wflush,wandiofound=1,wandiofound=0)
240240if test "$wandiofound" = 0; then
241- AC_MSG_ERROR(libwandio 4.0.0 or better is required to compile this version of libtrace. If you have installed libwandio 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 )
241+ AC_MSG_ERROR(libwandio 4.0.0 or better is required to compile this version of libtrace. If you have installed libwandio in a non-standard location please use LDFLAGS to specify the location of the library. WANDIO can be obtained from https ://github.com/LibtraceTeam/wandio )
242242else
243243 LIBTRACE_LIBS="$LIBTRACE_LIBS -lwandio"
244244 TOOLS_LIBS="$TOOLS_LIBS -lwandio"
@@ -307,32 +307,58 @@ AC_ARG_WITH(xdp, AS_HELP_STRING(--with-xdp, include XDP capture support),
307307
308308if test "$want_xdp" != no; then
309309 AC_CHECK_LIB(elf, elf_begin, elffound=1, elffound=0)
310+
310311 if test "$elffound" = 1; then
311- # check for libbpf
312- AC_CHECK_LIB(bpf, xsk_socket__create, bpffound=1, bpffound=0, -lelf)
313-
314- if test "$bpffound" = 1; then
315- AC_DEFINE(HAVE_LIBBPF, 1, [Set to 1 if libbpf is available])
316- ADD_LDFLAGS="$ADD_LDFLAGS -lbpf -lelf"
317- libtrace_xdp=true
318-
319- # check for requirements to build XDP eBPF kernel
320- AC_CHECK_PROG(CLANG, [clang], [clang], [no])
321- if test "$CLANG" != "no"; then
322-
323- AC_SUBST(CLANG)
324- llc_candidates=$($CLANG --version | \
325- awk '/^clang version/ {
326- split($3, v, ".");
327- printf("llc-%s.%s llc-%s llc", v[[1]], v[[2]], v[[1]])
328- }')
329- AC_CHECK_PROGS([LLC], [$llc_candidates], [no])
330- if test "$LLC" != "no"; then
331- AC_SUBST(LLC)
332- build_ebpf=true
312+ AC_CHECK_LIB(xdp, xsk_socket__create, xdpfound=1, xdpfound=0, -lelf)
313+
314+ if test "$xdpfound" = 1; then
315+ # check for libbpf
316+ AC_CHECK_LIB(bpf, bpf_map_update_elem, bpffound=1, bpffound=0,
317+ -lelf -lxdp)
318+
319+ if test "$bpffound" = 1; then
320+ AC_DEFINE(HAVE_LIBBPF, 1, [Set to 1 if libbpf is available])
321+ ADD_LDFLAGS="$ADD_LDFLAGS -lbpf -lelf -lxdp"
322+ libtrace_xdp=true
323+
324+ AC_CHECK_LIB(bpf, bpf_xdp_query_id, bpfnewer=1, bpfnewer=0,
325+ -lelf -lxdp)
326+ if test "$bpffound" = 1; then
327+ AC_DEFINE(HAVE_LIBBPF_XDP_QUERYID, 1, [Set to 1 if libbpf supports bpf_xdp_query_id])
333328 fi
334329
335- fi
330+ # check for requirements to build XDP eBPF kernel
331+ AC_CHECK_PROG(CLANG, [clang], [clang], [no])
332+ if test "$CLANG" != "no"; then
333+
334+ AC_SUBST(CLANG)
335+ llc_candidates=$($CLANG --version | \
336+ awk '/^clang version/ {
337+ split($3, v, ".");
338+ printf("llc-%s.%s llc-%s llc", v[[1]], v[[2]], v[[1]])
339+ }')
340+ AC_CHECK_PROGS([LLC], [$llc_candidates], [no])
341+ if test "$LLC" != "no"; then
342+ AC_SUBST(LLC)
343+ build_ebpf=true
344+ else
345+ llc_candidates=$($CLANG --version | \
346+ awk '/ clang version/ {
347+ split($4, v, ".");
348+ printf("llc-%s.%s llc-%s llc", v[[1]], v[[2]], v[[1]])
349+ }')
350+ LLC=""
351+ AC_CHECK_PROGS([LLC], [$llc_candidates], [no])
352+ if test "$LLC" != "no"; then
353+ AC_SUBST(LLC)
354+ build_ebpf=true
355+ fi
356+ fi
357+
358+ fi
359+ else
360+ libtrace_xdp=false
361+ fi
336362 else
337363 libtrace_xdp=false
338364 fi
341367
342368# was xdp build explicitly specified and failed
343369if test "$want_xdp" = yes -a "$libtrace_xdp" = false; then
344- AC_MSG_ERROR([libelf and libbpf are required for XDP support])
370+ AC_MSG_ERROR([libelf, libxdp and libbpf are required for XDP support])
345371fi
346372
347373# was ebpf build explicitly specified and failed
413439# Configure options for use of DAG cards
414440# Originally borrowed from libpcap, but extended quite a bit :)
415441# More details on how this check works:
416- # http ://wand.net.nz/trac /libtrace/wiki/DAGNotes
442+ # https ://github.com/LibtraceTeam /libtrace/wiki
417443
418444AC_ARG_WITH(dag,
419445 AS_HELP_STRING(--with-dag[=DIR],include DAG live capture support (located in directory DIR, if supplied)),
@@ -539,7 +565,7 @@ if test "$want_numa" != no; then
539565fi
540566
541567# Need libwandder for ETSI live decoding
542- AC_CHECK_LIB(wandder, init_wandder_decoder , have_wandder=1, have_wandder=0)
568+ AC_CHECK_LIB(wandder, wandder_etsili_get_cc_format , have_wandder=1, have_wandder=0)
543569
544570# Checks for various "optional" libraries
545571AC_CHECK_LIB(pthread, pthread_create, have_pthread=1, have_pthread=0)
@@ -878,8 +904,7 @@ LIBS=
878904# For now, the user has to explicitly ask for the LLVM stuff, as it's a bit
879905# rough around the edges :(
880906AC_ARG_WITH([llvm],
881- [AC_HELP_STRING([--with-llvm],
882- [support Just In Time compiler])],
907+ [AS_HELP_STRING([--with-llvm],[support Just In Time compiler])],
883908 use_llvm="yes",
884909 use_llvm="no")
885910JIT=no
921946PKG_CHECK_MODULES(ncurses,ncurses,have_ncurses=yes,have_ncurses=no)
922947
923948AC_ARG_WITH([ncurses],
924- AC_HELP_STRING ([--with-ncurses], [build tracetop (requires ncurses)]))
949+ AS_HELP_STRING ([--with-ncurses],[build tracetop (requires ncurses)]))
925950
926951AS_IF([test "x$with_ncurses" != "xno"],
927952 [AC_SEARCH_LIBS(mvprintw, ncurses, have_ncurses=yes, have_ncurses=no)
@@ -1075,7 +1100,7 @@ else
10751100fi
10761101
10771102reportopt "Compiled with LLVM BPF JIT support" $JIT
1078- reportopt "Compiled with live ETSI LI support (requires libwandder)" $wandder_avail
1103+ reportopt "Compiled with live ETSI LI support (requires libwandder >= 2.0.6 )" $wandder_avail
10791104reportopt "Building man pages/documentation" $libtrace_doxygen
10801105reportopt "Building tracetop (requires libncurses)" $with_ncurses
10811106reportopt "Building traceanon (requires libyaml)" $have_yaml
0 commit comments