1
0
mirror of https://git.savannah.gnu.org/git/coreutils.git synced 2025-08-10 05:43:02 +03:00

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.
This commit is contained in:
Jim Meyering
2007-07-12 20:58:53 +02:00
parent 13b2b9c342
commit cee14cc42f
3 changed files with 35 additions and 7 deletions

View File

@@ -1,5 +1,14 @@
2007-07-12 Jim Meyering <jim@meyering.net> 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. Clean up include-exclude-prog.m4.
* m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN. * m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN.
(gl_REMOVE_PROG): Likewise. (gl_REMOVE_PROG): Likewise.

View File

@@ -249,32 +249,51 @@ if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
fi fi
############################################################################ ############################################################################
mk="$srcdir/src/Makefile.am"
# Extract all literal names from the definition of $(EXTRA_PROGRAMS) # 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. # Append each literal name to $optional_bin_progs.
v=EXTRA_PROGRAMS 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' \ | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
| tr -s '\012\\' ' '`; do | tr -s '\012\\' ' '`; do
gl_ADD_PROG([optional_bin_progs], $gl_i) gl_ADD_PROG([optional_bin_progs], $gl_i)
done done
# As above, extract literal names from the definition of $(no_install__progs) # 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 v=no_install__progs
t=`sed -n '/^'$v' =/,/[^\]$/p' $srcdir/src/Makefile.am \ t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
| sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \ | sed 's/^ *//;/^\$.*/d;/^'$v' =/d' \
| tr -s '\012\\' ' '` | tr -s '\012\\' ' '`
# Remove any trailing space. # Remove any trailing space.
no_install_progs_default=`echo "$t"|sed 's/ $//'` 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 # 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 # install-by-default programs and the actual list do-not-install-by-default
# programs, modify the former variable to reflect any "do-install" and # programs, modify the former variable to reflect any "do-install" and
# "don't-install" requests. # "don't-install" requests.
# I.e., add any program name specified via --enable-install-program=..., and # I.e., add any program name specified via --enable-install-program=..., and
# remove any program name specified via --enable-no-install-program=... # 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 # Set INSTALL_SU if su installation has been requested via
# --enable-install-program=su. # --enable-install-program=su.

View File

@@ -43,8 +43,8 @@ AC_DEFUN([gl_INCLUDE_EXCLUDE_PROG],
# use --enable-no-install-program=A,B # use --enable-no-install-program=A,B
AC_ARG_ENABLE([no-install-program], AC_ARG_ENABLE([no-install-program],
[AS_HELP_STRING([--enable-no-install-program=PROG_LIST], [AS_HELP_STRING([--enable-no-install-program=PROG_LIST],
[do NOT install the programs in PROG_LIST (comma-separated, [do NOT install the programs in PROG_LIST
default: $gl_no_install_progs_default)])], (comma-separated, default: $2)])],
[gl_no_install_prog=$enableval], [gl_no_install_prog=$enableval],
[gl_no_install_prog=] [gl_no_install_prog=]
) )