build: clear Require.private for static-only builds in libcurl.pc

Before this patch static-only libcurl builds stored the list of module
dependencies in both `Require` and `Require.private`. The new `pccritic`
tool flagged this as an issue. Having (or not) a duplicate in
`Require.private` does not change the output created by `pkgconf` and
`pkg-config`, as tested with both with and without `--static` option.
Thus, fix by deleting the private copy.

Fixing:
```
$ pccritic libcurl.pc
bld/libcurl.pc
  score: 63/100  grade: D  (0 critical, 0 major, 9 minor, 1 info)
  [minor   ] 'libssh2' appears in both Requires and Requires.private (requires/PC051)
  [minor   ] 'libidn2' appears in both Requires and Requires.private (requires/PC051)
  [minor   ] 'openssl' appears in both Requires and Requires.private (requires/PC051)
[...]
```
Ref: https://github.com/curl/curl/actions/runs/31495008715/job/93790403026#step:10:210 (macOS, CM clang OpenSSL torture)
Ref: https://github.com/curl/curl/actions/runs/31495008825/job/93790433646#step:9:216 (mingw, AM ucrt-x86_64 wolfssl c-ares U)

Follow-up to f057de5a1a #13911
Follow-up to 98e5904165 #5373
Cherry-picked from #22543

Closes #22548
This commit is contained in:
Viktor Szakats 2026-08-11 16:32:07 +02:00
parent f5378b88a9
commit b9254da617
No known key found for this signature in database
2 changed files with 2 additions and 0 deletions

View file

@ -2301,6 +2301,7 @@ if(NOT CURL_DISABLE_INSTALL)
set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}")
set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}")
set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}")
set(LIBCURL_PC_REQUIRES_PRIVATE "")
endif()
if(BUILD_STATIC_LIBS)
set(ENABLE_STATIC "yes")

View file

@ -5209,6 +5209,7 @@ dnl Merge pkg-config private fields into public ones when static-only
if test "$enable_shared" = "no"; then
LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE
LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE
LIBCURL_PC_REQUIRES_PRIVATE=
else
LIBCURL_PC_REQUIRES=
LIBCURL_PC_LIBS=