fpc.cfg.5 5.9 KB

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