diff options
author | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-15 19:59:06 (GMT) |
---|---|---|
committer | Daniel Pfeifer <daniel@pfeifer-mail.de> | 2017-08-16 14:38:06 (GMT) |
commit | d12837afe65daf6f907364e48f907e6ce35fef7d (patch) | |
tree | b7227e1c3366987e5740163b6bdfd6f92fc8f61e /bootstrap | |
parent | dc0befb6a1b6480d5c2a8237ac052452c710e39a (diff) | |
download | CMake-d12837afe65daf6f907364e48f907e6ce35fef7d.zip CMake-d12837afe65daf6f907364e48f907e6ce35fef7d.tar.gz CMake-d12837afe65daf6f907364e48f907e6ce35fef7d.tar.bz2 |
bootstrap: Require a standard C compiler
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 33 |
1 files changed, 12 insertions, 21 deletions
@@ -935,35 +935,26 @@ echo ' # error "The CMAKE_C_COMPILER is set to a C++ compiler" #endif -#include<stdio.h> +#include <stdio.h> -#if defined(__CLASSIC_C__) -int main(argc, argv) - int argc; - char* argv[]; -#else int main(int argc, char* argv[]) -#endif { printf("%d%c", (argv != 0), (char)0x0a); - return argc-1; + return argc - 1; } ' > "${TMPFILE}.c" -for a in ${cmake_c_compilers}; do - if [ -z "${cmake_c_compiler}" ] && \ - cmake_try_run "${a}" "${cmake_c_flags}" "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then - cmake_c_compiler="${a}" - fi -done for std in 11 99 90; do try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`" - for flag in $try_flags; do - echo "Checking whether ${cmake_c_compiler} supports ${flag}" >> cmake_bootstrap.log 2>&1 - if cmake_try_run "${cmake_c_compiler}" "${cmake_c_flags} ${flag}" \ - "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then - cmake_c_flags="${cmake_c_flags} ${flag}" - break 2 - fi + for compiler in ${cmake_c_compilers}; do + for flag in '' $try_flags; do + echo "Checking whether '${compiler} ${cmake_c_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${compiler}" "${cmake_c_flags} ${flag}" \ + "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then + cmake_c_compiler="${compiler}" + cmake_c_flags="${cmake_c_flags} ${flag}" + break 3 + fi + done done done rm -f "${TMPFILE}.c" |