summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorBradley Smith2008-03-07 21:49:03 +0000
committerBradley Smith2008-03-07 21:49:03 +0000
commite873d9aba5c545c1fa78e13a496baf6ac746f889 (patch)
treea653c2fe99ba60274f6394b4e0b943e445e0471d /configure.ac
parentAdd -pedantic-errors and -Werror flags to compile, and fix code to comply. (diff)
downloadgnurobots-e873d9aba5c545c1fa78e13a496baf6ac746f889.tar.gz
Add readline support to x11_plugin's commandline input.
Signed-off-by: Bradley Smith <brad@brad-smith.co.uk>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 32 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9addd68..a034057 100644
--- a/configure.ac
+++ b/configure.ac
@@ -122,6 +122,38 @@ if test "x$HAVE_GLIB2" = "xno"; then
AC_MSG_ERROR([GNU Robots requires GLib2 to compile.])
fi
+AC_CHECK_FUNC(tgetent,
+ [READLINE_EXTRA=],
+ [AC_CHECK_LIB(curses, tgetent,
+ [READLINE_EXTRA=-lcurses],
+ [AC_CHECK_LIB(ncurses, tgetent,
+ [READLINE_EXTRA=-lncurses],
+ [AC_CHECK_LIB(termcap, tgetent,
+ [READLINE_EXTRA=-ltermcap],
+ [AC_MSG_WARN(No Termcap or Curses library found)])
+ ])
+ ])
+ ])
+
+AC_CHECK_LIB(readline,readline,[READLINE_LIBS=-lreadline],
+ AC_MSG_ERROR([
+
+You need the GNU Readline library to build this program.
+
+]),[$READLINE_EXTRA])
+
+AC_CHECK_HEADER(readline/readline.h,[READLINE_CFLAGS=-I/usr/include/readline/],
+ AC_MSG_ERROR([
+
+You need the GNU Readline headers to build this program.
+
+]))
+
+READLINE_LIBS="$READLINE_LIBS $READLINE_EXTRA"
+
+AC_SUBST(READLINE_LIBS)
+AC_SUBST(READLINE_CFLAGS)
+
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)