aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-09-18 19:08:56 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-09-18 19:46:07 +0200
commitbcce12266571d419c5d6342539e27e29ec54132d (patch)
treeb621adaefe1253414cedb705e1824c307b9b9eb4
parent4c776501a652fc8b90fdf8098a20c5099b0fcfce (diff)
Fixed mingw build w/o examples/tests/fuzzer.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--configure.seed2
-rw-r--r--example/Makefile.in9
-rw-r--r--src/lib/Makefile.in6
3 files changed, 17 insertions, 0 deletions
diff --git a/configure.seed b/configure.seed
index bf1260fd3..fa24b1917 100644
--- a/configure.seed
+++ b/configure.seed
@@ -107,6 +107,7 @@ case "$host" in
*-*-mingw32*|*-*-msys)
CFLAGS="${CFLAGS} -DOS_WIN32"
LDFLAGS="${LDFLAGS} -lws2_32 -lucrtbase"
+ BUILD_MINGW=1
;;
*)
if test -f $PCAP_HOME/libpcap/libpcap.a; then :
@@ -205,4 +206,5 @@ AC_SUBST(HAVE_PTHREAD_SETAFFINITY_NP)
AC_SUBST(CUSTOM_NDPI)
AC_SUBST(NDPI_API_VERSION)
AC_SUBST(EXTRA_TARGETS)
+AC_SUBST(BUILD_MINGW)
AC_OUTPUT
diff --git a/example/Makefile.in b/example/Makefile.in
index 32e36677d..e0dc34b95 100644
--- a/example/Makefile.in
+++ b/example/Makefile.in
@@ -1,5 +1,6 @@
CC=@CC@
CXX=@CXX@
+BUILD_MINGW=@BUILD_MINGW@
SRCHOME=../src
CFLAGS=-g -fPIC -DPIC -I$(SRCHOME)/include @CFLAGS@
LIBNDPI=$(SRCHOME)/lib/libndpi.a
@@ -9,6 +10,12 @@ HEADERS=intrusion_detection.h reader_util.h $(SRCHOME)/include/ndpi_api.h \
OBJS=ndpiReader.o reader_util.o intrusion_detection.o
PREFIX?=@prefix@
+ifneq ($(BUILD_MINGW),)
+all:
+ @echo 'Examples disabled due to mingw build.'
+
+else
+
all: ndpiReader @DPDK_TARGET@
EXECUTABLE_SOURCES := ndpiReader.c ndpiSimpleIntegration.c
@@ -50,3 +57,5 @@ clean:
distclean: clean
/bin/rm -f Makefile.dpdk
/bin/rm -f Makefile
+
+endif
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 09e1a7d09..902941d26 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -29,13 +29,19 @@ NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
ifneq ($(OS),Windows_NT)
OS := $(shell uname)
endif
+BUILD_MINGW = @BUILD_MINGW@
ifeq ($(OS),Darwin)
CC=clang
SONAME_FLAG=
else
+ifneq ($(BUILD_MINGW),)
+NDPI_LIB_SHARED_BASE = libndpi
+NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE)-@NDPI_VERSION_SHORT@.dll
+else
SONAME_FLAG=-Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR)
endif
+endif
all: $(NDPI_LIBS)