summaryrefslogtreecommitdiff
path: root/media-libs/openctm/files/openctm-1.0.3-create-lib-with-correct-soname-and-symlinks.patch
blob: 6b91f43aff7bbd425f5a9dc82d74291d2f5c7d9a (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
--- a/lib/Makefile.linux
+++ b/lib/Makefile.linux
@@ -33,7 +33,11 @@
 RM = rm -f
 DEPEND = $(CPP) -MM

-DYNAMICLIB = libopenctm.so
+VERSION = 1.0.3
+SOVERSION = 1
+LIBNAME = libopenctm.so
+SONAME = $(LIBNAME).$(SOVERSION)
+DYNAMICLIB = $(LIBNAME).$(VERSION)

 OBJS = openctm.o \
        stream.o \
@@ -64,10 +68,12 @@
 all: $(DYNAMICLIB)

 clean:
-	$(RM) $(DYNAMICLIB) $(OBJS) $(LZMA_OBJS)
+	$(RM) $(DYNAMICLIB) $(SONAME) $(LIBNAME) $(OBJS) $(LZMA_OBJS)

 $(DYNAMICLIB): $(OBJS) $(LZMA_OBJS)
-	gcc -shared -s -Wl,-soname,$@ -o $@ $(OBJS) $(LZMA_OBJS) -lm
+	gcc -shared -s -Wl,-soname,$(SONAME) -o $@ $(OBJS) $(LZMA_OBJS) -lm
+	ln -s $(DYNAMICLIB) $(SONAME)
+	ln -s $(DYNAMICLIB) $(LIBNAME)

 %.o: %.c
 	$(CC) $(CFLAGS) $<