# configure.ac: Autoconf input file
#
# Known contributors to this file:
-# Markus Armbruster, 2005-2008
+# Markus Armbruster, 2005-2009
#
# Process this file with autoconf to produce a configure script.
LIBS="$LIBS_SOCKETS $LIBS"
LIB_SOCKET_NSL
LIBS_server="$LIBS"
-AC_SEARCH_LIBS([setupterm], [termlib termcap curses ncurses])
LIBS_client="$LIBS"
LIBS="$save_LIBS"
AC_SUBST(LIBS_server)
Windows) AC_DEFINE([EMPTH_W32], 1, [Define to use Windows threads]) ;;
esac
+save_LIBS="$LIBS"
+LIBS="$LIBS_client"
+MY_WITH_TERMINFO
+LIBS_client="$LIBS"
+LIBS="$save_LIBS"
+
### Output
--- /dev/null
+AC_DEFUN([MY_CURSES_TERMINFO],
+[
+ AC_SEARCH_LIBS([setupterm], [termlib termcap curses ncurses],
+ [have_terminfo=yes], [have_terminfo=no])
+ AC_CHECK_HEADER([curses.h], , [have_terminfo=no])
+ AC_CHECK_HEADER([term.h], , [have_terminfo=no])
+ if test "$have_terminfo" = yes
+ then AC_DEFINE([HAVE_CURSES_TERMINFO], 1,
+ [Define if you have the curses interface to terminfo])
+ fi
+])
+
+AC_DEFUN([MY_WITH_TERMINFO],
+[
+ AC_ARG_WITH([terminfo],
+ AS_HELP_STRING([--with-terminfo],
+ [use terminfo for highlighting (default check)]))
+ if test "x$with_terminfo" != xno; then
+ MY_CURSES_TERMINFO
+ if test "$have_terminfo$with_terminfo" = noyes
+ then AC_MSG_FAILURE([Can't satisfy --with-terminfo])
+ fi
+ with_terminfo="$have_terminfo"
+ fi
+])
# configure.ac: Autoconf input file
#
# Known contributors to this file:
-# Markus Armbruster, 2005-2008
+# Markus Armbruster, 2005-2009
#
# Process this file with autoconf to produce a configure script.
### Checks for libraries.
LIBS="$LIBS_SOCKETS $LIBS"
LIB_SOCKET_NSL
-AC_SEARCH_LIBS([setupterm], [termlib termcap curses ncurses])
### Checks for header files.
AC_ARG_VAR([EMPIREPORT], [Default port [6789]])
test "$EMPIREPORT" || EMPIREPORT=6789
+MY_WITH_TERMINFO
### Output
extern int send_eof;
extern FILE *auxfp;
-#ifndef _WIN32
+#ifdef HAVE_CURSES_TERMINFO
void getsose(void);
void putso(void);
void putse(void);
-#else /* !_WIN32 */
+#else /* !HAVE_CURSES_TERMINFO */
#define getsose() ((void)0)
#define putso() ((void)0)
#define putse() ((void)0)
-#endif /* !WIN32 */
+#endif /* !HAVE_CURSES_TERMINFO */
int recvline(int s, char *buf);
int parseid(char *);
int expect(int s, int match, char *buf);
#include <config.h>
-#ifndef _WIN32
+#ifdef HAVE_CURSES_TERMINFO
#include <curses.h>
#include <stdio.h>
putp(rmso);
}
-#endif /* !_WIN32 */
+#endif /* HAVE_CURSES_TERMINFO */