[svn:parrot] r37091 - in trunk: . config/gen config/gen/config_pm runtime/parrot/library

fperrad at svn.parrot.org fperrad at svn.parrot.org
Tue Mar 3 14:36:35 UTC 2009


Author: fperrad
Date: Tue Mar  3 14:36:34 2009
New Revision: 37091
URL: https://trac.parrot.org/parrot/changeset/37091

Log:
[install] runtime/parrot/library/config.pir is now generated, and can work on installed tree

Added:
   trunk/config/gen/config_pm/config_pir.in
      - copied, changed from r37089, trunk/runtime/parrot/library/config.pir
Deleted:
   trunk/runtime/parrot/library/config.pir
Modified:
   trunk/MANIFEST
   trunk/MANIFEST.SKIP
   trunk/MANIFEST.generated
   trunk/config/gen/config_pm.pm
   trunk/runtime/parrot/library/   (props changed)

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Tue Mar  3 13:56:46 2009	(r37090)
+++ trunk/MANIFEST	Tue Mar  3 14:36:34 2009	(r37091)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Mon Mar  2 22:35:00 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Mar  3 13:58:08 2009 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -303,6 +303,7 @@
 config/gen/config_pm.pm                                     []
 config/gen/config_pm/Config_pm.in                           []
 config/gen/config_pm/config_lib_pasm.in                     []
+config/gen/config_pm/config_pir.in                          []
 config/gen/config_pm/myconfig.in                            []
 config/gen/core_pmcs.pm                                     []
 config/gen/crypto.pm                                        []
@@ -2002,7 +2003,6 @@
 runtime/parrot/library/YAML/Dumper/Base.pir                 [library]
 runtime/parrot/library/YAML/Dumper/Default.pir              [library]
 runtime/parrot/library/YAML/Parser/Syck.pir                 [library]
-runtime/parrot/library/config.pir                           [library]
 runtime/parrot/library/dumper.pir                           [library]
 runtime/parrot/library/libpcre.pir                          [library]
 runtime/parrot/library/ncurses.declarations                 [library]

Modified: trunk/MANIFEST.SKIP
==============================================================================
--- trunk/MANIFEST.SKIP	Tue Mar  3 13:56:46 2009	(r37090)
+++ trunk/MANIFEST.SKIP	Tue Mar  3 14:36:34 2009	(r37091)
@@ -1,6 +1,6 @@
 # ex: set ro:
 # $Id$
-# generated by tools/dev/mk_manifest_and_skip.pl Mon Mar  2 22:35:00 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Mar  3 14:13:06 2009 UT
 #
 # This file should contain a transcript of the svn:ignore properties
 # of the directories in the Parrot subversion repository. (Needed for
@@ -113,6 +113,8 @@
 ^pbc_to_exe\..*/
 ^perl6$
 ^perl6/
+^pirc$
+^pirc/
 ^tags$
 ^tags/
 ^temp\.file$
@@ -1013,6 +1015,8 @@
 ^runtime/parrot/library/OpenGL_funcs\.pir/
 ^runtime/parrot/library/PAST$
 ^runtime/parrot/library/PAST/
+^runtime/parrot/library/config\.pir$
+^runtime/parrot/library/config\.pir/
 # generated from svn:ignore of 'runtime/parrot/library/CGI/'
 ^runtime/parrot/library/CGI/.*\.pbc$
 ^runtime/parrot/library/CGI/.*\.pbc/

Modified: trunk/MANIFEST.generated
==============================================================================
--- trunk/MANIFEST.generated	Tue Mar  3 13:56:46 2009	(r37090)
+++ trunk/MANIFEST.generated	Tue Mar  3 14:36:34 2009	(r37091)
@@ -213,6 +213,7 @@
 runtime/parrot/include/warnings.pasm              [main]
 runtime/parrot/library/CGI/QueryHash.pbc          [main]
 runtime/parrot/library/config.pbc                 [main]
+runtime/parrot/library/config.pir                 [main]
 runtime/parrot/library/Data/Dumper/Base.pbc       [main]
 runtime/parrot/library/Data/Dumper/Default.pbc    [main]
 runtime/parrot/library/Data/Dumper.pbc            [main]

Modified: trunk/config/gen/config_pm.pm
==============================================================================
--- trunk/config/gen/config_pm.pm	Tue Mar  3 13:56:46 2009	(r37090)
+++ trunk/config/gen/config_pm.pm	Tue Mar  3 14:36:34 2009	(r37091)
@@ -31,6 +31,7 @@
     $data{result}      = q{};
     $data{templates}    = {
         myconfig        => 'config/gen/config_pm/myconfig.in',
+        config_pir      => 'config/gen/config_pm/config_pir.in',
         Config_pm       => 'config/gen/config_pm/Config_pm.in',
         config_lib      => 'config/gen/config_pm/config_lib_pasm.in',
     };
