summaryrefslogtreecommitdiff
path: root/www/cgilib/patches/patch-ab
blob: 9074fb9c63b83dff3eebf431b92329732d3030db (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
$NetBSD: patch-ab,v 1.8 2005/03/14 20:41:19 tv Exp $

--- Makefile.orig	1999-08-20 17:14:07.000000000 -0400
+++ Makefile
@@ -14,25 +14,29 @@
 #   along with this program; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
 
-CFLAGS = -I. -Wall -O2 -g
+CFLAGS += -I. -Wall -O2
 LDFLAGS = -L.
-LIBS = -lcgi
+LIBS = libcgi.la
 
 OBJS = cgi.o cookies.o
 
-libcgi.a: $(OBJS)
-	ar rc $@ $^
+all: libcgi.la cgitest jumpto
 
-cgitest: cgitest.o libcgi.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+.SUFFIXES:	.lo
 
-jumpto: jumpto.o libcgi.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+.c.lo:
+	${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $<
 
-all: libcgi.a cgitest jumpto
+libcgi.la: $(OBJS:.o=.lo)
+	${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \
+		-rpath ${PREFIX}/lib \
+		-version-info 0:0
 
-install: cgitest
-	install -m 755 cgitest /usr/lib/cgi-bin
+cgitest: cgitest.lo libcgi.la
+	${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgitest.lo $(LIBS)
+
+jumpto: jumpto.lo libcgi.la
+	${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ jumpto.lo $(LIBS)
 
 clean:
 	rm -f cgitest cgitest.o jumpto jumpto.o libcgi.a $(OBJS) *.[35].html
@@ -41,3 +45,19 @@ htmlman:
 	for f in *.[35]; do \
 	  man -l $$f|rman -f HTML --title $$f -r "%s.%s.html" > $$f.html; \
 	done
+
+install:
+	${BSD_INSTALL_PROGRAM_DIR} ${PREFIX}/libexec/cgi-bin
+	${BSD_INSTALL_DATA_DIR} ${PREFIX}/share/examples/cgilib
+	${BSD_INSTALL_DATA} cgitest.c ${PREFIX}/share/examples/cgilib
+	${BSD_INSTALL_DATA} jumpto.c ${PREFIX}/share/examples/cgilib
+	${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} libcgi.la ${PREFIX}/lib
+	${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} cgitest ${PREFIX}/libexec/cgi-bin
+	${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} jumpto ${PREFIX}/libexec/cgi-bin
+	${BSD_INSTALL_DATA} cgi.h ${PREFIX}/include
+	for i in *.3; do \
+          ${BSD_INSTALL_MAN} $$i ${PREFIX}/man/man3/; \
+        done
+	for i in *.5; do \
+          ${BSD_INSTALL_MAN} $$i ${PREFIX}/man/man5/; \
+        done