Hello Again (vis-a-vis my recently-posted "self-intro").
I wrote that i had been "hacking on MakeMaker". To quell or alternately
to amplify whatever consternation that statement might have engendered,
I will now briefly outline what sort of thing i have been trying to do.
Without having properly asked for comments (RFC'ing) i've named a
module-set. The name is to be "ExtUtils::ExoBuild". Exo == 'external,
outside', as in 'exoskeleton' [familiar to those readers who are {a}
into mecha (a type of manga/anime) {b} study arthropods (one of the
dominant and arguably most successful 'templates' for animal life on our
planet) or {c} ARE arthropods]. 'ExoBuild' means 'build a perl extension
[module] outside of the directory where the source distro is located.'
The work i've done so far represents the first time i've ever tried to
use Perl's Inheritance mechanism. It isn't the very first Perl-oo
authoring i've done but i am far from skillful with oo.
I brief, I believe I am very far in over my head.
What I need help with is the inheritance scheme for MakeMaker as a whole
(which i think is very complex and convoluted -- because the problem
domain is large, not because the work Schwern et al have done is badly
done) and with other issues.
To begin with, i'd like to achieve a way in which i might be able to
inherit methods from the MM_Unix and subordinate pals while able (of
course) to override certain methods with ones located in my own
module(s -- there are two of them). I also need to override methods in
MakeMaker.pm with my own. I began by trying to separate these two things
-- figuring that inheritance in perl depends on @ISA and multiple
additions to @ISA create multiple inheritance scenarios which become
bug-prone and harder to diagnose.
The first lines of ExtUtils/ExoBuild.pm contain the following:
-----------------------8<------------------------------------------
package ExtUtils::ExoBuild;
use 5.006;
use strict;
use warnings;
use Carp;
require Exporter;
use vars qw( @ISA $VERSION $Verbose);
use ExtUtils::ExoBuild::ExoTools qw(
&check_hints &mv_all_methods &parse_args &neatvalue );
require ExtUtils::MM; #dangerous -- may go away someday.
use ExtUtils::MakeMaker; #this is dubious, only testing will tell.
use ExtUtils::MM_Any; #generic platform-agnostic utilities, we'll need a
few.
$Verbose = 2; #debugging
@ISA = qw(ExtUtils::ExoBuild::ExoTools ExtUtils::MM);
-----------------------8<------------------------------------------
I recognize that i may not want to be exporting anything and that may
disappear. I started with the generic module template output for me by
h2xs and am modifying that as i learn along the way.
Q: Is it accurate to state that MakeMaker is in fact a mix of OO and
non-OO perl code? To start with, data passed when we do 'perl
Makefile.PL' is a hash that gets subjected to non-OO subroutines like
_validate_att(). Am I correct in this perception, that a lot of what
might be called pre-processing and setup takes place before what is to
become the build configuration, is blessed into any kind of object?
To back up a little, my intention is to create modules to do exobuilds
because i have assumed that direct patches to add such radically new
functionality to the existing MakeMaker family of modules would not be
welcomed. I could be wrong.
It's not at all clear to me and possibly not to the readers that what i
want to do CAN be done simply be adding new modules to MakeMaker. But I
am not likely to totally give up now because i already have many hours
invested in this and to a limited, buggy extent have had it working.
My second, "accessory" module is "ExtUtils::ExoBuild::ExoTools" and it
exists to try to replace some methods in the MM_Any and MM_.* modules. i
have, for example, a replacement pm_to_blib() sub in that module, but my
test runs show that it isn't being invoked in overrid-ship of the one in
the existing MM_.*. The first lines of that module follow:
-----------------------8<------------------------------------------
package ExtUtils::ExoBuild::ExoTools;
require Exporter;
require ExtUtils::MM_Any;
require ExtUtils::MM_Unix;
use File::Spec;
our @ISA = qw(ExtUtils::MM_Any ExtUtils::MM_Unix Exporter);
use vars qw($VERSION $unbusy_Makefile $Verbose @EXPORT_OK);
@EXPORT_OK = qw{ &check_hints &mv_all_methods &parse_args &neatvalue };
$Verbose = $ExtUtils::ExoBuild::Verbose;
-----------------------8<------------------------------------------
I could go on and on, but I can't ;-). Maybe that's for the best. Let
this serve as a introduction to what i am interested in and maybe
further explanation and exposition can be added later.
Thanks for reading,
Soren A
--
The makefiles which eventually result from using 'automake' 1.5x are
monstrosities. Sheer hellish madness. Several dozen targets, named
obscene things like "am_remake_your_mother"; utterly counter-intuitive,
buried in 4 or 5 levels of indirection, swamped in a thousand lines of
baffling, migraine-inducing auto-generated superfluity. [These] Makefiles
ought to be taken out and bled to death slowly, shot, burned, staked
through the heart, generally Buffy-ated to the maximum possible extent.
-- Soren Andersen (me) in
<http://groups.google.com/groups?selm=Xns91D2A2408EF9Dsorenngrp89%4064.8.1.226>
--
http://fastmail.fm - One of many happy users:
http://www.fastmail.fm/docs/quotes.html