The installation of Free Pascal is easy, but is platform-dependent. We discuss the process for each platform separately.
First, you must get the latest distribution files of Free Pascal. They come as zip files, which you must unzip first. The distribution zip file contains an installation program INSTALL.EXE. You must run this program to install the compiler.
The screen of the installation program looks like this:
The program allows you to select:
C:\PP
).
SET_PP.BAT
. This file is located in the directory where
you installed Free Pascal. The installation program doesn't modify the
AUTOEXEC.BAT, since many people (including the authors of Free Pascal)
don't like this.
You can choose to insert a call to this batch file in your AUTOEXEC.BAT file, like this :
CALL C:\PP\SET_PP.BAT(This is assuming that you installed Free Pascal in the default location.) In order to run Free Pascal from any directory on your system, you must extend your path variable to contain the
C:\PP\BIN
directory.
You can choose to do this in your AUTOEXEC.BAT file, but you can also
insert a statement in the SET_PP.BAT
file. Whatever the location you
choose, It should look something like this :
SET PATH=%PATH%;C:\PP\BIN(Again, assuming that you installed in the default location).
If you want to use the graphic drivers you must modify the environment variable GO32. Instructions for doing this can be found in the documentation of the Graph unit, at the InitGraph procedure.
For people who have an older CPU type, without math coprocessor (i387) it is necessary to install a coprocessor emulation, since Free Pascal uses the coprocessor to do all floating point operations.
The installation of the coprocessor emulation is handled by the
installation program (INSTALL.EXE). However,
the installation program has currently a bug: If you select the
coprocessor emulation the program ignores this and you must do
this by hand. You should change the GO32 environment variable in
the SET_PP.BAT
file, as follows:
SET GO32=emu C:\PP\DRIVERS\EMU387
The LINUX distribution of Free Pascal comes in three forms:
If you use the .rpm format, installation is limited to
rpm -i fpc-pascal-XXX.rpm(XXX is the version number of the .rpm file)
If you use debian, installation is limited to
dpkg -i fpc-XXX.debHere again, XXX is the version number of the .deb file.
You need root access to install these packages. The .tar file allows you to do an installation if you don't have root permissions.
When downloading the .tar file, installation is more interactive:
This means that you should first untar the file, in some directory where you have write permission, using the following command:
tar -xvf fpc.tarWe supposed here that you downloaded the file fpc.tar somewhere from the Internet. (The real filename will have some version number in it, which we omit here for clarity.)
When the file is untarred, you will be left with more archive files, and an install program: an installation shell script. To install Free Pascal, all that you need to do now is give the following command:
./install.shAnd then you must answer some questions. They're very simple, they're mainly concerned with 2 things :
At the end of installation, the installation program will generate a configuration file for the Free Pascal compiler which reflects the settings that you chose. It will install this file in the /etc directory, (if you are not installing as root, this will fail), and in the directory where you installed the libraries.
If you want the Free Pascal compiler to use this configuration file, it must be present in /etc, or you can set the environment variable PPC_CONFIG_PATH. Under csh, you can do this by adding a
setenv PPC_CONFIG_PATH /usr/lib/ppc/0.99.1line to your .login file in your home directory. (see also the next section)
You may wish to set some environment variables. The LINUX version of Free Pascal recognizes the following variables :
PPC_EXEC_PATH
contains the directory where 'as' and
'ld' are. (default /usr/bin)PPC_GCCLIB_PATH
contains the directory where libgcc.a is (no default)PPC_CONFIG_PATH
specifies an alternate path to find
ppc386.cfg (default /etc)PPC_ERROR_FILE
specifies the path and name of the error-definition file.
(default /usr/lib/ppc/errorE.msg)
These locations are, however, set in the sample configuration file which is
built at the end of the installation process, except for the
PPC_CONFIG_PATH
variable, which you must set if you didn't install
things in the default places.
Also distributed in Free Pascal is a README file. It contains the latest instructions for installing Free Pascal, and should always be read first.