]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/aclocal.m4
ncurses 6.0 - patch 20150808
[ncurses.git] / test / aclocal.m4
index c305e0013d6db06d439b3a91a7772b382994aa2e..0ea83b55135771270f1b5c89e76a05f564809375 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 2003-2012,2013 Free Software Foundation, Inc.              *
+dnl Copyright (c) 2003-2014,2015 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.87 2013/07/27 22:25:56 tom Exp $
+dnl $Id: aclocal.m4,v 1.120 2015/08/08 14:27:27 tom Exp $
 dnl
 dnl Author: Thomas E. Dickey
 dnl
@@ -40,7 +40,7 @@ dnl See http://invisible-island.net/autoconf/ for additional information.
 dnl
 dnl ---------------------------------------------------------------------------
 dnl ---------------------------------------------------------------------------
-dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56
+dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
 dnl ------------------
 dnl Conditionally generate script according to whether we're using a given autoconf.
 dnl
@@ -49,7 +49,7 @@ dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
 dnl $3 = code to use if AC_ACVERSION is older than $1.
 define([CF_ACVERSION_CHECK],
 [
-ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl
+ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl
 ifdef([m4_version_compare],
 [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
 [CF_ACVERSION_COMPARE(
@@ -66,7 +66,7 @@ define([CF_ACVERSION_COMPARE],
 [ifelse([$8], , ,[$8])],
 [ifelse([$9], , ,[$9])])])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
+dnl CF_ADD_CFLAGS version: 12 updated: 2015/04/12 15:39:00
 dnl -------------
 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
 dnl The second parameter if given makes this macro verbose.
@@ -84,14 +84,14 @@ cf_new_extra_cppflags=
 for cf_add_cflags in $1
 do
 case $cf_fix_cppflags in
-no)
-       case $cf_add_cflags in #(vi
-       -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+(no)
+       case $cf_add_cflags in
+       (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
                case $cf_add_cflags in
-               -D*)
+               (-D*)
                        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
 
-                       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+                       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
                                && test -z "${cf_tst_cflags}" \
                                && cf_fix_cppflags=yes
 
@@ -105,11 +105,11 @@ no)
                        ;;
                esac
                case "$CPPFLAGS" in
-               *$cf_add_cflags) #(vi
+               (*$cf_add_cflags)
                        ;;
-               *) #(vi
-                       case $cf_add_cflags in #(vi
-                       -D*)
+               (*)
+                       case $cf_add_cflags in
+                       (-D*)
                                cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
                                CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
                                ;;
@@ -118,17 +118,17 @@ no)
                        ;;
                esac
                ;;
-       *)
+       (*)
                cf_new_cflags="$cf_new_cflags $cf_add_cflags"
                ;;
        esac
        ;;
-yes)
+(yes)
        cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
 
        cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
 
-       test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+       test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
                && test -z "${cf_tst_cflags}" \
                && cf_fix_cppflags=no
        ;;
@@ -154,7 +154,7 @@ AC_SUBST(EXTRA_CPPFLAGS)
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57
+dnl CF_ADD_INCDIR version: 14 updated: 2015/05/25 20:53:04
 dnl -------------
 dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it's
 dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
@@ -205,6 +205,8 @@ if test -n "$1" ; then
                else
                  break
                fi
+         else
+               break
          fi
        done
   done
@@ -219,7 +221,7 @@ dnl $1 = library to add, without the "-l"
 dnl $2 = variable to update (default $LIBS)
 AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57
+dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57
 dnl -------------
 dnl    Adds to the library-path
 dnl
