core/gcc/Pkgfile

61 lines
1.7 KiB
Plaintext
Raw Normal View History

2006-02-23 16:26:10 +01:00
# Description: The GNU Compiler Collection
2022-01-07 18:37:13 +01:00
# URL: https://gcc.gnu.org
2021-04-09 15:00:32 +02:00
# Maintainer: CRUX System Team, core-ports at crux dot nu
2022-01-07 18:37:13 +01:00
# Depends on: libmpc zlib zstd
2006-02-23 16:26:10 +01:00
name=gcc
2023-05-08 19:00:59 +02:00
version=12.3.0
release=2
2021-12-28 16:57:54 +01:00
source=(https://sourceware.org/pub/gcc/releases/gcc-$version/$name-$version.tar.xz
$name-nocheck-fixincludes.patch $name-4.7.3-multilib-dirs.patch
fix-nested-generic-lambda.patch)
2008-09-17 10:43:39 +02:00
2006-02-23 16:26:10 +01:00
build() {
2021-04-09 15:00:32 +02:00
patch -d $name-$version -p1 -i $SRC/$name-nocheck-fixincludes.patch
patch -d $name-$version -p1 -i $SRC/$name-4.7.3-multilib-dirs.patch
patch -d $name-$version -p1 -i $SRC/fix-nested-generic-lambda.patch
2021-04-09 15:00:32 +02:00
2021-12-11 19:32:44 +01:00
# pipe fails tests
CFLAGS=${CFLAGS/-pipe/}
CXXFLAGS=${CXXFLAGS/-pipe/}
2021-04-09 15:00:32 +02:00
mkdir build
cd build
../$name-$version/configure \
--prefix=/usr \
--libexecdir=/usr/lib \
2021-12-11 19:32:44 +01:00
--enable-languages=c,c++,lto \
2021-04-09 15:00:32 +02:00
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-clocale=gnu \
--enable-shared \
2021-12-11 19:32:44 +01:00
--enable-lto \
2021-04-09 15:00:32 +02:00
--with-x=no \
--enable-multilib \
2021-12-11 19:32:44 +01:00
--enable-plugin \
2021-04-09 15:00:32 +02:00
--enable-default-pie \
--enable-default-ssp \
2022-01-07 18:37:13 +01:00
--with-pkgversion="CRUX-x86_64-multilib" \
--with-system-zlib \
--disable-nls
2021-04-09 15:00:32 +02:00
make bootstrap
make -j1 DESTDIR=$PKG install
install -d $PKG/lib
ln -sf ../usr/bin/cpp $PKG/lib/cpp
ln -sf gcc $PKG/usr/bin/cc
ln -sf g++ $PKG/usr/bin/c++
mv $PKG/usr/lib/gcc/*/$version/include-fixed/{limits.h,syslimits.h} $PKG/usr/lib/gcc/*/$version/include/
2021-12-11 19:32:44 +01:00
rm -r $PKG/usr/share/{info,$name-$version}
2021-04-09 15:00:32 +02:00
rm -r $PKG/usr/bin/*-linux-gnu-*
2021-12-11 19:32:44 +01:00
rm -r $PKG/usr/lib/gcc/*/$version/{install-tools,include-fixed}
2021-04-09 15:00:32 +02:00
for D in lib{,32}; do
install -d -m 0755 $PKG/usr/share/gdb/auto-load/usr/${D}
mv $PKG/usr/${D}/libstdc++.so.*-gdb.py $PKG/usr/share/gdb/auto-load/usr/${D}
done
sed -i "s|-L$SRC[^ ]* ||g" $PKG/usr/lib{,32}/{libstdc++.la,libsupc++.la}
2006-02-23 16:26:10 +01:00
}