From Freepascal Amiga wiki
Revision as of 18:57, 18 September 2013 by Molly (talk | contribs) (Added initial content for compiler configuration)
Jump to navigation Jump to search

The Freepascal compiler is basically nothing more then a commandline program that you can execute from the shell by typing the "fpc" (without quotes) and pressing enter.

Although a full-fledged IDE like Lazarus incorporate the FPC-compiler to address specific targets, also such an IDE need to use the commandline version of the FPC command in order to be able to cross-compile for specific targets. The only difference with regards to configuring the commandline compiler (when invoked) is a pimped GUI.

The commandline compiler does not really require a configuration if you do not want it to use one (although by default the fpc command _always_ will use a fpc.cfg file when it exist), but then you would need to provide all the several options the compiler can handle in the form of parameters. It would require you to provide those options each and every time you want to compile a project.

This becomes tiresome very quick as most options required are the same over and over again. Therefore you can use the fpc.cfg file to provide some of those options as being standard, whilst providing other (for your project) specific options to the commandline compiler.

In case you need to override an option that is already in place in the fpc.cfg configuration file, then you simply provide it as an option to the fpc command.

Also note that the FP-IDE (that is included in the AROS distribution of FPC) uses it's own fpc.cfg file (when the IDE resides in it's own drawer) and therefore overrides the default fpc.cfg file (that is found in the drawer where the fpc command resides).

Configuration of the compiler is basically the same as the normal compiler configuration (used on other platforms).

Details on how to configure the compiler can be read in the offical FreePascal user manual, chapter 5 - Compiler configuration.