From c2169b3dca4e9fb1fc77e23873d9c86a048f540c Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Mon, 29 Oct 2018 17:06:58 +0100 Subject: Add command line options to correctly populate the shared object SONAME property. --- src/lib/Makefile.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 216595430..6cbe4437c 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -19,6 +19,7 @@ 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@ @@ -37,7 +38,7 @@ $(NDPI_LIB_STATIC): $(OBJECTS) $(RANLIB) $@ $(NDPI_LIB_SHARED): $(OBJECTS) - $(CC) -shared -fPIC -o $@ $(OBJECTS) + $(CC) -shared -fPIC -Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) -o $@ $(OBJECTS) ln -Ffs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE) %.o: %.c $(HEADERS) Makefile -- cgit v1.2.3 From 023830f5aba7921083d47f250655fac9f65498df Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Mon, 29 Oct 2018 21:24:08 +0100 Subject: Try to fix build on Mac. --- src/lib/Makefile.in | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib') diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 6cbe4437c..3d53f15c4 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -27,6 +27,9 @@ NDPI_LIBS = $(NDPI_LIB_STATIC) $(NDPI_LIB_SHARED) ifeq ($(OS),Darwin) CC=clang +SONAME_FLAG= +else +SONAME_FLAG=-Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) endif all: $(NDPI_LIBS) @@ -38,7 +41,7 @@ $(NDPI_LIB_STATIC): $(OBJECTS) $(RANLIB) $@ $(NDPI_LIB_SHARED): $(OBJECTS) - $(CC) -shared -fPIC -Wl,-soname,$(NDPI_LIB_SHARED_BASE).$(NDPI_VERSION_MAJOR) -o $@ $(OBJECTS) + $(CC) -shared -fPIC $(SONAME_FLAG) -o $@ $(OBJECTS) ln -Ffs $(NDPI_LIB_SHARED) $(NDPI_LIB_SHARED_BASE) %.o: %.c $(HEADERS) Makefile -- cgit v1.2.3 From 00827903efe6ab35197e9b17985150e5d28fe8f8 Mon Sep 17 00:00:00 2001 From: Guido Falsi Date: Mon, 29 Oct 2018 23:15:28 +0100 Subject: The OS variable was not being populated by default. --- src/lib/Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib') diff --git a/src/lib/Makefile.in b/src/lib/Makefile.in index 3d53f15c4..1f07773e9 100644 --- a/src/lib/Makefile.in +++ b/src/lib/Makefile.in @@ -25,6 +25,10 @@ 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= -- cgit v1.2.3