summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeFortranCompilerId.F.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-07-14 19:16:59 (GMT)
committerBrad King <brad.king@kitware.com>2009-07-14 19:16:59 (GMT)
commiteff381185a1d95ba365ce7897b733af892c708d6 (patch)
treebf601cb8ba774c041aa99e58fb2b2fe667afea90 /Modules/CMakeFortranCompilerId.F.in
parent1e20be319f75dd936b9e057c4de7f3dc5526cee9 (diff)
downloadCMake-eff381185a1d95ba365ce7897b733af892c708d6.zip
CMake-eff381185a1d95ba365ce7897b733af892c708d6.tar.gz
CMake-eff381185a1d95ba365ce7897b733af892c708d6.tar.bz2
BUG: Avoid SGI preprocessor bug for Fortran Id
The SGI preprocessor /usr/lib/cpp produces bad output on this code: #if 1 A #elif 1 B #else C #endif Both 'A' and 'C' appear in the output! We work around the problem by using '#elif 1' instead of '#else'. This fixes detection of the SGI Fortran compiler id in -o32 mode.
Diffstat (limited to 'Modules/CMakeFortranCompilerId.F.in')
-rw-r--r--Modules/CMakeFortranCompilerId.F.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/Modules/CMakeFortranCompilerId.F.in b/Modules/CMakeFortranCompilerId.F.in
index 74e2cd5..a01dc81 100644
--- a/Modules/CMakeFortranCompilerId.F.in
+++ b/Modules/CMakeFortranCompilerId.F.in
@@ -25,7 +25,11 @@
PRINT *, 'INFO:compiler[MIPSpro]'
#elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:compiler[HP]'
-#else
+#elif 1
+# if 0
+! The above 'elif 1' instead of 'else' is to work around a bug in the
+! SGI preprocessor which produces both the __sgi and else blocks.
+# endif
PRINT *, 'INFO:compiler[]'
#endif
@@ -86,7 +90,11 @@
PRINT *, 'INFO:platform[ULTRIX]'
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
PRINT *, 'INFO:platform[Xenix]'
-#else
+#elif 1
+# if 0
+! The above 'elif 1' instead of 'else' is to work around a bug in the
+! SGI preprocessor which produces both the __sgi and else blocks.
+# endif
PRINT *, 'INFO:platform[]'
#endif
END