[svn:parrot] r43345 - in branches/one_make: . config/gen config/gen/makefiles tools/build

coke at svn.parrot.org coke at svn.parrot.org
Thu Dec 31 19:03:50 UTC 2009


Author: coke
Date: Thu Dec 31 19:03:48 2009
New Revision: 43345
URL: https://trac.parrot.org/parrot/changeset/43345

Log:
make toosl/build/dynpmc.pl a static file instead of dynamically generating it.

The original version probably predates Parrot::Config.

While doing this, simplify the logic a bit. (" is always safe to use on
our core platforms. use $^X instead of config's perl, since we're invoked
with the right perl anyway.)

There is no doubt more simplifications to be had here, as we seem to be
calculating an awful lot.

Added:
   branches/one_make/tools/build/dynpmc.pl
Deleted:
   branches/one_make/config/gen/makefiles/dynpmc_pl.in
Modified:
   branches/one_make/MANIFEST
   branches/one_make/MANIFEST.SKIP
   branches/one_make/config/gen/makefiles.pm
   branches/one_make/tools/build/   (props changed)

Modified: branches/one_make/MANIFEST
==============================================================================
--- branches/one_make/MANIFEST	Thu Dec 31 15:21:15 2009	(r43344)
+++ branches/one_make/MANIFEST	Thu Dec 31 19:03:48 2009	(r43345)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Dec 30 04:30:22 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Dec 31 18:57:26 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -323,7 +323,6 @@
 config/gen/makefiles/dynoplibs.in                           []
 config/gen/makefiles/dynoplibs_pl.in                        []
 config/gen/makefiles/dynpmc.in                              []
-config/gen/makefiles/dynpmc_pl.in                           []
 config/gen/makefiles/editor.in                              []
 config/gen/makefiles/ext.in                                 []
 config/gen/makefiles/parrot_embed_pl.in                     []
@@ -2135,6 +2134,7 @@
 t/tools/testdata                                            [test]
 tools/build/addopstags.pl                                   []
 tools/build/c2str.pl                                        []
+tools/build/dynpmc.pl                                       []
 tools/build/fixup_gen_file.pl                               []
 tools/build/headerizer.pl                                   []
 tools/build/nativecall.pl                                   []

Modified: branches/one_make/MANIFEST.SKIP
==============================================================================
--- branches/one_make/MANIFEST.SKIP	Thu Dec 31 15:21:15 2009	(r43344)
+++ branches/one_make/MANIFEST.SKIP	Thu Dec 31 19:03:48 2009	(r43345)
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Dec 30 04:30:22 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Dec 31 18:57:26 2009 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -1046,8 +1046,6 @@
 # generated from svn:ignore of 'tools/build/'
 ^tools/build/dynoplibs\.pl$
 ^tools/build/dynoplibs\.pl/
-^tools/build/dynpmc\.pl$
-^tools/build/dynpmc\.pl/
 # Local variables:
 #   mode: text
 #   buffer-read-only: t

Modified: branches/one_make/config/gen/makefiles.pm
==============================================================================
--- branches/one_make/config/gen/makefiles.pm	Thu Dec 31 15:21:15 2009	(r43344)
+++ branches/one_make/config/gen/makefiles.pm	Thu Dec 31 19:03:48 2009	(r43345)
@@ -47,11 +47,6 @@
         'editor/Makefile'            =>
             { SOURCE => 'config/gen/makefiles/editor.in' },
 
