From e1b0d579d7c0971856a3ada74078e51b3797a30a Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Fri, 11 Dec 2015 13:30:26 +0100 Subject: Add a target option. This option allows it to specify a .ini file that is in the usual search path. Bug 17431 --- driver/Configuration.ml | 7 +++++-- driver/Driver.ml | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'driver') diff --git a/driver/Configuration.ml b/driver/Configuration.ml index 8ab2642c..91d9a397 100644 --- a/driver/Configuration.ml +++ b/driver/Configuration.ml @@ -32,12 +32,15 @@ let absolute_path base file = the executable or in the directory ../share *) let ini_file_name = - match search_argv "--conf" with + match search_argv "-conf" with | Some s -> absolute_path (Sys.getcwd ()) s | None -> try Sys.getenv "COMPCERT_CONFIG" with Not_found -> + let ini_name = match search_argv "-target" with + | Some s -> s^".ini" + | None -> "compcert.ini" in let exe_dir = dirname Sys.executable_name in let share_dir = concat (concat exe_dir parent_dir_name) @@ -45,7 +48,7 @@ let ini_file_name = let share_compcert_dir = concat share_dir "compcert" in let search_path = [exe_dir;share_dir;share_compcert_dir] in - let files = List.map (fun s -> concat s "compcert.ini") search_path in + let files = List.map (fun s -> concat s ini_name) search_path in try List.find Sys.file_exists files with Not_found -> diff --git a/driver/Driver.ml b/driver/Driver.ml index 8d144ad5..c9c16eac 100644 --- a/driver/Driver.ml +++ b/driver/Driver.ml @@ -572,7 +572,8 @@ let cmdline_actions = Exact "-falign-branch-targets", Integer(fun n -> option_falignbranchtargets := n); Exact "-falign-cond-branches", Integer(fun n -> option_faligncondbranchs := n); (* Target processor options *) - Exact "--conf", String (fun _ -> ()); (* Ignore option since it is already handled *) + Exact "-conf", String (fun _ -> ()); (* Ignore option since it is already handled *) + Exact "-target", String (fun _ -> ()); (* Ignore option since it is already handled *) Exact "-mthumb", Set option_mthumb; Exact "-marm", Unset option_mthumb; (* Assembling options *) -- cgit