initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,89 @@
From fb158af083e72c9aa0a8dfd4c6965f950192a230 Mon Sep 17 00:00:00 2001
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 <aduskett@gmail.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 480d8cf..61dcd2d 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
--
2.9.4
@@ -0,0 +1,135 @@
From ef72be22ad6d58e230f75553d80b470b80c3303a Mon Sep 17 00:00:00 2001
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 1145f28..a194b85 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
;;
--
1.9.2
@@ -0,0 +1,207 @@
From 57d9d632be9a9f7e3ac00f9eb10b069afd0b1543 Mon Sep 17 00:00:00 2001
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>
[rebased against v1.20.1]
Signed-off-by: Adam Duskett <Aduskett@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 | 7 +++++++
6 files changed, 19 insertions(+)
diff --git a/auto/cc/conf b/auto/cc/conf
index afbca62b..ad42c800 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 ded93f5b..7c3cb74a 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 d1e484ab..37249161 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 429468f7..1ed47cca 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 2c8a9bb8..eb4513ee 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=
@@ -136,6 +137,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=
@@ -157,6 +159,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=
@@ -175,6 +178,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 43d3b25a..3da00537 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=
@@ -722,6 +723,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=
@@ -737,6 +739,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=
@@ -806,6 +809,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=
@@ -819,6 +823,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>"
@@ -834,6 +839,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=
@@ -848,6 +854,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=
--
2.17.1
@@ -0,0 +1,34 @@
From 7783d63c87f94797aa134786214b0a84c000be75 Mon Sep 17 00:00:00 2001
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>
[Peter: updated for 1.15.6]
Signed-off-by: Peter Korsgaard <peter@korsgaard.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 3063ac7c..3209e364 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;
--
2.11.0
@@ -0,0 +1,135 @@
From 08617a8d29ee22831175697555558fec8f52772c Mon Sep 17 00:00:00 2001
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>
[rebased against v1.20.1]
Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
auto/os/sys_nerr | 78 ++++++++++++++++++++++++++++++++++++++++++++++++
auto/unix | 8 +++++
2 files changed, 86 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 0000000..8970f5f
--- /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 7dbf9d1..00a7370 100755
--- a/auto/unix
+++ b/auto/unix
@@ -744,10 +744,18 @@ if [ $ngx_found = no ]; then
#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
fi
+else
+ # Cross-compilation support
+ . auto/os/sys_nerr
+
+fi
+
ngx_feature="localtime_r()"
ngx_feature_name="NGX_HAVE_LOCALTIME_R"
--
1.9.1
@@ -0,0 +1,251 @@
From 4ba4b1e0bd1b69e124eb34c95ae9e7c087370efa Mon Sep 17 00:00:00 2001
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 | 187 +++++++++++++++++++++---------------------
1 file changed, 94 insertions(+), 93 deletions(-)
diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
index 4fb52df7..9f30490d 100644
--- a/auto/lib/openssl/conf
+++ b/auto/lib/openssl/conf
@@ -1,4 +1,3 @@
-
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
@@ -7,123 +6,125 @@ if [ $OPENSSL != NONE ]; then
case "$CC" in
- cl | bcc32)
- have=NGX_OPENSSL . auto/have
- have=NGX_SSL . auto/have
-
- CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
-
- CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
- CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
-
- if [ -f $OPENSSL/ms/do_ms.bat ]; then
- # before OpenSSL 1.1.0
- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
- else
- # OpenSSL 1.1.0+
- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
- CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
- fi
-
- # libeay32.lib requires gdi32.lib
- CORE_LIBS="$CORE_LIBS gdi32.lib"
- # OpenSSL 1.0.0 requires crypt32.lib
- CORE_LIBS="$CORE_LIBS crypt32.lib"
- ;;
-
- *)
- have=NGX_OPENSSL . auto/have
- have=NGX_SSL . auto/have
-
- CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
- CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
- CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
- CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
- CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
-
- if [ "$NGX_PLATFORM" = win32 ]; then
- CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
- fi
- ;;
+ cl | bcc32)
+ have=NGX_OPENSSL . auto/have
+ have=NGX_SSL . auto/have
+
+ CFLAGS="$CFLAGS -DNO_SYS_TYPES_H"
+
+ CORE_INCS="$CORE_INCS $OPENSSL/openssl/include"
+ CORE_DEPS="$CORE_DEPS $OPENSSL/openssl/include/openssl/ssl.h"
+
+ if [ -f $OPENSSL/ms/do_ms.bat ]; then
+ # before OpenSSL 1.1.0
+ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/ssleay32.lib"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libeay32.lib"
+ else
+ # OpenSSL 1.1.0+
+ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libssl.lib"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/openssl/lib/libcrypto.lib"
+ fi
+
+ # libeay32.lib requires gdi32.lib
+ CORE_LIBS="$CORE_LIBS gdi32.lib"
+ # OpenSSL 1.0.0 requires crypt32.lib
+ CORE_LIBS="$CORE_LIBS crypt32.lib"
+ ;;
+
+ *)
+ have=NGX_OPENSSL . auto/have
+ have=NGX_SSL . auto/have
+
+ CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
+ CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libssl.a"
+ CORE_LIBS="$CORE_LIBS $OPENSSL/.openssl/lib/libcrypto.a"
+ CORE_LIBS="$CORE_LIBS $NGX_LIBDL"
+ CORE_LIBS="$CORE_LIBS $NGX_LIBPTHREAD"
+
+ if [ "$NGX_PLATFORM" = win32 ]; then
+ CORE_LIBS="$CORE_LIBS -lgdi32 -lcrypt32 -lws2_32"
+ fi
+ ;;
esac
else
if [ "$NGX_PLATFORM" != win32 ]; then
- OPENSSL=NO
+ OPENSSL=NO
- ngx_feature="OpenSSL library"
- 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_test="SSL_CTX_set_options(NULL, 0)"
- . auto/feature
+ ngx_feature="OpenSSL library"
+ ngx_feature_name="NGX_OPENSSL"
+ ngx_feature_run=no
+ ngx_feature_incs="#include <openssl/ssl.h>"
+ ngx_feature_path=
+ 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_feature_test="SSL_CTX_set_options(NULL, 0)"
+ . auto/feature
- if [ $ngx_found = no ]; then
+ if [ $ngx_found = no ]; then
- # FreeBSD port
+ # FreeBSD port
- ngx_feature="OpenSSL library in /usr/local/"
- ngx_feature_path="/usr/local/include"
+ ngx_feature="OpenSSL library in /usr/local/"
+ ngx_feature_path="/usr/local/include"
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
- else
- ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
- fi
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
+ else
+ ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
+ fi
- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
- . auto/feature
- fi
+ . auto/feature
+ fi
- if [ $ngx_found = no ]; then
+ if [ $ngx_found = no ]; then
- # NetBSD port
+ # NetBSD port
- ngx_feature="OpenSSL library in /usr/pkg/"
- ngx_feature_path="/usr/pkg/include"
+ ngx_feature="OpenSSL library in /usr/pkg/"
+ ngx_feature_path="/usr/pkg/include"
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
- else
- ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
- fi
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
+ else
+ ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
+ fi
- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
- . auto/feature
- fi
+ . auto/feature
+ fi
- if [ $ngx_found = no ]; then
+ if [ $ngx_found = no ]; then
- # MacPorts
+ # MacPorts
- ngx_feature="OpenSSL library in /opt/local/"
- ngx_feature_path="/opt/local/include"
+ ngx_feature="OpenSSL library in /opt/local/"
+ ngx_feature_path="/opt/local/include"
- if [ $NGX_RPATH = YES ]; then
- ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
- else
- ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
- fi
+ if [ $NGX_RPATH = YES ]; then
+ ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
+ else
+ ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
+ fi
- ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+ ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
- . auto/feature
- fi
+ . auto/feature
+ fi
- if [ $ngx_found = yes ]; then
- have=NGX_SSL . auto/have
- CORE_INCS="$CORE_INCS $ngx_feature_path"
- CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
- OPENSSL=YES
- fi
+ if [ $ngx_found = yes ]; then
+ have=NGX_SSL . auto/have
+ CORE_INCS="$CORE_INCS $ngx_feature_path"
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+ OPENSSL=YES
+ fi
fi
if [ $OPENSSL != YES ]; then
@@ -136,7 +137,7 @@ into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
END
- exit 1
+ exit 1
fi
fi
--
2.17.1
@@ -0,0 +1,36 @@
From 0551f2e5eb4143be0aacc0185cdc4afc9ca80204 Mon Sep 17 00:00:00 2001
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>
[Peter: updated for 1.15.6]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
[Fabrice: use pkg-config instead of gdlib-config]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.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 67863976..1a4379a5 100644
--- a/auto/lib/libgd/conf
+++ b/auto/lib/libgd/conf
@@ -7,8 +7,9 @@
ngx_feature_name=
ngx_feature_run=no
ngx_feature_incs="#include <gd.h>"
- ngx_feature_path=
- ngx_feature_libs="-lgd"
+ ngx_feature_path="$(${PKG_CONFIG:=pkg-config} --cflags-only-I gdlib|
+ sed -re 's/(^|\s)-I\s*(\S+)/\1\2/g')"
+ ngx_feature_libs="$(${PKG_CONFIG:=pkg-config} --libs gdlib)"
ngx_feature_test="gdImagePtr img = gdImageCreateFromGifPtr(1, NULL);
(void) img"
. auto/feature
--
2.11.0
@@ -0,0 +1,33 @@
From 8dc9dffc1f99ac951865f3135dfb5061a08d1f85 Mon Sep 17 00:00:00 2001
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 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
@@ -0,0 +1,38 @@
From 79f1fe5251afc4e22a138b0c8f44fc9c94093b8b Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Fri, 2 Apr 2021 09:18:26 +0200
Subject: [PATCH] auto/os/linux: fix build with libxcrypt
If crypt_r is found in libcrypt, add -lcrypt to CORE_LIBS to avoid the
following build failure with libxcrypt:
objs/ngx_modules.o \
-lpcre -L/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib -lssl -lcrypto -L/home/giuliobenetti/autobuild/run/instance-3/output-1/host/bin/../xtensa-buildroot-linux-uclibc/sysroot/usr/lib -lxslt -lxml2 -lGeoIP \
-Wl,-E
/home/giuliobenetti/autobuild/run/instance-3/output-1/host/lib/gcc/xtensa-buildroot-linux-uclibc/9.3.0/../../../../xtensa-buildroot-linux-uclibc/bin/ld: objs/src/os/unix/ngx_user.o:/home/giuliobenetti/autobuild/run/instance-3/output-1/build/nginx-1.18.0/src/os/unix/ngx_user.c:18: undefined reference to `crypt_r'
Fixes:
- http://autobuild.buildroot.org/results/79a51b0d348e756517b5c9ce815a67f5c657e7e6
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
auto/os/linux | 3 +++
1 file changed, 3 insertions(+)
diff --git a/auto/os/linux b/auto/os/linux
index 5e280eca..04682812 100644
--- a/auto/os/linux
+++ b/auto/os/linux
@@ -232,6 +232,9 @@ ngx_feature_test="struct crypt_data cd;
crypt_r(\"key\", \"salt\", &cd);"
. auto/feature
+if [ $ngx_found = yes ]; then
+ CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+fi
ngx_include="sys/vfs.h"; . auto/include
--
2.30.2
@@ -0,0 +1,118 @@
From 4bd8fe780ff2064f2d4e9c905d8a98dd0f9b6191 Mon Sep 17 00:00:00 2001
From: Nevo Hed <nhed+buildroot@starry.com>
Date: Mon, 30 Aug 2021 13:28:13 -0400
Subject: [PATCH] Allow forcing of endianness for cross-compilation
Upstream-status: Invalid (upstream doesn't support cross-compilation)
See https://trac.nginx.org/nginx/ticket/2240
Signed-off-by: Nevo Hed <nhed+buildroot@starry.com>
---
auto/endianness | 61 ++++++++++++++++++++++++++++++++-----------------
auto/options | 6 +++++
2 files changed, 46 insertions(+), 21 deletions(-)
diff --git a/auto/endianness b/auto/endianness
index 1b552b6b..4b2a3cd7 100644
--- a/auto/endianness
+++ b/auto/endianness
@@ -26,25 +26,44 @@ int main(void) {
END
-ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
- -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
-
-eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
-
-if [ -x $NGX_AUTOTEST ]; then
- if $NGX_AUTOTEST >/dev/null 2>&1; then
- echo " little endian"
+case "${NGX_FORCE_ENDIANNESS}" in
+ little)
+ echo " little endian (forced)"
have=NGX_HAVE_LITTLE_ENDIAN . auto/have
- else
- echo " big endian"
- fi
-
- rm -rf $NGX_AUTOTEST*
-
-else
- rm -rf $NGX_AUTOTEST*
-
- echo
- echo "$0: error: cannot detect system byte ordering"
- exit 1
-fi
+ ;;
+
+ big)
+ echo " big endian (forced)"
+ ;;
+
+ "")
+ ngx_test="$CC $CC_TEST_FLAGS $CC_AUX_FLAGS \
+ -o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
+
+ eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
+
+ if [ -x $NGX_AUTOTEST ]; then
+ if $NGX_AUTOTEST >/dev/null 2>&1; then
+ echo " little endian"
+ have=NGX_HAVE_LITTLE_ENDIAN . auto/have
+ else
+ echo " big endian"
+ fi
+
+ rm -rf $NGX_AUTOTEST*
+
+ else
+ rm -rf $NGX_AUTOTEST*
+
+ echo
+ echo "$0: error: cannot detect system byte ordering"
+ exit 1
+ fi
+ ;;
+
+ *)
+ echo
+ echo "$0: error: invalid \"--force-endianness=${NGX_FORCE_ENDIANNESS}\""
+ exit 1
+ ;;
+esac
diff --git a/auto/options b/auto/options
index 80be906e..85a06456 100644
--- a/auto/options
+++ b/auto/options
@@ -17,6 +17,8 @@ NGX_USER=
NGX_GROUP=
NGX_BUILD=
+NGX_FORCE_ENDIANNESS=
+
CC=${CC:-cc}
CPP=
NGX_OBJS=objs
@@ -196,6 +198,8 @@ do
--user=*) NGX_USER="$value" ;;
--group=*) NGX_GROUP="$value" ;;
+ --force-endianness=*) NGX_FORCE_ENDIANNESS="$value" ;;
+
--crossbuild=*) NGX_PLATFORM="$value" ;;
--build=*) NGX_BUILD="$value" ;;
@@ -432,6 +436,8 @@ cat << END
--build=NAME set build name
--builddir=DIR set build directory
+ --force-endianness=<big>|<little> force endianness
+
--with-select_module enable select module
--without-select_module disable select module
--with-poll_module enable poll module
--
2.31.1
+452
View File
@@ -0,0 +1,452 @@
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.
http://nginx.org/
if BR2_PACKAGE_NGINX
config BR2_PACKAGE_NGINX_FILE_AIO
bool "file AIO support"
# Does not build, because nginx hardcodes using SYS_eventfd,
# but it's available on neither AArch64 nor ARC where only
# eventfd() is available. See
# https://bugs.launchpad.net/linaro-aarch64/+bug/1160013
depends on !BR2_aarch64
depends on !BR2_arc
config BR2_PACKAGE_NGINX_THREADS
bool "thread pool support"
depends on BR2_TOOLCHAIN_HAS_THREADS
comment "thread pool support needs a toolchain w/ threads"
depends on !BR2_TOOLCHAIN_HAS_THREADS
config BR2_PACKAGE_NGINX_HTTP
bool "http server"
default y
if BR2_PACKAGE_NGINX_HTTP
config BR2_PACKAGE_NGINX_HTTP_CACHE
bool "http cache support"
select BR2_PACKAGE_OPENSSL
comment "http modules"
config BR2_PACKAGE_NGINX_HTTP_SSL_MODULE
bool "ngx_http_ssl_module"
select BR2_PACKAGE_OPENSSL
help
Enable ngx_http_ssl_module
config BR2_PACKAGE_NGINX_HTTP_V2_MODULE
bool "ngx_http_v2_module"
select BR2_PACKAGE_ZLIB
help
Enable ngx_http_spdy_module
config BR2_PACKAGE_NGINX_HTTP_REALIP_MODULE
bool "ngx_http_realip_module"
help
Enable ngx_http_realip_module
config BR2_PACKAGE_NGINX_HTTP_ADDITION_MODULE
bool "ngx_http_addition_module"
help
Enable ngx_http_addition_module
config BR2_PACKAGE_NGINX_HTTP_XSLT_MODULE
bool "ngx_http_xslt_module"
select BR2_PACKAGE_LIBXML2
select BR2_PACKAGE_LIBXSLT
help
Enable ngx_http_xslt_module
config BR2_PACKAGE_NGINX_HTTP_IMAGE_FILTER_MODULE
bool "ngx_http_image_filter_module"
select BR2_PACKAGE_GD
select BR2_PACKAGE_JPEG
select BR2_PACKAGE_LIBPNG
help
Enable ngx_http_image_filter_module
config BR2_PACKAGE_NGINX_HTTP_GEOIP_MODULE
bool "ngx_http_geoip_module"
select BR2_PACKAGE_GEOIP
help
Enable ngx_http_geoip_module
config BR2_PACKAGE_NGINX_HTTP_SUB_MODULE
bool "ngx_http_sub_module"
help
Enable ngx_http_sub_module
config BR2_PACKAGE_NGINX_HTTP_DAV_MODULE
bool "ngx_http_dav_module"
help
Enable ngx_http_dav_module
config BR2_PACKAGE_NGINX_HTTP_FLV_MODULE
bool "ngx_http_flv_module"
help
Enable ngx_http_flv_module
config BR2_PACKAGE_NGINX_HTTP_MP4_MODULE
bool "ngx_http_mp4_module"
help
Enable ngx_http_mp4_module
config BR2_PACKAGE_NGINX_HTTP_GUNZIP_MODULE
bool "ngx_http_gunzip_module"
select BR2_PACKAGE_ZLIB
help
Enable ngx_http_gunzip_module
config BR2_PACKAGE_NGINX_HTTP_GZIP_STATIC_MODULE
bool "ngx_http_gzip_static_module"
select BR2_PACKAGE_ZLIB
help
Enable ngx_http_gzip_static_module
config BR2_PACKAGE_NGINX_HTTP_AUTH_REQUEST_MODULE
bool "ngx_http_auth_request_module"
help
Enable ngx_http_auth_request_module
config BR2_PACKAGE_NGINX_HTTP_RANDOM_INDEX_MODULE
bool "ngx_http_random_index_module"
help
Enable ngx_http_random_index_module
config BR2_PACKAGE_NGINX_HTTP_SECURE_LINK_MODULE
bool "ngx_http_secure_link_module"
select BR2_PACKAGE_OPENSSL
help
Enable ngx_http_secure_link_module
config BR2_PACKAGE_NGINX_HTTP_DEGRADATION_MODULE
bool "ngx_http_degradation_module"
help
Enable ngx_http_degradation_module
config BR2_PACKAGE_NGINX_HTTP_SLICE_MODULE
bool "ngx_http_slice_module"
help
Enable ngx_http_slice_module
config BR2_PACKAGE_NGINX_HTTP_STUB_STATUS_MODULE
bool "ngx_http_stub_status_module"
help
Enable ngx_http_stub_status_module
config BR2_PACKAGE_NGINX_HTTP_CHARSET_MODULE
bool "ngx_http_charset_module"
default y
help
Enable ngx_http_charset_module
config BR2_PACKAGE_NGINX_HTTP_GZIP_MODULE
bool "ngx_http_gzip_module"
default y
select BR2_PACKAGE_ZLIB
help
Enable ngx_http_gzip_module
config BR2_PACKAGE_NGINX_HTTP_SSI_MODULE
bool "ngx_http_ssi_module"
default y
help
Enable ngx_http_ssi_module
config BR2_PACKAGE_NGINX_HTTP_USERID_MODULE
bool "ngx_http_userid_module"
default y
help
Enable ngx_http_userid_module
config BR2_PACKAGE_NGINX_HTTP_ACCESS_MODULE
bool "ngx_http_access_module"
default y
help
Enable ngx_http_access_module
config BR2_PACKAGE_NGINX_HTTP_AUTH_BASIC_MODULE
bool "ngx_http_auth_basic_module"
default y
help
Enable ngx_http_auth_basic_module
config BR2_PACKAGE_NGINX_HTTP_AUTOINDEX_MODULE
bool "ngx_http_autoindex_module"
default y
help
Enable ngx_http_autoindex_module
config BR2_PACKAGE_NGINX_HTTP_GEO_MODULE
bool "ngx_http_geo_module"
default y
help
Enable ngx_http_geo_module
config BR2_PACKAGE_NGINX_HTTP_MAP_MODULE
bool "ngx_http_map_module"
default y
help
Enable ngx_http_map_module
config BR2_PACKAGE_NGINX_HTTP_SPLIT_CLIENTS_MODULE
bool "ngx_http_split_clients_module"
default y
help
Enable ngx_http_split_clients_module
config BR2_PACKAGE_NGINX_HTTP_REFERER_MODULE
bool "ngx_http_referer_module"
default y
help
Enable ngx_http_referer_module
config BR2_PACKAGE_NGINX_HTTP_REWRITE_MODULE
bool "ngx_http_rewrite_module"
default y
select BR2_PACKAGE_PCRE
help
Enable ngx_http_rewrite_module
config BR2_PACKAGE_NGINX_HTTP_PROXY_MODULE
bool "ngx_http_proxy_module"
default y
help
Enable ngx_http_proxy_module
config BR2_PACKAGE_NGINX_HTTP_FASTCGI_MODULE
bool "ngx_http_fastcgi_module"
default y
help
Enable ngx_http_fastcgi_module
config BR2_PACKAGE_NGINX_HTTP_UWSGI_MODULE
bool "ngx_http_uwsgi_module"
default y
help
Enable ngx_http_uwsgi_module
config BR2_PACKAGE_NGINX_HTTP_SCGI_MODULE
bool "ngx_http_scgi_module"
default y
help
Enable ngx_http_scgi_module
config BR2_PACKAGE_NGINX_HTTP_MEMCACHED_MODULE
bool "ngx_http_memcached_module"
default y
help
Enable ngx_http_memcached_module
config BR2_PACKAGE_NGINX_HTTP_LIMIT_CONN_MODULE
bool "ngx_http_limit_conn_module"
default y
help
Enable ngx_http_limit_conn_module
config BR2_PACKAGE_NGINX_HTTP_LIMIT_REQ_MODULE
bool "ngx_http_limit_req_module"
default y
help
Enable ngx_http_limit_req_module
config BR2_PACKAGE_NGINX_HTTP_EMPTY_GIF_MODULE
bool "ngx_http_empty_gif_module"
default y
help
Enable ngx_http_empty_gif_module
config BR2_PACKAGE_NGINX_HTTP_BROWSER_MODULE
bool "ngx_http_browser_module"
default y
help
Enable ngx_http_browser_module
config BR2_PACKAGE_NGINX_HTTP_UPSTREAM_IP_HASH_MODULE
bool "ngx_http_upstream_ip_hash_module"
default y
help
Enable ngx_http_upstream_ip_hash_module
config BR2_PACKAGE_NGINX_HTTP_UPSTREAM_LEAST_CONN_MODULE
bool "ngx_http_upstream_least_conn_module"
default y
help
Enable ngx_http_upstream_least_conn_module
config BR2_PACKAGE_NGINX_HTTP_UPSTREAM_KEEPALIVE_MODULE
bool "ngx_http_upstream_keepalive_module"
default y
help
Enable ngx_http_upstream_keepalive_module
config BR2_PACKAGE_NGINX_HTTP_UPSTREAM_RANDOM_MODULE
bool "ngx_http_upstream_random_module"
default y
help
Enable ngx_http_upstream_random_module
endif #BR2_PACKAGE_NGINX_HTTP
config BR2_PACKAGE_NGINX_MAIL
bool "mail proxy modules"
if BR2_PACKAGE_NGINX_MAIL
config BR2_PACKAGE_NGINX_MAIL_SSL_MODULE
bool "ngx_mail_ssl_module"
select BR2_PACKAGE_OPENSSL
help
Enable ngx_mail_ssl_module
config BR2_PACKAGE_NGINX_MAIL_POP3_MODULE
bool "ngx_mail_pop3_module"
default y
help
Enable ngx_mail_pop3_module
config BR2_PACKAGE_NGINX_MAIL_IMAP_MODULE
bool "ngx_mail_imap_module"
default y
help
Enable ngx_mail_imap_module
config BR2_PACKAGE_NGINX_MAIL_SMTP_MODULE
bool "ngx_mail_smtp_module"
default y
help
Enable ngx_mail_smtp_module
endif #BR2_PACKAGE_NGINX_MAIL
config BR2_PACKAGE_NGINX_STREAM
bool "stream proxy modules"
if BR2_PACKAGE_NGINX_STREAM
config BR2_PACKAGE_NGINX_STREAM_REALIP_MODULE
bool "ngx_stream_realip_module"
help
Enable ngx_stream_realip_module
config BR2_PACKAGE_NGINX_STREAM_SET_MODULE
bool "ngx_stream_set_module"
default y
help
Enable ngx_stream_set_module
config BR2_PACKAGE_NGINX_STREAM_SSL_MODULE
bool "ngx_stream_ssl_module"
select BR2_PACKAGE_OPENSSL
help
Enable ngx_stream_ssl_module
config BR2_PACKAGE_NGINX_STREAM_GEOIP_MODULE
bool "ngx_stream_geoip_module"
select BR2_PACKAGE_GEOIP
help
Enable ngx_stream_geoip_module
config BR2_PACKAGE_NGINX_STREAM_SSL_PREREAD_MODULE
bool "ngx_stream_ssl_preread_module"
help
Enable ngx_stream_ssl_preread_module
config BR2_PACKAGE_NGINX_STREAM_LIMIT_CONN_MODULE
bool "ngx_stream_limit_conn_module"
default y
help
Enable ngx_stream_limit_conn_module
config BR2_PACKAGE_NGINX_STREAM_ACCESS_MODULE
bool "ngx_stream_access_module"
default y
help
Enable ngx_stream_access_module
config BR2_PACKAGE_NGINX_STREAM_GEO_MODULE
bool "ngx_stream_geo_module"
default y
help
Enable ngx_stream_geo_module
config BR2_PACKAGE_NGINX_STREAM_MAP_MODULE
bool "ngx_stream_map_module"
default y
help
Enable ngx_stream_map_module
config BR2_PACKAGE_NGINX_STREAM_SPLIT_CLIENTS_MODULE
bool "ngx_stream_split_clients_module"
default y
help
Enable ngx_stream_split_clients_module
config BR2_PACKAGE_NGINX_STREAM_RETURN_MODULE
bool "ngx_stream_return_module"
default y
help
Enable ngx_stream_return_module
config BR2_PACKAGE_NGINX_STREAM_UPSTREAM_HASH_MODULE
bool "ngx_stream_upstream_hash_module"
default y
help
Enable ngx_stream_upstream_hash_module
config BR2_PACKAGE_NGINX_STREAM_UPSTREAM_LEAST_CONN_MODULE
bool "ngx_stream_upstream_least_conn_module"
default y
help
Enable ngx_stream_upstream_least_conn_module
config BR2_PACKAGE_NGINX_STREAM_UPSTREAM_RANDOM_MODULE
bool "ngx_stream_upstream_random_module"
default y
help
Enable ngx_stream_upstream_random_module
config BR2_PACKAGE_NGINX_STREAM_UPSTREAM_ZONE_MODULE
bool "ngx_stream_upstream_zone_module"
default y
help
Enable ngx_stream_upstream_zone_module
endif #BR2_PACKAGE_NGINX_STREAM
config BR2_PACKAGE_NGINX_DEBUG
bool "debug logging"
help
Enable debug logging. The debug level should be set with
the error_log directive. For example
error_log /var/log/nginx/error.log debug;
comment "misc. modules"
config BR2_PACKAGE_NGINX_SELECT_MODULE
bool "ngx_select_module"
help
Enable ngx_select_module
config BR2_PACKAGE_NGINX_POLL_MODULE
bool "ngx_poll_module"
help
Enable ngx_poll_module
config BR2_PACKAGE_NGINX_ADD_MODULES
string "additional modules"
help
Space separated list of urls of the additional modules
endif
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
#
# Start/stop nginx
#
NGINX=/usr/sbin/nginx
PIDFILE=/var/run/nginx.pid
case "$1" in
start)
echo "Starting nginx..."
mkdir -p /var/log/nginx /var/cache/nginx
start-stop-daemon -S -x "$NGINX" -p "$PIDFILE"
;;
stop)
echo "Stopping nginx..."
start-stop-daemon -K -x "$NGINX" -p "$PIDFILE" -o
;;
reload|force-reload)
echo "Reloading nginx configuration..."
"$NGINX" -s reload
;;
restart)
"$0" stop
sleep 1 # Prevent race condition: ensure nginx stops before start.
"$0" start
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
exit 1
esac
+4
View File
@@ -0,0 +1,4 @@
# Locally calculated after checking pgp signature
sha256 e462e11533d5c30baa05df7652160ff5979591d291736cfa5edb9fd2edb48c49 nginx-1.20.1.tar.gz
# License files, locally calculated
sha256 b57270c1f73eb6624b38b2d0a1affcec56b21fab39efbf8c837428f05cef1d73 LICENSE
+9
View File
@@ -0,0 +1,9 @@
/var/log/nginx/*log {
missingok
create 640 http log
sharedscripts
compress
postrotate
test ! -r /var/run/nginx.pid || kill -USR1 `cat /var/run/nginx.pid`
endscript
}
+326
View File
@@ -0,0 +1,326 @@
################################################################################
#
# nginx
#
################################################################################
NGINX_VERSION = 1.20.1
NGINX_SITE = http://nginx.org/download
NGINX_LICENSE = BSD-2-Clause
NGINX_LICENSE_FILES = LICENSE
NGINX_CPE_ID_VENDOR = nginx
NGINX_DEPENDENCIES = \
host-pkgconf \
$(if $(BR2_PACKAGE_LIBXCRYPT),libxcrypt)
NGINX_CONF_OPTS = \
--crossbuild=Linux::$(BR2_ARCH) \
--with-cc="$(TARGET_CC)" \
--with-cpp="$(TARGET_CC)" \
--with-ld-opt="$(TARGET_LDFLAGS)"
# www-data user and group are used for nginx. Because these user and group
# are already set by buildroot, it is not necessary to redefine them.
# See system/skeleton/etc/passwd
# username: www-data uid: 33
# groupname: www-data gid: 33
#
# So, we just need to create the directories used by nginx with the right
# ownership.
define NGINX_PERMISSIONS
/var/lib/nginx d 755 33 33 - - - - -
endef
# disable external libatomic_ops because its detection fails.
NGINX_CONF_ENV += \
ngx_force_c_compiler=yes \
ngx_force_c99_have_variadic_macros=yes \
ngx_force_gcc_have_variadic_macros=yes \
ngx_force_gcc_have_atomic=yes \
ngx_force_have_epoll=yes \
ngx_force_have_sendfile=yes \
ngx_force_have_sendfile64=yes \
ngx_force_have_pr_set_dumpable=yes \
ngx_force_have_timer_event=yes \
ngx_force_have_map_anon=yes \
ngx_force_have_map_devzero=yes \
ngx_force_have_sysvshm=yes \
ngx_force_have_posix_sem=yes
# prefix: nginx root configuration location
NGINX_CONF_OPTS += \
--force-endianness=$(call qstrip,$(call LOWERCASE,$(BR2_ENDIAN))) \
--prefix=/usr \
--conf-path=/etc/nginx/nginx.conf \
--sbin-path=/usr/sbin/nginx \
--pid-path=/run/nginx.pid \
--lock-path=/run/lock/nginx.lock \
--user=www-data \
--group=www-data \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--http-client-body-temp-path=/var/cache/nginx/client-body \
--http-proxy-temp-path=/var/cache/nginx/proxy \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi \
--http-scgi-temp-path=/var/cache/nginx/scgi \
--http-uwsgi-temp-path=/var/cache/nginx/uwsgi
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
else
NGINX_CONF_OPTS += --without-pcre
endif
# modules disabled or not activated because of missing dependencies:
# - google_perftools (googleperftools)
# - http_perl_module (host-perl)
# - pcre-jit (want to rebuild pcre)
# Notes:
# * Feature/module option are *not* symetric.
# If a feature is on by default, only its --without-xxx option exists;
# if a feature is off by default, only its --with-xxx option exists.
# * The configure script fails if unknown options are passed on the command
# line.
# misc. modules
NGINX_CONF_OPTS += \
$(if $(BR2_PACKAGE_NGINX_SELECT_MODULE),--with-select_module,--without-select_module) \
$(if $(BR2_PACKAGE_NGINX_POLL_MODULE),--with-poll_module,--without-poll_module)
ifneq ($(BR2_PACKAGE_NGINX_ADD_MODULES),)
NGINX_CONF_OPTS += \
$(addprefix --add-module=,$(call qstrip,$(BR2_PACKAGE_NGINX_ADD_MODULES)))
endif
# http server modules
ifeq ($(BR2_PACKAGE_NGINX_HTTP),y)
ifeq ($(BR2_PACKAGE_NGINX_HTTP_CACHE),y)
NGINX_DEPENDENCIES += openssl
else
NGINX_CONF_OPTS += --without-http-cache
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_V2_MODULE),y)
NGINX_DEPENDENCIES += zlib
NGINX_CONF_OPTS += --with-http_v2_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_SSL_MODULE),y)
NGINX_DEPENDENCIES += openssl
NGINX_CONF_OPTS += --with-http_ssl_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_XSLT_MODULE),y)
NGINX_DEPENDENCIES += libxml2 libxslt
NGINX_CONF_OPTS += --with-http_xslt_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_IMAGE_FILTER_MODULE),y)
NGINX_DEPENDENCIES += gd jpeg libpng
NGINX_CONF_OPTS += --with-http_image_filter_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_GEOIP_MODULE),y)
NGINX_DEPENDENCIES += geoip
NGINX_CONF_OPTS += --with-http_geoip_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_GUNZIP_MODULE),y)
NGINX_DEPENDENCIES += zlib
NGINX_CONF_OPTS += --with-http_gunzip_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_GZIP_STATIC_MODULE),y)
NGINX_DEPENDENCIES += zlib
NGINX_CONF_OPTS += --with-http_gzip_static_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_SECURE_LINK_MODULE),y)
NGINX_DEPENDENCIES += openssl
NGINX_CONF_OPTS += --with-http_secure_link_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_GZIP_MODULE),y)
NGINX_DEPENDENCIES += zlib
else
NGINX_CONF_OPTS += --without-http_gzip_module
endif
ifeq ($(BR2_PACKAGE_NGINX_HTTP_REWRITE_MODULE),y)
NGINX_DEPENDENCIES += pcre
else
NGINX_CONF_OPTS += --without-http_rewrite_module
endif
NGINX_CONF_OPTS += \
$(if $(BR2_PACKAGE_NGINX_HTTP_REALIP_MODULE),--with-http_realip_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_ADDITION_MODULE),--with-http_addition_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_SUB_MODULE),--with-http_sub_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_DAV_MODULE),--with-http_dav_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_FLV_MODULE),--with-http_flv_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_MP4_MODULE),--with-http_mp4_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_AUTH_REQUEST_MODULE),--with-http_auth_request_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_RANDOM_INDEX_MODULE),--with-http_random_index_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_DEGRADATION_MODULE),--with-http_degradation_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_SLICE_MODULE),--with-http_slice_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_STUB_STATUS_MODULE),--with-http_stub_status_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_CHARSET_MODULE),,--without-http_charset_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_SSI_MODULE),,--without-http_ssi_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_USERID_MODULE),,--without-http_userid_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_ACCESS_MODULE),,--without-http_access_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_AUTH_BASIC_MODULE),,--without-http_auth_basic_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_AUTOINDEX_MODULE),,--without-http_autoindex_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_GEO_MODULE),,--without-http_geo_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_MAP_MODULE),,--without-http_map_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_SPLIT_CLIENTS_MODULE),,--without-http_split_clients_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_REFERER_MODULE),,--without-http_referer_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_PROXY_MODULE),,--without-http_proxy_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_FASTCGI_MODULE),,--without-http_fastcgi_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_UWSGI_MODULE),,--without-http_uwsgi_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_SCGI_MODULE),,--without-http_scgi_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_MEMCACHED_MODULE),,--without-http_memcached_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_LIMIT_CONN_MODULE),,--without-http_limit_conn_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_LIMIT_REQ_MODULE),,--without-http_limit_req_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_EMPTY_GIF_MODULE),,--without-http_empty_gif_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_BROWSER_MODULE),,--without-http_browser_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_IP_HASH_MODULE),,--without-http_upstream_ip_hash_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_LEAST_CONN_MODULE),,--without-http_upstream_least_conn_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_RANDOM_MODULE),,--without-http_upstream_random_module) \
$(if $(BR2_PACKAGE_NGINX_HTTP_UPSTREAM_KEEPALIVE_MODULE),,--without-http_upstream_keepalive_module)
else # !BR2_PACKAGE_NGINX_HTTP
NGINX_CONF_OPTS += --without-http
endif # BR2_PACKAGE_NGINX_HTTP
# mail modules
ifeq ($(BR2_PACKAGE_NGINX_MAIL),y)
NGINX_CONF_OPTS += --with-mail
ifeq ($(BR2_PACKAGE_NGINX_MAIL_SSL_MODULE),y)
NGINX_DEPENDENCIES += openssl
NGINX_CONF_OPTS += --with-mail_ssl_module
endif
NGINX_CONF_OPTS += \
$(if $(BR2_PACKAGE_NGINX_MAIL_POP3_MODULE),,--without-mail_pop3_module) \
$(if $(BR2_PACKAGE_NGINX_MAIL_IMAP_MODULE),,--without-mail_imap_module) \
$(if $(BR2_PACKAGE_NGINX_MAIL_SMTP_MODULE),,--without-mail_smtp_module)
endif # BR2_PACKAGE_NGINX_MAIL
# stream modules
ifeq ($(BR2_PACKAGE_NGINX_STREAM),y)
NGINX_CONF_OPTS += --with-stream
ifeq ($(BR2_PACKAGE_NGINX_STREAM_REALIP_MODULE),y)
NGINX_CONF_OPTS += --with-stream_realip_module
endif
ifeq ($(BR2_PACKAGE_NGINX_STREAM_SET_MODULE),)
NGINX_CONF_OPTS += --without-stream_set_module
endif
ifeq ($(BR2_PACKAGE_NGINX_STREAM_SSL_MODULE),y)
NGINX_DEPENDENCIES += openssl
NGINX_CONF_OPTS += --with-stream_ssl_module
endif
ifeq ($(BR2_PACKAGE_NGINX_STREAM_GEOIP_MODULE),y)
NGINX_DEPENDENCIES += geoip
NGINX_CONF_OPTS += --with-stream_geoip_module
endif
ifeq ($(BR2_PACKAGE_NGINX_STREAM_SSL_PREREAD_MODULE),y)
NGINX_CONF_OPTS += --with-stream_ssl_preread_module
endif
NGINX_CONF_OPTS += \
$(if $(BR2_PACKAGE_NGINX_STREAM_LIMIT_CONN_MODULE),,--without-stream_limit_conn_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_ACCESS_MODULE),,--without-stream_access_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_GEO_MODULE),,--without-stream_geo_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_MAP_MODULE),,--without-stream_map_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_SPLIT_CLIENTS_MODULE),,--without-stream_split_clients_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_RETURN_MODULE),,--without-stream_return_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_HASH_MODULE),,--without-stream_upstream_hash_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_LEAST_CONN_MODULE),,--without-stream_upstream_least_conn_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_RANDOM_MODULE),,--without-stream_upstream_random_module) \
$(if $(BR2_PACKAGE_NGINX_STREAM_UPSTREAM_ZONE_MODULE),,--without-stream_upstream_zone_module)
endif # BR2_PACKAGE_NGINX_STREAM
# external modules
ifeq ($(BR2_PACKAGE_NGINX_UPLOAD),y)
NGINX_CONF_OPTS += $(addprefix --add-module=,$(NGINX_UPLOAD_DIR))
NGINX_DEPENDENCIES += nginx-upload
endif
ifeq ($(BR2_PACKAGE_NGINX_DAV_EXT),y)
NGINX_CONF_OPTS += --add-module=$(NGINX_DAV_EXT_DIR)
NGINX_DEPENDENCIES += nginx-dav-ext
endif
ifeq ($(BR2_PACKAGE_NGINX_NAXSI),y)
NGINX_DEPENDENCIES += nginx-naxsi
NGINX_CONF_OPTS += --add-module=$(NGINX_NAXSI_DIR)/naxsi_src
endif
ifeq ($(BR2_PACKAGE_NGINX_MODSECURITY),y)
NGINX_DEPENDENCIES += nginx-modsecurity
NGINX_CONF_OPTS += --add-module=$(NGINX_MODSECURITY_DIR)
endif
# Debug logging
NGINX_CONF_OPTS += $(if $(BR2_PACKAGE_NGINX_DEBUG),--with-debug)
define NGINX_DISABLE_WERROR
$(SED) 's/-Werror//g' -i $(@D)/auto/cc/*
endef
NGINX_PRE_CONFIGURE_HOOKS += NGINX_DISABLE_WERROR
define NGINX_CONFIGURE_CMDS
cd $(@D) ; $(NGINX_CONF_ENV) \
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
./configure $(NGINX_CONF_OPTS) \
--with-cc-opt="$(TARGET_CFLAGS) $(NGINX_CFLAGS)"
endef
define NGINX_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
endef
define NGINX_INSTALL_TARGET_CMDS
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install
$(RM) $(TARGET_DIR)/usr/sbin/nginx.old
$(INSTALL) -D -m 0664 package/nginx/nginx.logrotate \
$(TARGET_DIR)/etc/logrotate.d/nginx
endef
define NGINX_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 0644 package/nginx/nginx.service \
$(TARGET_DIR)/usr/lib/systemd/system/nginx.service
endef
define NGINX_INSTALL_INIT_SYSV
$(INSTALL) -D -m 0755 package/nginx/S50nginx \
$(TARGET_DIR)/etc/init.d/S50nginx
endef
$(eval $(generic-package))
+17
View File
@@ -0,0 +1,17 @@
[Unit]
Description=A high performance web server and a reverse proxy server
After=syslog.target network.target
[Service]
Type=forking
LogsDirectory=nginx
CacheDirectory=nginx
PIDFile=/run/nginx.pid
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'
ExecStart=/usr/sbin/nginx -g 'daemon on; master_process on;'
ExecReload=/usr/sbin/nginx -g 'daemon on; master_process on;' -s reload
ExecStop=/usr/sbin/nginx -s quit
PrivateDevices=yes
[Install]
WantedBy=multi-user.target