summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 50efd29)
raw | patch | inline | side by side (parent: 50efd29)
author | Jonas Fonseca <fonseca@diku.dk> | |
Wed, 23 Apr 2008 21:49:25 +0000 (23:49 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Thu, 24 Apr 2008 08:14:26 +0000 (10:14 +0200) |
First ncursesw/ncurses.h, then ncurses/ncurses.h, and finally ncurses.h.
Also include ncurses.h by default instead of curses.h. On most system
ncurses.h should be a symlink to curses.h and this will avoid the
problem of including a non-ncurses header file.
This should fix systems like Solaris who ships their own version of
/usr/include/curses.h that is incompatible with ncurses.
Reported by SungHyun Nam.
Also include ncurses.h by default instead of curses.h. On most system
ncurses.h should be a symlink to curses.h and this will avoid the
problem of including a non-ncurses header file.
This should fix systems like Solaris who ships their own version of
/usr/include/curses.h that is incompatible with ncurses.
Reported by SungHyun Nam.
NEWS | patch | blob | history | |
configure.ac | patch | blob | history | |
tig.c | patch | blob | history |
index 626c8243f85258e7fd2904c9249d364f0a74dfb9..23432925967f84d0412e2bbdfc41ef9500d19957 100644 (file)
--- a/NEWS
+++ b/NEWS
- F5 also refreshes the current view.
- Allow line graphics to be disabled with new line-graphics option.
- Also include the reference names when searching.
+ - Configure: check for the ncurses header files.
Bug fixes:
diff --git a/configure.ac b/configure.ac
index 764190a40a8eecc3f0068e5d67b5db13dcb55a91..6b0fc45293092be92f771f36bed28008037da2e7 100644 (file)
--- a/configure.ac
+++ b/configure.ac
-AC_INIT([tig], [0],
- [Jonas Fonseca <fonseca@diku.dk>],
- [tig])
+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], [ncursesw ncurses curses], [],
- [AC_ERROR([curses not found])])
+cursed=no
+AC_CHECK_HEADERS([ncursesw/ncurses.h],
+ [AC_SEARCH_LIBS([initscr], [ncursesw], [cursed=yes])])
+case "$cursed" in "no")
+ AC_CHECK_HEADERS([ncurses/ncurses.h ncurses.h],
+ [AC_SEARCH_LIBS([wclear], [ncurses], [cursed=yes])])
+
+ case "$cursed" in "no")
+ AC_ERROR([ncurses not found])
+ esac
+
+ AC_MSG_WARN([The found ncurses library does not support wide-char.])
+ AC_MSG_WARN([This means that tig will not correctly render UTF-8.])
+esac
AM_ICONV
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 c50ea841766c0ec64665e4d30966b86dee3951f0..8e06c1ac5031bbb19cb3e0275e91e46c71652976 100644 (file)
--- a/tig.c
+++ b/tig.c
/* ncurses(3): Must be defined to have extended wide-character functions. */
#define _XOPEN_SOURCE_EXTENDED
-#include <curses.h>
+#ifdef HAVE_NCURSESW_NCURSES_H
+#include <ncursesw/ncurses.h>
+#else
+#ifdef HAVE_NCURSES_NCURSES_H
+#include <ncurses/ncurses.h>
+#else
+#include <ncurses.h>
+#endif
+#endif
#if __GNUC__ >= 3
#define __NORETURN __attribute__((__noreturn__))