From b7d7bde93532745ac21f2a09b7f926533f104861 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 22 Jan 2008 09:44:17 +0000 Subject: Make tools/check scripts cross-friendly This patch introduces tools/check/funcs.sh with some cross-friendly abstractions, then modifies the check_* scripts to use them. Signed-off-by: Aron Griffis --- tools/check/check_curl | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) (limited to 'tools/check/check_curl') diff --git a/tools/check/check_curl b/tools/check/check_curl index 7176c896c7..eb6add3ef4 100755 --- a/tools/check/check_curl +++ b/tools/check/check_curl @@ -1,38 +1,13 @@ #!/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 +. funcs.sh -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 +if [ "$LIBXENAPI_BINDINGS" != "y" ]; then + echo -n "unused, " + exit 0 fi -rm -f $tmpfile -exit $RC +has_or_fail curl-config +curl_libs=`curl-config --libs` || fail "curl-config --libs failed" +test_link $curl_libs || fail "dependency libraries for curl are missing" -- cgit v1.2.3