summaryrefslogtreecommitdiffstats
path: root/testing/gcc/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/gcc/APKBUILD')
-rw-r--r--testing/gcc/APKBUILD122
1 files changed, 122 insertions, 0 deletions
diff --git a/testing/gcc/APKBUILD b/testing/gcc/APKBUILD
new file mode 100644
index 00000000..8f78827e
--- /dev/null
+++ b/testing/gcc/APKBUILD
@@ -0,0 +1,122 @@
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=gcc
+pkgver=4.4.1
+_specsver=0.1.4
+_espfver=0.3.1
+pkgrel=0
+pkgdesc="The GNU Compiler Collection"
+url="http://gcc.gnu.org"
+license="GPL LGPL"
+depends="binutils"
+makedepends="bison flex gmp-dev mpfr-dev texinfo"
+subpackages="$pkgname-doc libstdc++:libcxx g++:gpp libgcc libgomp"
+source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2
+ ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-g++-$pkgver.tar.bz2
+ http://weaver.gentooenterprise.com/hardened/patches/gcc-$pkgver-espf-$_espfver.tar.bz2
+ http://weaver.gentooenterprise.com/hardened/patches/gcc-$pkgver-specs-$_specsver.tar.bz2
+ gcc4-stack-protector-uclibc-no_tls.patch
+ pt_gnu_eh_frame.patch
+ "
+# ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2
+build ()
+{
+ cd ${srcdir}/gcc-${pkgver}
+
+ # uclibc patches
+ for i in ../*.patch; do
+ msg "Applying $i"
+ patch -p1 -i $i || return 1
+ done
+
+ # ESPF patches. we dont use objc yet
+ rm -f ../espf-gcc-$pkgver/*_objc*lang-specs*.patch
+ # thanks to Zorry for hard work on those patches
+ for i in ../espf-gcc-$pkgver/*.patch; do
+ msg "Applying $i"
+ patch -p0 -i $i || return 1
+ done
+
+ echo ${pkgver} > gcc/BASE-VER
+ mkdir build
+ cd build
+ ../configure --prefix=/usr \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --build=${CHOST:-i486-alpine-linux-uclibc} \
+ --disable-altivec \
+ --disable-checking \
+ --disable-fixed-point \
+ --disable-libssp \
+ --disable-libstdcxx-pch \
+ --disable-multilib \
+ --disable-nls \
+ --disable-threads \
+ --disable-tls \
+ --disable-werror \
+ --enable-__cxa_atexit \
+ --enable-cld \
+ --enable-espf \
+ --enable-languages=c,c++ \
+ --enable-shared \
+ --enable-target-optspace \
+ --with-arch=i486 \
+ --with-system-zlib
+
+ make || return 1
+ make -j1 DESTDIR="${pkgdir}" install || return 1
+ ln -s gcc "$pkgdir"/usr/bin/cc
+
+ # binutils provides libiberty.a
+ rm -f "$pkgdir"/usr/lib/libiberty.a
+
+ # install the specs
+ cd "$srcdir"/specs
+ install -d "$pkgdir"/usr/share/gcc
+ for i in *.specs; do
+ install -m644 $i "$pkgdir"/usr/share/gcc/$i || return 1
+ done
+}
+
+libcxx() {
+ pkgdesc="GNU C++ standard runtime library"
+ depends=
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libstdc++.so* "$subpkgdir"/usr/lib/
+}
+
+gpp() {
+ pkgdesc="GNU C++ standard library and compiler"
+ depends=
+ local libexec=usr/libexec/gcc/${CHOST:-i486-alpine-linux-uclibc}/$pkgver
+ mkdir -p "$subpkgdir/$libexec" \
+ "$subpkgdir"/usr/bin \
+ "$subpkgdir"/usr/include \
+ "$subpkgdir"/usr/lib \
+
+ mv "$pkgdir/$libexec/cc1plus" "$subpkgdir/$libexec/"
+ mv "$pkgdir"/usr/lib/*++* "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/include/c++ "$subpkgdir"/usr/include/
+ mv "$pkgdir"/usr/bin/*++ "$subpkgdir"/usr/bin/
+}
+
+libgcc() {
+ pkgdesc="GNU C compiler runtime libraries"
+ depends=
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libgcc_s.so* "$subpkgdir"/usr/lib/
+}
+
+libgomp() {
+ pkgdesc="GCC shared-memory parallel programming API library"
+ depends=
+ replaces="gcc"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libgomp.so* "$subpkgdir"/usr/lib/
+}
+
+md5sums="d19693308aa6b2052e14c071111df59f gcc-core-4.4.1.tar.bz2
+d449047b5761348ceec23739f5553e0b gcc-g++-4.4.1.tar.bz2
+43d0bbd676bbb2acd67ddabd0ea1bc2b gcc-4.4.1-espf-0.3.1.tar.bz2
+da8d9165e828bbb9809ef86f1c72886f gcc-4.4.1-specs-0.1.4.tar.bz2
+15e77082db0e1a131af98debd3016290 gcc4-stack-protector-uclibc-no_tls.patch
+2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch"