diff options
author | David Holm <dholm@gentoo.org> | 2005-04-23 12:54:03 +0000 |
---|---|---|
committer | David Holm <dholm@gentoo.org> | 2005-04-23 12:54:03 +0000 |
commit | 96edad3a9b46e2ff6c305e9983e282349c1690c1 (patch) | |
tree | 923b12005e44ffb9bcb97752dfdc3f2b46218043 /dev-lang/gnat | |
parent | new upstream release (development branch). fixes bug #89631. (diff) | |
download | historical-96edad3a9b46e2ff6c305e9983e282349c1690c1.tar.gz historical-96edad3a9b46e2ff6c305e9983e282349c1690c1.tar.bz2 historical-96edad3a9b46e2ff6c305e9983e282349c1690c1.zip |
NPTL support (Bug #76491)
Package-Manager: portage-2.0.51.19
Diffstat (limited to 'dev-lang/gnat')
-rw-r--r-- | dev-lang/gnat/ChangeLog | 9 | ||||
-rw-r--r-- | dev-lang/gnat/Manifest | 5 | ||||
-rw-r--r-- | dev-lang/gnat/files/digest-gnat-3.15p-r5 | 5 | ||||
-rw-r--r-- | dev-lang/gnat/files/gnat-3.15p-nptl.patch | 67 | ||||
-rw-r--r-- | dev-lang/gnat/gnat-3.15p-r5.ebuild | 190 |
5 files changed, 274 insertions, 2 deletions
diff --git a/dev-lang/gnat/ChangeLog b/dev-lang/gnat/ChangeLog index bfdf92735aa6..69c08ccb76f3 100644 --- a/dev-lang/gnat/ChangeLog +++ b/dev-lang/gnat/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-lang/gnat # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/gnat/ChangeLog,v 1.30 2005/02/23 16:14:41 dholm Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/gnat/ChangeLog,v 1.31 2005/04/23 12:54:03 dholm Exp $ + +*gnat-3.15p-r5 (23 Apr 2005) + + 23 Apr 2005; David Holm <dholm@gentoo.org> +files/gnat-3.15p-nptl.patch, + +gnat-3.15p-r5.ebuild: + Added patch for NPTL support from Maxim Reznik <reznikmm (at) front (dot) + ru>, bug #76491 *gnat-3.15p-r4 (23 Feb 2005) diff --git a/dev-lang/gnat/Manifest b/dev-lang/gnat/Manifest index 3984009978c9..3e790271ec85 100644 --- a/dev-lang/gnat/Manifest +++ b/dev-lang/gnat/Manifest @@ -2,10 +2,11 @@ MD5 86fdf8a4f3d7e83edb3bcc0613692225 gnat-3.14p.ebuild 5599 MD5 608766ca2b3f1891c60dc4bf831bf14a gnat-3.15p.ebuild 5655 MD5 4b8299d1078b0c3a88969f43c9ae6a64 metadata.xml 927 MD5 7e1abff13d1add33756c2f586bbb5e63 gnat-3.41.ebuild 4012 -MD5 0efbee93a411069d1f42963a4f2a4f3c ChangeLog 4975 MD5 140f94774ca1df5f61298c4a7982bf3a gnat-3.43.ebuild 4041 MD5 ca3b64c8223c3f3781cfe65e4e224ee6 gnat-3.15p-r3.ebuild 6070 MD5 7d626d97f619615a5722cf1e86d673b2 gnat-3.15p-r4.ebuild 5760 +MD5 9e647fec72de0891860dccad0a12c86a gnat-3.15p-r5.ebuild 5769 +MD5 524902affb557e1550b91a3dc612f204 ChangeLog 5200 MD5 59500f81e672cff22232586fc278547b files/digest-gnat-3.14p 213 MD5 737e39907fb4f28640a1b4cbbc1cdc78 files/digest-gnat-3.15p 216 MD5 5710cea3459403d02bc4ad4674fa7d1b files/digest-gnat-3.15p-r3 378 @@ -16,3 +17,5 @@ MD5 7fabcf7198fb4001adfba250899e0024 files/gnat-3.15p-noaddr2line.patch.bz2 542 MD5 ffcd9ae5ebd258ffd9c88fc3cf225bd6 files/digest-gnat-3.41 315 MD5 119e0c400e71cdafcfb3eeca106c7029 files/digest-gnat-3.43 315 MD5 5710cea3459403d02bc4ad4674fa7d1b files/digest-gnat-3.15p-r4 378 +MD5 5710cea3459403d02bc4ad4674fa7d1b files/digest-gnat-3.15p-r5 378 +MD5 5d64753ce1119bb193bf3c09b43e87b0 files/gnat-3.15p-nptl.patch 1965 diff --git a/dev-lang/gnat/files/digest-gnat-3.15p-r5 b/dev-lang/gnat/files/digest-gnat-3.15p-r5 new file mode 100644 index 000000000000..ef184b39a779 --- /dev/null +++ b/dev-lang/gnat/files/digest-gnat-3.15p-r5 @@ -0,0 +1,5 @@ +MD5 cf8b9cccc867e318bccaaa2dce384028 gnat-3.15p-src.tgz 5553434 +MD5 3bcbedfaccf343a8515efc0f74b8a027 gnat-3.15p-unx-docs.tar.gz 9515443 +MD5 23ce8b5d276e2eab421416564f9dc8a3 gcc-2.8.1.tar.bz2 6304274 +MD5 57c060cd1ccef8b1ae9165b11d98780a gnat-3.15p-i686-pc-redhat71-gnu-bin.tar.gz 13482938 +MD5 33a146f39c04b2ac055ae81585622d08 gnat-3.15p-powerpc-unknown-linux-gnu.tar.bz2 8228916 diff --git a/dev-lang/gnat/files/gnat-3.15p-nptl.patch b/dev-lang/gnat/files/gnat-3.15p-nptl.patch new file mode 100644 index 000000000000..74bcb0323b76 --- /dev/null +++ b/dev-lang/gnat/files/gnat-3.15p-nptl.patch @@ -0,0 +1,67 @@ +This patch makes it possible to use the New POSIX Thread Library on +Linux >= 2.6 and glibc >= 2.3. It also works on linux 2.4. I +backported it from GCC 3.4. + +I omitted irrelevant parts of this patch to keep it minimal. + +-- +Ludovic Brenta. + +diff -u -u -r1.5 -r1.6 +--- ada/5iosinte.ads 24 Apr 2003 17:53:51 -0000 1.5 ++++ ada/5iosinte.ads 1 May 2003 14:14:35 -0000 1.6 +@@ -443,11 +448,8 @@ + + private + +- type sigset_t is array (0 .. 31) of unsigned_long; ++ type sigset_t is array (0 .. 127) of unsigned_char; + pragma Convention (C, sigset_t); +- for sigset_t'Size use 1024; +- -- This is for GNU libc version 2 but should be backward compatible with +- -- other libc where sigset_t is smaller. + + type pid_t is new int; + +@@ -476,7 +478,7 @@ + stackaddr : System.Address; + stacksize : size_t; + end record; +- pragma Convention (C_Pass_By_Copy, pthread_attr_t); ++ pragma Convention (C, pthread_attr_t); + + type pthread_condattr_t is record + dummy : int; +@@ -490,25 +492,22 @@ + + type pthread_t is new unsigned_long; + +- type struct_pthread_queue is record +- head : System.Address; +- tail : System.Address; ++ type struct_pthread_fast_lock is record ++ status : long; ++ spinlock : int; + end record; +- pragma Convention (C, struct_pthread_queue); ++ pragma Convention (C, struct_pthread_fast_lock); + + type pthread_mutex_t is record +- m_spinlock : int; ++ m_reserved : int; + m_count : int; + m_owner : System.Address; + m_kind : int; +- m_waiting : struct_pthread_queue; ++ m_lock : struct_pthread_fast_lock; + end record; + pragma Convention (C, pthread_mutex_t); + +- type pthread_cond_t is record +- c_spinlock : int; +- c_waiting : struct_pthread_queue; +- end record; ++ type pthread_cond_t is array (0 .. 47) of unsigned_char; + pragma Convention (C, pthread_cond_t); + + type pthread_key_t is new unsigned; diff --git a/dev-lang/gnat/gnat-3.15p-r5.ebuild b/dev-lang/gnat/gnat-3.15p-r5.ebuild new file mode 100644 index 000000000000..50895147bad9 --- /dev/null +++ b/dev-lang/gnat/gnat-3.15p-r5.ebuild @@ -0,0 +1,190 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/gnat/gnat-3.15p-r5.ebuild,v 1.1 2005/04/23 12:54:03 dholm Exp $ + +inherit eutils gnat + +DESCRIPTION="The GNU Ada Toolkit" +DEPEND="x86? ( >=app-shells/tcsh-6.0 )" +RDEPEND="" +SRC_URI="http://gd.tuwien.ac.at/languages/ada/gnat/${PV}/${P}-src.tgz + http://gd.tuwien.ac.at/languages/ada/gnat/${PV}/${P}-unx-docs.tar.gz + ftp://gcc.gnu.org/pub/gcc/old-releases/gcc-2/gcc-2.8.1.tar.bz2 + x86? ( http://gd.tuwien.ac.at/languages/ada/gnat/${PV}/${P}-i686-pc-redhat71-gnu-bin.tar.gz ) + ppc? ( mirror://gentoo/${P}-powerpc-unknown-linux-gnu.tar.bz2 )" +HOMEPAGE="http://www.gnat.com/" + +SLOT="0" +KEYWORDS="x86 ppc" +LICENSE="GMGPL" +IUSE="" + +S="${WORKDIR}/gcc-2.8.1" +GNATDIR="${WORKDIR}/${P}-src" + +case ${ARCH} in + x86) GNATBOOT="${WORKDIR}/boot" + GNATBOOTINST="${WORKDIR}/${P}-i686-pc-linux-gnu-bin" + ;; + ppc) + GNATBOOT="${WORKDIR}/${P}-powerpc-unknown-linux-gnu" + ;; +esac + +CFLAGS="-O2 -gnatpgn" + +src_unpack() { + unpack ${A} + + # Install the bootstrap compiler + if [ "${ARCH}" = "x86" ]; then + cd "${GNATBOOTINST}" + patch -p1 < ${FILESDIR}/gnat-3.15p-i686-pc-linux-gnu-bin.patch + echo $'\n'3$'\n'${GNATBOOT}$'\n' | ./doconfig > doconfig.log 2>&1 + ./doinstall + fi + + # Prepare the gcc source directory + cd "${S}" + patch -p0 < "${GNATDIR}/src/gcc-281.dif" + touch cstamp-h.in + mv "${GNATDIR}/src/ada" "${S}" + bzcat "${FILESDIR}/${P}-gentoo.patch.bz2" | patch -p1 + touch ada/treeprs.ads ada/a-[es]info.h ada/nmake.ad[bs] + + # Make $local_prefix point to $prefix + sed -i -e "s/@local_prefix@/@prefix@/" "${S}/Makefile.in" + + cd "${S}" + bzcat "${FILESDIR}/${P}-noaddr2line.patch.bz2" | patch -p1 + sed -i -e "s/-laddr2line//g" ada/Makefile.in + + patch -p0 < "${FILESDIR}/${P}-nptl.patch" +} + +src_compile() { + local PATH="${GNATBOOT}/bin:${PATH}" + local LDFLAGS="-L${GNATBOOT}/lib/gcc-lib/i686-pc-linux-gnu/2.8.1" + if [ -d ${GNATBOOTINST} ]; then + local LDFLAGS="-L${GNATBOOTINST} ${LDFLAGS}" + fi + + # Configure gcc + cd "${S}" + econf --libdir=/usr/lib/ada --program-prefix=gnat \ + || die "./configure failed" + + # Make sure we don't overwrite the existing gcc + sed -i -e "s/\$(bindir)\/gcov/\$(bindir)\/gnatgcov/" "${S}/Makefile" + sed -i -e "s/alias)-gcc/alias)-gnatgcc/g" "${S}/Makefile" + + # Compile it by first using the bootstrap compiler and then bootstrapping + # our own version. Finally compile the libraries and tools. + einfo "Building compiler" + make CC="gcc" CFLAGS="${CFLAGS}" LANGUAGES="c ada gcov" || + die "Failed while running inital compilation!" + make CC="gcc" CFLAGS="${CFLAGS}" LANGUAGES="c ada gcov" bootstrap || + die "Died while bootstrapping!" + einfo "Building shared gnatlib" + make CC="gcc" CFLAGS="${CFLAGS}" GNATLIBCFLAGS="${CFLAGS}" \ + TARGET_LIBGCC2_CFLAGS="-fPIC" \ + gnatlib-shared || + die "Failed to build the shared version of gnatlib!" + einfo "Building gnattools" + make CC="gcc" CFLAGS="${CFLAGS}" gnattools || + die "Failed to build gnattools!" +} + +src_install() { + local PATH="${GNATBOOT}/bin:${PATH}" + local LDFLAGS="-L${GNATBOOT}/lib/gcc-lib/i686-pc-linux-gnu/2.8.1" + if [ -d ${GNATBOOTINST} ]; then + local LDFLAGS="${LDFLAGS} -L${GNATBOOTINST}" + fi + + # Install gnatgcc, tools and native threads library + make prefix="${D}/usr" libdir="${D}/usr/lib/ada" \ + LANGUAGES="c ada gcov" GCC_INSTALL_NAME=gnatgcc \ + install-common install-libgcc install-gnatlib install-driver || + die "Failed while installing GNAT" + touch "${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1/include/float.h" + + if [ "${ARCH}" = "x86" ]; then + # Install the FSU threads library + cd "${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1" + mkdir rts-native + mkdir rts-fsu + + # Move the native threads library + mv adalib adainclude rts-native + cd ${S} + + # Compile and install the FSU threads library + rm stamp-gnatlib1 + einfo "Building FSU-threads runtime" + make CC="gcc" CFLAGS="${CFLAGS}" GNATLIBCFLAGS="${CFLAGS}" \ + TARGET_LIBGCC2_CFLAGS="-fPIC" \ + THREAD_KIND="fsu" gnatlib-shared + make prefix="${D}/usr" libdir="${D}/usr/lib/ada" install-gnatlib + cd "${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1" + mv adalib adainclude rts-fsu + cd ${S} + + # Install the precompiled FSU library from the binary distribution + cp "${GNATBOOTINST}/libgthreads.a" "${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1" + cp "${GNATBOOTINST}/libmalloc.a" "${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1" + + # Make native threads the default + cd "${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1" + ln -s rts-native/adalib adalib + ln -s rts-native/adainclude adainclude + fi + + if [ -z ${GNATBOOTINST} ]; then + cp "${GNATBOOTINST}/gnathtml.pl" "${D}/usr/bin" + chmod +x "${D}/usr/bin" + fi + + # Fix broken symlinks + cd ${D}/usr/lib/ada/gcc-lib/${CHOST}/2.8.1/adalib + rm -f libgnarl.so + rm -f liblibgnat.so + ln -sf libgnarl-3.15.so libgnarl.so + ln -sf libgnat-3.15.so libgnat.so + + # Install documentation and examples + cd ${WORKDIR}/${P}-src + dodoc COPYING README + insinto /usr/share/${PN}/examples + doins examples/* + cd ${WORKDIR}/${P}-unx-docs + rm -f */gvd.* + rm -f */gdb.* + for i in `find . -name 'gcc*'`; do \ + mv ${i} ${i/gcc/gnatgcc}; \ + done + dohtml html/* + docinto ps + dodoc ps/* + docinto txt + dodoc txt/* + doinfo info/* + cd ${S} + mv gcc.1 gnatgcc.1 + doman gnatgcc.1 +} + +pkg_postinst() { + # Notify the user what changed + einfo "" + if [ "${ARCH}" = "x86" ]; then + einfo "Both the native-threads and the FSU-threads runtimes have been" + einfo "installed. The native-threads version is the default on linux." + einfo "If you want to use FSU-threads (required if you are using" + einfo "Annex D) simply use the following switch: --RTS=fsu" + einfo "" + fi + einfo "The compiler has been installed as gnatgcc, and the coverage testing" + einfo "tool as gnatgcov." + einfo "" +} |