Group :: Sistema/Bibliotecas
RPM: libcgi
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: cgilib-0.5-alt-makefile.patch
Download
Download
diff -ruN cgilib-0.5.orig/Makefile cgilib-0.5/Makefile
--- cgilib-0.5.orig/Makefile 1999-08-21 08:14:07 +1100
+++ cgilib-0.5/Makefile 2006-03-19 21:15:27 +1000
@@ -14,30 +14,43 @@
# 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
-LDFLAGS = -L.
-LIBS = -lcgi
-
-OBJS = cgi.o cookies.o
-
-libcgi.a: $(OBJS)
- ar rc $@ $^
+CC=gcc
-cgitest: cgitest.o libcgi.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
+DESTDIR=$(DESTDIR)
-jumpto: jumpto.o libcgi.a
- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
-
-all: libcgi.a cgitest jumpto
+#CFLAGS=-fPIC -Wshadow -Wwrite-strings -Wconversion
+CFLAGS=-fPIC -Wall -O2 -g -I.
+LDFLAGS= -L.
+VERSION=0.5
+LIBS = -lcgi
-install: cgitest
- install -m 755 cgitest /usr/lib/cgi-bin
+OBJS = cgi.o cookies.o
+#OBJS=io.o proc.o ssl.o str.o utils.o val.o tcp.o snd_dev.o snd_util.o ip.o mail.o mem.o main.o
+MAN3 = cgiDebug.3 cgiFree.3 cgiFreeList.3 cgiGetCookie.3 cgiGetCookies.3 cgiGetValue.3 \
+ cgiGetVariables.3 cgiHeader.3 cgiInit.3 cgiRedirect.3 cgiSetHeader.3 cgiSetType.3
+
+MAN5 = cgi.5
+
+all: lib
+
+lib: $(OBJS)
+ $(CC) -shared -Wl,-soname,libcgi.so.0,-z,defs -o libcgi.so.$(VERSION) $(OBJS)
+ ar -r libcgi.a $(OBJS)
+#ld -x -shared -soname libcgi.so.0 -o libcgi.so.$(VERSION) $(OBJS)
+# --whole-archive libcgi.a
+
+%.o: %.c
+ $(CC) $(CFLAGS) -fPIC -c $< -o $@
+
+install: all
+ install -d $(DESTDIR)/usr/lib
+ install -d $(DESTDIR)/usr/include/cgilib/
+ install -d $(DESTDIR)/usr/share/man/man3/
+ install -d $(DESTDIR)/usr/share/man/man5/
+ install -m 644 libcgi.so* $(DESTDIR)/usr/lib
+ install -m 644 *.h $(DESTDIR)/usr/include/cgilib/
+ install -m 644 $(MAN3) $(DESTDIR)/usr/share/man/man3
+ install -m 644 $(MAN5) $(DESTDIR)/usr/share/man/man5
clean:
- rm -f cgitest cgitest.o jumpto jumpto.o libcgi.a $(OBJS) *.[35].html
-
-htmlman:
- for f in *.[35]; do \
- man -l $$f|rman -f HTML --title $$f -r "%s.%s.html" > $$f.html; \
- done
+ rm -f $(OBJS) libcgi*