| 1 | #!/usr/bin/env bash
|
|---|
| 2 | # $FreeWRT: src/share/misc/licence.template,v 1.20 2006/12/11 21:04:56 tg Rel $
|
|---|
| 3 | #-
|
|---|
| 4 | # Copyright (c) 2006
|
|---|
| 5 | # Thorsten Glaser <tg@mirbsd.de>
|
|---|
| 6 | #
|
|---|
| 7 | # Provided that these terms and disclaimer and all copyright notices
|
|---|
| 8 | # are retained or reproduced in an accompanying document, permission
|
|---|
| 9 | # is granted to deal in this work without restriction, including un-
|
|---|
| 10 | # limited rights to use, publicly perform, distribute, sell, modify,
|
|---|
| 11 | # merge, give away, or sublicence.
|
|---|
| 12 | #
|
|---|
| 13 | # Advertising materials mentioning features or use of this work must
|
|---|
| 14 | # display the following acknowledgement:
|
|---|
| 15 | # This product includes material provided by Thorsten Glaser.
|
|---|
| 16 | # This acknowledgement does not need to be reprinted if this work is
|
|---|
| 17 | # linked into a bigger work whose licence does not allow such clause
|
|---|
| 18 | # and the author of this work is given due credit in the bigger work
|
|---|
| 19 | # or its accompanying documents, where such information is generally
|
|---|
| 20 | # kept, provided that said credits are retained.
|
|---|
| 21 | #
|
|---|
| 22 | # This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
|
|---|
| 23 | # the utmost extent permitted by applicable law, neither express nor
|
|---|
| 24 | # implied; without malicious intent or gross negligence. In no event
|
|---|
| 25 | # may a licensor, author or contributor be held liable for indirect,
|
|---|
| 26 | # direct, other damage, loss, or other issues arising in any way out
|
|---|
| 27 | # of dealing in the work, even if advised of the possibility of such
|
|---|
| 28 | # damage or existence of a defect, except proven that it results out
|
|---|
| 29 | # of said person's immediate fault when using the work as intended.
|
|---|
| 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 | if [[ -n $FWRT_USE_CCACHE ]]; then
|
|---|
| 68 | NEED_CCACHE="yes"
|
|---|
| 69 | fi
|
|---|
| 70 |
|
|---|
| 71 | #-- start checking dependencies here --
|
|---|
| 72 |
|
|---|
| 73 | if [[ -n $NEED_JIKES ]]; then
|
|---|
| 74 | if ! which jikes >/dev/null 2>&1; then
|
|---|
| 75 | echo >&2 You need jikes to build $NEED_JIKES
|
|---|
| 76 | out=1
|
|---|
| 77 | fi
|
|---|
| 78 | fi
|
|---|
| 79 |
|
|---|
| 80 | if [[ -n $NEED_GETTEXT ]]; then
|
|---|
| 81 | if ! which xgettext >/dev/null 2>&1; then
|
|---|
| 82 | echo >&2 You need gettext to build $NEED_GETTEXT
|
|---|
| 83 | out=1
|
|---|
| 84 | fi
|
|---|
| 85 | fi
|
|---|
| 86 |
|
|---|
| 87 | if [[ -n $NEED_FASTJAR ]]; then
|
|---|
| 88 | if ! which fastjar >/dev/null 2>&1; then
|
|---|
| 89 | echo >&2 You need fastjar to build $NEED_FASTJAR
|
|---|
| 90 | out=1
|
|---|
| 91 | fi
|
|---|
| 92 | fi
|
|---|
| 93 |
|
|---|
| 94 | if [[ -n $NEED_PKGCONFIG ]]; then
|
|---|
| 95 | if ! which pkg-config >/dev/null 2>&1; then
|
|---|
| 96 | echo >&2 You need pkg-config to build $NEED_PKGCONFIG
|
|---|
| 97 | out=1
|
|---|
| 98 | fi
|
|---|
| 99 | fi
|
|---|
| 100 |
|
|---|
| 101 | if [[ -n $NEED_AUTOCONF_2_59 ]]; then
|
|---|
| 102 | if ! AUTOCONF_VERSION=2.59 autoconf --help 2>&1 | \
|
|---|
| 103 | fgrep gnu.org >/dev/null 2>&1; then
|
|---|
| 104 | echo >&2 You need autoconf 2.59 to build $NEED_AUTOCONF_2_59
|
|---|
| 105 | out=1
|
|---|
| 106 | fi
|
|---|
| 107 | fi
|
|---|
| 108 |
|
|---|
| 109 | if [[ -n $NEED_CCACHE ]]; then
|
|---|
| 110 | if ! which ccache >/dev/null 2>&1; then
|
|---|
| 111 | echo >&2 You have selected to build with ccache, but ccache could not be found.
|
|---|
| 112 | out=1
|
|---|
| 113 | fi
|
|---|
| 114 | fi
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 | #-- end of dependency checks
|
|---|
| 118 |
|
|---|
| 119 | exit $out
|
|---|