scan-pkgs.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_SQUID ]]; then
  29. NEED_SSLDEV="$NEED_SSLDEV squid"
  30. fi
  31. #if [[ -n $ADK_PACKAGE_RUBY ]]; then
  32. # NEED_RUBY="$NEED_RUBY ruby"
  33. #fi
  34. if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
  35. NEED_GLIBZWO="$NEED_GLIBZWO glib2"
  36. NEED_GETTEXT="$NEED_GETTEXT glib2"
  37. NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
  38. fi
  39. if [[ -n $NEED_GETTEXT ]]; then
  40. if ! which xgettext >/dev/null 2>&1; then
  41. echo >&2 You need gettext to build $NEED_GETTEXT
  42. out=1
  43. elif ! which msgfmt >/dev/null 2>&1; then
  44. echo >&2 You need gettext to build $NEED_GETTEXT
  45. out=1
  46. fi
  47. fi
  48. if [[ -n $NEED_SSLDEV ]]; then
  49. if ! test -f /usr/lib/pkgconfig/openssl.pc >/dev/null; then
  50. echo >&2 You need openssl headers to build $NEED_SQUID
  51. out=1
  52. fi
  53. fi
  54. if [[ -n $NEED_RUBY ]]; then
  55. if ! which ruby >/dev/null 2>&1; then
  56. echo >&2 You need ruby to build $NEED_RUBY
  57. out=1
  58. fi
  59. fi
  60. if [[ -n $NEED_XKBCOMP ]]; then
  61. if ! which xkbcomp >/dev/null 2>&1; then
  62. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  63. out=1
  64. fi
  65. fi
  66. if [[ -n $NEED_XMLTO ]]; then
  67. if ! which xmlto >/dev/null 2>&1; then
  68. echo >&2 You need xmlto to build $NEED_XMLTO
  69. out=1
  70. fi
  71. fi
  72. if [[ -n $NEED_PKGCONFIG ]]; then
  73. if ! which pkg-config >/dev/null 2>&1; then
  74. echo >&2 You need pkg-config to build $NEED_PKGCONFIG
  75. out=1
  76. fi
  77. fi
  78. if [[ -n $NEED_GLIBZWO ]]; then
  79. if ! which glib-genmarshal >/dev/null 2>&1; then
  80. echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
  81. out=1
  82. fi
  83. fi
  84. if [[ -n $ADK_USE_CCACHE ]]; then
  85. if ! which ccache >/dev/null 2>&1; then
  86. echo >&2 You have selected to build with ccache, but ccache could not be found.
  87. out=1
  88. fi
  89. fi
  90. #if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
  91. # echo >&2 mySQL does not build on non-GNU/Linux.
  92. # out=1
  93. #fi
  94. exit $out