[Cmake-commits] [cmake-commits] king committed CMakeFortranCompilerId.F.in 1.1 1.2

cmake-commits at cmake.org cmake-commits at cmake.org
Tue Jul 14 15:17:01 EDT 2009


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv27535/Modules

Modified Files:
	CMakeFortranCompilerId.F.in 
Log Message:
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.


Index: CMakeFortranCompilerId.F.in
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/CMakeFortranCompilerId.F.in,v
retrieving revision 1.1
retrieving revision 1.2
diff -C 2 -d -r1.1 -r1.2
*** CMakeFortranCompilerId.F.in	25 Jun 2009 12:45:19 -0000	1.1
--- CMakeFortranCompilerId.F.in	14 Jul 2009 19:16:59 -0000	1.2
***************
*** 26,30 ****
  #elif defined(__hpux) || defined(__hpux__)
          PRINT *, 'INFO:compiler[HP]'
! #else
          PRINT *, 'INFO:compiler[]'
  #endif
--- 26,34 ----
  #elif defined(__hpux) || defined(__hpux__)
          PRINT *, 'INFO:compiler[HP]'
! #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
***************
*** 87,91 ****
  #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
          PRINT *, 'INFO:platform[Xenix]'
! #else
          PRINT *, 'INFO:platform[]'
  #endif
--- 91,99 ----
  #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
          PRINT *, 'INFO:platform[Xenix]'
! #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



More information about the Cmake-commits mailing list