From a58a6ff7e5a354b7f743ebdba219f42655c1695b Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Fri, 21 Oct 2011 11:35:32 +0200
Subject: check for X.h existence

---
 scripts/scan-pkgs.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/scripts/scan-pkgs.sh b/scripts/scan-pkgs.sh
index 0bf8f5808..67703df58 100644
--- a/scripts/scan-pkgs.sh
+++ b/scripts/scan-pkgs.sh
@@ -61,6 +61,10 @@ if [[ -n $ADK_NATIVE ]];then
 	fi
 fi
 
+if [[ -n $ADK_PACKAGE_LIBX11 ]]; then
+	NEED_X11="$NEED_X11 libx11"
+fi
+
 if [[ -n $ADK_PACKAGE_GPSD ]]; then
 	NEED_PYTHON="$NEED_PYTHON gpsd"
 fi
@@ -236,6 +240,15 @@ if [[ -n $NEED_X11DEV ]];then
 	fi
 fi
 
+if [[ -n $NEED_X11 ]];then
+	if ! test -f /usr/include/X11/X.h >/dev/null; then
+	  if ! test -f /usr/local/include/X11/X.h >/dev/null; then
+		echo >&2 You need X11 headers to build $NEED_X11
+		out=1
+	  fi
+	fi
+fi
+
 if [[ -n $NEED_XEXTDEV ]];then
 	if ! test -f /usr/include/X11/extensions/XShm.h >/dev/null; then
 		echo >&2 You need X11 extensions headers to build $NEED_XEXTDEV
-- 
cgit v1.2.3