]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Expand default-no-install prog list in ./configure --help output,
authorJim Meyering <jim@meyering.net>
Thu, 12 Jul 2007 18:58:53 +0000 (20:58 +0200)
committerJim Meyering <jim@meyering.net>
Thu, 12 Jul 2007 18:58:53 +0000 (20:58 +0200)
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.

ChangeLog
configure.ac
m4/include-exclude-prog.m4

index b064df189443c51a4ac3a38813167138fc15f041..a52da5d4ce0fa1b2cdc18e42abc8c7445216855e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index 69236c964fb39329747c8eb6fb3f191b99ab6822..2f9f4cc80fc1960571c80eb8fdd32c6cd22b3af8 100644 (file)
@@ -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.
index 387386dfe7cddb674f1b14e5386d4c3f0ddcaedc..77627ea0e9c254856f0d61933ab1fd2fec4211e1 100644 (file)
@@ -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=]
   )