aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/Makefile.in10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in
index 216595430..1f07773e9 100644
--- a/src/lib/Makefile.in
+++ b/src/lib/Makefile.in
@@ -19,13 +19,21 @@ RANLIB = ranlib
OBJECTS = $(patsubst protocols/%.c, protocols/%.o, $(wildcard protocols/*.c)) $(patsubst third_party/src/%.c, third_party/src/%.o, $(wildcard third_party/src/*.c)) ndpi_main.o
HEADERS = $(wildcard ../include/*.h)
+NDPI_VERSION_MAJOR = @NDPI_MAJOR@
NDPI_LIB_STATIC = libndpi.a
NDPI_LIB_SHARED_BASE = libndpi.so
NDPI_LIB_SHARED = $(NDPI_LIB_SHARED_BASE).@NDPI_VERSION_SHORT@
NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED)
+ifneq ($(OS),Windows_NT)
+OS := $(shell uname)
+endif
+
ifeq ($(OS),Darwin)
CC=clang
+SONAME_FLAG=
+else
+SONAME_FLAG=-Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR)
endif
all: $(NDPI_LIBS)
@@ -37,7 +45,7 @@ $(NDPI_LIB_STATIC): $(OBJECTS)
$(RANLIB) $@
$(NDPI_LIB_SHARED): $(OBJECTS)
- $(CC) -shared -fPIC -o $@ $(OBJECTS)
+ $(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS)
ln -Ffs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE)
%.o: %.c $(HEADERS) Makefile