File intel-cmt-cat-dynlib.patch of Package intel-cmt-cat.4747

---
 Makefile |   27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

Index: Makefile
===================================================================
--- Makefile.orig	2016-05-25 14:16:17.498571723 +0200
+++ Makefile	2016-05-25 14:31:15.614000686 +0200
@@ -36,7 +36,14 @@
 ###############################################################################
 
 CC = gcc
-LIBNAME = ./lib/libpqos.a
+
+#use dynamic or static lib
+ifeq ($(SHARED),y)
+LIBNAME = ./lib/libpqos.so
+else
+LIBNAME = ./lib/libpqos.so
+endif
+
 LDFLAGS = -L./lib -lpqos -lpthread -fPIE -z noexecstack -z relro -z now
 CFLAGS = -I./lib \
 	-W -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes \
@@ -70,7 +77,13 @@ endif
 APP = pqos
 HDR = pqos.h
 MAN = pqos.8
+
+#use dynamic or static lib
+ifeq ($(SHARED),y)
+LIB = libpqos.so
+else
 LIB = libpqos.a
+endif
 
 # XXX: modify as desired
 PREFIX ?= /usr/local
@@ -90,10 +103,18 @@ $(LIBNAME):
 	+make -C lib all
 
 install: $(APP) $(MAN) lib/$(LIB) lib/$(HDR)
-	install -D -s $(APP) $(DESTDIR)$(BIN_DIR)/$(APP)
+	install -D $(APP) $(DESTDIR)$(BIN_DIR)/$(APP)
 	install -m 0444 $(MAN) -D $(DESTDIR)$(MAN_DIR)/$(MAN)
 	install -m 0644 lib/$(HDR) -D $(DESTDIR)$(HDR_DIR)/$(HDR)
-	install -m 0644 lib/$(LIB) -D $(DESTDIR)$(LIB_DIR)/$(LIB)
+	install -d $(DESTDIR)$(LIB_DIR)
+ifeq ($(SHARED),y)
+	cp lib/*.so* $(DESTDIR)$(LIB_DIR)/
+	cd $(DESTDIR)$(LIB_DIR)
+	/sbin/ldconfig -n .
+	cd ..
+else
+	install -m 0644 lib/$(LIB) -D $(DESTDIR)$(LIB_DIR)
+endif
 
 uninstall:
 	-rm $(DESTDIR)$(BIN_DIR)/$(APP)
openSUSE Build Service is sponsored by