diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2024-03-20 14:36:25 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2024-03-20 14:55:09 +0100 |
commit | 675640b0e647ff2084d973b5d3f302b3a6f978bf (patch) | |
tree | a85bf7fb5a613f355e3527886232e4d0a410495f | |
parent | 5e5f268b3ca75f0c1ee9d33211cf327c8412b4be (diff) |
Fixed libpcre2 build.
* CI: build against libpcre2 / libmaxminddb
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | .github/workflows/build.yml | 18 | ||||
-rw-r--r-- | CMakeLists.txt | 10 |
2 files changed, 21 insertions, 7 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90a51318a..789bb644d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER=OFF -DENABLE_SANITIZER_THREAD=OFF" coverage: "-DENABLE_COVERAGE=OFF" poll: "-DFORCE_POLL=OFF" @@ -46,6 +47,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=ON" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "-DNDPI_WITH_MAXMINDDB=ON -DNDPI_WITH_PCRE=ON" sanitizer: "-DENABLE_SANITIZER=OFF -DENABLE_SANITIZER_THREAD=OFF" coverage: "-DENABLE_COVERAGE=OFF" poll: "-DFORCE_POLL=OFF" @@ -58,6 +60,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=OFF" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER=OFF -DENABLE_SANITIZER_THREAD=OFF" coverage: "-DENABLE_COVERAGE=OFF" poll: "-DFORCE_POLL=OFF" @@ -70,6 +73,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER=ON" coverage: "-DENABLE_COVERAGE=ON" poll: "-DFORCE_POLL=ON" @@ -81,6 +85,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER=ON" coverage: "-DENABLE_COVERAGE=OFF" poll: "-DFORCE_POLL=OFF" @@ -92,6 +97,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER_THREAD=ON" coverage: "-DENABLE_COVERAGE=OFF" poll: @@ -103,6 +109,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=OFF" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER=ON" coverage: "-DENABLE_COVERAGE=OFF" poll: "-DFORCE_POLL=ON" @@ -114,6 +121,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=ON" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "" sanitizer: "-DENABLE_SANITIZER=ON" coverage: "-DENABLE_COVERAGE=OFF" poll: "-DFORCE_POLL=OFF" @@ -125,6 +133,7 @@ jobs: ndpid_examples: "-DBUILD_EXAMPLES=OFF" ndpid_gcrypt: "-DNDPI_WITH_GCRYPT=OFF" ndpid_zlib: "-DENABLE_ZLIB=ON" + ndpid_extras: "" examples: "-DBUILD_EXAMPLES=OFF" sanitizer: "-DENABLE_SANITIZER=OFF" coverage: "-DENABLE_COVERAGE=OFF" @@ -144,6 +153,7 @@ jobs: echo '| nDPI min.: ${{ matrix.ndpi_min_version }}' echo '| GCRYPT...: ${{ matrix.ndpid_gcrypt }}' echo '| ZLIB.....: ${{ matrix.ndpid_zlib }}' + echo '| Extras...: ${{ matrix.ndpid_extras }}' echo '| ForcePoll: ${{ matrix.poll }}' echo '|---------------------------------------' echo '| SANITIZER: ${{ matrix.sanitizer }}' @@ -184,10 +194,14 @@ jobs: if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.ndpid_gcrypt, '-DNDPI_WITH_GCRYPT=ON') run: | sudo apt-get install libgcrypt20-dev - - name: Install Ubuntu Prerequisities (zlib) + - name: Install Ubuntu Prerequisites (zlib) if: startsWith(matrix.os, 'ubuntu') && startsWith(matrix.ndpid_zlib, '-DENABLE_ZLIB=ON') run: | sudo apt-get install zlib1g-dev + - name: Install Ubuntu Prerequisites (libmaxminddb, libpcre2) + if: startsWith(matrix.ndpid_extras, '-D') + run: | + sudo apt-get install libmaxminddb-dev libpcre2-dev - name: Checking Network Buffer Size run: | C_VAL=$(cat config.h | sed -n 's/^#define\s\+NETWORK_BUFFER_MAX_SIZE\s\+\([0-9]\+\).*$/\1/gp') @@ -198,7 +212,7 @@ jobs: cmake -S . -B build -DCMAKE_C_COMPILER="$CMAKE_C_COMPILER" -DCMAKE_C_FLAGS="$CMAKE_C_FLAGS" -DCMAKE_MODULE_LINKER_FLAGS="$CMAKE_MODULE_LINKER_FLAGS" -DCMAKE_C_EXE_LINKER_FLAGS="$CMAKE_C_EXE_LINKER_FLAGS" \ -DENABLE_CURL=ON -DENABLE_SYSTEMD=ON \ ${{ matrix.poll }} ${{ matrix.coverage }} ${{ matrix.sanitizer }} ${{ matrix.ndpi_build }} \ - ${{ matrix.ndpid_examples }} ${{ matrix.ndpid_zlib }} ${{ matrix.ndpid_gcrypt }} + ${{ matrix.ndpid_examples }} ${{ matrix.ndpid_zlib }} ${{ matrix.ndpid_gcrypt }} ${{ matrix.ndpid_extras }} - name: Build nDPId run: | cmake --build build --verbose diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ae0dda29..a8875fe34 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,7 +186,7 @@ if(NDPI_WITH_GCRYPT) endif() if(NDPI_WITH_PCRE) message(STATUS "nDPI: Enable PCRE") - set(NDPI_ADDITIONAL_ARGS "${NDPI_ADDITIONAL_ARGS} --with-pcre") + set(NDPI_ADDITIONAL_ARGS "${NDPI_ADDITIONAL_ARGS} --with-pcre2") endif() if(NDPI_WITH_MAXMINDDB) message(STATUS "nDPI: Enable MAXMINDDB") @@ -278,7 +278,7 @@ if(STATIC_LIBNDPI_INSTALLDIR OR BUILD_NDPI OR NDPI_NO_PKGCONFIG) endif() if(NDPI_WITH_PCRE) - pkg_check_modules(PCRE REQUIRED libpcre>=8.39) + pkg_check_modules(PCRE REQUIRED libpcre2-8) endif() if(NDPI_WITH_MAXMINDDB) @@ -338,7 +338,7 @@ target_compile_options(nDPId PRIVATE "-pthread") target_compile_definitions(nDPId PRIVATE -D_GNU_SOURCE=1 -DPKG_VERSION=\"${PKG_VERSION}\" -DGIT_VERSION=\"${GIT_VERSION}\" ${NDPID_DEFS} ${EPOLL_DEFS} ${ZLIB_DEFS}) target_include_directories(nDPId PRIVATE "${STATIC_LIBNDPI_INC}" "${DEFAULT_NDPI_INCLUDE}" ${NDPID_DEPS_INC}) target_link_libraries(nDPId "${STATIC_LIBNDPI_LIB}" "${pkgcfg_lib_PCAP_pcap}" "${pkgcfg_lib_NDPI_ndpi}" - "${pkgcfg_lib_PCRE_pcre}" "${pkgcfg_lib_MAXMINDDB_maxminddb}" "${pkgcfg_lib_ZLIB_z}" + "${pkgcfg_lib_PCRE_pcre2-8}" "${pkgcfg_lib_MAXMINDDB_maxminddb}" "${pkgcfg_lib_ZLIB_z}" "${GCRYPT_LIBRARY}" "${GCRYPT_ERROR_LIBRARY}" "${PCAP_LIBRARY}" "${LIBM_LIB}" "-pthread") @@ -352,7 +352,7 @@ target_compile_definitions(nDPId-test PRIVATE -D_GNU_SOURCE=1 -DNO_MAIN=1 -DPKG_ target_include_directories(nDPId-test PRIVATE "${STATIC_LIBNDPI_INC}" "${DEFAULT_NDPI_INCLUDE}" ${NDPID_DEPS_INC}) target_link_libraries(nDPId-test "${STATIC_LIBNDPI_LIB}" "${pkgcfg_lib_PCAP_pcap}" "${pkgcfg_lib_NDPI_ndpi}" - "${pkgcfg_lib_PCRE_pcre}" "${pkgcfg_lib_MAXMINDDB_maxminddb}" "${pkgcfg_lib_ZLIB_z}" + "${pkgcfg_lib_PCRE_pcre2-8}" "${pkgcfg_lib_MAXMINDDB_maxminddb}" "${pkgcfg_lib_ZLIB_z}" "${GCRYPT_LIBRARY}" "${GCRYPT_ERROR_LIBRARY}" "${PCAP_LIBRARY}" "${LIBM_LIB}" "-pthread") @@ -373,7 +373,7 @@ if(BUILD_EXAMPLES) target_include_directories(nDPIsrvd-captured PRIVATE "${STATIC_LIBNDPI_INC}" "${DEFAULT_NDPI_INCLUDE}" "${CMAKE_SOURCE_DIR}" ${NDPID_DEPS_INC}) target_link_libraries(nDPIsrvd-captured "${pkgcfg_lib_PCAP_pcap}" "${pkgcfg_lib_NDPI_ndpi}" - "${pkgcfg_lib_PCRE_pcre}" "${pkgcfg_lib_MAXMINDDB_maxminddb}" + "${pkgcfg_lib_PCRE_pcre2-8}" "${pkgcfg_lib_MAXMINDDB_maxminddb}" "${GCRYPT_LIBRARY}" "${GCRYPT_ERROR_LIBRARY}" "${PCAP_LIBRARY}") add_executable(nDPIsrvd-json-dump examples/c-json-stdout/c-json-stdout.c) |