aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <sfabbro@uvic.ca>2012-07-12 11:43:51 -0700
committerSebastien Fabbro <sfabbro@uvic.ca>2012-07-12 11:43:51 -0700
commit04345deb54f94ec1c493834fc49ee409b8620f25 (patch)
treec7dd3b079fa23e4b3003f41d3d28791ffb11125f /sci-libs
parentsci-libs/cblas-reference: Shared library fixes and prefix love (diff)
downloadsci-04345deb54f94ec1c493834fc49ee409b8620f25.tar.gz
sci-04345deb54f94ec1c493834fc49ee409b8620f25.tar.bz2
sci-04345deb54f94ec1c493834fc49ee409b8620f25.zip
sci-libs/fdlibm: Shared library fixes and prefix love
(Portage version: 2.2.01.20757-prefix/git/Linux x86_64, RepoMan options: --force, unsigned Manifest commit)
Diffstat (limited to 'sci-libs')
-rw-r--r--sci-libs/fdlibm/ChangeLog3
-rw-r--r--sci-libs/fdlibm/fdlibm-5.3.ebuild36
2 files changed, 26 insertions, 13 deletions
diff --git a/sci-libs/fdlibm/ChangeLog b/sci-libs/fdlibm/ChangeLog
index 1f4cc02f7..ae9c52de3 100644
--- a/sci-libs/fdlibm/ChangeLog
+++ b/sci-libs/fdlibm/ChangeLog
@@ -2,6 +2,9 @@
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+ 12 Jul 2012; Sébastien Fabbro <bicatali@gentoo.org> fdlibm-5.3.ebuild:
+ sci-libs/fdlibm: Shared library fixes and prefix love
+
*fdlibm-5.3 (11 Jul 2012)
11 Jul 2012; Sébastien Fabbro <bicatali@gentoo.org> +fdlibm-5.3.ebuild,
diff --git a/sci-libs/fdlibm/fdlibm-5.3.ebuild b/sci-libs/fdlibm/fdlibm-5.3.ebuild
index c3ea459af..053933bb0 100644
--- a/sci-libs/fdlibm/fdlibm-5.3.ebuild
+++ b/sci-libs/fdlibm/fdlibm-5.3.ebuild
@@ -4,7 +4,7 @@
EAPI=4
-inherit toolchain-funcs flag-o-matic versionator
+inherit toolchain-funcs flag-o-matic versionator multilib
DESCRIPTION="C math library supporting IEEE 754 floating-point arithmetic"
HOMEPAGE="http://www.netlib.org/fdlibm"
@@ -18,24 +18,34 @@ IUSE="static-libs"
RDEPEND=""
DEPEND="${RDEPEND}"
-make_shared_lib() {
- local soname=$(basename "${1%.a}")$(get_libname $(get_major_version))
- einfo "Making ${soname}"
- ${2:-$(tc-getCC)} ${LDFLAGS} \
- -shared -Wl,-soname="${soname}" \
- $([[ ${CHOST} == *-darwin* ]] && \
- echo "-Wl,-install_name -Wl,${EPREFIX}/usr/$(get_libdir)/${soname}") \
- -Wl,--whole-archive "${1}" -Wl,--no-whole-archive \
- -o $(dirname "${1}")/"${soname}" \
- -lm $(pkg-config --libs blas lapack) || return 1
- ln -s "${soname}" $(dirname "${1}")/$(basename "${1%.a}")$(get_libname)
+static_to_shared() {
+ local libstatic=${1}; shift
+ local libname=$(basename ${libstatic%.a})
+ local soname=${libname}$(get_libname $(get_version_component_range 1-2))
+ local libdir=$(dirname ${libstatic})
+
+ einfo "Making ${soname} from ${libstatic}"
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -dynamiclib -install_name "${EPREFIX}"/usr/lib/"${soname}" \
+ -Wl,-all_load -Wl,${libstatic} \
+ "$@" -o ${libdir}/${soname} || die "${soname} failed"
+ else
+ ${LINK:-$(tc-getCC)} ${LDFLAGS} \
+ -shared -Wl,-soname=${soname} \
+ -Wl,--whole-archive ${libstatic} -Wl,--no-whole-archive \
+ "$@" -o ${libdir}/${soname} || die "${soname} failed"
+ [[ $(get_version_component_count) -gt 1 ]] && \
+ ln -s ${soname} ${libdir}/${libname}$(get_libname $(get_major_version))
+ ln -s ${soname} ${libdir}/${libname}$(get_libname)
+ fi
}
src_compile() {
append-cflags -D_IEEE_LIBM
emake CFLAGS="${CFLAGS} -fPIC" CC=$(tc-getCC)
mv libm.a lib${PN}.a
- make_shared_lib lib${PN}.a || die "doing shared lib failed"
+ static_to_shared lib${PN}.a
if use static-libs; then
rm -f *.o
emake CFLAGS="${CFLAGS}" CC=$(tc-getCC)