Commit 7b747408 authored by John van Groningen's avatar John van Groningen

port commit from Unix version:

split arguments for the compiler in initial arguments and arguments for each compiler call,
separated by a : (: is also used to separate the compiler executable file name and the arguments)
parent b20c9dd2
......@@ -124,7 +124,8 @@ CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax md
startupdir compiling_info env
# (cocl,cocl_dir,options1,options2) = get_path_name_and_options2 cocl startupdir
# (compiling_info=:CompilerProcess {commands_fd,results_fd}) = start_compiler_if_not_yet_started cocl compiling_info
# (compiling_info=:CompilerProcess {commands_fd,results_fd})
= start_compiler_if_not_yet_started cocl options1 compiling_info
# temp_dir = temp_dir_path startupdir
out_file_name = out_file_path temp_dir 0
......@@ -137,7 +138,6 @@ CompilePersistent cocl write_module_times errwin typewin compileOrCheckSyntax md
" -RE "+++"\""+++errors_file_name+++"\""+++
" -RO "+++"\""+++out_file_name+++"\""
# args_string = if (size options2==0) args_string (options2+++" "+++args_string)
# args_string = if (size options1==0) args_string (options1+++" "+++args_string)
# args_string = "cocl "+++args_string+++"\n"
n_chars = size args_string
# r = write commands_fd args_string n_chars
......@@ -183,7 +183,7 @@ CompileStartCommand cocl write_module_times errwin compileOrCheckSyntax path
# (cocl,cocl_dir,options1,options2) = get_path_name_and_options2 cocl startupdir
# ({commands_fd,results_fd},compiler_process_ids)
= start_a_compiler_if_not_yet_started cocl slot compiler_process_ids
= start_a_compiler_if_not_yet_started cocl slot compiler_process_ids options1
# temp_dir = temp_dir_path startupdir
out_file_name = out_file_path temp_dir slot
......@@ -521,8 +521,8 @@ O_RDONLY:==0;
O_WRONLY:==1;
O_RDWR:==2;
start_compiler :: !{#Char} -> *CompilerProcess
start_compiler compiler_file_name
start_compiler :: !{#Char} !{#Char} -> *CompilerProcess
start_compiler compiler_file_name initial_args
# commands_file_name = "/tmp/comXXXXXX" +++ "\0" // +++ because modified by mkstemp
# fd = mkstemp commands_file_name
| fd== -1
......@@ -551,7 +551,7 @@ start_compiler compiler_file_name
| r== -1
= abort "mkfifo failed"
# cocl_arguments = ["--pipe",commands_file_name,results_file_name]
# cocl_arguments = add_options_string_to_args 0 initial_args ["--pipe",commands_file_name,results_file_name]
# (argv,args_memory) = make_argv [compiler_file_name:cocl_arguments]
......@@ -575,16 +575,16 @@ start_compiler compiler_file_name
= { commands_file_name=commands_file_name, results_file_name=results_file_name,
compiler_pid=compiler_pid, commands_fd=commands_fd, results_fd=results_fd}
start_compiler_if_not_yet_started :: !{#Char} !*CompilingInfo -> *CompilingInfo
start_compiler_if_not_yet_started compiler_file_name NoCompiler
= CompilerProcess (start_compiler compiler_file_name);
start_compiler_if_not_yet_started compiler_file_name compiling_info
start_compiler_if_not_yet_started :: !{#Char} !{#Char} !*CompilingInfo -> *CompilingInfo
start_compiler_if_not_yet_started compiler_file_name initial_args NoCompiler
= CompilerProcess (start_compiler compiler_file_name initial_args)
start_compiler_if_not_yet_started compiler_file_name initial_args compiling_info
= compiling_info
start_a_compiler_if_not_yet_started compiler_file_name slot compiler_process_ids
start_a_compiler_if_not_yet_started compiler_file_name slot compiler_process_ids initial_args
| slot<length compiler_process_ids
= (compiler_process_ids !! slot,compiler_process_ids)
# compiler_process = start_compiler compiler_file_name
# compiler_process = start_compiler compiler_file_name initial_args
# compiler_process_ids = compiler_process_ids++[compiler_process]
= (compiler_process,compiler_process_ids)
......@@ -712,6 +712,7 @@ where
| c == line.[pos] = pos;
= FindChar c line linelen (pos+1);
add_options_string_to_args :: !Int !{#Char} ![{#Char}] -> [{#Char}]
add_options_string_to_args i s args
# first_i = skip_spaces_and_tabs i s
| first_i>=size s
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment