„Setting up Lazarus IDE for Amiga Crosscompiling” változatai közötti eltérés

Innen: amigaspirit.hu - pegasos.hu Wiki
Ugrás a navigációhozUgrás a kereséshez
(initial version)
 
(added pics)
4. sor: 4. sor:


As a first step, make sure, that in the menu ''Tools -> Options...'' the ''Compiler Executable (e.g. fpc)'' option points to the '''fpc''' compiler frontend (e.g. '''/usr/local/bin/fpc'''), and '''NOT''' to a native compiler directly (e.g. ppc386, or ppcx64).
As a first step, make sure, that in the menu ''Tools -> Options...'' the ''Compiler Executable (e.g. fpc)'' option points to the '''fpc''' compiler frontend (e.g. '''/usr/local/bin/fpc'''), and '''NOT''' to a native compiler directly (e.g. ppc386, or ppcx64).
[[Image:Lazarus-amiga-setup-01.png|640px|Compiler frontend setup]]


If this is done, make a new Lazarus project for your Amiga application. The rest of the options will be applied to project specific options.
If this is done, make a new Lazarus project for your Amiga application. The rest of the options will be applied to project specific options.
9. sor: 13. sor:
Go to the ''Project Options'' window, available under the menu ''Project -> Project Options...'' and apply the following settings. First makes sure the Lazarus passes the right CPU target and OS target to the compiler. This is possible under the ''Compiler Options > Config and Target'' tab. For classic Amiga target, set these to '''Amiga''' and '''m68k''' respectively. Other Amiga-like systems use their respective combinations.
Go to the ''Project Options'' window, available under the menu ''Project -> Project Options...'' and apply the following settings. First makes sure the Lazarus passes the right CPU target and OS target to the compiler. This is possible under the ''Compiler Options > Config and Target'' tab. For classic Amiga target, set these to '''Amiga''' and '''m68k''' respectively. Other Amiga-like systems use their respective combinations.


Second, go to the tab ''Compiler Options > Custom Options'', and add the following options to the ''Custom Options'' field:
[[Image:Lazarus-amiga-setup-02.png|640px|Compiler target setup]]
 
 
Then, under the tab ''Compiler Options > Custom Options'', add the following options to the ''Custom Options'' field:
 
[[Image:Lazarus-amiga-setup-03.png|800px|Compiler custom options]]




20. sor: 29. sor:
* '''-Fu''' option should point to the directory, where all the pre-compiled RTL units reside.
* '''-Fu''' option should point to the directory, where all the pre-compiled RTL units reside.


Any other FPC option can be applied here on demand.
Any additional FPC option can be applied here on demand.
 


And finally, Lazarus enables use of the '''lineinfo''' unit for new projects by default. This is currently not available for classic Amiga, therefore must be disabled, because it would cause build errors. Other Amiga-like systems can skip this step. This can be done under ''Compiler Options -> Debugging'' by disabling the option ''Display line numbers in run-time error backtraces (-gl)''.


[[Image:Lazarus-amiga-setup-04.png|640px|Disabling unwanted option]]


Third, Lazarus enables use of the '''lineinfo''' unit for new projects by default. This is currently not available for classic Amiga, therefore must be disabled, because it would cause build errors. Other Amiga-like systems can skip this step. This can be done under ''Compiler Options -> Debugging'' by disabling the option ''Display line numbers in run-time error backtraces (-gl)''.


If you have done everything correctly Clicking ''Show Options'' in the bottom of the ''Project Options'' window should show something like this. This window shows the invoked compiler binary and all the options Lazarus will pass to it.


[[Image:Lazarus-amiga-compiler-options.png|640px|Showing compiler options]]


If you have done everything correctly Clicking ''Show Options'' in the bottom of the ''Project Options'' window should show something like this. This window shows the invoked compiler binary and all the options Lazarus will pass to it.


Note: while setting up this option and closing the Project Options window, the following requester might appear. This is caused by a minor issue in Lazarus, and '''it's safe to ignore''', if the settings are otherwise correct.
Note: while setting up this option and closing the Project Options window, the following requester might appear. This is caused by a minor issue in Lazarus, and '''it's safe to ignore''', if the settings are otherwise correct.
[[Image:Lazarus-amiga-setup-error-ignore.png|640px|Error to ignore]]


If you have done everything correctly, invoking the menu ''Run -> Build'' will result a successful build for classic Amiga, or your chosen target system.
If you have done everything correctly, invoking the menu ''Run -> Build'' will result a successful build for classic Amiga, or your chosen target system.
[[Image:Lazarus-amiga-success.png|640px|Amiga Build Success]]

A lap 2019. január 30., 13:45-kori változata

This page provides a brief summary of how to setup the Free Pascal Amiga crosscompiler to be used with Lazarus IDE from macOS, Linux, or Windows. It primarily applies to classic Amiga, but can be used with all Amiga-like systems with minor adaptations and changes.

This article expect that you have already set up Free Pascal Compiler and Lazarus IDE on the host system, and it's functioning perfectly, it can build native binaries for the host. It also assumes that the Amiga crosscompiler archives are is obtained (binary builds are available here) including the required GNU as/ld and/or vlink and vasm binaries, capable of running on the host system, producing binaries for the target system, in this case classic Amiga.

As a first step, make sure, that in the menu Tools -> Options... the Compiler Executable (e.g. fpc) option points to the fpc compiler frontend (e.g. /usr/local/bin/fpc), and NOT to a native compiler directly (e.g. ppc386, or ppcx64).

Compiler frontend setup


If this is done, make a new Lazarus project for your Amiga application. The rest of the options will be applied to project specific options.

Go to the Project Options window, available under the menu Project -> Project Options... and apply the following settings. First makes sure the Lazarus passes the right CPU target and OS target to the compiler. This is possible under the Compiler Options > Config and Target tab. For classic Amiga target, set these to Amiga and m68k respectively. Other Amiga-like systems use their respective combinations.

Compiler target setup


Then, under the tab Compiler Options > Custom Options, add the following options to the Custom Options field:

Compiler custom options


  • -Cp option can be used to specify the target m68k CPU type. Note that you will need the runtime library units compiled with the same options.
  • -Cf option is optional, can be used to specify the target m68k FPU type. Note that you will need the runtime library units to be compiled with the same options. By default, FPC compiles without utilizing FPU instructions.
  • -XV enables linking with vlink. Omit this option if you want to use GNU LD.
  • -Avasm enables linking with vasm. Omit this option if you want to use GNU AS.
  • -FD option should point to the directory, where GNU as/ld or vasm/vlink for Amiga can be found.
  • -Xp option should point to the directory, where the ppcross68k cross-compiler binary resides.
  • -Fu option should point to the directory, where all the pre-compiled RTL units reside.

Any additional FPC option can be applied here on demand.


And finally, Lazarus enables use of the lineinfo unit for new projects by default. This is currently not available for classic Amiga, therefore must be disabled, because it would cause build errors. Other Amiga-like systems can skip this step. This can be done under Compiler Options -> Debugging by disabling the option Display line numbers in run-time error backtraces (-gl).

Disabling unwanted option


If you have done everything correctly Clicking Show Options in the bottom of the Project Options window should show something like this. This window shows the invoked compiler binary and all the options Lazarus will pass to it.

Showing compiler options


Note: while setting up this option and closing the Project Options window, the following requester might appear. This is caused by a minor issue in Lazarus, and it's safe to ignore, if the settings are otherwise correct.

Error to ignore


If you have done everything correctly, invoking the menu Run -> Build will result a successful build for classic Amiga, or your chosen target system.

Amiga Build Success