[svn:parrot] r46489 - in branches/ops_pct/compilers/opsc: . src/Ops

cotto at svn.parrot.org cotto at svn.parrot.org
Tue May 11 05:21:19 UTC 2010


Author: cotto
Date: Tue May 11 05:21:18 2010
New Revision: 46489
URL: https://trac.parrot.org/parrot/changeset/46489

Log:
[opsc] make ops2c.nqp work with dynops too

Modified:
   branches/ops_pct/compilers/opsc/ops2c.nqp
   branches/ops_pct/compilers/opsc/src/Ops/Emitter.pm

Modified: branches/ops_pct/compilers/opsc/ops2c.nqp
==============================================================================
--- branches/ops_pct/compilers/opsc/ops2c.nqp	Tue May 11 04:34:46 2010	(r46488)
+++ branches/ops_pct/compilers/opsc/ops2c.nqp	Tue May 11 05:21:18 2010	(r46489)
@@ -9,7 +9,6 @@
 
 while ($i lt pir::elements(@args)) {
     if (@args[$i] eq '--core') {
-        my $ops_dir := 'src/ops';
 
         @files := <
             src/ops/core.ops

Modified: branches/ops_pct/compilers/opsc/src/Ops/Emitter.pm
==============================================================================
--- branches/ops_pct/compilers/opsc/src/Ops/Emitter.pm	Tue May 11 04:34:46 2010	(r46488)
+++ branches/ops_pct/compilers/opsc/src/Ops/Emitter.pm	Tue May 11 05:21:18 2010	(r46489)
@@ -19,8 +19,13 @@
 
     # Preparing various bits.
     my $suffix := $trans.suffix();
+    my $base   := 'core';
+
+    if !%flags<core> {
+        $base := subst( $file, /.ops$$/, '');
+        $base := subst( $base, /.*\//, '');
+    }
 
-    my $base := %flags<core> ?? 'core' !! subst( $file, /.ops$$/, '');
     my $base_ops_stub := $base ~ '_ops' ~ $suffix;
     my $base_ops_h    := $base_ops_stub ~ '.h';
 
@@ -34,9 +39,10 @@
         self<source>  := (~%flags<dir>) ~ "src/ops/$base_ops_stub.c";
     }
     else {
+        my $dynops_dir := subst( $file, /\w+\.ops$$/, '');
         self<include> := $base ~ "_ops.h";
-        self<header>  := self<include>;
-        self<source>  := $base ~ "_ops.c";
+        self<header>  := $dynops_dir ~ self<include>;
+        self<source>  := $dynops_dir ~ $base ~ "_ops.c";
     }
 
     self<sym_export> := %flags<core>
@@ -271,6 +277,7 @@
     $fh.print(qq|
 #include "parrot/parrot.h"
 #include "parrot/oplib.h"
+#include "parrot/runcore_api.h"
 
 {self.sym_export} op_lib_t *{self.init_func}(PARROT_INTERP, long init);
 


More information about the parrot-commits mailing list