[njs] Refactored file hierarchy.

Dmitry Volyntsev xeioex at nginx.com
Tue Jul 30 18:12:26 UTC 2019


details:   https://hg.nginx.org/njs/rev/8b01e5bbbd16
branches:  
changeset: 1086:8b01e5bbbd16
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Tue Jul 30 20:11:46 2019 +0300
description:
Refactored file hierarchy.

1) all source files are moved to src directory.
2) nxt files are renamed with "njs" prefix.
3) some files are renamed to avoid collisions:
    nxt_array.c -> njs_arr.c
    nxt_array.h -> njs_arr.h
    nxt_string.h -> njs_str.h
    nxt_time.c -> njs_time.c
    nxt_time.h -> njs_time.h
    njs_time.c -> njs_timer.c
    njs_time.h -> njs_timer.c
    njs_core.h -> njs_main.h
4) C tests are moved to src/test dir.
5) Other tests are moved to test dir.
6) Some structs are renamed to avoid collisions:
    nxt_array_t -> njs_arr_t
    nxt_string_t -> njs_str_t

    appropriate functions and macros are also renamed.

7) all macros, functions and other identifiers with "NXT_" and "nxt_"
    prefixes are renamed to corresponding "NJS_" or "njs_" prefix.

NO functional changes.

diffstat:

 auto/clang                               |    266 +-
 auto/define                              |      6 +-
 auto/deps                                |     20 +-
 auto/expect                              |     20 +-
 auto/explicit_bzero                      |     20 +-
 auto/feature                             |     86 +-
 auto/getrandom                           |     36 +-
 auto/make                                |    256 +-
 auto/memalign                            |     26 +-
 auto/os                                  |     32 +-
 auto/pcre                                |     26 +-
 auto/readline                            |     54 +-
 auto/sources                             |    121 +-
 auto/time                                |     46 +-
 configure                                |     34 +-
 nginx/config                             |      4 +-
 nginx/ngx_http_js_module.c               |    220 +-
 nginx/ngx_stream_js_module.c             |    154 +-
 njs/njs.h                                |    307 -
 njs/njs_array.c                          |   2211 ----
 njs/njs_array.h                          |     32 -
 njs/njs_boolean.c                        |    166 -
 njs/njs_boolean.h                        |     18 -
 njs/njs_builtin.c                        |   1355 --
 njs/njs_builtin.h                        |     17 -
 njs/njs_core.h                           |     56 -
 njs/njs_crypto.c                         |    714 -
 njs/njs_crypto.h                         |     24 -
 njs/njs_date.c                           |   2336 ----
 njs/njs_date.h                           |     22 -
 njs/njs_disassembler.c                   |    473 -
 njs/njs_error.c                          |    942 -
 njs/njs_error.h                          |     88 -
 njs/njs_event.c                          |     97 -
 njs/njs_event.h                          |     42 -
 njs/njs_extern.c                         |    412 -
 njs/njs_extern.h                         |     54 -
 njs/njs_fs.c                             |   1078 --
 njs/njs_fs.h                             |     13 -
 njs/njs_function.c                       |   1264 --
 njs/njs_function.h                       |    222 -
 njs/njs_generator.c                      |   3336 ------
 njs/njs_generator.h                      |     34 -
 njs/njs_json.c                           |   2586 -----
 njs/njs_json.h                           |     14 -
 njs/njs_lexer.c                          |    848 -
 njs/njs_lexer.h                          |    266 -
 njs/njs_lexer_keyword.c                  |    195 -
 njs/njs_math.c                           |   1167 --
 njs/njs_math.h                           |     17 -
 njs/njs_module.c                         |    547 -
 njs/njs_module.h                         |     30 -
 njs/njs_number.c                         |    900 -
 njs/njs_number.h                         |    199 -
 njs/njs_object.c                         |   2293 ----
 njs/njs_object.h                         |    148 -
 njs/njs_object_hash.h                    |    288 -
 njs/njs_object_property.c                |   1405 --
 njs/njs_parser.c                         |   2371 ----
 njs/njs_parser.h                         |    277 -
 njs/njs_parser_expression.c              |   1019 --
 njs/njs_parser_terminal.c                |   1316 --
 njs/njs_regexp.c                         |   1239 --
 njs/njs_regexp.h                         |     41 -
 njs/njs_regexp_pattern.h                 |     48 -
 njs/njs_shell.c                          |   1239 --
 njs/njs_string.c                         |   4957 ---------
 njs/njs_string.h                         |    209 -
 njs/njs_time.c                           |    150 -
 njs/njs_time.h                           |     23 -
 njs/njs_value.c                          |    454 -
 njs/njs_value.h                          |    838 -
 njs/njs_variable.c                       |    673 -
 njs/njs_variable.h                       |     77 -
 njs/njs_vm.c                             |   1209 --
 njs/njs_vm.h                             |    366 -
 njs/njs_vmcode.c                         |   2022 ---
 njs/njs_vmcode.h                         |    383 -
 njs/test/fs/ascii                        |      1 -
 njs/test/fs/non_utf8                     |      1 -
 njs/test/fs/utf8                         |      1 -
 njs/test/inputrc                         |      5 -
 njs/test/module/declaration_exception.js |     10 -
 njs/test/module/exception.js             |      4 -
 njs/test/module/export.js                |      4 -
 njs/test/module/export_expression.js     |     10 -
 njs/test/module/export_expression2.js    |      5 -
 njs/test/module/export_name.js           |      6 -
 njs/test/module/export_non_default.js    |      3 -
 njs/test/module/lib1.js                  |     19 -
 njs/test/module/lib2.js                  |      7 -
 njs/test/module/lib3.js                  |     11 -
 njs/test/module/libs/hash.js             |      9 -
 njs/test/module/loading_exception.js     |      3 -
 njs/test/module/normal.js                |     41 -
 njs/test/module/recursive.js             |      3 -
 njs/test/module/ref_exception.js         |      1 -
 njs/test/module/return.js                |      1 -
 njs/test/module/sub/sub1.js              |     12 -
 njs/test/module/sub/sub2.js              |      7 -
 njs/test/njs_benchmark.c                 |    173 -
 njs/test/njs_expect_test.exp             |    777 -
 njs/test/njs_interactive_test.c          |    359 -
 njs/test/njs_unit_test.c                 |  14690 -----------------------------
 nxt/nxt_alignment.h                      |     49 -
 nxt/nxt_array.c                          |    168 -
 nxt/nxt_array.h                          |     68 -
 nxt/nxt_clang.h                          |    160 -
 nxt/nxt_diyfp.c                          |    150 -
 nxt/nxt_diyfp.h                          |    212 -
 nxt/nxt_djb_hash.c                       |     48 -
 nxt/nxt_djb_hash.h                       |     25 -
 nxt/nxt_dtoa.c                           |    376 -
 nxt/nxt_dtoa.h                           |     12 -
 nxt/nxt_file.c                           |     74 -
 nxt/nxt_file.h                           |     15 -
 nxt/nxt_lvlhsh.c                         |    859 -
 nxt/nxt_lvlhsh.h                         |    174 -
 nxt/nxt_malloc.c                         |     52 -
 nxt/nxt_malloc.h                         |     28 -
 nxt/nxt_md5.c                            |    271 -
 nxt/nxt_md5.h                            |     23 -
 nxt/nxt_mp.c                             |    818 -
 nxt/nxt_mp.h                             |     37 -
 nxt/nxt_murmur_hash.c                    |     89 -
 nxt/nxt_murmur_hash.h                    |     15 -
 nxt/nxt_pcre.c                           |    294 -
 nxt/nxt_pcre.h                           |     39 -
 nxt/nxt_queue.c                          |     87 -
 nxt/nxt_queue.h                          |    199 -
 nxt/nxt_random.c                         |    198 -
 nxt/nxt_random.h                         |     37 -
 nxt/nxt_rbtree.c                         |    535 -
 nxt/nxt_rbtree.h                         |    126 -
 nxt/nxt_regex.h                          |     45 -
 nxt/nxt_sha1.c                           |    299 -
 nxt/nxt_sha1.h                           |     24 -
 nxt/nxt_sha2.c                           |    321 -
 nxt/nxt_sha2.h                           |     24 -
 nxt/nxt_sprintf.c                        |    611 -
 nxt/nxt_sprintf.h                        |     27 -
 nxt/nxt_string.h                         |    137 -
 nxt/nxt_strtod.c                         |    404 -
 nxt/nxt_strtod.h                         |     12 -
 nxt/nxt_stub.h                           |     45 -
 nxt/nxt_time.c                           |     31 -
 nxt/nxt_time.h                           |     27 -
 nxt/nxt_trace.c                          |     57 -
 nxt/nxt_trace.h                          |     68 -
 nxt/nxt_types.h                          |    122 -
 nxt/nxt_unicode_lower_case.h             |   1709 ---
 nxt/nxt_unicode_lower_case.pl            |     95 -
 nxt/nxt_unicode_upper_case.h             |   1867 ---
 nxt/nxt_unicode_upper_case.pl            |     95 -
 nxt/nxt_unix.h                           |     23 -
 nxt/nxt_utf8.c                           |    421 -
 nxt/nxt_utf8.h                           |    162 -
 nxt/test/lvlhsh_unit_test.c              |    276 -
 nxt/test/random_unit_test.c              |     62 -
 nxt/test/rbtree_unit_test.c              |    195 -
 nxt/test/utf8_unit_test.c                |    208 -
 src/njs.h                                |    300 +
 src/njs_alignment.h                      |     49 +
 src/njs_arr.c                            |    168 +
 src/njs_arr.h                            |     67 +
 src/njs_array.c                          |   2211 ++++
 src/njs_array.h                          |     32 +
 src/njs_boolean.c                        |    166 +
 src/njs_boolean.h                        |     18 +
 src/njs_builtin.c                        |   1355 ++
 src/njs_builtin.h                        |     17 +
 src/njs_clang.h                          |    160 +
 src/njs_crypto.c                         |    714 +
 src/njs_crypto.h                         |     24 +
 src/njs_date.c                           |   2336 ++++
 src/njs_date.h                           |     22 +
 src/njs_disassembler.c                   |    473 +
 src/njs_diyfp.c                          |    150 +
 src/njs_diyfp.h                          |    212 +
 src/njs_djb_hash.c                       |     48 +
 src/njs_djb_hash.h                       |     25 +
 src/njs_dtoa.c                           |    376 +
 src/njs_dtoa.h                           |     12 +
 src/njs_error.c                          |    942 +
 src/njs_error.h                          |     88 +
 src/njs_event.c                          |     97 +
 src/njs_event.h                          |     42 +
 src/njs_extern.c                         |    412 +
 src/njs_extern.h                         |     54 +
 src/njs_file.c                           |     74 +
 src/njs_file.h                           |     15 +
 src/njs_fs.c                             |   1078 ++
 src/njs_fs.h                             |     13 +
 src/njs_function.c                       |   1264 ++
 src/njs_function.h                       |    222 +
 src/njs_generator.c                      |   3336 ++++++
 src/njs_generator.h                      |     34 +
 src/njs_json.c                           |   2586 +++++
 src/njs_json.h                           |     14 +
 src/njs_lexer.c                          |    848 +
 src/njs_lexer.h                          |    266 +
 src/njs_lexer_keyword.c                  |    195 +
 src/njs_lvlhsh.c                         |    859 +
 src/njs_lvlhsh.h                         |    174 +
 src/njs_main.h                           |     56 +
 src/njs_malloc.c                         |     52 +
 src/njs_malloc.h                         |     28 +
 src/njs_math.c                           |   1167 ++
 src/njs_math.h                           |     17 +
 src/njs_md5.c                            |    271 +
 src/njs_md5.h                            |     23 +
 src/njs_module.c                         |    547 +
 src/njs_module.h                         |     30 +
 src/njs_mp.c                             |    818 +
 src/njs_mp.h                             |     37 +
 src/njs_murmur_hash.c                    |     89 +
 src/njs_murmur_hash.h                    |     15 +
 src/njs_number.c                         |    900 +
 src/njs_number.h                         |    199 +
 src/njs_object.c                         |   2293 ++++
 src/njs_object.h                         |    148 +
 src/njs_object_hash.h                    |    288 +
 src/njs_object_property.c                |   1405 ++
 src/njs_parser.c                         |   2371 ++++
 src/njs_parser.h                         |    277 +
 src/njs_parser_expression.c              |   1019 ++
 src/njs_parser_terminal.c                |   1316 ++
 src/njs_pcre.c                           |    294 +
 src/njs_pcre.h                           |     39 +
 src/njs_queue.c                          |     87 +
 src/njs_queue.h                          |    199 +
 src/njs_random.c                         |    198 +
 src/njs_random.h                         |     37 +
 src/njs_rbtree.c                         |    535 +
 src/njs_rbtree.h                         |    126 +
 src/njs_regex.h                          |     45 +
 src/njs_regexp.c                         |   1239 ++
 src/njs_regexp.h                         |     41 +
 src/njs_regexp_pattern.h                 |     48 +
 src/njs_sha1.c                           |    299 +
 src/njs_sha1.h                           |     24 +
 src/njs_sha2.c                           |    321 +
 src/njs_sha2.h                           |     24 +
 src/njs_shell.c                          |   1239 ++
 src/njs_sprintf.c                        |    611 +
 src/njs_sprintf.h                        |     27 +
 src/njs_str.h                            |    137 +
 src/njs_string.c                         |   4957 +++++++++
 src/njs_string.h                         |    209 +
 src/njs_strtod.c                         |    404 +
 src/njs_strtod.h                         |     12 +
 src/njs_stub.h                           |     45 +
 src/njs_time.c                           |     31 +
 src/njs_time.h                           |     27 +
 src/njs_timer.c                          |    150 +
 src/njs_timer.h                          |     23 +
 src/njs_trace.c                          |     57 +
 src/njs_trace.h                          |     68 +
 src/njs_types.h                          |    122 +
 src/njs_unicode_lower_case.h             |   1709 +++
 src/njs_unicode_lower_case.pl            |     95 +
 src/njs_unicode_upper_case.h             |   1867 +++
 src/njs_unicode_upper_case.pl            |     95 +
 src/njs_unix.h                           |     23 +
 src/njs_utf8.c                           |    421 +
 src/njs_utf8.h                           |    162 +
 src/njs_value.c                          |    454 +
 src/njs_value.h                          |    838 +
 src/njs_variable.c                       |    673 +
 src/njs_variable.h                       |     77 +
 src/njs_vm.c                             |   1209 ++
 src/njs_vm.h                             |    366 +
 src/njs_vmcode.c                         |   2022 +++
 src/njs_vmcode.h                         |    383 +
 src/test/lvlhsh_unit_test.c              |    276 +
 src/test/njs_benchmark.c                 |    173 +
 src/test/njs_interactive_test.c          |    359 +
 src/test/njs_unit_test.c                 |  14690 +++++++++++++++++++++++++++++
 src/test/random_unit_test.c              |     62 +
 src/test/rbtree_unit_test.c              |    195 +
 src/test/utf8_unit_test.c                |    208 +
 test/fs/ascii                            |      1 +
 test/fs/non_utf8                         |      1 +
 test/fs/utf8                             |      1 +
 test/inputrc                             |      5 +
 test/module/declaration_exception.js     |     10 +
 test/module/exception.js                 |      4 +
 test/module/export.js                    |      4 +
 test/module/export_expression.js         |     10 +
 test/module/export_expression2.js        |      5 +
 test/module/export_name.js               |      6 +
 test/module/export_non_default.js        |      3 +
 test/module/lib1.js                      |     19 +
 test/module/lib2.js                      |      7 +
 test/module/lib3.js                      |     11 +
 test/module/libs/hash.js                 |      9 +
 test/module/loading_exception.js         |      3 +
 test/module/normal.js                    |     41 +
 test/module/recursive.js                 |      3 +
 test/module/ref_exception.js             |      1 +
 test/module/return.js                    |      1 +
 test/module/sub/sub1.js                  |     12 +
 test/module/sub/sub2.js                  |      7 +
 test/njs_expect_test.exp                 |    777 +
 304 files changed, 74571 insertions(+), 74638 deletions(-)

