CMakeFortranCompilerId.F.in 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. PROGRAM CMakeFortranCompilerId
  2. #if 0
  3. ! Identify the compiler
  4. #endif
  5. #if defined(__INTEL_COMPILER) || defined(__ICC)
  6. PRINT *, 'INFO:compiler[Intel]'
  7. #elif defined(__SUNPRO_F90) || defined(__SUNPRO_F95)
  8. PRINT *, 'INFO:compiler[SunPro]'
  9. #elif defined(__G95__)
  10. PRINT *, 'INFO:compiler[G95]'
  11. #elif defined(__PATHSCALE__)
  12. PRINT *, 'INFO:compiler[PathScale]'
  13. #elif defined(__GNUC__)
  14. PRINT *, 'INFO:compiler[GNU]'
  15. #elif defined(__IBMC__)
  16. # if defined(__COMPILER_VER__)
  17. PRINT *, 'INFO:compiler[zOS]'
  18. # elif __IBMC__ >= 800
  19. PRINT *, 'INFO:compiler[XL]'
  20. # else
  21. PRINT *, 'INFO:compiler[VisualAge]'
  22. # endif
  23. #elif defined(__PGI)
  24. PRINT *, 'INFO:compiler[PGI]'
  25. #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
  26. PRINT *, 'INFO:compiler[MIPSpro]'
  27. # if 0
  28. ! This compiler is either not known or is too old to define an
  29. ! identification macro. Try to identify the platform and guess that
  30. ! it is the native compiler.
  31. # endif
  32. #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
  33. PRINT *, 'INFO:compiler[VisualAge]'
  34. #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
  35. PRINT *, 'INFO:compiler[MIPSpro]'
  36. #elif defined(__hpux) || defined(__hpux__)
  37. PRINT *, 'INFO:compiler[HP]'
  38. #elif 1
  39. # if 0
  40. ! The above 'elif 1' instead of 'else' is to work around a bug in the
  41. ! SGI preprocessor which produces both the __sgi and else blocks.
  42. # endif
  43. PRINT *, 'INFO:compiler[]'
  44. #endif
  45. #if 0
  46. ! Identify the platform
  47. #endif
  48. #if defined(__linux) || defined(__linux__) || defined(linux)
  49. PRINT *, 'INFO:platform[Linux]'
  50. #elif defined(__CYGWIN__)
  51. PRINT *, 'INFO:platform[Cygwin]'
  52. #elif defined(__MINGW32__)
  53. PRINT *, 'INFO:platform[MinGW]'
  54. #elif defined(__APPLE__)
  55. PRINT *, 'INFO:platform[Darwin]'
  56. #elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
  57. PRINT *, 'INFO:platform[Windows]'
  58. #elif defined(__FreeBSD__) || defined(__FreeBSD)
  59. PRINT *, 'INFO:platform[FreeBSD]'
  60. #elif defined(__NetBSD__) || defined(__NetBSD)
  61. PRINT *, 'INFO:platform[NetBSD]'
  62. #elif defined(__OpenBSD__) || defined(__OPENBSD)
  63. PRINT *, 'INFO:platform[OpenBSD]'
  64. #elif defined(__sun) || defined(sun)
  65. PRINT *, 'INFO:platform[SunOS]'
  66. #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
  67. PRINT *, 'INFO:platform[AIX]'
  68. #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
  69. PRINT *, 'INFO:platform[IRIX]'
  70. #elif defined(__hpux) || defined(__hpux__)
  71. PRINT *, 'INFO:platform[HP-UX]'
  72. #elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
  73. PRINT *, 'INFO:platform[Haiku]'
  74. # if 0
  75. ! Haiku also defines __BEOS__ so we must
  76. ! put it prior to the check for __BEOS__
  77. # endif
  78. #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
  79. PRINT *, 'INFO:platform[BeOS]'
  80. #elif defined(__QNX__) || defined(__QNXNTO__)
  81. PRINT *, 'INFO:platform[QNX]'
  82. #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
  83. PRINT *, 'INFO:platform[Tru64]'
  84. #elif defined(__riscos) || defined(__riscos__)
  85. PRINT *, 'INFO:platform[RISCos]'
  86. #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
  87. PRINT *, 'INFO:platform[SINIX]'
  88. #elif defined(__UNIX_SV__)
  89. PRINT *, 'INFO:platform[UNIX_SV]'
  90. #elif defined(__bsdos__)
  91. PRINT *, 'INFO:platform[BSDOS]'
  92. #elif defined(_MPRAS) || defined(MPRAS)
  93. PRINT *, 'INFO:platform[MP-RAS]'
  94. #elif defined(__osf) || defined(__osf__)
  95. PRINT *, 'INFO:platform[OSF1]'
  96. #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
  97. PRINT *, 'INFO:platform[SCO_SV]'
  98. #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
  99. PRINT *, 'INFO:platform[ULTRIX]'
  100. #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
  101. PRINT *, 'INFO:platform[Xenix]'
  102. #elif 1
  103. # if 0
  104. ! The above 'elif 1' instead of 'else' is to work around a bug in the
  105. ! SGI preprocessor which produces both the __sgi and else blocks.
  106. # endif
  107. PRINT *, 'INFO:platform[]'
  108. #endif
  109. END