summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-08-29 15:18:08 +0200
committerJim Meyering <meyering@redhat.com>2012-08-30 15:21:59 +0200
commit60b01f9f0214b6a5c3e157a2772e4861649296af (patch)
tree96972bb3438e6712d217ec6a28a90ee6bcb58cd8 /configure.ac
parent7e85a52be42082c58f729178618e17c54083221d (diff)
downloadcoreutils-60b01f9f0214b6a5c3e157a2772e4861649296af.tar.xz
maint: simplify definition of $MAN in configure.ac
* configure.ac: Here, by making less use of 'sed' and 'tr' munging, and relying on a smarter and simpler shell loop instead.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac23
1 files changed, 13 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 52918ca6d..bc7520d50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -456,16 +456,19 @@ case " $optional_bin_progs " in
*' stdbuf '*) gl_ADD_PROG([optional_pkglib_progs], [libstdbuf.so]) ;;
esac
-MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'`
-
-# Change "ginstall.1" to "install.1" in $MAN.
-MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \
- | tr '\015\012' ' '; echo`
-
-# Remove [.1, since writing a portable rule for it in man/Makefile.am
-# is not practical. The sed LHS below uses the autoconf quadrigraph
-# representing '['.
-MAN=`echo "$MAN"|sed 's/\@<:@\.1//'`
+MAN=`
+ for p in $optional_bin_progs; do
+ # Change "ginstall.1" to "install.1" in $MAN.
+ test $p = ginstall && p=install
+ # Ignore the "[" program, since writing a portable make rule to
+ # generate its manpage is not practical.
+ dnl Use the autoconf-provided quadrigraph to represent "[",
+ dnl otherwise we will incur in dreadful quoting issues.
+ test x$p = x'@<:@' && continue
+ echo "$p.1"
+ done`
+# Normalize whitespace.
+MAN=`echo $MAN`
OPTIONAL_BIN_PROGS=`echo "$optional_bin_progs "|sed 's/ /\$(EXEEXT) /g;s/ $//'`
AC_SUBST([OPTIONAL_BIN_PROGS])