aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/0621_nxcompshad_use-correct-library-naming-scheme-on-OS-X.full.patch
blob: 95767c90bf9d607a1e0b7abd07113b91ade1302c (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
56
57
58
59
60
Description: Use the correct library naming scheme on OS X. It differs from other UNIX-based systems.
Author: Clemens Lang <cal@macports.org>
v2: Make sure only the first three digits are used for current_version. (Mihai Moldovan)

--- a/nxcompshad/Makefile.in
+++ b/nxcompshad/Makefile.in
@@ -103,9 +103,18 @@ DEPENDINCLUDES = -I/usr/include/g++ -I/u
 LIBRARY = Xcompshad
 
 LIBNAME    = lib$(LIBRARY)
+ifeq ($(shell uname),Darwin)
+LIBFULL    = lib$(LIBRARY).$(VERSION).dylib
+LIBLOAD    = lib$(LIBRARY).$(LIBVERSION).dylib
+LIBSHARED  = lib$(LIBRARY).dylib
+COMP_VER   = $(shell echo '$(VERSION)' | cut -d '.' -f 1-3)
+LIBFLAGS   = -install_name $(libdir)/$(LIBLOAD) -compatibility_version $(LIBVERSION) -current_version $(COMP_VER)
+else
 LIBFULL    = lib$(LIBRARY).so.$(VERSION)
 LIBLOAD    = lib$(LIBRARY).so.$(LIBVERSION)
 LIBSHARED  = lib$(LIBRARY).so
+LIBFLAGS   =
+endif
 LIBARCHIVE = lib$(LIBRARY).a
 
 MSRC   = Main.c
@@ -146,7 +155,7 @@ all: depend $(LIBFULL) $(LIBLOAD) $(LIBS
 endif
 
 $(LIBFULL):	$(CXXOBJ) $(COBJ)
-		$(CXX) -o $@ $(LDFLAGS) $(CXXOBJ) $(COBJ) $(LIBS) $(EXTRALIBS)
+		$(CXX) -o $@ $(LDFLAGS) $(LIBFLAGS) $(CXXOBJ) $(COBJ) $(LIBS) $(EXTRALIBS)
 
 $(LIBLOAD):	$(LIBFULL)
 		rm -f $(LIBLOAD)
@@ -193,9 +202,9 @@ install.lib: all
 	$(INSTALL_DIR)                          $(DESTDIR)${libdir}
 	$(INSTALL_DIR)                          $(DESTDIR)${includedir}/nx
 	$(INSTALL_DATA) $(LIBFULL)              $(DESTDIR)${libdir}
-	$(INSTALL_LINK) libXcompshad.so.3       $(DESTDIR)${libdir}
-	$(INSTALL_LINK) libXcompshad.so         $(DESTDIR)${libdir}
-	$(INSTALL_DATA) *.a                     $(DESTDIR)${libdir}
+	$(INSTALL_LINK) $(LIBLOAD)              $(DESTDIR)${libdir}
+	$(INSTALL_LINK) $(LIBSHARED)            $(DESTDIR)${libdir}
+	$(INSTALL_DATA) $(LIBARCHIVE)           $(DESTDIR)${libdir}
 	$(INSTALL_DATA) *.h                     $(DESTDIR)${includedir}/nx
 	echo "Running ldconfig tool, this may take a while..." && ldconfig || true
 
@@ -207,9 +216,9 @@ uninstall.bin:
 
 uninstall.lib:
 	$(RM_FILE) $(DESTDIR)${libdir}/$(LIBFULL)
-	$(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.so.3
-	$(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.so
-	$(RM_FILE) $(DESTDIR)${libdir}/libXcompshad.a
+	$(RM_FILE) $(DESTDIR)${libdir}/$(LIBLOAD)
+	$(RM_FILE) $(DESTDIR)${libdir}/$(LIBSHARED)
+	$(RM_FILE) $(DESTDIR)${libdir}/$(LIBARCHIVE)
 	for header in *.h; do $(RM_FILE) $(DESTDIR)${includedir}/nx/$$header; done
 	$(RM_DIR) $(DESTDIR)${libdir}/nx/
 	$(RM_DIR) $(DESTDIR)${includedir}/nx/