linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH 2/3] autoconf: don't let libnfsidmap test add -lnfsidmap to $LIBS
Date: Fri, 23 Dec 2011 14:47:04 -0500	[thread overview]
Message-ID: <1324669625-2948-3-git-send-email-jlayton@redhat.com> (raw)
In-Reply-To: <1324669625-2948-1-git-send-email-jlayton@redhat.com>

...as that makes that library get linked into every binary. Also,
replace "hardcoded" -lnfsidmap linker flag in Makefiles with
a AC_SUBST variable.

This fixes a regression introduced in commit d7c64dd.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
---
 aclocal/libnfsidmap.m4     |    9 ++++++---
 utils/gssd/Makefile.am     |    2 +-
 utils/idmapd/Makefile.am   |    2 +-
 utils/nfsidmap/Makefile.am |    2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/aclocal/libnfsidmap.m4 b/aclocal/libnfsidmap.m4
index 484b1ec..ae697e8 100644
--- a/aclocal/libnfsidmap.m4
+++ b/aclocal/libnfsidmap.m4
@@ -3,7 +3,7 @@ dnl
 AC_DEFUN([AC_LIBNFSIDMAP], [
 
   dnl Check for libnfsidmap, but do not add -lnfsidmap to LIBS
-  AC_CHECK_LIB([nfsidmap], [nfs4_init_name_mapping], [libnfsidmap=1],
+  AC_CHECK_LIB([nfsidmap], [nfs4_init_name_mapping], [LIBNFSIDMAP=-lnfsidmap],
                [AC_MSG_ERROR([libnfsidmap not found.])])
 
   AC_CHECK_HEADERS([nfsidmap.h], ,
@@ -14,7 +14,10 @@ AC_DEFUN([AC_LIBNFSIDMAP], [
                [AC_DEFINE([HAVE_NFS4_SET_DEBUG], 1,
                           [Define to 1 if you have the `nfs4_set_debug' function.])])
 
-  dnl only enable nfsidmap when libnfsidmap supports it
-  AC_CHECK_LIB([nfsidmap], [nfs4_owner_to_uid])
+  dnl nfs4_owner_to_uid() doesn't appear in all versions of libnfsidmap
+  dnl We just need this test to set $ac_cv_lib_nfsidmap_nfs4_owner_to_uid
+  AC_CHECK_LIB([nfsidmap], [nfs4_owner_to_uid], [:])
+
+  AC_SUBST(LIBNFSIDMAP)
 
 ])dnl
diff --git a/utils/gssd/Makefile.am b/utils/gssd/Makefile.am
index d7888ad..9136189 100644
--- a/utils/gssd/Makefile.am
+++ b/utils/gssd/Makefile.am
@@ -58,7 +58,7 @@ svcgssd_SOURCES = \
 
 svcgssd_LDADD = \
 	../../support/nfs/libnfs.a \
-	$(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) -lnfsidmap \
+	$(RPCSECGSS_LIBS) $(GSSGLUE_LIBS) $(LIBNFSIDMAP) \
 	$(KRBLIBS)
 
 svcgssd_LDFLAGS = $(KRBLDFLAGS)
diff --git a/utils/idmapd/Makefile.am b/utils/idmapd/Makefile.am
index f8578b0..58b33ec 100644
--- a/utils/idmapd/Makefile.am
+++ b/utils/idmapd/Makefile.am
@@ -16,7 +16,7 @@ idmapd_SOURCES = \
 	nfs_idmap.h \
 	queue.h
 
-idmapd_LDADD = $(LIBEVENT) -lnfsidmap ../../support/nfs/libnfs.a
+idmapd_LDADD = $(LIBEVENT) $(LIBNFSIDMAP) ../../support/nfs/libnfs.a
 
 MAINTAINERCLEANFILES = Makefile.in
 
diff --git a/utils/nfsidmap/Makefile.am b/utils/nfsidmap/Makefile.am
index 037aa79..c0675c4 100644
--- a/utils/nfsidmap/Makefile.am
+++ b/utils/nfsidmap/Makefile.am
@@ -4,6 +4,6 @@ man8_MANS = nfsidmap.man
 
 sbin_PROGRAMS	= nfsidmap
 nfsidmap_SOURCES = nfsidmap.c
-nfsidmap_LDADD = -lnfsidmap -lkeyutils ../../support/nfs/libnfs.a
+nfsidmap_LDADD = $(LIBNFSIDMAP) -lkeyutils ../../support/nfs/libnfs.a
 
 MAINTAINERCLEANFILES = Makefile.in
-- 
1.7.7.4


  parent reply	other threads:[~2011-12-23 19:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-23 19:47 [PATCH 0/3] autoconf: clean up linking in nfs-utils Jeff Layton
2011-12-23 19:47 ` [PATCH 1/3] autoconf: fix up libevent autoconf test Jeff Layton
2012-01-05 21:43   ` Steve Dickson
2011-12-23 19:47 ` Jeff Layton [this message]
2012-01-05 21:44   ` [PATCH 2/3] autoconf: don't let libnfsidmap test add -lnfsidmap to $LIBS Steve Dickson
2011-12-23 19:47 ` [PATCH 3/3] autoconf: only link binaries that need it to libtirpc Jeff Layton
2011-12-24 14:54 ` [PATCH 0/3] autoconf: clean up linking in nfs-utils Jim Rees
2011-12-24 16:53   ` Jim Rees
2012-01-05 18:37     ` Jeff Layton
2012-01-05 18:57       ` Jim Rees
2012-01-05 19:12         ` Jeff Layton
2012-01-05 20:42         ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1324669625-2948-3-git-send-email-jlayton@redhat.com \
    --to=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).