Files
haikuports/sys-devel/m68k_elf_binutils/m68k_elf_binutils-2.44.recipe
2025-02-22 22:43:05 +01:00

154 lines
4.5 KiB
Bash

SUMMARY="Assembler, linker and binary tools for m68k family processors"
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.
- 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-2024 Free Software Foundation, Inc."
LICENSE="GNU GPL v3
GNU LGPL v3"
REVISION="1"
SOURCE_URI="https://ftp.gnu.org/gnu/binutils/binutils-$portVersion.tar.xz"
SOURCE_DIR="binutils-$portVersion"
CHECKSUM_SHA256="ce2017e059d63e67ddb9240e9d4ec49c2893605035cd60e92ad53177f4377237"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
targetArch="m68k-elf"
targetU="m68k_elf"
PROVIDES="
${targetU}_binutils$secondaryArchSuffix = $portVersion compat >= 2.44
cmd:${targetU}_addr2line = $portVersion compat >= 2.44
cmd:${targetU}_ar = $portVersion compat >= 2.44
cmd:${targetU}_as = $portVersion compat >= 2.44
cmd:${targetU}_c++filt = $portVersion compat >= 2.44
cmd:${targetU}_elfedit = $portVersion compat >= 2.44
cmd:${targetU}_gprof = $portVersion compat >= 2.44
cmd:${targetU}_ld = $portVersion compat >= 2.44
cmd:${targetU}_ld.bfd = $portVersion compat >= 2.44
cmd:${targetU}_nm = $portVersion compat >= 2.44
cmd:${targetU}_objcopy = $portVersion compat >= 2.44
cmd:${targetU}_objdump = $portVersion compat >= 2.44
cmd:${targetU}_ranlib = $portVersion compat >= 2.44
cmd:${targetU}_readelf = $portVersion compat >= 2.44
cmd:${targetU}_size = $portVersion compat >= 2.44
cmd:${targetU}_strings = $portVersion compat >= 2.44
cmd:${targetU}_strip = $portVersion compat >= 2.44
lib:${targetU}_libbfd_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.44
lib:${targetU}_libopcodes_$binutilsVersion$secondaryArchSuffix = $portVersion compat >= 2.44
lib:libctf_nobfd$secondaryArchSuffix = 0.0.0 compat >= 0
lib:libctf$secondaryArchSuffix = 0.0.0 compat >= 0
lib:libsframe$secondaryArchSuffix = 0.0.0 compat >= 0
devel:libctf_nobfd$secondaryArchSuffix = 0.0.0 compat >= 0
devel:libctf$secondaryArchSuffix = 0.0.0 compat >= 0
devel:libsframe$secondaryArchSuffix = 0.0.0 compat >= 0
"
REQUIRES="
binutils$secondaryArchSuffix
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/${targetArch}"
installDir="$prefix/$relativeInstallDir"
objectsDir=$(pwd)/../${portVersionedName}-obj
BUILD()
{
rm -rf $objectsDir
mkdir -p $objectsDir
cd $objectsDir
CFLAGS=-O2 CXXFLAGS=-O2 runConfigure --omit-dirs binDir \
"$sourceDir/configure" \
--exec-prefix=$installDir \
--includedir=$includeDir/binutils \
--docdir=$docDir --with-sysroot=$installDir \
--enable-deterministic-archives --enable-shared=yes \
--disable-nls --bindir=$prefix/bin --target=${targetArch}
make $jobArgs LEXLIB=
}
INSTALL()
{
cd $objectsDir
make install
# no info documentation
rm -r $infoDir
### Strip #################################################
echo "Strip debug info"
strip --strip-debug $prefix/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/${targetArch}/bin/*; do
symlinkRelative -sfn $prefix/bin/${targetArch}-$(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
rm $libDir/*.la $libDir/*.a
prepareInstalledDevelLibs libctf libsframe
}