67 lines
1.9 KiB
Plaintext
67 lines
1.9 KiB
Plaintext
|
# URL: http://gcc.gnu.org/
|
||
|
# Description: The GNU Compiler Collection.
|
||
|
# Maintainer: Danny Rawlins, crux at romster dot me
|
||
|
|
||
|
name=gcc48
|
||
|
version=4.8.5
|
||
|
release=1
|
||
|
source=(http://ftp.gnu.org/gnu/gcc/gcc-$version/gcc-$version.tar.bz2
|
||
|
gcc-nocheck-fixincludes.patch gcc-4.7.3-multilib-dirs.patch)
|
||
|
|
||
|
build() {
|
||
|
patch -d gcc-$version -p 1 -i $SRC/gcc-nocheck-fixincludes.patch
|
||
|
patch -d gcc-$version -p 1 -i $SRC/gcc-4.7.3-multilib-dirs.patch
|
||
|
local SUFFIX=-${version%.*}
|
||
|
|
||
|
mkdir build
|
||
|
cd build
|
||
|
../gcc-$version/configure \
|
||
|
--prefix=/usr \
|
||
|
--libexecdir=/usr/lib \
|
||
|
--program-suffix=$SUFFIX \
|
||
|
--enable-languages=c,c++,objc \
|
||
|
--enable-threads=posix \
|
||
|
--enable-__cxa_atexit \
|
||
|
--enable-clocale=gnu \
|
||
|
--enable-shared \
|
||
|
--disable-nls \
|
||
|
--with-x=no \
|
||
|
--with-system-zlib \
|
||
|
--enable-multilib \
|
||
|
--with-pkgversion="CRUX"
|
||
|
|
||
|
if [ -n "$(pkginfo -i | grep '^ccache ')" ]; then
|
||
|
make STAGE_CC_WRAPPER='/usr/bin/ccache' BOOT_CFLAGS="$CFLAGS" bootstrap
|
||
|
else
|
||
|
make BOOT_CFLAGS="$CFLAGS" bootstrap
|
||
|
fi
|
||
|
|
||
|
make -j 1 DESTDIR=$PKG install
|
||
|
|
||
|
install -d $PKG/lib
|
||
|
ln -sf ../usr/bin/cpp$SUFFIX $PKG/lib/cpp$SUFFIX
|
||
|
ln -sf gcc$SUFFIX $PKG/usr/bin/cc$SUFFIX
|
||
|
ln -sf g++$SUFFIX $PKG/usr/bin/c++$SUFFIX
|
||
|
|
||
|
mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
|
||
|
sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/{libstdc++.la,libsupc++.la}
|
||
|
|
||
|
# remove files already on the system out of the port
|
||
|
for i in $(pkginfo -l gcc | sed -e "s|^|/|") $(pkginfo -l binutils | sed -e "s|^|/|"); do
|
||
|
if [ -e "$i" ] && [ ! -d "$i" ]; then
|
||
|
if [ -e "$PKG$i" ]; then
|
||
|
rm "$PKG$i"
|
||
|
fi
|
||
|
# check for compressed manpages
|
||
|
if [ -e "$PKG${i%%.gz}" ]; then
|
||
|
rm "$PKG${i%%.gz}"
|
||
|
fi
|
||
|
fi
|
||
|
done
|
||
|
|
||
|
rm -f $PKG/usr/lib{,32}/{libiberty.a,libstdc++.so.6.0.19-gdb.py}
|
||
|
rm -r $PKG/usr/share/{info,gcc-$version}
|
||
|
rm -r $PKG/usr/bin/*-linux-gnu-*
|
||
|
rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
|
||
|
}
|