]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: add --enable-chfn-chsh
authorKarel Zak <kzak@redhat.com>
Tue, 29 May 2012 12:41:01 +0000 (14:41 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 29 May 2012 12:41:01 +0000 (14:41 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
login-utils/Makefile.am

index 83d4c6d4b8acbd1d9c741617eaee223b233e6dbf..03832a25409f8ce9a0575ae0997210386796cc9b 100644 (file)
@@ -636,6 +636,7 @@ if test "x$enable_most_builds" = xyes; then
   enable_mesg=yes
   enable_reset=yes
   enable_login_utils=yes
+  enable_chfn_chsh=yes
   enable_write=yes
 fi
 
@@ -1019,7 +1020,7 @@ AM_CONDITIONAL(BUILD_RESET, test "x$build_reset" = xyes)
 
 
 AC_ARG_ENABLE([login-utils],
-  AS_HELP_STRING([--enable-login-utils], [build chfn, chsh, newgrp, vipw]),
+  AS_HELP_STRING([--enable-login-utils], [build newgrp, vipw]),
   [], enable_login_utils=no
 )
 UL_BUILD_INIT([login_utils])
@@ -1027,6 +1028,15 @@ UL_REQUIRES_HAVE([login_utils], [security_pam_misc_h], [PAM header file])
 AM_CONDITIONAL(BUILD_LOGIN_UTILS, test "x$build_login_utils" = xyes)
 
 
+AC_ARG_ENABLE([chfn-chsh],
+  AS_HELP_STRING([--enable-chfn-chsh], [build chfn and chsh]),
+  [], enable_chfn_chsh=no
+)
+UL_BUILD_INIT([chfn_chsh])
+UL_REQUIRES_HAVE([chfn_chsh], [security_pam_misc_h], [PAM header file])
+AM_CONDITIONAL(BUILD_CHFN_CHSH, test "x$build_chfn_chsh" = xyes)
+
+
 AC_ARG_ENABLE([login],
   AS_HELP_STRING([--disable-login], [do not build login]),
   [], enable_login=yes
index 4d1bf53bd4887717922e0bf60a55b89c5f71c74d..0e441b4d7375327ad61f5efb596de442a0c4ffed 100644 (file)
@@ -44,37 +44,53 @@ endif
 endif # BUILD_LOGIN
 
 
+if BUILD_CHFN_CHSH
+usrbin_exec_PROGRAMS += chfn chsh
+dist_man_MANS += chfn.1 chsh.1
+
+chfn_chsh_sources = \
+       islocal.c \
+       islocal.h \
+       setpwnam.c \
+       setpwnam.h \
+       $(top_srcdir)/lib/env.c \
+       $(top_srcdir)/lib/fileutils.c
+
+chfn_chsh_cflags = $(SUID_CFLAGS) $(AM_CFLAGS)
+chfn_chsh_ldflags = $(SUID_LDFLAGS) $(AM_LDFLAGS)
+chfn_chsh_ldadd = -lpam -lpam_misc
+
+if HAVE_SELINUX
+chfn_chsh_sources += selinux_utils.c selinux_utils.h
+chfn_chsh_ldadd += -lselinux
+endif
+
+chfn_SOURCES = chfn.c $(chfn_chsh_sources)
+chfn_CFLAGS = $(chfn_chsh_cflags)
+chfn_LDFLAGS = $(chfn_chsh_ldflags)
+chfn_LDADD = $(chfn_chsh_ldadd)
+
+chsh_SOURCES = chfn.c $(chfn_chsh_sources)
+chsh_CFLAGS = $(chfn_chsh_cflags)
+chsh_LDFLAGS = $(chfn_chsh_ldflags)
+chsh_LDADD = $(chfn_chsh_ldadd)
+endif # BUILD_CHFN_CHSH
+
+
 if BUILD_LOGIN_UTILS
 bin_PROGRAMS += su
 usrbin_exec_PROGRAMS += \
-       chfn \
-       chsh \
        newgrp
 usrsbin_exec_PROGRAMS += \
        vipw
 dist_man_MANS += \
-       chfn.1 \
-       chsh.1 \
        newgrp.1 \
        vigr.8 \
        vipw.8
 
-# login, su, chfn and chsh libs
+# su 
 login_ldadd_common =
 
-chfn_SOURCES = \
-       chfn.c \
-       $(chfn_chsh_common)
-chsh_SOURCES = \
-       chsh.c \
-       $(chfn_chsh_common)
-chfn_chsh_common = \
-       islocal.c \
-       islocal.h \
-       setpwnam.c \
-       setpwnam.h \
-       $(top_srcdir)/lib/env.c \
-       $(top_srcdir)/lib/fileutils.c
 vipw_SOURCES = \
        vipw.c \
        setpwnam.h \
@@ -84,19 +100,13 @@ su_SOURCES = \
        logindefs.c \
        logindefs.h
 
-chfn_LDADD = $(login_ldadd_common)
-chsh_LDADD = $(login_ldadd_common)
 su_LDADD = $(login_ldadd_common)
 newgrp_LDADD =
 vipw_LDADD =
 
-chfn_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
-chsh_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 newgrp_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 su_CFLAGS = $(SUID_CFLAGS) $(AM_CFLAGS)
 
-chfn_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
-chsh_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 newgrp_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 su_LDFLAGS = $(SUID_LDFLAGS) $(AM_LDFLAGS)
 
@@ -108,8 +118,6 @@ endif
 
 
 if HAVE_SELINUX
-chfn_SOURCES += selinux_utils.c selinux_utils.h
-chsh_SOURCES += selinux_utils.c selinux_utils.h
 vipw_LDADD += -lselinux
 login_ldadd_common += -lselinux
 endif