Skip to contentSkip to conversation

fcgiwrap: new package

PATCH Superseded Thomas Claveirole 5 participants 19 messages May 26, 2015 – Jul 19, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fcgiwrap: new package

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap

fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

---
 package/Config.in            |  1 +
 package/fcgiwrap/Config.in   | 10 ++++++++++
 package/fcgiwrap/fcgiwrap.mk | 19 +++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
package/Config.in +1 -0
index e0c2e2a..188ff0d 100644
@@ -1168,6 +1168,7 @@ endif
 	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
+	source "package/fcgiwrap/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/fcgiwrap/Config.in new file +10 -0
new file mode 100644
index 0000000..a5c15a0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_FCGIWRAP
+	bool "fcgiwrap"
+	depends on BR2_USE_MMU # Transitive dependency from libfcgi.
+	select BR2_PACKAGE_LIBFCGI
+	help
+	  fcgiwrap is a simple server for running CGI applications
+	  over FastCGI. It hopes to provide clean CGI support to Nginx
+	  (and other web servers that may need it).
+
+	  https://nginx.localdomain.pl/wiki/FcgiWrap
package/fcgiwrap/fcgiwrap.mk new file +19 -0
new file mode 100644
index 0000000..053f1d0
@@ -0,0 +1,19 @@
+################################################################################
+#
+# fcgiwrap
+#
+################################################################################
+
+FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
+FCGIWRAP_DEPENDENCIES = libfcgi
+FCGIWRAP_LICENSE = MIT
+FCGIWRAP_AUTORECONF = YES
+
+# We need -lm to link with libfcgi, and fcgiwrap does not add it automatically.
+FCGIWRAP_CONF_OPTS = LDFLAGS=-lm
+
+# fcgiwrap uses Autoconf, but not Automake, so we need to provide these to make.
+FCGIWRAP_MAKE_OPTS = CC="$(TARGET_CC)" LD="$(TARGET_LD)" $(FCGIWRAP_CONF_OPTS)
+
+$(eval $(autotools-package))
Signature · 1 line
2.1.4
#1 lore raw

PATCH 1/1 fcgiwrap: new package

Quoted 34 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Claveirole <[email protected]> writes:

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap
fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

---
 package/Config.in            |  1 +
 package/fcgiwrap/Config.in   | 10 ++++++++++
 package/fcgiwrap/fcgiwrap.mk | 19 +++++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
package/Config.in +1 -0
index e0c2e2a..188ff0d 100644
@@ -1168,6 +1168,7 @@ endif
 	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
+	source "package/fcgiwrap/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/fcgiwrap/Config.in new file +0 -0
new file mode 100644
index 0000000..a5c15a0

package/fcgiwrap/Config.in line 10

Quoted 10 lines
package/fcgiwrap/Config.in new file +10 -0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_FCGIWRAP
+	bool "fcgiwrap"
+	depends on BR2_USE_MMU # Transitive dependency from libfcgi.
+	select BR2_PACKAGE_LIBFCGI
+	help
+	  fcgiwrap is a simple server for running CGI applications
+	  over FastCGI. It hopes to provide clean CGI support to Nginx
+	  (and other web servers that may need it).
+
+	  https://nginx.localdomain.pl/wiki/FcgiWrap

FYI, the trac instance at that location seems to have some database issues.

Thanks, but it doesn't work here:

Quoted 1 line
Quoted 1 line
Quoted 1 line

fcgiwrap 1.1.0 Autoreconfiguring

configure.ac:32: error: possibly undefined macro: AC_DEFINE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /home/peko/source/buildroot/output/host/usr/bin/autoconf failed with exit status: 1 package/pkg-generic.mk:146: recipe for target '/home/peko/source/buildroot/output/build/fcgiwrap-1.1.0/.stamp_configured' failed

From a quick look it seems like you are missing a dependency on host-pkgconf. With that added autoreconf works, but configure fails to detect libfcgi when linking statically because you are passing LIBS=-lm to it.

With that fixed, linking fails as LDFLAGS (and hence your -lm) comes before -lfcgi, so I guess you should add LDLIBS='-lfcgi -lm' to _MAKE_OPTS instead.

Care to fix these issues and resend? Thanks!

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

v2 cover fcgiwrap: new package

Quoted 5 lines

configure.ac:32: error: possibly undefined macro: AC_DEFINE [...]

From a quick look it seems like you are missing a dependency on host-pkgconf.

Right. Thanks for pointing this out.

Quoted 3 lines

With that added autoreconf works, but configure fails to detect libfcgi when linking statically because you are passing LIBS=-lm to it.

