# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #16968]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16968 >


The following patch causes Configure to generate a 'myconfig' file that
summarizes the current parrot configuration (much like perl5's 'myconfig'
or perl -V output).

This patch also includes makefile targets to generate OK and Not OK
reports, and a simple tools/dev/genrpt.pl script to generate those
reports.

I think such things will be useful as we try to make parrot more portable
and assess how we are doing.

diff -r -u -N parrot-orig/MANIFEST parrot-andy/MANIFEST
--- parrot-orig/MANIFEST        Thu Aug 29 16:56:27 2002
+++ parrot-andy/MANIFEST        Tue Sep  3 12:24:25 2002
@@ -70,6 +70,8 @@
 config/gen/makefiles/perl6.in
 config/gen/makefiles/root.in
 config/gen/makefiles/scheme.in
+config/gen/myconfig.pl
+config/gen/myconfig/myconfig.in
 config/gen/platform.pl
 config/gen/platform/ansi.c
 config/gen/platform/ansi.h
@@ -590,6 +592,7 @@
 t/src/basic.t
 test_main.c
 tools/dev/check_source_standards.pl
+tools/dev/genrpt.pl
 tools/dev/lib_deps.pl
 tools/dev/manicheck.pl
 tools/dev/parrot_coverage.pl
diff -r -u -N parrot-orig/MANIFEST.SKIP parrot-andy/MANIFEST.SKIP
--- parrot-orig/MANIFEST.SKIP   Wed Jun 12 18:12:15 2002
+++ parrot-andy/MANIFEST.SKIP   Tue Sep  3 11:33:14 2002
@@ -9,7 +9,6 @@
 /Makefile$
 ^lib/Parrot/Config\.pm$
 ^platform\.c$
-^config.opt$
 
 ^include/parrot/vtable\.h$
 ^include/parrot/jit_struct\.h$
diff -r -u -N parrot-orig/config/gen/makefiles/root.in 
parrot-andy/config/gen/makefiles/root.in
--- parrot-orig/config/gen/makefiles/root.in    Tue Sep  3 12:37:04 2002
+++ parrot-andy/config/gen/makefiles/root.in    Tue Sep  3 12:29:59 2002
@@ -31,7 +31,7 @@
 GEN_CONFIGS  = include/parrot/config.h include/parrot/platform.h \
                           lib/Parrot/Config.pm platform.c
 
-STICKY_FILES = $(GEN_CONFIGS) $(GEN_MAKEFILES) config.opt
+STICKY_FILES = $(GEN_CONFIGS) $(GEN_MAKEFILES) myconfig
 
 
 ###############################################################################
@@ -276,7 +276,6 @@
 lib/Parrot/PMC.pm : include/parrot/pmc.h pmc_pm.pl
        $(PERL) pmc_pm.pl 
 
-
 ###############################################################################
 #
 # Examples (Assembly):
@@ -476,6 +475,18 @@
 lifetest : $(TEST_PROG) examples/assembly/life.pbc
        $(TEST_PROG) $(TEST_PROG_ARGS) examples/assembly/life.pbc
 
+# For reporting success or failure with different configurations
+ok:
+       $(PERL) tools/dev/genrpt.pl --ok
+
+okfile:
+       $(PERL) tools/dev/genrpt.pl --ok --File parrot.ok
+
+nok:
+       $(PERL) tools/dev/genrpt.pl --nok
+
+nokfile:
+       $(PERL) tools/dev/genrpt.pl --nok --File parrot.nok
 
 ###############################################################################
 #
