python: fix disabling the SSL module
[buildroot-gz.git] / package / libcgi / 0001-misc-fixes.patch
blobb576178546479946bdbbe6be3cb105672c314111
1 Index: b/src/cgi.c
2 ===================================================================
3 --- a/src/cgi.c
4 +++ b/src/cgi.c
5 @@ -336,7 +336,7 @@
6 hextable['b'] = 11;
7 hextable['c'] = 12;
8 hextable['d'] = 13;
9 - hextable['e'] = 13;
10 + hextable['e'] = 14;
11 hextable['f'] = 15;
12 hextable['A'] = 10;
13 hextable['B'] = 11;
14 Index: b/src/string.c
15 ===================================================================
16 --- a/src/string.c
17 +++ b/src/string.c
18 @@ -584,7 +584,7 @@
20 va_start(ptr, s);
22 - va_copy(bkp, str);
23 + va_copy(bkp, ptr);
24 len = strlen(s);
26 while (*str) {
27 Index: b/Makefile.in
28 ===================================================================
29 --- a/Makefile.in
30 +++ b/Makefile.in
31 @@ -5,22 +5,32 @@
32 prefix = @prefix@
33 exec_prefix = @exec_prefix@
35 -SHAREDOPT = -shared
36 +SHAREDOPT = -shared -fPIC -Wl,-soname,libcgi.so.0
37 LIBDIR = $(prefix)/lib
38 -INCDIR = $(prefix)/include
39 +INCDIR = $(prefix)/include/libcgi/
40 MANDIR = $(prefix)/man/man3
41 SHELL = /bin/sh
42 EXTRA_LIBS =
44 INCS = -Isrc
45 -FLAGS = -Wall -fpic
46 +FLAGS = -Wall -D_REENTRANT
48 OBJS = src/error.o src/cgi.o src/session.o src/base64.o src/md5.o \
49 src/string.o src/general.o src/list.o src/cookie.o
50 +SHOBJS=$(OBJS:.o=.sh.o)
52 -.c.o: $(CC) $(FLAGS) -c $<
53 +ALL_TARGETS = src/libcgi.a
54 +ifeq ($(STATIC),)
55 +ALL_TARGETS += src/libcgi.so
56 +endif
58 -all: $(OBJS) src/libcgi.so
59 +%.o: %.c
60 + $(CC) $(FLAGS) -c $*.c -o $@
62 +%.sh.o: %.c
63 + $(CC) $(FLAGS) -fPIC -c $*.c -o $@
65 +all: $(ALL_TARGETS)
67 @echo ""
68 @echo ""
69 @@ -48,14 +58,17 @@
70 src/libcgi.a: $(OBJS)
71 $(AR) rc src/libcgi.a $(OBJS)
73 -src/libcgi.so: src/libcgi.a
74 - $(CC) $(SHAREDOPT) -o src/libcgi.so $(OBJS) $(EXTRA_LIBS)
75 +src/libcgi.so: $(SHOBJS)
76 + $(CC) $(SHAREDOPT) -o src/libcgi.so $(SHOBJS) $(EXTRA_LIBS)
78 install:
79 - cp src/libcgi.a $(LIBDIR)
80 - cp src/libcgi.so $(LIBDIR)
81 - cp src/cgi.h $(INCDIR)
82 - cp src/session.h $(INCDIR)
83 + cp src/libcgi.a $(DESTDIR)/$(LIBDIR)
84 +ifeq ($(STATIC),)
85 + cp src/libcgi.so $(DESTDIR)/$(LIBDIR)
86 +endif
87 + [ -d $(DESTDIR)/$(INCDIR) ] || mkdir -p $(DESTDIR)/$(INCDIR)
88 + cp src/cgi.h $(DESTDIR)/$(INCDIR)
89 + cp src/session.h $(DESTDIR)/$(INCDIR)
92 src/error.o: src/error.c src/error.h
93 @@ -69,8 +82,9 @@
94 src/list.o: src/list.c
96 clean:
97 - find src/ -name *.*o -exec rm -f {} \;
98 + find src/ -name *.o -exec rm -f {} \;
99 find src/ -name *.a -exec rm -f {} \;
100 + find src/ -name *.so -exec rm -f {} \;
102 uninstall: clean
103 rm -f $(LIBDIR)/libcgi.*
104 @@ -78,11 +92,11 @@
105 rm -f $(INCDIR)/session.h
106 rm -f $(MANDIR)/libcgi*
108 -install_man:
109 - cp doc/man/man3/libcgi_base64.3 $(MANDIR)
110 - cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
111 - cp doc/man/man3/libcgi_general.3 $(MANDIR)
112 - cp doc/man/man3/libcgi_string.3 $(MANDIR)
113 - cp doc/man/man3/libcgi_session.3 $(MANDIR)
114 - cp doc/man/man3/libcgi_cookie.3 $(MANDIR)
115 +#install_man:
116 +# cp doc/man/man3/libcgi_base64.3 $(MANDIR)
117 +# cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
118 +# cp doc/man/man3/libcgi_general.3 $(MANDIR)
119 +# cp doc/man/man3/libcgi_string.3 $(MANDIR)
120 +# cp doc/man/man3/libcgi_session.3 $(MANDIR)
121 +# cp doc/man/man3/libcgi_cookie.3 $(MANDIR)