diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-11 13:30:26 +0100 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2015-12-11 13:30:26 +0100 |
commit | e1b0d579d7c0971856a3ada74078e51b3797a30a (patch) | |
tree | 6cb6fd057b9c526a53dfbd607b466351ffe7563c /driver | |
parent | 7b0ce5abd6a31a3790dfcfd3be69064bd5ca5eb3 (diff) | |
download | compcert-e1b0d579d7c0971856a3ada74078e51b3797a30a.tar.gz compcert-e1b0d579d7c0971856a3ada74078e51b3797a30a.zip |
Add a target option.
This option allows it to specify a .ini file that is in the usual
search path.
Bug 17431
Diffstat (limited to 'driver')
-rw-r--r-- | driver/Configuration.ml | 7 | ||||
-rw-r--r-- | driver/Driver.ml | 3 |
2 files changed, 7 insertions, 3 deletions
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 *) |