aboutsummaryrefslogtreecommitdiffstats
path: root/tools/check/check_curl
diff options
context:
space:
mode:
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-15 10:03:14 +0100
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>2007-05-15 10:03:14 +0100
commit4fcd011a83da98c3eb3262129cd5026f9200a334 (patch)
treec18056f5ea22884b748d8bafa515951a92a689d6 /tools/check/check_curl
parent67770ae5abb15d5b29528bdcb4a6e323b59398e2 (diff)
downloadxen-4fcd011a83da98c3eb3262129cd5026f9200a334.tar.gz
xen-4fcd011a83da98c3eb3262129cd5026f9200a334.tar.bz2
xen-4fcd011a83da98c3eb3262129cd5026f9200a334.zip
tools: check for curl-devel and libxml2-devel
when they are required for LIBXENAPI_BINDINGS. Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'tools/check/check_curl')
-rwxr-xr-xtools/check/check_curl38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/check/check_curl b/tools/check/check_curl
new file mode 100755
index 0000000000..7176c896c7
--- /dev/null
+++ b/tools/check/check_curl
@@ -0,0 +1,38 @@
+#!/bin/sh
+# CHECK-BUILD CHECK-INSTALL
+
+if [ ! "$LIBXENAPI_BINDINGS" = "y" ]
+then
+ echo -n "unused, "
+ exit 0
+fi
+
+RC=0
+
+CURL_CONFIG="$(which curl-config)"
+tmpfile=$(mktemp)
+
+if test -z ${CURL_CONFIG}; then
+ RC=1
+else
+ ${CURL_CONFIG} --libs 2>&1 > /dev/null
+ RC=$?
+fi
+
+if test $RC -ne 0; then
+ echo "FAILED"
+ echo " *** curl-config is missing. "
+ echo " *** Please install curl-devel."
+elif ! ld $($CURL_CONFIG --libs) -o $tmpfile >/dev/null 2>&1; then
+ echo "FAILED"
+ echo " *** dependency libraries for curl are missing: "
+ RC=1
+ for i in $(ld $($CURL_CONFIG --libs) -o $tmpfile 2>&1 >/dev/null); do
+ case $i in
+ -l*) echo lib${i#-l}
+ esac
+ done
+fi
+rm -f $tmpfile
+
+exit $RC