]> git.kaiwu.me - njs.git/commitdiff
Configure: add configure mode without a source-root Makefile
authorDmitry Volyntsev <xeioex@nginx.com>
Thu, 22 Oct 2026 00:35:52 +0000 (17:35 -0700)
committerDmitry Volyntsev <xeioexception@gmail.com>
Thu, 22 Oct 2026 21:25:01 +0000 (14:25 -0700)
Configuring a separate build directory still replaces the source-root
Makefile and redirects subsequent CLI builds.  Allow embedded builds
to leave the standalone build entry point unchanged.

auto/help
auto/make
auto/options

index 7fb6f6e23a7adb3c198a858559f1806ed28eb38c..7f647054d87eabc6d2a4d939d467f93e78fe4227 100644 (file)
--- a/auto/help
+++ b/auto/help
@@ -47,6 +47,7 @@ default: "$NJS_LD_OPT"
                             When this option is enabled only PCRE library
                             is discovered.
   --no-quickjs              disables QuickJS engine discovery.
+  --no-root-makefile        skips creation of the source-root Makefile.
   --no-zlib                 disables zlib discovery. When this option is
                             enabled zlib dependant code is not built as a
                             part of libnjs.a.
index 1c62b3df07a5923f7ef28ef7fc18bcee48db5ec2..5696329379a0b0099c83581f89b0719ddd15b7da 100644 (file)
--- a/auto/make
+++ b/auto/make
@@ -454,6 +454,8 @@ END
 
 # Makefile.
 
+if [ "$NJS_ROOT_MAKEFILE" = YES ]; then
+
 cat << END > Makefile
 
 # This file is auto-generated by configure
@@ -465,3 +467,5 @@ clean:
        rm -rf $NJS_BUILD_DIR Makefile
 
 END
+
+fi
index 1e5631362703d779ddee4608aaafd439d9e1c640..6e58be1e2a4569456adb8222d557d55633c7bba4 100644 (file)
@@ -26,6 +26,7 @@ NJS_PCRE=YES
 NJS_TRY_PCRE2=YES
 
 NJS_TRY_GOTO=YES
+NJS_ROOT_MAKEFILE=YES
 
 NJS_CONFIGURE_OPTIONS=
 
@@ -45,6 +46,7 @@ do
         --pic=*)                         NJS_PIC="$value"                    ;;
 
         --build-dir=*)                   NJS_BUILD_DIR="$value"              ;;
+        --no-root-makefile)              NJS_ROOT_MAKEFILE=NO                ;;
 
         --address-sanitizer=*)           NJS_ADDRESS_SANITIZER="$value"      ;;
         --addr2line=*)                   NJS_ADDR2LINE="$value"              ;;