| 1 | #!/bin/bash
|
|---|
| 2 | # $FreeWRT: src/share/misc/licence.template,v 1.8 2006/06/16 23:03:39 tg Rel $
|
|---|
| 3 | #-
|
|---|
| 4 | # Copyright (c) 2006
|
|---|
| 5 | # Thorsten Glaser <tg@mirbsd.de>
|
|---|
| 6 | #
|
|---|
| 7 | # Licensee is hereby permitted to deal in this work without restric-
|
|---|
| 8 | # tion, including unlimited rights to use, publicly perform, modify,
|
|---|
| 9 | # merge, distribute, sell, give away or sublicence, provided all co-
|
|---|
| 10 | # pyright notices above, these terms and the disclaimer are retained
|
|---|
| 11 | # in all redistributions or reproduced in accompanying documentation
|
|---|
| 12 | # or other materials provided with binary redistributions.
|
|---|
| 13 | #
|
|---|
| 14 | # All advertising materials mentioning features or use of this soft-
|
|---|
| 15 | # ware must display the following acknowledgement:
|
|---|
| 16 | # This product includes material provided by Thorsten Glaser.
|
|---|
| 17 | # This acknowledgement does not need to be reprinted if this work is
|
|---|
| 18 | # linked into a bigger work whose licence does not allow such clause
|
|---|
| 19 | # and the author of this work is given due credit in the bigger work
|
|---|
| 20 | # or its documentation.
|
|---|
| 21 | #
|
|---|
| 22 | # Licensor offers the work "AS IS" and WITHOUT WARRANTY of any kind,
|
|---|
| 23 | # express, or implied, to the maximum extent permitted by applicable
|
|---|
| 24 | # law, without malicious intent or gross negligence; in no event may
|
|---|
| 25 | # licensor, an author or contributor be held liable for any indirect
|
|---|
| 26 | # or other damage, or direct damage except proven a consequence of a
|
|---|
| 27 | # direct error of said person and intended use of this work, loss or
|
|---|
| 28 | # other issues arising in any way out of its use, even if advised of
|
|---|
| 29 | # the possibility of such damage or existence of a nontrivial bug.
|
|---|
| 30 | #-
|
|---|
| 31 | # Scan host-tool prerequisites of certain packages before building.
|
|---|
| 32 |
|
|---|
| 33 | if test -z "$BASH_VERSION"; then
|
|---|
| 34 | echo FreeWRT requires GNU bash to be installed, sorry.
|
|---|
| 35 | exit 1
|
|---|
| 36 | fi
|
|---|
| 37 |
|
|---|
| 38 | shopt -s extglob
|
|---|
| 39 | topdir=$(readlink -nf $(dirname $0)/..)
|
|---|
| 40 | export PATH=$topdir/lbin:$PATH
|
|---|
| 41 | out=0
|
|---|
| 42 |
|
|---|
| 43 | . $topdir/.config
|
|---|
| 44 |
|
|---|
| 45 | #-- start adding dependencies here --
|
|---|
| 46 |
|
|---|
| 47 | if [[ -n $FWRT_COMPILE_SABLEVM_CLASSPATH ]]; then
|
|---|
| 48 | NEED_JIKES="$NEED_JIKES sablevm-classpath"
|
|---|
| 49 | fi
|
|---|
| 50 |
|
|---|
| 51 | if [[ -n $FWRT_COMPILE_SABLEVM_CLASSPATH ]]; then
|
|---|
| 52 | NEED_FASTJAR="$NEED_FASTJAR sablevm-classpath"
|
|---|
| 53 | fi
|
|---|
| 54 |
|
|---|
| 55 | if [[ -n $FWRT_COMPILE_AVAHI ]]; then
|
|---|
| 56 | NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
|
|---|
| 57 | fi
|
|---|
| 58 |
|
|---|
| 59 | if [[ -n $FWRT_COMPILE_POPT ]]; then
|
|---|
| 60 | NEED_GETTEXT="$NEED_GETTEXT popt"
|
|---|
| 61 | fi
|
|---|
| 62 |
|
|---|
| 63 | if [[ -n $FWRT_PACKAGE_PRIVOXY ]]; then
|
|---|
| 64 | NEED_AUTOCONF_2_59="$NEED_AUTOCONF_2_59 privoxy"
|
|---|
| 65 | fi
|
|---|
| 66 |
|
|---|
| 67 | #-- start checking dependencies here --
|
|---|
| 68 |
|
|---|
| 69 | if [[ -n $NEED_JIKES ]]; then
|
|---|
| 70 | if ! which jikes >/dev/null 2>&1; then
|
|---|
| 71 | echo >&2 You need jikes to build $NEED_JIKES
|
|---|
| 72 | out=1
|
|---|
| 73 | fi
|
|---|
| 74 | fi
|
|---|
| 75 |
|
|---|
| 76 | if [[ -n $NEED_GETTEXT ]]; then
|
|---|
| 77 | if ! which xgettext >/dev/null 2>&1; then
|
|---|
| 78 | echo >&2 You need gettext to build $NEED_GETTEXT
|
|---|
| 79 | out=1
|
|---|
| 80 | fi
|
|---|
| 81 | fi
|
|---|
| 82 |
|
|---|
| 83 | if [[ -n $NEED_FASTJAR ]]; then
|
|---|
| 84 | if ! which fastjar >/dev/null 2>&1; then
|
|---|
| 85 | echo >&2 You need fastjar to build $NEED_FASTJAR
|
|---|
| 86 | out=1
|
|---|
| 87 | fi
|
|---|
| 88 | fi
|
|---|
| 89 |
|
|---|
| 90 | if [[ -n $NEED_PKGCONFIG ]]; then
|
|---|
| 91 | if ! which pkg-config >/dev/null 2>&1; then
|
|---|
| 92 | echo >&2 You need pkg-config to build $NEED_PKGCONFIG
|
|---|
| 93 | out=1
|
|---|
| 94 | fi
|
|---|
| 95 | fi
|
|---|
| 96 |
|
|---|
| 97 | if [[ -n $NEED_AUTOCONF_2_59 ]]; then
|
|---|
| 98 | if ! AUTOCONF_VERSION=2.59 autoconf --help 2>&1 | \
|
|---|
| 99 | fgrep gnu.org >/dev/null 2>&1; then
|
|---|
| 100 | echo >&2 You need autoconf 2.59 to build $NEED_AUTOCONF_2_59
|
|---|
| 101 | out=1
|
|---|
| 102 | fi
|
|---|
| 103 | fi
|
|---|
| 104 |
|
|---|
| 105 | #-- end of dependency checks
|
|---|
| 106 |
|
|---|
| 107 | exit $out
|
|---|