scan-pkgs.sh 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. # This file is part of the OpenADK project. OpenADK is copyrighted
  2. # material, please see the LICENCE file in the top-level directory.
  3. #
  4. # Scan host-tool prerequisites of certain packages before building.
  5. if test -z "$BASH_VERSION"; then
  6. foo=`$BASH -c 'echo "$BASH_VERSION"'`
  7. else
  8. foo=$BASH_VERSION
  9. fi
  10. if test -z "$foo"; then
  11. echo OpenADK requires GNU bash to be installed.
  12. exit 1
  13. fi
  14. test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
  15. [[ -n $BASH_VERSION ]] && shopt -s extglob
  16. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  17. OStype=$(uname)
  18. out=0
  19. . $topdir/.config
  20. if [[ -n $ADK_NATIVE ]];then
  21. if [[ -n $ADK_PACKAGE_GIT ]];then
  22. NEED_CURLDEV="$NEED_CURLDEV git"
  23. NEED_SSLDEV="$NEED_SSLDEV git"
  24. fi
  25. if [[ -n $ADK_TARGET_PACKAGE_RPM ]]; then
  26. NEED_RPM="$NEED_RPM rpm"
  27. fi
  28. fi
  29. if [[ -n $ADK_PACKAGE_FIREFOX ]]; then
  30. NEED_ZIP="$NEED_ZIP firefox"
  31. NEED_LIBIDL="$NEED_LIBIDL firefox"
  32. fi
  33. if [[ -n $ADK_COMPILE_HEIMDAL ]]; then
  34. NEED_BISON="$NEED_BISON heimdal-server"
  35. fi
  36. if [[ -n $ADK_COMPILE_PCMCIAUTILS ]]; then
  37. NEED_BISON="$NEED_BISON pcmciautils"
  38. NEED_FLEX="$NEED_FLEX pcmciautils"
  39. fi
  40. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  41. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  42. fi
  43. if [[ -n $ADK_COMPILE_AVAHI ]]; then
  44. NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
  45. fi
  46. if [[ -n $ADK_PACKAGE_SQUID ]]; then
  47. NEED_SSLDEV="$NEED_SSLDEV squid"
  48. NEED_GXX="$NEED_GXX squid"
  49. fi
  50. if [[ -n $ADK_PACKAGE_DANSGUARDIAN ]]; then
  51. NEED_PKGCONFIG="$NEED_PKGCONFIG dansguardian"
  52. fi
  53. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  54. NEED_INTL="$NEED_INTL xkeyboard-config"
  55. fi
  56. if [[ -n $ADK_PACKAGE_GLIB ]]; then
  57. NEED_GLIBZWO="$NEED_GLIBZWO glib"
  58. NEED_GETTEXT="$NEED_GETTEXT glib"
  59. NEED_PKGCONFIG="$NEED_PKGCONFIG glib"
  60. fi
  61. if [[ -n $ADK_PACKAGE_LIBPCAP ]]; then
  62. NEED_FLEX="$NEED_FLEX libpcap"
  63. NEED_BISON="$NEED_BISON libpcap"
  64. fi
  65. if [[ -n $ADK_PACKAGE_LIBXFONT ]]; then
  66. NEED_WWW="$NEED_WWW libXfont"
  67. NEED_XMLTO="$NEED_XMLTO libXfont"
  68. fi
  69. if [[ -n $ADK_PACKAGE_EGLIBC ]]; then
  70. NEED_GPERF="$NEED_GPERF eglibc"
  71. fi
  72. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
  73. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
  74. fi
  75. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
  76. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
  77. fi
  78. if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
  79. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
  80. fi
  81. if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
  82. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
  83. fi
  84. if [[ -n $NEED_GETTEXT ]]; then
  85. if ! which xgettext >/dev/null 2>&1; then
  86. echo >&2 You need gettext to build $NEED_GETTEXT
  87. out=1
  88. elif ! which msgfmt >/dev/null 2>&1; then
  89. echo >&2 You need gettext to build $NEED_GETTEXT
  90. out=1
  91. fi
  92. fi
  93. if [[ -n $NEED_CURLDEV ]];then
  94. if ! test -f /usr/include/curl/curl.h >/dev/null; then
  95. if ! test -f /usr/local/include/curl/curl.h >/dev/null; then
  96. echo >&2 You need curl headers to build $NEED_CURLDEV
  97. out=1
  98. fi
  99. fi
  100. fi
  101. #if [[ -n $NEED_SSLDEV ]]; then
  102. # if ! test -f /usr/lib/pkgconfig/openssl.pc >/dev/null; then
  103. # if ! test -f /usr/include/openssl/ssl.h >/dev/null; then
  104. # echo >&2 You need openssl headers to build $NEED_SSLDEV
  105. # out=1
  106. # fi
  107. # fi
  108. #fi
  109. if [[ -n $NEED_MKFONTDIR ]]; then
  110. if ! which mkfontdir >/dev/null 2>&1; then
  111. echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
  112. out=1
  113. fi
  114. fi
  115. if [[ -n $NEED_INTL ]]; then
  116. if ! which intltool-update >/dev/null 2>&1; then
  117. echo >&2 You need intltool-update to build $NEED_INTL
  118. out=1
  119. fi
  120. fi
  121. if [[ -n $NEED_WWW ]]; then
  122. if ! which w3m >/dev/null 2>&1; then
  123. if ! which lynx >/dev/null 2>&1; then
  124. if ! which links >/dev/null 2>&1; then
  125. echo >&2 You need w3m/links/lynx to build $NEED_WWW
  126. out=1
  127. fi
  128. fi
  129. fi
  130. fi
  131. if [[ -n $NEED_BISON ]]; then
  132. if ! which bison >/dev/null 2>&1; then
  133. echo >&2 You need bison to build $NEED_BISON
  134. out=1
  135. fi
  136. fi
  137. if [[ -n $NEED_ZIP ]]; then
  138. if ! which zip >/dev/null 2>&1; then
  139. echo >&2 You need zip to build $NEED_ZIP
  140. out=1
  141. fi
  142. fi
  143. if [[ -n $NEED_LIBIDL ]]; then
  144. if ! which libIDL-config-2 >/dev/null 2>&1; then
  145. echo >&2 You need libIDL-config-2 to build $NEED_LIBIDL
  146. out=1
  147. fi
  148. fi
  149. if [[ -n $NEED_GPERF ]]; then
  150. if ! which gperf >/dev/null 2>&1; then
  151. echo >&2 You need gperf to build $NEED_GPERF
  152. out=1
  153. fi
  154. fi
  155. if [[ -n $NEED_GXX ]]; then
  156. if ! which g++ >/dev/null 2>&1; then
  157. echo >&2 You need GNU c++ compiler to build $NEED_GXX
  158. out=1
  159. fi
  160. fi
  161. if [[ -n $NEED_RUBY ]]; then
  162. if ! which ruby >/dev/null 2>&1; then
  163. echo >&2 You need ruby to build $NEED_RUBY
  164. out=1
  165. fi
  166. fi
  167. if [[ -n $NEED_XKBCOMP ]]; then
  168. if ! which xkbcomp >/dev/null 2>&1; then
  169. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  170. out=1
  171. fi
  172. fi
  173. if [[ -n $NEED_PKGCONFIG ]]; then
  174. if ! which pkg-config >/dev/null 2>&1; then
  175. echo >&2 You need pkg-config to build $NEED_PKGCONFIG
  176. out=1
  177. fi
  178. fi
  179. if [[ -n $NEED_GLIBZWO ]]; then
  180. if ! which glib-genmarshal >/dev/null 2>&1; then
  181. echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
  182. out=1
  183. fi
  184. fi
  185. if [[ -n $ADK_USE_CCACHE ]]; then
  186. if ! which ccache >/dev/null 2>&1; then
  187. echo >&2 You have selected to build with ccache, but ccache could not be found.
  188. out=1
  189. fi
  190. fi
  191. if [[ -n $NEED_RPM ]]; then
  192. if ! which rpmbuild >/dev/null 2>&1; then
  193. echo >&2 You need rpmbuild to to use $NEED_RPM package backend
  194. out=1
  195. fi
  196. fi
  197. if [[ -n $NEED_FLEX ]]; then
  198. if ! which flex >/dev/null 2>&1; then
  199. echo >&2 You need flex to to use $NEED_FLEX package
  200. out=1
  201. fi
  202. fi
  203. exit $out