Revision 4 of gcc-2.95.3_110711:

* strip debug info from all binaries
* based on architecture, decide whether or not to link the tools into
  the default path
* use relative symlinks instead of absolute ones, as the latter won't work
  when building gcc with itself (in which case the .self-symlink in the 
  /packages folder will point to the packaging path, where no binaries
  exist yet)
This commit is contained in:
Oliver Tappe
2013-04-14 15:41:22 +00:00
parent b5cfbf400e
commit e494b43bda

View File

@@ -5,7 +5,7 @@ DESCRIPTION="
HOMEPAGE="http://gcc.gnu.org"
# TODO: Also: http://www.gnu.org/software/binutils
SRC_URI="git+git://github.com/haiku/BuildtoolsPM.git#ba94fdf309096bd9bbf432ad53efba62bc47f98e"
REVISION="3"
REVISION="4"
ARCHITECTURES="x86_gcc2 ?x86"
PROVIDES="
@@ -52,7 +52,8 @@ BUILD_PREREQUIRES="
SOURCE_DIR="$portVersionedName"
gccDate=110711
gccInstallDir="$prefix/develop/tools/gcc-2.95.3-${gccDate}"
relativeGccInstallDir="develop/tools/gcc-2.95.3-${gccDate}"
gccInstallDir="$prefix/$relativeGccInstallDir"
objectsDir=$(pwd)/../${portVersionedName}-obj
binutilsObjectsDir=$objectsDir/binutils
gccObjectsDir=$objectsDir/gcc
@@ -142,16 +143,44 @@ INSTALL()
echo "binutils HTML documentation missing, see" \
"INSTALL-gcc2-from-source-Haiku."
fi
### Cleanup ###############################################
echo "Cleanup"
### Symlinks ##############################################
echo "Creating required symlinks"
# create symlinks to binutils binaries
cd $base/bin
for binary in ../i586-pc-haiku/bin/*; do
ln -sfn $binary .
done
# convert to absolute links to relative ones
ln -sfn g++ c++
ln -sfn gcc i586-pc-haiku-gcc
# make all tools available via default paths if this is the system
# compiler
if [ $architecture = 'x86_gcc2' ]; then
echo "Symlinking binaries into default path"
mkdir -p $prefix/bin
cd $prefix/bin
ln -sfn ../$relativeGccInstallDir/bin/* .
fi
### Strip #################################################
echo "Strip debug info"
cd $base
strip --strip-debug bin/*
strip --strip-debug i586-pc-haiku/bin/*
strip --strip-debug lib/gcc-lib/i586-pc-haiku/2.95.3-${gccDate}/* \
&>/dev/null || true
### Cleanup ###############################################
echo "Cleanup"
if [ -d $base/man -o -d $base/info -o -d $base/share ]; then
rm -rf $base/man
rm -rf $base/info
@@ -169,12 +198,6 @@ INSTALL()
ln -snf /boot/system/lib/libstdc++.r4.so $base/lib/
ln -snf /boot/system/lib/libstdc++.so $base/lib/
### Symlink all binaries to $prefix/bin ###################
mkdir -p $prefix/bin
cd $prefix/bin
ln -sfn $base/bin/* .
}
LICENSE="GNU GPL v2