From 0518cdd4b6a15f51ae5c0c418e7ff8b5cd4ade3e Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Wed, 21 Oct 2026 17:35:52 -0700 Subject: [PATCH] Configure: add configure mode without a source-root Makefile 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 | 1 + auto/make | 4 ++++ auto/options | 2 ++ 3 files changed, 7 insertions(+) diff --git a/auto/help b/auto/help index 7fb6f6e2..7f647054 100644 --- 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. diff --git a/auto/make b/auto/make index 1c62b3df..56963293 100644 --- 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 diff --git a/auto/options b/auto/options index 1e563136..6e58be1e 100644 --- a/auto/options +++ b/auto/options @@ -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" ;; -- 2.47.3