scan-pkgs.sh 3.1 KB

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