summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeFortranCompiler.cmake.in12
-rw-r--r--Modules/CMakeFortranCompilerABI.F34
2 files changed, 44 insertions, 2 deletions
diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in
index d8a9ed6..ba2b46d 100644
--- a/Modules/CMakeFortranCompiler.cmake.in
+++ b/Modules/CMakeFortranCompiler.cmake.in
@@ -30,5 +30,17 @@ ELSE(UNIX)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
+# Save compiler ABI information.
+SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
+SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
+
+IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
+ SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
+ENDIF(CMAKE_Fortran_SIZEOF_DATA_PTR)
+
+IF(CMAKE_Fortran_COMPILER_ABI)
+ SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
+ENDIF(CMAKE_Fortran_COMPILER_ABI)
+
SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
diff --git a/Modules/CMakeFortranCompilerABI.F b/Modules/CMakeFortranCompilerABI.F
index cf8662f..b8efb42 100644
--- a/Modules/CMakeFortranCompilerABI.F
+++ b/Modules/CMakeFortranCompilerABI.F
@@ -1,3 +1,33 @@
- PROGRAM CMakeFortranCompilerId
- PRINT *, 'ABI Detection Binary'
+ PROGRAM CMakeFortranCompilerABI
+#if 0
+! Address Size
+#endif
+#if defined(_LP64)
+ PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(_M_IA64)
+ PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(_M_X64)
+ PRINT *, 'INFO:sizeof_dptr[8]'
+#elif defined(_M_AMD64)
+ PRINT *, 'INFO:sizeof_dptr[8]'
+
+#elif defined(_ILP32)
+ PRINT *, 'INFO:sizeof_dptr[4]'
+#elif defined(_M_IX86)
+ PRINT *, 'INFO:sizeof_dptr[4]'
+#endif
+
+#if 0
+! Application Binary Interface
+#endif
+#if defined(__sgi) && defined(_ABIO32)
+ PRINT *, 'INFO:abi[ELF O32]'
+#elif defined(__sgi) && defined(_ABIN32)
+ PRINT *, 'INFO:abi[ELF N32]'
+#elif defined(__sgi) && defined(_ABI64)
+ PRINT *, 'INFO:abi[ELF 64]'
+#elif defined(__ELF__)
+ PRINT *, 'INFO:abi[ELF]'
+#endif
+ PRINT *, 'ABI Detection'
END