m4: drop redundant conditions in TLS library detections#21781
Conversation
| fi | ||
| ]) | ||
|
|
||
| RUSTLS_ENABLED |
There was a problem hiding this comment.
I'm not enough of an autotools knower to evaluate on its face that this trailing RUSTLS_ENABLED being removed is a no-op. Can you help me understand why it is?
It looks like it was added fairly recently in 9c42098 as part of a bug fix and it'd be a shame to regress accidentally.
There was a problem hiding this comment.
There are two signals that make me think this was a placebo/mistake:
configuregenerates identical whether this line is there or not.- no other, functionally equivalent m4 module have this.
+1 this line by itself just evaluates to a value, which value is not consumed
by anything. Maybe it was meant as a return value of the m4 file, but AFAIU
this is not how m4 files work.
There was a problem hiding this comment.
These are convincing observations, thank you.
There was a problem hiding this comment.
Pull request overview
This PR simplifies curl’s Autoconf TLS backend detection macros by removing redundant OPT_<BACKEND> != no conditions, cleaning up a few backend-specific no-op/stray checks, and slightly restructuring conditionals for readability while keeping behavior equivalent.
Changes:
- Remove duplicated
OPT_<BACKEND> != nochecks inside TLS backend detection blocks. - OpenSSL: drop the special-case
OPT_OPENSSL=offcheck and consolidate error handling paths. - Minor cleanup: remove a Rustls no-op line, fix GnuTLS comment casing, and trim trailing whitespace in AmiSSL macro.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| m4/curl-wolfssl.m4 | Removes redundant nesting and keeps wolfSSL detection/error flow intact. |
| m4/curl-schannel.m4 | Drops redundant OPT_SCHANNEL check inside an already-guarded block. |
| m4/curl-rustls.m4 | Simplifies the final failure check and removes a no-op trailing token. |
| m4/curl-openssl.m4 | Removes OPT_OPENSSL=off special-case and merges conditional branches around failure handling. |
| m4/curl-mbedtls.m4 | Removes redundant outer condition and tightens the structure of the detection flow. |
| m4/curl-gnutls.m4 | Removes redundant nesting and normalizes comment casing while preserving detection logic. |
| m4/curl-amissl.m4 | Removes a trailing whitespace-only line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Omit checking `OPT_<BACKEND>` against `no` twice. Also: - openssl: drop stray `OPT_OPENSSL=off` check. Follow-up to 68d89f2 curl#6897 - rustls: drop no-op line. Follow-up to 9c42098 curl#13202 - gnutls: fix casing in comment. - merge `if` branches where possible after these changes. Closes curl#21781
Omit checking
OPT_<BACKEND>againstnotwice.Also:
OPT_OPENSSL=offcheck.Follow-up to 68d89f2 configure: make the TLS library choice(s) explicit #6897
Follow-up to 9c42098 m4: fix rustls pkg-config codepath #13202
ifbranches where possible after these changes.https://github.com/curl/curl/pull/21781/files?w=1