[svn:parrot] r43112 - in trunk: examples/languages/abc examples/languages/squaak examples/pir/befunge runtime/parrot/library

fperrad at svn.parrot.org fperrad at svn.parrot.org
Wed Dec 16 19:31:58 UTC 2009


Author: fperrad
Date: Wed Dec 16 19:31:57 2009
New Revision: 43112
URL: https://trac.parrot.org/parrot/changeset/43112

Log:
[distutils] now, works in a build tree

Modified:
   trunk/examples/languages/abc/setup.pir
   trunk/examples/languages/squaak/setup.pir
   trunk/examples/pir/befunge/setup.pir
   trunk/runtime/parrot/library/distutils.pir

Modified: trunk/examples/languages/abc/setup.pir
==============================================================================
--- trunk/examples/languages/abc/setup.pir	Wed Dec 16 18:53:55 2009	(r43111)
+++ trunk/examples/languages/abc/setup.pir	Wed Dec 16 19:31:57 2009	(r43112)
@@ -1,4 +1,4 @@
-#! /usr/local/bin/parrot
+#! ../../../parrot
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 

Modified: trunk/examples/languages/squaak/setup.pir
==============================================================================
--- trunk/examples/languages/squaak/setup.pir	Wed Dec 16 18:53:55 2009	(r43111)
+++ trunk/examples/languages/squaak/setup.pir	Wed Dec 16 19:31:57 2009	(r43112)
@@ -1,4 +1,4 @@
-#! /usr/local/bin/parrot
+#! ../../../parrot
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 

Modified: trunk/examples/pir/befunge/setup.pir
==============================================================================
--- trunk/examples/pir/befunge/setup.pir	Wed Dec 16 18:53:55 2009	(r43111)
+++ trunk/examples/pir/befunge/setup.pir	Wed Dec 16 19:31:57 2009	(r43112)
@@ -1,4 +1,4 @@
-#! /usr/local/bin/parrot
+#! ../../../parrot
 # Copyright (C) 2009, Parrot Foundation.
 # $Id$
 

Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir	Wed Dec 16 18:53:55 2009	(r43111)
+++ trunk/runtime/parrot/library/distutils.pir	Wed Dec 16 19:31:57 2009	(r43112)
@@ -587,9 +587,9 @@
     .local string cmd
     cmd = get_parrot()
     cmd .= " "
-    $S0 = get_libdir()
+    $S0 = get_library('PGE/Perl6Grammar.pbc')
     cmd .= $S0
-    cmd .= "/library/PGE/Perl6Grammar.pbc --output="
+    cmd .= " --output="
     cmd .= pir
     cmd .= " "
     cmd .= flags
@@ -632,9 +632,9 @@
     .local string cmd
     cmd = get_parrot()
     cmd .= " "
-    $S0 = get_libdir()
+    $S0 = get_compiler('tge/tgc.pir')
     cmd .= $S0
-    cmd .= "/languages/tge/tgc.pir --output="
+    cmd .= " --output="
     cmd .= pir
     cmd .= " "
     cmd .= tge
@@ -684,9 +684,9 @@
     .local string cmd
     cmd = get_parrot()
     cmd .= " "
-    $S0 = get_libdir()
+    $S0 = get_compiler('nqp/nqp.pbc')
     cmd .= $S0
-    cmd .= "/languages/nqp/nqp.pbc --target=pir --output="
+    cmd .= " --target=pir --output="
     cmd .= pir
     cmd .= " "
     cmd .= flags
@@ -769,7 +769,7 @@
     if $I0 goto L1
     src = join ' ', srcs
     .local string cmd
-    cmd = get_pbc_merge()
+    cmd = get_executable('pbc_merge')
     cmd .= " -o "
     cmd .= pbc
     cmd .= " "
@@ -815,9 +815,7 @@
     $I0 = newer($S1, pbc)
     if $I0 goto L1
     .local string cmd
-    cmd = get_bindir()
-    cmd .= "/pbc_to_exe"
-    cmd .= exe
+    cmd = get_executable('pbc_to_exe')
     cmd .= " "
     cmd .= pbc
     system(cmd, 1 :named('verbose'))
@@ -864,9 +862,7 @@
     $I0 = newer($S1, pbc)
     if $I0 goto L1
     .local string cmd
-    cmd = get_bindir()
-    cmd .= "/pbc_to_exe"
-    cmd .= exe
+    cmd = get_executable('pbc_to_exe')
     cmd .= " "
     cmd .= pbc
     cmd .= " --install"
