Difference between revisions of "Installation"

From Freepascal Amiga wiki
Jump to: navigation, search
(You need:: corrected link to nightly download)
(Compiling fpc from Source under AROS i386)
Line 13: Line 13:
  
 
This entry needs to be either removed in case you choose the Easy Way of installation or changed to where you installed FreePascal when choosing the Expert way of installation.
 
This entry needs to be either removed in case you choose the Easy Way of installation or changed to where you installed FreePascal when choosing the Expert way of installation.
 
  
 
=== Easy way ===
 
=== Easy way ===
  
 
Easiest way to install it, but you get a mix up of the C Developer files of AROS and the Freepascal files.
 
Easiest way to install it, but you get a mix up of the C Developer files of AROS and the Freepascal files.
 
  
 
Installation:
 
Installation:
Line 37: Line 35:
 
* edit the ''bin/fpc.cfg'' and change all ''-FU:Development:''... to your pathes
 
* edit the ''bin/fpc.cfg'' and change all ''-FU:Development:''... to your pathes
 
* if you want to use the FP-Editor you have to do the same changes in ''fp/fp.cfg''
 
* if you want to use the FP-Editor you have to do the same changes in ''fp/fp.cfg''
 +
 +
 +
== Compile Freepascal from Source ==
 +
 +
A very brief description how the freepascal can be compiled from the source.
 +
 +
=== On a AROS i386 machine ===
 +
 +
Every standard i386 AROS machine is suitable hosted or native, 500 Mb RAM should be available (maybe less will work I never tried) and around 300Mb harddisk space. You need an already installed freepascal compiler (see above), because freepascal is written in pascal.
 +
 +
