fpc.cfg.5 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. .TH fpc.cfg 5 "22 february 2002" FPC "FPC configuration file"
  2. .SH NAME
  3. fpc.cfg \- Free Pascal Compiler (FPC) configuration file, name derived from Free Pascal Compiler.
  4. .SH DESCRIPTION
  5. This is the main configuration file of the
  6. .I Free Pascal Compiler (FPC)
  7. .PP
  8. All commandline options of the compiler (described in
  9. .BR fpc (1)
  10. ) can be specified in fpc.cfg
  11. When the configuration file is found, it is read, and the lines
  12. it contains are treated like you typed them on the command line see
  13. .BR fpc (1)
  14. with some extra condtional possibilities.
  15. .SH SYNTAX
  16. You can specify comments in the configuration file with the # sign.
  17. Everything from the # on will be ignored, unless it is one of the keywords (see below).
  18. The compiler looks for the fpc.cfg file in the following places :
  19. .PP
  20. \ \fI\- Under Linux and unix\fP
  21. .br
  22. \ \ \- The current directory.
  23. .br
  24. \ \ \- Home directory, looks for .fpc.cfg
  25. .br
  26. \ \ \- The directory specified in the environment
  27. .br
  28. \ \ variable PPC\_CONFIG\_PATH, and if it's not
  29. .br
  30. \ \ set under compilerdir/../etc.
  31. .br
  32. \ \ \- If it is not yet found: in /etc.
  33. .PP
  34. \ \fI- Under all other OSes:\fP
  35. .br
  36. \ \ \- The current directory.
  37. .br
  38. \ \ \- The directory specified in the environment
  39. .br
  40. \ \ variable PPC\_CONFIG\_PATH.
  41. .br
  42. \ \ \- The directory where the compiler binary is.
  43. .br
  44. .PP
  45. When the compiler has finished reading the configuration file, it continues
  46. to treat the command line options.
  47. One of the command\-line options allows you to specify a second configuration
  48. file: Specifying \@foo on the command line will use file foo instead of fpc.cfg
  49. and read further options from there. When the compiler has finished reading
  50. this file, it continues to process the command line.
  51. The configuration file allows some kind of preprocessing. It understands the
  52. following directives, which you should place on the first column of a line :
  53. .PP
  54. \ #IFDEF
  55. .br
  56. \ #IFNDEF
  57. .br
  58. \ #ELSE
  59. .br
  60. \ #ENDIF
  61. .br
  62. \ #DEFINE
  63. .br
  64. \ #UNDEF
  65. .br
  66. \ #WRITE
  67. .br
  68. \ #INCLUDE
  69. .br
  70. \ #SECTION
  71. .br
  72. They work the same way as their $... directive counterparts in Pascal:
  73. .IP \fI#IFDEF\fP
  74. .RS
  75. .IP \fISyntax\fP
  76. #IFDEF name
  77. Lines following #IFDEF are skipped read if the keyword "name"
  78. following it is not defined.
  79. They are read until the keywords #ELSE or #ENDIF are
  80. encountered, after which normal processing is resumed.
  81. .IP \fIExample\fP
  82. #IFDEF VER0_99_12
  83. .br
  84. \-Fu/usr/lib/fpc/0.99.12/rtl
  85. .br
  86. #ENDIF
  87. .br
  88. .PP
  89. In the above example, /usr/lib/fpc/0.99.12/rtl will be added to
  90. the path if you're compiling with version 0.99.12 of the compiler.
  91. .RE
  92. .IP \fI#IFNDEF\fP
  93. .RS
  94. .IP \fISyntax\fP
  95. #IFNDEF name
  96. Lines following #IFDEF are skipped read if the keyword "name"
  97. following it is defined.
  98. They are read until the keywords #ELSE or #ENDIF are
  99. encountered, after which normal processing is resumed.
  100. .IP \fIExample\fP
  101. #IFNDEF VER0_99_12
  102. .br
  103. -Fu/usr/lib/fpc/0.99.13/rtl
  104. .br
  105. #ENDIF
  106. .PP
  107. In the above example, /usr/lib/fpc/0.99.13/rtl will be added to
  108. the path if you're NOT compiling with version 0.99.12 of the compiler.
  109. .RE
  110. .IP \fI#ELSE\fP
  111. .RS
  112. .IP \fISyntax\fP
  113. #ELSE
  114. #ELSE can be specified after a #IFDEF or #IFNDEF
  115. directive as an alternative.
  116. Lines following #ELSE are skipped read if the preceding #IFDEF
  117. #IFNDEF was accepted.
  118. They are skipped until the keyword #ENDIF is
  119. encountered, after which normal processing is resumed.
  120. .IP \fIExample\fP
  121. #IFDEF VER0_99_12
  122. .br
  123. -Fu/usr/lib/fpc/0.99.12/rtl
  124. .br
  125. #ELSE
  126. .br
  127. -Fu/usr/lib/fpc/0.99.13/rtl
  128. .br
  129. #ENDIF
  130. .br
  131. .PP
  132. In the above example, /usr/lib/fpc/0.99.12/rtl will be added to
  133. the path if you're compiling with version 0.99.12 of the compiler,
  134. otherwise /usr/lib/fpc/0.99.13/rtl will be added to the path.
  135. .RE
  136. .IP \fI#ENDIF\fP
  137. .RS
  138. .IP \fISyntax\fP
  139. #ENDIF
  140. .PP
  141. #ENDIF marks the end of a block that started with #IF(N)DEF,
  142. possibly with an #ELSE between it.
  143. .RE
  144. .IP \fI#DEFINE\fP
  145. .RS
  146. .IP \fISyntax\fP
  147. #DEFINE name
  148. .PP
  149. #DEFINE defines a new keyword. This has the same effect as a
  150. "\-dname" command\-line option.
  151. .RE
  152. .IP \fI#UNDEF\fP
  153. .RS
  154. .IP \fISyntax\fP
  155. #UNDEF name
  156. #UNDEF un-defines a keyword if it existed.
  157. This has the same effect as a "-uname" command-line option.
  158. .RE
  159. .IP \fI#WRITE\fP
  160. .RS
  161. .IP \fISyntax\fP
  162. #WRITE Message Text
  163. #WRITE writes "Message Text" to the screen.
  164. This can be useful to display warnings if certain options are set.
  165. .IP \fIExample\fP
  166. #IFDEF DEBUG
  167. .br
  168. #WRITE Setting debugging ON...
  169. .br
  170. -g
  171. .br
  172. #ENDIF
  173. .br
  174. .PP
  175. if "DEBUG is defined, this will produce a line
  176. Setting debugging ON...
  177. and will then switch on debugging information in the compiler.
  178. .RE
  179. .IP \fI#INCLUDE\fP
  180. .RS
  181. .IP \fISyntax\fP
  182. #INCLUDE filename
  183. #INCLUDE instructs the compiler to read the contents of
  184. "filename" before continuing to process options in the current file.
  185. This can be useful if you want to have a particular configuration file
  186. for a project (or, under Unix like systems (such as Linux), in
  187. your home directory), but still want to have the global options that are
  188. set in a global configuration file.
  189. .IP \fIExample\fP
  190. #IFDEF LINUX
  191. .br
  192. #INCLUDE /etc/fpc.cfg
  193. .br
  194. #ELSE
  195. .br
  196. #IFDEF GO32V2
  197. .br
  198. #INCLUDE c:\\pp\\bin\\fpc.cfg
  199. .br
  200. #ENDIF
  201. .br
  202. #ENDIF
  203. .br
  204. .PP
  205. This will include /etc/fpc.cfg if you're on a unix like machine (like linux),
  206. and will include c:\\pp\\bin\\fpc.cfg on a dos machine.
  207. .RE
  208. .IP \fI#SECTION\fP
  209. .RS
  210. .IP \fISyntax\fP
  211. #SECTION name
  212. The #SECTION directive acts as a #IFDEF directive, only
  213. it doesn't require an #ENDIF directive. the special name COMMON
  214. always exists, i.e. lines following #SECTION COMMON are always read.
  215. .RE
  216. .SH Example
  217. A standard block often used in (the Linux version of) fpc.cfg is
  218. -vwhin
  219. .br
  220. #IFDEF VER0_99_12
  221. .br
  222. #IFDEF FPC_LINK_STATIC
  223. .br
  224. \-Fu/usr/lib/fpc/0.99.12/rtl/static
  225. .br
  226. \-Fu/usr/lib/fpc/0.99.12/units/static
  227. .br
  228. #ENDIF
  229. .br
  230. #IFDEF FPC_LINK_DYNAMIC
  231. .br
  232. \-Fu/usr/lib/fpc/0.99.12/rtl/shared
  233. .br
  234. \-Fu/usr/lib/fpc/0.99.12/units/shared
  235. .br
  236. #ENDIF
  237. .br
  238. \-Fu/usr/lib/fpc/0.99.12/rtl
  239. .br
  240. \-Fu/usr/lib/fpc/0.99.12/units
  241. .br
  242. #ENDIF
  243. .PP
  244. The block is copied into the fpc.cfg file for each version you use (normally
  245. the latest release and the lastest developpers
  246. snapshot.
  247. .SH SEE ALSO
  248. .BR fpc (1)