fpc.1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. .TH fpc 1 "23 nov 2001" "Free Pascal" "Free Pascal Compiler"
  2. .SH NAME
  3. fpc \- Free Pascal Compiler (FPC) binary
  4. .SH SYNOPSIS
  5. .B "fpc [options] [sourcefile]"
  6. .BR
  7. .SH DESCRIPTION
  8. This binary is the main binary of the
  9. .I Free Pascal Compiler (FPC)
  10. which is a
  11. .I Turbo Pascal
  12. and
  13. .I Delphi (2.0)
  14. compatible standalone (non GCC frontend) multitarget Pascal compiler.
  15. .PP
  16. The compiler uses
  17. .BR LD (1)
  18. and can use
  19. .BR AS (1)
  20. (see parameter \-Aas), but also has its own binary object writer.
  21. .PP
  22. The current main targets are
  23. .I Go32V2
  24. (Dos DJGPP extender),
  25. .I Freebsd,
  26. .I Linux,
  27. .I OS/2
  28. and
  29. .I Win32.
  30. The other targets (M68K compilers for Atari and Amiga) are either based on older
  31. versions of the compiler or are still in development.
  32. .PP
  33. This manpage is meant for quick\-reference only. FPC comes with a great (600+ pages)
  34. manual, which is updated constantly, while this man page can be out of date.
  35. .SH Version number
  36. Starting with release 1.0, a new versioning system has been implemented.
  37. If the last number is even (1.0, 1.0.2), it is stable, and if the last number is
  38. odd it is a daily changing development version.(1.0.5, 1.1) just like the linux kernel.
  39. .PP
  40. Version 0.99.5 however is a stable release. It was made before the even/odd version
  41. naming system was introduced.
  42. .SH Usage
  43. The compilation proces is started by typing
  44. .I fpc
  45. followed by a sourcefile name (normally with .pas or .pp extension). Before processing the actual processing of the source file,
  46. .BR fpc.cfg (5)
  47. the configuration file of the compiler is read which contains the location of the
  48. RTL, other packages (FCL, FreeVision), and optionally default values for some
  49. switches. See the separate manpage of
  50. .BR fpc.cfg (5)
  51. for more information.
  52. .SH Options
  53. .PP
  54. General options
  55. .TP
  56. .BI \-h
  57. if you specify this option, the compiler outputs a list of all options,
  58. and exits after that.
  59. .TP
  60. .BI \-?
  61. idem as \-h, but waiting after every screenfull for the enter key.
  62. .TP
  63. .BI \-i
  64. This option tells the compiler to print the copyright information.
  65. You can give it an option, as -ixxx} where "xxx" can be one of the
  66. following:
  67. .RS
  68. .TP
  69. .I D
  70. Returns the compiler date.
  71. .TP
  72. .I V
  73. Returns the compiler version.
  74. .TP
  75. .I SO
  76. Returns the compiler OS.
  77. .TP
  78. .I SP
  79. Returns the compiler processor.
  80. .TP
  81. .I TO
  82. Returns the target OS.
  83. .TP
  84. .I TP
  85. Returns the target Processor.
  86. .RE
  87. .TP
  88. .I -l
  89. This option tells the compiler to print the
  90. .I FPC
  91. logo on standard output. It also gives you the
  92. .I FPC
  93. version number.
  94. .TP
  95. .I -n
  96. Tells the compiler not to read the configuration file
  97. .BR fpc.cfg (5)
  98. .PP
  99. Options for getting feedback
  100. .TP
  101. .BI \-v xxx
  102. Be verbose. "xxx" is a combination of the following:
  103. .RS
  104. .TP
  105. .I e
  106. Tells the compiler to show only errors. This option is on by default.
  107. .TP
  108. .I i
  109. Tells the compiler to show some general information.
  110. .TP
  111. .I w
  112. Tells the compiler to issue warnings.
  113. .TP
  114. .I n
  115. Tells the compiler to issue notes.
  116. .TP
  117. .I h
  118. Tells the compiler to issue hints.
  119. .TP
  120. .I l
  121. Tells the compiler to show the line numbers as it processes a
  122. file. Numbers are shown per 100.
  123. .TP
  124. .I u
  125. Tells the compiler to print the names of the files it opens.
  126. .TP
  127. .I t
  128. Tells the compiler to print the names of the files it tries
  129. to open.
  130. .TP
  131. .I p
  132. Tells the compiler to print the names of procedures and
  133. functions as it is processing them.
  134. .TP
  135. .I c
  136. Tells the compiler to warn you when it processes a
  137. conditional.
  138. .TP
  139. .I m
  140. Tells the compiler to write which macros are defined.
  141. .TP
  142. .I d
  143. Tells the compiler to write other debugging info.
  144. .TP
  145. .I a
  146. Tells the compiler to write all possible info. (this is the
  147. same as specifying all options)
  148. .TP
  149. .I 0
  150. Tells the compiler to write no messages. This is useful when
  151. you want to override the default setting in the configuration file.
  152. .TP
  153. .I b
  154. Tells the compiler to show all procedure declarations if an
  155. overloaded function error occurs.
  156. .TP
  157. .I x
  158. Tells the compiler to output some executable info (for Win32
  159. platform only).
  160. .TP
  161. .I r
  162. Rhide/GCC compatibility mode: formats the error differently, so they
  163. are understood by RHIDE.
  164. .RE
  165. .PP
  166. Options concerning files and directories
  167. .TP
  168. .BI -e xxx
  169. tells the compiler that
  170. .I xxx
  171. is the directory where it can find the executables as (the assembler) and
  172. ld (the linker).
  173. .TP
  174. .BI \-FD
  175. same as
  176. .I \-e.
  177. .TP
  178. .BI \-Fe xxx
  179. This option tells the compiler to write errors, etc. to
  180. the file
  181. .I xxx
  182. .
  183. .TP
  184. .BI \-Fg xxx
  185. (linux only, obsolete)
  186. .I xxx
  187. specifies the path where the compiler can find the
  188. .I GNU C
  189. library. This is superseded by the
  190. .I \-Fl
  191. option.
  192. .TP
  193. .BI \-Fi xxx
  194. adds
  195. .I xxx
  196. to the path where the compiler searches for its include files.
  197. .TP
  198. .BI \-Fl xxx
  199. Adds
  200. .I xxx
  201. to the library searching path, and is passe to the linker.
  202. .TP
  203. .BI \-FL xxx
  204. ( Linux only) Tells the compiler to use
  205. .I xxx
  206. as the dynamic linker. Default this is /lib/ld-linux.so.2, or
  207. lib/ld-linux.so.1, depending on which one is found.
  208. .TP
  209. .BI \-Fo xxx
  210. Adds
  211. .I xxx
  212. to the object file path. This path is used
  213. when looking for files that need to be linked in.
  214. .TP
  215. .BI \-Fr xxx
  216. tells the compiler that
  217. .I xxx
  218. contains the compiler messages. Default the compiler has built-in
  219. messages. Specifying this option will override the default messages.
  220. (useful if you want to use a language other than the default language).
  221. .TP
  222. .BI \-Fu xxx
  223. Adds
  224. .I xxx
  225. to the unit path.
  226. By default, the compiler only searches for units in the current directory
  227. and the directory where the compiler itself resides. This option tells the
  228. compiler also to look in the directory
  229. .I xxx
  230. \.
  231. .TP
  232. .BI \-FU xxx
  233. Tells the compiler to write units in directory
  234. .I xxx
  235. instead of the current directory.
  236. .TP
  237. .BI \-I xxx
  238. Add
  239. .I xxx
  240. to the include file search path.
  241. This path is used when looking for include files.
  242. .TP
  243. By default, the compiler only searches for units in the current directory
  244. and the directory where the compiler itself resides. This option tells the
  245. compiler also to look in the directory "xxx."
  246. .PP Options controlling the kind of output
  247. for more information on these options, see also the programmers manual.
  248. .TP
  249. .BI \-a
  250. Tells the compiler not to delete the assembler file.
  251. This also counts for the (possibly) generated batch script.
  252. .TP
  253. .BI \-al
  254. Tells the compiler to include the sourcecode lines
  255. in the assembler file as comments. This feature is still experimental, and
  256. should be used with caution.
  257. .TP
  258. .BI -A xxx
  259. specifies what kind of assembler should be generated . Here
  260. .I xxx
  261. is one of the following :
  262. .RS
  263. .TP
  264. .I AS
  265. A unix .o (object) file, using
  266. .I GNU AS
  267. .TP
  268. .I nasmcoff
  269. a coff file using the
  270. .I nasm
  271. assembler.
  272. .TP
  273. .I nasmelf
  274. a ELF32 file (LINUX only) using the
  275. .I nasm
  276. assembler.
  277. .TP
  278. .I nasmonj
  279. a obj file using the
  280. .I nasm
  281. assembler.
  282. .TP
  283. .I masm
  284. An obj file using the Microsoft
  285. .I masm
  286. assembler.
  287. .TP
  288. .I tasm
  289. An obj file using the Borland
  290. .I tasm
  291. assembler.
  292. .RE
  293. .TP
  294. .BI \-CD
  295. Create dynamic library.
  296. .TP
  297. .BI \-Ch xxx
  298. Reserves
  299. .I xxx
  300. bytes heap.
  301. .I xxx
  302. should be between 1024 and 67107840.
  303. .TP
  304. .BI \-Ci
  305. Generate Input/Output checking code.
  306. .TP
  307. .BI \-Cn
  308. Omit the linking stage.
  309. .TP
  310. .BI \-Co
  311. Generate Integer overflow checking code.
  312. .TP
  313. .BI \-Cr
  314. Generate Range checking code.
  315. .TP
  316. .BI \-Cs xxx
  317. Set stack size to
  318. .I xxx
  319. bytes.
  320. .TP
  321. .BI \-CS
  322. Create static library.
  323. .TP
  324. .BI \-Ct
  325. generate stack checking code.
  326. .TP
  327. .BI \-Cx
  328. Use smartlinking when compiling and linking units.
  329. .TP
  330. .BI \-d xxx
  331. Define the symbol name
  332. .I xxx
  333. This can be used to conditionally compile parts of your code.
  334. .TP
  335. .BI \-E
  336. Same as -Cn.
  337. .TP
  338. .BI \-g
  339. Generate debugging information for debugging with
  340. .I GDB
  341. .TP
  342. .BI \-gg
  343. idem as
  344. .B -g.
  345. .TP
  346. .BI \-gd
  347. generate debugging info for dbx.
  348. .TP
  349. .BI \-gh
  350. use the heaptrc unit (see the units part of the FPC manual).
  351. .TP
  352. .BI \-O xxx
  353. optimize the compiler's output;
  354. .I xxx
  355. can have one of the following values :
  356. .RS
  357. .TP
  358. .I g
  359. optimize for size, try to generate smaller code.
  360. .TP
  361. .I G
  362. optimize for time, try to generate faster code (default).
  363. .TP
  364. .I r
  365. keep certain variables in registers (experimental, use with caution).
  366. .TP
  367. .I u
  368. uncertain optimizations
  369. .TP
  370. .I 1
  371. Level 1 optimizations (quick optimizations).
  372. .TP
  373. .I 2
  374. Level 2 optimizations (-O1 plus some slower optimizations).
  375. .TP
  376. .I 3
  377. Level 3 optimizations (-O2 plus -Ou).
  378. .TP
  379. .I Pn
  380. Specify processor : n can be one of
  381. .RS
  382. .TP
  383. .I 1
  384. optimize for 386/486
  385. .TP
  386. .I 2
  387. optimize for Pentium/PentiumMMX (tm)
  388. .TP
  389. .I 3
  390. optimizations for PentiumPro / P-II / Cyrix 6x86 / K6 (tm)
  391. .RE
  392. The exact effect of these effects can be found in the programmers part of the manual.
  393. .RE
  394. .TP
  395. .BI \-o xxx
  396. Tells the compiler to use
  397. .I xxx
  398. as the name of the output file (executable). Only with programs.
  399. .TP
  400. .BI \-pg
  401. Generate profiler code for gprof.
  402. .TP
  403. .BI \-s
  404. Tells the compiler not to call the assembler and linker.
  405. Instead, the compiler writes a script, PPAS.BAT under DOS, or
  406. ppas.sh under Linux, which can then be executed to produce an
  407. executable.
  408. .TP
  409. .BI \-T xxx
  410. Specifies the target operating system.
  411. .I xxx
  412. can be one of the following:
  413. .RS
  414. .TP
  415. .I GO32V1
  416. DOS and version 1 of the DJ DELORIE extender (no longer maintained).
  417. .TP
  418. .I GO32V2
  419. DOS and version 2 of the DJ DELORIE extender.
  420. .TP
  421. .I LINUX
  422. Linux.
  423. .TP
  424. .I OS2
  425. OS/2 using EMX
  426. .TP
  427. .I WIN32
  428. Windows 32 bit.
  429. .TP
  430. .I BeOS
  431. BeOS 80x86
  432. .RE
  433. .TP
  434. .BI -u xxx
  435. undefine the symbol
  436. .I xxx
  437. \. This is the opposite of the
  438. .B \-d
  439. option.
  440. .TP
  441. .BI \-u xxx
  442. Undefine symbol
  443. .I xxx
  444. \.
  445. .TP
  446. .BI \-X x
  447. Executable options. These tell the compiler what
  448. kind of executable should be generated. the parameter
  449. .I x
  450. can be one of the following:
  451. .RS
  452. .TP
  453. .I c
  454. (Linux only, obsolete) Link with the C library. You should only use this when
  455. you start to port Free Pascal to another operating system.
  456. .TP
  457. .I D
  458. Link with dynamic libraries (defines the FPC_LINK_DYNAMIC symbol)
  459. .TP
  460. .I s
  461. Strip the symbols from the executable.
  462. .TP
  463. .I S
  464. Link with static libraries (defines th FPC_LINK_STATIC symbol)
  465. .RE
  466. .PP
  467. Options concerning the sources (language options)
  468. for more information on these options, see also Programmers Manual
  469. .TP
  470. .BI \-R xxx
  471. Specifies what assembler you use in your "asm" assembler code
  472. blocks. Here
  473. .I xxx
  474. is one of the following:
  475. .RS
  476. .TP
  477. .I att
  478. Asm blocks contain AT&T assembler.
  479. .TP
  480. .I intel
  481. Asm blocks contain Intel assembler.
  482. .TP
  483. .I direct
  484. Asm blocks should be copied as-is in the assembler
  485. file.
  486. .RE
  487. .TP
  488. .BI \-S2
  489. Switch on Delphi 2 extensions.
  490. .TP
  491. .BI \-Sc
  492. Support C-style operators, i.e. *=, +=, /= and -=.
  493. .TP
  494. .BI \-Sd
  495. tells the compiler to dispose asmlists. This uses less memory,
  496. but is slower.
  497. .TP
  498. .BI \-Se
  499. The compiler stops after the first error. Normally,
  500. the compiler tries to continue compiling after an error, until 50 errors are
  501. reached, or a fatal error is reached, and then it stops. With this switch,
  502. the compiler will stop after the first error.
  503. .TP
  504. .BI \-Sg
  505. Support the label and goto commands.
  506. .TP
  507. .BI \-Si
  508. Support C++ style INLINE.
  509. .TP
  510. .BI \-Sm
  511. Support C-style macros.
  512. .TP
  513. .BI \-So
  514. Try to be Borland TP 7.0 compatible (no function
  515. overloading etc.).
  516. .TP
  517. .BI \-Sp
  518. Try to be
  519. .I GPC (GNU Pascal Compiler)
  520. compatible.
  521. .TP
  522. .BI \-Ss
  523. The name of constructors must be "init", and the
  524. name of destructors should be "done".
  525. .TP
  526. .BI \-St
  527. Allow the "static" keyword in objects.
  528. .TP
  529. .BI \-Un
  530. Do not check the unit name. Normally, the unit name
  531. is the same as the filename. This option allows both to be different.
  532. .TP
  533. .BI \-Us
  534. Compile a system unit. This option causes the
  535. compiler to define only some very basic types.
  536. .SH SEE ALSO
  537. .BR fpc.cfg (5)
  538. .BR ppdep (1)
  539. .BR ppudump (1)
  540. .BR ppumove (1)
  541. .BR ptop (1)
  542. .BR h2pas (1)
  543. .BR ld (1)
  544. .BR as (1)