Files
haikuports/sys-devel/binutils/binutils-2.17_2013_04_21.recipe
Rene Gollent fdb9df7542 Fix checkout paths for recipes pointing to...
no longer existing BuildToolsPM repository.
2013-12-12 19:25:12 -05:00

176 lines
5.3 KiB
Plaintext

SUMMARY="The GNU assembler, linker and binary utilities"
HOMEPAGE="http://www.gnu.org/software/binutils"
SRC_URI="git+git://github.com/haiku/buildtools.git#ab0f66e"
REVISION="2"
LICENSE="
GNU GPL v2
GNU LGPL v2
"
COPYRIGHT="1988-2006 Free Software Foundation, Inc."
ARCHITECTURES="x86_gcc2"
if [ $effectiveTargetArchitecture = x86_gcc2 -a $targetArchitecture = x86 ]
then
ARCHITECTURES="$ARCHITECTURES x86"
fi
SECONDARY_ARCHITECTURES="x86_gcc2"
PROVIDES="
binutils$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:addr2line$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:ar$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:as$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:gprof$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:ld$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:nm$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:objcopy$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:objdump$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:ranlib$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:readelf$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:size$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:strings$secondaryArchSuffix = $portVersion compat >= 2.17
cmd:strip$secondaryArchSuffix = $portVersion compat >= 2.17
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
cmd:autoconf
cmd:flex
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:makeinfo
cmd:sed
cmd:tar
"
SOURCE_DIR="$portVersionedName/legacy/binutils"
BUILD_PACKAGE_ACTIVATION_PHASE=INSTALL
binutilsDir=$(pwd)
relativeInstallDir="develop/tools$secondaryArchSubDir"
installDir="$prefix/$relativeInstallDir"
binutilsObjectsDir=$binutilsDir/../binutils-obj
BUILD()
{
rm -rf $binutilsObjectsDir
# Touch all *.info files, as newer texinfos don't like their format
cd $binutilsDir
find . -name \*.info | xargs touch
# build binutils
mkdir -p $binutilsObjectsDir
cd $binutilsObjectsDir
CFLAGS="-O2" CXXFLAGS="-O2" runConfigure --omit-dirs "docDir dataRootDir" \
"$binutilsDir/configure" \
--exec-prefix=$installDir \
--includedir=$includeDir/binutils \
--with-htmldir=$relativeDocDir \
--disable-nls --enable-shared=yes
make
}
INSTALL()
{
cd $binutilsObjectsDir
archName=$(grep '^target_alias' Makefile | cut -d= -f2)
make install
make install-html
# Remove the development libraries and headers. Nobody uses those anyway.
rm -r $libDir
rm -r $developDir/headers
### HTML documentation ####################################
echo "Organizing HTML documentation..."
cd $docDir
mv as.html as
ln -sf as/index.html as.html
mv bfd.html bfd
ln -sf bfd/index.html bfd.html
mv binutils.html binutils
ln -sf binutils/index.html binutils.html
mv gprof.html gprof
ln -sf gprof/index.html gprof.html
mv ld.html ld
ln -sf ld/index.html ld.html
rm libiberty.html standards.html
# no info documentation
rm -r $infoDir
### Strip #################################################
echo "Strip debug info"
cd $prefix
find bin -type f | xargs -r strip --strip-debug
strip --strip-debug $installDir/$archName/bin/*
### Symlinks ##############################################
echo "Creating required symlinks"
# There are copies of a subset of the commands below installDir. We
# overwrite those with symlinks to the ones in binDir.
for file in $installDir/i586-pc-haiku/bin/*; do
symlinkRelative -sfn $binDir/$(basename $file) $file
done
### 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.
dlltool - Creates files for building and using DLLs.
gold - A new, faster, ELF only linker, still in beta test.
gprof - Displays profiling information.
nlmconv - Converts object code into an NLM.
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.
windmc - A Windows compatible message compiler.
windres - A compiler for Windows resource files.
Most of these programs use BFD, the Binary File Descriptor library, to do low-level
manipulation. Many of them also use the opcodes library to assemble and disassemble machine
instructions.
The binutils have been ported to most major Unix variants as well as Wintel systems, and their
main reason for existence is to give the GNU system (and GNU/Linux) the facility to compile
and link programs.
"