annotate kdiff3/admin/missing @ 40:b19cb8e5c569

Fix for a warning concerning VERSION
author joachim99
date Tue, 14 Oct 2003 20:50:46 +0000
parents 415083d043f3
children 8febbfb1148c
rev   line source
joachim99@2 1 #! /bin/sh
joachim99@2 2 # Common stub for a few missing GNU programs while installing.
joachim99@14 3 # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
joachim99@2 4 # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
joachim99@2 5
joachim99@2 6 # This program is free software; you can redistribute it and/or modify
joachim99@2 7 # it under the terms of the GNU General Public License as published by
joachim99@2 8 # the Free Software Foundation; either version 2, or (at your option)
joachim99@2 9 # any later version.
joachim99@2 10
joachim99@2 11 # This program is distributed in the hope that it will be useful,
joachim99@2 12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
joachim99@2 13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
joachim99@2 14 # GNU General Public License for more details.
joachim99@2 15
joachim99@2 16 # You should have received a copy of the GNU General Public License
joachim99@2 17 # along with this program; if not, write to the Free Software
joachim99@2 18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
joachim99@2 19 # 02111-1307, USA.
joachim99@2 20
joachim99@2 21 # As a special exception to the GNU General Public License, if you
joachim99@2 22 # distribute this file as part of a program that contains a
joachim99@2 23 # configuration script generated by Autoconf, you may include it under
joachim99@2 24 # the same distribution terms that you use for the rest of that program.
joachim99@2 25
joachim99@2 26 if test $# -eq 0; then
joachim99@2 27 echo 1>&2 "Try \`$0 --help' for more information"
joachim99@2 28 exit 1
joachim99@2 29 fi
joachim99@2 30
joachim99@2 31 run=:
joachim99@2 32
joachim99@2 33 # In the cases where this matters, `missing' is being run in the
joachim99@2 34 # srcdir already.
joachim99@2 35 if test -f configure.ac; then
joachim99@2 36 configure_ac=configure.ac
joachim99@2 37 else
joachim99@2 38 configure_ac=configure.in
joachim99@2 39 fi
joachim99@2 40
joachim99@2 41 case "$1" in
joachim99@2 42 --run)
joachim99@2 43 # Try to run requested program, and just exit if it succeeds.
joachim99@2 44 run=
joachim99@2 45 shift
joachim99@2 46 "$@" && exit 0
joachim99@2 47 ;;
joachim99@2 48 esac
joachim99@2 49
joachim99@2 50 # If it does not exist, or fails to run (possibly an outdated version),
joachim99@2 51 # try to emulate it.
joachim99@2 52 case "$1" in
joachim99@2 53
joachim99@2 54 -h|--h|--he|--hel|--help)
joachim99@2 55 echo "\
joachim99@2 56 $0 [OPTION]... PROGRAM [ARGUMENT]...
joachim99@2 57
joachim99@2 58 Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
joachim99@2 59 error status if there is no known handling for PROGRAM.
joachim99@2 60
joachim99@2 61 Options:
joachim99@2 62 -h, --help display this help and exit
joachim99@2 63 -v, --version output version information and exit
joachim99@2 64 --run try to run the given command, and emulate it if it fails
joachim99@2 65
joachim99@2 66 Supported PROGRAM values:
joachim99@2 67 aclocal touch file \`aclocal.m4'
joachim99@2 68 autoconf touch file \`configure'
joachim99@2 69 autoheader touch file \`config.h.in'
joachim99@2 70 automake touch all \`Makefile.in' files
joachim99@2 71 bison create \`y.tab.[ch]', if possible, from existing .[ch]
joachim99@2 72 flex create \`lex.yy.c', if possible, from existing .c
joachim99@2 73 help2man touch the output file
joachim99@2 74 lex create \`lex.yy.c', if possible, from existing .c
joachim99@2 75 makeinfo touch the output file
joachim99@2 76 tar try tar, gnutar, gtar, then tar without non-portable flags
joachim99@2 77 yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
joachim99@2 78 ;;
joachim99@2 79
joachim99@2 80 -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
joachim99@14 81 echo "missing 0.4 - GNU automake"
joachim99@2 82 ;;
joachim99@2 83
joachim99@2 84 -*)
joachim99@2 85 echo 1>&2 "$0: Unknown \`$1' option"
joachim99@2 86 echo 1>&2 "Try \`$0 --help' for more information"
joachim99@2 87 exit 1
joachim99@2 88 ;;
joachim99@2 89
joachim99@14 90 aclocal*)
joachim99@14 91 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
joachim99@14 92 # We have it, but it failed.
joachim99@14 93 exit 1
joachim99@14 94 fi
joachim99@14 95
joachim99@2 96 echo 1>&2 "\
joachim99@2 97 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 98 you modified \`acinclude.m4' or \`${configure_ac}'. You might want
joachim99@2 99 to install the \`Automake' and \`Perl' packages. Grab them from
joachim99@2 100 any GNU archive site."
joachim99@2 101 touch aclocal.m4
joachim99@2 102 ;;
joachim99@2 103
joachim99@2 104 autoconf)
joachim99@14 105 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
joachim99@14 106 # We have it, but it failed.
joachim99@14 107 exit 1
joachim99@14 108 fi
joachim99@14 109
joachim99@2 110 echo 1>&2 "\
joachim99@2 111 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 112 you modified \`${configure_ac}'. You might want to install the
joachim99@2 113 \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
joachim99@2 114 archive site."
joachim99@2 115 touch configure
joachim99@2 116 ;;
joachim99@2 117
joachim99@2 118 autoheader)
joachim99@14 119 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
joachim99@14 120 # We have it, but it failed.
joachim99@14 121 exit 1
joachim99@14 122 fi
joachim99@14 123
joachim99@2 124 echo 1>&2 "\
joachim99@2 125 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 126 you modified \`acconfig.h' or \`${configure_ac}'. You might want
joachim99@2 127 to install the \`Autoconf' and \`GNU m4' packages. Grab them
joachim99@2 128 from any GNU archive site."
joachim99@2 129 files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
joachim99@2 130 test -z "$files" && files="config.h"
joachim99@2 131 touch_files=
joachim99@2 132 for f in $files; do
joachim99@2 133 case "$f" in
joachim99@2 134 *:*) touch_files="$touch_files "`echo "$f" |
joachim99@2 135 sed -e 's/^[^:]*://' -e 's/:.*//'`;;
joachim99@2 136 *) touch_files="$touch_files $f.in";;
joachim99@2 137 esac
joachim99@2 138 done
joachim99@2 139 touch $touch_files
joachim99@2 140 ;;
joachim99@2 141
joachim99@14 142 automake*)
joachim99@14 143 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
joachim99@14 144 # We have it, but it failed.
joachim99@14 145 exit 1
joachim99@14 146 fi
joachim99@14 147
joachim99@2 148 echo 1>&2 "\
joachim99@2 149 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 150 you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
joachim99@2 151 You might want to install the \`Automake' and \`Perl' packages.
joachim99@2 152 Grab them from any GNU archive site."
joachim99@2 153 find . -type f -name Makefile.am -print |
joachim99@2 154 sed 's/\.am$/.in/' |
joachim99@2 155 while read f; do touch "$f"; done
joachim99@2 156 ;;
joachim99@2 157
joachim99@14 158 autom4te)
joachim99@14 159 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
joachim99@14 160 # We have it, but it failed.
joachim99@14 161 exit 1
joachim99@14 162 fi
joachim99@14 163
joachim99@14 164 echo 1>&2 "\
joachim99@14 165 WARNING: \`$1' is needed, and you do not seem to have it handy on your
joachim99@14 166 system. You might have modified some files without having the
joachim99@14 167 proper tools for further handling them.
joachim99@14 168 You can get \`$1Help2man' as part of \`Autoconf' from any GNU
joachim99@14 169 archive site."
joachim99@14 170
joachim99@14 171 file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
joachim99@14 172 test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
joachim99@14 173 if test -f "$file"; then
joachim99@14 174 touch $file
joachim99@14 175 else
joachim99@14 176 test -z "$file" || exec >$file
joachim99@14 177 echo "#! /bin/sh"
joachim99@14 178 echo "# Created by GNU Automake missing as a replacement of"
joachim99@14 179 echo "# $ $@"
joachim99@14 180 echo "exit 0"
joachim99@14 181 chmod +x $file
joachim99@14 182 exit 1
joachim99@14 183 fi
joachim99@14 184 ;;
joachim99@14 185
joachim99@2 186 bison|yacc)
joachim99@2 187 echo 1>&2 "\
joachim99@2 188 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 189 you modified a \`.y' file. You may need the \`Bison' package
joachim99@2 190 in order for those modifications to take effect. You can get
joachim99@2 191 \`Bison' from any GNU archive site."
joachim99@2 192 rm -f y.tab.c y.tab.h
joachim99@2 193 if [ $# -ne 1 ]; then
joachim99@2 194 eval LASTARG="\${$#}"
joachim99@2 195 case "$LASTARG" in
joachim99@2 196 *.y)
joachim99@2 197 SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
joachim99@2 198 if [ -f "$SRCFILE" ]; then
joachim99@2 199 cp "$SRCFILE" y.tab.c
joachim99@2 200 fi
joachim99@2 201 SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
joachim99@2 202 if [ -f "$SRCFILE" ]; then
joachim99@2 203 cp "$SRCFILE" y.tab.h
joachim99@2 204 fi
joachim99@2 205 ;;
joachim99@2 206 esac
joachim99@2 207 fi
joachim99@2 208 if [ ! -f y.tab.h ]; then
joachim99@2 209 echo >y.tab.h
joachim99@2 210 fi
joachim99@2 211 if [ ! -f y.tab.c ]; then
joachim99@2 212 echo 'main() { return 0; }' >y.tab.c
joachim99@2 213 fi
joachim99@2 214 ;;
joachim99@2 215
joachim99@2 216 lex|flex)
joachim99@2 217 echo 1>&2 "\
joachim99@2 218 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 219 you modified a \`.l' file. You may need the \`Flex' package
joachim99@2 220 in order for those modifications to take effect. You can get
joachim99@2 221 \`Flex' from any GNU archive site."
joachim99@2 222 rm -f lex.yy.c
joachim99@2 223 if [ $# -ne 1 ]; then
joachim99@2 224 eval LASTARG="\${$#}"
joachim99@2 225 case "$LASTARG" in
joachim99@2 226 *.l)
joachim99@2 227 SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
joachim99@2 228 if [ -f "$SRCFILE" ]; then
joachim99@2 229 cp "$SRCFILE" lex.yy.c
joachim99@2 230 fi
joachim99@2 231 ;;
joachim99@2 232 esac
joachim99@2 233 fi
joachim99@2 234 if [ ! -f lex.yy.c ]; then
joachim99@2 235 echo 'main() { return 0; }' >lex.yy.c
joachim99@2 236 fi
joachim99@2 237 ;;
joachim99@2 238
joachim99@2 239 help2man)
joachim99@14 240 if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
joachim99@14 241 # We have it, but it failed.
joachim99@14 242 exit 1
joachim99@14 243 fi
joachim99@14 244
joachim99@2 245 echo 1>&2 "\
joachim99@2 246 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 247 you modified a dependency of a manual page. You may need the
joachim99@2 248 \`Help2man' package in order for those modifications to take
joachim99@2 249 effect. You can get \`Help2man' from any GNU archive site."
joachim99@2 250
joachim99@2 251 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
joachim99@2 252 if test -z "$file"; then
joachim99@2 253 file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
joachim99@2 254 fi
joachim99@2 255 if [ -f "$file" ]; then
joachim99@2 256 touch $file
joachim99@2 257 else
joachim99@2 258 test -z "$file" || exec >$file
joachim99@2 259 echo ".ab help2man is required to generate this page"
joachim99@2 260 exit 1
joachim99@2 261 fi
joachim99@2 262 ;;
joachim99@2 263
joachim99@2 264 makeinfo)
joachim99@2 265 if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
joachim99@2 266 # We have makeinfo, but it failed.
joachim99@2 267 exit 1
joachim99@2 268 fi
joachim99@2 269
joachim99@2 270 echo 1>&2 "\
joachim99@2 271 WARNING: \`$1' is missing on your system. You should only need it if
joachim99@2 272 you modified a \`.texi' or \`.texinfo' file, or any other file
joachim99@2 273 indirectly affecting the aspect of the manual. The spurious
joachim99@2 274 call might also be the consequence of using a buggy \`make' (AIX,
joachim99@2 275 DU, IRIX). You might want to install the \`Texinfo' package or
joachim99@2 276 the \`GNU make' package. Grab either from any GNU archive site."
joachim99@2 277 file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
joachim99@2 278 if test -z "$file"; then
joachim99@2 279 file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
joachim99@2 280 file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
joachim99@2 281 fi
joachim99@2 282 touch $file
joachim99@2 283 ;;
joachim99@2 284
joachim99@2 285 tar)
joachim99@2 286 shift
joachim99@2 287 if test -n "$run"; then
joachim99@2 288 echo 1>&2 "ERROR: \`tar' requires --run"
joachim99@2 289 exit 1
joachim99@2 290 fi
joachim99@2 291
joachim99@2 292 # We have already tried tar in the generic part.
joachim99@2 293 # Look for gnutar/gtar before invocation to avoid ugly error
joachim99@2 294 # messages.
joachim99@2 295 if (gnutar --version > /dev/null 2>&1); then
joachim99@14 296 gnutar "$@" && exit 0
joachim99@2 297 fi
joachim99@2 298 if (gtar --version > /dev/null 2>&1); then
joachim99@14 299 gtar "$@" && exit 0
joachim99@2 300 fi
joachim99@2 301 firstarg="$1"
joachim99@2 302 if shift; then
joachim99@2 303 case "$firstarg" in
joachim99@2 304 *o*)
joachim99@2 305 firstarg=`echo "$firstarg" | sed s/o//`
joachim99@14 306 tar "$firstarg" "$@" && exit 0
joachim99@2 307 ;;
joachim99@2 308 esac
joachim99@2 309 case "$firstarg" in
joachim99@2 310 *h*)
joachim99@2 311 firstarg=`echo "$firstarg" | sed s/h//`
joachim99@14 312 tar "$firstarg" "$@" && exit 0
joachim99@2 313 ;;
joachim99@2 314 esac
joachim99@2 315 fi
joachim99@2 316
joachim99@2 317 echo 1>&2 "\
joachim99@2 318 WARNING: I can't seem to be able to run \`tar' with the given arguments.
joachim99@2 319 You may want to install GNU tar or Free paxutils, or check the
joachim99@2 320 command line arguments."
joachim99@2 321 exit 1
joachim99@2 322 ;;
joachim99@2 323
joachim99@2 324 *)
joachim99@2 325 echo 1>&2 "\
joachim99@2 326 WARNING: \`$1' is needed, and you do not seem to have it handy on your
joachim99@2 327 system. You might have modified some files without having the
joachim99@2 328 proper tools for further handling them. Check the \`README' file,
joachim99@2 329 it often tells you about the needed prerequirements for installing
joachim99@2 330 this package. You may also peek at any GNU archive site, in case
joachim99@2 331 some other package would contain this missing \`$1' program."
joachim99@2 332 exit 1
joachim99@2 333 ;;
joachim99@2 334 esac
joachim99@2 335
joachim99@2 336 exit 0