summaryrefslogtreecommitdiff
path: root/www/cgilib/patches/patch-ab
blob: 806f428f3e678d320b4c2eab14ad1ea6fe5b1b48 (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
$NetBSD: patch-ab,v 1.9 2006/11/12 01:51:52 rillig Exp $

--- Makefile.orig	1999-08-20 23:14:07.000000000 +0200
+++ Makefile	2006-11-12 02:49:34.000000000 +0100
@@ -14,25 +14,31 @@
 #   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
+MANDIR?=	${PREFIX}/man
+
+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
+
+.SUFFIXES:	.lo
 
-cgitest: cgitest.o libcgi.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+.c.lo:
+	${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $<
 
-jumpto: jumpto.o libcgi.a
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+libcgi.la: $(OBJS:.o=.lo)
+	${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \
+		-rpath ${PREFIX}/lib \
+		-version-info 0:0
 
-all: libcgi.a cgitest jumpto
+cgitest: cgitest.lo libcgi.la
+	${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgitest.lo $(LIBS)
 
-install: cgitest
-	install -m 755 cgitest /usr/lib/cgi-bin
+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 +47,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 ${MANDIR}/man3/; \
+        done
+	for i in *.5; do \
+          ${BSD_INSTALL_MAN} $$i ${MANDIR}/man5/; \
+        done