use less ancient versions of autofoo scripts SDL-1.2
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 18 Oct 2018 11:55:14 +0300
branchSDL-1.2
changeset 611b39ee38ead19
parent 609 e14e00a2754d
child 613 89225c8816d6
use less ancient versions of autofoo scripts
depcomp
install-sh
missing
     1.1 --- a/depcomp	Wed Oct 17 01:00:32 2018 +0300
     1.2 +++ b/depcomp	Thu Oct 18 11:55:14 2018 +0300
     1.3 @@ -1,10 +1,9 @@
     1.4  #! /bin/sh
     1.5  # depcomp - compile a program generating dependencies as side-effects
     1.6  
     1.7 -scriptversion=2006-10-15.18
     1.8 +scriptversion=2012-07-12.20; # UTC
     1.9  
    1.10 -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
    1.11 -# Foundation, Inc.
    1.12 +# Copyright (C) 1999-2012 Free Software Foundation, Inc.
    1.13  
    1.14  # This program is free software; you can redistribute it and/or modify
    1.15  # it under the terms of the GNU General Public License as published by
    1.16 @@ -17,9 +16,7 @@
    1.17  # GNU General Public License for more details.
    1.18  
    1.19  # You should have received a copy of the GNU General Public License
    1.20 -# along with this program; if not, write to the Free Software
    1.21 -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    1.22 -# 02110-1301, USA.
    1.23 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.24  
    1.25  # As a special exception to the GNU General Public License, if you
    1.26  # distribute this file as part of a program that contains a
    1.27 @@ -30,7 +27,7 @@
    1.28  
    1.29  case $1 in
    1.30    '')
    1.31 -     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
    1.32 +     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
    1.33       exit 1;
    1.34       ;;
    1.35    -h | --h*)
    1.36 @@ -42,11 +39,11 @@
    1.37  
    1.38  Environment variables:
    1.39    depmode     Dependency tracking mode.
    1.40 -  source      Source file read by `PROGRAMS ARGS'.
    1.41 -  object      Object file output by `PROGRAMS ARGS'.
    1.42 +  source      Source file read by 'PROGRAMS ARGS'.
    1.43 +  object      Object file output by 'PROGRAMS ARGS'.
    1.44    DEPDIR      directory where to store dependencies.
    1.45    depfile     Dependency file to output.
    1.46 -  tmpdepfile  Temporary file to use when outputing dependencies.
    1.47 +  tmpdepfile  Temporary file to use when outputting dependencies.
    1.48    libtool     Whether libtool is used (yes/no).
    1.49  
    1.50  Report bugs to <bug-automake@gnu.org>.
    1.51 @@ -59,6 +56,12 @@
    1.52      ;;
    1.53  esac
    1.54  
    1.55 +# A tabulation character.
    1.56 +tab='	'
    1.57 +# A newline character.
    1.58 +nl='
    1.59 +'
    1.60 +
    1.61  if test -z "$depmode" || test -z "$source" || test -z "$object"; then
    1.62    echo "depcomp: Variables source, object and depmode must be set" 1>&2
    1.63    exit 1
    1.64 @@ -87,6 +90,29 @@
    1.65     depmode=dashmstdout
    1.66  fi
    1.67  
    1.68 +cygpath_u="cygpath -u -f -"
    1.69 +if test "$depmode" = msvcmsys; then
    1.70 +   # This is just like msvisualcpp but w/o cygpath translation.
    1.71 +   # Just convert the backslash-escaped backslashes to single forward
    1.72 +   # slashes to satisfy depend.m4
    1.73 +   cygpath_u='sed s,\\\\,/,g'
    1.74 +   depmode=msvisualcpp
    1.75 +fi
    1.76 +
    1.77 +if test "$depmode" = msvc7msys; then
    1.78 +   # This is just like msvc7 but w/o cygpath translation.
    1.79 +   # Just convert the backslash-escaped backslashes to single forward
    1.80 +   # slashes to satisfy depend.m4
    1.81 +   cygpath_u='sed s,\\\\,/,g'
    1.82 +   depmode=msvc7
    1.83 +fi
    1.84 +
    1.85 +if test "$depmode" = xlc; then
    1.86 +   # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations.
    1.87 +   gccflag=-qmakedep=gcc,-MF
    1.88 +   depmode=gcc
    1.89 +fi
    1.90 +
    1.91  case "$depmode" in
    1.92  gcc3)
    1.93  ## gcc 3 implements dependency tracking that does exactly what
    1.94 @@ -141,20 +167,21 @@
    1.95  ## The second -e expression handles DOS-style file names with drive letters.
    1.96    sed -e 's/^[^:]*: / /' \
    1.97        -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
    1.98 -## This next piece of magic avoids the `deleted header file' problem.
    1.99 +## This next piece of magic avoids the "deleted header file" problem.
   1.100  ## The problem is that when a header file which appears in a .P file
   1.101  ## is deleted, the dependency causes make to die (because there is
   1.102  ## typically no way to rebuild the header).  We avoid this by adding
   1.103  ## dummy dependencies for each header file.  Too bad gcc doesn't do
   1.104  ## this for us directly.
   1.105 -  tr ' ' '
   1.106 -' < "$tmpdepfile" |
   1.107 -## Some versions of gcc put a space before the `:'.  On the theory
   1.108 +  tr ' ' "$nl" < "$tmpdepfile" |
   1.109 +## Some versions of gcc put a space before the ':'.  On the theory
   1.110  ## that the space means something, we add a space to the output as
   1.111 -## well.
   1.112 +## well.  hp depmode also adds that space, but also prefixes the VPATH
   1.113 +## to the object.  Take care to not repeat it in the output.
   1.114  ## Some versions of the HPUX 10.20 sed can't process this invocation
   1.115  ## correctly.  Breaking it into two sed invocations is a workaround.
   1.116 -    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
   1.117 +    sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
   1.118 +      | sed -e 's/$/ :/' >> "$depfile"
   1.119    rm -f "$tmpdepfile"
   1.120    ;;
   1.121  
   1.122 @@ -186,20 +213,17 @@
   1.123      # clever and replace this with sed code, as IRIX sed won't handle
   1.124      # lines with more than a fixed number of characters (4096 in
   1.125      # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
   1.126 -    # the IRIX cc adds comments like `#:fec' to the end of the
   1.127 +    # the IRIX cc adds comments like '#:fec' to the end of the
   1.128      # dependency line.
   1.129 -    tr ' ' '
   1.130 -' < "$tmpdepfile" \
   1.131 +    tr ' ' "$nl" < "$tmpdepfile" \
   1.132      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
   1.133 -    tr '
   1.134 -' ' ' >> $depfile
   1.135 -    echo >> $depfile
   1.136 +    tr "$nl" ' ' >> "$depfile"
   1.137 +    echo >> "$depfile"
   1.138  
   1.139      # The second pass generates a dummy entry for each header file.
   1.140 -    tr ' ' '
   1.141 -' < "$tmpdepfile" \
   1.142 +    tr ' ' "$nl" < "$tmpdepfile" \
   1.143     | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
   1.144 -   >> $depfile
   1.145 +   >> "$depfile"
   1.146    else
   1.147      # The sourcefile does not contain any dependencies, so just
   1.148      # store a dummy comment line, to avoid errors with the Makefile
   1.149 @@ -209,40 +233,51 @@
   1.150    rm -f "$tmpdepfile"
   1.151    ;;
   1.152  
   1.153 +xlc)
   1.154 +  # This case exists only to let depend.m4 do its work.  It works by
   1.155 +  # looking at the text of this script.  This case will never be run,
   1.156 +  # since it is checked for above.
   1.157 +  exit 1
   1.158 +  ;;
   1.159 +
   1.160  aix)
   1.161    # The C for AIX Compiler uses -M and outputs the dependencies
   1.162    # in a .u file.  In older versions, this file always lives in the
   1.163 -  # current directory.  Also, the AIX compiler puts `$object:' at the
   1.164 +  # current directory.  Also, the AIX compiler puts '$object:' at the
   1.165    # start of each line; $object doesn't have directory information.
   1.166    # Version 6 uses the directory in both cases.
   1.167 -  stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
   1.168 -  tmpdepfile="$stripped.u"
   1.169 +  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   1.170 +  test "x$dir" = "x$object" && dir=
   1.171 +  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
   1.172    if test "$libtool" = yes; then
   1.173 +    tmpdepfile1=$dir$base.u
   1.174 +    tmpdepfile2=$base.u
   1.175 +    tmpdepfile3=$dir.libs/$base.u
   1.176      "$@" -Wc,-M
   1.177    else
   1.178 +    tmpdepfile1=$dir$base.u
   1.179 +    tmpdepfile2=$dir$base.u
   1.180 +    tmpdepfile3=$dir$base.u
   1.181      "$@" -M
   1.182    fi
   1.183    stat=$?
   1.184  
   1.185 -  if test -f "$tmpdepfile"; then :
   1.186 -  else
   1.187 -    stripped=`echo "$stripped" | sed 's,^.*/,,'`
   1.188 -    tmpdepfile="$stripped.u"
   1.189 -  fi
   1.190 -
   1.191    if test $stat -eq 0; then :
   1.192    else
   1.193 -    rm -f "$tmpdepfile"
   1.194 +    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
   1.195      exit $stat
   1.196    fi
   1.197  
   1.198 +  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
   1.199 +  do
   1.200 +    test -f "$tmpdepfile" && break
   1.201 +  done
   1.202    if test -f "$tmpdepfile"; then
   1.203 -    outname="$stripped.o"
   1.204 -    # Each line is of the form `foo.o: dependent.h'.
   1.205 +    # Each line is of the form 'foo.o: dependent.h'.
   1.206      # Do two passes, one to just change these to
   1.207 -    # `$object: dependent.h' and one to simply `dependent.h:'.
   1.208 -    sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
   1.209 -    sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
   1.210 +    # '$object: dependent.h' and one to simply 'dependent.h:'.
   1.211 +    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
   1.212 +    sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   1.213    else
   1.214      # The sourcefile does not contain any dependencies, so just
   1.215      # store a dummy comment line, to avoid errors with the Makefile
   1.216 @@ -253,23 +288,26 @@
   1.217    ;;
   1.218  
   1.219  icc)
   1.220 -  # Intel's C compiler understands `-MD -MF file'.  However on
   1.221 -  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   1.222 +  # Intel's C compiler anf tcc (Tiny C Compiler) understand '-MD -MF file'.
   1.223 +  # However on
   1.224 +  #    $CC -MD -MF foo.d -c -o sub/foo.o sub/foo.c
   1.225    # ICC 7.0 will fill foo.d with something like
   1.226    #    foo.o: sub/foo.c
   1.227    #    foo.o: sub/foo.h
   1.228 -  # which is wrong.  We want:
   1.229 +  # which is wrong.  We want
   1.230    #    sub/foo.o: sub/foo.c
   1.231    #    sub/foo.o: sub/foo.h
   1.232    #    sub/foo.c:
   1.233    #    sub/foo.h:
   1.234    # ICC 7.1 will output
   1.235    #    foo.o: sub/foo.c sub/foo.h
   1.236 -  # and will wrap long lines using \ :
   1.237 +  # and will wrap long lines using '\':
   1.238    #    foo.o: sub/foo.c ... \
   1.239    #     sub/foo.h ... \
   1.240    #     ...
   1.241 -
   1.242 +  # tcc 0.9.26 (FIXME still under development at the moment of writing)
   1.243 +  # will emit a similar output, but also prepend the continuation lines
   1.244 +  # with horizontal tabulation characters.
   1.245    "$@" -MD -MF "$tmpdepfile"
   1.246    stat=$?
   1.247    if test $stat -eq 0; then :
   1.248 @@ -278,6 +316,85 @@
   1.249      exit $stat
   1.250    fi
   1.251    rm -f "$depfile"
   1.252 +  # Each line is of the form 'foo.o: dependent.h',
   1.253 +  # or 'foo.o: dep1.h dep2.h \', or ' dep3.h dep4.h \'.
   1.254 +  # Do two passes, one to just change these to
   1.255 +  # '$object: dependent.h' and one to simply 'dependent.h:'.
   1.256 +  sed -e "s/^[ $tab][ $tab]*/  /" -e "s,^[^:]*:,$object :," \
   1.257 +    < "$tmpdepfile" > "$depfile"
   1.258 +  sed '
   1.259 +    s/[ '"$tab"'][ '"$tab"']*/ /g
   1.260 +    s/^ *//
   1.261 +    s/ *\\*$//
   1.262 +    s/^[^:]*: *//
   1.263 +    /^$/d
   1.264 +    /:$/d
   1.265 +    s/$/ :/
   1.266 +  ' < "$tmpdepfile" >> "$depfile"
   1.267 +  rm -f "$tmpdepfile"
   1.268 +  ;;
   1.269 +
   1.270 +## The order of this option in the case statement is important, since the
   1.271 +## shell code in configure will try each of these formats in the order
   1.272 +## listed in this file.  A plain '-MD' option would be understood by many
   1.273 +## compilers, so we must ensure this comes after the gcc and icc options.
   1.274 +pgcc)
   1.275 +  # Portland's C compiler understands '-MD'.
   1.276 +  # Will always output deps to 'file.d' where file is the root name of the
   1.277 +  # source file under compilation, even if file resides in a subdirectory.
   1.278 +  # The object file name does not affect the name of the '.d' file.
   1.279 +  # pgcc 10.2 will output
   1.280 +  #    foo.o: sub/foo.c sub/foo.h
   1.281 +  # and will wrap long lines using '\' :
   1.282 +  #    foo.o: sub/foo.c ... \
   1.283 +  #     sub/foo.h ... \
   1.284 +  #     ...
   1.285 +  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   1.286 +  test "x$dir" = "x$object" && dir=
   1.287 +  # Use the source, not the object, to determine the base name, since
   1.288 +  # that's sadly what pgcc will do too.
   1.289 +  base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
   1.290 +  tmpdepfile="$base.d"
   1.291 +
   1.292 +  # For projects that build the same source file twice into different object
   1.293 +  # files, the pgcc approach of using the *source* file root name can cause
   1.294 +  # problems in parallel builds.  Use a locking strategy to avoid stomping on
   1.295 +  # the same $tmpdepfile.
   1.296 +  lockdir="$base.d-lock"
   1.297 +  trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
   1.298 +  numtries=100
   1.299 +  i=$numtries
   1.300 +  while test $i -gt 0 ; do
   1.301 +    # mkdir is a portable test-and-set.
   1.302 +    if mkdir $lockdir 2>/dev/null; then
   1.303 +      # This process acquired the lock.
   1.304 +      "$@" -MD
   1.305 +      stat=$?
   1.306 +      # Release the lock.
   1.307 +      rm -rf $lockdir
   1.308 +      break
   1.309 +    else
   1.310 +      ## the lock is being held by a different process,
   1.311 +      ## wait until the winning process is done or we timeout
   1.312 +      while test -d $lockdir && test $i -gt 0; do
   1.313 +        sleep 1
   1.314 +        i=`expr $i - 1`
   1.315 +      done
   1.316 +    fi
   1.317 +    i=`expr $i - 1`
   1.318 +  done
   1.319 +  trap - 1 2 13 15
   1.320 +  if test $i -le 0; then
   1.321 +    echo "$0: failed to acquire lock after $numtries attempts" >&2
   1.322 +    echo "$0: check lockdir '$lockdir'" >&2
   1.323 +    exit 1
   1.324 +  fi
   1.325 +
   1.326 +  if test $stat -ne 0; then
   1.327 +    rm -f "$tmpdepfile"
   1.328 +    exit $stat
   1.329 +  fi
   1.330 +  rm -f "$depfile"
   1.331    # Each line is of the form `foo.o: dependent.h',
   1.332    # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
   1.333    # Do two passes, one to just change these to
   1.334 @@ -322,8 +439,13 @@
   1.335    done
   1.336    if test -f "$tmpdepfile"; then
   1.337      sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
   1.338 -    # Add `dependent.h:' lines.
   1.339 -    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
   1.340 +    # Add 'dependent.h:' lines.
   1.341 +    sed -ne '2,${
   1.342 +	       s/^ *//
   1.343 +	       s/ \\*$//
   1.344 +	       s/$/:/
   1.345 +	       p
   1.346 +	     }' "$tmpdepfile" >> "$depfile"
   1.347    else
   1.348      echo "#dummy" > "$depfile"
   1.349    fi
   1.350 @@ -332,9 +454,9 @@
   1.351  
   1.352  tru64)
   1.353     # The Tru64 compiler uses -MD to generate dependencies as a side
   1.354 -   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
   1.355 +   # effect.  'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
   1.356     # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
   1.357 -   # dependencies in `foo.d' instead, so we check for that too.
   1.358 +   # dependencies in 'foo.d' instead, so we check for that too.
   1.359     # Subdirectories are respected.
   1.360     dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
   1.361     test "x$dir" = "x$object" && dir=
   1.362 @@ -380,14 +502,59 @@
   1.363     done
   1.364     if test -f "$tmpdepfile"; then
   1.365        sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
   1.366 -      # That's a tab and a space in the [].
   1.367 -      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   1.368 +      sed -e 's,^.*\.[a-z]*:['"$tab"' ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
   1.369     else
   1.370        echo "#dummy" > "$depfile"
   1.371     fi
   1.372     rm -f "$tmpdepfile"
   1.373     ;;
   1.374  
   1.375 +msvc7)
   1.376 +  if test "$libtool" = yes; then
   1.377 +    showIncludes=-Wc,-showIncludes
   1.378 +  else
   1.379 +    showIncludes=-showIncludes
   1.380 +  fi
   1.381 +  "$@" $showIncludes > "$tmpdepfile"
   1.382 +  stat=$?
   1.383 +  grep -v '^Note: including file: ' "$tmpdepfile"
   1.384 +  if test "$stat" = 0; then :
   1.385 +  else
   1.386 +    rm -f "$tmpdepfile"
   1.387 +    exit $stat
   1.388 +  fi
   1.389 +  rm -f "$depfile"
   1.390 +  echo "$object : \\" > "$depfile"
   1.391 +  # The first sed program below extracts the file names and escapes
   1.392 +  # backslashes for cygpath.  The second sed program outputs the file
   1.393 +  # name when reading, but also accumulates all include files in the
   1.394 +  # hold buffer in order to output them again at the end.  This only
   1.395 +  # works with sed implementations that can handle large buffers.
   1.396 +  sed < "$tmpdepfile" -n '
   1.397 +/^Note: including file:  *\(.*\)/ {
   1.398 +  s//\1/
   1.399 +  s/\\/\\\\/g
   1.400 +  p
   1.401 +}' | $cygpath_u | sort -u | sed -n '
   1.402 +s/ /\\ /g
   1.403 +s/\(.*\)/'"$tab"'\1 \\/p
   1.404 +s/.\(.*\) \\/\1:/
   1.405 +H
   1.406 +$ {
   1.407 +  s/.*/'"$tab"'/
   1.408 +  G
   1.409 +  p
   1.410 +}' >> "$depfile"
   1.411 +  rm -f "$tmpdepfile"
   1.412 +  ;;
   1.413 +
   1.414 +msvc7msys)
   1.415 +  # This case exists only to let depend.m4 do its work.  It works by
   1.416 +  # looking at the text of this script.  This case will never be run,
   1.417 +  # since it is checked for above.
   1.418 +  exit 1
   1.419 +  ;;
   1.420 +
   1.421  #nosideeffect)
   1.422    # This comment above is used by automake to tell side-effect
   1.423    # dependency tracking mechanisms from slower ones.
   1.424 @@ -399,13 +566,13 @@
   1.425  
   1.426    # Remove the call to Libtool.
   1.427    if test "$libtool" = yes; then
   1.428 -    while test $1 != '--mode=compile'; do
   1.429 +    while test "X$1" != 'X--mode=compile'; do
   1.430        shift
   1.431      done
   1.432      shift
   1.433    fi
   1.434  
   1.435 -  # Remove `-o $object'.
   1.436 +  # Remove '-o $object'.
   1.437    IFS=" "
   1.438    for arg
   1.439    do
   1.440 @@ -425,15 +592,14 @@
   1.441    done
   1.442  
   1.443    test -z "$dashmflag" && dashmflag=-M
   1.444 -  # Require at least two characters before searching for `:'
   1.445 +  # Require at least two characters before searching for ':'
   1.446    # in the target name.  This is to cope with DOS-style filenames:
   1.447 -  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
   1.448 +  # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
   1.449    "$@" $dashmflag |
   1.450 -    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
   1.451 +    sed 's:^['"$tab"' ]*[^:'"$tab"' ][^:][^:]*\:['"$tab"' ]*:'"$object"'\: :' > "$tmpdepfile"
   1.452    rm -f "$depfile"
   1.453    cat < "$tmpdepfile" > "$depfile"
   1.454 -  tr ' ' '
   1.455 -' < "$tmpdepfile" | \
   1.456 +  tr ' ' "$nl" < "$tmpdepfile" | \
   1.457  ## Some versions of the HPUX 10.20 sed can't process this invocation
   1.458  ## correctly.  Breaking it into two sed invocations is a workaround.
   1.459      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
   1.460 @@ -450,38 +616,46 @@
   1.461    "$@" || exit $?
   1.462    # Remove any Libtool call
   1.463    if test "$libtool" = yes; then
   1.464 -    while test $1 != '--mode=compile'; do
   1.465 +    while test "X$1" != 'X--mode=compile'; do
   1.466        shift
   1.467      done
   1.468      shift
   1.469    fi
   1.470    # X makedepend
   1.471    shift
   1.472 -  cleared=no
   1.473 -  for arg in "$@"; do
   1.474 +  cleared=no eat=no
   1.475 +  for arg
   1.476 +  do
   1.477      case $cleared in
   1.478      no)
   1.479        set ""; shift
   1.480        cleared=yes ;;
   1.481      esac
   1.482 +    if test $eat = yes; then
   1.483 +      eat=no
   1.484 +      continue
   1.485 +    fi
   1.486      case "$arg" in
   1.487      -D*|-I*)
   1.488        set fnord "$@" "$arg"; shift ;;
   1.489      # Strip any option that makedepend may not understand.  Remove
   1.490      # the object too, otherwise makedepend will parse it as a source file.
   1.491 +    -arch)
   1.492 +      eat=yes ;;
   1.493      -*|$object)
   1.494        ;;
   1.495      *)
   1.496        set fnord "$@" "$arg"; shift ;;
   1.497      esac
   1.498    done
   1.499 -  obj_suffix="`echo $object | sed 's/^.*\././'`"
   1.500 +  obj_suffix=`echo "$object" | sed 's/^.*\././'`
   1.501    touch "$tmpdepfile"
   1.502    ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
   1.503    rm -f "$depfile"
   1.504 -  cat < "$tmpdepfile" > "$depfile"
   1.505 -  sed '1,2d' "$tmpdepfile" | tr ' ' '
   1.506 -' | \
   1.507 +  # makedepend may prepend the VPATH from the source file name to the object.
   1.508 +  # No need to regex-escape $object, excess matching of '.' is harmless.
   1.509 +  sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
   1.510 +  sed '1,2d' "$tmpdepfile" | tr ' ' "$nl" | \
   1.511  ## Some versions of the HPUX 10.20 sed can't process this invocation
   1.512  ## correctly.  Breaking it into two sed invocations is a workaround.
   1.513      sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
   1.514 @@ -495,13 +669,13 @@
   1.515  
   1.516    # Remove the call to Libtool.
   1.517    if test "$libtool" = yes; then
   1.518 -    while test $1 != '--mode=compile'; do
   1.519 +    while test "X$1" != 'X--mode=compile'; do
   1.520        shift
   1.521      done
   1.522      shift
   1.523    fi
   1.524  
   1.525 -  # Remove `-o $object'.
   1.526 +  # Remove '-o $object'.
   1.527    IFS=" "
   1.528    for arg
   1.529    do
   1.530 @@ -533,13 +707,27 @@
   1.531  
   1.532  msvisualcpp)
   1.533    # Important note: in order to support this mode, a compiler *must*
   1.534 -  # always write the preprocessed file to stdout, regardless of -o,
   1.535 -  # because we must use -o when running libtool.
   1.536 +  # always write the preprocessed file to stdout.
   1.537    "$@" || exit $?
   1.538 +
   1.539 +  # Remove the call to Libtool.
   1.540 +  if test "$libtool" = yes; then
   1.541 +    while test "X$1" != 'X--mode=compile'; do
   1.542 +      shift
   1.543 +    done
   1.544 +    shift
   1.545 +  fi
   1.546 +
   1.547    IFS=" "
   1.548    for arg
   1.549    do
   1.550      case "$arg" in
   1.551 +    -o)
   1.552 +      shift
   1.553 +      ;;
   1.554 +    $object)
   1.555 +      shift
   1.556 +      ;;
   1.557      "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
   1.558  	set fnord "$@"
   1.559  	shift
   1.560 @@ -552,16 +740,23 @@
   1.561  	;;
   1.562      esac
   1.563    done
   1.564 -  "$@" -E |
   1.565 -  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
   1.566 +  "$@" -E 2>/dev/null |
   1.567 +  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
   1.568    rm -f "$depfile"
   1.569    echo "$object : \\" > "$depfile"
   1.570 -  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
   1.571 -  echo "	" >> "$depfile"
   1.572 -  . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   1.573 +  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
   1.574 +  echo "$tab" >> "$depfile"
   1.575 +  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
   1.576    rm -f "$tmpdepfile"
   1.577    ;;
   1.578  
   1.579 +msvcmsys)
   1.580 +  # This case exists only to let depend.m4 do its work.  It works by
   1.581 +  # looking at the text of this script.  This case will never be run,
   1.582 +  # since it is checked for above.
   1.583 +  exit 1
   1.584 +  ;;
   1.585 +
   1.586  none)
   1.587    exec "$@"
   1.588    ;;
   1.589 @@ -580,5 +775,6 @@
   1.590  # eval: (add-hook 'write-file-hooks 'time-stamp)
   1.591  # time-stamp-start: "scriptversion="
   1.592  # time-stamp-format: "%:y-%02m-%02d.%02H"
   1.593 -# time-stamp-end: "$"
   1.594 +# time-stamp-time-zone: "UTC"
   1.595 +# time-stamp-end: "; # UTC"
   1.596  # End:
     2.1 --- a/install-sh	Wed Oct 17 01:00:32 2018 +0300
     2.2 +++ b/install-sh	Thu Oct 18 11:55:14 2018 +0300
     2.3 @@ -1,7 +1,7 @@
     2.4  #!/bin/sh
     2.5  # install - install a program, script, or datafile
     2.6  
     2.7 -scriptversion=2006-10-14.15
     2.8 +scriptversion=2011-11-20.07; # UTC
     2.9  
    2.10  # This originates from X11R5 (mit/util/scripts/install.sh), which was
    2.11  # later released in X11R6 (xc/config/util/install.sh) with the
    2.12 @@ -35,7 +35,7 @@
    2.13  # FSF changes to this file are in the public domain.
    2.14  #
    2.15  # Calling this script install-sh is preferred over install.sh, to prevent
    2.16 -# `make' implicit rules from creating a file called install from it
    2.17 +# 'make' implicit rules from creating a file called install from it
    2.18  # when there is no Makefile.
    2.19  #
    2.20  # This script is compatible with the BSD install script, but was written
    2.21 @@ -48,7 +48,7 @@
    2.22  # set DOITPROG to echo to test this script
    2.23  
    2.24  # Don't use :- since 4.3BSD and earlier shells don't like it.
    2.25 -doit="${DOITPROG-}"
    2.26 +doit=${DOITPROG-}
    2.27  if test -z "$doit"; then
    2.28    doit_exec=exec
    2.29  else
    2.30 @@ -58,34 +58,49 @@
    2.31  # Put in absolute file names if you don't have them in your path;
    2.32  # or use environment vars.
    2.33  
    2.34 -mvprog="${MVPROG-mv}"
    2.35 -cpprog="${CPPROG-cp}"
    2.36 -chmodprog="${CHMODPROG-chmod}"
    2.37 -chownprog="${CHOWNPROG-chown}"
    2.38 -chgrpprog="${CHGRPPROG-chgrp}"
    2.39 -stripprog="${STRIPPROG-strip}"
    2.40 -rmprog="${RMPROG-rm}"
    2.41 -mkdirprog="${MKDIRPROG-mkdir}"
    2.42 +chgrpprog=${CHGRPPROG-chgrp}
    2.43 +chmodprog=${CHMODPROG-chmod}
    2.44 +chownprog=${CHOWNPROG-chown}
    2.45 +cmpprog=${CMPPROG-cmp}
    2.46 +cpprog=${CPPROG-cp}
    2.47 +mkdirprog=${MKDIRPROG-mkdir}
    2.48 +mvprog=${MVPROG-mv}
    2.49 +rmprog=${RMPROG-rm}
    2.50 +stripprog=${STRIPPROG-strip}
    2.51  
    2.52 -posix_glob=
    2.53 +posix_glob='?'
    2.54 +initialize_posix_glob='
    2.55 +  test "$posix_glob" != "?" || {
    2.56 +    if (set -f) 2>/dev/null; then
    2.57 +      posix_glob=
    2.58 +    else
    2.59 +      posix_glob=:
    2.60 +    fi
    2.61 +  }
    2.62 +'
    2.63 +
    2.64  posix_mkdir=
    2.65  
    2.66  # Desired mode of installed file.
    2.67  mode=0755
    2.68  
    2.69 +chgrpcmd=
    2.70  chmodcmd=$chmodprog
    2.71  chowncmd=
    2.72 -chgrpcmd=
    2.73 +mvcmd=$mvprog
    2.74 +rmcmd="$rmprog -f"
    2.75  stripcmd=
    2.76 -rmcmd="$rmprog -f"
    2.77 -mvcmd="$mvprog"
    2.78 +
    2.79  src=
    2.80  dst=
    2.81  dir_arg=
    2.82 -dstarg=
    2.83 +dst_arg=
    2.84 +
    2.85 +copy_on_change=false
    2.86  no_target_directory=
    2.87  
    2.88 -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    2.89 +usage="\
    2.90 +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
    2.91     or: $0 [OPTION]... SRCFILES... DIRECTORY
    2.92     or: $0 [OPTION]... -t DIRECTORY SRCFILES...
    2.93     or: $0 [OPTION]... -d DIRECTORIES...
    2.94 @@ -95,65 +110,59 @@
    2.95  In the 4th, create DIRECTORIES.
    2.96  
    2.97  Options:
    2.98 --c         (ignored)
    2.99 --d         create directories instead of installing files.
   2.100 --g GROUP   $chgrpprog installed files to GROUP.
   2.101 --m MODE    $chmodprog installed files to MODE.
   2.102 --o USER    $chownprog installed files to USER.
   2.103 --s         $stripprog installed files.
   2.104 --t DIRECTORY  install into DIRECTORY.
   2.105 --T         report an error if DSTFILE is a directory.
   2.106 ---help     display this help and exit.
   2.107 ---version  display version info and exit.
   2.108 +     --help     display this help and exit.
   2.109 +     --version  display version info and exit.
   2.110 +
   2.111 +  -c            (ignored)
   2.112 +  -C            install only if different (preserve the last data modification time)
   2.113 +  -d            create directories instead of installing files.
   2.114 +  -g GROUP      $chgrpprog installed files to GROUP.
   2.115 +  -m MODE       $chmodprog installed files to MODE.
   2.116 +  -o USER       $chownprog installed files to USER.
   2.117 +  -s            $stripprog installed files.
   2.118 +  -t DIRECTORY  install into DIRECTORY.
   2.119 +  -T            report an error if DSTFILE is a directory.
   2.120  
   2.121  Environment variables override the default commands:
   2.122 -  CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
   2.123 +  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   2.124 +  RMPROG STRIPPROG
   2.125  "
   2.126  
   2.127  while test $# -ne 0; do
   2.128    case $1 in
   2.129 -    -c) shift
   2.130 -        continue;;
   2.131 +    -c) ;;
   2.132  
   2.133 -    -d) dir_arg=true
   2.134 -        shift
   2.135 -        continue;;
   2.136 +    -C) copy_on_change=true;;
   2.137 +
   2.138 +    -d) dir_arg=true;;
   2.139  
   2.140      -g) chgrpcmd="$chgrpprog $2"
   2.141 -        shift
   2.142 -        shift
   2.143 -        continue;;
   2.144 +	shift;;
   2.145  
   2.146      --help) echo "$usage"; exit $?;;
   2.147  
   2.148      -m) mode=$2
   2.149 -        shift
   2.150 -        shift
   2.151  	case $mode in
   2.152  	  *' '* | *'	'* | *'
   2.153  '*	  | *'*'* | *'?'* | *'['*)
   2.154  	    echo "$0: invalid mode: $mode" >&2
   2.155  	    exit 1;;
   2.156  	esac
   2.157 -        continue;;
   2.158 +	shift;;
   2.159  
   2.160      -o) chowncmd="$chownprog $2"
   2.161 -        shift
   2.162 -        shift
   2.163 -        continue;;
   2.164 +	shift;;
   2.165  
   2.166 -    -s) stripcmd=$stripprog
   2.167 -        shift
   2.168 -        continue;;
   2.169 +    -s) stripcmd=$stripprog;;
   2.170  
   2.171 -    -t) dstarg=$2
   2.172 -	shift
   2.173 -	shift
   2.174 -	continue;;
   2.175 +    -t) dst_arg=$2
   2.176 +	# Protect names problematic for 'test' and other utilities.
   2.177 +	case $dst_arg in
   2.178 +	  -* | [=\(\)!]) dst_arg=./$dst_arg;;
   2.179 +	esac
   2.180 +	shift;;
   2.181  
   2.182 -    -T) no_target_directory=true
   2.183 -	shift
   2.184 -	continue;;
   2.185 +    -T) no_target_directory=true;;
   2.186  
   2.187      --version) echo "$0 $scriptversion"; exit $?;;
   2.188  
   2.189 @@ -165,21 +174,26 @@
   2.190  
   2.191      *)  break;;
   2.192    esac
   2.193 +  shift
   2.194  done
   2.195  
   2.196 -if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
   2.197 +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
   2.198    # When -d is used, all remaining arguments are directories to create.
   2.199    # When -t is used, the destination is already specified.
   2.200    # Otherwise, the last argument is the destination.  Remove it from $@.
   2.201    for arg
   2.202    do
   2.203 -    if test -n "$dstarg"; then
   2.204 +    if test -n "$dst_arg"; then
   2.205        # $@ is not empty: it contains at least $arg.
   2.206 -      set fnord "$@" "$dstarg"
   2.207 +      set fnord "$@" "$dst_arg"
   2.208        shift # fnord
   2.209      fi
   2.210      shift # arg
   2.211 -    dstarg=$arg
   2.212 +    dst_arg=$arg
   2.213 +    # Protect names problematic for 'test' and other utilities.
   2.214 +    case $dst_arg in
   2.215 +      -* | [=\(\)!]) dst_arg=./$dst_arg;;
   2.216 +    esac
   2.217    done
   2.218  fi
   2.219  
   2.220 @@ -188,13 +202,17 @@
   2.221      echo "$0: no input file specified." >&2
   2.222      exit 1
   2.223    fi
   2.224 -  # It's OK to call `install-sh -d' without argument.
   2.225 +  # It's OK to call 'install-sh -d' without argument.
   2.226    # This can happen when creating conditional directories.
   2.227    exit 0
   2.228  fi
   2.229  
   2.230  if test -z "$dir_arg"; then
   2.231 -  trap '(exit $?); exit' 1 2 13 15
   2.232 +  do_exit='(exit $ret); exit $ret'
   2.233 +  trap "ret=129; $do_exit" 1
   2.234 +  trap "ret=130; $do_exit" 2
   2.235 +  trap "ret=141; $do_exit" 13
   2.236 +  trap "ret=143; $do_exit" 15
   2.237  
   2.238    # Set umask so as not to create temps with too-generous modes.
   2.239    # However, 'strip' requires both read and write access to temps.
   2.240 @@ -222,9 +240,9 @@
   2.241  
   2.242  for src
   2.243  do
   2.244 -  # Protect names starting with `-'.
   2.245 +  # Protect names problematic for 'test' and other utilities.
   2.246    case $src in
   2.247 -    -*) src=./$src ;;
   2.248 +    -* | [=\(\)!]) src=./$src;;
   2.249    esac
   2.250  
   2.251    if test -n "$dir_arg"; then
   2.252 @@ -242,22 +260,17 @@
   2.253        exit 1
   2.254      fi
   2.255  
   2.256 -    if test -z "$dstarg"; then
   2.257 +    if test -z "$dst_arg"; then
   2.258        echo "$0: no destination specified." >&2
   2.259        exit 1
   2.260      fi
   2.261 -
   2.262 -    dst=$dstarg
   2.263 -    # Protect names starting with `-'.
   2.264 -    case $dst in
   2.265 -      -*) dst=./$dst ;;
   2.266 -    esac
   2.267 +    dst=$dst_arg
   2.268  
   2.269      # If destination is a directory, append the input filename; won't work
   2.270      # if double slashes aren't ignored.
   2.271      if test -d "$dst"; then
   2.272        if test -n "$no_target_directory"; then
   2.273 -	echo "$0: $dstarg: Is a directory" >&2
   2.274 +	echo "$0: $dst_arg: Is a directory" >&2
   2.275  	exit 1
   2.276        fi
   2.277        dstdir=$dst
   2.278 @@ -341,7 +354,7 @@
   2.279  	      if test -z "$dir_arg" || {
   2.280  		   # Check for POSIX incompatibilities with -m.
   2.281  		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
   2.282 -		   # other-writeable bit of parent directory when it shouldn't.
   2.283 +		   # other-writable bit of parent directory when it shouldn't.
   2.284  		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
   2.285  		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
   2.286  		   case $ls_ld_tmpdir in
   2.287 @@ -378,33 +391,26 @@
   2.288        # directory the slow way, step by step, checking for races as we go.
   2.289  
   2.290        case $dstdir in
   2.291 -	/*) prefix=/ ;;
   2.292 -	-*) prefix=./ ;;
   2.293 -	*)  prefix= ;;
   2.294 +	/*) prefix='/';;
   2.295 +	[-=\(\)!]*) prefix='./';;
   2.296 +	*)  prefix='';;
   2.297        esac
   2.298  
   2.299 -      case $posix_glob in
   2.300 -        '')
   2.301 -	  if (set -f) 2>/dev/null; then
   2.302 -	    posix_glob=true
   2.303 -	  else
   2.304 -	    posix_glob=false
   2.305 -	  fi ;;
   2.306 -      esac
   2.307 +      eval "$initialize_posix_glob"
   2.308  
   2.309        oIFS=$IFS
   2.310        IFS=/
   2.311 -      $posix_glob && set -f
   2.312 +      $posix_glob set -f
   2.313        set fnord $dstdir
   2.314        shift
   2.315 -      $posix_glob && set +f
   2.316 +      $posix_glob set +f
   2.317        IFS=$oIFS
   2.318  
   2.319        prefixes=
   2.320  
   2.321        for d
   2.322        do
   2.323 -	test -z "$d" && continue
   2.324 +	test X"$d" = X && continue
   2.325  
   2.326  	prefix=$prefix$d
   2.327  	if test -d "$prefix"; then
   2.328 @@ -459,41 +465,54 @@
   2.329      # ignore errors from any of these, just make sure not to ignore
   2.330      # errors from the above "$doit $cpprog $src $dsttmp" command.
   2.331      #
   2.332 -    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
   2.333 -      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
   2.334 -      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
   2.335 -      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
   2.336 +    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
   2.337 +    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
   2.338 +    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
   2.339 +    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
   2.340  
   2.341 -    # Now rename the file to the real destination.
   2.342 -    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
   2.343 -      || {
   2.344 -	   # The rename failed, perhaps because mv can't rename something else
   2.345 -	   # to itself, or perhaps because mv is so ancient that it does not
   2.346 -	   # support -f.
   2.347 +    # If -C, don't bother to copy if it wouldn't change the file.
   2.348 +    if $copy_on_change &&
   2.349 +       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
   2.350 +       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
   2.351  
   2.352 -	   # Now remove or move aside any old file at destination location.
   2.353 -	   # We try this two ways since rm can't unlink itself on some
   2.354 -	   # systems and the destination file might be busy for other
   2.355 -	   # reasons.  In this case, the final cleanup might fail but the new
   2.356 -	   # file should still install successfully.
   2.357 -	   {
   2.358 -	     if test -f "$dst"; then
   2.359 -	       $doit $rmcmd -f "$dst" 2>/dev/null \
   2.360 -	       || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
   2.361 -		     && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
   2.362 -	       || {
   2.363 -		 echo "$0: cannot unlink or rename $dst" >&2
   2.364 -		 (exit 1); exit 1
   2.365 -	       }
   2.366 -	     else
   2.367 -	       :
   2.368 -	     fi
   2.369 -	   } &&
   2.370 +       eval "$initialize_posix_glob" &&
   2.371 +       $posix_glob set -f &&
   2.372 +       set X $old && old=:$2:$4:$5:$6 &&
   2.373 +       set X $new && new=:$2:$4:$5:$6 &&
   2.374 +       $posix_glob set +f &&
   2.375  
   2.376 -	   # Now rename the file to the real destination.
   2.377 -	   $doit $mvcmd "$dsttmp" "$dst"
   2.378 -	 }
   2.379 -    } || exit 1
   2.380 +       test "$old" = "$new" &&
   2.381 +       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
   2.382 +    then
   2.383 +      rm -f "$dsttmp"
   2.384 +    else
   2.385 +      # Rename the file to the real destination.
   2.386 +      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
   2.387 +
   2.388 +      # The rename failed, perhaps because mv can't rename something else
   2.389 +      # to itself, or perhaps because mv is so ancient that it does not
   2.390 +      # support -f.
   2.391 +      {
   2.392 +	# Now remove or move aside any old file at destination location.
   2.393 +	# We try this two ways since rm can't unlink itself on some
   2.394 +	# systems and the destination file might be busy for other
   2.395 +	# reasons.  In this case, the final cleanup might fail but the new
   2.396 +	# file should still install successfully.
   2.397 +	{
   2.398 +	  test ! -f "$dst" ||
   2.399 +	  $doit $rmcmd -f "$dst" 2>/dev/null ||
   2.400 +	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
   2.401 +	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
   2.402 +	  } ||
   2.403 +	  { echo "$0: cannot unlink or rename $dst" >&2
   2.404 +	    (exit 1); exit 1
   2.405 +	  }
   2.406 +	} &&
   2.407 +
   2.408 +	# Now rename the file to the real destination.
   2.409 +	$doit $mvcmd "$dsttmp" "$dst"
   2.410 +      }
   2.411 +    fi || exit 1
   2.412  
   2.413      trap '' 0
   2.414    fi
   2.415 @@ -503,5 +522,6 @@
   2.416  # eval: (add-hook 'write-file-hooks 'time-stamp)
   2.417  # time-stamp-start: "scriptversion="
   2.418  # time-stamp-format: "%:y-%02m-%02d.%02H"
   2.419 -# time-stamp-end: "$"
   2.420 +# time-stamp-time-zone: "UTC"
   2.421 +# time-stamp-end: "; # UTC"
   2.422  # End:
     3.1 --- a/missing	Wed Oct 17 01:00:32 2018 +0300
     3.2 +++ b/missing	Thu Oct 18 11:55:14 2018 +0300
     3.3 @@ -1,10 +1,9 @@
     3.4  #! /bin/sh
     3.5  # Common stub for a few missing GNU programs while installing.
     3.6  
     3.7 -scriptversion=2006-05-10.23
     3.8 +scriptversion=2012-01-06.18; # UTC
     3.9  
    3.10 -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
    3.11 -#   Free Software Foundation, Inc.
    3.12 +# Copyright (C) 1996-2012 Free Software Foundation, Inc.
    3.13  # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
    3.14  
    3.15  # This program is free software; you can redistribute it and/or modify
    3.16 @@ -18,9 +17,7 @@
    3.17  # GNU General Public License for more details.
    3.18  
    3.19  # You should have received a copy of the GNU General Public License
    3.20 -# along with this program; if not, write to the Free Software
    3.21 -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    3.22 -# 02110-1301, USA.
    3.23 +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
    3.24  
    3.25  # As a special exception to the GNU General Public License, if you
    3.26  # distribute this file as part of a program that contains a
    3.27 @@ -28,7 +25,7 @@
    3.28  # the same distribution terms that you use for the rest of that program.
    3.29  
    3.30  if test $# -eq 0; then
    3.31 -  echo 1>&2 "Try \`$0 --help' for more information"
    3.32 +  echo 1>&2 "Try '$0 --help' for more information"
    3.33    exit 1
    3.34  fi
    3.35  
    3.36 @@ -36,7 +33,7 @@
    3.37  sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
    3.38  sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
    3.39  
    3.40 -# In the cases where this matters, `missing' is being run in the
    3.41 +# In the cases where this matters, 'missing' is being run in the
    3.42  # srcdir already.
    3.43  if test -f configure.ac; then
    3.44    configure_ac=configure.ac
    3.45 @@ -67,7 +64,7 @@
    3.46      echo "\
    3.47  $0 [OPTION]... PROGRAM [ARGUMENT]...
    3.48  
    3.49 -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
    3.50 +Handle 'PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
    3.51  error status if there is no known handling for PROGRAM.
    3.52  
    3.53  Options:
    3.54 @@ -76,18 +73,20 @@
    3.55    --run           try to run the given command, and emulate it if it fails
    3.56  
    3.57  Supported PROGRAM values:
    3.58 -  aclocal      touch file \`aclocal.m4'
    3.59 -  autoconf     touch file \`configure'
    3.60 -  autoheader   touch file \`config.h.in'
    3.61 +  aclocal      touch file 'aclocal.m4'
    3.62 +  autoconf     touch file 'configure'
    3.63 +  autoheader   touch file 'config.h.in'
    3.64    autom4te     touch the output file, or create a stub one
    3.65 -  automake     touch all \`Makefile.in' files
    3.66 -  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
    3.67 -  flex         create \`lex.yy.c', if possible, from existing .c
    3.68 +  automake     touch all 'Makefile.in' files
    3.69 +  bison        create 'y.tab.[ch]', if possible, from existing .[ch]
    3.70 +  flex         create 'lex.yy.c', if possible, from existing .c
    3.71    help2man     touch the output file
    3.72 -  lex          create \`lex.yy.c', if possible, from existing .c
    3.73 +  lex          create 'lex.yy.c', if possible, from existing .c
    3.74    makeinfo     touch the output file
    3.75 -  tar          try tar, gnutar, gtar, then tar without non-portable flags
    3.76 -  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
    3.77 +  yacc         create 'y.tab.[ch]', if possible, from existing .[ch]
    3.78 +
    3.79 +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
    3.80 +'g' are ignored when checking the name.
    3.81  
    3.82  Send bug reports to <bug-automake@gnu.org>."
    3.83      exit $?
    3.84 @@ -99,37 +98,35 @@
    3.85      ;;
    3.86  
    3.87    -*)
    3.88 -    echo 1>&2 "$0: Unknown \`$1' option"
    3.89 -    echo 1>&2 "Try \`$0 --help' for more information"
    3.90 +    echo 1>&2 "$0: Unknown '$1' option"
    3.91 +    echo 1>&2 "Try '$0 --help' for more information"
    3.92      exit 1
    3.93      ;;
    3.94  
    3.95  esac
    3.96  
    3.97 +# normalize program name to check for.
    3.98 +program=`echo "$1" | sed '
    3.99 +  s/^gnu-//; t
   3.100 +  s/^gnu//; t
   3.101 +  s/^g//; t'`
   3.102 +
   3.103  # Now exit if we have it, but it failed.  Also exit now if we
   3.104  # don't have it and --version was passed (most likely to detect
   3.105 -# the program).
   3.106 +# the program).  This is about non-GNU programs, so use $1 not
   3.107 +# $program.
   3.108  case $1 in
   3.109 -  lex|yacc)
   3.110 +  lex*|yacc*)
   3.111      # Not GNU programs, they don't have --version.
   3.112      ;;
   3.113  
   3.114 -  tar)
   3.115 -    if test -n "$run"; then
   3.116 -       echo 1>&2 "ERROR: \`tar' requires --run"
   3.117 -       exit 1
   3.118 -    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
   3.119 -       exit 1
   3.120 -    fi
   3.121 -    ;;
   3.122 -
   3.123    *)
   3.124      if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   3.125         # We have it, but it failed.
   3.126         exit 1
   3.127      elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
   3.128         # Could not run --version or --help.  This is probably someone
   3.129 -       # running `$TOOL --version' or `$TOOL --help' to check whether
   3.130 +       # running '$TOOL --version' or '$TOOL --help' to check whether
   3.131         # $TOOL exists and not knowing $TOOL uses missing.
   3.132         exit 1
   3.133      fi
   3.134 @@ -138,30 +135,30 @@
   3.135  
   3.136  # If it does not exist, or fails to run (possibly an outdated version),
   3.137  # try to emulate it.
   3.138 -case $1 in
   3.139 +case $program in
   3.140    aclocal*)
   3.141      echo 1>&2 "\
   3.142 -WARNING: \`$1' is $msg.  You should only need it if
   3.143 -         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
   3.144 -         to install the \`Automake' and \`Perl' packages.  Grab them from
   3.145 +WARNING: '$1' is $msg.  You should only need it if
   3.146 +         you modified 'acinclude.m4' or '${configure_ac}'.  You might want
   3.147 +         to install the Automake and Perl packages.  Grab them from
   3.148           any GNU archive site."
   3.149      touch aclocal.m4
   3.150      ;;
   3.151  
   3.152 -  autoconf)
   3.153 +  autoconf*)
   3.154      echo 1>&2 "\
   3.155 -WARNING: \`$1' is $msg.  You should only need it if
   3.156 -         you modified \`${configure_ac}'.  You might want to install the
   3.157 -         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
   3.158 +WARNING: '$1' is $msg.  You should only need it if
   3.159 +         you modified '${configure_ac}'.  You might want to install the
   3.160 +         Autoconf and GNU m4 packages.  Grab them from any GNU
   3.161           archive site."
   3.162      touch configure
   3.163      ;;
   3.164  
   3.165 -  autoheader)
   3.166 +  autoheader*)
   3.167      echo 1>&2 "\
   3.168 -WARNING: \`$1' is $msg.  You should only need it if
   3.169 -         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
   3.170 -         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
   3.171 +WARNING: '$1' is $msg.  You should only need it if
   3.172 +         you modified 'acconfig.h' or '${configure_ac}'.  You might want
   3.173 +         to install the Autoconf and GNU m4 packages.  Grab them
   3.174           from any GNU archive site."
   3.175      files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
   3.176      test -z "$files" && files="config.h"
   3.177 @@ -178,21 +175,21 @@
   3.178  
   3.179    automake*)
   3.180      echo 1>&2 "\
   3.181 -WARNING: \`$1' is $msg.  You should only need it if
   3.182 -         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
   3.183 -         You might want to install the \`Automake' and \`Perl' packages.
   3.184 +WARNING: '$1' is $msg.  You should only need it if
   3.185 +         you modified 'Makefile.am', 'acinclude.m4' or '${configure_ac}'.
   3.186 +         You might want to install the Automake and Perl packages.
   3.187           Grab them from any GNU archive site."
   3.188      find . -type f -name Makefile.am -print |
   3.189  	   sed 's/\.am$/.in/' |
   3.190  	   while read f; do touch "$f"; done
   3.191      ;;
   3.192  
   3.193 -  autom4te)
   3.194 +  autom4te*)
   3.195      echo 1>&2 "\
   3.196 -WARNING: \`$1' is needed, but is $msg.
   3.197 +WARNING: '$1' is needed, but is $msg.
   3.198           You might have modified some files without having the
   3.199           proper tools for further handling them.
   3.200 -         You can get \`$1' as part of \`Autoconf' from any GNU
   3.201 +         You can get '$1' as part of Autoconf from any GNU
   3.202           archive site."
   3.203  
   3.204      file=`echo "$*" | sed -n "$sed_output"`
   3.205 @@ -210,15 +207,15 @@
   3.206      fi
   3.207      ;;
   3.208  
   3.209 -  bison|yacc)
   3.210 +  bison*|yacc*)
   3.211      echo 1>&2 "\
   3.212 -WARNING: \`$1' $msg.  You should only need it if
   3.213 -         you modified a \`.y' file.  You may need the \`Bison' package
   3.214 +WARNING: '$1' $msg.  You should only need it if
   3.215 +         you modified a '.y' file.  You may need the Bison package
   3.216           in order for those modifications to take effect.  You can get
   3.217 -         \`Bison' from any GNU archive site."
   3.218 +         Bison from any GNU archive site."
   3.219      rm -f y.tab.c y.tab.h
   3.220      if test $# -ne 1; then
   3.221 -        eval LASTARG="\${$#}"
   3.222 +        eval LASTARG=\${$#}
   3.223  	case $LASTARG in
   3.224  	*.y)
   3.225  	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
   3.226 @@ -240,15 +237,15 @@
   3.227      fi
   3.228      ;;
   3.229  
   3.230 -  lex|flex)
   3.231 +  lex*|flex*)
   3.232      echo 1>&2 "\
   3.233 -WARNING: \`$1' is $msg.  You should only need it if
   3.234 -         you modified a \`.l' file.  You may need the \`Flex' package
   3.235 +WARNING: '$1' is $msg.  You should only need it if
   3.236 +         you modified a '.l' file.  You may need the Flex package
   3.237           in order for those modifications to take effect.  You can get
   3.238 -         \`Flex' from any GNU archive site."
   3.239 +         Flex from any GNU archive site."
   3.240      rm -f lex.yy.c
   3.241      if test $# -ne 1; then
   3.242 -        eval LASTARG="\${$#}"
   3.243 +        eval LASTARG=\${$#}
   3.244  	case $LASTARG in
   3.245  	*.l)
   3.246  	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
   3.247 @@ -263,12 +260,12 @@
   3.248      fi
   3.249      ;;
   3.250  
   3.251 -  help2man)
   3.252 +  help2man*)
   3.253      echo 1>&2 "\
   3.254 -WARNING: \`$1' is $msg.  You should only need it if
   3.255 +WARNING: '$1' is $msg.  You should only need it if
   3.256  	 you modified a dependency of a manual page.  You may need the
   3.257 -	 \`Help2man' package in order for those modifications to take
   3.258 -	 effect.  You can get \`Help2man' from any GNU archive site."
   3.259 +	 Help2man package in order for those modifications to take
   3.260 +	 effect.  You can get Help2man from any GNU archive site."
   3.261  
   3.262      file=`echo "$*" | sed -n "$sed_output"`
   3.263      test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
   3.264 @@ -277,18 +274,18 @@
   3.265      else
   3.266  	test -z "$file" || exec >$file
   3.267  	echo ".ab help2man is required to generate this page"
   3.268 -	exit 1
   3.269 +	exit $?
   3.270      fi
   3.271      ;;
   3.272  
   3.273 -  makeinfo)
   3.274 +  makeinfo*)
   3.275      echo 1>&2 "\
   3.276 -WARNING: \`$1' is $msg.  You should only need it if
   3.277 -         you modified a \`.texi' or \`.texinfo' file, or any other file
   3.278 +WARNING: '$1' is $msg.  You should only need it if
   3.279 +         you modified a '.texi' or '.texinfo' file, or any other file
   3.280           indirectly affecting the aspect of the manual.  The spurious
   3.281 -         call might also be the consequence of using a buggy \`make' (AIX,
   3.282 -         DU, IRIX).  You might want to install the \`Texinfo' package or
   3.283 -         the \`GNU make' package.  Grab either from any GNU archive site."
   3.284 +         call might also be the consequence of using a buggy 'make' (AIX,
   3.285 +         DU, IRIX).  You might want to install the Texinfo package or
   3.286 +         the GNU make package.  Grab either from any GNU archive site."
   3.287      # The file to touch is that specified with -o ...
   3.288      file=`echo "$*" | sed -n "$sed_output"`
   3.289      test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
   3.290 @@ -310,49 +307,14 @@
   3.291      touch $file
   3.292      ;;
   3.293  
   3.294 -  tar)
   3.295 -    shift
   3.296 -
   3.297 -    # We have already tried tar in the generic part.
   3.298 -    # Look for gnutar/gtar before invocation to avoid ugly error
   3.299 -    # messages.
   3.300 -    if (gnutar --version > /dev/null 2>&1); then
   3.301 -       gnutar "$@" && exit 0
   3.302 -    fi
   3.303 -    if (gtar --version > /dev/null 2>&1); then
   3.304 -       gtar "$@" && exit 0
   3.305 -    fi
   3.306 -    firstarg="$1"
   3.307 -    if shift; then
   3.308 -	case $firstarg in
   3.309 -	*o*)
   3.310 -	    firstarg=`echo "$firstarg" | sed s/o//`
   3.311 -	    tar "$firstarg" "$@" && exit 0
   3.312 -	    ;;
   3.313 -	esac
   3.314 -	case $firstarg in
   3.315 -	*h*)
   3.316 -	    firstarg=`echo "$firstarg" | sed s/h//`
   3.317 -	    tar "$firstarg" "$@" && exit 0
   3.318 -	    ;;
   3.319 -	esac
   3.320 -    fi
   3.321 -
   3.322 -    echo 1>&2 "\
   3.323 -WARNING: I can't seem to be able to run \`tar' with the given arguments.
   3.324 -         You may want to install GNU tar or Free paxutils, or check the
   3.325 -         command line arguments."
   3.326 -    exit 1
   3.327 -    ;;
   3.328 -
   3.329    *)
   3.330      echo 1>&2 "\
   3.331 -WARNING: \`$1' is needed, and is $msg.
   3.332 +WARNING: '$1' is needed, and is $msg.
   3.333           You might have modified some files without having the
   3.334 -         proper tools for further handling them.  Check the \`README' file,
   3.335 +         proper tools for further handling them.  Check the 'README' file,
   3.336           it often tells you about the needed prerequisites for installing
   3.337           this package.  You may also peek at any GNU archive site, in case
   3.338 -         some other package would contain this missing \`$1' program."
   3.339 +         some other package would contain this missing '$1' program."
   3.340      exit 1
   3.341      ;;
   3.342  esac
   3.343 @@ -363,5 +325,6 @@
   3.344  # eval: (add-hook 'write-file-hooks 'time-stamp)
   3.345  # time-stamp-start: "scriptversion="
   3.346  # time-stamp-format: "%:y-%02m-%02d.%02H"
   3.347 -# time-stamp-end: "$"
   3.348 +# time-stamp-time-zone: "UTC"
   3.349 +# time-stamp-end: "; # UTC"
   3.350  # End: