summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-05-06 13:29:05 -0400
committerBrad King <brad.king@kitware.com>2014-05-06 13:29:05 -0400
commit9cb4677509aa767245cbf4bb9e655d1559bc10bd (patch)
tree6851c9bf79cc75edd46857437c24fff273478c80
parentb121436bd05448643b133ea49c8556aeeef9a098 (diff)
parent500d83ba8c1653279a37057e30ce51c835d19c0d (diff)
downloadcmake-9cb4677509aa767245cbf4bb9e655d1559bc10bd.tar.gz
Merge branch 'hpux-compile' into release
-rw-r--r--CompileFlags.cmake15
-rwxr-xr-xbootstrap25
2 files changed, 38 insertions, 2 deletions
diff --git a/CompileFlags.cmake b/CompileFlags.cmake
index 24ac58db78..587403178d 100644
--- a/CompileFlags.cmake
+++ b/CompileFlags.cmake
@@ -19,7 +19,6 @@ endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
-include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
set(_INTEL_WINDOWS 1)
@@ -54,6 +53,18 @@ if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
endif()
endif()
+if(CMAKE_SYSTEM_NAME MATCHES "HP-UX" AND CMAKE_CXX_COMPILER_ID MATCHES "HP")
+ # HP aCC since version 3.80 supports the flag +hpxstd98 to get ANSI C++98
+ # template support. It is known that version 6.25 doesn't need that flag.
+ # Versions prior to 3.80 will not be able to build CMake. Current assumption:
+ # it is needed for every version from 3.80 to 4 to get it working.
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4 AND
+ NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.80)
+ # use new C++ library and improved template support
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -AA +hpxstd98")
+ endif()
+endif()
+
# use the ansi CXX compile flag for building cmake
if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
@@ -68,3 +79,5 @@ endif ()
if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text._*")
endif ()
+
+include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
diff --git a/bootstrap b/bootstrap
index 69dcbce84c..45f67cf798 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1085,8 +1085,8 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
cmake_test_flags=
# If we are on HP-UX, check for -Ae for the C compiler.
- cmake_test_flags="-Ae"
if [ "x${cmake_system}" = "xHP-UX" ]; then
+ cmake_test_flags="-Ae"
TMPFILE=`cmake_tmp_file`
echo '
int main(int argc, char** argv) { (void)argc; (void)argv; return 0; }
@@ -1107,6 +1107,29 @@ if [ "x${cmake_cxx_compiler_is_gnu}" != "x1" ]; then
echo "${cmake_c_compiler} does not need ${cmake_test_flags}"
fi
rm -f "${TMPFILE}.c"
+ echo '
+ #include <iostream>
+ int main(int argc, char** argv) {
+ for(int i=0; i < 1; ++i);
+ for(int i=0; i < 1; ++i);
+ (void)argc; (void)argv; return 0; }
+' > ${TMPFILE}.cxx
+ cmake_need_AAstd98=0
+ cmake_test_flags="-AA +hpxstd98"
+ if cmake_try_run "${cmake_cxx_compiler}" "${cmake_cxx_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
+ :
+ else
+ if cmake_try_run "${cmake_cxx_compiler}" \
+ "${cmake_cxx_flags} ${cmake_test_flags}" "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then
+ cmake_need_AAstd98=1
+ fi
+ fi
+ if [ "x${cmake_need_AAstd98}" = "x1" ]; then
+ cmake_cxx_flags="${cmake_cxx_flags} ${cmake_test_flags}"
+ echo "${cmake_cxx_compiler} needs ${cmake_test_flags}"
+ else
+ echo "${cmake_cxx_compiler} does not need ${cmake_test_flags}"
+ fi
fi
cmake_test_flags=
fi