summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9295982)
raw | patch | inline | side by side (parent: 9295982)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 19 Mar 2008 20:40:26 +0000 (21:40 +0100) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 19 Mar 2008 21:07:03 +0000 (22:07 +0100) |
Also (unconditionally) define _XOPEN_SOURCE_EXTENDED before including
curses.h to have extended functions as recommended by ncurses(3).
curses.h to have extended functions as recommended by ncurses(3).
configure.ac | patch | blob | history | |
tig.c | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 422039eb4876c71e57c45705140bbc43cdb26ca9..65b5af34c6087d39902c22ecda9a69ac20562c8d 100644 (file)
--- a/configure.ac
+++ b/configure.ac
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
index fcbf93c51aa4047619526db4a89b32ba7ab8ae45..81bc52b8f35845bd7c30c14828bcb6c74f21446f 100644 (file)
--- a/tig.c
+++ b/tig.c
#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