mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Check for a curses compatible library (curses or ncurses basically). One of those is needed to compile Xen tools (gtraceview and xentop). Modify Makefiles/sources to use configure output (fetch CURSES_LIBS from tools/Tools.mk and header to include from tools/config.h) Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
21 lines
707 B
Plaintext
21 lines
707 B
Plaintext
AC_DEFUN([AX_CHECK_CURSES], [
|
|
AC_CHECK_HEADER([curses.h], [
|
|
AC_CHECK_LIB([curses], [clear], [curses="y"], [curses="n"])
|
|
], [curses="n"])
|
|
AC_CHECK_HEADER([ncurses.h], [
|
|
AC_CHECK_LIB([ncurses], [clear], [ncurses="y"], [ncurses="n"])
|
|
], [ncurses="n"])
|
|
AS_IF([test "$curses" = "n" && test "$ncurses" = "n"], [
|
|
AC_MSG_ERROR([Unable to find a suitable curses library])
|
|
])
|
|
# Prefer ncurses over curses if both are present
|
|
AS_IF([test "$ncurses" = "y"], [
|
|
CURSES_LIBS="-lncurses"
|
|
AC_DEFINE([INCLUDE_CURSES_H], [<ncurses.h>], [Define curses header to use])
|
|
], [
|
|
CURSES_LIBS="-lcurses"
|
|
AC_DEFINE([INCLUDE_CURSES_H], [<curses.h>], [Define curses header to use])
|
|
])
|
|
AC_SUBST(CURSES_LIBS)
|
|
])
|