diff -r -u -N parrot-orig/config/gen/myconfig/myconfig.in 
parrot-andy/config/gen/myconfig/myconfig.in
--- parrot-orig/config/gen/myconfig/myconfig.in Wed Dec 31 19:00:00 1969
+++ parrot-andy/config/gen/myconfig/myconfig.in Tue Sep  3 12:34:46 2002
@@ -0,0 +1,20 @@
+Summary of my parrot ${VERSION} configuration:
+  configdate='${configdate}'
+  Platform:
+    osname=${osname}, archname=${archname}
+    jitcapable=${jitcapable}, jitarchname=${jitarchname},
+    jitosname=${jitosname}, jitcpuarch=${jitcpuarch}
+    perl=${perl}
+  Compiler:
+    cc='${cc}', ccflags='${ccflags}',
+  Linker and Libraries:
+    ld='${ld}', ldflags='${ldflags}',
+    cc_ldflags='${cc_ldflags}',
+    libs='${libs}'
+  Dynamic Linking:
+    so='${so}', ld_shared='${ld_shared}',
+    ld_shared_flags='${ld_shared_flags}'
+  Types:
+    iv=${iv}, intvalsize=${intvalsize}, intsize=${intsize}, opcode_t=${opcode_t}, 
+opcode_t_size=${opcode_t_size},
+    ptrsize=${ptrsize}, ptr_alignment=${ptr_alignment} byteorder=${byteorder}, 
+    nv=${nv}, numvalsize=${numvalsize}, doublesize=${doublesize}
diff -r -u -N parrot-orig/config/gen/myconfig.pl parrot-andy/config/gen/myconfig.pl
--- parrot-orig/config/gen/myconfig.pl  Wed Dec 31 19:00:00 1969
+++ parrot-andy/config/gen/myconfig.pl  Tue Sep  3 11:21:37 2002
@@ -0,0 +1,15 @@
+package Configure::Step;
+
+use strict;
+use vars qw($description @args);
+use Parrot::Configure::Step ':gen';
+
+$description="Recording this configuration in myconfig...";
+
+@args=();
+
+sub runstep {
+  genfile('config/gen/myconfig/myconfig.in',      'myconfig');
+}
+
+1;
diff -r -u -N parrot-orig/lib/Parrot/Configure/RunSteps.pm 
parrot-andy/lib/Parrot/Configure/RunSteps.pm
--- parrot-orig/lib/Parrot/Configure/RunSteps.pm        Tue Aug 27 01:05:06 2002
+++ parrot-andy/lib/Parrot/Configure/RunSteps.pm        Tue Sep  3 11:22:20 2002
@@ -29,6 +29,7 @@
        gen/config_h.pl
        gen/config_pm.pl
        gen/makefiles.pl
+       gen/myconfig.pl
        gen/platform.pl
        gen/libparrot_def.pl
 );
diff -r -u -N parrot-orig/tools/dev/genrpt.pl parrot-andy/tools/dev/genrpt.pl
--- parrot-orig/tools/dev/genrpt.pl     Wed Dec 31 19:00:00 1969
+++ parrot-andy/tools/dev/genrpt.pl     Tue Sep  3 12:22:52 2002
@@ -0,0 +1,57 @@
+#!/usr/bin/perl -w
+#
+# genrpt.pl
+#
+# Generate simple OK/Not OK reports for parrot builds.  It was loosely
+# inspired by perl5's perlbug utility.  If we want much more, we
+# should perhaps just use perlbug.
+#
+# The user must still manually edit the Not OK report to explain what
+# went wrong.
+
+use strict;
+use Getopt::Long;
+my $USAGE =
+"genrpt.pl [--help --ok --nok --File outputfile ]
+Generate simple OK/Not OK reports for parrot builds.  Examples:
+       genrpt.pl --ok --File parrot.ok    # Makes an 'OK' report
+       genrpt.pl --nok -File parrot.nok  # Makes a 'Not OK' report
+";
+
+my %opts;
+GetOptions(\%opts, qw(help ok nok File=s)) || die $USAGE;
+
+if ($opts{help}) {
+    print $USAGE;
+    exit(0);
+}
+
+if ($opts{File}) {
+    open(REPORT, ">$opts{File}") || 
+       die "Unable to open report file $opts{File}: $!\n";
+}
+else {
+    open(REPORT, ">-") ||
+       die "Unable to open standard output: $!\n";
+}
+
+
+if ($opts{ok}) {
+    print REPORT "OK: This is a success report for parrot.\n\n";
+    print REPORT "Parrot reported to build OK on this system.\n\n";
+}
+elsif ($opts{nok}) {
+    print REPORT "Not OK: This is a failure report for parrot.\n\n";
+}
+
+if (open(MYCONFIG, "<myconfig")) {
+    while (<MYCONFIG>) {
+       print REPORT $_;
+    }
+    close(MYCONFIG) || warn "Unable to close myconfig: $!\n";
+}
+else {
+    warn "Unable to open myconfig for input: $!\n";
+}
+
+close(REPORT) || warn "Unable to close report file: $!\n";

-- 
    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042



Reply via email to