diffs (truncated from 151925 to 1000 lines):

diff -r b685cc423391 -r 8b01e5bbbd16 auto/clang
--- a/auto/clang	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/clang	Tue Jul 30 20:11:46 2019 +0300
@@ -4,7 +4,7 @@
 
 
 $echo checking for C compiler: $CC
-cat << END >> $NXT_AUTOCONF_ERR
+cat << END >> $NJS_AUTOCONF_ERR
 ----------------------------------------
 checking for C compiler: $CC
 END
@@ -21,37 +21,37 @@ if [ -z `which $CC` ]; then
 fi
 
 
-if `/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" >> $NXT_AUTOCONF_ERR 2>&1`
+if `/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" >> $NJS_AUTOCONF_ERR 2>&1`
 then
-    NXT_CC_NAME=gcc
+    NJS_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"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "gcc version" 2>&1`
+    $echo " + $NJS_CC_VERSION"
 
 else
-if `/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" >> $NXT_AUTOCONF_ERR 2>&1`
+if `/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" >> $NJS_AUTOCONF_ERR 2>&1`
 then
-    NXT_CC_NAME=clang
+    NJS_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"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "clang version" 2>&1`
+    $echo " + $NJS_CC_VERSION"
 
 else
 if `/bin/sh -c "($CC -v)" 2>&1 \
-                 | grep "Apple LLVM version" >> $NXT_AUTOCONF_ERR 2>&1`
+                 | grep "Apple LLVM version" >> $NJS_AUTOCONF_ERR 2>&1`
 then
-    NXT_CC_NAME=clang
+    NJS_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"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -v)" 2>&1 | grep "Apple LLVM version" 2>&1`
+    $echo " + $NJS_CC_VERSION"
 
 else
