summaryrefslogtreecommitdiff
path: root/extra/compface/compface-1.5.2-build.patch
blob: b86cdb881acc85925ed4c4c398b24b9901711ecf (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
o Build shared library, link tools against it
o Make it possible to prevent stripping
o Add DESTDIR support

--- Makefile.in~	2005-10-04 15:59:49.000000000 +0300
+++ Makefile.in	2006-08-02 22:23:07.000000000 +0300
@@ -15,6 +15,7 @@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA    = @INSTALL_DATA@
 SHELL           = /bin/sh
+STRIP           = strip
 
 NAME		= compface
 UNNAME		= uncompface
@@ -25,6 +26,7 @@
 UNEXECUTABLE	= $(BINDIR)/$(UNNAMEEXE)
 LIBNAME		= lib$(NAME).a
 LIBRARY		= $(LIBDIR)/$(LIBNAME)
+SHLIBNAME	= lib$(NAME).so
 MAN1DIR		= $(MANDIR)/man1
 MAN3DIR		= $(MANDIR)/man3
 OBJECTS		= arith.o file.o compress.o gen.o uncompface.o
@@ -45,11 +47,11 @@
 
 all:		$(NAMEEXE) $(UNNAMEEXE)
 
-$(NAMEEXE) :	cmain.o compface.o $(LIBNAME)
-		$(CC) $(LDFLAGS) -o $@ cmain.o compface.o $(LIBNAME)
+$(NAMEEXE) :	cmain.o compface.o $(SHLIBNAME)
+		$(CC) $(LDFLAGS) -o $@ cmain.o compface.o -L. -l$(NAME)
 
-$(UNNAMEEXE) :	uncmain.o $(LIBNAME)
-		$(CC) $(LDFLAGS) -o $@ uncmain.o $(LIBNAME)
+$(UNNAMEEXE) :	uncmain.o $(SHLIBNAME)
+		$(CC) $(LDFLAGS) -o $@ uncmain.o -L. -l$(NAME)
 
 $(LIBNAME) :	$(OBJECTS)
 		ar rc $(LIBNAME) $(OBJECTS)
@@ -73,25 +75,28 @@
 		tar chzf `cat .fname`.tar.gz `cat .fname`
 		$(RM) -rf `cat .fname` .fname
 
-install: 	$(NAMEEXE) $(UNNAMEEXE) $(LIBNAME)
-		$(INSTALL_PROGRAM) -d $(BINDIR) $(LIBDIR) $(MAN1DIR) $(MAN3DIR) $(INCLUDEDIR)
-		$(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(EXECUTABLE) 
-		-chmod 0755 $(EXECUTABLE)
-		-strip $(EXECUTABLE)
-		$(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(UNEXECUTABLE)
-		-chmod 0755 $(UNEXECUTABLE)
-		-strip $(UNEXECUTABLE)
-		$(INSTALL_DATA) $(srcdir)/$(NAME).1 $(MAN1DIR)/$(NAME).1
-		cd $(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1
-		$(INSTALL_DATA) $(srcdir)/$(NAME).3 $(MAN3DIR)/$(NAME).3
-		cd $(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3
-		for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(INCLUDEDIR)/$${hdr}; done
-		$(INSTALL_DATA) $(srcdir)/$(LIBNAME) $(LIBRARY)
+install: 	$(NAMEEXE) $(UNNAMEEXE) $(SHLIBNAME)
+		$(INSTALL_PROGRAM) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) $(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INCLUDEDIR)
+		$(INSTALL_PROGRAM) $(srcdir)/$(NAMEEXE) $(DESTDIR)$(EXECUTABLE) 
+		-$(STRIP) $(DESTDIR)$(EXECUTABLE)
+		$(INSTALL_PROGRAM) $(srcdir)/$(UNNAMEEXE) $(DESTDIR)$(UNEXECUTABLE)
+		-$(STRIP) $(DESTDIR)$(UNEXECUTABLE)
+		$(INSTALL_DATA) $(srcdir)/$(NAME).1 $(DESTDIR)$(MAN1DIR)/$(NAME).1
+		cd $(DESTDIR)$(MAN1DIR) && $(RM) ./$(UNNAME).1 && $(LN_S) $(NAME).1 $(UNNAME).1
+		$(INSTALL_DATA) $(srcdir)/$(NAME).3 $(DESTDIR)$(MAN3DIR)/$(NAME).3
+		cd $(DESTDIR)$(MAN3DIR) && $(RM) ./$(UNNAME).3 && $(LN_S) $(NAME).3 $(UNNAME).3
+		for hdr in $(INSTALLHEADERS); do $(INSTALL_DATA) $(srcdir)/$${hdr} $(DESTDIR)$(INCLUDEDIR)/$${hdr}; done
+		$(INSTALL_PROGRAM) $(srcdir)/$(SHLIBNAME) $(DESTDIR)$(LIBDIR)/$(SHLIBNAME).1.0.0
+		$(LN_S) $(SHLIBNAME).1.0.0 $(DESTDIR)$(LIBDIR)/$(SHLIBNAME).1
+		$(LN_S) $(SHLIBNAME).1 $(DESTDIR)$(LIBDIR)/$(SHLIBNAME)
 
 shar :
 		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
 		compress $(NAME).sh
 
+$(SHLIBNAME): $(OBJECTS)
+	$(CC) -shared -Wl,-soname,$(SHLIBNAME).1 $(LDFLAGS) -o $(SHLIBNAME) $(OBJECTS)
+
 .c.o:
 	$(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $<