[njs] Configure: added --build-dir option.

Dmitry Volyntsev xeioex at nginx.com
Thu Dec 30 13:30:37 UTC 2021


details:   https://hg.nginx.org/njs/rev/c714088503bc
branches:  
changeset: 1797:c714088503bc
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Wed Dec 29 17:20:09 2021 +0000
description:
Configure: added --build-dir option.

diffstat:

 auto/help    |   2 ++
 auto/init    |  16 ----------------
 auto/make    |   2 +-
 auto/options |   2 ++
 configure    |  20 +++++++++++++++++++-
 5 files changed, 24 insertions(+), 18 deletions(-)

diffs (94 lines):

diff -r d11d962c40cd -r c714088503bc auto/help
--- a/auto/help	Wed Dec 29 17:19:55 2021 +0000
+++ b/auto/help	Wed Dec 29 17:20:09 2021 +0000
@@ -14,6 +14,8 @@ default: "$NJS_CC_OPT"
 default: "$NJS_LD_OPT"
   --ar=FILE                 set static linking program, default: "$AR"
 
+  --build-dir=DIR           set build directory, default: "$NJS_BUILD_DIR"
+
   --no-pcre                 disables PCRE/PCRE2 discovery for RegExp
                             backend. This flag allows to build PCRE/PCRE2
                             outside of libnjs.a.  When this option is enabled
diff -r d11d962c40cd -r c714088503bc auto/init
--- a/auto/init	Wed Dec 29 17:19:55 2021 +0000
+++ b/auto/init	Wed Dec 29 17:20:09 2021 +0000
@@ -15,23 +15,7 @@ NJS_CFLAGS=${NJS_CFLAGS=}
 
 NJS_BUILD_DIR=${NJS_BUILD_DIR:-build}
 
-NJS_AUTOTEST=$NJS_BUILD_DIR/autotest
-NJS_AUTOCONF_ERR=$NJS_BUILD_DIR/autoconf.err
-NJS_AUTO_CONFIG_H=$NJS_BUILD_DIR/njs_auto_config.h
-NJS_MAKEFILE=$NJS_BUILD_DIR/Makefile
-
 NJS_LIB_MODULES=
-NJS_LIB_INCS="src $NJS_BUILD_DIR"
-
-test -d $NJS_BUILD_DIR || mkdir $NJS_BUILD_DIR
-
-> $NJS_AUTOCONF_ERR
-
-cat << END > $NJS_AUTO_CONFIG_H
-
-/* This file is auto-generated by configure */
-
-END
 
 NJS_LIBRT=
 
diff -r d11d962c40cd -r c714088503bc auto/make
--- a/auto/make	Wed Dec 29 17:19:55 2021 +0000
+++ b/auto/make	Wed Dec 29 17:20:09 2021 +0000
@@ -242,7 +242,7 @@ lib_test: $NJS_BUILD_DIR/njs_auto_config
 
 test262: njs
 
-	test/test262
+	test/test262 --binary=$NJS_BUILD_DIR/njs
 
 unit_test: $NJS_BUILD_DIR/njs_auto_config.h \\
 	$NJS_BUILD_DIR/njs_unit_test
diff -r d11d962c40cd -r c714088503bc auto/options
--- a/auto/options	Wed Dec 29 17:19:55 2021 +0000
+++ b/auto/options	Wed Dec 29 17:20:09 2021 +0000
@@ -31,6 +31,8 @@ do
         --ld-opt=*)                      NJS_LD_OPT="$value"                 ;;
         --ar=*)                          AR="$value"                         ;;
 
+        --build-dir=*)                   NJS_BUILD_DIR="$value"              ;;
+
         --address-sanitizer=*)           NJS_ADDRESS_SANITIZER="$value"      ;;
         --debug=*)                       NJS_DEBUG="$value"                  ;;
         --debug-memory=*)                NJS_DEBUG_MEMORY="$value"           ;;
diff -r d11d962c40cd -r c714088503bc configure
--- a/configure	Wed Dec 29 17:19:55 2021 +0000
+++ b/configure	Wed Dec 29 17:20:09 2021 +0000
@@ -14,8 +14,26 @@ set -e
 set -u
 
 . auto/init
+. auto/options
+
+NJS_AUTOTEST=$NJS_BUILD_DIR/autotest
+NJS_AUTOCONF_ERR=$NJS_BUILD_DIR/autoconf.err
+NJS_AUTO_CONFIG_H=$NJS_BUILD_DIR/njs_auto_config.h
+NJS_MAKEFILE=$NJS_BUILD_DIR/Makefile
+
+NJS_LIB_INCS="src $NJS_BUILD_DIR"
+
+test -d $NJS_BUILD_DIR || mkdir $NJS_BUILD_DIR
+
+> $NJS_AUTOCONF_ERR
+
+cat << END > $NJS_AUTO_CONFIG_H
+
+/* This file is auto-generated by configure */
+
+END
+
 . auto/os
-. auto/options
 . auto/cc
 . auto/types
 . auto/endianness


More information about the nginx-devel mailing list