Also (unconditionally) define _XOPEN_SOURCE_EXTENDED before including
curses.h to have extended functions as recommended by ncurses(3).
AC_INIT([tig], [0],
[Jonas Fonseca <fonseca@diku.dk>],
[tig])
+
AC_LANG([C])
AC_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(tig.c)
-AC_SEARCH_LIBS([wclear], [ncurses curses])
+AC_SEARCH_LIBS([wclear], [ncursesw ncurses curses], [],
+ [AC_ERROR([curses not found])])
+
AM_ICONV
AC_PROG_CC
AC_CONFIG_FILES([config.make])
AC_OUTPUT
+
+case "$LIBS" in
+*-lncursesw*) ;;
+*) AC_MSG_RESULT([NOTE: The found ncurses library does not support wide-char.])
+ AC_MSG_RESULT([NOTE: This means that tig will not correctly render UTF-8])
+esac
#include <langinfo.h>
#include <iconv.h>
+/* ncurses(3): Must be defined to have extended wide-character functions. */
+#define _XOPEN_SOURCE_EXTENDED
+
#include <curses.h>
#if __GNUC__ >= 3