%general-entities; ]> $Date$ FreePascal-&freepascal-version; FreePascal Binary Binary FreePascal Information FreePascal is a compiler software used to translate Pascal source code to executable programs. An introductory Pascal program looks like: program Hello; begin writeln('Hello world!'); end. The FreePascal package does not only contain the compiler itself but also a complete semi-graphical, text based IDE. This IDE can be operated using keyboard commands and by mouse interaction. The IDE is constructed with a toolkit previously named Turbo Vision which was introduced by Borland somewhere back in the MS-DOS age together with Turbo Pascal 6.0 - that was in Nov. 1990. This toolbox is available for own programs, too. Creating the FreePascal compiler from source requires a FreePascal compiler to be available. This is a circular dependency which can be solved by using a precompiled package. To start, we set up a binary installation of FreePascal created by the FreePascal development team. It is installed in the /opt directory. Using this temporary compiler installation, the compiler can be created from source. After this step is done, the temporary compiler can be easily removed. &lfs110a_checked; Binary Package Information Binary download (x86): Download MD5 sum: &fpc-bin-i686-md5sum; Download size (binary): &fpc-bin-i686-size; Estimated disk space required: &fpc-bin-i686-bldsize; Binary download (x86_64): Download MD5 sum: &fpc-bin-x86-md5sum; Download size (binary): &fpc-bin-x86-size; Estimated disk space required: &fpc-bin-x86-bldsize; Source Package Information Source download: Download MD5 sum: &fpc-src-md5sum; Download size (binary): &fpc-src-size; Estimated disk space required: &fpc-src-bldsize; Additional Downloads Optional patch (Required if building on i686 systems): FreePascal Dependencies (with static library libgdb.a) User Notes: Installation of FreePascal While installation it is required to have administrator privileges. It is assumed that the current user is allowed to use sudo to gain full privileges. Even a temporary binary compiler must be installed prior to compile the compiler from the source, it is assumed that the FreePascal sources has been extracted and the current directory has been changed to it just like as usual. In case there is a FreePascal compiler installed allready, the temporary binary is not required. The installed compiler should be appropriate to compile the sources if the installed version is not too old. Begin by extracting the appropriate binary tarball for your architecture and changing to the extracted directory. This extraction is performed within the extracted source directory. Install the binary FreePascal and remove some unused files with the following commands: case "$(uname -m)" in i?86) tar -xf ../../fpc-&freepascal-bin-version;.i386-linux.tar && cd fpc-&freepascal-bin-version;.i386-linux ;; x86_64) tar -xf ../../fpc-&freepascal-bin-version;-x86_64-linux.tar && cd fpc-&freepascal-bin-version;-x86_64-linux ;; esac && rm demo.tar.gz && rm doc-pdf.tar.gz && sed -e 's;PREFIX=/usr;test -z "$PREFIX" \&\& &;' -i install.sh Prepare the install directory for the temporary compiler and make it writable to the current user by executing as the root user: install -dm755 -o $(id -u) &fpc-tmp-target; Install the temporary compiler: yes "" | { PREFIX=&fpc-tmp-target; ./install.sh; } Remove the extracted binary objects: cd .. && case "$(uname -m)" in i?86) rm -rf fpc-&freepascal-bin-version;.i386-linux ;; x86_64) rm -rf fpc-&freepascal-bin-version;-x86_64-linux ;; esac && export PATH=&fpc-tmp-target;/bin:$PATH The binary version is now installed in &fpc-tmp-target; and can be used to create the compiler and utilities from source. Fix invalid path for man pages: sed -e "/^INSTALL_MANDIR=/ s;/man;/share/man;" \ -i install/man/Makefile If building on i686 systems (32-bit), a patch is required to overcome an issue with glibc-2.34. cd fpcsrc && patch -Np1 -i ../../fpc-&freepascal-version;-glibc_2.34-2.patch && cd .. Compile the FreePascal compiler and tools by executing the following commands: make clean && make build Install the FreePascal compiler and tools by executing the following commands as the root user. Make sure that the temporary compiler is in PATH: make -j1 PREFIX=/usr install && case "$(uname -m)" in i?86) ln -svf /usr/lib/fpc/&freepascal-version;/ppc386 /usr/bin/ ;; x86_64) ln -svf /usr/lib/fpc/&freepascal-version;/ppcx64 /usr/bin/ ;; esac Now that the compiler has been created from source, the temporary compiler in &fpc-tmp-target; can be removed. Execute the following commands as the root user: rm -rf /etc/fppkg* && rm -rf /etc/fpc.* && rm -rf $HOME/{.fppkg,.fpc.cfg,.config/fppkg.cfg} && rm -rf &fpc-tmp-target; You may also want to remove the &fpc-tmp-target; entry from PATH now. Configuring FreePascal A default configuration file /etc/fpc.cfg can be created by a tool which is part of the compiler suite. Generate the default config file as the root user: /usr/lib/fpc/&freepascal-version;/samplecfg /usr/lib/fpc/&freepascal-version; /etc && cat >> /etc/fpc.cfg <<EOF #ifdef cpux86_64 # for x86_64 use -fPIC by default -Cg #endif EOF If you are going to use QT (most likely when building Lazarus with the QT library), add the QT library path to the config as the root user: sed -e "/^-Fl\/usr\/lib\/fpc/a -Fl/opt/qt5/lib" \ -i /etc/fpc.cfg It is highly recommended that the compiler sources are available for later use. Since the sources are available on disk already they can be used but some binaries built in the source tree should be removed first: make clean To copy the source, execute the following command as the root user: mv fpcsrc /usr/lib/fpc/src Contents Installed Program Installed Libraries Installed Directories fpc, fp, samplecfg, ... None /usr/lib/fpc Short Descriptions fp FreePascal text based IDE fp fpc FreePascal compiler frontend fpc fpcmake FreePascal make utility fpcmake samplecfg Utility to create a default configuration file samplecfg