void-packages/srcpkgs/gcc-multilib/template

96 lines
3.1 KiB
Bash

# Template build file for 'gcc-multilib'
only_for_archs="x86_64"
_triplet="x86_64-unknown-linux-gnu"
_majorver=4.9
pkgname=gcc-multilib
version=${_majorver}.4
revision=2
wrksrc="gcc-${version}"
short_desc="The GNU C Compiler (multilib files)"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://gcc.gnu.org"
license="GFDL-1.2, GPL-3, LGPL-2.1"
distfiles="${GNU_SITE}/gcc/gcc-$version/gcc-$version.tar.bz2"
checksum=6c11d292cd01b294f9f84c9a59c230d80e9e4a47e5c6355f046bb36d4f358092
hostmakedepends="perl flex zip unzip"
makedepends="zlib-devel libmpc-devel ppl-devel cloog-devel
isl-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}
libcilkrts-devel-32bit>=${_majorver}
libvtv-devel-32bit>=${_majorver}
zlib-32bit
glibc-devel-32bit"
do_configure() {
ldconfig &>/dev/null
# _FORTIFY_SOURCE needs an optimization level.
sed -i "/ac_cpp=/s/\$CPPFLAGS/\$CPPFLAGS -O2/" {gcc,libiberty}/configure
# As specified in the LFS book, disable installing libiberty.
sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
# Do not run fixincludes
sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
./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-checking=release --disable-libstdcxx-pch \
--with-ppl --enable-cloog-backend=isl --enable-libstdcxx-time \
--enable-tls --enable-languages="c,c++,lto" \
--with-linker-hash-style=gnu
}
do_build() {
make ${makejobs}
}
do_install() {
# Install to a tempdir and then only copy relevant files.
if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
vmkdir usr/lib
cd ${DESTDIR}/usr
ln -sf lib lib64
fi
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/${_triplet}/${version}/32 \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}/
cp -a ${wrksrc}/${pkgname}-build/usr/include/c++/${version}/${_triplet}/32 \
${DESTDIR}/usr/include/c++/${_majorver}/${_triplet}
vinstall ${wrksrc}/host-${_triplet}/gcc/specs 644 usr/lib/gcc/${_triplet}/${_majorver}
rm -f ${DESTDIR}/usr/lib64
}
gcc-c++-multilib_package() {
depends="gcc-c++>=${_majorver} gcc-multilib>=${_majorver} libstdc++-devel-32bit>=${_majorver}"
short_desc="GCC C++ compiler (multilib files)"
pkg_install() {
vmove usr/include/c++
}
}
gcc-objc-multilib_package() {
depends="gcc-multilib>=${_majorver} gcc-objc>=${_majorver} libobjc-devel-32bit>=${_majorver}"
short_desc="The GNU Objective-C compiler (multilib files)"
build_style=meta
}