]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Find suitable OpenSSL version.
authorDarren Tucker <dtucker@dtucker.net>
Sun, 26 Mar 2023 03:22:53 +0000 (14:22 +1100)
committerDarren Tucker <dtucker@dtucker.net>
Sun, 26 Mar 2023 03:22:53 +0000 (14:22 +1100)
Check the installed OpenSSL versions for a suitable one, and if there
isn't (and we don't have a specific version configured) then build
without OpenSSL.

.github/configs

index eb91732c43ae6c84de6d10908dee409e98aa50ee..cf1988d71ed36dfabfb47fb97040926a501e2196 100755 (executable)
@@ -296,13 +296,22 @@ case "`./config.guess`" in
        ;;
 esac
 
-# If we have a local openssl/libressl, use that.
+# Unless specifically configured, search for a suitable version of OpenSSL,
+# otherwise build without it.
 if [ -z "${LIBCRYPTOFLAGS}" ]; then
+       LIBCRYPTOFLAGS="--without-openssl"
        # last-match
-       for i in /usr/local /usr/local/ssl /usr/local/opt/openssl; do
+       for i in /usr /usr/local /usr/local/ssl /usr/local/opt/openssl; do
+               ver="none"
                if [ -x ${i}/bin/openssl ]; then
-                       LIBCRYPTOFLAGS="--with-ssl-dir=${i}"
+                       ver="$(${i}/bin/openssl version)"
                fi
+               case "$ver" in
+                       none) ;;
+                       "OpenSSL 0."*|"OpenSSL 1.0."*|"OpenSSL 1.1.0"*) ;;
+                       "LibreSSL 2."*|"LibreSSL 3.0."*) ;;
+                       *) LIBCRYPTOFLAGS="--with-ssl-dir=${i}" ;;
+               esac
        done
 fi