scan-pkgs.sh 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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_COMPILE_OPENJDK ]]; then
  58. NEED_GXX="$NEED_GXX openjdk"
  59. NEED_XSLTPROC="$NEED_XSLTPROC openjdk"
  60. fi
  61. if [[ -n $ADK_COMPILE_OPENJDK ]]; then
  62. cd ${TOPDIR}/jtools; bash prereq.sh
  63. [ $? -ne 0 ] && out=1
  64. fi
  65. if [[ -n $ADK_COMPILE_OPENJDK7 ]]; then
  66. cd ${TOPDIR}/jtools; bash prereq.sh
  67. [ $? -ne 0 ] && out=1
  68. fi
  69. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  70. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  71. fi
  72. if [[ -n $ADK_COMPILE_COROSYNC ]]; then
  73. NEED_GROFF="$NEED_GROFF corosync"
  74. fi
  75. if [[ -n $ADK_PACKAGE_SQUID ]]; then
  76. NEED_GXX="$NEED_GXX squid"
  77. fi
  78. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  79. NEED_INTL="$NEED_INTL xkeyboard-config"
  80. fi
  81. if [[ -n $ADK_PACKAGE_LIBXFONT ]]; then
  82. NEED_WWW="$NEED_WWW libXfont"
  83. NEED_XMLTO="$NEED_XMLTO libXfont"
  84. fi
  85. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
  86. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
  87. fi
  88. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
  89. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
  90. fi
  91. if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
  92. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
  93. fi
  94. if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
  95. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
  96. fi
  97. if [[ -n $NEED_LIBTIRPCDEV ]];then
  98. if ! test -f /usr/include/tirpc/netconfig.h >/dev/null; then
  99. echo >&2 You need tirpc headers to build $NEED_LIBTIRPCDEV
  100. out=1
  101. fi
  102. fi
  103. if [[ -n $NEED_LIBXML2_DEV ]];then
  104. if ! test -f /usr/include/libxml2/libxml/xmlversion.h >/dev/null; then
  105. echo >&2 You need libxml2 headers to build $NEED_LIBXML2_DEV
  106. out=1
  107. fi
  108. fi
  109. if [[ -n $NEED_LIBKRB5DEV ]];then
  110. if ! test -f /usr/include/krb5.h >/dev/null; then
  111. echo >&2 You need krb5 headers to build $NEED_LIBKRB5DEV
  112. out=1
  113. fi
  114. fi
  115. if [[ -n $NEED_CURLDEV ]];then
  116. if ! test -f /usr/include/curl/curl.h >/dev/null; then
  117. if ! test -f /usr/local/include/curl/curl.h >/dev/null; then
  118. echo >&2 You need curl headers to build $NEED_CURLDEV
  119. out=1
  120. fi
  121. fi
  122. fi
  123. if [[ -n $NEED_TIFFDEV ]];then
  124. if ! test -f /usr/include/tiff.h >/dev/null; then
  125. echo >&2 You need libtiff headers to build $NEED_TIFFDEV
  126. out=1
  127. fi
  128. fi
  129. if [[ -n $NEED_SDLDEV ]];then
  130. if ! test -f /usr/include/SDL/SDL.h >/dev/null; then
  131. echo >&2 You need libSDL headers to build $NEED_SDLDEV
  132. out=1
  133. fi
  134. fi
  135. if [[ -n $NEED_SDLIMAGEDEV ]];then
  136. if ! test -f /usr/include/SDL/SDL_image.h >/dev/null; then
  137. echo >&2 You need libSDL-image headers to build $NEED_SDLIMAGEDEV
  138. out=1
  139. fi
  140. fi
  141. if [[ -n $NEED_JPEGDEV ]];then
  142. if ! test -f /usr/include/jpeglib.h >/dev/null; then
  143. echo >&2 You need libjpeg headers to build $NEED_JPEGDEV
  144. out=1
  145. fi
  146. fi
  147. if [[ -n $NEED_LZODEV ]];then
  148. if ! test -f /usr/include/lzo/lzo1.h >/dev/null; then
  149. echo >&2 You need liblzo headers to build $NEED_LZODEV
  150. out=1
  151. fi
  152. fi
  153. if [[ -n $NEED_LIBNLDEV ]];then
  154. if ! test -f /usr/include/netlink/netlink.h >/dev/null; then
  155. echo >&2 You need libnl headers to build $NEED_LIBNLDEV
  156. out=1
  157. fi
  158. fi
  159. if [[ -n $NEED_X11DEV ]];then
  160. if ! test -f /usr/include/X11/Xlib.h >/dev/null; then
  161. echo >&2 You need X11 headers to build $NEED_X11DEV
  162. out=1
  163. fi
  164. fi
  165. if [[ -n $NEED_XEXTDEV ]];then
  166. if ! test -f /usr/include/X11/extensions/XShm.h >/dev/null; then
  167. echo >&2 You need X11 extensions headers to build $NEED_XEXTDEV
  168. out=1
  169. fi
  170. fi
  171. if [[ -n $NEED_LIBSSLDEV ]]; then
  172. if ! test -f /usr/include/openssl/ssl.h >/dev/null; then
  173. echo >&2 You need openssl headers to build $NEED_LIBSSLDEV
  174. out=1
  175. fi
  176. fi
  177. if [[ -n $NEED_GROFF ]]; then
  178. if ! which groff >/dev/null 2>&1; then
  179. echo >&2 You need groff to build $NEED_GROFF
  180. out=1
  181. fi
  182. fi
  183. if [[ -n $NEED_MKFONTDIR ]]; then
  184. if ! which mkfontdir >/dev/null 2>&1; then
  185. echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
  186. out=1
  187. fi
  188. fi
  189. if [[ -n $NEED_INTL ]]; then
  190. if ! which intltool-update >/dev/null 2>&1; then
  191. echo >&2 You need intltool to build $NEED_INTL
  192. out=1
  193. fi
  194. fi
  195. if [[ -n $NEED_WWW ]]; then
  196. if ! which w3m >/dev/null 2>&1; then
  197. if ! which lynx >/dev/null 2>&1; then
  198. if ! which links >/dev/null 2>&1; then
  199. echo >&2 You need w3m/links/lynx to build $NEED_WWW
  200. out=1
  201. fi
  202. fi
  203. fi
  204. fi
  205. if [[ -n $NEED_GXX ]]; then
  206. if ! which g++ >/dev/null 2>&1; then
  207. echo >&2 You need GNU c++ compiler to build $NEED_GXX
  208. out=1
  209. fi
  210. fi
  211. if [[ -n $NEED_XKBCOMP ]]; then
  212. if ! which xkbcomp >/dev/null 2>&1; then
  213. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  214. out=1
  215. fi
  216. fi
  217. if [[ -n $NEED_RPM ]]; then
  218. if ! which rpmbuild >/dev/null 2>&1; then
  219. echo >&2 You need rpmbuild to to use $NEED_RPM package backend
  220. out=1
  221. fi
  222. fi
  223. if [[ -n $NEED_XSLTPROC ]]; then
  224. if ! which xsltproc >/dev/null 2>&1; then
  225. echo >&2 You need xsltproc to build $NEED_XSLTPROC
  226. out=1
  227. fi
  228. fi
  229. if [[ -n $NEED_DBUSGLIB ]]; then
  230. if ! which dbus-binding-tool >/dev/null 2>&1; then
  231. echo >&2 You need dbus-binding-tool to build $NEED_DBUSGLIB
  232. out=1
  233. fi
  234. fi
  235. if [[ -n $ADK_USE_CCACHE ]]; then
  236. if ! which ccache >/dev/null 2>&1; then
  237. echo >&2 You have selected to build with ccache, but ccache could not be found.
  238. out=1
  239. fi
  240. fi
  241. exit $out