-if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NXT_AUTOCONF_ERR 2>&1`
+if `/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" >> $NJS_AUTOCONF_ERR 2>&1`
 then
-    NXT_CC_NAME=SunC
+    NJS_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"
+    NJS_CC_VERSION=`/bin/sh -c "($CC -V)" 2>&1 | grep "Sun C" 2>&1`
+    $echo " + $NJS_CC_VERSION"
 
 fi # SunC
 fi # Apple LLVM clang
@@ -59,94 +59,94 @@ fi # clang
 fi # gcc
 
 
-case $NXT_CC_NAME in
+case $NJS_CC_NAME in
 
     gcc)
-        nxt_define=NXT_GCC . auto/define
+        njs_define=NJS_GCC . auto/define
 
-        NXT_CFLAGS="$NXT_CFLAGS -pipe"
-        NXT_CFLAGS="$NXT_CFLAGS -fPIC"
+        NJS_CFLAGS="$NJS_CFLAGS -pipe"
+        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
 
-        # Do not export symbols except explicitly marked with NXT_EXPORT.
-        NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
+        # Do not export symbols except explicitly marked with NJS_EXPORT.
+        NJS_CFLAGS="$NJS_CFLAGS -fvisibility=hidden"
 
         # c99/gnu99 conflict with Solaris XOPEN.
-        #NXT_CFLAGS="$NXT_CFLAGS -std=gnu99"
+        #NJS_CFLAGS="$NJS_CFLAGS -std=gnu99"
 
