diff options
author | Jim Meyering <jim@meyering.net> | 2007-07-10 22:37:05 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-07-10 22:55:15 +0200 |
commit | 471d33582e48a9f9527e231c9bbc575ee9b43e45 (patch) | |
tree | 4f5cb28e3e7a614062c4d10c8bb10a998b0e95f5 /m4 | |
parent | 264021699cb9a460ebcdd3d080e88d55c269cc61 (diff) | |
download | coreutils-471d33582e48a9f9527e231c9bbc575ee9b43e45.tar.gz coreutils-471d33582e48a9f9527e231c9bbc575ee9b43e45.tar.bz2 coreutils-471d33582e48a9f9527e231c9bbc575ee9b43e45.zip |
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 'm4')
-rw-r--r-- | m4/include-exclude-prog.m4 | 86 | ||||
-rw-r--r-- | m4/jm-macros.m4 | 10 |
2 files changed, 87 insertions, 9 deletions
diff --git a/m4/include-exclude-prog.m4 b/m4/include-exclude-prog.m4 new file mode 100644 index 000000000..c48c70b67 --- /dev/null +++ b/m4/include-exclude-prog.m4 @@ -0,0 +1,86 @@ +#serial 1 +dnl Copyright (C) 2007 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl From Jim Meyering. + +# Usage: gl_ADD_PROG([prog_list_var_name], [prog_name]) +AC_DEFUN([gl_ADD_PROG], +[{ + $1="$$1 $2" + MAN="$MAN $2.1" +}]) + +# Usage: gl_REMOVE_PROG([prog_list_var_name], [prog_name]) +AC_DEFUN([gl_REMOVE_PROG], +[{ + $1=`echo "$$1"|sed 's/\<'"$1"'//;s/ */ /g'` + MAN=`echo "$MAN"|sed 's/\<'"$1"'\.1//'` +}]) + +# Given the name of a variable containing a space-separated list of +# install-by-default programs and the list of do-not-install-by-default +# programs, modify the former variable to reflect "don't-install" and +# "do-install" requests. +# +# Usage: gl_INCLUDE_EXCLUDE_PROG([prog_list_var_name], [NI_prog1]) +AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG], +[{ + gl_no_install_progs_default=$2 + AC_ARG_ENABLE([install-program], + [AS_HELP_STRING([--enable-install-program=PROG_LIST], + [install the programs in PROG_LIST (comma-separated, + default: none)])], + [gl_do_install_prog=$enableval], + [gl_do_install_prog=] + ) + + # If you want to refrain from installing programs A and B, + # use --enable-no-install-program=A,B + AC_ARG_ENABLE([no-install-program], + [AS_HELP_STRING([--enable-no-install-program=PROG_LIST], + [do NOT install the programs in PROG_LIST (comma-separated, + default: $gl_no_install_progs_default)])], + [gl_no_install_prog=$enableval], + [gl_no_install_prog=] + ) + + # For each not-to-be-installed program name, ensure that it's a + # valid name, remove it from the list of programs to build/install, + # as well as from the list of man pages to install. + extra_programs= + for gl_i in `echo "$gl_no_install_prog"|tr -s , ' '`; do + + # Fail upon a request to install and not-install the same program. + case ",$gl_do_install_prog," in + *",$gl_i,"*) AC_MSG_ERROR(['$gl_i' is both included and excluded]) ;; + esac + + gl_msg= + # Warn about a request not to install a program that is not being + # built (which may be because the systems lacks a required interface). + case " $$1 " in + *" $gl_i "*) gl_REMOVE_PROG([$1], $gl_i) ;; + *) gl_msg="'$gl_i' is already not being installed" ;; + esac + + if test "$gl_msg" = ''; then + # Warn about a request not to install a program that is + # already on the default-no-install list. + case " $gl_no_install_progs_default " in + *" $gl_i "*) gl_msg="by default, '$gl_i' is not installed" ;; + esac + fi + + test "$gl_msg" != '' && AC_MSG_WARN([$gl_msg]) + done + + for gl_i in `echo "$gl_do_install_prog"|tr -s , ' '`; do + case " $gl_no_install_progs_default " in + *" $gl_i "*) gl_ADD_PROG([$1], $gl_i) ;; + *) AC_MSG_WARN(['$gl_i' is not an optionally-installable program]) ;; + esac + done +}]) diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4 index 8ba9aebff..81c7891b5 100644 --- a/m4/jm-macros.m4 +++ b/m4/jm-macros.m4 @@ -2,8 +2,7 @@ dnl Misc type-related macros for coreutils. -# Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software -# Foundation, Inc. +# Copyright (C) 1998, 2000-2007 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,9 +28,7 @@ AC_DEFUN([coreutils_MACROS], AC_SUBST(GNU_PACKAGE) AM_MISSING_PROG(HELP2MAN, help2man) - AC_SUBST(OPTIONAL_BIN_PROGS) AC_SUBST(MAN) - AC_SUBST(DF_PROG) dnl This macro actually runs replacement code. See isc-posix.m4. AC_REQUIRE([AC_ISC_POSIX])dnl @@ -104,11 +101,6 @@ AC_DEFUN([coreutils_MACROS], ]) AC_REQUIRE([AM_LANGINFO_CODESET]) - - # Build df only if there's a point to it. - if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then - DF_PROG='df$(EXEEXT)' - fi ]) AC_DEFUN([gl_CHECK_ALL_HEADERS], |