* Download the latest [//blog.alb42.de/fpc-aros/ Source release]
 +
* Copy the downloaded: ''fpcsrc-*.tgz'' to the folder, where you want to place the source
 +
* Extract the source with:
 +
<source lang=text>
 +
tar -zxvf fpcsrc-*.tgz
 +
</source>
 +
* A folder ''fpcsrc'' is created with the sources inside, change to the folder
 +
<source lang=text>
 +
cd fpcsrc
 +
</source>
 +
* We have to create the ''Makefiles'' for compilation. Usually the ''Makefiles'' are created by ALB already and included in the archive, but to be sure, lets create them again, if your get error messages like: ''The Makefile does not support i386-aros'' run ''fpcmake'' in this folder.
 +
<source lang=text>
 +
fpcmake -r
 +
</source>
 +
* navigate to the compiler:
 +
<source lang=text>
 +
cd compiler
 +
</source>
 +
* compile the compiler (in principle you could also start in the top dir, but then you get path problems unix <> amiga style pathes) needs long time because the compiler will be build twice, frist with the "old" already installed fpc and the again with the freshly build fpc
 +
<source lang=text>
 +
make
 +
</source>
 +
* make an assign ''PP:'' to install the compiler (and later the units as well) for example:
 +
<source lang=text>
 +
assign pp: dh1:pp
 +
</source>
 +
* Install the compiler, if all went well it can be found in ''pp:bin/i386-aros''
 +
<source lang=text>
 +
make install
 +
</source>
 +
* As next step we compile an install the rtl so we change to rtl folder compile and install it. The rtl contains very basic functions of freepascal without them the compiler is rather useless (at least the system unit is always needed). The units will be installed into ''pp:units/i386-aros/rtl''
 +
<source lang=text>
 +
cd /rtl
 +
make
 +
make install
 +
</source>
 +
* Now we have an already useable fpc, but of course we want all the additional packagaes as well (and the FP-IDE) so we compile all the packages. There are  some more aros specific in ''arosunits'' included. The units will be also installed to ''pp:units/i386-aros'' every packages with its own folder.
 +
<source lang=text>
 +
cd /packages
 +
make
 +
make install
 +
</source>
 +
* As last point we can compile the FP-IDE and install it. It will also be installed to ''pp:bin/i386-aros''.
 +
<source lang=text>
 +
cd /ide
 +
make
 +
make install
 +
</source>
 +
* if you want to compile the ''fpcmake'' util (compare 5. Point) you can find it in ''fpcsrc/utils/'' then run:
 +
<source lang=text>
 +
fpcmake
 +
make
 +
make install
 +
</source>
 +
* if you want spare some space you can clean all the compiled objects from the harddisk (or want to force a recompile after changing include files)
 +
change to the directory you want to clean (or to top directory ''fpcsrc'' if you want clean all) and run:
 +
<source lang=text>
 +
make clean
 +
</source>
 +
 +
'''Attention:'''
 +
If you change something in the code you have to compile everything what depends on:
 +
For example if you changed something in ''rtl'', you have to clean and compile the ''packages'' again or you get magic number errors when you try to use the units from packages.
 +
<source lang=text>
 +
cd /rtl
 +
make clean install
 +
cd /packages
 +
make clean install
 +
</source>
 +
Usually the compiler does not need to be recompiled (with some obvious exceptions, when you fix bugs in compiler/compiler-related rtl code).
 +
 +
=== Crosscompile from Linux ===
 +
TODO:

Revision as of 23:18, 22 November 2013

Installation of Freepascal on a AROS i386 machine

You need:

  • a fully installed AROS i386 ABIv0
  • developer tools (try to type ld in a shell if you get "ld: no input files" then everything is ok) should be included in all major distributions. If not you have to download the nightly iso from AROS page open it and copy the Developer folder to your System:
  • binary release of fpc-aros-i386

Before installing

If you want to install the FreePascal from the archive and choose not to install it over an existing installation of FreePascal (as can be found on distributions like Icaros), then you have to make sure the existing installation is 'deactivated'.

You can check where and if an current installation is present by opening a shell and type "which fpc" (without the quotes) and pressing enter. If this prints a result then a current installation of Freepascal is 'active'. If you type "path" (without quotes) and press the enter key in the shell, you could see the currently active paths. If you see a path which looks similar to Device:Drawerx/drawery/fpc/bin (especially the last part fpc/bin) then this path should be removed as well. In Icaros this can be done by editing the file s:icaros-sequence, and look for an entry that looks like "PATH Device:Drawerx/drawery/fpc/bin ADD".

This entry needs to be either removed in case you choose the Easy Way of installation or changed to where you installed FreePascal when choosing the Expert way of installation.

Easy way

Easiest way to install it, but you get a mix up of the C Developer files of AROS and the Freepascal files.

Installation:

  • Unpack the archive file to RAM:
  • Copy the contents of the folder pp to Development: (in most cases it points to System:Development)
  • open shell and type fpc if you get help for fpc then everything is ok

For Experts

Better way of installing freepascal to an own folder with all files included, but needs some more work and understanding how AROS work.

Installation:

  • make sure you removed all other/older fpc versions from the path
  • Unpack the archive file
  • in the folder pp all freepascal related programs, libaries, object, units and examples are included
  • make sure the PATH is pointed to the bin Folder
  • edit the bin/fpc.cfg and change all -FU:Development:... to your pathes
  • if you want to use the FP-Editor you have to do the same changes in fp/fp.cfg


Compile Freepascal from Source

A very brief description how the freepascal can be compiled from the source.

On a AROS i386 machine

Every standard i386 AROS machine is suitable hosted or native, 500 Mb RAM should be available (maybe less will work I never tried) and around 300Mb harddisk space. You need an already installed freepascal compiler (see above), because freepascal is written in pascal.

  • Download the latest Source release
  • Copy the downloaded: fpcsrc-*.tgz to the folder, where you want to place the source
  • Extract the source with:
tar -zxvf fpcsrc-*.tgz
  • A folder fpcsrc is created with the sources inside, change to the folder
cd fpcsrc
  • We have to create the Makefiles for compilation. Usually the Makefiles are created by ALB already and included in the archive, but to be sure, lets create them again, if your get error messages like: The Makefile does not support i386-aros run fpcmake in this folder.
fpcmake -r
  • navigate to the compiler:
cd compiler
  • compile the compiler (in principle you could also start in the top dir, but then you get path problems unix <> amiga style pathes) needs long time because the compiler will be build twice, frist with the "old" already installed fpc and the again with the freshly build fpc
make
  • make an assign PP: to install the compiler (and later the units as well) for example:
assign pp: dh1:pp
  • Install the compiler, if all went well it can be found in pp:bin/i386-aros
make install
  • As next step we compile an install the rtl so we change to rtl folder compile and install it. The rtl contains very basic functions of freepascal without them the compiler is rather useless (at least the system unit is always needed). The units will be installed into pp:units/i386-aros/rtl
cd /rtl
make
make install
  • Now we have an already useable fpc, but of course we want all the additional packagaes as well (and the FP-IDE) so we compile all the packages. There are some more aros specific in arosunits included. The units will be also installed to pp:units/i386-aros every packages with its own folder.
cd /packages
make
make install
  • As last point we can compile the FP-IDE and install it. It will also be installed to pp:bin/i386-aros.
cd /ide
make
make install
  • if you want to compile the fpcmake util (compare 5. Point) you can find it in fpcsrc/utils/ then run:
fpcmake
make
make install
  • if you want spare some space you can clean all the compiled objects from the harddisk (or want to force a recompile after changing include files)

change to the directory you want to clean (or to top directory fpcsrc if you want clean all) and run:

make clean

Attention: If you change something in the code you have to compile everything what depends on: For example if you changed something in rtl, you have to clean and compile the packages again or you get magic number errors when you try to use the units from packages.

cd /rtl
make clean install
cd /packages
make clean install

Usually the compiler does not need to be recompiled (with some obvious exceptions, when you fix bugs in compiler/compiler-related rtl code).

Crosscompile from Linux

TODO: