Hi,

this is my first post ;-)

I'm a reader for nearly 20 years now, perhaps i can help today ;-)

Anyhow, the problem originates from the fact, that BigSur provides a native

XML Library and therefore the cc compiler will always favor the local libxml which differs from the version homebrew is providing.

homebrew version: '20904'

Big sur version: '20910'

How you can get it working: (Assuming you have perl-5.3.32 homebrew package installed)

1.) install the gcc homebrew package !

2.) Extract the source

3.) perl Makefile.PL

4.) Edit the Makefile

Change these lines:

Change the CC binary

 CC = gcc

Change the LD binary

 LD = gcc

Change the LDDFLAGS to:

LDDLFLAGS = -L/usr/local/opt/libxml2/lib -L/usr/local/lib/perl5/5.32.0 +/darwin-thread-multi-2level/CORE -mmacosx-version-min=10.15 -bundle - +fstack-protector- strong -lxml2 -lperl

Change the LDFLAGS to

LDFLAGS = -L/usr/local/opt/libxml2/lib -L/usr/local/lib/perl5/5.32.0/darwin-thread-multi-2level/CORE -mmacosx-version-min=10.15 -fstack-protector-strong -lxml2 -lperl

Change the INC Path to

INC = -I/usr/local/opt/libxml2/include

Change the PASSTHROUGH INC

PASTHRU_INC='-I/usr/local/opt/libxml2/include $(PASTHRU_INC)'

Then build:

make

Check using otool:

$otool -L blib/arch/auto/XML/LibXML/LibXML.bundle blib/arch/auto/XML/LibXML/LibXML.bundle: /usr/local/opt/libxml2/lib/libxml2.2.dylib (compatibility version +12.0.0, current version 12.10.0) /usr/local/opt/perl/lib/perl5/5.32.0/darwin-thread-multi-2level/CO +RE/libperl.dylib (compatibility version 5.32.0, current version 5.32. +0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current v +ersion 1292.60.1) /usr/local/lib/gcc/10/libgcc_s.1.dylib (compatibility version 1.0. +0, current version 1.0.0)
make test

(3 tests will fail because the tests favor the native libs, so don't mind

 make install

Best regards

Franz


In reply to Re^2: XML::LibXML fails install on macOS Big Sur by Skalef
in thread XML::LibXML fails install on macOS Big Sur by redsox43

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.