46f793f28f
This is the code written to accompany Thomas Boutell's book "CGI Programming in C & Perl". It provides a library of routines for use in CGI programming, and unlike cgilib-0.5, this library handles the "multipart/form-data" encoding required to use the FILE input control type as defined in the HTML specification. NOTE: It should be aware that there were a few developer visible changes made from Thomas Boutell's original distribution when integrating it with the NetBSD packages environment. They are: 1) Instead of being yet another source file which is used in building the application, the package have been converted totally into a library format. This library is linked using "-lcgic". 2) As a result of the first item, the developer no longer writes their entry point under the function name of cgiMain(). Instead, the user will provide their own main(), and will need to call cgiInit() before any other cgic function is called.
65 lines
1.9 KiB
Text
65 lines
1.9 KiB
Text
$NetBSD: patch-aa,v 1.1.1.1 2004/07/20 21:44:29 jmmv Exp $
|
|
|
|
--- Makefile.orig Sun Jan 12 13:59:43 2003
|
|
+++ Makefile
|
|
@@ -1,27 +1,42 @@
|
|
-CFLAGS=-g -Wall
|
|
+CFLAGS += -g -Wall
|
|
CC=gcc
|
|
AR=ar
|
|
-LIBS=-L./ -lcgic
|
|
+LIBS = libcgic.la
|
|
|
|
-all: libcgic.a cgictest.cgi capture
|
|
+OBJS = cgic.o
|
|
|
|
-install: libcgic.a
|
|
- cp libcgic.a /usr/local/lib
|
|
- cp cgic.h /usr/local/include
|
|
- @echo libcgic.a is in /usr/local/lib. cgic.h is in /usr/local/include.
|
|
+all: libcgic.la cgictest capture
|
|
|
|
-libcgic.a: cgic.o cgic.h
|
|
- rm -f libcgic.a
|
|
- $(AR) rc libcgic.a cgic.o
|
|
+.SUFFIXES: .lo
|
|
|
|
-#mingw32 and cygwin users: replace .cgi with .exe
|
|
-
|
|
-cgictest.cgi: cgictest.o libcgic.a
|
|
- gcc cgictest.o -o cgictest.cgi ${LIBS}
|
|
-
|
|
-capture: capture.o libcgic.a
|
|
- gcc capture.o -o capture ${LIBS}
|
|
+.c.lo:
|
|
+ ${LIBTOOL} --mode=compile ${CC} ${CFLAGS} -o $@ -c $<
|
|
+
|
|
+libcgic.la: $(OBJS:.o=.lo)
|
|
+ ${LIBTOOL} --mode=link ${CC} -o $@ ${OBJS:.o=.lo} \
|
|
+ -rpath ${PREFIX}/lib \
|
|
+ -version-info 0:0
|
|
+
|
|
+cgictest: cgictest.lo libcgic.la
|
|
+ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgictest.lo $(LIBS)
|
|
+
|
|
+capture: capture.lo libcgic.la
|
|
+ ${LIBTOOL} --mode=link $(CC) $(CFLAGS) $(LDFLAGS) -o $@ cgictest.lo $(LIBS)
|
|
+
|
|
+install: libcgic.la cgictest
|
|
+ -mkdir -p ${PREFIX}/libexec/cgi-bin
|
|
+ -mkdir -p ${PREFIX}/share/examples/cgiclib
|
|
+ ${INSTALL} -c -m 444 capture.c ${PREFIX}/share/examples/cgiclib
|
|
+ ${INSTALL} -c -m 444 cgictest.c ${PREFIX}/share/examples/cgiclib
|
|
+ ${LIBTOOL} --mode=install ${INSTALL} -c -m 444 libcgic.la ${PREFIX}/lib
|
|
+ ${LIBTOOL} --mode=install ${INSTALL} -c -m 755 capture ${PREFIX}/libexec/cgi-bin
|
|
+ ${LIBTOOL} --mode=install ${INSTALL} -c -m 755 cgictest ${PREFIX}/libexec/cgi-bin
|
|
+ ${INSTALL} -c -m 444 cgic.h ${PREFIX}/include
|
|
+ -mkdir -p ${PREFIX}/share/doc/html/cgiclib
|
|
+ for i in *.html; do \
|
|
+ ${INSTALL} -c -m 444 $$i ${PREFIX}/share/doc/html/cgiclib ; \
|
|
+ done
|
|
|
|
clean:
|
|
- rm -f *.o *.a cgictest.cgi capture
|
|
+ rm -f *.o *.la cgictest capture
|
|
|