[Lazarus] Need suggestion about crosscompile on osx

Anthony Walter sysrpl at gmail.com
Sun Feb 22 06:45:31 CET 2015


You have to make all cross compile targets using fpc 2.6.4 as your working
compiler, and fpc 3.x as your source code compiler.

First you build a fpc 3.x compiler. Assuming you want to install off your
home folder somewhere, build fpc.3.x and cross compilers on osx like so:

# wherever you put the fpc.x source code
# i recommend somewhere under your home folder
BASE=$HOME/path/to/fpc.3.x

# make and install the default fpc.3.x compiler
make all
make install INSTALL_PREFIX=$BASE
# make the cross compilers
make crossinstall OS_TARGET=osx CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE
make crossinstall OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE
make crossinstall OS_TARGET=linux CPU_TARGET=i386 INSTALL_PREFIX=$BASE
make crossinstall OS_TARGET=win32 CPU_TARGET=i386 INSTALL_PREFIX=$BASE
make crossinstall OS_TARGET=win64 CPU_TARGET=x86_64 INSTALL_PREFIX=$BASE

# copy the compilers to the bin folder
cp $BASE/lib/fpc/$FPC_BUILD/* $BASE/bin

# make changes to your path
OLDPATH=$PATH
export PPC_CONFIG_PATH=$BASE/fpc/bin
export PATH=$PPC_CONFIG_PATH:$OLDPATH

# create a new fpc.cfg in the compiler folder
$PPC_CONFIG_PATH/fpcmkcfg -d basepath=$BASE/lib/fpc/\$FPCVERSION -o
$PPC_CONFIG_PATH/fpc.cfg

# test the compiler path and configuration
cd $HOME
fpc -iv

You should see 3.0.1 if using svn fixes_3_0 branch.

Next you need to find the cross compiler tools and place them in the fpc
bin folder which is:

$BASE/bin

They are named like fpc.3.x/bin/i386-linux-as or
fpc.3.x/bin/x86_64-linux-ld. You need about 30 of these tools for all
platforms in total.

After that then you need to find the cross compiler libs, and place them in:
$BASE/lib/$CPUTARGET_$OSTARGET

These are files like fpc.3.x/lib/x86_64-linux/libcairo.so or
fpc.3.x/lib/i386-win32/user32.dll. There's probably 200 or so of these
files you'll need.

I can't tell you where to get these files, but if you're desperate you can
pull them out of my bundle.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150222/d5f19e2d/attachment-0003.html>


More information about the Lazarus mailing list