aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuca Deri <lucaderi@users.noreply.github.com>2018-11-01 09:20:05 +0100
committerGitHub <noreply@github.com>2018-11-01 09:20:05 +0100
commitde37d08c241d2dec47e7e11e2f80a9516399f49f (patch)
treef3bbe93087b498c7c2a87645526affc6f47583bb /src
parent01444f79e1a780259090a68fbdb73eacfacd5d5b (diff)
parent00827903efe6ab35197e9b17985150e5d28fe8f8 (diff)
Merge pull request #632 from madpilot78/Add_SONAME
Add SONAME property to shared library
Diffstat (limited to 'src')
-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