[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Fun with ExtUtils::MakeMaker and Windows import libraries



Torsten Schoenfeld kirjoitti:
Elegance shouldn't be the primary concern.  If you have a patch that makes
linking work on MinGW, just post it.

Somehow this detection should be propagated to EU::LibList::Kid to look for
import libraries "lib<library>.dll.a" -- or the Makefile.PL's may also alter
the liblist by adding ".dll.a" before calling set_libs().

I'd prefer a solution that doesn't involve changing every Makefile.PL.

ok, almost there

1. Patch lib/ExtUtils/Liblist/Kid.pm with the attached patch (the patch needs to be offered to guys maintaining ExtUtils::MakeMaker I guess)

2. When building Glib and Cairo, there are the extra steps before make install:

using spicy jack's method:

dlltool --input-def Glib.def --dllname Glib.dll --output-lib Glib.dll.a
copy Glib.dll.a blib/arch/auto/Glib

and

dlltool --input-def Cairo.def --dllname Cairo.dll --output-lib Cairo.dll.a
copy Cairo.dll.a blib/arch/auto/Cairo

Brian, you wrote that you have been able to abstract the above and add it to the Makefile.PL. How exactly? However, I think this should/could be corrected somewhere in lib/ExtUtils/ and not change the Makefile.PL

3. Now the patch for ExtUtils/Depends.pm - that's attached

4. Gtk2 installs without problems - at least in my test just now with everything freshly built.

These same steps

dlltool --input-def Gtk2.def --dllname Gtk2.dll --output-lib Gtk2.dll.a
copy Gtk2.dll.a blib/arch/auto/Gtk2

need to be run for Gtk2::GladeXML

Ari


--
Prof. Ari Jolma
Environmental Management Information Technology
Teknillinen korkeakoulu / Helsinki University of Technology
tel: +358 9 451 3812 address: POBox 5300, 02015 TKK, Finland
Email: ari.jolma at tkk.fi http://geoinformatics.tkk.fi/twiki/bin/view/Main/AriJolmaHomePage

308,315c308,311
< 	# handle possible library arguments
< 	if (s/^-l// and $GC and !/^lib/i) {
< 	    $_ = "lib$_";
< 	}
< 	$_ .= $libext if !/\Q$libext\E$/i;
< 
< 	my $secondpass = 0;
<     LOOKAGAIN:
---
>     # try $_$libext, lib$_$libext, $_.dll$libext, lib$_.dll$libext
>     s/^-l//;
>     my $found_lib = 0;
>     for my $libname ($_.$libext, 'lib'.$_.$libext, $_.'.dll'.$libext, 'lib'.$_.'.dll'.$libext) {
318,319c314,315
< 	if (-f) {
< 	    warn "'$thislib' found as '$_'\n" if $verbose;
---
> 	if (-f $libname) {
> 	    warn "'$thislib' found as '$libname'\n" if $verbose;
321,322c317,319
< 	    push(@extralibs, $_);
< 	    next;
---
> 	    $found_lib++;
> 	    push(@extralibs, $libname);
> 	    last;
325d321
< 	my $found_lib = 0;
327c323
< 	    unless (-f ($fullname="$thispth\\$_")) {
---
> 	    unless (-f ($fullname="$thispth\\$libname")) {
338,347d333
< 
< 	# do another pass with (or without) leading 'lib' if they used -l
< 	if (!$found_lib and $thislib =~ /^-l/ and !$secondpass++) {
< 	    if ($GC) {
< 		goto LOOKAGAIN if s/^lib//i;
< 	    }
< 	    elsif (!/^lib/i) {
< 		$_ = "lib$_";
< 		goto LOOKAGAIN;
< 	    }
350c336
< 	# give up
---
> 	# express frustration
304,305c304,305
< 		MSWin32 => sub { $_[0] . '.lib' },
< 		cygwin  => sub { $_[0] . '.dll'},
---
> 		MSWin32 => sub { ($_[0] . '.lib', $_[0] . '.dll.a') },
> 		cygwin  => sub { ($_[0] . '.dll') },
313c313
< 		my $lib = $mapper->($stem);
---
> 		for my $lib ($mapper->($stem)) {
319c319,320
< 			if ((not $matching_file) && /$pattern/) {;
---
> 			if ((not $matching_file) && /$pattern/) 
> 			{;
327a329
> 		    }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]