diff options
author | Armando Di Cianno <fafhrd@gentoo.org> | 2004-09-22 21:48:48 +0000 |
---|---|---|
committer | Armando Di Cianno <fafhrd@gentoo.org> | 2004-09-22 21:48:48 +0000 |
commit | aceb73e55259ab06473d5d881cfadba0039ed96e (patch) | |
tree | 86193d8386ad0127706bedfaa012208e8e474e33 /dev-libs/libffi | |
parent | Removing jack from use.mask on sparc. (diff) | |
download | gentoo-2-aceb73e55259ab06473d5d881cfadba0039ed96e.tar.gz gentoo-2-aceb73e55259ab06473d5d881cfadba0039ed96e.tar.bz2 gentoo-2-aceb73e55259ab06473d5d881cfadba0039ed96e.zip |
Upgraded to 3.3.3-r1 and added 3.4.1-r1 for ~x86; based off newest incarnation of libstdc++-v3; 3.4.1-r1 for anyone running x86 gcc-3.4.1; added patches for building without turning on libgcj
Diffstat (limited to 'dev-libs/libffi')
-rw-r--r-- | dev-libs/libffi/ChangeLog | 10 | ||||
-rw-r--r-- | dev-libs/libffi/Manifest | 6 | ||||
-rw-r--r-- | dev-libs/libffi/files/digest-libffi-3.3.3-r1 | 1 | ||||
-rw-r--r-- | dev-libs/libffi/files/digest-libffi-3.4.1-r1 | 1 | ||||
-rw-r--r-- | dev-libs/libffi/files/libffi-soversion.dpatch | 61 | ||||
-rw-r--r-- | dev-libs/libffi/files/libffi-without-libgcj.dpatch | 67 | ||||
-rw-r--r-- | dev-libs/libffi/libffi-3.3.3-r1.ebuild | 245 | ||||
-rw-r--r-- | dev-libs/libffi/libffi-3.4.1-r1.ebuild | 211 |
8 files changed, 601 insertions, 1 deletions
diff --git a/dev-libs/libffi/ChangeLog b/dev-libs/libffi/ChangeLog index 005745a009a6..48306a4bd026 100644 --- a/dev-libs/libffi/ChangeLog +++ b/dev-libs/libffi/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for dev-libs/libffi # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/libffi/ChangeLog,v 1.13 2004/08/27 20:21:47 fafhrd Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libffi/ChangeLog,v 1.14 2004/09/22 21:48:48 fafhrd Exp $ + +*libffi-3.3.3-r1 (22 Sep 2004) + + 22 Sep 2004; Armando Di Cianno <fafhrd@gentoo.org> + +files/libffi-soversion.dpatch, +files/libffi-without-libgcj.dpatch, + +libffi-3.3.3-r1.ebuild, +libffi-3.4.1-r1.ebuild: + Updated,new 3.3.3-r1 and 3.4.1-r1 for ~x86; 3.4.1-r1 now applies patches that + allow building without turning on libgcj as well. *libffi-3.3.3 (27 Aug 2004) diff --git a/dev-libs/libffi/Manifest b/dev-libs/libffi/Manifest index 1f5a4cc93f68..25661057dda1 100644 --- a/dev-libs/libffi/Manifest +++ b/dev-libs/libffi/Manifest @@ -1,8 +1,14 @@ +MD5 bfca5570fcd0cd124594ab0754a9d65c libffi-3.4.1-r1.ebuild 5592 MD5 3113b98f43bda47db0f39bd6f6e3aad1 libffi-1.20.ebuild 605 +MD5 19f26db0e7e679b17f169b20a13fbac5 libffi-3.3.3-r1.ebuild 6245 MD5 e21dd80ca7b21c735c8e7808a6c3c82e libffi-3.3.3.ebuild 6895 MD5 8e8520857bfdc8f92328b44e6449db28 libffi-3.4.1.ebuild 7094 MD5 724b963b813ffe2e6aa8ddcf102921ad ChangeLog 2163 MD5 ef1d6e99f954cc3412a9e513a2d80c64 metadata.xml 1836 MD5 ed8f1e978198c34ad3dc3b81c4804199 files/digest-libffi-1.20 63 +MD5 1ca677e646f4d209e68601c9ba83c629 files/libffi-without-libgcj.dpatch 2255 +MD5 78c9b1a1b40fcc12f8cf34d57a970f00 files/libffi-soversion.dpatch 1943 +MD5 14f4d6619c938dbb907e2420c0eeefd9 files/digest-libffi-3.3.3-r1 64 +MD5 03a0e46a8ce1aff598b68a731112c13a files/digest-libffi-3.4.1-r1 64 MD5 14f4d6619c938dbb907e2420c0eeefd9 files/digest-libffi-3.3.3 64 MD5 03a0e46a8ce1aff598b68a731112c13a files/digest-libffi-3.4.1 64 diff --git a/dev-libs/libffi/files/digest-libffi-3.3.3-r1 b/dev-libs/libffi/files/digest-libffi-3.3.3-r1 new file mode 100644 index 000000000000..e87695155cb0 --- /dev/null +++ b/dev-libs/libffi/files/digest-libffi-3.3.3-r1 @@ -0,0 +1 @@ +MD5 3c6cfd9fcd180481063b4058cf6faff2 gcc-3.3.3.tar.bz2 23279245 diff --git a/dev-libs/libffi/files/digest-libffi-3.4.1-r1 b/dev-libs/libffi/files/digest-libffi-3.4.1-r1 new file mode 100644 index 000000000000..ba271506dd42 --- /dev/null +++ b/dev-libs/libffi/files/digest-libffi-3.4.1-r1 @@ -0,0 +1 @@ +MD5 31b459062499f9f68d451db9cbf3205c gcc-3.4.1.tar.bz2 27182385 diff --git a/dev-libs/libffi/files/libffi-soversion.dpatch b/dev-libs/libffi/files/libffi-soversion.dpatch new file mode 100644 index 000000000000..45b95b9add40 --- /dev/null +++ b/dev-libs/libffi/files/libffi-soversion.dpatch @@ -0,0 +1,61 @@ +#! /bin/sh -e + +# DP: Install libffi with soversion 3. + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + #cd ${dir}gcc && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + #rm ${dir}gcc/configure + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +diff -urN libffi.old/Makefile.am libffi/Makefile.am +--- libffi.old/Makefile.am 2003-10-22 01:02:59.000000000 +0200 ++++ libffi/Makefile.am 2004-02-21 10:06:49.000000000 +0100 +@@ -175,7 +175,7 @@ + + AM_CFLAGS = -Wall -g -fexceptions + +-libffi_la_LDFLAGS = -release $(VERSION) ++libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` + + INCLUDES = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src + +diff -urN libffi.old/Makefile.in libffi/Makefile.in +--- libffi.old/Makefile.in 2003-11-24 00:52:28.000000000 +0100 ++++ libffi/Makefile.in 2004-02-21 10:06:49.000000000 +0100 +@@ -226,7 +226,7 @@ + + AM_CFLAGS = -Wall -g -fexceptions + +-libffi_la_LDFLAGS = -release $(VERSION) ++libffi_la_LDFLAGS = -version-info `grep -v '^\#' $(srcdir)/libtool-version` + + INCLUDES = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +diff -urN libffi.old/libtool-version libffi/libtool-version +--- libffi.old/libtool-version 1970-01-01 01:00:00.000000000 +0100 ++++ libffi/libtool-version 2004-02-21 10:06:49.000000000 +0100 +@@ -0,0 +1,6 @@ ++# This file is used to maintain libtool version info for libffi. See ++# the libtool manual to understand the meaning of the fields. This is ++# a separate file so that version updates don't involve re-running ++# automake. ++# CURRENT:REVISION:AGE ++3:0:0 diff --git a/dev-libs/libffi/files/libffi-without-libgcj.dpatch b/dev-libs/libffi/files/libffi-without-libgcj.dpatch new file mode 100644 index 000000000000..f4732cad4015 --- /dev/null +++ b/dev-libs/libffi/files/libffi-without-libgcj.dpatch @@ -0,0 +1,67 @@ +#! /bin/sh -e + +# DP: build libffi without building libgcj + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + #cd ${dir}gcc && autoconf + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + #rm ${dir}gcc/configure + ;; + *) + echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" + exit 1 +esac +exit 0 + +--- configure.in.orig 2004-08-03 00:53:36.000000000 +0200 ++++ configure.in 2004-08-03 00:52:35.000000000 +0200 +@@ -136,8 +136,7 @@ + host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" + + # libgcj represents the runtime libraries only used by gcj. +-libgcj="target-libffi \ +- target-boehm-gc \ ++libgcj="target-boehm-gc \ + target-zlib \ + target-qthreads \ + target-libjava" +@@ -150,6 +150,7 @@ + target-libstdc++-v3 \ + target-libf2c \ + ${libgcj} \ ++ target-libffi \ + target-libobjc" + + # these tools are built using the target libraries, and are intended to +--- configure~ 2004-08-28 02:31:04.000000000 +0200 ++++ configure 2004-08-28 10:55:28.000000000 +0200 +@@ -876,8 +876,7 @@ + host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" + + # libgcj represents the runtime libraries only used by gcj. +-libgcj="target-libffi \ +- target-boehm-gc \ ++libgcj="target-boehm-gc \ + target-zlib \ + target-qthreads \ + target-libjava" +@@ -891,6 +890,7 @@ + target-libstdc++-v3 \ + target-libf2c \ + ${libgcj} \ ++ target-libffi \ + target-libobjc" + + # these tools are built using the target libraries, and are intended to diff --git a/dev-libs/libffi/libffi-3.3.3-r1.ebuild b/dev-libs/libffi/libffi-3.3.3-r1.ebuild new file mode 100644 index 000000000000..6fa95eae1c75 --- /dev/null +++ b/dev-libs/libffi/libffi-3.3.3-r1.ebuild @@ -0,0 +1,245 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libffi/libffi-3.3.3-r1.ebuild,v 1.1 2004/09/22 21:48:48 fafhrd Exp $ + +inherit eutils flag-o-matic libtool gnuconfig + +# This ebuild mod'd from libstdc++ compatbility package ebuild to create +# a similar structure for libffi, which is also included in gcc sources. +# __Armando Di Cianno <fafhrd@gentoo.org> + +do_filter_flags() { + declare setting + + strip-flags + + # In general gcc does not like optimization, and add -O2 where + # it is safe. This is especially true for gcc 3.3 + 3.4 + replace-flags -O? -O2 + + if use amd64 + then + # gcc 3.3 doesn't support -march=k8/etc on amd64, so xgcc will fail + setting="`get-flag march`" + [ ! -z "${setting}" ] && filter-flags -march="${setting}" + fi + + # and on x86, we just need to filter the 3.4 specific amd64 -marchs + filter-flags -march=k8 + filter-flags -march=athlon64 + filter-flags -march=opteron + + # gcc 3.3 doesn't support -march=pentium-m + replace-flags -march=pentium-m -march=pentium3 + + # gcc 3.3 doesn't support -mtune on numerous archs, so xgcc will fail + setting="`get-flag mtune`" + [ ! -z "${setting}" ] && filter-flags -mtune="${setting}" + + # xgcc wont understand gcc 3.4 flags... + filter-flags -fno-unit-at-a-time + filter-flags -funit-at-a-time + filter-flags -fweb + filter-flags -fno-web + + # xgcc isnt patched with propolice + filter-flags -fstack-protector-all + filter-flags -fno-stack-protector-all + filter-flags -fstack-protector + filter-flags -fno-stack-protector + + # xgcc isnt patched with the gcc symbol visibility patch + filter-flags -fvisibility-inlines-hidden + filter-flags -fvisibility=hidden + + # ...sure, why not? + strip-unsupported-flags +} + +S=${WORKDIR}/gcc-${PV} + +# Theoretical cross compiler support +[ ! -n "${CCHOST}" ] && export CCHOST="${CHOST}" + +LOC="/usr" +MY_PV="`echo ${PV} | awk -F. '{ gsub(/_pre.*|_alpha.*/, ""); print $1 "." $2 }'`" +MY_PV_FULL="`echo ${PV} | awk '{ gsub(/_pre.*|_alpha.*/, ""); print $0 }'`" + +LIBPATH="${LOC}/lib/gcc-lib/${CCHOST}/${MY_PV_FULL}" +BINPATH="${LOC}/${CCHOST}/gcc-bin/${MY_PV}" +DATAPATH="${LOC}/share/gcc-data/${CCHOST}/${MY_PV}" +# Dont install in /usr/include/g++-v3/, but in gcc internal directory. +# We will handle /usr/include/g++-v3/ with gcc-config ... +STDCXX_INCDIR="${LIBPATH}/include/g++-v${MY_PV/\.*/}" + +SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2" + +DESCRIPTION="libffi (from gcc) does not commonly build unless gcj is compiled, but is used by other projects, like GNUstep." +HOMEPAGE="http://gcc.gnu.org/" + +LICENSE="libffi" + +KEYWORDS="-* ~x86" +IUSE="nls" + +SLOT="0" +## 3.2.3 -> 3.3.x install .so.5, so lets slot to 5 +#if [ "${CHOST}" == "${CCHOST}" ] +#then +# SLOT="5" +#else +# SLOT="${CCHOST}-5" +#fi + +DEPEND="virtual/libc + !nptl? ( !uclibc? ( >=sys-libs/glibc-2.3.2-r3 ) ) + >=sys-devel/binutils-2.14.90.0.6-r1 + >=sys-devel/bison-1.875 + >=sys-devel/gcc-config-1.3.1 + >=sys-devel/gcc-3.3.3_pre20040130 + !build? ( >=sys-libs/ncurses-5.2-r2 + nls? ( sys-devel/gettext ) )" + +RDEPEND="virtual/libc + !nptl? ( !uclibc? ( >=sys-libs/glibc-2.3.2-r3 ) ) + >=sys-devel/gcc-config-1.3.1 + >=sys-libs/zlib-1.1.4 + >=sys-apps/texinfo-4.2-r4 + !build? ( >=sys-libs/ncurses-5.2-r2 )" + +pkg_setup() { + if test_version_info ${PV} + then + einfo "Correctly using gcc version ${PV}" + else + eerror "Not using gcc version ${PV}!" + einfo "Please switch to this gcc profile using gcc-config and re-run emerge." + einfo "If you are using a newer version of gcc, you can see if there is a matching version of libffi." + die + fi +} + +src_unpack() { + unpack ${A} + + # XXX: fix these at some point + #EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/libffi-without-libgcj.dpatch + #EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/libffi-soversion.dpatch + + cd ${S} + # Fixup libtool to correctly generate .la files with portage + elibtoolize --portage --shallow + + cd ${S}; ./contrib/gcc_update --touch &> /dev/null + gnuconfig_update +} + +src_compile() { + + local myconf= + + if ! use nls || use build + then + myconf="${myconf} --disable-nls" + else + myconf="${myconf} --enable-nls --without-included-gettext" + fi + + #use amd64 && myconf="${myconf} --disable-multilib" + + do_filter_flags + einfo "CFLAGS=\"${CFLAGS}\"" + einfo "CXXFLAGS=\"${CXXFLAGS}\"" + + # Build in a separate build tree + mkdir -p ${WORKDIR}/build + cd ${WORKDIR}/build + + einfo "Configuring libffi..." + addwrite "/dev/zero" + ${S}/configure --prefix=${LOC} \ + --bindir=${BINPATH} \ + --includedir=${LIBPATH}/include \ + --datadir=${DATAPATH} \ + --mandir=${DATAPATH}/man \ + --infodir=${DATAPATH}/info \ + --enable-shared \ + --host=${CHOST} \ + --target=${CCHOST} \ + --with-system-zlib \ + --enable-languages=java,c++,objc \ + --enable-threads=posix \ + --enable-long-long \ + --disable-checking \ + --enable-cstdio=stdio \ + --enable-__cxa_atexit \ + --enable-version-specific-runtime-libs \ + --with-gxx-include-dir=${STDCXX_INCDIR} \ + --with-local-prefix=${LOC}/local \ + ${myconf} || die + + touch ${S}/gcc/c-gperf.h + + # Setup -j in MAKEOPTS + get_number_of_jobs + + einfo "Compiling libffi..." + S="${WORKDIR}/build" \ + emake all-target-libffi \ + LIBPATH="${LIBPATH}" \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die +} + +src_install() { + local x= + + # Do allow symlinks in ${LOC}/lib/gcc-lib/${CHOST}/${PV}/include as + # this can break the build. + for x in ${WORKDIR}/build/gcc/include/* + do + if [ -L ${x} ] + then + rm -f ${x} + continue + fi + done + # Remove generated headers, as they can cause things to break + # (ncurses, openssl, etc). + for x in `find ${WORKDIR}/build/gcc/include/ -name '*.h'` + do + if grep -q 'It has been auto-edited by fixincludes from' ${x} + then + rm -f ${x} + fi + done + + einfo "Installing libffi..." + # Do the 'make install' from the build directory + cd ${WORKDIR}/build + S="${WORKDIR}/build" \ + make prefix=${LOC} \ + bindir=${BINPATH} \ + includedir=${LIBPATH}/include \ + datadir=${DATAPATH} \ + mandir=${DATAPATH}/man \ + infodir=${DATAPATH}/info \ + DESTDIR="${D}" \ + LIBPATH="${LIBPATH}" \ + install-target-libffi || die + + # we want the headers... + mkdir -p ${D}/${LOC}/include/${PN} + mv ${D}/${LOC}/lib/gcc-lib/${CCHOST}/${PV}/include/* ${D}/${LOC}/include/${PN} + # remove now useless directory... + rm -Rf ${D}/${LOC}/lib/gcc-lib/ + # we'll move this into a directory we can put at the end of ld.so.conf + # other than the normal versioned directory, so that it doesnt conflict + # with gcc 3.3.3 + mkdir -p ${D}/${LOC}/lib/${PN} + mv ${D}/${LOC}/lib/* ${D}/${LOC}/lib/${PN} + + mkdir -p ${D}/etc/env.d/ + echo "LDPATH=\"${LOC}/lib/${PN}\"" >> ${D}/etc/env.d/99libffi + echo "CPATH=\"${LOC}/include/${PN}\"" >> ${D}/etc/env.d/99libffi +} + diff --git a/dev-libs/libffi/libffi-3.4.1-r1.ebuild b/dev-libs/libffi/libffi-3.4.1-r1.ebuild new file mode 100644 index 000000000000..53e2bb420003 --- /dev/null +++ b/dev-libs/libffi/libffi-3.4.1-r1.ebuild @@ -0,0 +1,211 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/libffi/libffi-3.4.1-r1.ebuild,v 1.1 2004/09/22 21:48:48 fafhrd Exp $ + +inherit eutils flag-o-matic libtool gnuconfig + +# This ebuild mod'd from libstdc++ compatbility package ebuild to create +# a similar structure for libffi, which is also included in gcc sources. +# __Armando Di Cianno <fafhrd@gentoo.org> + +do_filter_flags() { + declare setting + + strip-flags + + # In general gcc does not like optimization, and add -O2 where + # it is safe. This is especially true for gcc 3.3 + 3.4 + replace-flags -O? -O2 + + # xgcc isnt patched with propolice + filter-flags -fstack-protector-all + filter-flags -fno-stack-protector-all + filter-flags -fstack-protector + filter-flags -fno-stack-protector + + # xgcc isnt patched with the gcc symbol visibility patch + filter-flags -fvisibility-inlines-hidden + filter-flags -fvisibility=hidden + + # ...sure, why not? + strip-unsupported-flags +} + +S=${WORKDIR}/gcc-${PV} + +# Theoretical cross compiler support +[ ! -n "${CCHOST}" ] && export CCHOST="${CHOST}" + +LOC="/usr" +MY_PV="`echo ${PV} | awk -F. '{ gsub(/_pre.*|_alpha.*/, ""); print $1 "." $2 }'`" +MY_PV_FULL="`echo ${PV} | awk '{ gsub(/_pre.*|_alpha.*/, ""); print $0 }'`" + +LIBPATH="${LOC}/lib/gcc-lib/${CCHOST}/${MY_PV_FULL}" +BINPATH="${LOC}/${CCHOST}/gcc-bin/${MY_PV}" +DATAPATH="${LOC}/share/gcc-data/${CCHOST}/${MY_PV}" +# Dont install in /usr/include/g++-v3/, but in gcc internal directory. +# We will handle /usr/include/g++-v3/ with gcc-config ... +STDCXX_INCDIR="${LIBPATH}/include/g++-v${MY_PV/\.*/}" + +SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2" + +DESCRIPTION="libffi (from gcc) does not commonly build unless gcj is compiled, but is used by other projects, like GNUstep." +HOMEPAGE="http://gcc.gnu.org/" + +LICENSE="libffi" + +KEYWORDS="-* ~x86" +IUSE="nls" + +SLOT="0" +## 3.2.3 -> 3.3.x install .so.5, so lets slot to 5 +#if [ "${CHOST}" == "${CCHOST}" ] +#then +# SLOT="5" +#else +# SLOT="${CCHOST}-5" +#fi + +DEPEND="virtual/libc + !nptl? ( !uclibc? ( >=sys-libs/glibc-2.3.2-r3 ) ) + >=sys-devel/binutils-2.14.90.0.6-r1 + >=sys-devel/bison-1.875 + >=sys-devel/gcc-config-1.3.1 + >=sys-devel/gcc-3.4.1* + !build? ( >=sys-libs/ncurses-5.2-r2 + nls? ( sys-devel/gettext ) )" + +RDEPEND="virtual/libc + !nptl? ( !uclibc? ( >=sys-libs/glibc-2.3.2-r3 ) ) + >=sys-devel/gcc-config-1.3.1 + >=sys-libs/zlib-1.1.4 + >=sys-apps/texinfo-4.2-r4 + !build? ( >=sys-libs/ncurses-5.2-r2 )" + +PDEPEND="sys-devel/gcc-config" + +src_unpack() { + unpack ${A} + + EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/libffi-without-libgcj.dpatch + EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/libffi-soversion.dpatch + + # mainly for AMD64, but can't hurt to run it + sed -i -e 's/MULTILIB_OSDIRNAMES\ =.*/MULTILIB_OSDIRNAMES\ =\ ..\/lib64\ ..\/lib32/' ${S}/gcc/config/i386/t-linux64 + + cd ${S} + # Fixup libtool to correctly generate .la files with portage + elibtoolize --portage --shallow + + cd ${S}; ./contrib/gcc_update --touch &> /dev/null + gnuconfig_update +} + +src_compile() { + + local myconf= + + if ! use nls || use build + then + myconf="${myconf} --disable-nls" + else + myconf="${myconf} --enable-nls --without-included-gettext" + fi + + use amd64 && myconf="${myconf} --disable-multilib" + + do_filter_flags + einfo "CFLAGS=\"${CFLAGS}\"" + einfo "CXXFLAGS=\"${CXXFLAGS}\"" + + # Build in a separate build tree + mkdir -p ${WORKDIR}/build + cd ${WORKDIR}/build + + einfo "Configuring libffi..." + addwrite "/dev/zero" + ${S}/configure --prefix=${LOC} \ + --bindir=${BINPATH} \ + --includedir=${LIBPATH}/include \ + --datadir=${DATAPATH} \ + --mandir=${DATAPATH}/man \ + --infodir=${DATAPATH}/info \ + --enable-shared \ + --host=${CHOST} \ + --target=${CCHOST} \ + --with-system-zlib \ + --enable-languages=c++,objc \ + --enable-threads=posix \ + --enable-long-long \ + --disable-checking \ + --enable-cstdio=stdio \ + --enable-__cxa_atexit \ + --enable-version-specific-runtime-libs \ + --with-gxx-include-dir=${STDCXX_INCDIR} \ + --with-local-prefix=${LOC}/local \ + ${myconf} || die + + touch ${S}/gcc/c-gperf.h + + # Setup -j in MAKEOPTS + get_number_of_jobs + + einfo "Compiling libffi..." + S="${WORKDIR}/build" \ + emake all-target-libffi \ + LIBPATH="${LIBPATH}" \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die +} + +src_install() { + local x= + + # Do allow symlinks in ${LOC}/lib/gcc-lib/${CHOST}/${PV}/include as + # this can break the build. + for x in ${WORKDIR}/build/gcc/include/* + do + if [ -L ${x} ] + then + rm -f ${x} + continue + fi + done + # Remove generated headers, as they can cause things to break + # (ncurses, openssl, etc). + for x in `find ${WORKDIR}/build/gcc/include/ -name '*.h'` + do + if grep -q 'It has been auto-edited by fixincludes from' ${x} + then + rm -f ${x} + fi + done + + einfo "Installing libffi..." + # Do the 'make install' from the build directory + cd ${WORKDIR}/build + S="${WORKDIR}/build" \ + make prefix=${LOC} \ + bindir=${BINPATH} \ + includedir=${LIBPATH}/include \ + datadir=${DATAPATH} \ + mandir=${DATAPATH}/man \ + infodir=${DATAPATH}/info \ + DESTDIR="${D}" \ + LIBPATH="${LIBPATH}" \ + install-target-libffi || die + + mkdir -p ${D}/${LOC}/include/${PN} + mv ${D}/${LOC}/lib/gcc-lib/${CCHOST}/${PV}/include/* ${D}/${LOC}/include/${PN} + mv ${D}/${LOC}/lib/gcc/${CCHOST}/${PV}/include/libffi/* ${D}/${LOC}/include/${PN} + # remove now useless directory... + rm -Rf ${D}/${LOC}/lib/gcc-lib/ + rm -Rf ${D}/${LOC}/lib/gcc + + mkdir -p ${D}/${LOC}/lib/${PN}/ + mv ${D}/${LOC}/{lib,lib64}/* ${D}/${LOC}/lib/${PN}/ + + mkdir -p ${D}/etc/env.d/ + echo "LDPATH=\"${LOC}/lib/${PN}\"" >> ${D}/etc/env.d/99libffi + echo "CPATH=\"${LOC}/include/${PN}\"" >> ${D}/etc/env.d/99libffi +} + |