test/missing
changeset 729 dac996d69abb
parent 0 74212992fb08
     1.1 --- a/test/missing	Fri Oct 03 18:26:39 2003 +0000
     1.2 +++ b/test/missing	Mon Oct 06 07:13:16 2003 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  #! /bin/sh
     1.5  # Common stub for a few missing GNU programs while installing.
     1.6 -# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
     1.7 -# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
     1.8 +# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
     1.9 +# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
    1.10  
    1.11  # This program is free software; you can redistribute it and/or modify
    1.12  # it under the terms of the GNU General Public License as published by
    1.13 @@ -18,11 +18,37 @@
    1.14  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
    1.15  # 02111-1307, USA.
    1.16  
    1.17 +# As a special exception to the GNU General Public License, if you
    1.18 +# distribute this file as part of a program that contains a
    1.19 +# configuration script generated by Autoconf, you may include it under
    1.20 +# the same distribution terms that you use for the rest of that program.
    1.21 +
    1.22  if test $# -eq 0; then
    1.23    echo 1>&2 "Try \`$0 --help' for more information"
    1.24    exit 1
    1.25  fi
    1.26  
    1.27 +run=:
    1.28 +
    1.29 +# In the cases where this matters, `missing' is being run in the
    1.30 +# srcdir already.
    1.31 +if test -f configure.ac; then
    1.32 +  configure_ac=configure.ac
    1.33 +else
    1.34 +  configure_ac=configure.in
    1.35 +fi
    1.36 +
    1.37 +case "$1" in
    1.38 +--run)
    1.39 +  # Try to run requested program, and just exit if it succeeds.
    1.40 +  run=
    1.41 +  shift
    1.42 +  "$@" && exit 0
    1.43 +  ;;
    1.44 +esac
    1.45 +
    1.46 +# If it does not exist, or fails to run (possibly an outdated version),
    1.47 +# try to emulate it.
    1.48  case "$1" in
    1.49  
    1.50    -h|--h|--he|--hel|--help)
    1.51 @@ -35,6 +61,7 @@
    1.52  Options:
    1.53    -h, --help      display this help and exit
    1.54    -v, --version   output version information and exit
    1.55 +  --run           try to run the given command, and emulate it if it fails
    1.56  
    1.57  Supported PROGRAM values:
    1.58    aclocal      touch file \`aclocal.m4'
    1.59 @@ -43,13 +70,15 @@
    1.60    automake     touch all \`Makefile.in' files
    1.61    bison        create \`y.tab.[ch]', if possible, from existing .[ch]
    1.62    flex         create \`lex.yy.c', if possible, from existing .c
    1.63 +  help2man     touch the output file
    1.64    lex          create \`lex.yy.c', if possible, from existing .c
    1.65    makeinfo     touch the output file
    1.66 +  tar          try tar, gnutar, gtar, then tar without non-portable flags
    1.67    yacc         create \`y.tab.[ch]', if possible, from existing .[ch]"
    1.68      ;;
    1.69  
    1.70    -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
    1.71 -    echo "missing - GNU libit 0.0"
    1.72 +    echo "missing 0.4 - GNU automake"
    1.73      ;;
    1.74  
    1.75    -*)
    1.76 @@ -58,31 +87,46 @@
    1.77      exit 1
    1.78      ;;
    1.79  
    1.80 -  aclocal)
    1.81 +  aclocal*)
    1.82 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    1.83 +       # We have it, but it failed.
    1.84 +       exit 1
    1.85 +    fi
    1.86 +
    1.87      echo 1>&2 "\
    1.88  WARNING: \`$1' is missing on your system.  You should only need it if
    1.89 -         you modified \`acinclude.m4' or \`configure.in'.  You might want
    1.90 +         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
    1.91           to install the \`Automake' and \`Perl' packages.  Grab them from
    1.92           any GNU archive site."
    1.93      touch aclocal.m4
    1.94      ;;
    1.95  
    1.96    autoconf)
    1.97 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
    1.98 +       # We have it, but it failed.
    1.99 +       exit 1
   1.100 +    fi
   1.101 +
   1.102      echo 1>&2 "\
   1.103  WARNING: \`$1' is missing on your system.  You should only need it if
   1.104 -         you modified \`configure.in'.  You might want to install the
   1.105 +         you modified \`${configure_ac}'.  You might want to install the
   1.106           \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
   1.107           archive site."
   1.108      touch configure
   1.109      ;;
   1.110  
   1.111    autoheader)
   1.112 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   1.113 +       # We have it, but it failed.
   1.114 +       exit 1
   1.115 +    fi
   1.116 +
   1.117      echo 1>&2 "\
   1.118  WARNING: \`$1' is missing on your system.  You should only need it if
   1.119 -         you modified \`acconfig.h' or \`configure.in'.  You might want
   1.120 +         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
   1.121           to install the \`Autoconf' and \`GNU m4' packages.  Grab them
   1.122           from any GNU archive site."
   1.123 -    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
   1.124 +    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
   1.125      test -z "$files" && files="config.h"
   1.126      touch_files=
   1.127      for f in $files; do
   1.128 @@ -95,10 +139,15 @@
   1.129      touch $touch_files
   1.130      ;;
   1.131  
   1.132 -  automake)
   1.133 +  automake*)
   1.134 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   1.135 +       # We have it, but it failed.
   1.136 +       exit 1
   1.137 +    fi
   1.138 +
   1.139      echo 1>&2 "\
   1.140  WARNING: \`$1' is missing on your system.  You should only need it if
   1.141 -         you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
   1.142 +         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
   1.143           You might want to install the \`Automake' and \`Perl' packages.
   1.144           Grab them from any GNU archive site."
   1.145      find . -type f -name Makefile.am -print |
   1.146 @@ -106,6 +155,34 @@
   1.147  	   while read f; do touch "$f"; done
   1.148      ;;
   1.149  
   1.150 +  autom4te)
   1.151 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   1.152 +       # We have it, but it failed.
   1.153 +       exit 1
   1.154 +    fi
   1.155 +
   1.156 +    echo 1>&2 "\
   1.157 +WARNING: \`$1' is needed, and you do not seem to have it handy on your
   1.158 +         system.  You might have modified some files without having the
   1.159 +         proper tools for further handling them.
   1.160 +         You can get \`$1Help2man' as part of \`Autoconf' from any GNU
   1.161 +         archive site."
   1.162 +
   1.163 +    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
   1.164 +    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
   1.165 +    if test -f "$file"; then
   1.166 +	touch $file
   1.167 +    else
   1.168 +	test -z "$file" || exec >$file
   1.169 +	echo "#! /bin/sh"
   1.170 +	echo "# Created by GNU Automake missing as a replacement of"
   1.171 +	echo "#  $ $@"
   1.172 +	echo "exit 0"
   1.173 +	chmod +x $file
   1.174 +	exit 1
   1.175 +    fi
   1.176 +    ;;
   1.177 +
   1.178    bison|yacc)
   1.179      echo 1>&2 "\
   1.180  WARNING: \`$1' is missing on your system.  You should only need it if
   1.181 @@ -159,7 +236,37 @@
   1.182      fi
   1.183      ;;
   1.184  
   1.185 +  help2man)
   1.186 +    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
   1.187 +       # We have it, but it failed.
   1.188 +       exit 1
   1.189 +    fi
   1.190 +
   1.191 +    echo 1>&2 "\
   1.192 +WARNING: \`$1' is missing on your system.  You should only need it if
   1.193 +	 you modified a dependency of a manual page.  You may need the
   1.194 +	 \`Help2man' package in order for those modifications to take
   1.195 +	 effect.  You can get \`Help2man' from any GNU archive site."
   1.196 +
   1.197 +    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
   1.198 +    if test -z "$file"; then
   1.199 +	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
   1.200 +    fi
   1.201 +    if [ -f "$file" ]; then
   1.202 +	touch $file
   1.203 +    else
   1.204 +	test -z "$file" || exec >$file
   1.205 +	echo ".ab help2man is required to generate this page"
   1.206 +	exit 1
   1.207 +    fi
   1.208 +    ;;
   1.209 +
   1.210    makeinfo)
   1.211 +    if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
   1.212 +       # We have makeinfo, but it failed.
   1.213 +       exit 1
   1.214 +    fi
   1.215 +
   1.216      echo 1>&2 "\
   1.217  WARNING: \`$1' is missing on your system.  You should only need it if
   1.218           you modified a \`.texi' or \`.texinfo' file, or any other file
   1.219 @@ -175,6 +282,45 @@
   1.220      touch $file
   1.221      ;;
   1.222  
   1.223 +  tar)
   1.224 +    shift
   1.225 +    if test -n "$run"; then
   1.226 +      echo 1>&2 "ERROR: \`tar' requires --run"
   1.227 +      exit 1
   1.228 +    fi
   1.229 +
   1.230 +    # We have already tried tar in the generic part.
   1.231 +    # Look for gnutar/gtar before invocation to avoid ugly error
   1.232 +    # messages.
   1.233 +    if (gnutar --version > /dev/null 2>&1); then
   1.234 +       gnutar "$@" && exit 0
   1.235 +    fi
   1.236 +    if (gtar --version > /dev/null 2>&1); then
   1.237 +       gtar "$@" && exit 0
   1.238 +    fi
   1.239 +    firstarg="$1"
   1.240 +    if shift; then
   1.241 +	case "$firstarg" in
   1.242 +	*o*)
   1.243 +	    firstarg=`echo "$firstarg" | sed s/o//`
   1.244 +	    tar "$firstarg" "$@" && exit 0
   1.245 +	    ;;
   1.246 +	esac
   1.247 +	case "$firstarg" in
   1.248 +	*h*)
   1.249 +	    firstarg=`echo "$firstarg" | sed s/h//`
   1.250 +	    tar "$firstarg" "$@" && exit 0
   1.251 +	    ;;
   1.252 +	esac
   1.253 +    fi
   1.254 +
   1.255 +    echo 1>&2 "\
   1.256 +WARNING: I can't seem to be able to run \`tar' with the given arguments.
   1.257 +         You may want to install GNU tar or Free paxutils, or check the
   1.258 +         command line arguments."
   1.259 +    exit 1
   1.260 +    ;;
   1.261 +
   1.262    *)
   1.263      echo 1>&2 "\
   1.264  WARNING: \`$1' is needed, and you do not seem to have it handy on your