Skip to content

Commit ecc22bf

Browse files
authored
Merge pull request #133 from garlick/diod_init
tighten up diod configuration and initialization
2 parents fb78bf2 + 9126275 commit ecc22bf

File tree

11 files changed

+168
-158
lines changed

11 files changed

+168
-158
lines changed

configure.ac

+33-46
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ AC_PROG_RANLIB
4545
m4_ifndef([PKG_PROG_PKG_CONFIG],
4646
[AC_MSG_ERROR([PKG_PROG_PKG_CONFIG not found, please install pkgconf package before configuring.])])
4747

48+
##
49+
# Initialize pkg-config for PKG_CHECK_MODULES to avoid conditional issues
50+
##
51+
PKG_PROG_PKG_CONFIG
52+
4853
##
4954
# Checks for ncurses
5055
##
@@ -75,8 +80,6 @@ AC_CHECK_FUNCS( \
7580
)
7681
AC_FUNC_STRERROR_R
7782
X_AC_CHECK_PTHREADS
78-
X_AC_CHECK_COND_LIB(munge, munge_ctx_create)
79-
X_AC_CHECK_COND_LIB(cap, cap_get_proc)
8083
X_AC_TCMALLOC
8184
X_AC_RDMA
8285

@@ -95,10 +98,32 @@ AC_SYS_LARGEFILE
9598
AC_ARG_ENABLE([diodmount],
9699
[AS_HELP_STRING([--disable-diodmount], [do not build diodmount])])
97100

98-
AC_ARG_ENABLE([impersonation],
99-
[AS_HELP_STRING([--enable-impersonation], [allow access=user])],
100-
[],
101-
[enable_impersonation=auto])
101+
AC_ARG_ENABLE([multiuser],
102+
[AS_HELP_STRING([--disable-multiuser], [build without multi-user support])])
103+
104+
AC_ARG_ENABLE([auth],
105+
[AS_HELP_STRING([--disable-auth], [build without authentication support])])
106+
107+
AC_ARG_WITH([ganesha-kmod],
108+
[AS_HELP_STRING([--with-ganesha-kmod], [use nfs-ganesha-kmod syscalls for multi-user])])
109+
110+
AS_IF([test "x$with_ganesha_kmod" = "xyes"], [
111+
AC_DEFINE([USE_GANESHA_KMOD], [1], [Use nfs-ganesha-kmod syscalls])
112+
])
113+
114+
AS_IF([test "x$enable_auth" != "xno"], [
115+
PKG_CHECK_MODULES([MUNGE], [munge], [], [
116+
AC_MSG_ERROR([Install munge or configure with --disable-auth])
117+
])
118+
AC_DEFINE([AUTH], [1], [Support MUNGE authentication])
119+
])
120+
121+
AS_IF([test "x$enable_multiuser" != "xno"], [
122+
PKG_CHECK_MODULES([CAP], [libcap], [], [
123+
AC_MSG_ERROR([Install libcap or configure with --disable-multiuser])
124+
])
125+
AC_DEFINE([MULTIUSER], [1], [service files to multiple users])
126+
])
102127

103128
AC_ARG_ENABLE([config],
104129
[AS_HELP_STRING([--disable-config], [disable lua config file support])])
@@ -114,47 +139,9 @@ AS_IF([test "x$enable_config" != "xno"], [
114139
AC_DEFINE([HAVE_CONFIG_FILE], [1], [lua config file support])
115140
])
116141

117-
case "${host_os}" in
118-
linux*)
119-
case "${enable_impersonation}" in
120-
no)
121-
;;
122-
yes|linux|auto)
123-
enable_impersonation=linux;;
124-
*)
125-
AC_MSG_FAILURE([unsupported impersonation model]);;
126-
esac
127-
;;
128-
freebsd*)
129-
case "${enable_impersonation}" in
130-
no|auto)
131-
enable_impersonation=no;;
132-
yes|ganesha)
133-
enable_impersonation=ganesha;;
134-
*)
135-
AC_MSG_FAILURE([unsupported impersonation model]);;
136-
esac
137-
;;
138-
*)
139-
case "${enable_impersonation}" in
140-
no|auto)
141-
enable_impersonation=no;;
142-
*)
143-
AC_MSG_FAILURE([unsupported impersonation model]);;
144-
esac
145-
;;
146-
esac
147-
148142
AM_CONDITIONAL([ENABLE_DIODMOUNT], [test "x${enable_diodmount}" != "xno"])
149-
AM_CONDITIONAL([USE_IMPERSONATION_LINUX], [test "x${enable_impersonation}" = "xlinux"])
150-
AM_CONDITIONAL([USE_IMPERSONATION_GANESHA], [test "x${enable_impersonation}" = "xganesha"])
151-
152-
if test "x${enable_impersonation}" = "xlinux"; then
153-
AC_DEFINE([USE_IMPERSONATION_LINUX], [1], [Use Linux setfsuid])
154-
fi
155-
if test "x${enable_impersonation}" = "xganesha"; then
156-
AC_DEFINE([USE_IMPERSONATION_GANESHA], [1], [Use nfs-ganesha-kmod syscalls])
157-
fi
143+
AM_CONDITIONAL([MULTIUSER], [test "x${enable_multiuser}" != "xno"])
144+
AM_CONDITIONAL([USE_GANESHA_KMOD], [test "x${with_ganesha_kmod}" = "xyes"])
158145

159146
##
160147
# Check for systemd

src/cmd/Makefile.am

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ AM_CFLAGS = @WARNING_CFLAGS@
22

33
AM_CPPFLAGS = \
44
-I$(top_srcdir) \
5+
$(MUNGE_CFLAGS) \
6+
$(CAP_CFLAGS) \
57
$(LUA_INCLUDE)
68
AM_CPPFLAGS += $(ncurses_CPPFLAGS)
79

@@ -17,7 +19,7 @@ common_ldadd = \
1719
$(top_builddir)/src/libnpfs/libnpfs.a \
1820
$(top_builddir)/src/liblsd/liblsd.a \
1921
$(top_builddir)/src/libdiod/libdiod.a \
20-
$(LIBPTHREAD) $(LUA_LIB) $(LIBMUNGE) $(LIBCAP) \
22+
$(LIBPTHREAD) $(LUA_LIB) $(MUNGE_LIBS) $(CAP_LIBS) \
2123
$(LIBIBVERBS) $(LIBRDMACM) $(LIBTCMALLOC) $(ncurses_LIBS)
2224

2325
common_sources = \

0 commit comments

Comments
 (0)