mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 19:50:05 +02:00
Add recipes for binutils/gcc 4
The directory layout has changed similarly to that of the gcc 2 couple, i.e. we install in develop/tools[/<arch>] instead of separate subdirectories, so gcc finds the matching gas and ld. Only tested the secondary architecture build so far.
This commit is contained in:
168
sys-devel/binutils/binutils-2.23.2_2013_04_09.recipe
Normal file
168
sys-devel/binutils/binutils-2.23.2_2013_04_09.recipe
Normal file
@@ -0,0 +1,168 @@
|
||||
SUMMARY="Assembler, linker and binary tools for target ${targetMachineTriple}"
|
||||
HOMEPAGE="http://www.gnu.org/software/binutils"
|
||||
|
||||
SRC_URI="
|
||||
git+git://github.com/haiku/BuildtoolsPM.git#db2a6d28f6c6a92cfb1c619b0828dfbf6b87ca30"
|
||||
REVISION="1"
|
||||
LICENSE="
|
||||
GNU GPL v2
|
||||
GNU LGPL v2
|
||||
"
|
||||
COPYRIGHT="1988-2013 Free Software Foundation, Inc."
|
||||
|
||||
ARCHITECTURES="x86"
|
||||
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="
|
||||
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_2.23.2$secondaryArchSuffix = $portVersion compat >= 2.23
|
||||
lib:libopcodes_2.23.2$secondaryArchSuffix = $portVersion compat >= 2.23
|
||||
"
|
||||
|
||||
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:strip
|
||||
cmd:tar
|
||||
"
|
||||
|
||||
SOURCE_DIR="binutils-$portVersion/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 --enable-shared=yes
|
||||
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd $objectsDir
|
||||
|
||||
make install
|
||||
make install-html
|
||||
|
||||
# Remove the development libraries and headers. Nobody uses those anyway.
|
||||
rm $libDir/*.a $libDir/*.la $libDir/libbfd.so $libDir/libopcodes.so
|
||||
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 standards.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 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 $effectiveTargetMachineTriple.
|
||||
"
|
||||
130
sys-devel/gcc/gcc-4.7.3_2013_08_03.recipe
Normal file
130
sys-devel/gcc/gcc-4.7.3_2013_08_03.recipe
Normal file
@@ -0,0 +1,130 @@
|
||||
SUMMARY="C/C++ cross-compiler for target ${effectiveTargetMachineTriple}"
|
||||
DESCRIPTION="Standard compiler for x86 platform."
|
||||
HOMEPAGE="http://gcc.gnu.org"
|
||||
LICENSE="
|
||||
GNU GPL v2
|
||||
GNU LGPL v2
|
||||
"
|
||||
COPYRIGHT="1988-2013 Free Software Foundation, Inc."
|
||||
SRC_URI="
|
||||
git+file://$portBaseDir/../binutils/download/BuildtoolsPM.git#7a87db2a172a406b79540188a23e52491ad3b741
|
||||
git+git://github.com/haiku/BuildtoolsPM.git#7a87db2a172a406b79540188a23e52491ad3b741
|
||||
"
|
||||
REVISION="1"
|
||||
ARCHITECTURES="x86"
|
||||
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="
|
||||
gcc$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:c++$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:cc$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:cpp$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:g++$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:gcc$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:gcc_4.7.3$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4
|
||||
"
|
||||
|
||||
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:strip
|
||||
cmd:tar
|
||||
"
|
||||
|
||||
SOURCE_DIR="gcc-$portVersion/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
|
||||
|
||||
CFLAGS="-O2 -U_FORTIFY_SOURCE" CXXFLAGS="-O2" "$sourceDir/configure" \
|
||||
--prefix=$installDir --libexecdir=$installDir/lib --mandir=$manDir \
|
||||
--docdir=$docDir \
|
||||
--disable-nls --enable-shared \
|
||||
--enable-languages=c,c++ --enable-lto --enable-frame-pointer \
|
||||
--with-pkgversion=$(echo $portVersion | cut -c 7-) \
|
||||
$additionalConfigureFlags
|
||||
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
cd $objectsDir
|
||||
|
||||
make install-strip
|
||||
make install-html
|
||||
|
||||
### HTML documentation ####################################
|
||||
|
||||
echo "Organizing HTML documentation..."
|
||||
cd $docDir
|
||||
for dir in gmp libquadmath mpc mpfr; do
|
||||
mv ${dir}.html $dir
|
||||
ln -s $dir/index.html ${dir}.html
|
||||
done
|
||||
|
||||
### Strip #################################################
|
||||
|
||||
echo "Strip debug info"
|
||||
|
||||
cd $installDir
|
||||
strip --strip-debug bin/*
|
||||
for f in cc1 cc1plus collect2 lto1; do
|
||||
strip --strip-debug lib/gcc/$effectiveTargetMachineTriple/*/$f
|
||||
done
|
||||
strip --strip-debug lib/*.a
|
||||
|
||||
### Symlinks ##############################################
|
||||
|
||||
echo "Creating required symlinks"
|
||||
|
||||
# make all tools available via default paths
|
||||
mkdir -p $binDir
|
||||
for f in c++ cpp g++ gcc gcov; do
|
||||
symlinkRelative -sfn $installDir/bin/$f $binDir
|
||||
done
|
||||
|
||||
### Cleanup ###############################################
|
||||
|
||||
echo "Cleanup"
|
||||
rm -rf $installDir/info
|
||||
rm -rf $installDir/share
|
||||
}
|
||||
Reference in New Issue
Block a user