net-fs/autofs: fix --as-need issue USE=libtirpc
authorYixun Lan <dlan@gentoo.org>
Tue, 5 Jul 2016 23:19:20 +0000 (07:19 +0800)
committerYixun Lan <dlan@gentoo.org>
Tue, 5 Jul 2016 23:20:09 +0000 (07:20 +0800)
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

net-fs/autofs/autofs-5.1.2.ebuild
net-fs/autofs/files/autofs-5.1.2-libtirpc-as-need.patch [new file with mode: 0644]

index 685e0bbe3723ac97da07859b65ad60f1087f20b4..4fb3c6110753f24af2d57e3575104824f32cc98b 100644 (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
diff --git a/net-fs/autofs/files/autofs-5.1.2-libtirpc-as-need.patch b/net-fs/autofs/files/autofs-5.1.2-libtirpc-as-need.patch
new file mode 100644 (file)
index 0000000..f6e1769
--- /dev/null
@@ -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],