The first screen of the installation program looks like this:
And the second screen looks like
The program allows you to select:
C:\PP
).
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(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.
The installation of the coprocessor emulation is handled by the installation program (INSTALL.EXE) under DOS and WINDOWS.
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, 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.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.
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.shAnd then you must answer some questions. They're very simple, they're mainly concerned with 2 things :
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 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.14line to your .login file in your home directory. (see also the next section)
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). This if for LINUX only.
PPC_CONFIG_PATH
specifies an alternate path to find
ppc386.cfg (default under LINUX is /etc)
PPC_ERROR_FILE
specifies the path and name of the error-definition file.
(default /usr/lib/fpc/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.
Included in the Free Pascal distribution are some demonstration programs, showing what the compiler can do. You can test if the compiler functions correctly by trying to compile these programs.
The compiler is called
demo\hello.pp
) simply type :
ppc386 helloat the command prompt. If you don't have a configuration file, then you may need to tell the compiler where it can find the units, for instance as follows:
ppc386 -Fuc:\pp\units\go32v2\rtl hellounder DOS, and under LINUX you could type
ppc386 -Fu/usr/lib/fpc/0.99.14/units/linux/rtl helloThis is, of course, assuming that you installed under
C:\PP
or
/usr/lib/fpc/0.99.14, respectively.
If you got no error messages, the compiler has generated an executable called hello (no extension) under LINUX, and a file hello.exe under DOS.
To execute the program, simply type :
helloIf all went well, you should see the following friendly greeting:
Hello world