All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@entel.upc.edu>
To: xen-devel@lists.xensource.com
Subject: [PATCH] tools/check: check for headers and libraries in EXTRA_INCLUDES and EXTRA_LIB
Date: Thu, 13 Oct 2011 15:24:35 +0200	[thread overview]
Message-ID: <8fe2ca552de44aa679be.1318512275@loki> (raw)

# HG changeset patch
# User Roger Pau Monne <roger.pau@entel.upc.edu>
# Date 1318512213 -7200
# Node ID 8fe2ca552de44aa679be3184b1f98f50a00507e2
# Parent  8d316acde60f93cc8563a3c18950e9cbc3ab7fa8
tools/check: check for headers and libraries in EXTRA_INCLUDES and EXTRA_LIB

Parse EXTRA_INCLUDES and EXTRA_LIB during checks, to search for required files.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>

diff -r 8d316acde60f -r 8fe2ca552de4 tools/check/Makefile
--- a/tools/check/Makefile	Thu Oct 13 13:59:02 2011 +0200
+++ b/tools/check/Makefile	Thu Oct 13 15:23:33 2011 +0200
@@ -7,12 +7,12 @@ all install: check-build
 # Check this machine is OK for building on.
 .PHONY: check-build
 check-build:
-	PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) ./chk build
+	PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) EXTRA_INCLUDES=$(EXTRA_INCLUDES) EXTRA_LIB=$(EXTRA_LIB) ./chk build
 
 # Check this machine is OK for installing on.
 .PHONY: check-install
 check-install:
-	PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) ./chk install
+	PYTHON=$(PYTHON) LIBXENAPI_BINDINGS=$(LIBXENAPI_BINDINGS) EXTRA_INCLUDES=$(EXTRA_INCLUDES) EXTRA_LIB=$(EXTRA_LIB) ./chk install
 
 .PHONY: clean
 clean:
diff -r 8d316acde60f -r 8fe2ca552de4 tools/check/funcs.sh
--- a/tools/check/funcs.sh	Thu Oct 13 13:59:02 2011 +0200
+++ b/tools/check/funcs.sh	Thu Oct 13 15:23:33 2011 +0200
@@ -25,15 +25,23 @@ has_or_fail() {
 }
 
 has_header() {
+	check_sys_root || return 1
+
 	case $1 in
 		/*) ;;
-		*) set -- "/usr/include/$1" ;;
+		*)
+		if [ -r "$CROSS_SYS_ROOT/usr/include/$1" ]; then
+			return 0
+		fi
+		for path in ${EXTRA_INCLUDES}; do
+			if [ -r "$CROSS_SYS_ROOT${path}/$1" ]; then
+				return 0
+			fi
+		done
+		;;
 	esac
 
-	check_sys_root || return 1
-
-	test -r "$CROSS_SYS_ROOT$1"
-	return $?
+	return 1
 }
 
 has_lib() {
@@ -42,6 +50,7 @@ has_lib() {
 	# subshell to prevent pollution of caller's environment
 	(
 	PATH=/sbin:$PATH        # for ldconfig
+	LIBRARIES="$EXTRA_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.
@@ -49,8 +58,15 @@ has_lib() {
 	    echo "Please run ldconfig -r \"$CROSS_SYS_ROOT\" to generate ld.so.cache"
 	    # fall through; ldconfig test below should fail
 	fi
-	ldconfig -p ${CROSS_SYS_ROOT+-r "$CROSS_SYS_ROOT"} | grep -Fq "$1"
-	return $?
+	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
 	)
 }

             reply	other threads:[~2011-10-13 13:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-13 13:24 Roger Pau Monne [this message]
2011-10-17 15:39 ` [PATCH] tools/check: check for headers and libraries in EXTRA_INCLUDES and EXTRA_LIB Ian Jackson
2011-10-18  9:20   ` Roger Pau Monné
2011-10-18 13:20     ` Ian Jackson
2011-10-19  8:10       ` Roger Pau Monné
2011-10-19  8:13         ` Roger Pau Monné
2011-10-25 14:44         ` Ian Jackson
2011-10-25 16:40           ` Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8fe2ca552de44aa679be.1318512275@loki \
    --to=roger.pau@entel.upc.edu \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.