summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorGeorge Shapovalov <george@gentoo.org>2011-03-10 19:36:24 +0000
committerGeorge Shapovalov <george@gentoo.org>2011-03-10 19:36:24 +0000
commite79aa5dbdcb836772eef7d782d30a1a58fc1ce44 (patch)
tree1201fbd0dedfd3b3326797ab45709224b7a773c1 /eclass
parentRemove largefile USE support and default to it (diff)
downloadhistorical-e79aa5dbdcb836772eef7d782d30a1a58fc1ce44.tar.gz
historical-e79aa5dbdcb836772eef7d782d30a1a58fc1ce44.tar.bz2
historical-e79aa5dbdcb836772eef7d782d30a1a58fc1ce44.zip
bunch of updates, long overdue and in prep for gnat-4.4 backend
Diffstat (limited to 'eclass')
-rw-r--r--eclass/gnatbuild.eclass62
1 files changed, 46 insertions, 16 deletions
diff --git a/eclass/gnatbuild.eclass b/eclass/gnatbuild.eclass
index 69c5bd353b77..c71bdae88799 100644
--- a/eclass/gnatbuild.eclass
+++ b/eclass/gnatbuild.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnatbuild.eclass,v 1.50 2010/01/22 13:27:36 george Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnatbuild.eclass,v 1.51 2011/03/10 19:36:24 george Exp $
#
# Author: George Shapovalov <george@gentoo.org>
# Belongs to: ada herd <ada@gentoo.org>
@@ -14,6 +14,8 @@
# SLOT
# BOOT_SLOT - where old bootstrap is used as it works fine
+#WANT_AUTOMAKE="1.8"
+#WANT_AUTOCONF="2.1"
inherit eutils versionator toolchain-funcs flag-o-matic multilib autotools \
libtool fixheadtails gnuconfig pax-utils
@@ -344,10 +346,10 @@ gnatbuild_src_unpack() {
# Replacing obsolete head/tail with POSIX compliant ones
ht_fix_file */configure
- if ! is_crosscompile && is_multilib && \
- [[ ( $(tc-arch) == "amd64" || $(tc-arch) == "ppc64" ) && -z ${SKIP_MULTILIB_HACK} ]] ; then
- disgusting_gcc_multilib_HACK || die "multilib hack failed"
- fi
+# if ! is_crosscompile && is_multilib && \
+# [[ ( $(tc-arch) == "amd64" || $(tc-arch) == "ppc64" ) && -z ${SKIP_MULTILIB_HACK} ]] ; then
+# disgusting_gcc_multilib_HACK || die "multilib hack failed"
+# fi
# Fixup libtool to correctly generate .la files with portage
cd "${S}"
@@ -386,10 +388,12 @@ gnatbuild_src_unpack() {
epatch "${FILESDIR}"/gnat-Make-lang.in.patch
fi
- # gcc sources as of 4.3 seem to have a common omission of $(DESTDIR),
+ # gcc 4.3 sources seem to have a common omission of $(DESTDIR),
# that leads to make install trying to rm -f file on live system.
# As we do not need this rm, we simply remove the whole line
- sed -i -e "/\$(RM) \$(bindir)/d" "${S}"/gcc/ada/Make-lang.in
+ if [ "4.3" == "${GCCBRANCH}" ] ; then
+ sed -i -e "/\$(RM) \$(bindir)/d" "${S}"/gcc/ada/Make-lang.in
+ fi
mkdir -p "${GNATBUILD}"
;;
@@ -433,6 +437,8 @@ gnatbuild_src_compile() {
export CC="${GNATBOOT}/bin/gnatgcc"
export INCLUDE_DIR="${GNATLIB}/include"
+ export C_INCLUDE_PATH="${GNATLIB}/include"
+ export CPLUS_INCLUDE_PATH="${GNATLIB}/include"
export LIB_DIR="${GNATLIB}"
export LDFLAGS="-L${GNATLIB}"
@@ -472,18 +478,31 @@ gnatbuild_src_compile() {
fi
# reasonably sane globals (from toolchain)
+ # also disable mudflap and ssp
confgcc="${confgcc} \
--with-system-zlib \
--disable-checking \
--disable-werror \
+ --disable-libmudflap \
+ --disable-libssp \
--disable-libunwind-exceptions"
# ACT's gnat-gpl does not like libada for whatever reason..
- if [[ ${PN} == ${PN_GnatGpl} ]]; then
- einfo "ACT's gnat-gpl does not like libada, disabling"
- confgcc="${confgcc} --disable-libada"
- else
+ if version_is_at_least 4.2 ; then
confgcc="${confgcc} --enable-libada"
+# else
+# einfo "ACT's gnat-gpl does not like libada, disabling"
+# confgcc="${confgcc} --disable-libada"
+ fi
+
+ # set some specifics available in later versions
+ if version_is_at_least 4.3 ; then
+ einfo "setting gnat thread model"
+ confgcc="${confgcc} --enable-threads=gnat"
+ confgcc="${confgcc} --enable-shared=boehm-gc,ada,libada"
+ else
+ confgcc="${confgcc} --enable-threads=posix"
+ confgcc="${confgcc} --enable-shared"
fi
# multilib support
@@ -493,7 +512,14 @@ gnatbuild_src_compile() {
confgcc="${confgcc} --disable-multilib"
fi
-# einfo "confgcc=${confgcc}"
+ # __cxa_atexit is "essential for fully standards-compliant handling of
+ # destructors", but apparently requires glibc.
+ if [[ ${CTARGET} == *-gnu* ]] ; then
+ confgcc="${confgcc} --enable-__cxa_atexit"
+ confgcc="${confgcc} --enable-clocale=gnu"
+ fi
+
+ einfo "confgcc=${confgcc}"
cd "${GNATBUILD}"
CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" "${S}"/configure \
@@ -508,9 +534,6 @@ gnatbuild_src_compile() {
--program-prefix=gnat \
--enable-languages="c,ada" \
--with-gcc \
- --enable-threads=posix \
- --enable-shared \
- --with-system-zlib \
${confgcc} || die "configure failed"
;;
@@ -522,6 +545,7 @@ gnatbuild_src_compile() {
cp "${S}"/gcc/ada/xsinfo.adb .
cp "${S}"/gcc/ada/xeinfo.adb .
cp "${S}"/gcc/ada/xnmake.adb .
+ cp "${S}"/gcc/ada/xutil.ad{s,b} .
gnatmake xtreeprs && \
gnatmake xsinfo && \
gnatmake xeinfo && \
@@ -579,10 +603,16 @@ gnatbuild_src_install() {
# The spotted obuser was xgnatugn, used to process gnat_ugn_urw.texi,
# during preparison of the docs.
export PATH="${GNATBOOT}/bin:${PATH}"
- GNATLIB="${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}"
+ if [[ ${BOOT_SLOT} > 4.1 ]] ; then
+ GNATLIB="${GNATBOOT}/lib"
+ else
+ GNATLIB="${GNATBOOT}/lib/gnatgcc/${BOOT_TARGET}/${BOOT_SLOT}"
+ fi
export CC="${GNATBOOT}/bin/gnatgcc"
export INCLUDE_DIR="${GNATLIB}/include"
+ export C_INCLUDE_PATH="${GNATLIB}/include"
+ export CPLUS_INCLUDE_PATH="${GNATLIB}/include"
export LIB_DIR="${GNATLIB}"
export LDFLAGS="-L${GNATLIB}"
export ADA_OBJECTS_PATH="${GNATLIB}/adalib"