diff options
author | Jim Meyering <jim@meyering.net> | 2007-07-12 20:58:53 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-07-12 20:58:53 +0200 |
commit | cee14cc42f91f1245b18d3e2e9968e841ff85e50 (patch) | |
tree | f1c66ebb2c54af6c4bbf764e670ecac784848954 | |
parent | 13b2b9c3428f28802dcc98b29e4f6f96771326b8 (diff) | |
download | coreutils-cee14cc42f91f1245b18d3e2e9968e841ff85e50.tar.xz |
Expand default-no-install prog list in ./configure --help output,
and fix some []-quoting bugs in sed expressions.
* configure.ac: Hard-code the list, "arch,su" here as well
as in src/Makefile.am, and ensure the two stay in sync.
* m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2,
rather than the nearly-equivalent shell variable.
Karel Zak reported that ./configure --help's output included
the literal string, $gl_no_install_progs_default.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.ac | 29 | ||||
-rw-r--r-- | m4/include-exclude-prog.m4 | 4 |
3 files changed, 35 insertions, 7 deletions
@@ -1,5 +1,14 @@ 2007-07-12 Jim Meyering <jim@meyering.net> + Expand default-no-install prog list in ./configure --help output, + and fix some []-quoting bugs in sed expressions. + * configure.ac: Hard-code the list, "arch,su" here as well + as in src/Makefile.am, and ensure the two stay in sync. + * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2, + rather than the nearly-equivalent shell variable. + Karel Zak reported that ./configure --help's output included + the literal string, $gl_no_install_progs_default. + Clean up include-exclude-prog.m4. * m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN. (gl_REMOVE_PROG): Likewise. diff --git a/configure.ac b/configure.ac index 69236c964..2f9f4cc80 100644 --- a/configure.ac +++ b/configure.ac @@ -249,32 +249,51 @@ if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then fi ############################################################################ +mk="$srcdir/src/Makefile.am" # Extract all literal names from the definition of $(EXTRA_PROGRAMS) -# in src/Makefile.am, but don't expand the variable references. +# in $mk but don't expand the variable references. # Append each literal name to $optional_bin_progs. v=EXTRA_PROGRAMS -for gl_i in `sed -n '/^'$v' =/,/[^\]$/p' $srcdir/src/Makefile.am \ +for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \ | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ | tr -s '\012\\' ' '`; do gl_ADD_PROG([optional_bin_progs], $gl_i) done # As above, extract literal names from the definition of $(no_install__progs) -# in src/Makefile.am, but don't expand the variable references. +# in $mk but don't expand the variable references. v=no_install__progs -t=`sed -n '/^'$v' =/,/[^\]$/p' $srcdir/src/Makefile.am \ +t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \ | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ | tr -s '\012\\' ' '` # Remove any trailing space. no_install_progs_default=`echo "$t"|sed 's/ $//'` +# Unfortunately, due to the way autoconf's AS_HELP_STRING works, the +# list of default-not-installed programs, "arch,su", must appear in two +# places: in this file below, and in $mk. Simply using comma-separated +# variant of "$no_install_progs_default" cannot work. And we can't +# substitute the names into $mk because automake needs the literals, too. +# The compromise is to ensure that the space-separated list extracted +# above matches the comma-separated list below. +c="$srcdir/configure.ac" +t=`sed -n '/^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])/s//\1/p' $c` +u=`echo "$t"|sed 's/,/ /g'` +case $u in + $no_install_progs_default) ;; + *) AC_MSG_ERROR([[internal error: g'l_INCLUDE_EXCLUDE_PROG's 2nd arg, $t, + does not match the list of default-not-installed programs + ($no_install_progs_default) extracted also recorded in $mk]], + 1) ;; +esac + # Given the name of a variable containing a space-separated list of # install-by-default programs and the actual list do-not-install-by-default # programs, modify the former variable to reflect any "do-install" and # "don't-install" requests. # I.e., add any program name specified via --enable-install-program=..., and # remove any program name specified via --enable-no-install-program=... -gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [$no_install_progs_default]) +gl_INCLUDE_EXCLUDE_PROG([optional_bin_progs], [arch,su]) # Set INSTALL_SU if su installation has been requested via # --enable-install-program=su. diff --git a/m4/include-exclude-prog.m4 b/m4/include-exclude-prog.m4 index 387386dfe..77627ea0e 100644 --- a/m4/include-exclude-prog.m4 +++ b/m4/include-exclude-prog.m4 @@ -43,8 +43,8 @@ AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG], # 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)])], + [do NOT install the programs in PROG_LIST + (comma-separated, default: $2)])], [gl_no_install_prog=$enableval], [gl_no_install_prog=] ) |