From 53a0ee77d8cadde468cb1d1f89e7bce98238ece7 Mon Sep 17 00:00:00 2001 From: Dmitry Volyntsev Date: Fri, 24 Dec 2021 15:48:09 +0000 Subject: [PATCH] Introducing --no-openssl to disable OpenSSL discover. --- auto/modules | 2 +- auto/openssl | 55 ++++++++++++++++++++++++----------------------- auto/options | 4 ++-- nginx/config.make | 2 +- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/auto/modules b/auto/modules index 4d46c664..5f20cc6f 100644 --- a/auto/modules +++ b/auto/modules @@ -13,7 +13,7 @@ njs_module_srcs=external/njs_crypto.c . auto/module -if [ $NJS_WEBCRYPTO = YES -a $NJS_HAVE_OPENSSL = YES ]; then +if [ $NJS_OPENSSL = YES -a $NJS_HAVE_OPENSSL = YES ]; then njs_module_name=njs_webcrypto_module njs_module_incs= njs_module_srcs=external/njs_webcrypto.c diff --git a/auto/openssl b/auto/openssl index a81efdd7..adca5887 100644 --- a/auto/openssl +++ b/auto/openssl @@ -6,38 +6,39 @@ NJS_OPENSSL_LIB= NJS_HAVE_OPENSSL=NO +if [ $NJS_OPENSSL = YES ]; then + njs_found=no -njs_found=no + njs_feature="OpenSSL library" + njs_feature_name=NJS_HAVE_OPENSSL + njs_feature_run=yes + njs_feature_incs= + njs_feature_libs="-lcrypto" + njs_feature_test="#include + int main() { + EVP_CIPHER_CTX *ctx; + ctx = EVP_CIPHER_CTX_new(); + EVP_CIPHER_CTX_free(ctx); + return 0; + }" + . auto/feature -njs_feature="OpenSSL library" -njs_feature_name=NJS_HAVE_OPENSSL -njs_feature_run=yes -njs_feature_incs= -njs_feature_libs="-lcrypto" -njs_feature_test="#include - - int main() { - EVP_CIPHER_CTX *ctx; - ctx = EVP_CIPHER_CTX_new(); - EVP_CIPHER_CTX_free(ctx); - return 0; - }" -. auto/feature + if [ $njs_found = yes ]; then + njs_feature="OpenSSL version" + njs_feature_name=NJS_OPENSSL_VERSION + njs_feature_run=value + njs_feature_test="#include -if [ $njs_found = yes ]; then - njs_feature="OpenSSL version" - njs_feature_name=NJS_OPENSSL_VERSION - njs_feature_run=value - njs_feature_test="#include + int main() { + printf(\"\\\"%s\\\"\", OPENSSL_VERSION_TEXT); + return 0; + }" + . auto/feature - int main() { - printf(\"\\\"%s\\\"\", OPENSSL_VERSION_TEXT); - return 0; - }" - . auto/feature + NJS_HAVE_OPENSSL=YES + NJS_OPENSSL_LIB="$njs_feature_libs" + fi - NJS_HAVE_OPENSSL=YES - NJS_OPENSSL_LIB="$njs_feature_libs" fi diff --git a/auto/options b/auto/options index 11c1ff0c..c4282280 100644 --- a/auto/options +++ b/auto/options @@ -11,7 +11,7 @@ NJS_DEBUG_MEMORY=NO NJS_ADDRESS_SANITIZER=NO NJS_TEST262=YES -NJS_WEBCRYPTO=YES +NJS_OPENSSL=YES NJS_TRY_PCRE2=YES NJS_CONFIGURE_OPTIONS= @@ -34,7 +34,7 @@ do --debug-memory=*) NJS_DEBUG_MEMORY="$value" ;; --test262=*) NJS_TEST262="$value" ;; - --no-webcrypto) NJS_WEBCRYPTO=NO ;; + --no-openssl) NJS_OPENSSL=NO ;; --no-pcre2) NJS_TRY_PCRE2=NO ;; --help) diff --git a/nginx/config.make b/nginx/config.make index 30f88d81..7210c0da 100644 --- a/nginx/config.make +++ b/nginx/config.make @@ -3,7 +3,7 @@ cat << END >> $NGX_MAKEFILE $ngx_addon_dir/../build/libnjs.a: $NGX_MAKEFILE cd $ngx_addon_dir/.. \\ && if [ -f build/Makefile ]; then \$(MAKE) clean; fi \\ - && CFLAGS="\$(CFLAGS)" CC="\$(CC)" ./configure --no-webcrypto --no-pcre2 \\ + && CFLAGS="\$(CFLAGS)" CC="\$(CC)" ./configure --no-openssl --no-pcre2 \\ && \$(MAKE) END -- 2.47.3