From f8b892e1fa3d6398a21ce5e183911baa11a14d6a Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 6 Oct 2022 13:13:30 +0100 Subject: Fixed the build on MacOS (and others). @alejandro-colomar reported that the build was broken on MacOS cc -o build/unitd -pipe -fPIC -fvisibility=hidden -O -W -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -fstrict-aliasing -Wstrict-overflow=5 -Wmissing-prototypes -Werror -g \ build/src/nxt_main.o build/libnxt.a \ \ \ -L/usr/local/Cellar/pcre2/10.40/lib -lpcre2-8 Undefined symbols for architecture x86_64: "_nxt_fs_mkdir_parent", referenced from: _nxt_runtime_pid_file_create in libnxt.a(nxt_runtime.o) _nxt_runtime_controller_socket in libnxt.a(nxt_controller.o) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [build/unitd] Error 1 This was due to commit 57fc920 ("Socket: Created control socket & pid file directories."). This happened because this commit introduced the usage of nxt_fs_mkdir_parent() in core code which uses nxt_fs_mkdir(), both of these are defined in src/nxt_fs.c. It turns out however that this file doesn't get built on MacOS (or any system that isn't Linux or that lacks a FreeBSD compatible nmount(2) system call) due to the following In auto/sources we have if [ $NXT_HAVE_ROOTFS = YES ]; then NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_fs.c" fi NXT_HAVE_ROOTFS is set in auto/isolation If [ $NXT_HAVE_MOUNT = YES -a $NXT_HAVE_UNMOUNT = YES ]; then NXT_HAVE_ROOTFS=YES cat << END >> $NXT_AUTO_CONFIG_H #ifndef NXT_HAVE_ISOLATION_ROOTFS #define NXT_HAVE_ISOLATION_ROOTFS 1 #endif END fi While we do have a check for a generic umount(2) which is found on MacOS, for mount(2) we currently only check for the Linux mount(2) and FreeBSD nmount(2) system calls. So NXT_HAVE_ROOTFS is set to NO on MacOS and we don't build src/nxt_fs.c This fixes the immediate build issue by taking the mount/umount OS support out of nxt_fs.c into a new nxt_fs_mount.c file which is guarded by the above while we now build nxt_fs.c unconditionally. This should fix the build on any _supported_ system. Reported-by: Alejandro Colomar Fixes: 57fc920 ("Socket: Created control socket & pid file directories.") Signed-off-by: Andrew Clayton --- auto/sources | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 8548f812..8f07cc0c 100644 --- a/auto/sources +++ b/auto/sources @@ -104,6 +104,7 @@ NXT_LIB_SRCS=" \ src/nxt_websocket_accept.c \ src/nxt_http_websocket.c \ src/nxt_h1proto_websocket.c \ + src/nxt_fs.c \ " NXT_LIB_SRC0=" \ @@ -187,7 +188,7 @@ NXT_LIB_UTF8_FILE_NAME_TEST_SRCS=" \ if [ $NXT_HAVE_ROOTFS = YES ]; then - NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_fs.c" + NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_fs_mount.c" fi -- cgit From 48b6a7b311272896be9212e170fcee8d1da25e79 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 2 Jun 2022 16:16:35 +0200 Subject: PHP: Fixed php_module_startup() call for PHP 8.2. PHP 8.2 changed the prototype of the function, removing the last parameter. Signed-off-by: Remi Collet Cc: Timo Stark Cc: George Peter Banyard Tested-by: Andy Postnikov Acked-by: Andy Postnikov Reviewed-by: Andrew Clayton Signed-off-by: Alejandro Colomar --- auto/modules/php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'auto') diff --git a/auto/modules/php b/auto/modules/php index e92a67cd..7d224ec1 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -149,7 +149,11 @@ nxt_feature_test=" #include int main() { + #if (PHP_VERSION_ID < 80200) php_module_startup(NULL, NULL, 0); + #else + php_module_startup(NULL, NULL); + #endif return 0; }" -- cgit From bbf1f4da0fe19c51253400a2cef58b8bac28fb25 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Thu, 20 Oct 2022 12:02:27 +0800 Subject: Configuration: added the regex status in configure summary. --- auto/summary | 1 + 1 file changed, 1 insertion(+) (limited to 'auto') diff --git a/auto/summary b/auto/summary index 84bfbb7f..79e7ce34 100644 --- a/auto/summary +++ b/auto/summary @@ -27,6 +27,7 @@ Unit configuration summary: IPv6 support: .............. $NXT_INET6 Unix domain sockets support: $NXT_UNIX_DOMAIN TLS support: ............... $NXT_OPENSSL + Regex support: ............. $NXT_REGEX process isolation: ......... $NXT_ISOLATION -- cgit From f93361979a9f612b59470640c3566f5cb66c3eaf Mon Sep 17 00:00:00 2001 From: Alex Colomar Date: Tue, 11 Oct 2022 16:00:06 +0200 Subject: Avoided modifying existing directories at 'make install'. 'install -d' has an issue compared to 'mkdir -p': it doesn't respect existing directories. It will set the ownership, file mode, and SELinux contexts (and any other property that would be set by install(1) to a newly-created directory), overwriting any existing properties of the existing directory. 'mkdir -p' doesn't have this issue: it is a no-op if the directory exists. However, it's not an ideal solution either, since it can't be used to set the properties (owner, mode, ...) of a newly-created directory. Therefore, the best solution is to use install(1), but only after making sure that the directory doesn't exist with test(1). Reported-by: Andrew Clayton Reported-by: Alejandro Colomar Closes: Signed-off-by: Alejandro Colomar Tested-by: Andrew Clayton Reviewed-by: Andrew Clayton --- auto/make | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'auto') diff --git a/auto/make b/auto/make index cb1d1f49..5324f49c 100644 --- a/auto/make +++ b/auto/make @@ -363,12 +363,15 @@ install-check: exit 1) ${NXT_DAEMON}-install: $NXT_DAEMON install-check - install -d \$(DESTDIR)$NXT_SBINDIR + test -d \$(DESTDIR)$NXT_SBINDIR \ + || install -d \$(DESTDIR)$NXT_SBINDIR install -p $NXT_BUILD_DIR/$NXT_DAEMON \$(DESTDIR)$NXT_SBINDIR/ - install -d \$(DESTDIR)$NXT_STATE + test -d \$(DESTDIR)$NXT_STATE \ + || install -d \$(DESTDIR)$NXT_STATE manpage-install: manpage install-check - install -d \$(DESTDIR)$NXT_MANDIR/man8 + test -d \$(DESTDIR)$NXT_MANDIR/man8 \ + || install -d \$(DESTDIR)$NXT_MANDIR/man8 install -p -m644 $NXT_BUILD_DIR/unitd.8 \$(DESTDIR)$NXT_MANDIR/man8/ .PHONY: uninstall ${NXT_DAEMON}-uninstall manpage-uninstall @@ -390,10 +393,12 @@ cat << END >> $NXT_MAKEFILE .PHONY: libunit-install libunit-uninstall libunit-install: $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC - install -d \$(DESTDIR)$NXT_LIBDIR + test -d \$(DESTDIR)$NXT_LIBDIR \ + || install -d \$(DESTDIR)$NXT_LIBDIR install -p -m u=rw,go=r $NXT_BUILD_DIR/$NXT_LIB_UNIT_STATIC \ \$(DESTDIR)$NXT_LIBDIR/ - install -d \$(DESTDIR)$NXT_INCDIR + test -d \$(DESTDIR)$NXT_INCDIR \ + || install -d \$(DESTDIR)$NXT_INCDIR install -p -m u=rw,go=r src/nxt_unit.h \ src/nxt_unit_field.h \ src/nxt_unit_request.h \ -- cgit From 8f0dd9478e164121e31bebaf1c10dd6e537d2918 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 28 Oct 2022 00:17:51 +0100 Subject: Fixed main() prototypes in auto tests. Future releases of GCC are planning to remove[0] default support for some old features that were removed from C99 but GCC still accepts. We can test for these changes by using the following -Werror= directives -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition Doing so revealed an issue with the auto/ tests in that the test programs always define main as int main() rather than int main(void) which results in a bunch of errors like build/autotest.c:3:23: error: function declaration isn't a prototype [-Werror=strict-prototypes] 3 | int main() { | ^~~~ build/autotest.c: In function 'main': build/autotest.c:3:23: error: old-style function definition [-Werror=old-style-definition] The fix was easy, it only required fixing the main prototype with find -type f -exec sed -i 's/int main() {/int main(void) {/g' {} \; Regardless of these upcoming GCC changes, this is probably a good thing to do anyway for correctness. [0]: https://fedoraproject.org/wiki/Changes/PortingToModernC Link: Link: Reviewed-by: Alejandro Colomar Signed-off-by: Andrew Clayton --- auto/atomic | 8 ++++---- auto/capability | 2 +- auto/clang | 20 ++++++++++---------- auto/events | 16 ++++++++-------- auto/files | 8 ++++---- auto/isolation | 16 ++++++++-------- auto/malloc | 16 ++++++++-------- auto/mmap | 8 ++++---- auto/modules/java | 2 +- auto/modules/perl | 4 ++-- auto/modules/php | 8 ++++---- auto/modules/python | 4 ++-- auto/modules/ruby | 6 +++--- auto/pcre | 2 +- auto/sendfile | 12 ++++++------ auto/shmem | 8 ++++---- auto/sockets | 32 ++++++++++++++++---------------- auto/ssltls | 18 +++++++++--------- auto/threads | 16 ++++++++-------- auto/time | 20 ++++++++++---------- auto/types | 14 +++++++------- auto/unix | 18 +++++++++--------- 22 files changed, 129 insertions(+), 129 deletions(-) (limited to 'auto') diff --git a/auto/atomic b/auto/atomic index 31259fc5..f99adf7e 100644 --- a/auto/atomic +++ b/auto/atomic @@ -10,7 +10,7 @@ nxt_feature_name=NXT_HAVE_GCC_ATOMIC nxt_feature_run=yes nxt_feature_incs= nxt_feature_libs= -nxt_feature_test="int main() { +nxt_feature_test="int main(void) { long n = 0; if (!__sync_bool_compare_and_swap(&n, 0, 3)) @@ -44,7 +44,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { ulong_t n = 0; if (atomic_cas_ulong(&n, 0, 3) != 0) @@ -70,7 +70,7 @@ fi if [ $nxt_found = no ]; then if [ $NXT_64BIT = 1 ]; then - nxt_feature_test="int main() { + nxt_feature_test="int main(void) { long n = 0; long o = 0; @@ -87,7 +87,7 @@ if [ $nxt_found = no ]; then return 0; }" else - nxt_feature_test="int main() { + nxt_feature_test="int main(void) { int n = 0; int o = 0; diff --git a/auto/capability b/auto/capability index 48777665..c0410b34 100644 --- a/auto/capability +++ b/auto/capability @@ -10,7 +10,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { struct __user_cap_header_struct hdr; hdr.version = _LINUX_CAPABILITY_VERSION; syscall(SYS_capget, &hdr, 0); diff --git a/auto/clang b/auto/clang index 1a05b5a3..975a6468 100644 --- a/auto/clang +++ b/auto/clang @@ -14,7 +14,7 @@ nxt_feature_libs= nxt_feature_test="#include #define set(dummy, ...) sprintf(__VA_ARGS__) - int main() { + int main(void) { char buf[4]; buf[0] = '0'; @@ -37,7 +37,7 @@ if [ $nxt_found = no ]; then nxt_feature_test="#include #define set(dummy, args...) sprintf(args) - int main() { + int main(void) { char buf[4]; buf[0] = '0'; @@ -70,7 +70,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_UNREACHABLE nxt_feature_run=no nxt_feature_incs= nxt_feature_libs= -nxt_feature_test="int main() { +nxt_feature_test="int main(void) { __builtin_unreachable(); }" . auto/feature @@ -81,7 +81,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_PREFETCH nxt_feature_run=no nxt_feature_incs= nxt_feature_libs= -nxt_feature_test="int main() { +nxt_feature_test="int main(void) { __builtin_prefetch(0); return 0; }" @@ -93,7 +93,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_CLZ nxt_feature_run= nxt_feature_incs= nxt_feature_libs= -nxt_feature_test="int main() { +nxt_feature_test="int main(void) { if (__builtin_clz(1) == 31) return 0; return 1; @@ -106,7 +106,7 @@ nxt_feature_name=NXT_HAVE_BUILTIN_POPCOUNT nxt_feature_run= nxt_feature_incs= nxt_feature_libs= -nxt_feature_test="int main() { +nxt_feature_test="int main(void) { if (__builtin_popcount(5) == 2) return 0; return 1; @@ -121,7 +121,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="int n __attribute__ ((visibility(\"default\"))); - int main() { + int main(void) { return 1; }" . auto/feature @@ -134,7 +134,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="int n __attribute__ ((aligned(64))); - int main() { + int main(void) { return 1; }" . auto/feature @@ -153,7 +153,7 @@ nxt_feature_test="#include return malloc(1); } - int main() { + int main(void) { if (f() != NULL) { return 1; } @@ -172,7 +172,7 @@ nxt_feature_test="struct s { int i; } __attribute__ ((__packed__)); - int main() { + int main(void) { return 1; }" . auto/feature diff --git a/auto/events b/auto/events index 700dc20c..1ca6e7cd 100644 --- a/auto/events +++ b/auto/events @@ -13,7 +13,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { int n; n = epoll_create(1); @@ -34,7 +34,7 @@ if [ $nxt_found = yes ]; then #include #include - int main() { + int main(void) { int n; sigset_t mask; @@ -54,7 +54,7 @@ if [ $nxt_found = yes ]; then nxt_feature_test="#include #include - int main() { + int main(void) { int n; n = eventfd(0, 0); @@ -79,7 +79,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { int n; n = kqueue(); @@ -100,7 +100,7 @@ if [ $nxt_found = yes ]; then #include #include - int main() { + int main(void) { struct kevent kev; kev.filter = EVFILT_USER; @@ -124,7 +124,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { int n; n = port_create(); @@ -152,7 +152,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { int n; n = open(\"/dev/poll\", O_RDWR); @@ -180,7 +180,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { pollset_t n; n = pollset_create(-1); diff --git a/auto/files b/auto/files index 591c5ee1..1fa6ca28 100644 --- a/auto/files +++ b/auto/files @@ -12,7 +12,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { (void) posix_fadvise(0, 0, 0, POSIX_FADV_WILLNEED); return 0; }" @@ -28,7 +28,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { (void) fcntl(0, F_READAHEAD, 1024); return 0; }" @@ -44,7 +44,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { (void) fcntl(0, F_RDAHEAD, 1); return 0; }" @@ -62,7 +62,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { struct open_how how; memset(&how, 0, sizeof(how)); diff --git a/auto/isolation b/auto/isolation index 384f7ef1..cbf42d9d 100644 --- a/auto/isolation +++ b/auto/isolation @@ -20,7 +20,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { return SYS_clone | SIGCHLD; }" . auto/feature @@ -40,7 +40,7 @@ if [ $nxt_found = yes ]; then #include #include - int main() { + int main(void) { return CLONE_NEW$flag; }" . auto/feature @@ -70,7 +70,7 @@ nxt_feature_test="#include # error #endif - int main() { + int main(void) { return SYS_pivot_root; }" . auto/feature @@ -96,7 +96,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { return PR_SET_NO_NEW_PRIVS; }" . auto/feature @@ -109,7 +109,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { return mount(\"/\", \"/\", \"bind\", MS_BIND | MS_REC, \"\"); }" @@ -128,7 +128,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { return nmount((void *)0, 0, 0); }" . auto/feature @@ -146,7 +146,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { return umount2((void *)0, 0); }" . auto/feature @@ -163,7 +163,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { return unmount((void *)0, 0); }" . auto/feature diff --git a/auto/malloc b/auto/malloc index 06a16b54..cf6fc59e 100644 --- a/auto/malloc +++ b/auto/malloc @@ -13,7 +13,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { void *p; if (posix_memalign(&p, 4096, 4096) != 0) @@ -36,7 +36,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { void *p; p = memalign(4096, 4096); @@ -59,7 +59,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { void *p; p = malloc(4096); @@ -82,7 +82,7 @@ if [ $nxt_found = no ]; then nxt_feature_test="#include #include - int main() { + int main(void) { void *p; p = malloc(4096); @@ -105,7 +105,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { if (malloc_good_size(4096) < 4096) return 1; return 0; @@ -125,7 +125,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { void *p; p = alloca(256); @@ -147,7 +147,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { void *p; p = alloca(256); @@ -168,7 +168,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { mallopt(M_PERTURB, 0x55); return 0; }" diff --git a/auto/mmap b/auto/mmap index 8ecdf670..e8ffac78 100644 --- a/auto/mmap +++ b/auto/mmap @@ -13,7 +13,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { if (mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0) == MAP_FAILED) @@ -35,7 +35,7 @@ if [ $nxt_found = no ]; then nxt_feature_test="#include #include - int main() { + int main(void) { if (mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0) == MAP_FAILED) @@ -56,7 +56,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { if (mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_POPULATE, -1, 0) == MAP_FAILED) @@ -76,7 +76,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { if (mmap(NULL, 4096, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_PREFAULT_READ, -1, 0) diff --git a/auto/modules/java b/auto/modules/java index e8137217..691060b3 100644 --- a/auto/modules/java +++ b/auto/modules/java @@ -191,7 +191,7 @@ nxt_feature_libs="${NXT_JAVA_LDFLAGS}" nxt_feature_test=" #include - int main() { + int main(void) { JNI_CreateJavaVM(NULL, NULL, NULL); return 0; }" diff --git a/auto/modules/perl b/auto/modules/perl index e9d7e109..2daebd0d 100644 --- a/auto/modules/perl +++ b/auto/modules/perl @@ -79,7 +79,7 @@ if /bin/sh -c "$NXT_PERL -MConfig -e 'print \"Perl version: \", static PerlInterpreter *my_perl; - int main() { + int main(void) { char argv[] = \"\\0-e\\00\"; char *embedding[] = { &argv[0], &argv[1], &argv[4] }; @@ -124,7 +124,7 @@ nxt_feature_test=" #include #include - int main() { + int main(void) { printf(\"%s\", PERL_VERSION_STRING); return 0; }" diff --git a/auto/modules/php b/auto/modules/php index 7d224ec1..f0ecb709 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -131,7 +131,7 @@ nxt_feature_libs="${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS}" nxt_feature_test=" #include - int main() { + int main(void) { printf(\"%s\", PHP_VERSION); return 0; }" @@ -148,7 +148,7 @@ nxt_feature_test=" #include #include - int main() { + int main(void) { #if (PHP_VERSION_ID < 80200) php_module_startup(NULL, NULL, 0); #else @@ -176,7 +176,7 @@ nxt_feature_test=" #include #include - int main() { + int main(void) { #ifndef ZTS #error ZTS is not defined. #endif @@ -197,7 +197,7 @@ nxt_feature_test=" #include #include - int main() { + int main(void) { zend_signal_startup(); return 0; }" diff --git a/auto/modules/python b/auto/modules/python index 9be6b370..480ae1da 100644 --- a/auto/modules/python +++ b/auto/modules/python @@ -86,7 +86,7 @@ if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then nxt_feature_test=" #include - int main() { + int main(void) { Py_Initialize(); return 0; }" @@ -114,7 +114,7 @@ nxt_feature_test=" #include #include - int main() { + int main(void) { printf(\"%s\", PY_VERSION); return 0; }" diff --git a/auto/modules/ruby b/auto/modules/ruby index dbedfd72..7c2f0102 100644 --- a/auto/modules/ruby +++ b/auto/modules/ruby @@ -106,7 +106,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then nxt_feature_test=" #include - int main() { + int main(void) { static const char *argv[3] = { \"NGINX_Unit\", \"-rrbconfig\", \"-eprint RbConfig::CONFIG['libdir']\" @@ -130,7 +130,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then nxt_feature_test=" #include - int main() { + int main(void) { ruby_init(); return ruby_cleanup(0); }" @@ -159,7 +159,7 @@ nxt_feature_test=" #include #include - int main() { + int main(void) { printf(\"%s\", ruby_version); return 0; }" diff --git a/auto/pcre b/auto/pcre index 955e4baf..27205118 100644 --- a/auto/pcre +++ b/auto/pcre @@ -50,7 +50,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs=$NXT_PCRE_LIB nxt_feature_test="#include - int main() { + int main(void) { pcre *re; re = pcre_compile(NULL, 0, NULL, 0, NULL); diff --git a/auto/sendfile b/auto/sendfile index 1c20db06..abbda6c7 100644 --- a/auto/sendfile +++ b/auto/sendfile @@ -17,7 +17,7 @@ nxt_feature="Linux sendfile()" nxt_feature_name=NXT_HAVE_LINUX_SENDFILE nxt_feature_test="#include - int main() { + int main(void) { off_t offset; sendfile(-1, -1, &offset, 0); @@ -43,7 +43,7 @@ if [ $nxt_found = no ]; then #include #include - int main() { + int main(void) { off_t sent; sendfile(-1, -1, 0, 0, NULL, &sent, 0); @@ -69,7 +69,7 @@ if [ $nxt_found = no ]; then #include #include - int main() { + int main(void) { off_t sent; sendfile(-1, -1, 0, &sent, NULL, 0); @@ -100,7 +100,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs="-lsendfile" nxt_feature_test="#include - int main() { + int main(void) { size_t sent; struct sendfilevec vec; @@ -124,7 +124,7 @@ if [ $nxt_found = no ]; then nxt_feature_name=NXT_HAVE_AIX_SEND_FILE nxt_feature_test="#include - int main() { + int main(void) { int s; struct sf_parms sf_iobuf; @@ -152,7 +152,7 @@ if [ $nxt_found = no ]; then sbsize_t sendfile(int s, int fd, off_t offset, bsize_t nbytes, const struct iovec *hdtrl, int flags); - int main() { + int main(void) { sendfile(-1, -1, 0, 0, NULL, 0); return 0; }" diff --git a/auto/shmem b/auto/shmem index bfe0ee4a..c434a58f 100644 --- a/auto/shmem +++ b/auto/shmem @@ -18,7 +18,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { int ret; static char name[] = \"/unit.configure\"; @@ -62,7 +62,7 @@ if [ $nxt_found = no ]; then #include #include - int main() { + int main(void) { static char name[] = \"/tmp/unit.configure\"; shm_unlink(name); @@ -94,7 +94,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { int fd = shm_open(SHM_ANON, O_RDWR, S_IRUSR | S_IWUSR); if (fd == -1) return 1; @@ -119,7 +119,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { static char name[] = \"/unit.configure\"; int fd = syscall(SYS_memfd_create, name, MFD_CLOEXEC); diff --git a/auto/sockets b/auto/sockets index e344a3db..241b88eb 100644 --- a/auto/sockets +++ b/auto/sockets @@ -15,7 +15,7 @@ if [ $NXT_INET6 = YES ]; then #include #include - int main() { + int main(void) { struct sockaddr_in6 sin6; sin6.sin6_family = AF_INET6; @@ -36,7 +36,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { struct sockaddr sa; sa.sa_len = 0; @@ -54,7 +54,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(struct sockaddr)); return 0; }" @@ -70,7 +70,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(struct sockaddr_in)); return 0; }" @@ -86,7 +86,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(struct sockaddr_in6)); return 0; }" @@ -102,7 +102,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(struct sockaddr_un)); return 0; }" @@ -117,7 +117,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(struct sockaddr_storage)); return 0; }" @@ -132,7 +132,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { int pair[2]; if (socketpair(AF_UNIX, SOCK_SEQPACKET, 0, pair) != 0) @@ -150,7 +150,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { struct msghdr msg; printf(\"%d\", (int) sizeof(msg.msg_control)); @@ -175,7 +175,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then nxt_feature_test="#define _GNU_SOURCE #include - int main() { + int main(void) { return SO_PASSCRED == 0; }" . auto/feature @@ -191,7 +191,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then #include #include - int main() { + int main(void) { return sizeof(struct ucred); }" . auto/feature @@ -206,7 +206,7 @@ if [ $NXT_SYSTEM != DragonFly ]; then nxt_feature_test="#define _GNU_SOURCE #include - int main() { + int main(void) { return sizeof(struct cmsgcred); }" . auto/feature @@ -220,7 +220,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { return 0; }" . auto/feature @@ -235,7 +235,7 @@ nxt_feature_test="#include #include #include - int main() { + int main(void) { int nb; nb = 0; @@ -255,7 +255,7 @@ nxt_feature_libs= nxt_feature_test="#define _GNU_SOURCE #include - int main() { + int main(void) { socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0); return 0; }" @@ -273,7 +273,7 @@ nxt_feature_test="#define _GNU_SOURCE #include #include - int main() { + int main(void) { accept4(0, NULL, NULL, SOCK_NONBLOCK); return 0; }" diff --git a/auto/ssltls b/auto/ssltls index d678ba74..6512d330 100644 --- a/auto/ssltls +++ b/auto/ssltls @@ -23,7 +23,7 @@ if [ $NXT_OPENSSL = YES ]; then nxt_feature_libs="-lssl -lcrypto" nxt_feature_test="#include - int main() { + int main(void) { SSL_library_init(); return 0; }" @@ -39,7 +39,7 @@ if [ $NXT_OPENSSL = YES ]; then nxt_feature_run=value nxt_feature_test="#include - int main() { + int main(void) { printf(\"\\\"%s\\\"\", SSLeay_version(SSLEAY_VERSION)); return 0; @@ -61,7 +61,7 @@ if [ $NXT_OPENSSL = YES ]; then nxt_feature_libs="$NXT_OPENSSL_LIBS" nxt_feature_test="#include - int main() { + int main(void) { SSL_CONF_cmd(NULL, NULL, NULL); return 0; }" @@ -75,7 +75,7 @@ if [ $NXT_OPENSSL = YES ]; then nxt_feature_libs="$NXT_OPENSSL_LIBS" nxt_feature_test="#include - int main() { + int main(void) { #if (OPENSSL_NO_TLSEXT) #error OpenSSL: no tlsext support. #else @@ -100,7 +100,7 @@ if [ $NXT_GNUTLS = YES ]; then nxt_feature_libs=$NXT_GNUTLS_LIBS nxt_feature_test="#include - int main() { + int main(void) { gnutls_global_init(); gnutls_global_deinit(); return 0; @@ -121,7 +121,7 @@ if [ $NXT_GNUTLS = YES ]; then nxt_feature_libs=$NXT_GNUTLS_LIBS nxt_feature_test="#include - int main() { + int main(void) { gnutls_transport_set_vec_push_function(NULL, NULL); return 0; }" @@ -135,7 +135,7 @@ if [ $NXT_GNUTLS = YES ]; then nxt_feature_libs=$NXT_GNUTLS_LIBS nxt_feature_test="#include - int main() { + int main(void) { gnutls_global_set_time_function(NULL); return 0; }" @@ -160,7 +160,7 @@ if [ $NXT_CYASSL = YES ]; then nxt_feature_libs="-lcyassl" nxt_feature_test="#include - int main() { + int main(void) { CyaSSL_Init(); CyaSSL_Cleanup(); return 0; @@ -191,7 +191,7 @@ if [ $NXT_POLARSSL = YES ]; then nxt_feature_libs="-lpolarssl" nxt_feature_test="#include - int main() { + int main(void) { ssl_context ssl; memset(&ssl, '\0', sizeof(ssl)); ssl_init(&ssl); diff --git a/auto/threads b/auto/threads index ff33eaac..67b46690 100644 --- a/auto/threads +++ b/auto/threads @@ -47,7 +47,7 @@ nxt_feature_libs=$NXT_PTHREAD nxt_feature_test="#define _GNU_SOURCE #include - int main() { + int main(void) { pthread_yield(); return 0; }" @@ -65,7 +65,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs=$NXT_PTHREAD nxt_feature_test="#include - int main() { + int main(void) { pthread_yield_np(); return 0; }" @@ -82,7 +82,7 @@ nxt_feature_incs= nxt_feature_libs=$NXT_PTHREAD nxt_feature_test="#include - int main() { + int main(void) { pthread_spinlock_t lock; if (pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE) != 0) @@ -112,7 +112,7 @@ if [ $nxt_found = yes ]; then pthread_spinlock_t lock = 0; - int main() { + int main(void) { if (pthread_spin_trylock(&lock) != 0) return 1; if (pthread_spin_unlock(&lock) != 0) @@ -130,7 +130,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { sem_t sem; struct timespec ts; @@ -199,7 +199,7 @@ nxt_feature_test="#include return NULL; } - int main() { + int main(void) { void *n; pthread_t pt; @@ -227,7 +227,7 @@ if [ $nxt_found = no ]; then nxt_feature_libs=$NXT_PTHREAD nxt_feature_test="#include - int main() { + int main(void) { pthread_key_t key = -1; if (pthread_key_create(&key, NULL)) @@ -250,7 +250,7 @@ if [ $nxt_found = no ]; then #include #include - int main() { + int main(void) { printf(\"%d\", PTHREAD_KEYS_MAX); return 0; }" diff --git a/auto/time b/auto/time index 7663e62f..402a219c 100644 --- a/auto/time +++ b/auto/time @@ -13,7 +13,7 @@ nxt_feature_incs= nxt_feature_libs="-lrt" nxt_feature_test="#include - int main() { + int main(void) { struct timespec ts; if (clock_gettime(CLOCK_REALTIME_COARSE, &ts) == -1) @@ -36,7 +36,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { struct timespec ts; if (clock_gettime(CLOCK_REALTIME_FAST, &ts) == -1) @@ -53,7 +53,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { struct timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) @@ -87,7 +87,7 @@ nxt_feature_incs= nxt_feature_libs="-lrt" nxt_feature_test="#include - int main() { + int main(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC_COARSE, &ts) == -1) @@ -110,7 +110,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC_FAST, &ts) == -1) @@ -127,7 +127,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) @@ -163,7 +163,7 @@ nxt_feature_libs="-lhg" nxt_feature_test="#include #include - int main() { + int main(void) { hg_gethrtime(); return 0; }" @@ -181,7 +181,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { time_t t; struct tm tm; @@ -199,7 +199,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { altzone = 0; return 0; }" @@ -213,7 +213,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { time_t t; struct tm tm; diff --git a/auto/types b/auto/types index 91d53b6f..c0a871dd 100644 --- a/auto/types +++ b/auto/types @@ -18,7 +18,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(int)); return 0; }" @@ -32,7 +32,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(long)); return 0; }" @@ -46,7 +46,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(long long)); return 0; }" @@ -60,7 +60,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(void *)); return 0; }" @@ -80,7 +80,7 @@ nxt_feature_incs= nxt_feature_libs= nxt_feature_test="#include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(size_t)); return 0; }" @@ -96,7 +96,7 @@ nxt_feature_test="#define _FILE_OFFSET_BITS 64 #include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(off_t)); return 0; }" @@ -111,7 +111,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { printf(\"%d\", (int) sizeof(time_t)); return 0; }" diff --git a/auto/unix b/auto/unix index 45c6a139..1307bdbd 100644 --- a/auto/unix +++ b/auto/unix @@ -13,7 +13,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { char buf[4]; if (getrandom(buf, 4, 0) < 0) { @@ -35,7 +35,7 @@ if [ $nxt_found = no ]; then #include #include - int main() { + int main(void) { char buf[4]; if (syscall(SYS_getrandom, buf, 4, 0) < 0) { @@ -56,7 +56,7 @@ if [ $nxt_found = no ]; then nxt_feature_name=NXT_HAVE_GETENTROPY nxt_feature_test="#include - int main() { + int main(void) { char buf[4]; if (getentropy(buf, 4) == -1) { @@ -78,7 +78,7 @@ if [ $nxt_found = no ]; then nxt_feature_test="#include #include - int main() { + int main(void) { char buf[4]; if (getentropy(buf, 4) == -1) { @@ -99,7 +99,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { ucontext_t uc; if (getcontext(&uc) == 0) { @@ -126,7 +126,7 @@ if [ $nxt_found = no ]; then #include #include - int main() { + int main(void) { ucontext_t uc; if (getcontext(&uc) == 0) { @@ -155,7 +155,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { void *h = dlopen(NULL, RTLD_NOW | RTLD_GLOBAL); dlsym(h, \"\"); dlclose(h); @@ -188,7 +188,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { setproctitle(\"%s\", \"title\"); return 0; }" @@ -204,7 +204,7 @@ nxt_feature_libs= nxt_feature_test="#include #include - int main() { + int main(void) { getgrouplist(\"root\", 0, NULL, NULL); return 0; }" -- cgit From 894a2620a7c9992ac009e3e35b0a95124b89f3cb Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Wed, 16 Nov 2022 18:37:35 +0400 Subject: Propagated NXT_RUBY_CFLAGS to Ruby checks. This fixes an issue addressed in 651f5a37f5b8 on FreeBSD 12. The problem manifested itself as: configuring Ruby module checking for -fdeclspec ... found checking for Ruby library ... not found checking for Ruby library in /usr/local/lib ... not found ./configure: error: no Ruby found. --- auto/modules/ruby | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'auto') diff --git a/auto/modules/ruby b/auto/modules/ruby index 7c2f0102..608193a6 100644 --- a/auto/modules/ruby +++ b/auto/modules/ruby @@ -101,7 +101,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then nxt_feature="Ruby library" nxt_feature_name="" nxt_feature_run=value - nxt_feature_incs="${NXT_RUBY_INCPATH}" + nxt_feature_incs="${NXT_RUBY_INCPATH} ${NXT_RUBY_CFLAGS}" nxt_feature_libs="${NXT_RUBY_LIBS}" nxt_feature_test=" #include @@ -125,7 +125,7 @@ if /bin/sh -c "$NXT_RUBY -v" >> $NXT_AUTOCONF_ERR 2>&1; then nxt_feature="Ruby library in $NXT_RUBY_LIBPATH" nxt_feature_name="" nxt_feature_run=no - nxt_feature_incs="${NXT_RUBY_INCPATH}" + nxt_feature_incs="${NXT_RUBY_INCPATH} ${NXT_RUBY_CFLAGS}" nxt_feature_libs="${NXT_RUBY_LIBS}" nxt_feature_test=" #include @@ -153,7 +153,7 @@ fi nxt_feature="Ruby version" nxt_feature_name="" nxt_feature_run=value -nxt_feature_incs="${NXT_RUBY_INCPATH}" +nxt_feature_incs="${NXT_RUBY_INCPATH} ${NXT_RUBY_CFLAGS}" nxt_feature_libs="${NXT_RUBY_LIBS}" nxt_feature_test=" #include -- cgit From 4735931ace321752c387dae04c8b217ef22897ee Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Sun, 20 Nov 2022 23:15:01 +0800 Subject: Var: separating nxt_tstr_t from nxt_var_t. It's for the introduction of njs support. For each option that supports native variable and JS template literals introduced next, it's unified as template string. No functional changes. --- auto/sources | 1 + 1 file changed, 1 insertion(+) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 8f07cc0c..7d3f62cf 100644 --- a/auto/sources +++ b/auto/sources @@ -34,6 +34,7 @@ NXT_LIB_SRCS=" \ src/nxt_parse.c \ src/nxt_sprintf.c \ src/nxt_var.c \ + src/nxt_tstr.c \ src/nxt_file_name.c \ src/nxt_log.c \ src/nxt_djb_hash.c \ -- cgit From 4d6d146e920667a8afeacd355e4fb6a94387066e Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Sun, 20 Nov 2022 23:16:51 +0800 Subject: Basic njs support. --- auto/help | 2 ++ auto/njs | 41 +++++++++++++++++++++++++++++++++++++++++ auto/options | 4 ++++ auto/sources | 4 ++++ auto/summary | 1 + 5 files changed, 52 insertions(+) create mode 100644 auto/njs (limited to 'auto') diff --git a/auto/help b/auto/help index e2b81bc7..a3884679 100644 --- a/auto/help +++ b/auto/help @@ -41,6 +41,8 @@ cat << END --openssl enable OpenSSL library usage + --njs enable NJS library usage + --debug enable debug logging diff --git a/auto/njs b/auto/njs new file mode 100644 index 00000000..72304793 --- /dev/null +++ b/auto/njs @@ -0,0 +1,41 @@ + +# Copyright (C) NGINX, Inc. + + +nxt_found=no +NXT_HAVE_NJS=NO + +NXT_NJS_CFLAGS= +NXT_NJS_AUX_CFLAGS= +NXT_NJS_LIBS="-lnjs" +NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS" + +nxt_feature="NJS" +nxt_feature_name=NXT_HAVE_NJS +nxt_feature_run=no +nxt_feature_incs="$NXT_NJS_CFLAGS $NXT_NJS_AUX_CFLAGS" +nxt_feature_libs="$NXT_NJS_LIBS $NXT_NJS_AUX_LIBS" +nxt_feature_test="#include + + int main(void) { + njs_vm_t *vm; + njs_vm_opt_t opts; + + njs_vm_opt_init(&opts); + + vm = njs_vm_create(&opts); + if (vm == NULL) + return 1; + return 0; + }" +. auto/feature + +if [ $nxt_found = no ]; then + $echo + $echo $0: error: no NJS library found. + $echo + exit 1; +fi + +NXT_LIB_AUX_CFLAGS="$NXT_LIB_AUX_CFLAGS $NXT_NJS_CFLAGS" +NXT_LIB_AUX_LIBS="$NXT_NJS_LIBS $NXT_LIB_AUX_LIBS" diff --git a/auto/options b/auto/options index 572d8a9b..abcf531d 100644 --- a/auto/options +++ b/auto/options @@ -28,6 +28,8 @@ NXT_GNUTLS=NO NXT_CYASSL=NO NXT_POLARSSL=NO +NXT_NJS=NO + NXT_TEST_BUILD_EPOLL=NO NXT_TEST_BUILD_EVENTPORT=NO NXT_TEST_BUILD_DEVPOLL=NO @@ -85,6 +87,8 @@ do --cyassl) NXT_CYASSL=YES ;; --polarssl) NXT_POLARSSL=YES ;; + --njs) NXT_NJS=YES ;; + --test-build-epoll) NXT_TEST_BUILD_EPOLL=YES ;; --test-build-eventport) NXT_TEST_BUILD_EVENTPORT=YES ;; --test-build-devpoll) NXT_TEST_BUILD_DEVPOLL=YES ;; diff --git a/auto/sources b/auto/sources index 7d3f62cf..9f9a27f7 100644 --- a/auto/sources +++ b/auto/sources @@ -135,6 +135,10 @@ NXT_LIB_POLARSSL_SRCS="src/nxt_polarssl.c" NXT_LIB_PCRE_SRCS="src/nxt_pcre.c" NXT_LIB_PCRE2_SRCS="src/nxt_pcre2.c" +if [ "$NXT_NJS" != "NO" ]; then + NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_js.c" +fi + NXT_LIB_EPOLL_SRCS="src/nxt_epoll_engine.c" NXT_LIB_KQUEUE_SRCS="src/nxt_kqueue_engine.c" NXT_LIB_EVENTPORT_SRCS="src/nxt_eventport_engine.c" diff --git a/auto/summary b/auto/summary index 79e7ce34..c8a49d08 100644 --- a/auto/summary +++ b/auto/summary @@ -28,6 +28,7 @@ Unit configuration summary: Unix domain sockets support: $NXT_UNIX_DOMAIN TLS support: ............... $NXT_OPENSSL Regex support: ............. $NXT_REGEX + NJS support: ............... $NXT_NJS process isolation: ......... $NXT_ISOLATION -- cgit From e3bbf5b3b5be384a39bbd1c42d44379b17d94185 Mon Sep 17 00:00:00 2001 From: Zhidao HONG Date: Tue, 22 Nov 2022 10:13:18 +0800 Subject: NJS: added http request prototype. --- auto/sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'auto') diff --git a/auto/sources b/auto/sources index 9f9a27f7..cebced3a 100644 --- a/auto/sources +++ b/auto/sources @@ -136,7 +136,7 @@ NXT_LIB_PCRE_SRCS="src/nxt_pcre.c" NXT_LIB_PCRE2_SRCS="src/nxt_pcre2.c" if [ "$NXT_NJS" != "NO" ]; then - NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_js.c" + NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_js.c src/nxt_http_js.c" fi NXT_LIB_EPOLL_SRCS="src/nxt_epoll_engine.c" -- cgit From 09ac678943e253dfea65f84cd84963d863580efe Mon Sep 17 00:00:00 2001 From: Konstantin Pavlov Date: Tue, 29 Nov 2022 18:10:38 +0400 Subject: Used pkg-config to detect njs where available. --- auto/njs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'auto') diff --git a/auto/njs b/auto/njs index 72304793..c0c43f19 100644 --- a/auto/njs +++ b/auto/njs @@ -5,10 +5,18 @@ nxt_found=no NXT_HAVE_NJS=NO -NXT_NJS_CFLAGS= -NXT_NJS_AUX_CFLAGS= -NXT_NJS_LIBS="-lnjs" -NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS" +if /bin/sh -c "(pkg-config njs --exists)" >> $NXT_AUTOCONF_ERR 2>&1; +then + NXT_NJS_AUX_CFLAGS= + NXT_NJS_AUX_LIBS= + NXT_NJS_CFLAGS=`pkg-config njs --cflags` + NXT_NJS_LIBS=`pkg-config njs --libs` +else + NXT_NJS_AUX_CFLAGS= + NXT_NJS_AUX_LIBS="$NXT_LIBM $NXT_LIB_AUX_LIBS" + NXT_NJS_CFLAGS= + NXT_NJS_LIBS="-lnjs" +fi nxt_feature="NJS" nxt_feature_name=NXT_HAVE_NJS -- cgit From c9e433a13d0e3a9d580891f83fd5fe7f640492b7 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Mon, 24 Oct 2022 14:13:23 +0100 Subject: Isolation: wired up cgroup to build system. This commit enables the building of the cgroup code. This is only built when the cgroupv2 filesystem is found. If cgroupv2 support is found then cgroupv2: .................. YES will be printed by ./configure Reviewed-by: Alejandro Colomar Signed-off-by: Andrew Clayton --- auto/cgroup | 22 ++++++++++++++++++++++ auto/sources | 5 +++++ auto/summary | 1 + 3 files changed, 28 insertions(+) create mode 100644 auto/cgroup (limited to 'auto') diff --git a/auto/cgroup b/auto/cgroup new file mode 100644 index 00000000..2262b2ef --- /dev/null +++ b/auto/cgroup @@ -0,0 +1,22 @@ +# Copyright (C) Andrew Clayton +# Copyright (C) F5, Inc. + +NXT_HAVE_CGROUP=NO + +if [ -f "/proc/mounts" ]; then + CGROUP=$(grep cgroup2 /proc/mounts | head -n 1 | cut -d " " -f 2) + + if [ "$CGROUP" ]; then + NXT_HAVE_CGROUP=YES + + cat << END >> $NXT_AUTO_CONFIG_H + +#ifndef NXT_HAVE_CGROUP +#define NXT_HAVE_CGROUP 1 +#define NXT_CGROUP_ROOT "$CGROUP" +#endif + +END + + fi +fi diff --git a/auto/sources b/auto/sources index cebced3a..29f3c7b5 100644 --- a/auto/sources +++ b/auto/sources @@ -304,6 +304,11 @@ if [ "$NXT_HAVE_CLONE" = "YES" ]; then fi +if [ "$NXT_HAVE_CGROUP" = "YES" ]; then + NXT_LIB_SRCS="$NXT_LIB_SRCS src/nxt_cgroup.c" +fi + + if [ "$NXT_TEST_BUILD" = "YES" ]; then NXT_LIB_SRCS="$NXT_LIB_SRCS $NXT_TEST_BUILD_SRCS" fi diff --git a/auto/summary b/auto/summary index c8a49d08..51db0eae 100644 --- a/auto/summary +++ b/auto/summary @@ -31,6 +31,7 @@ Unit configuration summary: NJS support: ............... $NXT_NJS process isolation: ......... $NXT_ISOLATION + cgroupv2: .................. $NXT_HAVE_CGROUP debug logging: ............. $NXT_DEBUG -- cgit From c9c001ee16091c76773d3e9e655d777696dd755a Mon Sep 17 00:00:00 2001 From: "Sergey A. Osokin" Date: Wed, 14 Dec 2022 01:43:24 +0000 Subject: Java: upgrading third-party components. --- auto/modules/java | 6 +++--- auto/modules/java_jar.sha512 | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'auto') diff --git a/auto/modules/java b/auto/modules/java index 691060b3..bdf17022 100644 --- a/auto/modules/java +++ b/auto/modules/java @@ -238,7 +238,7 @@ cat << END > $NXT_JAVA_JARS static const char *nxt_java_system_jars[] = { END -NXT_TOMCAT_VERSION=9.0.52 +NXT_TOMCAT_VERSION=9.0.70 NXT_JAR_VERSION=$NXT_TOMCAT_VERSION @@ -284,7 +284,7 @@ static const char *nxt_java_unit_jars[] = { "$NXT_UNIT_JAR", END -NXT_JAR_VERSION=9.4.43.v20210629 +NXT_JAR_VERSION=9.4.49.v20220914 NXT_JAR_NAMESPACE=org/eclipse/jetty/ NXT_JAR_NAME=jetty-util @@ -297,7 +297,7 @@ NXT_JAR_NAME=jetty-http . auto/modules/java_get_jar NXT_JAR_NAME=classgraph -NXT_JAR_VERSION=4.8.112 +NXT_JAR_VERSION=4.8.151 NXT_JAR_NAMESPACE=io/github/classgraph/ . auto/modules/java_get_jar diff --git a/auto/modules/java_jar.sha512 b/auto/modules/java_jar.sha512 index 5289081c..d3e9016c 100644 --- a/auto/modules/java_jar.sha512 +++ b/auto/modules/java_jar.sha512 @@ -1,14 +1,14 @@ -e7ad5ee436f6befaddcdd1046022a2e30444a435d9419a33f8316f66e794cf710809dbcf7e408a087f434cd9cb724682965b5e4098e34803569241eb44288322 classgraph-4.8.112.jar +4b47eabc83f3f672a7e91af6ae97bbdbc6f01ed7149540cb06b0f530f45a95d025cc7807a6640982d23d2da50bd973ad788a4c8fdfa025da7cf93c560abbe61e classgraph-4.8.151.jar ab441acf5551a7dc81c353eaccb3b3df9e89a48987294d19e39acdb83a5b640fcdff7414cee29f5b96eaa8826647f1d5323e185018fe33a64c402d69c73c9158 ecj-3.26.0.jar -a3ce1a5a41c9791ece4cbbf049ec4add1ec41330743d6757daea520f8b329299f5dd274f9e5741ba41fe49510f203efd19540d2404390eca53421132f5f46d4b jetty-http-9.4.43.v20210629.jar -61a14e97baac9962bd68ece24f8b967eec8e32edfebfa27c6a13996a86650d82f8977bf1aa582fc9706a1b028cb3cec0057c97628235dfc130061939845229e6 jetty-server-9.4.43.v20210629.jar -304fcdba2bdbf37e8f2ea69a3f5fbdffdfefd98d80fa78883b1dca1129a4907cef63eb2fa7c83eef359022a3b6a2f3ff742d8d23075c83d049ac01f1402e97f8 jetty-util-9.4.43.v20210629.jar -f14ac948559c0b6e20f6d84e5177fea46ea1321a7a401f280ee9323f3a07e70e141d2b12c8c466c446efb55a58743af931b0584f56494f17311cab511bcd214a tomcat-api-9.0.52.jar -a5ca293732267854a296ccc79b25051acf76fa8dea6118d43aa2e95b6d1951dfaffb941430b5080d7ab62d82d2c82c9385baf99e3c4a2bb6bf4a04372149169d tomcat-el-api-9.0.52.jar -8660e11dd0f994de43b19ba251a789dc3194a6b82d674085fed510200c789b402b27ab97bcecfec0720f563bb0dd18c2631cd8bb5c35e604c1460d7357492123 tomcat-jasper-9.0.52.jar -5b0b3e0edb47e3c4269736542d66d6fc099a74965fdcd5d3a6382db3f75bec7329e81f0719aaafccd318a058ec8fbba113a6ae9234ca94a00c8c39e5c8885568 tomcat-jasper-el-9.0.52.jar -a4368d1073d79a4f8a1cb8967a5e39af87723a17b2d94466554e8e4d3e8bb2dec3ee37db9f606e0c775dd4028604d4e87921f0dda764c8ef138aa50acf03d549 tomcat-jsp-api-9.0.52.jar -8687e108489996226a83e8310c73a2a176fac9ce365a7bd3fc23955fe968c3858a24c047cb5c7fbd1f3a890c893dcdf55e88180eefe61b98c1a3bf4e316fb07e tomcat-juli-9.0.52.jar -f9929f433e2b2f93897a87d117af2519e44020b44e3a475dfc81662b08d08e010b14a3dd6df2d4800196cdba7cbb8db2b879341c5a0ef1d11e5abe63d872bc34 tomcat-servlet-api-9.0.52.jar -c21ccf969378f2cad0ead32451c2527ea944207b5a894b642ee554042fe87eb0ce647aacbf8a51d12b4ecf2bf13e9380da78d8f7792486909daba72e8d0f83f2 tomcat-util-9.0.52.jar -14b4eb31c124d22c7ea7f05808cd6a46076f9d72648afd76e2d11924874117266771a455686d704225d2eff94656f024293140a3259b108857fa6b8b218ddd63 tomcat-util-scan-9.0.52.jar +82c6985f0d7c76459bf0638fdc24f3692a11804a95845b1a45203dfcc1205ab7bf67934f6babf7eb2f2b87d637a8fcbd87eae297e4403511bf73f359b1957e09 jetty-http-9.4.49.v20220914.jar +2f199729ad9b46fda968b4bfafd657971fc9d90371852f8ad7afdae6d5752d2b84648734eabb6ffbf084800253d1da97d4bb9ad60f799ee6ae38a80c2d881fc4 jetty-server-9.4.49.v20220914.jar +e207d93ef5bc98ad2b1a43393231bdacfb3ab642b6197a8b72d819f8ad30357c4daa0a76a0459340563fcdee0fdfc111e719a2db5be778d6b1e10f1ccbe77fc9 jetty-util-9.4.49.v20220914.jar +a2cd93ccaa58191475df9aa40a11c8b3f14f77e78b6b2dc9e5fbebf07297e318d60c5cc5aca37e61bd748456b01491a0e6702b9e4d3ec3ef43d9b1a93f9b733e tomcat-api-9.0.70.jar +4b2b33f6bdcb3fbff6de7da6f7558e4a21335c5c08dbc2adba1be90ddcaa4be1ba053d9021a4891edef975759a562b46a58da6c5acc2209ae8b942e4058b7022 tomcat-el-api-9.0.70.jar +7ee837f218220022bf2543e4b3191c0a948c7f8bbd4f2e7202cc29196e5f4a8264aee027bc3521b79775b1ab0b3f8a4bef8982be9c0b2c5f95b77f36d5e5930f tomcat-jasper-9.0.70.jar +f92cdddd3aae8d1b0b861afc67344fc6544c413d78e2e810f804632e68a3667b2b1929ac4995b582af03774ad024632e820143cd53273e06a796484ce2f0a73e tomcat-jasper-el-9.0.70.jar +5ec6985740e7a5873f56430b1f0fd6e55a625fac8f5618d846072117f5ed8ccc69665fd6ebde40381099cf42ab9525f5da3cd16dd0b50a267734bfdf7f2e168d tomcat-jsp-api-9.0.70.jar +33cf08f10bad572c9e7085b3ba8e91b38a293f8838a39483b01d07d9c1b9d0e67492343e0523da24af47782ec4a5d639db49679d951ccbe1da9d1309346cc693 tomcat-juli-9.0.70.jar +0c8ee46dc49828720cd431e4e6bcb2a9d7409b3bae3d3427640b159985a27de22181151c8fa15a1f44f607730977c4ae2512c63a19c070b92e38438ad0ba8138 tomcat-servlet-api-9.0.70.jar +e882c47acdb9e5612a0810503cb8900570b68aec5dd33dd6439884b15723a67cbf982c9cf546e7cd6d67b731df3d64ec5347500ab8a987d7cb1e11a74f819325 tomcat-util-9.0.70.jar +0a562e8a40e406966ae2be5587dcad0ceae3143b03ef9b9f7dd77c6a2db522c31ed82b9c38b4464f9f80c1d8ca418ce6a09f9fecb3e0209a962da01e2f9bd626 tomcat-util-scan-9.0.70.jar -- cgit