aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-08-28 14:03:38 +0200
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-09-09 18:17:03 +0200
commitf79a6f65acde9753ea65887e0e0d4bc7f76ff52b (patch)
tree6c7b266871110fd56e5738555b906f5f8b609acc /configure.ac
parent4c6b6814abfc9c022c6ea8d1e23097c2a774fde5 (diff)
downloadsciteco-f79a6f65acde9753ea65887e0e0d4bc7f76ff52b.tar.gz
prefer libncursesw (widechar variant) (refs #5)
* Some platforms like Ubuntu actually ship widechar and non-widechar versions of ncurses with different pkg-config files. Other platforms like FreeBSD will ship an "ncursesw" and "ncurses" pkg-config file but both point to the same wide-char library anyway. * Currently we are not using wide-char APIs to ensure maximum compatibility even with embedded systems where ncurses might be built without widechar support. But in order to handle Unicode correctly, we still need to link against the widechar version of ncurses (if available). * Compilation on platforms without a widechar ncurses is now handled by the common AC_CHECK_LIB() fallback (which might actually find a widechar version anyway if it just didn't install the pkg-config file). If necessary, we could also check for the "ncurses" package if "ncursesw" is not found. * This fixes Unicode display and input on Ubuntu.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 511d169..3606803 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,11 +226,16 @@ case $INTERFACE in
*curses*)
case $INTERFACE in
ncurses | netbsd-curses)
- PKG_CHECK_MODULES(NCURSES, [ncurses], [
+ # The widechar version of ncurses is necessary for Unicode
+ # support even when not using widechar APIs.
+ PKG_CHECK_MODULES(NCURSES, [ncursesw], [
CFLAGS="$CFLAGS $NCURSES_CFLAGS"
CXXFLAGS="$CXXFLAGS $NCURSES_CFLAGS"
LIBS="$LIBS $NCURSES_LIBS"
], [
+ # This should be sufficient to detect non-widechar
+ # ncurses versions as well, although we could also check
+ # for an "ncurses" package.
AC_CHECK_LIB(ncurses, initscr, , [
AC_MSG_ERROR([libncurses missing!])
])