]> git.kaiwu.me - njs.git/commitdiff
SSL: fixed reporting of the detected library version.
authorDmitry Volyntsev <xeioex@nginx.com>
Wed, 17 Nov 2021 17:01:07 +0000 (17:01 +0000)
committerDmitry Volyntsev <xeioex@nginx.com>
Wed, 17 Nov 2021 17:01:07 +0000 (17:01 +0000)
Previously, `openssl version` command was used to report the OpenSSL
version.  Whereas, when provided with custom CFLAGS and LDFLAGS the
used library may differ from the system one.

The fix is to report OpenSSL version using the provided library.

auto/openssl

index 8409f75f2b5108e716460c07ae04b249a8b2c348..a494ea8a79ecca0bd1d7de92cfbbb7d524d70eca 100644 (file)
@@ -25,7 +25,16 @@ njs_feature_test="#include <openssl/evp.h>
 
 
 if [ $njs_found = yes ]; then
-    echo " + OpenSSL version: `openssl version`"
+    njs_feature="OpenSSL version"
+    njs_feature_name=NJS_OPENSSL_VERSION
+    njs_feature_run=value
+    njs_feature_test="#include <openssl/ssl.h>
+
+                      int main() {
+                          printf(\"\\\"%s\\\"\", OPENSSL_VERSION_TEXT);
+                          return 0;
+                      }"
+    . auto/feature
 
     NJS_HAVE_OPENSSL=YES
     NJS_OPENSSL_LIB="$njs_feature_libs"