Files
xen/tools/m4/curses.m4
T
Roger Pau Monne 65da491321 autoconf: add check for curses library
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>
2012-03-13 15:23:35 +00:00

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)
])