scan-pkgs.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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_COMPILE_AVAHI ]]; then
  27. NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
  28. fi
  29. #if [[ -n $ADK_PACKAGE_RUBY ]]; then
  30. # NEED_RUBY="$NEED_RUBY ruby"
  31. #fi
  32. if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
  33. NEED_GLIBZWO="$NEED_GLIBZWO glib2"
  34. NEED_GETTEXT="$NEED_GETTEXT glib2"
  35. NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
  36. fi
  37. #-- start checking dependencies here --
  38. if [[ -n $NEED_GETTEXT ]]; then
  39. if ! which xgettext >/dev/null 2>&1; then
  40. echo >&2 You need gettext to build $NEED_GETTEXT
  41. out=1
  42. elif ! which msgfmt >/dev/null 2>&1; then
  43. echo >&2 You need gettext to build $NEED_GETTEXT
  44. out=1
  45. fi
  46. fi
  47. if [[ -n $NEED_RUBY ]]; then
  48. if ! which ruby >/dev/null 2>&1; then
  49. echo >&2 You need ruby to build $NEED_RUBY
  50. out=1
  51. fi
  52. fi
  53. if [[ -n $NEED_XMLTO ]]; then
  54. if ! which xmlto >/dev/null 2>&1; then
  55. echo >&2 You need xmlto to build $NEED_XMLTO
  56. out=1
  57. fi
  58. fi
  59. if [[ -n $NEED_PKGCONFIG ]]; then
  60. if ! which pkg-config >/dev/null 2>&1; then
  61. echo >&2 You need pkg-config to build $NEED_PKGCONFIG
  62. out=1
  63. fi
  64. fi
  65. if [[ -n $NEED_GLIBZWO ]]; then
  66. if ! which glib-genmarshal >/dev/null 2>&1; then
  67. echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
  68. out=1
  69. fi
  70. fi
  71. if [[ -n $ADK_USE_CCACHE ]]; then
  72. if ! which ccache >/dev/null 2>&1; then
  73. echo >&2 You have selected to build with ccache, but ccache could not be found.
  74. out=1
  75. fi
  76. fi
  77. #if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
  78. # echo >&2 mySQL does not build on non-GNU/Linux.
  79. # out=1
  80. #fi
  81. #-- end of dependency checks
  82. exit $out