gcc: enable Ada (gnat) for x86_64 and i686

See: #4154
Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
Jürgen Buchmüller 2018-10-29 11:43:48 +01:00
parent 985bb8e918
commit e1da908004
No known key found for this signature in database
GPG Key ID: 6764EC32352D0647
1 changed files with 99 additions and 19 deletions

View File

@ -7,7 +7,7 @@ _isl_version=0.19
pkgname=gcc
version=${_majorver}.0
revision=4
revision=5
short_desc="The GNU C Compiler"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
homepage="http://gcc.gnu.org"
@ -38,10 +38,29 @@ fi
makedepends="zlib-devel"
depends="binutils libgcc-devel-${version}_${revision}
libstdc++-devel-${version}_${revision} libssp-devel-${version}_${revision}"
checkdepends="dejagnu"
subpackages="libgcc libgomp libgomp-devel libatomic libatomic-devel"
subpackages+=" libssp libssp-devel"
build_options="gnatboot"
desc_option_gnatboot="Bootstrap Ada using adacore.com binaries"
case "$XBPS_TARGET_MACHINE" in
x86_64)
_gnat_tarball="gnat-gpl-2017-x86_64-linux-bin.tar.gz"
distfiles+=" http://mirrors.cdn.adacore.com/art/591c6d80c7a447af2deed1d7>$_gnat_tarball"
checksum+=" b942bcac20dea39748b39f8b624d9619f60a8dee2e8195dbe3829c835b0956e6"
build_options_default="gnatboot"
;;
i686)
_gnat_tarball="gnat-gpl-2014-x86-linux-bin.tar.gz"
distfiles+=" http://mirrors.cdn.adacore.com/art/564b3e9dc8e196b040fbe248>$_gnat_tarball"
checksum+=" 3b693510f5d22a240abb3034934c1adbd80ccd6e4f61a4f491cc408fdfd9c042"
build_options_default="gnatboot"
;;
esac
if [ -n "$CHROOT_READY" ]; then
subpackages+=" gcc-fortran libgfortran-devel libgfortran"
if [ -z "$CROSS_BUILD" ]; then
@ -56,6 +75,10 @@ if [ -n "$CHROOT_READY" ]; then
fi
subpackages+=" libstdc++-devel libstdc++ libgcc-devel"
if [ "$build_option_gnatboot" ]; then
subpackages+=" gcc-ada libada-devel libada"
fi
# TODO: figure whether the host's gcc is able to compile ada and enable the subpackages
case "$XBPS_TARGET_MACHINE" in
i686) _triplet="i686-pc-linux-gnu";;
@ -104,6 +127,21 @@ post_extract() {
cp -ar ${XBPS_BUILDDIR}/mpfr-${_mpfr_version}/* ${wrksrc}/mpfr/
cp -ar ${XBPS_BUILDDIR}/mpc-${_mpc_version}/* ${wrksrc}/mpc/
cp -ar ${XBPS_BUILDDIR}/isl-${_isl_version}/* ${wrksrc}/isl/
if [ "$build_option_gnatboot" ]; then
local f="${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_gnat_tarball}"
msg_normal "Extracting ${_gnat_tarball} ...\n"
mkdir -p ${wrksrc}/gnat-ins
tar -x -f "$f" --strip-components=1 -C ${wrksrc}/gnat-ins
cd ${wrksrc}/gnat-ins
make ins-all prefix=${wrksrc}/gnat
cd ${wrksrc}
rm -rf ${wrksrc}/gnat-ins
# Rename obsolete ld and as
find ${wrksrc}/gnat -name ld -exec mv -v {} {}.old \;
find ${wrksrc}/gnat -name as -exec mv -v {} {}.old \;
fi
}
pre_configure() {
@ -141,13 +179,11 @@ do_configure() {
export GCC_FOR_TARGET="$CC"
export CXX_FOR_TARGET="$CXX"
_args+=" --disable-multilib"
_args+=" --host=$XBPS_CROSS_TRIPLET"
_args+=" --with-build-sysroot=${XBPS_CROSS_BASE}"
_args+=" --enable-sjlj-exceptions=no"
_langs+=",fortran"
else
if [ -z "$CHROOT_READY" ]; then
elif [ -z "$CHROOT_READY" ]; then
export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
_args+=" --build=${_triplet}"
else
@ -161,7 +197,6 @@ do_configure() {
_args+=" --build=${_triplet}"
_args+=" --enable-fast-character"
fi
fi
case "$XBPS_TARGET_MACHINE" in
aarch64*|*-musl) _args+=" --disable-libsanitizer";;
@ -182,6 +217,7 @@ do_configure() {
# Disable explicit -fno-PIE, gcc will figure this out itself.
export CFLAGS="${CFLAGS//-fno-PIE/}"
export CXXFLAGS="${CXXFLAGS//-fno-PIE/}"
export LDFLAGS="${LDFLAGS//-no-pie/}"
_args+=" --prefix=/usr"
_args+=" --mandir=/usr/share/man"
@ -208,11 +244,23 @@ do_configure() {
_args+=" --with-linker-hash-style=$_hash"
_args+=" --disable-libunwind-exceptions"
_args+=" --disable-target-libiberty"
_args+=" --enable-languages=${_langs}"
mkdir -p build
cd build
CONFIG_SHELL=/bin/bash ${wrksrc}/configure ${_args}
if [ "$build_option_gnatboot" ]; then
_args+=" --enable-languages=${_langs},ada"
_args+=" --enable-libada"
CONFIG_SHELL=/bin/bash \
CC="${wrksrc}/gnat/bin/gcc" \
GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
PATH="${wrksrc}/gnat/bin:$PATH" \
${wrksrc}/configure ${_args}
else
_args+=" --enable-languages=${_langs}"
CONFIG_SHELL=/bin/bash \
${wrksrc}/configure ${_args}
fi
}
do_build() {
@ -220,7 +268,15 @@ do_build() {
export LD_LIBRARY_PATH="${XBPS_MASTERDIR}/usr/lib"
fi
cd build
if [ "$build_option_gnatboot" ]; then
CC="${wrksrc}/gnat/bin/gcc" \
GNATBIND="${wrksrc}/gnat/bin/gnatbind" \
GNATMAKE="${wrksrc}/gnat/bin/gnatmake" \
PATH="${wrksrc}/gnat/bin:$PATH" \
make ${makejobs}
else
make ${makejobs}
fi
}
pre_install() {
if [ "$CROSS_BUILD" ]; then
@ -284,6 +340,16 @@ do_install() {
esac
}
gcc-ada_package() {
lib32disabled=yes
depends="gcc>=${_majorver} libada>=${_majorver}"
short_desc+=" - Ada compiler frontend"
pkg_install() {
for f in gnat{,bind,chop,clean,find,kr,link,ls,make,name,prep,xref}; do
vmove usr/bin/${f}
done
}
}
gcc-go_package() {
lib32disabled=yes
depends="gcc>=${_majorver} libgo-devel>=${_majorver}"
@ -346,6 +412,20 @@ gcc-objc_package() {
vmove usr/lib/gcc/${_triplet}/${_majorver}/cc1obj
}
}
libada-devel_package() {
depends="libada>=${_majorver}"
short_desc+=" - Ada library - development files"
pkg_install() {
vmove usr/lib/gcc/${_triplet}/${_majorver}/adainclude
vmove usr/lib/gcc/${_triplet}/${_majorver}/plugin/include/ada
}
}
libada_package() {
short_desc=" - Ada library"
pkg_install() {
vmove usr/lib/gcc/${_triplet}/${_majorver}/adalib
}
}
libgfortran-devel_package() {
depends="libgfortran>=${_majorver}"
short_desc+=" - Fortran library - development files"