@@ -971,9 +967,9 @@
     .local string cmd
     cmd = config['perl']
     cmd .= " "
-    $S0 = get_libdir()
+    $S0 = get_tool('build/ops2c.pl')
     cmd .= $S0
-    cmd .= "/tools/build/ops2c.pl "
+    cmd .= " "
     cmd .= core
     cmd .= " --dynamic "
     cmd .= src
@@ -1159,9 +1155,8 @@
     .local string pmc2c
     pmc2c = config['perl']
     pmc2c .= " "
-    $S0 = get_libdir()
+    $S0 = get_tool('build/pmc2c.pl')
     pmc2c .= $S0
-    pmc2c .= "/tools/build/pmc2c.pl"
     .local string pmc2c_includes
     pmc2c_includes = "--include "
     $S0 = get_srcdir()
@@ -1219,9 +1214,9 @@
     .local string cmd
     cmd = config['perl']
     cmd .= " "
-    $S0 = get_libdir()
+    $S0 = get_tool('build/pmc2c.pl')
     cmd .= $S0
-    cmd .= "/tools/build/pmc2c.pl --library "
+    cmd .= " --library "
 #    $S0 = dirname(src)
 #    cmd .= $S0
 #    cmd .= "/"
@@ -3226,6 +3221,28 @@
     .return (flags)
 .end
 
+=item get_compiler
+
+=cut
+
+.sub 'get_compiler'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['libdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    $S0 .= '/languages/'
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+    $S0 .= '/compilers/'
+  L2:
+    $S0 .= name
+    .return ($S0)
+.end
+
 =item get_exe
 
 =cut
@@ -3236,6 +3253,27 @@
     .return ($S0)
 .end
 
+=item get_executable
+
+=cut
+
+.sub 'get_executable'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['bindir']
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+  L2:
+    $S0 .= '/'
+    $S0 .= name
+    $S1 = $P0['exe']
+    $S0 .= $S1
+    .return ($S0)
+.end
+
 =item get_incdir
 
 =cut
@@ -3260,6 +3298,28 @@
     .return ($S0)
 .end
 
+=item get_library
+
+=cut
+
+.sub 'get_library'
+    .param string name
+    $P0 = get_config()
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['libdir']
+    $S1 = $P0['versiondir']
+    $S0 .= $S1
+    $S0 .= '/library/'
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+    $S0 .= '/runtime/parrot/library/'
+  L2:
+    $S0 .= name
+    .return ($S0)
+.end
+
 =item get_ldflags
 
 =cut
@@ -3305,49 +3365,47 @@
 =cut
 
 .sub 'get_parrot'
-    $P0 = get_config()
-    $S0 = $P0['bindir']
-    $S0 .= '/parrot'
-    $S1 = $P0['exe']
-    $S0 .= $S1
-    .return ($S0)
+    .tailcall get_executable('parrot')
 .end
 
-=item get_pbc_merge
+=item get_nqp
 
 =cut
 
-.sub 'get_pbc_merge'
-    $P0 = get_config()
-    $S0 = $P0['bindir']
-    $S0 .= '/pbc_merge'
-    $S1 = $P0['exe']
-    $S0 .= $S1
-    .return ($S0)
+.sub 'get_nqp'
+    .tailcall get_executable('parrot-nqp')
 .end
 
-=item get_nqp
+=item get_srcdir
 
 =cut
 
-.sub 'get_nqp'
+.sub 'get_srcdir'
     $P0 = get_config()
-    $S0 = $P0['bindir']
-    $S0 .= '/parrot-nqp'
-    $S1 = $P0['exe']
+    $S0 = $P0['srcdir']
+    $S1 = $P0['versiondir']
     $S0 .= $S1
     .return ($S0)
 .end
 
-=item get_srcdir
+=item get_tool
 
 =cut
 
-.sub 'get_srcdir'
+.sub 'get_tool'
+    .param string name
     $P0 = get_config()
-    $S0 = $P0['srcdir']
+    $I0 = $P0['installed']
+    unless $I0 goto L1
+    $S0 = $P0['libdir']
     $S1 = $P0['versiondir']
     $S0 .= $S1
+    goto L2
+  L1:
+    $S0 = $P0['prefix']
+  L2:
+    $S0 .= '/tools/'
+    $S0 .= name
     .return ($S0)
 .end
 


More information about the parrot-commits mailing list