The installation of Free Pascal is easy, but is platform-dependent. We discuss the process for each platform separately.
The screen of the installation program looks like figure 2.1.
The program allows you to select:
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. Usually this is done in the AUTOEXEC.BAT file. It should look something like this :
SET PATH=%PATH%;C:\PP\BIN\GO32V2 |
SET PATH=%PATH%;C:\PP\BIN\WIN32 |
SET PATH=%PATH%;C:\PP\BIN\OS2 |
On OS/2, Free Pascal installs some libraries from the EMX package if they were not yet installed (the installer will notify you if they should be installed). They are located in the
C:\PP\DLL |
LIBPATH=XXX;C:\PP\DLL |
The installation of the coprocessor emulation is handled by the installation program (INSTALL.EXE) under DOS and WINDOWS.
All of these packages contain a ELF version of the compiler binaries and units. the older aout binaries are no longer distributed, although you still can use the comiler on an aout system if you recompile it.
If you use the .rpm format, installation is limited to
rpm -i fpc-pascal-XXX.rpm |
If you use Debian, installation is limited to
dpkg -i fpc-XXX.deb |
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, or the separate files, installation is more interactive.
In case you downloaded the .tar file, you should first untar the file, in some directory where you have write permission, using the following command:
tar -xvf fpc.tar |
When the file is untarred, you will be left with more archive files, and an install program: an installation shell script.
If you downloaded the files as separate files, you should at least download the install.sh script, and the libraries (in libs.tar.gz).
To install Free Pascal, all that you need to do now is give the following command:
./install.sh |
The script will automatically detect which components are present and can be installed. It will only offer to install what has been found. because of this feature, you must keep the original names when downloading, since the script expects this.
If you run the installation script as the root user, you can just accept all installation defaults. If you don’t run as root, you must take care to supply the installation program with directory names where you have write permission, as it will attempt to create the directories you specify. In principle, you can install it wherever you want, though.
At the end of installation, the installation program will generate a configuration file (fpc.cfg) for the Free Pascal compiler which reflects the settings that you chose. It will install this file in the /etc directory or in your home directory (with name .fpc.cfg) if you do not have write permission in the /etc directory. It will make a copy in the directory where you installed the libraries.
The compiler will first look for a file .fpc.cfg in your home directory before looking in the /etc directory.