Skip to content

Commit 64faa3f

Browse files
committed
Removed environment variable for the stdlib_path and added a new variable for the configuration file.
1 parent a2bed03 commit 64faa3f

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

driver/Configuration.ml

+15-11
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,22 @@ let config_vars: (string, string) Hashtbl.t = Hashtbl.create 10
1818
let _ =
1919
try
2020
let file =
21-
let dir = Sys.getcwd ()
22-
and name = Sys.argv.(0) in
23-
let dirname = if Filename.is_relative name then
24-
Filename.dirname (Filename.concat dir name)
25-
else
26-
Filename.dirname name
27-
in
28-
let share_dir = Filename.concat (Filename.concat dirname Filename.parent_dir_name) "share" in
2921
try
30-
open_in (Filename.concat dirname "compcert.ini")
31-
with Sys_error _ ->
32-
open_in (Filename.concat share_dir "compcert.ini")
22+
let env_file = Sys.getenv "COMPCERT_CONFIG" in
23+
open_in env_file
24+
with Not_found ->
25+
let dir = Sys.getcwd ()
26+
and name = Sys.argv.(0) in
27+
let dirname = if Filename.is_relative name then
28+
Filename.dirname (Filename.concat dir name)
29+
else
30+
Filename.dirname name
31+
in
32+
let share_dir = Filename.concat (Filename.concat dirname Filename.parent_dir_name) "share" in
33+
try
34+
open_in (Filename.concat dirname "compcert.ini")
35+
with Sys_error _ ->
36+
open_in (Filename.concat share_dir "compcert.ini")
3337
in
3438
(try
3539
let ini_line = Str.regexp "\\([^=]+\\)=\\(.+\\)" in

driver/Driver.ml

+1-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ open Timing
1717

1818
(* Location of the compatibility library *)
1919

20-
let stdlib_path = ref(
21-
try
22-
Sys.getenv "COMPCERT_LIBRARY"
23-
with Not_found ->
24-
Configuration.stdlib_path)
20+
let stdlib_path = ref Configuration.stdlib_path
2521

2622
let command cmd =
2723
if !option_v then begin

driver/Timing.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
(* *)
33
(* The Compcert verified compiler *)
44
(* *)
5-
(* Bernhard Schommer, AbsInt Angewandte Informatik GmbH *)
5+
(* Xavier Leroy, INRIA Paris-Rocquencourt *)
66
(* *)
7-
(* AbsInt Angewandte Informatik GmbH. All rights reserved. This file *)
8-
(* is distributed under the terms of the INRIA Non-Commercial *)
9-
(* License Agreement. *)
7+
(* Copyright Institut National de Recherche en Informatique et en *)
8+
(* Automatique. All rights reserved. This file is distributed *)
9+
(* under the terms of the INRIA Non-Commercial License Agreement. *)
1010
(* *)
1111
(* *********************************************************************)
1212

0 commit comments

Comments
 (0)