[3.0] 63ec044 Look for ncurses/curses.h before curses.h

Tollef Fog Heen tfheen at varnish-cache.org
Thu Sep 22 14:04:16 CEST 2011


commit 63ec044368d1a8a8a5b700c99e1c5ce4ea84bbbd
Author: Tollef Fog Heen <tfheen at varnish-software.com>
Date:   Wed Sep 21 13:41:58 2011 +0200

    Look for ncurses/curses.h before curses.h
    
    Solaris puts the ncurses header in /usr/include/ncurses, and we need
    that to compile with -Werror.
    
    Fixes: #889

diff --git a/bin/varnishstat/varnishstat_curses.c b/bin/varnishstat/varnishstat_curses.c
index d0eb001..1127e6a 100644
--- a/bin/varnishstat/varnishstat_curses.c
+++ b/bin/varnishstat/varnishstat_curses.c
@@ -34,7 +34,11 @@
 
 #include <sys/time.h>
 
+#ifdef HAVE_NCURSES_CURSES_H
+#include <ncurses/curses.h>
+#elif HAVE_CURSES_H
 #include <curses.h>
+#endif
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
diff --git a/configure.ac b/configure.ac
index ab745fa..9ef4c67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,6 +87,7 @@ 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])
 
 save_LIBS="${LIBS}"



More information about the varnish-commit mailing list