summaryrefslogtreecommitdiff
path: root/scripts/scan-pkgs.sh
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /scripts/scan-pkgs.sh
Initial import
Diffstat (limited to 'scripts/scan-pkgs.sh')
-rw-r--r--scripts/scan-pkgs.sh100
1 files changed, 100 insertions, 0 deletions
diff --git a/scripts/scan-pkgs.sh b/scripts/scan-pkgs.sh
new file mode 100644
index 000000000..ee62ed33f
--- /dev/null
+++ b/scripts/scan-pkgs.sh
@@ -0,0 +1,100 @@
+# $Id: scan-pkgs.sh 431 2009-05-09 01:01:40Z wbx $
+#-
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+#-
+# Scan host-tool prerequisites of certain packages before building.
+
+if test -z "$BASH_VERSION"; then
+ foo=`$BASH -c 'echo "$BASH_VERSION"'`
+else
+ foo=$BASH_VERSION
+fi
+
+if test -z "$foo"; then
+ echo OpenADK requires GNU bash to be installed.
+ exit 1
+fi
+
+test -z "$BASH_VERSION$KSH_VERSION" && exec $BASH $0 "$@"
+
+[[ -n $BASH_VERSION ]] && shopt -s extglob
+topdir=$(readlink -nf $(dirname $0)/.. 2>/dev/null || (cd $(dirname $0)/..; pwd -P))
+OStype=$(env NOFAKE=yes uname)
+out=0
+
+. $topdir/.config
+
+#-- start adding dependencies here --
+if [[ -n $ADK_PACKAGE_ALSA_UTILS ]]; then
+ NEED_XMLTO="$NEED_XMLTO alsa-utils"
+fi
+
+if [[ -n $ADK_COMPILE_AVAHI ]]; then
+ NEED_PKGCONFIG="$NEED_PKGCONFIG avahi"
+fi
+
+#if [[ -n $ADK_PACKAGE_RUBY ]]; then
+# NEED_RUBY="$NEED_RUBY ruby"
+#fi
+
+if [[ -n $ADK_PACKAGE_GLIB2 ]]; then
+ NEED_GLIBZWO="$NEED_GLIBZWO glib2"
+ NEED_GETTEXT="$NEED_GETTEXT glib2"
+ NEED_PKGCONFIG="$NEED_PKGCONFIG glib2"
+fi
+
+#-- start checking dependencies here --
+
+if [[ -n $NEED_GETTEXT ]]; then
+ if ! which xgettext >/dev/null 2>&1; then
+ echo >&2 You need gettext to build $NEED_GETTEXT
+ out=1
+ elif ! which msgfmt >/dev/null 2>&1; then
+ echo >&2 You need gettext to build $NEED_GETTEXT
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_RUBY ]]; then
+ if ! which ruby >/dev/null 2>&1; then
+ echo >&2 You need ruby to build $NEED_RUBY
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_XMLTO ]]; then
+ if ! which xmlto >/dev/null 2>&1; then
+ echo >&2 You need xmlto to build $NEED_XMLTO
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_PKGCONFIG ]]; then
+ if ! which pkg-config >/dev/null 2>&1; then
+ echo >&2 You need pkg-config to build $NEED_PKGCONFIG
+ out=1
+ fi
+fi
+
+if [[ -n $NEED_GLIBZWO ]]; then
+ if ! which glib-genmarshal >/dev/null 2>&1; then
+ echo >&2 You need libglib2.0-dev to build $NEED_GLIBZWO
+ out=1
+ fi
+fi
+
+if [[ -n $ADK_USE_CCACHE ]]; then
+ if ! which ccache >/dev/null 2>&1; then
+ echo >&2 You have selected to build with ccache, but ccache could not be found.
+ out=1
+ fi
+fi
+
+#if [[ -n $ADK_COMPILE_MYSQL && $OStype != Linux ]]; then
+# echo >&2 mySQL does not build on non-GNU/Linux.
+# out=1
+#fi
+
+#-- end of dependency checks
+exit $out