Index: ExtUtils-Depends/lib/ExtUtils/Depends.pm =================================================================== RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/ExtUtils-Depends/lib/ExtUtils/Depends.pm,v retrieving revision 1.11 diff -u -r1.11 Depends.pm --- ExtUtils-Depends/lib/ExtUtils/Depends.pm 12 Mar 2004 21:02:22 -0000 1.11 +++ ExtUtils-Depends/lib/ExtUtils/Depends.pm 22 Jun 2004 03:19:19 -0000 @@ -282,8 +282,10 @@ my %vars = ( INC => join (' ', uniquify @incbits), LIBS => join (' ', uniquify @libsbits), + #LIBS => join (' ', uniquify $self->find_extra_libs, @libsbits), TYPEMAPS => [ typemaps], ); + push @OBJECT, $self->find_extra_libs; # we don't want to provide these if there is no data in them; # that way, the caller can still get default behavior out of # MakeMaker when INC, LIBS and TYPEMAPS are all that are required. @@ -299,6 +301,37 @@ %vars; } +# $Config{so} = 'so' on linux and 'dll' on win32 +# $Config{lib_ext} = 'a' on both. +sub find_extra_libs { + my $self = shift; + use File::Find; + use Config; + my @ret; + my $ext = $Config{so}; + # XXX what about linkage order? these should be in the most-dependent + # first order, for old-style linkers... but when we get the dep names + # from the hash, we have no idea about order. + foreach my $name (keys %{ $self->{deps} }) { + my $dep = $self->{deps}{$name}; + (my $dllname = $name) =~ s/^.*:://; + my $match = qr/$dllname\.$ext$/; + my $l; + find (sub { + $l = $File::Find::name + if (not $l) && /$match/; + }, @INC); + if ($l && -f $l) { + warn "found $l\n"; + push @ret, $l; + next; + } + warn "can't find extra lib for $name\n"; + } + #print Dumper(\ ret); + return @ret; +} + 1; __END__ Index: Glib/Glib.pm =================================================================== RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/Glib.pm,v retrieving revision 1.66 diff -u -r1.66 Glib.pm --- Glib/Glib.pm 1 Jun 2004 15:40:30 -0000 1.66 +++ Glib/Glib.pm 22 Jun 2004 03:19:23 -0000 @@ -63,7 +63,7 @@ our $VERSION = '1.050'; -sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } +#sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } bootstrap Glib $VERSION; Index: GnomeCanvas/Canvas.pm =================================================================== RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/GnomeCanvas/Canvas.pm,v retrieving revision 1.20 diff -u -r1.20 Canvas.pm --- GnomeCanvas/Canvas.pm 6 Jun 2004 15:53:13 -0000 1.20 +++ GnomeCanvas/Canvas.pm 22 Jun 2004 03:19:24 -0000 @@ -21,7 +21,7 @@ $class->VERSION (@_); } -sub dl_load_flags { 0x01 } +#sub dl_load_flags { 0x01 } bootstrap Gnome2::Canvas $VERSION; Index: Gtk2/Gtk2.pm =================================================================== RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Gtk2/Gtk2.pm,v retrieving revision 1.64 diff -u -r1.64 Gtk2.pm --- Gtk2/Gtk2.pm 10 Jun 2004 22:51:20 -0000 1.64 +++ Gtk2/Gtk2.pm 22 Jun 2004 03:19:24 -0000 @@ -70,7 +70,7 @@ # complains "Can't make loaded symbols global on this platform" when this # is set to 0x01, but goes on to work fine. returning 0 here avoids the # warning and doesn't appear to break anything. -sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } +###sub dl_load_flags { $^O eq 'darwin' ? 0x00 : 0x01 } # now load the XS code. Gtk2->bootstrap ($VERSION);