I investigated that and found it is actually a bug with libfcgi. libfcgi's Buildroot package does already include a patch to address that, but the patch is wrong: it adds -lm to libfcgi programs that link against libfcgi, while it should directly add -lm to libfcgi instead. See first patch in my new series.

By the way, I reproduced it, fixed it, and tested with both static and dynamic libraries. This works, at least on my system.

Quoted 1 line

Care to fix these issues and resend? Thanks!

Yes, here it is. Thanks for the help. :-)

Thomas Claveirole (2):
libfcgi (0003-link-against-math.patch): Do actually link when needed.
fcgiwrap: new package

 package/Config.in                            |  1 +
 package/fcgiwrap/Config.in                   | 10 ++++++++
 package/fcgiwrap/fcgiwrap.mk                 | 13 ++++++++++
 package/libfcgi/0003-link-against-math.patch | 36 +++++++++-------------------
 4 files changed, 35 insertions(+), 25 deletions(-)
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
Signature · 1 line
2.1.4
#3 lore raw

PATCH v2 1/2 libfcgi (0003-link-against-math.patch): Do actually link when needed.

libfcgi uses frexp() and thus should link with libm, but fails to do so. Thus link errors with programs that use libfcgi (the bug does appear only with uClibc, because the GNU libc provides frexp() directly in libc.so). Modify 0003-link-against-math.patch so libfcgi links against math, instead of programs that need it.

---
 package/libfcgi/0003-link-against-math.patch | 36 +++++++++-------------------
 1 file changed, 11 insertions(+), 25 deletions(-)
package/libfcgi/0003-link-against-math.patch +11 -25
index 4c87ea6..ccf648a 100644
@@ -1,28 +1,14 @@
-Link against math libraries when needed
+Link libfcgi against the math library.
 
-Signed-off-by: Thomas Petazzoni <[email protected]>
-
-Index: b/cgi-fcgi/Makefile.am
-===================================================================
---- a/cgi-fcgi/Makefile.am
-+++ b/cgi-fcgi/Makefile.am
-@@ -11,5 +11,5 @@
- LIBDIR      = ../libfcgi
- LIBFCGI     = $(LIBDIR)/libfcgi.la
- 
--LDADD = $(LIBFCGI)
-+LDADD = $(LIBFCGI) -lm
- cgi_fcgi_SOURCES = $(INCLUDE_FILES) cgi-fcgi.c
-Index: b/examples/Makefile.am
+Index: b/libfcgi/Makefile.am
 ===================================================================
---- a/examples/Makefile.am
-+++ b/examples/Makefile.am
-@@ -21,7 +21,7 @@
- LIBDIR      = ../libfcgi
- LIBFCGI     = $(LIBDIR)/libfcgi.la
- 
--LDADD = $(LIBFCGI)
-+LDADD = $(LIBFCGI) -lm
+--- a/libfcgi/Makefile.am
++++ b/libfcgi/Makefile.am
+@@ -18,6 +18,7 @@
+                      os_ at [email protected]
+ libfcgi_la_CC      = @PTHREAD_CC@
+ libfcgi_la_CFLAGS  = @PTHREAD_CFLAGS@
++libfcgi_la_LIBADD  = -lm
  
- echo_SOURCES       = $(INCLUDE_FILES) echo.c
- echo_x_SOURCES     = $(INCLUDE_FILES) echo-x.c
+ libfcgi___la_SOURCES = $(INCLUDE_FILES)       \
+                        $(INCLUDEDIR)/fcgio.h  \
Signature · 1 line
2.1.4
#4 lore raw

PATCH v2 1/2 libfcgi (0003-link-against-math.patch): Do actually link when needed.

Quoted 7 lines · Thomas Claveirole

libfcgi uses frexp() and thus should link with libm, but fails to do so. Thus link errors with programs that use libfcgi (the bug does appear only with uClibc, because the GNU libc provides frexp() directly in libc.so). Modify 0003-link-against-math.patch so libfcgi links against math, instead of programs that need it.

Looks good, but the patch should still have your Signed-off-by to the patch:

package/libfcgi/0003-link-against-math.patch line 3

Quoted 13 lines
---
 package/libfcgi/0003-link-against-math.patch | 36 +++++++++-------------------
 1 file changed, 11 insertions(+), 25 deletions(-)
package/libfcgi/0003-link-against-math.patch +1 -2
index 4c87ea6..ccf648a 100644
@@ -1,28 +1,14 @@
-Link against math libraries when needed
+Link libfcgi against the math library.
 
-Signed-off-by: Thomas Petazzoni <[email protected]>

Here.

With that:

Regards,
Arnout

