Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] dynamic pmc libraries

5 views
Skip to first unread message

Steve Fink

unread,
Sep 6, 2004, 11:40:02 PM9/6/04
to perl6-i...@perl.org
Mattia Barbon recently implemented the capability to group multiple
dynamic PMCs into a single library. It took me a while, but the correct
way of using it finally percolated through my thick skull. One remaining
problem is that the build process is very platform-dependent. This
patch doesn't fix that, but it does eliminate the gmake dependency.
Another problem is that you have to specifically write Makefile rules to
build your group of dynamic PMCs into a library, and that is very
difficult to do portably.

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.

dyngroup.patch

Leopold Toetsch

unread,
Sep 7, 2004, 3:17:06 AM9/7/04
to Steve Fink, perl6-i...@perl.org
Steve Fink <st...@fink.com> wrote:

> 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

Steve Fink

unread,
Sep 8, 2004, 1:29:44 AM9/8/04
to perl6-i...@perl.org

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.)

Brent 'Dax' Royal-Gordon

unread,
Sep 10, 2004, 2:05:18 AM9/10/04
to Steve Fink, perl6-i...@perl.org
Steve Fink <st...@fink.com> wrote:
> 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

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.]

Steve Fink

unread,
Sep 13, 2004, 3:20:09 AM9/13/04
to br...@brentdax.com, perl6-i...@perl.org
On Sep-09, Brent 'Dax' Royal-Gordon wrote:
>
> Tiny nit: for consistency with other Configure source files, this
> should probably be named dynclasses_pl.in. No big deal, though.

Consistency is good, and you're the authority. Change committed.

0 new messages