]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
autoconf: don't let libnfsidmap test add -lnfsidmap to $LIBS
authorJeff Layton <jlayton@redhat.com>
Fri, 23 Dec 2011 19:41:11 +0000 (14:41 -0500)
committerSteve Dickson <steved@redhat.com>
Thu, 5 Jan 2012 20:42:40 +0000 (15:42 -0500)
...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
utils/gssd/Makefile.am
utils/idmapd/Makefile.am
utils/nfsidmap/Makefile.am

index 484b1ecebfdcb3120464997e5a4b5c900830a260..ae697e814026aabddd926ecb8c89eab88f665def 100644 (file)
@@ -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
index d7888ad63d2b0bd827c9ca1892bc3dd62b8d92c0..9136189bb1d0c2d0f2de4de2d874cb0b36c1e75b 100644 (file)
@@ -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)
index f8578b087e407c24ba9bf7b95e72d3efe46a3102..58b33ece4fcd655f4f22891548b06c61e5837335 100644 (file)
@@ -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
 
index 037aa7979c10e6fe50c6f34d4993a55630f2985e..c0675c446592d62e57dadfd2350673047a40842b 100644 (file)
@@ -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