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

libcurl.pc: Merge Libs.private into Libs for static-only builds #5373

Closed
wants to merge 1 commit into from
Closed

libcurl.pc: Merge Libs.private into Libs for static-only builds #5373

wants to merge 1 commit into from

Conversation

chewi
Copy link
Contributor

@chewi chewi commented May 11, 2020

A project being built entirely statically will call pkg-config with --static, which utilises the Libs.private field. Conversely it will not use --static when not being built entirely statically, even if there is only a static build of libcurl available. This will most likely cause the build to fail due to underlinking unless we merge the Libs fields.

Consider that this is what the Meson build system does when it generates pkg-config files.

I have also reflected this in the --libs argument of curl-config even though REQUIRE_LIB_DEPS always seems to be yes anyway.

@bagder bagder added the build label May 11, 2020
@chewi
Copy link
Contributor Author

chewi commented May 11, 2020

Sorry, I've screwed this up. The newline character is mishandled up by Automake. I didn't notice because parallel builds somewhat hid the breakage. I also didn't hit this when I did the same for SDL2 as they don't use Automake. There is AM_SUBST_NOTMAKE but you're supporting Automake versions older than 1.11. I'll have a think…

A project being built entirely statically will call pkg-config with
--static, which utilises the Libs.private field. Conversely it will
not use --static when not being built entirely statically, even if
there is only a static build of libcurl available. This will most
likely cause the build to fail due to underlinking unless we merge the
Libs fields.

Consider that this is what the Meson build system does when it
generates pkg-config files.

I have also reflected this in the --libs argument of curl-config even
though REQUIRE_LIB_DEPS always seems to be "yes" anyway.
@chewi
Copy link
Contributor Author

chewi commented May 11, 2020

Should be good now. Without AM_SUBST_NOTMAKE, I had to rework it in a slightly less clever way but it does the job.

@bagder
Copy link
Member

bagder commented May 12, 2020

Thanks!

@bagder bagder closed this in 98e5904 May 12, 2020
@chewi chewi deleted the static-only-pkg-config branch May 12, 2020 08:51
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 13, 2023
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 14, 2023
Quoting the curl commit message (adapted for libssh2):

"A project being built entirely statically will call pkg-config with
`--static`, which utilises the `Libs.private` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs` fields.

Consider that this is what the Meson build system does when it
generates pkg-config files."

Follow-up to 1209c16 libssh2#1114

Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 15, 2023
Quoting the curl commit message (adapted for libssh2):

"A project being built entirely statically will call pkg-config with
`--static`, which utilises the `Libs.private` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs` fields.

Consider that this is what the Meson build system does when it
generates pkg-config files."

Follow-up to 1209c16 libssh2#1114

Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 15, 2023
Quoting the curl commit message (adapted for libssh2):

"A project being built entirely statically will call pkg-config with
`--static`, which utilises the `Libs.private` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs` fields.

Consider that this is what the Meson build system does when it
generates pkg-config files."

Follow-up to 1209c16 libssh2#1114

Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
vszakats added a commit to libssh2/libssh2 that referenced this pull request Jul 18, 2023
Adapted for libssh2 from the curl commit message by James Le Cuirot:

"A project built entirely statically will call `pkg-config` with
`--static`, which utilises the `Libs.private:` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs:` fields.

Consider that this is what the Meson build system does when it generates
`pkg-config` files."

This patch extends the above to `Requires:`, to mirror `Libs:` with
`pkg-config` package names.

Follow-up to 1209c16 #1114

Ref: #1114 (comment)
Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes #1119
lampmanyao pushed a commit to lampmanyao/libssh2 that referenced this pull request Sep 3, 2023
Adapted for libssh2 from the curl commit message by James Le Cuirot:

"A project built entirely statically will call `pkg-config` with
`--static`, which utilises the `Libs.private:` field. Conversely it will
not use `--static` when not being built entirely statically, even if
there is only a static build of libssh2 available. This will most
likely cause the build to fail due to underlinking unless we merge the
`Libs:` fields.

Consider that this is what the Meson build system does when it generates
`pkg-config` files."

This patch extends the above to `Requires:`, to mirror `Libs:` with
`pkg-config` package names.

Follow-up to 1209c16 libssh2#1114

Ref: libssh2#1114 (comment)
Ref: curl/curl@98e5904
Ref: curl/curl#5373
Closes libssh2#1119
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants