Skip to content

Commit

Permalink
Use AX_WITH_CURSES for curses library discovery
Browse files Browse the repository at this point in the history
Properly discovers libtinfow for customized systems (eg Gentoo)
while offloading search handling to autoconf builtins.

Fixes #250

Signed-off-by: Marco Sirabella <marco@sirabella.org>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
  • Loading branch information
mjsir911 authored and Lukas Fleischer committed Oct 16, 2021
1 parent 1351f8f commit 661da1d
Showing 1 changed file with 6 additions and 21 deletions.
27 changes: 6 additions & 21 deletions configure.ac
Expand Up @@ -29,27 +29,12 @@ AC_CHECK_HEADERS([ctype.h getopt.h locale.h math.h signal.h stdio.h stdlib.h \
#-------------------------------------------------------------------------------
# Checks for system libs
#-------------------------------------------------------------------------------
AC_CHECK_FUNC(initscr,,
[
available_ncurses="none"
for lib in ncursesw ncurses
do
AC_CHECK_LIB($lib, initscr,
[available_ncurses="$lib"; break])
done
if test "$available_ncurses" = none; then
AC_MSG_ERROR(Either ncurses or ncursesw library is required to build calcurse!)
elif test "$available_ncurses" = ncursesw; then
AC_CHECK_HEADERS([ncursesw/ncurses.h],,
[AC_CHECK_HEADERS([ncurses.h],,
AC_MSG_ERROR([Missing ncursesw header file]))])
else
AC_CHECK_HEADERS([ncurses/ncurses.h],,
[AC_CHECK_HEADERS([ncurses.h],,
AC_MSG_ERROR([Missing ncurses header file]))])
fi
LIBS="$LIBS -l$available_ncurses"
])
AX_WITH_CURSES
if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then
AC_MSG_ERROR(Either ncurses or ncursesw library is required to build calcurse!)
fi

LIBS="$LIBS $CURSES_LIBS"

AC_CHECK_HEADERS([pthread.h], [
AC_CHECK_LIB(pthread, pthread_create, [
Expand Down

0 comments on commit 661da1d

Please sign in to comment.