scan-pkgs.sh 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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_NEON ]];then
  22. NEED_LIBXML2_DEV="$NEED_LIBXML2_DEV neon"
  23. fi
  24. if [[ -n $ADK_PACKAGE_LZOP ]];then
  25. NEED_LZODEV="$NEED_LZODEV lzop"
  26. fi
  27. if [[ -n $ADK_PACKAGE_LIBIMAGEMAGICK ]];then
  28. NEED_JPEGDEV="$NEED_JPEGDEV libimagemagick"
  29. NEED_TIFFDEV="$NEED_TIFFDEV libimagemagick"
  30. fi
  31. if [[ -n $ADK_PACKAGE_DISPLAY ]];then
  32. NEED_X11DEV="$NEED_X11DEV display"
  33. NEED_XEXTDEV="$NEED_XEXTDEV display"
  34. fi
  35. if [[ -n $ADK_PACKAGE_GIT ]];then
  36. NEED_CURLDEV="$NEED_CURLDEV git"
  37. fi
  38. if [[ -n $ADK_TARGET_PACKAGE_RPM ]]; then
  39. NEED_RPM="$NEED_RPM rpm"
  40. fi
  41. if [[ -n $ADK_PACKAGE_WPA_SUPPLICANT_WITH_OPENSSL ]]; then
  42. NEED_LIBSSLDEV="$NEED_LIBSSLDEV wpa_supplicant"
  43. fi
  44. if [[ -n $ADK_COMPILE_BIND ]]; then
  45. NEED_LIBSSLDEV="$NEED_LIBSSLDEV bind"
  46. fi
  47. if [[ -n $ADK_PACKAGE_IW ]]; then
  48. NEED_LIBNLDEV="$NEED_LIBNLDEV iw"
  49. fi
  50. if [[ -n $ADK_PACKAGE_NFS_UTILS_WITH_KERBEROS ]]; then
  51. NEED_LIBKRB5DEV="$NEED_LIBKRB5DEV nfs-utils"
  52. fi
  53. if [[ -n $ADK_PACKAGE_NFS_UTILS_WITH_TIRPC ]]; then
  54. NEED_LIBTIRPCDEV="$NEED_LIBTIRPCDEV nfs-utils"
  55. fi
  56. fi
  57. if [[ -n $ADK_PACKAGE_XBMC ]]; then
  58. NEED_JAVA="$NEED_JAVA xbmc"
  59. fi
  60. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  61. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  62. fi
  63. if [[ -n $ADK_COMPILE_COROSYNC ]]; then
  64. NEED_GROFF="$NEED_GROFF corosync"
  65. fi
  66. if [[ -n $ADK_PACKAGE_SQUID ]]; then
  67. NEED_GXX="$NEED_GXX squid"
  68. fi
  69. if [[ -n $ADK_PACKAGE_LIBXFONT ]]; then
  70. NEED_XMLTO="$NEED_XMLTO libXfont"
  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_LIBTIRPCDEV ]];then
  85. if ! test -f /usr/include/tirpc/netconfig.h >/dev/null; then
  86. echo >&2 You need tirpc headers to build $NEED_LIBTIRPCDEV
  87. out=1
  88. fi
  89. fi
  90. if [[ -n $NEED_LIBXML2_DEV ]];then
  91. if ! test -f /usr/include/libxml2/libxml/xmlversion.h >/dev/null; then
  92. echo >&2 You need libxml2 headers to build $NEED_LIBXML2_DEV
  93. out=1
  94. fi
  95. fi
  96. if [[ -n $NEED_LIBKRB5DEV ]];then
  97. if ! test -f /usr/include/krb5.h >/dev/null; then
  98. echo >&2 You need krb5 headers to build $NEED_LIBKRB5DEV
  99. out=1
  100. fi
  101. fi
  102. if [[ -n $NEED_CURLDEV ]];then
  103. if ! test -f /usr/include/curl/curl.h >/dev/null; then
  104. if ! test -f /usr/local/include/curl/curl.h >/dev/null; then
  105. echo >&2 You need curl headers to build $NEED_CURLDEV
  106. out=1
  107. fi
  108. fi
  109. fi
  110. if [[ -n $NEED_TIFFDEV ]];then
  111. if ! test -f /usr/include/tiff.h >/dev/null; then
  112. echo >&2 You need libtiff headers to build $NEED_TIFFDEV
  113. out=1
  114. fi
  115. fi
  116. if [[ -n $NEED_SDLDEV ]];then
  117. if ! test -f /usr/include/SDL/SDL.h >/dev/null; then
  118. echo >&2 You need libSDL headers to build $NEED_SDLDEV
  119. out=1
  120. fi
  121. fi
  122. if [[ -n $NEED_SDLIMAGEDEV ]];then
  123. if ! test -f /usr/include/SDL/SDL_image.h >/dev/null; then
  124. echo >&2 You need libSDL-image headers to build $NEED_SDLIMAGEDEV
  125. out=1
  126. fi
  127. fi
  128. if [[ -n $NEED_JPEGDEV ]];then
  129. if ! test -f /usr/include/jpeglib.h >/dev/null; then
  130. echo >&2 You need libjpeg headers to build $NEED_JPEGDEV
  131. out=1
  132. fi
  133. fi
  134. if [[ -n $NEED_LZODEV ]];then
  135. if ! test -f /usr/include/lzo/lzo1.h >/dev/null; then
  136. echo >&2 You need liblzo headers to build $NEED_LZODEV
  137. out=1
  138. fi
  139. fi
  140. if [[ -n $NEED_LIBNLDEV ]];then
  141. if ! test -f /usr/include/netlink/netlink.h >/dev/null; then
  142. echo >&2 You need libnl headers to build $NEED_LIBNLDEV
  143. out=1
  144. fi
  145. fi
  146. if [[ -n $NEED_X11DEV ]];then
  147. if ! test -f /usr/include/X11/Xlib.h >/dev/null; then
  148. echo >&2 You need X11 headers to build $NEED_X11DEV
  149. out=1
  150. fi
  151. fi
  152. if [[ -n $NEED_XEXTDEV ]];then
  153. if ! test -f /usr/include/X11/extensions/XShm.h >/dev/null; then
  154. echo >&2 You need X11 extensions headers to build $NEED_XEXTDEV
  155. out=1
  156. fi
  157. fi
  158. if [[ -n $NEED_LIBSSLDEV ]]; then
  159. if ! test -f /usr/include/openssl/ssl.h >/dev/null; then
  160. echo >&2 You need openssl headers to build $NEED_LIBSSLDEV
  161. out=1
  162. fi
  163. fi
  164. if [[ -n $NEED_GROFF ]]; then
  165. if ! which groff >/dev/null 2>&1; then
  166. echo >&2 You need groff to build $NEED_GROFF
  167. out=1
  168. fi
  169. fi
  170. if [[ -n $NEED_MKFONTDIR ]]; then
  171. if ! which mkfontdir >/dev/null 2>&1; then
  172. echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
  173. out=1
  174. fi
  175. fi
  176. if [[ -n $NEED_WWW ]]; then
  177. if ! which w3m >/dev/null 2>&1; then
  178. if ! which lynx >/dev/null 2>&1; then
  179. if ! which links >/dev/null 2>&1; then
  180. echo >&2 You need w3m/links/lynx to build $NEED_WWW
  181. out=1
  182. fi
  183. fi
  184. fi
  185. fi
  186. if [[ -n $NEED_GXX ]]; then
  187. if ! which g++ >/dev/null 2>&1; then
  188. echo >&2 You need GNU c++ compiler to build $NEED_GXX
  189. out=1
  190. fi
  191. fi
  192. if [[ -n $NEED_XKBCOMP ]]; then
  193. if ! which xkbcomp >/dev/null 2>&1; then
  194. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  195. out=1
  196. fi
  197. fi
  198. if [[ -n $NEED_RPM ]]; then
  199. if ! which rpmbuild >/dev/null 2>&1; then
  200. echo >&2 You need rpmbuild to to use $NEED_RPM package backend
  201. out=1
  202. fi
  203. fi
  204. if [[ -n $NEED_XSLTPROC ]]; then
  205. if ! which xsltproc >/dev/null 2>&1; then
  206. echo >&2 You need xsltproc to build $NEED_XSLTPROC
  207. out=1
  208. fi
  209. fi
  210. if [[ -n $NEED_DBUSGLIB ]]; then
  211. if ! which dbus-binding-tool >/dev/null 2>&1; then
  212. echo >&2 You need dbus-binding-tool to build $NEED_DBUSGLIB
  213. out=1
  214. fi
  215. fi
  216. if [[ -n $NEED_JAVA ]]; then
  217. if ! which java >/dev/null 2>&1; then
  218. echo >&2 You need java to build $NEED_JAVA
  219. out=1
  220. fi
  221. fi
  222. if [[ -n $ADK_USE_CCACHE ]]; then
  223. if ! which ccache >/dev/null 2>&1; then
  224. echo >&2 You have selected to build with ccache, but ccache could not be found.
  225. out=1
  226. fi
  227. fi
  228. exit $out