Quoted 36 lines
package/libfcgi/0003-link-against-math.patch +10 -23
-
-Index: b/cgi-fcgi/Makefile.am
-===================================================================
---- a/cgi-fcgi/Makefile.am
-+++ b/cgi-fcgi/Makefile.am
-@@ -11,5 +11,5 @@
- LIBDIR      = ../libfcgi
- LIBFCGI     = $(LIBDIR)/libfcgi.la
- 
--LDADD = $(LIBFCGI)
-+LDADD = $(LIBFCGI) -lm
- cgi_fcgi_SOURCES = $(INCLUDE_FILES) cgi-fcgi.c
-Index: b/examples/Makefile.am
+Index: b/libfcgi/Makefile.am
 ===================================================================
---- a/examples/Makefile.am
-+++ b/examples/Makefile.am
-@@ -21,7 +21,7 @@
- LIBDIR      = ../libfcgi
- LIBFCGI     = $(LIBDIR)/libfcgi.la
- 
--LDADD = $(LIBFCGI)
-+LDADD = $(LIBFCGI) -lm
+--- a/libfcgi/Makefile.am
++++ b/libfcgi/Makefile.am
+@@ -18,6 +18,7 @@
+                      os_ at [email protected]
+ libfcgi_la_CC      = @PTHREAD_CC@
+ libfcgi_la_CFLAGS  = @PTHREAD_CFLAGS@
++libfcgi_la_LIBADD  = -lm
 
- echo_SOURCES       = $(INCLUDE_FILES) echo.c
- echo_x_SOURCES     = $(INCLUDE_FILES) echo-x.c
+ libfcgi___la_SOURCES = $(INCLUDE_FILES)       \
+                        $(INCLUDEDIR)/fcgio.h  \
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#5 lore raw

PATCH v2 2/2 fcgiwrap: new package

In reply to Thomas Claveirole

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap

fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

---
 package/Config.in            |  1 +
 package/fcgiwrap/Config.in   | 10 ++++++++++
 package/fcgiwrap/fcgiwrap.mk | 13 +++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
package/Config.in +1 -0
index e0c2e2a..188ff0d 100644
@@ -1168,6 +1168,7 @@ endif
 	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
+	source "package/fcgiwrap/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/fcgiwrap/Config.in new file +10 -0
new file mode 100644
index 0000000..a5c15a0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_FCGIWRAP
+	bool "fcgiwrap"
+	depends on BR2_USE_MMU # Transitive dependency from libfcgi.
+	select BR2_PACKAGE_LIBFCGI
+	help
+	  fcgiwrap is a simple server for running CGI applications
+	  over FastCGI. It hopes to provide clean CGI support to Nginx
+	  (and other web servers that may need it).
+
+	  https://nginx.localdomain.pl/wiki/FcgiWrap
package/fcgiwrap/fcgiwrap.mk new file +13 -0
new file mode 100644
index 0000000..844f1a3
@@ -0,0 +1,13 @@
+################################################################################
+#
+# fcgiwrap
+#
+################################################################################
+
+FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
+FCGIWRAP_DEPENDENCIES = host-pkgconf libfcgi
+FCGIWRAP_LICENSE = MIT
+FCGIWRAP_AUTORECONF = YES
+
+$(eval $(autotools-package))
Signature · 1 line
2.1.4
#6 lore raw

PATCH v2 2/2 fcgiwrap: new package

Quoted 10 lines

[...]

(quoted diff) +0 -0

b/package/fcgiwrap/fcgiwrap.mk new file mode 100644 index 0000000..844f1a3

package/fcgiwrap/fcgiwrap.mk new file +3 -0
@@ -0,0 +1,13 @@
+################################################################################
+#
+# fcgiwrap

package/fcgiwrap/fcgiwrap.mk line 13

Quoted 10 lines
package/fcgiwrap/fcgiwrap.mk new file +10 -0
+#
+################################################################################
+
+FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
+FCGIWRAP_DEPENDENCIES = host-pkgconf libfcgi
+FCGIWRAP_LICENSE = MIT
+FCGIWRAP_AUTORECONF = YES
+
+$(eval $(autotools-package))

Erf, sorry, this is wrong. I forgot the

FCGIWRAP_MAKE_OPTS = CC="$(TARGET_CC)" LD="$(TARGET_LD)"

line and now fcgiwrap is not cross-compiled anymore. Sending a new series soon. Sorry for the noise.

Signature · 8 lines
Thomas Claveirole <[email protected]>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20150528/75267de0/attachment.asc>
#7 lore raw

PATCH v2 2/2 fcgiwrap: new package

In reply to Thomas Claveirole
Quoted 33 lines · Thomas Claveirole

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap

fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

---
 package/Config.in            |  1 +
 package/fcgiwrap/Config.in   | 10 ++++++++++
 package/fcgiwrap/fcgiwrap.mk | 13 +++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
