Makefile.PL: set include paths correctly#213
Conversation
|
@marc-vanderwal, this is a draft. Is it ready for review? |
|
Not yet, I’d like to know if it works on someone else’s machine, for example @ondohotola’s setup. |
|
I have built and installed on FreeBSD without any issues. |
|
It builds on the Intel (15.1.1) without any issues. On the Silicon (15.1.1) with Homebrew (including The following works: showing: |
|
@ondohotola Thanks for the feedback! And it’s a good thing that passing I’ve found a small mistake in my new code and pushed a fix. Does that work on ARM-based Macs too? |
|
No, does not work on ARM: |
|
I just found out that also works. Still not ideal, but one doesn't have to go into the build directory. |
|
I agree that it isn’t ideal. Actually, I think I’ve found the problem: I forgot to update a data structure later passed on to functions in Devel::CheckLib with the information obtained from |
|
Same error on AMR, works on Intel |
|
I now have access to an ARM-based Mac, but haven’t had the time to continue investigating this problem. I’ll push the fix to the next release. |
It turns out that the cc_include_flags function, from Module::Install::XSUtil, doesn’t like being given raw command-line arguments (e.g. a string like "-I/path/to/thing -I/some/thing/else"). We have to give it a list of strings without the prefixing "-I" (e.g. "/path/to/thing", "/some/thing/else"). This commit takes care of that.
The cc_libs function in Module::Install::XSUtil expects a list of strings, while we were passing it a single string containing whitespace-delimited items. Split it, so that it hopefully works as intended.
When pkg-config is used to discover the appropriate header and library locations, the new code forgot to update a hash that is passed to the cc_assert_lib function later on. This means that on systems with non-traditional locations for openssl or ldns libraries, the cc_assert_lib didn’t check the locations previously discovered by pkg-config. This commit should ensure that cc_assert_lib finds those libraries when testing for their presence.
85f37cb to
c953cdb
Compare
The previous commits were close, but no cigar. This time, we should be able to find openssl’s libraries if they are installed in a custom location (e.g. via brew on macOS).
LDNS needs OpenSSL to work, so when we use cc_assert_lib for ldns, we should import the incpath and libpath options for openssl and ldns together, otherwise it might not work.
a350d24 to
0ea1464
Compare
|
I was able to make some progress getting Zonemaster-LDNS to compile on macOS/arm64 with these changes. But for some reason, perl segfaults whenever I try to use anything that requires the LDNS library. In their infinite wisdom, Apple have decided that I cannot attach a debugger to the |
|
Oh well; even though we don’t officially support macOS as a platform, at least this change can benefit unusual configurations where libraries like LDNS and OpenSSL are installed in unusual places. |
|
If it doesn't work, enter the the build directory and turn Claude Code lose |
Purpose
This PR addresses an oversight in #210 that causes Makefile.PL to fail when a library needs include paths (
-I) specified on the compiler command line.Context
See:
Changes
Filter the output of
pkg-configto turn it into a list of raw paths, for consumption bycc_include_pathsfrom Module::Install::XSUtil.How to test this PR
Run Makefile.PL, ideally while having OpenSSL or LDNS installed in a custom location such as the user’s home directory.