1
0

scan-pkgs.sh 2.7 KB

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