scan-pkgs.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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=$(uname)
  18. out=0
  19. . $topdir/.config
  20. if [[ -n $ADK_PACKAGE_KODI ]]; then
  21. NEED_JAVA="$NEED_JAVA kodi"
  22. fi
  23. if [[ -n $ADK_PACKAGE_ICU4C ]]; then
  24. NEED_STATIC_LIBSTDCXX="$NEED_STATIC_LIBSTDCXX icu4c"
  25. fi
  26. if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
  27. NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
  28. fi
  29. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
  30. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
  31. fi
  32. if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
  33. NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
  34. fi
  35. if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
  36. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
  37. fi
  38. if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
  39. NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
  40. fi
  41. if [[ -n $NEED_MKFONTDIR ]]; then
  42. if ! which mkfontdir >/dev/null 2>&1; then
  43. echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
  44. out=1
  45. fi
  46. fi
  47. if [[ -n $NEED_XKBCOMP ]]; then
  48. if ! which xkbcomp >/dev/null 2>&1; then
  49. echo >&2 You need xkbcomp to build $NEED_XKBCOMP
  50. out=1
  51. fi
  52. fi
  53. if [[ -n $NEED_JAVA ]]; then
  54. if ! which java >/dev/null 2>&1; then
  55. echo >&2 You need java to build $NEED_JAVA
  56. out=1
  57. fi
  58. fi
  59. if [[ -n $NEED_STATIC_LIBSTDCXX ]]; then
  60. cat >test.c <<-'EOF'
  61. #include <stdio.h>
  62. int
  63. main()
  64. {
  65. return (0);
  66. }
  67. EOF
  68. if ! g++ -static-libstdc++ -o test test.c ; then
  69. echo >&2 You need static version of libstdc++ installed to build $NEED_STATIC_LIBSTDCXX
  70. out=1
  71. rm test 2>/dev/null
  72. fi
  73. fi
  74. exit $out