Skip to contentSkip to conversation

tools: Check presence of ncurses

PATCH In review Samuel Thibault 2 participants 3 messages Mar 4, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools: Check presence of ncurses

Add a check for the presence of ncurses development files

tools/check/check_curses_devel new file +14 -0
diff -r b28ae5f00553 tools/check/check_curses_devel
@@ -0,0 +1,14 @@
+#!/bin/sh
+# CHECK-BUILD
+
+RC=0
+
+set -e
+test -r /usr/include/curses.h || RC=1
+
+if test ${RC} -ne 0; then
+	echo
+	echo " *** Check for curses headers FAILED"
+fi 
+
+exit ${RC}
#1 lore raw

Will this break cross-compile environments? Xentop is not built in that case (hence no dependency on curses.h), yet your new check will still be enforced. If it is the xentop usage that you are wanting to protect with a check, perhaps the compile-or-not decision in xenstat/Makefile should be made dynamically based on presence of curses.h?

-- Keir

Quoted 27 lines · Samuel Thibault

Add a check for the presence of ncurses development files

diff -r b28ae5f00553 tools/check/check_curses_devel

tools/check/check_curses_devel Tue Mar 04 11:06:06 2008 +0000 renamed from dev/null Thu Jan 01 00:00:00 1970 +0000 +14 -0
@@ -0,0 +1,14 @@
+#!/bin/sh
+# CHECK-BUILD
+
+RC=0
+
+set -e
+test -r /usr/include/curses.h || RC=1
+
+if test ${RC} -ne 0; then
+ echo
+ echo " *** Check for curses headers FAILED"
+fi 
+
+exit ${RC}

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw
Quoted 5 lines · Keir Fraser, le Tue 04 Mar 2008 11:24:46 +0000, a écrit :

Will this break cross-compile environments? Xentop is not built in that case (hence no dependency on curses.h), yet your new check will still be enforced. If it is the xentop usage that you are wanting to protect with a check, perhaps the compile-or-not decision in xenstat/Makefile should be made dynamically based on presence of curses.h?

Something like this then:

tools: Compile xentop only if curses are available.

tools/xenstat/Makefile +2 -0
diff -r c89f6ed56351 tools/xenstat/Makefile
@@ -6,7 +6,9 @@ SUBDIRS += libxenstat
 
 # This doesn't cross-compile (cross-compile environments rarely have curses)
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
+ifeq ($(wildcard /usr/include/curses.h),/usr/include/curses.h)
 SUBDIRS += xentop
+endif
 endif
 
 .PHONY: all install clean