aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Configuration.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2017-02-13 15:39:07 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2017-02-13 15:39:07 +0100
commit5c0c02e51a76183eb43b5ed80d925f3c2ce88dfb (patch)
tree13266f8767648ee5433f30b16ec503144c67d003 /driver/Configuration.ml
parent236d8a48288ea5845466408cf9d0be2ccd68f9a8 (diff)
downloadcompcert-kvx-5c0c02e51a76183eb43b5ed80d925f3c2ce88dfb.tar.gz
compcert-kvx-5c0c02e51a76183eb43b5ed80d925f3c2ce88dfb.zip
Introduced configuration variable for gnu systems.
The variable gnu_toolchain is true if a gnu toolchain is used and false in all other cases. The variable avoids the explicit test whether the system string is diab and should be easier to change. Bug 20521.
Diffstat (limited to 'driver/Configuration.ml')
-rw-r--r--driver/Configuration.ml26
1 files changed, 11 insertions, 15 deletions
diff --git a/driver/Configuration.ml b/driver/Configuration.ml
index 5d5b4a2d..87e72f1c 100644
--- a/driver/Configuration.ml
+++ b/driver/Configuration.ml
@@ -115,6 +115,12 @@ let asm =
let linker =
tool_absolute_path (get_config_list "linker")@(opt_config_list "linker_options")
+let get_bool_config key =
+ match get_config_string key with
+ | "true" -> true
+ | "false" -> false
+ | v -> bad_config key [v]
+
let arch =
match get_config_string "arch" with
| "powerpc"|"arm"|"x86" as a -> a
@@ -127,27 +133,15 @@ let is_big_endian =
| "little" -> false
| v -> bad_config "endianness" [v]
let system = get_config_string "system"
-let has_runtime_lib =
- match get_config_string "has_runtime_lib" with
- | "true" -> true
- | "false" -> false
- | v -> bad_config "has_runtime_lib" [v]
-let has_standard_headers =
- match get_config_string "has_standard_headers" with
- | "true" -> true
- | "false" -> false
- | v -> bad_config "has_standard_headers" [v]
+let has_runtime_lib = get_bool_config "has_runtime_lib"
+let has_standard_headers = get_bool_config "has_standard_headers"
let stdlib_path =
if has_runtime_lib then
let path = get_config_string "stdlib_path" in
absolute_path ini_dir path
else
""
-let asm_supports_cfi =
- match get_config_string "asm_supports_cfi" with
- | "true" -> true
- | "false" -> false
- | v -> bad_config "asm_supports_cfi" [v]
+let asm_supports_cfi = get_bool_config "asm_supports_cfi"
type struct_passing_style =
@@ -188,3 +182,5 @@ let response_file_style =
| "gnu" -> Gnu
| "diab" -> Diab
| v -> bad_config "response_file_style" [v]
+
+let gnu_toolchain = system <> "diab"