in reply to Re^4: Warning (mostly harmless): No library found for -lxml2
in thread Warning (mostly harmless): No library found for -lxml2

And after that, we come to the real problem, which manifests during make test (and which you can see is again to do with the linker):
$ make test "/usr/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- SimpleServ +er.bs blib/arch/auto/Net/Z3950/SimpleServer/SimpleServer.bs 644 PERL_DL_NONLAZY=1 "/usr/bin/perl" "-Iblib/lib" "-Iblib/arch" test.pl 1..4 Can't load 'blib/arch/auto/Net/Z3950/SimpleServer/SimpleServer.bundle' + for module Net::Z3950::SimpleServer: dlopen(blib/arch/auto/Net/Z3950 +/SimpleServer/SimpleServer.bundle, 0x0002): tried: 'blib/arch/auto/Ne +t/Z3950/SimpleServer/SimpleServer.bundle' (relative path not allowed +in hardened program) at /System/Library/Perl/5.30/darwin-thread-multi +-2level/DynaLoader.pm line 197. � at test.pl line 11. Compilation failed in require at test.pl line 11. BEGIN failed--compilation aborted at test.pl line 11. not ok 1 make: *** [test_dynamic] Error 2
That "relative path not allowed" actually prevents the tests from running, and my real question is, why is this a hardened program at all? My favoured solution would be to not have the program hardened while I'm working on it!

Anyway: I can force this to work my modifying the Makefile.PL to use an absolute path for the ARCHLIB:

sub MY::postamble { 'INST_ARCHLIB = `pwd`/blib/arch' }
which makes the -I argument absolute. Then the tests run OK (which proves that the "mostly harmless" warnings really were mostly harmless: the necessary libraries were loaded OK for the tests.)

But that "solution" is no good, not only because it's horribly inelegant and knows too much about what ExtUtils::MakeMaker is doing, but more significantly because it prevents make install from working.

Replies are listed 'Best First'.
Re^6: Warning (mostly harmless): No library found for -lxml2
by etj (Priest) on Aug 01, 2024 at 15:01 UTC
    This general situation (getting a Perl distro to successfully link and run with -lxml2) is addressed by Alien::Libxml2, as used by XML::LibXML, which has plenty of passes on MacOS. In your situation I would move my distro over to using that scheme of things and copy exactly what XML::LibXML does.