platform.inc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. {
  2. $Id$
  3. Include file to sort out compilers/platforms/targets
  4. Copyright (c) 1997 Balazs Scheidler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Library General Public
  7. License as published by the Free Software Foundation; either
  8. version 2 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Library General Public License for more details.
  13. You should have received a copy of the GNU Library General Public
  14. License along with this library; if not, write to the Free
  15. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. This include file defines some conditional defines to allow us to select
  18. the compiler/platform/target in a consequent way.
  19. OS_XXXX The operating system used (XXXX may be one of:
  20. DOS, OS2, Linux, Windows, Go32, FreeBSD,Linux)
  21. PPC_XXXX The compiler used: BP, FPK, Virtual, Speed
  22. BIT_XX The number of bits of the target platform: 16 or 32
  23. PROC_XXXX The mode of the target processor (Real or Protected)
  24. This shouldn't be used, except for i386 specific parts.
  25. ASM_XXXX This is the assembler type: BP, ISO-ANSI, FPK
  26. ****************************************************************************
  27. Changelog:
  28. Date Version Who Comments
  29. 02 Jul 97 0.1 Bazsi Initial implementation~
  30. 28 Aug 97 0.2 LdeB Fixed OS2 platform sort out
  31. 29 Aug 97 0.3 LdeB Added assembler type change
  32. 29 Aug 97 0.4 LdeB OS_DOS removed from Windows
  33. 23 Oct 97 0.5 LdeB Delphi & Speed compilers added
  34. 05 May 98 0.6 LdeB Virtual pascal 2.0 added
  35. 19 May 98 0.7 LdeB Delphi2/3 definitions altered
  36. 6 Aug 98 0.8 CEC/LdeB FPC only support - fixed for Win32
  37. 10 Aug 98 0.9 LdeB BP_VMTLink def/Undef for object reg.
  38. 27 Aug 98 1.0 LdeB Fixed Atari etc not $UNDEF OS_DOS.
  39. 25 Oct 98 1.1 pfv Delphi4
  40. 13 nov 00 1.2 mvdv Unix renamefest Addition of FreeBSD
  41. and change of Linux conditional
  42. meaning
  43. ****************************************************************************
  44. This is how the IFDEF and UNDEF statements below should translate.
  45. PLATFORM SYSTEM COMPILER COMP ID CPU MODE BITS ASSEMBLER
  46. -------- ------ -------- ------- -------- ---- ---------
  47. DOS OS_DOS BP/TP7 PPC_BP PROC_Real BIT_16 ASM_BP
  48. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  49. DPMI OS_DOS BP/TP7 PPC_BP PROC_Protected BIT_16 ASM_BP
  50. LINUX OS_LINUX FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  51. FREEBSD OS_FREEBSD FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  52. WINDOWS OS_WINDOWS BP/TP7 PPC_BP PROC_Protected BIT_16 ASM_BP
  53. DELPHI PPC_DELPHI PROC_Protected BIT_16 ASM_BP
  54. DELPHI2 PPC_DELPHI&2 PROC_Protected BIT_16 ASM_BP
  55. WIN95/NT OS_WINDOWS DELPHI2 PPC_DELPHI&2 PROC_Protected BIT_32 ASM_BP
  56. DELPHI3 PPC_DELPHI&3 PROC_Protected BIT_32 ASM_BP
  57. DELPHI4 PPC_DELPHI&3 PROC_Protected BIT_32 ASM_BP
  58. VIRTUAL PPC_VIRTUAL PROC_Protected BIT 32 ASM_BP
  59. OS2 OS_OS2 BPOS2 PPC_BPOS2 PROC_Protected BIT_16 ASM_BP
  60. VIRTUAL PPC_VIRTUAL PROC_Protected BIT_32 ASM_BP
  61. SPEED PPC_SPEED PROC_Protected BIT_32 ASM_BP
  62. FPC PPC_FPC PROC_Protected BIT_32 ASM_FPC
  63. ****************************************************************************}
  64. {****************************************************************************
  65. FOR ALL COMPILERS BP_VMTLink will be defined but FPC and Delphi3 undefine it
  66. ****************************************************************************}
  67. {****************************************************************************
  68. FOR FPC THESE ARE THE TRANSLATIONS
  69. PLATFORM SYSTEM COMPILER HANDLE SIZE ASM CPU
  70. -------- ------ -------- ----------- ---- ---
  71. DOS OS_DOS,
  72. OS_GO32 FPC 32-bit AT&T CPU86
  73. WIN32 OS_WINDOWS FPC 32-bit AT&T ----
  74. LINUX OS_LINUX,
  75. OS_UNIX FPC 32-bit AT&T ----
  76. FREEBSD OS_FREEBSD,
  77. OS_BSD,
  78. OS_UNIX FPC 32-bit AT&T ----
  79. OS2 OS_OS2 FPC ????? AT&T CPU86
  80. ATARI OS_ATARI FPC 32-bit Internal CPU68
  81. MACOS OS_MAC FPC ????? Internal CPU68
  82. AMIGA OS_AMIGA FPC 32-bit Internal CPU68
  83. Note: All Unices have OS_UNIX in common. All BSD's (Open,Net,Free) have
  84. OS_BSD in common.
  85. ****************************************************************************}
  86. {---------------------------------------------------------------------------}
  87. { Initial assume BORLAND 16 BIT DOS COMPILER - Updated 27Aug98 LdB }
  88. {---------------------------------------------------------------------------}
  89. {$DEFINE OS_DOS}
  90. {$DEFINE PROC_Real}
  91. {$DEFINE BIT_16}
  92. {$DEFINE PPC_BP}
  93. {$DEFINE ASM_BP}
  94. {$DEFINE BP_VMTLink}
  95. {---------------------------------------------------------------------------}
  96. { BORLAND 16 BIT DPMI changes protected mode - Updated 27Aug98 LdB }
  97. {---------------------------------------------------------------------------}
  98. {$IFDEF DPMI}
  99. {$UNDEF PROC_Real}
  100. {$DEFINE PROC_Protected}
  101. {$ENDIF}
  102. {---------------------------------------------------------------------------}
  103. { FPC 32 BIT COMPILER changes ASM, 32 bits etc - Updated 27Aug98 LdB }
  104. {---------------------------------------------------------------------------}
  105. {$IFDEF FPC}
  106. {$UNDEF PROC_Real}
  107. {$DEFINE PROC_Protected}
  108. {$UNDEF BIT_16}
  109. {$DEFINE BIT_32}
  110. {$UNDEF PPC_BP}
  111. {$DEFINE PPC_FPC}
  112. {$UNDEF ASM_BP}
  113. {$DEFINE ASM_FPC}
  114. {$UNDEF BP_VMTLink}
  115. {$ENDIF}
  116. {---------------------------------------------------------------------------}
  117. { FPC LINUX COMPILER changes operating system - Updated 12nov00 MvdV }
  118. { Note: Other linux compilers would need to change other details }
  119. {---------------------------------------------------------------------------}
  120. {$IFDEF UNIX}
  121. {$UNDEF OS_DOS}
  122. {$DEFINE OS_UNIX}
  123. {$IFNDEF BSD} {Work around. BSD still defines "linux"
  124. in 1.1 for now}
  125. {$DEFINE OS_LINUX}
  126. {$ELSE}
  127. {$DEFINE OS_FREEBSD}
  128. {$DEFINE OS_BSD}
  129. {$ENDIF}
  130. {$ENDIF}
  131. {---------------------------------------------------------------------------}
  132. { FPC GO32V2 COMPILER changes operating system - Updated 27Aug98 LdB }
  133. {---------------------------------------------------------------------------}
  134. {$IFDEF GO32V2}
  135. {$DEFINE OS_GO32}
  136. {$ENDIF}
  137. {---------------------------------------------------------------------------}
  138. { 32 BIT WINDOWS COMPILERS changes bit size - Updated 27Aug98 LdB }
  139. {---------------------------------------------------------------------------}
  140. {$IFDEF WIN32}
  141. {$IFNDEF WINDOWS}
  142. {$DEFINE WINDOWS}
  143. {$ENDIF}
  144. {$UNDEF BIT_16}
  145. {$DEFINE BIT_32}
  146. {$ENDIF}
  147. {---------------------------------------------------------------------------}
  148. { WINDOWS COMPILERS change op system and proc mode - Updated 27Aug98 LdB }
  149. {---------------------------------------------------------------------------}
  150. {$IFDEF WINDOWS}
  151. {$UNDEF OS_DOS}
  152. {$DEFINE OS_WINDOWS}
  153. {$UNDEF PROC_Real}
  154. {$DEFINE PROC_Protected}
  155. {$ENDIF}
  156. {---------------------------------------------------------------------------}
  157. { DELPHI1 COMPILER changes compiler type - Updated 27Aug98 LdB }
  158. {---------------------------------------------------------------------------}
  159. {$IFDEF VER80}
  160. {$UNDEF PPC_BP}
  161. {$DEFINE PPC_DELPHI}
  162. {$ENDIF}
  163. {---------------------------------------------------------------------------}
  164. { DELPHI2 COMPILER changes compiler type - Updated 27Aug98 LdB }
  165. {---------------------------------------------------------------------------}
  166. {$IFDEF VER90}
  167. {$UNDEF PPC_BP}
  168. {$DEFINE PPC_DELPHI}
  169. {$DEFINE PPC_DELPHI2}
  170. {$ENDIF}
  171. {---------------------------------------------------------------------------}
  172. { DELPHI3 COMPILER changes compiler type - Updated 27Aug98 LdB }
  173. {---------------------------------------------------------------------------}
  174. {$IFDEF VER100}
  175. {$UNDEF PPC_BP}
  176. {$DEFINE PPC_DELPHI}
  177. {$DEFINE PPC_DELPHI3}
  178. {$UNDEF BP_VMTLink}
  179. {$ENDIF}
  180. {---------------------------------------------------------------------------}
  181. { DELPHI4 COMPILER changes compiler type - Updated 25Oct98 pfv }
  182. {---------------------------------------------------------------------------}
  183. {$IFDEF VER120}
  184. {$UNDEF PPC_BP}
  185. {$DEFINE PPC_DELPHI}
  186. {$DEFINE PPC_DELPHI3}
  187. {$DEFINE PPC_DELPHI4}
  188. {$UNDEF BP_VMTLink}
  189. {$ENDIF}
  190. {---------------------------------------------------------------------------}
  191. { OS2 COMPILERS change compiler type and mode - Updated 27Aug98 LdB }
  192. { Note: Assumes BPOS2 16BIT OS2 patch except for FPC which undefines this }
  193. {---------------------------------------------------------------------------}
  194. {$IFDEF OS2}
  195. {$UNDEF OS_DOS}
  196. {$DEFINE OS_OS2}
  197. {$UNDEF PROC_Real}
  198. {$DEFINE PROC_Protected}
  199. {$UNDEF PPC_BP}
  200. {$DEFINE PPC_BPOS2}
  201. {$IFDEF FPC}
  202. {$UNDEF PPC_BPOS2}
  203. {$ENDIF}
  204. {$ENDIF}
  205. {---------------------------------------------------------------------------}
  206. { VIRTUAL PASCAL changes compiler type/32 bit - Updated 27Aug98 LdB }
  207. { Note: VP2 can compile win 32 code so changes op system as needed }
  208. {---------------------------------------------------------------------------}
  209. {$IFDEF VirtualPascal}
  210. {$UNDEF BIT_16}
  211. {$DEFINE BIT_32}
  212. {$IFDEF PPC_BPOS2}
  213. {$UNDEF PPC_BPOS2}
  214. {$ENDIF}
  215. {$DEFINE PPC_VIRTUAL}
  216. {$IFDEF WIN32}
  217. {$UNDEF PPC_BP}
  218. {$UNDEF OS_OS2}
  219. {$DEFINE OS_WINDOWS}
  220. {$ENDIF}
  221. {$ENDIF}
  222. {---------------------------------------------------------------------------}
  223. { SPEED COMPILER changes compiler type/32 bit - Updated 27Aug98 LdB }
  224. {---------------------------------------------------------------------------}
  225. {$IFDEF Speed}
  226. {$UNDEF BIT_16}
  227. {$DEFINE BIT_32}
  228. {$UNDEF PPC_BPOS2}
  229. {$DEFINE PPC_SPEED}
  230. {$ENDIF}
  231. {---------------------------------------------------------------------------}
  232. { FPC AMIGA COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  233. {---------------------------------------------------------------------------}
  234. {$IFDEF AMIGA}
  235. {$UNDEF OS_DOS}
  236. {$DEFINE OS_AMIGA}
  237. {$IFDEF CPU86}
  238. {$UNDEF CPU86}
  239. {$ENDIF}
  240. {$IFNDEF CPU68}
  241. {$DEFINE CPU68}
  242. {$ENDIF}
  243. {$ENDIF}
  244. {---------------------------------------------------------------------------}
  245. { FPC ATARI COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  246. {---------------------------------------------------------------------------}
  247. {$IFDEF ATARI}
  248. {$UNDEF OS_DOS}
  249. {$DEFINE OS_ATARI}
  250. {$IFDEF CPU86}
  251. {$UNDEF CPU86}
  252. {$ENDIF}
  253. {$IFNDEF CPU68}
  254. {$DEFINE CPU68}
  255. {$ENDIF}
  256. {$ENDIF}
  257. {---------------------------------------------------------------------------}
  258. { FPC MAC COMPILER changes op system and CPU type - Updated 27Aug98 LdB }
  259. {---------------------------------------------------------------------------}
  260. {$IFDEF MACOS}
  261. {$UNDEF OS_DOS}
  262. {$DEFINE OS_MAC}
  263. {$IFDEF CPU86}
  264. {$UNDEF CPU86}
  265. {$ENDIF}
  266. {$IFNDEF CPU68}
  267. {$DEFINE CPU68}
  268. {$ENDIF}
  269. {$ENDIF}
  270. {
  271. $Log$
  272. Revision 1.3 2000-11-13 14:35:57 marco
  273. * Unix Renamefest for defines.
  274. Revision 1.2 2000/07/13 11:32:24 michael
  275. + removed logs
  276. }