[svn:parrot] r43705 - in trunk: . compilers/ncigen/config/makefiles docs lib/Parrot/Docs/Section tools/build

coke at svn.parrot.org coke at svn.parrot.org
Tue Feb 2 19:32:39 UTC 2010


Author: coke
Date: Tue Feb  2 19:32:37 2010
New Revision: 43705
URL: https://trac.parrot.org/parrot/changeset/43705

Log:
Remove tools/build/dynpmc.pl, resolve TT#338

Deleted:
   trunk/tools/build/dynpmc.pl
Modified:
   trunk/DEPRECATED.pod
   trunk/MANIFEST
   trunk/compilers/ncigen/config/makefiles/ncigen.in
   trunk/docs/compiler_faq.pod
   trunk/lib/Parrot/Docs/Section/Tools.pm

Modified: trunk/DEPRECATED.pod
==============================================================================
--- trunk/DEPRECATED.pod	Tue Feb  2 16:01:32 2010	(r43704)
+++ trunk/DEPRECATED.pod	Tue Feb  2 19:32:37 2010	(r43705)
@@ -369,18 +369,6 @@
 
 =back
 
-=head1 build tools
-
-=over 4
-
-=item tools/build/dynpmc.pl [eligible in 1.1]
-
-Replaced with makefiles.
-
-L<https://trac.parrot.org/parrot/ticket/338>
-
-=back
-
 =head1 Parrot library
 
 =over 4

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Tue Feb  2 16:01:32 2010	(r43704)
+++ trunk/MANIFEST	Tue Feb  2 19:32:37 2010	(r43705)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Mon Feb  1 01:27:58 2010 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Feb  2 19:27:59 2010 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -2129,7 +2129,6 @@
 tools/build/addopstags.pl                                   []
 tools/build/c2str.pl                                        []
 tools/build/cc_flags.pl                                     []
-tools/build/dynpmc.pl                                       []
 tools/build/fixup_gen_file.pl                               []
 tools/build/h2inc.pl                                        []
 tools/build/headerizer.pl                                   []

Modified: trunk/compilers/ncigen/config/makefiles/ncigen.in
==============================================================================
--- trunk/compilers/ncigen/config/makefiles/ncigen.in	Tue Feb  2 16:01:32 2010	(r43704)
+++ trunk/compilers/ncigen/config/makefiles/ncigen.in	Tue Feb  2 19:32:37 2010	(r43705)
@@ -16,7 +16,6 @@
 CP            = @cp@
 PARROT        = ../../parrot at exe@
 CAT           = @cat@
-BUILD_DYNPMC  = $(PERL) $(BUILD_DIR)/tools/build/dynpmc.pl
 RECONFIGURE   = $(PERL) $(BUILD_DIR)/tools/dev/reconfigure.pl
 
 ## places to look for things
@@ -30,15 +29,12 @@
 
 all: ncigen.pbc
 
-C_GROUP = $(PMC_DIR)/c_group$(LOAD_EXT)
-
 SOURCES = ncigen.pir \
   src/gen_grammar.pir \
   src/gen_actions.pir \
   src/gen_builtins.pir \
   src/NCIGENAST.pir \
-  src/NCIPIR.pir \
-#  $(C_GROUP)
+  src/NCIPIR.pir
 
 BUILTINS_PIR = \
   src/builtins/say.pir \
@@ -62,12 +58,6 @@
 src/gen_builtins.pir: $(BUILTINS_PIR)
 	$(CAT) $(BUILTINS_PIR) >src/gen_builtins.pir
 
-$(C_GROUP): $(PARROT) $(PMC_SOURCES)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) generate $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) compile $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) linklibs $(PMCS)
-	cd $(PMC_DIR) && $(BUILD_DYNPMC) copy --destination=$(PARROT_DYNEXT) $(PMCS)
-
 # This is a listing of all targets, that are meant to be called by users
 help:
 	@echo ""

Modified: trunk/docs/compiler_faq.pod
==============================================================================
--- trunk/docs/compiler_faq.pod	Tue Feb  2 16:01:32 2010	(r43704)
+++ trunk/docs/compiler_faq.pod	Tue Feb  2 19:32:37 2010	(r43705)
@@ -669,22 +669,8 @@
 to extend Parrot with additional types. For more information about writing
 PMCs, see L<tools/build/pmc2c.pl> and L<docs/pmc.pod>.
 
-To build dynamic PMCs, add something like the following to your Makefile:
-
-  PERL     = /usr/bin/perl
-  PMCBUILD = $(PERL) /path/to/parrot/tools/build/dynpmc.pl
-  DESTDIR  = /path/to/parrot/runtime/parrot/dynext
-  LOAD_EXT = .so
-
-  PMCDIR    = pmc
-  PMCS      = MyInteger MyFloat MyString MyObject
-  PMC_FILES = MyInteger.pmc MyFloat.pmc MyString.pmc MyObject.pmc
-
-  dynpmcs : $(PMC_FILES)
-      @cd $(PMCDIR) && $(PMCBUILD) generate $(PMCS)
-      @cd $(PMCDIR) && $(PMCBUILD) compile $(PMCS)
-      @cd $(PMCDIR) && $(PMCBUILD) linklibs $(PMCS)
-      @cd $(PMCDIR) && $(PMCBUILD) copy "--destination=$(DESTDIR)" $(PMCS)
+See L<src/dynpmc/Makefile> for an example of how to build your dynamic
+PMCS.
 
 =head2 How do I add another op to Parrot?
 

Modified: trunk/lib/Parrot/Docs/Section/Tools.pm
==============================================================================
--- trunk/lib/Parrot/Docs/Section/Tools.pm	Tue Feb  2 16:01:32 2010	(r43704)
+++ trunk/lib/Parrot/Docs/Section/Tools.pm	Tue Feb  2 19:32:37 2010	(r43705)
@@ -55,7 +55,6 @@
             '',
             $self->new_item( '', 'docs/configuration.pod' ),
             $self->new_item( '', 'tools/build/c2str.pl' ),
-            $self->new_item( '', 'tools/build/dynpmc.pl' ),
             $self->new_item( '', 'tools/build/ops2c.pl' ),
             $self->new_item( '', 'tools/build/ops2pm.pl' ),
             $self->new_item( '', 'tools/build/parrot_config_c.pl' ),

Deleted: trunk/tools/build/dynpmc.pl
==============================================================================
--- trunk/tools/build/dynpmc.pl	Tue Feb  2 19:32:37 2010	(r43704)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,292 +0,0 @@
-# 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.  It is deprecated,
-L<http://trac.parrot.org/parrot/ticket/338>.
-
-=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