-        NXT_CFLAGS="$NXT_CFLAGS -O"
-        #NXT_CFLAGS="$NXT_CFLAGS -O0"
-        NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
+        NJS_CFLAGS="$NJS_CFLAGS -O"
+        #NJS_CFLAGS="$NJS_CFLAGS -O0"
+        NJS_CFLAGS="$NJS_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"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wunused-result"
+        NJS_CFLAGS="$NJS_CFLAGS -Wno-unused-parameter"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wshorten-64-to-32"
+        NJS_CFLAGS="$NJS_CFLAGS -Wwrite-strings"
 
         # -O2 enables -fstrict-aliasing and -fstrict-overflow.
-        #NXT_CFLAGS="$NXT_CFLAGS -O2"
-        #NXT_CFLAGS="$NXT_CFLAGS -Wno-strict-aliasing"
+        #NJS_CFLAGS="$NJS_CFLAGS -O2"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wno-strict-aliasing"
 
-        #NXT_CFLAGS="$NXT_CFLAGS -fomit-frame-pointer"
-        #NXT_CFLAGS="$NXT_CFLAGS -momit-leaf-frame-pointer"
+        #NJS_CFLAGS="$NJS_CFLAGS -fomit-frame-pointer"
+        #NJS_CFLAGS="$NJS_CFLAGS -momit-leaf-frame-pointer"
 
         # -Wstrict-overflow is supported by GCC 4.2+.
-        #NXT_CFLAGS="$NXT_CFLAGS -Wstrict-overflow=5"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wstrict-overflow=5"
 
-        NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
+        NJS_CFLAGS="$NJS_CFLAGS -Wmissing-prototypes"
 
         # Stop on warning.
-        NXT_CFLAGS="$NXT_CFLAGS -Werror"
+        NJS_CFLAGS="$NJS_CFLAGS -Werror"
 
         # Debug.
-        NXT_CFLAGS="$NXT_CFLAGS -g"
+        NJS_CFLAGS="$NJS_CFLAGS -g"
     ;;
 
     clang)
-        nxt_define=NXT_CLANG . auto/define
+        njs_define=NJS_CLANG . auto/define
 
-        NXT_CFLAGS="$NXT_CFLAGS -pipe"
-        NXT_CFLAGS="$NXT_CFLAGS -fPIC"
+        NJS_CFLAGS="$NJS_CFLAGS -pipe"
+        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
 
-        # Do not export symbols except explicitly marked with NXT_EXPORT.
-        NXT_CFLAGS="$NXT_CFLAGS -fvisibility=hidden"
+        # Do not export symbols except explicitly marked with NJS_EXPORT.
+        NJS_CFLAGS="$NJS_CFLAGS -fvisibility=hidden"
 
-        NXT_CFLAGS="$NXT_CFLAGS -O"
-        #NXT_CFLAGS="$NXT_CFLAGS -O0"
-        NXT_CFLAGS="$NXT_CFLAGS -W -Wall -Wextra"
+        NJS_CFLAGS="$NJS_CFLAGS -O"
+        #NJS_CFLAGS="$NJS_CFLAGS -O0"
+        NJS_CFLAGS="$NJS_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"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wunused-result"
+        NJS_CFLAGS="$NJS_CFLAGS -Wno-unused-parameter"
+        #NJS_CFLAGS="$NJS_CFLAGS -Wshorten-64-to-32"
+        NJS_CFLAGS="$NJS_CFLAGS -Wwrite-strings"
+        #NJS_CFLAGS="$NJS_CFLAGS -O2"
+        #NJS_CFLAGS="$NJS_CFLAGS -fomit-frame-pointer"
+        NJS_CFLAGS="$NJS_CFLAGS -fstrict-aliasing"
+        NJS_CFLAGS="$NJS_CFLAGS -Wstrict-overflow=5"
 
-        NXT_CFLAGS="$NXT_CFLAGS -Wmissing-prototypes"
+        NJS_CFLAGS="$NJS_CFLAGS -Wmissing-prototypes"
 
         # Stop on warning.
-        NXT_CFLAGS="$NXT_CFLAGS -Werror"
+        NJS_CFLAGS="$NJS_CFLAGS -Werror"
 
         # Debug.
 
-        if [ "$NXT_SYSTEM_PLATFORM" != "powerpc" ]; then
+        if [ "$NJS_SYSTEM_PLATFORM" != "powerpc" ]; then
             # "-g" flag causes the "unknown pseudo-op: `.cfi_sections'"
             # error on PowerPC Clang.
-            NXT_CFLAGS="$NXT_CFLAGS -g"
+            NJS_CFLAGS="$NJS_CFLAGS -g"
         fi
     ;;
 
     SunC)
-        nxt_define=NXT_SUNC . auto/define
+        njs_define=NJS_SUNC . auto/define
 
-        NXT_CFLAGS="$NXT_CFLAGS -fPIC"
+        NJS_CFLAGS="$NJS_CFLAGS -fPIC"
         # Optimization.
-        NXT_CFLAGS="$NXT_CFLAGS -O -fast"
+        NJS_CFLAGS="$NJS_CFLAGS -O -fast"
         # Stop on warning.
-        NXT_CFLAGS="$NXT_CFLAGS -errwarn=%all"
+        NJS_CFLAGS="$NJS_CFLAGS -errwarn=%all"
         # Debug.
-        NXT_CFLAGS="$NXT_CFLAGS -g"
+        NJS_CFLAGS="$NJS_CFLAGS -g"
     ;;
 
     *)
@@ -157,33 +157,33 @@ esac
 # Stop on error exit status again.
 set -e
 
-cat << END >> $NXT_MAKEFILE
+cat << END >> $NJS_MAKEFILE
 
