diff options
author | Fabian Groffen <grobian@gentoo.org> | 2015-08-31 20:36:02 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2015-08-31 20:43:19 +0200 |
commit | 9c928e3de99c4b2f01f8dfd1b4cc97ae8cd181e5 (patch) | |
tree | 5868408bbe7e158d22d39353ae7b4066b680e0c7 /sys-libs/ncurses | |
parent | dev-vcs/git: add some features availble on Solaris (diff) | |
download | gentoo-9c928e3de99c4b2f01f8dfd1b4cc97ae8cd181e5.tar.gz gentoo-9c928e3de99c4b2f01f8dfd1b4cc97ae8cd181e5.tar.bz2 gentoo-9c928e3de99c4b2f01f8dfd1b4cc97ae8cd181e5.zip |
sys-libs/ncurses: fix build on platforms that don't support static linking
Package-Manager: portage-2.2.20-prefix
Diffstat (limited to 'sys-libs/ncurses')
-rw-r--r-- | sys-libs/ncurses/ncurses-6.0-r1.ebuild | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys-libs/ncurses/ncurses-6.0-r1.ebuild b/sys-libs/ncurses/ncurses-6.0-r1.ebuild index 245d977593f1..c41219baea45 100644 --- a/sys-libs/ncurses/ncurses-6.0-r1.ebuild +++ b/sys-libs/ncurses/ncurses-6.0-r1.ebuild @@ -68,13 +68,24 @@ src_configure() { # or installing for the first time. Build a local copy of tic whenever # the host version isn't available. #249363 #557598 if ! ROOT=/ has_version "~sys-libs/${P}:0" ; then + local lbuildflags="-static" + + # some toolchains don't quite support static linking + local dbuildflags="-Wl,-rpath,${WORKDIR}/lib" + case ${CHOST} in + *-darwin*) dbuildflags= ;; + esac + echo "int main() {}" | \ + $(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \ + || lbuildflags="${dbuildflags}" + # We can't re-use the multilib BUILD_DIR because we run outside of it. BUILD_DIR="${WORKDIR}" \ CHOST=${CBUILD} \ CFLAGS=${BUILD_CFLAGS} \ CXXFLAGS=${BUILD_CXXFLAGS} \ CPPFLAGS=${BUILD_CPPFLAGS} \ - LDFLAGS="${BUILD_LDFLAGS} -static" \ + LDFLAGS="${BUILD_LDFLAGS} ${lbuildflags}" \ multijob_child_init do_configure cross --without-shared --with-normal fi multilib-minimal_src_configure @@ -165,7 +176,7 @@ do_configure() { # Force bash until upstream rebuilds the configure script with a newer # version of autotools. #545532 - CONFIG_SHELL=/bin/bash \ + CONFIG_SHELL=${EPREFIX}/bin/bash \ ECONF_SOURCE=${S} \ econf "${conf[@]}" "$@" } |