From 4ee1ee1bd0d6b19feb5846bfeccdc39a90d52ac8 Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Mon, 17 Sep 2007 15:55:17 -0400 Subject: [PATCH] ENH: add support for the Portland Compiler to CMake, can build cmake and the tests pass (except the wrapping tests, which fail to link to the g++-compiled Qt) Alex --- CMakeLists.txt | 4 ++-- Modules/CMakeCCompilerId.c | 3 +++ Modules/CMakeCXXCompilerId.cpp | 3 +++ Modules/Platform/Linux-PGI-C.cmake | 5 +++++ Modules/Platform/Linux-PGI-CXX.cmake | 4 ++++ Source/kwsys/Directory.cxx | 9 +++++++++ 6 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 Modules/Platform/Linux-PGI-C.cmake create mode 100644 Modules/Platform/Linux-PGI-CXX.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9aec580fb..43d6e77c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -406,9 +406,9 @@ CMAKE_BUILD_UTILITIES() IF(BUILD_CursesDialog) GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH) SET(CURSES_NEED_RPATH FALSE) - IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib") + IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") SET(CURSES_NEED_RPATH TRUE) - ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib") + ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") ENDIF(BUILD_CursesDialog) # The same might be true on other systems for other libraries if diff --git a/Modules/CMakeCCompilerId.c b/Modules/CMakeCCompilerId.c index f88f57e0f..ec11b6c1b 100644 --- a/Modules/CMakeCCompilerId.c +++ b/Modules/CMakeCCompilerId.c @@ -27,6 +27,9 @@ #elif defined(__IBMC__) # define COMPILER_ID "VisualAge" +#elif defined(__PGI) +# define COMPILER_ID "PGI" + #elif defined(__GNUC__) # define COMPILER_ID "GNU" diff --git a/Modules/CMakeCXXCompilerId.cpp b/Modules/CMakeCXXCompilerId.cpp index 1f714d953..86d65bde6 100644 --- a/Modules/CMakeCXXCompilerId.cpp +++ b/Modules/CMakeCXXCompilerId.cpp @@ -29,6 +29,9 @@ #elif defined(__IBMCPP__) # define COMPILER_ID "VisualAge" +#elif defined(__PGI) +# define COMPILER_ID "PGI" + #elif defined(__GNUC__) # define COMPILER_ID "GNU" diff --git a/Modules/Platform/Linux-PGI-C.cmake b/Modules/Platform/Linux-PGI-C.cmake new file mode 100644 index 000000000..104e3dcca --- /dev/null +++ b/Modules/Platform/Linux-PGI-C.cmake @@ -0,0 +1,5 @@ +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + +SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") +SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") + diff --git a/Modules/Platform/Linux-PGI-CXX.cmake b/Modules/Platform/Linux-PGI-CXX.cmake new file mode 100644 index 000000000..1d8c92a3f --- /dev/null +++ b/Modules/Platform/Linux-PGI-CXX.cmake @@ -0,0 +1,4 @@ +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") + +SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE " -E > ") +SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index bc775e944..00ee7e1ed 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -193,6 +193,15 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const char* name) #include #include +/* There is a problem with the Portland compiler, large file +support and glibc/Linux system headers: +http://www.pgroup.com/userforum/viewtopic.php? +p=1992&sid=f16167f51964f1a68fe5041b8eb213b6 +*/ +#if defined(__PGI) && defined(__USE_FILE_OFFSET64) +# define dirent dirent64 +#endif + namespace KWSYS_NAMESPACE {