aboutsummaryrefslogtreecommitdiff
path: root/libraries/libb64/shared-library.patch
blob: 0cd2bf234f87afc9205f4f9721fc548bac24485f (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
--- src/Makefile~
+++ src/Makefile
@@ -1,4 +1,5 @@
-LIBRARIES = libb64.a
+LIBRARIES = libb64.a libb64.so
+SOVERSION ?= 0
 
 # Build flags (uncomment one)
 #############################
@@ -27,6 +28,15 @@ all: $(TARGETS) #strip
 libb64.a: cencode.o cdecode.o
 	$(AR) $(ARFLAGS) $@ $^
 
+libb64.so.$(SOVERSION): cencode.So cdecode.So
+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,$@ -o $@ $^
+
+%.So: %.c
+	$(CC) -fPIC -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+
+%.so: %.so.$(SOVERSION)
+	ln -fs $< $@
+
 strip:
 	strip $(BINARIES) *.exe