From: Jonas Fonseca Date: Wed, 19 Mar 2008 20:40:26 +0000 (+0100) Subject: Make configure search for the ncursesw library first X-Git-Tag: tig-0.10.1~4 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/tig/commitdiff_plain/6a19a30372cca7c252afcf6adbb31b6e9ecdee9b?hp=9295982a3492d52bc85a6b7b12817ca3d6fbe007 Make configure search for the ncursesw library first Also (unconditionally) define _XOPEN_SOURCE_EXTENDED before including curses.h to have extended functions as recommended by ncurses(3). --- diff --git a/configure.ac b/configure.ac index 422039e..65b5af3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,14 @@ AC_INIT([tig], [0], [Jonas Fonseca ], [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 @@ -21,3 +24,9 @@ AC_CHECK_PROGS(DOCBOOK2PDF, [docbook2pdf false]) 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 diff --git a/tig.c b/tig.c index fcbf93c..81bc52b 100644 --- a/tig.c +++ b/tig.c @@ -42,6 +42,9 @@ #include #include +/* ncurses(3): Must be defined to have extended wide-character functions. */ +#define _XOPEN_SOURCE_EXTENDED + #include #if __GNUC__ >= 3