[njs] Introducing UNIT makefile dependency scripts.

Dmitry Volyntsev xeioex at nginx.com
Fri Mar 15 10:59:34 UTC 2019


details:   https://hg.nginx.org/njs/rev/a750d6fdc54a
branches:  
changeset: 828:a750d6fdc54a
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Mar 13 15:04:58 2019 +0800
description:
Introducing UNIT makefile dependency scripts.

    1) Autogenerating Makefile.
    2) Correct makefile dependency tracking.
    3) Makefile.conf is removed.
    4) nxt/auto scripts moved to auto.

    In collaboration with ??? (Hong Zhi Dao).

This closes #110 issue on Github.

diffstat:

 Makefile                |  576 ------------------------------------------------
 auto/clang              |  321 ++++++++++++++++++++++++++
 auto/define             |   12 +
 auto/deps               |   29 ++
 auto/echo               |   12 +
 auto/editline           |   55 ++++
 auto/expect             |   36 +++
 auto/explicit_bzero     |   40 +++
 auto/feature            |  112 +++++++++
 auto/getrandom          |   91 +++++++
 auto/make               |  275 ++++++++++++++++++++++
 auto/memalign           |   50 ++++
 auto/os                 |   57 ++++
 auto/pcre               |   41 +++
 auto/sources            |   65 +++++
 auto/time               |   69 +++++
 configure               |   52 ++++-
 nginx/config            |    4 +-
 nginx/config.make       |    2 +-
 nxt/Makefile            |  273 ----------------------
 nxt/auto/clang          |  321 --------------------------
 nxt/auto/configure      |   60 -----
 nxt/auto/define         |   12 -
 nxt/auto/echo           |   12 -
 nxt/auto/editline       |   59 ----
 nxt/auto/expect         |   36 ---
 nxt/auto/explicit_bzero |   40 ---
 nxt/auto/feature        |  112 ---------
 nxt/auto/getrandom      |   91 -------
 nxt/auto/memalign       |   50 ----
 nxt/auto/os             |   57 ----
 nxt/auto/pcre           |   47 ---
 nxt/auto/time           |   73 ------
 nxt/test/Makefile       |   57 ----
 34 files changed, 1316 insertions(+), 1883 deletions(-)

diffs (truncated from 3359 to 1000 lines):

