]> git.kaiwu.me - njs.git/commitdiff
Configure: added --build-dir option.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 29 Dec 2021 17:20:09 +0000 (17:20 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 29 Dec 2021 17:20:09 +0000 (17:20 +0000)
auto/help
auto/init
auto/make
auto/options
configure

index 091802e8f9d225a0f20272ef7dfcad1d5710757a..21c52ca48118e31d84b18498119610bb3abe34ce 100644 (file)
--- a/auto/help
+++ b/auto/help
@@ -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
index 4edea8b93ae7fdfb80788c8e63fc13153cc4e80c..3c92859150e96dd04872e572bf94c6ea35b61ea7 100644 (file)
--- a/auto/init
+++ b/auto/init
@@ -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=
 
index a3c6fca13ecae5fd3e61cc9736bf2f413e90ab2d..6fa45404a464e5cc90917185b83fe17fbc5ca1e6 100644 (file)
--- a/auto/make
+++ b/auto/make
@@ -242,7 +242,7 @@ lib_test: $NJS_BUILD_DIR/njs_auto_config.h \\
 
 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
index 5aab0845ee9e7be5914a906eac8899d85535f26c..3590d22f085cb25cbab133caf4ebaee1feedd2f1 100644 (file)
@@ -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"           ;;
index 5fb5af005df3c1392ed6ec0543a0aec9fda42a73..b80fed4b5ccd81fccf228e315988424d5de81252 100755 (executable)
--- a/configure
+++ b/configure
@@ -14,8 +14,26 @@ set -e
 set -u
 
 . auto/init
-. auto/os
 . 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/cc
 . auto/types
 . auto/endianness