linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Noam Meltzer <noam@primarydata.com>
To: noam@primarydata.com, linux-nfs@vger.kernel.org,
	sssd-devel@lists.fedorahosted.org
Subject: [PATCH v2 3/5] NFSv4 client: add to build system
Date: Tue,  4 Mar 2014 09:37:54 +0200	[thread overview]
Message-ID: <1393918676-20865-4-git-send-email-noam@primarydata.com> (raw)
In-Reply-To: <1393918676-20865-1-git-send-email-noam@primarydata.com>

---
 Makefile.am                 | 19 +++++++++++++++++++
 configure.ac                | 10 ++++++++++
 src/conf_macros.m4          | 30 ++++++++++++++++++++++++++++++
 src/external/libnfsidmap.m4 | 17 +++++++++++++++++
 4 files changed, 76 insertions(+)
 create mode 100644 src/external/libnfsidmap.m4

diff --git a/Makefile.am b/Makefile.am
index 9f010d9..23f6093 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -47,6 +47,7 @@ localedir = @localedir@
 nsslibdir = @nsslibdir@
 pamlibdir = @pammoddir@
 autofslibdir = @appmodpath@
+nfslibdir = @nfsidmaplibdir@
 
 dbpath = @dbpath@
 pluginpath = @pluginpath@
@@ -526,6 +527,7 @@ dist_noinst_HEADERS = \
     src/tests/cmocka/common_mock_sysdb_objects.h \
     src/sss_client/ssh/sss_ssh_client.h \
     src/sss_client/sudo/sss_sudo.h \
+    src/sss_client/nfs/nfsidmap_internal.h \
     src/lib/idmap/sss_idmap_private.h
 
 
@@ -1666,6 +1668,23 @@ libnss_sss_la_LDFLAGS = \
     -version-info 2:0:0 \
     -Wl,--version-script,$(srcdir)/src/sss_client/sss_nss.exports
 
+
+if BUILD_NFS
+nfslib_LTLIBRARIES = sss_nfs.la
+sss_nfs_la_SOURCES = \
+    src/sss_client/common.c \
+    src/sss_client/nss_mc_common.c \
+    src/util/io.c \
+    src/util/murmurhash3.c \
+    src/sss_client/nss_mc_passwd.c \
+    src/sss_client/nss_mc_group.c \
+    src/sss_client/nfs/sss_nfs_client.c \
+    $(NULL)
+sss_nfs_la_CFLAGS = $(AM_CFLAGS)
+sss_nfs_la_LIBADD = $(CLIENT_LIBS) $(NFSIDMAP_LIBS)
+sss_nfs_la_LDFLAGS = -module -avoid-version
+endif
+
 pamlib_LTLIBRARIES = pam_sss.la
 pam_sss_la_SOURCES = \
     src/sss_client/pam_sss.c \
