Use ExtUtils::PkgConfig to discover the CFLAGS and LDFLAGS for external libraries#210
Merged
Merged
Conversation
1992abc to
3998044
Compare
Contributor
|
@marc-vanderwal, milestone? |
Contributor
Author
|
I wasn’t sure about the milestone. It might be nice to have it in 2024.2, though. What do you think? |
Contributor
|
On FreeBSD: Installation instructions for build environment must be updated too. https://github.com/zonemaster/zonemaster/tree/develop/docs/internal/distrib-testing |
Contributor
If other documents are updated too it should be fine. |
Contributor
Author
|
Yes, I’m preparing a PR for the installation instructions in zonemaster/zonemaster because we need one more package to be installed. I’ll set the milestone to 2024.2 then. |
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster
that referenced
this pull request
Nov 12, 2024
A pull request on zonemaster-ldns [1] now requires ExtUtils::PkgConfig. Update the documentation to that effect. [1]: zonemaster/zonemaster-ldns#210
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster
that referenced
this pull request
Nov 12, 2024
A pull request on zonemaster-ldns [1] now requires ExtUtils::PkgConfig. Update the documentation to that effect. [1]: zonemaster/zonemaster-ldns#210
51fce8a to
b27f14e
Compare
On platforms or systems where libraries might be installed somewhere else than the usual /usr/local/lib or /usr/lib, running perl Makefile.PL might fail to detect the location of the libraries. Fortunately, pkg-config can help us determine which appropriate CFLAGS and LDFLAGS to append to the compiler and linker command lines respectively, and ExtUtils::PkgConfig provides a simple wrapper around that command line utility. This unfortunately requires one more dependency, but that library is widely packaged across Linux distributions and FreeBSD. It’s packaged as follows: * on Alpine Linux: perl-extutils-pkgconfig; * on Debian-based OSes: libextutils-pkgconfig-perl; * on FreeBSD: p5-ExtUtils-PkgConfig; * on Red Hat-based OSes: perl-ExtUtils-PkgConfig.
Install ExtUtils::PkgConfig in the build container.
As a drive-by change, update the NSEC test in rr.t because the .se has started using ZONEMD.
b27f14e to
c7b7407
Compare
mattias-p
approved these changes
Nov 14, 2024
mattias-p
left a comment
Member
There was a problem hiding this comment.
I tested this on Arch Linux and it seems to work.
matsduf
approved these changes
Nov 15, 2024
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster-engine
that referenced
this pull request
Nov 21, 2024
Pull request zonemaster/zonemaster-ldns#210 added an additional build-time dependency on ExtUtils::PkgConfig that wasn’t mirrored in the CI configuration for Zonemaster::Engine, therefore breaking CI. Adding the missing dependency should restore CI to normal working state.
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster-engine
that referenced
this pull request
Nov 21, 2024
Pull request zonemaster/zonemaster-ldns#210 added an additional build-time dependency on ExtUtils::PkgConfig that wasn’t mirrored in the CI configuration for Zonemaster::Engine, therefore breaking CI. Adding the missing dependency should restore CI to normal working state.
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster-engine
that referenced
this pull request
Nov 21, 2024
Pull request zonemaster/zonemaster-ldns#210 added an additional build-time dependency on ExtUtils::PkgConfig that wasn’t mirrored in the CI configuration for Zonemaster::Engine, therefore breaking CI. Adding the missing dependency should restore CI to normal working state.
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster-engine
that referenced
this pull request
Nov 21, 2024
Pull request zonemaster/zonemaster-ldns#210 added an additional build-time dependency on ExtUtils::PkgConfig that wasn’t mirrored in the CI configuration for Zonemaster::Engine, therefore breaking CI. Adding the missing dependency should restore CI to normal working state.
marc-vanderwal
added a commit
to marc-vanderwal/zonemaster-ldns
that referenced
this pull request
Nov 21, 2024
Pull request zonemaster#210 forgot to document the change in README.md. Let’s fix that before quickly before the next release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR aims to make detection of CFLAGS and LDFLAGS more reliable and portable across *nix systems by calling out to
pkg-config. By doing so, libraries that have been installed by hand (in/usr/localor a private prefix such as$HOME/.local) or through alternative package managers are more likely to be successfully detected.Context
See #129.
Changes
How to test this PR
Run
perl Makefile.PL; it should still work.Building the Dockerfile should also still work.