scan-pkgs.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # $Id: scan-pkgs.sh 431 2009-05-09 01:01:40Z wbx $
  2. #-
  3. # This file is part of the OpenADK project. OpenADK is copyrighted
  4. # material, please see the LICENCE file in the top-level directory.
  5. #-
  6. # Scan host-tool prerequisites of certain packages before building.
  7. if test -z "$BASH_VERSION"; then
  8. foo=`$BASH -c 'echo "$BASH_VERSION"'`
  9. else
  10. foo=$BASH_VERSION
  11. fi
  12. if test -z "$foo"; then
  13. echo OpenADK requires GNU bash to be installed.
  14. exit 1
  15. fi
  16. test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
  17. [[ -n $BASH_VERSION ]] && shopt -s extglob
  18. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  19. OStype=$(env NOFAKE=yes uname)
  20. out=0
  21. . $topdir/.config
  22. #-- start adding dependencies here --
  23. if [[ -n $ADK_PACKAGE_ALSA_UTILS ]]; then
  24. NEED_XMLTO="$NEED_XMLTO alsa-utils"
  25. fi
  26. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  27. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  28. fi
  29. if [[ -n $ADK_COMPILE_AVAHI ]]; then
  30. NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
  31. fi
  32. #if [[ -n $ADK_PACKAGE_RUBY ]]; then
  33. # NEED_RUBY="$NEED_RUBY ruby"
  34. #fi
  35. if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
  36. NEED_GLIBZWO="$NEED_GLIBZWO glib2"
  37. NEED_GETTEXT="$NEED_GETTEXT glib2"
  38. NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
  39. fi
  40. #-- start checking dependencies here --
  41. if [[ -n $NEED_GETTEXT ]]; then
  42. if ! which xgettext >/dev/null 2>&1; then
  43. echo >&2 You need gettext to build $NEED_GETTEXT
  44. out=1
  45. elif ! which msgfmt >/dev/null 2>&1; then
  46. echo >&2 You need gettext to build $NEED_GETTEXT
  47. out=1
  48. fi
  49. fi
  50. if [[ -n $NEED_RUBY ]]; then
  51. if ! which ruby >/dev/null 2>&1; then
  52. echo >&2 You need ruby to build $NEED_RUBY
  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_XMLTO ]]; then
  63. if ! which xmlto >/dev/null 2>&1; then
  64. echo >&2 You need xmlto to build $NEED_XMLTO
  65. out=1
  66. fi
  67. fi
  68. if [[ -n $NEED_PKGCONFIG ]]; then
  69. if ! which pkg-config >/dev/null 2>&1; then
  70. echo >&2 You need pkg-config to build $NEED_PKGCONFIG
  71. out=1
  72. fi
  73. fi
  74. if [[ -n $NEED_GLIBZWO ]]; then
  75. if ! which glib-genmarshal >/dev/null 2>&1; then
  76. echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
  77. out=1
  78. fi
  79. fi
  80. if [[ -n $ADK_USE_CCACHE ]]; then
  81. if ! which ccache >/dev/null 2>&1; then
  82. echo >&2 You have selected to build with ccache, but ccache could not be found.
  83. out=1
  84. fi
  85. fi
  86. #if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
  87. # echo >&2 mySQL does not build on non-GNU/Linux.
  88. # out=1
  89. #fi
  90. #-- end of dependency checks
  91. exit $out