diff options
Diffstat (limited to 'patches/nginx-1.16.1')
11 files changed, 762 insertions, 0 deletions
diff --git a/patches/nginx-1.16.1/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch b/patches/nginx-1.16.1/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch new file mode 100644 index 000000000..bc4c8d527 --- /dev/null +++ b/patches/nginx-1.16.1/0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch @@ -0,0 +1,85 @@ +From: Samuel Martin <s.martin49@gmail.com> +Date: Tue, 4 Jul 2017 11:09:20 -0400 +Subject: [PATCH] auto/type/sizeof: rework autotest to be cross-compilation + friendly + +Rework the sizeof test to do the checks at compile time instead of at +runtime. This way, it does not break when cross-compiling for a +different CPU architecture. + +Signed-off-by: Samuel Martin <s.martin49@gmail.com> + +Refresh for 1.8.0. + +Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> +[martin@barkynet.com: Updated for 1.10.0] +Signed-off-by: Martin Bark <martin@barkynet.com> +Signed-off-by: Adam Duskett <Adamduskett@outlook.com> +Refresh for 1.12.0 +--- + auto/types/sizeof | 37 ++++++++++++++++++++++++++++--------- + 1 file changed, 28 insertions(+), 9 deletions(-) + +diff --git a/auto/types/sizeof b/auto/types/sizeof +index 480d8cfa49aa..61dcd2de5d44 100644 +--- a/auto/types/sizeof ++++ b/auto/types/sizeof +@@ -14,7 +14,7 @@ END + + ngx_size= + +-cat << END > $NGX_AUTOTEST.c ++cat << _EOF > $NGX_AUTOTEST.c + + #include <sys/types.h> + #include <sys/time.h> +@@ -25,22 +25,41 @@ $NGX_INCLUDE_UNISTD_H + $NGX_INCLUDE_INTTYPES_H + $NGX_INCLUDE_AUTO_CONFIG_H + +-int main(void) { +- printf("%d", (int) sizeof($ngx_type)); ++#if !defined( PASTE) ++#define PASTE2( x, y) x##y ++#define PASTE( x, y) PASTE2( x, y) ++#endif /* PASTE */ ++ ++#define SAY_IF_SIZEOF( typename, type, size) \\ ++ static char PASTE( PASTE( PASTE( sizeof_, typename), _is_), size) \\ ++ [(sizeof(type) == (size)) ? 1 : -1] ++ ++SAY_IF_SIZEOF(TEST_TYPENAME, TEST_TYPE, TEST_SIZE); ++ ++int main(void) ++{ + return 0; + } + +-END ++_EOF + + +-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ +- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs" ++_ngx_typename=`echo "$ngx_type" | sed 's/ /_/g;s/\*/p/'` ++ngx_size="-1" ++ngx_size=`for i in 1 2 4 8 16 ; do \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -DTEST_TYPENAME="$_ngx_typename" -DTEST_TYPE="$ngx_type" -DTEST_SIZE="$i" \ ++ $NGX_AUTOTEST.c -o $NGX_AUTOTEST \ ++ $NGX_LD_OPT $ngx_feature_libs >/dev/null 2>&1 || continue ;\ ++ echo $i ; break ; done` + +-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" ++rm -rf $NGX_AUTOTEST* + ++if test -z $ngx_size ; then ++ ngx_size=-1 ++fi + +-if [ -x $NGX_AUTOTEST ]; then +- ngx_size=`$NGX_AUTOTEST` ++if [ $ngx_size -gt 0 ]; then + echo " $ngx_size bytes" + fi + diff --git a/patches/nginx-1.16.1/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch b/patches/nginx-1.16.1/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch new file mode 100644 index 000000000..4742694ce --- /dev/null +++ b/patches/nginx-1.16.1/0002-auto-feature-add-mechanism-allowing-to-force-feature.patch @@ -0,0 +1,131 @@ +From: Samuel Martin <s.martin49@gmail.com> +Date: Sun, 4 May 2014 00:40:49 +0200 +Subject: [PATCH] auto/feature: add mechanism allowing to force feature run + test result + +Whenever a feature needs to run a test, the ngx_feature_run_force_result +variable can be set to the desired test result, and thus skip the test. + +Therefore, the generated config.h file will honor these presets. + +This mechanism aims to make easier cross-compilation support. + +Signed-off-by: Samuel Martin <s.martin49@gmail.com> +--- + auto/feature | 80 ++++++++++++++++++++++++++++++++++++++++++++---------------- + 1 file changed, 59 insertions(+), 21 deletions(-) + +diff --git a/auto/feature b/auto/feature +index 3561f5941f24..8016d802e7a8 100644 +--- a/auto/feature ++++ b/auto/feature +@@ -52,50 +52,88 @@ if [ -x $NGX_AUTOTEST ]; then + case "$ngx_feature_run" in + + yes) +- # /bin/sh is used to intercept "Killed" or "Abort trap" messages +- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then +- echo " found" ++ if test -n "$ngx_feature_run_force_result" ; then ++ echo " not tested (maybe cross-compiling)" ++ if test -n "$ngx_feature_name" ; then ++ if test "$ngx_feature_run_force_result" = "yes" ; then ++ have=$ngx_have_feature . auto/have ++ fi ++ fi + ngx_found=yes ++ else + +- if test -n "$ngx_feature_name"; then +- have=$ngx_have_feature . auto/have ++ # /bin/sh is used to intercept "Killed" or "Abort trap" messages ++ if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then ++ echo " found" ++ ngx_found=yes ++ ++ if test -n "$ngx_feature_name"; then ++ have=$ngx_have_feature . auto/have ++ fi ++ ++ else ++ echo " found but is not working" + fi + +- else +- echo " found but is not working" + fi + ;; + + value) +- # /bin/sh is used to intercept "Killed" or "Abort trap" messages +- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then +- echo " found" ++ if test -n "$ngx_feature_run_force_result" ; then ++ echo " not tested (maybe cross-compiling)" ++ cat << END >> $NGX_AUTO_CONFIG_H ++ ++#ifndef $ngx_feature_name ++#define $ngx_feature_name $ngx_feature_run_force_result ++#endif ++ ++END + ngx_found=yes ++ else + +- cat << END >> $NGX_AUTO_CONFIG_H ++ # /bin/sh is used to intercept "Killed" or "Abort trap" messages ++ if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then ++ echo " found" ++ ngx_found=yes ++ ++ cat << END >> $NGX_AUTO_CONFIG_H + + #ifndef $ngx_feature_name + #define $ngx_feature_name `$NGX_AUTOTEST` + #endif + + END +- else +- echo " found but is not working" ++ else ++ echo " found but is not working" ++ fi ++ + fi + ;; + + bug) +- # /bin/sh is used to intercept "Killed" or "Abort trap" messages +- if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then +- echo " not found" +- +- else +- echo " found" ++ if test -n "$ngx_feature_run_force_result" ; then ++ echo " not tested (maybe cross-compiling)" ++ if test -n "$ngx_feature_name"; then ++ if test "$ngx_feature_run_force_result" = "yes" ; then ++ have=$ngx_have_feature . auto/have ++ fi ++ fi + ngx_found=yes ++ else + +- if test -n "$ngx_feature_name"; then +- have=$ngx_have_feature . auto/have ++ # /bin/sh is used to intercept "Killed" or "Abort trap" messages ++ if /bin/sh -c $NGX_AUTOTEST >> $NGX_AUTOCONF_ERR 2>&1; then ++ echo " not found" ++ ++ else ++ echo " found" ++ ngx_found=yes ++ ++ if test -n "$ngx_feature_name"; then ++ have=$ngx_have_feature . auto/have ++ fi + fi ++ + fi + ;; + diff --git a/patches/nginx-1.16.1/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch b/patches/nginx-1.16.1/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch new file mode 100644 index 000000000..b468812bd --- /dev/null +++ b/patches/nginx-1.16.1/0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch @@ -0,0 +1,209 @@ +From: Samuel Martin <s.martin49@gmail.com> +Date: Thu, 29 May 2014 18:52:10 +0200 +Subject: [PATCH] auto/*: set ngx_feature_run_force_result for each feature + requiring run test + +Each feature requiring a run test has a matching preset variable (called +ngx_force_*) used to set ngx_feature_run_force_result. + +These ngx_force_* variables are passed through the environment at configure +time. + +Signed-off-by: Samuel Martin <s.martin49@gmail.com> + +Refresh for 1.8.0. + +Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> +--- + auto/cc/conf | 3 +++ + auto/cc/name | 1 + + auto/lib/libatomic/conf | 1 + + auto/os/darwin | 3 +++ + auto/os/linux | 4 ++++ + auto/unix | 8 ++++++++ + 6 files changed, 20 insertions(+) + +diff --git a/auto/cc/conf b/auto/cc/conf +index afbca62bcef9..ad42c8000cca 100644 +--- a/auto/cc/conf ++++ b/auto/cc/conf +@@ -184,6 +184,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + ngx_feature="gcc builtin atomic operations" + ngx_feature_name=NGX_HAVE_GCC_ATOMIC + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_gcc_have_atomic" + ngx_feature_incs= + ngx_feature_path= + ngx_feature_libs= +@@ -205,6 +206,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + ngx_feature="C99 variadic macros" + ngx_feature_name="NGX_HAVE_C99_VARIADIC_MACROS" + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_c99_have_variadic_macros" + ngx_feature_incs="#include <stdio.h> + #define var(dummy, ...) sprintf(__VA_ARGS__)" + ngx_feature_path= +@@ -219,6 +221,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + ngx_feature="gcc variadic macros" + ngx_feature_name="NGX_HAVE_GCC_VARIADIC_MACROS" + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_gcc_have_variadic_macros" + ngx_feature_incs="#include <stdio.h> + #define var(dummy, args...) sprintf(args)" + ngx_feature_path= +diff --git a/auto/cc/name b/auto/cc/name +index ded93f5bc989..7c3cb74a2bd1 100644 +--- a/auto/cc/name ++++ b/auto/cc/name +@@ -8,6 +8,7 @@ if [ "$NGX_PLATFORM" != win32 ]; then + ngx_feature="C compiler" + ngx_feature_name= + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_c_compiler" + ngx_feature_incs= + ngx_feature_path= + ngx_feature_libs= +diff --git a/auto/lib/libatomic/conf b/auto/lib/libatomic/conf +index d1e484ab32ee..37249161ea2f 100644 +--- a/auto/lib/libatomic/conf ++++ b/auto/lib/libatomic/conf +@@ -15,6 +15,7 @@ else + ngx_feature="atomic_ops library" + ngx_feature_name=NGX_HAVE_LIBATOMIC + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_have_libatomic" + ngx_feature_incs="#define AO_REQUIRE_CAS + #include <atomic_ops.h>" + ngx_feature_path= +diff --git a/auto/os/darwin b/auto/os/darwin +index 429468f7fd40..1ed47cca5c89 100644 +--- a/auto/os/darwin ++++ b/auto/os/darwin +@@ -33,6 +33,7 @@ NGX_KQUEUE_CHECKED=YES + ngx_feature="kqueue's EVFILT_TIMER" + ngx_feature_name="NGX_HAVE_TIMER_EVENT" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_timer_event" + ngx_feature_incs="#include <sys/event.h> + #include <sys/time.h>" + ngx_feature_path= +@@ -63,6 +64,7 @@ ngx_feature_test="int kq; + ngx_feature="Darwin 64-bit kqueue millisecond timeout bug" + ngx_feature_name=NGX_DARWIN_KEVENT_BUG + ngx_feature_run=bug ++ngx_feature_run_force_result="$ngx_force_kevent_bug" + ngx_feature_incs="#include <sys/event.h> + #include <sys/time.h>" + ngx_feature_path= +@@ -92,6 +94,7 @@ ngx_feature_test="int kq; + ngx_feature="sendfile()" + ngx_feature_name="NGX_HAVE_SENDFILE" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_sendfile" + ngx_feature_incs="#include <sys/types.h> + #include <sys/socket.h> + #include <sys/uio.h> +diff --git a/auto/os/linux b/auto/os/linux +index 5e280eca75db..50bf84d503d0 100644 +--- a/auto/os/linux ++++ b/auto/os/linux +@@ -37,6 +37,7 @@ fi + ngx_feature="epoll" + ngx_feature_name="NGX_HAVE_EPOLL" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_epoll" + ngx_feature_incs="#include <sys/epoll.h>" + ngx_feature_path= + ngx_feature_libs= +@@ -111,6 +112,7 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE" + ngx_feature="sendfile()" + ngx_feature_name="NGX_HAVE_SENDFILE" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_sendfile" + ngx_feature_incs="#include <sys/sendfile.h> + #include <errno.h>" + ngx_feature_path= +@@ -132,6 +134,7 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" + ngx_feature="sendfile64()" + ngx_feature_name="NGX_HAVE_SENDFILE64" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_sendfile64" + ngx_feature_incs="#include <sys/sendfile.h> + #include <errno.h>" + ngx_feature_path= +@@ -150,6 +153,7 @@ ngx_include="sys/prctl.h"; . auto/include + ngx_feature="prctl(PR_SET_DUMPABLE)" + ngx_feature_name="NGX_HAVE_PR_SET_DUMPABLE" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_pr_set_dumpable" + ngx_feature_incs="#include <sys/prctl.h>" + ngx_feature_path= + ngx_feature_libs= +diff --git a/auto/unix b/auto/unix +index 43d3b25a5456..3da005375cf5 100644 +--- a/auto/unix ++++ b/auto/unix +@@ -100,6 +100,7 @@ if test -z "$NGX_KQUEUE_CHECKED"; then + ngx_feature="kqueue's EVFILT_TIMER" + ngx_feature_name="NGX_HAVE_TIMER_EVENT" + ngx_feature_run=yes ++ ngx_feature_run_force_result="$ngx_force_have_timer_event" + ngx_feature_incs="#include <sys/event.h> + #include <sys/time.h>" + ngx_feature_path= +@@ -730,6 +731,7 @@ ngx_feature_test="char buf[1]; struct iovec vec[1]; ssize_t n; + ngx_feature="sys_nerr" + ngx_feature_name="NGX_SYS_NERR" + ngx_feature_run=value ++ngx_feature_run_force_result="$ngx_force_sys_nerr" + ngx_feature_incs='#include <errno.h> + #include <stdio.h>' + ngx_feature_path= +@@ -744,6 +746,7 @@ if [ $ngx_found = no ]; then + ngx_feature="_sys_nerr" + ngx_feature_name="NGX_SYS_NERR" + ngx_feature_run=value ++ ngx_feature_run_force_result="$ngx_force_sys_nerr" + ngx_feature_incs='#include <errno.h> + #include <stdio.h>' + ngx_feature_path= +@@ -759,6 +762,7 @@ if [ $ngx_found = no ]; then + ngx_feature='maximum errno' + ngx_feature_name=NGX_SYS_NERR + ngx_feature_run=value ++ ngx_feature_run_force_result="$ngx_force_sys_nerr" + ngx_feature_incs='#include <errno.h> + #include <string.h> + #include <stdio.h>' +@@ -841,6 +845,7 @@ ngx_feature_test="void *p; p = memalign(4096, 4096); + ngx_feature="mmap(MAP_ANON|MAP_SHARED)" + ngx_feature_name="NGX_HAVE_MAP_ANON" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_map_anon" + ngx_feature_incs="#include <sys/mman.h>" + ngx_feature_path= + ngx_feature_libs= +@@ -854,6 +859,7 @@ ngx_feature_test="void *p; + ngx_feature='mmap("/dev/zero", MAP_SHARED)' + ngx_feature_name="NGX_HAVE_MAP_DEVZERO" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_map_devzero" + ngx_feature_incs="#include <sys/mman.h> + #include <sys/stat.h> + #include <fcntl.h>" +@@ -869,6 +875,7 @@ ngx_feature_test='void *p; int fd; + ngx_feature="System V shared memory" + ngx_feature_name="NGX_HAVE_SYSVSHM" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_sysvshm" + ngx_feature_incs="#include <sys/ipc.h> + #include <sys/shm.h>" + ngx_feature_path= +@@ -883,6 +890,7 @@ ngx_feature_test="int id; + ngx_feature="POSIX semaphores" + ngx_feature_name="NGX_HAVE_POSIX_SEM" + ngx_feature_run=yes ++ngx_feature_run_force_result="$ngx_force_have_posix_sem" + ngx_feature_incs="#include <semaphore.h>" + ngx_feature_path= + ngx_feature_libs= diff --git a/patches/nginx-1.16.1/0004-auto-lib-libxslt-conf-use-pkg-config.patch b/patches/nginx-1.16.1/0004-auto-lib-libxslt-conf-use-pkg-config.patch new file mode 100644 index 000000000..bd0c07b84 --- /dev/null +++ b/patches/nginx-1.16.1/0004-auto-lib-libxslt-conf-use-pkg-config.patch @@ -0,0 +1,28 @@ +From: Samuel Martin <s.martin49@gmail.com> +Date: Thu, 29 May 2014 19:22:27 +0200 +Subject: [PATCH] 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 <martin@barkynet.com> +--- + auto/lib/libxslt/conf | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/auto/lib/libxslt/conf b/auto/lib/libxslt/conf +index 3063ac7ce0c0..3209e3642fdc 100644 +--- a/auto/lib/libxslt/conf ++++ b/auto/lib/libxslt/conf +@@ -12,8 +12,9 @@ + #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 -re 's/(^|\s)-I\s*(\S+)/\1\2/g')" ++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs libxslt)" + ngx_feature_test="xmlParserCtxtPtr ctxt = NULL; + xsltStylesheetPtr sheet = NULL; + xmlDocPtr doc = NULL; diff --git a/patches/nginx-1.16.1/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch b/patches/nginx-1.16.1/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch new file mode 100644 index 000000000..8a98f197f --- /dev/null +++ b/patches/nginx-1.16.1/0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch @@ -0,0 +1,134 @@ +From: Samuel Martin <s.martin49@gmail.com> +Date: Sun, 1 Jun 2014 16:05:04 +0200 +Subject: [PATCH] auto/unix: make sys_nerr guessing cross-friendly + +This patch replaces the default sys_nerr runtest with a test done at +buildtime. + +The idea behind this buildtime test is finding the value of the ERR_MAX +macro if defined, or the EHWPOISON (which is currently the last errno) +otherwise. + +Signed-off-by: Samuel Martin <s.martin49@gmail.com> + +Refresh for 1.8.0. + +Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> +--- + auto/os/sys_nerr | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + auto/unix | 10 ++++++++ + 2 files changed, 88 insertions(+) + create mode 100644 auto/os/sys_nerr + +diff --git a/auto/os/sys_nerr b/auto/os/sys_nerr +new file mode 100644 +index 000000000000..8970f5f6ec73 +--- /dev/null ++++ b/auto/os/sys_nerr +@@ -0,0 +1,78 @@ ++ ++# Copyright (C) Samuel Martin <s.martin49@gmail.com> ++ ++ ++echo $ngx_n "checking for sys_nerr value...$ngx_c" ++ ++# sys_nerr guessing is done using a (very) poor (but working) ++# heuristics, by checking for the value of ERR_MAX if defined, or ++# EHWPOISON otherwise. ++ ++cat << END >> $NGX_AUTOCONF_ERR ++ ++---------------------------------------- ++checking for sys_nerr value ++ ++END ++ ++ngx_sys_nerr= ++ ++cat << _EOF > $NGX_AUTOTEST.c ++ ++#include <stdio.h> ++#include <errno.h> ++ ++static char sys_nerr_test[ERR_MAX]; ++int main(void) ++{ ++ return 0; ++} ++ ++_EOF ++ ++if $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ $NGX_AUTOTEST.c -o $NGX_AUTOTEST \ ++ $NGX_LD_OPT $ngx_feature_libs >/dev/null 2>&1 ; then ++ _ngx_max_err_macro=ERR_MAX ++else ++ # the +2 has been empirically found! ++ _ngx_max_err_macro="EHWPOISON + 2" ++fi ++ ++cat << _EOF > $NGX_AUTOTEST.c ++ ++#include <stdio.h> ++#include <errno.h> ++ ++static char sys_nerr_test[(TEST_ERR_MAX == $_ngx_max_err_macro) ? 1 : -1]; ++int main(void) ++{ ++ return 0; ++} ++ ++_EOF ++ ++ ++ngx_sys_nerr=`for i in $(seq 0 2000) ; do \ ++ $CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ ++ -DTEST_ERR_MAX="$i" \ ++ $NGX_AUTOTEST.c -o $NGX_AUTOTEST \ ++ $NGX_LD_OPT $ngx_feature_libs >/dev/null 2>&1 || continue ;\ ++ echo $i ; break ; done` ++ ++rm -rf $NGX_AUTOTEST* ++ ++if test -z $ngx_sys_nerr ; then ++ ngx_size=0 ++ ngx_sys_nerr=0 ++fi ++ ++cat << END >> $NGX_AUTO_CONFIG_H ++ ++#ifndef $ngx_feature_name ++#define $ngx_feature_name $ngx_sys_nerr ++#endif ++ ++END ++ ++echo " $ngx_sys_nerr" +diff --git a/auto/unix b/auto/unix +index 3da005375cf5..a67ee3e2939c 100644 +--- a/auto/unix ++++ b/auto/unix +@@ -736,6 +736,10 @@ ngx_feature_incs='#include <errno.h> + #include <stdio.h>' + ngx_feature_path= + ngx_feature_libs= ++ ++if false ; then ++# Disabled because only valid for native build. ++ + ngx_feature_test='printf("%d", sys_nerr);' + . auto/feature + +@@ -784,6 +788,12 @@ if [ $ngx_found = no ]; then + . auto/feature + fi + ++else ++ # Cross-compilation support ++ . auto/os/sys_nerr ++ ++fi ++ + + ngx_feature="localtime_r()" + ngx_feature_name="NGX_HAVE_LOCALTIME_R" diff --git a/patches/nginx-1.16.1/0006-auto-lib-openssl-conf-use-pkg-config.patch b/patches/nginx-1.16.1/0006-auto-lib-openssl-conf-use-pkg-config.patch new file mode 100644 index 000000000..5cbd262fe --- /dev/null +++ b/patches/nginx-1.16.1/0006-auto-lib-openssl-conf-use-pkg-config.patch @@ -0,0 +1,27 @@ +From: Martin Bark <martin@barkynet.com> +Date: Fri, 6 May 2016 14:48:31 +0100 +Subject: [PATCH] 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 <martin@barkynet.com> +--- + 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 4fb52df7fe17..32ab2a045209 100644 +--- a/auto/lib/openssl/conf ++++ b/auto/lib/openssl/conf +@@ -59,8 +59,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_LIBPTHREAD" ++ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I openssl|sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')" ++ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs openssl) $NGX_LIBDL $NGX_LIBPTHREAD" + ngx_feature_test="SSL_CTX_set_options(NULL, 0)" + . auto/feature + diff --git a/patches/nginx-1.16.1/0007-auto-lib-libgd-conf-use-pkg-config.patch b/patches/nginx-1.16.1/0007-auto-lib-libgd-conf-use-pkg-config.patch new file mode 100644 index 000000000..2f1c80013 --- /dev/null +++ b/patches/nginx-1.16.1/0007-auto-lib-libgd-conf-use-pkg-config.patch @@ -0,0 +1,27 @@ +From: Martin Bark <martin@barkynet.com> +Date: Fri, 6 May 2016 14:48:49 +0100 +Subject: [PATCH] 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 <martin@barkynet.com> +--- + 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 678639767a63..1a4379a5e45c 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); + (void) img" + . auto/feature diff --git a/patches/nginx-1.16.1/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch b/patches/nginx-1.16.1/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch new file mode 100644 index 000000000..43b3e2e38 --- /dev/null +++ b/patches/nginx-1.16.1/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch @@ -0,0 +1,29 @@ +From: Martin Bark <martin@barkynet.com> +Date: Fri, 6 May 2016 16:29:17 +0100 +Subject: [PATCH] src/os/unix/ngx_linux_config.h: only include dlfcn.h if + available + +Signed-off-by: Martin Bark <martin@barkynet.com> +--- + 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 3036caebf630..e282a1f7533c 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) diff --git a/patches/nginx-1.16.1/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch b/patches/nginx-1.16.1/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch new file mode 100644 index 000000000..8d4ad867a --- /dev/null +++ b/patches/nginx-1.16.1/0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch @@ -0,0 +1,22 @@ +From: Marc Kleine-Budde <mkl@pengutronix.de> +Date: Wed, 2 Sep 2015 18:20:10 +0200 +Subject: [PATCH] auto/endianness: add mechanism allowing to force result + +Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> +--- + auto/endianness | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/auto/endianness b/auto/endianness +index 1b552b6b37b8..0f2394cfb6a1 100644 +--- a/auto/endianness ++++ b/auto/endianness +@@ -32,7 +32,7 @@ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \ + eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1" + + if [ -x $NGX_AUTOTEST ]; then +- if $NGX_AUTOTEST >/dev/null 2>&1; then ++ if $NGX_AUTOTEST >/dev/null 2>&1 || test "$ngx_force_have_little_endian" = "yes"; then + echo " little endian" + have=NGX_HAVE_LITTLE_ENDIAN . auto/have + else diff --git a/patches/nginx-1.16.1/0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch b/patches/nginx-1.16.1/0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch new file mode 100644 index 000000000..d8c4a04b1 --- /dev/null +++ b/patches/nginx-1.16.1/0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch @@ -0,0 +1,55 @@ +From: Clemens Gruber <clemens.gruber@pqgruber.com> +Date: Thu, 3 Aug 2017 15:47:08 +0200 +Subject: [PATCH] auto/unix: allow overriding the IPv6 build tests + +Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com> +--- + auto/feature | 7 ++++++- + auto/unix | 6 ++++-- + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/auto/feature b/auto/feature +index 8016d802e7a8..a9c6b6ee5eeb 100644 +--- a/auto/feature ++++ b/auto/feature +@@ -81,10 +81,15 @@ if [ -x $NGX_AUTOTEST ]; then + value) + if test -n "$ngx_feature_run_force_result" ; then + echo " not tested (maybe cross-compiling)" ++ if test "$ngx_feature_run_force_result" = "yes" ; then ++ ngx_feature_run_force_result_int=1 ++ else ++ ngx_feature_run_force_result_int=0 ++ fi + cat << END >> $NGX_AUTO_CONFIG_H + + #ifndef $ngx_feature_name +-#define $ngx_feature_name $ngx_feature_run_force_result ++#define $ngx_feature_name $ngx_feature_run_force_result_int + #endif + + END +diff --git a/auto/unix b/auto/unix +index a67ee3e2939c..1c3c1cf5996f 100644 +--- a/auto/unix ++++ b/auto/unix +@@ -440,7 +440,8 @@ ngx_feature_test="struct in_pktinfo pkt; + + ngx_feature="IPV6_RECVPKTINFO" + ngx_feature_name="NGX_HAVE_IPV6_RECVPKTINFO" +-ngx_feature_run=no ++ngx_feature_run_force_result="$ngx_force_ipv6" ++ngx_feature_run=value + ngx_feature_incs="#include <sys/socket.h> + #include <netinet/in.h>" + ngx_feature_path= +@@ -668,7 +669,8 @@ ngx_param=NGX_MAX_TIME_T_VALUE; ngx_value=$ngx_max_value; . auto/types/value + + ngx_feature="AF_INET6" + ngx_feature_name="NGX_HAVE_INET6" +-ngx_feature_run=no ++ngx_feature_run_force_result="$ngx_force_ipv6" ++ngx_feature_run=value + ngx_feature_incs="#include <sys/socket.h> + #include <netinet/in.h> + #include <arpa/inet.h>" diff --git a/patches/nginx-1.16.1/series b/patches/nginx-1.16.1/series new file mode 100644 index 000000000..92d0a70c8 --- /dev/null +++ b/patches/nginx-1.16.1/series @@ -0,0 +1,15 @@ +# generated by git-ptx-patches +#tag:base --start-number 0 +#tag:buildroot --start-number 1 +0001-auto-type-sizeof-rework-autotest-to-be-cross-compila.patch +0002-auto-feature-add-mechanism-allowing-to-force-feature.patch +0003-auto-set-ngx_feature_run_force_result-for-each-featu.patch +0004-auto-lib-libxslt-conf-use-pkg-config.patch +0005-auto-unix-make-sys_nerr-guessing-cross-friendly.patch +0006-auto-lib-openssl-conf-use-pkg-config.patch +0007-auto-lib-libgd-conf-use-pkg-config.patch +0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch +#tag:ptxdist --start-number 100 +0100-auto-endianness-add-mechanism-allowing-to-force-resu.patch +0101-auto-unix-allow-overriding-the-IPv6-build-tests.patch +# 2d82d97a87698e491d40c417a32a8a6b - git-ptx-patches magic |