# New Ticket Created by Nick Glencross # Please include the string: [perl #38156] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38156 >
Thanks to everyone, particularly rafl, for getting shared libraries in. I hope that it hasn't been too painful, and that we get support for most platforms. Here's a patch which provides initial support for Darwin. I've only just got a Mac, so am learning as I go along (e.g. http://fink.sourceforge.net/doc/porting/porting.en.html) I've basically added a way to suppress the -rpath flag when building shared libraries, and done a -install_name to do the rpath functionality (but on the library, not the executable that links with it; hence the inconsistency that I'm going to mention now). For simplicity, I've gone and broken my own naming convention for config variables. In the next day or so I'll probably submit a patch to change some of the names, e.g. libparrot_soname -> ld_libparrot_share_flags rpath_blib -> link_libparrot_share_executable [or /something/ like that] Hence they describe where they are used, not what they contain. Cheers, Nick
Index: config/inter/libparrot.pm =================================================================== --- config/inter/libparrot.pm (revision 10892) +++ config/inter/libparrot.pm (working copy) @@ -51,7 +51,7 @@ ); $conf->data->set( - rpath_blib => ($libparrot_is_shared) + rpath_blib => ($libparrot_is_shared) && $conf->data->get('rpath') ? $conf->data->get('rpath') . $conf->data->get('build_dir') . Index: config/init/hints/darwin.pm =================================================================== --- config/init/hints/darwin.pm (revision 10892) +++ config/init/hints/darwin.pm (working copy) @@ -34,10 +34,21 @@ load_ext => '.bundle', link => 'c++', ld => 'c++', - ld_share_flags => '-dynamiclib', + ld_share_flags => '-dynamiclib -undefined suppress', ld_load_flags => '-bundle -undefined suppress', memalign => 'some_memalign', - libparrot_is_shared => 0, + libparrot_is_shared => 1, + rpath => '', + + # This variable needs renaming to be more general + libparrot_soname => "-install_name " . + $conf->data->get('build_dir') . + $conf->data->get('slash') . + $conf->data->get('blib_dir') . + $conf->data->get('slash') . + "libparrot" . + $conf->data->get('share_ext') + ); }