mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
gcc: add recipe for version 4.8.3
This commit is contained in:
164
sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe
Normal file
164
sys-devel/gcc/gcc-4.8.3_2014_05_28.recipe
Normal file
@@ -0,0 +1,164 @@
|
||||
SUMMARY="C/C++ cross-compiler for target ${effectiveTargetMachineTriple}"
|
||||
DESCRIPTION="
|
||||
Standard compiler for x86 platform.
|
||||
"
|
||||
HOMEPAGE="http://gcc.gnu.org"
|
||||
|
||||
srcGitRev="3ad9ac2317f63b65937473c4fbe37c9e93e3a116"
|
||||
SRC_URI="https://github.com/haiku/buildtools/archive/$srcGitRev.tar.gz"
|
||||
CHECKSUM_SHA256="85499c650421b68f9830d3fb2ddfafb8789a3e1ffce75e8dd27aaed678135df0"
|
||||
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="
|
||||
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.8.3$secondaryArchSuffix = $portVersion compat >= 4
|
||||
cmd:gcov$secondaryArchSuffix = $portVersion compat >= 4
|
||||
lib:libstdc++$secondaryArchSuffix = $portVersion compat >= 4
|
||||
"
|
||||
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix >= $haikuVersion
|
||||
cmd:as$secondaryArchSuffix
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
"
|
||||
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 --enable-threads=posix \
|
||||
--disable-nls --enable-shared --with-gnu-ld \
|
||||
--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
|
||||
|
||||
### Disable ASLR ##########################################
|
||||
|
||||
echo "Add SYS:ENV attribute to disable ASLR"
|
||||
|
||||
cd $installDir
|
||||
for f in bin/*; do
|
||||
if [ -r "$f" ]; then
|
||||
addattr SYS:ENV DISABLE_ASLR=1 $f
|
||||
fi
|
||||
done
|
||||
for f in cc1 cc1plus collect2 lto1; do
|
||||
addattr SYS:ENV DISABLE_ASLR=1 \
|
||||
lib/gcc/$effectiveTargetMachineTriple/*/$f
|
||||
done
|
||||
|
||||
### Symlinks ##############################################
|
||||
|
||||
echo "Creating required symlinks"
|
||||
|
||||
# create missing cc symlink
|
||||
ln -sf gcc $installDir/bin/cc
|
||||
|
||||
# make all tools available via default paths
|
||||
mkdir -p $binDir
|
||||
for f in c++ cc 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