]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/aclocal.m4
ncurses 6.0 - patch 20171230
[ncurses.git] / test / aclocal.m4
index 701fe34d3bf49997f29102747c7c46b60f81bb10..1a710ab271339bc789b9f52de12ef9bdaef11292 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 2003-2015,2016 Free Software Foundation, Inc.              *
+dnl Copyright (c) 2003-2016,2017 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written       *
 dnl authorization.                                                           *
 dnl***************************************************************************
 dnl
-dnl $Id: aclocal.m4,v 1.127 2016/04/09 21:39:32 tom Exp $
+dnl $Id: aclocal.m4,v 1.149 2017/12/26 22:17:17 tom Exp $
 dnl
 dnl Author: Thomas E. Dickey
 dnl
@@ -89,7 +89,7 @@ define([CF_ACVERSION_COMPARE],
 [ifelse([$8], , ,[$8])],
 [ifelse([$9], , ,[$9])])])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 12 updated: 2015/04/12 15:39:00
+dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40
 dnl -------------
 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
 dnl The second parameter if given makes this macro verbose.
@@ -119,10 +119,10 @@ case $cf_fix_cppflags in
                                && cf_fix_cppflags=yes
 
                        if test $cf_fix_cppflags = yes ; then
-                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+                               CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
                                continue
                        elif test "${cf_tst_cflags}" = "\"'" ; then
-                               cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+                               CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
                                continue
                        fi
                        ;;
@@ -137,17 +137,17 @@ case $cf_fix_cppflags in
                                CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
                                ;;
                        esac
-                       cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+                       CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags)
                        ;;
                esac
                ;;
        (*)
-               cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+               CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags)
                ;;
        esac
        ;;
 (yes)
-       cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+       CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
 
        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
 
@@ -160,17 +160,17 @@ done
 
 if test -n "$cf_new_cflags" ; then
        ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
-       CFLAGS="$CFLAGS $cf_new_cflags"
+       CF_APPEND_TEXT(CFLAGS,$cf_new_cflags)
 fi
 
 if test -n "$cf_new_cppflags" ; then
        ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
-       CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+       CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags)
 fi
 
 if test -n "$cf_new_extra_cppflags" ; then
        ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
-       EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+       CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags)
 fi
 
 AC_SUBST(EXTRA_CPPFLAGS)
@@ -341,6 +341,16 @@ ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]
 }
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
+dnl --------------
+dnl use this macro for appending text without introducing an extra blank at
+dnl the beginning
+define([CF_APPEND_TEXT],
+[
+       test -n "[$]$1" && $1="[$]$1 "
+       $1="[$]{$1}$2"
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
 dnl --------------
 dnl Allow user to disable a normally-on option.
@@ -376,11 +386,18 @@ ifelse([$3],,[    :]dnl
 ])dnl
 ])])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CC_ENV_FLAGS version: 2 updated: 2015/04/12 15:39:00
+dnl CF_CC_ENV_FLAGS version: 8 updated: 2017/09/23 08:50:24
 dnl ---------------
 dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
-dnl into CC.  This will not help with broken scripts that wrap the compiler with
-dnl options, but eliminates a more common category of user confusion.
+dnl into CC.  This will not help with broken scripts that wrap the compiler
+dnl with options, but eliminates a more common category of user confusion.
+dnl
+dnl In particular, it addresses the problem of being able to run the C
+dnl preprocessor in a consistent manner.
+dnl
+dnl Caveat: this also disallows blanks in the pathname for the compiler, but
+dnl the nuisance of having inconsistent settings for compiler and preprocessor
+dnl outweighs that limitation.
 AC_DEFUN([CF_CC_ENV_FLAGS],
 [
 # This should have been defined by AC_PROG_CC
@@ -388,13 +405,27 @@ AC_DEFUN([CF_CC_ENV_FLAGS],
 
 AC_MSG_CHECKING(\$CC variable)
 case "$CC" in
-(*[[\ \        ]]-[[IUD]]*)
+(*[[\ \        ]]-*)
        AC_MSG_RESULT(broken)
        AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
        # humor him...
-       cf_flags=`echo "$CC" | sed -e 's/^[[^   ]]*[[   ]]//'`
-       CC=`echo "$CC" | sed -e 's/[[   ]].*//'`
-       CF_ADD_CFLAGS($cf_flags)
+       cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'`
+       cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'`
+       CC="$cf_prog"
+       for cf_arg in $cf_flags
+       do
+               case "x$cf_arg" in
+               (x-[[IUDfgOW]]*)
+                       CF_ADD_CFLAGS($cf_arg)
+                       ;;
+               (*)
+                       CC="$CC $cf_arg"
+                       ;;
+               esac
+       done
+       CF_VERBOSE(resulting CC: '$CC')
+       CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
+       CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
        ;;
 (*)
        AC_MSG_RESULT(ok)
@@ -526,50 +557,60 @@ done
 test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map,[Define as needed to override ncurses prefix _nc_])
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHECK_DATA version: 5 updated: 2014/07/19 18:41:17
+dnl CF_CURSES_CHECK_DATA version: 6 updated: 2017/07/28 19:05:31
 dnl --------------------
 dnl Check if curses.h defines the given data/variable.
 dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG.
+dnl
+dnl $1 = data item(s) to check for
+dnl $2 = action on success, e.g., "break" to quit checking a series of choices
 AC_DEFUN([CF_CURSES_CHECK_DATA],
 [
-AC_MSG_CHECKING(for data $1 declaration in ${cf_cv_ncurses_header:-curses.h})
+for cf_data in $1
+do
+AC_MSG_CHECKING(for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h})
 
 AC_TRY_COMPILE(CF__CURSES_HEAD,[
-void *foo = &($1)
-],cf_result=yes,cf_result=no)
+void *foo = &($cf_data)
+],[cf_result=yes
+],[cf_result=no])
 AC_MSG_RESULT($cf_result)
 
 if test $cf_result = yes ; then
-       CF_UPPER(cf_result,have_curses_data_$1)
+       CF_UPPER(cf_result,have_curses_data_$cf_data)
        AC_DEFINE_UNQUOTED($cf_result)
+       ifelse($2,,,[$2])
 else
-       AC_MSG_CHECKING(for data $1 in library)
+       AC_MSG_CHECKING(for data $cf_data in library)
        # BSD linkers insist on making weak linkage, but resolve at runtime.
        AC_TRY_RUN(CF__CURSES_HEAD
 [
-extern char $1;
+extern char $cf_data;
 int main(void)
 {
-       void *foo = &($1);
-       fprintf(stderr, "testing linkage of $1:%p\n", foo);
+       void *foo = &($cf_data);
+       fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
        ${cf_cv_main_return:-return}(foo == 0);
-}],[cf_result=yes],[cf_result=no],[
+}],[cf_result=yes
+],[cf_result=no],[
        # cross-compiling
        AC_TRY_LINK(CF__CURSES_HEAD
-[extern char $1;],[
+[extern char $cf_data;],[
        do {
-               void *foo = &($1);
-               fprintf(stderr, "testing linkage of $1:%p\n", foo);
+               void *foo = &($cf_data);
+               fprintf(stderr, "testing linkage of $cf_data:%p\n", foo);
                ${cf_cv_main_return:-return}(foo == 0);
        } while (0)
 ],[cf_result=yes],[cf_result=no])
 ])
        AC_MSG_RESULT($cf_result)
        if test $cf_result = yes ; then
-               CF_UPPER(cf_result,decl_curses_data_$1)
+               CF_UPPER(cf_result,decl_curses_data_$cf_data)
                AC_DEFINE_UNQUOTED($cf_result)
+               # do not exit loop here, since we prefer system's declarations
        fi
 fi
+done
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_CURSES_CHECK_TYPE version: 4 updated: 2012/10/06 16:39:58
@@ -704,7 +745,7 @@ fi
 AC_CHECK_HEADERS($cf_cv_ncurses_header)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 39 updated: 2015/05/10 19:52:14
+dnl CF_CURSES_LIBS version: 40 updated: 2017/09/07 17:06:24
 dnl --------------
 dnl Look for the curses libraries.  Older curses implementations may require
 dnl termcap/termlib to be linked as well.  Call CF_CURSES_CPPFLAGS first.
@@ -797,36 +838,35 @@ if test ".$ac_cv_func_initscr" != .yes ; then
        then
                for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
                do
-                       AC_CHECK_LIB($cf_curs_lib,initscr,[break])
+                       LIBS="-l$cf_curs_lib $cf_save_LIBS"
+                       if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
+                               AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
+                               AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+                                       [initscr()],
+                                       [cf_result=yes],
+                                       [cf_result=no])
+                               AC_MSG_RESULT($cf_result)
+                               test $cf_result = yes && break
+                       elif test "$cf_curs_lib" = "$cf_term_lib" ; then
+                               cf_result=no
+                       elif test "$cf_term_lib" != predefined ; then
+                               AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
+                               AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+                                       [initscr(); tgoto((char *)0, 0, 0);],
+                                       [cf_result=no],
+                                       [
+                                       LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
+                                       AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+                                               [initscr()],
+                                               [cf_result=yes],
+                                               [cf_result=error])
+                                       ])
+                               AC_MSG_RESULT($cf_result)
+                               test $cf_result != error && break
+                       fi
                done
        fi
        test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
