summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-06-30 09:56:33 -0400
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-06-30 09:56:33 -0400
commit81c2f420d8b5e0b885b79bff0eaa07a13982368a (patch)
tree504cab7c89c654e6dc3f6b9c304093bd3bc6abf8 /bootstrap
parentd24b9feaf31b2088ef3ee7a0f4f338132defad35 (diff)
downloadcmake-81c2f420d8b5e0b885b79bff0eaa07a13982368a.tar.gz
ENH: Fix checking for C++ compiler on Mac, remove cmConfigure.h.tmp, so that nothing bad can happen if configure is interrupted, reports kwsys sources in cmConfigure.h
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap21
1 files changed, 19 insertions, 2 deletions
diff --git a/bootstrap b/bootstrap
index f4e70a7824..032a7d6d5a 100755
--- a/bootstrap
+++ b/bootstrap
@@ -177,6 +177,10 @@ cmake_try_run ()
fi
TMPFILE=`cmake_tmp_file`
echo "Try: ${COMPILER}"
+ echo "Line: ${COMPILER} ${FLAGS} ${TESTFILE} -o ${TMPFILE}"
+ echo "---------- file -----------------------"
+ cat ${TESTFILE}
+ echo "------------------------------------------"
"${COMPILER}" ${FLAGS} "${TESTFILE}" -o "${TMPFILE}"
RES=$?
if [ "${RES}" -ne "0" ]; then
@@ -281,6 +285,7 @@ fi
# Delete all the bootstrap files
rm -f "${cmake_bootstrap_dir}/cmake_bootstrap.log"
+rm -f "${cmake_bootstrap_dir}/cmConfigure.h.tmp"
# If exist compiler flags, set them
cmake_c_flags=${CFLAGS}
@@ -322,6 +327,8 @@ echo "C compiler on this system is: ${cmake_c_compiler} ${cmake_c_flags}"
# Test CXX compiler
cmake_cxx_compiler=
+# On Mac OSX, CC is the same as cc, so make sure not to try CC as c++ compiler.
+
# If CC is set, use that for compiler, otherwise use list of known compilers
if [ -n "${CXX}" ]; then
cmake_cxx_compilers="${CXX}"
@@ -333,10 +340,18 @@ fi
TMPFILE=`cmake_tmp_file`
cat>"${TMPFILE}.cxx"<<EOF
#include <stdio.h>
-class NeedCXX {};
+class NeedCXX
+{
+public:
+ NeedCXX() { this->Foo = 1; }
+ int GetFoo() { return this->Foo; }
+private:
+ int Foo;
+};
int main()
{
- printf("1\n");
+ NeedCXX c;
+ printf("%d\n", c.GetFoo());
return 0;
}
EOF
@@ -479,6 +494,8 @@ cmake_report cmConfigure.h.tmp " * Make: ${cmake_make_processor}"
cmake_report cmConfigure.h.tmp " *"
cmake_report cmConfigure.h.tmp " * Sources:"
cmake_report cmConfigure.h.tmp " * ${CMAKE_SOURCES}"
+cmake_report cmConfigure.h.tmp " * kwSys Sources:"
+cmake_report cmConfigure.h.tmp " * ${KWSYS_SOURCES}"
cmake_report cmConfigure.h.tmp " */"
# Test for STD namespace