fpc.1 11 KB

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