From 4cf7a9adba18ed7752898c0d9421067c7bf17292 Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Wed, 09 Feb 2022 14:00:13 -0700 Subject: [PATCH] autoconf: Additional library test for ncurses Depending on how the ncurses libraries were built the external symbol 'LINES' may be replaced with the '_nc_LINES' external symbol. Because the symbol 'LINES' may or may not be present, the autoconf test can fail to detect the correct libraries needed for curses support. Add an additional AC_CHECK_LIBs for the symbol _nc_LINES (within the ncurses or tinfo libraries) when setting the $LIB_curses. This commit was adapted from the openSuSE source packaging for openafs. Background: when ncurses is built with --enable-reentrant, LINES is defined as a C preprocessor macro that expands to a call to _nc_LINES Change-Id: If5e93078ff8cd0af5a50a25a8be7b462261a4f6f --- diff --git a/src/cf/curses.m4 b/src/cf/curses.m4 index 24c6535..1691845 100644 --- a/src/cf/curses.m4 +++ b/src/cf/curses.m4 @@ -19,7 +19,11 @@ AC_CHECK_LIB([ncurses], [initscr], [AC_CHECK_LIB([ncurses], [LINES], [openafs_cv_curses_lib=-lncurses], [AC_CHECK_LIB([tinfo], [LINES], - [openafs_cv_curses_lib="-lncurses -ltinfo"])])]) + [openafs_cv_curses_lib="-lncurses -ltinfo"], + [AC_CHECK_LIB([ncurses], [_nc_LINES], + [openafs_cv_curses_lib=-lncurses], + [AC_CHECK_LIB([tinfo], [_nc_LINES], + [openafs_cv_curses_lib="-lncurses -ltinfo"])])])])]) AS_IF([test "x$openafs_cv_curses_lib" = x], [AC_CHECK_LIB([Hcurses], [initscr], [openafs_cv_curses_lib=-lHcurses])]) AS_IF([test "x$openafs_cv_curses_lib" = x],