Use pkg-config flags for nDPI compilation
Let pkg-config provide the correct include paths instead of overriding them.
This commit is contained in:
@@ -49,13 +49,13 @@ RUN echo "=== Searching for nDPI files ===" && \
|
|||||||
echo "=== Checking pkg-config ===" && \
|
echo "=== Checking pkg-config ===" && \
|
||||||
pkg-config --cflags libndpi 2>/dev/null || echo "pkg-config failed"
|
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 ===" && \
|
RUN echo "=== Attempting nDPI compilation ===" && \
|
||||||
ldconfig && \
|
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 \
|
gcc -o protocol_analyzer protocol_analyzer.c \
|
||||||
-I/usr/local/include -L/usr/local/lib \
|
$NDPI_FLAGS -lpcap -ljson-c -lpthread \
|
||||||
-lndpi -lpcap -ljson-c -lpthread -lm \
|
|
||||||
&& echo "✅ nDPI compilation successful" \
|
&& echo "✅ nDPI compilation successful" \
|
||||||
|| (echo "❌ nDPI compilation failed with exit code $?" && exit 1)
|
|| (echo "❌ nDPI compilation failed with exit code $?" && exit 1)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user