void-packages/srcpkgs/gcc-4.7/template
2014-11-15 09:08:09 +01:00

217 lines
6.5 KiB
Text

# Template build file for 'gcc-4.7'
_majorver=4.7
pkgname=gcc-${_majorver}
version=${_majorver}.4
revision=1
wrksrc="gcc-${version}"
short_desc="The GNU C Compiler (${_majorver} series)"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://gcc.gnu.org"
license="GFDL-1.2, GPL-3, LGPL-2.1"
distfiles="http://ftp.gnu.org/pub/gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2"
checksum=92e61c6dc3a0a449e62d72a38185fda550168a86702dea07125ebd3ec3996282
hostmakedepends="perl flex"
makedepends="zlib-devel libmpc-devel>=1.0.1_2 cloog-devel>=0.18"
depends="binutils"
provides="gcc-${version}_${revision}"
case "$XBPS_TARGET_MACHINE" in
i686-musl) _triplet="i686-pc-linux-musl";;
x86_64-musl) _triplet="x86_64-linux-musl";;
arm*-musl) _triplet="arm-linux-musleabi";;
esac
# musl only
only_for_archs="i686-musl x86_64-musl armv6l-musl armv7l-musl"
do_configure() {
local _langs _args
_langs="c,c++,lto"
case "$XBPS_TARGET_MACHINE" in
armv5*) _args+=" --with-arch=armv5te --with-float=soft";;
armv6l*) _args+=" --with-arch=armv6 --with-fpu=vfp --with-float=hard";;
armv7l*) _args+=" --with-arch=armv7-a --with-fpu=vfpv3 --with-float=hard";;
esac
if [ "$CROSS_BUILD" ]; then
export CC_FOR_TARGET="$CC"
export GCC_FOR_TARGET="$CC"
export CXX_FOR_TARGET="$CXX"
_args+=" --disable-multilib --host=$XBPS_CROSS_TRIPLET --with-build-sysroot=${XBPS_CROSS_BASE}"
else
_args+=" --build=${_triplet}"
fi
if [ -z "$CHROOT_READY" ]; then
export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
_args+=" --with-gmp=${XBPS_MASTERDIR}/usr"
_args+=" --with-mpfr=${XBPS_MASTERDIR}/usr"
_args+=" --with-isl=${XBPS_MASTERDIR}/usr"
_args+=" --with-mpc=${XBPS_MASTERDIR}/usr"
_args+=" --with-cloog=${XBPS_MASTERDIR}/usr"
fi
CONFIG_SHELL=/bin/bash \
./configure --prefix=/usr --mandir=/usr/share/man \
--infodir=/usr/share/info --libexecdir=/usr/lib \
--enable-clocale=gnu --libdir=/usr/lib --enable-c99 \
--enable-threads=posix --enable-__cxa_atexit --disable-multilib \
--with-system-zlib --disable-libmudflap --enable-shared --enable-lto \
--enable-libstdcxx-time --disable-libquadmath \
--enable-linker-build-id --enable-gnu-unique-object \
--enable-checking=release --disable-libstdcxx-pch \
--enable-cloog-backend=isl --with-linker-hash-style=gnu \
--enable-languages=${_langs} --enable-sjlj-exceptions=no ${_args}
}
do_build() {
make ${makejobs}
}
do_install() {
vmkdir usr/lib
cd ${DESTDIR}/usr
ln -sf lib lib64
cd ${wrksrc}
make DESTDIR=${DESTDIR} install
# Make version a symlink of major version to make all versions
# from the same series work automagically.
mv ${DESTDIR}/usr/lib/gcc/${_triplet}/${version} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver}
ln -sfr ${DESTDIR}/usr/lib/gcc/${_triplet}/${_majorver} \
${DESTDIR}/usr/lib/gcc/${_triplet}/${version}
# Ditto for c++ headers.
mv ${DESTDIR}/usr/include/c++/${version} \
${DESTDIR}/usr/include/c++/${_majorver}
ln -sfr ${DESTDIR}/usr/include/c++/${_majorver} \
${DESTDIR}/usr/include/c++/${version}
# cc symlink.
ln -sfr ${DESTDIR}/usr/bin/gcc ${DESTDIR}/usr/bin/cc
# rpcgen wants /lib/cpp, make a symlink
ln -sfr ${DESTDIR}/usr/bin/cpp ${DESTDIR}/usr/lib/cpp
if [ -e ${DESTDIR}/usr/lib64 ]; then
rm -f ${DESTDIR}/usr/lib64
fi
# Remove libffi stuff.
rm -f ${DESTDIR}/usr/lib/libffi*
rm -f ${DESTDIR}/usr/share/man/man3/ffi*
# Remove all python scripts in libdir.
rm -f ${DESTDIR}/usr/lib/*.py
# Remove more python stuff.
if [ -d ${DESTDIR}/usr/share/gcc-${version}/python ]; then
rm -rf ${DESTDIR}/usr/share/gcc-${version}/python
fi
# Install c89 and c99 wrappers and its manpages, from NetBSD.
for f in c89 c99; do
vinstall ${FILESDIR}/${f}.sh 755 usr/bin ${f}
vinstall ${FILESDIR}/${f}.1 644 usr/share/man/man1 ${f}.1
done
}
libgcc-4.7_package() {
provides="libgcc-${version}_${revision}"
short_desc+=" - GCC library"
noverifyrdeps=yes
pkg_install() {
vmove "usr/lib/libgcc_s.so*"
vinstall ${wrksrc}/COPYING.RUNTIME 644 usr/share/licenses/$pkgname RUNTIME.LIBRARY.EXCEPTION
}
}
libgomp-devel-4.7_package() {
provides="libgomp-devel-${version}_${revision}"
depends="libgomp>=${_majorver}"
short_desc+=" - OpenMP v4.0 library - development files"
pkg_install() {
vmove usr/lib/gcc/${_triplet}/${_majorver}/include/omp.h
vmove usr/lib/libgomp.so
vmove usr/lib/libgomp.a
vmove usr/lib/libgomp.spec
vmove usr/share/info/libgomp.info
touch ${PKGDESTDIR}/usr/share/info/dir
}
}
libgomp-4.7_package() {
provides="libgomp-${version}_${revision}"
short_desc+=" - OpenMP v4.0 library"
pkg_install() {
vmove "usr/lib/libgomp*.so.*"
vinstall ${wrksrc}/COPYING.RUNTIME 644 usr/share/licenses/$pkgname RUNTIME.LIBRARY.EXCEPTION
}
}
libitm-devel-4.7_package() {
provides="libitm-devel-${version}_${revision}"
depends="libitm>=${_majorver}"
short_desc+=" - Transactional Memory library - development files"
pkg_install() {
vmove usr/lib/libitm.a
vmove usr/lib/libitm.so
vmove usr/lib/libitm.spec
vmove usr/share/info/libitm.info
touch ${PKGDESTDIR}/usr/share/info/dir
}
}
libitm-4.7_package() {
provides="libitm-${version}_${revision}"
short_desc+=" - Transactional Memory library"
pkg_install() {
vmove "usr/lib/libitm.so.*"
}
}
libssp-devel-4.7_package() {
provides="libssp-devel-${version}_${revision}"
depends="libssp>=${_majorver}"
short_desc+=" - SSP (StackSmashingProtection) library - development files"
pkg_install() {
vmove "usr/lib/libssp*.a"
vmove usr/lib/gcc/${_triplet}/${_majorver}/include/ssp
}
}
libssp-4.7_package() {
provides="libssp-${version}_${revision}"
short_desc+=" - SSP (StackSmashingProtection) library"
pkg_install() {
vmove "usr/lib/libssp.so*"
vinstall ${wrksrc}/COPYING.RUNTIME 644 usr/share/licenses/$pkgname RUNTIME.LIBRARY.EXCEPTION
}
}
libstdc++-devel-4.7_package() {
provides="libstdc++-devel-${version}_${revision}"
depends="libstdc++>=${_majorver}"
short_desc+=" - Standard C++ Library - development files"
pkg_install() {
vmove "usr/lib/libstdc++.*a"
vmove "usr/lib/libsupc++.*"
vmove usr/include/c++
}
}
libstdc++-4.7_package() {
provides="libstdc++-${version}_${revision}"
short_desc+=" - Standard C++ Library"
pkg_install() {
vmove "usr/lib/libstdc++.so*"
vinstall ${wrksrc}/COPYING.RUNTIME 644 usr/share/licenses/$pkgname RUNTIME.LIBRARY.EXCEPTION
}
}
gcc-c++-4.7_package() {
provides="gcc-c++-${version}_${revision}"
depends="gcc>=${_majorver} libstdc++-devel>=${_majorver}"
short_desc+=" - C++ support"
pkg_install() {
for f in g++ c++ ${_triplet}-g++ ${_triplet}-c++; do
vmove usr/bin/${f}
done
vmove usr/lib/gcc/${_triplet}/${_majorver}/cc1plus
vmove usr/share/man/man1/g++.1
}
}