mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 07:40:07 +02:00
x86_64 is used as a baseline: the "x86_64" entry, whatever status it has, is transformed into "all", and then the other entries in ARCHITECTURES either dropped or rearranged appropriately.
199 lines
5.9 KiB
Bash
199 lines
5.9 KiB
Bash
SUMMARY="Assembler, linker and binary tools for target ${targetMachineTriple}"
|
|
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 of archives.
|
|
- c++filt - filter to demangle encoded C++ symbols.
|
|
- gold - a linker for ELF files.
|
|
- 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 \
|
|
$effectiveTargetMachineTriple."
|
|
HOMEPAGE="https://www.gnu.org/software/binutils/"
|
|
COPYRIGHT="1988-2018 Free Software Foundation, Inc."
|
|
LICENSE="GNU GPL v3
|
|
GNU LGPL v3"
|
|
REVISION="2"
|
|
binutilsVersion="2.31.1"
|
|
SOURCE_URI="https://ftpmirror.gnu.org/binutils/binutils-$binutilsVersion.tar.xz
|
|
https://ftp.gnu.org/gnu/binutils/binutils-$binutilsVersion.tar.xz"
|
|
CHECKSUM_SHA256="5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86"
|
|
SOURCE_DIR="binutils-$binutilsVersion"
|
|
PATCHES="binutils-$portVersion.patchset"
|
|
|
|
# disabled on x86: see https://github.com/haikuports/haikuports/issues/1750
|
|
ARCHITECTURES="all !x86_gcc2 ?ppc"
|
|
SECONDARY_ARCHITECTURES="!x86"
|
|
|
|
PROVIDES="
|
|
binutils$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:addr2line$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:ar$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:as$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:c++filt$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:elfedit$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:gprof$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:ld$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:ld.bfd$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:nm$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:objcopy$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:objdump$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:ranlib$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:readelf$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:size$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:strings$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
cmd:strip$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
lib:libbfd_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
lib:libopcodes_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.23
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
cmd:find
|
|
cmd:xargs
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
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
|
|
"
|
|
|
|
|
|
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)
|
|
|
|
# Touch all *.y files, ensure they get generated; without this, the
|
|
# PE targets would fail to link
|
|
(cd $sourceDir; find . -name \*.y | xargs touch)
|
|
|
|
mkdir -p $objectsDir
|
|
cd $objectsDir
|
|
|
|
binUtilsTargets=$effectiveTargetMachineTriple
|
|
|
|
if [ $effectiveTargetArchitecture == x86_64 ]; then
|
|
binUtilsTargets="$binUtilsTargets,i386-efi-pe,x86_64-efi-pe"
|
|
fi
|
|
|
|
CFLAGS=-O2 CXXFLAGS=-O2 runConfigure "$sourceDir/configure" \
|
|
--exec-prefix=$installDir \
|
|
--includedir=$includeDir/binutils \
|
|
--docdir=$docDir --enable-host-shared --enable-largefile=yes \
|
|
--disable-libtool-lock --disable-nls --enable-plugins --enable-64-bit-bfd \
|
|
--enable-ld=default --enable-targets=$binUtilsTargets \
|
|
--with-sysroot=/
|
|
# Note: The sysroot option is normally superfluous. We have to specify
|
|
# it, however, since these binutils may be used by the bootstrap-gcc,
|
|
# which passes --sysroot=<path> to ld.
|
|
|
|
make $jobArgs LEXLIB=
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
cd $objectsDir
|
|
|
|
make install
|
|
make install-html
|
|
|
|
# Remove the development libraries and headers. Nobody uses those anyway.
|
|
rm $libDir/*.a $libDir/*.la
|
|
rm -r $developDir/headers
|
|
|
|
### HTML documentation ####################################
|
|
|
|
echo "Organizing HTML documentation..."
|
|
cd $docDir
|
|
|
|
# beautify HTML docs and remove stuff we don't need
|
|
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
|
|
|
|
# no info documentation
|
|
rm -r $infoDir
|
|
|
|
### Strip #################################################
|
|
|
|
echo "Strip debug info"
|
|
|
|
strip --strip-debug $binDir/*
|
|
|
|
### 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/$effectiveTargetMachineTriple/bin/*; do
|
|
symlinkRelative -sfn $binDir/$(basename $file) $file
|
|
done
|
|
|
|
### Cleanup #################################################
|
|
|
|
echo "Cleanup"
|
|
|
|
# delete commands we aren't including
|
|
cd $binDir
|
|
for cmd in dlltool dllwrap windmc windres; do
|
|
rm -f $cmd
|
|
rm -f $installDir/$effectiveTargetMachineTriple/bin/$cmd
|
|
done
|
|
|
|
# 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
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
cd $objectsDir
|
|
make check
|
|
}
|