From 115ecc5750deff688d580b48223d865ef8c9bf4c Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 7 Aug 2009 10:13:07 -0400 Subject: Teach compiler id about VisualAge -> XL rebranding IBM rebranded its VisualAge compiler to XL starting at version 8.0. We use the compiler id "XL" for newer versions and "VisualAge" for older versions. We now also recognize the "z/OS" compiler, which is distinct from XL. --- Modules/CMakeCCompilerId.c.in | 8 +++++++- Modules/CMakeCXXCompilerId.cpp.in | 8 +++++++- Modules/CMakeFortranCompilerId.F.in | 8 +++++++- Modules/Compiler/VisualAge-C.cmake | 2 +- Modules/Compiler/VisualAge-CXX.cmake | 2 +- Modules/Compiler/VisualAge-Fortran.cmake | 3 +-- Modules/Compiler/XL-C.cmake | 1 + Modules/Compiler/XL-CXX.cmake | 1 + Modules/Compiler/XL-Fortran.cmake | 2 ++ Modules/Platform/Linux-VisualAge-C.cmake | 3 +-- Modules/Platform/Linux-VisualAge-Fortran.cmake | 3 +-- Modules/Platform/Linux-XL-C.cmake | 2 ++ Modules/Platform/Linux-XL-Fortran.cmake | 2 ++ 13 files changed, 34 insertions(+), 11 deletions(-) create mode 100644 Modules/Compiler/XL-C.cmake create mode 100644 Modules/Compiler/XL-CXX.cmake create mode 100644 Modules/Compiler/XL-Fortran.cmake create mode 100644 Modules/Platform/Linux-XL-C.cmake create mode 100644 Modules/Platform/Linux-XL-Fortran.cmake diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 7a0a39d..a999e8d 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -25,7 +25,13 @@ # define COMPILER_ID "Compaq" #elif defined(__IBMC__) -# define COMPILER_ID "VisualAge" +# if defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" +# elif __IBMC__ >= 800 +# define COMPILER_ID "XL" +# else +# define COMPILER_ID "VisualAge" +# endif #elif defined(__PGI) # define COMPILER_ID "PGI" diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 77a6247..2c8aa3c 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -27,7 +27,13 @@ # define COMPILER_ID "Compaq" #elif defined(__IBMCPP__) -# define COMPILER_ID "VisualAge" +# if defined(__COMPILER_VER__) +# define COMPILER_ID "zOS" +# elif __IBMCPP__ >= 800 +# define COMPILER_ID "XL" +# else +# define COMPILER_ID "VisualAge" +# endif #elif defined(__PGI) # define COMPILER_ID "PGI" diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in index 63d3e43..51f4e91 100644 --- a/Modules/CMakeFortranCompilerId.F.in +++ b/Modules/CMakeFortranCompilerId.F.in @@ -8,8 +8,14 @@ PRINT *, 'INFO:compiler[SunPro]' #elif defined(__GNUC__) PRINT *, 'INFO:compiler[GNU]' -#elif defined(__IBM__) || defined(__IBMC__) +#elif defined(__IBMC__) +# if defined(__COMPILER_VER__) + PRINT *, 'INFO:compiler[zOS]' +# elif __IBMC__ >= 800 + PRINT *, 'INFO:compiler[XL]' +# else PRINT *, 'INFO:compiler[VisualAge]' +# endif #elif defined(__PGI) PRINT *, 'INFO:compiler[PGI]' #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) diff --git a/Modules/Compiler/VisualAge-C.cmake b/Modules/Compiler/VisualAge-C.cmake index 3120478..40b609e 100644 --- a/Modules/Compiler/VisualAge-C.cmake +++ b/Modules/Compiler/VisualAge-C.cmake @@ -1 +1 @@ -SET(CMAKE_C_VERBOSE_FLAG "-V") +include(Compiler/XL-C) diff --git a/Modules/Compiler/VisualAge-CXX.cmake b/Modules/Compiler/VisualAge-CXX.cmake index 618ff5a..2509b43 100644 --- a/Modules/Compiler/VisualAge-CXX.cmake +++ b/Modules/Compiler/VisualAge-CXX.cmake @@ -1 +1 @@ -SET(CMAKE_CXX_VERBOSE_FLAG "-V") +include(Compiler/XL-CXX) diff --git a/Modules/Compiler/VisualAge-Fortran.cmake b/Modules/Compiler/VisualAge-Fortran.cmake index 49d6bb2..3ef3178 100644 --- a/Modules/Compiler/VisualAge-Fortran.cmake +++ b/Modules/Compiler/VisualAge-Fortran.cmake @@ -1,2 +1 @@ -SET(CMAKE_Fortran_VERBOSE_FLAG "-V") -SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D") +include(Compiler/XL-Fortran) diff --git a/Modules/Compiler/XL-C.cmake b/Modules/Compiler/XL-C.cmake new file mode 100644 index 0000000..3120478 --- /dev/null +++ b/Modules/Compiler/XL-C.cmake @@ -0,0 +1 @@ +SET(CMAKE_C_VERBOSE_FLAG "-V") diff --git a/Modules/Compiler/XL-CXX.cmake b/Modules/Compiler/XL-CXX.cmake new file mode 100644 index 0000000..618ff5a --- /dev/null +++ b/Modules/Compiler/XL-CXX.cmake @@ -0,0 +1 @@ +SET(CMAKE_CXX_VERBOSE_FLAG "-V") diff --git a/Modules/Compiler/XL-Fortran.cmake b/Modules/Compiler/XL-Fortran.cmake new file mode 100644 index 0000000..49d6bb2 --- /dev/null +++ b/Modules/Compiler/XL-Fortran.cmake @@ -0,0 +1,2 @@ +SET(CMAKE_Fortran_VERBOSE_FLAG "-V") +SET(CMAKE_Fortran_DEFINE_FLAG "-WF,-D") diff --git a/Modules/Platform/Linux-VisualAge-C.cmake b/Modules/Platform/Linux-VisualAge-C.cmake index 295226b..0622b63 100644 --- a/Modules/Platform/Linux-VisualAge-C.cmake +++ b/Modules/Platform/Linux-VisualAge-C.cmake @@ -1,2 +1 @@ -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") -SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +include(Platform/Linux-XL-C) diff --git a/Modules/Platform/Linux-VisualAge-Fortran.cmake b/Modules/Platform/Linux-VisualAge-Fortran.cmake index 295226b..1939a8a 100644 --- a/Modules/Platform/Linux-VisualAge-Fortran.cmake +++ b/Modules/Platform/Linux-VisualAge-Fortran.cmake @@ -1,2 +1 @@ -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") -SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +include(Platform/Linux-XL-Fortran) diff --git a/Modules/Platform/Linux-XL-C.cmake b/Modules/Platform/Linux-XL-C.cmake new file mode 100644 index 0000000..08370e2 --- /dev/null +++ b/Modules/Platform/Linux-XL-C.cmake @@ -0,0 +1,2 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") diff --git a/Modules/Platform/Linux-XL-Fortran.cmake b/Modules/Platform/Linux-XL-Fortran.cmake new file mode 100644 index 0000000..08370e2 --- /dev/null +++ b/Modules/Platform/Linux-XL-Fortran.cmake @@ -0,0 +1,2 @@ +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") +SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -- cgit v0.12