[svn:parrot] r43093 - trunk/runtime/parrot/library

fperrad at svn.parrot.org fperrad at svn.parrot.org
Wed Dec 16 11:57:29 UTC 2009


Author: fperrad
Date: Wed Dec 16 11:57:28 2009
New Revision: 43093
URL: https://trac.parrot.org/parrot/changeset/43093

Log:
[distutils] add the key 'pbc_pbc' in order to support pbc_merge

Modified:
   trunk/runtime/parrot/library/distutils.pir

Modified: trunk/runtime/parrot/library/distutils.pir
==============================================================================
--- trunk/runtime/parrot/library/distutils.pir	Wed Dec 16 11:01:48 2009	(r43092)
+++ trunk/runtime/parrot/library/distutils.pir	Wed Dec 16 11:57:28 2009	(r43093)
@@ -207,6 +207,8 @@
     register_step_after('build', _build_pir_nqp_rx)
     .const 'Sub' _build_pbc_pir = '_build_pbc_pir'
     register_step_after('build', _build_pbc_pir)
+    .const 'Sub' _build_pbc_pbc = '_build_pbc_pbc'
+    register_step_after('build', _build_pbc_pbc)
     .const 'Sub' _build_exe_pbc = '_build_exe_pbc'
     register_step_after('build', _build_exe_pbc)
     .const 'Sub' _build_installable_pbc = '_build_installable_pbc'
@@ -228,6 +230,8 @@
     register_step_after('clean', _clean_pir_nqp_rx)
     .const 'Sub' _clean_pbc_pir = '_clean_pbc_pir'
     register_step_after('clean', _clean_pbc_pir)
+    .const 'Sub' _clean_pbc_pbc = '_clean_pbc_pbc'
+    register_step_after('clean', _clean_pbc_pbc)
     .const 'Sub' _clean_exe_pbc = '_clean_exe_pbc'
     register_step_after('clean', _clean_exe_pbc)
     .const 'Sub' _clean_installable_pbc = '_clean_installable_pbc'
@@ -509,7 +513,7 @@
     .local string pbc, src
     pbc = shift $P0
     .local pmc depends
-    depends = $P0[pbc]
+    depends = hash[pbc]
     $I0 = does depends, 'array'
     unless $I0 goto L3
     $I0 = newer(pbc, depends)
@@ -568,7 +572,7 @@
     .local string pir, src
     pir = shift $P0
     .local pmc srcs
-    srcs = $P0[pir]
+    srcs = hash[pir]
     $I0 = does srcs, 'array'
     unless $I0 goto L3
     $I0 = newer(pir, srcs)
@@ -622,7 +626,7 @@
     unless $P0 goto L2
     .local string pir, tge
     pir = shift $P0
-    tge = $P0[pir]
+    tge = hash[pir]
     $I0 = newer(pir, tge)
     if $I0 goto L1
     .local string cmd
@@ -674,7 +678,7 @@
     unless $P0 goto L2
     .local string pir, nqp
     pir = shift $P0
-    nqp = $P0[pir]
+    nqp = hash[pir]
     $I0 = newer(pir, nqp)
     if $I0 goto L1
     .local string cmd
@@ -719,7 +723,7 @@
     unless $P0 goto L2
     .local string pir, nqp
     pir = shift $P0
-    nqp = $P0[pir]
+    nqp = hash[pir]
     $I0 = newer(pir, nqp)
     if $I0 goto L1
     .local string cmd
@@ -733,6 +737,48 @@
   L2:
 .end
 
+=item pbc_pbc
+
+hash
+
+the key is the PBC pathname
+
+the value is an array of PBC pathname
+
+=cut
+
+.sub '_build_pbc_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pbc_pbc']
+    unless $I0 goto L1
+    $P0 = kv['pbc_pbc']
+    build_pbc_pbc($P0)
+  L1:
+.end
+
+.sub 'build_pbc_pbc'
+    .param pmc hash
+    $P0 = iter hash
+  L1:
+    unless $P0 goto L2
+    .local string pbc, src
+    pbc = shift $P0
+    .local pmc srcs
+    srcs = hash[pbc]
+    $I0 = newer(pbc, srcs)
+    if $I0 goto L1
+    src = join ' ', srcs
+    .local string cmd
+    cmd = get_pbc_merge()
+    cmd .= " -o "
+    cmd .= pbc
+    cmd .= " "
+    cmd .= src
+    system(cmd, 1 :named('verbose'))
+    goto L1
+  L2:
+.end
+
 =item exe_pbc
 
 hash
@@ -761,7 +807,7 @@
     unless $P0 goto L2
     .local string bin, pbc
     bin = shift $P0
-    pbc = $P0[bin]
+    pbc = hash[bin]
     $I0 = length pbc
     $I0 -= 4
     $S0 = substr pbc, 0, $I0
@@ -809,7 +855,7 @@
     unless $P0 goto L2
     .local string bin, pbc
     bin = shift $P0
-    pbc = $P0[bin]
+    pbc = hash[bin]
     $I0 = length pbc
     $I0 -= 4
     $S0 = substr pbc, 0, $I0
@@ -1304,7 +1350,7 @@
     unless $P0 goto L2
     .local string html, pod
     html = shift $P0
-    pod = $P0[html]
+    pod = hash[html]
     $I0 = newer(html, pod)
     if $I0 goto L1
     .local string cmd
@@ -1401,6 +1447,19 @@
   L1:
 .end
 
+=item pbc_pbc
+
+=cut
+
+.sub '_clean_pbc_pbc' :anon
+    .param pmc kv :slurpy :named
+    $I0 = exists kv['pbc_pbc']
+    unless $I0 goto L1
+    $P0 = kv['pbc_pbc']
+    clean_key($P0)
+  L1:
+.end
+
 =item exe_pbc
 
 =cut
@@ -2538,6 +2597,8 @@
 
 =item pir_nqp-rx
 
+=item pbc_pbc
+
 =item exe_pbc
 
 =item installable_pbc
@@ -2572,7 +2633,7 @@
     needed = new 'Hash'
     generated = new 'Hash'
 
-    $P0 = split ' ', 'pbc_pir pir_pge pir_tge pir_nqp pir_nqp-rx exe_pbc installable_pbc dynops dynpmc html_pod'
+    $P0 = split ' ', 'pbc_pir pir_pge pir_tge pir_nqp pir_nqp-rx pbc_pbc exe_pbc installable_pbc dynops dynpmc html_pod'
   L1:
     unless $P0 goto L2
     $S0 = shift $P0
@@ -3242,6 +3303,19 @@
     .return ($S0)
 .end
 
+=item get_pbc_merge
+
+=cut
+
+.sub 'get_pbc_merge'
+    $P0 = get_config()
+    $S0 = $P0['bindir']
+    $S0 .= '/pbc_merge'
+    $S1 = $P0['exe']
+    $S0 .= $S1
+    .return ($S0)
+.end
+
 =item get_nqp
 
 =cut


More information about the parrot-commits mailing list