Difference between revisions of "Installation"

From Freepascal Amiga wiki
Jump to: navigation, search
m (Crosscompile from Linux)
(Add installation informations for other platforms)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
+
== Installation of Free Pascal on a AROS machine ==
== Installation of Freepascal on a AROS i386 machine ==
+
  
 
=== You need: ===
 
=== You need: ===
* a fully installed AROS i386 ABIv0
+
* a fully installed AROS
* 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 [//aros.sourceforge.net/nightly.php nightly iso] from AROS page open it and copy the ''Developer'' folder to your ''System:''
+
** i386: Icaros, AEROS, ABIv0 nightly
* binary release of [//blog.alb42.de/fpc-aros/ fpc-aros-i386]
+
** ARM: AEROS, ABIv0/ABIv1 nightly
 +
** x86_64: T100pUAD, ABIv1 nightly
 +
** m68k: AROSVision
 +
* 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 or contrib from AROS page extract it and copy the ''Developer'' folder to your ''System:''
 +
* binary release of [//blog.alb42.de/fpc-aros/ fpc-aros] (i386, ARM, x86_64) or [//blog.alb42.de/fpc-amigaaros-m68k/ fpc-aros-m68k]
  
 
=== Before installing ===
 
=== 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'.  
 
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".
+
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'. An Installation will deactivate this folder on next reboot, if you want to keep it as fallback you should keep the folder in mind
 
+
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 using the package system of AROS and the delivered install script.
  
 
Installation:
 
Installation:
* Unpack the archive file to ''RAM:''
+
* Unpack the archive file to a folder where you like to have the installation
* Copy the contents of the folder ''pp'' to ''Development:'' (in most cases it points to ''System:Development'')
+
* open a new shell window
 +
* navigate to the unpack destination and enter the ''pp'' folder
 +
* renaming the ''pp'' folder possible, but must be done *before* the install script is started
 +
* start the installscript by typing ''install''
 +
* reboot your computer
 
* open shell and type ''fpc'' if you get help for fpc then everything is ok
 
* open shell and type ''fpc'' if you get help for fpc then everything is ok
  
 
=== For Experts ===
 
=== 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.
+
Does not use the package system.
  
 
Installation:
 
Installation:
  
* make sure you removed all other/older fpc versions from the path
+
* Unpack the archive file to a folder where you like to have the installation
* Unpack the archive file
+
* Create an assign FreePascal: to the ''pp'' folder (for example in s:user-startup)
* in the folder ''pp'' all freepascal related programs, libaries, object, units and examples are included
+
* Add the binary location to path (for example in s:user-startup)
* make sure the ''PATH'' is pointed to the ''bin'' Folder
+
** i386: ''setpath Freepascal:bin/i386-aros add''
* edit the ''bin/fpc.cfg'' and change all ''-FU:Development:''... to your pathes
+
** ARM: ''setpath Freepascal:bin/arm-aros add''
* if you want to use the FP-Editor you have to do the same changes in ''fp/fp.cfg''
+
** x86_64: ''setpath Freepascal:bin/x86_64-aros add''
 +
** m68k: ''setpath Freepascal:bin/m68k-amiga add''
  
 +
* if you do not want to create an assign you can also edit the ''fpc.cfg'' and ''fp.cfg'' and add your personal path directly there
  
== Compile Freepascal from Source ==
+
== Compile Freepascal i386-aros from Source ==
  
A very brief description how freepascal can be compiled from the source.
+
A very brief description how freepascal for i386-aros can be compiled from the source. For the other targets are comparable.
  
 
=== On a AROS i386 machine ===
 
=== On a AROS i386 machine ===
Line 45: Line 52:
 
Every standard i386 AROS machine is suitable hosted or native, 500 MiB RAM should be available (maybe less will work I never tried) and around 300MiB harddisk space. You need an already installed freepascal compiler (see above), because freepascal is written in pascal.
 
Every standard i386 AROS machine is suitable hosted or native, 500 MiB RAM should be available (maybe less will work I never tried) and around 300MiB 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]
+
* Get the latest freepascal source
* Copy the downloaded: ''fpcsrc-*.tgz'' to the folder, where you want to place the source
+
** via svn: ''svn checkout [http://svn.freepascal.org/svn/fpc/trunk http://svn.freepascal.org/svn/fpc/trunk] fpc''
* Extract the source with: (replace the * with the date used the the downloaded file for example: ''fpcsrc-20131120.tgz'')
+
** via zip: from the [http://freepascal.org/develop.var Freepascal Development Page]
 +
* A folder ''fpc'' is created with the sources inside, change to the folder
 
<source lang=text>
 
<source lang=text>
tar -zxvf fpcsrc-*.tgz
+
cd fpc
</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 you get error messages like ''The Makefile does not support i386-aros'' when running ''make'' run ''fpcmake'' in the folder where the error appear.
+
<source lang=text>
+
fpcmake -r
+
 
</source>
 
</source>
 
* navigate to the compiler (in principle you could also start in the top dir, but then you get path problems unix <> amiga style pathes):
 
* navigate to the compiler (in principle you could also start in the top dir, but then you get path problems unix <> amiga style pathes):
Line 75: Line 75:
 
make install
 
make install
 
</source>
 
</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''
+
* 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 Free Pascal 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>
 
<source lang=text>
 
cd /rtl
 
cd /rtl
Line 100: Line 100:
 
</source>
 
</source>
 
* If you want save some space you can clean all the compiled objects from the harddisk (or want to force a recompile after changing include files)
 
* If you want save 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:
+
change to the directory you want to clean (or to top directory ''fpc'' if you want clean all) and run:
 
<source lang=text>
 
<source lang=text>
 
make clean
 
make clean
Line 119: Line 119:
 
=== Crosscompile from Linux ===
 
=== Crosscompile from Linux ===
  
This section describe how the freepascal compiler with all units can be created under a linux system. This could be important if you start without a working freepascal at aros.
+
This section describe how the freepascal compiler with all units can be created under a linux system. This could be important if you start without a working Free Pascal at AROS.
  
 
* A working linux system (CPU is not important, i386 and x64 tested other platform might work)
 
* A working linux system (CPU is not important, i386 and x64 tested other platform might work)
* A freepascal compiler for this linux (Version >= 2.4) (e.g. at Ubuntu/Debian <code lang=shell>apt-get install fpc</code>)
+
* A freepascal compiler for this linux (Version = 3.0) (e.g. at Ubuntu/Debian <code lang=shell>apt-get install fpc</code>)
 
* You need a the pc-i386-sdk for aros from the [http://aros.sourceforge.net/de/download.php AROS Page]
 
* You need a the pc-i386-sdk for aros from the [http://aros.sourceforge.net/de/download.php AROS Page]
 
* Unpack the sdk: (replace the * by the date of the downloaded file) it creates a folder with the name as the file, change into the directory
 
* Unpack the sdk: (replace the * by the date of the downloaded file) it creates a folder with the name as the file, change into the directory
Line 137: Line 137:
 
export PATH=$PATH:/usr/local/aros-sdk/bin/
 
export PATH=$PATH:/usr/local/aros-sdk/bin/
 
</source>
 
</source>
* Download the [http://blog.alb42.de/fpc-aros/ FPC for AROS Source]
+
* Get the latest freepascal source
* Unpack the file to a directory you prefer, change to the created directory
+
** via svn: ''svn checkout [http://svn.freepascal.org/svn/fpc/trunk http://svn.freepascal.org/svn/fpc/trunk] fpc''
<source lang=text>
+
** via zip: from the [http://freepascal.org/develop.var Freepascal Development Page]
tar -zvxf fpcsrc-*-tgz
+
* A folder ''fpc'' is created with the sources inside, change to the folder
cd fpcsrc
+
</source>
+
* As first we have to create a <code lang=shell>fpcmake</code> which supports i386-aros, to do it change to the fpc make directory
+
<source lang=text>
+
cd utils/fpcm
+
</source>
+
* start fpcmake to create the makefile and compile the fpcmake tool
+
<source lang=text>
+
fpcmake
+
make
+
</source>
+
* now we can go to main directory of fpc and create all the Makefiles for all platforms (in principle could also do for the two needed platforms but for all is easier)
+
 
<source lang=text>
 
<source lang=text>
cd ../..
+
cd fpc
utils/fpcm/fpcmake -r -Tall
+
 
</source>
 
</source>
* Now everything is set for make the compiler, we choose <code>zipinstall</code> to create directly a packed version <code lang=shell>fpc-2.7.1.i386-aros.tar.gz</code>
+
* Now everything is set for make the compiler, we choose <code>zipinstall</code> to create directly a packed version <code lang=shell>fpc-3.1.1.i386-aros.tar.gz</code>
 
<source lang=text>
 
<source lang=text>
 
make zipinstall CPU_TARGET=i386 OS_TARGET=aros
 
make zipinstall CPU_TARGET=i386 OS_TARGET=aros
 
</source>
 
</source>
* now you have a complete archive with the AROS freepascal compiler with all units and utilities
+
* now you have a complete archive with the AROS freepascal compiler with all units and some utilities

Latest revision as of 18:23, 5 January 2017

Installation of Free Pascal on a AROS machine

You need:

  • a fully installed AROS
    • i386: Icaros, AEROS, ABIv0 nightly
    • ARM: AEROS, ABIv0/ABIv1 nightly
    • x86_64: T100pUAD, ABIv1 nightly
    • m68k: AROSVision
  • 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 or contrib from AROS page extract it and copy the Developer folder to your System:
  • binary release of fpc-aros (i386, ARM, x86_64) or fpc-aros-m68k

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'. An Installation will deactivate this folder on next reboot, if you want to keep it as fallback you should keep the folder in mind

Easy way

Easiest way to install it using the package system of AROS and the delivered install script.

Installation:

  • Unpack the archive file to a folder where you like to have the installation
  • open a new shell window
  • navigate to the unpack destination and enter the pp folder
  • renaming the pp folder possible, but must be done *before* the install script is started
  • start the installscript by typing install
  • reboot your computer
  • open shell and type fpc if you get help for fpc then everything is ok

For Experts

Does not use the package system.

Installation:

  • Unpack the archive file to a folder where you like to have the installation
  • Create an assign FreePascal: to the pp folder (for example in s:user-startup)
  • Add the binary location to path (for example in s:user-startup)
    • i386: setpath Freepascal:bin/i386-aros add
    • ARM: setpath Freepascal:bin/arm-aros add
    • x86_64: setpath Freepascal:bin/x86_64-aros add
    • m68k: setpath Freepascal:bin/m68k-amiga add
  • if you do not want to create an assign you can also edit the fpc.cfg and fp.cfg and add your personal path directly there

Compile Freepascal i386-aros from Source

A very brief description how freepascal for i386-aros can be compiled from the source. For the other targets are comparable.

On a AROS i386 machine

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

cd fpc
  • navigate to the compiler (in principle you could also start in the top dir, but then you get path problems unix <> amiga style pathes):
cd compiler
  • Compile the compiler. It 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 Free Pascal 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 packages as well (and the FP-IDE). 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) navigate to fpcsrc/utils/fpcm then run:
fpcmake
make
make install
  • If you want save 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 fpc 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

This section describe how the freepascal compiler with all units can be created under a linux system. This could be important if you start without a working Free Pascal at AROS.

  • A working linux system (CPU is not important, i386 and x64 tested other platform might work)
  • A freepascal compiler for this linux (Version = 3.0) (e.g. at Ubuntu/Debian apt-get install fpc)
  • You need a the pc-i386-sdk for aros from the AROS Page
  • Unpack the sdk: (replace the * by the date of the downloaded file) it creates a folder with the name as the file, change into the directory
tar -zvxf AROS-*-pc-i386-sdk.tar.bz2
cd AROS-*-pc-i386-sdk
  • Compile and install the SDK (must be done as root, so change to root or use sudo)
./AROS-SDK-Install
  • Add path to the SDK bin folder
export PATH=$PATH:/usr/local/aros-sdk/bin/
cd fpc
  • Now everything is set for make the compiler, we choose zipinstall to create directly a packed version fpc-3.1.1.i386-aros.tar.gz
make zipinstall CPU_TARGET=i386 OS_TARGET=aros
  • now you have a complete archive with the AROS freepascal compiler with all units and some utilities