How to integrate multiple inline `if` variable checks into `configure` flag selection
0
votes
1
answer
68
views
I'm compiling Nginx from source on Debian 12 in Bash. I'd like to select the TLS vendor (e.g. LibreSSL, OpenSSL) via a preflight variable (
$nginx_tls_vendor
). An example configure
command without the variable stuff looks like this:
./configure \
--with-foo \
[…]
--with-openssl=/src/vendor/library-1.2.3 \
--with-openssl-opt="baz" \
[…]
--with-bar \
The values of the --with-openssl
and --with-openssl-opt
flags depend on $nginx_tls_vendor
. Broadly like this for each vendor:
if [ "$nginx_tls_vendor" = "libressl" ] \
; then \
--with-openssl=/src/libressl/libressl-1.2.3 \
--with-openssl-opt="baz-libressl etc" \
; fi
if [ "$nginx_tls_vendor" = "openssl" ] \
; then \
--with-openssl=/src/openssl/openssl-3.2.1 \
--with-openssl-opt="baz-openssl etc" \
; fi
I haven't yet figured out how to use one or more if
checks inline within a command. I am reasonably comfortable with an if
wrapper around an entire command, but this doesn't apply here. I would like to use two inline if
checks to find the TLS vendor and apply the relevant flags.
I've tried various things that might work but they end up breaking my download-and-compile script.
I would be grateful for some guidance and / or further reading so I can integrate two consecutive if
checks around the two --with-openssl
and --with-openssl-opt
flags.
Thank you.
Asked by Pete Cooper
(163 rep)
Mar 30, 2024, 07:21 PM
Last activity: Mar 31, 2024, 02:15 PM
Last activity: Mar 31, 2024, 02:15 PM