annotate kdiff3/admin/missing @ 75:08ea9b86c12c

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