package/nginx: fix libxslt support
PATCH 1/5 package/nginx: fix libxslt support
Change to using pkg-config to find libxslt and it dependencies.
This Fixes:
http://autobuild.buildroot.net/results/382699bbed15f598625b9296e464d1349ef559f8
--- ...bxslt-conf-allow-to-override-ngx_feature_.patch | 42 ---------------------- ...0004-auto-lib-libxslt-conf-use-pkg-config.patch | 31 ++++++++++++++++ package/nginx/nginx.mk | 7 ++-- 3 files changed, 35 insertions(+), 45 deletions(-) delete mode 100644 package/nginx/0004-auto-lib-libxslt-conf-allow-to-override-ngx_feature_.patch create mode 100644 package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
package/nginx/0004-auto-lib-libxslt-conf-allow-to-override-ngx_feature_.patch deleted +0 -42
@@ -1,42 +0,0 @@ -From 5d281572d0afbf69d934737e1ee4c553670a46cc Mon Sep 17 00:00:00 2001 -From: Samuel Martin <[email protected]> -Date: Thu, 29 May 2014 19:22:27 +0200 -Subject: [PATCH 4/5] auto/lib/libxslt/conf: allow to override ngx_feature_path - and ngx_feature_libs - -Because libxml2 headers are not in /usr/include by default, hardcoding the -include directory to /usr/include/libxml2 does not play well when -cross-compiling, or if libxml2 has been installed somewhere else. - -This patch allows to define/override the libxslt include directory, and -the libxslt libs flags. - -Being able to override the include location is especially useful when -cross-compiling to prevent gcc from complaining about unsafe include -location for cross-compilation (-Wpoision-system-directories). - -So far, this warning is only triggered by libxslt. - -Signed-off-by: Samuel Martin <[email protected]> ---- - auto/lib/libxslt/conf | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf -index bc19d83..386f1a0 100644 ---- a/auto/lib/libxslt/conf -+++ b/auto/lib/libxslt/conf -@@ -12,8 +12,8 @@ - #include <libxslt/xsltInternals.h> - #include <libxslt/transform.h> - #include <libxslt/xsltutils.h>" -- ngx_feature_path="/usr/include/libxml2" -- ngx_feature_libs="-lxml2 -lxslt" -+ ngx_feature_path="${ngx_feature_path_libxslt:=/usr/include/libxml2}" -+ ngx_feature_libs="${ngx_feature_libs_libxslt:=-lxml2 -lxslt}" - ngx_feature_test="xmlParserCtxtPtr ctxt = NULL; - xsltStylesheetPtr sheet = NULL; - xmlDocPtr doc; --- -1.9.2 -
package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 211b9f19a3a62826fadef55d2f89d6f66fbf4aa6 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <[email protected]> +Date: Thu, 29 May 2014 19:22:27 +0200 +Subject: [PATCH 4/8] auto/lib/libxslt/conf: use pkg-config + +Change to using pkg-config to find the path to libxslt and its +dependencies. + +Signed-off-by: Martin Bark <[email protected]> +--- + auto/lib/libxslt/conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf +index 3a0f37b..3c2a60e 100644 +--- a/auto/lib/libxslt/conf ++++ b/auto/lib/libxslt/conf +@@ -12,8 +12,8 @@ + #include <libxslt/xsltInternals.h> + #include <libxslt/transform.h> + #include <libxslt/xsltutils.h>" +- ngx_feature_path="/usr/include/libxml2" +- ngx_feature_libs="-lxml2 -lxslt" ++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I libxslt|sed 's/-I//g')" ++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs libxslt)" + ngx_feature_test="xmlParserCtxtPtr ctxt = NULL; + xsltStylesheetPtr sheet = NULL; + xmlDocPtr doc; +-- +2.8.2 +
package/nginx/nginx.mk +4 -3
@@ -8,6 +8,7 @@ NGINX_VERSION = 1.10.0 NGINX_SITE = http://nginx.org/download NGINX_LICENSE = BSD-2c NGINX_LICENSE_FILES = LICENSE +NGINX_DEPENDENCIES = host-pkgconf NGINX_CONF_OPTS = \ --crossbuild=Linux::$(BR2_ARCH) \
@@ -118,8 +119,6 @@ endif ifeq ($(BR2_PACKAGE_NGINX_HTTP_XSLT_MODULE),y) NGINX_DEPENDENCIES += libxml2 libxslt NGINX_CONF_OPTS += --with-http_xslt_module -NGINX_CONF_ENV += \ - ngx_feature_path_libxslt=$(STAGING_DIR)/usr/include/libxml2 endif ifeq ($(BR2_PACKAGE_NGINX_HTTP_IMAGE_FILTER_MODULE),y)
@@ -236,7 +235,9 @@ endef NGINX_PRE_CONFIGURE_HOOKS += NGINX_DISABLE_WERROR define NGINX_CONFIGURE_CMDS - cd $(@D) ; $(NGINX_CONF_ENV) ./configure $(NGINX_CONF_OPTS) + cd $(@D) ; $(NGINX_CONF_ENV) \ + PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ + ./configure $(NGINX_CONF_OPTS) endef define NGINX_BUILD_CMDS
Signature · 1 line
2.8.2
PATCH 2/5 package/nginx: fix openssl support
Change to using pkg-config to find openssl and its dependencies.
This fixes:
http://autobuild.buildroot.net/results/17db76c3a099e7592af343bbe119dfe717cd7999/
--- ...0006-auto-lib-openssl-conf-use-pkg-config.patch | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch
package/nginx/0006-auto-lib-openssl-conf-use-pkg-config.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 756556d127da291cad8a2c007a89124a692aef7f Mon Sep 17 00:00:00 2001 +From: Martin Bark <[email protected]> +Date: Fri, 6 May 2016 14:48:31 +0100 +Subject: [PATCH 6/8] auto/lib/openssl/conf: use pkg-config + +Change to using pkg-config to find the path to openssl and its +dependencies. + +Signed-off-by: Martin Bark <[email protected]> +--- + auto/lib/openssl/conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf +index 39d9602..995c6f3 100644 +--- a/auto/lib/openssl/conf ++++ b/auto/lib/openssl/conf +@@ -50,8 +50,8 @@ else + ngx_feature_name="NGX_OPENSSL" + ngx_feature_run=no + ngx_feature_incs="#include <openssl/ssl.h>" +- ngx_feature_path= +- ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL" ++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|sed 's/-I//g')" ++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl)" + ngx_feature_test="SSL_CTX_set_options(NULL, 0)" + . auto/feature + +-- +2.8.2 +
Signature · 1 line
2.8.2
PATCH 3/5 package/nginx: fix libgd support
In reply to Martin BarkChange to using gdlib-config to find libgd and its dependencies.
This fixes:
http://autobuild.buildroot.net/results/d1806140eccb1202cb8b223289510d64fb28acb6/
--- .../0007-auto-lib-libgd-conf-use-pkg-config.patch | 31 ++++++++++++++++++++++ package/nginx/nginx.mk | 1 + 2 files changed, 32 insertions(+) create mode 100644 package/nginx/0007-auto-lib-libgd-conf-use-pkg-config.patch
package/nginx/0007-auto-lib-libgd-conf-use-pkg-config.patch new file +31 -0
@@ -0,0 +1,31 @@ +From fd9885fe5fef5826034547ca6be7299863f99769 Mon Sep 17 00:00:00 2001 +From: Martin Bark <[email protected]> +Date: Fri, 6 May 2016 14:48:49 +0100 +Subject: [PATCH 7/8] auto/lib/libgd/conf: use pkg-config + +Change to using pkg-config to find the path to libgd and its +dependencies. + +Signed-off-by: Martin Bark <[email protected]> +--- + auto/lib/libgd/conf | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/auto/lib/libgd/conf b/auto/lib/libgd/conf +index 6e4e91c..1c536a2 100644 +--- a/auto/lib/libgd/conf ++++ b/auto/lib/libgd/conf +@@ -7,8 +7,8 @@ + ngx_feature_name= + ngx_feature_run=no + ngx_feature_incs="#include <gd.h>" +- ngx_feature_path= +- ngx_feature_libs="-lgd" ++ ngx_feature_path="$(${GDLIB_CONFIG:=gdlib-config} --includedir)" ++ ngx_feature_libs="$(${GDLIB_CONFIG:=gdlib-config} --libs)" + ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);" + . auto/feature + +-- +2.8.2 +
package/nginx/nginx.mk +1 -0
@@ -237,6 +237,7 @@ NGINX_PRE_CONFIGURE_HOOKS += NGINX_DISABLE_WERROR define NGINX_CONFIGURE_CMDS cd $(@D) ; $(NGINX_CONF_ENV) \ PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ + GDLIB_CONFIG=$(STAGING_DIR)/usr/bin/gdlib-config \ ./configure $(NGINX_CONF_OPTS) endef
Signature · 1 line
2.8.2
PATCH 4/5 package/nginx: fix dlopen support
In reply to Martin BarkOnly include dlfcn.h on systems that support it
This fixes:
http://autobuild.buildroot.net/results/f72a9a81e21166af20332d835d71651be7c016c3/
--- ...-ngx_linux_config.h-only-include-dlfcn.h-.patch | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 package/nginx/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch
package/nginx/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 8dc9dffc1f99ac951865f3135dfb5061a08d1f85 Mon Sep 17 00:00:00 2001 +From: Martin Bark <[email protected]> +Date: Fri, 6 May 2016 16:29:17 +0100 +Subject: [PATCH 8/8] src/os/unix/ngx_linux_config.h: only include dlfcn.h if + available + +Signed-off-by: Martin Bark <[email protected]> +--- + src/os/unix/ngx_linux_config.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/src/os/unix/ngx_linux_config.h b/src/os/unix/ngx_linux_config.h +index 2f6129d..4244086 100644 +--- a/src/os/unix/ngx_linux_config.h ++++ b/src/os/unix/ngx_linux_config.h +@@ -55,10 +55,12 @@ + #include <crypt.h> + #include <sys/utsname.h> /* uname() */ + +-#include <dlfcn.h> ++#include <ngx_auto_config.h> + + +-#include <ngx_auto_config.h> ++#if (NGX_HAVE_DLOPEN) ++#include <dlfcn.h> ++#endif + + + #if (NGX_HAVE_POSIX_SEM) +-- +2.8.2 +
Signature · 1 line
2.8.2
PATCH 5/5 package/nginx: add libatomic_ops support
In reply to Martin BarkForce the use of libatomics_ops on the sparc v8 and leon3 platforms to allow nginx to build. Optionally use libatomic_ops on other platforms.
This fixes:
http://autobuild.buildroot.net/results/20dc41cd62887222d2569d81b5865893baeafaae/
http://autobuild.buildroot.net/results/eb47af0c8df6fae82859865fb8b9912f45960444/
--- package/nginx/Config.in | 1 + package/nginx/nginx.mk | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
package/nginx/Config.in +1 -0
@@ -1,6 +1,7 @@ menuconfig BR2_PACKAGE_NGINX bool "nginx" depends on BR2_USE_MMU # fork() + select BR2_PACKAGE_LIBATOMIC_OPS if BR2_sparc_v8 || BR2_sparc_leon3 help nginx is an HTTP and reverse proxy server, as well as a mail proxy server.
package/nginx/nginx.mk +13 -3
@@ -14,7 +14,6 @@ NGINX_CONF_OPTS = \ --crossbuild=Linux::$(BR2_ARCH) \ --with-cc="$(TARGET_CC)" \ --with-cpp="$(TARGET_CC)" \ - --with-cc-opt="$(TARGET_CFLAGS)" \ --with-ld-opt="$(TARGET_LDFLAGS)" \ --with-ipv6
@@ -36,7 +35,6 @@ NGINX_CONF_ENV += \ ngx_force_c99_have_variadic_macros=yes \ ngx_force_gcc_have_variadic_macros=yes \ ngx_force_gcc_have_atomic=yes \ - ngx_force_have_libatomic=no \ ngx_force_have_epoll=yes \ ngx_force_have_sendfile=yes \ ngx_force_have_sendfile64=yes \
@@ -68,6 +66,17 @@ NGINX_CONF_OPTS += \ $(if $(BR2_PACKAGE_NGINX_FILE_AIO),--with-file-aio) \ $(if $(BR2_PACKAGE_NGINX_THREADS),--with-threads) +ifeq ($(BR2_PACKAGE_LIBATOMIC_OPS),y) +NGINX_DEPENDENCIES += libatomic_ops +NGINX_CONF_OPTS += --with-libatomic +NGINX_CONF_ENV += ngx_force_have_libatomic=yes +ifeq ($(BR2_sparc_v8)$(BR2_sparc_leon3),y) +NGINX_CFLAGS += "-DAO_NO_SPARC_V9" +endif +else +NGINX_CONF_ENV += ngx_force_have_libatomic=no +endif + ifeq ($(BR2_PACKAGE_PCRE),y) NGINX_DEPENDENCIES += pcre NGINX_CONF_OPTS += --with-pcre
@@ -238,7 +247,8 @@ define NGINX_CONFIGURE_CMDS cd $(@D) ; $(NGINX_CONF_ENV) \ PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \ GDLIB_CONFIG=$(STAGING_DIR)/usr/bin/gdlib-config \ - ./configure $(NGINX_CONF_OPTS) + ./configure $(NGINX_CONF_OPTS) \ + --with-cc-opt="$(TARGET_CFLAGS) $(NGINX_CFLAGS)" endef define NGINX_BUILD_CMDS
Signature · 1 line
2.8.2
Thomas Petazzoni
AppliedPATCH 1/5 package/nginx: fix libxslt support
In reply to Martin BarkHello,
Quoted 5 lines · Martin Bark
Change to using pkg-config to find libxslt and it dependencies.
This Fixes:
http://autobuild.buildroot.net/results/382699bbed15f598625b9296e464d1349ef559f8
Quoted 8 lines
Signed-off-by Martin Bark <[email protected]>--- ...bxslt-conf-allow-to-override-ngx_feature_.patch | 42 ---------------------- ...0004-auto-lib-libxslt-conf-use-pkg-config.patch | 31 ++++++++++++++++ package/nginx/nginx.mk | 7 ++-- 3 files changed, 35 insertions(+), 45 deletions(-) delete mode 100644 package/nginx/0004-auto-lib-libxslt-conf-allow-to-override-ngx_feature_.patch create mode 100644 package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
I've applied your 5 patches to the master branch, thanks for doing this work around nginx, much appreciated.
I have two comments though:
1/ Could you submit the nginx patches upstream? We currently have 8
patches on nginx, and it would be really good to reduce the size of this stack of patches.
2/ We normally don't number the patches on packages, i.e we don't want
the patches do have "PATCH x/y" in their title. Since the nginx patches already had a numbering, I applied your patches as-is. But as you can see now, this numbering is meaningless (which is why we don't want it in the first place). A follow-up commit removing this numbering would be good.
Thanks again!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/5 package/nginx: fix libxslt support
Thomas,
Quoted 17 lines · Thomas Petazzoni
Hello,
Quoted 5 lines · Martin Bark
Change to using pkg-config to find libxslt and it dependencies.
This Fixes:
http://autobuild.buildroot.net/results/382699bbed15f598625b9296e464d1349ef559f8Quoted 8 lines
Signed-off-by Martin Bark <[email protected]>--- ...bxslt-conf-allow-to-override-ngx_feature_.patch | 42 ---------------------- ...0004-auto-lib-libxslt-conf-use-pkg-config.patch | 31 ++++++++++++++++ package/nginx/nginx.mk | 7 ++-- 3 files changed, 35 insertions(+), 45 deletions(-) delete mode 100644 package/nginx/0004-auto-lib-libxslt-conf-allow-to-override-ngx_feature_.patch create mode 100644 package/nginx/0004-auto-lib-libxslt-conf-use-pkg-config.patch
Quoted 8 lines
I've applied your 5 patches to the master branch, thanks for doing this work around nginx, much appreciated.
I have two comments though:
1/ Could you submit the nginx patches upstream? We currently have 8
patches on nginx, and it would be really good to reduce the size of this stack of patches.
yes I'll work on that
Quoted 7 lines
2/ We normally don't number the patches on packages, i.e we don't want
the patches do have "PATCH x/y" in their title. Since the nginx patches already had a numbering, I applied your patches as-is. But as you can see now, this numbering is meaningless (which is why we don't want it in the first place). A follow-up commit removing this numbering would be good.
I have submitted a patch to correct this. Thanks for letting me know, I'll avoid that in the future.
Thanks
Martin
Quoted 8 lines
Thanks again!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com