This patch introduces something that feels suspiciously like libtool,
despite the fact that libtool has never been very kind to me. But for
now I am targeting this only at the dynamic PMC generation problem; this
solution could be expanded to ease porting of other parts of the build
procedure, but I think other people are already working on that.
The patch adds an additional target to config/gen/makefiles.pl: instead
of just converting config/gen/makefiles/dynclasses.in to
dynclasses/Makefile, it also converts
config/gen/makefiles/dynclasses.pl.in to dynclasses/build.pl, and
changes that Makefile to call build.pl to do all the real work. It is
thus able to pick up config/init/data.pl's notions of all of the ${cc},
${ld}, etc. definitions, but leaves the description of which PMCs to
build with the original Makefile (which probably isn't the greatest
place, but I'm trying to change as little as possible.)
My guess is that this will not immediately cause dynamic PMCs to start
working on the platforms where they do not currently work, but it should
make it easier to get them to work. It also implements a new pmclass
attribute in .pmc files (only meaningful for dynamic PMCs): C<group
GROUPNAME>, which will get automatically picked up by the new
dynclasses/build.pl to generate a single shared library out of all PMCs
with the same group tag. So to implement two new dynamic PMCs
'mylangPmc1' and 'mylangPmc2', you would:
* Implement the .pmc files, and include 'group mylang' in their pmclass lines
* Add mylangPmc1 and mylangPmc2 to config/gen/makefiles/dynclasses.in
* Re-run Configure.pl
That is the same procedure as is currently used to implement independent
dynamic PMCs right now, except for the addition of the 'group mylang'
tag.
I am not committing this patch directly because I know that other people
are currently actively working on the dynamic PMC stuff and the build
system, and I didn't want to step on anyone's toes. Note that build.pl
is NOT a general build tool, although it covers everything needed for
the dynclasses/ directory. At the moment, it doesn't even bother to do
dependency analysis for the grouped PMCs, although it does for all of
the rest. Still, this patch gets stuff working that currently doesn't
exist, and doesn't break anything that currently works AFAIK. I fully
expect (and hope) that it will be replaced by something more general
someday. But I'd rather not wait for that day, having first-hand
experience with how much "fun" it is to get partial linking of dynamic
libraries working on multiple platforms.
> This patch introduces something that feels suspiciously like libtool,
> despite the fact that libtool has never been very kind to me. But for
> now I am targeting this only at the dynamic PMC generation problem; this
> solution could be expanded to ease porting of other parts of the build
> procedure, but I think other people are already working on that.
Looks good.
> I am not committing this patch directly because I know that other people
> are currently actively working on the dynamic PMC stuff and the build
> system, and I didn't want to step on anyone's toes.
So please give it a try.
Thanks,
leo
Ok, it's in. See dynclasses/README for brief usage instructions. I'll
probably be committing a couple of dynamic PMCs soon (when I can figure
out why they're complaining about not having a destroy() defined, when
they don't have the active_destroy flag set.)
Tiny nit: for consistency with other Configure source files, this
should probably be named dynclasses_pl.in. No big deal, though.
--
Brent 'Dax' Royal-Gordon <br...@brentdax.com>
Perl and Parrot hacker
There is no cabal.
[I currently have a couple Gmail invites--contact me if you're interested.]
Consistency is good, and you're the authority. Change committed.