aboutsummaryrefslogtreecommitdiffhomepage
path: root/configure.ac
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-12-24 13:57:38 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-12-24 14:08:06 +0300
commitcaed2e42c7257a386ed433a8bccba028cc9437c8 (patch)
tree67834b37814a2fa96e897872f90618043c6ea03b /configure.ac
parentef897b418a4487196e1dbc18a97046f8f0aea2e8 (diff)
downloadsciteco-caed2e42c7257a386ed433a8bccba028cc9437c8.tar.gz
added AX_WITH_CURSES for more robust ncurses checks
* Turns out that on SunOS/OmniOS the ncurses port does not ship with a ncursesw pkg-config file, but the ncurses file is for a version, that does contain widechar support as well. * Instead of adding yet another recursive PKG_CHECK_MODULES() call, we now use the AX_WITH_CURSES() macro, which is probably more robust. This should at least fix ./configure on OmniOS. * It also adds a number of feature C macros, that could be useful to check in the future. * At the moment, we strive to support all X/Open-compatible Curses libraries, but both enhanced and color functions are required. Therefore plain SVr4 Curses is not supported. * source: https://www.gnu.org/software/autoconf-archive/ax_with_curses.html
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 12 insertions, 14 deletions
diff --git a/configure.ac b/configure.ac
index c4f55ac..ad4d805 100644
--- a/configure.ac
+++ b/configure.ac
@@ -246,20 +246,16 @@ case $INTERFACE in
*curses*)
case $INTERFACE in
ncurses | netbsd-curses)
- # 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!])
- ])
- ])
+ # This gives precendence to the widechar version of ncurses,
+ # which is necessary for Unicode support even when not using widechar APIs.
+ AX_WITH_CURSES
+ if [[ x$ax_cv_curses_enhanced != xyes -o x$ax_cv_curses_color != xyes ]]; then
+ AC_MSG_ERROR([X/Open curses compatible library not found!])
+ fi
+ CFLAGS="$CFLAGS $CURSES_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $CURSES_CFLAGS"
+ LIBS="$LIBS $CURSES_LIBS"
+
AC_CHECK_FUNCS([tigetstr])
if [[ x$INTERFACE = xnetbsd-curses ]]; then
@@ -348,6 +344,8 @@ case $INTERFACE in
;;
esac
+ # AX_WITH_CURSES defines per-header symbols, but we currently
+ # demand that CPPFLAGS are set up such, that we can find curses.h anyway.
AC_CHECK_HEADERS([curses.h], , [
AC_MSG_ERROR([Curses header missing!])
])