bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"\.1" entries in Makefile $MAN variable (Solaris 9)


From: Poor Yorick
Subject: "\.1" entries in Makefile $MAN variable (Solaris 9)
Date: Fri, 20 Jun 2008 05:13:19 +0000

installing coreutils-6.12 on SunOS 5.9, with gcc-4.2.2 and gnu ld, Makefile
contains unexpected "\.1" entries in Makefile:


    MAN = uname.1
    chroot.1
    hostid.1
    nice.1
    who.1
    users.1
    pinky.1
    uptime.1
    stty.1
    df.1

    chcon.1
    chgrp.1
    chown.1
    chmod.1
    cp.1
    dd.1
    dircolors.1
    du.1
    \.1
    install.1
    link.1
    ln.1
    dir.1
    vdir.1
    ls.1
    mkdir.1
    \.1
    mkfifo.1
    etc...




It seems there is a chicken and egg problem with the tr command on line 261 of
configure.ac.  One might be installing coreutils on Solaris to get a working
version of "tr", but a working version of "tr" is needed to install coreutils:

    for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
        | sed 's/^  *//;/^\$.*/d;/^'$v' =/d' \
        | tr -s '\\015\\012\\\\' '  '`; do
      gl_ADD_PROG([optional_bin_progs], $gl_i)
    done

With solaris "tr", the following command leaves the backslash in the output.
It seems to have too many backslashes, and the number of spaces in the second
argument of the "tr" command does not match the number of characters in the
first argument:

    bash-2.05$ echo $'foo \\ \012 bar'  | tr -s '\\015\\012\\\\' '  '
    foo \
     bar

In fact, the example above does not even work with gnu tr 6.12:

    bash-2.05b$ echo $'foo \\ \012 bar'  | tr -s '\\015\\012\\\\' '  '
    foo
 bar

but at least it got rid of the backslash.

The following command produces the same usable output on Linux with gnu tr 6.12 
as well as on Solaris with Solaris tr:

    bash-2.05b$ env 
PATH=/grid/gro/vol/gbl_statcomp_devel/x86-32-linux/bin:"$PATH" echo $'foo \\ 
\012 bar'  | tr -s '\015\012\\' '   '
    foo bar

The following patch seems to work:


    --- configure.ac        2008-06-19 21:29:20 -04:00
    +++ configure.ac.new    2008-06-19 21:25:23 -04:00
    @@ -258,7 +258,7 @@
     v=EXTRA_PROGRAMS
     for gl_i in `sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
         | sed 's/^  *//;/^\$.*/d;/^'$v' =/d' \
    -    | tr -s '\\015\\012\\\\' '  '`; do
    +    | tr -s '\015\012\\' '   '`; do
       gl_ADD_PROG([optional_bin_progs], $gl_i)
     done

    @@ -267,7 +267,7 @@
     v=no_install__progs
     t=`sed -n '/^'$v' =/,/[[^\]]$/p' $mk \
         | sed 's/^  *//;/^\$.*/d;/^'$v' =/d' \
    -    | tr -s '\\015\\012\\\\' '   '`
    +    | tr -s '\015\012\\' '   '`
     # Remove any trailing space.
     no_install_progs_default=`echo "$t"|sed 's/ $//'`

    @@ -309,11 +309,11 @@
       *)        INSTALL_SU=no ;;
     esac

    -MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\\015\\012'`
    +MAN=`echo "$optional_bin_progs "|sed 's/ /.1 /g;s/ $//'|tr -d '\015\012'`

     # Change ginstall.1 to "install.h" in $MAN.
     MAN=`for m in $MAN; do test $m = ginstall.1 && m=install.1; echo $m; done \
    -  | tr '\015\012' ' '; echo`
    +  | 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


--
yorick




reply via email to

[Prev in Thread] Current Thread [Next in Thread]