@@ -1292,46 +1292,41 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]], [[sighandler_t *f;]]
12921292dnl ========================================================================
12931293dnl ncurses
12941294dnl ========================================================================
1295- dnl
1296- dnl A few OSes (e.g. Linux) deliver a default "ncurses" alongside "curses".
1297- dnl Many non-Linux deliver "curses"; sites may add "ncurses".
1298- dnl
1299- dnl However, the source-code recommendation for both is to #include "curses.h"
1300- dnl (i.e. "ncurses" still wants the include to be simple, no-'n', "curses.h").
1301- dnl
1302- dnl ncurses takes precedence.
1303- dnl
1304- found_curses_header=0
1295+
1296+ found_ncurses_header=0
13051297
13061298m4_foreach (
1307- [ header] ,
1308- [ [ curses.h] , [ curses/curses.h] , [ ncurses.h] , [ ncurses/ncurses.h] ] ,
1299+ [ header] , [ [ ncurses.h] , [ ncurses/ncurses.h] ] ,
13091300 [ AS_IF (
1310- [ test "$found_curses_header " -eq 0] ,
1301+ [ test "$found_ncurses_header " -eq 0] ,
13111302 [ AC_CHECK_HEADER (
13121303 header ,
13131304 [
1314- found_curses_header =1
1315- AC_DEFINE ( [ PCMK__CURSES_H ] , [ <header>] , [ Curses header file] )
1305+ found_ncurses_header =1
1306+ AC_DEFINE ( [ PCMK__NCURSES_H ] , [ <header>] , [ Ncurses header file] )
13161307 ]
13171308 ) ]
13181309 ) ]
13191310)
13201311
13211312save_LIBS="$LIBS"
1322- found_curses =0
1323- CURSES_LIBS =""
1313+ found_ncurses =0
1314+ NCURSES_LIBS =""
13241315LIBS=""
1325- AC_SEARCH_LIBS ( [ printw] , [ ncurses curses] ,
1326- [ test "$ac_cv_search_printw" = "none required" || CURSES_LIBS="$LIBS"
1327- found_curses=1] ,
1328- [ found_curses=0] )
1316+ AC_SEARCH_LIBS (
1317+ [ printw] , [ ncurses] ,
1318+ [
1319+ test "$ac_cv_search_printw" = "none required" || NCURSES_LIBS="$LIBS"
1320+ found_ncurses=1
1321+ ] ,
1322+ [ found_ncurses=0]
1323+ )
13291324LIBS="$save_LIBS"
13301325
13311326dnl Check for printw() prototype compatibility
1332- AS_IF ( [ test $found_curses -eq 1 && cc_supports_flag -Wcast-qual] , [
1327+ AS_IF ( [ test $found_ncurses -eq 1 && cc_supports_flag -Wcast-qual] , [
13331328 ac_save_LIBS="$LIBS"
1334- LIBS="$CURSES_LIBS "
1329+ LIBS="$NCURSES_LIBS "
13351330
13361331 # avoid broken test because of hardened build environment in Fedora 23+
13371332 # - https://fedoraproject.org/wiki/Changes/Harden_All_Packages
@@ -1340,12 +1335,12 @@ AS_IF([test $found_curses -eq 1 && cc_supports_flag -Wcast-qual], [
13401335 [ cc_temp_flags "-Wcast-qual $WERROR -fPIC"] ,
13411336 [ cc_temp_flags "-Wcast-qual $WERROR"] )
13421337
1343- AC_MSG_CHECKING ( [ whether curses library is compatible] )
1338+ AC_MSG_CHECKING ( [ whether ncurses library is compatible] )
13441339 AC_LINK_IFELSE (
13451340 [ AC_LANG_PROGRAM (
13461341 [
1347- #ifdef PCMK__CURSES_H
1348- #include PCMK__CURSES_H
1342+ #ifdef PCMK__NCURSES_H
1343+ #include PCMK__NCURSES_H
13491344 #endif
13501345 ] ,
13511346 [ printw((NCURSES_CONST char *) "Test");]
@@ -1354,12 +1349,12 @@ AS_IF([test $found_curses -eq 1 && cc_supports_flag -Wcast-qual], [
13541349 PCMK_FEATURES="$PCMK_FEATURES ncurses"
13551350 ] ,
13561351 [
1357- found_curses =0
1358- CURSES_LIBS =""
1352+ found_ncurses =0
1353+ NCURSES_LIBS =""
13591354 AC_MSG_RESULT ( [ no] )
1360- AC_MSG_WARN ( m4_normalize ( [ Disabling curses because the printw()
1361- function of your (n)curses library is old.
1362- If you wish to enable curses , update to a
1355+ AC_MSG_WARN ( m4_normalize ( [ Disabling ncurses because the printw()
1356+ function of your ncurses library is old.
1357+ If you wish to enable ncurses , update to a
13631358 newer version (ncurses 5.4 or later is
13641359 recommended, available from
13651360 https://invisible-island.net/ncurses/)
@@ -1371,8 +1366,9 @@ AS_IF([test $found_curses -eq 1 && cc_supports_flag -Wcast-qual], [
13711366 cc_restore_flags
13721367] )
13731368
1374- AC_DEFINE_UNQUOTED ( [ PCMK__ENABLE_CURSES] , [ $found_curses] , [ have ncurses library] )
1375- AC_SUBST ( CURSES_LIBS )
1369+ AC_DEFINE_UNQUOTED ( [ PCMK__ENABLE_CURSES] , [ $found_ncurses] ,
1370+ [ have ncurses library] )
1371+ AC_SUBST ( NCURSES_LIBS )
13761372
13771373dnl ========================================================================
13781374dnl Profiling and GProf
0 commit comments