@@ -231,37 +233,55 @@ dnl
 AC_DEFUN([CF_ADD_LIBDIR],
 [
 if test -n "$1" ; then
-  for cf_add_libdir in $1
-  do
-    if test $cf_add_libdir = /usr/lib ; then
-      :
-    elif test -d $cf_add_libdir
-    then
-      cf_have_libdir=no
-      if test -n "$LDFLAGS$LIBS" ; then
-        # a loop is needed to ensure we can add subdirs of existing dirs
-        for cf_test_libdir in $LDFLAGS $LIBS ; do
-          if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
-            cf_have_libdir=yes; break
-          fi
-        done
-      fi
-      if test "$cf_have_libdir" = no ; then
-        CF_VERBOSE(adding $cf_add_libdir to library-path)
-        ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
-      fi
-    fi
-  done
+       for cf_add_libdir in $1
+       do
+               if test $cf_add_libdir = /usr/lib ; then
+                       :
+               elif test -d $cf_add_libdir
+               then
+                       cf_have_libdir=no
+                       if test -n "$LDFLAGS$LIBS" ; then
+                               # a loop is needed to ensure we can add subdirs of existing dirs
+                               for cf_test_libdir in $LDFLAGS $LIBS ; do
+                                       if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
+                                               cf_have_libdir=yes; break
+                                       fi
+                               done
+                       fi
+                       if test "$cf_have_libdir" = no ; then
+                               CF_VERBOSE(adding $cf_add_libdir to library-path)
+                               ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
+                       fi
+               fi
+       done
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
+dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27
 dnl -----------
-dnl Add one or more libraries, used to enforce consistency.
+dnl Add one or more libraries, used to enforce consistency.  Libraries are
+dnl prepended to an existing list, since their dependencies are assumed to
+dnl already exist in the list.
 dnl
 dnl $1 = libraries to add, with the "-l", etc.
 dnl $2 = variable to update (default $LIBS)
-AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
+AC_DEFUN([CF_ADD_LIBS],[
+cf_add_libs="$1"
+# Filter out duplicates - this happens with badly-designed ".pc" files...
+for cf_add_1lib in [$]ifelse($2,,LIBS,[$2])
+do
+       for cf_add_2lib in $cf_add_libs
+       do
+               if test "x$cf_add_1lib" = "x$cf_add_2lib"
+               then
+                       cf_add_1lib=
+                       break
+               fi
+       done
+       test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
+done
+ifelse($2,,LIBS,[$2])="$cf_add_libs"
+])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_ADD_LIB_AFTER version: 3 updated: 2013/07/09 21:27:22
 dnl ----------------
@@ -276,7 +296,7 @@ LIBS=`echo "$LIBS" | sed -e "s/[[   ]][[    ]]*/ /g" -e "s%$1 %$1 $2 %" -e 's%  % %
 CF_VERBOSE(...after  $LIBS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
+dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05
 dnl ------------------
 dnl Append to a search-list for a nonstandard header/lib-file
 dnl    $1 = the variable to return as result
@@ -286,9 +306,9 @@ dnl $4 = the directory under which we will test for subdirectories
 dnl $5 = a directory that we do not want $4 to match
 AC_DEFUN([CF_ADD_SUBDIR_PATH],
 [
-test "$4" != "$5" && \
+test "x$4" != "x$5" && \
 test -d "$4" && \
-ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
+ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) {
        test -n "$verbose" && echo "    ... testing for $3-directories under $4"
        test -d $4/$3 &&          $1="[$]$1 $4/$3"
        test -d $4/$3/$2 &&       $1="[$]$1 $4/$3/$2"
@@ -310,7 +330,7 @@ dnl Allow user to enable a normally-off option.
 AC_DEFUN([CF_ARG_ENABLE],
 [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42
+dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14
 dnl -------------
 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
 dnl values.
@@ -323,17 +343,17 @@ dnl $4 = action if perform if option is default
 dnl $5 = default option value (either 'yes' or 'no')
 AC_DEFUN([CF_ARG_OPTION],
 [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
-  if test "$enableval" != "$5" ; then
+       if test "$enableval" != "$5" ; then
 ifelse([$3],,[    :]dnl
 ,[    $3]) ifelse([$4],,,[
-  else
-    $4])
-  fi],[enableval=$5 ifelse([$4],,,[
-  $4
+       else
+               $4])
+       fi],[enableval=$5 ifelse([$4],,,[
+       $4
 ])dnl
-  ])])dnl
+])])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49
+dnl CF_CC_ENV_FLAGS version: 2 updated: 2015/04/12 15:39:00
 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
@@ -344,8 +364,8 @@ AC_DEFUN([CF_CC_ENV_FLAGS],
 : ${CC:=cc}
 
 AC_MSG_CHECKING(\$CC variable)
-case "$CC" in #(vi
-*[[\ \ ]]-[[IUD]]*)
+case "$CC" in
+(*[[\ \        ]]-[[IUD]]*)
        AC_MSG_RESULT(broken)
        AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
        # humor him...
@@ -353,7 +373,7 @@ case "$CC" in #(vi
        CC=`echo "$CC" | sed -e 's/[[   ]].*//'`
        CF_ADD_CFLAGS($cf_flags)
        ;;
-*)
+(*)
        AC_MSG_RESULT(ok)
        ;;
 esac
@@ -394,7 +414,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58
+dnl CF_CHECK_CFLAGS version: 3 updated: 2014/07/22 05:32:57
 dnl ---------------
 dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
 dnl a build-configuration such as imake.  These have the pitfall that they
@@ -406,17 +426,30 @@ CF_VERBOSE(checking additions to CFLAGS)
 cf_check_cflags="$CFLAGS"
 cf_check_cppflags="$CPPFLAGS"
 CF_ADD_CFLAGS($1,yes)
-if test "$cf_check_cflags" != "$CFLAGS" ; then
+if test "x$cf_check_cflags" != "x$CFLAGS" ; then
 AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
        [CF_VERBOSE(test-compile failed.  Undoing change to \$CFLAGS)
-        if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
+        if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
                 CF_VERBOSE(but keeping change to \$CPPFLAGS)
         fi
         CFLAGS="$cf_check_flags"])
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39
+dnl CF_CHECK_CURSES_LIB version: 1 updated: 2015/04/25 20:53:11
+dnl -------------------
+dnl $1 = nominal library name, used also for header lookup
+dnl $2 = suffix to append to library name
+dnl $3 = function to check for using AC_CHECK_LIB
+AC_DEFUN([CF_CHECK_CURSES_LIB],
+[
+AC_CHECK_LIB($1$2,$3,[
+CF_UPPER(cf_upper,have_lib$1)
+CF_ADD_LIBS(-l$1$2)
+AC_DEFINE_UNQUOTED($cf_upper,1)])
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35
 dnl -----------------
 dnl Check if the given compiler is really clang.  clang's C driver defines
 dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
@@ -427,7 +460,7 @@ dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked from
 dnl the wrappers for gcc and g++ warnings.
 dnl
 dnl $1 = GCC (default) or GXX
-dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
+dnl $2 = CLANG_COMPILER (default)
 dnl $3 = CFLAGS (default) or CXXFLAGS
 AC_DEFUN([CF_CLANG_COMPILER],[
 ifelse([$2],,CLANG_COMPILER,[$2])=no
@@ -470,7 +503,7 @@ 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: 4 updated: 2011/01/15 16:39:24
+dnl CF_CURSES_CHECK_DATA version: 5 updated: 2014/07/19 18:41:17
 dnl --------------------
 dnl Check if curses.h defines the given data/variable.
 dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG.
@@ -495,6 +528,7 @@ extern char $1;
 int main(void)
 {
        void *foo = &($1);
+       fprintf(stderr, "testing linkage of $1:%p\n", foo);
        ${cf_cv_main_return:-return}(foo == 0);
 }],[cf_result=yes],[cf_result=no],[
        # cross-compiling
@@ -502,6 +536,7 @@ int main(void)
 [extern char $1;],[
        do {
                void *foo = &($1);
+               fprintf(stderr, "testing linkage of $1:%p\n", foo);
                ${cf_cv_main_return:-return}(foo == 0);
        } while (0)
 ],[cf_result=yes],[cf_result=no])
@@ -548,22 +583,22 @@ CF_NCURSES_VERSION
 CF_CURSES_LIBS
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CPPFLAGS version: 11 updated: 2011/04/09 14:51:08
+dnl CF_CURSES_CPPFLAGS version: 12 updated: 2015/04/15 19:08:48
 dnl ------------------
 dnl Look for the curses headers.
 AC_DEFUN([CF_CURSES_CPPFLAGS],[
 
 AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
 cf_cv_curses_incdir=no
-case $host_os in #(vi
-hpux10.*) #(vi
+case $host_os in
+(hpux10.*)
        if test "x$cf_cv_screen" = "xcurses_colr"
        then
                test -d /usr/include/curses_colr && \
                cf_cv_curses_incdir="-I/usr/include/curses_colr"
        fi
        ;;
-sunos3*|sunos4*)
+(sunos3*|sunos4*)
        if test "x$cf_cv_screen" = "xcurses_5lib"
        then
                test -d /usr/5lib && \
@@ -579,7 +614,7 @@ CF_CURSES_HEADER
 CF_TERM_HEADER
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_FUNCS version: 17 updated: 2011/05/14 16:07:29
+dnl CF_CURSES_FUNCS version: 18 updated: 2014/07/19 18:44:41
 dnl ---------------
 dnl Curses-functions are a little complicated, since a lot of them are macros.
 AC_DEFUN([CF_CURSES_FUNCS],
@@ -600,6 +635,7 @@ do
                        [
 #ifndef ${cf_func}
 long foo = (long)(&${cf_func});
+fprintf(stderr, "testing linkage of $cf_func:%p\n", foo);
 if (foo + 1234 > 5678)
        ${cf_cv_main_return:-return}(foo);
 #endif
@@ -618,7 +654,7 @@ if (foo + 1234 > 5678)
 done
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_HEADER version: 3 updated: 2011/05/01 19:47:45
+dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30
 dnl ----------------
 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
 dnl variations of ncurses' installs.
@@ -627,11 +663,9 @@ dnl $1 = ncurses when looking for ncurses, or is empty
 AC_DEFUN([CF_CURSES_HEADER],[
 AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
 cf_cv_ncurses_header=none
-for cf_header in ifelse($1,,,[ \
-    $1/ncurses.h \
-       $1/curses.h]) \
-       ncurses.h \
-       curses.h ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
+for cf_header in \
+       ncurses.h ifelse($1,,,[$1/ncurses.h]) \
+       curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
 do
 AC_TRY_COMPILE([#include <${cf_header}>],
        [initscr(); tgoto("?", 0,0)],
@@ -647,7 +681,7 @@ fi
 AC_CHECK_HEADERS($cf_cv_ncurses_header)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_LIBS version: 37 updated: 2013/02/09 17:33:50
+dnl CF_CURSES_LIBS version: 39 updated: 2015/05/10 19:52:14
 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.
@@ -656,17 +690,17 @@ AC_DEFUN([CF_CURSES_LIBS],[
 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 AC_MSG_CHECKING(if we have identified curses libraries)
 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
-    [initscr(); tgoto("?", 0,0)],
-    cf_result=yes,
-    cf_result=no)
+       [initscr(); tgoto("?", 0,0)],
+       cf_result=yes,
+       cf_result=no)
 AC_MSG_RESULT($cf_result)
 
 if test "$cf_result" = no ; then
-case $host_os in #(vi
-freebsd*) #(vi
-    AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
-    ;;
-hpux10.*) #(vi
+case $host_os in
+(freebsd*)
+       AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
+       ;;
+(hpux10.*)
        # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
        # next (1998), and xcurses "newer" (2000).  There is no header file for
        # Hcurses; the subdirectory curses_colr has the headers (curses.h and
@@ -685,9 +719,9 @@ hpux10.*) #(vi
                        ])])
        fi
        ;;
-linux*)
+(linux*)
        case `arch 2>/dev/null` in
-       x86_64)
+       (x86_64)
                if test -d /lib64
                then
                        CF_ADD_LIBDIR(/lib64)
@@ -695,21 +729,21 @@ linux*)
                        CF_ADD_LIBDIR(/lib)
                fi
                ;;
-       *)
+       (*)
                CF_ADD_LIBDIR(/lib)
                ;;
        esac
        ;;
-sunos3*|sunos4*)
+(sunos3*|sunos4*)
        if test "x$cf_cv_screen" = "xcurses_5lib"
        then
                if test -d /usr/5lib ; then
                        CF_ADD_LIBDIR(/usr/5lib)
                        CF_ADD_LIBS(-lcurses -ltermcap)
                fi
-    fi
-    ac_cv_func_initscr=yes
-    ;;
+       fi
+       ac_cv_func_initscr=yes
+       ;;
 esac
 
 if test ".$ac_cv_func_initscr" != .yes ; then
@@ -775,7 +809,7 @@ fi
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_TERM_H version: 10 updated: 2012/10/06 08:57:51
+dnl CF_CURSES_TERM_H version: 11 updated: 2015/04/15 19:08:48
 dnl ----------------
 dnl SVr4 curses should have term.h as well (where it puts the definitions of
 dnl the low-level interface).  This may not be true in old/broken implementations,
@@ -792,8 +826,8 @@ AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
 
 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
 
-case ${cf_cv_ncurses_header:-curses.h} in #(vi
-*/*)
+case ${cf_cv_ncurses_header:-curses.h} in
+(*/*)
        cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
        cf_header_list="$cf_header_item $cf_header_list"
        ;;
@@ -810,8 +844,8 @@ do
        [cf_cv_term_header=no])
 done
 
-case $cf_cv_term_header in #(vi
-no)
+case $cf_cv_term_header in
+(no)
        # If curses is ncurses, some packagers still mess it up by trying to make
        # us use GNU termcap.  This handles the most common case.
        for cf_header in ncurses/term.h ncursesw/term.h
@@ -832,20 +866,20 @@ make an error
 esac
 ])
 
-case $cf_cv_term_header in #(vi
-term.h) #(vi
+case $cf_cv_term_header in
+(term.h)
        AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
        ;;
-ncurses/term.h) #(vi
+(ncurses/term.h)
        AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
        ;;
-ncursesw/term.h)
+(ncursesw/term.h)
        AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
        ;;
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_UNCTRL_H version: 2 updated: 2012/10/06 08:57:51
+dnl CF_CURSES_UNCTRL_H version: 4 updated: 2015/04/15 19:08:48
 dnl ------------------
 dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
 dnl may put it in a subdirectory (along with ncurses' other headers, of
@@ -862,8 +896,8 @@ AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
 
 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
 
-case ${cf_cv_ncurses_header:-curses.h} in #(vi
-*/*)
+case ${cf_cv_ncurses_header:-curses.h} in
+(*/*)
        cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
        cf_header_list="$cf_header_item $cf_header_list"
        ;;
@@ -879,22 +913,22 @@ do
         break],
        [cf_cv_unctrl_header=no])
 done
+])
 
-case $cf_cv_unctrl_header in #(vi
-no)
+case $cf_cv_unctrl_header in
+(no)
        AC_MSG_WARN(unctrl.h header not found)
        ;;
 esac
-])
 
-case $cf_cv_unctrl_header in #(vi
-unctrl.h) #(vi
+case $cf_cv_unctrl_header in
+(unctrl.h)
        AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
        ;;
-ncurses/unctrl.h) #(vi
+(ncurses/unctrl.h)
        AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
        ;;
-ncursesw/unctrl.h)
+(ncursesw/unctrl.h)
        AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
        ;;
 esac
@@ -962,7 +996,7 @@ dnl ----------
 dnl "dirname" is not portable, so we fake it with a shell script.
 AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28
+dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57
 dnl ---------------
 dnl You can always use "make -n" to see the actual options, but it's hard to
 dnl pick out/analyze warning messages when the compile-line is long.
@@ -979,17 +1013,17 @@ AC_MSG_CHECKING(if you want to see long compiling messages)
 CF_ARG_DISABLE(echo,
        [  --disable-echo          do not display "compiling" commands],
        [
-    ECHO_LT='--silent'
-    ECHO_LD='@echo linking [$]@;'
-    RULE_CC='@echo compiling [$]<'
-    SHOW_CC='@echo compiling [$]@'
-    ECHO_CC='@'
+       ECHO_LT='--silent'
+       ECHO_LD='@echo linking [$]@;'
+       RULE_CC='@echo compiling [$]<'
+       SHOW_CC='@echo compiling [$]@'
+       ECHO_CC='@'
 ],[
-    ECHO_LT=''
-    ECHO_LD=''
-    RULE_CC=''
-    SHOW_CC=''
-    ECHO_CC=''
+       ECHO_LT=''
+       ECHO_LD=''
+       RULE_CC=''
+       SHOW_CC=''
+       ECHO_CC=''
 ])
 AC_MSG_RESULT($enableval)
 AC_SUBST(ECHO_LT)
@@ -1111,7 +1145,7 @@ fi
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02
+dnl CF_FIND_LINKAGE version: 20 updated: 2015/04/18 08:56:57
 dnl ---------------
 dnl Find a library (specifically the linkage used in the code fragment),
 dnl searching for it if it is not already in the library path.
@@ -1159,73 +1193,73 @@ AC_TRY_LINK([$1],[$2],[
        cf_cv_find_linkage_$3=no
        LIBS="$cf_save_LIBS"
 
-    CF_VERBOSE(find linkage for $3 library)
-    CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
-
-    cf_save_CPPFLAGS="$CPPFLAGS"
-    cf_test_CPPFLAGS="$CPPFLAGS"
-
-    CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
-    for cf_cv_header_path_$3 in $cf_search
-    do
-      if test -d $cf_cv_header_path_$3 ; then
-        CF_VERBOSE(... testing $cf_cv_header_path_$3)
-        CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
-        AC_TRY_COMPILE([$1],[$2],[
-            CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
-            cf_cv_find_linkage_$3=maybe
-            cf_test_CPPFLAGS="$CPPFLAGS"
-            break],[
-            CPPFLAGS="$cf_save_CPPFLAGS"
-            ])
-      fi
-    done
-
-    if test "$cf_cv_find_linkage_$3" = maybe ; then
-
-      CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
-
-      cf_save_LIBS="$LIBS"
-      cf_save_LDFLAGS="$LDFLAGS"
-
-      ifelse([$6],,,[
-        CPPFLAGS="$cf_test_CPPFLAGS"
-        LIBS="-l$3 $7 $cf_save_LIBS"
-        AC_TRY_LINK([$1],[$2],[
-            CF_VERBOSE(... found $3 library in system)
-            cf_cv_find_linkage_$3=yes])
-            CPPFLAGS="$cf_save_CPPFLAGS"
-            LIBS="$cf_save_LIBS"
-            ])
-
-      if test "$cf_cv_find_linkage_$3" != yes ; then
-        CF_LIBRARY_PATH(cf_search,$3)
-        for cf_cv_library_path_$3 in $cf_search
-        do
-          if test -d $cf_cv_library_path_$3 ; then
-            CF_VERBOSE(... testing $cf_cv_library_path_$3)
-            CPPFLAGS="$cf_test_CPPFLAGS"
-            LIBS="-l$3 $7 $cf_save_LIBS"
-            LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
-            AC_TRY_LINK([$1],[$2],[
-                CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
-                cf_cv_find_linkage_$3=yes
-                cf_cv_library_file_$3="-l$3"
-                break],[
-                CPPFLAGS="$cf_save_CPPFLAGS"
-                LIBS="$cf_save_LIBS"
-                LDFLAGS="$cf_save_LDFLAGS"
-                ])
-          fi
-        done
-        CPPFLAGS="$cf_save_CPPFLAGS"
-        LDFLAGS="$cf_save_LDFLAGS"
-      fi
-
-    else
-      cf_cv_find_linkage_$3=no
-    fi
-    ],$7)
+       CF_VERBOSE(find linkage for $3 library)
+       CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
+
+       cf_save_CPPFLAGS="$CPPFLAGS"
+       cf_test_CPPFLAGS="$CPPFLAGS"
+
+       CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
+       for cf_cv_header_path_$3 in $cf_search
+       do
+               if test -d $cf_cv_header_path_$3 ; then
+                       CF_VERBOSE(... testing $cf_cv_header_path_$3)
+                       CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3"
+                       AC_TRY_COMPILE([$1],[$2],[
+                               CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
+                               cf_cv_find_linkage_$3=maybe
+                               cf_test_CPPFLAGS="$CPPFLAGS"
+                               break],[
+                               CPPFLAGS="$cf_save_CPPFLAGS"
+                               ])
+               fi
+       done
+
+       if test "$cf_cv_find_linkage_$3" = maybe ; then
+
+               CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
+
+               cf_save_LIBS="$LIBS"
+               cf_save_LDFLAGS="$LDFLAGS"
+
+               ifelse([$6],,,[
+               CPPFLAGS="$cf_test_CPPFLAGS"
+               LIBS="-l$3 $7 $cf_save_LIBS"
+               AC_TRY_LINK([$1],[$2],[
+                       CF_VERBOSE(... found $3 library in system)
+                       cf_cv_find_linkage_$3=yes])
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+                       LIBS="$cf_save_LIBS"
+                       ])
+
+               if test "$cf_cv_find_linkage_$3" != yes ; then
+                       CF_LIBRARY_PATH(cf_search,$3)
+                       for cf_cv_library_path_$3 in $cf_search
+                       do
+                               if test -d $cf_cv_library_path_$3 ; then
+                                       CF_VERBOSE(... testing $cf_cv_library_path_$3)
+                                       CPPFLAGS="$cf_test_CPPFLAGS"
+                                       LIBS="-l$3 $7 $cf_save_LIBS"
+                                       LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
+                                       AC_TRY_LINK([$1],[$2],[
+                                       CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
+                                       cf_cv_find_linkage_$3=yes
+                                       cf_cv_library_file_$3="-l$3"
+                                       break],[
+                                       CPPFLAGS="$cf_save_CPPFLAGS"
+                                       LIBS="$cf_save_LIBS"
+                                       LDFLAGS="$cf_save_LDFLAGS"
+                                       ])
+                               fi
+                       done
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+                       LDFLAGS="$cf_save_LDFLAGS"
+               fi
+
+       else
+               cf_cv_find_linkage_$3=no
+       fi
+       ],$7)
 ])
 
 LIBS="$cf_save_LIBS"
@@ -1263,7 +1297,7 @@ rm -f core])
 test "$cf_cv_func_curses_version" = yes && AC_DEFINE(HAVE_CURSES_VERSION,1,[Define to 1 if we have curses_version function])
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03
+dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00
 dnl -----------------
 dnl Test for availability of useful gcc __attribute__ directives to quiet
 dnl compiler warnings.  Though useful, not all are supported -- and contrary
@@ -1317,20 +1351,20 @@ EOF
                cf_directive="__attribute__(($cf_attribute))"
                echo "checking for $CC $cf_directive" 1>&AC_FD_CC
 
-               case $cf_attribute in #(vi
-               printf) #(vi
+               case $cf_attribute in
+               (printf)
                        cf_printf_attribute=yes
                        cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
                        ;;
-               scanf) #(vi
+               (scanf)
                        cf_scanf_attribute=yes
                        cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE 1
 EOF
                        ;;
-               *) #(vi
+               (*)
                        cat >conftest.h <<EOF
 #define GCC_$cf_ATTRIBUTE $cf_directive
 EOF
@@ -1340,11 +1374,11 @@ EOF
                if AC_TRY_EVAL(ac_compile); then
                        test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
                        cat conftest.h >>confdefs.h
-                       case $cf_attribute in #(vi
-                       noreturn) #(vi
+                       case $cf_attribute in
+                       (noreturn)
                                AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
                                ;;
-                       printf) #(vi
+                       (printf)
                                cf_value='/* nothing */'
                                if test "$cf_printf_attribute" != no ; then
                                        cf_value='__attribute__((format(printf,fmt,var)))'
@@ -1352,7 +1386,7 @@ EOF
                                fi
                                AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
                                ;;
-                       scanf) #(vi
+                       (scanf)
                                cf_value='/* nothing */'
                                if test "$cf_scanf_attribute" != no ; then
                                        cf_value='__attribute__((format(scanf,fmt,var)))'
@@ -1360,7 +1394,7 @@ EOF
                                fi
                                AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
                                ;;
-                       unused) #(vi
+                       (unused)
                                AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
                                ;;
                        esac
@@ -1387,7 +1421,7 @@ if test "$GCC" = yes ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 29 updated: 2012/06/16 14:55:39
+dnl CF_GCC_WARNINGS version: 32 updated: 2015/04/12 15:39:00
 dnl ---------------
 dnl Check if the compiler supports useful warning options.  There's a few that
 dnl we don't use, simply because they're too noisy:
@@ -1459,10 +1493,14 @@ then
        EXTRA_CFLAGS=
        cf_warn_CONST=""
        test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
+       cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
+       test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
        for cf_opt in W Wall \
                Wbad-function-cast \
                Wcast-align \
                Wcast-qual \
+               Wdeclaration-after-statement \
+               Wextra \
                Winline \
                Wmissing-declarations \
                Wmissing-prototypes \
@@ -1470,25 +1508,25 @@ then
                Wpointer-arith \
                Wshadow \
                Wstrict-prototypes \
-               Wundef $cf_warn_CONST $1
+               Wundef $cf_gcc_warnings $cf_warn_CONST $1
        do
                CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
                if AC_TRY_EVAL(ac_compile); then
                        test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
-                       case $cf_opt in #(vi
-                       Wcast-qual) #(vi
+                       case $cf_opt in
+                       (Wcast-qual)
                                CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
                                ;;
-                       Winline) #(vi
+                       (Winline)
                                case $GCC_VERSION in
-                               [[34]].*)
+                               ([[34]].*)
                                        CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
                                        continue;;
                                esac
                                ;;
-                       Wpointer-arith) #(vi
+                       (Wpointer-arith)
                                case $GCC_VERSION in
-                               [[12]].*)
+                               ([[12]].*)
                                        CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
                                        continue;;
                                esac
@@ -1504,7 +1542,7 @@ rm -rf conftest*
 AC_SUBST(EXTRA_CFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GETOPT_HEADER version: 5 updated: 2012/10/06 16:39:58
+dnl CF_GETOPT_HEADER version: 6 updated: 2014/07/22 14:45:54
 dnl ----------------
 dnl Check for getopt's variables which are commonly defined in stdlib.h,
 dnl unistd.h or (nonstandard) in getopt.h
@@ -1523,7 +1561,10 @@ AC_TRY_COMPILE([
 done
 ])
 if test $cf_cv_getopt_header != none ; then
-       AC_DEFINE(HAVE_GETOPT_HEADER,1,[Define to 1 if we need to include getopt.h])
+       AC_DEFINE(HAVE_GETOPT_HEADER,1,[Define to 1 if getopt variables are declared in header])
+fi
+if test $cf_cv_getopt_header = getopt.h ; then
+       AC_DEFINE(NEED_GETOPT_H,1,[Define to 1 if we must include getopt.h])
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -1557,7 +1598,7 @@ make an error
 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40
+dnl CF_HEADER_PATH version: 13 updated: 2015/04/15 19:08:48
 dnl --------------
 dnl Construct a search-list of directories for a nonstandard header-file
 dnl
@@ -1573,8 +1614,8 @@ cf_header_path_list=""
 if test -n "${CFLAGS}${CPPFLAGS}" ; then
        for cf_header_path in $CPPFLAGS $CFLAGS
        do
-               case $cf_header_path in #(vi
-               -I*)
+               case $cf_header_path in
+               (-I*)
                        cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
                        CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
                        cf_header_path_list="$cf_header_path_list [$]$1"
@@ -1618,7 +1659,7 @@ AC_DEFUN([CF_INHERIT_SCRIPT],
 test -f $1 || ( test -f ../$1 && cp ../$1 ./ )
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_INTEL_COMPILER version: 5 updated: 2013/02/10 10:41:05
+dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00
 dnl -----------------
 dnl Check if the given compiler is really the Intel compiler for Linux.  It
 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
@@ -1637,7 +1678,7 @@ ifelse([$2],,INTEL_COMPILER,[$2])=no
 
 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
        case $host_os in
-       linux*|gnu*)
+       (linux*|gnu*)
                AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
                cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
                ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
@@ -1647,7 +1688,7 @@ if test "$ifelse([$1],,[$1],GCC)" = yes ; then
 make an error
 #endif
 ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
-cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
+cf_save_CFLAGS="$cf_save_CFLAGS -we147"
 ],[])
                ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
                AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
@@ -1656,7 +1697,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LD_RPATH_OPT version: 5 updated: 2011/07/17 14:48:41
+dnl CF_LD_RPATH_OPT version: 6 updated: 2015/04/12 15:39:00
 dnl ---------------
 dnl For the given system and compiler, find the compiler flags to pass to the
 dnl loader to use the "rpath" feature.
@@ -1666,39 +1707,39 @@ AC_REQUIRE([CF_CHECK_CACHE])
 
 LD_RPATH_OPT=
 AC_MSG_CHECKING(for an rpath option)
-case $cf_cv_system_name in #(vi
-irix*) #(vi
+case $cf_cv_system_name in
+(irix*)
        if test "$GCC" = yes; then
                LD_RPATH_OPT="-Wl,-rpath,"
        else
                LD_RPATH_OPT="-rpath "
        fi
        ;;
-linux*|gnu*|k*bsd*-gnu) #(vi
+(linux*|gnu*|k*bsd*-gnu)
        LD_RPATH_OPT="-Wl,-rpath,"
        ;;
-openbsd[[2-9]].*|mirbsd*) #(vi
+(openbsd[[2-9]].*|mirbsd*)
        LD_RPATH_OPT="-Wl,-rpath,"
        ;;
-dragonfly*|freebsd*) #(vi
+(dragonfly*|freebsd*)
        LD_RPATH_OPT="-rpath "
        ;;
-netbsd*) #(vi
+(netbsd*)
        LD_RPATH_OPT="-Wl,-rpath,"
        ;;
-osf*|mls+*) #(vi
+(osf*|mls+*)
        LD_RPATH_OPT="-rpath "
        ;;
-solaris2*) #(vi
+(solaris2*)
        LD_RPATH_OPT="-R"
        ;;
-*)
+(*)
        ;;
 esac
 AC_MSG_RESULT($LD_RPATH_OPT)
 
-case "x$LD_RPATH_OPT" in #(vi
-x-R*)
+case "x$LD_RPATH_OPT" in
+(x-R*)
        AC_MSG_CHECKING(if we need a space after rpath option)
        cf_save_LIBS="$LIBS"
        CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
@@ -1710,7 +1751,7 @@ x-R*)
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
+dnl CF_LIBRARY_PATH version: 10 updated: 2015/04/15 19:08:48
 dnl ---------------
 dnl Construct a search-list of directories for a nonstandard library-file
 dnl
@@ -1724,8 +1765,8 @@ cf_library_path_list=""
 if test -n "${LDFLAGS}${LIBS}" ; then
        for cf_library_path in $LDFLAGS $LIBS
        do
-               case $cf_library_path in #(vi
-               -L*)
+               case $cf_library_path in
+               (-L*)
                        cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
                        CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
                        cf_library_path_list="$cf_library_path_list [$]$1"
@@ -1800,7 +1841,7 @@ ifelse($1,,[
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_MIXEDCASE_FILENAMES version: 4 updated: 2012/10/02 20:55:03
+dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00
 dnl ----------------------
 dnl Check if the file-system supports mixed-case filenames.  If we're able to
 dnl create a lowercase name and see it as uppercase, it doesn't support that.
@@ -1808,11 +1849,11 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES],
 [
 AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
 if test "$cross_compiling" = yes ; then
-       case $target_alias in #(vi
-       *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
+       case $target_alias in
+       (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
                cf_cv_mixedcase=no
                ;;
-       *)
+       (*)
                cf_cv_mixedcase=yes
                ;;
        esac
@@ -1871,46 +1912,96 @@ printf("old\n");
        ,[$1=no])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 10 updated: 2012/10/06 08:57:51
+dnl CF_NCURSES_CONFIG version: 17 updated: 2015/07/07 04:22:07
 dnl -----------------
-dnl Tie together the configure-script macros for ncurses.
-dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
-dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
+dnl Tie together the configure-script macros for ncurses, preferring these in
+dnl order:
+dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG
+dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG
+dnl c) just plain libraries
 dnl
 dnl $1 is the root library name (default: "ncurses")
-AC_DEFUN([CF_NCURSES_CONFIG],
-[
+AC_DEFUN([CF_NCURSES_CONFIG],[
+AC_REQUIRE([CF_PKG_CONFIG])
 cf_ncuconfig_root=ifelse($1,,ncurses,$1)
+cf_have_ncuconfig=no
 
-echo "Looking for ${cf_ncuconfig_root}-config"
+if test "x${PKG_CONFIG:=none}" != xnone; then
+       AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root)
+       if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
+               AC_MSG_RESULT(yes)
 
-CF_ACVERSION_CHECK(2.52,
-       [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
-       [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
+               AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work)
+               cf_have_ncuconfig=unknown
+
+               cf_save_CPPFLAGS="$CPPFLAGS"
+               cf_save_LIBS="$LIBS"
 
-if test "$NCURSES_CONFIG" != none ; then
+               CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
+               CF_ADD_LIBS(`$PKG_CONFIG --libs $cf_ncuconfig_root`)
 
-CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
+               AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
+                       [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
+                       [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
+                               int main(void)
+                               { char *xx = curses_version(); return (xx == 0); }],
+                               [cf_have_ncuconfig=yes],
+                               [cf_have_ncuconfig=no],
+                               [cf_have_ncuconfig=maybe])],
+                       [cf_have_ncuconfig=no])
+               AC_MSG_RESULT($cf_have_ncuconfig)
+               test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
+               if test "$cf_have_ncuconfig" != "yes"
+               then
+                       CPPFLAGS="$cf_save_CPPFLAGS"
+                       LIBS="$cf_save_LIBS"
+                       NCURSES_CONFIG_PKG=none
+               else
+                       AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
+                       NCURSES_CONFIG_PKG=$cf_ncuconfig_root
+               fi
+
+       else
+               AC_MSG_RESULT(no)
+               NCURSES_CONFIG_PKG=none
+       fi
+else
+       NCURSES_CONFIG_PKG=none
+fi
 
-# even with config script, some packages use no-override for curses.h
-CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
+if test "x$cf_have_ncuconfig" = "xno"; then
+       echo "Looking for ${cf_ncuconfig_root}-config"
 
-dnl like CF_NCURSES_CPPFLAGS
-AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
+       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)])
 
-dnl like CF_NCURSES_LIBS
-CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
-AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+       if test "$NCURSES_CONFIG" != none ; then
 
-dnl like CF_NCURSES_VERSION
-cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+               CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
+               CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
 
-else
+               # even with config script, some packages use no-override for curses.h
+               CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
 
-CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
-CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+               dnl like CF_NCURSES_CPPFLAGS
+               AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
 
+               dnl like CF_NCURSES_LIBS
+               CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
+               AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
+
+               dnl like CF_NCURSES_VERSION
+               cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
+
+       else
+
+               CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
+               CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
+
+       fi
+else
+       NCURSES_CONFIG=none
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -2000,7 +2091,7 @@ AC_TRY_LINK([
 test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS,1,[Define to 1 if we have ncurses extensions])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_HEADER version: 3 updated: 2012/10/06 08:57:51
+dnl CF_NCURSES_HEADER version: 4 updated: 2015/04/15 19:08:48
 dnl -----------------
 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
 dnl variations of ncurses' installs.
@@ -2049,24 +2140,24 @@ fi
 
 # Set definitions to allow ifdef'ing for ncurses.h
 
-case $cf_cv_ncurses_header in # (vi
-*ncurses.h)
+case $cf_cv_ncurses_header in
+(*ncurses.h)
        AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
        ;;
 esac
 
-case $cf_cv_ncurses_header in # (vi
-ncurses/curses.h|ncurses/ncurses.h)
+case $cf_cv_ncurses_header in
+(ncurses/curses.h|ncurses/ncurses.h)
        AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
        ;;
-ncursesw/curses.h|ncursesw/ncurses.h)
+(ncursesw/curses.h|ncursesw/ncurses.h)
        AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
        ;;
 esac
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38
+dnl CF_NCURSES_LIBS version: 17 updated: 2015/04/15 19:08:48
 dnl ---------------
 dnl Look for the ncurses library.  This is a little complicated on Linux,
 dnl because it may be linked with the gpm (general purpose mouse) library.
@@ -2092,8 +2183,8 @@ AC_CHECK_LIB(gpm,Gpm_Open,
                [LIBS="$cf_ncurses_SAVE"],
                [cf_ncurses_LIBS="-lgpm"])])
 
-case $host_os in #(vi
-freebsd*)
+case $host_os in
+(freebsd*)
        # This is only necessary if you are linking against an obsolete
        # version of ncurses (but it should do no harm, since it's static).
        if test "$cf_nculib_root" = ncurses ; then
@@ -2251,7 +2342,7 @@ AC_TRY_COMPILE([
 test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H,1,[Define to 1 if we appear to be using NetBSD menu.h])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NO_LEAKS_OPTION version: 5 updated: 2012/10/02 20:55:03
+dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00
 dnl ------------------
 dnl see CF_WITH_NO_LEAKS
 AC_DEFUN([CF_NO_LEAKS_OPTION],[
@@ -2267,12 +2358,12 @@ AC_ARG_WITH($1,
        [with_$1=])
 AC_MSG_RESULT(${with_$1:-no})
 
-case .$with_cflags in #(vi
-.*-g*)
-       case .$CFLAGS in #(vi
-       .*-g*) #(vi
+case .$with_cflags in
+(.*-g*)
+       case .$CFLAGS in
+       (.*-g*)
                ;;
-       *)
+       (*)
                CF_ADD_CFLAGS([-g])
                ;;
        esac
@@ -2280,7 +2371,7 @@ case .$with_cflags in #(vi
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PATH_SYNTAX version: 14 updated: 2012/06/19 20:58:54
+dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57
 dnl --------------
 dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
 dnl begins with one of the prefix/exec_prefix variables, and then again if the
@@ -2288,32 +2379,32 @@ dnl result begins with 'NONE'.  This is necessary to work around autoconf's
 dnl delayed evaluation of those symbols.
 AC_DEFUN([CF_PATH_SYNTAX],[
 if test "x$prefix" != xNONE; then
-  cf_path_syntax="$prefix"
+       cf_path_syntax="$prefix"
 else
-  cf_path_syntax="$ac_default_prefix"
-fi
-
-case ".[$]$1" in #(vi
-.\[$]\(*\)*|.\'*\'*) #(vi
-  ;;
-..|./*|.\\*) #(vi
-  ;;
-.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX
-  ;;
-.\[$]{*prefix}*|.\[$]{*dir}*) #(vi
-  eval $1="[$]$1"
-  case ".[$]$1" in #(vi
-  .NONE/*)
-    $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
-    ;;
-  esac
-  ;; #(vi
-.no|.NONE/*)
-  $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
-  ;;
-*)
-  ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
-  ;;
+       cf_path_syntax="$ac_default_prefix"
+fi
+
+case ".[$]$1" in
+(.\[$]\(*\)*|.\'*\'*)
+       ;;
+(..|./*|.\\*)
+       ;;
+(.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
+       ;;
+(.\[$]{*prefix}*|.\[$]{*dir}*)
+       eval $1="[$]$1"
+       case ".[$]$1" in
+       (.NONE/*)
+               $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
+               ;;
+       esac
+       ;;
+(.no|.NONE/*)
+       $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
+       ;;
+(*)
+       ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
+       ;;
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -2362,7 +2453,7 @@ else
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PKG_CONFIG version: 7 updated: 2011/04/29 04:53:22
+dnl CF_PKG_CONFIG version: 10 updated: 2015/04/26 18:06:58
 dnl -------------
 dnl Check for the package-config program, unless disabled by command-line.
 AC_DEFUN([CF_PKG_CONFIG],
@@ -2374,16 +2465,16 @@ AC_ARG_WITH(pkg-config,
        [cf_pkg_config=yes])
 AC_MSG_RESULT($cf_pkg_config)
 
-case $cf_pkg_config in #(vi
-no) #(vi
+case $cf_pkg_config in
+(no)
        PKG_CONFIG=none
        ;;
-yes) #(vi
+(yes)
        CF_ACVERSION_CHECK(2.52,
                [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)],
                [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)])
        ;;
-*)
+(*)
        PKG_CONFIG=$withval
        ;;
 esac
@@ -2391,12 +2482,14 @@ esac
 test -z "$PKG_CONFIG" && PKG_CONFIG=none
 if test "$PKG_CONFIG" != none ; then
        CF_PATH_SYNTAX(PKG_CONFIG)
+elif test "x$cf_pkg_config" != xno ; then
+       AC_MSG_WARN(pkg-config is not installed)
 fi
 
 AC_SUBST(PKG_CONFIG)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42
+dnl CF_POSIX_C_SOURCE version: 9 updated: 2015/04/12 15:39:00
 dnl -----------------
 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
 dnl
@@ -2428,15 +2521,15 @@ make an error
 #endif],
        [cf_cv_posix_c_source=no],
        [cf_want_posix_source=no
-        case .$cf_POSIX_C_SOURCE in #(vi
-        .[[12]]??*) #(vi
+        case .$cf_POSIX_C_SOURCE in
+        (.[[12]]??*)
                cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
                ;;
-        .2) #(vi
+        (.2)
                cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
                cf_want_posix_source=yes
                ;;
-        .*)
+        (.*)
                cf_want_posix_source=yes
                ;;
         esac
@@ -2493,7 +2586,7 @@ done
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC version: 3 updated: 2012/10/06 15:31:55
+dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58
 dnl ----------
 dnl standard check for CC, plus followup sanity checks
 dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
@@ -2503,10 +2596,10 @@ CF_GCC_VERSION
 CF_ACVERSION_CHECK(2.52,
        [AC_PROG_CC_STDC],
        [CF_ANSI_CC_REQD])
-CF_CC_ENV_FLAGS 
+CF_CC_ENV_FLAGS
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07
+dnl CF_PROG_INSTALL version: 7 updated: 2015/04/18 08:56:57
 dnl ---------------
 dnl Force $INSTALL to be an absolute-path.  Otherwise, edit_man.sh and the
 dnl misc/tabset install won't work properly.  Usually this happens only when
@@ -2514,13 +2607,13 @@ dnl using the fallback mkinstalldirs script
 AC_DEFUN([CF_PROG_INSTALL],
 [AC_PROG_INSTALL
 case $INSTALL in
-/*)
-  ;;
-*)
-  CF_DIRNAME(cf_dir,$INSTALL)
-  test -z "$cf_dir" && cf_dir=.
-  INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
-  ;;
+(/*)
+       ;;
+(*)
+       CF_DIRNAME(cf_dir,$INSTALL)
+       test -z "$cf_dir" && cf_dir=.
+       INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
+       ;;
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -2549,7 +2642,7 @@ $1=`echo "$2" | \
                -e 's/-[[UD]]'"$3"'\(=[[^       ]]*\)\?[$]//g'`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK version: 10 updated: 2013/07/22 18:27:50
+dnl CF_RPATH_HACK version: 11 updated: 2013/09/01 13:02:00
 dnl -------------
 AC_DEFUN([CF_RPATH_HACK],
 [
@@ -2566,8 +2659,8 @@ if test -n "$LD_RPATH_OPT" ; then
 
 AC_TRY_LINK([#include <stdio.h>],
                [printf("Hello");],
-               [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
-                cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[     ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`])
+               [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
+                cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[     ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`])
 
                # If we passed the link-test, but get a "not found" on a given library,
                # this could be due to inept reconfiguration of gcc to make it only
@@ -2606,7 +2699,7 @@ fi
 AC_SUBST(EXTRA_LDFLAGS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24
+dnl CF_RPATH_HACK_2 version: 7 updated: 2015/04/12 15:39:00
 dnl ---------------
 dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
 dnl EXTRA_LDFLAGS for each -L option found.
@@ -2622,8 +2715,8 @@ CF_VERBOSE(...checking $1 [$]$1)
 cf_rpath_dst=
 for cf_rpath_src in [$]$1
 do
-       case $cf_rpath_src in #(vi
-       -L*) #(vi
+       case $cf_rpath_src in
+       (-L*)
 
                # check if this refers to a directory which we will ignore
                cf_rpath_skip=no
@@ -2701,7 +2794,7 @@ AC_MSG_RESULT($cf_cv_sig_atomic_t)
 test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t,[Define to signal global datatype])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
+dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06
 dnl --------------
 dnl Construct a search-list for a nonstandard header/lib-file
 dnl    $1 = the variable to return as result
@@ -2711,14 +2804,21 @@ AC_DEFUN([CF_SUBDIR_PATH],
 [
 $1=
 
-CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
 CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
-CF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix)
-CF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix)
+
+for cf_subdir_prefix in \
+       /usr \
+       /usr/local \
+       /usr/pkg \
+       /opt \
+       /opt/local \
+       [$]HOME
+do
+       CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix)
+done
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SYS_TIME_SELECT version: 5 updated: 2012/10/04 05:24:07
+dnl CF_SYS_TIME_SELECT version: 6 updated: 2015/04/18 08:56:57
 dnl ------------------
 dnl Check if we can include <sys/time.h> with <sys/select.h>; this breaks on
 dnl older SCO configurations.
@@ -2735,24 +2835,24 @@ AC_TRY_COMPILE([
 #include <sys/select.h>
 #endif
 ],[],[cf_cv_sys_time_select=yes],
-     [cf_cv_sys_time_select=no])
-     ])
+        [cf_cv_sys_time_select=no])
+        ])
 AC_MSG_RESULT($cf_cv_sys_time_select)
 test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT,1,[Define to 1 if we can include <sys/time.h> with <sys/select.h>])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_TERM_HEADER version: 3 updated: 2012/10/06 08:57:51
+dnl CF_TERM_HEADER version: 4 updated: 2015/04/15 19:08:48
 dnl --------------
 dnl Look for term.h, which is part of X/Open curses.  It defines the interface
 dnl to terminfo database.  Usually it is in the same include-path as curses.h,
 dnl but some packagers change this, breaking various applications.
 AC_DEFUN([CF_TERM_HEADER],[
 AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
-case ${cf_cv_ncurses_header} in #(vi
-*/ncurses.h|*/ncursesw.h) #(vi
+case ${cf_cv_ncurses_header} in
+(*/ncurses.h|*/ncursesw.h)
        cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
        ;;
-*)
+(*)
        cf_term_header=term.h
        ;;
 esac
@@ -2772,17 +2872,17 @@ done
 
 # Set definitions to allow ifdef'ing to accommodate subdirectories
 
-case $cf_cv_term_header in # (vi
-*term.h)
+case $cf_cv_term_header in
+(*term.h)
        AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
        ;;
 esac
 
-case $cf_cv_term_header in # (vi
-ncurses/term.h) #(vi
+case $cf_cv_term_header in
+(ncurses/term.h)
        AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
        ;;
-ncursesw/term.h)
+(ncursesw/term.h)
        AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
        ;;
 esac
@@ -2797,7 +2897,7 @@ top_builddir=ifelse($1,,`pwd`,$1)
 AC_SUBST(top_builddir)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_TPUTS_PROTO version: 2 updated: 2011/04/23 19:25:50
+dnl CF_TPUTS_PROTO version: 3 updated: 2015/04/17 21:26:14
 dnl --------------
 dnl Check for type of function-pointer passed to tputs.  Some old
 dnl implementations used functions that had different prototypes, making it
@@ -2823,7 +2923,7 @@ then
 
 static $cf_ret outc($cf_arg value) { $cf_return; }
 ],[
-       tputs("hello", 0, outc); 
+       tputs("hello", 0, outc);
        ${cf_cv_main_return:-return}(0);
 ],[
                CF_VERBOSE([prototype $cf_ret func($cf_arg value)])
@@ -2841,7 +2941,7 @@ EOF
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_TRIM_X_LIBS version: 2 updated: 2013/07/09 21:27:22
+dnl CF_TRIM_X_LIBS version: 3 updated: 2015/04/12 15:39:00
 dnl --------------
 dnl Trim extra base X libraries added as a workaround for inconsistent library
 dnl dependencies returned by "new" pkg-config files.
@@ -2849,7 +2949,7 @@ AC_DEFUN([CF_TRIM_X_LIBS],[
        for cf_trim_lib in Xmu Xt X11
        do
                case "$LIBS" in
-               *-l$cf_trim_lib\ *-l$cf_trim_lib*)
+               (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
                        LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
                        CF_VERBOSE(..trimmed $LIBS)
                        ;;
@@ -3070,7 +3170,7 @@ if test "$with_dmalloc" = yes ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_NCURSES_ETC version: 2 updated: 2012/01/13 10:49:00
+dnl CF_WITH_NCURSES_ETC version: 4 updated: 2015/04/25 20:53:11
 dnl -------------------
 dnl Use this macro for programs which use any variant of "curses", e.g.,
 dnl "ncurses", and "PDCurses".  Programs that can use curses and some unrelated
@@ -3084,6 +3184,10 @@ CF_WITH_CURSES_DIR
 cf_cv_screen=curses
 
 AC_MSG_CHECKING(for specified curses library type)
+AC_ARG_WITH(screen,
+       [  --with-screen=XXX       use specified curses-libraries],
+       [cf_cv_screen=$withval],[
+
 AC_ARG_WITH(ncursesw,
        [  --with-ncursesw         use wide ncurses-libraries],
        [cf_cv_screen=ncursesw],[
@@ -3102,24 +3206,27 @@ AC_ARG_WITH(curses-colr,
 
 AC_ARG_WITH(curses-5lib,
        [  --with-curses-5lib      compile/link with SunOS 5lib curses],
-       [cf_cv_screen=curses_5lib])])])])])
+       [cf_cv_screen=curses_5lib])])])])])])
 
 AC_MSG_RESULT($cf_cv_screen)
 
-case $cf_cv_screen in #(vi
-curses|curses_*) #(vi
+case $cf_cv_screen in
+(curses|curses_*)
        CF_CURSES_CONFIG
        ;;
-ncurses) #(vi
-       CF_NCURSES_CONFIG
-       ;;
-ncursesw) #(vi
+(ncursesw*)
        CF_UTF8_LIB
-       CF_NCURSES_CONFIG(ncursesw)
+       CF_NCURSES_CONFIG($cf_cv_screen)
        ;;
-pdcurses)
+(ncurses*)
+       CF_NCURSES_CONFIG($cf_cv_screen)
+       ;;
+(pdcurses)
        CF_PDCURSES_X11
        ;;
+(*)
+       AC_MSG_ERROR(unexpected screen-value: $cf_cv_screen)
+       ;;
 esac
 
 ])dnl
@@ -3171,7 +3278,7 @@ AC_TRY_LINK([
 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 43 updated: 2013/02/10 10:41:05
+dnl CF_XOPEN_SOURCE version: 49 updated: 2015/04/12 15:39:00
 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,
@@ -3187,21 +3294,21 @@ cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
 cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
 cf_xopen_source=
 
-case $host_os in #(vi
-aix[[4-7]]*) #(vi
+case $host_os in
+(aix[[4-7]]*)
        cf_xopen_source="-D_ALL_SOURCE"
        ;;
-cygwin) #(vi
+(cygwin|msys)
        cf_XOPEN_SOURCE=600
        ;;
-darwin[[0-8]].*) #(vi
+(darwin[[0-8]].*)
        cf_xopen_source="-D_APPLE_C_SOURCE"
        ;;
-darwin*) #(vi
+(darwin*)
        cf_xopen_source="-D_DARWIN_C_SOURCE"
        cf_XOPEN_SOURCE=
        ;;
-freebsd*|dragonfly*) #(vi
+(freebsd*|dragonfly*)
        # 5.x headers associate
        #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
        #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
@@ -3209,55 +3316,63 @@ freebsd*|dragonfly*) #(vi
        cf_XOPEN_SOURCE=600
        cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
        ;;
-hpux11*) #(vi
+(hpux11*)
        cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
        ;;
-hpux*) #(vi
+(hpux*)
        cf_xopen_source="-D_HPUX_SOURCE"
        ;;
-irix[[56]].*) #(vi
+(irix[[56]].*)
        cf_xopen_source="-D_SGI_SOURCE"
        cf_XOPEN_SOURCE=
        ;;
-linux*|gnu*|mint*|k*bsd*-gnu) #(vi
+(linux*|gnu*|mint*|k*bsd*-gnu)
        CF_GNU_SOURCE
        ;;
-mirbsd*) #(vi
+(minix*)
+       cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
+       ;;
+(mirbsd*)
        # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
        cf_XOPEN_SOURCE=
        CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
        ;;
-netbsd*) #(vi
+(netbsd*)
        cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
        ;;
-openbsd[[4-9]]*) #(vi
+(openbsd[[4-9]]*)
        # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
        cf_xopen_source="-D_BSD_SOURCE"
        cf_XOPEN_SOURCE=600
        ;;
-openbsd*) #(vi
+(openbsd*)
        # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
        ;;
-osf[[45]]*) #(vi
+(osf[[45]]*)
        cf_xopen_source="-D_OSF_SOURCE"
        ;;
-nto-qnx*) #(vi
+(nto-qnx*)
        cf_xopen_source="-D_QNX_SOURCE"
        ;;
-sco*) #(vi
+(sco*)
        # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
        ;;
-solaris2.*) #(vi
+(solaris2.*)
        cf_xopen_source="-D__EXTENSIONS__"
+       cf_cv_xopen_source=broken
        ;;
-*)
+(sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
+       cf_XOPEN_SOURCE=
+       cf_POSIX_C_SOURCE=
+       ;;
+(*)
        CF_TRY_XOPEN_SOURCE
        CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
        ;;
 esac
 
 if test -n "$cf_xopen_source" ; then
-       CF_ADD_CFLAGS($cf_xopen_source)
+       CF_ADD_CFLAGS($cf_xopen_source,true)
 fi
 
 dnl In anything but the default case, we may have system-specific setting
@@ -3290,7 +3405,7 @@ make an error
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA version: 21 updated: 2013/07/06 21:27:06
+dnl CF_X_ATHENA version: 23 updated: 2015/04/12 15:39:00
 dnl -----------
 dnl Check for Xaw (Athena) libraries
 dnl
@@ -3310,6 +3425,17 @@ else
        AC_MSG_RESULT(no)
 fi
 
+AC_MSG_CHECKING(if you want to link with Xaw 3d xft library)
+withval=
+AC_ARG_WITH(Xaw3dxft,
+       [  --with-Xaw3dxft         link with Xaw 3d xft library])
+if test "$withval" = yes ; then
+       cf_x_athena=Xaw3dxft
+       AC_MSG_RESULT(yes)
+else
+       AC_MSG_RESULT(no)
+fi
+
 AC_MSG_CHECKING(if you want to link with neXT Athena library)
 withval=
 AC_ARG_WITH(neXtaw,
@@ -3361,10 +3487,10 @@ int check = XmuCompareISOLatin1("big", "small")
                        if test "$cf_cv_xaw_compat" = no
                        then
                                # workaround for broken ".pc" files...
-                               case "$cf_x_athena_lib" in #(vi
-                               *-lXmu*) #(vi
+                               case "$cf_x_athena_lib" in
+                               (*-lXmu*)
                                        ;;
-                               *)
+                               (*)
                                        CF_VERBOSE(work around broken package)
                                        cf_save_xmu="$LIBS"
                                        cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^[ ][ ]*//' -e 's/ .*//'`
@@ -3509,23 +3635,36 @@ CF_TRY_PKG_CONFIG(Xext,,[
                [CF_ADD_LIB(Xext)])])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_X_TOOLKIT version: 21 updated: 2012/10/04 06:57:36
+dnl CF_X_TOOLKIT version: 23 updated: 2015/04/12 15:39:00
 dnl ------------
 dnl Check for X Toolkit libraries
-dnl
 AC_DEFUN([CF_X_TOOLKIT],
 [
 AC_REQUIRE([AC_PATH_XTRA])
 AC_REQUIRE([CF_CHECK_CACHE])
 
+# OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
+# in some cases has installed dummy files in the former, other cases replaced
+# it with a link to the new location).  This complicates the configure script.
+# Check for that pitfall, and recover using pkg-config
+#
+# If none of these are set, the configuration is almost certainly broken.
+if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
+then
+       CF_TRY_PKG_CONFIG(x11,,[AC_MSG_WARN(unable to find X11 library)])
+       CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
+       CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
+       CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
+fi
+
 cf_have_X_LIBS=no
 
 CF_TRY_PKG_CONFIG(xt,[
 
-       case "x$LIBS" in #(vi
-       *-lX11*) #(vi
+       case "x$LIBS" in
+       (*-lX11*)
                ;;
-       *)
+       (*)
 # we have an "xt" package, but it may omit Xt's dependency on X11
 AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
 AC_TRY_LINK([
@@ -3554,12 +3693,12 @@ AC_TRY_LINK([
        if test "$cf_cv_xt_ice_compat" = no
        then
                # workaround for broken ".pc" files used for X Toolkit.
-               case "x$X_PRE_LIBS" in #(vi
-               *-lICE*)
-                       case "x$LIBS" in #(vi
-                       *-lICE*) #(vi
+               case "x$X_PRE_LIBS" in
+               (*-lICE*)
+                       case "x$LIBS" in
+                       (*-lICE*)
                                ;;
-                       *)
+                       (*)
                                CF_VERBOSE(work around broken ICE dependency)
                                CF_TRY_PKG_CONFIG(ice,
                                        [CF_TRY_PKG_CONFIG(sm)],