package/Config.in +1 -0
index e0c2e2a..188ff0d 100644
@@ -1168,6 +1168,7 @@ endif
 	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
+	source "package/fcgiwrap/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/fcgiwrap/Config.in new file +0 -0
new file mode 100644
index 0000000..a5c15a0

package/fcgiwrap/Config.in line 3

Quoted 3 lines
package/fcgiwrap/Config.in new file +3 -0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_FCGIWRAP
+	bool "fcgiwrap"
+	depends on BR2_USE_MMU # Transitive dependency from libfcgi.

Just say # libfcgi

Quoted 13 lines
package/fcgiwrap/Config.in new file +7 -0
+	select BR2_PACKAGE_LIBFCGI
+	help
+	  fcgiwrap is a simple server for running CGI applications
+	  over FastCGI. It hopes to provide clean CGI support to Nginx
+	  (and other web servers that may need it).
+
+	  https://nginx.localdomain.pl/wiki/FcgiWrap
package/fcgiwrap/fcgiwrap.mk new file +0 -0
new file mode 100644
index 0000000..844f1a3

package/fcgiwrap/fcgiwrap.mk line 10

Quoted 10 lines
package/fcgiwrap/fcgiwrap.mk new file +10 -0
@@ -0,0 +1,13 @@
+################################################################################
+#
+# fcgiwrap
+#
+################################################################################
+
+FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
+FCGIWRAP_DEPENDENCIES = host-pkgconf libfcgi
+FCGIWRAP_LICENSE = MIT

Please add a license file. There isn't a separate one, so just use fcgiwrap.c.

package/fcgiwrap/fcgiwrap.mk line 11

Quoted 1 line
package/fcgiwrap/fcgiwrap.mk new file +1 -0
+FCGIWRAP_AUTORECONF = YES

This package also has an optional dependency on systemd, so add:

ifeq ($(BR2_PACKAGE_SYSTEMD),y)
FCGIWRAP_DEPENDENCIES += systemd
FCGIWRAP_CONF_OPTS += --with-systemd
else
FCGIWRAP_CONF_OPTS += --without-systemd
endif

package/fcgiwrap/fcgiwrap.mk line 13

Quoted 2 lines
package/fcgiwrap/fcgiwrap.mk new file +2 -0
+
+$(eval $(autotools-package))

This doesn't work because it's not a proper autotools package: it doesn't have
a Makefile.am, only a Makefile.in. Because of this, CC etc. don't get set in the generated Makefile.

Normally we say to make it a generic package, but that means you also have to
define the autoreconf expansion. So in this case, I'd say to just define FCGIWRAP_MAKE_ENV = $(TARGET_CONFIGURE_OPTS)

Regards,
Arnout

Quoted 1 line
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#8 lore raw

PATCH v3 1/2 libfcgi (0003-link-against-math.patch): Do actually link when needed.

libfcgi uses frexp() and thus should link with libm, but fails to do so. Thus link errors with programs that use libfcgi (the bug does appear only with uClibc, because the GNU libc provides frexp() directly in libc.so). Modify 0003-link-against-math.patch so libfcgi links against math, instead of programs that need it.

---
 package/libfcgi/0003-link-against-math.patch | 36 ++++++++++------------------
 1 file changed, 12 insertions(+), 24 deletions(-)
package/libfcgi/0003-link-against-math.patch +12 -24
index 4c87ea6..c60c6d5 100644
@@ -1,28 +1,16 @@
-Link against math libraries when needed
+Link libfcgi against the math library.
 
-Signed-off-by: Thomas Petazzoni <[email protected]>
+Signed-off-by: Thomas Claveirole <[email protected]>
 
-Index: b/cgi-fcgi/Makefile.am
+Index: b/libfcgi/Makefile.am
 ===================================================================
---- a/cgi-fcgi/Makefile.am
-+++ b/cgi-fcgi/Makefile.am
-@@ -11,5 +11,5 @@
- LIBDIR      = ../libfcgi
- LIBFCGI     = $(LIBDIR)/libfcgi.la
+--- a/libfcgi/Makefile.am
++++ b/libfcgi/Makefile.am
+@@ -18,6 +18,7 @@
+                      os_ at [email protected]
+ libfcgi_la_CC      = @PTHREAD_CC@
+ libfcgi_la_CFLAGS  = @PTHREAD_CFLAGS@
++libfcgi_la_LIBADD  = -lm
  
