Difference between revisions of "fpcup"

From Free Pascal wiki
Jump to navigationJump to search
(→‎Troubleshooting: Tools > Rescan FPC Source Directory)
(→‎External links: dead link)
 
(72 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 +
{{LanguageBar}}
 +
 
== About ==
 
== About ==
fpcup is a tool that automates running a subversion client to build FPC and/or Lazarus in a self-contained directory structure. Think of it as a batch file on steriods that does the boring svn work for you.
+
fpcup is a tool that automates running a subversion client to build FPC and/or Lazarus in a self-contained directory structure. It is meant as a thin wrapper around the regular manual svn up/make/make install build process.
 +
 
 +
It was made by and maintained by the late Reinier Olislagers (BigChimp).
 +
His version can still be found at [https://bitbucket.org/reiniero/fpcup fpcup]
 +
 
 +
Current maintained version can be found at [https://github.com/LongDirtyAnimAlf/Reiniero-fpcup new fpcup]
 +
 
 +
Lazarus 1.st time users will probably
 +
* run the downloaded fpcup binary (e.g. '''fpcup_linux_x64''' on a Linux 64 bit). Once that installed a working Lazarus IDE, one could
 +
* download the fpcup Pascal project (i.e. the sources, in addition to the above binary) and
 +
* compile those to be able to run the native fpcup GUI that comes with that fpcup Pascal project.
 +
* Later, one may want to switch to one's favourite SVN GUI (possibly kdesvn), using 'Apache Subversion' with the SVN URL:  '''<nowiki>http://svn.freepascal.org/svn/fpc/trunk</nowiki>'''
 +
** in the Linux app  kdesvn  you can ''OPEN'' the URL  '''<nowiki>https://svn.code.sf.net/p/lazarus-ccr/svn</nowiki>'''  and once loaded, bookmark it. Then ''CHECKOUT'' stuff you need to your local hard drive.
 +
 
  
 
On Windows, it can also serve as a "bare metal" installer: it can download a subversion client, binutils (make.exe etc).
 
On Windows, it can also serve as a "bare metal" installer: it can download a subversion client, binutils (make.exe etc).
 +
 +
Think of it as a batch file on steroids that does the boring svn work for you.
  
 
fpcup allows maintaining multiple different FPC/Lazarus combinations.
 
fpcup allows maintaining multiple different FPC/Lazarus combinations.
Line 10: Line 27:
 
The fpcup GUI which is provided with the source code:
 
The fpcup GUI which is provided with the source code:
 
[[Image:fpcupgui.png]]
 
[[Image:fpcupgui.png]]
 +
 +
{{Note|Here is a confortable successor to fpcup
 +
* [[fpcupdeluxe]]}}
  
 
== Ready to run ==
 
== Ready to run ==
Line 23: Line 43:
 
C:\development\lazarus        # Lazarus trunk by default
 
C:\development\lazarus        # Lazarus trunk by default
 
</syntaxhighlight>
 
</syntaxhighlight>
On Linux/OSX/BSD, a similar layout is used under ~
+
On Linux/macOS/BSD, a similar layout is used under ~ (the user's home directory).
  
 
fpcup will create a shortcut to the installed Lazarus on your desktop.
 
fpcup will create a shortcut to the installed Lazarus on your desktop.
Line 32: Line 52:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
On *nix:
+
On UNIX:
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
#replace fpcup_linux_x86 with your actual fpcup filename of course if not on linux x86
+
#replace fpcup_linux_x86 with your actual fpcup filename of course if not on linux x86, e.g. 64-bit Linux or other variant
chmod u+rx fpcup_linux_x86 #make executable (one time only action)
+
 
./fpcup_linux_x86 #run
+
chmod u+rx fpcup_linux_x86  
 +
#make executable (one time only action)
 +
 
 +
./fpcup_linux_x86  
 +
#run
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
Next time, you can either run the exact same command, or run the fpcup_update desktop shortcut or home directory shell script/batch file.
 
Next time, you can either run the exact same command, or run the fpcup_update desktop shortcut or home directory shell script/batch file.
 +
 +
{{Note|fpcup is set up to compile FPC 3.0 fixes and Lazarus 1.4 fixes by default}}
  
 
== Documentation ==
 
== Documentation ==
fpcup has a -h option, a [https://bitbucket.org/reiniero/fpcup/overview readme.txt] and [https://bitbucket.org/reiniero/fpcup/downloads/fpcup.html fpcup.html] with development notes (see the [https://bitbucket.org/reiniero/fpcup/src source code repository] for the latest readme.txt and fpcup.html).  
+
fpcup has  
 +
* a -h option
 +
* a [https://raw.githubusercontent.com/LongDirtyAnimAlf/Reiniero-fpcup/master/Readme.TXT readme.txt]  
 +
 
 +
See the [https://github.com/LongDirtyAnimAlf/Reiniero-fpcup source code repository] for the latest readme.txt.
  
 
To make it easier to get user contributions for documentation/tips, this wiki page has been created. Please feel free to add your own examples etc.
 
To make it easier to get user contributions for documentation/tips, this wiki page has been created. Please feel free to add your own examples etc.
Line 59: Line 89:
  
 
Of course, you can use the anchordocking=1 module setting in any .ini section.
 
Of course, you can use the anchordocking=1 module setting in any .ini section.
 +
 +
You can also just run fpcup with just a single module: fpcup --only="anchordocking".
  
 
=== Building only FPC ===
 
=== Building only FPC ===
Line 67: Line 99:
 
<syntaxhighlight lang="ini">
 
<syntaxhighlight lang="ini">
 
[fixes26]
 
[fixes26]
; FPC 2.6 fixes only (no Lazarus)
+
; FPC 2.6 fixes (no Lazarus):
 
fpcdir=c:\development\fpcfixes26
 
fpcdir=c:\development\fpcfixes26
 +
; replace e.g. with
 +
; http://svn.freepascal.org/svn/fpc/trunk
 +
; for FPC trunk
 
fpcurl=http://svn.freepascal.org/svn/fpc/branches/fixes_2_6
 
fpcurl=http://svn.freepascal.org/svn/fpc/branches/fixes_2_6
; Let's specify Lazarus info in case we ever want to add lazarus
+
; Let's specify Lazarus info in case we ever want to add Lazarus
 
lazdir=c:\development\lazarus12_fixes26
 
lazdir=c:\development\lazarus12_fixes26
; Just an example: build Lazarus 1.2:
+
; Just an example: build Lazarus 1.2 - if we're building Lazarus
 
lazurl=http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2
 
lazurl=http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2
 
primary-config-path=c:\development\configlazarus12_fixes26
 
primary-config-path=c:\development\configlazarus12_fixes26
Line 111: Line 146:
  
 
You can avoid compiling lcl.chm by generating it one time (or copying over an existing file) and making the file read-only.
 
You can avoid compiling lcl.chm by generating it one time (or copying over an existing file) and making the file read-only.
 +
 +
== OS-specific notes ==
 +
Specific notes for operating systems are given below if they are different from the general instructions.
 +
 +
=== Running on Raspberry Pi Raspbian ===
 +
Open your settings file (e.g. <code>settings.ini</code> and include ''at least'' these lines
 +
<syntaxhighlight lang="ini">
 +
; ARMHF needs FPC >= 3.0; 2.6.x does not work (unless it is a patched version)
 +
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
 +
; if using armhf, you MUST specify -dFPC_ARMHF in the FPC options
 +
fpcopt="-dFPC_ARMHF -CaEABIHF -CpARMV6 -CfVFPV2"
 +
</syntaxhighlight>
 +
 +
=== Running on Windows 2000 ===
 +
Normally, fpcup tries to download an svn client if it cannot find an existing client. This client will not work on Windows 2000 due to missing libraries, so please download and install an svn command line client - such as SlikSVN 1.6.16.
  
 
== Cross compilers ==
 
== Cross compilers ==
 
fpcup not only lets you install native FPC/Lazarus, but will also build cross compilers for you.
 
fpcup not only lets you install native FPC/Lazarus, but will also build cross compilers for you.
  
For most cross compilers, you do need to have the relevant binutils that are specific for the host<>target system.
+
First, you should have set up your normal FPC (and optionally Lazarus) using fpcup. Then you let fpcup generate the cross compiler.
 +
 
 +
For most cross compilers, you do need to have the relevant binutils that are specific for the host<>target system (so not the normal binutils but cross binutils).
  
 
Often, you will also need libraries in target system format if you want to compile programs (e.g. Linux Qt or Gtk libraries for the relevant CPU if you're crosscompiling for Linux).
 
Often, you will also need libraries in target system format if you want to compile programs (e.g. Linux Qt or Gtk libraries for the relevant CPU if you're crosscompiling for Linux).
Line 141: Line 193:
 
|FreeBSD x64
 
|FreeBSD x64
 
|FreeBSD x86
 
|FreeBSD x86
|OSX
+
|macOS
 
|AIX powerpc32
 
|AIX powerpc32
 
|-
 
|-
Line 150: Line 202:
 
|
 
|
 
|
 
|
|
+
|needs binutils,libs
 
|needs binutils,libs
 
|needs binutils,libs
 
|needs binutils,libs
 
|needs binutils,libs
Line 176: Line 228:
 
|Windows x64
 
|Windows x64
 
|no
 
|no
|needs binutils
+
|no due to FPC limitations
|yes
+
|needs FPC trunk
 
|N/A
 
|N/A
 
|needs binutils,libs
 
|needs binutils,libs
Line 193: Line 245:
 
|
 
|
 
|yes, built in
 
|yes, built in
|
+
|yes, built in
 
|N/A
 
|N/A
 
|
 
|
Line 208: Line 260:
 
|
 
|
 
|yes, built in
 
|yes, built in
|
+
|yes, built in
 
|
 
|
 
|N/A
 
|N/A
Line 294: Line 346:
 
|See Any
 
|See Any
 
|-
 
|-
|OSX
+
|macOS
 
|
 
|
 
|
 
|
Line 308: Line 360:
 
|N/A
 
|N/A
 
|See Any
 
|See Any
|-
 
|AIX powerpc32
 
|
 
|
 
|
 
|
 
|
 
|
 
|see Any
 
|see Any
 
|
 
|
 
|
 
|
 
|N/A
 
 
|}
 
|}
 
  
 
(With thanks to [[FPSpreadsheet]]'s spreadsheet to wikitable conversion tool, see e.g. examples\fpsgrid)
 
(With thanks to [[FPSpreadsheet]]'s spreadsheet to wikitable conversion tool, see e.g. examples\fpsgrid)
Line 524: Line 560:
  
 
=== Linux ARM cross compiler ===
 
=== Linux ARM cross compiler ===
Once you have set up a regular FPC compiler, you can add an Linux on ARM cross compiler (e.g. for a Raspbian/Raspberry Pi).
+
Once you have set up a regular FPC compiler, you can add a Linux on ARM cross compiler (e.g. for a Raspbian/Raspberry Pi).
  
 
==== Required files ====
 
==== Required files ====
 
* Linux/Unix build or install the relevant crossbinutils (Linux, unix)  
 
* Linux/Unix build or install the relevant crossbinutils (Linux, unix)  
 
* Windows: download the binutils from http://svn2.freepascal.org/svn/fpcbuild/binaries/i386-win32 (the files starting with arm-linux-) Put them into <syntaxhighlight lang="dos">
 
* Windows: download the binutils from http://svn2.freepascal.org/svn/fpcbuild/binaries/i386-win32 (the files starting with arm-linux-) Put them into <syntaxhighlight lang="dos">
C:\development\cross\lib\arm-linux
+
C:\development\cross\bin\arm-linux
 
</syntaxhighlight>
 
</syntaxhighlight>
  
Line 551: Line 587:
 
grep -i "ld script" *
 
grep -i "ld script" *
 
</syntaxhighlight>
 
</syntaxhighlight>
Remove those .so and copy over (or symlink) the .so.x to .so in order for the linker to find them
+
Remove those .so and copy over (or symlink) the files the script point to (e.g. .so.x files) to .so so that the linker can find them
 +
 
 
Examples:
 
Examples:
libpthread.so
+
* libpthread.so
libc.so
+
* libc.so
libgcc_s.so
+
* libgcc_s.so
  
put them into your cross lib path, e.g. on Windows
+
Put the libs into your cross lib path, e.g. on Windows
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
C:\development\cross\lib\arm-linux
 
C:\development\cross\lib\arm-linux
Line 620: Line 657:
 
;crossopt="-CaEABIHF -Cparmv7 -CfVFPv3"
 
;crossopt="-CaEABIHF -Cparmv7 -CfVFPv3"
 
ostarget=linux
 
ostarget=linux
; we only need to do Lazarus as FPC won't change here
+
; Only build FPC
 
only=FPCCleanOnly,FPCBuildOnly
 
only=FPCCleanOnly,FPCBuildOnly
 
skip=FPCGetOnly,lazbuild,bigide,useride
 
skip=FPCGetOnly,lazbuild,bigide,useride
Line 639: Line 676:
 
<syntaxhighlight lang="dos">
 
<syntaxhighlight lang="dos">
 
fpc -Parm -Tlinux test.pas
 
fpc -Parm -Tlinux test.pas
 +
</syntaxhighlight>
 +
(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)
 +
 +
=== Linux i386 cross ===
 +
On an x64 Linux system (or any system with support for i386 Linux libraries/cross binutils), once you have set up a regular FPC compiler, you can add a Linux i386 cross compiler.
 +
 +
==== Required files ====
 +
* Linux
 +
** build or install the relevant crossbinutils
 +
** build or install the relevant i386 libraries for your code (e.g. libc)
 +
* other systems: not tested yet
 +
 +
==== Settings ====
 +
Open your settings file or add a new file, settings.ini.
 +
 +
<syntaxhighlight lang="dos">
 +
[linuxi386]
 +
; a full fpcup run must have been done before
 +
; does not update packages
 +
; please adjust paths etc
 +
fpcdir=~/development/fpctrunk
 +
fpcopt=""
 +
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
 +
lazdir=lazdir=~/development/lazarus
 +
primary-config-path=~/development/lazarussettings
 +
lazlinkname=""
 +
fpcuplinkname=""
 +
fpcbootstrapdir=~/development/fpcbootstrap
 +
noconfirm=true
 +
keeplocalchanges=true
 +
cputarget=i386
 +
ostarget=linux
 +
only=FPCCleanOnly,FPCBuildOnly
 +
skip=FPCGetOnly,lazbuild,bigide,useride
 +
</syntaxhighlight>
 +
 +
 +
==== Creating and using the cross compiler ====
 +
Then generate the cross compiler with
 +
<syntaxhighlight lang="dos">
 +
fpcup --inifile=settings.ini --inisection=linuxi386
 +
</syntaxhighlight>
 +
 +
Now you can run a test compile, compiling a file test.pas with
 +
<syntaxhighlight lang="dos">
 +
fpc -Pi386 -Tlinux test.pas
 
</syntaxhighlight>
 
</syntaxhighlight>
 
(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)
 
(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)
Line 701: Line 784:
  
 
== Download ==
 
== Download ==
The official site is at:
+
The current maintained version can be found at:
 +
https://github.com/LongDirtyAnimAlf/Reiniero-fpcup
 +
 
 +
The original site is at:
 
https://bitbucket.org/reiniero/fpcup/downloads
 
https://bitbucket.org/reiniero/fpcup/downloads
 +
(not maintained at the moment)
 +
 +
{{Warning|Windows users, please download the 32 bit fpcup version even if you are on 64 bit Windows unless you know what you are doing. See [[Windows_Programming_Tips#FPC_2.6.x.2FLazarus_warning_.28Missing_support_for_SEH.29|this warning about FPC 2.6.x x64.]] }}
  
 
== License ==
 
== License ==
Line 709: Line 798:
 
== Troubleshooting ==
 
== Troubleshooting ==
 
When you hit errors with fpcup:
 
When you hit errors with fpcup:
 +
* RTFM (read the fine manual)
 +
* If compiling Lazarus, make sure lazarus and lhelp are not running.
 
* If you have a working Lazarus, run Tools > Rescan FPC Source Directory
 
* If you have a working Lazarus, run Tools > Rescan FPC Source Directory
* Try running fpcup with <code>--verbose</code> to see what's going on exactly.
+
* Try running fpcup with <code>--verbose</code> (look for fpcup: error etc) to see what's going on exactly.
 
* Look into the error message fpcup generates; it also shows some troubleshooting steps you may perform.
 
* Look into the error message fpcup generates; it also shows some troubleshooting steps you may perform.
* Sometimes, the FPC or Lazarus build process leaves incorrect files; you can delete all .ppu files from your FPC and Lazarus directories (including subdirectories) and run fpcup again.
+
* Sometimes, the FPC or Lazarus build process leaves incorrect files; you can (e.g. with fpcupgui) delete all .ppu files from your FPC and Lazarus directories (including subdirectories) and run fpcup again.
 
* Try removing all intermediate files by running fpcup with the <code>--clean</code> option
 
* Try removing all intermediate files by running fpcup with the <code>--clean</code> option
* If compiling Lazarus, make sure lazarus and lhelp are not running.
+
* fpcup is a wrapper around svn/make/lazbuild etc. It cannot fix errors in those underlying systems. The svn information/database in your (fpc, lazarus, external modules) directory may be corrupted. Try a manual <code>svn up</code> to update and fix any error messages first (e.g. running <code>svn cleanup</code>).
 
* Try running <syntaxhighlight lang=bash>svn revert THEDIRECTORY --recursive</syntaxhighlight> followed by <syntaxhighlight lang=bash>svn update THEDIRECTORY</syntaxhighlight> for your Lazarus and FPC directories to remove local modifications, if any.
 
* Try running <syntaxhighlight lang=bash>svn revert THEDIRECTORY --recursive</syntaxhighlight> followed by <syntaxhighlight lang=bash>svn update THEDIRECTORY</syntaxhighlight> for your Lazarus and FPC directories to remove local modifications, if any.
 
* Remove possible stale files:
 
* Remove possible stale files:
Line 728: Line 819:
 
{{Note|Of course, errors introduced in FPC and Lazarus source code/repository may also influence builds. There's nothing fpcup can do to fix incorrect code breaking the build. However, some of the steps mentioned above (deleting .ppu files, fpc.cfg, Lazarus config) may fix Lazarus/FPC build problems..}}
 
{{Note|Of course, errors introduced in FPC and Lazarus source code/repository may also influence builds. There's nothing fpcup can do to fix incorrect code breaking the build. However, some of the steps mentioned above (deleting .ppu files, fpc.cfg, Lazarus config) may fix Lazarus/FPC build problems..}}
  
=== Known issues ===
+
== Known issues ==
 
Known issues can be found in the issue tracker:
 
Known issues can be found in the issue tracker:
 
https://bitbucket.org/reiniero/fpcup/issues?status=new&status=open
 
https://bitbucket.org/reiniero/fpcup/issues?status=new&status=open
 +
 +
=== No rule to make target ... ===
 +
If you see errrors like <code>make.exe: *** No rule to make target `all'.  Stop.</code> on Windows, this may be caused by an invalid make version. Make sure you're using the right make.exe version.
 +
 +
FPC 2.6.x needs make 3.80 (distributed with FPC 2.6.x)
 +
 +
FPC 2.7.1+ needs at least make 3.82 (packet name "remake" at the debian repo) (distributed with e.g. Lazarus 1.2.4)
  
 
=== Strange errors running clean/distclean ===
 
=== Strange errors running clean/distclean ===
 
This is a symptom of issues with the FPC build system (not fpcup).
 
This is a symptom of issues with the FPC build system (not fpcup).
  
On Windows, make 3.80 which is distributed with FPC 2.6.x has problems when there are spaces in your path. This may lead to strang error messages when cleaning.
+
On Windows, make 3.80 which is distributed with FPC 2.6.x has problems when there are spaces in your path. This may lead to strange error messages when cleaning.
Solution: download make 3.81 or make 3.82. Make 3.82 is newer, but cannot build FPC 2.6.x; it builds FPC 2.7.x fine, though.
+
 
 +
FPC 2.6.x needs make 3.80 (distributed with FPC 2.6.x)
 +
 
 +
FPC 2.7.1+ needs at least make 3.82 (distributed with e.g. Lazarus 1.2.4)
  
 
=== Info: Error running fpcup. Technical details: error executing sequence helplazarus; line: 4, param: helplazarus ===
 
=== Info: Error running fpcup. Technical details: error executing sequence helplazarus; line: 4, param: helplazarus ===
HelpLazarus is often the first module that will be built after building lazbuild and the other core IDE units. However, the actual problem may be that lazbuild itself was not generated due to an error. Try running with --verbose to pinpoint where the problem is and follow the troubleshooting steps above.
+
HelpLazarus is often the first module that will be built after building lazbuild and the other core IDE units. However, the actual problem may be that lazbuild itself was not generated due to an error. Try running with <code>--verbose</code> to pinpoint where the problem is and follow the troubleshooting steps above.
  
 
=== Error finding (e.g.) system.ppu when compiling with FPC/Lazarus ===
 
=== Error finding (e.g.) system.ppu when compiling with FPC/Lazarus ===
Try running Tools > Rescan FPC Source Directory
+
First try running Tools > Rescan FPC Source Directory. Normally, Lazarus does this automatically, in the background but if you are too fast it won't have finished in time.
  
Errors like this may be caused by an fpc.cfg from an older/different version of FPC that remains in your fpc/bin/<platform> directory.
+
Errors like this may also be caused by an fpc.cfg from an older/different version of FPC that remains in your fpc/bin/<platform> directory.
 
Because you can customise fpc.cfg, fpcup will not just replace it.
 
Because you can customise fpc.cfg, fpcup will not just replace it.
  
Line 750: Line 851:
  
 
== Support and bug reporting ==
 
== Support and bug reporting ==
Please post support requests on the forum (e.g. in the thread dedicated to FPCUP in the Third-Party announcements section).
+
Please post support requests on the forum so other users can help you.
  
If you report problems, '''after''' running the troubleshooting steps above, please be sure to mention:
+
Please report fpcup bugs on the bug tracker
 +
https://bitbucket.org/reiniero/fpcup/issues
 +
 
 +
If you report bugs, '''after''' running the [[#Troubleshooting|troubleshooting]] steps above, please be sure to mention:
 
# operating system
 
# operating system
 
# fpcup version (as printed in its output)
 
# fpcup version (as printed in its output)
 
# description of what went wrong/error message
 
# description of what went wrong/error message
# run fpcup with the <code>--verbose --noconfirm</code> arguments (or the equivalents in settings.ini) as well as the other arguments you used, redirect the output to file, and attach the file, e.g.: <syntaxhighlight lang=bash>fpcup --verbose --noconfirm > fpcupverbose.txt</syntaxhighlight>; if you post on the forum, please zip it and attach the result to your post
+
# run fpcup with the <code>--verbose --noconfirm</code> arguments (or the equivalents in settings.ini) as well as the other arguments you used, redirect the output to file, and attach the file, e.g.: <syntaxhighlight lang=bash>fpcup --verbose --noconfirm > fpcupverbose.txt</syntaxhighlight>.
  
== Current progress ==
+
== Supported platforms ==
* Support for Windows 2000-7 (untested, probably works on 8). Bare metal install currently needs Windows XP or later for the subversion client. On Windows 2000, manually installing a subversion client in advance will work.
+
* Support for Windows 2000-7 (Windows 8: untested, probably works). Bare metal install currently needs Windows XP or later for the subversion client. On Windows 2000, manually installing a subversion client (e.g. SlikSVN 1.6.16) in advance will work.
 
* Linux x86: works
 
* Linux x86: works
 
* Linux x64: works
 
* Linux x64: works
 
* Linux ARMHF: lightly tested; seems to work
 
* Linux ARMHF: lightly tested; seems to work
* OSX 10.?: lightly tested; seems to work
+
* macOS 10.?: lightly tested; seems to work
 
* FreeBSD 9: lightly tested; seems to work
 
* FreeBSD 9: lightly tested; seems to work
 +
 +
fpcup can be compiled on all platforms that support Lazarus+[[Synapse]]
  
 
== Changelog ==
 
== Changelog ==
This log tracks fpcup binaries as available on the download page. Note that not all binaries may be updated at the same time; fpcup prints a version string at the beginning which you can check.
+
This log tracks fpcup development. Note that not all binaries on the download page may be updated at the same time; fpcup prints a version string at the beginning which you can check.
  
For more details, please see the Mercurial commit log in https://bitbucket.org/reiniero/fpcup/commits/all
+
The commit log is located at https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/commits/master
* 20140128:
 
** Build startlazarus when building useride. Although the regular lazarus build should have built startlazarus, it apparently was not present.
 
** Run useride build process twice to try and deal with packages being marked for installation but not actually being built on IDE build.
 
** Revert back to make 3.80 on Windows as make 3.82 does not work with FPC 2.6.x even though Lazarus 1.2RC2 is distributed with it. If needed, you can delete existing make.exe from your fpcbootstrap directory before running fpcup.
 
** Bug fix: Win64: remove libexpat-1.dll download as it doesn't exist remotely
 
* 20140127:
 
** GUI: allow running without noconfirm in ini file (avoids yes/no question that can never be answered)
 
** Fix a bug in fpcup that disallows running noconfirm
 
* 20140125:
 
** Support fpcres resource compiler in trunk FPC on *nix being in "plain bin dir", not architecture dependent bin dir. '''PLEASE REMOVE EXISTING FPC.CFG and FPC.SH AS THEY NEED TO BE CHANGED'''.
 
** Follow Lazarus 1.2RC2+FPC2.6.2 and use make 3.82 instead of 3.80 on win32. '''Please remove existing make.exe from your fpcbootstrap directory'''
 
** Much improved Linux ARM(HF native compiler
 
** Improve console output: more clearly mark what is fpcup and what is generated by FPC/Lazarus make/lazbuild etc
 
** Give exit code 64 if fpcup run fails
 
** GUI: troubleshooting tool (delete .ppu/.a/.o)
 
* 20140113:
 
** Experimental AIX cross compiler module.
 
* 20140111:
 
** Working fpc fixes 2.6 cross compiler for Linux ARM (e.g. Raspbian).
 
* 20131231:
 
** Add --crossOPT option that lets you pass options to cross compilers. Useful for e.g. specifying softfloat or hardfloat on ARM/MIPS processors. See example in settings.ini Please delete settings.ini and let fpcup regenerate it.
 
* 20131230:
 
** cross compiler modules not only add but also update fpc.cfg configuration snippets.
 
Snippet format changed:
 
PLEASE REMOVE ALL # fpcup do not remove snippets from fpc.cfg or entire fpc.cfg and rerun your cross compilers.
 
** new Android-ARM cross-compiler module
 
** updated ARMEL cross compiler
 
** update configuration to Lazarus 1.3, avoiding upgrade process
 
** add dcpcrypt package
 
** add anchordocking package
 
** add CodeLibrarian package
 
** update rx to new repository URL. Please remove existing directory or do svn switch
 
* 20131122:
 
** New SVN URL for [[RXfpc]] components. Please delete your fpcup.ini (if not modified) to let it regenarate and remove the <code>extras\rx</code> directory before running the new fpcup so the new repository can be downloaded.
 
* 20131118:
 
** Initial stab at support for http proxy: --httpproxy=user:password@host:port (user and password are optional). Also picks up http_proxy variable. Used in http, svn, hg over http downloads; not supported for git over http downloads. Needs testing.
 
** Bug fix: Ini file parameters should not be stored in fpcup start shell script/batch file
 
** Added fpc only example to settings.ini.
 
** Changed settings.ini: make full install/update default
 
** Split win32->win64 cross compile into FPC and Lazarus parts
 
** Reinstate bare metal install on Windows XP+. Windows 2000 users will get a warning that they should install SVN themselves.
 
* 20131023: Win32=>DOS crosscompiler support for FPC trunk
 
Earlier releases: please see the [http://forum.lazarus.freepascal.org/index.php/topic,15919.0.html fpcup forum thread]
 
  
 
== External links ==
 
== External links ==
* [https://bitbucket.org/reiniero/fpcup Project page]
+
* [https://bitbucket.org/reiniero/fpcup Original project page - No longer available]
* [https://bitbucket.org/reiniero/fpcup/downloads Downloads for several platforms]
+
* [https://github.com/LongDirtyAnimAlf/Reiniero-fpcup Updated Repository]
* [https://www.ohloh.net/p/fpcup Ohloh code statistics]
+
* [https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/tree/master/bin Binary downloads for several platforms]
 +
* [https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/tree/master/bin/i386-win32 Additional install scripts]
 +
* [https://www.openhub.net/p/fpcup BlackDuck OpenHub/Ohloh code statistics]
  
 
== See also ==
 
== See also ==
 
* [[Installing Lazarus]] Official way to install Lazarus
 
* [[Installing Lazarus]] Official way to install Lazarus
 
* [[Lazarus Manager]] Another installer for Lazarus/FPC
 
* [[Lazarus Manager]] Another installer for Lazarus/FPC
 +
* [[Small Virtual Machines]] See fpcup used in two virtual machines
  
 
[[Category:Lazarus]]
 
[[Category:Lazarus]]

Latest revision as of 23:56, 7 November 2023

English (en)

About

fpcup is a tool that automates running a subversion client to build FPC and/or Lazarus in a self-contained directory structure. It is meant as a thin wrapper around the regular manual svn up/make/make install build process.

It was made by and maintained by the late Reinier Olislagers (BigChimp). His version can still be found at fpcup

Current maintained version can be found at new fpcup

Lazarus 1.st time users will probably

  • run the downloaded fpcup binary (e.g. fpcup_linux_x64 on a Linux 64 bit). Once that installed a working Lazarus IDE, one could
  • download the fpcup Pascal project (i.e. the sources, in addition to the above binary) and
  • compile those to be able to run the native fpcup GUI that comes with that fpcup Pascal project.
  • Later, one may want to switch to one's favourite SVN GUI (possibly kdesvn), using 'Apache Subversion' with the SVN URL: http://svn.freepascal.org/svn/fpc/trunk
    • in the Linux app kdesvn you can OPEN the URL https://svn.code.sf.net/p/lazarus-ccr/svn and once loaded, bookmark it. Then CHECKOUT stuff you need to your local hard drive.


On Windows, it can also serve as a "bare metal" installer: it can download a subversion client, binutils (make.exe etc).

Think of it as a batch file on steroids that does the boring svn work for you.

fpcup allows maintaining multiple different FPC/Lazarus combinations.

It is a third party tool, not part of FPC or Lazarus.

The fpcup GUI which is provided with the source code: fpcupgui.png

Light bulb  Note: Here is a confortable successor to fpcup

Ready to run

fpcup is ready to run out of the box. It will download and install FPC and Lazarus. On Windows, this directory layout is used:

C:\development\config_lazarus # Default primary-config-path directory 
                              # (contains Lazarus settings)
C:\development\cross          # Place to store cross compiling binutils and libs if wanted
C:\development\extras         # Third party modules (see fpcup.ini) such as fpcdocs
C:\development\fpcbootstrap   # Binutils (make.exe etc) and bootstrap compiler
C:\development\fpc            # FPC fixes 2.6 by default
C:\development\lazarus        # Lazarus trunk by default

On Linux/macOS/BSD, a similar layout is used under ~ (the user's home directory).

fpcup will create a shortcut to the installed Lazarus on your desktop.

Just run fpcup, e.g. on Windows:

fpcup

On UNIX:

#replace fpcup_linux_x86 with your actual fpcup filename of course if not on linux x86, e.g. 64-bit Linux or other variant

chmod u+rx fpcup_linux_x86 
#make executable (one time only action)

./fpcup_linux_x86 
#run

Next time, you can either run the exact same command, or run the fpcup_update desktop shortcut or home directory shell script/batch file.

Light bulb  Note: fpcup is set up to compile FPC 3.0 fixes and Lazarus 1.4 fixes by default

Documentation

fpcup has

See the source code repository for the latest readme.txt.

To make it easier to get user contributions for documentation/tips, this wiki page has been created. Please feel free to add your own examples etc.

Tips

Anchordocking

One way to enable anchordocking is by using settings.ini: open your settings file or add a new file settings.ini

[anchordocking]
; Just a plain install except enable anchordocking package
anchordocking=1

This will use default settings but also enable the anchordocking package in the IDE.

Of course, you can use the anchordocking=1 module setting in any .ini section.

You can also just run fpcup with just a single module: fpcup --only="anchordocking".

Building only FPC

You can build FPC without Lazarus if you want (or the other way round). The example below builds FPC from the fixes 2.6 SVN branch.

Settings

Open your settings file or add a new file, settings.ini:

[fixes26]
; FPC 2.6 fixes (no Lazarus):
fpcdir=c:\development\fpcfixes26
; replace e.g. with 
; http://svn.freepascal.org/svn/fpc/trunk
; for FPC trunk
fpcurl=http://svn.freepascal.org/svn/fpc/branches/fixes_2_6
; Let's specify Lazarus info in case we ever want to add Lazarus
lazdir=c:\development\lazarus12_fixes26
; Just an example: build Lazarus 1.2 - if we're building Lazarus
lazurl=http://svn.freepascal.org/svn/lazarus/tags/lazarus_1_2
primary-config-path=c:\development\configlazarus12_fixes26
; If we ever build Lazarus, do create a link/shortcut:
lazlinkname=lazarus12_fixes26
; Do not create a batch file with shortcut
fpcuplinkname=""
; We can use the binutils/bootstrap dirs that we usually use:
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
; Just install/update, no questions asked:
noconfirm=true
; In case you want to submit patches, it's nice to be able to update
; without overwriting your fixes:
keeplocalchanges=true
; Specify we only want FPC, not Lazarus
; in case of fpc patches FPCBuildOnly
only=FPC,FPCCrossWin32-64
skip=helplazarus,lazarus,lazbuild,bigide,useride

Then get FPC and build it with:

fpcup --inifile=settings.ini --inisection=fixes26

Now you can run your compiler:

c:\development\fpcfixes26\bin\i386-win32\fpc.exe -h

Cross-compile for win64, e.g.:

c:\development\fpcfixes26\bin\i386-win32\fpc.exe -Px86_64 yourfile.pas

Avoid lengthy lcl.chm documentation generation

By default, fpcup tries to compile the $(lazarusdir)\docs\chm\lcl.chm Lazarus help file every day or so. This can take a long time due to the fpdoc tool being quite slow.

You can avoid compiling lcl.chm by generating it one time (or copying over an existing file) and making the file read-only.

OS-specific notes

Specific notes for operating systems are given below if they are different from the general instructions.

Running on Raspberry Pi Raspbian

Open your settings file (e.g. settings.ini and include at least these lines

; ARMHF needs FPC >= 3.0; 2.6.x does not work (unless it is a patched version)
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
; if using armhf, you MUST specify -dFPC_ARMHF in the FPC options
fpcopt="-dFPC_ARMHF -CaEABIHF -CpARMV6 -CfVFPV2"

Running on Windows 2000

Normally, fpcup tries to download an svn client if it cannot find an existing client. This client will not work on Windows 2000 due to missing libraries, so please download and install an svn command line client - such as SlikSVN 1.6.16.

Cross compilers

fpcup not only lets you install native FPC/Lazarus, but will also build cross compilers for you.

First, you should have set up your normal FPC (and optionally Lazarus) using fpcup. Then you let fpcup generate the cross compiler.

For most cross compilers, you do need to have the relevant binutils that are specific for the host<>target system (so not the normal binutils but cross binutils).

Often, you will also need libraries in target system format if you want to compile programs (e.g. Linux Qt or Gtk libraries for the relevant CPU if you're crosscompiling for Linux).

When you run a crosscompiler, fpcup briefly checks if it can find required binutils and libraries and will warn you if they can't be found.

Status

  • Built in means no additional files are needed
  • Needs binutils/libs: means that you need to supply those (see above)
  • N/A: means non-applicable/impossible
  • No: means no plans to implement this. However, contributions are welcome, as always
From\To DOS GO32v2 Windows x86 Windows x64 Linux x64 Linux x86 Linux mipsel Linux arm Android ARM FreeBSD x64 FreeBSD x86 macOS AIX powerpc32
Any needs binutils,libs needs binutils,libs needs binutils,libs needs binutils,libs needs binutils,libs
Windows x86 needs FPC trunk, binutils yes, built in N/A yes needs binutils,libs needs binutils,libs see Any see Any See Any
Windows x64 no no due to FPC limitations needs FPC trunk N/A needs binutils,libs needs binutils,libs see Any see Any See Any
Linux x64 no yes, built in yes, built in N/A see Any see Any no plans no plans See Any
Linux x86 yes, built in yes, built in N/A see Any see Any no plans no plans See Any
Linux mipsel N/A see Any See Any
Linux arm see Any N/A See Any
Android ARM see Any see Any N/A See Any
FreeBSD x64 no no plans yes, built in see Any see Any N/A See Any
FreeBSD x86 no plans yes, built in see Any see Any N/A See Any
macOS verify see Any see Any N/A See Any

(With thanks to FPSpreadsheet's spreadsheet to wikitable conversion tool, see e.g. examples\fpsgrid)

AIX PowerPC crosscompiler

Once you have set up a regular FPC trunk/2.7.1 compiler, you can add an FPC AIX Port cross compiler.

Limitations:

  • FPC trunk/2.7.1+ only
  • untested; don't have target platform libs (or access to target platform). Test reports welcome.

Required files

  • Crossbinutils: see wiki article mentioned earlier. Win32 cross binutils are provided; for *nix, you have to compile your own.
  • Libs: copy over from target device; see wiki article as well.

Settings

Open your settings file or add a new file, settings.ini:

[aix]
; AIX on powerpc32 cross compiler. Also runs on 64 bit powerpc
; a full fpcup run must have been done before
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
fpcopt=""
fpcuplinkname=""
lazlinkname=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
noconfirm=true
keeplocalchanges=true
cputarget=powerpc
fpcopt=""
crossopt=""
ostarget=aix
; Perhaps best to always clean... can be removed for speed
only=FPCCleanOnly,FPCBuildOnly
skip=FPCGetOnly,lazbuild,bigide,useride

See also:

  • any (cross compiler) page about your device
  • your AIX documentation

Creating and using the cross compiler

Then generate the cross compiler with

fpcup --inifile=settings.ini --inisection=aix

If, like me, you don't have the libs from the target platform and run with --verbose, you'll see something like:

C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find \lib\crt0.o
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find -lm
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find -lc
C:\development\cross\bin\powerpc-aix\powerpc-aix-ld.exe: cannot find -lbsd

If the compiler generation went ok, you can run a test compile, compiling a file test.pas with

  • option -CN: avoid reading for null pointers on AIX; see wiki article
fpc -Ppowerpc -Taix -CN test.pas

(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)


Android ARM crosscompiler

Once you have set up a regular FPC trunk/2.7.1 compiler, you can add an Android cross compiler.

Limitations:

  • only tested on FPC trunk
  • only builds FPC cross compiler, Android does not have "regular" LCL support so not enabled
  • patches for getting customdrawn support going are welcome

Required files

Download the Android NDK (e.g. a file like android-sdk_r22.3-windows.zip) for your platform and extract the crossbinutils, e.g. from a path like

android-ndk-r9c\toolchains\arm-linux-androideabi-4.8\prebuilt\windows-x86_64\bin

The result is something like these files (adjust for your platform etc):

arm-linux-androideabi-addr2line.exe
arm-linux-androideabi-ar.exe
arm-linux-androideabi-as.exe
arm-linux-androideabi-c++.exe
arm-linux-androideabi-c++filt.exe
arm-linux-androideabi-cpp.exe
arm-linux-androideabi-elfedit.exe
arm-linux-androideabi-g++.exe
arm-linux-androideabi-gcc-4.8.exe
arm-linux-androideabi-gcc-ar.exe
arm-linux-androideabi-gcc-nm.exe
arm-linux-androideabi-gcc-ranlib.exe
arm-linux-androideabi-gcc.exe
arm-linux-androideabi-gcov.exe
arm-linux-androideabi-gdb-orig.exe
arm-linux-androideabi-gdb.exe
arm-linux-androideabi-gprof.exe
arm-linux-androideabi-ld.bfd.exe
arm-linux-androideabi-ld.exe
arm-linux-androideabi-ld.gold.exe
arm-linux-androideabi-ld.mcld.exe
arm-linux-androideabi-nm.exe
arm-linux-androideabi-objcopy.exe
arm-linux-androideabi-objdump.exe
arm-linux-androideabi-ranlib.exe
arm-linux-androideabi-readelf.exe
arm-linux-androideabi-size.exe
arm-linux-androideabi-strings.exe
arm-linux-androideabi-strip.exe

Put these files in your cross binutils directory for the right platform - e.g. on a standard Windows fpcup install:

C:\development\cross\bin\arm-android

Libs: extract the libs from a path like

android-ndk-r9c\platforms\android-19\arch-arm\usr\lib

into

C:\development\cross\lib\arm-android

The libs in question can be like this list:

crtbegin_dynamic.o
crtbegin_so.o
crtbegin_static.o
crtend_android.o
crtend_so.o
libandroid.so
libc.a
libc.so
libdl.so
libEGL.so
libGLESv1_CM.so
libGLESv2.so
libGLESv3.so
libjnigraphics.so
liblog.so
libm.a
libm.so
libm_hard.a
libOpenMAXAL.so
libOpenSLES.so
libstdc++.a
libstdc++.so
libthread_db.so
libz.so
rs

Settings

Open your settings file or add a new file, settings.ini:

[android]
; Android ARM cross compiler
; a full fpcup run must have been done before
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
fpcopt=""
fpcuplinkname=""
lazlinkname=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
cputarget=arm
ostarget=android
; You can specify exact instruction set and floating point support etc:
crossopt="-CpARMV7 -CfVFPV3"
; ... or something more conservative/compatible:
;crossopt="-CpARMV6"
verbose=0
; We only need an FPC here; assume FPC has been updated by regular update
only=FPCBuildOnly
; No LCL support on Android yet

See also:

Creating and using the cross compiler

Then generate the cross compiler with

fpcup --inifile=settings.ini --inisection=android

Now you can run a test compile, compiling a file test.pas with

fpc -Parm -Tandroid test.pas

(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)

Linux ARM cross compiler

Once you have set up a regular FPC compiler, you can add a Linux on ARM cross compiler (e.g. for a Raspbian/Raspberry Pi).

Required files

On Windows, the result is something like these files (adjust for your platform etc):

arm-linux-addr2line.exe
arm-linux-ar.exe
arm-linux-as.exe
arm-linux-ld.exe
arm-linux-objcopy.exe
arm-linux-objdump.exe
arm-linux-strip.exe

Libs: extract the libs from your device - e.g. this on Raspbian:

  • all .so files in /lib
  • all .so files in /usr/lib
  • all .so files in /usr/lib/arm-linux-gnueabihf

Note: some .so files are actually scripts; check

grep -i "ld script" *

Remove those .so and copy over (or symlink) the files the script point to (e.g. .so.x files) to .so so that the linker can find them

Examples:

  • libpthread.so
  • libc.so
  • libgcc_s.so

Put the libs into your cross lib path, e.g. on Windows

C:\development\cross\lib\arm-linux

Settings

Open your settings file or add a new file, settings.ini.

As you can see in the comments below, you can build an ARMHF cross-compiler which works on e.g. Raspbian, requires an FPU and requires ARMHF libraries, but only on FPC 2.7+.

[linuxarm]
; a full fpcup run must have been done before (e.g. win32full)
; does not update packages
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
lazdir=lazdir=c:\development\lazarus
primary-config-path=c:\development\lazarussettings
lazlinkname=""
fpcuplinkname=""
; NO FPIC: not supported on 2.6.x
; http://bugs.freepascal.org/view.php?id=19729
; otherwise Fatal: Internal error 200502052
; If using -CaEABIHF in crossopt, specify -dFPC_ARMHF here (only works on 2.7.x)
; more info see below
fpcopt=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
noconfirm=true
keeplocalchanges=true
cputarget=arm
; if using armhf, you MUST specify -dFPC_ARMHF in the FPC options; 
; specifying in crossopt is not enough.
; -fPIC not supported on FPC 2.6.x, only on 2.7.x; 
fpcopt="-dFPC_ARMHF"

; safe default but slow:
;crossopt="-CpARMV6 -CaEABI -CfSOFT"

; Raspbian for Raspberry Pi safe
; ARMv6 instruction set
; if using arm hf (hard float/floating point), please specify -dFPC_ARMHF
; copy over /lib, /usr/lib 
; /usr/lib/arm-linux-gnueabihf (Raspbian) => note: 
; some .so files are actually scripts; check
; grep -i "ld script" *
; Remove those .so and copy over (or symlink) the .so.x to .so in order for the linker to find them
; Examples:
; libpthread.so
; libc.so
; libgcc_s.so
; to cross lib dir (try compiling and keep copying until no errors left)
; Note: -CpARMV6Z parameter not supported on 2.6.x, only on 2.7.x
; Note: -CaEABIHF parameter not supported on 2.6.x, only on 2.7.x
; Note: don't use -fPIC; will give segmentation fault
crossopt="-CaEABIHF -CpARMV6 -CfVFPV2"

; beagleboard black with hardfloat:
; if using armhf, also specify -dFPC_ARMHF (in fpcopt) to avoid gtk scrollbar errors
; Note: -CaEABIHF not supported on 2.6.x, only on 2.7.x
;crossopt="-CaEABIHF -Cparmv7 -CfVFPv3"
ostarget=linux
; Only build FPC
only=FPCCleanOnly,FPCBuildOnly
skip=FPCGetOnly,lazbuild,bigide,useride

See also:

Creating and using the cross compiler

Then generate the cross compiler with

fpcup --inifile=settings.ini --inisection=linuxarm

Now you can run a test compile, compiling a file test.pas with

fpc -Parm -Tlinux test.pas

(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)

Linux i386 cross

On an x64 Linux system (or any system with support for i386 Linux libraries/cross binutils), once you have set up a regular FPC compiler, you can add a Linux i386 cross compiler.

Required files

  • Linux
    • build or install the relevant crossbinutils
    • build or install the relevant i386 libraries for your code (e.g. libc)
  • other systems: not tested yet

Settings

Open your settings file or add a new file, settings.ini.

[linuxi386]
; a full fpcup run must have been done before
; does not update packages
; please adjust paths etc
fpcdir=~/development/fpctrunk
fpcopt=""
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
lazdir=lazdir=~/development/lazarus
primary-config-path=~/development/lazarussettings
lazlinkname=""
fpcuplinkname=""
fpcbootstrapdir=~/development/fpcbootstrap
noconfirm=true
keeplocalchanges=true
cputarget=i386
ostarget=linux
only=FPCCleanOnly,FPCBuildOnly
skip=FPCGetOnly,lazbuild,bigide,useride


Creating and using the cross compiler

Then generate the cross compiler with

fpcup --inifile=settings.ini --inisection=linuxi386

Now you can run a test compile, compiling a file test.pas with

fpc -Pi386 -Tlinux test.pas

(your fpc.cfg will have been modified to add some settings when cross-compiling to Android ARM)

DOS crosscompiler

Using 32 bit fpcup.exe on Windows, once you have set up a regular FPC trunk/2.7.1 compiler, you can add a DOS cross compiler.

Required files

Download the required binaries as mentioned in DOS, currently:

msdos-nasm.exe
msdos-wlib.exe
msdos-wlink.exe
nasm.exe
wlibd.dll
wlinkd.dll
wlsystem.lnk

and put them in your cross binutils directory for the right platform - e.g. on a standard Windows fpcup install:

c:\development\cross\bin\i8086-msdos

There are no files needed in the corresponding library directory,

C:\development\cross\lib\i8086-msdos

Settings

Open your settings file or add a new file, settings.ini:

[dos]
; dos cross compiler
; a full fpcup run must have been done before
; please adjust paths etc
fpcdir=c:\development\fpctrunk
fpcurl=http://svn.freepascal.org/svn/fpc/trunk
fpcopt=""
fpcuplinkname=""
lazlinkname=""
binutilsdir=c:\development\fpcbootstrap
fpcbootstrapdir=c:\development\fpcbootstrap
cputarget=i8086
ostarget=msdos
verbose=0
; We only need an FPC here; assume FPC has been updated by regular update
only=FPCBuildOnly

Creating and using the cross compiler

Then generate the cross compiler with

fpcup --inifile=settings.ini --inisection=dos

Now you can run a test compile, compiling a file test.pas with

fpc -Pi8086 -TMSDOS test.pas

(your fpc.cfg will have been modified to use DOS medium memory model, smartlinking etc)

Download

The current maintained version can be found at: https://github.com/LongDirtyAnimAlf/Reiniero-fpcup

The original site is at: https://bitbucket.org/reiniero/fpcup/downloads (not maintained at the moment)

Warning-icon.png

Warning: Windows users, please download the 32 bit fpcup version even if you are on 64 bit Windows unless you know what you are doing. See this warning about FPC 2.6.x x64.

License

fpcup is open source software released under the LGPL with linking exception (same as FreePascal/LCL).

Troubleshooting

When you hit errors with fpcup:

  • RTFM (read the fine manual)
  • If compiling Lazarus, make sure lazarus and lhelp are not running.
  • If you have a working Lazarus, run Tools > Rescan FPC Source Directory
  • Try running fpcup with --verbose (look for fpcup: error etc) to see what's going on exactly.
  • Look into the error message fpcup generates; it also shows some troubleshooting steps you may perform.
  • Sometimes, the FPC or Lazarus build process leaves incorrect files; you can (e.g. with fpcupgui) delete all .ppu files from your FPC and Lazarus directories (including subdirectories) and run fpcup again.
  • Try removing all intermediate files by running fpcup with the --clean option
  • fpcup is a wrapper around svn/make/lazbuild etc. It cannot fix errors in those underlying systems. The svn information/database in your (fpc, lazarus, external modules) directory may be corrupted. Try a manual svn up to update and fix any error messages first (e.g. running svn cleanup).
  • Try running
    svn revert THEDIRECTORY --recursive
    
    followed by
    svn update THEDIRECTORY
    
    for your Lazarus and FPC directories to remove local modifications, if any.
  • Remove possible stale files:
    • the bootstrap compiler and any binutils: remove all files and directories in the fpcbootstrap directory
    • if you haven't modified fpcup.ini, remove it and let fpcup regenerate it
    • same for settings.ini
    • same for fpc.cfg in $(fpcdir)\bin\<architecture>
    • same for your Lazarus primary config path/configuration directory
  • See if there's a newer fpcup version available that may have fixed your problem

If the steps before do not work: you can use the --uninstall option to remove all files including your FPC and Lazarus directories, then run fpcup with the same commands.

Light bulb  Note: Of course, errors introduced in FPC and Lazarus source code/repository may also influence builds. There's nothing fpcup can do to fix incorrect code breaking the build. However, some of the steps mentioned above (deleting .ppu files, fpc.cfg, Lazarus config) may fix Lazarus/FPC build problems..

Known issues

Known issues can be found in the issue tracker: https://bitbucket.org/reiniero/fpcup/issues?status=new&status=open

No rule to make target ...

If you see errrors like make.exe: *** No rule to make target `all'. Stop. on Windows, this may be caused by an invalid make version. Make sure you're using the right make.exe version.

FPC 2.6.x needs make 3.80 (distributed with FPC 2.6.x)

FPC 2.7.1+ needs at least make 3.82 (packet name "remake" at the debian repo) (distributed with e.g. Lazarus 1.2.4)

Strange errors running clean/distclean

This is a symptom of issues with the FPC build system (not fpcup).

On Windows, make 3.80 which is distributed with FPC 2.6.x has problems when there are spaces in your path. This may lead to strange error messages when cleaning.

FPC 2.6.x needs make 3.80 (distributed with FPC 2.6.x)

FPC 2.7.1+ needs at least make 3.82 (distributed with e.g. Lazarus 1.2.4)

Info: Error running fpcup. Technical details: error executing sequence helplazarus; line: 4, param: helplazarus

HelpLazarus is often the first module that will be built after building lazbuild and the other core IDE units. However, the actual problem may be that lazbuild itself was not generated due to an error. Try running with --verbose to pinpoint where the problem is and follow the troubleshooting steps above.

Error finding (e.g.) system.ppu when compiling with FPC/Lazarus

First try running Tools > Rescan FPC Source Directory. Normally, Lazarus does this automatically, in the background but if you are too fast it won't have finished in time.

Errors like this may also be caused by an fpc.cfg from an older/different version of FPC that remains in your fpc/bin/<platform> directory. Because you can customise fpc.cfg, fpcup will not just replace it.

If you have not customised fpc.cfg, you can remove it and let fpcup regenerate it when rebuilding FPC.

Support and bug reporting

Please post support requests on the forum so other users can help you.

Please report fpcup bugs on the bug tracker https://bitbucket.org/reiniero/fpcup/issues

If you report bugs, after running the troubleshooting steps above, please be sure to mention:

  1. operating system
  2. fpcup version (as printed in its output)
  3. description of what went wrong/error message
  4. run fpcup with the --verbose --noconfirm arguments (or the equivalents in settings.ini) as well as the other arguments you used, redirect the output to file, and attach the file, e.g.:
    fpcup --verbose --noconfirm > fpcupverbose.txt
    
    .

Supported platforms

  • Support for Windows 2000-7 (Windows 8: untested, probably works). Bare metal install currently needs Windows XP or later for the subversion client. On Windows 2000, manually installing a subversion client (e.g. SlikSVN 1.6.16) in advance will work.
  • Linux x86: works
  • Linux x64: works
  • Linux ARMHF: lightly tested; seems to work
  • macOS 10.?: lightly tested; seems to work
  • FreeBSD 9: lightly tested; seems to work

fpcup can be compiled on all platforms that support Lazarus+Synapse

Changelog

This log tracks fpcup development. Note that not all binaries on the download page may be updated at the same time; fpcup prints a version string at the beginning which you can check.

The commit log is located at https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/commits/master

External links

See also