void-packages/srcpkgs/gcc-multilib/template
2021-06-21 18:10:56 +02:00

96 lines
2.9 KiB
Bash

# Template file for 'gcc-multilib'
archs="x86_64"
_triplet="x86_64-unknown-linux-gnu"
pkgname=gcc-multilib
version=10.2.1pre1
revision=1
_majorver="${version%.*}"
wrksrc=gcc-${version/pre/_pre}
short_desc="GNU Compiler Collection (multilib files)"
maintainer="Orphaned <orphan@voidlinux.org>"
homepage="http://gcc.gnu.org"
license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
distfiles="https://dev.alpinelinux.org/~nenolod/gcc-${version/pre/_pre}.tar.xz"
checksum=772cfd5d30eb9cc5a996fec9ba8cdcb45d37df1c9b5770610103b814b732c590
hostmakedepends="perl flex tar zip unzip"
makedepends="zlib-devel libmpc-devel isl15-devel libfl-devel
glibc-32bit glibc-devel-32bit"
depends="
gcc>=${_majorver}
libgcc-32bit>=${_majorver}
libssp-devel-32bit>=${_majorver}
libgomp-devel-32bit>=${_majorver}
libitm-devel-32bit>=${_majorver}
libsanitizer-devel-32bit>=${_majorver}
libatomic-devel-32bit>=${_majorver}
libvtv-devel-32bit>=${_majorver}
zlib-32bit
glibc-devel-32bit"
replaces="libmpx-devel-32bit>=0"
do_configure() {
ldconfig &>/dev/null
# _FORTIFY_SOURCE needs an optimization level.
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
# hack! some configure tests for header files using "$CPP $CPPFLAGS"
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {libiberty,gcc}/configure
./configure --prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--libexecdir=/usr/lib \
--enable-clocale=gnu \
--disable-bootstrap \
--libdir=/usr/lib \
--enable-threads=posix \
--enable-__cxa_atexit \
--enable-multilib \
--disable-rpath \
--with-system-zlib \
--enable-shared \
--enable-lto \
--enable-linker-build-id \
--enable-gnu-unique-object \
--enable-default-pie \
--enable-default-ssp \
--enable-checking=release \
--disable-libstdcxx-pch \
--disable-target-libiberty \
--with-isl \
--enable-libstdcxx-time \
--enable-tls \
--enable-languages="c,c++,lto" \
--with-linker-hash-style=gnu
}
do_build() {
make ${makejobs}
}
do_install() {
local _pc_triplet=x86_64-pc-linux-gnu _version=${version%pre1}
# Install to a tempdir and then only copy relevant files.
cd ${wrksrc}
make DESTDIR=${wrksrc}/${pkgname}-build install
# Make version a symlink of major version to make all versions
# from the same series work automagically.
vmkdir usr/include/c++/${_majorver}/${_triplet}
vmkdir usr/lib/gcc/${_triplet}/${_majorver}
cp -a ${wrksrc}/${pkgname}-build/usr/lib/gcc/${_pc_triplet}/${_version}/32 \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${_version}/${_pc_triplet}/32 \
${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
vinstall ${wrksrc}/host-${_pc_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}
}
gcc-objc-multilib_package() {
depends="gcc-multilib>=${_majorver} gcc-objc>=${_majorver} libobjc-devel-32bit>=${_majorver}"
short_desc="GNU Objective-C compiler (multilib files)"
build_style=meta
}