scan-pkgs.sh 2.1 KB

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