diff -r dcc7965410bd -r a750d6fdc54a Makefile
--- a/Makefile	Tue Mar 12 19:28:11 2019 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,576 +0,0 @@
-
-NXT_LIB =	nxt
-
--include	$(NXT_LIB)/Makefile.conf
-
-NXT_BUILDDIR =	build
-
-$(NXT_BUILDDIR)/libnjs.a: \
-	$(NXT_LIB)/nxt_auto_config.h \
-	$(NXT_BUILDDIR)/njs_shell.o \
-	$(NXT_BUILDDIR)/njs_vm.o \
-	$(NXT_BUILDDIR)/njs_boolean.o \
-	$(NXT_BUILDDIR)/njs_number.o \
-	$(NXT_BUILDDIR)/njs_string.o \
-	$(NXT_BUILDDIR)/njs_object.o \
-	$(NXT_BUILDDIR)/njs_array.o \
-	$(NXT_BUILDDIR)/njs_json.o \
-	$(NXT_BUILDDIR)/njs_function.o \
-	$(NXT_BUILDDIR)/njs_regexp.o \
-	$(NXT_BUILDDIR)/njs_date.o \
-	$(NXT_BUILDDIR)/njs_error.o \
-	$(NXT_BUILDDIR)/njs_math.o \
-	$(NXT_BUILDDIR)/njs_time.o \
-	$(NXT_BUILDDIR)/njs_module.o \
-	$(NXT_BUILDDIR)/njs_event.o \
-	$(NXT_BUILDDIR)/njs_fs.o \
-	$(NXT_BUILDDIR)/njs_crypto.o \
-	$(NXT_BUILDDIR)/njs_extern.o \
-	$(NXT_BUILDDIR)/njs_variable.o \
-	$(NXT_BUILDDIR)/njs_builtin.o \
-	$(NXT_BUILDDIR)/njs_lexer.o \
-	$(NXT_BUILDDIR)/njs_lexer_keyword.o \
-	$(NXT_BUILDDIR)/njs_parser.o \
-	$(NXT_BUILDDIR)/njs_parser_expression.o \
-	$(NXT_BUILDDIR)/njs_generator.o \
-	$(NXT_BUILDDIR)/njs_disassembler.o \
-	$(NXT_BUILDDIR)/nxt_diyfp.o \
-	$(NXT_BUILDDIR)/nxt_dtoa.o \
-	$(NXT_BUILDDIR)/nxt_strtod.o \
-	$(NXT_BUILDDIR)/nxt_djb_hash.o \
-	$(NXT_BUILDDIR)/nxt_utf8.o \
-	$(NXT_BUILDDIR)/nxt_array.o \
-	$(NXT_BUILDDIR)/nxt_rbtree.o \
-	$(NXT_BUILDDIR)/nxt_lvlhsh.o \
-	$(NXT_BUILDDIR)/nxt_trace.o \
-	$(NXT_BUILDDIR)/nxt_random.o \
-	$(NXT_BUILDDIR)/nxt_md5.o \
-	$(NXT_BUILDDIR)/nxt_sha1.o \
-	$(NXT_BUILDDIR)/nxt_sha2.o \
-	$(NXT_BUILDDIR)/nxt_pcre.o \
-	$(NXT_BUILDDIR)/nxt_time.o \
-	$(NXT_BUILDDIR)/nxt_file.o \
-	$(NXT_BUILDDIR)/nxt_malloc.o \
-	$(NXT_BUILDDIR)/nxt_mp.o \
-	$(NXT_BUILDDIR)/nxt_sprintf.o \
-
-	ar -r -c $(NXT_BUILDDIR)/libnjs.a \
-		$(NXT_BUILDDIR)/njs_shell.o \
-		$(NXT_BUILDDIR)/njs_vm.o \
-		$(NXT_BUILDDIR)/njs_boolean.o \
-		$(NXT_BUILDDIR)/njs_number.o \
-		$(NXT_BUILDDIR)/njs_string.o \
-		$(NXT_BUILDDIR)/njs_object.o \
-		$(NXT_BUILDDIR)/njs_array.o \
-		$(NXT_BUILDDIR)/njs_json.o \
-		$(NXT_BUILDDIR)/njs_function.o \
-		$(NXT_BUILDDIR)/njs_regexp.o \
-		$(NXT_BUILDDIR)/njs_date.o \
-		$(NXT_BUILDDIR)/njs_error.o \
-		$(NXT_BUILDDIR)/njs_math.o \
-		$(NXT_BUILDDIR)/njs_time.o \
-		$(NXT_BUILDDIR)/njs_module.o \
-		$(NXT_BUILDDIR)/njs_event.o \
-		$(NXT_BUILDDIR)/njs_fs.o \
-		$(NXT_BUILDDIR)/njs_crypto.o \
-		$(NXT_BUILDDIR)/njs_extern.o \
-		$(NXT_BUILDDIR)/njs_variable.o \
-		$(NXT_BUILDDIR)/njs_builtin.o \
-		$(NXT_BUILDDIR)/njs_lexer.o \
-		$(NXT_BUILDDIR)/njs_lexer_keyword.o \
-		$(NXT_BUILDDIR)/njs_parser.o \
-		$(NXT_BUILDDIR)/njs_parser_expression.o \
-		$(NXT_BUILDDIR)/njs_generator.o \
-		$(NXT_BUILDDIR)/njs_disassembler.o \
-		$(NXT_BUILDDIR)/nxt_diyfp.o \
-		$(NXT_BUILDDIR)/nxt_dtoa.o \
-		$(NXT_BUILDDIR)/nxt_strtod.o \
-		$(NXT_BUILDDIR)/nxt_djb_hash.o \
-		$(NXT_BUILDDIR)/nxt_utf8.o \
-		$(NXT_BUILDDIR)/nxt_array.o \
-		$(NXT_BUILDDIR)/nxt_rbtree.o \
-		$(NXT_BUILDDIR)/nxt_lvlhsh.o \
-		$(NXT_BUILDDIR)/nxt_trace.o \
-		$(NXT_BUILDDIR)/nxt_random.o \
-		$(NXT_BUILDDIR)/nxt_md5.o \
-		$(NXT_BUILDDIR)/nxt_sha1.o \
-		$(NXT_BUILDDIR)/nxt_sha2.o \
-		$(NXT_BUILDDIR)/nxt_pcre.o \
-		$(NXT_BUILDDIR)/nxt_time.o \
-		$(NXT_BUILDDIR)/nxt_file.o \
-		$(NXT_BUILDDIR)/nxt_malloc.o \
-		$(NXT_BUILDDIR)/nxt_mp.o \
-		$(NXT_BUILDDIR)/nxt_sprintf.o \
-
-all:	test lib_test
-
-njs:	$(NXT_BUILDDIR)/njs
-
-libnjs:	$(NXT_BUILDDIR)/libnjs.a
-
-njs_interactive_test:	njs_expect_test $(NXT_BUILDDIR)/njs_interactive_test
-	$(NXT_BUILDDIR)/njs_interactive_test
-
-test:	lib_test \
-	njs_interactive_test \
-	$(NXT_BUILDDIR)/njs_unit_test \
-	$(NXT_BUILDDIR)/njs_benchmark \
-
-	$(NXT_BUILDDIR)/njs_unit_test
-
-clean:
-	rm -rf $(NXT_BUILDDIR)
-	rm -f $(NXT_LIB)/Makefile.conf $(NXT_LIB)/nxt_auto_config.h
-
-dist:
-	NJS_VER=`grep NJS_VERSION njs/njs.h | sed -e 's/.*"\(.*\)".*/\1/'`; \
-	rm -rf njs-$${NJS_VER} \
-	&& hg archive njs-$${NJS_VER}.tar.gz \
-		      -p njs-$${NJS_VER} \
-		      -X ".hg*" \
-	&& echo njs-$${NJS_VER}.tar.gz done
-
-$(NXT_LIB)/nxt_auto_config.h:
-	@echo
-	@echo "	Please run ./configure before make"
-	@echo
-	@exit 1
-
-$(NXT_BUILDDIR)/njs_shell.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_function.h \
-	njs/njs_parser.h \
-	njs/njs_generator.h \
-	njs/njs.h \
-	njs/njs.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_shell.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs.c
-
-$(NXT_BUILDDIR)/njs_vm.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_number.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_object_hash.h \
-	njs/njs_array.h \
-	njs/njs_function.h \
-	njs/njs_regexp.h \
-	njs/njs_extern.h \
-	njs/njs_variable.h \
-	njs/njs_parser.h \
-	njs/njs_vm.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_vm.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_vm.c
-
-$(NXT_BUILDDIR)/njs_boolean.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_vm.h \
-	njs/njs_boolean.h \
-	njs/njs_object.h \
-	njs/njs_function.h \
-	njs/njs_boolean.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_boolean.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_boolean.c
-
-$(NXT_BUILDDIR)/njs_number.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_number.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_array.h \
-	njs/njs_function.h \
-	njs/njs_number.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_number.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_number.c
-
-$(NXT_BUILDDIR)/njs_string.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_number.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_object_hash.h \
-	njs/njs_array.h \
-	njs/njs_function.h \
-	njs/njs_regexp.h \
-	njs/njs_parser.h \
-	njs/njs_string.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_string.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs $(NXT_PCRE_CFLAGS) \
-		njs/njs_string.c
-
-$(NXT_BUILDDIR)/njs_object.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_object.h \
-	njs/njs_object_hash.h \
-	njs/njs_function.h \
-	njs/njs_object.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_object.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_object.c
-
-$(NXT_BUILDDIR)/njs_array.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_number.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_object_hash.h \
-	njs/njs_array.h \
-	njs/njs_function.h \
-	njs/njs_array.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_array.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_array.c
-
-$(NXT_BUILDDIR)/njs_json.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_object.h \
-	njs/njs_json.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_json.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_json.c
-
-
-$(NXT_BUILDDIR)/njs_function.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_object.h \
-	njs/njs_array.h \
-	njs/njs_function.h \
-	njs/njs_function.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_function.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_function.c
-
-$(NXT_BUILDDIR)/njs_regexp.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_object_hash.h \
-	njs/njs_array.h \
-	njs/njs_function.h \
-	njs/njs_regexp.h \
-	njs/njs_regexp.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_regexp.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs $(NXT_PCRE_CFLAGS) \
-		njs/njs_regexp.c
-
-$(NXT_BUILDDIR)/njs_date.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_function.h \
-	njs/njs_date.h \
-	njs/njs_date.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_date.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs $(NXT_PCRE_CFLAGS) \
-		njs/njs_date.c
-
-$(NXT_BUILDDIR)/njs_error.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_function.h \
-	njs/njs_error.h \
-	njs/njs_error.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_error.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs $(NXT_PCRE_CFLAGS) \
-		njs/njs_error.c
-
-$(NXT_BUILDDIR)/njs_math.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_object.h \
-	njs/njs_math.h \
-	njs/njs_math.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_math.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_math.c
-
-$(NXT_BUILDDIR)/njs_time.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_object.h \
-	njs/njs_time.h \
-	njs/njs_time.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_time.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_time.c
-
-$(NXT_BUILDDIR)/njs_module.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_module.h \
-	njs/njs_module.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_module.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_module.c
-
-$(NXT_BUILDDIR)/njs_event.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_event.h \
-	njs/njs_event.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_event.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_event.c
-
-$(NXT_BUILDDIR)/njs_fs.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_vm.h \
-	njs/njs_fs.h \
-	njs/njs_fs.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_fs.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_fs.c
-
-$(NXT_BUILDDIR)/njs_crypto.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_crypto.h \
-	njs/njs_crypto.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_crypto.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_crypto.c
-
-$(NXT_BUILDDIR)/njs_extern.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_parser.h \
-	njs/njs_extern.h \
-	njs/njs_extern.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_extern.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_extern.c
-
-$(NXT_BUILDDIR)/njs_variable.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_parser.h \
-	njs/njs_variable.h \
-	njs/njs_variable.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_variable.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_variable.c
-
-$(NXT_BUILDDIR)/njs_builtin.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_boolean.h \
-	njs/njs_number.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_array.h \
-	njs/njs_module.h \
-	njs/njs_function.h \
-	njs/njs_regexp.h \
-	njs/njs_parser.h \
-	njs/njs_builtin.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_builtin.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_builtin.c
-
-$(NXT_BUILDDIR)/njs_lexer.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_parser.h \
-	njs/njs_lexer.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_lexer.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_lexer.c
-
-$(NXT_BUILDDIR)/njs_lexer_keyword.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_vm.h \
-	njs/njs_number.h \
-	njs/njs_object.h \
-	njs/njs_parser.h \
-	njs/njs_lexer_keyword.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_lexer_keyword.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_lexer_keyword.c
-
-$(NXT_BUILDDIR)/njs_parser.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_string.h \
-	njs/njs_object.h \
-	njs/njs_function.h \
-	njs/njs_variable.h \
-	njs/njs_parser.h \
-	njs/njs_parser.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_parser.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_parser.c \
-
-$(NXT_BUILDDIR)/njs_parser_expression.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_number.h \
-	njs/njs_object.h \
-	njs/njs_function.h \
-	njs/njs_variable.h \
-	njs/njs_parser.h \
-	njs/njs_parser_expression.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_parser_expression.o \
-		$(NXT_CFLAGS) -I$(NXT_LIB) -Injs \
-		njs/njs_parser_expression.c
-
-$(NXT_BUILDDIR)/njs_generator.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_parser.h \
-	njs/njs_generator.h \
-	njs/njs_generator.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_generator.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_generator.c
-
-$(NXT_BUILDDIR)/njs_disassembler.o: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	njs/njs.h \
-	njs/njs_core.h \
-	njs/njs_vm.h \
-	njs/njs_object.h \
-	njs/njs_parser.h \
-	njs/njs_disassembler.c \
-
-	$(NXT_CC) -c -o $(NXT_BUILDDIR)/njs_disassembler.o $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/njs_disassembler.c
-
-$(NXT_BUILDDIR)/njs: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	$(NXT_BUILDDIR)/libnjs.a \
-	njs/njs_shell.c \
-
-	$(NXT_CC) -o $(NXT_BUILDDIR)/njs $(NXT_CFLAGS) \
-		-I$(NXT_LIB) $(NXT_EDITLINE_CFLAGS) -Injs \
-		njs/njs_shell.c \
-		$(NXT_BUILDDIR)/libnjs.a \
-		-lm $(NXT_PCRE_LIB) $(NXT_LIBRT) $(NXT_EDITLINE_LIB)
-
-$(NXT_BUILDDIR)/njs_unit_test: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	$(NXT_BUILDDIR)/libnjs.a \
-	njs/test/njs_unit_test.c \
-
-	$(NXT_CC) -o $(NXT_BUILDDIR)/njs_unit_test $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/test/njs_unit_test.c \
-		$(NXT_BUILDDIR)/libnjs.a \
-		-lm $(NXT_PCRE_LIB) $(NXT_LIBRT)
-
-$(NXT_BUILDDIR)/njs_interactive_test: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	$(NXT_BUILDDIR)/libnjs.a \
-	njs/test/njs_interactive_test.c \
-
-	$(NXT_CC) -o $(NXT_BUILDDIR)/njs_interactive_test $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/test/njs_interactive_test.c \
-		$(NXT_BUILDDIR)/libnjs.a \
-		-lm $(NXT_PCRE_LIB) $(NXT_LIBRT)
-
-$(NXT_BUILDDIR)/njs_benchmark: \
-	$(NXT_BUILDDIR)/libnxt.a \
-	$(NXT_BUILDDIR)/libnjs.a \
-	njs/test/njs_benchmark.c \
-
-	$(NXT_CC) -o $(NXT_BUILDDIR)/njs_benchmark $(NXT_CFLAGS) \
-		-I$(NXT_LIB) -Injs \
-		njs/test/njs_benchmark.c \
-		$(NXT_BUILDDIR)/libnjs.a \
-		-lm $(NXT_PCRE_LIB) $(NXT_LIBRT)
-
-include $(NXT_LIB)/Makefile
diff -r dcc7965410bd -r a750d6fdc54a auto/clang
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auto/clang	Wed Mar 13 15:04:58 2019 +0800
@@ -0,0 +1,321 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+
+$echo checking for C compiler: $CC
+cat << END >> $NXT_AUTOCONF_ERR
+----------------------------------------
+checking for C compiler: $CC
+END
+
+
+# Allow error exit status.
+set +e
+
+if [ -z `which $CC` ]; then
+    $echo
+    $echo $0: error: $CC not found.
+    $echo
+    exit 1;
+fi
+
+
+if `/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" >> $NXT_AUTOCONF_ERR 2>&1`
+then
+    NXT_CC_NAME=gcc
+    $echo " + using GNU C compiler"
+    NXT_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" 2>&1`
+    $echo " + $NXT_CC_VERSION"
+
+else
+if `/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" >> $NXT_AUTOCONF_ERR 2>&1`
+then
+    NXT_CC_NAME=clang
+    $echo " + using Clang C compiler"
+    NXT_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" 2>&1`
+    $echo " + $NXT_CC_VERSION"
+
+else
+if `/bin/sh -c "($CC -v)" 2>&1 \
+                 | grep "Apple LLVM version" >> $NXT_AUTOCONF_ERR 2>&1`
+then
+    NXT_CC_NAME=clang
+    $echo " + using Clang C compiler"
+    NXT_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "Apple LLVM version" 2>&1`
+    $echo " + $NXT_CC_VERSION"
+
+else
+if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NXT_AUTOCONF_ERR 2>&1`
+then
+    NXT_CC_NAME=SunC
+    $echo " + using Sun C compiler"
+    NXT_CC_VERSION=`/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" 2>&1`
+    $echo " + $NXT_CC_VERSION"
+
+fi # SunC
+fi # Apple LLVM clang
+fi # clang
+fi # gcc
+
+
+case $NXT_CC_NAME in
+
+    gcc)
+        nxt_define=NXT_GCC . auto/define
+
+        NXT_CFLAGS="$NXT_CFLAGS -pipe"
+        NXT_CFLAGS="$NXT_CFLAGS -fPIC"
+
+        # Do not export symbols except explicitly marked with NXT_EXPORT.
+        NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
+
+        # c99/gnu99 conflict with Solaris XOPEN.
+        #NXT_CFLAGS="$NXT_CFLAGS -std=gnu99"
+
+        NXT_CFLAGS="$NXT_CFLAGS -O"
+        #NXT_CFLAGS="$NXT_CFLAGS -O0"
+        NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
+
+        #NXT_CFLAGS="$NXT_CFLAGS -Wunused-result"
+        NXT_CFLAGS="$NXT_CFLAGS -Wno-unused-parameter"
+        #NXT_CFLAGS="$NXT_CFLAGS -Wshorten-64-to-32"
+        NXT_CFLAGS="$NXT_CFLAGS -Wwrite-strings"
+
+        # -O2 enables -fstrict-aliasing and -fstrict-overflow.
+        #NXT_CFLAGS="$NXT_CFLAGS -O2"
+        #NXT_CFLAGS="$NXT_CFLAGS -Wno-strict-aliasing"
+
+        #NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
+        #NXT_CFLAGS="$NXT_CFLAGS -momit-leaf-frame-pointer"
+
+        # -Wstrict-overflow is supported by GCC 4.2+.
+        #NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
+
+        NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
+
+        # Stop on warning.
+        NXT_CFLAGS="$NXT_CFLAGS -Werror"
+
+        # Debug.
+        NXT_CFLAGS="$NXT_CFLAGS -g"
+    ;;
+
+    clang)
+        nxt_define=NXT_CLANG . auto/define
+
+        NXT_CFLAGS="$NXT_CFLAGS -pipe"
+        NXT_CFLAGS="$NXT_CFLAGS -fPIC"
+
+        # Do not export symbols except explicitly marked with NXT_EXPORT.
+        NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
+
+        NXT_CFLAGS="$NXT_CFLAGS -O"
+        #NXT_CFLAGS="$NXT_CFLAGS -O0"
+        NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
+
+        #NXT_CFLAGS="$NXT_CFLAGS -Wunused-result"
+        NXT_CFLAGS="$NXT_CFLAGS -Wno-unused-parameter"
+        #NXT_CFLAGS="$NXT_CFLAGS -Wshorten-64-to-32"
+        NXT_CFLAGS="$NXT_CFLAGS -Wwrite-strings"
+        #NXT_CFLAGS="$NXT_CFLAGS -O2"
+        #NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
+        NXT_CFLAGS="$NXT_CFLAGS -fstrict-aliasing"
+        NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
+
+        NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
+
+        # Stop on warning.
+        NXT_CFLAGS="$NXT_CFLAGS -Werror"
+
+        # Debug.
+
+        if [ "$NXT_SYSTEM_PLATFORM" != "powerpc" ]; then
+            # "-g" flag causes the "unknown pseudo-op: `.cfi_sections'"
+            # error on PowerPC Clang.
+            NXT_CFLAGS="$NXT_CFLAGS -g"
+        fi
+    ;;
+
+    SunC)
+        nxt_define=NXT_SUNC . auto/define
+
+        NXT_CFLAGS="$NXT_CFLAGS -fPIC"
+        # Optimization.
+        NXT_CFLAGS="$NXT_CFLAGS -O -fast"
+        # Stop on warning.
+        NXT_CFLAGS="$NXT_CFLAGS -errwarn=%all"
+        # Debug.
+        NXT_CFLAGS="$NXT_CFLAGS -g"
+    ;;
+
+    *)
+    ;;
+
+esac
+
+# Stop on error exit status again.
+set -e
+
+cat << END >> $NXT_MAKEFILE
+
+NXT_CC =	${CC}
+NXT_CFLAGS =	${NXT_CFLAGS} ${CFLAGS}
+END
+
+
+# C language features.
+
+nxt_feature="GCC unsigned __int128"
+nxt_feature_name=NXT_HAVE_UNSIGNED_INT128
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="int main(void) {
+                      unsigned __int128 p = 0;
+                      return (int) p;
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __builtin_expect()"
+nxt_feature_name=NXT_HAVE_BUILTIN_EXPECT
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="int main(int argc, char *const *argv) {
+                      if ((__typeof__(argc == 0))
+                                   __builtin_expect((argc == 0), 0))
+                          return 0;
+                      return 1;
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __builtin_unreachable()"
+nxt_feature_name=NXT_HAVE_BUILTIN_UNREACHABLE
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="int main(void) {
+                      __builtin_unreachable();
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __builtin_prefetch()"
+nxt_feature_name=NXT_HAVE_BUILTIN_PREFETCH
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="int main(void) {
+                      __builtin_prefetch(0);
+                      return 0;
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __builtin_clz()"
+nxt_feature_name=NXT_HAVE_BUILTIN_CLZ
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="int main(void) {
+                      if (__builtin_clz(1) != 31) {
+                          return 1;
+                      }
+                      return 0;
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __builtin_clzll()"
+nxt_feature_name=NXT_HAVE_BUILTIN_CLZLL
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="int main(void) {
+                      if (__builtin_clzll(1ULL) != 63) {
+                          return 1;
+                      }
+                      return 0;
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __attribute__ visibility"
+nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_VISIBILITY
+nxt_feature_run=no
+nxt_feature_path=
+nxt_feature_libs=
+nxt_feature_test="int n __attribute__ ((visibility(\"default\")));
+
+                  int main(void) {
+                      return 0;
+                  }"
+. auto/feature
+
+
+nxt_feature="GCC __attribute__ malloc"
+nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_MALLOC
+nxt_feature_run=no
+nxt_feature_path=
+nxt_feature_libs=
+nxt_feature_test="#include <stdlib.h>
+
+                  void *f(void) __attribute__ ((__malloc__));
+
+                  void *f(void) {
+                      return malloc(1);
+                  }
+
+                  int main(void) {
+                      if (f() != NULL) {
+                          return 1;
+                      }
+                      return 0;
+                  }"
+. auto/feature
+
+
+nxt_os="$NXT_SYSTEM/$NXT_SYSTEM_PLATFORM"
+
+if [ "$nxt_os" = "Linux/ppc64le" ]; then
+
+    # Old GNU ld linker may hang on Linux ppc64le platform
+    # if some of these features are enabled.
+
+    echo "checking for GCC __attribute__ aligned is disabled for $nxt_os."
+
+else
+
+    nxt_feature="GCC __attribute__ aligned"
+    nxt_feature_name=NXT_HAVE_GCC_ATTRIBUTE_ALIGNED
+    nxt_feature_run=no
+    nxt_feature_path=
+    nxt_feature_libs=
+    nxt_feature_test="int n __attribute__ ((aligned(64)));
+
+                      int main(void) {
+                          return 0;
+                      }"
+    . auto/feature
+
+fi
+
+
+nxt_feature="NAN to uint conversion"
+nxt_feature_name=NXT_NAN_TO_UINT_CONVERSION
+nxt_feature_run=value
+nxt_feature_incs=
+nxt_feature_libs=-lm
+nxt_feature_test="#include <math.h>
+                  #include <stdio.h>
+                  #include <stdint.h>
+
+                  int main(void) {
+                      int64_t  i64 = acosh(0);
+                      printf(\"%x\", (uint32_t) i64);
+                      return 0;
+                  }"
+. auto/feature
diff -r dcc7965410bd -r a750d6fdc54a auto/define
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auto/define	Wed Mar 13 15:04:58 2019 +0800
@@ -0,0 +1,12 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+
+cat << END >> $NXT_AUTO_CONFIG_H
+
+#ifndef $nxt_define
+#define $nxt_define  1
+#endif
+
+END
diff -r dcc7965410bd -r a750d6fdc54a auto/deps
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auto/deps	Wed Mar 13 15:04:58 2019 +0800
@@ -0,0 +1,29 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+
+case "$NXT_CC_NAME" in
+
+    SunC):
+        nxt_gen_dep_flags() {
+            $echo "-xMMD -xMF $NXT_BUILD_DIR/$1.tmp"
+        }
+
+        nxt_gen_dep_post() {
+            $echo -n "@sed -e 's#^.*:#$NXT_BUILD_DIR/$2:#' "
+            $echo -n "$NXT_BUILD_DIR/$1.tmp > $NXT_BUILD_DIR/$1"
+            $echo " && rm -f $NXT_BUILD_DIR/$1.tmp"
+        }
+    ;;
+
+    *)
+        nxt_gen_dep_flags() {
+            $echo "-MMD -MF $NXT_BUILD_DIR/$1 -MT $NXT_BUILD_DIR/$2"
+        }
+
+        nxt_gen_dep_post() {
+            $echo ""
+        }
+    ;;
+esac
diff -r dcc7965410bd -r a750d6fdc54a auto/echo
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auto/echo	Wed Mar 13 15:04:58 2019 +0800
@@ -0,0 +1,12 @@
+
+# Copyright (C) Igor Sysoev
+# Copyright (C) NGINX, Inc.
+
+
+if [ "x$1" = x-n ]; then
+   shift
+   echo "$*\c"
+
+else
+   echo "$*"
+fi
diff -r dcc7965410bd -r a750d6fdc54a auto/editline
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/auto/editline	Wed Mar 13 15:04:58 2019 +0800
@@ -0,0 +1,55 @@
+# Copyright (C) Dmitry Volyntsev
+# Copyright (C) NGINX, Inc.
+
+
+NXT_EDITLINE_CFLAGS=
+NXT_EDITLINE_LIB=
+
+nxt_found=no
+
+nxt_feature="editline library"
+nxt_feature_name=NXT_HAVE_EDITLINE
+nxt_feature_run=no
+nxt_feature_incs="-I/usr/include/editline"
+nxt_feature_libs="-ledit"
+nxt_feature_test="#include <stdio.h>
+                  #include <readline.h>
+
+                 int main(void) {
+                     add_history(NULL);
+                     return 0;
+                 }"
+. auto/feature
+
+if [ $nxt_found = no ]; then
+
+    # FreeBSD port


More information about the nginx-devel mailing list