Add recipe for arm_none_eabi_gcc

* Do NOT use for Haiku development. This is a GCC without standard
libraries for bare-metal programming on embedded platforms.
This commit is contained in:
Adrien Destugues
2014-08-10 08:39:58 +02:00
parent 50ebacc642
commit ad2d0bf023

View File

@@ -0,0 +1,126 @@
SUMMARY="C/C++ cross-compiler for ARM"
DESCRIPTION="
Compiler for ARM processors.
"
HOMEPAGE="http://gcc.gnu.org"
srcGitRev="c20a732df8f8b6d0f32c872817f3a0498a5c4761"
SRC_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="6d3b677cd8ef777bf6fb3186a15b5122e46345595a996370325c758b3d8a4ab6"
SRC_FILENAME="$portVersionedName.tar.gz"
REVISION="1"
LICENSE="
GNU GPL v2
GNU LGPL v2
"
COPYRIGHT="1988-2013 Free Software Foundation, Inc."
ARCHITECTURES="x86 x86_64 arm"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
# x86_gcc2 is fine as primary target architecture as long as we're building
# for a different secondary architecture.
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"
targetArch="arm-none-eabi"
targetU="arm_none_eabi"
PROVIDES="
${targetU}_gcc$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_c++$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_cc$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_cpp$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_g++$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_gcc$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_gcc_4.8.2$secondaryArchSuffix = $portVersion compat >= 4
cmd:${targetU}_gcov$secondaryArchSuffix = $portVersion compat >= 4
lib:${targetU}_libstdc++$secondaryArchSuffix = $portVersion compat >= 4
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
cmd:${targetU}_as$secondaryArchSuffix
lib:libstdc++$secondaryArchSuffix
"
BUILD_REQUIRES="
cmd:${targetU}_as$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:autoconf
cmd:awk
cmd:bison
cmd:find
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:sed
cmd:strip
cmd:tar
cmd:xargs
"
SOURCE_DIR="buildtools-$srcGitRev/gcc"
sourceDir=$(pwd)
relativeInstallDir="develop/tools/${targetArch}"
installDir="$prefix/$relativeInstallDir"
objectsDir=$(pwd)/../${portVersionedName}-obj
BUILD()
{
rm -rf $objectsDir
# Touch some files generated by bison, so that bison won't run to update
# them. Fixes issues with newer bison versions.
# And while at it, touch gperf target, too (as gperf may not be installed).
(cd $sourceDir/gcc; touch c-parse.c c-parse.h cexp.c cp/parse.c \
cp/parse.h c-gperf.h)
mkdir -p $objectsDir
cd $objectsDir
# Setting a quoted string in an environment variable is ugly (the quotes
# are removed at various stages and need an absurd amount of escaping), so
# let's use a file and --include instead.
echo '#define LIBRARY_PATH_ENV "ARM_LIBRARY_PATH"' > haiku_host.h
CXXFLAGS="-O2 -include $objectsDir/haiku_host.h" \
CFLAGS="-O2 -U_FORTIFY_SOURCE" "$sourceDir/configure" \
--build=$effectiveTargetMachineTriple \
--prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \
--docdir=$docDir --disable-nls --disable-libssp --with-gnu-ld \
--enable-languages=c,c++ --enable-lto --enable-frame-pointer \
--enable-multilib --disable-shared \
--without-headers --with-newlib \
--with-pkgversion=$(echo $portVersion | cut -c 7-) --target=$targetArch
make $jobArgs all-gcc all-target-libgcc
}
INSTALL()
{
cd $objectsDir
make install-gcc install-target-libgcc
### Symlinks ##############################################
echo "Creating required symlinks"
# make all tools available via default paths
mkdir -p $binDir
for f in c++ cc cpp g++ gcc gcov; do
symlinkRelative -sfn $installDir/bin/$targetArch-$f $binDir
done
### Cleanup ###############################################
echo "Cleanup"
rm -rf $installDir/info
rm -rf $installDir/share
}