From 2866bea9560518d80d6f193966f4a9cdffbc53f4 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 9 May 2014 08:23:28 +0200 Subject: [PATCH] Add recipes for avr-binutils and -gcc. * Uses our binutils and gcc sources. * Derived from the native recipes. * Does not install the docs, they are identical to the standard ones. --- .../avr_binutils-2.24_2014_03_19.recipe | 139 ++++++++++++++++++ .../avr_gcc/avr_gcc-4.8.2_2014_03_20.recipe | 115 +++++++++++++++ 2 files changed, 254 insertions(+) create mode 100644 sys-devel/avr_binutils/avr_binutils-2.24_2014_03_19.recipe create mode 100644 sys-devel/avr_gcc/avr_gcc-4.8.2_2014_03_20.recipe diff --git a/sys-devel/avr_binutils/avr_binutils-2.24_2014_03_19.recipe b/sys-devel/avr_binutils/avr_binutils-2.24_2014_03_19.recipe new file mode 100644 index 000000000..710cc0a4c --- /dev/null +++ b/sys-devel/avr_binutils/avr_binutils-2.24_2014_03_19.recipe @@ -0,0 +1,139 @@ +SUMMARY="Assembler, linker and binary tools for Atmel AVR" +HOMEPAGE="http://www.gnu.org/software/binutils" + +srcGitRev="c20a732df8f8b6d0f32c872817f3a0498a5c4761" +SRC_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz" +CHECKSUM_SHA256="6d3b677cd8ef777bf6fb3186a15b5122e46345595a996370325c758b3d8a4ab6" +SRC_FILENAME="binutils-$portVersion.tar.gz" +REVISION="5" +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" + +PROVIDES=" + avr_binutils$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_addr2line$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_ar$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_as$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_c++filt$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_elfedit$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_gprof$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_ld$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_ld.bfd$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_nm$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_objcopy$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_objdump$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_ranlib$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_readelf$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_size$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_strings$secondaryArchSuffix = $portVersion compat >= 2.23 + cmd:avr_strip$secondaryArchSuffix = $portVersion compat >= 2.23 + lib:avr_libbfd_2.24$secondaryArchSuffix = $portVersion compat >= 2.23 + lib:avr_libopcodes_2.24$secondaryArchSuffix = $portVersion compat >= 2.23 + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + " +BUILD_REQUIRES=" + cmd:find + cmd:xargs + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:autoconf + cmd:awk + 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/binutils" +BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL + +sourceDir=$(pwd) +relativeInstallDir="develop/tools$secondaryArchSubDir" +installDir="$prefix/$relativeInstallDir" +objectsDir=$(pwd)/../${portVersionedName}-obj + +BUILD() +{ + rm -rf $objectsDir + + # Touch all *.info files, as newer texinfos don't like their format + (cd $sourceDir; find . -name \*.info | xargs touch) + + mkdir -p $objectsDir + cd $objectsDir + + CFLAGS=-O2 CXXFLAGS=-O2 runConfigure "$sourceDir/configure" \ + --exec-prefix=$installDir \ + --includedir=$includeDir/binutils \ + --docdir=$docDir \ + --disable-nls --target=avr + + make $jobArgs +} + +INSTALL() +{ + cd $objectsDir + + make install + + # no info documentation + rm -r $infoDir + + ### Strip ################################################# + + echo "Strip debug info" + + strip --strip-debug $binDir/* + + ### Cleanup ################################################# + + echo "Cleanup" + + # delete man pages for commands that we aren't including + cd $manDir + for cmd in dlltool nlmconv windmc windres; do + rm -f man1/$cmd.1 + done +} + +DESCRIPTION=" +The GNU Binutils are a collection of binary tools. The main ones are: +- ld - the GNU linker. +- as - the GNU assembler. +But they also include: +- addr2line - Converts addresses into filenames and line numbers. +- ar - A utility for creating, modifying and extracting from archives. +- c++filt - Filter to demangle encoded C++ symbols. +- nm - Lists symbols from object files. +- objcopy - Copys and translates object files. +- objdump - Displays information from object files. +- ranlib - Generates an index to the contents of an archive. +- readelf - Displays information from any ELF format object file. +- size - Lists the section sizes of an object or archive file. +- strings - Lists printable strings from files. +- strip - Discards symbols. +The tools of this package can be used for cross-builds to Atmel AVR. +" diff --git a/sys-devel/avr_gcc/avr_gcc-4.8.2_2014_03_20.recipe b/sys-devel/avr_gcc/avr_gcc-4.8.2_2014_03_20.recipe new file mode 100644 index 000000000..90623c3a3 --- /dev/null +++ b/sys-devel/avr_gcc/avr_gcc-4.8.2_2014_03_20.recipe @@ -0,0 +1,115 @@ +SUMMARY="C/C++ cross-compiler for Atmel AVR" +DESCRIPTION=" +Compiler for Atmel AVR platform. +" +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" + +PROVIDES=" + avr_gcc$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_c++$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_cc$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_cpp$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_g++$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_gcc$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_gcc_4.8.2$secondaryArchSuffix = $portVersion compat >= 4 + cmd:avr_gcov$secondaryArchSuffix = $portVersion compat >= 4 + lib:avr_libstdc++$secondaryArchSuffix = $portVersion compat >= 4 + " + +REQUIRES=" + haiku$secondaryArchSuffix >= $haikuVersion + cmd:avr_as$secondaryArchSuffix + " +BUILD_REQUIRES=" + cmd:avr_as$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:autoconf + cmd:awk + 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$secondaryArchSubDir" +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 + + local additionalConfigureFlags + if [ -n "$secondaryArchSuffix" ]; then + additionalConfigureFlags="\ + --with-hybrid-secondary=${effectiveTargetArchitecture}" + fi + if [ $effectiveTargetArchitecture == x86_64 ]; then + # disable multilib support, as x86_64 by default tries to build the + # 32-bit libraries, too, which fails as no 32-bit libroot is available + additionalConfigureFlags+=" --disable-multilib" + fi + + CFLAGS="-O2 -U_FORTIFY_SOURCE" CXXFLAGS="-O2" "$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 \ + --with-pkgversion=$(echo $portVersion | cut -c 7-) --target=avr \ + $additionalConfigureFlags + + make $jobArgs +} + +INSTALL() +{ + cd $objectsDir + + make install-strip + + ### Cleanup ############################################### + + echo "Cleanup" + rm -rf $installDir/info + rm -rf $installDir/share +}