diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-06-01 00:06:02 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-06-01 00:06:02 -0400 |
commit | cf759e3b000d92683cc0c200cebaea448aadb484 (patch) | |
tree | 25a1cb7522d651de5bf96142aa20d4f9de3cfcc5 /net-misc/iputils | |
parent | net-misc/iputils: mark 20151218 arm/arm64/ia64/m68k/ppc/s390/sh/sparc stable ... (diff) | |
download | gentoo-cf759e3b000d92683cc0c200cebaea448aadb484.tar.gz gentoo-cf759e3b000d92683cc0c200cebaea448aadb484.tar.bz2 gentoo-cf759e3b000d92683cc0c200cebaea448aadb484.zip |
net-misc/iputils: make -lresolv linkage dynamic #584132
Diffstat (limited to 'net-misc/iputils')
-rw-r--r-- | net-misc/iputils/iputils-20151218.ebuild | 9 | ||||
-rw-r--r-- | net-misc/iputils/iputils-99999999.ebuild | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/net-misc/iputils/iputils-20151218.ebuild b/net-misc/iputils/iputils-20151218.ebuild index 1f283fa7d1e2..03be077d5f01 100644 --- a/net-misc/iputils/iputils-20151218.ebuild +++ b/net-misc/iputils/iputils-20151218.ebuild @@ -82,6 +82,14 @@ src_configure() { use ipv6 || IPV6_TARGETS=() } +ldflag_resolv() { + # See if the system includes a libresolv. #584132 + echo "main(){}" > "${T}"/resolv.c + if ${CC} ${CFLAGS} ${LDFLAGS} "${T}"/resolv.c -lresolv -o "${T}"/resolv 2>/dev/null ; then + echo -lresolv + fi +} + src_compile() { tc-export CC emake \ @@ -89,6 +97,7 @@ src_compile() { USE_IDN=$(usex idn) \ USE_GCRYPT=$(usex gcrypt) \ USE_CRYPTO=$(usex ssl) \ + LDFLAG_RESOLV=$(ldflag_resolv) \ IPV4_TARGETS="${IPV4_TARGETS[*]}" \ IPV6_TARGETS="${IPV6_TARGETS[*]}" diff --git a/net-misc/iputils/iputils-99999999.ebuild b/net-misc/iputils/iputils-99999999.ebuild index 09b9ad107a61..8276b4345988 100644 --- a/net-misc/iputils/iputils-99999999.ebuild +++ b/net-misc/iputils/iputils-99999999.ebuild @@ -82,6 +82,14 @@ src_configure() { use ipv6 || IPV6_TARGETS=() } +ldflag_resolv() { + # See if the system includes a libresolv. #584132 + echo "main(){}" > "${T}"/resolv.c + if ${CC} ${CFLAGS} ${LDFLAGS} "${T}"/resolv.c -lresolv -o "${T}"/resolv 2>/dev/null ; then + echo -lresolv + fi +} + src_compile() { tc-export CC emake \ @@ -89,6 +97,7 @@ src_compile() { USE_IDN=$(usex idn) \ USE_GCRYPT=$(usex gcrypt) \ USE_CRYPTO=$(usex ssl) \ + LDFLAG_RESOLV=$(ldflag_resolv) \ IPV4_TARGETS="${IPV4_TARGETS[*]}" \ IPV6_TARGETS="${IPV6_TARGETS[*]}" |