aboutsummaryrefslogtreecommitdiffstats
path: root/tools/check/funcs.sh
diff options
context:
space:
mode:
authorIan Jackson <ian.jackson@eu.citrix.com>2012-02-22 01:55:03 +0000
committerIan Jackson <ian.jackson@eu.citrix.com>2012-02-22 01:55:03 +0000
commit85896a7c4dc7b6b1dba2db79dfb0ca61738a92a4 (patch)
tree680508e2d4592ff706364d6c5a000729003f5f04 /tools/check/funcs.sh
parentfa674239ae719f35ee831d2d6fbfee1ccaab8303 (diff)
downloadxen-85896a7c4dc7b6b1dba2db79dfb0ca61738a92a4.tar.gz
xen-85896a7c4dc7b6b1dba2db79dfb0ca61738a92a4.tar.bz2
xen-85896a7c4dc7b6b1dba2db79dfb0ca61738a92a4.zip
build: add autoconf to replace custom checks in tools/check
Added autotools magic to replace custom check scripts. The previous checks have been ported to autoconf, and some additional ones have been added (plus the suggestions from running autoscan). Two files are created as a result from executing configure script, config/Tools.mk and config.h. conf/Tools.mk is included by tools/Rules.mk, and contains most of the options previously defined in .config, that can now be set passing parameters or defining environment variables when executing configure script. config.h is only used by libxl/xl to detect yajl_version.h. [ tools/config.sub and config.guess copied from autotools-dev 20100122.1 from Debian squeeze i386, which is GPLv2. tools/configure generated using the included ./autogen.sh which ran autoconf 2.67-2 from Debian squeeze i386. autoconf is GPLv3+ but has a special exception for the autoconf output; this exception applies to us and exempts us from complying with GPLv3+ for configure, which is good as Xen is GPL2 only. - Ian Jackson ] Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Tested-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Diffstat (limited to 'tools/check/funcs.sh')
-rw-r--r--tools/check/funcs.sh106
1 files changed, 0 insertions, 106 deletions
diff --git a/tools/check/funcs.sh b/tools/check/funcs.sh
deleted file mode 100644
index 054c579f15..0000000000
--- a/tools/check/funcs.sh
+++ /dev/null
@@ -1,106 +0,0 @@
-# has is the same as which, except it handles cross environments
-has() {
- if [ -z "$CROSS_COMPILE" ]; then
- command which "$@"
- return $?
- fi
-
- check_sys_root || return 1
-
- # subshell to prevent pollution of caller's IFS
- (
- IFS=:
- for p in $PATH; do
- if [ -x "$CROSS_SYS_ROOT/$p/$1" ]; then
- echo "$CROSS_SYS_ROOT/$p/$1"
- return 0
- fi
- done
- return 1
- )
-}
-
-has_or_fail() {
- has "$1" >/dev/null || fail "can't find $1"
-}
-
-has_header() {
- check_sys_root || return 1
-
- case $1 in
- /*) ;;
- *)
- if [ -r "$CROSS_SYS_ROOT/usr/include/$1" ]; then
- return 0
- fi
- for path in ${CHECK_INCLUDES}; do
- if [ -r "$CROSS_SYS_ROOT${path}/$1" ]; then
- return 0
- fi
- done
- ;;
- esac
-
- return 1
-}
-
-has_lib() {
- check_sys_root || return 1
-
- # subshell to prevent pollution of caller's environment
- (
- PATH=/sbin:$PATH # for ldconfig
- LIBRARIES="$CHECK_LIB /usr/lib"
-
- # This relatively common in a sys-root; libs are installed but
- # ldconfig hasn't run there, so ldconfig -p won't work.
- if [ "$OS" = Linux -a ! -f "$CROSS_SYS_ROOT/etc/ld.so.cache" ]; then
- echo "Please run ldconfig -r \"$CROSS_SYS_ROOT\" to generate ld.so.cache"
- # fall through; ldconfig test below should fail
- fi
- if [ "${OS}" = "Linux" ]; then
- ldconfig -p ${CROSS_SYS_ROOT+-r "$CROSS_SYS_ROOT"} | grep -Fq "$1"
- return $?
- fi
- if [ "${OS}" = "NetBSD" ]; then
- ls -1 ${LIBRARIES} | grep -Fq "$1"
- return $?
- fi
- return 1
- )
-}
-
-test_link() {
- # subshell to trap removal of tmpfile
- (
- unset tmpfile
- trap 'rm -f "$tmpfile"; exit' 0 1 2 15
- tmpfile=`mktemp` || return 1
- ld "$@" -o "$tmpfile" >/dev/null 2>&1
- return $?
- )
-}
-
-# this function is used commonly above
-check_sys_root() {
- [ -z "$CROSS_COMPILE" ] && return 0
- if [ -z "$CROSS_SYS_ROOT" ]; then
- echo "please set CROSS_SYS_ROOT in the environment"
- return 1
- fi
- if [ ! -d "$CROSS_SYS_ROOT" ]; then
- echo "no sys-root found at $CROSS_SYS_ROOT"
- return 1
- fi
-}
-
-warning() {
- echo
- echo " *** `basename "$0"` FAILED${*+: $*}"
-}
-
-fail() {
- echo
- echo " *** `basename "$0"` FAILED${*+: $*}"
- exit 1
-}