2008/7/22 Mark Glines <[EMAIL PROTECTED]>:
> On Tuesday 22 July 2008 04:56:53 Reini Urban wrote:
>> Attached patch adds --install to pbc_to_exe,
>> adds a basic pod to pbc_to_exe,
>> and applies --install to perl6.
>>
>> link against install_config.o and add installable prefix.
>> Limitation: With --install the first arg infile must have no
>> directory part!
>>
>> Now we can generate make install for the languages.
>
> Hi!
>
> When I try to apply your patch, I get:
>
> [EMAIL PROTECTED] parrot-trunk % patch -p0 
> <~/Desktop/installable_pbc_to_exe.patch
> patching file languages/perl6/config/makefiles/root.in
> patching file tools/dev/pbc_to_exe_gen.pl
> misordered hunks! output would be garbled
> Hunk #4 FAILED at 11.
> misordered hunks! output would be garbled
> Hunk #5 FAILED at 70.
> misordered hunks! output would be garbled
> Hunk #6 FAILED at 318.
> 3 out of 10 hunks FAILED -- saving rejects to file 
> tools/dev/pbc_to_exe_gen.pl.rej
>
>
> Any chance of getting an in-order diff?  If not, could you just attach
> your pbc_to_exe_gen.pl?

Because my patch is on top of another open ticket of mine for this file.

Here are both.
-- 
Reini Urban
http://phpwiki.org/ http://murbreak.at/
difforig tools/dev/pbc_to_exe_gen.pl

diff -u tools/dev/pbc_to_exe_gen.pl.orig tools/dev/pbc_to_exe_gen.pl
--- tools/dev/pbc_to_exe_gen.pl.orig	2008-07-20 16:13:26.656250000 +0200
+++ tools/dev/pbc_to_exe_gen.pl	2008-07-22 13:43:04.625000000 +0200
@@ -11,6 +11,22 @@
 __END__
 #! parrot
 
+=head1 TITLE
+
+pbc_to_exe
+
+=head2 SYNOPSIS
+
+  pbc_to_exe my.pbc
+  => my.exe
+
+  pbc_to_exe my.pbc --install
+  => installable_my.exe
+
+Warning! With -install there must be no directory prefix in the first arg yet.
+
+=cut
+
 .include 'library/config.pir'
 
 .sub 'main' :main
@@ -54,8 +70,40 @@
     argc = args
 
     if argc == 2 goto proper_args
+    if argc == 3 goto check_install
     .return ()
 
+check_install:
+    .local string infile, install
+
+    $P0    = shift args
+    infile = shift args
+    install = shift args
+    if install == '--install' goto proper_install
+    .return ()
+
+proper_install:
+    .local string cfile, objfile, obj, exefile, exe
+
+    $P0    = '_config'()
+    obj    = $P0['o']
+    exe    = $P0['exe']
+
+    .local int infile_len
+    infile_len  = length infile
+    infile_len -= 3
+
+    cfile       = substr infile, 0, infile_len
+    cfile      .= 'c'
+
+    dec infile_len
+    objfile     = substr infile, 0, infile_len
+    exefile     = 'installable_'
+    exefile    .= objfile
+    exefile    .= exe
+    objfile    .= obj
+    .return(infile, cfile, objfile, exefile)
+
 proper_args:
     .local string infile, cfile, objfile, obj, exefile, exe
 
@@ -270,6 +318,7 @@
 .sub 'compile_file'
     .param string cfile
     .param string objfile
+    .param int install :optional
 
     $P0 = '_config'()
     .local string cc, ccflags, cc_o_out, osname, build_dir, slash
@@ -318,6 +367,7 @@
 .sub 'link_file'
     .param string objfile
     .param string exefile
+    .param int install :optional
 
     $P0 = '_config'()
     .local string cc, ld, link_dynamic, linkflags, ld_out, libparrot, libs, o
@@ -336,11 +386,17 @@
     slash        = $P0['slash']
     icushared    = $P0['icu_shared']
 
-    .local string config, pathquote
+    .local string config, pathquote, exeprefix
+    exeprefix = substr exefile, 0, 12
     config     = concat build_dir, slash
     config    .= 'src'
     config    .= slash
+    if exeprefix == 'installable_' goto config_install
     config    .= 'parrot_config'
+    goto config_cont
+ config_install:
+    config    .= 'install_config'
+ config_cont:
     config    .= o
     pathquote  = ''
     unless osname == 'MSWin32' goto not_windows
@@ -361,6 +417,8 @@
     link .= objfile
     link .= pathquote
     link .= ' '
+    link .= config
+    link .= ' '
     link .= rpath
     link .= ' '
     link .= libparrot
@@ -372,8 +430,6 @@
     link .= libs
     link .= ' '
     link .= icushared
-    link .= ' '
-    link .= config
 
     say link
     .local int status

Reply via email to