Re: Question about ExtUtils::Depends



Brett Kosinski said:
Is there a reason why, when building the directory location for the
typemaps, headers, etc, it strips leading package qualifiers off?  For
example:

  XML::LibXML

has typemaps, etc, placed in:

  $(INST_ARCHLIBDIR)/LibXML

rather than

  $(INST_ARCHLIBDIR)/XML/LibXML

hrm.

looking at generated Makefiles...  INST_ARCHLIB is typically blib/lib, and
INST_ARCHLIBDIR appears to be $(INST_ARCHLIB)/something... for Gnome2::Canvas,
that's $(INST_ARCHLIB)/Gnome2.  a few lines below that, INST_ARCHAUTODIR is
set to $(INST_ARCHLIB)/auto/$(FULLEXT).

i'm not sure why one uses a real literal name and the other uses $(FULLEXT),
because, especially in this situation, $(FULLEXT) will be the package name as
a relative path, e.g. Gnome2/Canvas.

in light of that, i also don't understand why Depends does this:

        $name = $mdir = $mdir2 = $self->{_name_};
        $mdir =~ s/.*:://;
        $pm->{$filename} = '$(INST_ARCHLIBDIR)/'."$mdir/Install/Files.pm";

instead of this:

        $pm->{$filename} = '$(INST_ARCHLIB)/$(FULLEXT)/Install/Files.pm";


Depends also has some problems with include strings getting waaaay out of
hand, and the Install directories of previous modules aren't included for you
(why should i have to add Gtk2 *and* Glib to my depends if Gtk2 depends on
Glib?), but up to this point i've been following the principle of It Ain't
Broke, So I Ain't Fixin' It.



This is a problem, because if a program depends on this one, then when it
does an

  ExtUtils::Depends->new('blah', 'XML::LibXML')

it tries to load headers, etc, from $(INST_ARCHLIBDIR)/XML/LibXML, rather
than $(INST_ARCHLIBDIR)/LibXML.  Now, this likely can be fixed (although I
haven't done it yet) by doing an

  ExtUtils::Depends->new('blah', 'LibXML')

but it seems strange to me to have to strip off the leading package qualifiers.


i don't doubt that something like this is possible, but i can't recreate it.

this little script

 use ExtUtils::Depends;
 my $whee = ExtUtils::Depends->new ('whee', 'Gnome2::Canvas', 'Gtk2', 'Glib');
 use Data::Dumper;
 print Dumper({$whee->get_makefile_vars});

prints this monstrous output...

-=-=-=-=-=-=-=-
$VAR1 = {
          'INC' => '
-I/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gnome2/Canvas/Install/
 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/libart-2.0
-I/usr/include/pango-1.0 -I/usr/include/freetype2
-I/usr/include/gtk-2.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/Xft2 -I/usr/X11R6/include  
-I/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gtk2/Install/
 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/Xft2
-I/usr/include/freetype2 -I/usr/X11R6/include
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I./build 
-I/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Glib/Install/
 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include  -D_REENTRANT
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -I.  ',
          'LIBS' => [
                      ' -lgnomecanvas-2 -lart_lgpl_2 -lpangoft2-1.0
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0
-lm -lpangoxft-1.0 -lpangox-1.0 -lpango-1.0
-lgmodule-2.0 -ldl -lgobject-2.0 -lgthread-2.0 -lpthread
-lglib-2.0'
                    ],
          'DEFINE' => '',
          'OBJECT' => '',
          'clean' => {
                       'FILES' => ''
                     },
          'PM' => undef,
          'TYPEMAPS' => [
                          
'/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gnome2/Canvas/Install//canvas.typemap',
                          
'/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gnome2/Canvas/Install//gnomecanvasperl.typemap',
                          
'/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gtk2/Install//gtk2perl.typemap',
                          
'/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gtk2/Install//gdk.typemap',
                          
'/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Gtk2/Install//gtk.typemap',
                          
'/home/muppet/local/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Glib/Install//typemap'
                        ],
          'XS' => {}
        };
-=-=-=-=-=-=-=-

but if i use 'Canvas' instead of 'Gnome2::Canvas', it dies with an error,
saying it can't locate Canvas/Install/Files.pm anywhere in my @INC.


-- 
muppet <scott at asofyet dot org>






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