missing 10 KB

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