scan-pkgs.sh 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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_PACKAGE_XBMC ]]; then
  21. NEED_JAVA="$NEED_JAVA xbmc"
  22. fi
  23. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  24. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  25. fi
  26. if [[ -n $ADK_COMPILE_COROSYNC ]]; then
  27. NEED_GROFF="$NEED_GROFF corosync"
  28. fi
  29. if [[ -n $ADK_PACKAGE_LIBXFONT ]]; then
  30. NEED_XMLTO="$NEED_XMLTO libXfont"
  31. fi
  32. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
  33. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
  34. fi
  35. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
  36. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
  37. fi
  38. if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
  39. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
  40. fi
  41. if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
  42. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
  43. fi
  44. if [[ -n $NEED_GROFF ]]; then
  45. if ! which groff >/dev/null 2>&1; then
  46. echo >&2 You need groff to build $NEED_GROFF
  47. out=1
  48. fi
  49. fi
  50. if [[ -n $NEED_MKFONTDIR ]]; then
  51. if ! which mkfontdir >/dev/null 2>&1; then
  52. echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
  53. out=1
  54. fi
  55. fi
  56. if [[ -n $NEED_XKBCOMP ]]; then
  57. if ! which xkbcomp >/dev/null 2>&1; then
  58. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  59. out=1
  60. fi
  61. fi
  62. if [[ -n $NEED_JAVA ]]; then
  63. if ! which java >/dev/null 2>&1; then
  64. echo >&2 You need java to build $NEED_JAVA
  65. out=1
  66. fi
  67. fi
  68. exit $out