10_libxnvctrl_so_0.diff 2.72 KB
Newer Older
1 2
Author: Andreas Beckmann <debian@abeckmann.de>
Description: build a shared library for libXNVCtrl
3
Bug-Debian: https://bugs.debian.org/666909
4

Andreas Beckmann's avatar
Andreas Beckmann committed
5 6
--- a/src/Makefile
+++ b/src/Makefile
Andreas Beckmann's avatar
Andreas Beckmann committed
7
@@ -113,6 +113,9 @@ endif
Andreas Beckmann's avatar
Andreas Beckmann committed
8
 XNVCTRL_DIR             ?= libXNVCtrl
Andreas Beckmann's avatar
Andreas Beckmann committed
9
 XNVCTRL_MAKEFILE        ?= Makefile
Andreas Beckmann's avatar
Andreas Beckmann committed
10 11
 XNVCTRL_ARCHIVE         ?= $(XNVCTRL_DIR)/libXNVCtrl.a
+XNVCTRL_SHARED          ?= $(XNVCTRL_DIR)/libXNVCtrl.so.0
12 13
+#XNVCTRL_LIB            ?= $(XNVCTRL_ARCHIVE)
+XNVCTRL_LIB             ?= $(XNVCTRL_SHARED)
Andreas Beckmann's avatar
Andreas Beckmann committed
14 15 16
 XCONFIG_PARSER_DIR      ?= XF86Config-parser
 COMMON_UTILS_DIR        ?= common-utils
 COMMON_UNIX_DIR         ?= common-unix
17
@@ -282,9 +285,9 @@ NVIDIA_SETTINGS_install: $(NVIDIA_SETTIN
Andreas Beckmann's avatar
Andreas Beckmann committed
18
 	$(INSTALL) $(INSTALL_BIN_ARGS) $< $(BINDIR)/$(notdir $<)
19
 
Andreas Beckmann's avatar
Andreas Beckmann committed
20 21 22
 $(eval $(call DEBUG_INFO_RULES, $(NVIDIA_SETTINGS)))
-$(NVIDIA_SETTINGS).unstripped: $(OBJS) $(XNVCTRL_ARCHIVE)
+$(NVIDIA_SETTINGS).unstripped: $(OBJS) $(XNVCTRL_LIB)
Andreas Beckmann's avatar
Andreas Beckmann committed
23 24
 	$(call quiet_cmd,LINK) $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \
-	    -rdynamic -o $@ $(OBJS) $(XNVCTRL_ARCHIVE) $(LIBS)
Andreas Beckmann's avatar
Andreas Beckmann committed
25
+	    -rdynamic -o $@ $(OBJS) $(XNVCTRL_LIB) $(LIBS)
26
 
Andreas Beckmann's avatar
Andreas Beckmann committed
27
 $(eval $(call DEBUG_INFO_RULES, $(GTK2LIB)))
Andreas Beckmann's avatar
Andreas Beckmann committed
28
 $(GTK2LIB).unstripped: $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK)
29
@@ -292,7 +295,7 @@ $(GTK2LIB).unstripped: $(GTK2_OBJS) $(XC
30
 	    -o $@ \
Andreas Beckmann's avatar
Andreas Beckmann committed
31
 	    -Wl,-soname -Wl,$(GTK2LIB_SONAME) \
Andreas Beckmann's avatar
Andreas Beckmann committed
32
 	    $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) \
Andreas Beckmann's avatar
Andreas Beckmann committed
33 34 35
-	    $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK2_LIBS)
+	    $(XNVCTRL_LIB) $(LIBS) $(GTK2_LIBS)
 
Andreas Beckmann's avatar
Andreas Beckmann committed
36
 ifdef BUILD_GTK3LIB
Andreas Beckmann's avatar
Andreas Beckmann committed
37
 $(eval $(call DEBUG_INFO_RULES, $(GTK3LIB)))
38
@@ -301,7 +304,7 @@ $(GTK3LIB).unstripped: $(GTK3_OBJS) $(XC
39
 	    -o $@ \
Andreas Beckmann's avatar
Andreas Beckmann committed
40
 	    -Wl,-soname -Wl,$(GTK3LIB_SONAME) \
Andreas Beckmann's avatar
Andreas Beckmann committed
41
 	    $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) \
Andreas Beckmann's avatar
Andreas Beckmann committed
42 43 44 45 46
-	    $(XNVCTRL_ARCHIVE) $(LIBS) $(GTK3_LIBS)
+	    $(XNVCTRL_LIB) $(LIBS) $(GTK3_LIBS)
 endif
 
 # define the rule to build each object file
47 48
@@ -309,7 +312,7 @@ $(foreach src,$(SRC),$(eval $(call DEFIN
 $(foreach src,$(XCP_SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
Andreas Beckmann's avatar
Andreas Beckmann committed
49 50 51 52 53 54 55
 
 # define the rule to build $(XNVCTRL_ARCHIVE)
-$(XNVCTRL_ARCHIVE): build-xnvctrl
+$(XNVCTRL_ARCHIVE) $(XNVCTRL_SHARED): build-xnvctrl
 
 build-xnvctrl:
 	@$(MAKE) -C $(XNVCTRL_DIR) -f $(XNVCTRL_MAKEFILE)
56 57
--- a/src/libXNVCtrl/Makefile
+++ b/src/libXNVCtrl/Makefile
58
@@ -57,13 +57,21 @@ OBJS = $(call BUILD_OBJECT_LIST,$(SRC))
Andreas Beckmann's avatar
Andreas Beckmann committed
59
 .PHONY: clean
60
 
Andreas Beckmann's avatar
Andreas Beckmann committed
61 62
 all: $(LIBXNVCTRL)
+all: libXNVCtrl.so
63
 
Andreas Beckmann's avatar
Andreas Beckmann committed
64 65 66 67
 $(LIBXNVCTRL) : $(OBJS)
 	$(AR) ru $@ $(OBJS)
 
+libXNVCtrl.so: $(OBJS)
68
+	$(RM) $@ $@.*
69
+	$(CC) -shared -Wl,-soname=$@.0 -o $@.0.0.0 $(LDFLAGS) $^ -lXext -lX11
70 71 72
+	ln -s $@.0.0.0 $@.0
+	ln -s $@.0 $@
+
Andreas Beckmann's avatar
Andreas Beckmann committed
73 74
 # define the rule to build each object file
 $(foreach src,$(SRC),$(eval $(call DEFINE_OBJECT_RULE,TARGET,$(src))))
75
 
Andreas Beckmann's avatar
Andreas Beckmann committed
76
 clean:
77
 	rm -rf $(LIBXNVCTRL) *~ \
Andreas Beckmann's avatar
Andreas Beckmann committed
78
 		$(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d
79
+	rm -f libXNVCtrl.so libXNVCtrl.so.*