The conundrum I'm in is that I need libperl.so to build mod_perl and libperl.a to build a static version of DBD::Sybase

Your best bet is probably to run the build twice, once with -Duseshrplib and once without.  And then install whichever variant of perl you want (static/dynamic), manually copying the missing libperl from the other build next to the already installed one. For example, if you install the statically linked perl binary, libperl.a will get installed together with it, so just copy the libperl.so from the other build next to it (in the same directory).

But note that if you have both a static and a dymanic library in the same location, the linker (ld) will by default link against the dynamic one (so if you don't want this to happen, the easiest approach is typically to just move it away temporarily while building whatever needs the static lib...).

That said, it might be wiser to simply install both versions into separate directories, because then the configuration information (i.e. essentially what you get via "perl -V") will automatically be correct without manual tweaking.

BTW, what exactly do you mean by "build a static version of DBD::Sybase"?  Are you building an extra perl binary that already includes the XS part of the DBD::Sybase module statically (as opposed to loading the extension at runtime via DynaLoader)? Otherwise, I wouldn't know why you would need a libperl.a for that.  If it's only because you don't want to have dependencies on shared sybase libs, you should (in theory) be able to link the sybase code/libs statically into a shared XS lib (i.e. Sybase.so) and still have that library loaded at runtime from either a statically or a dynamically linked perl binary (in which case that XS lib would no longer depend on the third party sybase libs — at runtime, that is, at build-time you of course need them).


In reply to Re: Building Perl with static and dynamic perllib libs by Eliya
in thread Building Perl with static and dynamic perllib libs by bergbrains

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.