Permalink
Browse files

[build] move Perl6/ to blib/Perl6

  • Loading branch information...
moritz committed Jun 1, 2011
1 parent 31dde87 commit cf09768ef0ee1b9fe74b3fe3d284afb7891b68de
Showing with 28 additions and 7 deletions.
  1. +1 −0 blib/Perl6/.gitignore
  2. +5 −5 build/Makefile.in
  3. +20 −0 src/Perl6/ModuleLoader.pm
  4. +2 −2 src/Perl6/SymbolTable.pm
View
@@ -0,0 +1 @@
+*.pbc
View
@@ -54,15 +54,15 @@ PERL6_PIR = src/gen/perl6.pir
PERL6_PBC = perl6.pbc
PERL6_EXE = perl6$(EXE)
PERL6_ML = src/gen/perl6-moduleloader.pir
-PERL6_ML_PBC = Perl6/ModuleLoader.pbc
+PERL6_ML_PBC = blib/Perl6/ModuleLoader.pbc
PERL6_ST = src/gen/perl6-symboltable.pir
-PERL6_ST_PBC = Perl6/SymbolTable.pbc
+PERL6_ST_PBC = blib/Perl6/SymbolTable.pbc
PERL6_G = src/gen/perl6-grammar.pir
-PERL6_G_PBC = Perl6/Grammar.pbc
+PERL6_G_PBC = blib/Perl6/Grammar.pbc
PERL6_A = src/gen/perl6-actions.pir
-PERL6_A_PBC = Perl6/Actions.pbc
+PERL6_A_PBC = blib/Perl6/Actions.pbc
PERL6_M = src/gen/perl6-metamodel.pir
-PERL6_M_PBC = Perl6/Metamodel.pbc
+PERL6_M_PBC = blib/Perl6/Metamodel.pbc
SETTING_PIR = src/gen/CORE.setting.pir
SETTING = CORE.setting.pbc
GROUP = perl6_group
View
@@ -19,6 +19,26 @@ class Perl6::ModuleLoader {
# with what we already have.
my $module_ctx;
my $path := pir::join('/', pir::split('::', $module_name)) ~ '.pbc';
+ my @prefixes := [];
+ try {
+ my $prefix := %*COMPILING<%?OPTIONS><module-path>;
+ if $prefix {
+ pir::push(@prefixes, $prefix);
+ } else {
+ pir::push(@prefixes, '.');
+ pir::push(@prefixes, 'blib');
+ }
+ CATCH {
+ pir::push(@prefixes, '.');
+ pir::push(@prefixes, 'blib');
+ }
+ }
+ for @prefixes -> $prefix {
+ if pir::stat__isi("$prefix/$path", 0) {
+ $path := "$prefix/$path";
+ last;
+ }
+ }
try {
my $prefix := %*COMPILING<%?OPTIONS><module-path>;
if $prefix {
View
@@ -77,7 +77,7 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
# Do load in code.
my $fixup := PAST::Stmts.new(
PAST::Op.new(
- :pirop('load_bytecode vs'), 'Perl6/ModuleLoader.pbc'
+ :pirop('load_bytecode vs'), 'blib/Perl6/ModuleLoader.pbc'
),
PAST::Op.new(
:pasttype('callmethod'), :name('set_outer_ctx'),
@@ -104,7 +104,7 @@ class Perl6::SymbolTable is HLL::Compiler::SerializationContextBuilder {
# Make sure we do the loading during deserialization.
self.add_event(:deserialize_past(PAST::Stmts.new(
PAST::Op.new(
- :pirop('load_bytecode vs'), 'Perl6/ModuleLoader.pbc'
+ :pirop('load_bytecode vs'), 'blib/Perl6/ModuleLoader.pbc'
),
PAST::Op.new(
:pasttype('callmethod'), :name('load_module'),

0 comments on commit cf09768

Please sign in to comment.