-NXT_CC =	${CC}
-NXT_CFLAGS =	${NXT_CFLAGS} ${CFLAGS}
+NJS_CC =	${CC}
+NJS_CFLAGS =	${NJS_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) {
+njs_feature="GCC unsigned __int128"
+njs_feature_name=NJS_HAVE_UNSIGNED_INT128
+njs_feature_run=no
+njs_feature_incs=
+njs_feature_libs=
+njs_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) {
+njs_feature="GCC __builtin_expect()"
+njs_feature_name=NJS_HAVE_BUILTIN_EXPECT
+njs_feature_run=no
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="int main(int argc, char *const *argv) {
                       if ((__typeof__(argc == 0))
                                    __builtin_expect((argc == 0), 0))
                           return 0;
@@ -192,35 +192,35 @@ nxt_feature_test="int main(int argc, cha
 . 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) {
+njs_feature="GCC __builtin_unreachable()"
+njs_feature_name=NJS_HAVE_BUILTIN_UNREACHABLE
+njs_feature_run=no
+njs_feature_incs=
+njs_feature_libs=
+njs_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) {
+njs_feature="GCC __builtin_prefetch()"
+njs_feature_name=NJS_HAVE_BUILTIN_PREFETCH
+njs_feature_run=no
+njs_feature_incs=
+njs_feature_libs=
+njs_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) {
+njs_feature="GCC __builtin_clz()"
+njs_feature_name=NJS_HAVE_BUILTIN_CLZ
+njs_feature_run=no
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="int main(void) {
                       if (__builtin_clz(1) != 31) {
                           return 1;
                       }
@@ -229,12 +229,12 @@ nxt_feature_test="int main(void) {
 . 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) {
+njs_feature="GCC __builtin_clzll()"
+njs_feature_name=NJS_HAVE_BUILTIN_CLZLL
+njs_feature_run=no
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="int main(void) {
                       if (__builtin_clzll(1ULL) != 63) {
                           return 1;
                       }
@@ -243,12 +243,12 @@ nxt_feature_test="int main(void) {
 . 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\")));
+njs_feature="GCC __attribute__ visibility"
+njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_VISIBILITY
+njs_feature_run=no
+njs_feature_path=
+njs_feature_libs=
+njs_feature_test="int n __attribute__ ((visibility(\"default\")));
 
                   int main(void) {
                       return 0;
@@ -256,12 +256,12 @@ nxt_feature_test="int n __attribute__ ((
 . 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>
+njs_feature="GCC __attribute__ malloc"
+njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_MALLOC
+njs_feature_run=no
+njs_feature_path=
+njs_feature_libs=
+njs_feature_test="#include <stdlib.h>
 
                   void *f(void) __attribute__ ((__malloc__));
 
@@ -278,12 +278,12 @@ nxt_feature_test="#include <stdlib.h>
 . auto/feature
 
 
-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)));
+njs_feature="GCC __attribute__ aligned"
+njs_feature_name=NJS_HAVE_GCC_ATTRIBUTE_ALIGNED
+njs_feature_run=no
+njs_feature_path=
+njs_feature_libs=
+njs_feature_test="int n __attribute__ ((aligned(64)));
 
 				  int main(void) {
 					  return 0;
@@ -291,12 +291,12 @@ nxt_feature_test="int n __attribute__ ((
 . auto/feature
 
 
-nxt_feature="Memory sanitizer"
-nxt_feature_name=NXT_HAVE_MEMORY_SANITIZER
-nxt_feature_run=yes
-nxt_feature_incs=
-nxt_feature_libs=
-nxt_feature_test="#include <sanitizer/msan_interface.h>
+njs_feature="Memory sanitizer"
+njs_feature_name=NJS_HAVE_MEMORY_SANITIZER
+njs_feature_run=yes
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="#include <sanitizer/msan_interface.h>
                   int main(int argc, char *argv[]) {
                       __msan_unpoison(argv, sizeof(char *));
                       return 0;
@@ -304,12 +304,12 @@ nxt_feature_test="#include <sanitizer/ms
 . auto/feature
 
 
-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>
+njs_feature="NAN to uint conversion"
+njs_feature_name=NJS_NAN_TO_UINT_CONVERSION
+njs_feature_run=value
+njs_feature_incs=
+njs_feature_libs=-lm
+njs_feature_test="#include <math.h>
                   #include <stdio.h>
                   #include <stdint.h>
 
diff -r b685cc423391 -r 8b01e5bbbd16 auto/define
--- a/auto/define	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/define	Tue Jul 30 20:11:46 2019 +0300
@@ -3,10 +3,10 @@
 # Copyright (C) NGINX, Inc.
 
 
-cat << END >> $NXT_AUTO_CONFIG_H
+cat << END >> $NJS_AUTO_CONFIG_H
 
-#ifndef $nxt_define
-#define $nxt_define  1
+#ifndef $njs_define
+#define $njs_define  1
 #endif
 
 END
diff -r b685cc423391 -r 8b01e5bbbd16 auto/deps
--- a/auto/deps	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/deps	Tue Jul 30 20:11:46 2019 +0300
@@ -3,26 +3,26 @@
 # Copyright (C) NGINX, Inc.
 
 
-case "$NXT_CC_NAME" in
+case "$NJS_CC_NAME" in
 
     SunC):
-        nxt_gen_dep_flags() {
-            $echo "-xMMD -xMF $NXT_BUILD_DIR/$1.tmp"
+        njs_gen_dep_flags() {
+            $echo "-xMMD -xMF $NJS_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"
+        njs_gen_dep_post() {
+            $echo -n "@sed -e 's#^.*:#$NJS_BUILD_DIR/$2:#' "
+            $echo -n "$NJS_BUILD_DIR/$1.tmp > $NJS_BUILD_DIR/$1"
+            $echo " && rm -f $NJS_BUILD_DIR/$1.tmp"
         }
     ;;
 
     *)
-        nxt_gen_dep_flags() {
-            $echo "-MMD -MF $NXT_BUILD_DIR/$1 -MT $NXT_BUILD_DIR/$2"
+        njs_gen_dep_flags() {
+            $echo "-MMD -MF $NJS_BUILD_DIR/$1 -MT $NJS_BUILD_DIR/$2"
         }
 
-        nxt_gen_dep_post() {
+        njs_gen_dep_post() {
             $echo ""
         }
     ;;
diff -r b685cc423391 -r 8b01e5bbbd16 auto/expect
--- a/auto/expect	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/expect	Tue Jul 30 20:11:46 2019 +0300
@@ -2,14 +2,14 @@
 # Copyright (C) Dmitry Volyntsev
 # Copyright (C) NGINX, Inc.
 
-nxt_found=no
+njs_found=no
 $echo -n "checking for expect ..."
 
-if /bin/sh -c "(expect -v)" >> $NXT_AUTOCONF_ERR 2>&1; then
-    nxt_found=yes
+if /bin/sh -c "(expect -v)" >> $NJS_AUTOCONF_ERR 2>&1; then
+    njs_found=yes
 fi
 
-if [ $nxt_found = yes ]; then
+if [ $njs_found = yes ]; then
     $echo " found"
     $echo " + Expect version: `expect -v`"
 
@@ -17,18 +17,18 @@ else
     $echo " not found"
 fi
 
-if [ $nxt_found = yes -a $NXT_HAVE_READLINE = YES ]; then
-    cat << END >> $NXT_MAKEFILE
+if [ $njs_found = yes -a $NJS_HAVE_READLINE = YES ]; then
+    cat << END >> $NJS_MAKEFILE
 
-expect_test:	njs njs/test/njs_expect_test.exp
-	INPUTRC=njs/test/inputrc PATH=$NXT_BUILD_DIR:\$(PATH) \
-            expect -f njs/test/njs_expect_test.exp
+expect_test:	njs test/njs_expect_test.exp
+	INPUTRC=test/inputrc PATH=$NJS_BUILD_DIR:\$(PATH) \
+            expect -f test/njs_expect_test.exp
 END
 
 else
     $echo " - expect tests are disabled"
 
-    cat << END >> $NXT_MAKEFILE
+    cat << END >> $NJS_MAKEFILE
 
 expect_test:
 	@echo "Skipping expect tests"
diff -r b685cc423391 -r 8b01e5bbbd16 auto/explicit_bzero
--- a/auto/explicit_bzero	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/explicit_bzero	Tue Jul 30 20:11:46 2019 +0300
@@ -5,12 +5,12 @@
 
 # Linux (glibc and musl from 1.1.20), OpenBSD and FreeBSD.
 
-nxt_feature="explicit_bzero()"
-nxt_feature_name=NXT_HAVE_EXPLICIT_BZERO
-nxt_feature_run=yes
-nxt_feature_incs=
-nxt_feature_libs=
-nxt_feature_test="#include <strings.h>
+njs_feature="explicit_bzero()"
+njs_feature_name=NJS_HAVE_EXPLICIT_BZERO
+njs_feature_run=yes
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="#include <strings.h>
                   #include <string.h>
 
                   int main(void) {
@@ -22,13 +22,13 @@ nxt_feature_test="#include <strings.h>
 . auto/feature
 
 
-if [ $nxt_found = no ]; then
+if [ $njs_found = no ]; then
 
     # NetBSD has explicit_memset instead.
 
-    nxt_feature="explicit_memset()"
-    nxt_feature_name=NXT_HAVE_EXPLICIT_MEMSET
-    nxt_feature_test="#include <string.h>
+    njs_feature="explicit_memset()"
+    njs_feature_name=NJS_HAVE_EXPLICIT_MEMSET
+    njs_feature_test="#include <string.h>
 
                       int main(void) {
                           int r;
diff -r b685cc423391 -r 8b01e5bbbd16 auto/feature
--- a/auto/feature	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/feature	Tue Jul 30 20:11:46 2019 +0300
@@ -3,64 +3,64 @@
 # Copyright (C) NGINX, Inc.
 
 
-$echo -n "checking for $nxt_feature ..."
+$echo -n "checking for $njs_feature ..."
 
-cat << END >> $NXT_AUTOCONF_ERR
+cat << END >> $NJS_AUTOCONF_ERR
 ----------------------------------------
-checking for $nxt_feature
+checking for $njs_feature
 END
 
 
-nxt_found=no
-nxt_feature_value=
-nxt_feature_inc_path=
+njs_found=no
+njs_feature_value=
+njs_feature_inc_path=
 
-if test -n "$nxt_feature_incs"; then
-    case "$nxt_feature_incs" in
+if test -n "$njs_feature_incs"; then
+    case "$njs_feature_incs" in
         -*)
-            nxt_feature_inc_path="$nxt_feature_incs"
+            njs_feature_inc_path="$njs_feature_incs"
         ;;
 
         *)
-            for nxt_temp in $nxt_feature_incs; do
-                nxt_feature_inc_path="$nxt_feature_inc_path -I $nxt_temp"
+            for njs_temp in $njs_feature_incs; do
+                njs_feature_inc_path="$njs_feature_inc_path -I $njs_temp"
             done
         ;;
     esac
 fi
 
 
-cat << END > $NXT_AUTOTEST.c
-$nxt_feature_test
+cat << END > $NJS_AUTOTEST.c
+$njs_feature_test
 END
 
 
-nxt_test="$CC $CFLAGS $NXT_CFLAGS $NXT_CC_OPT $NXT_TEST_CFLAGS \
-          $nxt_feature_inc_path -o $NXT_AUTOTEST $NXT_AUTOTEST.c \
-          $NXT_LD_OPT $NXT_TEST_LIBS $nxt_feature_libs"
+njs_test="$CC $CFLAGS $NJS_CFLAGS $NJS_CC_OPT $NJS_TEST_CFLAGS \
+          $njs_feature_inc_path -o $NJS_AUTOTEST $NJS_AUTOTEST.c \
+          $NJS_LD_OPT $NJS_TEST_LIBS $njs_feature_libs"
 
 # /bin/sh -c "(...)" is to intercept "Killed", "Abort trap",
 # "Segmentation fault", or other shell messages.
 # "|| true" is to bypass "set -e" setting.
 
-/bin/sh -c "($nxt_test || true)" >> $NXT_AUTOCONF_ERR 2>&1
+/bin/sh -c "($njs_test || true)" >> $NJS_AUTOCONF_ERR 2>&1
 
 
-if [ -x $NXT_AUTOTEST ]; then
+if [ -x $NJS_AUTOTEST ]; then
 
-    case "$nxt_feature_run" in
+    case "$njs_feature_run" in
 
         value)
-            if /bin/sh -c "($NXT_AUTOTEST)" >> $NXT_AUTOCONF_ERR 2>&1; then
-                $echo >> $NXT_AUTOCONF_ERR
-                nxt_found=yes
-                nxt_feature_value=`$NXT_AUTOTEST`
-                $echo " $nxt_feature_value"
-                if [ -n "$nxt_feature_name" ]; then
-                    cat << END >> $NXT_AUTO_CONFIG_H
+            if /bin/sh -c "($NJS_AUTOTEST)" >> $NJS_AUTOCONF_ERR 2>&1; then
+                $echo >> $NJS_AUTOCONF_ERR
+                njs_found=yes
+                njs_feature_value=`$NJS_AUTOTEST`
+                $echo " $njs_feature_value"
+                if [ -n "$njs_feature_name" ]; then
+                    cat << END >> $NJS_AUTO_CONFIG_H
 
-#ifndef $nxt_feature_name
-#define $nxt_feature_name  $nxt_feature_value
+#ifndef $njs_feature_name
+#define $njs_feature_name  $njs_feature_value
 #endif
 
 END
@@ -71,13 +71,13 @@ END
         ;;
 
         yes)
-            if /bin/sh -c "($NXT_AUTOTEST)" >> $NXT_AUTOCONF_ERR 2>&1; then
+            if /bin/sh -c "($NJS_AUTOTEST)" >> $NJS_AUTOCONF_ERR 2>&1; then
                 $echo " found"
-                nxt_found=yes
-                cat << END >> $NXT_AUTO_CONFIG_H
+                njs_found=yes
+                cat << END >> $NJS_AUTO_CONFIG_H
 
-#ifndef $nxt_feature_name
-#define $nxt_feature_name  1
+#ifndef $njs_feature_name
+#define $njs_feature_name  1
 #endif
 
 END
@@ -88,11 +88,11 @@ END
 
         *)
             $echo " found"
-            nxt_found=yes
-            cat << END >> $NXT_AUTO_CONFIG_H
+            njs_found=yes
+            cat << END >> $NJS_AUTO_CONFIG_H
 
-#ifndef $nxt_feature_name
-#define $nxt_feature_name  1
+#ifndef $njs_feature_name
+#define $njs_feature_name  1
 #endif
 
 END
@@ -102,11 +102,11 @@ END
 else
     $echo " not found"
 
-    $echo "----------"    >> $NXT_AUTOCONF_ERR
-    cat $NXT_AUTOTEST.c       >> $NXT_AUTOCONF_ERR
-    $echo "----------"    >> $NXT_AUTOCONF_ERR
-    $echo $nxt_test       >> $NXT_AUTOCONF_ERR
-    $echo "----------"    >> $NXT_AUTOCONF_ERR
+    $echo "----------"    >> $NJS_AUTOCONF_ERR
+    cat $NJS_AUTOTEST.c       >> $NJS_AUTOCONF_ERR
+    $echo "----------"    >> $NJS_AUTOCONF_ERR
+    $echo $njs_test       >> $NJS_AUTOCONF_ERR
+    $echo "----------"    >> $NJS_AUTOCONF_ERR
 fi
 
-rm -rf $NXT_AUTOTEST*
+rm -rf $NJS_AUTOTEST*
diff -r b685cc423391 -r 8b01e5bbbd16 auto/getrandom
--- a/auto/getrandom	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/getrandom	Tue Jul 30 20:11:46 2019 +0300
@@ -5,12 +5,12 @@
 
 # Linux 3.17 with glibc 2.25, FreeBSD 12, Solaris 11.3.
 
-nxt_feature="getrandom()"
-nxt_feature_name=NXT_HAVE_GETRANDOM
-nxt_feature_run=yes
-nxt_feature_incs=
-nxt_feature_libs=
-nxt_feature_test="#include <unistd.h>
+njs_feature="getrandom()"
+njs_feature_name=NJS_HAVE_GETRANDOM
+njs_feature_run=yes
+njs_feature_incs=
+njs_feature_libs=
+njs_feature_test="#include <unistd.h>
                   #include <sys/random.h>
 
                   int main(void) {
@@ -25,13 +25,13 @@ nxt_feature_test="#include <unistd.h>
 . auto/feature
 
 
-if [ $nxt_found = no ]; then
+if [ $njs_found = no ]; then
 
     # Linux 3.17 SYS_getrandom.
 
-    nxt_feature="SYS_getrandom in Linux"
-    nxt_feature_name=NXT_HAVE_LINUX_SYS_GETRANDOM
-    nxt_feature_test="#include <unistd.h>
+    njs_feature="SYS_getrandom in Linux"
+    njs_feature_name=NJS_HAVE_LINUX_SYS_GETRANDOM
+    njs_feature_test="#include <unistd.h>
                       #include <sys/syscall.h>
                       #include <linux/random.h>
 
@@ -48,13 +48,13 @@ if [ $nxt_found = no ]; then
 fi
 
 
-if [ $nxt_found = no ]; then
+if [ $njs_found = no ]; then
 
     # OpenBSD 5.6 lacks <sys/random.h>.
 
-    nxt_feature="getentropy()"
-    nxt_feature_name=NXT_HAVE_GETENTROPY
-    nxt_feature_test="#include <unistd.h>
+    njs_feature="getentropy()"
+    njs_feature_name=NJS_HAVE_GETENTROPY
+    njs_feature_test="#include <unistd.h>
 
                       int main(void) {
                           char  buf[4];
@@ -69,13 +69,13 @@ if [ $nxt_found = no ]; then
 fi
 
 
-if [ $nxt_found = no ]; then
+if [ $njs_found = no ]; then
 
     # macOS 10.12.
 
-    nxt_feature="getentropy() in sys/random.h"
-    nxt_feature_name=NXT_HAVE_GETENTROPY_SYS_RANDOM
-    nxt_feature_test="#include <unistd.h>
+    njs_feature="getentropy() in sys/random.h"
+    njs_feature_name=NJS_HAVE_GETENTROPY_SYS_RANDOM
+    njs_feature_test="#include <unistd.h>
                       #include <sys/random.h>
 
                       int main(void) {
diff -r b685cc423391 -r 8b01e5bbbd16 auto/make
--- a/auto/make	Sun Jul 28 03:28:03 2019 -0400
+++ b/auto/make	Tue Jul 30 20:11:46 2019 +0300
@@ -4,141 +4,61 @@
 
 . auto/deps
 
-$echo "creating $NXT_MAKEFILE"
+$echo "creating $NJS_MAKEFILE"
 
-mkdir -p $NXT_BUILD_DIR/src
-mkdir -p $NXT_BUILD_DIR/test
+mkdir -p $NJS_BUILD_DIR/src
+mkdir -p $NJS_BUILD_DIR/test
 
 
-cat << END > $NXT_MAKEFILE
+cat << END > $NJS_MAKEFILE
 
 # This file is auto-generated by configure
 
-NXT_CC = ${CC}
-NXT_AR = ${AR}
-NXT_CFLAGS = ${NXT_CFLAGS} ${CFLAGS}
+NJS_CC = ${CC}
+NJS_AR = ${AR}
+NJS_CFLAGS = ${NJS_CFLAGS} ${CFLAGS}
 
-default: $NXT_DEFAULT_TARGET
+default: $NJS_DEFAULT_TARGET
 END
 
 
-# The nxt include paths list.
-
-$echo -n "NXT_LIB_INCS =" >> $NXT_MAKEFILE
+# The include paths list.
 
-for nxt_inc in nxt $NXT_BUILD_DIR
-do
-	$echo -n " -I $nxt_inc" >> $NXT_MAKEFILE
-done
+$echo -n "NJS_LIB_INCS =" >> $NJS_MAKEFILE
 
-$echo >> $NXT_MAKEFILE
-$echo >> $NXT_MAKEFILE
-
-
-# The nxt object files list.
-
-$echo "NXT_LIB_OBJS = \\" >> $NXT_MAKEFILE
-
-for nxt_src in $NXT_LIB_SRCS
+for njs_inc in src $NJS_BUILD_DIR
 do
-    fname=$(basename $nxt_src)
-    nxt_obj="src/${fname%.c}.o"
-    $echo "    $NXT_BUILD_DIR/$nxt_obj \\" >> $NXT_MAKEFILE
+	$echo -n " -I$njs_inc" >> $NJS_MAKEFILE
 done
 
-$echo >> $NXT_MAKEFILE
-
-
-# The nxt static library.
-
-cat << END >> $NXT_MAKEFILE
-
-libnxt: $NXT_BUILD_DIR/libnxt.a
-
-$NXT_BUILD_DIR/libnxt.a: \\
-	$NXT_BUILD_DIR/nxt_auto_config.h \\
-	\$(NXT_LIB_OBJS)
-	\$(NXT_AR) -r -c $NXT_BUILD_DIR/libnxt.a \\
-		\$(NXT_LIB_OBJS)
-
-END
-
-
-# The nxt object files.
-
-for nxt_src in $NXT_LIB_SRCS
-do
-    fname=$(basename $nxt_src)
-    nxt_obj="src/${fname%.c}.o"
-    nxt_dep="src/${fname%.c}.dep"
-    nxt_dep_flags=`nxt_gen_dep_flags $nxt_dep $nxt_obj`
-    nxt_dep_post=`nxt_gen_dep_post $nxt_dep $nxt_obj`
-    cat << END >> $NXT_MAKEFILE
+$echo >> $NJS_MAKEFILE
+$echo >> $NJS_MAKEFILE
 
-$NXT_BUILD_DIR/$nxt_obj: $nxt_src
-	\$(NXT_CC) -c \$(NXT_CFLAGS) $NXT_LIB_AUX_CFLAGS \\
-		\$(NXT_LIB_INCS) -o $NXT_BUILD_DIR/$nxt_obj \\
-		$nxt_dep_flags \\
-		$nxt_src \\
-		$nxt_dep_post
-
--include $NXT_BUILD_DIR/$nxt_dep
-
-END
-
-done
-
-# nxt tests.
-
-for nxt_src in $NXT_TEST_SRCS
-do
-    fname=$(basename $nxt_src)
-    nxt_dep="test/${fname%.c}.dep"
-    nxt_bin="${fname%.c}"
-    nxt_dep_flags=`nxt_gen_dep_flags $nxt_dep $fname`
-    nxt_dep_post=`nxt_gen_dep_post $nxt_dep $fname`
-    cat << END >> $NXT_MAKEFILE
-
-$NXT_BUILD_DIR/$nxt_bin: $nxt_src \\
-	$NXT_BUILD_DIR/libnxt.a
-	\$(NXT_CC) -o $NXT_BUILD_DIR/$nxt_bin \$(NXT_CFLAGS) \\
-		\$(NXT_LIB_INCS) $nxt_dep_flags \\
-		$nxt_src $NXT_BUILD_DIR/libnxt.a \\
-		$nxt_dep_post -lm
-
--include $NXT_BUILD_DIR/$nxt_dep
-
-END
-
-done
 
 # The njs object files list.
 
-$echo "NJS_LIB_OBJS = \\" >> $NXT_MAKEFILE
+$echo "NJS_LIB_OBJS = \\" >> $NJS_MAKEFILE
 
 for njs_src in $NJS_LIB_SRCS
 do
     fname=$(basename $njs_src)
     njs_obj="src/${fname%.c}.o"
-    $echo "    $NXT_BUILD_DIR/$njs_obj \\" >> $NXT_MAKEFILE
+    $echo "    $NJS_BUILD_DIR/$njs_obj \\" >> $NJS_MAKEFILE
 done
 
-$echo >> $NXT_MAKEFILE
-
+$echo >> $NJS_MAKEFILE
 
 # The njs static library.
 
-cat << END >> $NXT_MAKEFILE
-
-libnjs: $NXT_BUILD_DIR/libnjs.a
+cat << END >> $NJS_MAKEFILE
 
-$NXT_BUILD_DIR/libnjs.a:   \\
-	$NXT_BUILD_DIR/nxt_auto_config.h \\
-	\$(NXT_LIB_OBJS) \\
+libnjs: $NJS_BUILD_DIR/libnjs.a
+
+$NJS_BUILD_DIR/libnjs.a:   \\
+	$NJS_BUILD_DIR/njs_auto_config.h \\
 	\$(NJS_LIB_OBJS)
 
-	\$(NXT_AR) -r -c $NXT_BUILD_DIR/libnjs.a \\
-		\$(NXT_LIB_OBJS) \\
+	\$(NJS_AR) -r -c $NJS_BUILD_DIR/libnjs.a \\
 		\$(NJS_LIB_OBJS)
 
 END
@@ -151,19 +71,19 @@ do
     fname=$(basename $njs_src)
     njs_obj="src/${fname%.c}.o"
     njs_dep="src/${fname%.c}.dep"
-    njs_dep_flags=`nxt_gen_dep_flags $njs_dep $njs_obj`
-    njs_dep_post=`nxt_gen_dep_post $njs_dep $njs_obj`
-    cat << END >> $NXT_MAKEFILE
+    njs_dep_flags=`njs_gen_dep_flags $njs_dep $njs_obj`
+    njs_dep_post=`njs_gen_dep_post $njs_dep $njs_obj`
+    cat << END >> $NJS_MAKEFILE
 
-$NXT_BUILD_DIR/$njs_obj: $njs_src
-	\$(NXT_CC) -c \$(NXT_CFLAGS) $NXT_LIB_AUX_CFLAGS \\
-		\$(NXT_LIB_INCS) -Injs \\
-		-o $NXT_BUILD_DIR/$njs_obj \\
+$NJS_BUILD_DIR/$njs_obj: $njs_src
+	\$(NJS_CC) -c \$(NJS_CFLAGS) $NJS_LIB_AUX_CFLAGS \\
+		\$(NJS_LIB_INCS) -Injs \\
+		-o $NJS_BUILD_DIR/$njs_obj \\
 		$njs_dep_flags \\
 		$njs_src
 		$njs_dep_post
 
--include $NXT_BUILD_DIR/$njs_dep
+-include $NJS_BUILD_DIR/$njs_dep
 
 END
 
@@ -171,20 +91,45 @@ done
 
 # njs cli.
 
-cat << END >> $NXT_MAKEFILE
+cat << END >> $NJS_MAKEFILE
 
-$NXT_BUILD_DIR/njs: \\
-	$NXT_BUILD_DIR/libnxt.a \\
-	$NXT_BUILD_DIR/libnjs.a \\


More information about the nginx-devel mailing list