Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: drop unused feature macros, update exception list #15577

Closed
wants to merge 39 commits into from

Conversation

vszakats
Copy link
Member

@vszakats vszakats commented Nov 13, 2024

  • cmp-config.pl: add remaining exceptions. Sort list.

  • drop unused HAVE_SYS_WAIT_H.
    Follow-up to 50def7c NTLM_WB: drop support #13249

  • drop unused HAVE_FCHMOD.
    Follow-up to 03cb1ff fopen: create new file using old file's mode #12395

  • autotools: stop promoting variables to macros:
    USE_NGTCP2_CRYPTO_*, USE_NGTCP2_H3, USE_OPENSSL_H3,
    HAVE_LIBRESSL.
    They are not used in the source.

  • cmake: drop unused HAVE_O_NONBLOCK,
    HAVE_DISABLED_NONBLOCKING.

  • lib: drop NEED_MALLOC_H.
    It was used in manual-build cases for Amiga/MS-DOS/Windows/WinCE, but
    never by autotools/cmake, thus apparently unnecessary.

  • lib: drop unused NEED_MEMORY_H.

  • lib: simplify classic mac feature guards,
    drop HAVE_EXTRA_STRICMP_H and HAVE_EXTRA_STRDUP_H.

  • autotools: drop unused HAVE_GETHOSTBYNAME detection.

  • autotools: drop unused OpenSSL feature tests:
    HAVE_ERR_H, HAVE_PEM_H, HAVE_RSA_H

  • autotools: drop unused OpenSSL feature tests:
    HAVE_X509_H, HAVE_CRYPTO_H, HAVE_SSL_H.

    They performed a fallback check when the primary check missed
    openssl/x509.h. Though if any other prefixed headers were found,
    OpenSSL is already assumed detected.

    The fallback check was looking for 3 unprefixed OpenSSL headers, and
    if all found, marked OpenSSL found internally, but did not promote
    it to curl_config.h via USE_OPENSSL. Meaning it either didn't do
    anything or may have continued with an inconsistent state.
    Added in d99c20f (2008)

    At the time, there was an extra AC_DEFINE(USE_SSLEAY, 1 ... logic
    after this code, which kicked in in the fallback case, but that code
    was deleted in 709cf76 (2015)

    Follow-up to 709cf76

  • autotools: drop AC_SUBST() where the value is explicitly set anyway
    and the macro is unused.

  • autotools: replace AC_SUBST(VAR, 1) with local variable assigments,
    where the @VAR@ macro is unused. Also dedupe the local variable if
    there was a parallel one used for the same purpose.

  • autotools: drop local feature variables that were never used.

  • autotools: drop unused CURL_CHECK_OPTION_NTLM_WB,
    CURL_CHECK_NTLM_WB.
    Also stop setting unused NTLM_WB_ENABLED macro for VMS.
    Follow-up to 50def7c NTLM_WB: drop support #13249

  • autotools: drop unused PKGADD_*.
    Follow-up to bae0d47 packages: remove old leftover files and dirs #3331

  • autotools: drop unused CURL_NETWORK_LIBS.
    Follow-up to 3af75e1 configure: remove USE_EXPLICIT_LIB_DEPS #14697


@github-actions github-actions bot added the CI Continuous Integration label Nov 13, 2024
@vszakats

This comment was marked as resolved.

@vszakats vszakats force-pushed the def-tidy branch 2 times, most recently from c315b59 to 32815dc Compare November 19, 2024 21:38
@vszakats vszakats added CI Continuous Integration and removed CI Continuous Integration labels Nov 19, 2024
@vszakats vszakats force-pushed the def-tidy branch 3 times, most recently from 92d007d to 70f11de Compare November 22, 2024 00:33
It was used in manual-build cases for Amiga/MS-DOS/Windows/WinCE, but
never by autotools/cmake, thus apparently unnecessary.

If it turns out be necessary, it can be re-added with the specific
platform guard right into curl_setup_once.h.
drop `HAVE_EXTRA_STRICMP_H` and `HAVE_EXTRA_STRDUP_H`
…_H, HAVE_SSL_H

The logic was doing extra work when openssl/x509.h was not found.

`AC_CHECK_HEADERS()` already considered the detection successful
if any other headers were found. So the logic kicked in in case
no headers were found. In such case it considered OpenSSL be found
_internally_ if three of the headers were found without the
`openssl/` prefix, but in this case `USE_OPENSSL` was not promoted
to `curl_config.h`. Meaning the logic did not work even if it could
detect OpenSSL with the unprefixed headers.

Logic added here d99c20f (2008)

At the time, there was an extra `AC_DEFINE(USE_SSLEAY, 1 ...` logic
after this code, which kicked in in the fallback case, but that
code was deleted in 709cf76 (2015)
@vszakats vszakats force-pushed the def-tidy branch 2 times, most recently from bb9ce34 to 4918a0c Compare November 23, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build CI Continuous Integration tidy-up
Development

Successfully merging this pull request may close these issues.

1 participant