More patches for lazarus to help building cross-compilers with the same
script as the regular compiler.
It's mostly done, I've not fully tested it because wince still fails
badly because half of db, and so db export and also fphtml (and who
knows what else) fail on wince.
Basically fpc head does't actually support (build for) arm-wince right now.
interested folk can try with:
CPU_TARGET=arm OS_TARGET=wince bash -x ./create_fpc_deb.sh fpc
~/lazarus/fpc/
I'll finish testing this script with some other cross combination in a
couple of days.
Sam
Index: create_fpc_deb.sh
===================================================================
--- create_fpc_deb.sh (revision 13125)
+++ create_fpc_deb.sh (working copy)
@@ -105,27 +105,38 @@
# architecture dependent stuff
Arch=`dpkg --print-architecture`
+
CPU_TARGET="${CPU_TARGET:-$Arch}"
case "$CPU_TARGET" in
- i386) ppcbin=ppc386;;
- amd64) ppcbin=ppcx64;;
- powerpc) ppcbin=ppcppc;;
- sparc) ppcbin=ppcsparc;;
- arm) ppcbin=ppcarm;;
- *) echo "$CPU_TARGET is not supported."
- exit -1;;
+ i386) ppcbin=ppc386;;
+ amd64) ppcbin=ppcx64;;
+ powerpc) ppcbin=ppcppc;;
+ sparc) ppcbin=ppcsparc;;
+ arm) ppcbin=ppcarm;;
+ *) echo "$CPU_TARGET is not supported."
+ exit -1;;
esac
if [ "$CPU_TARGET" != "$Arch" ]
-then TARGET_SUFFIX="$CPU_TARGET-"
+then TARGET_SUFFIX="_${CPU_TARGET}"
+fi
+
+if test -n "$OS_TARGET"
+then
+ TARGET_SUFFIX="${TARGET_SUFFIX}_${OS_TARGET}"
fi
+if test -z "$FPC"
+then
+ FPC="`fpc -P$Arch -PB`"
+fi
+
#------------------------------------------------------------------------------
# setup variables
CurDir=`pwd`
FPCBuildDir=$TmpDir/fpc_build
-FPCDeb=$CurDir/${PackageName}_$FPCVersion-${FPCRelease}_$Arch.deb
+FPCDeb=$CurDir/${PackageName}${TARGET_SUFFIX}_$FPCVersion-${FPCRelease}_$Arch.deb
ResourceDir=$CurDir/debian_$PackageName
DebianInstallDir=$FPCBuildDir/usr
DebianRulezDir=$FPCBuildDir/DEBIAN/
@@ -200,7 +211,8 @@
# build fpc
mkdir -p $FPCBuildDir/etc
cd $FPCSrcDir
- make clean all
+ make clean all ${CPU_TARGET:+CPU_TARGET=$CPU_TARGET}
${OS_TARGET:+OS_TARGET=$OS_TARGET} ${FPC:+FPC=$FPC}
+# OS_TARGET=wince CROSSCOMPILE=1 BINUTILSPREFIX=arm-wince-
mkdir -p $DebianInstallDir
make install INSTALL_PREFIX=$DebianInstallDir
cd -