missing 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. #! /bin/sh
  2. # Common stub for a few missing GNU programs while installing.
  3. # Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
  4. # Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2, or (at your option)
  8. # any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  16. # 02111-1307, USA.
  17. if test $# -eq 0; then
  18. echo 1>&2 "Try \`$0 --help' for more information"
  19. exit 1
  20. fi
  21. # In the cases where this matters, `missing' is being run in the
  22. # srcdir already.
  23. if test -f configure.in; then
  24. configure_ac=configure.ac
  25. else
  26. configure_ac=configure.in
  27. fi
  28. case "$1" in
  29. -h|--h|--he|--hel|--help)
  30. echo "\
  31. $0 [OPTION]... PROGRAM [ARGUMENT]...
  32. Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
  33. error status if there is no known handling for PROGRAM.
  34. Options:
  35. -h, --help display this help and exit
  36. -v, --version output version information and exit
  37. Supported PROGRAM values:
  38. aclocal touch file \`aclocal.m4'
  39. autoconf touch file \`configure'
  40. autoheader touch file \`config.h.in'
  41. automake touch all \`Makefile.in' files
  42. bison create \`y.tab.[ch]', if possible, from existing .[ch]
  43. flex create \`lex.yy.c', if possible, from existing .c
  44. lex create \`lex.yy.c', if possible, from existing .c
  45. makeinfo touch the output file
  46. yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
  47. ;;
  48. -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
  49. echo "missing - GNU libit 0.0"
  50. ;;
  51. -*)
  52. echo 1>&2 "$0: Unknown \`$1' option"
  53. echo 1>&2 "Try \`$0 --help' for more information"
  54. exit 1
  55. ;;
  56. aclocal)
  57. echo 1>&2 "\
  58. WARNING: \`$1' is missing on your system. You should only need it if
  59. you modified \`acinclude.m4' or \`$configure_ac'. You might want
  60. to install the \`Automake' and \`Perl' packages. Grab them from
  61. any GNU archive site."
  62. touch aclocal.m4
  63. ;;
  64. autoconf)
  65. echo 1>&2 "\
  66. WARNING: \`$1' is missing on your system. You should only need it if
  67. you modified \`$configure_ac'. You might want to install the
  68. \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
  69. archive site."
  70. touch configure
  71. ;;
  72. autoheader)
  73. echo 1>&2 "\
  74. WARNING: \`$1' is missing on your system. You should only need it if
  75. you modified \`acconfig.h' or \`$configure_ac'. You might want
  76. to install the \`Autoconf' and \`GNU m4' packages. Grab them
  77. from any GNU archive site."
  78. files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac`
  79. test -z "$files" && files="config.h"
  80. touch_files=
  81. for f in $files; do
  82. case "$f" in
  83. *:*) touch_files="$touch_files "`echo "$f" |
  84. sed -e 's/^[^:]*://' -e 's/:.*//'`;;
  85. *) touch_files="$touch_files $f.in";;
  86. esac
  87. done
  88. touch $touch_files
  89. ;;
  90. automake)
  91. echo 1>&2 "\
  92. WARNING: \`$1' is missing on your system. You should only need it if
  93. you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'.
  94. You might want to install the \`Automake' and \`Perl' packages.
  95. Grab them from any GNU archive site."
  96. find . -type f -name Makefile.am -print |
  97. sed 's/\.am$/.in/' |
  98. while read f; do touch "$f"; done
  99. ;;
  100. bison|yacc)
  101. echo 1>&2 "\
  102. WARNING: \`$1' is missing on your system. You should only need it if
  103. you modified a \`.y' file. You may need the \`Bison' package
  104. in order for those modifications to take effect. You can get
  105. \`Bison' from any GNU archive site."
  106. rm -f y.tab.c y.tab.h
  107. if [ $# -ne 1 ]; then
  108. eval LASTARG="\${$#}"
  109. case "$LASTARG" in
  110. *.y)
  111. SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
  112. if [ -f "$SRCFILE" ]; then
  113. cp "$SRCFILE" y.tab.c
  114. fi
  115. SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
  116. if [ -f "$SRCFILE" ]; then
  117. cp "$SRCFILE" y.tab.h
  118. fi
  119. ;;
  120. esac
  121. fi
  122. if [ ! -f y.tab.h ]; then
  123. echo >y.tab.h
  124. fi
  125. if [ ! -f y.tab.c ]; then
  126. echo 'main() { return 0; }' >y.tab.c
  127. fi
  128. ;;
  129. lex|flex)
  130. echo 1>&2 "\
  131. WARNING: \`$1' is missing on your system. You should only need it if
  132. you modified a \`.l' file. You may need the \`Flex' package
  133. in order for those modifications to take effect. You can get
  134. \`Flex' from any GNU archive site."
  135. rm -f lex.yy.c
  136. if [ $# -ne 1 ]; then
  137. eval LASTARG="\${$#}"
  138. case "$LASTARG" in
  139. *.l)
  140. SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
  141. if [ -f "$SRCFILE" ]; then
  142. cp "$SRCFILE" lex.yy.c
  143. fi
  144. ;;
  145. esac
  146. fi
  147. if [ ! -f lex.yy.c ]; then
  148. echo 'main() { return 0; }' >lex.yy.c
  149. fi
  150. ;;
  151. makeinfo)
  152. echo 1>&2 "\
  153. WARNING: \`$1' is missing on your system. You should only need it if
  154. you modified a \`.texi' or \`.texinfo' file, or any other file
  155. indirectly affecting the aspect of the manual. The spurious
  156. call might also be the consequence of using a buggy \`make' (AIX,
  157. DU, IRIX). You might want to install the \`Texinfo' package or
  158. the \`GNU make' package. Grab either from any GNU archive site."
  159. file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
  160. if test -z "$file"; then
  161. file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
  162. file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
  163. fi
  164. touch $file
  165. ;;
  166. *)
  167. echo 1>&2 "\
  168. WARNING: \`$1' is needed, and you do not seem to have it handy on your
  169. system. You might have modified some files without having the
  170. proper tools for further handling them. Check the \`README' file,
  171. it often tells you about the needed prerequirements for installing
  172. this package. You may also peek at any GNU archive site, in case
  173. some other package would contain this missing \`$1' program."
  174. exit 1
  175. ;;
  176. esac
  177. exit 0