From: Otto Moerbeek Date: Fri, 28 Mar 2025 09:55:14 +0000 (+0100) Subject: Allow alternate location for libssl X-Git-Tag: dnsdist-2.0.0-alpha2~76^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c749edbb5a23a753661173fb9a8ebdff220496e;p=thirdparty%2Fpdns.git Allow alternate location for libssl Needed at least on OpenBSD to get boringssl for dnsdist with quiche, but other platforms might benefit as well --- diff --git a/meson/libssl/meson.build b/meson/libssl/meson.build index 725d955d2b..55a849c683 100644 --- a/meson/libssl/meson.build +++ b/meson/libssl/meson.build @@ -1,5 +1,18 @@ opt_libssl = get_option('tls-libssl') -dep_libssl = dependency('libssl', required: opt_libssl) +opt_libssl_dir = get_option('tls-libssl-dir') + + +if opt_libssl_dir != '' + dep_libssl = declare_dependency( + include_directories: [opt_libssl_dir / 'include'], + ) + add_global_link_arguments( + ['-L' + opt_libssl_dir / 'lib', '-lssl'], + language: ['c', 'cpp'], + ) +else + dep_libssl = dependency('libssl', required: opt_libssl) +endif if dep_libssl.found() funcs = [ diff --git a/meson_options.txt b/meson_options.txt index cf19f6a188..afcf7a7a66 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,6 +8,7 @@ option('signers-libsodium', type: 'feature', value: 'auto', description: 'Enable option('signers-libcrypto', type: 'feature', value: 'auto', description: 'Enable OpenSSL libcrypto-based signers)') option('signers-libcrypto-path', type: 'string', value: '', description: 'Custom path to find OpenSSL libcrypto') option('tls-libssl', type: 'feature', value: 'auto', description: 'OpenSSL-based TLS') +option('tls-libssl-dir', type: 'string', value: '', description: 'Alternate OpenSSL location') option('tls-gnutls', type: 'feature', value: 'auto', description: 'GnuTLS-based TLS') option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires GnuTLS or OpenSSL)') option('ipcipher', type: 'feature', value: 'auto', description: 'IPcipher (requires libcrypto)') diff --git a/pdns/dnsdistdist/meson_options.txt b/pdns/dnsdistdist/meson_options.txt index d277eabe5e..b245eb775a 100644 --- a/pdns/dnsdistdist/meson_options.txt +++ b/pdns/dnsdistdist/meson_options.txt @@ -12,6 +12,7 @@ option('hardening-experimental-scp', type: 'feature', value: 'disabled', descrip option('hardening-fortify-source', type: 'combo', choices: ['auto', 'disabled', '1', '2', '3'], value: '2', description: 'Source fortification level') option('ipcipher', type: 'feature', value: 'auto', description: 'IPCipher') option('tls-libssl', type: 'feature', value: 'auto', description: 'OpenSSL-based TLS') +option('tls-libssl-dir', type: 'string', value: '', description: 'Alternate OpenSSL location') option('tls-libssl-engines', type: 'boolean', value: false, description: 'OpenSSL-based TLS with TLS engines') option('tls-libssl-providers', type: 'boolean', value: false, description: 'OpenSSL-based TLS with TLS providers') option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires GnuTLS or OpenSSL)') diff --git a/pdns/recursordist/meson_options.txt b/pdns/recursordist/meson_options.txt index 9e2931579a..09d8668154 100644 --- a/pdns/recursordist/meson_options.txt +++ b/pdns/recursordist/meson_options.txt @@ -7,7 +7,8 @@ option('signers-libsodium', type: 'feature', value: 'auto', description: 'Enable option('signers-libcrypto', type: 'feature', value: 'auto', description: 'Enable OpenSSL libcrypto-based signers)') option('signers-libcrypto-path', type: 'string', value: '', description: 'Custom path to find OpenSSL libcrypto') option('tls-libssl', type: 'feature', value: 'auto', description: 'OpenSSL-based TLS') -option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires OpenSSL)') +option('tls-libssl-dir', type: 'string', value: '', description: 'Alternate OpenSSL location') +option('dns-over-tls', type: 'feature', value: 'auto', description: 'DNS over TLS (requires GnuTLS or OpenSSL)') option('unit-tests', type: 'boolean', value: false, description: 'Build and run unit tests') option('unit-tests-backends', type: 'boolean', value: false, description: 'Not relevant for recursor') option('reproducible', type: 'boolean', value: false, description: 'Reproducible builds (for distro maintainers, makes debugging difficult)')