net-fs/autofs: fix --as-need issue USE=libtirpc

thanks Martin von Gagern for reporting & the patch

http://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed

Gentoo-Bug: 588106

Package-Manager: portage-2.3.0_rc1
This commit is contained in:
Yixun Lan
2016-07-06 07:19:20 +08:00
parent 2e5771a83a
commit 1069c56a89
2 changed files with 32 additions and 0 deletions

View File

@@ -47,6 +47,10 @@ DEPEND="${RDEPEND}
CONFIG_CHECK="~AUTOFS4_FS"
PATCHES=(
"${FILESDIR}"/${P}-libtirpc-as-need.patch
)
src_prepare() {
# Upstream's patchset
if [[ -n ${PATCH_VER} ]]; then

View File

@@ -0,0 +1,28 @@
Make configure compatible with -Wl,--as-needed following
https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed#Failure_in_..2Fconfigure
2016-07-05 Martin von Gagern
--- autofs-5.1.2.orig/aclocal.m4
+++ autofs-5.1.2/aclocal.m4
@@ -413,9 +413,9 @@ AC_DEFUN([AF_CHECK_LIBTIRPC],
[
# save current flags
af_check_libtirpc_save_cflags="$CFLAGS"
-af_check_libtirpc_save_ldflags="$LDFLAGS"
+af_check_libtirpc_save_libs="$LIBS"
CFLAGS="$CFLAGS -I/usr/include/tirpc"
-LDFLAGS="$LDFLAGS -ltirpc"
+LIBS="$LIBS -ltirpc"
AC_TRY_LINK(
[ #include <rpc/rpc.h> ],
@@ -438,7 +438,7 @@ AC_CHECK_FUNCS([getrpcbyname getservbyna
# restore flags
CFLAGS="$af_check_libtirpc_save_cflags"
-LDFLAGS="$af_check_libtirpc_save_ldflags"
+LIBS="$af_check_libtirpc_save_libs"
])
AC_DEFUN([AF_WITH_LIBTIRPC],