summarylogtreecommitdiffstats
path: root/nvidia-settings-libxnvctrl_so.patch
blob: 70043f0c212512b9c93a00265030167c48c1a947 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
diff --git a/src/Makefile b/src/Makefile
index 68eb140..6d0aab8 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -345,7 +345,7 @@ endif
 
 ifdef BUILD_GTK3LIB
 $(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
-$(GTK3LIB).unstripped: $(LIBXNVCTRL) $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
+$(GTK3LIB).unstripped: $(LIBXNVCTRL) $(LIBXNVCTRL_SHARED) $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
 	$(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS)  $(BIN_LDFLAGS) \
 	    $(LIBXNVCTRL) $(LIBS) $(GTK3_LIBS) \
 	    -Wl,--unresolved-symbols=ignore-all -o $@ \
diff --git a/src/libXNVCtrl/xnvctrl.mk b/src/libXNVCtrl/xnvctrl.mk
index e6be2ef..c0921c4 100644
--- a/src/libXNVCtrl/xnvctrl.mk
+++ b/src/libXNVCtrl/xnvctrl.mk
@@ -39,6 +39,11 @@ XNVCTRL_CFLAGS ?=
 
 LIBXNVCTRL = $(OUTPUTDIR)/libXNVCtrl.a
 
+LIBXNVCTRL_SHARED = $(OUTPUTDIR)/libXNVCtrl.so
+LIBXNVCTRL_ABI_VERSION_MAJOR = 0
+LIBXNVCTRL_ABI_VERSION_MINOR = 0
+LIBXNVCTRL_LIBS += -lXext -lX11
+
 LIBXNVCTRL_SRC = $(XNVCTRL_DIR)/NVCtrl.c
 
 LIBXNVCTRL_OBJ = $(call BUILD_OBJECT_LIST,$(LIBXNVCTRL_SRC))
@@ -47,3 +52,8 @@ $(eval $(call DEFINE_OBJECT_RULE,TARGET,$(LIBXNVCTRL_SRC)))
 
 $(LIBXNVCTRL) : $(LIBXNVCTRL_OBJ)
 	$(call quiet_cmd,AR) ru $@ $(LIBXNVCTRL_OBJ)
+
+$(LIBXNVCTRL_SHARED) : $(LIBXNVCTRL_OBJ)
+	$(CC) -shared $(CFLAGS) $(LDFLAGS) -Wl,-soname=$(notdir $@).${LIBXNVCTRL_ABI_VERSION_MAJOR} -o $@.$(LIBXNVCTRL_ABI_VERSION_MAJOR).$(LIBXNVCTRL_ABI_VERSION_MINOR).0 $^ $(LIBXNVCTRL_LIBS)
+	ln -s $(notdir $@).$(LIBXNVCTRL_ABI_VERSION_MAJOR).$(LIBXNVCTRL_ABI_VERSION_MINOR).0 $@
+	ln -s $(notdir $@).$(LIBXNVCTRL_ABI_VERSION_MAJOR).$(LIBXNVCTRL_ABI_VERSION_MINOR).0 $@.$(LIBXNVCTRL_ABI_VERSION_MAJOR)