scan-pkgs.sh 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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_PACEMAKER_MGMTD ]]; then
  86. NEED_SWIG="$NEED_SWIG pacemaker-mgmtd"
  87. fi
  88. if [[ -n $ADK_PACKAGE_EGLIBC ]]; then
  89. NEED_GPERF="$NEED_GPERF eglibc"
  90. fi
  91. if [[ -n $ADK_PACKAGE_XBMC ]]; then
  92. NEED_SDLDEV="$NEED_SDLDEV xbmc"
  93. NEED_SDLIMAGEDEV="$NEED_SDLIMAGEDEV xbmc"
  94. fi
  95. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
  96. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
  97. fi
  98. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
  99. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
  100. fi
  101. if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
  102. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
  103. fi
  104. if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
  105. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
  106. fi
  107. if [[ -n $NEED_LIBTIRPCDEV ]];then
  108. if ! test -f /usr/include/tirpc/netconfig.h >/dev/null; then
  109. echo >&2 You need tirpc headers to build $NEED_LIBTIRPCDEV
  110. out=1
  111. fi
  112. fi
  113. if [[ -n $NEED_LIBXML2_DEV ]];then
  114. if ! test -f /usr/include/libxml2/libxml/xmlversion.h >/dev/null; then
  115. echo >&2 You need libxml2 headers to build $NEED_LIBXML2_DEV
  116. out=1
  117. fi
  118. fi
  119. if [[ -n $NEED_LIBKRB5DEV ]];then
  120. if ! test -f /usr/include/krb5.h >/dev/null; then
  121. echo >&2 You need krb5 headers to build $NEED_LIBKRB5DEV
  122. out=1
  123. fi
  124. fi
  125. if [[ -n $NEED_CURLDEV ]];then
  126. if ! test -f /usr/include/curl/curl.h >/dev/null; then
  127. if ! test -f /usr/local/include/curl/curl.h >/dev/null; then
  128. echo >&2 You need curl headers to build $NEED_CURLDEV
  129. out=1
  130. fi
  131. fi
  132. fi
  133. if [[ -n $NEED_TIFFDEV ]];then
  134. if ! test -f /usr/include/tiff.h >/dev/null; then
  135. echo >&2 You need libtiff headers to build $NEED_TIFFDEV
  136. out=1
  137. fi
  138. fi
  139. if [[ -n $NEED_SDLDEV ]];then
  140. if ! test -f /usr/include/SDL/SDL.h >/dev/null; then
  141. echo >&2 You need libSDL headers to build $NEED_SDLDEV
  142. out=1
  143. fi
  144. fi
  145. if [[ -n $NEED_SDLIMAGEDEV ]];then
  146. if ! test -f /usr/include/SDL/SDL_image.h >/dev/null; then
  147. echo >&2 You need libSDL-image headers to build $NEED_SDLIMAGEDEV
  148. out=1
  149. fi
  150. fi
  151. if [[ -n $NEED_JPEGDEV ]];then
  152. if ! test -f /usr/include/jpeglib.h >/dev/null; then
  153. echo >&2 You need libjpeg headers to build $NEED_JPEGDEV
  154. out=1
  155. fi
  156. fi
  157. if [[ -n $NEED_LZODEV ]];then
  158. if ! test -f /usr/include/lzo/lzo1.h >/dev/null; then
  159. echo >&2 You need liblzo headers to build $NEED_LZODEV
  160. out=1
  161. fi
  162. fi
  163. if [[ -n $NEED_LIBNLDEV ]];then
  164. if ! test -f /usr/include/netlink/netlink.h >/dev/null; then
  165. echo >&2 You need libnl headers to build $NEED_LIBNLDEV
  166. out=1
  167. fi
  168. fi
  169. if [[ -n $NEED_X11DEV ]];then
  170. if ! test -f /usr/include/X11/Xlib.h >/dev/null; then
  171. echo >&2 You need X11 headers to build $NEED_X11DEV
  172. out=1
  173. fi
  174. fi
  175. if [[ -n $NEED_XEXTDEV ]];then
  176. if ! test -f /usr/include/X11/extensions/XShm.h >/dev/null; then
  177. echo >&2 You need X11 extensions headers to build $NEED_XEXTDEV
  178. out=1
  179. fi
  180. fi
  181. if [[ -n $NEED_LIBSSLDEV ]]; then
  182. if ! test -f /usr/include/openssl/ssl.h >/dev/null; then
  183. echo >&2 You need openssl headers to build $NEED_LIBSSLDEV
  184. out=1
  185. fi
  186. fi
  187. if [[ -n $NEED_GROFF ]]; then
  188. if ! which groff >/dev/null 2>&1; then
  189. echo >&2 You need groff to build $NEED_GROFF
  190. out=1
  191. fi
  192. fi
  193. if [[ -n $NEED_MKFONTDIR ]]; then
  194. if ! which mkfontdir >/dev/null 2>&1; then
  195. echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
  196. out=1
  197. fi
  198. fi
  199. if [[ -n $NEED_INTL ]]; then
  200. if ! which intltool-update >/dev/null 2>&1; then
  201. echo >&2 You need intltool to build $NEED_INTL
  202. out=1
  203. fi
  204. fi
  205. if [[ -n $NEED_WWW ]]; then
  206. if ! which w3m >/dev/null 2>&1; then
  207. if ! which lynx >/dev/null 2>&1; then
  208. if ! which links >/dev/null 2>&1; then
  209. echo >&2 You need w3m/links/lynx to build $NEED_WWW
  210. out=1
  211. fi
  212. fi
  213. fi
  214. fi
  215. if [[ -n $NEED_SWIG ]]; then
  216. if ! which swig >/dev/null 2>&1; then
  217. echo >&2 You need swig to build $NEED_SWIG
  218. out=1
  219. fi
  220. fi
  221. if [[ -n $NEED_GPERF ]]; then
  222. if ! which gperf >/dev/null 2>&1; then
  223. echo >&2 You need gperf to build $NEED_GPERF
  224. out=1
  225. fi
  226. fi
  227. if [[ -n $NEED_GXX ]]; then
  228. if ! which g++ >/dev/null 2>&1; then
  229. echo >&2 You need GNU c++ compiler to build $NEED_GXX
  230. out=1
  231. fi
  232. fi
  233. if [[ -n $NEED_XKBCOMP ]]; then
  234. if ! which xkbcomp >/dev/null 2>&1; then
  235. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  236. out=1
  237. fi
  238. fi
  239. if [[ -n $NEED_RPM ]]; then
  240. if ! which rpmbuild >/dev/null 2>&1; then
  241. echo >&2 You need rpmbuild to to use $NEED_RPM package backend
  242. out=1
  243. fi
  244. fi
  245. if [[ -n $NEED_XSLTPROC ]]; then
  246. if ! which xsltproc >/dev/null 2>&1; then
  247. echo >&2 You need xsltproc to build $NEED_XSLTPROC
  248. out=1
  249. fi
  250. fi
  251. if [[ -n $NEED_DBUSGLIB ]]; then
  252. if ! which dbus-binding-tool >/dev/null 2>&1; then
  253. echo >&2 You need dbus-binding-tool to build $NEED_DBUSGLIB
  254. out=1
  255. fi
  256. fi
  257. if [[ -n $ADK_USE_CCACHE ]]; then
  258. if ! which ccache >/dev/null 2>&1; then
  259. echo >&2 You have selected to build with ccache, but ccache could not be found.
  260. out=1
  261. fi
  262. fi
  263. exit $out