summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-07-10 22:37:05 +0200
committerJim Meyering <jim@meyering.net>2007-07-10 22:55:15 +0200
commit471d33582e48a9f9527e231c9bbc575ee9b43e45 (patch)
tree4f5cb28e3e7a614062c4d10c8bb10a998b0e95f5 /src
parent264021699cb9a460ebcdd3d080e88d55c269cc61 (diff)
downloadcoreutils-471d33582e48a9f9527e231c9bbc575ee9b43e45.tar.xz
Add support for enabling/disabling installation of specified programs.
* NEWS: Mention new configure-time options. Mention that neither arch nor su is built/installed, by default. * m4/include-exclude-prog.m4: New file. * configure.ac: Use new macro, gl_ADD_PROG, rather than manually appending to OPTIONAL_BIN_PROGS and MAN. Move the code that adds "df" to the list of programs to build from m4/jm-macros into this file. Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [. (NO_INSTALL_PROGS_DEFAULT): AC_SUBST it. Used by man/Makefile.am. * man/Makefile.am (dist_man_MANS): Remove from this list all man pages corresponding to "bin" programs. Add $(MAN) instead. (optional_mans): Remove all uses. (check-x-vs-1): Adapt to work even though arch and su are typically no longer built (and neither are their .1 files). * src/Makefile.am (install_su): Rename from INSTALL_SU, now that INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am50
1 files changed, 33 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 5a71bb3f6..c01806e08 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,11 +16,21 @@
## along with this program; if not, write to the Free Software Foundation,
## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-EXTRA_PROGRAMS = chroot df hostid nice pinky stty su uname uptime users who \
- arch
-
-bin_SCRIPTS = groups
-bin_PROGRAMS = [ chcon chgrp chown chmod cp dd dircolors du \
+# These are the names of programs that are not installed by default.
+# This list is *not* intended for programs like who, nice, chroot, etc.,
+# that are built only when certain requisite system features are detected.
+# Hence, if you want to install programs from this list anyway, say A and B,
+# use --enable-install-program=A,B
+no_install__progs = \
+ arch su
+
+build_if_possible__progs = \
+ chroot df hostid nice pinky stty su uname uptime users who
+
+EXTRA_PROGRAMS = \
+ $(no_install__progs) \
+ $(build_if_possible__progs) \
+ [ chcon chgrp chown chmod cp dd dircolors du \
ginstall link ln dir vdir ls mkdir \
mkfifo mknod mv nohup readlink rm rmdir shred stat sync touch unlink \
cat cksum comm csplit cut expand fmt fold head join md5sum \
@@ -30,8 +40,10 @@ bin_PROGRAMS = [ chcon chgrp chown chmod cp dd dircolors du \
hostname id kill logname pathchk printenv printf pwd \
runcon seq sleep tee \
test true tty whoami yes \
- base64 \
- $(OPTIONAL_BIN_PROGS) $(DF_PROG)
+ base64
+
+bin_SCRIPTS = groups
+bin_PROGRAMS = $(OPTIONAL_BIN_PROGS)
noinst_PROGRAMS = setuidgid
@@ -148,17 +160,21 @@ installed_su = $(DESTDIR)$(bindir)/`echo su|sed '$(transform)'`
setuid_root_mode = a=rx,u+s
-INSTALL_SU = \
- p=su; \
- echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \
- $(INSTALL_PROGRAM) $$p $(installed_su); \
- echo " chown root $(installed_su)"; \
- chown root $(installed_su); \
- echo " chmod $(setuid_root_mode) $(installed_su)"; \
- chmod $(setuid_root_mode) $(installed_su)
+install_su = \
+ if test "$(INSTALL_SU)" = yes; then \
+ p=su; \
+ echo " $(INSTALL_PROGRAM) $$p $(installed_su)"; \
+ $(INSTALL_PROGRAM) $$p $(installed_su); \
+ echo " chown root $(installed_su)"; \
+ chown root $(installed_su); \
+ echo " chmod $(setuid_root_mode) $(installed_su)"; \
+ chmod $(setuid_root_mode) $(installed_su) \
+ else \
+ :; \
+ fi
install-root: su$(EXEEXT)
- @$(INSTALL_SU)
+ @$(install_su)
install-exec-local: su$(EXEEXT)
@TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \
@@ -172,7 +188,7 @@ install-exec-local: su$(EXEEXT)
&& can_create_suid_root_executable=yes; \
rm -f $$TMPFILE; \
if test $$can_create_suid_root_executable = yes; then \
- $(INSTALL_SU); \
+ $(install_su); \
else \
echo "WARNING: insufficient access; not installing su"; \
echo "NOTE: to install su, run 'make install-root' as root"; \