update coreutils to latest stable version
[openadk.git] / scripts / scan-pkgs.sh
blob416d3a4d4df19f1e3cf4bb7a934179abf9ff0582
1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 # Scan host-tool prerequisites of certain packages before building.
6 if test -z "$BASH_VERSION"; then
7 foo=`$BASH -c 'echo "$BASH_VERSION"'`
8 else
9 foo=$BASH_VERSION
12 if test -z "$foo"; then
13 echo OpenADK requires GNU bash to be installed.
14 exit 1
17 test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
19 [[ -n $BASH_VERSION ]] && shopt -s extglob
20 topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
21 OStype=$(uname)
22 out=0
24 . $topdir/.config
26 if [[ -n $ADK_PACKAGE_KODI ]]; then
27 NEED_JAVA="$NEED_JAVA kodi"
30 if [[ -n $ADK_PACKAGE_ICU4C ]]; then
31 NEED_STATIC_LIBSTDCXX="$NEED_STATIC_LIBSTDCXX icu4c"
34 if [[ -n $ADK_PACKAGE_XKEYBOARD_CONFIG ]]; then
35 NEED_XKBCOMP="$NEED_XKBCOMP xkeyboard-config"
38 if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_100DPI ]]; then
39 NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-100dpi"
42 if [[ -n $ADK_PACKAGE_FONT_BITSTREAM_75DPI ]]; then
43 NEED_MKFONTDIR="$NEED_MKFONTDIR font-bitstream-75dpi"
46 if [[ -n $ADK_PACKAGE_FONT_ADOBE_100DPI ]]; then
47 NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-100dpi"
50 if [[ -n $ADK_PACKAGE_FONT_ADOBE_75DPI ]]; then
51 NEED_MKFONTDIR="$NEED_MKFONTDIR font-adobe-75dpi"
54 if [[ -n $NEED_MKFONTDIR ]]; then
55 if ! which mkfontdir >/dev/null 2>&1; then
56 echo >&2 You need mkfontdir to build $NEED_MKFONTDIR
57 out=1
61 if [[ -n $NEED_XKBCOMP ]]; then
62 if ! which xkbcomp >/dev/null 2>&1; then
63 echo >&2 You need xkbcomp to build $NEED_XKBCOMP
64 out=1
68 if [[ -n $NEED_JAVA ]]; then
69 if ! which java >/dev/null 2>&1; then
70 echo >&2 You need java to build $NEED_JAVA
71 out=1
75 if [[ -n $NEED_STATIC_LIBSTDCXX ]]; then
76 cat >test.c <<-'EOF'
77 #include <stdio.h>
78 int
79 main()
81 return (0);
83 EOF
84 if ! g++ -static-libstdc++ -o test test.c ; then
85 echo >&2 You need static version of libstdc++ installed to build $NEED_STATIC_LIBSTDCXX
86 out=1
87 rm test 2>/dev/null
91 exit $out