From fe88b4bc3f63b2facbede848f6de1c4fb8470a60 Mon Sep 17 00:00:00 2001 From: ImBenji Date: Fri, 29 Aug 2025 16:05:35 +0100 Subject: [PATCH] Use pkg-config flags for nDPI compilation Let pkg-config provide the correct include paths instead of overriding them. --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9b4ea5d..83a6f48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,13 +49,13 @@ RUN echo "=== Searching for nDPI files ===" && \ echo "=== Checking pkg-config ===" && \ pkg-config --cflags libndpi 2>/dev/null || echo "pkg-config failed" -# Fix nDPI compilation with proper linking order and paths +# Fix nDPI compilation using pkg-config output RUN echo "=== Attempting nDPI compilation ===" && \ ldconfig && \ - pkg-config --cflags --libs libndpi && \ + NDPI_FLAGS=$(pkg-config --cflags --libs libndpi) && \ + echo "Using nDPI flags: $NDPI_FLAGS" && \ gcc -o protocol_analyzer protocol_analyzer.c \ - -I/usr/local/include -L/usr/local/lib \ - -lndpi -lpcap -ljson-c -lpthread -lm \ + $NDPI_FLAGS -lpcap -ljson-c -lpthread \ && echo "✅ nDPI compilation successful" \ || (echo "❌ nDPI compilation failed with exit code $?" && exit 1)