ntop / nDPI

Open Source Deep Packet Inspection Software Toolkit
http://www.ntop.org
GNU Lesser General Public License v3.0
3.86k stars 902 forks source link

A compile error occurred while cross-compiling to the mips architecture #2461

Closed hochek closed 6 months ago

hochek commented 6 months ago

When I cross-compile and port to the mips platform (Little Endian), I get errors when executing ./autogen.sh and ./configure . I have defined --host, --target, PCAP_CFLAGS, PCAP_LIBS, and libpcap.a is pre-compiled in the project file. The error is as follows:

./autogen.sh && ./configure --host=mips-linux --target=mips-linux CC=/share/rlx/msdk-10.3.0-mips-EB-5.10-g2.30-m32s-210630/bin/msdk-linux-gcc PCAP_CFLAGS="/mnt/HDD_3/CHEK/PROJECT/user/libpcap" PCAP_LIBS="/mnt/HDD_3/CHEK/PROJECT/user/libpcap"

checking for pthread_mutex_init in -lpthread... no checking DPDK (used by ndpiReader)... no (missing /mnt/HDD_3/CHEK/DPDK) checking for numa_available in -lnuma... no checking PF_RING nBPF (/mnt/HDD_3/CHEK/PROJECT/user/nDPI-flow_info-4/../PF_RING/userland/nbpf)... no checking for pcap_open_live in -lpcap... no configure: error: Missing libpcap(-dev) library required to compile the example application. Makefile:10: recipe for target 'all' failed make[2]: *** [all] Error 1

IvanNardi commented 6 months ago

No sure about MIPS, but try using NDPI_CFLAGS and NDPI_LDFLAGS instead of PCAP_CFLAGS/PCAP_LIBS

hochek commented 6 months ago

No sure about MIPS, but try using NDPI_CFLAGS and NDPI_LDFLAGS instead of PCAP_CFLAGS/PCAP_LIBS

It cannot solve the problems in my project. But I found another temporary solution: Modify the "configure" file, where like ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' such a definition, and I add the $PCAP_LIBS inside it, like this: ac_link='$CC -o conftest$ac_exeext $PCAP_LIBS $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'