On Thu Aug 14 13:13:08 2008, DCOPPIT wrote:
Show quoted text> I'm trying to build Math::GSL on Mac OS X. It fails when trying to
> link
> the first binary.
I struck the same problem on Win32 because the perl import library
($Config{libperl} is not linked in. On linux it doesn't matter, as
linux is prepared to wait for symbol resolution until runtime (when the
symbols are resolved by the perl shared object). But on Windows, and
perhaps Apple also, all symbols need to be resolved at compile time.
The fix (mentioned in
http://rt.cpan.org/Public/Bug/Display.html?
id=38131) was to insert the following line of code into Build.PL's
link_c() sub:
push @linker_flags, $Config{archlib} . '/CORE/' . $Config{libperl} if
$^O =~ /MSWin32/i;
Perhaps, if there are other operating systems that also need to link to
$Config{libperl}, the if{} condition in that amendment should be
dropped. Although nix type operating systems don't need it, they
shouldn't suffer from the inclusion of that linkage.
Anyway, if the OP wants to check, just grab Math::GSL-0.08, find sub
link_c in Build.PL and delete the 'if' condition from the end of that
line of code. (The 'if' condition has been slightly rewritten as 'if
is_windows()'.)
Note: I'm assuming that "$Config{archlib} . '/CORE/' . $Config
{libperl}" will find and link to your perl import library(... untested).
Also, while you're trying to get things to work, I suggest you remove
the line "$self->add_to_cleanup($c_file);" in Build.PL's process_swig
sub. Otherwise, whenever you run './Build clean' you might have to
reinstall the source, and re-edit any files you've amended.
Cheers,
Rob