diff auto/lib/openssl/conf @ 9316:b40149d062cb

Win32: checking for system PCRE, zlib, and OpenSSL libs. Checking for system libs on Windows is beneficial when compiling in MSYS2 environments with GCC or Clang, as most libraries are readily available.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 07 Aug 2024 03:58:50 +0300
parents 0ba26c99b3a1
children
line wrap: on
line diff
--- a/auto/lib/openssl/conf
+++ b/auto/lib/openssl/conf
@@ -55,96 +55,94 @@ if [ $OPENSSL != NONE ]; then
 
 else
 
-    if [ "$NGX_PLATFORM" != win32 ]; then
-
-        OPENSSL=NO
+    OPENSSL=NO
 
-        ngx_feature="OpenSSL library"
-        ngx_feature_name="NGX_OPENSSL"
-        ngx_feature_run=no
-        ngx_feature_incs="#include <openssl/ssl.h>"
-        ngx_feature_path=
-        ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD"
-        ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
-        . auto/feature
+    ngx_feature="OpenSSL library"
+    ngx_feature_name="NGX_OPENSSL"
+    ngx_feature_run=no
+    ngx_feature_incs="#include <openssl/ssl.h>"
+    ngx_feature_path=
+    ngx_feature_libs="-lssl -lcrypto $NGX_LIBDL $NGX_LIBPTHREAD"
+    ngx_feature_test="SSL_CTX_set_options(NULL, 0)"
+    . auto/feature
 
-        if [ $ngx_found = no ]; then
+    if [ $ngx_found = no ]; then
+
+        # FreeBSD port
+
+        ngx_feature="OpenSSL library in /usr/local/"
+        ngx_feature_path="/usr/local/include"
 
-            # FreeBSD port
+        if [ $NGX_RPATH = YES ]; then
+            ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
+        else
+            ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
+        fi
 
-            ngx_feature="OpenSSL library in /usr/local/"
-            ngx_feature_path="/usr/local/include"
+        ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+        . auto/feature
+    fi
 
-            if [ $NGX_RPATH = YES ]; then
-                ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -lssl -lcrypto"
-            else
-                ngx_feature_libs="-L/usr/local/lib -lssl -lcrypto"
-            fi
+    if [ $ngx_found = no ]; then
+
+        # NetBSD port
 
-            ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+        ngx_feature="OpenSSL library in /usr/pkg/"
+        ngx_feature_path="/usr/pkg/include"
 
-            . auto/feature
+        if [ $NGX_RPATH = YES ]; then
+            ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
+        else
+            ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
         fi
 
-        if [ $ngx_found = no ]; then
+        ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
+
+        . auto/feature
+    fi
+
+    if [ $ngx_found = no ]; then
+
+        # MacPorts
 
-            # NetBSD port
+        ngx_feature="OpenSSL library in /opt/local/"
+        ngx_feature_path="/opt/local/include"
+
+        if [ $NGX_RPATH = YES ]; then
+            ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
+        else
+            ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
+        fi
+
+        ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
 
-            ngx_feature="OpenSSL library in /usr/pkg/"
-            ngx_feature_path="/usr/pkg/include"
+        . auto/feature
+    fi
+
+    if [ $ngx_found = yes ]; then
+        have=NGX_SSL . auto/have
+        CORE_INCS="$CORE_INCS $ngx_feature_path"
+        CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
+        OPENSSL=YES
+
+        if [ $USE_OPENSSL_QUIC = YES ]; then
 
-            if [ $NGX_RPATH = YES ]; then
-                ngx_feature_libs="-R/usr/pkg/lib -L/usr/pkg/lib -lssl -lcrypto"
-            else
-                ngx_feature_libs="-L/usr/pkg/lib -lssl -lcrypto"
+            ngx_feature="OpenSSL QUIC support"
+            ngx_feature_name="NGX_QUIC"
+            ngx_feature_test="SSL_set_quic_method(NULL, NULL)"
+            . auto/feature
+
+            if [ $ngx_found = no ]; then
+                have=NGX_QUIC_OPENSSL_COMPAT . auto/have
+
+                ngx_feature="OpenSSL QUIC compatibility"
+                ngx_feature_test="SSL_CTX_add_custom_ext(NULL, 0, 0,
+                                             NULL, NULL, NULL, NULL, NULL)"
+                . auto/feature
             fi
 
-            ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
-
-            . auto/feature
-        fi
-
-        if [ $ngx_found = no ]; then
-
-            # MacPorts
-
-            ngx_feature="OpenSSL library in /opt/local/"
-            ngx_feature_path="/opt/local/include"
-
-            if [ $NGX_RPATH = YES ]; then
-                ngx_feature_libs="-R/opt/local/lib -L/opt/local/lib -lssl -lcrypto"
-            else
-                ngx_feature_libs="-L/opt/local/lib -lssl -lcrypto"
-            fi
-
-            ngx_feature_libs="$ngx_feature_libs $NGX_LIBDL $NGX_LIBPTHREAD"
-
-            . auto/feature
-        fi
-
-        if [ $ngx_found = yes ]; then
-            have=NGX_SSL . auto/have
-            CORE_INCS="$CORE_INCS $ngx_feature_path"
-            CORE_LIBS="$CORE_LIBS $ngx_feature_libs"
-            OPENSSL=YES
-
-            if [ $USE_OPENSSL_QUIC = YES ]; then
-
-                ngx_feature="OpenSSL QUIC support"
-                ngx_feature_name="NGX_QUIC"
-                ngx_feature_test="SSL_set_quic_method(NULL, NULL)"
-                . auto/feature
-
-                if [ $ngx_found = no ]; then
-                    have=NGX_QUIC_OPENSSL_COMPAT . auto/have
-
-                    ngx_feature="OpenSSL QUIC compatibility"
-                    ngx_feature_test="SSL_CTX_add_custom_ext(NULL, 0, 0,
-                                                 NULL, NULL, NULL, NULL, NULL)"
-                    . auto/feature
-                fi
-
-                if [ $ngx_found = no ]; then
+            if [ $ngx_found = no ]; then
 cat << END
 
 $0: error: certain modules require OpenSSL QUIC support.
@@ -153,8 +151,7 @@ QUIC support into the system, or build t
 statically from the source with nginx by using --with-openssl=<path> option.
 
 END
-                        exit 1
-                fi
+                exit 1
             fi
         fi
     fi