summaryrefslogtreecommitdiff
path: root/libraries/compface/compface-sharedlib.patch
blob: 856303f8dcd39a37d79bfe932fcbe3dc6d34c5ec (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
--- compface-1.5.2.orig/Makefile.in	2005-10-04 14:59:49.000000000 +0200
+++ compface-1.5.2/Makefile.in	2013-02-28 00:12:27.888027519 +0100
@@ -24,6 +24,7 @@
 EXECUTABLE	= $(BINDIR)/$(NAMEEXE)
 UNEXECUTABLE	= $(BINDIR)/$(UNNAMEEXE)
 LIBNAME		= lib$(NAME).a
+SOLIBNAME	= lib$(NAME).so
 LIBRARY		= $(LIBDIR)/$(LIBNAME)
 MAN1DIR		= $(MANDIR)/man1
 MAN3DIR		= $(MANDIR)/man3
@@ -41,15 +42,16 @@
 CFLAGS		= @CFLAGS@
 DEFS		= @DEFS@ -DHAVE_CONFIG_H
 LDFLAGS		= @LDFLAGS@
+SHLDFLAGS	= -L. -lcompface
 LIBS		= @LIBS@
 
-all:		$(NAMEEXE) $(UNNAMEEXE)
+all:		shared $(NAMEEXE) $(UNNAMEEXE)
 
-$(NAMEEXE) :	cmain.o compface.o $(LIBNAME)
-		$(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME)
+$(NAMEEXE) :	cmain.o compface.o 
+		$(CC) $(LDFLAGS) $(SHLDFLAGS) -o $@ cmain.o compface.o
 
 $(UNNAMEEXE) :	uncmain.o $(LIBNAME)
-		$(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME)
+		$(CC) $(LDFLAGS) $(SHLDFLAGS) -o $@ uncmain.o
 
 $(LIBNAME) :	$(OBJECTS)
 		ar rc $(LIBNAME) $(OBJECTS)
@@ -92,6 +94,14 @@
 		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
 		compress $(NAME).sh
 
+static: $(OBJECTS)
+	ar rc $(LIBNAME) $(OBJECTS)
+	-ranlib $(LIBNAME)
+
+shared:		$(OBJECTS)
+		$(CC) -shared -Wl,-soname,$(SOLIBNAME).1 $(LDFLAGS) -o $(SOLIBNAME).1.5.2 $(OBJECTS)
+		ln -sf $(SOLIBNAME).1.5.2 $(SOLIBNAME)
+
 .c.o:
 	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<