From 5c0c02e51a76183eb43b5ed80d925f3c2ce88dfb Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 13 Feb 2017 15:39:07 +0100 Subject: 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. --- driver/Configuration.ml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'driver/Configuration.ml') 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" -- cgit