next up previous contents
Next: Using the configuration file Up: Compiler configuration Previous: Compiler configuration

Using the command-line options

The available options are listed by category:

General options

-h
if you specify this option, the compiler outputs a list of all options, and exits after that.  
-?
idem as -h, waiting after every screenfull for the enter key.
-i
This option tells the compiler to print the copyright information.  
-l
This option tells the compiler to print the Free Pascal logo on standard output. It also gives you the Free Pascal version number.  
-n
Tells the compiler not to read the configuration file.  

Options for getting feedback

-vxxx
Be verbose. xxx is a combination of the following :  

Options concerning files and directories

-exxx
xxx specifies the directory where the compiler can find the executables as (the assembler) and ld (the compiler).  
-Fexxx
This option tells the compiler to write errors, etc. to the file in xxx.  
-Fgxxx
(LINUX only) xxx specifies the path where the compiler can find the gnu C library.  
-Fixxx
adds xxx to the path where the compiler searches for its include files.  
-Flxxx
Adds xxx to the library searching path, and is passed to the linker.  
-FLxxx
(LINUX only) Tells the compiler to use xxx as the dynamic linker. Default this is /lib/ld-linux.so.2, or lib/ld-linux.so.1, depending on which one is found.  
-Foxxx
Adds xxx to the object file path. This path is used when looking for files that need to be linked in.  
-Frxxx
xxx specifies the file which contain the compiler messages. Default the compiler ahs built-in messages. Specifying this option will override the default messages.  
-Fuxxx
Idem as -Up: Add xxx to the object path.  
-Ixxx
  Add xxx to the include file search path. This path is used when looking for include files.
-P
uses pipes instead of files when assembling. This may speed up the compiler on OS/2 and LINUX. Only with assemblers (such as gnu as) that support piping..
-Upxxx
  Tells the compiler to add xxx to the path where to find units.
By default, the compiler only searches for units in the current directory and the directory where the compiler itself resides. This option tells the compiler also to look in the directory xxx.

Options controlling the kind of output.

for more information on these options, see also Programmer's guide\

-a
  Tells the compiler not to delete the assembler file. This also counts for the (possibly) generated batch script.
-al
  Tells the compiler to include the sourcecode lines in the assembler file as comments. This feature is still experimental, and should be used with caution.
-Axxx
 specifies what kind of assembler should be generated . Here xxx is one of the following :
-CD
Create dynamic library.
-Chxxx
  Reserves xxx bytes heap. xxx should be between 1024 and 67107840.
-Ci
  Generate Input/Output checking code.
-Cn
  Omit the linking stage.
-Co
  Generate Integer overflow checking code.
-Cr
  Generate Range checking code.
-Csxxx
  Set stack size to xxx.
-CS
  Create static library.
-Ct
  generate stack checking code.
-Cx
  Use smartlinking when compiling and linking units.
-dxxx
  Define the symbol name xxx. This can be used to conditionally compile parts of your code.
-E   Same as -Cn.
-g
  Generate debugging information for debugging with gdb
-gg
idem as -g.
-gd
  generate debugging info for dbx.

-Oxxx
  optimize the compiler's output; xxx can have one of the following values :
g
optimize for size, try to generate smaller code.
G
optimize for time, try to generate faster code (default).
r
keep certain variables in registers (experimental, use with caution).
u
uncertain optimizations
1
Level 1 optimizations (quick optimizations).
2
Level 2 optimizations (-O1 plus some slower optimizations).
3
Level 2 optimizations (-O2 plus -Ou).
Pn
Specify processor: n can be one of
1
optimize for 386/486
2
optimize for Pentium/PentiumMMX (tm)
3
optimizations for PentiumPro/PII/Cyrix 6x86/K6 (tm)

The exact effect of these effects can be found in the Programmer's guide.
-oxxx
Tells the compiler to use xxx as the name of the output file (executable). Only with programs.
-pg
  Generate profiler code for gprof.
-s
  Tells the compiler not to call the assembler and linker. Instead, the compiler writes a script, PPAS.BAT under DOS, or ppas.sh under LINUX, which can then be executed to produce an executable.
-Txxx
 Specifies the target operating system. xxx can be one of the following:
-uxxx
  undefine the symbol xxx. This is the opposite of the -d option.
-Uld
  make dynamic library from unit.
-Uls
  make static library from unit.
-uxxx
  Undefine symbol xxx.

-Xx
  executable options. This tells the compiler what kind of executable should be generated. the parameter x can be one of the following:

Options concerning the sources (language options)

for more information on these options, see also Programmer's guide\

-Rxxx
  Specifies what assembler you use in your asm assembler code blocks. Here xxx is one of the following:
att
asm blocks contain AT&T assembler.
intel
asm blocks contain Intel assembler.
direct
asm blocks should be copied as-is in the assembler file.

-S2
  Switch on Delphi 2 extensions.
-Sc
  Support C-style operators, i.e. *=, +=, /= and -=.
-Sd
tells the compiler to dispose asmlists. This uses less memory, but is slower.
-Se
  The compiler stops after the first error. Normally, the compiler tries to continue compiling after an error, until 50 errors are reached, or a fatal error is reachd, and then it stops. With this switch, the compiler will stop after the first error.
-Sg
  Support the label and goto commands.
-Si
  Support C++ style INLINE.
-Sm
  Support C-style macros.
-So
  Try to be Borland TP 7.0 compatible (no function overloading etc.).
-Sp
  Try to be gpc (gnu pascal compiler) compatible.
-Ss
  The name of constructors must be init, and the name of destructors should be done.
-St
  Allow the static keyword in objects.
-Sv
allow variable directives (cvar, external, public, export). You cannot use the cvar or external modifiers on variables, unless you use this switch.
-Un
  Do not check the unit name. Normally, the unit name is the same as the filename. This option allows both to be different.
-Us
  Compile a system unit. This option causes the compiler to define only some very basic types.


next up previous contents
Next: Using the configuration file Up: Compiler configuration Previous: Compiler configuration

Michael Van Canneyt
Thu Sep 10 13:56:17 CEST 1998