-        'tools/build/dynpmc.pl' => {
-            SOURCE            => 'config/gen/makefiles/dynpmc_pl.in',
-            replace_slashes   => 0,
-            conditioned_lines => 1,
-        },
         'tools/build/dynoplibs.pl' => {
             SOURCE            => 'config/gen/makefiles/dynoplibs_pl.in',
             replace_slashes   => 0,

Deleted: branches/one_make/config/gen/makefiles/dynpmc_pl.in
==============================================================================
--- branches/one_make/config/gen/makefiles/dynpmc_pl.in	Thu Dec 31 19:03:48 2009	(r43344)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,298 +0,0 @@
-# Copyright (C) 2001-2009, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-tools/build/dynpmc.pl - Build script for dynamic PMCs
-
-=head1 DESCRIPTION
-
-This file is generated by F<config/gen/makefiles.pl> from
-F<config/gen/makefiles/dynpmc_pl.in>.  This script is used for building
-dynamic PMCs.
-
-=cut
-
-use strict;
-use warnings;
-use FindBin;
-use lib "$FindBin::Bin/../..";
-use lib "$FindBin::Bin/../../lib";
-
-use File::Copy qw(copy);
-use Storable;
-
-# Config stuff
-# q[] isn't guaranteed to work, but it's safer than "" as some platforms
-# (eg FreeBSD) have ""s embedded in their substitution values. q[] is used
-# as Win32 paths have \'s in, which qq treats as escape sequences.
-our $CC              = q[@cc@ -c];
-our $LD              = q[@ld@];
-our $LDFLAGS         = q[@ldflags@ @ld_debug@ @rpath_blib@];
-our $LD_LOAD_FLAGS   = q[@ld_load_flags@];
-our $PERL            = q[@perl@];
-our $LOAD_EXT        = q[@load_ext@];
-our $O               = q[@o@];
-our $CFLAGS          = q[@ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @cg_flag@ @gc_flag@];
-
-our $LIBPARROT = q[];
-#IF(parrot_is_shared):$LIBPARROT = q[@libparrot_ldflags@];
-
-# Here comes some stuff for Win32.
-our $PATHQUOTE = $^O eq 'MSWin32' ? q["] : q[];
-
-# PMC2C Config
-our $PMC2C = "$PERL $PATHQUOTE" . q[@build_dir@@slash at tools@slash at build@slash at pmc2c.pl] . $PATHQUOTE;
-
-# Actual commands
-sub compile_cmd {
-    my ($target, $source) = @_;
-
-    my $dynpmc_include = '';
-    if (defined $ENV{DYNPMC_INCLUDE} )
-    {
-        $dynpmc_include = $ENV{DYNPMC_INCLUDE};
-        $dynpmc_include =~ s/,/$PATHQUOTE -I$PATHQUOTE/g;
-        $dynpmc_include = "-I" . $PATHQUOTE . $dynpmc_include . $PATHQUOTE . " ";
-    }
-
-    return
-        "$CC " .
-        '@cc_o_out@' . $target . " " .
-        "-I" . $PATHQUOTE . '@build_dir@@slash at include' . $PATHQUOTE . " " .
-        "-I" . $PATHQUOTE . '@build_dir@@slash at src@slash at pmc' . $PATHQUOTE . " " .
-        $dynpmc_include . " " .
-        "$CFLAGS " .
-        $source;
-};
-
-sub partial_link_cmd {
-    my ($target, $libs, $sources) = @_;
-
-    my $liblist;
-    if ($^O =~ /mswin32/i) {
-        # Need to put various libraries in the link line.
-        if ($CC =~ /gcc/i) {
-            $liblist = join( ' ', map { "-l$_" } keys %$libs );
-            $liblist =~ s/-lgdbm/-llibgdbm/i;
-        }
-        else {
-            $liblist = join( ' ', map { "$_.lib" } keys %$libs );
-        }
-        my $extraLibs = '@libs@ @icu_shared@';
-        $extraLibs =~ s/blib/..\\blib/g;
-        $extraLibs =~ s/\Q$(A)\E/.lib/g;
-        $liblist .= ' ' . $extraLibs;
-
-        # Also note that we may need to look in the Parrot blib directory.
-        if ($CC =~ /gcc/i) {
-            $liblist .= qq{ -Wl,-L "@build_dir@/blib/lib"};
-        }
-        else {
-            $liblist .= qq{ /LIBPATH:"@build_dir@/blib/lib"};
-        }
-    }
-    else {
-        $liblist = join( ' ', map { "-l$_" } keys %$libs );
-        my $extraLibs = '@libs@ @icu_shared@';
-        $liblist .= ' ' . $extraLibs;
-    }
-
-    if (defined $ENV{DYNPMC_LINK}) {
-        push @{$sources}, split /,/, $ENV{DYNPMC_LINK};
-    }
-
-    return
-        "$LD ".
-        '@ld_out@' . $target . " " .
-        join(" ", map {"$PATHQUOTE$_$PATHQUOTE"} @$sources) .
-        " $liblist $LDFLAGS $LD_LOAD_FLAGS $LIBPARROT";
-}
-
-our $NOW = time();
-
-################### MAIN PROGRAM ################
-
-my ($mode, @pmcs) = @ARGV;
-
-if ($mode eq 'generate') {
-    # Convert X.pmc -> X.dump and X.c and also create any lib-GROUP.c files
-
-    generate_dump($_) foreach (@pmcs);
-    generate_c($_) foreach (@pmcs);
-
-    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
-        gather_groups_and_libs(@pmcs);
-
-    while (my ($group, $pmcs) = each %$group_files) {
-        my @pmcfiles = map { "$_.pmc" } @$pmcs;
-        if (needs_build("$group.c", @pmcfiles)) {
-            run("$PMC2C --library $group --c " . join(" ", at pmcfiles))
-              or die "pmc2c library creation failed ($?)\n";
-        }
-    }
-}
-elsif ($mode eq 'compile') {
-    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
-        gather_groups_and_libs(@pmcs);
-
-    # Convert X.c -> X.o for all X.c
-    compile($_) foreach (@pmcs);
-
-    # lib-GROUP.c
-    for my $group (keys %$group_files) {
-        compile("$group", "lib-$group")
-          or die "compile $group.c failed ($?)\n";
-    }
-}
-elsif ($mode eq 'linklibs') {
-    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
-        gather_groups_and_libs(@pmcs);
-
-    # Convert lib-GROUP.so + A.so + B.so ... -> GROUP.so
-    while (my ($group, $pmcs) = each %$group_files) {
-        partial_link($group, $group_libs->{$group}, [ "lib-$group", @$pmcs ] )
-          or die "partial link of $group failed ($?)\n";
-    }
-
-    # Link non-grouped PMCs individually
-    my @ungrouped_pmcs = grep { ! exists $pmc_group->{$_} } @pmcs;
-    partial_link($_, $pmc_libs->{$_}, [ $_ ] ) foreach (@ungrouped_pmcs);
-}
-elsif ($mode eq 'copy') {
-    # Copy *.so -> destination, where destination is the first
-    # argument, given as --destination=DIRECTORY
-    shift(@pmcs) =~ /--destination=(.*)/
-      or die "copy command requires destination";
-    my $dest = $1;
-
-    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
-        gather_groups_and_libs(@pmcs);
-    my @ungrouped_pmcs = grep { ! exists $pmc_group->{$_} } @pmcs;
-
-    my (@list_to_process) = (@ungrouped_pmcs, keys %$group_files);
-
-    die "nothing found to copy" unless @list_to_process;
-
-    foreach (@list_to_process) {
-        copy("$_$LOAD_EXT", $dest) or die "Copy $_$LOAD_EXT failed ($?)\n";
-
-        # Execute permissions on libraries is especially important on
-        # some platforms
-        if ($^O eq 'hpux' or $^O eq 'cygwin') {
-            chmod 0755, "$dest at slash@$_$LOAD_EXT";
-        }
-
-    }
-}
-else {
-    die "invalid command '$mode'\nmust be one of generate, compile, linklibs, or copy\n";
-}
-
-sub run {
-    print join(" ", @_), "\n";
-
-    return system(@_) == 0;
-}
-
-sub gather_groups_and_libs {
-    my @pmcs = @_;
-
-    my ( %group_files, %group_libs, %pmc_group, %pmc_libs );
-    for my $pmc (@pmcs) {
-        our $class = retrieve("$pmc.dump");
-
-        # there can be many libs
-        my %libs = %{ $class->{flags}{lib} || {} };
-        $pmc_libs{$pmc} = \%libs;
-
-        # There should be at most a single group
-        my $group = $class->{flags}{group}
-          or next;
-        $pmc_group{$pmc} = $group;
-        push @{ $group_files{$group} }, $pmc;
-        $group_libs{$group} ||= {};
-        foreach my $lib ( keys %libs ) {
-            $group_libs{$group}->{$lib} = 1;
-        }
-    }
-
-    return (\%group_files, \%group_libs, \%pmc_group, \%pmc_libs);
-}
-
-sub modtime {
-    my $ago = (-M shift);
-
-    if (defined $ago) {
-        return $NOW - $ago;
-    }
-    else {
-        return;
-    }
-}
-
-sub needs_build {
-    my ($target, @sources) = @_;
-
-    my $target_mod = modtime($target)
-      or return 1;
-    for my $source (@sources) {
-        return 1 if modtime($source) > $target_mod;
-    }
-
-    return 0;
-}
-
-sub generate_dump {
-    my ($pmc) = @_;
-
-    if (needs_build("$pmc.dump", "$pmc.pmc")) {
-        run("$PMC2C --dump $pmc.pmc")
-          or die "pmc2c dump failed ($?)\n";
-    }
-
-    return;
-}
-
-sub generate_c {
-    my ($pmc) = @_;
-
-    if (needs_build("$pmc.c", "$pmc.pmc")) {
-        run("$PMC2C --c $pmc.pmc")
-          or die "pmc2c code generation failed ($?)\n";
-    }
-
-    return;
-}
-
-sub compile {
-    my ($src_stem, $dest_stem) = @_;
-
-    $dest_stem ||= $src_stem;
-    if (needs_build("$dest_stem$O", "$src_stem.c")) {
-        run(compile_cmd("$dest_stem$O", "$src_stem.c"))
-          or die "compile $src_stem.c failed ($?)\n";
-    }
-    return 1;
-}
-
-sub partial_link {
-    my ($group, $libs, $stems) = @_;
-
-    my @sources = map { "$_$O" } @$stems;
-    if (needs_build("$group$LOAD_EXT", @sources)) {
-        return run(partial_link_cmd("$group$LOAD_EXT", $libs, \@sources))
-          or die "partial link $group$LOAD_EXT failed ($?)\n";
-    }
-    else {
-        return 1;
-    }
-}
-
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Added: branches/one_make/tools/build/dynpmc.pl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/one_make/tools/build/dynpmc.pl	Thu Dec 31 19:03:48 2009	(r43345)
@@ -0,0 +1,291 @@
+# Copyright (C) 2001-2009, Parrot Foundation.
+# $Id: $
+
+=head1 NAME
+
+tools/build/dynpmc.pl - Build script for dynamic PMCs
+
+=head1 DESCRIPTION
+
+This script is used for building dynamic PMCs.
+
+=cut
+
+use strict;
+use warnings;
+use FindBin;
+use lib "$FindBin::Bin/../..";
+use lib "$FindBin::Bin/../../lib";
+
+use File::Copy qw(copy);
+use Storable;
+
+use Parrot::Config qw/%PConfig/;
+
+# Config stuff
+our $CC            = $PConfig{cc} . ' -c';
+our $LD            = $PConfig{ld};
+our $LDFLAGS       = $PConfig{ldflags} . ' ' . $PConfig{ld_debug} . ' ' . $PConfig{rpath_blib};
+our $LD_LOAD_FLAGS = $PConfig{ld_load_flags};
+our $LOAD_EXT      = $PConfig{load_ext};
+our $O             = $PConfig{o};
+our $CFLAGS        = $PConfig{ccflags} . ' '. $PConfig{cc_shared} . ' ' . $PConfig{cc_debug} . ' ' . $PConfig{ccwarn} . ' ' . $PConfig{cc_hasjit} . ' ' . $PConfig{cg_flag} . ' ' . $PConfig{gc_flag};
+our $BUILD_DIR     = $PConfig{build_dir};
+
+our $LIBPARROT = q[];
+if ($PConfig{parrot_is_shared}) {
+    $LIBPARROT = $PConfig{libparrot_ldflags};
+}
+
+# PMC2C Config
+our $SLASH = $PConfig{slash};
+our $PMC2C = "$^X \"" . join($SLASH, qw/tools build pmc2c.pl/) . '"';
+
+# Actual commands
+sub compile_cmd {
+    my ($target, $source) = @_;
+
+    my $dynpmc_include = '';
+    if (defined $ENV{DYNPMC_INCLUDE} )
+    {
+        $dynpmc_include = $ENV{DYNPMC_INCLUDE};
+        $dynpmc_include =~ s/,/" -I"/g;
+        $dynpmc_include = '-I"' . $dynpmc_include . '" ';
+    }
+
+    return
+        $CC . ' ' .
+        $PConfig{cc_o_out} . $target . ' ' .
+        '-I"' . $BUILD_DIR . $SLASH . 'include' .
+        "$dynpmc_include $CFLAGS $source";
+};
+
+sub partial_link_cmd {
+    my ($target, $libs, $sources) = @_;
+
+    my $liblist;
+    if ($^O =~ /mswin32/i) {
+        # Need to put various libraries in the link line.
+        if ($CC =~ /gcc/i) {
+            $liblist = join( ' ', map { "-l$_" } keys %$libs );
+            $liblist =~ s/-lgdbm/-llibgdbm/i;
+        }
+        else {
+            $liblist = join( ' ', map { "$_.lib" } keys %$libs );
+        }
+        my $extraLibs = $PConfig{libs} . ' ' . $PConfig{icu_shared};
+        $extraLibs =~ s/blib/..\\blib/g;
+        $extraLibs =~ s/\Q$(A)\E/.lib/g;
+        $liblist .= ' ' . $extraLibs;
+
+        # Also note that we may need to look in the Parrot blib directory.
+        if ($CC =~ /gcc/i) {
+            $liblist .= qq{ -Wl,-L "$BUILD_DIR/blib/lib"};
+        }
+        else {
+            $liblist .= qq{ /LIBPATH:"$BUILD_DIR/blib/lib"};
+        }
+    }
+    else {
+        $liblist = join( ' ', map { "-l$_" } keys %$libs );
+        $liblist .= ' ' . $PConfig{libs} . ' ' . $PConfig{icu_shared};
+    }
+
+    if (defined $ENV{DYNPMC_LINK}) {
+        push @{$sources}, split /,/, $ENV{DYNPMC_LINK};
+    }
+
+    return
+        $LD . ' ' . $PConfig{ld_out} .
+        $target . ' ' .
+        join(' ', map {"\"$_\""} @$sources) .
+        " $liblist $LDFLAGS $LD_LOAD_FLAGS $LIBPARROT";
+}
+
+our $NOW = time();
+
+################### MAIN PROGRAM ################
+
+my ($mode, @pmcs) = @ARGV;
+
+if ($mode eq 'generate') {
+    # Convert X.pmc -> X.dump and X.c and also create any lib-GROUP.c files
+
+    generate_dump($_) foreach (@pmcs);
+    generate_c($_) foreach (@pmcs);
+
+    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
+        gather_groups_and_libs(@pmcs);
+
+    while (my ($group, $pmcs) = each %$group_files) {
+        my @pmcfiles = map { "$_.pmc" } @$pmcs;
+        if (needs_build("$group.c", @pmcfiles)) {
+            run("$PMC2C --library $group --c " . join(" ", at pmcfiles))
+              or die "pmc2c library creation failed ($?)\n";
+        }
+    }
+}
+elsif ($mode eq 'compile') {
+    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
+        gather_groups_and_libs(@pmcs);
+
+    # Convert X.c -> X.o for all X.c
+    compile($_) foreach (@pmcs);
+
+    # lib-GROUP.c
+    for my $group (keys %$group_files) {
+        compile("$group", "lib-$group")
+          or die "compile $group.c failed ($?)\n";
+    }
+}
+elsif ($mode eq 'linklibs') {
+    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
+        gather_groups_and_libs(@pmcs);
+
+    # Convert lib-GROUP.so + A.so + B.so ... -> GROUP.so
+    while (my ($group, $pmcs) = each %$group_files) {
+        partial_link($group, $group_libs->{$group}, [ "lib-$group", @$pmcs ] )
+          or die "partial link of $group failed ($?)\n";
+    }
+
+    # Link non-grouped PMCs individually
+    my @ungrouped_pmcs = grep { ! exists $pmc_group->{$_} } @pmcs;
+    partial_link($_, $pmc_libs->{$_}, [ $_ ] ) foreach (@ungrouped_pmcs);
+}
+elsif ($mode eq 'copy') {
+    # Copy *.so -> destination, where destination is the first
+    # argument, given as --destination=DIRECTORY
+    shift(@pmcs) =~ /--destination=(.*)/
+      or die "copy command requires destination";
+    my $dest = $1;
+
+    my ($group_files, $group_libs, $pmc_group, $pmc_libs) =
+        gather_groups_and_libs(@pmcs);
+    my @ungrouped_pmcs = grep { ! exists $pmc_group->{$_} } @pmcs;
+
+    my (@list_to_process) = (@ungrouped_pmcs, keys %$group_files);
+
+    die "nothing found to copy" unless @list_to_process;
+
+    foreach (@list_to_process) {
+        copy("$_$LOAD_EXT", $dest) or die "Copy $_$LOAD_EXT failed ($?)\n";
+
+        # Execute permissions on libraries is especially important on
+        # some platforms
+        if ($^O eq 'hpux' or $^O eq 'cygwin') {
+            chmod 0755, "$dest at slash@$_$LOAD_EXT";
+        }
+
+    }
+}
+else {
+    die "invalid command '$mode'\nmust be one of generate, compile, linklibs, or copy\n";
+}
+
+sub run {
+    print join(" ", @_), "\n";
+
+    return system(@_) == 0;
+}
+
+sub gather_groups_and_libs {
+    my @pmcs = @_;
+
+    my ( %group_files, %group_libs, %pmc_group, %pmc_libs );
+    for my $pmc (@pmcs) {
+        our $class = retrieve("$pmc.dump");
+
+        # there can be many libs
+        my %libs = %{ $class->{flags}{lib} || {} };
+        $pmc_libs{$pmc} = \%libs;
+
+        # There should be at most a single group
+        my $group = $class->{flags}{group}
+          or next;
+        $pmc_group{$pmc} = $group;
+        push @{ $group_files{$group} }, $pmc;
+        $group_libs{$group} ||= {};
+        foreach my $lib ( keys %libs ) {
+            $group_libs{$group}->{$lib} = 1;
+        }
+    }
+
+    return (\%group_files, \%group_libs, \%pmc_group, \%pmc_libs);
+}
+
+sub modtime {
+    my $ago = (-M shift);
+
+    if (defined $ago) {
+        return $NOW - $ago;
+    }
+    else {
+        return;
+    }
+}
+
+sub needs_build {
+    my ($target, @sources) = @_;
+
+    my $target_mod = modtime($target)
+      or return 1;
+    for my $source (@sources) {
+        return 1 if modtime($source) > $target_mod;
+    }
+
+    return 0;
+}
+
+sub generate_dump {
+    my ($pmc) = @_;
+
+    if (needs_build("$pmc.dump", "$pmc.pmc")) {
+        run("$PMC2C --dump $pmc.pmc")
+          or die "pmc2c dump failed ($?)\n";
+    }
+
+    return;
+}
+
+sub generate_c {
+    my ($pmc) = @_;
+
+    if (needs_build("$pmc.c", "$pmc.pmc")) {
+        run("$PMC2C --c $pmc.pmc")
+          or die "pmc2c code generation failed ($?)\n";
+    }
+
+    return;
+}
+
+sub compile {
+    my ($src_stem, $dest_stem) = @_;
+
+    $dest_stem ||= $src_stem;
+    if (needs_build("$dest_stem$O", "$src_stem.c")) {
+        run(compile_cmd("$dest_stem$O", "$src_stem.c"))
+          or die "compile $src_stem.c failed ($?)\n";
+    }
+    return 1;
+}
+
+sub partial_link {
+    my ($group, $libs, $stems) = @_;
+
+    my @sources = map { "$_$O" } @$stems;
+    if (needs_build("$group$LOAD_EXT", @sources)) {
+        return run(partial_link_cmd("$group$LOAD_EXT", $libs, \@sources))
+          or die "partial link $group$LOAD_EXT failed ($?)\n";
+    }
+    else {
+        return 1;
+    }
+}
+
+
+# Local Variables:
+#   mode: cperl
+#   cperl-indent-level: 4
+#   fill-column: 100
+# End:
+# vim: expandtab shiftwidth=4:


More information about the parrot-commits mailing list