BUG: Check if the compiler is gnu. If it is, do not do special platform tests. Fixes Bug #1215 - bootstrap uses native flags with gnu compiler on OSF
This commit is contained in:
parent
cbab381bda
commit
d186bbd719
63
bootstrap
63
bootstrap
@ -511,9 +511,33 @@ fi
|
|||||||
|
|
||||||
# Test C++ compiler features
|
# Test C++ compiler features
|
||||||
|
|
||||||
# If we are on IRIX, check for -LANG:std
|
# Are we GCC?
|
||||||
cmake_test_flags="-LANG:std"
|
|
||||||
if [ "x${cmake_system}" = "xIRIX64" ]; then
|
TMPFILE=`cmake_tmp_file`
|
||||||
|
cat > ${TMPFILE}.cxx <<EOF
|
||||||
|
#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
||||||
|
#include <iostream>
|
||||||
|
int main() { std::cout << "This is GNU" << std::endl; return 0;}
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
cmake_cxx_compiler_is_gnu=0
|
||||||
|
if cmake_try_run "${cmake_cxx_compiler}" \
|
||||||
|
"${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
|
||||||
|
cmake_cxx_compiler_is_gnu=1
|
||||||
|
fi
|
||||||
|
if [ "x${cmake_cxx_compiler_is_gnu}" = "x1" ]; then
|
||||||
|
echo "${cmake_cxx_compiler} is GNU compiler"
|
||||||
|
else
|
||||||
|
echo "${cmake_cxx_compiler} is not GNU compiler"
|
||||||
|
fi
|
||||||
|
rm -f "${TMPFILE}.cxx"
|
||||||
|
|
||||||
|
if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
|
||||||
|
# Check for non-GNU compiler flags
|
||||||
|
|
||||||
|
# If we are on IRIX, check for -LANG:std
|
||||||
|
cmake_test_flags="-LANG:std"
|
||||||
|
if [ "x${cmake_system}" = "xIRIX64" ]; then
|
||||||
TMPFILE=`cmake_tmp_file`
|
TMPFILE=`cmake_tmp_file`
|
||||||
cat > ${TMPFILE}.cxx <<EOF
|
cat > ${TMPFILE}.cxx <<EOF
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -536,12 +560,12 @@ EOF
|
|||||||
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
||||||
fi
|
fi
|
||||||
rm -f "${TMPFILE}.cxx"
|
rm -f "${TMPFILE}.cxx"
|
||||||
fi
|
fi
|
||||||
cmake_test_flags=
|
cmake_test_flags=
|
||||||
|
|
||||||
# If we are on OSF, check for -timplicit_local -no_implicit_include
|
# If we are on OSF, check for -timplicit_local -no_implicit_include
|
||||||
cmake_test_flags="-timplicit_local -no_implicit_include"
|
cmake_test_flags="-timplicit_local -no_implicit_include"
|
||||||
if [ "x${cmake_system}" = "xOSF1" ]; then
|
if [ "x${cmake_system}" = "xOSF1" ]; then
|
||||||
TMPFILE=`cmake_tmp_file`
|
TMPFILE=`cmake_tmp_file`
|
||||||
cat > ${TMPFILE}.cxx <<EOF
|
cat > ${TMPFILE}.cxx <<EOF
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -561,12 +585,12 @@ EOF
|
|||||||
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
||||||
fi
|
fi
|
||||||
rm -f "${TMPFILE}.cxx"
|
rm -f "${TMPFILE}.cxx"
|
||||||
fi
|
fi
|
||||||
cmake_test_flags=
|
cmake_test_flags=
|
||||||
|
|
||||||
# If we are on OSF, check for -std strict_ansi -nopure_cname
|
# If we are on OSF, check for -std strict_ansi -nopure_cname
|
||||||
cmake_test_flags="-std strict_ansi -nopure_cname"
|
cmake_test_flags="-std strict_ansi -nopure_cname"
|
||||||
if [ "x${cmake_system}" = "xOSF1" ]; then
|
if [ "x${cmake_system}" = "xOSF1" ]; then
|
||||||
TMPFILE=`cmake_tmp_file`
|
TMPFILE=`cmake_tmp_file`
|
||||||
cat > ${TMPFILE}.cxx <<EOF
|
cat > ${TMPFILE}.cxx <<EOF
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -586,12 +610,12 @@ EOF
|
|||||||
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
|
||||||
fi
|
fi
|
||||||
rm -f "${TMPFILE}.cxx"
|
rm -f "${TMPFILE}.cxx"
|
||||||
fi
|
fi
|
||||||
cmake_test_flags=
|
cmake_test_flags=
|
||||||
|
|
||||||
# If we are on HP-UX, check for -Ae for the C compiler.
|
# If we are on HP-UX, check for -Ae for the C compiler.
|
||||||
cmake_test_flags="-Ae"
|
cmake_test_flags="-Ae"
|
||||||
if [ "x${cmake_system}" = "xHP-UX" ]; then
|
if [ "x${cmake_system}" = "xHP-UX" ]; then
|
||||||
TMPFILE=`cmake_tmp_file`
|
TMPFILE=`cmake_tmp_file`
|
||||||
cat > ${TMPFILE}.c <<EOF
|
cat > ${TMPFILE}.c <<EOF
|
||||||
int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
|
int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
|
||||||
@ -612,8 +636,9 @@ EOF
|
|||||||
echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
|
echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
|
||||||
fi
|
fi
|
||||||
rm -f "${TMPFILE}.c"
|
rm -f "${TMPFILE}.c"
|
||||||
|
fi
|
||||||
|
cmake_test_flags=
|
||||||
fi
|
fi
|
||||||
cmake_test_flags=
|
|
||||||
|
|
||||||
# Test for kwsys features
|
# Test for kwsys features
|
||||||
KWSYS_NAME_IS_KWSYS=0
|
KWSYS_NAME_IS_KWSYS=0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user