appneta / tcpreplay

Pcap editing and replay tools for *NIX and Windows - Users please download source from
http://tcpreplay.appneta.com/wiki/installation.html#downloads
1.15k stars 268 forks source link

configure: error: Unable to link libpcap in pfring #752

Closed seventrees closed 1 year ago

seventrees commented 1 year ago

Hi! I want to compile the tcpreplay-4.4.2 with pfring, ./configure --with-libpcap=/usr/src/PF_RING-8.2.0/userland/libpcap --with-pfring-lib=/opt/pfring/lib/libpfring.a but it always failed configure: error: Unable to link libpcap in /usr/src/PF_RING-8.2.0/userland/libpcap The procedure for installing pfring is as follows:

cd /usr/src
tar xvzf PF_RING-8.2.0.tar.gz
cd PF_RING-8.2.0/userland/lib
./configure --prefix=/opt/pfring
make install

#
cd ../libpcap
./configure --prefix=/opt/pfring
make install

#
cd ../tcpdump
./configure --prefix=/opt/pfring
make install

#
cd ../../kernel
make
make install

#
modprobe pf_ring enable_tx_capture=0 min_num_slots=32768
fklassen commented 1 year ago

You got the instructions mostly right, except that --with-libpcap should be pointing to the libpcap install directory rather than the source.

I have #750 fix applied in my 4.4.3 Beta1 sandbox, which prevents false positives on version detection. Then I followed your instructions, except I didn't run make install in the kernel directory. I am able to build:

./configure --with-libpcap=/opt/pfring --with-pfring-lib=/opt/pfring/lib/libpfring.a --disable-local-libopts
checking whether to enable maintainer-specific portions of Makefiles... yes
checking if malloc debugging is wanted... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for cygwin development environment... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking whether make supports the include directive... yes (GNU style)
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking for gawk... (cached) gawk
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking whether make sets $(MAKE)... (cached) yes
checking for printf... /usr/bin/printf
checking for echo... /usr/bin/echo
checking for cut... /usr/bin/cut
checking for autogen... /usr/bin/autogen
checking for groff... /usr/bin/groff
checking for depmod... /sbin/depmod
checking for insmod... /sbin/insmod
checking for rmmod... /sbin/rmmod
checking for autogen version >= 5.18.16... yes
configure: Using system libopts
checking for egrep... (cached) /usr/bin/grep -E
checking whether sys/types.h defines makedev... no
checking sys/mkdev.h usability... no
checking sys/mkdev.h presence... no
checking for sys/mkdev.h... no
checking sys/sysmacros.h usability... yes
checking sys/sysmacros.h presence... yes
checking for sys/sysmacros.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for off_t... yes
checking for pid_t... yes
checking for size_t... yes
checking for ssize_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for sys/param.h... yes
checking for an ANSI C-conforming const... yes
checking for inline... (cached) inline
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for u_int8_t... yes
checking for u_int16_t... yes
checking for u_int32_t... yes
checking for u_int64_t... yes
checking for gcc -Wextra support... yes
checking for gcc -Wno-variadic-macros support... yes
checking for gcc -Wfatal-errors support... yes
checking for gcc -Wno-format-contains-nul support... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking for sys/time.h... (cached) yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for stdint.h... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking sys/poll.h usability... yes
checking sys/poll.h presence... yes
checking for sys/poll.h... yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for inttypes.h... (cached) yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/systeminfo.h usability... no
checking sys/systeminfo.h presence... no
checking for sys/systeminfo.h... no
checking sys/io.h usability... yes
checking sys/io.h presence... yes
checking for sys/io.h... yes
checking architecture/i386/pio.h usability... no
checking architecture/i386/pio.h presence... no
checking for architecture/i386/pio.h... no
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking fts.h usability... yes
checking fts.h presence... yes
checking for fts.h... yes
checking for stdbool.h that conforms to C99... (cached) yes
checking for _Bool... (cached) yes
checking for sys/sysctl.h... yes
checking for net/route.h... yes
checking for socket in -lsocket... no
checking for gethostbyname in -lnsl... yes
checking for nanosleep in -lrt... yes
checking for resolv in -lresolv... no
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking whether lstat correctly handles trailing slash... yes
checking for working memcmp... yes
checking for vprintf... yes
checking for _doprnt... no
checking whether time.h and sys/time.h may both be included... yes
checking for alarm... yes
checking for working mktime... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for struct timeval.tv_sec... yes
checking for alarm... (cached) yes
checking for atexit... yes
checking for bzero... yes
checking for dup2... yes
checking for gethostbyname... yes
checking for getpagesize... (cached) yes
checking for gettimeofday... yes
checking for ctime... yes
checking for inet_ntoa... yes
checking for memmove... yes
checking for memset... yes
checking for munmap... yes
checking for pow... no
checking for putenv... yes
checking for realpath... yes
checking for regcomp... yes
checking for strdup... yes
checking for select... yes
checking for socket... yes
checking for strcasecmp... yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... (cached) yes
checking for strerror... yes
checking for strtol... yes
checking for strncpy... yes
checking for strtoull... yes
checking for poll... yes
checking for ntohll... no
checking for mmap... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for strsignal... yes
checking for strpbrk... yes
checking for strrchr... yes
checking for strspn... yes
checking for strstr... yes
checking for strtoul... yes
checking for ioperm... yes
checking for strlcpy... no
checking whether byte ordering is bigendian... no
configure: Bypassing libpcap discovery via pcap_config
configure: Using u_int64_t for packet counters
checking for inet_aton... yes
checking for inet_pton... yes
checking for inet_ntop... yes
checking for inet_addr... yes
checking linux/if_tun.h usability... yes
checking linux/if_tun.h presence... yes
checking for linux/if_tun.h... yes
checking for libpcap... /opt/pfring
checking for library containing nl_handle_alloc... no
checking for nl_cache_alloc in -lnl... no
checking for genl_connect in -lnl-genl-3... no
checking for nl_cache_alloc in -lnl-3... no
checking for dbus_malloc in -ldbus-1... no
checking for numa_available in -lnuma... yes
checking for pthread_create in -lpthread... yes
checking for library containing pcap_get_pfring_id... none required
checking for library containing pcap_close... none required
checking libpcap version... 1.9.1
checking for valid libpcap version... ok
checking for pcap_setnonblock... yes
checking for pcap_datalink_val_to_description... yes
checking for pcap_get_selectable_fd... yes
checking for pcap_dump_fopen... yes
checking for pcap_inject sending support... yes
checking for pcap_sendpacket sending support... yes
checking for pcap_breakloop... no
checking for pcap_version... yes
checking for pcap_snapshot... yes
configure: Building tcpbridge
configure: Building tcpliveplay
checking for netmap socket sending support... no
checking for PF_PACKET socket sending support... yes
checking for TX_RING socket sending support... no
checking net/bpf.h usability... no
checking net/bpf.h presence... no
checking for net/bpf.h... no
checking for libdnet... no
configure: WARNING: libdnet not found, disabling fragroute feature
checking for DLT_LINUX_SLL in libpcap... yes
checking for DLT_C_HDLC in libpcap... yes
checking for /opt/pfring/pcap-bpf.h... no
checking for libpcap bpf header... no
checking for netmap libpcap... no
checking for pcapnav-config... no 
checking for requires strict byte alignment... no
checking for tcpdump... no
configure: WARNING: Unable to find tcpdump.  Please specify --with-tcpdump.
                 Disabling --verbose