diff --git a/configure.ac b/configure.ac
index 8295139..b440f92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -91,6 +91,13 @@ AC_ARG_ENABLE([pammoddir], [AS_HELP_STRING([--enable-pammoddir],
               [pammoddir=$libdir/security])
 AC_SUBST(pammoddir)
 
+#Set the NFSv4 idmapd library install path
+AC_ARG_ENABLE([nfsidmaplibdir], [AS_HELP_STRING([--enable-nfsidmaplibdir],
+                                        [Where to install libnfsidmap libraries ($libdir/libnfsidmap)])],
+              [nfsidmaplibdir=$enableval],
+              [nfsidmaplibdir=$libdir/libnfsidmap])
+AC_SUBST(nfsidmaplibdir)
+
 #Include here cause WITH_INIT_DIR requires $osname set in platform.m4
 m4_include([src/external/platform.m4])
 
@@ -127,6 +134,8 @@ WITH_AUTOFS
 WITH_SSH
 WITH_CRYPTO
 WITH_SYSLOG
+WITH_NFS
+WITH_NFS_LIB_PATH
 
 m4_include([src/external/pkg.m4])
 m4_include([src/external/libpopt.m4])
@@ -159,6 +168,7 @@ m4_include([src/external/signal.m4])
 m4_include([src/external/inotify.m4])
 m4_include([src/external/libndr_nbt.m4])
 m4_include([src/external/sasl.m4])
+m4_include([src/external/libnfsidmap.m4])
 
 WITH_UNICODE_LIB
 if test x$unicode_lib = xlibunistring; then
diff --git a/src/conf_macros.m4 b/src/conf_macros.m4
index 7111859..3f59b1f 100644
--- a/src/conf_macros.m4
+++ b/src/conf_macros.m4
@@ -646,3 +646,33 @@ AC_DEFUN([WITH_SSH],
     fi
     AM_CONDITIONAL([BUILD_SSH], [test x"$with_ssh" = xyes])
   ])
+
+  AC_DEFUN([WITH_NFS],
+  [ AC_ARG_WITH([nfs],
+                [AC_HELP_STRING([--with-nfs],
+                                [Whether to build with NFSv4 IDMAP support [yes]]
+                               )
+                ],
+                [with_nfs=$withval],
+                with_nfs=yes
+               )
+
+    if test x"$with_nfs" = xyes; then
+        AC_DEFINE(BUILD_NFS, 1, [whether to build with NFSv4 IDMAP support])
+    fi
+    AM_CONDITIONAL([BUILD_NFS], [test x"$with_nfs" = xyes])
+  ])
+
+AC_DEFUN([WITH_NFS_LIB_PATH],
+  [ AC_ARG_WITH([nfs-lib-path],
+                [AC_HELP_STRING([--with-nfs-lib-path=<path>],
+                                [Path to the nfs library [${libdir}]]
+                               )
+                ]
+               )
+    nfslibpath="${libdir}"
+    if test x"$with_nfs_lib_path" != x; then
+        nfslibpath=$with_nfs_lib_path
+    fi
+    AC_SUBST(nfslibpath)
+  ])
diff --git a/src/external/libnfsidmap.m4 b/src/external/libnfsidmap.m4
new file mode 100644
index 0000000..5bb6d86
--- /dev/null
+++ b/src/external/libnfsidmap.m4
@@ -0,0 +1,17 @@
+AC_SUBST(NFSIDMAP_OBJ)
+AC_SUBST(NFSIDMAP_CFLAGS)
+AC_SUBST(NFSIDMAP_LIBS)
+
+PKG_CHECK_MODULES([NFSIDMAP], [libnfsidmap], [found_nfsidmap=yes],
+		  [found_nfsidmap=no])
+
+SSS_AC_EXPAND_LIB_DIR()
+AS_IF([test x"$with_nfs" = xyes -a x"$found_nfsidmap" != xyes],
+    [AC_CHECK_HEADER([nfsidmap.h],
+        [AC_CHECK_LIB([nfsidmap],
+                      [nfs4_init_name_mapping],
+                      [NFSIDMAP_LIBS="-L$sss_extra_libdir -lnfsidmap"],
+                      [AC_MSG_ERROR([libnfsidmap missing nfs4_init_name_mapping])],
+                      [-L$sss_extra_libdir])],
+        [AC_MSG_ERROR([libnfsidmap header files are not installed])])]
+)
-- 
1.8.5.3


  parent reply	other threads:[~2014-03-04  7:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04  7:37 [PATCH v2 0/5] NFSv4 rpc.idmapd plugin Noam Meltzer
2014-03-04  7:37 ` [PATCH v2 1/5] NEW CLIENT: plugin for NFSv4 rpc.idmapd Noam Meltzer
2014-03-04  7:37 ` [PATCH v2 2/5] NFSv4 client: (private) headers from libnfsidmap Noam Meltzer
2014-03-04  7:37 ` Noam Meltzer [this message]
2014-03-04  7:37 ` [PATCH v2 4/5] NFSv4 client: man page Noam Meltzer
2014-03-04  7:37 ` [PATCH v2 5/5] NFSv4 client: add to RPM spec Noam Meltzer
2014-03-13 15:24 ` [PATCH v2 0/5] NFSv4 rpc.idmapd plugin Steve Dickson
2014-03-13 16:58   ` Simo Sorce
2014-03-13 17:25     ` J. Bruce Fields
2014-03-13 17:41       ` Simo Sorce
     [not found]         ` <1394732462.32465.235.camel-Hs+ccMQdwurzDu64bZtGtWD2FQJk+8+b@public.gmane.org>
2014-03-20  7:33           ` Noam Meltzer
2014-03-20 13:49             ` Steve Dickson
2014-05-27 19:46               ` [SSSD] " Jakub Hrozek
2014-05-27 20:02                 ` Simo Sorce
2014-03-20  7:36         ` Noam Meltzer

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=1393918676-20865-4-git-send-email-noam@primarydata.com \
    --to=noam@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=sssd-devel@lists.fedorahosted.org \
    /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).