123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- # Maintainer: André Silva <emulatorman@hyperbola.info>
- # Maintainer: Márcio Silva <coadde@hyperbola.info>
- # Maintainer: Luke R. <g4jc@hyperbola.info>
- # Based on gcc package
- _ctarget=i686-unknown-hyperbolabsd
- pkgname=$_ctarget-gcc
- pkgver=8.5.0
- _islver=0.24
- pkgrel=2
- pkgdesc="The GNU Compiler Collection - cross compiler for HyperbolaBSD i686 target"
- arch=('i686' 'x86_64')
- license=('GPL-3' 'LGPL-3' 'custom:GCC-Exception-3.1' 'FDL-1.3')
- url="https://gcc.gnu.org"
- groups=('cross-devel')
- depends=('libmpc')
- makedepends=('doxygen' 'libxcrypt')
- checkdepends=('dejagnu' 'net-tools')
- options=('!emptydirs' 'staticlibs')
- source=(https://ftp.gnu.org/gnu/gcc/gcc-$pkgver/gcc-$pkgver.tar.xz{,.sig}
- https://libisl.sourceforge.io/isl-${_islver}.tar.xz
- gcc-hyperbolabsd.patch
- COPYING.DOC)
- validpgpkeys=('D3A93CAD751C2AF4F8C7AD516C35B99309B5FA62') # Jakub Jelinek <jakub@redhat.com>
- sha512sums=('92f599680e6b7fbce88bcdda810f468777d541e5fddfbb287f7977d51093de2a5178bd0e6a08dfe37090ea10a0508a43ccd00220041abbbec33f1179bfc174d8'
- 'SKIP'
- 'ff6bdcff839e1cd473f2a0c1e4dd4a3612ec6fee4544ccbc62b530a7248db2cf93b4b99bf493a86ddf2aba00e768927265d5d411f92061ea85fd7929073428e8'
- '50bb6eba6ed0a7602cc52f96b7b9cc2d435393eba30a2103f2e1f68f170f2ecc8acae6dc42c7c0f6a3af70264f6a4a10783793c1826a7b292cd610d4f18acaab'
- 'bea1788b2bdc84f470e459114b871cf4ee991718964a63e18adde65116806d7676484cb30857cf74dece5eef5f96a015ee4a21900e019623e5d3484868b28b7f')
- _libdir="usr/lib/gcc/$_ctarget/$pkgver"
- prepare() {
- cd ${srcdir}/gcc-$pkgver
- # 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
- # Hyperbola GNU/Linux-libre installs 64-bit libraries in /lib
- if [ $(uname -s) = Linux ]; then
- [ $CARCH = "x86_64" ] && sed -i '/m64=/s/lib64/lib/' gcc/config/i386/t-linux64
- fi
- # hack! - some configure tests for header files using "$CPP $CPPFLAGS"
- sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
- # HyperbolaBSD patch
- patch -p1 -i ${srcdir}/gcc-hyperbolabsd.patch
- 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
- CFLAGS=${CFLAGS/-pipe/}
- CXXFLAGS=${CXXFLAGS/-pipe/}
- ${srcdir}/gcc-$pkgver/configure --prefix=/usr \
- --libdir=/usr/lib \
- --libexecdir=/usr/libexec \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --with-bugurl=https://issues.hyperbola.info/ \
- --enable-languages=c,c++,lto \
- --enable-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 \
- --disable-nls \
- --target=$_ctarget
- make all-gcc
- }
- 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}/gcc-$pkgver/contrib/test_summary
- }
- package() {
- cd ${srcdir}/gcc-build
- make -C gcc DESTDIR=${pkgdir} install-driver install-cpp install-gcc-ar \
- c++.install-common install-headers install-plugin install-lto-wrapper
- install -m755 gcc/gcov $pkgdir/usr/bin/$_ctarget-gcov
- install -m755 -t $pkgdir/${_libdir}/ gcc/{cc1,cc1plus,collect2,lto1}
- make DESTDIR=${pkgdir} install-fixincludes
- make -C gcc DESTDIR=${pkgdir} install-mkheaders
- make -C lto-plugin DESTDIR=${pkgdir} install
- make -C gcc DESTDIR=${pkgdir} install-man
- make -C libcpp DESTDIR=${pkgdir} install
- make -C gcc DESTDIR=${pkgdir} install-po
- # many packages expect this symlink
- ln -s $_ctarget-gcc ${pkgdir}/usr/bin/$_ctarget-cc
- # POSIX conformance launcher scripts for c89 and c99
- cat > $pkgdir/usr/bin/$_ctarget-c89 <<"EOF"
- #!/bin/sh
- fl="-std=c89"
- for opt; do
- case "$opt" in
- -ansi|-std=c89|-std=iso9899:1990) fl="";;
- -std=*) echo "`basename $0` called with non ANSI/ISO C option $opt" >&2
- exit 1;;
- esac
- done
- exec gcc $fl ${1+"$@"}
- EOF
- sed -i "s|exec gcc|exec $_ctarget-gcc|" $pkgdir/usr/bin/$_ctarget-c89
- cat > $pkgdir/usr/bin/$_ctarget-c99 <<"EOF"
- #!/bin/sh
- fl="-std=c99"
- for opt; do
- case "$opt" in
- -std=c99|-std=iso9899:1999) fl="";;
- -std=*) echo "`basename $0` called with non ISO C99 option $opt" >&2
- exit 1;;
- esac
- done
- exec gcc $fl ${1+"$@"}
- EOF
- sed -i "s|exec gcc|exec $_ctarget-gcc|" $pkgdir/usr/bin/$_ctarget-c99
- chmod 755 $pkgdir/usr/bin/$_ctarget-c{8,9}9
- # Remove man documents that conflict with host version
- rm -rf ${pkgdir}/usr/share/man/man7
- # Remove unused dirs
- rmdir ${pkgdir}/usr/{include,share/info}
- # Add licenses
- install -m755 -d ${pkgdir}/usr/share/licenses/$_ctarget-gcc
- install -m644 ${srcdir}/gcc-$pkgver/COPYING{3{,.LIB},.RUNTIME} ${srcdir}/COPYING.DOC \
- ${pkgdir}/usr/share/licenses/$_ctarget-gcc
- }
|