configure: WARNING: Your version of libpcap does not support --verbose
checking for 'make test' profile... yes
checking for OS version... Linux
configure: Using eth0 for 1st test network interface card
configure: Using eth0 for 2nd test network interface card
checking if it's ok to use pcap_findalldevs()... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for sys/param.h... (cached) yes
checking for sys/poll.h... (cached) yes
checking sys/procset.h usability... no
checking sys/procset.h presence... no
checking for sys/procset.h... no
checking for sys/select.h... (cached) yes
checking for sys/socket.h... (cached) yes
checking sys/stropts.h usability... yes
checking sys/stropts.h presence... yes
checking for sys/stropts.h... yes
checking for sys/time.h... (cached) yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking for dlfcn.h... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking for fcntl.h... (cached) yes
checking libgen.h usability... yes
checking libgen.h presence... yes
checking for libgen.h... yes
checking for libintl.h... (cached) yes
checking for memory.h... (cached) yes
checking for netinet/in.h... (cached) yes
checking setjmp.h usability... yes
checking setjmp.h presence... yes
checking for setjmp.h... yes
checking for stdbool.h... (cached) yes
checking sysexits.h usability... yes
checking sysexits.h presence... yes
checking for sysexits.h... yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking for string.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for inttypes.h... (cached) yes
checking for working stdnoreturn.h... yes
checking for runetype.h... no
checking for wchar.h... yes
checking for wchar_t... yes
checking for wint_t... yes
checking for int8_t... yes
checking for uint8_t... yes
checking for int16_t... yes
checking for uint16_t... yes
checking for int32_t... yes
checking for uint32_t... yes
checking for intptr_t... yes
checking for uintptr_t... yes
checking for uint_t... no
checking for pid_t... (cached) yes
checking for size_t... (cached) yes
checking for ptrdiff_t... yes
checking size of char *... 8
checking size of int... 4
checking size of long... 8
checking size of short... 2
checking for pathfind in -lgen... no
checking for gettext in -lintl... no
checking for vprintf... (cached) yes
checking for _doprnt... (cached) no
checking for vfork.h... (cached) no
checking for fork... (cached) yes
checking for vfork... (cached) yes
checking for working fork... (cached) yes
checking for working vfork... (cached) yes
checking for mmap... (cached) yes
checking for canonicalize_file_name... yes
checking for snprintf... (cached) yes
checking for strdup... (cached) yes
checking for strchr... (cached) yes
checking for strrchr... (cached) yes
checking for strsignal... (cached) yes
checking for fchmod... yes
checking for fstat... yes
checking for chmod... yes
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking whether autoopts-config can be found... checking whether autoopts-config is specified... autoopts-config
 -lopts
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating libopts/Makefile
config.status: creating Makefile
config.status: creating doxygen.cfg
config.status: creating lib/Makefile
config.status: creating docs/Makefile
config.status: creating src/Makefile
config.status: creating src/tcpedit/Makefile
config.status: creating src/fragroute/Makefile
config.status: creating src/common/Makefile
config.status: creating src/defines.h
config.status: creating test/Makefile
config.status: creating test/config
config.status: creating scripts/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

##########################################################################
             TCPREPLAY Suite Configuration Results (4.4.3-Beta1)
##########################################################################
libpcap:                    /opt/pfring (1.9.1)
PF_RING libpcap             yes   /opt/pfring/lib/libpfring.a
libdnet:                    no   
autogen:                    /usr/bin/autogen (5.18.12)
Use libopts tearoff:        no
64bit counter support:      yes
tcpdump binary path:        no
fragroute support:          no
tcpbridge support:          yes
tcpliveplay support:        yes

Supported Packet Injection Methods (*):
Linux TX_RING:              no
Linux PF_PACKET:            yes
BSD BPF:                    no
libdnet:                    no
pcap_inject:                yes
pcap_sendpacket:            yes **
pcap_netmap                 no
Linux/BSD netmap:           no
Tuntap device support:      yes

* In order of preference; see configure --help to override
** Required for tcpbridge