-
-       LIBS="-l$cf_curs_lib $cf_save_LIBS"
-       if test "$cf_term_lib" = unknown ; then
-               AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
-               AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
-                       [initscr()],
-                       [cf_result=yes],
-                       [cf_result=no])
-               AC_MSG_RESULT($cf_result)
-               test $cf_result = no && AC_MSG_ERROR(Cannot link curses library)
-       elif test "$cf_curs_lib" = "$cf_term_lib" ; then
-               :
-       elif test "$cf_term_lib" != predefined ; then
-               AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
-               AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
-                       [initscr(); tgoto((char *)0, 0, 0);],
-                       [cf_result=no],
-                       [
-                       LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
-                       AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
-                               [initscr()],
-                               [cf_result=yes],
-                               [cf_result=error])
-                       ])
-               AC_MSG_RESULT($cf_result)
-       fi
 fi
 fi
 
@@ -1098,7 +1138,47 @@ if test "$cf_disable_rpath_hack" = no ; then
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03
+dnl CF_ENABLE_STRING_HACKS version: 5 updated: 2016/10/08 17:34:11
+dnl ----------------------
+dnl On a few platforms, the compiler and/or loader nags with untruthful
+dnl comments stating that "most" uses of strcat/strcpy/sprintf are incorrect,
+dnl and implying that most uses of the recommended alternatives are correct.
+dnl
+dnl Factually speaking, no one has actually counted the number of uses of these
+dnl functions versus the total of incorrect uses.  Samples of a few thousand
+dnl instances are meaningless compared to the hundreds of millions of lines of
+dnl existing C code.
+dnl
+dnl strlcat/strlcpy are (as of 2012) non-standard, and are available on some
+dnl platforms, in implementations of varying quality.  Likewise, snprintf is
+dnl standard - but evolved through phases, and older implementations are likely
+dnl to yield surprising results, as documented in manpages on various systems.
+AC_DEFUN([CF_ENABLE_STRING_HACKS],
+[
+AC_MSG_CHECKING(if you want to work around bogus compiler/loader warnings)
+AC_ARG_ENABLE(string-hacks,
+       [  --enable-string-hacks   work around bogus compiler/loader warnings],
+       [with_string_hacks=$enableval],
+       [with_string_hacks=no])
+AC_MSG_RESULT($with_string_hacks)
+
+if test "x$with_string_hacks" = "xyes"; then
+       AC_DEFINE(USE_STRING_HACKS,1,[Define to 1 to work around bogus compiler/loader warnings])
+       AC_MSG_WARN(enabling string-hacks to work around bogus compiler/loader warnings)
+       AC_CHECK_FUNC(strlcat,[
+               AC_DEFINE(HAVE_STRLCAT,1,[Define to 1 if we have strlcat function])
+               ],[
+               AC_CHECK_LIB(bsd,strlcat,[
+                       CF_ADD_LIB(bsd)
+                       AC_CHECK_HEADERS(bsd/string.h)
+                       AC_DEFINE(HAVE_STRLCAT,1,[Define to 1 if we have strlcat function])
+                       ])
+               ])
+       AC_CHECK_FUNCS( strlcpy snprintf )
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_ENABLE_WARNINGS version: 5 updated: 2017/09/29 20:01:16
 dnl ------------------
 dnl Configure-option to enable gcc warnings
 AC_DEFUN([CF_ENABLE_WARNINGS],[
@@ -1113,7 +1193,7 @@ AC_MSG_RESULT($with_warnings)
 if test "$with_warnings" = "yes"
 then
        CF_GCC_ATTRIBUTES
-       CF_GCC_WARNINGS
+       CF_GCC_WARNINGS($1)
 fi
 fi
 ])dnl
@@ -1298,7 +1378,7 @@ ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_FUNC_CURSES_VERSION version: 6 updated: 2012/10/06 16:39:58
+dnl CF_FUNC_CURSES_VERSION version: 7 updated: 2017/05/10 18:31:29
 dnl ----------------------
 dnl Solaris has a data item 'curses_version', which confuses AC_CHECK_FUNCS.
 dnl It's a character string "SVR4", not documented.
@@ -1307,7 +1387,7 @@ AC_DEFUN([CF_FUNC_CURSES_VERSION],
 AC_CACHE_CHECK(for function curses_version, cf_cv_func_curses_version,[
 AC_TRY_RUN([
 #include <${cf_cv_ncurses_header:-curses.h}>
-int main()
+int main(void)
 {
        char temp[1024];
        sprintf(temp, "%s\n", curses_version());
@@ -1619,7 +1699,7 @@ if test $cf_cv_getopt_header = getopt.h ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
+dnl CF_GNU_SOURCE version: 7 updated: 2016/08/05 05:15:37
 dnl -------------
 dnl Check if we must define _GNU_SOURCE to get a reasonable value for
 dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a defect
@@ -1646,7 +1726,20 @@ make an error
        CPPFLAGS="$cf_save"
        ])
 ])
-test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+
+if test "$cf_cv_gnu_source" = yes
+then
+AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[
+CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
+       AC_TRY_COMPILE([#include <sys/types.h>],[
+#ifdef _DEFAULT_SOURCE
+make an error
+#endif],
+               [cf_cv_default_source=no],
+               [cf_cv_default_source=yes])
+       ])
+test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
+fi
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_HEADER_PATH version: 13 updated: 2015/04/15 19:08:48
@@ -1868,7 +1961,7 @@ AC_SUBST(MAKE_UPPER_TAGS)
 AC_SUBST(MAKE_LOWER_TAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02
+dnl CF_MATH_LIB version: 9 updated: 2017/01/21 11:06:25
 dnl -----------
 dnl Checks for libraries.  At least one UNIX system, Apple Macintosh
 dnl Rhapsody 5.5, does not have -lm.  We cannot use the simpler
@@ -1879,6 +1972,7 @@ AC_CACHE_CHECK(if -lm needed for math functions,
        cf_cv_need_libm,[
        AC_TRY_LINK([
        #include <stdio.h>
+       #include <stdlib.h>
        #include <math.h>
        ],
        [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)],
@@ -1963,7 +2057,7 @@ printf("old\n");
        ,[$1=no])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 17 updated: 2015/07/07 04:22:07
+dnl CF_NCURSES_CONFIG version: 18 updated: 2017/07/23 18:30:00
 dnl -----------------
 dnl Tie together the configure-script macros for ncurses, preferring these in
 dnl order:
@@ -2011,6 +2105,7 @@ if test "x${PKG_CONFIG:=none}" != xnone; then
                        AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
                        NCURSES_CONFIG_PKG=$cf_ncuconfig_root
                fi
+               CF_TERM_HEADER
 
        else
                AC_MSG_RESULT(no)
@@ -2021,11 +2116,11 @@ else
 fi
 
 if test "x$cf_have_ncuconfig" = "xno"; then
-       echo "Looking for ${cf_ncuconfig_root}-config"
+       cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
 
        CF_ACVERSION_CHECK(2.52,
-               [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
-               [AC_PATH_PROGS(NCURSES_CONFIG,  ${cf_ncuconfig_root}-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
+               [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
+               [AC_PATH_PROGS(NCURSES_CONFIG,  ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
 
        if test "$NCURSES_CONFIG" != none ; then
 
@@ -2276,24 +2371,22 @@ CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_PTHREADS version: 1 updated: 2016/02/20 19:23:20
+dnl CF_NCURSES_PTHREADS version: 2 updated: 2016/04/22 05:07:41
 dnl -------------------
 dnl Use this followup check to ensure that we link with pthreads if ncurses
 dnl uses it.
 AC_DEFUN([CF_NCURSES_PTHREADS],[
 : ${cf_nculib_root:=ifelse($1,,ncurses,$1)}
-AC_CACHE_CHECK(if $cf_nculib_root uses pthreads, cf_cv_ncurses_pthreads,[
-       AC_CHECK_LIB($cf_nculib_root,_nc_init_pthreads,
-               cf_cv_ncurses_pthreads=yes,
-               cf_cv_ncurses_pthreads=no)
-])
+AC_CHECK_LIB($cf_nculib_root,_nc_init_pthreads,
+       cf_cv_ncurses_pthreads=yes,
+       cf_cv_ncurses_pthreads=no)
 if test "$cf_cv_ncurses_pthreads" = yes
 then
        CF_ADD_LIBS(-lpthread)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_VERSION version: 14 updated: 2012/10/06 08:57:51
+dnl CF_NCURSES_VERSION version: 15 updated: 2017/05/09 19:26:10
 dnl ------------------
 dnl Check for the version of ncurses, to aid in reporting bugs, etc.
 dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS.  We don't use
@@ -2308,7 +2401,7 @@ AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
        AC_TRY_RUN([
 #include <${cf_cv_ncurses_header:-curses.h}>
 #include <stdio.h>
-int main()
+int main(void)
 {
        FILE *fp = fopen("$cf_tempfile", "w");
 #ifdef NCURSES_VERSION
@@ -2685,11 +2778,11 @@ case $INSTALL in
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14
+dnl CF_PROG_LINT version: 3 updated: 2016/05/22 15:25:54
 dnl ------------
 AC_DEFUN([CF_PROG_LINT],
 [
-AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint)
+AC_CHECK_PROGS(LINT, lint cppcheck splint)
 AC_SUBST(LINT_OPTS)
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -3368,6 +3461,92 @@ CF_NO_LEAKS_OPTION(valgrind,
        [USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_WITH_X11_RGB version: 1 updated: 2017/11/25 17:32:16
+dnl ---------------
+dnl Handle configure option "--with-x11-rgb", setting these shell
+dnl variables:
+dnl
+dnl $RGB_PATH is the option value, used for finding the X11 rgb file.
+dnl $no_x11_rgb is a "#" (comment) if "--without-x11-rgb" is given.
+dnl
+dnl Most Linux's use this:
+dnl    /usr/share/X11/rgb.txt
+dnl Debian uses this:
+dnl    /etc/X11/rgb.txt
+dnl DragonFlyBSD ports uses this:
+dnl    /usr/pkg/lib/X11/rgb.txt
+dnl FreeBSD ports use these:
+dnl    /usr/local/lib/X11/rgb.txt
+dnl    /usr/local/share/X11/rgb.txt
+dnl Mandriva has these:
+dnl    /usr/lib/X11/rgb.txt
+dnl    /usr/lib64/X11/rgb.txt
+dnl NetBSD has these
+dnl    /usr/X11R7/lib/X11/rgb.txt
+dnl OpenSolaris uses
+dnl    32-bit:
+dnl    /usr/X11/etc/X11/rgb.txt
+dnl    /usr/X11/share/X11/rgb.txt
+dnl    /usr/X11/lib/X11/rgb.txt
+dnl OSX uses
+dnl            /opt/local/share/X11/rgb.txt (MacPorts)
+dnl            /opt/X11/share/X11/rgb.txt (non-ports)
+dnl    64-bit:
+dnl    /usr/X11/etc/X11/rgb.txt
+dnl    /usr/X11/share/X11/rgb.txt (perhaps)
+dnl    /usr/X11/lib/amd64/X11/rgb.txt
+dnl Solaris10 uses (in this order):
+dnl    /usr/openwin/lib/X11/rgb.txt
+dnl    /usr/X11/lib/X11/rgb.txt
+AC_DEFUN([CF_WITH_X11_RGB],[
+AC_MSG_CHECKING(for X11 rgb file)
+AC_ARG_WITH(x11-rgb,
+       [  --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)],
+       [RGB_PATH=$withval],
+       [RGB_PATH=auto])
+
+if test "x[$]RGB_PATH" = xauto
+then
+       RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
+       for cf_path in \
+               /opt/local/share/X11/rgb.txt \
+               /opt/X11/share/X11/rgb.txt \
+               /usr/share/X11/rgb.txt \
+               /usr/X11/share/X11/rgb.txt \
+               /usr/X11/lib/X11/rgb.txt \
+               /usr/lib/X11/rgb.txt \
+               /etc/X11/rgb.txt \
+               /usr/pkg/lib/X11/rgb.txt \
+               /usr/X11R7/lib/X11/rgb.txt \
+               /usr/X11R6/lib/X11/rgb.txt \
+               /usr/X11R5/lib/X11/rgb.txt \
+               /usr/X11R4/lib/X11/rgb.txt \
+               /usr/local/lib/X11/rgb.txt \
+               /usr/local/share/X11/rgb.txt \
+               /usr/lib64/X11/rgb.txt
+       do
+               if test -f "$cf_path" ; then
+                       RGB_PATH="$cf_path"
+                       break
+               fi
+       done
+else
+       cf_path=$RGB_PATH
+       CF_PATH_SYNTAX(cf_path)
+fi
+
+AC_MSG_RESULT($RGB_PATH)
+AC_SUBST(RGB_PATH)
+AC_DEFINE_UNQUOTED(RGB_PATH,"$cf_path")
+
+no_x11_rgb=
+if test "$RGB_PATH" = no
+then
+       no_x11_rgb="#"
+fi
+AC_SUBST(no_x11_rgb)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_XOPEN_CURSES version: 13 updated: 2015/12/12 20:59:52
 dnl ---------------
 dnl Test if we should define X/Open source for curses, needed on Digital Unix
@@ -3423,7 +3602,7 @@ esac
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 50 updated: 2015/10/17 19:03:33
+dnl CF_XOPEN_SOURCE version: 52 updated: 2016/08/27 12:21:42
 dnl ---------------
 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
 dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -3443,7 +3622,7 @@ case $host_os in
 (aix[[4-7]]*)
        cf_xopen_source="-D_ALL_SOURCE"
        ;;
-(cygwin|msys)
+(msys)
        cf_XOPEN_SOURCE=600
        ;;
 (darwin[[0-8]].*)
@@ -3471,7 +3650,7 @@ case $host_os in
        cf_xopen_source="-D_SGI_SOURCE"
        cf_XOPEN_SOURCE=
        ;;
-(linux*|gnu*|mint*|k*bsd*-gnu)
+(linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
        CF_GNU_SOURCE
        ;;
 (minix*)
@@ -3493,9 +3672,6 @@ case $host_os in
 (openbsd*)
        # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
        ;;
-(os2*)
-       cf_XOPEN_SOURCE=
-       ;;
 (osf[[45]]*)
        cf_xopen_source="-D_OSF_SOURCE"
        ;;