scan-pkgs.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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_TARGET_PACKAGE_RPM ]]; then
  21. NEED_RPM="$NEED_RPM rpm"
  22. fi
  23. if [[ -n $ADK_PACKAGE_ALSA_UTILS ]]; then
  24. NEED_XMLTO="$NEED_XMLTO alsa-utils"
  25. fi
  26. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  27. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  28. fi
  29. if [[ -n $ADK_COMPILE_AVAHI ]]; then
  30. NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
  31. fi
  32. if [[ -n $ADK_PACKAGE_SQUID ]]; then
  33. NEED_SSLDEV="$NEED_SSLDEV squid"
  34. fi
  35. #if [[ -n $ADK_PACKAGE_RUBY ]]; then
  36. # NEED_RUBY="$NEED_RUBY ruby"
  37. #fi
  38. if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
  39. NEED_GLIBZWO="$NEED_GLIBZWO glib2"
  40. NEED_GETTEXT="$NEED_GETTEXT glib2"
  41. NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
  42. fi
  43. if [[ -n $NEED_GETTEXT ]]; then
  44. if ! which xgettext >/dev/null 2>&1; then
  45. echo >&2 You need gettext to build $NEED_GETTEXT
  46. out=1
  47. elif ! which msgfmt >/dev/null 2>&1; then
  48. echo >&2 You need gettext to build $NEED_GETTEXT
  49. out=1
  50. fi
  51. fi
  52. if [[ -n $NEED_SSLDEV ]]; then
  53. if ! test -f /usr/lib/pkgconfig/openssl.pc >/dev/null; then
  54. if ! test -f /usr/include/openssl/ssl.h >/dev/null; then
  55. echo >&2 You need openssl headers to build $NEED_SQUID
  56. out=1
  57. fi
  58. fi
  59. fi
  60. if [[ -n $NEED_RUBY ]]; then
  61. if ! which ruby >/dev/null 2>&1; then
  62. echo >&2 You need ruby to build $NEED_RUBY
  63. out=1
  64. fi
  65. fi
  66. if [[ -n $NEED_XKBCOMP ]]; then
  67. if ! which xkbcomp >/dev/null 2>&1; then
  68. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  69. out=1
  70. fi
  71. fi
  72. if [[ -n $NEED_XMLTO ]]; then
  73. if ! which xmlto >/dev/null 2>&1; then
  74. echo >&2 You need xmlto to build $NEED_XMLTO
  75. out=1
  76. fi
  77. fi
  78. if [[ -n $NEED_PKGCONFIG ]]; then
  79. if ! which pkg-config >/dev/null 2>&1; then
  80. echo >&2 You need pkg-config to build $NEED_PKGCONFIG
  81. out=1
  82. fi
  83. fi
  84. if [[ -n $NEED_GLIBZWO ]]; then
  85. if ! which glib-genmarshal >/dev/null 2>&1; then
  86. echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
  87. out=1
  88. fi
  89. fi
  90. if [[ -n $ADK_USE_CCACHE ]]; then
  91. if ! which ccache >/dev/null 2>&1; then
  92. echo >&2 You have selected to build with ccache, but ccache could not be found.
  93. out=1
  94. fi
  95. fi
  96. if [[ -n $NEED_RPM ]]; then
  97. if ! which rpmbuild >/dev/null 2>&1; then
  98. echo >&2 You need rpmbuild to to use $NEED_RPM package backend
  99. out=1
  100. fi
  101. fi
  102. #if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
  103. # echo >&2 mySQL does not build on non-GNU/Linux.
  104. # out=1
  105. #fi
  106. exit $out