echo
AC_PATH_XTRA
+#
+# Check for ncurses.
+#
+
+AC_ARG_WITH([curses],
+ [AS_HELP_STRING([--with-curses],
+ [enable curses UI])],
+ [],
+ [with_curses=check])
+
+LIBCURSES=
+AS_IF([test "x$with_curses" != xno],
+ [AC_CHECK_LIB([curses], [clrtoeol],
+ [AC_SUBST([LIBCURSES], ["-lcurses"])
+ AC_DEFINE([HAVE_LIBCURSES], [1],
+ [Define if you have lib])
+ ],
+ [AC_MSG_FAILURE(
+ [--with-curses was given, but test for curses failed])],
+ [-ltermcap])])
#
# Check for other libraries.
#
-AC_CHECK_LIB(curses, clrtoeol)
AC_CHECK_LIB(m, pow)
dnl Replace `main' with a function in -ltermcap:
AC_CHECK_LIB(termcap, tgoto)
case DISPLAY_X: \
func args; \
break
+
+#ifdef HAVE_LIBCURSES
#define CASE_DSP_CURSES(func,args) \
case DISPLAY_CURSES: \
func args; \
break;
+#else
+#define CASE_DSP_CURSES(func,args)
+#endif
#define DISPLAY_FUNC(func,argsdecl,args) \
void func argsdecl \
* Display options.
*/
-typedef enum { DISPLAY_RAW, DISPLAY_CURSES, DISPLAY_X } display_t;
+typedef enum {
+ DISPLAY_RAW,
+#ifdef HAVE_LIBCURSES
+ DISPLAY_CURSES,
+#endif
+ DISPLAY_X
+} display_t;
extern display_t display_type;
#define XSHOGI (display_type == DISPLAY_X)