Weirdly enough, the --enable-static trick did not work out for me, but for completeness (and off-site backup :) ), here is what I need to do to build expat and XML::Parser on Solaris x86 with the SUN C compiler:

First build expat:

PATH=/usr/ccs/bin:$PATH # to add the correct "ar" # autotools does not seem to know when the configuration was changed, +this is just a safety measure gmake clean CC=/opt/SUNWspro/bin/cc CFLAGS="-KPIC -O -D_LARGEFILE_SOURCE -D_FILE_O +FFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -xarch=generic64" ./configure - +-prefix=/home/corion/lib --enable-shared gmake all # this one might not compile the C++ checks, if you don't have the SUN + C++ compiler installed gmake check gmake install

After installation, remember to update LD_LIBRARY_PATH in an appropriate location:

# Update LD_LIBRARY_PATH export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/corion/lib

Then, the installation of XML::Parser works, although the SUN C compiler did not like having the library directories listed after the -lexpat command. So I had to fudge that by patching the Makefile.PL:

unless ( check_lib( # fill in what you prompted the user for here #lib => [qw(expat)], header => ['expat.h'], debug => 1, incpath => $expat_incpath, # Ugly hack here ($expat_libpath? (libpath => "$expat_libpath -lexpat"):()), )) {

Then, configuring and testing Just Works:

perl Makefile.PL EXPATLIBPATH=/home/corion/lib/lib EXPATINCPATH=/home/ +corion/lib/include -lexpat gmake gmake test gmake install

In reply to Re^2: Installing XML::Parser (with expat) by Corion
in thread Installing XML::Parser (with expat) by dorko

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.