summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-ada/gnat_util/gnat_util-2016.ebuild')
-rw-r--r--dev-ada/gnat_util/gnat_util-2016.ebuild30
1 files changed, 14 insertions, 16 deletions
diff --git a/dev-ada/gnat_util/gnat_util-2016.ebuild b/dev-ada/gnat_util/gnat_util-2016.ebuild
index dd8a3f6cba12..f3a43667276a 100644
--- a/dev-ada/gnat_util/gnat_util-2016.ebuild
+++ b/dev-ada/gnat_util/gnat_util-2016.ebuild
@@ -14,34 +14,32 @@ SRC_URI="http://mirrors.cdn.adacore.com/art/57399637c7a447658e0affa6 -> ${MYP}-s
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="+shared static static-pic"
+IUSE="gnat_2016 gnat_2017 +shared static static-pic"
-RDEPEND="dev-lang/gnat-gpl"
+RDEPEND="gnat_2016? ( dev-lang/gnat-gpl:4.9.4 )
+ gnat_2017? ( dev-lang/gnat-gpl:6.3.0 )"
DEPEND="${RDEPEND}
- dev-ada/gprbuild"
+ dev-ada/gprbuild[gnat_2016=,gnat_2017=]"
+REQUIRED_USE="^^ ( gnat_2016 gnat_2017 )"
S="${WORKDIR}"/${MYP}-src
PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )
-pkg_setup() {
- GCC=${ADA:-$(tc-getCC)}
- GNATMAKE="${GCC/gcc/gnatmake}"
- CC="${GCC}"
- if [[ -z "$(type ${GNATMAKE} 2>/dev/null)" ]] ; then
- eerror "You need a gcc compiler that provides the Ada Compiler:"
- eerror "1) use gcc-config to select the right compiler or"
- eerror "2) set ADA=gcc-4.9.4 in make.conf"
- die "ada compiler not available"
- fi
-}
-
src_compile() {
+ if use gnat_2016; then
+ GCC_PV=4.9.4
+ else
+ GCC_PV=6.3.0
+ fi
+ GCC=${CHOST}-gcc-${GCC_PV}
+ GNATMAKE=${CHOST}-gnatmake-${GCC_PV}
emake GNATMAKE="${GNATMAKE} ${ADAFLAGS}" \
BUILDER="gprbuild -j$(makeopts_jobs)" generate_sources
for kind in shared static static-pic; do
if use ${kind}; then
- emake BUILDER="gprbuild -v -j$(makeopts_jobs)" build-${kind}
+ emake CC="${GCC}" BUILDER="gprbuild -v -j$(makeopts_jobs)" \
+ build-${kind}
fi
done
}