--LDADD = $(LIBFCGI)
-+LDADD = $(LIBFCGI) -lm
- cgi_fcgi_SOURCES = $(INCLUDE_FILES) cgi-fcgi.c
-Index: b/examples/Makefile.am
-===================================================================
---- a/examples/Makefile.am
-+++ b/examples/Makefile.am
-@@ -21,7 +21,7 @@
- LIBDIR      = ../libfcgi
- LIBFCGI     = $(LIBDIR)/libfcgi.la
- 
--LDADD = $(LIBFCGI)
-+LDADD = $(LIBFCGI) -lm
- 
- echo_SOURCES       = $(INCLUDE_FILES) echo.c
- echo_x_SOURCES     = $(INCLUDE_FILES) echo-x.c
+ libfcgi___la_SOURCES = $(INCLUDE_FILES)       \
+                        $(INCLUDEDIR)/fcgio.h  \
Signature · 1 line
2.1.4
#9 lore raw

PATCH v3 2/2 fcgiwrap: new package

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap

fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

---
 package/Config.in                                  |  1 +
 .../fcgiwrap/0001-use-LIBS-from-configure.patch    | 22 +++++++++++++++
 package/fcgiwrap/Config.in                         | 10 +++++++
 package/fcgiwrap/fcgiwrap.mk                       | 32 ++++++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 package/fcgiwrap/0001-use-LIBS-from-configure.patch
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
package/Config.in +1 -0
index e0c2e2a..188ff0d 100644
@@ -1168,6 +1168,7 @@ endif
 	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
+	source "package/fcgiwrap/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/fcgiwrap/0001-use-LIBS-from-configure.patch new file +22 -0
new file mode 100644
index 0000000..12563c4
@@ -0,0 +1,22 @@
+Makefile.in: Use LIBS from configure rather than specifying -lfcgi manually.
+
+libfcgi needs libm and fcgiwrap does not use libtool or pkgconf to
+detect libfcgi, so we need to add -lm explicitely when using static
+libs.  Buildroot does this by providing LIBS=-lm to configure when
+needed.  However fcgiwrap does not use Automake and its Makefile.in
+ignores LIBS from configure.  Fix it with this patch.
+
+Signed-off-by: Thomas Claveirole <[email protected]>
+
+diff -ur a/Makefile.in b/Makefile.in
+--- a/Makefile.in	2013-02-03 14:25:17.000000000 +0100
++++ b/Makefile.in	2015-05-29 16:33:23.895280138 +0200
+@@ -16,7 +16,7 @@
+ 	install -m 644 systemd/fcgiwrap.service $(DESTDIR)@systemdsystemunitdir@
+ endif
+
+-LDLIBS = -lfcgi @systemd_LIBS@
++LDLIBS = @LIBS@ @systemd_LIBS@
+ CFLAGS = @AM_CFLAGS@
+
+ fcgiwrap: fcgiwrap.c
package/fcgiwrap/Config.in new file +10 -0
new file mode 100644
index 0000000..c3a31fc
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_FCGIWRAP
+	bool "fcgiwrap"
+	depends on BR2_USE_MMU # libfcgi
+	select BR2_PACKAGE_LIBFCGI
+	help
+	  fcgiwrap is a simple server for running CGI applications
+	  over FastCGI. It hopes to provide clean CGI support to Nginx
+	  (and other web servers that may need it).
+
+	  https://nginx.localdomain.pl/wiki/FcgiWrap
package/fcgiwrap/fcgiwrap.mk new file +32 -0
new file mode 100644
index 0000000..698a130
@@ -0,0 +1,32 @@
+################################################################################
+#
+# fcgiwrap
+#
+################################################################################
+
+FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
+FCGIWRAP_DEPENDENCIES = host-pkgconf libfcgi
+FCGIWRAP_LICENSE = MIT
+FCGIWRAP_LICENSE_FILES = fcgiwrap.c
+FCGIWRAP_AUTORECONF = YES
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+FCGIWRAP_DEPENDENCIES += systemd
+FCGIWRAP_CONF_OPTS += --with-systemd
+else
+FCGIWRAP_CONF_OPTS += --without-systemd
+endif
+
+# libfcgi needs libm and fcgiwrap does not use libtool or pkgconf to
+# detect libfcgi, so we need to add -lm explicitely when using static
+# libs.
+ifeq ($(BR2_STATIC_LIBS),y)
+FCGIWRAP_CONF_OPTS += LIBS=-lm
+endif
+
+# fcgiwrap uses Autoconf, but not Automake, so we need to provide
+# these to make.
+FCGIWRAP_MAKE_ENV = $(TARGET_CONFIGURE_OPTS)
+
+$(eval $(autotools-package))
Signature · 1 line
2.1.4
#10 lore raw

PATCH v3 2/2 fcgiwrap: new package

Dear Thomas Claveirole,

Quoted 7 lines · Thomas Claveirole

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap

fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

