Commit dd0a14fc authored by Tollef Fog Heen's avatar Tollef Fog Heen

Fix up curses detection logic, Solaris fixes

Makes git master compile on Solaris again, and mostly work.
parent 3d0438f7
......@@ -5,7 +5,7 @@
#SUBDIRS = varnishadm varnishd varnishlog varnishncsa varnishreplay varnishtest
SUBDIRS = varnishadm varnishd varnishlog varnishtest
if HAVE_CURSES
if VARNISH_CURSES
#SUBDIRS += varnishhist varnishstat varnishtop
SUBDIRS += varnishstat
endif
......@@ -14,7 +14,7 @@ varnishhist_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
-lm \
${CURSES_LIBS} ${RT_LIBS} ${PTHREAD_LIBS}
@CURSES_LIB@ ${RT_LIBS} ${PTHREAD_LIBS}
varnishhist.1: $(top_srcdir)/doc/sphinx/reference/varnishhist.rst
if HAVE_RST2MAN
......
......@@ -18,7 +18,7 @@ varnishstat_SOURCES = \
varnishstat_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${CURSES_LIBS} ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
@CURSES_LIB@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
varnishstat.1: $(top_srcdir)/doc/sphinx/reference/varnishstat.rst
if HAVE_RST2MAN
......
......@@ -54,12 +54,18 @@
#include "varnishstat.h"
#ifdef HAVE_NCURSES_CURSES_H
#if defined HAVE_NCURSESW_CURSES_H
# include <ncursesw/curses.h>
#elif defined HAVE_NCURSESW_H
# include <ncursesw.h>
#elif defined HAVE_NCURSES_CURSES_H
# include <ncurses/curses.h>
#elif defined HAVE_NCURSES_H
# include <ncurses.h>
#elif defined HAVE_CURSES_H
# include <curses.h>
#else
# ifdef HAVE_CURSES_H
# include <curses.h>
# endif
# error "SysV or X/Open-compatible Curses header file required"
#endif
#define LINES_STATUS 3
......@@ -892,10 +898,12 @@ do_curses(struct VSM_data *vd, int delay)
switch (ch = wgetch(w_status)) {
case ERR:
break;
#ifdef KEY_RESIZE /* sigh, Solaris lacks this.. */
case KEY_RESIZE:
make_windows();
update_position();
break;
#endif
default:
handle_keypress(ch);
break;
......
......@@ -13,7 +13,7 @@ varnishtop_SOURCES = varnishtop.c \
varnishtop_LDADD = \
$(top_builddir)/lib/libvarnishcompat/libvarnishcompat.la \
$(top_builddir)/lib/libvarnishapi/libvarnishapi.la \
${CURSES_LIBS} ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
@CURSES_LIB@ ${RT_LIBS} ${LIBM} ${PTHREAD_LIBS}
varnishtop.1: $(top_srcdir)/doc/sphinx/reference/varnishtop.rst
if HAVE_RST2MAN
......
......@@ -84,18 +84,8 @@ DL_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(DL_LIBS)
save_LIBS="${LIBS}"
LIBS=""
AC_SEARCH_LIBS(initscr, [curses ncurses],
[have_curses=yes], [have_curses=no])
CURSES_LIBS="${LIBS}"
LIBS="${save_LIBS}"
AC_SUBST(CURSES_LIBS)
if test "$have_curses" = no; then
AC_MSG_WARN([curses not found; some tools will not be built])
fi
AC_CHECK_HEADERS([ncurses/curses.h curses.h])
AM_CONDITIONAL([HAVE_CURSES], [test x$have_curses = xyes])
AX_WITH_CURSES
AM_CONDITIONAL(VARNISH_CURSES, test x$ax_cv_curses = xyes)
save_LIBS="${LIBS}"
LIBS=""
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment