]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: Add flag for enabling/disabling libuser support.
authorCody Maloney <cmaloney@theoreticalchaos.com>
Thu, 7 Feb 2013 06:22:18 +0000 (23:22 -0700)
committerKarel Zak <kzak@redhat.com>
Wed, 13 Feb 2013 08:17:34 +0000 (09:17 +0100)
Signed-off-by: Cody Maloney <cmaloney@theoreticalchaos.com>
configure.ac
login-utils/Makemodule.am

index d26a686b02070dc97395e46ccd6cd8600e2c88f0..cf6e92210402f3a0a27c1f6f3f7c25daf690d310 100644 (file)
@@ -1126,6 +1126,23 @@ AS_HELP_STRING([--disable-chsh-only-listed], [chsh: allow shells not in /etc/she
 [], enable_chsh_only_listed=yes
 )
 
+AC_ARG_WITH([libuser], AS_HELP_STRING([--without-libuser], [compile without libuser (remote chsh)]),
+  [], with_user=auto
+)
+
+if test "x$with_user" = xno; then
+  AM_CONDITIONAL(HAVE_USER, false)
+else
+  PKG_CHECK_MODULES(LIBUSER,[libuser >= 0.58])
+  UL_CHECK_LIB(user, lu_start)
+  case "$with_user:$have_user" in
+  yes:no)
+   AC_MSG_ERROR([user selected but libuser not found])
+   ;;
+  esac
+fi
+
+
 if test "x$enable_chsh_only_listed" = xyes; then
 AC_DEFINE(ONLY_LISTED_SHELLS, 1, [Should chsh allow only shells in /etc/shells?])
 fi
index aef81771c3a4ae8359682ed6b5b7d4f16df4dc0a..479b87b0fb3c9783b4da62edfd365b249b874495 100644 (file)
@@ -68,6 +68,11 @@ chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
 chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 chfn_chsh_ldadd = libcommon.la -lpam -lpam_misc
 
+if HAVE_USER
+chfn_chsh_ldflags += $(LIBUSER_LIBS)
+chfn_chsh_cflags += $(LIBUSER_CFLAGS)
+endif
+
 if HAVE_SELINUX
 chfn_chsh_sources += \
        login-utils/selinux_utils.c \