fpc.1 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561
  1. .TH fpc 1 "22 feb 2002" "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. .I BeOS
  29. .I Solaris
  30. and
  31. .I Win32.
  32. The other targets (M68K compilers for Atari and Amiga) are either based on older
  33. versions of the compiler or are still in development.
  34. .PP
  35. This manpage is meant for quick\-reference only. FPC comes with a great (600+ pages)
  36. manual, which is updated constantly, while this man page can be out of date.
  37. .SH Version number
  38. Starting with release 1.0, a new versioning system has been implemented.
  39. If the last number is even (1.0, 1.0.2), it is stable, and if the last number is
  40. odd it is a daily changing development version.(1.0.5, 1.1) just like the linux kernel.
  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 fpc.cfg (5)
  49. the configuration file of the compiler is read which contains the location of the
  50. RTL, other packages (FCL, FreeVision), and optionally default values for some
  51. switches. See the separate manpage of
  52. .BR fpc.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 fpc.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. By default, the compiler only searches for units in the current directory
  246. and the directory where the compiler itself resides. This option tells the
  247. compiler also to look in the directory "xxx."
  248. .PP Options controlling the kind of output
  249. for more information on these options, see also the programmers manual.
  250. .TP
  251. .BI \-a
  252. Tells the compiler not to delete the assembler file.
  253. This also counts for the (possibly) generated batch script.
  254. .TP
  255. .BI \-al
  256. Tells the compiler to include the sourcecode lines
  257. in the assembler file as comments. This feature is still experimental, and
  258. should be used with caution.
  259. .TP
  260. .BI -A xxx
  261. specifies what kind of assembler should be generated . Here
  262. .I xxx
  263. is one of the following :
  264. .RS
  265. .TP
  266. .I AS
  267. A unix .o (object) file, using
  268. .I GNU AS
  269. .TP
  270. .I nasmcoff
  271. a coff file using the
  272. .I nasm
  273. assembler.
  274. .TP
  275. .I nasmelf
  276. a ELF32 file (LINUX only) using the
  277. .I nasm
  278. assembler.
  279. .TP
  280. .I nasmonj
  281. a obj file using the
  282. .I nasm
  283. assembler.
  284. .TP
  285. .I masm
  286. An obj file using the Microsoft
  287. .I masm
  288. assembler.
  289. .TP
  290. .I tasm
  291. An obj file using the Borland
  292. .I tasm
  293. assembler.
  294. .RE
  295. .TP
  296. .BI \-CD
  297. Create dynamic library.
  298. .TP
  299. .BI \-Ch xxx
  300. Reserves
  301. .I xxx
  302. bytes heap.
  303. .I xxx
  304. should be between 1024 and 67107840.
  305. .TP
  306. .BI \-Ci
  307. Generate Input/Output checking code.
  308. .TP
  309. .BI \-Cn
  310. Omit the linking stage.
  311. .TP
  312. .BI \-Co
  313. Generate Integer overflow checking code.
  314. .TP
  315. .BI \-Cr
  316. Generate Range checking code.
  317. .TP
  318. .BI \-Cs xxx
  319. Set stack size to
  320. .I xxx
  321. bytes.
  322. .TP
  323. .BI \-CS
  324. Create static library.
  325. .TP
  326. .BI \-Ct
  327. generate stack checking code.
  328. .TP
  329. .BI \-Cx
  330. Use smartlinking when compiling and linking units.
  331. .TP
  332. .BI \-d xxx
  333. Define the symbol name
  334. .I xxx
  335. This can be used to conditionally compile parts of your code.
  336. .TP
  337. .BI \-E
  338. Same as -Cn.
  339. .TP
  340. .BI \-g
  341. Generate debugging information for debugging with
  342. .I GDB
  343. .TP
  344. .BI \-gg
  345. idem as
  346. .B -g.
  347. .TP
  348. .BI \-gd
  349. generate debugging info for dbx.
  350. .TP
  351. .BI \-gh
  352. use the heaptrc unit (see the units part of the FPC manual).
  353. .TP
  354. .BI \-O xxx
  355. optimize the compiler's output;
  356. .I xxx
  357. can have one of the following values :
  358. .RS
  359. .TP
  360. .I g
  361. optimize for size, try to generate smaller code.
  362. .TP
  363. .I G
  364. optimize for time, try to generate faster code (default).
  365. .TP
  366. .I r
  367. keep certain variables in registers (experimental, use with caution).
  368. .TP
  369. .I u
  370. uncertain optimizations
  371. .TP
  372. .I 1
  373. Level 1 optimizations (quick optimizations).
  374. .TP
  375. .I 2
  376. Level 2 optimizations (-O1 plus some slower optimizations).
  377. .TP
  378. .I 3
  379. Level 3 optimizations (-O2 plus -Ou).
  380. .TP
  381. .I Pn
  382. Specify processor : n can be one of
  383. .RS
  384. .TP
  385. .I 1
  386. optimize for 386/486
  387. .TP
  388. .I 2
  389. optimize for Pentium/PentiumMMX (tm)
  390. .TP
  391. .I 3
  392. optimizations for PentiumPro / P-II / Cyrix 6x86 / K6 (tm)
  393. .RE
  394. The exact effect of these effects can be found in the programmers part of the manual.
  395. .RE
  396. .TP
  397. .BI \-o xxx
  398. Tells the compiler to use
  399. .I xxx
  400. as the name of the output file (executable). Only with programs.
  401. .TP
  402. .BI \-pg
  403. Generate profiler code for gprof.
  404. .TP
  405. .BI \-s
  406. Tells the compiler not to call the assembler and linker.
  407. Instead, the compiler writes a script, PPAS.BAT under DOS, or
  408. ppas.sh under Linux, which can then be executed to produce an
  409. executable.
  410. .TP
  411. .BI \-T xxx
  412. Specifies the target operating system.
  413. .I xxx
  414. can be one of the following:
  415. .RS
  416. .TP
  417. .I GO32V2
  418. DOS and version 2 of the DJ DELORIE extender.
  419. .TP
  420. .I LINUX
  421. Linux.
  422. .TP
  423. .I OS2
  424. OS/2 using EMX
  425. .TP
  426. .I WIN32
  427. Windows 32 bit.
  428. .TP
  429. .I BeOS
  430. BeOS 80x86
  431. .RE
  432. .TP
  433. .BI -u xxx
  434. undefine the symbol
  435. .I xxx
  436. \. This is the opposite of the
  437. .B \-d
  438. option.
  439. .TP
  440. .BI \-u xxx
  441. Undefine symbol
  442. .I xxx
  443. \.
  444. .TP
  445. .BI \-X x
  446. Executable options. These tell the compiler what
  447. kind of executable should be generated. the parameter
  448. .I x
  449. can be one of the following:
  450. .RS
  451. .TP
  452. .I c
  453. (Linux only, obsolete) Link with the C library. You should only use this when
  454. you start to port Free Pascal to another operating system.
  455. .TP
  456. .I D
  457. Link with dynamic libraries (defines the FPC_LINK_DYNAMIC symbol)
  458. .TP
  459. .I s
  460. Strip the symbols from the executable.
  461. .TP
  462. .I S
  463. Link with static libraries (defines th FPC_LINK_STATIC symbol)
  464. .RE
  465. .PP
  466. Options concerning the sources (language options)
  467. for more information on these options, see also Programmers Manual
  468. .TP
  469. .BI \-R xxx
  470. Specifies what assembler you use in your "asm" assembler code
  471. blocks. Here
  472. .I xxx
  473. is one of the following:
  474. .RS
  475. .TP
  476. .I att
  477. Asm blocks contain AT&T assembler.
  478. .TP
  479. .I intel
  480. Asm blocks contain Intel assembler.
  481. .TP
  482. .I direct
  483. Asm blocks should be copied as-is in the assembler
  484. file.
  485. .RE
  486. .TP
  487. .BI \-S2
  488. Switch on Delphi 2 extensions.
  489. .TP
  490. .BI \-Sc
  491. Support C-style operators, i.e. *=, +=, /= and -=.
  492. .TP
  493. .BI \-Sd
  494. tells the compiler to dispose asmlists. This uses less memory,
  495. but is slower.
  496. .TP
  497. .BI \-Se
  498. The compiler stops after the first error. Normally,
  499. the compiler tries to continue compiling after an error, until 50 errors are
  500. reached, or a fatal error is reached, and then it stops. With this switch,
  501. the compiler will stop after the first error.
  502. .TP
  503. .BI \-Sg
  504. Support the label and goto commands.
  505. .TP
  506. .BI \-Si
  507. Support C++ style INLINE.
  508. .TP
  509. .BI \-Sm
  510. Support C-style macros.
  511. .TP
  512. .BI \-So
  513. Try to be Borland TP 7.0 compatible (no function
  514. overloading etc.).
  515. .TP
  516. .BI \-Sp
  517. Try to be
  518. .I GPC (GNU Pascal Compiler)
  519. compatible.
  520. .TP
  521. .BI \-Ss
  522. The name of constructors must be "init", and the
  523. name of destructors should be "done".
  524. .TP
  525. .BI \-St
  526. Allow the "static" keyword in objects.
  527. .TP
  528. .BI \-Un
  529. Do not check the unit name. Normally, the unit name
  530. is the same as the filename. This option allows both to be different.
  531. .TP
  532. .BI \-Us
  533. Compile a system unit. This option causes the
  534. compiler to define only some very basic types.
  535. .SH SEE ALSO
  536. .BR fpc.cfg (5)
  537. .BR ppdep (1)
  538. .BR ppudump (1)
  539. .BR ppumove (1)
  540. .BR ptop (1)
  541. .BR h2pas (1)
  542. .BR ld (1)
  543. .BR as (1)