libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
Index: b/src/cgi.c
|
|
|
|
===================================================================
|
|
|
|
--- a/src/cgi.c
|
|
|
|
+++ b/src/cgi.c
|
2006-12-12 14:16:31 +01:00
|
|
|
@@ -336,7 +336,7 @@
|
|
|
|
hextable['b'] = 11;
|
|
|
|
hextable['c'] = 12;
|
|
|
|
hextable['d'] = 13;
|
|
|
|
- hextable['e'] = 13;
|
|
|
|
+ hextable['e'] = 14;
|
|
|
|
hextable['f'] = 15;
|
|
|
|
hextable['A'] = 10;
|
|
|
|
hextable['B'] = 11;
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
Index: b/src/string.c
|
|
|
|
===================================================================
|
|
|
|
--- a/src/string.c
|
|
|
|
+++ b/src/string.c
|
2006-12-12 14:16:31 +01:00
|
|
|
@@ -584,7 +584,7 @@
|
|
|
|
|
|
|
|
va_start(ptr, s);
|
|
|
|
|
|
|
|
- va_copy(bkp, str);
|
|
|
|
+ va_copy(bkp, ptr);
|
|
|
|
len = strlen(s);
|
|
|
|
|
|
|
|
while (*str) {
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
Index: b/Makefile.in
|
|
|
|
===================================================================
|
|
|
|
--- a/Makefile.in
|
|
|
|
+++ b/Makefile.in
|
|
|
|
@@ -5,22 +5,32 @@
|
2006-12-12 14:16:31 +01:00
|
|
|
prefix = @prefix@
|
|
|
|
exec_prefix = @exec_prefix@
|
|
|
|
|
|
|
|
-SHAREDOPT = -shared
|
2012-06-03 07:15:12 +02:00
|
|
|
+SHAREDOPT = -shared -fPIC -Wl,-soname,libcgi.so.0
|
2006-12-12 14:16:31 +01:00
|
|
|
LIBDIR = $(prefix)/lib
|
|
|
|
-INCDIR = $(prefix)/include
|
|
|
|
+INCDIR = $(prefix)/include/libcgi/
|
|
|
|
MANDIR = $(prefix)/man/man3
|
|
|
|
SHELL = /bin/sh
|
|
|
|
EXTRA_LIBS =
|
|
|
|
|
|
|
|
INCS = -Isrc
|
|
|
|
-FLAGS = -Wall -fpic
|
|
|
|
+FLAGS = -Wall -D_REENTRANT
|
|
|
|
|
|
|
|
OBJS = src/error.o src/cgi.o src/session.o src/base64.o src/md5.o \
|
|
|
|
src/string.o src/general.o src/list.o src/cookie.o
|
|
|
|
+SHOBJS=$(OBJS:.o=.sh.o)
|
|
|
|
|
|
|
|
-.c.o: $(CC) $(FLAGS) -c $<
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
+ALL_TARGETS = src/libcgi.a
|
|
|
|
+ifeq ($(STATIC),)
|
|
|
|
+ALL_TARGETS += src/libcgi.so
|
|
|
|
+endif
|
2006-12-12 14:16:31 +01:00
|
|
|
|
|
|
|
-all: $(OBJS) src/libcgi.so
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
+%.o: %.c
|
|
|
|
+ $(CC) $(FLAGS) -c $*.c -o $@
|
|
|
|
+
|
2006-12-12 14:16:31 +01:00
|
|
|
+%.sh.o: %.c
|
|
|
|
+ $(CC) $(FLAGS) -fPIC -c $*.c -o $@
|
|
|
|
+
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
+all: $(ALL_TARGETS)
|
2006-12-12 14:16:31 +01:00
|
|
|
|
|
|
|
@echo ""
|
|
|
|
@echo ""
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
@@ -48,14 +58,17 @@
|
2006-12-12 14:16:31 +01:00
|
|
|
src/libcgi.a: $(OBJS)
|
|
|
|
$(AR) rc src/libcgi.a $(OBJS)
|
|
|
|
|
|
|
|
-src/libcgi.so: src/libcgi.a
|
|
|
|
- $(CC) $(SHAREDOPT) -o src/libcgi.so $(OBJS) $(EXTRA_LIBS)
|
|
|
|
+src/libcgi.so: $(SHOBJS)
|
|
|
|
+ $(CC) $(SHAREDOPT) -o src/libcgi.so $(SHOBJS) $(EXTRA_LIBS)
|
|
|
|
|
|
|
|
install:
|
|
|
|
- cp src/libcgi.a $(LIBDIR)
|
|
|
|
- cp src/libcgi.so $(LIBDIR)
|
|
|
|
- cp src/cgi.h $(INCDIR)
|
|
|
|
- cp src/session.h $(INCDIR)
|
|
|
|
+ cp src/libcgi.a $(DESTDIR)/$(LIBDIR)
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
+ifeq ($(STATIC),)
|
2006-12-12 14:16:31 +01:00
|
|
|
+ cp src/libcgi.so $(DESTDIR)/$(LIBDIR)
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
+endif
|
2010-07-08 13:25:09 +02:00
|
|
|
+ [ -d $(DESTDIR)/$(INCDIR) ] || mkdir -p $(DESTDIR)/$(INCDIR)
|
2006-12-12 14:16:31 +01:00
|
|
|
+ cp src/cgi.h $(DESTDIR)/$(INCDIR)
|
|
|
|
+ cp src/session.h $(DESTDIR)/$(INCDIR)
|
|
|
|
|
|
|
|
|
|
|
|
src/error.o: src/error.c src/error.h
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
@@ -69,8 +82,9 @@
|
2006-12-12 14:16:31 +01:00
|
|
|
src/list.o: src/list.c
|
|
|
|
|
|
|
|
clean:
|
|
|
|
- find src/ -name *.*o -exec rm -f {} \;
|
|
|
|
+ find src/ -name *.o -exec rm -f {} \;
|
|
|
|
find src/ -name *.a -exec rm -f {} \;
|
|
|
|
+ find src/ -name *.so -exec rm -f {} \;
|
|
|
|
|
|
|
|
uninstall: clean
|
|
|
|
rm -f $(LIBDIR)/libcgi.*
|
libcgi: fix build failure on pure static library builds
libcgi always builds both the shared and static library, which doesn't
work on architecture that don't support shared library at all, such as
Blackfin with the FLAT format. libcgi uses autoconf, but not automake,
and the Makefile is not of the highest possible quality, so this
commit fixes the problem by introducing a "STATIC" variable that can
be set from the environment. When set to a non-empty value, the
Makefile assumes it should only build the static version of the
library.
Note that this package is in desperate need of some care: there is one
single patch that mixes several changes together, it doesn't have a
description or a Signed-off-by line, and there is now a github project
for libcgi at https://github.com/rafaelsteil/libcgi/ that has the same
fixes.
However, for the purpose of the master branch, we're doing the most
minimal fix possible, by just adding this STATIC variable.
Fixes:
http://autobuild.buildroot.net/results/625/625105bcaf26345f422b225787fc19611b65cd57/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-02-22 22:12:00 +01:00
|
|
|
@@ -78,11 +92,11 @@
|
2006-12-12 14:16:31 +01:00
|
|
|
rm -f $(INCDIR)/session.h
|
|
|
|
rm -f $(MANDIR)/libcgi*
|
|
|
|
|
|
|
|
-install_man:
|
|
|
|
- cp doc/man/man3/libcgi_base64.3 $(MANDIR)
|
|
|
|
- cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
|
|
|
|
- cp doc/man/man3/libcgi_general.3 $(MANDIR)
|
|
|
|
- cp doc/man/man3/libcgi_string.3 $(MANDIR)
|
|
|
|
- cp doc/man/man3/libcgi_session.3 $(MANDIR)
|
|
|
|
- cp doc/man/man3/libcgi_cookie.3 $(MANDIR)
|
|
|
|
+#install_man:
|
|
|
|
+# cp doc/man/man3/libcgi_base64.3 $(MANDIR)
|
|
|
|
+# cp doc/man/man3/libcgi_cgi.3 $(MANDIR)
|
|
|
|
+# cp doc/man/man3/libcgi_general.3 $(MANDIR)
|
|
|
|
+# cp doc/man/man3/libcgi_string.3 $(MANDIR)
|
|
|
|
+# cp doc/man/man3/libcgi_session.3 $(MANDIR)
|
|
|
|
+# cp doc/man/man3/libcgi_cookie.3 $(MANDIR)
|
|
|
|
|