Attached patch makes building in the dynclass ghetto a bit less inhospitable...

- Sam Ruby

? pyint.imc
? test.imc
? config/gen/makefiles/.dynclasses_pl.in.swp
? dynclasses/pyboolean.pmc
? dynclasses/pydict.pmc
? dynclasses/pyfloat.pmc
? dynclasses/pyfunc.pmc
? dynclasses/pyint.pmc
? dynclasses/pylist.pmc
? dynclasses/pymodule.pmc
? dynclasses/pynone.pmc
? dynclasses/pyobject.pmc
? dynclasses/pystring.pmc
? dynclasses/pytuple.pmc
? t/dynclass
Index: config/gen/makefiles/dynclasses.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/dynclasses.in,v
retrieving revision 1.8
diff -u -r1.8 dynclasses.in
--- config/gen/makefiles/dynclasses.in  12 Oct 2004 09:00:16 -0000      1.8
+++ config/gen/makefiles/dynclasses.in  4 Nov 2004 05:15:59 -0000
@@ -14,10 +14,10 @@
 BUILD = ${perl} build.pl
 
 all :
-       $(BUILD) generate $(PMCS)
-       $(BUILD) compile $(PMCS)
-       $(BUILD) linklibs $(PMCS)
-       $(BUILD) copy --destination=$(DESTDIR) $(PMCS)
+       @$(BUILD) generate $(PMCS)
+       @$(BUILD) compile $(PMCS)
+       @$(BUILD) linklibs $(PMCS)
+       @$(BUILD) copy --destination=$(DESTDIR) $(PMCS)
 
 clean :
        $(RM_F) *.c *.h *$(LOAD_EXT) *.dump lib-* *$(O)
Index: config/gen/makefiles/dynclasses_pl.in
===================================================================
RCS file: /cvs/public/parrot/config/gen/makefiles/dynclasses_pl.in,v
retrieving revision 1.3
diff -u -r1.3 dynclasses_pl.in
--- config/gen/makefiles/dynclasses_pl.in       14 Oct 2004 09:40:12 -0000      1.3
+++ config/gen/makefiles/dynclasses_pl.in       4 Nov 2004 05:15:59 -0000
@@ -43,9 +43,11 @@
     my ($group_files, $pmc_group) = gather_groups(@pmcs);
 
     while (my ($group, $pmcs) = each %$group_files) {
-        my $pmcfiles = join(" ", map { "$_.pmc" } @$pmcs);
-        run("$PMC2C --library $group --c $pmcfiles")
-          or die "pmc2c library creation failed ($?)\n";
+        my @pmcfiles = map { "$_.pmc" } @$pmcs;
+        if (needs_build("$group.c", @pmcfiles)) {
+            run("$PMC2C --library $group --c " . join(" ",@pmcfiles))
+              or die "pmc2c library creation failed ($?)\n";
+        }
     }
 } elsif ($mode eq 'compile') {
     my ($group_files, $pmc_group) = gather_groups(@pmcs);
@@ -123,7 +125,7 @@
     my $target_mod = modtime($target)
       or return 1;
     for my $source (@sources) {
-        return 1 if modtime($source) >= $target_mod;
+        return 1 if modtime($source) > $target_mod;
     }
     return 0;
 }
@@ -134,8 +136,6 @@
     if (needs_build("$pmc.dump", "$pmc.pmc")) {
         run("$PMC2C --dump $pmc.pmc")
           or die "pmc2c dump failed ($?)\n";
-    } else {
-        print "$pmc.dump is up to date\n";
     }
 }
 
@@ -155,6 +155,9 @@
         run(compile_cmd("$dest_stem$O", "$src_stem.c"))
           or die "compile $src_stem.c failed ($?)\n";
     }
+    else {
+        1;
+    }
 }
 
 sub partial_link {
@@ -164,4 +167,7 @@
         run(partial_link_cmd("$group$LOAD_EXT", @sources))
           or die "partial link $group$LOAD_EXT failed ($?)\n";
     }
+    else {
+        1;
+    }
 }
Index: lib/Parrot/Pmc2c.pm
===================================================================
RCS file: /cvs/public/parrot/lib/Parrot/Pmc2c.pm,v
retrieving revision 1.48
diff -u -r1.48 Pmc2c.pm
--- lib/Parrot/Pmc2c.pm 1 Nov 2004 12:28:49 -0000       1.48
+++ lib/Parrot/Pmc2c.pm 4 Nov 2004 05:16:03 -0000
@@ -1577,6 +1577,7 @@
     my %opt = %{$self->{opt}};
     my $library = $opt{library} ? 1 : 0;
 
+    if (!$library) {
     while (my @fc = each %{$self->{pmcs}}) {
         my ($file, $generator) = @fc;
        print Data::Dumper->Dump([$generator]) if $opt{debug} > 1;
@@ -1600,7 +1601,8 @@
         close C;
     }
 
-    if ($library) {
+    }
+    else {
        my $hout = $self->gen_h($opt{library});
         my $h = "$opt{library}.h";
         print "Writing $h\n" if $opt{verbose};

Reply via email to