scan-pkgs.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. # Scan host-tool prerequisites of certain packages before building.
  4. if test -z "$BASH_VERSION"; then
  5. foo=`$BASH -c 'echo "$BASH_VERSION"'`
  6. else
  7. foo=$BASH_VERSION
  8. fi
  9. if test -z "$foo"; then
  10. echo OpenADK requires GNU bash to be installed.
  11. exit 1
  12. fi
  13. test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
  14. [[ -n $BASH_VERSION ]] && shopt -s extglob
  15. topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
  16. OStype=$(env NOFAKE=yes uname)
  17. out=0
  18. . $topdir/.config
  19. if [[ -n $ADK_PACKAGE_ALSA_UTILS ]]; then
  20. NEED_XMLTO="$NEED_XMLTO alsa-utils"
  21. fi
  22. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  23. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  24. fi
  25. if [[ -n $ADK_COMPILE_AVAHI ]]; then
  26. NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
  27. fi
  28. #if [[ -n $ADK_PACKAGE_RUBY ]]; then
  29. # NEED_RUBY="$NEED_RUBY ruby"
  30. #fi
  31. if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
  32. NEED_GLIBZWO="$NEED_GLIBZWO glib2"
  33. NEED_GETTEXT="$NEED_GETTEXT glib2"
  34. NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
  35. fi
  36. if [[ -n $NEED_GETTEXT ]]; then
  37. if ! which xgettext >/dev/null 2>&1; then
  38. echo >&2 You need gettext to build $NEED_GETTEXT
  39. out=1
  40. elif ! which msgfmt >/dev/null 2>&1; then
  41. echo >&2 You need gettext to build $NEED_GETTEXT
  42. out=1
  43. fi
  44. fi
  45. if [[ -n $NEED_RUBY ]]; then
  46. if ! which ruby >/dev/null 2>&1; then
  47. echo >&2 You need ruby to build $NEED_RUBY
  48. out=1
  49. fi
  50. fi
  51. if [[ -n $NEED_XKBCOMP ]]; then
  52. if ! which xkbcomp >/dev/null 2>&1; then
  53. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  54. out=1
  55. fi
  56. fi
  57. if [[ -n $NEED_XMLTO ]]; then
  58. if ! which xmlto >/dev/null 2>&1; then
  59. echo >&2 You need xmlto to build $NEED_XMLTO
  60. out=1
  61. fi
  62. fi
  63. if [[ -n $NEED_PKGCONFIG ]]; then
  64. if ! which pkg-config >/dev/null 2>&1; then
  65. echo >&2 You need pkg-config to build $NEED_PKGCONFIG
  66. out=1
  67. fi
  68. fi
  69. if [[ -n $NEED_GLIBZWO ]]; then
  70. if ! which glib-genmarshal >/dev/null 2>&1; then
  71. echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
  72. out=1
  73. fi
  74. fi
  75. if [[ -n $ADK_USE_CCACHE ]]; then
  76. if ! which ccache >/dev/null 2>&1; then
  77. echo >&2 You have selected to build with ccache, but ccache could not be found.
  78. out=1
  79. fi
  80. fi
  81. #if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
  82. # echo >&2 mySQL does not build on non-GNU/Linux.
  83. # out=1
  84. #fi
  85. exit $out