summaryrefslogtreecommitdiff
path: root/multimedia/libmatroska/patches/patch-ac
blob: 2c7352c151251ad239c2cf8ec157c3cfef2d2f1e (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
$NetBSD: patch-ac,v 1.8 2007/11/14 18:27:48 drochner Exp $

--- make/linux/Makefile.orig	2006-06-02 16:32:52.000000000 +0200
+++ make/linux/Makefile
@@ -16,15 +16,15 @@ prefix=/boot/home/config
 else
 prefix=/usr/local
 endif
-libdir=$(prefix)/lib
-includedir=$(prefix)/include/matroska
+libdir=$(PREFIX)/lib
+includedir=$(PREFIX)/include/matroska
 
 # Programs
-CXX=g++
+#CXX=g++
 LD=$(CXX)
-AR = ar rcvu
-RANLIB = ranlib
-INSTALL = install
+AR += rcvu
+#RANLIB = ranlib
+INSTALL = $(BSD_INSTALL)
 INSTALL_OPTS = -m 644
 INSTALL_OPTS_LIB = -m 644
 INSTALL_DIR_OPTS = -m 755
@@ -56,7 +56,7 @@ MUX_LIBS=-lmatroska -lebml $(LIBICONV)
 
 # Names
 LIBRARY=libmatroska.a
-LIBRARY_SO=libmatroska.so
+LIBRARY_SO=libmatroska.la
 LIBRARY_SO_VER=libmatroska.so.0
 
 # source-files
@@ -95,16 +95,14 @@ lib:
 	$(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
 %.lo: %$(EXTENSION)
-	$(CXX) -c $(COMPILEFLAGS) -fPIC -o $@ $<
+	$(LIBTOOL) --mode=compile $(CXX) -c $(COMPILEFLAGS) -o $@ $<
 
 $(LIBRARY): $(objects)
 	$(AR) $@ $(objects)
 	$(RANLIB) $@
 
 $(LIBRARY_SO): $(objects_so)
-	$(CXX) -shared -Wl,-soname,$(LIBRARY_SO_VER) -o $(LIBRARY_SO_VER) $(objects_so) -lebml
-	rm -f $(LIBRARY_SO)
-	ln -s $(LIBRARY_SO_VER) $(LIBRARY_SO)
+	$(LIBTOOL) --mode=link $(CXX) -o $(LIBRARY_SO) $(objects_so) -lebml -rpath $(PREFIX)/lib -version-info 0
 
 clean:	cleantest
 	rm -f $(objects) $(objects_so)
@@ -156,23 +154,22 @@ install: install_staticlib install_share
 endif
 
 install_headers:
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(includedir)
 	for i in $(INCLUDE_DIR)/*.h; do \
-		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir) ; \
+		$(INSTALL) $(INSTALL_OPTS) $$i $(DESTDIR)$(includedir) ; \
 	done
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(includedir)/c
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(includedir)/c
 	for i in $(INCLUDE_DIR)/c/*.h; do \
-		$(INSTALL) $(INSTALL_OPTS) $$i $(includedir)/c ; \
+		$(INSTALL) $(INSTALL_OPTS) $$i $(DESTDIR)$(includedir)/c ; \
 	done
 
 install_staticlib: $(LIBRARY)
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
-	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(libdir)
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(libdir)
+	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY) $(DESTDIR)$(libdir)
 
 install_sharedlib: $(LIBRARY_SO)
-	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(libdir)
-	$(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO_VER) $(libdir)
-	ln -fs $(LIBRARY_SO_VER) $(libdir)/$(LIBRARY_SO)
+	$(INSTALL) $(INSTALL_DIR_OPTS) -d $(DESTDIR)$(libdir)
+	$(LIBTOOL) --mode=install $(INSTALL) $(INSTALL_OPTS_LIB) $(LIBRARY_SO) $(DESTDIR)$(libdir)
 
 ifneq ($(wildcard .depend),)
 include .depend