summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorDaniel Pfeifer <daniel@pfeifer-mail.de>2017-08-15 19:59:06 (GMT)
committerDaniel Pfeifer <daniel@pfeifer-mail.de>2017-08-16 14:38:06 (GMT)
commitd12837afe65daf6f907364e48f907e6ce35fef7d (patch)
treeb7227e1c3366987e5740163b6bdfd6f92fc8f61e /bootstrap
parentdc0befb6a1b6480d5c2a8237ac052452c710e39a (diff)
downloadCMake-d12837afe65daf6f907364e48f907e6ce35fef7d.zip
CMake-d12837afe65daf6f907364e48f907e6ce35fef7d.tar.gz
CMake-d12837afe65daf6f907364e48f907e6ce35fef7d.tar.bz2
bootstrap: Require a standard C compiler
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap33
1 files changed, 12 insertions, 21 deletions
diff --git a/bootstrap b/bootstrap
index 00c3ba5..eb54228 100755
--- a/bootstrap
+++ b/bootstrap
@@ -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"