Quoted 9 lines
---
 package/Config.in                                  |  1 +
 .../fcgiwrap/0001-use-LIBS-from-configure.patch    | 22 +++++++++++++++
 package/fcgiwrap/Config.in                         | 10 +++++++
 package/fcgiwrap/fcgiwrap.mk                       | 32 ++++++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 package/fcgiwrap/0001-use-LIBS-from-configure.patch
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#11 lore raw

PATCH v3 2/2 fcgiwrap: new package

In reply to Thomas Claveirole

Thomas C, All,

On 2015-05-29 18:15 +0200, Thomas Claveirole spake thusly:

Quoted 5 lines

Add package fcgiwrap from https://nginx.localdomain.pl/wiki/FcgiWrap

fcgiwrap is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

fcgiwrap fails to build because it does not find the systemd libraries:

    http://autobuild.buildroot.org/results/9b5/9b5e70e42e53e7752245f7c43bd01f208fcf76d0/build-end.log
    http://autobuild.buildroot.org/results/065/0656fde5005c7472e9e8ae8da32a6955ed5093cc/build-end.log

That's because it is looking for the legacy systemd compat libraries, which have been removed in systemd 230:

PKG_CHECK_MODULES(systemd, [libsystemd-daemon],

Also, it seems the homepage referenced in the Config.in is no longer available. The git tree has not changed since April 2015.

Care to have a look, please?

Regards,
Yann E. MORIN.

Quoted 112 lines
---
 package/Config.in                                  |  1 +
 .../fcgiwrap/0001-use-LIBS-from-configure.patch    | 22 +++++++++++++++
 package/fcgiwrap/Config.in                         | 10 +++++++
 package/fcgiwrap/fcgiwrap.mk                       | 32 ++++++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 package/fcgiwrap/0001-use-LIBS-from-configure.patch
 create mode 100644 package/fcgiwrap/Config.in
 create mode 100644 package/fcgiwrap/fcgiwrap.mk
package/Config.in +1 -0
index e0c2e2a..188ff0d 100644
@@ -1168,6 +1168,7 @@ endif
 	source "package/ejabberd/Config.in"
 	source "package/ethtool/Config.in"
 	source "package/faifa/Config.in"
+	source "package/fcgiwrap/Config.in"
 	source "package/fmc/Config.in"
 	source "package/foomatic-filters/Config.in"
 	source "package/fping/Config.in"
package/fcgiwrap/0001-use-LIBS-from-configure.patch new file +22 -0
new file mode 100644
index 0000000..12563c4
@@ -0,0 +1,22 @@
+Makefile.in: Use LIBS from configure rather than specifying -lfcgi manually.
+
+libfcgi needs libm and fcgiwrap does not use libtool or pkgconf to
+detect libfcgi, so we need to add -lm explicitely when using static
+libs.  Buildroot does this by providing LIBS=-lm to configure when
+needed.  However fcgiwrap does not use Automake and its Makefile.in
+ignores LIBS from configure.  Fix it with this patch.
+
+Signed-off-by: Thomas Claveirole <[email protected]>
+
+diff -ur a/Makefile.in b/Makefile.in
+--- a/Makefile.in	2013-02-03 14:25:17.000000000 +0100
++++ b/Makefile.in	2015-05-29 16:33:23.895280138 +0200
+@@ -16,7 +16,7 @@
+ 	install -m 644 systemd/fcgiwrap.service $(DESTDIR)@systemdsystemunitdir@
+ endif
+
+-LDLIBS = -lfcgi @systemd_LIBS@
++LDLIBS = @LIBS@ @systemd_LIBS@
+ CFLAGS = @AM_CFLAGS@
+
+ fcgiwrap: fcgiwrap.c
package/fcgiwrap/Config.in new file +10 -0
new file mode 100644
index 0000000..c3a31fc
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_FCGIWRAP
+	bool "fcgiwrap"
+	depends on BR2_USE_MMU # libfcgi
+	select BR2_PACKAGE_LIBFCGI
+	help
+	  fcgiwrap is a simple server for running CGI applications
+	  over FastCGI. It hopes to provide clean CGI support to Nginx
+	  (and other web servers that may need it).
+
+	  https://nginx.localdomain.pl/wiki/FcgiWrap
package/fcgiwrap/fcgiwrap.mk new file +32 -0
new file mode 100644
index 0000000..698a130
@@ -0,0 +1,32 @@
+################################################################################
+#
+# fcgiwrap
+#
+################################################################################
+
+FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
+FCGIWRAP_DEPENDENCIES = host-pkgconf libfcgi
+FCGIWRAP_LICENSE = MIT
+FCGIWRAP_LICENSE_FILES = fcgiwrap.c
+FCGIWRAP_AUTORECONF = YES
+
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+FCGIWRAP_DEPENDENCIES += systemd
+FCGIWRAP_CONF_OPTS += --with-systemd
+else
+FCGIWRAP_CONF_OPTS += --without-systemd
+endif
+
+# libfcgi needs libm and fcgiwrap does not use libtool or pkgconf to
+# detect libfcgi, so we need to add -lm explicitely when using static
+# libs.
+ifeq ($(BR2_STATIC_LIBS),y)
+FCGIWRAP_CONF_OPTS += LIBS=-lm
+endif
+
+# fcgiwrap uses Autoconf, but not Automake, so we need to provide
+# these to make.
+FCGIWRAP_MAKE_ENV = $(TARGET_CONFIGURE_OPTS)
+
+$(eval $(autotools-package))
Signature · 6 lines
2.1.4

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

cover Bump fcgiwrap, then fixes it w.r.t. systemd.

Hi all,

Quoted 10 lines

fcgiwrap fails to build because it does not find the systemd libraries:

http://autobuild.buildroot.org/results/9b5/9b5e70e42e53e7752245f7c43bd01f208fcf76d0/build-end.log
http://autobuild.buildroot.org/results/065/0656fde5005c7472e9e8ae8da32a6955ed5093cc/build-end.log

That's because it is looking for the legacy systemd compat libraries, which have been removed in systemd 230:

PKG_CHECK_MODULES(systemd, [libsystemd-daemon],

I am not familiar with systemd and the documentation on freedesktop.org appears very messy. As far as I understand, linking with libsystemd instead of libsystemd-daemon is a proper fix, right? At least it does fix compilation and seems to produce a proper fcgiwrap binary.

Quoted 2 lines

Also, it seems the homepage referenced in the Config.in is no longer available. The git tree has not changed since April 2015.

I bumped the fcgiwrap package to the latest commit (which is not a GitHub release, but the latest release is from February 2013) and changed the homepage to the GitHub page.

Quoted 1 line

Care to have a look, please?

See the following patches.

Thomas Claveirole (2):
fcgiwrap: Bump to 99c942c90063c73734e56bacaa65f947772d9186.
fcgiwrap: Add a patch to link with libsystemd, not libsystemd-daemon.

 ...ith-libsystemd-instead-of-libsystemd-daemon.patch | 20 ++++++++++++++++++++
 package/fcgiwrap/Config.in                           |  2 +-
 package/fcgiwrap/fcgiwrap.hash                       |  2 +-
 package/fcgiwrap/fcgiwrap.mk                         |  4 ++--
 4 files changed, 24 insertions(+), 4 deletions(-)
 create mode 100644 package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch

--
2.8.1

#13 lore raw

PATCH v2 1/2 fcgiwrap: Bump to 99c942c90063c73734e56bacaa65f947772d9186.

fcgiwrap was not updated since April 2015, but the last GitHub release is from February 2013. Therefore, bump fcgiwrap to the latest commit as it features fixes and improvements, but is unlikely to be part of a release soon.

Update as well:
* the license file (latest commit features a COPYING file),
* the Config.in URL, as the previous "official" URL now returns an HTTP 502 error.

---
 package/fcgiwrap/Config.in     | 2 +-
 package/fcgiwrap/fcgiwrap.hash | 2 +-
 package/fcgiwrap/fcgiwrap.mk   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
package/fcgiwrap/Config.in +1 -1
index c3a31fc..b1dbd72 100644
@@ -7,4 +7,4 @@ config BR2_PACKAGE_FCGIWRAP
 	  over FastCGI. It hopes to provide clean CGI support to Nginx
 	  (and other web servers that may need it).
 
-	  https://nginx.localdomain.pl/wiki/FcgiWrap
+	  https://github.com/gnosek/fcgiwrap
package/fcgiwrap/fcgiwrap.hash +1 -1
index 510e1ff..4ad8b0b 100644
@@ -1,2 +1,2 @@
 # Locally calculated
-sha256 4c7de0db2634c38297d5fcef61ab4a3e21856dd7247d49c33d9b19542bd1c61f  fcgiwrap-1.1.0.tar.gz
+sha256 c72f2933669ebd21605975c5a11f26b9739e32e4f9d324fb9e1a1925e9c2ae88  fcgiwrap-99c942c90063c73734e56bacaa65f947772d9186.tar.gz
package/fcgiwrap/fcgiwrap.mk +2 -2
index 698a130..dd74c1e 100644
@@ -4,11 +4,11 @@
 #
 ################################################################################
 
-FCGIWRAP_VERSION = 1.1.0
+FCGIWRAP_VERSION = 99c942c90063c73734e56bacaa65f947772d9186
 FCGIWRAP_SITE = $(call github,gnosek,fcgiwrap,$(FCGIWRAP_VERSION))
 FCGIWRAP_DEPENDENCIES = host-pkgconf libfcgi
 FCGIWRAP_LICENSE = MIT
-FCGIWRAP_LICENSE_FILES = fcgiwrap.c
+FCGIWRAP_LICENSE_FILES = COPYING
 FCGIWRAP_AUTORECONF = YES
 
 ifeq ($(BR2_PACKAGE_SYSTEMD),y)
Signature · 1 line
2.8.1
#14 lore raw

PATCH 1/2 fcgiwrap: Bump to 99c942c90063c73734e56bacaa65f947772d9186.

Hello,

Quoted 10 lines · Thomas Claveirole

fcgiwrap was not updated since April 2015, but the last GitHub release is from February 2013. Therefore, bump fcgiwrap to the latest commit as it features fixes and improvements, but is unlikely to be part of a release soon.

Update as well:
* the license file (latest commit features a COPYING file),
* the Config.in URL, as the previous "official" URL now returns an HTTP 502 error.

Quoted 6 lines
---
 package/fcgiwrap/Config.in     | 2 +-
 package/fcgiwrap/fcgiwrap.hash | 2 +-
 package/fcgiwrap/fcgiwrap.mk   | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#15 lore raw

PATCH v2 2/2 fcgiwrap: Add a patch to link with libsystemd, not libsystemd-daemon.

In reply to Thomas Claveirole
---
 ...ith-libsystemd-instead-of-libsystemd-daemon.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch
package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch new file +20 -0
new file mode 100644
index 0000000..e88706f
@@ -0,0 +1,20 @@
+configure.ac: Check for libsystemd, not libsystemd-daemon.
+
+Newer versions of systemd do not provide libsystemd-daemon anymore.
+Therefore, use libsystemd instead.
+
+Signed-off-by: Thomas Claveirole <[email protected]>
+
+diff --git a/configure.ac b/configure.ac
+index bb3674e..2b02ef4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -28,7 +28,7 @@ AC_ARG_WITH([systemd],
+   [], [with_systemd=check])
+ have_systemd=no
+ if test "x$with_systemd" != "xno"; then
+-  PKG_CHECK_MODULES(systemd, [libsystemd-daemon],
++  PKG_CHECK_MODULES(systemd, [libsystemd],
+     [AC_DEFINE(HAVE_SYSTEMD, 1, [Define if systemd is available])
+     have_systemd=yes],
+   have_systemd=no)
Signature · 1 line
2.8.1
#16 lore raw

PATCH 2/2 fcgiwrap: Add a patch to link with libsystemd, not libsystemd-daemon.

Hello,

Quoted 1 line · Thomas Claveirole

I've added a reference to the autobuilder fixed by this commit, and applied. However, see below...

Quoted 11 lines
---
 ...ith-libsystemd-instead-of-libsystemd-daemon.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch
package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch new file +0 -0
new file mode 100644
index 0000000..e88706f

package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch line 6

Quoted 6 lines
package/fcgiwrap/0002-link-with-libsystemd-instead-of-libsystemd-daemon.patch new file +6 -0
@@ -0,0 +1,20 @@
+configure.ac: Check for libsystemd, not libsystemd-daemon.
+
+Newer versions of systemd do not provide libsystemd-daemon anymore.
+Therefore, use libsystemd instead.
+
+Signed-off-by: Thomas Claveirole <[email protected]>

it would have been good for this patch to be formatted with "git format-patch", just like the existing 0001 patch on this package.

Also, both patches should be submitted upstream, especially since upstream is hosted on Github, which makes it really easy to submit pull requests.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#17 lore raw

PATCH v2 2/2 fcgiwrap: Add a patch to link with libsystemd, not libsystemd-daemon.

Quoted 3 lines

Also, both patches should be submitted upstream, especially since upstream is hosted on Github, which makes it really easy to submit pull requests.

You are right indeed. I just did it:

https://github.com/gnosek/fcgiwrap/pull/37

Thanks for this quick feedback,

Signature · 8 lines
Thomas Claveirole <[email protected]>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160719/1a66da47/attachment.asc>
#18 lore raw

PATCH v3 1/2 libfcgi (0003-link-against-math.patch): Do actually link when needed.

In reply to Thomas Claveirole

Dear Thomas Claveirole,

Quoted 10 lines · Thomas Claveirole

libfcgi uses frexp() and thus should link with libm, but fails to do so. Thus link errors with programs that use libfcgi (the bug does appear only with uClibc, because the GNU libc provides frexp() directly in libc.so). Modify 0003-link-against-math.patch so libfcgi links against math, instead of programs that need it.

---
 package/libfcgi/0003-link-against-math.patch | 36 ++++++++++------------------
 1 file changed, 12 insertions(+), 24 deletions(-)

Applied with a slightly edited commit title, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com