summaryrefslogtreecommitdiff
path: root/libre/gcc-libs-static/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/gcc-libs-static/PKGBUILD')
-rw-r--r--libre/gcc-libs-static/PKGBUILD124
1 files changed, 124 insertions, 0 deletions
diff --git a/libre/gcc-libs-static/PKGBUILD b/libre/gcc-libs-static/PKGBUILD
new file mode 100644
index 000000000..084875611
--- /dev/null
+++ b/libre/gcc-libs-static/PKGBUILD
@@ -0,0 +1,124 @@
+# Maintainer: Márcio Silva <coadde@parabola.nu>
+# based of gcc
+
+_pkgname=gcc-libs
+pkgname=gcc-libs-static
+pkgver=5.3.0
+_pkgver=5
+_islver=0.15
+pkgrel=3
+#_snapshot=5-20150623
+pkgdesc="The GNU Compiler Collection (static libraries only)"
+arch=('i686' 'x86_64' 'armv7h')
+license=('GPL' 'LGPL' 'FDL' 'custom')
+url="http://gcc.gnu.org"
+makedepends=('binutils>=2.25' 'libmpc' 'glibc-static')
+checkdepends=('dejagnu' 'inetutils')
+options=('!docs' 'staticlibs' '!emptydirs')
+source=(ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.bz2
+ #ftp://gcc.gnu.org/pub/gcc/snapshots/${_snapshot}/gcc-${_snapshot}.tar.bz2
+ http://isl.gforge.inria.fr/isl-${_islver}.tar.bz2)
+md5sums=('c9616fd448f980259c31de613e575719'
+ '8428efbbc6f6e2810ce5c1ba73ecf98c')
+
+if [ -n "${_snapshot}" ]; then
+ _basedir=gcc-${_snapshot}
+else
+ _basedir=gcc-${pkgver}
+fi
+
+_libdir="usr/lib/gcc/$CHOST/$pkgver"
+
+prepare() {
+ cd ${srcdir}/${_basedir}
+
+ # link isl for in-tree build
+ ln -s ../isl-${_islver} isl
+
+ # Do not run fixincludes
+ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+
+ # Parabola GNU/Linux-libre installs x86_64 libraries /lib
+ [[ $CARCH == "x86_64" ]] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
+
+ echo ${pkgver} > gcc/BASE-VER
+
+ # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
+ sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
+
+ mkdir ${srcdir}/gcc-build
+}
+
+build() {
+ cd ${srcdir}/gcc-build
+
+ # using -pipe causes spurious test-suite failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48565
+ # enable -fPIC for static libraries
+ CFLAGS="${CFLAGS/-pipe/} -fPIC"
+ CXXFLAGS="${CXXFLAGS/-pipe/} -fPIC"
+
+ ${srcdir}/${_basedir}/configure --prefix=/usr \
+ --libdir=/usr/lib \
+ --with-bugurl=https://labs.parabola.nu/ \
+ --enable-languages=c,c++,fortran,lto,objc,obj-c++ \
+ --disable-shared --enable-threads=posix --enable-libmpx \
+ --with-system-zlib --with-isl --enable-__cxa_atexit \
+ --disable-libunwind-exceptions --enable-clocale=gnu \
+ --disable-libstdcxx-pch --disable-libssp \
+ --enable-gnu-unique-object --enable-linker-build-id \
+ --enable-lto --enable-plugin --enable-install-libiberty \
+ --with-linker-hash-style=gnu --enable-gnu-indirect-function \
+ --disable-multilib --disable-werror \
+ --enable-checking=release
+
+# --libexecdir=/usr/lib
+# --enable-languages=go
+
+ make
+}
+
+check() {
+ cd ${srcdir}/gcc-build
+
+ # increase stack size to prevent test failures
+ # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31827
+ ulimit -s 32768
+
+ # do not abort on error as some are "expected"
+ make -k check || true
+ ${srcdir}/${_basedir}/contrib/test_summary
+}
+
+package()
+{
+ pkgdesc="Runtime libraries shipped by GCC (static libraries only)"
+ depends=('gcc-libs')
+ options=('!emptydirs' '!strip' '!docs' 'staticlibs')
+
+ cd ${srcdir}/gcc-build
+
+# make -C $CHOST/libgcc DESTDIR=${pkgdir} install
+
+ for lib in libatomic \
+ libcilkrts \
+ libgfortran \
+ libgomp \
+ libitm \
+ libquadmath \
+ libsanitizer/{a,l,ub}san \
+ libstdc++-v3/src \
+ libvtv; do
+ make -C $CHOST/$lib DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES
+ done
+
+# libgo
+
+ [[ $CARCH == "x86_64" ]] && \
+ make -C $CHOST/libsanitizer/tsan DESTDIR=${pkgdir} install-toolexeclibLTLIBRARIES
+
+ make -C $CHOST/libobjc DESTDIR=${pkgdir} install-libs
+
+ make -C $CHOST/libmpx DESTDIR=${pkgdir} install
+ rm ${pkgdir}/usr/lib/libmpx.spec
+}