@@ -45,6 +46,11 @@
     my $template = $self->{templates}->{myconfig};
     $conf->genfile($template, 'myconfig' );
 
+    $template = $self->{templates}->{config_pir};
+    my $gen_pir = q{runtime/parrot/library/config.pir};
+    $conf->append_configure_log($gen_pir);
+    $conf->genfile($template, $gen_pir );
+
     $template = $self->{templates}->{Config_pm};
     open( my $IN, "<", $template )
         or die "Can't open $template: $!";

Copied and modified: trunk/config/gen/config_pm/config_pir.in (from r37089, trunk/runtime/parrot/library/config.pir)
==============================================================================
--- trunk/runtime/parrot/library/config.pir	Tue Mar  3 10:32:58 2009	(r37089, copy source)
+++ trunk/config/gen/config_pm/config_pir.in	Tue Mar  3 14:36:34 2009	(r37091)
@@ -4,10 +4,6 @@
 
 config.pir - Access Parrot configuration data
 
-=head1 VERSION
-
-version 0.01
-
 =head1 SYNOPSIS
 
   .sub _some
@@ -44,11 +40,20 @@
 =cut
 
 .include "interpinfo.pasm"
+.include "stat.pasm"
 
 .sub _config
-    .local string conf_file
-    conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
-    conf_file .= "/runtime/parrot/include/config.fpmc"
+    .local string prefix, conf_file
+    prefix = interpinfo .INTERPINFO_RUNTIME_PREFIX
+
+    $S0 = concat prefix, "/runtime"
+    $I0 = stat $S0, .STAT_EXISTS
+    if $I0 goto L1
+    conf_file = prefix . "/lib/parrot/include/config.fpmc"
+    goto L2
+  L1:
+    conf_file = prefix . "/runtime at versiondir@/include/config.fpmc"
+  L2:
 
     .local pmc CONF
     CONF = new 'FileHandle'

Deleted: trunk/runtime/parrot/library/config.pir
==============================================================================
--- trunk/runtime/parrot/library/config.pir	Tue Mar  3 14:36:34 2009	(r37090)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,97 +0,0 @@
-# $Id$
-
-=head1 TITLE
-
-config.pir - Access Parrot configuration data
-
-=head1 VERSION
-
-version 0.01
-
-=head1 SYNOPSIS
-
-  .sub _some
-  ...
-  # store the config data into $P0
-  $P0 = _config()
-  # Retrieve and print a key
-  $P1 = $P0["cc"]
-  print "Your C compiler is "
-  print $P1
-  print "\n"
-  ...
-
- .end
- .include "library/config.pir"
-
-=head1 DESCRIPTION
-
-config.pir is a mechanism for accessing most of the data collected by
-Configure.  It's roughly equivalent to Perl5's C<Config.pm> module.
-
-At the end of a successful C<make> of Parrot, a PASM file generated by
-Configure is run to put a file, F<config.fpmc>, into the library with a
-frozen Hash of the configuration data.  This library provides a
-function, C<_config>, to unpack and return that file's data.
-
-C<_config> does not take any parameters.  It returns a single Hash
-containing the data.  Keys that were C<undef> in Configure contain a
-C<None> PMC; otherwise they contain a C<String>.
-
-Note that the behavior of that hash when writing to any value (especially
-undefined values) is undefined, and may be rather funky.
-
-=cut
-
-.include "interpinfo.pasm"
-
-.sub _config
-    .local string conf_file
-    conf_file = interpinfo .INTERPINFO_RUNTIME_PREFIX
-    conf_file .= "/runtime/parrot/include/config.fpmc"
-
-    .local pmc CONF
-    CONF = new 'FileHandle'
-    push_eh error
-    .local string image
-    image = CONF.'readall'(conf_file)
-    pop_eh
-
-    .local pmc conf_hash
-    thaw conf_hash, image
-
-    .local pmc one
-    one = new 'Integer'
-    one = 1
-    setprop conf_hash, '_ro', one
-
-    .return( conf_hash )
-
-error:
-    .local pmc ex
-    .get_results (ex)
-    $S0 = "Can't read '"
-    $S0 .= conf_file
-    $S0 .= "' : "
-    $S1 = err
-    $S0 .= $S1
-    ex = $S0
-    rethrow ex
-.end
-
-=head1 AUTHOR
-
-Brent Royal-Gordon E<lt>brent at brentdax.comE<gt> is the author and maintainer.
-Please send patches and suggestions to the Parrot porters mailing list.
-
-=head1 COPYRIGHT
-
-Copyright (C) 2004-2009, Parrot Foundation.
-
-=cut
-
-# Local Variables:
-#   mode: pir
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:


More information about the parrot-commits mailing list