summaryrefslogtreecommitdiff
path: root/community/libxnvctrl/10_libxnvctrl_so_0.diff
blob: 02673675a7c71605623b8dc4283188b2c786e280 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Author: Andreas Beckmann <debian@abeckmann.de>
Description: build a shared library for libXNVCtrl
Bug-Debian: http://bugs.debian.org/666909

--- a/src/Makefile
+++ b/src/Makefile
@@ -79,6 +79,9 @@
 
 XNVCTRL_DIR             ?= libXNVCtrl
 XNVCTRL_ARCHIVE         ?= $(XNVCTRL_DIR)/libXNVCtrl.a
+XNVCTRL_SHARED          ?= $(XNVCTRL_DIR)/libXNVCtrl.so.0
+#XNVCTRL_LIB            ?= $(XNVCTRL_ARCHIVE)
+XNVCTRL_LIB             ?= $(XNVCTRL_SHARED)
 XCONFIG_PARSER_DIR      ?= XF86Config-parser
 COMMON_UTILS_DIR        ?= common-utils
 COMMON_UNIX_DIR         ?= common-unix
@@ -179,9 +182,12 @@
 	$(MKDIR) $(BINDIR)
 	$(INSTALL) $(INSTALL_BIN_ARGS) $< $(BINDIR)/$(notdir $<)
 
-$(NVIDIA_SETTINGS): $(OBJS) $(XNVCTRL_ARCHIVE)
+$(XNVCTRL_ARCHIVE) $(XNVCTRL_SHARED):
+	$(MAKE) -C $(XNVCTRL_DIR)
+
+$(NVIDIA_SETTINGS): $(OBJS) $(XNVCTRL_LIB)
 	$(call quiet_cmd,LINK) $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) -o $@ $(OBJS) \
-	    $(XNVCTRL_ARCHIVE) $(LIBS)
+	    $(XNVCTRL_LIB) $(LIBS)
 	$(call quiet_cmd,STRIP_CMD) $@
 
 # define the rule to build each object file
--- a/src/libXNVCtrl/Makefile
+++ b/src/libXNVCtrl/Makefile
@@ -22,12 +22,21 @@
 RANLIB ?= ranlib
 CFLAGS += -fPIC
 
+all: libXNVCtrl.a libXNVCtrl.so
+
 libXNVCtrl.a : libXNVCtrl.a(NVCtrl.o)
 	$(RANLIB) $@
 
+libXNVCtrl.so: NVCtrl.o
+	$(RM) $@ $@.*
+	$(CC) -shared -Wl,-soname=$@.0 -o $@.0.0.0 $(LDFLAGS) $^ -lXext -lX11
+	ln -s $@.0.0.0 $@.0
+	ln -s $@.0 $@
+
 NVCtrl.o : NVCtrl.h nv_control.h NVCtrlLib.h
 .INTERMEDIATE: NVCtrl.o
 
 clean ::
 	rm -f libXNVCtrl.a *.o
+	rm -f libXNVCtrl.so libXNVCtrl.so.*
 .PHONY: clean