"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.6.1/aclocal.m4" (15 Dec 2021, 215261 Bytes) of package /linux/misc/tin-2.6.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "aclocal.m4": 2.6.0_vs_2.6.1.

    1 dnl Project   : tin - a Usenet reader
    2 dnl Module    : aclocal.m4
    3 dnl Author    : Thomas E. Dickey <dickey@invisible-island.net>
    4 dnl Created   : 1995-08-24
    5 dnl Updated   : 2021-12-13
    6 dnl Notes     :
    7 dnl
    8 dnl Copyright (c) 1995-2021 Thomas E. Dickey <dickey@invisible-island.net>
    9 dnl All rights reserved.
   10 dnl
   11 dnl Redistribution and use in source and binary forms, with or without
   12 dnl modification, are permitted provided that the following conditions
   13 dnl are met:
   14 dnl 1. Redistributions of source code must retain the above copyright
   15 dnl    notice, this list of conditions and the following disclaimer.
   16 dnl 2. Redistributions in binary form must reproduce the above copyright
   17 dnl    notice, this list of conditions and the following disclaimer in the
   18 dnl    documentation and/or other materials provided with the distribution.
   19 dnl 3. The name of the author may not be used to endorse or promote
   20 dnl    products derived from this software without specific prior written
   21 dnl    permission.
   22 dnl
   23 dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
   24 dnl OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   25 dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   26 dnl ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
   27 dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   28 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   29 dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   30 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   31 dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   32 dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   33 dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   34 dnl
   35 dnl
   36 dnl Macros used in TIN auto-configuration script.
   37 dnl https://invisible-island.net/autoconf/
   38 dnl
   39 dnl ---------------------------------------------------------------------------
   40 dnl ---------------------------------------------------------------------------
   41 dnl AC_ISC_POSIX version: 2 updated: 2002/04/17 21:09:56
   42 dnl ------------
   43 dnl Inserted as requested by gettext 0.10.40
   44 dnl File from /usr/share/aclocal
   45 dnl isc-posix.m4
   46 dnl ====================
   47 #serial 1
   48 # This test replaces the one in autoconf.
   49 # Currently this macro should have the same name as the autoconf macro
   50 # because gettext's gettext.m4 (distributed in the automake package)
   51 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
   52 # give these diagnostics:
   53 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
   54 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
   55 
   56 undefine([AC_ISC_POSIX])
   57 
   58 AC_DEFUN([AC_ISC_POSIX],
   59   [
   60     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
   61     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
   62   ]
   63 )
   64 dnl ---------------------------------------------------------------------------
   65 dnl AM_GNU_GETTEXT version: 15 updated: 2021/01/02 09:31:20
   66 dnl --------------
   67 dnl Usage: Just like AM_WITH_NLS, which see.
   68 AC_DEFUN([AM_GNU_GETTEXT],
   69   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
   70    AC_REQUIRE([AC_CANONICAL_HOST])dnl
   71    AC_REQUIRE([AC_PROG_RANLIB])dnl
   72    AC_REQUIRE([AC_HEADER_STDC])dnl
   73    AC_REQUIRE([AC_C_INLINE])dnl
   74    AC_REQUIRE([AC_TYPE_OFF_T])dnl
   75    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
   76    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
   77    AC_REQUIRE([AC_FUNC_MMAP])dnl
   78    AC_REQUIRE([jm_GLIBC21])dnl
   79    AC_REQUIRE([CF_PROG_CC])dnl
   80 
   81    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
   82 stdlib.h string.h unistd.h sys/param.h])
   83    AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
   84 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
   85 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
   86 
   87    AM_ICONV
   88    AM_LANGINFO_CODESET
   89    AM_LC_MESSAGES
   90    AM_WITH_NLS([$1],[$2],[$3],[$4])
   91 
   92    if test "x$CATOBJEXT" != "x"; then
   93      if test "x$ALL_LINGUAS" = "x"; then
   94        LINGUAS=
   95      else
   96        AC_MSG_CHECKING(for catalogs to be installed)
   97        NEW_LINGUAS=
   98        for presentlang in $ALL_LINGUAS; do
   99          useit=no
  100          for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
  101            # Use the presentlang catalog if desiredlang is
  102            #   a. equal to presentlang, or
  103            #   b. a variant of presentlang (because in this case,
  104            #      presentlang can be used as a fallback for messages
  105            #      which are not translated in the desiredlang catalog).
  106            case "$desiredlang" in
  107              "$presentlang"*) useit=yes;;
  108            esac
  109          done
  110          if test "$useit" = yes; then
  111            NEW_LINGUAS="$NEW_LINGUAS $presentlang"
  112          fi
  113        done
  114        LINGUAS=$NEW_LINGUAS
  115        AC_MSG_RESULT($LINGUAS)
  116      fi
  117 
  118      dnl Construct list of names of catalog files to be constructed.
  119      if test -n "$LINGUAS"; then
  120        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
  121      fi
  122    fi
  123 
  124    dnl Enable libtool support if the surrounding package wishes it.
  125    INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
  126    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
  127 ])dnl
  128 dnl ---------------------------------------------------------------------------
  129 dnl AM_ICONV version: 12 updated: 2007/07/30 19:12:03
  130 dnl --------
  131 dnl Inserted as requested by gettext 0.10.40
  132 dnl File from /usr/share/aclocal
  133 dnl iconv.m4
  134 dnl ====================
  135 dnl serial AM2
  136 dnl
  137 dnl From Bruno Haible.
  138 dnl
  139 dnl ====================
  140 dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the
  141 dnl range of locations searched.  Retain the same cache-variable naming to
  142 dnl allow reuse with the other gettext macros -Thomas E Dickey
  143 AC_DEFUN([AM_ICONV],
  144 [
  145   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
  146   dnl those with the standalone portable GNU libiconv installed).
  147 
  148   AC_ARG_WITH([libiconv-prefix],
  149 [  --with-libiconv-prefix=DIR
  150                           search for libiconv in DIR/include and DIR/lib], [
  151     CF_ADD_OPTIONAL_PATH($withval, libiconv)
  152    ])
  153 
  154   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
  155     CF_FIND_LINKAGE(CF__ICONV_HEAD,
  156       CF__ICONV_BODY,
  157       iconv,
  158       am_cv_func_iconv=yes,
  159       am_cv_func_iconv=["no, consider installing GNU libiconv"])])
  160 
  161   if test "$am_cv_func_iconv" = yes; then
  162     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
  163 
  164     AC_CACHE_CHECK([if the declaration of iconv() needs const.],
  165 		   am_cv_proto_iconv_const,[
  166       AC_TRY_COMPILE(CF__ICONV_HEAD [
  167 extern
  168 #ifdef __cplusplus
  169 "C"
  170 #endif
  171 #if defined(__STDC__) || defined(__cplusplus)
  172 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
  173 #else
  174 size_t iconv();
  175 #endif
  176 ],[], am_cv_proto_iconv_const=no,
  177       am_cv_proto_iconv_const=yes)])
  178 
  179     if test "$am_cv_proto_iconv_const" = yes ; then
  180       am_cv_proto_iconv_arg1="const"
  181     else
  182       am_cv_proto_iconv_arg1=""
  183     fi
  184 
  185     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
  186       [Define as const if the declaration of iconv() needs const.])
  187   fi
  188 
  189   LIBICONV=
  190   if test "$cf_cv_find_linkage_iconv" = yes; then
  191     CF_ADD_INCDIR($cf_cv_header_path_iconv)
  192     if test -n "$cf_cv_library_file_iconv" ; then
  193       LIBICONV="-liconv"
  194       CF_ADD_LIBDIR($cf_cv_library_path_iconv)
  195     fi
  196   fi
  197 
  198   AC_SUBST(LIBICONV)
  199 ])dnl
  200 dnl ---------------------------------------------------------------------------
  201 dnl AM_LANGINFO_CODESET version: 6 updated: 2021/01/01 16:53:59
  202 dnl -------------------
  203 dnl Inserted as requested by gettext 0.10.40
  204 dnl File from /usr/share/aclocal
  205 dnl codeset.m4
  206 dnl ====================
  207 dnl serial AM1
  208 dnl
  209 dnl From Bruno Haible.
  210 AC_DEFUN([AM_LANGINFO_CODESET],
  211 [
  212 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
  213 	[AC_TRY_LINK([#include <langinfo.h>],
  214 	[char* cs = nl_langinfo(CODESET); (void)cs],
  215 	am_cv_langinfo_codeset=yes,
  216 	am_cv_langinfo_codeset=no)
  217 	])
  218 	if test "$am_cv_langinfo_codeset" = yes; then
  219 		AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
  220 		[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
  221 	fi
  222 ])dnl
  223 dnl ---------------------------------------------------------------------------
  224 dnl AM_LC_MESSAGES version: 6 updated: 2021/01/02 09:31:20
  225 dnl --------------
  226 dnl Inserted as requested by gettext 0.10.40
  227 dnl File from /usr/share/aclocal
  228 dnl lcmessage.m4
  229 dnl ====================
  230 dnl Check whether LC_MESSAGES is available in <locale.h>.
  231 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
  232 dnl
  233 dnl This file can be copied and used freely without restrictions.  It can
  234 dnl be used in projects which are not available under the GNU General Public
  235 dnl License or the GNU Library General Public License but which still want
  236 dnl to provide support for the GNU gettext functionality.
  237 dnl Please note that the actual code of the GNU gettext library is covered
  238 dnl by the GNU Library General Public License, and the rest of the GNU
  239 dnl gettext package package is covered by the GNU General Public License.
  240 dnl They are *not* in the public domain.
  241 dnl
  242 dnl serial 2
  243 dnl
  244 AC_DEFUN([AM_LC_MESSAGES],
  245 [if test "$ac_cv_header_locale_h" = yes; then
  246 	AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
  247 		[AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
  248 		am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
  249 	if test "$am_cv_val_LC_MESSAGES" = yes; then
  250 		AC_DEFINE(HAVE_LC_MESSAGES, 1,
  251 		[Define if your <locale.h> file defines LC_MESSAGES.])
  252 	fi
  253 fi])dnl
  254 dnl ---------------------------------------------------------------------------
  255 dnl AM_MULTIBYTE_ABLE version: 10 updated: 2019/12/31 20:39:42
  256 dnl -----------------
  257 dnl
  258 dnl check for required multibyte/widechar functions
  259 dnl Urs Janssen <urs@tin.org> 20021006
  260 dnl Usage: AM_MULTIBYTE_ABLE
  261 AC_DEFUN([AM_MULTIBYTE_ABLE],
  262 [
  263   AC_CACHE_CHECK([for wide char and multibyte support], am_cv_multibyte_able,
  264    [AC_TRY_LINK([#include <stdio.h>
  265 #ifdef HAVE_STDLIB_H
  266 #	include <stdlib.h>
  267 #endif /* HAVE_STDLIB_H */
  268 #ifdef HAVE_WCHAR_H
  269 #	include <wchar.h>
  270 #endif /* HAVE_WCHAR_H */
  271 #ifdef HAVE_WCTYPE_H
  272 #	include <wctype.h>
  273 #endif /* HAVE_WCTYPE_H */
  274 ],
  275      [const char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
  276       char ocb[5];
  277       wchar_t wcb[5];
  278       wchar_t wcb2[5];
  279       wchar_t format[3];
  280 
  281       putwc(0, 0);
  282       fputwc(0, 0);
  283       fwide(0, 0);
  284       mbtowc(wcb, icb, MB_CUR_MAX);
  285       mbstowcs(wcb, icb, 5);
  286       (void) iswalnum((wint_t) wcb[0]);
  287       (void) iswcntrl((wint_t) wcb[0]);
  288       (void) iswdigit((wint_t) wcb[0]);
  289       (void) iswgraph((wint_t) wcb[0]);
  290       (void) iswprint((wint_t) wcb[0]);
  291       (void) iswspace((wint_t) wcb[0]);
  292       (void) towupper((wint_t) wcb[0]);
  293       /* (void) iswupper((wint_t) wcb[0]); */
  294       /* (void) towlower((wint_t) wcb[0]); */
  295       /* (void) iswlower((wint_t) wcb[0]); */
  296       (void) iswalpha((wint_t) wcb[0]);
  297       /* (void) iswblank((wint_t) wcb[0]); */
  298       /* (void) iswpunct((wint_t) wcb[0]); */
  299       /* (void) iswxdigit((wint_t) wcb[0]); */
  300       /* (void) iswctype((wint_t) wcb[0], wctype("print")); */
  301       /* (void) towctranse((wint_t) wcb[0], wctrans("toupper")); */
  302       (void) wcslen(wcb);
  303       /* (void) wcsnlen(wcb, 4); */
  304       wcwidth((wint_t) wcb[0]);
  305       wcswidth(wcb, 5);
  306       wcstombs(ocb, wcb, 5);
  307       wctomb(ocb, wcb[0]);
  308       wcscat(wcb2, wcb);
  309       wcscpy(wcb2, wcb);
  310       mbstowcs(format, "%s", 2);
  311       swprintf(wcb, 5, format, "test");
  312       wcsncat(wcb2, wcb, 5);],
  313      am_cv_multibyte_able=yes,
  314      [cf_save_LIBS="$LIBS"
  315       LIBS="-lutf8 $LIBS"
  316       AC_TRY_LINK([#include <libutf8.h>],
  317        [const char icb[5] = {0xa4, 0xa4, 0xa4, 0xe5, 0x00};
  318         char ocb[5];
  319         wchar_t wcb[5];
  320         wchar_t wcb2[5];
  321         wchar_t format[3];
  322 
  323         putwc(0, 0);
  324         fputwc(0, 0);
  325         fwide(0, 0);
  326         mbtowc(wcb, icb, MB_CUR_MAX);
  327         mbstowcs(wcb, icb, 5);
  328         (void) iswalnum((wint_t) wcb[0]);
  329         (void) iswcntrl((wint_t) wcb[0]);
  330         (void) iswdigit((wint_t) wcb[0]);
  331         (void) iswgraph((wint_t) wcb[0]);
  332         (void) iswprint((wint_t) wcb[0]);
  333         (void) iswspace((wint_t) wcb[0]);
  334         (void) towupper((wint_t) wcb[0]);
  335         /* (void) iswupper((wint_t) wcb[0]); */
  336         /* (void) towlower((wint_t) wcb[0]); */
  337         /* (void) iswlower((wint_t) wcb[0]); */
  338         (void) iswalpha((wint_t) wcb[0]);
  339         /* (void) iswblank((wint_t) wcb[0]); */
  340         /* (void) iswpunct((wint_t) wcb[0]); */
  341         /* (void) iswxdigit((wint_t) wcb[0]); */
  342         /* (void) iswctype((wint_t) wcb[0], wctype("print")); */
  343         /* (void) towctranse((wint_t) wcb[0], wctrans("toupper")); */
  344         (void) wcslen(wcb);
  345         /* (void) wcsnlen(wcb, 4); */
  346         wcwidth((wint_t) wcb[0]);
  347         wcswidth(wcb, 5);
  348         wcstombs(ocb, wcb, 5);
  349         wctomb(ocb, wcb[0]);
  350         wcscat(wcb2, wcb);
  351         wcscpy(wcb2, wcb);
  352         mbstowcs(format, "%s", 2);
  353         swprintf(wcb, 5, format, "test");
  354         wcsncat(wcb2, wcb, 5);],
  355         [am_cv_multibyte_able=libutf8],
  356         [am_cv_multibyte_able=no])
  357       LIBS="$cf_save_LIBS"
  358    ])
  359   ])
  360   if test "$am_cv_multibyte_able" != no; then
  361     if test "$am_cv_multibyte_able" = libutf8; then
  362       AC_DEFINE(HAVE_LIBUTF8_H,1,[Define this to 1 if we have header libutf8.h])
  363       LIBS="-lutf8 $LIBS"
  364     fi
  365     AC_DEFINE(MULTIBYTE_ABLE, 1,
  366       [Define if you have swprintf() and co.])
  367   fi
  368 ])
  369 dnl ---------------------------------------------------------------------------
  370 dnl AM_PATH_PROG_WITH_TEST version: 10 updated: 2021/01/02 09:31:20
  371 dnl ----------------------
  372 dnl Inserted as requested by gettext 0.10.40
  373 dnl File from /usr/share/aclocal
  374 dnl progtest.m4
  375 dnl ====================
  376 dnl Search path for a program which passes the given test.
  377 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
  378 dnl
  379 dnl This file can be copied and used freely without restrictions.  It can
  380 dnl be used in projects which are not available under the GNU General Public
  381 dnl License or the GNU Library General Public License but which still want
  382 dnl to provide support for the GNU gettext functionality.
  383 dnl Please note that the actual code of the GNU gettext library is covered
  384 dnl by the GNU Library General Public License, and the rest of the GNU
  385 dnl gettext package package is covered by the GNU General Public License.
  386 dnl They are *not* in the public domain.
  387 dnl
  388 dnl serial 2
  389 dnl
  390 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
  391 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
  392 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
  393 [# Extract the first word of "$2", so it can be a program name with args.
  394 AC_REQUIRE([CF_PATHSEP])
  395 set dummy $2; ac_word=[$]2
  396 AC_MSG_CHECKING([for $ac_word])
  397 AC_CACHE_VAL(ac_cv_path_$1,
  398 [case "[$]$1" in
  399   [[\\/]*|?:[\\/]]*)
  400   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
  401   ;;
  402   *)
  403   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  404   for ac_dir in ifelse([$5], , $PATH, [$5]); do
  405     test -z "$ac_dir" && ac_dir=.
  406     if test -f "$ac_dir/$ac_word$ac_exeext" ; then
  407       if [$3]; then
  408 	ac_cv_path_$1="$ac_dir/$ac_word$ac_exeext"
  409 	break
  410       fi
  411     fi
  412   done
  413   IFS="$ac_save_ifs"
  414 dnl If no 4th arg is given, leave the cache variable unset,
  415 dnl so AC_PATH_PROGS will keep looking.
  416 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
  417 ])dnl
  418   ;;
  419 esac])dnl
  420 $1="$ac_cv_path_$1"
  421 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
  422   AC_MSG_RESULT([$]$1)
  423 else
  424   AC_MSG_RESULT(no)
  425 fi
  426 AC_SUBST($1)dnl
  427 ])dnl
  428 dnl ---------------------------------------------------------------------------
  429 dnl AM_WITH_NLS version: 31 updated: 2021/01/04 17:48:08
  430 dnl -----------
  431 dnl Inserted as requested by gettext 0.10.40
  432 dnl File from /usr/share/aclocal
  433 dnl gettext.m4
  434 dnl ====================
  435 dnl Macro to add for using GNU gettext.
  436 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
  437 dnl ====================
  438 dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the
  439 dnl range of locations searched.  Retain the same cache-variable naming to
  440 dnl allow reuse with the other gettext macros -Thomas E Dickey
  441 dnl ====================
  442 dnl
  443 dnl This file can be copied and used freely without restrictions.  It can
  444 dnl be used in projects which are not available under the GNU General Public
  445 dnl License or the GNU Library General Public License but which still want
  446 dnl to provide support for the GNU gettext functionality.
  447 dnl Please note that the actual code of the GNU gettext library is covered
  448 dnl by the GNU Library General Public License, and the rest of the GNU
  449 dnl gettext package package is covered by the GNU General Public License.
  450 dnl They are *not* in the public domain.
  451 dnl
  452 dnl serial 10
  453 dnl
  454 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR], [ENABLED]).
  455 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
  456 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
  457 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
  458 dnl    AM-DISABLE-SHARED). Otherwise, a static library
  459 dnl    $(top_builddir)/intl/libintl.a will be created.
  460 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
  461 dnl    implementations (in libc or libintl) without the ngettext() function
  462 dnl    will be ignored.
  463 dnl LIBDIR is used to find the intl libraries.  If empty,
  464 dnl    the value `$(top_builddir)/intl/' is used.
  465 dnl ENABLED is used to control the default for the related --enable-nls, since
  466 dnl    not all application developers want this feature by default, e.g., lynx.
  467 dnl
  468 dnl The result of the configuration is one of three cases:
  469 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
  470 dnl    and used.
  471 dnl    Catalog format: GNU --> install in $(datadir)
  472 dnl    Catalog extension: .mo after installation, .gmo in source tree
  473 dnl 2) GNU gettext has been found in the system's C library.
  474 dnl    Catalog format: GNU --> install in $(datadir)
  475 dnl    Catalog extension: .mo after installation, .gmo in source tree
  476 dnl 3) No internationalization, always use English msgid.
  477 dnl    Catalog format: none
  478 dnl    Catalog extension: none
  479 dnl The use of .gmo is historical (it was needed to avoid overwriting the
  480 dnl GNU format catalogs when building on a platform with an X/Open gettext),
  481 dnl but we keep it in order not to force irrelevant filename changes on the
  482 dnl maintainers.
  483 dnl
  484 AC_DEFUN([AM_WITH_NLS],
  485 [AC_MSG_CHECKING([whether NLS is requested])
  486   dnl Default is enabled NLS
  487   ifelse([$4],,[
  488   AC_ARG_ENABLE(nls,
  489     [  --disable-nls           do not use Native Language Support],
  490     USE_NLS=$enableval, USE_NLS=yes)],[
  491   AC_ARG_ENABLE(nls,
  492     [  --enable-nls            use Native Language Support],
  493     USE_NLS=$enableval, USE_NLS=no)])
  494   AC_MSG_RESULT($USE_NLS)
  495   AC_SUBST(USE_NLS)
  496 
  497   BUILD_INCLUDED_LIBINTL=no
  498   USE_INCLUDED_LIBINTL=no
  499   INTLLIBS=
  500 
  501   dnl If we use NLS figure out what method
  502   if test "$USE_NLS" = "yes"; then
  503     dnl We need to process the po/ directory.
  504     POSUB=po
  505     AC_DEFINE(ENABLE_NLS, 1,
  506       [Define to 1 if translation of program messages to the user's native language
  507  is requested.])
  508     AC_MSG_CHECKING([whether included gettext is requested])
  509     AC_ARG_WITH(included-gettext,
  510       [  --with-included-gettext use the GNU gettext library included here],
  511       nls_cv_force_use_gnu_gettext=$withval,
  512       nls_cv_force_use_gnu_gettext=no)
  513     AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
  514 
  515     nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
  516     if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
  517       dnl User does not insist on using GNU NLS library.  Figure out what
  518       dnl to use.  If GNU gettext is available we use this.  Else we may have
  519       dnl to fall back to GNU NLS library.
  520       CATOBJEXT=NONE
  521 
  522       dnl Save these (possibly-set) variables for reference.  If the user
  523       dnl overrode these to provide full pathnames, then warn if not actually
  524       dnl GNU gettext, but do not override their values.  Also, if they were
  525       dnl overridden, suppress the part of the library test which prevents it
  526       dnl from finding anything other than GNU gettext.  Doing this also
  527       dnl suppresses a bogus search for the intl library.
  528       cf_save_msgfmt_path="$MSGFMT"
  529       cf_save_xgettext_path="$XGETTEXT"
  530 
  531       dnl Search for GNU msgfmt in the PATH.
  532       AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
  533           ["$ac_dir/$ac_word" --statistics /dev/null >/dev/null 2>&1], :)
  534       AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
  535       AC_SUBST(MSGFMT)
  536 
  537       dnl Search for GNU xgettext in the PATH.
  538       AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
  539           ["$ac_dir/$ac_word" --omit-header /dev/null >/dev/null 2>&1], :)
  540 
  541       cf_save_OPTS_1="$CPPFLAGS"
  542       if test "x$cf_save_msgfmt_path" = "x$MSGFMT" && \
  543          test "x$cf_save_xgettext_path" = "x$XGETTEXT" ; then
  544           CF_ADD_CFLAGS(-DIGNORE_MSGFMT_HACK)
  545       fi
  546 
  547       cf_save_LIBS_1="$LIBS"
  548       CF_ADD_LIBS($LIBICONV)
  549 
  550       CF_FIND_LINKAGE(CF__INTL_HEAD,
  551         CF__INTL_BODY($2),
  552         intl,
  553         cf_cv_func_gettext=yes,
  554         cf_cv_func_gettext=no)
  555 
  556       AC_MSG_CHECKING([for libintl.h and gettext()])
  557       AC_MSG_RESULT($cf_cv_func_gettext)
  558 
  559       LIBS="$cf_save_LIBS_1"
  560       CPPFLAGS="$cf_save_OPTS_1"
  561 
  562       if test "$cf_cv_func_gettext" = yes ; then
  563         AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have libintl.h])
  564 
  565         dnl If an already present or preinstalled GNU gettext() is found,
  566         dnl use it.  But if this macro is used in GNU gettext, and GNU
  567         dnl gettext is already preinstalled in libintl, we update this
  568         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
  569         if test "$PACKAGE" != gettext; then
  570           AC_DEFINE(HAVE_GETTEXT, 1,
  571               [Define if the GNU gettext() function is already present or preinstalled.])
  572 
  573           CF_ADD_INCDIR($cf_cv_header_path_intl)
  574 
  575           if test -n "$cf_cv_library_file_intl" ; then
  576             dnl If iconv() is in a separate libiconv library, then anyone
  577             dnl linking with libintl{.a,.so} also needs to link with
  578             dnl libiconv.
  579             INTLLIBS="$cf_cv_library_file_intl $LIBICONV"
  580             CF_ADD_LIBDIR($cf_cv_library_path_intl,INTLLIBS)
  581           fi
  582 
  583           gt_save_LIBS="$LIBS"
  584           LIBS="$LIBS $INTLLIBS"
  585           AC_CHECK_FUNCS(dcgettext)
  586           LIBS="$gt_save_LIBS"
  587 
  588           CATOBJEXT=.gmo
  589         fi
  590       elif test -z "$MSGFMT" || test -z "$XGETTEXT" ; then
  591         AC_MSG_WARN(disabling NLS feature)
  592         sed -e /ENABLE_NLS/d confdefs.h >confdefs.tmp
  593         mv confdefs.tmp confdefs.h
  594         ALL_LINGUAS=
  595         CATOBJEXT=.ignored
  596         MSGFMT=":"
  597         GMSGFMT=":"
  598         XGETTEXT=":"
  599         POSUB=
  600         BUILD_INCLUDED_LIBINTL=no
  601         USE_INCLUDED_LIBINTL=no
  602         USE_NLS=no
  603         nls_cv_use_gnu_gettext=no
  604       fi
  605 
  606       if test "$CATOBJEXT" = "NONE"; then
  607         dnl GNU gettext is not found in the C library.
  608         dnl Fall back on GNU gettext library.
  609         nls_cv_use_gnu_gettext=maybe
  610       fi
  611     fi
  612 
  613     if test "$nls_cv_use_gnu_gettext" != "no"; then
  614       CATOBJEXT=.gmo
  615       if test -f "$srcdir/intl/libintl.h" ; then
  616         dnl Mark actions used to generate GNU NLS library.
  617         INTLOBJS="\$(GETTOBJS)"
  618         BUILD_INCLUDED_LIBINTL=yes
  619         USE_INCLUDED_LIBINTL=yes
  620         INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
  621         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
  622       elif test "$nls_cv_use_gnu_gettext" = "yes"; then
  623         nls_cv_use_gnu_gettext=no
  624         AC_MSG_WARN(no NLS library is packaged with this application)
  625       fi
  626     fi
  627 
  628     dnl Test whether we really found GNU msgfmt.
  629     if test "$GMSGFMT" != ":"; then
  630       if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
  631         : ;
  632       else
  633         AC_MSG_WARN([found msgfmt program is not GNU msgfmt])
  634       fi
  635     fi
  636 
  637     dnl Test whether we really found GNU xgettext.
  638     if test "$XGETTEXT" != ":"; then
  639       if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
  640         : ;
  641       else
  642         AC_MSG_WARN([found xgettext program is not GNU xgettext])
  643       fi
  644     fi
  645   fi
  646 
  647   if test "$XGETTEXT" != ":"; then
  648     AC_OUTPUT_COMMANDS(
  649      [for ac_file in $CONFIG_FILES; do
  650 
  651         # Support "outfile[:infile[:infile...]]"
  652         case "$ac_file" in
  653           *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  654         esac
  655 
  656         # PO directories have a Makefile.in generated from Makefile.inn.
  657         case "$ac_file" in
  658         */[Mm]akefile.in)
  659           # Adjust a relative srcdir.
  660           ac_dir="`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`"
  661           ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
  662           ac_dots="`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`"
  663           ac_base="`basename $ac_file .in`"
  664           # In autoconf-2.13 it is called $ac_given_srcdir.
  665           # In autoconf-2.50 it is called $srcdir.
  666           test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
  667 
  668           case "$ac_given_srcdir" in
  669             .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
  670             /*) top_srcdir="$ac_given_srcdir" ;;
  671             *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
  672           esac
  673 
  674           if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
  675             rm -f "$ac_dir/POTFILES"
  676             test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
  677             sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
  678             test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base"
  679             sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base"
  680           fi
  681           ;;
  682         esac
  683       done])
  684 
  685     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
  686     dnl to 'yes' because some of the testsuite requires it.
  687     if test "$PACKAGE" = gettext; then
  688       BUILD_INCLUDED_LIBINTL=yes
  689     fi
  690 
  691     dnl intl/plural.c is generated from intl/plural.y. It requires bison,
  692     dnl because plural.y uses bison specific features. It requires at least
  693     dnl bison-1.26 because earlier versions generate a plural.c that doesn't
  694     dnl compile.
  695     dnl bison is only needed for the maintainer (who touches plural.y). But in
  696     dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
  697     dnl the rule in general Makefile. Now, some people carelessly touch the
  698     dnl files or have a broken "make" program, hence the plural.c rule will
  699     dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
  700     dnl present or too old.
  701     if test "$nls_cv_use_gnu_gettext" = "yes"; then
  702       AC_CHECK_PROGS([INTLBISON], [bison])
  703       if test -z "$INTLBISON"; then
  704         ac_verc_fail=yes
  705       else
  706         dnl Found it, now check the version.
  707         AC_MSG_CHECKING([version of bison])
  708 changequote(<<,>>)dnl
  709         ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
  710         case "$ac_prog_version" in
  711           '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
  712           1.2[6-9]*|1.[3-9][0-9]*|[2-9].*)
  713 changequote([,])dnl
  714              ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
  715           *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
  716         esac
  717       AC_MSG_RESULT([$ac_prog_version])
  718       fi
  719       if test "$ac_verc_fail" = yes; then
  720         INTLBISON=:
  721       fi
  722     fi
  723 
  724     dnl These rules are solely for the distribution goal.  While doing this
  725     dnl we only have to keep exactly one list of the available catalogs
  726     dnl in configure.in.
  727     for lang in $ALL_LINGUAS; do
  728       GMOFILES="$GMOFILES $lang.gmo"
  729       POFILES="$POFILES $lang.po"
  730     done
  731   fi
  732 
  733   dnl Make all variables we use known to autoconf.
  734   AC_SUBST(BUILD_INCLUDED_LIBINTL)
  735   AC_SUBST(USE_INCLUDED_LIBINTL)
  736   AC_SUBST(CATALOGS)
  737   AC_SUBST(CATOBJEXT)
  738   AC_SUBST(GMOFILES)
  739   AC_SUBST(INTLLIBS)
  740   AC_SUBST(INTLOBJS)
  741   AC_SUBST(POFILES)
  742   AC_SUBST(POSUB)
  743 
  744   dnl For backward compatibility. Some configure.ins may be using this.
  745   nls_cv_header_intl=
  746   nls_cv_header_libgt=
  747 
  748   dnl For backward compatibility. Some Makefiles may be using this.
  749   DATADIRNAME=share
  750   AC_SUBST(DATADIRNAME)
  751 
  752   dnl For backward compatibility. Some Makefiles may be using this.
  753   INSTOBJEXT=.mo
  754   AC_SUBST(INSTOBJEXT)
  755 
  756   dnl For backward compatibility. Some Makefiles may be using this.
  757   GENCAT=gencat
  758   AC_SUBST(GENCAT)
  759 ])dnl
  760 dnl ---------------------------------------------------------------------------
  761 dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
  762 dnl ------------------
  763 dnl Conditionally generate script according to whether we're using a given autoconf.
  764 dnl
  765 dnl $1 = version to compare against
  766 dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
  767 dnl $3 = code to use if AC_ACVERSION is older than $1.
  768 define([CF_ACVERSION_CHECK],
  769 [
  770 ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl
  771 ifdef([m4_version_compare],
  772 [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
  773 [CF_ACVERSION_COMPARE(
  774 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
  775 AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
  776 dnl ---------------------------------------------------------------------------
  777 dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
  778 dnl --------------------
  779 dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
  780 dnl                      MAJOR2, MINOR2, TERNARY2,
  781 dnl                      PRINTABLE2, not FOUND, FOUND)
  782 define([CF_ACVERSION_COMPARE],
  783 [ifelse(builtin([eval], [$2 < $5]), 1,
  784 [ifelse([$8], , ,[$8])],
  785 [ifelse([$9], , ,[$9])])])dnl
  786 dnl ---------------------------------------------------------------------------
  787 dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15
  788 dnl -------------
  789 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
  790 dnl $1 = flags to add
  791 dnl $2 = if given makes this macro verbose.
  792 dnl
  793 dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
  794 dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
  795 dnl confused by the quotes (which require backslashes to keep them usable).
  796 AC_DEFUN([CF_ADD_CFLAGS],
  797 [
  798 cf_fix_cppflags=no
  799 cf_new_cflags=
  800 cf_new_cppflags=
  801 cf_new_extra_cppflags=
  802 
  803 for cf_add_cflags in $1
  804 do
  805 case "$cf_fix_cppflags" in
  806 no)
  807 	case "$cf_add_cflags" in
  808 	-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
  809 		case "$cf_add_cflags" in
  810 		-D*)
  811 			cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
  812 
  813 			test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
  814 				&& test -z "${cf_tst_cflags}" \
  815 				&& cf_fix_cppflags=yes
  816 
  817 			if test "$cf_fix_cppflags" = yes ; then
  818 				CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
  819 				continue
  820 			elif test "${cf_tst_cflags}" = "\"'" ; then
  821 				CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
  822 				continue
  823 			fi
  824 			;;
  825 		esac
  826 		case "$CPPFLAGS" in
  827 		*$cf_add_cflags)
  828 			;;
  829 		*)
  830 			case "$cf_add_cflags" in
  831 			-D*)
  832 				cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
  833 				CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
  834 				;;
  835 			esac
  836 			CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags)
  837 			;;
  838 		esac
  839 		;;
  840 	*)
  841 		CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags)
  842 		;;
  843 	esac
  844 	;;
  845 yes)
  846 	CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
  847 
  848 	cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'`
  849 
  850 	test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
  851 		&& test -z "${cf_tst_cflags}" \
  852 		&& cf_fix_cppflags=no
  853 	;;
  854 esac
  855 done
  856 
  857 if test -n "$cf_new_cflags" ; then
  858 	ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
  859 	CF_APPEND_TEXT(CFLAGS,$cf_new_cflags)
  860 fi
  861 
  862 if test -n "$cf_new_cppflags" ; then
  863 	ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
  864 	CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags)
  865 fi
  866 
  867 if test -n "$cf_new_extra_cppflags" ; then
  868 	ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
  869 	CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags)
  870 fi
  871 
  872 AC_SUBST(EXTRA_CPPFLAGS)
  873 
  874 ])dnl
  875 dnl ---------------------------------------------------------------------------
  876 dnl CF_ADD_INCDIR version: 17 updated: 2021/09/04 06:35:04
  877 dnl -------------
  878 dnl Add an include-directory to $CPPFLAGS.  Don't add /usr/include, since it is
  879 dnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
  880 dnl but old versions (and some misinstalled ones) need that.  To make things
  881 dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
  882 dnl the include-path).
  883 AC_DEFUN([CF_ADD_INCDIR],
  884 [
  885 if test -n "$1" ; then
  886   for cf_add_incdir in $1
  887   do
  888 	while test "$cf_add_incdir" != /usr/include
  889 	do
  890 	  if test -d "$cf_add_incdir"
  891 	  then
  892 		cf_have_incdir=no
  893 		if test -n "$CFLAGS$CPPFLAGS" ; then
  894 		  # a loop is needed to ensure we can add subdirs of existing dirs
  895 		  for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
  896 			if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
  897 			  cf_have_incdir=yes; break
  898 			fi
  899 		  done
  900 		fi
  901 
  902 		if test "$cf_have_incdir" = no ; then
  903 		  if test "$cf_add_incdir" = /usr/local/include ; then
  904 			if test "$GCC" = yes
  905 			then
  906 			  cf_save_CPPFLAGS=$CPPFLAGS
  907 			  CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir)
  908 			  AC_TRY_COMPILE([#include <stdio.h>],
  909 				  [printf("Hello")],
  910 				  [],
  911 				  [cf_have_incdir=yes])
  912 			  CPPFLAGS=$cf_save_CPPFLAGS
  913 			fi
  914 		  fi
  915 		fi
  916 
  917 		if test "$cf_have_incdir" = no ; then
  918 		  CF_VERBOSE(adding $cf_add_incdir to include-path)
  919 		  ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir"
  920 
  921 		  cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'`
  922 		  test "$cf_top_incdir" = "$cf_add_incdir" && break
  923 		  cf_add_incdir="$cf_top_incdir"
  924 		else
  925 		  break
  926 		fi
  927 	  else
  928 		break
  929 	  fi
  930 	done
  931   done
  932 fi
  933 ])dnl
  934 dnl ---------------------------------------------------------------------------
  935 dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
  936 dnl ----------
  937 dnl Add a library, used to enforce consistency.
  938 dnl
  939 dnl $1 = library to add, without the "-l"
  940 dnl $2 = variable to update (default $LIBS)
  941 AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
  942 dnl ---------------------------------------------------------------------------
  943 dnl CF_ADD_LIBDIR version: 11 updated: 2020/12/31 20:19:42
  944 dnl -------------
  945 dnl	Adds to the library-path
  946 dnl
  947 dnl	Some machines have trouble with multiple -L options.
  948 dnl
  949 dnl $1 is the (list of) directory(s) to add
  950 dnl $2 is the optional name of the variable to update (default LDFLAGS)
  951 dnl
  952 AC_DEFUN([CF_ADD_LIBDIR],
  953 [
  954 if test -n "$1" ; then
  955 	for cf_add_libdir in $1
  956 	do
  957 		if test "$cf_add_libdir" = /usr/lib ; then
  958 			:
  959 		elif test -d "$cf_add_libdir"
  960 		then
  961 			cf_have_libdir=no
  962 			if test -n "$LDFLAGS$LIBS" ; then
  963 				# a loop is needed to ensure we can add subdirs of existing dirs
  964 				for cf_test_libdir in $LDFLAGS $LIBS ; do
  965 					if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
  966 						cf_have_libdir=yes; break
  967 					fi
  968 				done
  969 			fi
  970 			if test "$cf_have_libdir" = no ; then
  971 				CF_VERBOSE(adding $cf_add_libdir to library-path)
  972 				ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
  973 			fi
  974 		fi
  975 	done
  976 fi
  977 ])dnl
  978 dnl ---------------------------------------------------------------------------
  979 dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33
  980 dnl -----------
  981 dnl Add one or more libraries, used to enforce consistency.  Libraries are
  982 dnl prepended to an existing list, since their dependencies are assumed to
  983 dnl already exist in the list.
  984 dnl
  985 dnl $1 = libraries to add, with the "-l", etc.
  986 dnl $2 = variable to update (default $LIBS)
  987 AC_DEFUN([CF_ADD_LIBS],[
  988 cf_add_libs="[$]ifelse($2,,LIBS,[$2])"
  989 # reverse order
  990 cf_add_0lib=
  991 for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
  992 # filter duplicates
  993 for cf_add_1lib in $cf_add_0lib; do
  994 	for cf_add_2lib in $cf_add_libs; do
  995 		if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
  996 			cf_add_1lib=
  997 			break
  998 		fi
  999 	done
 1000 	test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
 1001 done
 1002 ifelse($2,,LIBS,[$2])="$cf_add_libs"
 1003 ])dnl
 1004 dnl ---------------------------------------------------------------------------
 1005 dnl CF_ADD_LIB_AFTER version: 3 updated: 2013/07/09 21:27:22
 1006 dnl ----------------
 1007 dnl Add a given library after another, e.g., following the one it satisfies a
 1008 dnl dependency for.
 1009 dnl
 1010 dnl $1 = the first library
 1011 dnl $2 = its dependency
 1012 AC_DEFUN([CF_ADD_LIB_AFTER],[
 1013 CF_VERBOSE(...before $LIBS)
 1014 LIBS=`echo "$LIBS" | sed -e "s/[[ 	]][[ 	]]*/ /g" -e "s%$1 %$1 $2 %" -e 's%  % %g'`
 1015 CF_VERBOSE(...after  $LIBS)
 1016 ])dnl
 1017 dnl ---------------------------------------------------------------------------
 1018 dnl CF_ADD_OPTIONAL_PATH version: 3 updated: 2015/05/10 19:52:14
 1019 dnl --------------------
 1020 dnl Add an optional search-path to the compile/link variables.
 1021 dnl See CF_WITH_PATH
 1022 dnl
 1023 dnl $1 = shell variable containing the result of --with-XXX=[DIR]
 1024 dnl $2 = module to look for.
 1025 AC_DEFUN([CF_ADD_OPTIONAL_PATH],[
 1026 case "$1" in
 1027 no)
 1028 	;;
 1029 yes)
 1030 	;;
 1031 *)
 1032 	CF_ADD_SEARCHPATH([$1], [AC_MSG_ERROR(cannot find $2 under $1)])
 1033 	;;
 1034 esac
 1035 ])dnl
 1036 dnl ---------------------------------------------------------------------------
 1037 dnl CF_ADD_SEARCHPATH version: 6 updated: 2020/12/31 20:19:42
 1038 dnl -----------------
 1039 dnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter.
 1040 dnl They can be either the common root of include- and lib-directories, or the
 1041 dnl lib-directory (to allow for things like lib64 directories).
 1042 dnl See also CF_FIND_LINKAGE.
 1043 dnl
 1044 dnl $1 is the list of colon-separated directory names to search.
 1045 dnl $2 is the action to take if a parameter does not yield a directory.
 1046 AC_DEFUN([CF_ADD_SEARCHPATH],
 1047 [
 1048 AC_REQUIRE([CF_PATHSEP])
 1049 for cf_searchpath in `echo "$1" | tr $PATH_SEPARATOR ' '`; do
 1050 	if test -d "$cf_searchpath/include" ; then
 1051 		CF_ADD_INCDIR($cf_searchpath/include)
 1052 	elif test -d "$cf_searchpath/../include" ; then
 1053 		CF_ADD_INCDIR($cf_searchpath/../include)
 1054 	ifelse([$2],,,[else
 1055 $2])
 1056 	fi
 1057 	if test -d "$cf_searchpath/lib" ; then
 1058 		CF_ADD_LIBDIR($cf_searchpath/lib)
 1059 	elif test -d "$cf_searchpath" ; then
 1060 		CF_ADD_LIBDIR($cf_searchpath)
 1061 	ifelse([$2],,,[else
 1062 $2])
 1063 	fi
 1064 done
 1065 ])
 1066 dnl ---------------------------------------------------------------------------
 1067 dnl CF_ADD_SUBDIR_PATH version: 5 updated: 2020/12/31 20:19:42
 1068 dnl ------------------
 1069 dnl Append to a search-list for a nonstandard header/lib-file
 1070 dnl	$1 = the variable to return as result
 1071 dnl	$2 = the package name
 1072 dnl	$3 = the subdirectory, e.g., bin, include or lib
 1073 dnl $4 = the directory under which we will test for subdirectories
 1074 dnl $5 = a directory that we do not want $4 to match
 1075 AC_DEFUN([CF_ADD_SUBDIR_PATH],
 1076 [
 1077 test "x$4" != "x$5" && \
 1078 test -d "$4" && \
 1079 ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } &&]) {
 1080 	test -n "$verbose" && echo "	... testing for $3-directories under $4"
 1081 	test -d "$4/$3" &&          $1="[$]$1 $4/$3"
 1082 	test -d "$4/$3/$2" &&       $1="[$]$1 $4/$3/$2"
 1083 	test -d "$4/$3/$2/$3" &&    $1="[$]$1 $4/$3/$2/$3"
 1084 	test -d "$4/$2/$3" &&       $1="[$]$1 $4/$2/$3"
 1085 	test -d "$4/$2/$3/$2" &&    $1="[$]$1 $4/$2/$3/$2"
 1086 }
 1087 ])dnl
 1088 dnl ---------------------------------------------------------------------------
 1089 dnl CF_ANSI_CC_CHECK version: 13 updated: 2012/10/06 11:17:15
 1090 dnl ----------------
 1091 dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and
 1092 dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution.
 1093 AC_DEFUN([CF_ANSI_CC_CHECK],
 1094 [
 1095 CF_CC_ENV_FLAGS
 1096 
 1097 AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[
 1098 cf_cv_ansi_cc=no
 1099 cf_save_CFLAGS="$CFLAGS"
 1100 cf_save_CPPFLAGS="$CPPFLAGS"
 1101 # Don't try gcc -ansi; that turns off useful extensions and
 1102 # breaks some systems' header files.
 1103 # AIX			-qlanglvl=ansi
 1104 # Ultrix and OSF/1	-std1
 1105 # HP-UX			-Aa -D_HPUX_SOURCE
 1106 # SVR4			-Xc
 1107 # UnixWare 1.2		(cannot use -Xc, since ANSI/POSIX clashes)
 1108 for cf_arg in "-DCC_HAS_PROTOS" \
 1109 	"" \
 1110 	-qlanglvl=ansi \
 1111 	-std1 \
 1112 	-Ae \
 1113 	"-Aa -D_HPUX_SOURCE" \
 1114 	-Xc
 1115 do
 1116 	CF_ADD_CFLAGS($cf_arg)
 1117 	AC_TRY_COMPILE(
 1118 [
 1119 #ifndef CC_HAS_PROTOS
 1120 #if !defined(__STDC__) || (__STDC__ != 1)
 1121 choke me
 1122 #endif
 1123 #endif
 1124 ],[
 1125 	int test (int i, double x);
 1126 	struct s1 {int (*f) (int a);};
 1127 	struct s2 {int (*f) (double a);};],
 1128 	[cf_cv_ansi_cc="$cf_arg"; break])
 1129 done
 1130 CFLAGS="$cf_save_CFLAGS"
 1131 CPPFLAGS="$cf_save_CPPFLAGS"
 1132 ])
 1133 
 1134 if test "$cf_cv_ansi_cc" != "no"; then
 1135 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
 1136 	CF_ADD_CFLAGS($cf_cv_ansi_cc)
 1137 else
 1138 	AC_DEFINE(CC_HAS_PROTOS,1,[Define to 1 if C compiler supports prototypes])
 1139 fi
 1140 fi
 1141 ])dnl
 1142 dnl ---------------------------------------------------------------------------
 1143 dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54
 1144 dnl ---------------
 1145 dnl For programs that must use an ANSI compiler, obtain compiler options that
 1146 dnl will make it recognize prototypes.  We'll do preprocessor checks in other
 1147 dnl macros, since tools such as unproto can fake prototypes, but only part of
 1148 dnl the preprocessor.
 1149 AC_DEFUN([CF_ANSI_CC_REQD],
 1150 [AC_REQUIRE([CF_ANSI_CC_CHECK])
 1151 if test "$cf_cv_ansi_cc" = "no"; then
 1152 	AC_MSG_ERROR(
 1153 [Your compiler does not appear to recognize prototypes.
 1154 You have the following choices:
 1155 	a. adjust your compiler options
 1156 	b. get an up-to-date compiler
 1157 	c. use a wrapper such as unproto])
 1158 fi
 1159 ])dnl
 1160 dnl ---------------------------------------------------------------------------
 1161 dnl CF_APPEND_CFLAGS version: 3 updated: 2021/09/05 17:25:40
 1162 dnl ----------------
 1163 dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions.
 1164 dnl $1 = flags to add
 1165 dnl $2 = if given makes this macro verbose.
 1166 define([CF_APPEND_CFLAGS],
 1167 [
 1168 for cf_add_cflags in $1
 1169 do
 1170 	case "x$cf_add_cflags" in
 1171 	x-[[DU]]*)
 1172 		CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2])
 1173 		CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2])
 1174 		;;
 1175 	esac
 1176 	CF_ADD_CFLAGS([$cf_add_cflags],[$2])
 1177 done
 1178 ])dnl
 1179 dnl ---------------------------------------------------------------------------
 1180 dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
 1181 dnl --------------
 1182 dnl use this macro for appending text without introducing an extra blank at
 1183 dnl the beginning
 1184 define([CF_APPEND_TEXT],
 1185 [
 1186 	test -n "[$]$1" && $1="[$]$1 "
 1187 	$1="[$]{$1}$2"
 1188 ])dnl
 1189 dnl ---------------------------------------------------------------------------
 1190 dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
 1191 dnl --------------
 1192 dnl Allow user to disable a normally-on option.
 1193 AC_DEFUN([CF_ARG_DISABLE],
 1194 [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
 1195 dnl ---------------------------------------------------------------------------
 1196 dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
 1197 dnl -------------
 1198 dnl Allow user to enable a normally-off option.
 1199 AC_DEFUN([CF_ARG_ENABLE],
 1200 [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
 1201 dnl ---------------------------------------------------------------------------
 1202 dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14
 1203 dnl -------------
 1204 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
 1205 dnl values.
 1206 dnl
 1207 dnl Parameters:
 1208 dnl $1 = option name
 1209 dnl $2 = help-string
 1210 dnl $3 = action to perform if option is not default
 1211 dnl $4 = action if perform if option is default
 1212 dnl $5 = default option value (either 'yes' or 'no')
 1213 AC_DEFUN([CF_ARG_OPTION],
 1214 [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
 1215 	if test "$enableval" != "$5" ; then
 1216 ifelse([$3],,[    :]dnl
 1217 ,[    $3]) ifelse([$4],,,[
 1218 	else
 1219 		$4])
 1220 	fi],[enableval=$5 ifelse([$4],,,[
 1221 	$4
 1222 ])dnl
 1223 ])])dnl
 1224 dnl ---------------------------------------------------------------------------
 1225 dnl CF_ARG_WITH version: 4 updated: 2008/03/23 14:48:54
 1226 dnl -----------
 1227 dnl Restricted form of AC_ARG_WITH that requires user to specify a value
 1228 dnl $1 = option name
 1229 dnl $2 = help message
 1230 dnl $3 = variable to set with the --with value
 1231 dnl $4 = default value, if any, must be constant.
 1232 dnl $5 = default value shown for --help if $4 is empty.
 1233 AC_DEFUN([CF_ARG_WITH],
 1234 [AC_ARG_WITH($1,[$2 ](default: ifelse($4,,ifelse($5,,empty,$5),$4)),,
 1235 ifelse($4,,[withval="${$3}"],[withval="${$3-$4}"]))dnl
 1236 ifelse($4,,[test -n "$withval" && \
 1237 ],[test -z "$withval" && withval=no
 1238 ])dnl
 1239 case "$withval" in #(vi
 1240 yes)
 1241   AC_MSG_ERROR(expected a value for --with-$1)
 1242   ;; #(vi
 1243 no) withval=""
 1244   ;;
 1245 esac
 1246 $3="$withval"
 1247 ])dnl
 1248 dnl ---------------------------------------------------------------------------
 1249 dnl CF_AR_FLAGS version: 9 updated: 2021/01/01 13:31:04
 1250 dnl -----------
 1251 dnl Check for suitable "ar" (archiver) options for updating an archive.
 1252 dnl
 1253 dnl In particular, handle some obsolete cases where the "-" might be omitted,
 1254 dnl as well as a workaround for breakage of make's archive rules by the GNU
 1255 dnl binutils "ar" program.
 1256 AC_DEFUN([CF_AR_FLAGS],[
 1257 AC_REQUIRE([CF_PROG_AR])
 1258 
 1259 AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
 1260 	case "$cf_cv_system_name" in
 1261 	*-msvc*)
 1262 		cf_cv_ar_flags=''
 1263 		cat >mk_static_lib.sh <<-EOF
 1264 		#!$SHELL
 1265 		MSVC_BIN="[$]AR"
 1266 		out="\[$]1"
 1267 		shift
 1268 		exec \[$]MSVC_BIN -out:"\[$]out" \[$]@
 1269 		EOF
 1270 		chmod +x mk_static_lib.sh
 1271 		AR=`pwd`/mk_static_lib.sh
 1272 		;;
 1273 	*)
 1274 		cf_cv_ar_flags=unknown
 1275 		for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
 1276 		do
 1277 
 1278 			# check if $ARFLAGS already contains this choice
 1279 			if test "x$ARFLAGS" != "x" ; then
 1280 				cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
 1281 				if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
 1282 					cf_cv_ar_flags=
 1283 					break
 1284 				fi
 1285 			fi
 1286 
 1287 			rm -f "conftest.$ac_cv_objext"
 1288 			rm -f conftest.a
 1289 
 1290 			cat >"conftest.$ac_ext" <<EOF
 1291 #line __oline__ "configure"
 1292 int	testdata[[3]] = { 123, 456, 789 };
 1293 EOF
 1294 			if AC_TRY_EVAL(ac_compile) ; then
 1295 				echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC
 1296 				$AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AC_FD_CC 1>/dev/null
 1297 				if test -f conftest.a ; then
 1298 					cf_cv_ar_flags="$cf_ar_flags"
 1299 					break
 1300 				fi
 1301 			else
 1302 				CF_VERBOSE(cannot compile test-program)
 1303 				break
 1304 			fi
 1305 		done
 1306 		rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext"
 1307 		;;
 1308 	esac
 1309 ])
 1310 
 1311 if test -n "$ARFLAGS" ; then
 1312 	if test -n "$cf_cv_ar_flags" ; then
 1313 		ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
 1314 	fi
 1315 else
 1316 	ARFLAGS=$cf_cv_ar_flags
 1317 fi
 1318 
 1319 AC_SUBST(ARFLAGS)
 1320 ])
 1321 dnl ---------------------------------------------------------------------------
 1322 dnl CF_BUILD_CC version: 9 updated: 2021/01/02 09:31:20
 1323 dnl -----------
 1324 dnl If we're cross-compiling, allow the user to override the tools and their
 1325 dnl options.  The configure script is oriented toward identifying the host
 1326 dnl compiler, etc., but we need a build compiler to generate parts of the
 1327 dnl source.
 1328 dnl
 1329 dnl $1 = default for $CPPFLAGS
 1330 dnl $2 = default for $LIBS
 1331 AC_DEFUN([CF_BUILD_CC],[
 1332 CF_ACVERSION_CHECK(2.52,,
 1333 	[AC_REQUIRE([CF_PROG_EXT])])
 1334 if test "$cross_compiling" = yes ; then
 1335 
 1336 	# defaults that we might want to override
 1337 	: ${BUILD_CFLAGS:=''}
 1338 	: ${BUILD_CPPFLAGS:='ifelse([$1],,,[$1])'}
 1339 	: ${BUILD_LDFLAGS:=''}
 1340 	: ${BUILD_LIBS:='ifelse([$2],,,[$2])'}
 1341 	: ${BUILD_EXEEXT:='$x'}
 1342 	: ${BUILD_OBJEXT:='o'}
 1343 
 1344 	AC_ARG_WITH(build-cc,
 1345 		[  --with-build-cc=XXX     the build C compiler ($BUILD_CC)],
 1346 		[BUILD_CC="$withval"],
 1347 		[AC_CHECK_PROGS(BUILD_CC, [gcc clang c99 c89 cc cl],none)])
 1348 	AC_MSG_CHECKING(for native build C compiler)
 1349 	AC_MSG_RESULT($BUILD_CC)
 1350 
 1351 	AC_MSG_CHECKING(for native build C preprocessor)
 1352 	AC_ARG_WITH(build-cpp,
 1353 		[  --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)],
 1354 		[BUILD_CPP="$withval"],
 1355 		[BUILD_CPP='${BUILD_CC} -E'])
 1356 	AC_MSG_RESULT($BUILD_CPP)
 1357 
 1358 	AC_MSG_CHECKING(for native build C flags)
 1359 	AC_ARG_WITH(build-cflags,
 1360 		[  --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)],
 1361 		[BUILD_CFLAGS="$withval"])
 1362 	AC_MSG_RESULT($BUILD_CFLAGS)
 1363 
 1364 	AC_MSG_CHECKING(for native build C preprocessor-flags)
 1365 	AC_ARG_WITH(build-cppflags,
 1366 		[  --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)],
 1367 		[BUILD_CPPFLAGS="$withval"])
 1368 	AC_MSG_RESULT($BUILD_CPPFLAGS)
 1369 
 1370 	AC_MSG_CHECKING(for native build linker-flags)
 1371 	AC_ARG_WITH(build-ldflags,
 1372 		[  --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)],
 1373 		[BUILD_LDFLAGS="$withval"])
 1374 	AC_MSG_RESULT($BUILD_LDFLAGS)
 1375 
 1376 	AC_MSG_CHECKING(for native build linker-libraries)
 1377 	AC_ARG_WITH(build-libs,
 1378 		[  --with-build-libs=XXX   the build libraries (${BUILD_LIBS})],
 1379 		[BUILD_LIBS="$withval"])
 1380 	AC_MSG_RESULT($BUILD_LIBS)
 1381 
 1382 	# this assumes we're on Unix.
 1383 	BUILD_EXEEXT=
 1384 	BUILD_OBJEXT=o
 1385 
 1386 	: ${BUILD_CC:='${CC}'}
 1387 
 1388 	if { test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}'; } ; then
 1389 		AC_MSG_ERROR([Cross-build requires two compilers.
 1390 Use --with-build-cc to specify the native compiler.])
 1391 	fi
 1392 
 1393 else
 1394 	: ${BUILD_CC:='${CC}'}
 1395 	: ${BUILD_CPP:='${CPP}'}
 1396 	: ${BUILD_CFLAGS:='${CFLAGS}'}
 1397 	: ${BUILD_CPPFLAGS:='${CPPFLAGS}'}
 1398 	: ${BUILD_LDFLAGS:='${LDFLAGS}'}
 1399 	: ${BUILD_LIBS:='${LIBS}'}
 1400 	: ${BUILD_EXEEXT:='$x'}
 1401 	: ${BUILD_OBJEXT:='o'}
 1402 fi
 1403 
 1404 AC_SUBST(BUILD_CC)
 1405 AC_SUBST(BUILD_CPP)
 1406 AC_SUBST(BUILD_CFLAGS)
 1407 AC_SUBST(BUILD_CPPFLAGS)
 1408 AC_SUBST(BUILD_LDFLAGS)
 1409 AC_SUBST(BUILD_LIBS)
 1410 AC_SUBST(BUILD_EXEEXT)
 1411 AC_SUBST(BUILD_OBJEXT)
 1412 ])dnl
 1413 dnl ---------------------------------------------------------------------------
 1414 dnl CF_BUNDLED_CANLOCK version: 1 updated: 2020/01/09 20:03:25
 1415 dnl ------------------
 1416 dnl Top-level macro for configuring an application with a bundled copy of
 1417 dnl the canlock library.
 1418 dnl
 1419 dnl $1 specifies the top of the directory containing CANLOCK's include/lib dirs.
 1420 dnl    That is assigned to $cf_canlock_home, which may be updated.
 1421 AC_DEFUN([CF_BUNDLED_CANLOCK],
 1422 [
 1423 cf_canlock_home=$1
 1424 CANDIR_MAKE=
 1425 CANLIBS=
 1426 CAN_CPPFLAGS=
 1427 CAN_MAKEFILE=
 1428 
 1429 case .$cf_canlock_home in #(vi
 1430 .no) #(vi
 1431 	CF_VERBOSE(using bundled canlock)
 1432 	CANLIBS='-L../libcanlock -lcanlock'
 1433 	CAN_CPPFLAGS='-I$(top_builddir)/libcanlock/include -I$(top_srcdir)/libcanlock/include'
 1434 	CAN_MAKEFILE='libcanlock/Makefile'
 1435 	;;
 1436 .yes) #(vi
 1437 	CF_FIND_CANLOCK(
 1438 		cf_canlock_cppflags,
 1439 		cf_canlock_libs,
 1440 		[
 1441 			CANDIR_MAKE='#'
 1442 			CANLIBS="$cf_canlock_libs"
 1443 			CAN_CPPFLAGS="$cf_canlock_cppflags"
 1444 			CF_VERBOSE(using installed canlock)
 1445 		],[
 1446 			CF_VERBOSE(using bundled canlock because no installed canlock was found)
 1447 			CANLIBS='-L../libcanlock -lcanlock'
 1448 			CAN_CPPFLAGS='-I$(top_builddir)/libcanlock/include -I$(top_srcdir)/libcanlock/include'
 1449 			CAN_MAKEFILE='libcanlock/Makefile'
 1450 		])
 1451 	;;
 1452 .*)
 1453 	CF_PATH_SYNTAX(cf_canlock_home)
 1454 	CANDIR_MAKE='#'
 1455 	CANLIBS="-L${cf_canlock_home}/lib -lcanlock"
 1456 	CAN_CPPFLAGS="-I${cf_canlock_home}/include"
 1457 	CF_VERBOSE(using installed canlock $cf_canlock_home)
 1458 	;;
 1459 esac
 1460 
 1461 AC_DEFINE(USE_CANLOCK,1,[Define this to 1 to use Cancel-Locks])
 1462 
 1463 AC_SUBST(CANDIR_MAKE)
 1464 AC_SUBST(CANLIBS)
 1465 AC_SUBST(CAN_CPPFLAGS)
 1466 AC_SUBST(CAN_MAKEFILE)
 1467 ])dnl
 1468 dnl ---------------------------------------------------------------------------
 1469 dnl CF_BUNDLED_INTL version: 20 updated: 2021/01/02 09:31:20
 1470 dnl ---------------
 1471 dnl Top-level macro for configuring an application with a bundled copy of
 1472 dnl the intl and po directories for gettext.
 1473 dnl
 1474 dnl $1 specifies either Makefile or makefile, defaulting to the former.
 1475 dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
 1476 dnl
 1477 dnl Sets variables which can be used to substitute in makefiles:
 1478 dnl	GT_YES       - "#" comment unless building intl library, otherwise empty
 1479 dnl	GT_NO        - "#" comment if building intl library, otherwise empty
 1480 dnl	INTLDIR_MAKE - to make ./intl directory
 1481 dnl	MSG_DIR_MAKE - to make ./po directory
 1482 dnl	SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
 1483 dnl
 1484 dnl Defines:
 1485 dnl	HAVE_LIBGETTEXT_H if we're using ./intl
 1486 dnl	NLS_TEXTDOMAIN
 1487 dnl
 1488 dnl Environment:
 1489 dnl	ALL_LINGUAS if set, lists the root names of the ".po" files.
 1490 dnl	CONFIG_H assumed to be "config.h"
 1491 dnl	PACKAGE must be set, used as default for textdomain
 1492 dnl	VERSION may be set, otherwise extract from "VERSION" file.
 1493 dnl
 1494 AC_DEFUN([CF_BUNDLED_INTL],[
 1495 cf_makefile=ifelse($1,,Makefile,$1)
 1496 
 1497 dnl Set of available languages (based on source distribution).  Note that
 1498 dnl setting $LINGUAS overrides $ALL_LINGUAS.  Some environments set $LINGUAS
 1499 dnl rather than $LC_ALL
 1500 test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d "$srcdir/po" && cd "$srcdir/po" && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
 1501 
 1502 # Allow override of "config.h" definition:
 1503 : ${CONFIG_H:=config.h}
 1504 AC_SUBST(CONFIG_H)
 1505 
 1506 if test -z "$PACKAGE" ; then
 1507 	AC_MSG_ERROR([[CF_BUNDLED_INTL] used without setting [PACKAGE] variable])
 1508 fi
 1509 
 1510 if test -z "$VERSION" ; then
 1511 if test -f "$srcdir/VERSION" ; then
 1512 	VERSION=`sed -e '2,$d' "$srcdir/VERSION" |cut -f1`
 1513 else
 1514 	VERSION=unknown
 1515 fi
 1516 fi
 1517 AC_SUBST(VERSION)
 1518 
 1519 AM_GNU_GETTEXT(,,,[$2])
 1520 
 1521 if test "$USE_NLS" = yes ; then
 1522 	AC_ARG_WITH(textdomain,
 1523 		[  --with-textdomain=PKG   NLS text-domain (default is package name)],
 1524 		[NLS_TEXTDOMAIN=$withval],
 1525 		[NLS_TEXTDOMAIN=$PACKAGE])
 1526 	AC_DEFINE_UNQUOTED(NLS_TEXTDOMAIN,"$NLS_TEXTDOMAIN",[Define to the nls textdomain value])
 1527 	AC_SUBST(NLS_TEXTDOMAIN)
 1528 fi
 1529 
 1530 INTLDIR_MAKE=
 1531 MSG_DIR_MAKE=
 1532 SUB_MAKEFILE=
 1533 
 1534 dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:
 1535 CF_OUR_MESSAGES($1)
 1536 
 1537 if test "$USE_INCLUDED_LIBINTL" = yes ; then
 1538 	if test "$nls_cv_force_use_gnu_gettext" = yes ; then
 1539 		:
 1540 	elif test "$nls_cv_use_gnu_gettext" = yes ; then
 1541 		:
 1542 	else
 1543 		INTLDIR_MAKE="#"
 1544 	fi
 1545 	if test -z "$INTLDIR_MAKE"; then
 1546 		AC_DEFINE(HAVE_LIBGETTEXT_H,1,[Define to 1 if we have libgettext.h])
 1547 		for cf_makefile in \
 1548 			$srcdir/intl/Makefile.in \
 1549 			$srcdir/intl/makefile.in
 1550 		do
 1551 			if test -f "$cf_makefile" ; then
 1552 				SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}"
 1553 				break
 1554 			fi
 1555 		done
 1556 	fi
 1557 else
 1558 	INTLDIR_MAKE="#"
 1559 	if test "$USE_NLS" = yes ; then
 1560 		AC_CHECK_HEADERS(libintl.h)
 1561 	fi
 1562 fi
 1563 
 1564 if test -z "$INTLDIR_MAKE" ; then
 1565 	CF_APPEND_TEXT(CPPFLAGS,-I../intl)
 1566 fi
 1567 
 1568 dnl FIXME:  we use this in lynx (the alternative is a spurious dependency upon
 1569 dnl GNU make)
 1570 if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
 1571 	GT_YES="#"
 1572 	GT_NO=
 1573 else
 1574 	GT_YES=
 1575 	GT_NO="#"
 1576 fi
 1577 
 1578 AC_SUBST(INTLDIR_MAKE)
 1579 AC_SUBST(MSG_DIR_MAKE)
 1580 AC_SUBST(GT_YES)
 1581 AC_SUBST(GT_NO)
 1582 
 1583 dnl FIXME:  the underlying AM_GNU_GETTEXT macro either needs some fixes or a
 1584 dnl little documentation.  It doesn't define anything so that we can ifdef our
 1585 dnl own code, except ENABLE_NLS, which is too vague to be of any use.
 1586 
 1587 if test "$USE_INCLUDED_LIBINTL" = yes ; then
 1588 	if test "$nls_cv_force_use_gnu_gettext" = yes ; then
 1589 		AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
 1590 	elif test "$nls_cv_use_gnu_gettext" = yes ; then
 1591 		AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
 1592 	fi
 1593 	if test -n "$nls_cv_header_intl" ; then
 1594 		AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have header-file for libintl])
 1595 	fi
 1596 fi
 1597 ])dnl
 1598 dnl ---------------------------------------------------------------------------
 1599 dnl CF_BUNDLED_PCRE version: 4 updated: 2009/12/24 04:20:51
 1600 dnl ---------------
 1601 dnl Top-level macro for configuring an application with a bundled copy of
 1602 dnl the pcre library.
 1603 dnl
 1604 dnl $1 specifies the top of the directory containing PCRE's include, lib dirs.
 1605 dnl    That is assigned to $cf_pcre_home, which may be updated.
 1606 AC_DEFUN([CF_BUNDLED_PCRE],
 1607 [
 1608 cf_pcre_home=$1
 1609 PCREDIR_MAKE=
 1610 PCREDIR_LIBS=
 1611 PCREDIR_CPPFLAGS=
 1612 
 1613 case .$cf_pcre_home in #(vi
 1614 .no) #(vi
 1615 	# setup to compile the bundled PCRE:
 1616 #	. $srcdir/pcre/version.sh
 1617 	AC_SUBST(PCRE_MAJOR)
 1618 	AC_SUBST(PCRE_MINOR)
 1619 	AC_SUBST(PCRE_DATE)
 1620 	AC_SUBST(PCRE_DEFINES)
 1621 	;;
 1622 .yes) #(vi
 1623 	CF_FIND_PCRE(
 1624 		cf_pcre_cppflags,
 1625 		cf_pcre_libs,
 1626 		[
 1627 			PCREDIR_MAKE='#'
 1628 			PCREDIR_LIBS="$cf_pcre_libs"
 1629 			PCREDIR_CPPFLAGS="$cf_pcre_cppflags"
 1630 		],[
 1631 			CF_VERBOSE(using bundled pcre because no installed pcre was found)
 1632 			AC_SUBST(PCRE_MAJOR)
 1633 			AC_SUBST(PCRE_MINOR)
 1634 			AC_SUBST(PCRE_DATE)
 1635 			AC_SUBST(PCRE_DEFINES)
 1636 			cf_pcre_home=no
 1637 		])
 1638 	;;
 1639 .*)
 1640 	CF_PATH_SYNTAX(cf_pcre_home)
 1641 	PCREDIR_MAKE='#'
 1642 	PCREDIR_LIBS="-L${cf_pcre_home}/lib -lpcre"
 1643 	PCREDIR_CPPFLAGS="-I${cf_pcre_home}/include"
 1644 	;;
 1645 esac
 1646 
 1647 AC_SUBST(PCREDIR_MAKE)
 1648 AC_SUBST(PCREDIR_LIBS)
 1649 AC_SUBST(PCREDIR_CPPFLAGS)
 1650 ])dnl
 1651 dnl ---------------------------------------------------------------------------
 1652 dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20
 1653 dnl ---------------
 1654 dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
 1655 dnl into CC.  This will not help with broken scripts that wrap the compiler
 1656 dnl with options, but eliminates a more common category of user confusion.
 1657 dnl
 1658 dnl In particular, it addresses the problem of being able to run the C
 1659 dnl preprocessor in a consistent manner.
 1660 dnl
 1661 dnl Caveat: this also disallows blanks in the pathname for the compiler, but
 1662 dnl the nuisance of having inconsistent settings for compiler and preprocessor
 1663 dnl outweighs that limitation.
 1664 AC_DEFUN([CF_CC_ENV_FLAGS],
 1665 [
 1666 # This should have been defined by AC_PROG_CC
 1667 : "${CC:=cc}"
 1668 
 1669 AC_MSG_CHECKING(\$CFLAGS variable)
 1670 case "x$CFLAGS" in
 1671 *-[[IUD]]*)
 1672 	AC_MSG_RESULT(broken)
 1673 	AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options)
 1674 	cf_flags="$CFLAGS"
 1675 	CFLAGS=
 1676 	for cf_arg in $cf_flags
 1677 	do
 1678 		CF_ADD_CFLAGS($cf_arg)
 1679 	done
 1680 	;;
 1681 *)
 1682 	AC_MSG_RESULT(ok)
 1683 	;;
 1684 esac
 1685 
 1686 AC_MSG_CHECKING(\$CC variable)
 1687 case "$CC" in
 1688 *[[\ \	]]-*)
 1689 	AC_MSG_RESULT(broken)
 1690 	AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options)
 1691 	# humor him...
 1692 	cf_prog=`echo "$CC" | sed -e 's/	/ /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'`
 1693 	cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'`
 1694 	CC="$cf_prog"
 1695 	for cf_arg in $cf_flags
 1696 	do
 1697 		case "x$cf_arg" in
 1698 		x-[[IUDfgOW]]*)
 1699 			CF_ADD_CFLAGS($cf_arg)
 1700 			;;
 1701 		*)
 1702 			CC="$CC $cf_arg"
 1703 			;;
 1704 		esac
 1705 	done
 1706 	CF_VERBOSE(resulting CC: '$CC')
 1707 	CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
 1708 	CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
 1709 	;;
 1710 *)
 1711 	AC_MSG_RESULT(ok)
 1712 	;;
 1713 esac
 1714 ])dnl
 1715 dnl ---------------------------------------------------------------------------
 1716 dnl CF_CHECK_1_DECL version: 5 updated: 2001/07/22 21:09:16
 1717 dnl ---------------
 1718 dnl Check for missing declarations in the system headers (adapted from vile).
 1719 dnl
 1720 dnl CHECK_DECL_FLAG and CHECK_DECL_HDRS must be set in configure.in
 1721 AC_DEFUN([CF_CHECK_1_DECL],
 1722 [
 1723 AC_MSG_CHECKING([for missing "$1" extern])
 1724 AC_CACHE_VAL([cf_cv_func_$1],[
 1725 CF_MSG_LOG([for missing "$1" external])
 1726 cf_save_CFLAGS="$CFLAGS"
 1727 CFLAGS="$CFLAGS $CHECK_DECL_FLAG"
 1728 AC_TRY_LINK([
 1729 $CHECK_DECL_HDRS
 1730 
 1731 #undef $1
 1732 struct zowie { int a; double b; struct zowie *c; char d; };
 1733 extern struct zowie *$1();
 1734 ],
 1735 [
 1736 ],
 1737 [if test -n "$CHECK_DECL_HDRS" ; then
 1738 # try to work around system headers which are infested with non-standard syntax
 1739 CF_UPPER(cf_1_up,$1)
 1740 AC_TRY_COMPILE([
 1741 #define DECL_${cf_1_up}
 1742 $CHECK_DECL_HDRS
 1743 ],[long x = 0],
 1744 [eval 'cf_cv_func_'$1'=yes'],
 1745 [eval 'cf_cv_func_'$1'=no'])
 1746 else
 1747 eval 'cf_cv_func_'$1'=yes'
 1748 fi
 1749 ],
 1750 [eval 'cf_cv_func_'$1'=no'])
 1751 CFLAGS="$cf_save_CFLAGS"
 1752 ])
 1753 eval 'cf_result=$cf_cv_func_'$1
 1754 AC_MSG_RESULT($cf_result)
 1755 test $cf_result = yes && AC_DEFINE_UNQUOTED(DECL_$2)
 1756 ])dnl
 1757 dnl ---------------------------------------------------------------------------
 1758 dnl CF_CHECK_CACHE version: 13 updated: 2020/12/31 10:54:15
 1759 dnl --------------
 1760 dnl Check if we're accidentally using a cache from a different machine.
 1761 dnl Derive the system name, as a check for reusing the autoconf cache.
 1762 dnl
 1763 dnl If we've packaged config.guess and config.sub, run that (since it does a
 1764 dnl better job than uname).  Normally we'll use AC_CANONICAL_HOST, but allow
 1765 dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
 1766 dnl which is useful in cross-compiles.
 1767 dnl
 1768 dnl Note: we would use $ac_config_sub, but that is one of the places where
 1769 dnl autoconf 2.5x broke compatibility with autoconf 2.13
 1770 AC_DEFUN([CF_CHECK_CACHE],
 1771 [
 1772 if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then
 1773 	ifelse([$1],,[AC_CANONICAL_HOST],[$1])
 1774 	system_name="$host_os"
 1775 else
 1776 	system_name="`(uname -s -r) 2>/dev/null`"
 1777 	if test -z "$system_name" ; then
 1778 		system_name="`(hostname) 2>/dev/null`"
 1779 	fi
 1780 fi
 1781 test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
 1782 AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
 1783 
 1784 test -z "$system_name" && system_name="$cf_cv_system_name"
 1785 test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
 1786 
 1787 if test ".$system_name" != ".$cf_cv_system_name" ; then
 1788 	AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
 1789 	AC_MSG_ERROR("Please remove config.cache and try again.")
 1790 fi
 1791 ])dnl
 1792 dnl ---------------------------------------------------------------------------
 1793 dnl CF_CHECK_CFLAGS version: 4 updated: 2021/01/02 19:22:58
 1794 dnl ---------------
 1795 dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
 1796 dnl a build-configuration such as imake.  These have the pitfall that they
 1797 dnl often contain compiler-specific options which we cannot use, mixed with
 1798 dnl preprocessor options that we usually can.
 1799 AC_DEFUN([CF_CHECK_CFLAGS],
 1800 [
 1801 CF_VERBOSE(checking additions to CFLAGS)
 1802 cf_check_cflags="$CFLAGS"
 1803 cf_check_cppflags="$CPPFLAGS"
 1804 CF_ADD_CFLAGS($1,yes)
 1805 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
 1806 AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
 1807 	[CF_VERBOSE(test-compile failed.  Undoing change to \$CFLAGS)
 1808 	 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
 1809 		 CF_VERBOSE(but keeping change to \$CPPFLAGS)
 1810 	 fi
 1811 	 CFLAGS="$cf_check_cflags"])
 1812 fi
 1813 ])dnl
 1814 dnl ---------------------------------------------------------------------------
 1815 dnl CF_CHECK_DECL version: 2 updated: 1997/08/28 23:57:55
 1816 dnl -------------
 1817 AC_DEFUN([CF_CHECK_DECL],
 1818 [for ac_func in $1
 1819 do
 1820 CF_UPPER(ac_tr_func,$ac_func)
 1821 CF_CHECK_1_DECL(${ac_func}, ${ac_tr_func})dnl
 1822 done
 1823 ])dnl
 1824 dnl ---------------------------------------------------------------------------
 1825 dnl CF_CHECK_ERRNO version: 13 updated: 2020/03/10 18:53:47
 1826 dnl --------------
 1827 dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
 1828 dnl the 'errno' variable.  Define a DECL_xxx symbol if we must declare it
 1829 dnl ourselves.
 1830 dnl
 1831 dnl $1 = the name to check
 1832 dnl $2 = the assumed type
 1833 AC_DEFUN([CF_CHECK_ERRNO],
 1834 [
 1835 AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
 1836 	AC_TRY_COMPILE([
 1837 #ifdef HAVE_STDLIB_H
 1838 #include <stdlib.h>
 1839 #endif
 1840 #include <stdio.h>
 1841 #include <sys/types.h>
 1842 #include <errno.h> ],
 1843 	ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1; (void)x,
 1844 	[cf_cv_dcl_$1=yes],
 1845 	[cf_cv_dcl_$1=no])
 1846 ])
 1847 
 1848 if test "$cf_cv_dcl_$1" = no ; then
 1849 	CF_UPPER(cf_result,decl_$1)
 1850 	AC_DEFINE_UNQUOTED($cf_result)
 1851 fi
 1852 
 1853 # It's possible (for near-UNIX clones) that the data doesn't exist
 1854 CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2]))
 1855 ])dnl
 1856 dnl ---------------------------------------------------------------------------
 1857 dnl CF_CHECK_EXTERN_DATA version: 5 updated: 2021/09/04 06:35:04
 1858 dnl --------------------
 1859 dnl Check for existence of external data in the current set of libraries.  If
 1860 dnl we can modify it, it is real enough.
 1861 dnl $1 = the name to check
 1862 dnl $2 = its type
 1863 AC_DEFUN([CF_CHECK_EXTERN_DATA],
 1864 [
 1865 AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[
 1866 	AC_TRY_LINK([
 1867 #undef $1
 1868 extern $2 $1;
 1869 ],
 1870 	[$1 = 2],
 1871 	[cf_cv_have_$1=yes],
 1872 	[cf_cv_have_$1=no])
 1873 ])
 1874 
 1875 if test "$cf_cv_have_$1" = yes ; then
 1876 	CF_UPPER(cf_result,have_$1)
 1877 	AC_DEFINE_UNQUOTED($cf_result)
 1878 fi
 1879 
 1880 ])dnl
 1881 dnl ---------------------------------------------------------------------------
 1882 dnl CF_CHECK_FD_SET version: 5 updated: 2012/10/06 11:17:15
 1883 dnl ---------------
 1884 dnl Check if the fd_set type and corresponding macros are defined.
 1885 AC_DEFUN([CF_CHECK_FD_SET],
 1886 [
 1887 AC_REQUIRE([CF_TYPE_FD_SET])
 1888 AC_CACHE_CHECK([for fd_set macros],cf_cv_macros_fd_set,[
 1889 AC_TRY_COMPILE([
 1890 #include <sys/types.h>
 1891 #if USE_SYS_SELECT_H
 1892 # include <sys/select.h>
 1893 #else
 1894 # ifdef HAVE_SYS_TIME_H
 1895 #  include <sys/time.h>
 1896 #  ifdef TIME_WITH_SYS_TIME
 1897 #   include <time.h>
 1898 #  endif
 1899 # else
 1900 #  include <time.h>
 1901 # endif
 1902 #endif
 1903 ],[
 1904 	fd_set read_bits;
 1905 	FD_ZERO(&read_bits);
 1906 	FD_SET(0, &read_bits);],
 1907 	[cf_cv_macros_fd_set=yes],
 1908 	[cf_cv_macros_fd_set=no])])
 1909 test $cf_cv_macros_fd_set = yes && AC_DEFINE(HAVE_TYPE_FD_SET,1,[Define to 1 if type fd_set is declared])
 1910 ])dnl
 1911 dnl ---------------------------------------------------------------------------
 1912 dnl CF_CHECK_HEADERS version: 3 updated: 2000/11/03 11:14:19
 1913 dnl ----------------
 1914 dnl AC_CHECK_HEADERS(sys/socket.h) fails on OS/2 EMX because it demands that
 1915 dnl <sys/types.h> be included first.
 1916 dnl
 1917 dnl Also <sys/dir.h> and <sys/dirent.h> and <sys/stat.h>, but we normally do
 1918 dnl not do our own tests via AC_CHECK_HEADERS for those.
 1919 AC_DEFUN([CF_CHECK_HEADERS],[
 1920 for cf_hdr in $1
 1921 do
 1922 	AC_MSG_CHECKING(for $cf_hdr)
 1923 	AC_TRY_CPP([
 1924 #include <sys/types.h>
 1925 #include <$cf_hdr>
 1926 ],[cf_found=yes],[cf_found=no])
 1927 AC_MSG_RESULT($cf_found)
 1928 if test $cf_found = yes ; then
 1929 	CF_UPPER(cf_tr_hdr,$cf_hdr)
 1930 	AC_DEFINE_UNQUOTED(HAVE_${cf_tr_hdr})
 1931 fi
 1932 done
 1933 ])dnl
 1934 dnl ---------------------------------------------------------------------------
 1935 dnl CF_CHECK_IPV6 version: 3 updated: 2004/01/22 17:38:22
 1936 dnl -------------
 1937 dnl Check for IPV6 configuration.
 1938 AC_DEFUN([CF_CHECK_IPV6],[
 1939 CF_FIND_IPV6_TYPE
 1940 CF_FIND_IPV6_LIBS
 1941 
 1942 CF_FUNC_GETADDRINFO
 1943 
 1944 if test "$cf_cv_getaddrinfo" != "yes"; then
 1945 	if test "$cf_cv_ipv6type" != "linux"; then
 1946 		AC_MSG_WARN(
 1947 [You must get working getaddrinfo() function,
 1948 or you can specify "--disable-ipv6"])
 1949 	else
 1950 		AC_MSG_WARN(
 1951 [The getaddrinfo() implementation on your system seems be buggy.
 1952 You should upgrade your system library to the newest version
 1953 of GNU C library (aka glibc).])
 1954 	fi
 1955 fi
 1956 
 1957 ])dnl
 1958 dnl ---------------------------------------------------------------------------
 1959 dnl CF_CHECK_NESTED_PARAMS version: 3 updated: 2019/12/31 20:39:42
 1960 dnl ----------------------
 1961 dnl Check if the compiler allows nested parameter lists (some don't)
 1962 AC_DEFUN([CF_CHECK_NESTED_PARAMS],
 1963 [
 1964 AC_MSG_CHECKING([if nested parameters work])
 1965 AC_CACHE_VAL(cf_cv_nested_params,[
 1966 	AC_TRY_COMPILE([],
 1967 	[extern void (*sigdisp(int sig, void (*func)(int sig)))(int sig)],
 1968 	[cf_cv_nested_params=yes],
 1969 	[cf_cv_nested_params=no])
 1970 ])
 1971 AC_MSG_RESULT($cf_cv_nested_params)
 1972 test $cf_cv_nested_params = yes && AC_DEFINE(HAVE_NESTED_PARAMS,1,[Define this to 1 if the compiler allows nested parameter lists])
 1973 ])dnl
 1974 dnl ---------------------------------------------------------------------------
 1975 dnl CF_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04
 1976 dnl -----------------
 1977 dnl Check if the given compiler is really clang.  clang's C driver defines
 1978 dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
 1979 dnl not ignore some gcc options.
 1980 dnl
 1981 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
 1982 dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked from
 1983 dnl the wrappers for gcc and g++ warnings.
 1984 dnl
 1985 dnl $1 = GCC (default) or GXX
 1986 dnl $2 = CLANG_COMPILER (default)
 1987 dnl $3 = CFLAGS (default) or CXXFLAGS
 1988 AC_DEFUN([CF_CLANG_COMPILER],[
 1989 ifelse([$2],,CLANG_COMPILER,[$2])=no
 1990 
 1991 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
 1992 	AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
 1993 	cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
 1994 	AC_TRY_COMPILE([],[
 1995 #ifdef __clang__
 1996 #else
 1997 make an error
 1998 #endif
 1999 ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
 2000 ],[])
 2001 	ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
 2002 	AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
 2003 fi
 2004 
 2005 CLANG_VERSION=none
 2006 
 2007 if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then
 2008 	case "$CC" in
 2009 	c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]])
 2010 		AC_MSG_WARN(replacing broken compiler alias $CC)
 2011 		CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`"
 2012 		CC=clang
 2013 		;;
 2014 	esac
 2015 
 2016 	AC_MSG_CHECKING(version of $CC)
 2017 	CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
 2018 	test -z "$CLANG_VERSION" && CLANG_VERSION=unknown
 2019 	AC_MSG_RESULT($CLANG_VERSION)
 2020 
 2021 	for cf_clang_opt in \
 2022 		-Qunused-arguments \
 2023 		-Wno-error=implicit-function-declaration
 2024 	do
 2025 		AC_MSG_CHECKING(if option $cf_clang_opt works)
 2026 		cf_save_CFLAGS="$CFLAGS"
 2027 		CFLAGS="$CFLAGS $cf_clang_opt"
 2028 		AC_TRY_LINK([
 2029 			#include <stdio.h>],[
 2030 			printf("hello!\\n");],[
 2031 			cf_clang_optok=yes],[
 2032 			cf_clang_optok=no])
 2033 		AC_MSG_RESULT($cf_clang_optok)
 2034 		CFLAGS="$cf_save_CFLAGS"
 2035 		if test "$cf_clang_optok" = yes; then
 2036 			CF_VERBOSE(adding option $cf_clang_opt)
 2037 			CF_APPEND_TEXT(CFLAGS,$cf_clang_opt)
 2038 		fi
 2039 	done
 2040 fi
 2041 ])
 2042 dnl ---------------------------------------------------------------------------
 2043 dnl CF_COLOR_CURSES version: 9 updated: 2021/01/02 09:31:20
 2044 dnl ---------------
 2045 dnl Check if curses supports color.  (Note that while SVr3 curses supports
 2046 dnl color, it does this differently from SVr4 curses; more work would be needed
 2047 dnl to accommodate SVr3).
 2048 dnl
 2049 AC_DEFUN([CF_COLOR_CURSES],
 2050 [
 2051 AC_MSG_CHECKING(if curses supports color attributes)
 2052 AC_CACHE_VAL(cf_cv_color_curses,[
 2053 	AC_TRY_LINK([
 2054 #include <${cf_cv_ncurses_header:-curses.h}>
 2055 ],
 2056 	[chtype x = COLOR_BLUE;
 2057 	 has_colors();
 2058 	 start_color();
 2059 #ifndef NCURSES_BROKEN
 2060 	 wbkgd(curscr, getbkgd(stdscr)); /* X/Open XPG4 aka SVr4 Curses */
 2061 #endif
 2062 	],
 2063 	[cf_cv_color_curses=yes],
 2064 	[cf_cv_color_curses=no])
 2065 	])
 2066 AC_MSG_RESULT($cf_cv_color_curses)
 2067 if test "$cf_cv_color_curses" = yes ; then
 2068 	AC_DEFINE(COLOR_CURSES,1,[Define to 1 if if curses supports color attributes])
 2069 	test ".$cf_cv_ncurses_broken" != .yes && AC_DEFINE(HAVE_GETBKGD,1,[Define to 1 if curses has getbkgd function])
 2070 fi
 2071 ])dnl
 2072 dnl ---------------------------------------------------------------------------
 2073 dnl CF_COMPTYPE version: 3 updated: 2019/12/31 20:39:42
 2074 dnl -----------
 2075 dnl Check if the compiler uses 'void *' for qsort's compare function parameters
 2076 dnl (i.e., it's an ANSI prototype).
 2077 AC_DEFUN([CF_COMPTYPE],
 2078 [
 2079 AC_MSG_CHECKING([for ANSI qsort])
 2080 AC_CACHE_VAL(cf_cv_comptype,[
 2081 	AC_TRY_COMPILE([
 2082 #ifdef HAVE_STDLIB_H
 2083 #include <stdlib.h>
 2084 #endif],
 2085 	[extern int compare(const void *, const void *);
 2086 	 char *foo = "string";
 2087 	 qsort(foo, sizeof(foo)/sizeof(*foo), sizeof(*foo), compare)],
 2088 	[cf_cv_comptype=yes],
 2089 	[cf_cv_comptype=no])
 2090 ])
 2091 AC_MSG_RESULT($cf_cv_comptype)
 2092 if test $cf_cv_comptype = yes; then
 2093 	AC_DEFINE(HAVE_COMPTYPE_VOID,1,[Define this to 1 if qsort uses void*])
 2094 else
 2095 	AC_DEFINE(HAVE_COMPTYPE_CHAR,1,[Define this to 1 if qsort uses char*])
 2096 fi
 2097 ])dnl
 2098 dnl ---------------------------------------------------------------------------
 2099 dnl CF_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17
 2100 dnl -----------------
 2101 dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
 2102 dnl character-strings.
 2103 dnl
 2104 dnl It is ambiguous because the specification accommodated the pre-ANSI
 2105 dnl compilers bundled by more than one vendor in lieu of providing a standard C
 2106 dnl compiler other than by costly add-ons.  Because of this, the specification
 2107 dnl did not take into account the use of const for telling the compiler that
 2108 dnl string literals would be in readonly memory.
 2109 dnl
 2110 dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to
 2111 dnl let the compiler decide how to represent Xt's strings which were #define'd.
 2112 dnl That does not solve the problem of using the block of Xt's strings which
 2113 dnl are compiled into the library (and is less efficient than one might want).
 2114 dnl
 2115 dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both
 2116 dnl when compiling the library and compiling using the library, to tell the
 2117 dnl compiler that String is const.
 2118 AC_DEFUN([CF_CONST_X_STRING],
 2119 [
 2120 AC_REQUIRE([AC_PATH_XTRA])
 2121 
 2122 CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING])
 2123 
 2124 AC_TRY_COMPILE(
 2125 [
 2126 #include <stdlib.h>
 2127 #include <X11/Intrinsic.h>
 2128 ],
 2129 [String foo = malloc(1); free((void*)foo)],[
 2130 
 2131 AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
 2132 	AC_TRY_COMPILE(
 2133 		[
 2134 #define _CONST_X_STRING	/* X11R7.8 (perhaps) */
 2135 #undef  XTSTRINGDEFINES	/* X11R5 and later */
 2136 #include <stdlib.h>
 2137 #include <X11/Intrinsic.h>
 2138 		],[String foo = malloc(1); *foo = 0],[
 2139 			cf_cv_const_x_string=no
 2140 		],[
 2141 			cf_cv_const_x_string=yes
 2142 		])
 2143 ])
 2144 
 2145 CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING])
 2146 
 2147 case "$cf_cv_const_x_string" in
 2148 no)
 2149 	CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES)
 2150 	;;
 2151 *)
 2152 	CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING)
 2153 	;;
 2154 esac
 2155 
 2156 ])
 2157 ])dnl
 2158 dnl ---------------------------------------------------------------------------
 2159 dnl CF_COREFILE version: 5 updated: 2019/12/31 20:39:42
 2160 dnl -----------
 2161 dnl Check if the application can dump core (for debugging).
 2162 AC_DEFUN([CF_COREFILE],
 2163 [
 2164 AC_MSG_CHECKING([if application can dump core])
 2165 AC_CACHE_VAL(cf_cv_corefile,[
 2166 	AC_TRY_RUN([
 2167 #include <signal.h>
 2168 #include <sys/types.h>
 2169 #include <sys/stat.h>
 2170 int found()
 2171 {
 2172 	struct stat sb;
 2173 	return ((stat("core", &sb) == 0			/* UNIX */
 2174 	   ||    stat("conftest.core", &sb) == 0	/* FreeBSD */
 2175 		)
 2176 		&& ((sb.st_mode & S_IFMT) == S_IFREG));
 2177 }
 2178 int main()
 2179 {
 2180 #ifdef __amiga__
 2181 /* Nicholas d'Alterio (nagd@ic.ac.uk) reports that the check for ability to
 2182  * core dump causes the machine to crash - reason unknown (gcc 2.7.2)
 2183  */
 2184 	${cf_cv_main_return:-return}(1);
 2185 #else
 2186 	int	pid, status;
 2187 	if (found())
 2188 		unlink("core");
 2189 	if (found())
 2190 		${cf_cv_main_return:-return}(1);
 2191 	if ((pid = fork()) != 0) {
 2192 		while (wait(&status) <= 0)
 2193 			;
 2194 	} else {
 2195 		abort();	/* this will dump core, if anything will */
 2196 	}
 2197 	if (found()) {
 2198 		unlink("core");
 2199 		${cf_cv_main_return:-return}(0);
 2200 	}
 2201 	${cf_cv_main_return:-return}(1);
 2202 #endif
 2203 }],
 2204 	[cf_cv_corefile=yes],
 2205 	[cf_cv_corefile=no],
 2206 	[cf_cv_corefile=unknown])])
 2207 AC_MSG_RESULT($cf_cv_corefile)
 2208 test $cf_cv_corefile = yes && AC_DEFINE(HAVE_COREFILE,1,[Define this to 1 if the application can dump core])
 2209 ])dnl
 2210 dnl ---------------------------------------------------------------------------
 2211 dnl CF_CPP_CONCATS version: 3 updated: 2019/12/31 20:39:42
 2212 dnl --------------
 2213 dnl Test for ANSI token expansion (used in 'assert').
 2214 AC_DEFUN([CF_CPP_CONCATS],
 2215 [
 2216 AC_MSG_CHECKING([for ansi token concatenation])
 2217 AC_CACHE_VAL(cf_cv_cpp_concats,[
 2218 	AC_TRY_COMPILE([
 2219 #define concat(a,b) a ## b],
 2220 	[char *firstlast = "y", *s = concat(first,last)],
 2221 	[cf_cv_cpp_concats=yes],
 2222 	[cf_cv_cpp_concats=no])
 2223 ])
 2224 AC_MSG_RESULT($cf_cv_cpp_concats)
 2225 test $cf_cv_cpp_concats = yes && AC_DEFINE(CPP_DOES_CONCAT,1,[Define this to 1 for ansi token concatenation])
 2226 ])dnl
 2227 dnl ---------------------------------------------------------------------------
 2228 dnl CF_CPP_EXPANDS version: 3 updated: 2019/12/31 20:39:42
 2229 dnl --------------
 2230 dnl Test for ANSI token expansion (used in 'assert').
 2231 AC_DEFUN([CF_CPP_EXPANDS],
 2232 [
 2233 AC_MSG_CHECKING([for ansi token expansion/substitution])
 2234 AC_CACHE_VAL(cf_cv_cpp_expands,[
 2235 	AC_TRY_COMPILE([
 2236 #define string(n) #n],
 2237 	[char *s = string(token)],
 2238 	[cf_cv_cpp_expands=yes],
 2239 	[cf_cv_cpp_expands=no])
 2240 ])
 2241 AC_MSG_RESULT($cf_cv_cpp_expands)
 2242 test $cf_cv_cpp_expands = yes && AC_DEFINE(CPP_DOES_EXPAND,1,[Define this to 1 for ansi token expansion/substitution])
 2243 ])dnl
 2244 dnl ---------------------------------------------------------------------------
 2245 dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27
 2246 dnl ----------------
 2247 dnl Tie together the configure-script macros for curses.  It may be ncurses,
 2248 dnl but unless asked, we do not make a special search for ncurses.  However,
 2249 dnl still check for the ncurses version number, for use in other macros.
 2250 AC_DEFUN([CF_CURSES_CONFIG],
 2251 [
 2252 CF_CURSES_CPPFLAGS
 2253 CF_NCURSES_VERSION
 2254 CF_CURSES_LIBS
 2255 ])dnl
 2256 dnl ---------------------------------------------------------------------------
 2257 dnl CF_CURSES_CPPFLAGS version: 14 updated: 2021/01/02 09:31:20
 2258 dnl ------------------
 2259 dnl Look for the curses headers.
 2260 AC_DEFUN([CF_CURSES_CPPFLAGS],[
 2261 
 2262 AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
 2263 cf_cv_curses_incdir=no
 2264 case "$host_os" in
 2265 hpux10.*)
 2266 	if test "x$cf_cv_screen" = "xcurses_colr"
 2267 	then
 2268 		test -d /usr/include/curses_colr && \
 2269 		cf_cv_curses_incdir="-I/usr/include/curses_colr"
 2270 	fi
 2271 	;;
 2272 sunos3*|sunos4*)
 2273 	if test "x$cf_cv_screen" = "xcurses_5lib"
 2274 	then
 2275 		test -d /usr/5lib && \
 2276 		test -d /usr/5include && \
 2277 		cf_cv_curses_incdir="-I/usr/5include"
 2278 	fi
 2279 	;;
 2280 esac
 2281 ])
 2282 if test "$cf_cv_curses_incdir" != no
 2283 then
 2284 	CF_APPEND_TEXT(CPPFLAGS,$cf_cv_curses_incdir)
 2285 fi
 2286 
 2287 CF_CURSES_HEADER
 2288 CF_TERM_HEADER
 2289 ])dnl
 2290 dnl ---------------------------------------------------------------------------
 2291 dnl CF_CURSES_FUNCS version: 20 updated: 2020/12/31 20:19:42
 2292 dnl ---------------
 2293 dnl Curses-functions are a little complicated, since a lot of them are macros.
 2294 AC_DEFUN([CF_CURSES_FUNCS],
 2295 [
 2296 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 2297 AC_REQUIRE([CF_XOPEN_CURSES])
 2298 AC_REQUIRE([CF_CURSES_TERM_H])
 2299 AC_REQUIRE([CF_CURSES_UNCTRL_H])
 2300 for cf_func in $1
 2301 do
 2302 	CF_UPPER(cf_tr_func,$cf_func)
 2303 	AC_MSG_CHECKING(for ${cf_func})
 2304 	CF_MSG_LOG(${cf_func})
 2305 	AC_CACHE_VAL(cf_cv_func_$cf_func,[
 2306 		eval cf_result='$ac_cv_func_'$cf_func
 2307 		if test ".$cf_result" != ".no"; then
 2308 			AC_TRY_LINK(CF__CURSES_HEAD,
 2309 			[
 2310 #ifndef ${cf_func}
 2311 long foo = (long)(&${cf_func});
 2312 fprintf(stderr, "testing linkage of $cf_func:%p\\n", (void *)foo);
 2313 if (foo + 1234L > 5678L)
 2314 	${cf_cv_main_return:-return}(foo != 0);
 2315 #endif
 2316 			],
 2317 			[cf_result=yes],
 2318 			[cf_result=no])
 2319 		fi
 2320 		eval 'cf_cv_func_'$cf_func'="$cf_result"'
 2321 	])
 2322 	# use the computed/retrieved cache-value:
 2323 	eval 'cf_result=$cf_cv_func_'$cf_func
 2324 	AC_MSG_RESULT($cf_result)
 2325 	if test "$cf_result" != no; then
 2326 		AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func})
 2327 	fi
 2328 done
 2329 ])dnl
 2330 dnl ---------------------------------------------------------------------------
 2331 dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30
 2332 dnl ----------------
 2333 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
 2334 dnl variations of ncurses' installs.
 2335 dnl
 2336 dnl $1 = ncurses when looking for ncurses, or is empty
 2337 AC_DEFUN([CF_CURSES_HEADER],[
 2338 AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
 2339 cf_cv_ncurses_header=none
 2340 for cf_header in \
 2341 	ncurses.h ifelse($1,,,[$1/ncurses.h]) \
 2342 	curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
 2343 do
 2344 AC_TRY_COMPILE([#include <${cf_header}>],
 2345 	[initscr(); tgoto("?", 0,0)],
 2346 	[cf_cv_ncurses_header=$cf_header; break],[])
 2347 done
 2348 ])
 2349 
 2350 if test "$cf_cv_ncurses_header" = none ; then
 2351 	AC_MSG_ERROR(No curses header-files found)
 2352 fi
 2353 
 2354 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
 2355 AC_CHECK_HEADERS($cf_cv_ncurses_header)
 2356 ])dnl
 2357 dnl ---------------------------------------------------------------------------
 2358 dnl CF_CURSES_LIBS version: 44 updated: 2021/01/02 09:31:20
 2359 dnl --------------
 2360 dnl Look for the curses libraries.  Older curses implementations may require
 2361 dnl termcap/termlib to be linked as well.  Call CF_CURSES_CPPFLAGS first.
 2362 AC_DEFUN([CF_CURSES_LIBS],[
 2363 
 2364 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 2365 AC_MSG_CHECKING(if we have identified curses libraries)
 2366 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 2367 	[initscr(); tgoto("?", 0,0)],
 2368 	cf_result=yes,
 2369 	cf_result=no)
 2370 AC_MSG_RESULT($cf_result)
 2371 
 2372 if test "$cf_result" = no ; then
 2373 case "$host_os" in
 2374 freebsd*)
 2375 	AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
 2376 	;;
 2377 hpux10.*)
 2378 	# Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
 2379 	# next (1998), and xcurses "newer" (2000).  There is no header file for
 2380 	# Hcurses; the subdirectory curses_colr has the headers (curses.h and
 2381 	# term.h) for cur_colr
 2382 	if test "x$cf_cv_screen" = "xcurses_colr"
 2383 	then
 2384 		AC_CHECK_LIB(cur_colr,initscr,[
 2385 			CF_ADD_LIBS(-lcur_colr)
 2386 			ac_cv_func_initscr=yes
 2387 			],[
 2388 		AC_CHECK_LIB(Hcurses,initscr,[
 2389 			# HP's header uses __HP_CURSES, but user claims _HP_CURSES.
 2390 			CF_ADD_LIBS(-lHcurses)
 2391 			CF_APPEND_TEXT(CPPFLAGS,-D__HP_CURSES -D_HP_CURSES)
 2392 			ac_cv_func_initscr=yes
 2393 			])])
 2394 	fi
 2395 	;;
 2396 linux*)
 2397 	case `arch 2>/dev/null` in
 2398 	x86_64)
 2399 		if test -d /lib64
 2400 		then
 2401 			CF_ADD_LIBDIR(/lib64)
 2402 		else
 2403 			CF_ADD_LIBDIR(/lib)
 2404 		fi
 2405 		;;
 2406 	*)
 2407 		CF_ADD_LIBDIR(/lib)
 2408 		;;
 2409 	esac
 2410 	;;
 2411 sunos3*|sunos4*)
 2412 	if test "x$cf_cv_screen" = "xcurses_5lib"
 2413 	then
 2414 		if test -d /usr/5lib ; then
 2415 			CF_ADD_LIBDIR(/usr/5lib)
 2416 			CF_ADD_LIBS(-lcurses -ltermcap)
 2417 		fi
 2418 	fi
 2419 	ac_cv_func_initscr=yes
 2420 	;;
 2421 esac
 2422 
 2423 if test ".$ac_cv_func_initscr" != .yes ; then
 2424 	cf_save_LIBS="$LIBS"
 2425 
 2426 	if test ".${cf_cv_ncurses_version:-no}" != .no
 2427 	then
 2428 		cf_check_list="ncurses curses cursesX"
 2429 	else
 2430 		cf_check_list="cursesX curses ncurses"
 2431 	fi
 2432 
 2433 	# Check for library containing tgoto.  Do this before curses library
 2434 	# because it may be needed to link the test-case for initscr.
 2435 	if test "x$cf_term_lib" = x
 2436 	then
 2437 		AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
 2438 			for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
 2439 			do
 2440 				AC_CHECK_LIB($cf_term_lib,tgoto,[
 2441 					: "${cf_nculib_root:=$cf_term_lib}"
 2442 					break
 2443 				])
 2444 			done
 2445 		])
 2446 	fi
 2447 
 2448 	# Check for library containing initscr
 2449 	test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
 2450 	if test "x$cf_curs_lib" = x
 2451 	then
 2452 		for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
 2453 		do
 2454 			LIBS="-l$cf_curs_lib $cf_save_LIBS"
 2455 			if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
 2456 				AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
 2457 				AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 2458 					[initscr()],
 2459 					[cf_result=yes],
 2460 					[cf_result=no])
 2461 				AC_MSG_RESULT($cf_result)
 2462 				test "$cf_result" = yes && break
 2463 			elif test "$cf_curs_lib" = "$cf_term_lib" ; then
 2464 				cf_result=no
 2465 			elif test "$cf_term_lib" != predefined ; then
 2466 				AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
 2467 				AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 2468 					[initscr(); tgoto((char *)0, 0, 0);],
 2469 					[cf_result=no],
 2470 					[
 2471 					LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
 2472 					AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 2473 						[initscr()],
 2474 						[cf_result=yes],
 2475 						[cf_result=error])
 2476 					])
 2477 				AC_MSG_RESULT($cf_result)
 2478 				test "$cf_result" != error && break
 2479 			fi
 2480 		done
 2481 	fi
 2482 	test "$cf_curs_lib" = unknown && AC_MSG_ERROR(no curses library found)
 2483 fi
 2484 fi
 2485 
 2486 ])dnl
 2487 dnl ---------------------------------------------------------------------------
 2488 dnl CF_CURSES_TERMCAP version: 12 updated: 2015/05/15 19:42:24
 2489 dnl -----------------
 2490 dnl Check if we should include <curses.h> to pick up prototypes for termcap
 2491 dnl functions.  On terminfo systems, these are normally declared in <curses.h>,
 2492 dnl but may be in <term.h>.  We check for termcap.h as an alternate, but it
 2493 dnl isn't standard (usually associated with GNU termcap).
 2494 dnl
 2495 dnl The 'tgoto()' function is declared in both terminfo and termcap.
 2496 dnl
 2497 dnl See CF_TYPE_OUTCHAR for more details.
 2498 AC_DEFUN([CF_CURSES_TERMCAP],
 2499 [
 2500 AC_REQUIRE([CF_CURSES_TERM_H])
 2501 AC_CACHE_CHECK(if we should include curses.h or termcap.h, cf_cv_need_curses_h,[
 2502 cf_save_CPPFLAGS="$CPPFLAGS"
 2503 cf_cv_need_curses_h=no
 2504 
 2505 for cf_t_opts in "" "NEED_TERMCAP_H"
 2506 do
 2507 for cf_c_opts in "" "NEED_CURSES_H"
 2508 do
 2509 
 2510     CPPFLAGS="$cf_save_CPPFLAGS $CHECK_DECL_FLAG"
 2511     test -n "$cf_c_opts" && CPPFLAGS="$CPPFLAGS -D$cf_c_opts"
 2512     test -n "$cf_t_opts" && CPPFLAGS="$CPPFLAGS -D$cf_t_opts"
 2513 
 2514     AC_TRY_LINK([/* $cf_c_opts $cf_t_opts */
 2515 $CHECK_DECL_HDRS],
 2516 	[char *x = (char *)tgoto("")],
 2517 	[test "$cf_cv_need_curses_h" = no && {
 2518 	     cf_cv_need_curses_h=maybe
 2519 	     cf_ok_c_opts=$cf_c_opts
 2520 	     cf_ok_t_opts=$cf_t_opts
 2521 	}],
 2522 	[echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >&AC_FD_CC
 2523 	AC_TRY_LINK([
 2524 $CHECK_DECL_HDRS],
 2525 	[char *x = (char *)tgoto("",0,0)],
 2526 	[cf_cv_need_curses_h=yes
 2527 	 cf_ok_c_opts=$cf_c_opts
 2528 	 cf_ok_t_opts=$cf_t_opts])])
 2529 
 2530 	CPPFLAGS="$cf_save_CPPFLAGS"
 2531 	test "$cf_cv_need_curses_h" = yes && break
 2532 done
 2533 	test "$cf_cv_need_curses_h" = yes && break
 2534 done
 2535 
 2536 if test "$cf_cv_need_curses_h" != no ; then
 2537 	echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T:$cf_ok_t_opts)" >&AC_FD_CC
 2538 	if test -n "$cf_ok_c_opts" ; then
 2539 		if test -n "$cf_ok_t_opts" ; then
 2540 			cf_cv_need_curses_h=both
 2541 		else
 2542 			cf_cv_need_curses_h=curses.h
 2543 		fi
 2544 	elif test -n "$cf_ok_t_opts" ; then
 2545 		cf_cv_need_curses_h=termcap.h
 2546 	elif test "$cf_cv_term_header" != no ; then
 2547 		cf_cv_need_curses_h=term.h
 2548 	else
 2549 		cf_cv_need_curses_h=no
 2550 	fi
 2551 fi
 2552 ])
 2553 
 2554 case $cf_cv_need_curses_h in
 2555 both)
 2556 	AC_DEFINE_UNQUOTED(NEED_CURSES_H,1,[Define to 1 if we must include curses.h])
 2557 	AC_DEFINE_UNQUOTED(NEED_TERMCAP_H,1,[Define to 1 if we must include termcap.h])
 2558 	;;
 2559 curses.h)
 2560 	AC_DEFINE_UNQUOTED(NEED_CURSES_H,1,[Define to 1 if we must include curses.h])
 2561 	;;
 2562 term.h)
 2563 	AC_DEFINE_UNQUOTED(NEED_TERM_H,1,[Define to 1 if we must include term.h])
 2564 	;;
 2565 termcap.h)
 2566 	AC_DEFINE_UNQUOTED(NEED_TERMCAP_H,1,[Define to 1 if we must include termcap.h])
 2567 	;;
 2568 esac
 2569 
 2570 ])dnl
 2571 dnl ---------------------------------------------------------------------------
 2572 dnl CF_CURSES_TERM_H version: 15 updated: 2021/01/02 09:31:20
 2573 dnl ----------------
 2574 dnl SVr4 curses should have term.h as well (where it puts the definitions of
 2575 dnl the low-level interface).  This may not be true in old/broken implementations,
 2576 dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
 2577 dnl running with Solaris 2.5.1).
 2578 AC_DEFUN([CF_CURSES_TERM_H],
 2579 [
 2580 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 2581 
 2582 AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
 2583 
 2584 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
 2585 # for <term.h> if we do not find the variant.
 2586 
 2587 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
 2588 
 2589 case "${cf_cv_ncurses_header:-curses.h}" in
 2590 */*)
 2591 	cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
 2592 	cf_header_list="$cf_header_item $cf_header_list"
 2593 	;;
 2594 esac
 2595 
 2596 for cf_header in $cf_header_list
 2597 do
 2598 	AC_TRY_COMPILE([
 2599 #include <${cf_cv_ncurses_header:-curses.h}>
 2600 #include <${cf_header}>],
 2601 	[WINDOW *x; (void)x],
 2602 	[cf_cv_term_header=$cf_header
 2603 	 break],
 2604 	[cf_cv_term_header=no])
 2605 done
 2606 
 2607 case "$cf_cv_term_header" in
 2608 no)
 2609 	# If curses is ncurses, some packagers still mess it up by trying to make
 2610 	# us use GNU termcap.  This handles the most common case.
 2611 	for cf_header in ncurses/term.h ncursesw/term.h
 2612 	do
 2613 		AC_TRY_COMPILE([
 2614 #include <${cf_cv_ncurses_header:-curses.h}>
 2615 #ifdef NCURSES_VERSION
 2616 #include <${cf_header}>
 2617 #else
 2618 make an error
 2619 #endif],
 2620 			[WINDOW *x; (void)x],
 2621 			[cf_cv_term_header=$cf_header
 2622 			 break],
 2623 			[cf_cv_term_header=no])
 2624 	done
 2625 	;;
 2626 esac
 2627 ])
 2628 
 2629 case "$cf_cv_term_header" in
 2630 term.h)
 2631 	AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
 2632 	;;
 2633 ncurses/term.h)
 2634 	AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
 2635 	;;
 2636 ncursesw/term.h)
 2637 	AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
 2638 	;;
 2639 esac
 2640 ])dnl
 2641 dnl ---------------------------------------------------------------------------
 2642 dnl CF_CURSES_UNCTRL_H version: 8 updated: 2021/01/02 09:31:20
 2643 dnl ------------------
 2644 dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
 2645 dnl may put it in a subdirectory (along with ncurses' other headers, of
 2646 dnl course).  Packages which put the headers in inconsistent locations are
 2647 dnl broken).
 2648 AC_DEFUN([CF_CURSES_UNCTRL_H],
 2649 [
 2650 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 2651 
 2652 AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
 2653 
 2654 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
 2655 # for <unctrl.h> if we do not find the variant.
 2656 
 2657 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
 2658 
 2659 case "${cf_cv_ncurses_header:-curses.h}" in
 2660 */*)
 2661 	cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
 2662 	cf_header_list="$cf_header_item $cf_header_list"
 2663 	;;
 2664 esac
 2665 
 2666 for cf_header in $cf_header_list
 2667 do
 2668 	AC_TRY_COMPILE([
 2669 #include <${cf_cv_ncurses_header:-curses.h}>
 2670 #include <${cf_header}>],
 2671 	[WINDOW *x; (void)x],
 2672 	[cf_cv_unctrl_header=$cf_header
 2673 	 break],
 2674 	[cf_cv_unctrl_header=no])
 2675 done
 2676 ])
 2677 
 2678 case "$cf_cv_unctrl_header" in
 2679 no)
 2680 	AC_MSG_WARN(unctrl.h header not found)
 2681 	;;
 2682 esac
 2683 
 2684 case "$cf_cv_unctrl_header" in
 2685 unctrl.h)
 2686 	AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
 2687 	;;
 2688 ncurses/unctrl.h)
 2689 	AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
 2690 	;;
 2691 ncursesw/unctrl.h)
 2692 	AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
 2693 	;;
 2694 esac
 2695 ])dnl
 2696 dnl ---------------------------------------------------------------------------
 2697 dnl CF_DEFAULT_SHELL version: 7 updated: 2019/12/31 20:39:42
 2698 dnl ----------------
 2699 dnl Look for a Bourne-shell compatible program from a list that we know about:
 2700 dnl	ash	Almquist Shell (sh based)
 2701 dnl	bash	Bourne Again Shell (sh, ksh based)
 2702 dnl	dash	Debian Almquist Shell (sh based)
 2703 dnl	jsh	Job Control Bourne Shell (sh based)
 2704 dnl	keysh	Key Shell (ksh based)
 2705 dnl	ksh	Korn Shell (sh based)
 2706 dnl	mksh	MirBSD Korn shell (pdksh based)
 2707 dnl	pdksh	Public-domain ksh
 2708 dnl	sh	Bourne Shell or POSIX Shell
 2709 dnl	zsh	Z Shell (sh, ksh based)
 2710 dnl On BSD systems look for a C Shell compatible program:
 2711 dnl	csh	C Shell
 2712 dnl	tcsh	TENEX C Shell (csh based)
 2713 AC_DEFUN([CF_DEFAULT_SHELL],
 2714 [
 2715 AC_MSG_CHECKING(for the default shell program)
 2716 cf_shell_progs="ifelse($1,,sh,[$1])"
 2717 if test -z "$cf_shell_progs" ; then
 2718 	cf_shell_progs="sh ksh bash zsh pdksh mksh jsh keysh ash dash"
 2719 	# TIN preferred default shell for BSD systems is csh. Others are sh.
 2720 	AC_TRY_COMPILE([
 2721 #include <sys/params.h>],[
 2722 #if (defined(BSD) && (BSD >= 199103))
 2723 #else
 2724 make an error
 2725 #endif
 2726 ],[$cf_shell_progs="csh tcsh $cf_shell_progs"])
 2727 fi
 2728 CF_MSG_LOG(paths of shell programs: $cf_shell_progs)
 2729 if test -s /etc/shells && test `egrep -c -v '^(#| |    |$)' /etc/shells` -gt 0; then
 2730 	CF_MSG_LOG(/etc/shells)
 2731 	for cf_prog in $cf_shell_progs
 2732 	do
 2733 		case $cf_prog in
 2734 			/*)
 2735 				cf_pattern="^"$cf_prog"$"
 2736 				;;
 2737 			*/*)
 2738 				AC_MSG_ERROR(Program name must be absolute or filename: $cf_prog)
 2739 				;;
 2740 			*)
 2741 				cf_pattern="/"$cf_prog"$"
 2742 				;;
 2743 		esac
 2744 		cf_path=`egrep $cf_pattern /etc/shells 2>/dev/null`
 2745 		if test -n "$cf_path"
 2746 		then
 2747 			for cf_shell in $cf_path
 2748 			do
 2749 				if test -f "$cf_shell"
 2750 				then
 2751 					DEFAULT_SHELL="$cf_shell"
 2752 					break
 2753 				fi
 2754 			done
 2755 		fi
 2756 		if test -n "$DEFAULT_SHELL"
 2757 		then
 2758 			break
 2759 		fi
 2760 	done
 2761 	AC_MSG_RESULT($DEFAULT_SHELL)
 2762 else
 2763 	CF_MSG_LOG($PATH)
 2764 AC_PATH_PROGS(DEFAULT_SHELL,
 2765 	$cf_shell_progs,,
 2766 	$PATH:/bin:/usr/bin:/usr/xpg4/bin:/bin/posix:/usr/bin/posix:/usr/old/bin:/usr/local/bin)
 2767 fi
 2768 if test -z "$DEFAULT_SHELL" ; then
 2769 	AC_MSG_WARN(
 2770 Cannot find the default shell you specified: $cf_shell_progs)
 2771 	if test -f /bin/false ; then
 2772 		AC_MSG_WARN(Using /bin/false instead)
 2773 		DEFAULT_SHELL=/bin/false
 2774 	else
 2775 		AC_MSG_ERROR(Cannot use /bin/false because it does not exist)
 2776 	fi
 2777 fi
 2778 AC_DEFINE_UNQUOTED(DEFAULT_SHELL,"$DEFAULT_SHELL",[Define this to the default shell-program])
 2779 ])dnl
 2780 dnl ---------------------------------------------------------------------------
 2781 dnl CF_DEFINE_STRING version: 3 updated: 2019/12/31 20:39:42
 2782 dnl ----------------
 2783 dnl Define a string which may contain escaped quotes or backslashes
 2784 dnl $1 = symbol to define
 2785 dnl $2 = the information we want to quote
 2786 AC_DEFUN([CF_DEFINE_STRING],
 2787 [
 2788 cf_define=`echo $2|sed -e 's/\\\\/\\\\134/g' -e 's/^[[ 	]]\\+//' -e 's/[[ 	]]\\+$//' -e 's/"/\\\\042/g'`
 2789 AC_DEFINE_UNQUOTED($1, "$cf_define", [Define a value for $1])
 2790 ])dnl
 2791 dnl ---------------------------------------------------------------------------
 2792 dnl CF_DIRNAME version: 5 updated: 2020/12/31 20:19:42
 2793 dnl ----------
 2794 dnl "dirname" is not portable, so we fake it with a shell script.
 2795 AC_DEFUN([CF_DIRNAME],[$1=`echo "$2" | sed -e 's%/[[^/]]*$%%'`])dnl
 2796 dnl ---------------------------------------------------------------------------
 2797 dnl CF_DISABLE_ECHO version: 14 updated: 2021/09/04 06:35:04
 2798 dnl ---------------
 2799 dnl You can always use "make -n" to see the actual options, but it is hard to
 2800 dnl pick out/analyze warning messages when the compile-line is long.
 2801 dnl
 2802 dnl Sets:
 2803 dnl	ECHO_LT - symbol to control if libtool is verbose
 2804 dnl	ECHO_LD - symbol to prefix "cc -o" lines
 2805 dnl	RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
 2806 dnl	SHOW_CC - symbol to put before explicit "cc -c" lines
 2807 dnl	ECHO_CC - symbol to put before any "cc" line
 2808 dnl
 2809 AC_DEFUN([CF_DISABLE_ECHO],[
 2810 AC_MSG_CHECKING(if you want to see long compiling messages)
 2811 CF_ARG_DISABLE(echo,
 2812 	[  --disable-echo          do not display "compiling" commands],
 2813 	[
 2814 	ECHO_LT='--silent'
 2815 	ECHO_LD='@echo linking [$]@;'
 2816 	RULE_CC='@echo compiling [$]<'
 2817 	SHOW_CC='@echo compiling [$]@'
 2818 	ECHO_CC='@'
 2819 ],[
 2820 	ECHO_LT=''
 2821 	ECHO_LD=''
 2822 	RULE_CC=''
 2823 	SHOW_CC=''
 2824 	ECHO_CC=''
 2825 ])
 2826 AC_MSG_RESULT($enableval)
 2827 AC_SUBST(ECHO_LT)
 2828 AC_SUBST(ECHO_LD)
 2829 AC_SUBST(RULE_CC)
 2830 AC_SUBST(SHOW_CC)
 2831 AC_SUBST(ECHO_CC)
 2832 ])dnl
 2833 dnl ---------------------------------------------------------------------------
 2834 dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
 2835 dnl --------
 2836 dnl Check if 'errno' is declared in <errno.h>
 2837 AC_DEFUN([CF_ERRNO],
 2838 [
 2839 CF_CHECK_ERRNO(errno)
 2840 ])dnl
 2841 dnl ---------------------------------------------------------------------------
 2842 dnl CF_FIND_CANLOCK version: 2 updated: 2021/12/13 19:52:28
 2843 dnl ---------------
 2844 dnl Look for CANLOCK, to use instead of a bundled copy of CANLOCK.
 2845 dnl
 2846 dnl $1 = variable to set with CANLOCK's CPPFLAGS
 2847 dnl $2 = variable to set with CANLOCK's LIBS
 2848 dnl $3 = action to take on success
 2849 dnl $4 = action to take on failure
 2850 AC_DEFUN([CF_FIND_CANLOCK],[
 2851 AC_REQUIRE([CF_PKG_CONFIG])
 2852 
 2853 cf_save_CFLAGS="$CFLAGS"
 2854 cf_save_LIBS="$LIBS"
 2855 cf_find_CANLOCK=yes
 2856 
 2857 CF_TRY_PKG_CONFIG(libcanlock-3,,[
 2858 	CF_TRY_PKG_CONFIG(libcanlock,,[
 2859 		cf_pkgconfig_incs=
 2860 		cf_pkgconfig_libs=
 2861 		for cf_canlock_lib in canlock3 canlock
 2862 		do
 2863 			AC_CHECK_LIB($cf_canlock_lib,cl_clear_secret,[
 2864 				cf_pkgconfig_libs="-l$cf_canlock_lib"
 2865 				break
 2866 			])
 2867 		done
 2868 		if test -z "$cf_pkgconfig_libs" ; then
 2869 			cf_find_CANLOCK=no
 2870 		else
 2871 			AC_CHECK_HEADERS(libcanlock-3/canlock.h canlock.h)
 2872 		fi
 2873 		])
 2874 	])
 2875 
 2876 CFLAGS="$cf_save_CFLAGS"
 2877 LIBS="$cf_save_LIBS"
 2878 
 2879 $1="$cf_pkgconfig_incs"
 2880 $2="$cf_pkgconfig_libs"
 2881 
 2882 if test "$cf_find_CANLOCK" = yes; then
 2883 	$3
 2884 else
 2885 	$4
 2886 fi
 2887 ])dnl
 2888 dnl ---------------------------------------------------------------------------
 2889 dnl CF_FIND_IPV6_LIBS version: 9 updated: 2021/01/02 09:31:20
 2890 dnl -----------------
 2891 dnl Based on the IPV6 stack type, look for the corresponding library.
 2892 AC_DEFUN([CF_FIND_IPV6_LIBS],[
 2893 AC_REQUIRE([CF_FIND_IPV6_TYPE])
 2894 
 2895 cf_ipv6lib=none
 2896 cf_ipv6dir=none
 2897 
 2898 AC_MSG_CHECKING(for IPv6 library if required)
 2899 case "$cf_cv_ipv6type" in
 2900 solaris)
 2901 	;;
 2902 inria)
 2903 	;;
 2904 kame)
 2905 	dnl http://www.kame.net/
 2906 	cf_ipv6lib=inet6
 2907 	cf_ipv6dir=v6
 2908 	;;
 2909 linux-glibc)
 2910 	;;
 2911 linux-libinet6)
 2912 	dnl http://www.v6.linux.or.jp/
 2913 	cf_ipv6lib=inet6
 2914 	cf_ipv6dir=inet6
 2915 	;;
 2916 toshiba)
 2917 	cf_ipv6lib=inet6
 2918 	cf_ipv6dir=v6
 2919 	;;
 2920 v6d)
 2921 	cf_ipv6lib=v6
 2922 	cf_ipv6dir=v6
 2923 	;;
 2924 zeta)
 2925 	cf_ipv6lib=inet6
 2926 	cf_ipv6dir=v6
 2927 	;;
 2928 esac
 2929 AC_MSG_RESULT($cf_ipv6lib)
 2930 
 2931 if test "$cf_ipv6lib" != "none"; then
 2932 
 2933 	AC_TRY_LINK([
 2934 #include <sys/types.h>
 2935 #include <netdb.h>
 2936 #include <netinet/in.h>
 2937 #include <netinet/ip6.h>],
 2938 	[getaddrinfo(0, 0, 0, 0)],,[
 2939 	CF_HEADER_PATH(cf_search,$cf_ipv6dir)
 2940 	for cf_incdir in $cf_search
 2941 	do
 2942 		cf_header=$cf_incdir/netinet/ip6.h
 2943 		if test -f "$cf_header"
 2944 		then
 2945 			CF_ADD_INCDIR($cf_incdir)
 2946 			test -n "$verbose" && echo "	... found $cf_header" 1>&AC_FD_MSG
 2947 			break
 2948 		fi
 2949 		test -n "$verbose" && echo "	... tested $cf_header" 1>&AC_FD_MSG
 2950 	done
 2951 	])
 2952 
 2953 	CF_FIND_LIBRARY([$cf_ipv6lib],[$cf_ipv6dir],[
 2954 #include <sys/types.h>
 2955 #include <netdb.h>
 2956 #include <netinet/in.h>
 2957 #include <netinet/ip6.h>],
 2958 	[getaddrinfo(0, 0, 0, 0)],
 2959 	[getaddrinfo],
 2960 	noexit)
 2961 	if test "$cf_found_library" = no ; then
 2962 		AC_MSG_ERROR(
 2963 [No $cf_ipv6lib library found, cannot continue.  You must fetch lib$cf_ipv6lib.a
 2964 from an appropriate IPv6 kit and compile beforehand.])
 2965 	fi
 2966 fi
 2967 
 2968 ])dnl
 2969 dnl ---------------------------------------------------------------------------
 2970 dnl CF_FIND_IPV6_TYPE version: 7 updated: 2021/01/02 09:31:20
 2971 dnl -----------------
 2972 AC_DEFUN([CF_FIND_IPV6_TYPE],[
 2973 AC_CACHE_CHECK(ipv6 stack type, cf_cv_ipv6type, [
 2974 cf_cv_ipv6type=unknown
 2975 for i in solaris inria kame linux-glibc linux-libinet6 toshiba v6d zeta
 2976 do
 2977 	case "$i" in
 2978 	solaris)
 2979 		if test "SunOS" = "`uname -s`"
 2980 		then
 2981 		  if test -f /usr/include/netinet/ip6.h
 2982 		  then
 2983 			cf_cv_ipv6type=$i
 2984 		  fi
 2985 		fi
 2986 		;;
 2987 	inria)
 2988 		dnl http://www.kame.net/
 2989 		AC_EGREP_CPP(yes, [
 2990 #include <netinet/in.h>
 2991 #ifdef IPV6_INRIA_VERSION
 2992 yes
 2993 #endif],	[cf_cv_ipv6type=$i])
 2994 		;;
 2995 	kame)
 2996 		dnl http://www.kame.net/
 2997 		AC_EGREP_CPP(yes, [
 2998 #include <netinet/in.h>
 2999 #ifdef __KAME__
 3000 yes
 3001 #endif],	[cf_cv_ipv6type=$i])
 3002 		;;
 3003 	linux-glibc)
 3004 		dnl http://www.v6.linux.or.jp/
 3005 		AC_EGREP_CPP(yes, [
 3006 #include <features.h>
 3007 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
 3008 yes
 3009 #endif],	[cf_cv_ipv6type=$i])
 3010 		;;
 3011 	linux-libinet6)
 3012 		dnl http://www.v6.linux.or.jp/
 3013 		if test -d /usr/inet6
 3014 		then
 3015 			cf_cv_ipv6type=$i
 3016 		elif test -f /usr/include/netinet/ip6.h
 3017 		then
 3018 			cf_cv_ipv6type=$i
 3019 		fi
 3020 		;;
 3021 	toshiba)
 3022 		AC_EGREP_CPP(yes, [
 3023 #include <sys/param.h>
 3024 #ifdef _TOSHIBA_INET6
 3025 yes
 3026 #endif],	[cf_cv_ipv6type=$i])
 3027 		;;
 3028 	v6d)
 3029 		AC_EGREP_CPP(yes, [
 3030 #include </usr/local/v6/include/sys/v6config.h>
 3031 #ifdef __V6D__
 3032 yes
 3033 #endif],	[cf_cv_ipv6type=$i])
 3034 		;;
 3035 	zeta)
 3036 		AC_EGREP_CPP(yes, [
 3037 #include <sys/param.h>
 3038 #ifdef _ZETA_MINAMI_INET6
 3039 yes
 3040 #endif],	[cf_cv_ipv6type=$i])
 3041 		;;
 3042 	esac
 3043 	if test "$cf_cv_ipv6type" != "unknown"; then
 3044 		break
 3045 	fi
 3046 done
 3047 ])
 3048 ])dnl
 3049 dnl ---------------------------------------------------------------------------
 3050 dnl CF_FIND_LIBRARY version: 11 updated: 2021/01/02 09:31:20
 3051 dnl ---------------
 3052 dnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
 3053 dnl prefer a standard location, and use -L options only if we do not find the
 3054 dnl library in the standard library location(s).
 3055 dnl	$1 = library name
 3056 dnl	$2 = library class, usually the same as library name
 3057 dnl	$3 = includes
 3058 dnl	$4 = code fragment to compile/link
 3059 dnl	$5 = corresponding function-name
 3060 dnl	$6 = flag, nonnull if failure should not cause an error-exit
 3061 dnl
 3062 dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
 3063 dnl to use a -L option.
 3064 AC_DEFUN([CF_FIND_LIBRARY],
 3065 [
 3066 	eval 'cf_cv_have_lib_'"$1"'=no'
 3067 	cf_libdir=""
 3068 	AC_CHECK_FUNC($5,
 3069 		eval 'cf_cv_have_lib_'"$1"'=yes',[
 3070 		cf_save_LIBS="$LIBS"
 3071 		AC_MSG_CHECKING(for $5 in -l$1)
 3072 		LIBS="-l$1 $LIBS"
 3073 		AC_TRY_LINK([$3],[$4],
 3074 			[AC_MSG_RESULT(yes)
 3075 			 eval 'cf_cv_have_lib_'"$1"'=yes'
 3076 			],
 3077 			[AC_MSG_RESULT(no)
 3078 			CF_LIBRARY_PATH(cf_search,$2)
 3079 			for cf_libdir in $cf_search
 3080 			do
 3081 				AC_MSG_CHECKING(for -l$1 in $cf_libdir)
 3082 				LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
 3083 				AC_TRY_LINK([$3],[$4],
 3084 					[AC_MSG_RESULT(yes)
 3085 			 		 eval 'cf_cv_have_lib_'"$1"'=yes'
 3086 					 break],
 3087 					[AC_MSG_RESULT(no)
 3088 					 LIBS="$cf_save_LIBS"])
 3089 			done
 3090 			])
 3091 		])
 3092 eval 'cf_found_library="[$]cf_cv_have_lib_'"$1"\"
 3093 ifelse($6,,[
 3094 if test "$cf_found_library" = no ; then
 3095 	AC_MSG_ERROR(Cannot link $1 library)
 3096 fi
 3097 ])
 3098 ])dnl
 3099 dnl ---------------------------------------------------------------------------
 3100 dnl CF_FIND_LINKAGE version: 22 updated: 2020/12/31 20:19:42
 3101 dnl ---------------
 3102 dnl Find a library (specifically the linkage used in the code fragment),
 3103 dnl searching for it if it is not already in the library path.
 3104 dnl See also CF_ADD_SEARCHPATH.
 3105 dnl
 3106 dnl Parameters (4-on are optional):
 3107 dnl     $1 = headers for library entrypoint
 3108 dnl     $2 = code fragment for library entrypoint
 3109 dnl     $3 = the library name without the "-l" option or ".so" suffix.
 3110 dnl     $4 = action to perform if successful (default: update CPPFLAGS, etc)
 3111 dnl     $5 = action to perform if not successful
 3112 dnl     $6 = module name, if not the same as the library name
 3113 dnl     $7 = extra libraries
 3114 dnl
 3115 dnl Sets these variables:
 3116 dnl     $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
 3117 dnl     $cf_cv_header_path_$3 - include-directory if needed
 3118 dnl     $cf_cv_library_path_$3 - library-directory if needed
 3119 dnl     $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
 3120 AC_DEFUN([CF_FIND_LINKAGE],[
 3121 
 3122 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
 3123 # will be set on completion of the AC_TRY_LINK below.
 3124 cf_cv_header_path_$3=
 3125 cf_cv_library_path_$3=
 3126 
 3127 CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
 3128 
 3129 cf_save_LIBS="$LIBS"
 3130 
 3131 AC_TRY_LINK([$1],[$2],[
 3132 	cf_cv_find_linkage_$3=yes
 3133 	cf_cv_header_path_$3=/usr/include
 3134 	cf_cv_library_path_$3=/usr/lib
 3135 ],[
 3136 
 3137 LIBS="-l$3 $7 $cf_save_LIBS"
 3138 
 3139 AC_TRY_LINK([$1],[$2],[
 3140 	cf_cv_find_linkage_$3=yes
 3141 	cf_cv_header_path_$3=/usr/include
 3142 	cf_cv_library_path_$3=/usr/lib
 3143 	cf_cv_library_file_$3="-l$3"
 3144 ],[
 3145 	cf_cv_find_linkage_$3=no
 3146 	LIBS="$cf_save_LIBS"
 3147 
 3148 	CF_VERBOSE(find linkage for $3 library)
 3149 	CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
 3150 
 3151 	cf_save_CPPFLAGS="$CPPFLAGS"
 3152 	cf_test_CPPFLAGS="$CPPFLAGS"
 3153 
 3154 	CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
 3155 	for cf_cv_header_path_$3 in $cf_search
 3156 	do
 3157 		if test -d "$cf_cv_header_path_$3" ; then
 3158 			CF_VERBOSE(... testing $cf_cv_header_path_$3)
 3159 			CPPFLAGS="$cf_save_CPPFLAGS"
 3160 			CF_APPEND_TEXT(CPPFLAGS,-I$cf_cv_header_path_$3)
 3161 			AC_TRY_COMPILE([$1],[$2],[
 3162 				CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
 3163 				cf_cv_find_linkage_$3=maybe
 3164 				cf_test_CPPFLAGS="$CPPFLAGS"
 3165 				break],[
 3166 				CPPFLAGS="$cf_save_CPPFLAGS"
 3167 				])
 3168 		fi
 3169 	done
 3170 
 3171 	if test "$cf_cv_find_linkage_$3" = maybe ; then
 3172 
 3173 		CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
 3174 
 3175 		cf_save_LIBS="$LIBS"
 3176 		cf_save_LDFLAGS="$LDFLAGS"
 3177 
 3178 		ifelse([$6],,,[
 3179 		CPPFLAGS="$cf_test_CPPFLAGS"
 3180 		LIBS="-l$3 $7 $cf_save_LIBS"
 3181 		AC_TRY_LINK([$1],[$2],[
 3182 			CF_VERBOSE(... found $3 library in system)
 3183 			cf_cv_find_linkage_$3=yes])
 3184 			CPPFLAGS="$cf_save_CPPFLAGS"
 3185 			LIBS="$cf_save_LIBS"
 3186 			])
 3187 
 3188 		if test "$cf_cv_find_linkage_$3" != yes ; then
 3189 			CF_LIBRARY_PATH(cf_search,$3)
 3190 			for cf_cv_library_path_$3 in $cf_search
 3191 			do
 3192 				if test -d "$cf_cv_library_path_$3" ; then
 3193 					CF_VERBOSE(... testing $cf_cv_library_path_$3)
 3194 					CPPFLAGS="$cf_test_CPPFLAGS"
 3195 					LIBS="-l$3 $7 $cf_save_LIBS"
 3196 					LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
 3197 					AC_TRY_LINK([$1],[$2],[
 3198 					CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
 3199 					cf_cv_find_linkage_$3=yes
 3200 					cf_cv_library_file_$3="-l$3"
 3201 					break],[
 3202 					CPPFLAGS="$cf_save_CPPFLAGS"
 3203 					LIBS="$cf_save_LIBS"
 3204 					LDFLAGS="$cf_save_LDFLAGS"
 3205 					])
 3206 				fi
 3207 			done
 3208 			CPPFLAGS="$cf_save_CPPFLAGS"
 3209 			LDFLAGS="$cf_save_LDFLAGS"
 3210 		fi
 3211 
 3212 	else
 3213 		cf_cv_find_linkage_$3=no
 3214 	fi
 3215 	],$7)
 3216 ])
 3217 
 3218 LIBS="$cf_save_LIBS"
 3219 
 3220 if test "$cf_cv_find_linkage_$3" = yes ; then
 3221 ifelse([$4],,[
 3222 	CF_ADD_INCDIR($cf_cv_header_path_$3)
 3223 	CF_ADD_LIBDIR($cf_cv_library_path_$3)
 3224 	CF_ADD_LIB($3)
 3225 ],[$4])
 3226 else
 3227 ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
 3228 fi
 3229 ])dnl
 3230 dnl ---------------------------------------------------------------------------
 3231 dnl CF_FIND_PCRE version: 1 updated: 2020/01/01 16:29:19
 3232 dnl ------------
 3233 dnl Look for PCRE, to use instead of a bundled copy of PCRE.
 3234 dnl
 3235 dnl $1 = variable to set with PCRE's CPPFLAGS
 3236 dnl $2 = variable to set with PCRE's LIBS
 3237 dnl $3 = action to take on success
 3238 dnl $4 = action to take on failure
 3239 AC_DEFUN([CF_FIND_PCRE],[
 3240 AC_REQUIRE([CF_PKG_CONFIG])
 3241 
 3242 cf_save_CFLAGS="$CFLAGS"
 3243 cf_save_LIBS="$LIBS"
 3244 cf_find_PCRE=yes
 3245 
 3246 CF_TRY_PKG_CONFIG(libpcre2,,[
 3247 	CF_TRY_PKG_CONFIG(libpcre,,[
 3248 		AC_CHECK_LIB(pcre,pcre_compile,[
 3249 			CF_ADD_LIB(pcre)
 3250 			AC_CHECK_LIB(pcre2-posix,regcomp,[
 3251 				CF_ADD_LIB(pcre2-posix)],[
 3252 					AC_CHECK_LIB(pcreposix,regcomp,[
 3253 						CF_ADD_LIB(pcreposix)
 3254 					],[
 3255 						cf_find_PCRE=no
 3256 					])
 3257 				])
 3258 			],[
 3259 				cf_find_PCRE=no
 3260 			])
 3261 		])
 3262 	])
 3263 
 3264 CFLAGS="$cf_save_CFLAGS"
 3265 LIBS="$cf_save_LIBS"
 3266 
 3267 $1="$cf_pkgconfig_incs"
 3268 $2="$cf_pkgconfig_libs"
 3269 
 3270 if test "$cf_find_PCRE" = yes; then
 3271 	$3
 3272 else
 3273 	$4
 3274 fi
 3275 ])dnl
 3276 dnl ---------------------------------------------------------------------------
 3277 dnl CF_FIX_SLASHES version: 2 updated: 2001/05/27 21:36:02
 3278 dnl --------------
 3279 dnl OS/2 and Cygwin ports may pick up backslashes in pathnames, which are not
 3280 dnl usable in quoted strings.  Fix them.
 3281 dnl	$1=fixed($2)
 3282 AC_DEFUN([CF_FIX_SLASHES],
 3283 [
 3284 case $cf_cv_system_name in #(vi
 3285 os2*|cygwin*)
 3286 	$1=`echo "[$]$1" | sed -e 's%\\\\%/%g'`
 3287 	;;
 3288 esac
 3289 ])dnl
 3290 dnl ---------------------------------------------------------------------------
 3291 dnl CF_FUNC_ALLOCA version: 2 updated: 2009/01/06 19:35:17
 3292 dnl --------------
 3293 dnl workaround for bison 1.875c (compound breakage in Linux stdlib.h and
 3294 dnl bison's output make bison try to use alloca()).
 3295 AC_DEFUN([CF_FUNC_ALLOCA],
 3296 [
 3297 AC_FUNC_ALLOCA
 3298 
 3299 case $host_os in
 3300 linux*|gnu*)
 3301 	# workaround for bison 1.875c (compound breakage in Linux stdlib.h
 3302 	# and bison's output make bison try to use alloca()).
 3303 	if test -z "$GCC" ; then
 3304 		CPPFLAGS="$CPPFLAGS -DYYSTACK_USE_ALLOCA=0"
 3305 		ALLOCA=""
 3306 	elif test "$INTEL_COMPILER" = yes ; then
 3307 		CPPFLAGS="$CPPFLAGS -DYYSTACK_USE_ALLOCA=0"
 3308 		ALLOCA=""
 3309 	fi
 3310 	;;
 3311 esac
 3312 ])dnl
 3313 dnl ---------------------------------------------------------------------------
 3314 dnl CF_FUNC_FORK version: 4 updated: 2010/10/23 15:52:32
 3315 dnl ------------
 3316 dnl Check if 'fork()' is available, and working.  Amiga (and possibly other
 3317 dnl machines) have a non-working 'fork()' entrypoint.
 3318 AC_DEFUN([CF_FUNC_FORK],
 3319 [AC_MSG_CHECKING([for fork])
 3320 AC_CACHE_VAL(cf_cv_func_fork,[
 3321 AC_TRY_RUN([
 3322 int main()
 3323 {
 3324 	if (fork() < 0)
 3325 		${cf_cv_main_return:-return}(1);
 3326 	${cf_cv_main_return:-return}(0);
 3327 }],	[cf_cv_func_fork=yes],
 3328 	[cf_cv_func_fork=no],
 3329 	[cf_cv_func_fork=unknown])
 3330 ])dnl
 3331 AC_MSG_RESULT($cf_cv_func_fork)
 3332 test $cf_cv_func_fork = yes && AC_DEFINE(HAVE_FORK)
 3333 ])dnl
 3334 dnl ---------------------------------------------------------------------------
 3335 dnl CF_FUNC_GETADDRINFO version: 9 updated: 2017/05/10 18:31:29
 3336 dnl -------------------
 3337 dnl Look for a working version of getaddrinfo(), for IPV6 support.
 3338 AC_DEFUN([CF_FUNC_GETADDRINFO],[
 3339 AC_CACHE_CHECK(working getaddrinfo, cf_cv_getaddrinfo,[
 3340 AC_TRY_RUN([
 3341 #include <sys/types.h>
 3342 #include <netdb.h>
 3343 #include <string.h>
 3344 #include <sys/socket.h>
 3345 #include <netinet/in.h>
 3346 
 3347 #define expect(a,b) if (strcmp(a,b) != 0) goto bad
 3348 
 3349 int main(void)
 3350 {
 3351    int passive, gaierr, inet4 = 0, inet6 = 0;
 3352    struct addrinfo hints, *ai, *aitop;
 3353    char straddr[INET6_ADDRSTRLEN], strport[16];
 3354 
 3355    for (passive = 0; passive <= 1; passive++) {
 3356      memset(&hints, 0, sizeof(hints));
 3357      hints.ai_family = AF_UNSPEC;
 3358      hints.ai_flags = passive ? AI_PASSIVE : 0;
 3359      hints.ai_socktype = SOCK_STREAM;
 3360      if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
 3361        (void)gai_strerror(gaierr);
 3362        goto bad;
 3363      }
 3364      for (ai = aitop; ai; ai = ai->ai_next) {
 3365        if (ai->ai_addr == NULL ||
 3366            ai->ai_addrlen == 0 ||
 3367            getnameinfo(ai->ai_addr, ai->ai_addrlen,
 3368                        straddr, sizeof(straddr), strport, sizeof(strport),
 3369                        NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
 3370          goto bad;
 3371        }
 3372        switch (ai->ai_family) {
 3373        case AF_INET:
 3374          expect(strport, "54321");
 3375          if (passive) {
 3376            expect(straddr, "0.0.0.0");
 3377          } else {
 3378            expect(straddr, "127.0.0.1");
 3379          }
 3380          inet4++;
 3381          break;
 3382        case AF_INET6:
 3383          expect(strport, "54321");
 3384          if (passive) {
 3385            expect(straddr, "::");
 3386          } else {
 3387            expect(straddr, "::1");
 3388          }
 3389          inet6++;
 3390          break;
 3391        case AF_UNSPEC:
 3392          goto bad;
 3393          break;
 3394        default:
 3395          /* another family support? */
 3396          break;
 3397        }
 3398      }
 3399    }
 3400 
 3401    if (!(inet4 == 0 || inet4 == 2))
 3402      goto bad;
 3403    if (!(inet6 == 0 || inet6 == 2))
 3404      goto bad;
 3405 
 3406    if (aitop)
 3407      freeaddrinfo(aitop);
 3408    ${cf_cv_main_return:-return}(0);
 3409 
 3410   bad:
 3411    if (aitop)
 3412      freeaddrinfo(aitop);
 3413    ${cf_cv_main_return:-return}(1);
 3414 }
 3415 ],
 3416 [cf_cv_getaddrinfo=yes],
 3417 [cf_cv_getaddrinfo=no],
 3418 [cf_cv_getaddrinfo=unknown])
 3419 ])
 3420 if test "$cf_cv_getaddrinfo" = yes ; then
 3421 	AC_DEFINE(HAVE_GAI_STRERROR,1,[Define to 1 if we have gai_strerror function])
 3422 	AC_DEFINE(HAVE_GETADDRINFO,1,[Define to 1 if we have getaddrinfo function])
 3423 fi
 3424 ])dnl
 3425 dnl ---------------------------------------------------------------------------
 3426 dnl CF_FUNC_MEMMOVE version: 9 updated: 2017/01/21 11:06:25
 3427 dnl ---------------
 3428 dnl Check for memmove, or a bcopy that can handle overlapping copy.  If neither
 3429 dnl is found, add our own version of memmove to the list of objects.
 3430 AC_DEFUN([CF_FUNC_MEMMOVE],
 3431 [
 3432 AC_CHECK_FUNC(memmove,,[
 3433 AC_CHECK_FUNC(bcopy,[
 3434 	AC_CACHE_CHECK(if bcopy does overlapping moves,cf_cv_good_bcopy,[
 3435 		AC_TRY_RUN([
 3436 int main(void) {
 3437 	static char data[] = "abcdefghijklmnopqrstuwwxyz";
 3438 	char temp[40];
 3439 	bcopy(data, temp, sizeof(data));
 3440 	bcopy(temp+10, temp, 15);
 3441 	bcopy(temp+5, temp+15, 10);
 3442 	${cf_cv_main_return:-return} (strcmp(temp, "klmnopqrstuwwxypqrstuwwxyz"));
 3443 }
 3444 		],
 3445 		[cf_cv_good_bcopy=yes],
 3446 		[cf_cv_good_bcopy=no],
 3447 		[cf_cv_good_bcopy=unknown])
 3448 		])
 3449 	],[cf_cv_good_bcopy=no])
 3450 	if test "$cf_cv_good_bcopy" = yes ; then
 3451 		AC_DEFINE(USE_OK_BCOPY,1,[Define to 1 to use bcopy when memmove is unavailable])
 3452 	else
 3453 		AC_DEFINE(USE_MY_MEMMOVE,1,[Define to 1 to use replacement function when memmove is unavailable])
 3454 	fi
 3455 ])])dnl
 3456 dnl ---------------------------------------------------------------------------
 3457 dnl CF_FUNC_SYSTEM version: 6 updated: 2019/12/31 20:39:42
 3458 dnl --------------
 3459 dnl Check if the 'system()' function returns a usable status, or if not, try
 3460 dnl to use the status returned by a SIGCHLD.
 3461 AC_DEFUN([CF_FUNC_SYSTEM],
 3462 [
 3463 AC_REQUIRE([CF_UNION_WAIT])
 3464 AC_MSG_CHECKING(if the system function returns usable child-status)
 3465 AC_CACHE_VAL(cf_cv_system_status,[
 3466 	AC_TRY_RUN([
 3467 #include <stdio.h>
 3468 #include <signal.h>
 3469 #if HAVE_SYS_WAIT_H
 3470 #include <sys/wait.h>
 3471 #endif
 3472 
 3473 RETSIGTYPE signal_handler (int sig)
 3474 {
 3475 #if HAVE_TYPE_UNIONWAIT
 3476 	union wait wait_status;
 3477 #else
 3478 	int wait_status = 1;
 3479 #endif
 3480 	int system_status;
 3481 	wait (&wait_status);
 3482 	system_status = WEXITSTATUS(wait_status); /* should be nonzero */
 3483 	${cf_cv_main_return:-return}(system_status != 23);
 3484 }
 3485 
 3486 int main()
 3487 {
 3488 	/* this looks weird, but apparently the SIGCHLD gets there first on
 3489 	 * machines where 'system()' doesn't return a usable code, so ...
 3490 	 */
 3491 	signal (SIGCHLD, signal_handler);
 3492 	system("exit 23");
 3493 	${cf_cv_main_return:-return}(1);
 3494 }
 3495 ],
 3496 	[cf_cv_system_status=no],
 3497 	[AC_TRY_RUN(
 3498 	[int main() { ${cf_cv_main_return:-return}(system("exit 23") != (23 << 8)); }],
 3499 	[cf_cv_system_status=yes],
 3500 	[cf_cv_system_status=unknown],
 3501 	[cf_cv_system_status=unknown])],
 3502 	[cf_cv_system_status=unknown])
 3503 ])
 3504 AC_MSG_RESULT($cf_cv_system_status)
 3505 test $cf_cv_system_status = no && AC_DEFINE(USE_SYSTEM_STATUS,1,[Define this to 1 if the system function returns usable exit-status])
 3506 ])dnl
 3507 dnl ---------------------------------------------------------------------------
 3508 dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36
 3509 dnl --------------
 3510 dnl Find version of gcc, and (because icc/clang pretend to be gcc without being
 3511 dnl compatible), attempt to determine if icc/clang is actually used.
 3512 AC_DEFUN([CF_GCC_VERSION],[
 3513 AC_REQUIRE([AC_PROG_CC])
 3514 GCC_VERSION=none
 3515 if test "$GCC" = yes ; then
 3516 	AC_MSG_CHECKING(version of $CC)
 3517 	GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
 3518 	test -z "$GCC_VERSION" && GCC_VERSION=unknown
 3519 	AC_MSG_RESULT($GCC_VERSION)
 3520 fi
 3521 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
 3522 CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
 3523 ])dnl
 3524 dnl ---------------------------------------------------------------------------
 3525 dnl CF_GCC_WARNINGS version: 41 updated: 2021/01/01 16:53:59
 3526 dnl ---------------
 3527 dnl Check if the compiler supports useful warning options.  There's a few that
 3528 dnl we don't use, simply because they're too noisy:
 3529 dnl
 3530 dnl	-Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
 3531 dnl	-Winline (usually not worthwhile)
 3532 dnl	-Wredundant-decls (system headers make this too noisy)
 3533 dnl	-Wtraditional (combines too many unrelated messages, only a few useful)
 3534 dnl	-Wwrite-strings (too noisy, but should review occasionally).  This
 3535 dnl		is enabled for ncurses using "--enable-const".
 3536 dnl	-pedantic
 3537 dnl
 3538 dnl Parameter:
 3539 dnl	$1 is an optional list of gcc warning flags that a particular
 3540 dnl		application might want to use, e.g., "no-unused" for
 3541 dnl		-Wno-unused
 3542 dnl Special:
 3543 dnl	If $with_ext_const is "yes", add a check for -Wwrite-strings
 3544 dnl
 3545 AC_DEFUN([CF_GCC_WARNINGS],
 3546 [
 3547 AC_REQUIRE([CF_GCC_VERSION])
 3548 if test "x$have_x" = xyes; then CF_CONST_X_STRING fi
 3549 cat > "conftest.$ac_ext" <<EOF
 3550 #line __oline__ "${as_me:-configure}"
 3551 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
 3552 EOF
 3553 if test "$INTEL_COMPILER" = yes
 3554 then
 3555 # The "-wdXXX" options suppress warnings:
 3556 # remark #1419: external declaration in primary source file
 3557 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
 3558 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
 3559 # remark #193: zero used for undefined preprocessing identifier
 3560 # remark #593: variable "curs_sb_left_arrow" was set but never used
 3561 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
 3562 # remark #869: parameter "tw" was never referenced
 3563 # remark #981: operands are evaluated in unspecified order
 3564 # warning #279: controlling expression is constant
 3565 
 3566 	AC_CHECKING([for $CC warning options])
 3567 	cf_save_CFLAGS="$CFLAGS"
 3568 	EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
 3569 	for cf_opt in \
 3570 		wd1419 \
 3571 		wd1683 \
 3572 		wd1684 \
 3573 		wd193 \
 3574 		wd593 \
 3575 		wd279 \
 3576 		wd810 \
 3577 		wd869 \
 3578 		wd981
 3579 	do
 3580 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
 3581 		if AC_TRY_EVAL(ac_compile); then
 3582 			test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
 3583 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 3584 		fi
 3585 	done
 3586 	CFLAGS="$cf_save_CFLAGS"
 3587 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
 3588 then
 3589 	AC_CHECKING([for $CC warning options])
 3590 	cf_save_CFLAGS="$CFLAGS"
 3591 	cf_warn_CONST=""
 3592 	test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
 3593 	cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
 3594 	test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
 3595 	for cf_opt in W Wall \
 3596 		Wbad-function-cast \
 3597 		Wcast-align \
 3598 		Wcast-qual \
 3599 		Wdeclaration-after-statement \
 3600 		Wextra \
 3601 		Winline \
 3602 		Wmissing-declarations \
 3603 		Wmissing-prototypes \
 3604 		Wnested-externs \
 3605 		Wpointer-arith \
 3606 		Wshadow \
 3607 		Wstrict-prototypes \
 3608 		Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST $1
 3609 	do
 3610 		CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
 3611 		if AC_TRY_EVAL(ac_compile); then
 3612 			test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
 3613 			case "$cf_opt" in
 3614 			Winline)
 3615 				case "$GCC_VERSION" in
 3616 				[[34]].*)
 3617 					CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
 3618 					continue;;
 3619 				esac
 3620 				;;
 3621 			Wpointer-arith)
 3622 				case "$GCC_VERSION" in
 3623 				[[12]].*)
 3624 					CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
 3625 					continue;;
 3626 				esac
 3627 				;;
 3628 			esac
 3629 			EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
 3630 		fi
 3631 	done
 3632 	CFLAGS="$cf_save_CFLAGS"
 3633 fi
 3634 rm -rf ./conftest*
 3635 
 3636 AC_SUBST(EXTRA_CFLAGS)
 3637 ])dnl
 3638 dnl ---------------------------------------------------------------------------
 3639 dnl CF_GNU_SOURCE version: 10 updated: 2018/12/10 20:09:41
 3640 dnl -------------
 3641 dnl Check if we must define _GNU_SOURCE to get a reasonable value for
 3642 dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a defect
 3643 dnl (or misfeature) of glibc2, which breaks portability of many applications,
 3644 dnl since it is interwoven with GNU extensions.
 3645 dnl
 3646 dnl Well, yes we could work around it...
 3647 dnl
 3648 dnl Parameters:
 3649 dnl	$1 is the nominal value for _XOPEN_SOURCE
 3650 AC_DEFUN([CF_GNU_SOURCE],
 3651 [
 3652 cf_gnu_xopen_source=ifelse($1,,500,$1)
 3653 
 3654 AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[
 3655 AC_TRY_COMPILE([#include <sys/types.h>],[
 3656 	#if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
 3657 		return 0;
 3658 	#elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
 3659 		return 0;
 3660 	#else
 3661 	#	error not GNU C library
 3662 	#endif],
 3663 	[cf_cv_gnu_library=yes],
 3664 	[cf_cv_gnu_library=no])
 3665 ])
 3666 
 3667 if test x$cf_cv_gnu_library = xyes; then
 3668 
 3669 	# With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
 3670 	# was changed to help a little.  newlib incorporated the change about 4
 3671 	# years later.
 3672 	AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[
 3673 		cf_save="$CPPFLAGS"
 3674 		CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
 3675 		AC_TRY_COMPILE([#include <sys/types.h>],[
 3676 			#if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
 3677 				return 0;
 3678 			#elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
 3679 				return 0;
 3680 			#else
 3681 			#	error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
 3682 			#endif],
 3683 			[cf_cv_gnu_library_219=yes],
 3684 			[cf_cv_gnu_library_219=no])
 3685 		CPPFLAGS="$cf_save"
 3686 	])
 3687 
 3688 	if test "x$cf_cv_gnu_library_219" = xyes; then
 3689 		cf_save="$CPPFLAGS"
 3690 		AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[
 3691 			CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source)
 3692 			AC_TRY_COMPILE([
 3693 				#include <limits.h>
 3694 				#include <sys/types.h>
 3695 				],[
 3696 				#if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
 3697 					return 0;
 3698 				#else
 3699 				#	error GNU C library is too old
 3700 				#endif],
 3701 				[cf_cv_gnu_dftsrc_219=yes],
 3702 				[cf_cv_gnu_dftsrc_219=no])
 3703 			])
 3704 		test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
 3705 	else
 3706 		cf_cv_gnu_dftsrc_219=maybe
 3707 	fi
 3708 
 3709 	if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
 3710 
 3711 		AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
 3712 		AC_TRY_COMPILE([#include <sys/types.h>],[
 3713 			#ifndef _XOPEN_SOURCE
 3714 			#error	expected _XOPEN_SOURCE to be defined
 3715 			#endif],
 3716 			[cf_cv_gnu_source=no],
 3717 			[cf_save="$CPPFLAGS"
 3718 			 CF_ADD_CFLAGS(-D_GNU_SOURCE)
 3719 			 AC_TRY_COMPILE([#include <sys/types.h>],[
 3720 				#ifdef _XOPEN_SOURCE
 3721 				#error	expected _XOPEN_SOURCE to be undefined
 3722 				#endif],
 3723 				[cf_cv_gnu_source=no],
 3724 				[cf_cv_gnu_source=yes])
 3725 			CPPFLAGS="$cf_save"
 3726 			])
 3727 		])
 3728 
 3729 		if test "$cf_cv_gnu_source" = yes
 3730 		then
 3731 		AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[
 3732 			CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE)
 3733 			AC_TRY_COMPILE([#include <sys/types.h>],[
 3734 				#ifdef _DEFAULT_SOURCE
 3735 				#error	expected _DEFAULT_SOURCE to be undefined
 3736 				#endif],
 3737 				[cf_cv_default_source=no],
 3738 				[cf_cv_default_source=yes])
 3739 			])
 3740 			if test "$cf_cv_default_source" = yes
 3741 			then
 3742 				CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
 3743 			fi
 3744 		fi
 3745 	fi
 3746 
 3747 fi
 3748 ])dnl
 3749 dnl ---------------------------------------------------------------------------
 3750 dnl CF_HEADER_PATH version: 15 updated: 2021/01/01 13:31:04
 3751 dnl --------------
 3752 dnl Construct a search-list of directories for a nonstandard header-file
 3753 dnl
 3754 dnl Parameters
 3755 dnl	$1 = the variable to return as result
 3756 dnl	$2 = the package name
 3757 AC_DEFUN([CF_HEADER_PATH],
 3758 [
 3759 $1=
 3760 
 3761 # collect the current set of include-directories from compiler flags
 3762 cf_header_path_list=""
 3763 if test -n "${CFLAGS}${CPPFLAGS}" ; then
 3764 	for cf_header_path in $CPPFLAGS $CFLAGS
 3765 	do
 3766 		case "$cf_header_path" in
 3767 		-I*)
 3768 			cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
 3769 			CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
 3770 			cf_header_path_list="$cf_header_path_list [$]$1"
 3771 			;;
 3772 		esac
 3773 	done
 3774 fi
 3775 
 3776 # add the variations for the package we are looking for
 3777 CF_SUBDIR_PATH($1,$2,include)
 3778 
 3779 test "$includedir" != NONE && \
 3780 test "$includedir" != "/usr/include" && \
 3781 test -d "$includedir" && {
 3782 	test -d "$includedir" &&    $1="[$]$1 $includedir"
 3783 	test -d "$includedir/$2" && $1="[$]$1 $includedir/$2"
 3784 }
 3785 
 3786 test "$oldincludedir" != NONE && \
 3787 test "$oldincludedir" != "/usr/include" && \
 3788 test -d "$oldincludedir" && {
 3789 	test -d "$oldincludedir"    && $1="[$]$1 $oldincludedir"
 3790 	test -d "$oldincludedir/$2" && $1="[$]$1 $oldincludedir/$2"
 3791 }
 3792 
 3793 $1="[$]$1 $cf_header_path_list"
 3794 ])dnl
 3795 dnl ---------------------------------------------------------------------------
 3796 dnl CF_INTEL_COMPILER version: 8 updated: 2021/01/01 16:53:59
 3797 dnl -----------------
 3798 dnl Check if the given compiler is really the Intel compiler for Linux.  It
 3799 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
 3800 dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
 3801 dnl
 3802 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
 3803 dnl ensure that it is not mistaken for gcc/g++.  It is normally invoked from
 3804 dnl the wrappers for gcc and g++ warnings.
 3805 dnl
 3806 dnl $1 = GCC (default) or GXX
 3807 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
 3808 dnl $3 = CFLAGS (default) or CXXFLAGS
 3809 AC_DEFUN([CF_INTEL_COMPILER],[
 3810 AC_REQUIRE([AC_CANONICAL_HOST])
 3811 ifelse([$2],,INTEL_COMPILER,[$2])=no
 3812 
 3813 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
 3814 	case "$host_os" in
 3815 	linux*|gnu*)
 3816 		AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
 3817 		cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
 3818 		ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
 3819 		AC_TRY_COMPILE([],[
 3820 #ifdef __INTEL_COMPILER
 3821 #else
 3822 make an error
 3823 #endif
 3824 ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
 3825 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
 3826 ],[])
 3827 		ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
 3828 		AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
 3829 		;;
 3830 	esac
 3831 fi
 3832 ])dnl
 3833 dnl ---------------------------------------------------------------------------
 3834 dnl CF_LIBRARY_PATH version: 11 updated: 2021/01/01 13:31:04
 3835 dnl ---------------
 3836 dnl Construct a search-list of directories for a nonstandard library-file
 3837 dnl
 3838 dnl Parameters
 3839 dnl	$1 = the variable to return as result
 3840 dnl	$2 = the package name
 3841 AC_DEFUN([CF_LIBRARY_PATH],
 3842 [
 3843 $1=
 3844 cf_library_path_list=""
 3845 if test -n "${LDFLAGS}${LIBS}" ; then
 3846 	for cf_library_path in $LDFLAGS $LIBS
 3847 	do
 3848 		case "$cf_library_path" in
 3849 		-L*)
 3850 			cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
 3851 			CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
 3852 			cf_library_path_list="$cf_library_path_list [$]$1"
 3853 			;;
 3854 		esac
 3855 	done
 3856 fi
 3857 
 3858 CF_SUBDIR_PATH($1,$2,lib)
 3859 
 3860 $1="$cf_library_path_list [$]$1"
 3861 ])dnl
 3862 dnl ---------------------------------------------------------------------------
 3863 dnl CF_LIB_PREFIX version: 14 updated: 2021/01/01 13:31:04
 3864 dnl -------------
 3865 dnl Compute the library-prefix for the given host system
 3866 dnl $1 = variable to set
 3867 define([CF_LIB_PREFIX],
 3868 [
 3869 	case "$cf_cv_system_name" in
 3870 	OS/2*|os2*)
 3871 		if test "$DFT_LWR_MODEL" = libtool; then
 3872 			LIB_PREFIX='lib'
 3873 		else
 3874 			LIB_PREFIX=''
 3875 		fi
 3876 		;;
 3877 	*-msvc*)
 3878 		LIB_PREFIX=''
 3879 		;;
 3880 	*)	LIB_PREFIX='lib'
 3881 		;;
 3882 	esac
 3883 ifelse($1,,,[$1=$LIB_PREFIX])
 3884 	AC_SUBST(LIB_PREFIX)
 3885 ])dnl
 3886 dnl ---------------------------------------------------------------------------
 3887 dnl CF_LOCKFILE version: 2 updated: 2001/05/26 12:41:02
 3888 dnl -----------
 3889 dnl Check for functions that we can use for file-locking.  Simply checking for
 3890 dnl existence is not sufficient, since fcntl, for example, uses definitions
 3891 dnl that are not in every version of the header.
 3892 AC_DEFUN([CF_LOCKFILE],
 3893 [
 3894 AC_CHECK_HEADERS(unistd.h fcntl.h sys/file.h)
 3895 AC_CHECK_FUNC(fcntl)
 3896 AC_CHECK_FUNC(lockf)
 3897 AC_CHECK_FUNC(flock,,,[
 3898 	CF_RECHECK_FUNC(flock,bsd,cf_cv_lockfile,[AC_MSG_WARN(no lock function found)])])
 3899 
 3900 AC_CACHE_CHECK(for file-locking functions,cf_cv_lockfile,[
 3901 cf_cv_lockfile=
 3902 for cf_lock in fcntl lockf flock
 3903 do
 3904 if eval 'test ${ac_cv_func_'$cf_lock'+set} = set'; then
 3905 	case $cf_lock in #(vi
 3906 	fcntl) #(vi
 3907 		AC_TRY_COMPILE([
 3908 #include <stdio.h>
 3909 #ifdef HAVE_UNISTD_H
 3910 #include <unistd.h>
 3911 #endif
 3912 #ifdef HAVE_FCNTL_H
 3913 #include <fcntl.h>
 3914 #endif
 3915 ],[
 3916 	struct flock flk;
 3917 	int block = 1;
 3918 	int fd = 0;
 3919 	int rc;
 3920 
 3921 	flk.l_type = F_WRLCK;
 3922 	flk.l_whence = SEEK_SET;
 3923 	flk.l_start = 0;
 3924 	flk.l_len = 0;
 3925 	rc = fcntl(fd, block ? F_SETLKW : F_SETLK, &flk)
 3926 	&& fcntl(fd, F_GETLK, &flk)
 3927 	&& fcntl(fd, F_SETLK, &flk);
 3928 	],,continue)
 3929 		;;
 3930 	lockf) #(vi
 3931 		AC_TRY_COMPILE([
 3932 #include <stdio.h>
 3933 #ifdef HAVE_UNISTD_H
 3934 #include <unistd.h>
 3935 #endif
 3936 #ifdef HAVE_FCNTL_H
 3937 #include <fcntl.h>
 3938 #endif
 3939 ],[
 3940 	int block = 1, fd = 0;
 3941 	int ret = lockf(fd, block ? F_LOCK : F_TLOCK, 0L)
 3942 	 && lockf(fd, F_TEST, 0L)
 3943 	 && lockf(fd, F_ULOCK, 0L);
 3944 	],,[continue])
 3945 		;;
 3946 	flock)
 3947 		AC_TRY_COMPILE([
 3948 #include <stdio.h>
 3949 #ifdef HAVE_UNISTD_H
 3950 #include <unistd.h>
 3951 #endif
 3952 #ifdef HAVE_FCNTL_H
 3953 #include <fcntl.h>
 3954 #endif
 3955 #ifdef HAVE_SYS_FILE_H
 3956 #include <sys/file.h>
 3957 #endif
 3958 ],[
 3959 	int block = 1, fd = 0;
 3960 	int ret = flock(fd, (LOCK_EX|LOCK_NB))
 3961 	 && flock(fd, LOCK_UN)
 3962 	 && flock(fd, block ? LOCK_EX : (LOCK_EX | LOCK_NB));
 3963 	],,[continue])
 3964 		;;
 3965 	esac
 3966 	cf_cv_lockfile="$cf_cv_lockfile $cf_lock"
 3967 fi
 3968 done
 3969 ])
 3970 ])dnl
 3971 dnl ---------------------------------------------------------------------------
 3972 dnl CF_MAKEFLAGS version: 21 updated: 2021/09/04 06:47:34
 3973 dnl ------------
 3974 dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
 3975 dnl options to lower-levels.  It is very useful for "make -n" -- if we have it.
 3976 dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
 3977 dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
 3978 AC_DEFUN([CF_MAKEFLAGS],
 3979 [AC_REQUIRE([AC_PROG_FGREP])dnl
 3980 
 3981 AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
 3982 	cf_cv_makeflags=''
 3983 	for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
 3984 	do
 3985 		cat >cf_makeflags.tmp <<CF_EOF
 3986 SHELL = $SHELL
 3987 all :
 3988 	@ echo '.$cf_option'
 3989 CF_EOF
 3990 		cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[[ 	]]*$,,'`
 3991 		case "$cf_result" in
 3992 		.*k|.*kw)
 3993 			cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`"
 3994 			case "$cf_result" in
 3995 			.*CC=*)	cf_cv_makeflags=
 3996 				;;
 3997 			*)	cf_cv_makeflags=$cf_option
 3998 				;;
 3999 			esac
 4000 			break
 4001 			;;
 4002 		.-)
 4003 			;;
 4004 		*)
 4005 			CF_MSG_LOG(given option \"$cf_option\", no match \"$cf_result\")
 4006 			;;
 4007 		esac
 4008 	done
 4009 	rm -f cf_makeflags.tmp
 4010 ])
 4011 
 4012 AC_SUBST(cf_cv_makeflags)
 4013 ])dnl
 4014 dnl ---------------------------------------------------------------------------
 4015 dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
 4016 dnl ----------
 4017 dnl Write a debug message to config.log, along with the line number in the
 4018 dnl configure script.
 4019 AC_DEFUN([CF_MSG_LOG],[
 4020 echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
 4021 ])dnl
 4022 dnl ---------------------------------------------------------------------------
 4023 dnl CF_NCURSES_BROKEN version: 8 updated: 2012/11/08 20:57:52
 4024 dnl -----------------
 4025 dnl Check for pre-1.9.9g ncurses (among other problems, the most obvious is
 4026 dnl that color combinations don't work).
 4027 AC_DEFUN([CF_NCURSES_BROKEN],
 4028 [
 4029 AC_REQUIRE([CF_NCURSES_VERSION])
 4030 if test "$cf_cv_ncurses_version" != no ; then
 4031 AC_MSG_CHECKING(for obsolete/broken version of ncurses)
 4032 AC_CACHE_VAL(cf_cv_ncurses_broken,[
 4033 AC_TRY_COMPILE([
 4034 #include <${cf_cv_ncurses_header:-curses.h}>],[
 4035 #if defined(NCURSES_VERSION) && defined(wgetbkgd)
 4036 	make an error
 4037 #else
 4038 	int x = 1
 4039 #endif
 4040 ],
 4041 	[cf_cv_ncurses_broken=no],
 4042 	[cf_cv_ncurses_broken=yes])
 4043 ])
 4044 AC_MSG_RESULT($cf_cv_ncurses_broken)
 4045 if test "$cf_cv_ncurses_broken" = yes ; then
 4046 	AC_MSG_WARN(hmm... you should get an up-to-date version of ncurses)
 4047 	AC_DEFINE(NCURSES_BROKEN,1,[Define to 1 if you have an obsolete version of ncurses])
 4048 fi
 4049 fi
 4050 ])dnl
 4051 dnl ---------------------------------------------------------------------------
 4052 dnl CF_NCURSES_CC_CHECK version: 5 updated: 2020/12/31 20:19:42
 4053 dnl -------------------
 4054 dnl Check if we can compile with ncurses' header file
 4055 dnl $1 is the cache variable to set
 4056 dnl $2 is the header-file to include
 4057 dnl $3 is the root name (ncurses or ncursesw)
 4058 AC_DEFUN([CF_NCURSES_CC_CHECK],[
 4059 	AC_TRY_COMPILE([
 4060 ]ifelse($3,ncursesw,[
 4061 #define _XOPEN_SOURCE_EXTENDED
 4062 #undef  HAVE_LIBUTF8_H	/* in case we used CF_UTF8_LIB */
 4063 #define HAVE_LIBUTF8_H	/* to force ncurses' header file to use cchar_t */
 4064 ])[
 4065 #include <$2>],[
 4066 #ifdef NCURSES_VERSION
 4067 ]ifelse($3,ncursesw,[
 4068 #ifndef WACS_BSSB
 4069 	make an error
 4070 #endif
 4071 ])[
 4072 printf("%s\\n", NCURSES_VERSION);
 4073 #else
 4074 #ifdef __NCURSES_H
 4075 printf("old\\n");
 4076 #else
 4077 	make an error
 4078 #endif
 4079 #endif
 4080 	]
 4081 	,[$1=$2]
 4082 	,[$1=no])
 4083 ])dnl
 4084 dnl ---------------------------------------------------------------------------
 4085 dnl CF_NCURSES_CONFIG version: 28 updated: 2021/08/28 15:20:37
 4086 dnl -----------------
 4087 dnl Tie together the configure-script macros for ncurses, preferring these in
 4088 dnl order:
 4089 dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG
 4090 dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG
 4091 dnl c) just plain libraries
 4092 dnl
 4093 dnl $1 is the root library name (default: "ncurses")
 4094 AC_DEFUN([CF_NCURSES_CONFIG],[
 4095 AC_REQUIRE([CF_PKG_CONFIG])
 4096 cf_ncuconfig_root=ifelse($1,,ncurses,$1)
 4097 cf_have_ncuconfig=no
 4098 
 4099 if test "x${PKG_CONFIG:=none}" != xnone; then
 4100 	AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root)
 4101 	if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
 4102 		AC_MSG_RESULT(yes)
 4103 
 4104 		AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work)
 4105 		cf_have_ncuconfig=unknown
 4106 
 4107 		cf_save_CFLAGS="$CFLAGS"
 4108 		cf_save_CPPFLAGS="$CPPFLAGS"
 4109 		cf_save_LIBS="$LIBS"
 4110 
 4111 		cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`"
 4112 		cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
 4113 
 4114 		# while -W for passing linker flags is prevalent, it is not "standard".
 4115 		# At least one wrapper for c89/c99 (in Apple's xcode) has its own
 4116 		# incompatible _and_ non-standard -W option which gives an error.  Work
 4117 		# around that pitfall.
 4118 		case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
 4119 		x*c[[89]]9@@*-W*)
 4120 			CF_ADD_CFLAGS($cf_pkg_cflags)
 4121 			CF_ADD_LIBS($cf_pkg_libs)
 4122 
 4123 			AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 4124 				[initscr(); mousemask(0,0); tigetstr((char *)0);],
 4125 				[AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
 4126 					int main(void)
 4127 					{ const char *xx = curses_version(); return (xx == 0); }],
 4128 					[cf_test_ncuconfig=yes],
 4129 					[cf_test_ncuconfig=no],
 4130 					[cf_test_ncuconfig=maybe])],
 4131 				[cf_test_ncuconfig=no])
 4132 
 4133 			CFLAGS="$cf_save_CFLAGS"
 4134 			CPPFLAGS="$cf_save_CPPFLAGS"
 4135 			LIBS="$cf_save_LIBS"
 4136 
 4137 			if test "x$cf_test_ncuconfig" != xyes; then
 4138 				cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[[^ 	]]*//g'`
 4139 				cf_pkg_cflags="$cf_temp"
 4140 				cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[[^ 	]]*//g'`
 4141 				cf_pkg_libs="$cf_temp"
 4142 			fi
 4143 			;;
 4144 		esac
 4145 
 4146 		CF_APPEND_CFLAGS($cf_pkg_cflags)
 4147 		CF_ADD_LIBS($cf_pkg_libs)
 4148 
 4149 		AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 4150 			[initscr(); mousemask(0,0); tigetstr((char *)0);],
 4151 			[AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
 4152 				int main(void)
 4153 				{ const char *xx = curses_version(); return (xx == 0); }],
 4154 				[cf_have_ncuconfig=yes],
 4155 				[cf_have_ncuconfig=no],
 4156 				[cf_have_ncuconfig=maybe])],
 4157 			[cf_have_ncuconfig=no])
 4158 		AC_MSG_RESULT($cf_have_ncuconfig)
 4159 		test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
 4160 		if test "$cf_have_ncuconfig" != "yes"
 4161 		then
 4162 			CPPFLAGS="$cf_save_CPPFLAGS"
 4163 			LIBS="$cf_save_LIBS"
 4164 			NCURSES_CONFIG_PKG=none
 4165 		else
 4166 			AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
 4167 			NCURSES_CONFIG_PKG=$cf_ncuconfig_root
 4168 			CF_TERM_HEADER
 4169 		fi
 4170 
 4171 	else
 4172 		AC_MSG_RESULT(no)
 4173 		NCURSES_CONFIG_PKG=none
 4174 	fi
 4175 else
 4176 	NCURSES_CONFIG_PKG=none
 4177 fi
 4178 
 4179 if test "x$cf_have_ncuconfig" = "xno"; then
 4180 	cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
 4181 
 4182 	CF_ACVERSION_CHECK(2.52,
 4183 		[AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
 4184 		[AC_PATH_PROGS(NCURSES_CONFIG,  ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
 4185 
 4186 	if test "$NCURSES_CONFIG" != none ; then
 4187 
 4188 		CF_APPEND_CFLAGS(`$NCURSES_CONFIG --cflags`)
 4189 		CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
 4190 
 4191 		# even with config script, some packages use no-override for curses.h
 4192 		CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
 4193 
 4194 		dnl like CF_NCURSES_CPPFLAGS
 4195 		AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
 4196 
 4197 		dnl like CF_NCURSES_LIBS
 4198 		CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
 4199 		AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
 4200 
 4201 		dnl like CF_NCURSES_VERSION
 4202 		cf_cv_ncurses_version="`$NCURSES_CONFIG --version`"
 4203 
 4204 	else
 4205 
 4206 		CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
 4207 		CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
 4208 
 4209 	fi
 4210 else
 4211 	NCURSES_CONFIG=none
 4212 fi
 4213 ])dnl
 4214 dnl ---------------------------------------------------------------------------
 4215 dnl CF_NCURSES_CPPFLAGS version: 22 updated: 2021/01/02 09:31:20
 4216 dnl -------------------
 4217 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
 4218 dnl the CPPFLAGS variable so we can include its header.
 4219 dnl
 4220 dnl The header files may be installed as either curses.h, or ncurses.h (would
 4221 dnl be obsolete, except that some packagers prefer this name to distinguish it
 4222 dnl from a "native" curses implementation).  If not installed for overwrite,
 4223 dnl the curses.h file would be in an ncurses subdirectory (e.g.,
 4224 dnl /usr/include/ncurses), but someone may have installed overwriting the
 4225 dnl vendor's curses.  Only very old versions (pre-1.9.2d, the first autoconf'd
 4226 dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
 4227 dnl the header.
 4228 dnl
 4229 dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
 4230 dnl is already in the include-path, don't even bother with this, since we cannot
 4231 dnl easily determine which file it is.  In this case, it has to be <curses.h>.
 4232 dnl
 4233 dnl The optional parameter gives the root name of the library, in case it is
 4234 dnl not installed as the default curses library.  That is how the
 4235 dnl wide-character version of ncurses is installed.
 4236 AC_DEFUN([CF_NCURSES_CPPFLAGS],
 4237 [AC_REQUIRE([CF_WITH_CURSES_DIR])
 4238 
 4239 AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
 4240 cf_ncuhdr_root=ifelse($1,,ncurses,$1)
 4241 
 4242 test -n "$cf_cv_curses_dir" && \
 4243 test "$cf_cv_curses_dir" != "no" && { \
 4244   CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root)
 4245 }
 4246 
 4247 AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
 4248 	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
 4249 	{ test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h"
 4250 	for cf_header in $cf_header_list
 4251 	do
 4252 		CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
 4253 		test "$cf_cv_ncurses_h" != no && break
 4254 	done
 4255 ])
 4256 
 4257 CF_NCURSES_HEADER
 4258 CF_TERM_HEADER
 4259 
 4260 # some applications need this, but should check for NCURSES_VERSION
 4261 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
 4262 
 4263 CF_NCURSES_VERSION
 4264 ])dnl
 4265 dnl ---------------------------------------------------------------------------
 4266 dnl CF_NCURSES_HEADER version: 7 updated: 2021/01/04 19:33:05
 4267 dnl -----------------
 4268 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
 4269 dnl variations of ncurses' installs.
 4270 dnl
 4271 dnl See also CF_CURSES_HEADER, which sets the same cache variable.
 4272 AC_DEFUN([CF_NCURSES_HEADER],[
 4273 
 4274 if test "$cf_cv_ncurses_h" != no ; then
 4275 	cf_cv_ncurses_header=$cf_cv_ncurses_h
 4276 else
 4277 
 4278 AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
 4279 	test -n "$verbose" && echo
 4280 	CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
 4281 	test -n "$verbose" && echo "search path $cf_search"
 4282 	cf_save2_CPPFLAGS="$CPPFLAGS"
 4283 	for cf_incdir in $cf_search
 4284 	do
 4285 		CF_ADD_INCDIR($cf_incdir)
 4286 		for cf_header in \
 4287 			ncurses.h \
 4288 			curses.h
 4289 		do
 4290 			CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
 4291 			if test "$cf_cv_ncurses_h2" != no ; then
 4292 				cf_cv_ncurses_h2=$cf_incdir/$cf_header
 4293 				test -n "$verbose" && echo $ECHO_N "	... found $ECHO_C" 1>&AC_FD_MSG
 4294 				break
 4295 			fi
 4296 			test -n "$verbose" && echo "	... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
 4297 		done
 4298 		CPPFLAGS="$cf_save2_CPPFLAGS"
 4299 		test "$cf_cv_ncurses_h2" != no && break
 4300 	done
 4301 	test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
 4302 	])
 4303 
 4304 	CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
 4305 	cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`"
 4306 	if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then
 4307 		cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header"
 4308 	fi
 4309 	CF_ADD_INCDIR($cf_1st_incdir)
 4310 
 4311 fi
 4312 
 4313 # Set definitions to allow ifdef'ing for ncurses.h
 4314 
 4315 case "$cf_cv_ncurses_header" in
 4316 *ncurses.h)
 4317 	AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
 4318 	;;
 4319 esac
 4320 
 4321 case "$cf_cv_ncurses_header" in
 4322 ncurses/curses.h|ncurses/ncurses.h)
 4323 	AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
 4324 	;;
 4325 ncursesw/curses.h|ncursesw/ncurses.h)
 4326 	AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
 4327 	;;
 4328 esac
 4329 
 4330 ])dnl
 4331 dnl ---------------------------------------------------------------------------
 4332 dnl CF_NCURSES_LIBS version: 21 updated: 2021/09/04 06:37:12
 4333 dnl ---------------
 4334 dnl Look for the ncurses library.  This is a little complicated on Linux,
 4335 dnl because it may be linked with the gpm (general purpose mouse) library.
 4336 dnl Some distributions have gpm linked with (bsd) curses, which makes it
 4337 dnl unusable with ncurses.  However, we don't want to link with gpm unless
 4338 dnl ncurses has a dependency, since gpm is normally set up as a shared library,
 4339 dnl and the linker will record a dependency.
 4340 dnl
 4341 dnl The optional parameter gives the root name of the library, in case it is
 4342 dnl not installed as the default curses library.  That is how the
 4343 dnl wide-character version of ncurses is installed.
 4344 AC_DEFUN([CF_NCURSES_LIBS],
 4345 [AC_REQUIRE([CF_NCURSES_CPPFLAGS])
 4346 
 4347 cf_nculib_root=ifelse($1,,ncurses,$1)
 4348 	# This works, except for the special case where we find gpm, but
 4349 	# ncurses is in a nonstandard location via $LIBS, and we really want
 4350 	# to link gpm.
 4351 cf_ncurses_LIBS=""
 4352 cf_ncurses_SAVE="$LIBS"
 4353 AC_CHECK_LIB(gpm,Gpm_Open,
 4354 	[AC_CHECK_LIB(gpm,initscr,
 4355 		[LIBS="$cf_ncurses_SAVE"],
 4356 		[cf_ncurses_LIBS="-lgpm"])])
 4357 
 4358 case "$host_os" in
 4359 freebsd*)
 4360 	# This is only necessary if you are linking against an obsolete
 4361 	# version of ncurses (but it should do no harm, since it is static).
 4362 	if test "$cf_nculib_root" = ncurses ; then
 4363 		AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
 4364 	fi
 4365 	;;
 4366 esac
 4367 
 4368 CF_ADD_LIBS($cf_ncurses_LIBS)
 4369 
 4370 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
 4371 then
 4372 	CF_ADD_LIBS(-l$cf_nculib_root)
 4373 else
 4374 	CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
 4375 		[#include <${cf_cv_ncurses_header:-curses.h}>],
 4376 		[initscr()],
 4377 		initscr)
 4378 fi
 4379 
 4380 if test -n "$cf_ncurses_LIBS" ; then
 4381 	AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
 4382 	cf_ncurses_SAVE="$LIBS"
 4383 	for p in $cf_ncurses_LIBS ; do
 4384 		q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"`
 4385 		if test "$q" != "$LIBS" ; then
 4386 			LIBS="$q"
 4387 		fi
 4388 	done
 4389 	AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
 4390 		[initscr(); mousemask(0,0); tigetstr((char *)0);],
 4391 		[AC_MSG_RESULT(yes)],
 4392 		[AC_MSG_RESULT(no)
 4393 		 LIBS="$cf_ncurses_SAVE"])
 4394 fi
 4395 
 4396 CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
 4397 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
 4398 ])dnl
 4399 dnl ---------------------------------------------------------------------------
 4400 dnl CF_NCURSES_VERSION version: 16 updated: 2020/12/31 20:19:42
 4401 dnl ------------------
 4402 dnl Check for the version of ncurses, to aid in reporting bugs, etc.
 4403 dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS.  We don't use
 4404 dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
 4405 AC_DEFUN([CF_NCURSES_VERSION],
 4406 [
 4407 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 4408 AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
 4409 	cf_cv_ncurses_version=no
 4410 	cf_tempfile=out$$
 4411 	rm -f "$cf_tempfile"
 4412 	AC_TRY_RUN([
 4413 #include <${cf_cv_ncurses_header:-curses.h}>
 4414 #include <stdio.h>
 4415 int main(void)
 4416 {
 4417 	FILE *fp = fopen("$cf_tempfile", "w");
 4418 #ifdef NCURSES_VERSION
 4419 # ifdef NCURSES_VERSION_PATCH
 4420 	fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
 4421 # else
 4422 	fprintf(fp, "%s\\n", NCURSES_VERSION);
 4423 # endif
 4424 #else
 4425 # ifdef __NCURSES_H
 4426 	fprintf(fp, "old\\n");
 4427 # else
 4428 	make an error
 4429 # endif
 4430 #endif
 4431 	${cf_cv_main_return:-return}(0);
 4432 }],[
 4433 	cf_cv_ncurses_version=`cat $cf_tempfile`],,[
 4434 
 4435 	# This will not work if the preprocessor splits the line after the
 4436 	# Autoconf token.  The 'unproto' program does that.
 4437 	cat > "conftest.$ac_ext" <<EOF
 4438 #include <${cf_cv_ncurses_header:-curses.h}>
 4439 #undef Autoconf
 4440 #ifdef NCURSES_VERSION
 4441 Autoconf NCURSES_VERSION
 4442 #else
 4443 #ifdef __NCURSES_H
 4444 Autoconf "old"
 4445 #endif
 4446 ;
 4447 #endif
 4448 EOF
 4449 	cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
 4450 	AC_TRY_EVAL(cf_try)
 4451 	if test -f conftest.out ; then
 4452 		cf_out=`sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%' conftest.out`
 4453 		test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
 4454 		rm -f conftest.out
 4455 	fi
 4456 ])
 4457 	rm -f "$cf_tempfile"
 4458 ])
 4459 test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
 4460 ])dnl
 4461 dnl ---------------------------------------------------------------------------
 4462 dnl CF_NETLIBS version: 12 updated: 2021/01/02 09:31:20
 4463 dnl ----------
 4464 dnl After checking for functions in the default $LIBS, make a further check
 4465 dnl for the functions that are netlib-related (these aren't always in the
 4466 dnl libc, etc., and have to be handled specially because there are conflicting
 4467 dnl and broken implementations.
 4468 dnl Common library requirements (in order):
 4469 dnl	-lresolv -lsocket -lnsl
 4470 dnl	-lnsl -lsocket
 4471 dnl	-lsocket
 4472 dnl	-lbsd
 4473 dnl	-lnetwork
 4474 AC_DEFUN([CF_NETLIBS],[
 4475 cf_test_netlibs=no
 4476 
 4477 AC_MSG_CHECKING(for network libraries)
 4478 
 4479 AC_CACHE_VAL(cf_cv_netlibs,[
 4480 AC_MSG_RESULT(working...)
 4481 
 4482 cf_cv_netlibs=""
 4483 cf_test_netlibs=yes
 4484 
 4485 case "$host_os" in
 4486 mingw*)
 4487 	AC_CHECK_HEADERS( windows.h winsock.h winsock2.h )
 4488 
 4489 	if test "$ac_cv_header_winsock2_h" = "yes" ; then
 4490 		cf_winsock_lib="-lws2_32"
 4491 	elif test "$ac_cv_header_winsock_h" = "yes" ; then
 4492 		cf_winsock_lib="-lwsock32"
 4493 	fi
 4494 
 4495 	cf_save_LIBS="$LIBS"
 4496 	CF_ADD_LIBS($cf_winsock_lib)
 4497 
 4498 	AC_TRY_LINK([
 4499 #ifdef HAVE_WINDOWS_H
 4500 #undef WIN32_LEAN_AND_MEAN
 4501 #define WIN32_LEAN_AND_MEAN
 4502 #include <windows.h>
 4503 #ifdef HAVE_WINSOCK2_H
 4504 #include <winsock2.h>
 4505 #else
 4506 #ifdef HAVE_WINSOCK_H
 4507 #include <winsock.h>
 4508 #endif
 4509 #endif
 4510 #endif
 4511 ],[
 4512 	char buffer[1024];
 4513 	gethostname(buffer, sizeof(buffer));],
 4514 	[cf_cv_netlibs="$cf_winsock_lib $cf_cv_netlibs"],
 4515 	[AC_MSG_ERROR(Cannot link against winsock library)])
 4516 
 4517 	LIBS="$cf_save_LIBS"
 4518 	;;
 4519 *)
 4520 	AC_CHECK_FUNCS(gethostname,,[
 4521 		CF_RECHECK_FUNC(gethostname,nsl,cf_cv_netlibs,[
 4522 			CF_RECHECK_FUNC(gethostname,socket,cf_cv_netlibs)])])
 4523 
 4524 	AC_CHECK_LIB(inet, main, cf_cv_netlibs="-linet $cf_cv_netlibs")
 4525 
 4526 	if test "$ac_cv_func_lsocket" != no ; then
 4527 	AC_CHECK_FUNCS(socket,,[
 4528 		CF_RECHECK_FUNC(socket,socket,cf_cv_netlibs,[
 4529 			CF_RECHECK_FUNC(socket,bsd,cf_cv_netlibs)])])
 4530 	fi
 4531 
 4532 	AC_CHECK_FUNCS(gethostbyname,,[
 4533 		CF_RECHECK_FUNC(gethostbyname,nsl,cf_cv_netlibs)])
 4534 
 4535 	AC_CHECK_FUNCS(inet_ntoa,,[
 4536 		CF_RECHECK_FUNC(inet_ntoa,nsl,cf_cv_netlibs)])
 4537 
 4538 	AC_CHECK_FUNCS(gethostbyname,,[
 4539 		CF_RECHECK_FUNC(gethostbyname,network,cf_cv_netlibs)])
 4540 
 4541 	AC_CHECK_FUNCS(strcasecmp,,[
 4542 		CF_RECHECK_FUNC(strcasecmp,resolv,cf_cv_netlibs)])
 4543 	;;
 4544 esac
 4545 ])
 4546 
 4547 case "$cf_cv_netlibs" in
 4548 *ws2_32*)
 4549 	AC_DEFINE(USE_WINSOCK2_H,1,[Define to 1 if we should include winsock2.h])
 4550 	;;
 4551 esac
 4552 
 4553 CF_ADD_LIBS($cf_cv_netlibs)
 4554 test "$cf_test_netlibs" = no && echo "$cf_cv_netlibs" >&AC_FD_MSG
 4555 ])dnl
 4556 dnl ---------------------------------------------------------------------------
 4557 dnl CF_NO_LEAKS_OPTION version: 9 updated: 2021/06/13 19:45:41
 4558 dnl ------------------
 4559 dnl see CF_WITH_NO_LEAKS
 4560 dnl
 4561 dnl $1 = option/name
 4562 dnl $2 = help-text
 4563 dnl $3 = symbol to define if the option is set
 4564 dnl $4 = additional actions to take if the option is set
 4565 AC_DEFUN([CF_NO_LEAKS_OPTION],[
 4566 AC_MSG_CHECKING(if you want to use $1 for testing)
 4567 AC_ARG_WITH($1,
 4568 	[$2],
 4569 	[case "x$withval" in
 4570 	x|xno) ;;
 4571 	*)
 4572 		: "${with_cflags:=-g}"
 4573 		: "${enable_leaks:=no}"
 4574 		with_$1=yes
 4575 		AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
 4576 	 $4
 4577 ])
 4578 		;;
 4579 	esac],
 4580 	[with_$1=])
 4581 AC_MSG_RESULT(${with_$1:-no})
 4582 
 4583 case ".$with_cflags" in
 4584 .*-g*)
 4585 	case .$CFLAGS in
 4586 	.*-g*)
 4587 		;;
 4588 	*)
 4589 		CF_ADD_CFLAGS([-g])
 4590 		;;
 4591 	esac
 4592 	;;
 4593 esac
 4594 ])dnl
 4595 dnl ---------------------------------------------------------------------------
 4596 dnl CF_OUR_MESSAGES version: 8 updated: 2021/01/02 09:31:20
 4597 dnl ---------------
 4598 dnl Check if we use the messages included with this program
 4599 dnl
 4600 dnl $1 specifies either Makefile or makefile, defaulting to the former.
 4601 dnl
 4602 dnl Sets variables which can be used to substitute in makefiles:
 4603 dnl	MSG_DIR_MAKE - to make ./po directory
 4604 dnl	SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL)
 4605 dnl
 4606 AC_DEFUN([CF_OUR_MESSAGES],
 4607 [
 4608 cf_makefile=ifelse($1,,Makefile,$1)
 4609 
 4610 use_our_messages=no
 4611 if test "$USE_NLS" = yes ; then
 4612 if test -d "$srcdir/po" ; then
 4613 AC_MSG_CHECKING(if we should use included message-library)
 4614 	AC_ARG_ENABLE(included-msgs,
 4615 	[  --disable-included-msgs use included messages, for i18n support],
 4616 	[use_our_messages=$enableval],
 4617 	[use_our_messages=yes])
 4618 fi
 4619 AC_MSG_RESULT($use_our_messages)
 4620 fi
 4621 
 4622 MSG_DIR_MAKE="#"
 4623 if test "$use_our_messages" = yes
 4624 then
 4625 	SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn"
 4626 	MSG_DIR_MAKE=
 4627 fi
 4628 
 4629 AC_SUBST(MSG_DIR_MAKE)
 4630 AC_SUBST(SUB_MAKEFILE)
 4631 ])dnl
 4632 dnl ---------------------------------------------------------------------------
 4633 dnl CF_PATHSEP version: 8 updated: 2021/01/01 13:31:04
 4634 dnl ----------
 4635 dnl Provide a value for the $PATH and similar separator (or amend the value
 4636 dnl as provided in autoconf 2.5x).
 4637 AC_DEFUN([CF_PATHSEP],
 4638 [
 4639 	AC_MSG_CHECKING(for PATH separator)
 4640 	case "$cf_cv_system_name" in
 4641 	os2*)	PATH_SEPARATOR=';'  ;;
 4642 	*)	${PATH_SEPARATOR:=':'}  ;;
 4643 	esac
 4644 ifelse([$1],,,[$1=$PATH_SEPARATOR])
 4645 	AC_SUBST(PATH_SEPARATOR)
 4646 	AC_MSG_RESULT($PATH_SEPARATOR)
 4647 ])dnl
 4648 dnl ---------------------------------------------------------------------------
 4649 dnl CF_PATH_EDITOR version: 6 updated: 2019/12/31 20:39:42
 4650 dnl --------------
 4651 dnl Look for the default editor (vi)
 4652 AC_DEFUN([CF_PATH_EDITOR],
 4653 [
 4654 AC_MSG_CHECKING(for default editor)
 4655 CF_ARG_WITH(editor,
 4656     [  --with-editor=PROG      specify editor],
 4657     [DEFAULT_EDITOR],,vi)
 4658 if test -z "$DEFAULT_EDITOR" ; then
 4659     if test -n "$EDITOR" ; then
 4660     	DEFAULT_EDITOR="$EDITOR"
 4661     elif test -n "$VISUAL" ; then
 4662     	DEFAULT_EDITOR="$VISUAL"
 4663     else
 4664 	AC_PATH_PROG(DEFAULT_EDITOR,vi,vi,$PATH:/usr/bin:/usr/ucb)
 4665     fi
 4666 fi
 4667 AC_MSG_RESULT($DEFAULT_EDITOR)
 4668 AC_DEFINE_UNQUOTED(DEFAULT_EDITOR,"$DEFAULT_EDITOR",[Define this to the default editor])
 4669 ])dnl
 4670 dnl ---------------------------------------------------------------------------
 4671 dnl CF_PATH_MAILBOX version: 5 updated: 2019/12/31 20:39:42
 4672 dnl ---------------
 4673 dnl Look for the directory that contains incoming mail.  I would check for an
 4674 dnl actual mail-file, to verify this, but that is not always easy to arrange.
 4675 AC_DEFUN([CF_PATH_MAILBOX],
 4676 [
 4677 AC_MSG_CHECKING(for incoming-mail directory)
 4678 CF_ARG_WITH(mailbox,
 4679     [  --with-mailbox=DIR      directory for incoming mailboxes],
 4680     [DEFAULT_MAILBOX])
 4681 if test -z "$DEFAULT_MAILBOX" ; then
 4682 for cf_dir in \
 4683 	/var/spool/mail \
 4684 	/usr/spool/mail \
 4685 	/var/mail \
 4686 	/usr/mail \
 4687 	/mail
 4688     do
 4689     	if test -d $cf_dir ; then
 4690 	    DEFAULT_MAILBOX=$cf_dir
 4691 	    break
 4692 	fi
 4693     done
 4694 fi
 4695 if test -n "$DEFAULT_MAILBOX" ; then
 4696 	AC_DEFINE_UNQUOTED(DEFAULT_MAILBOX,"$DEFAULT_MAILBOX",[Define this to the directory for incoming mailboxes])
 4697 else
 4698 	DEFAULT_MAILBOX=none
 4699 fi
 4700 AC_MSG_RESULT($DEFAULT_MAILBOX)
 4701 ])dnl
 4702 dnl ---------------------------------------------------------------------------
 4703 dnl CF_PATH_MAILER version: 7 updated: 2019/12/31 20:39:42
 4704 dnl --------------
 4705 dnl Look for the program that sends outgoing mail.
 4706 AC_DEFUN([CF_PATH_MAILER],
 4707 [
 4708 AC_PATH_PROG(DEFAULT_MAILER,sendmail,,$PATH:/usr/sbin:/usr/lib)
 4709 CF_ARG_WITH(mailer,
 4710      [  --with-mailer=PROG      specify default mailer-program],
 4711      [DEFAULT_MAILER],,mailx)
 4712 if test -z "$DEFAULT_MAILER" ; then
 4713 AC_PATH_PROG(DEFAULT_MAILER,mailx,,$PATH:/usr/bin)
 4714 fi
 4715 if test -z "$DEFAULT_MAILER" ; then
 4716 AC_PATH_PROG(DEFAULT_MAILER,mail,,$PATH:/usr/bin)
 4717 fi
 4718 AC_MSG_CHECKING(for default mailer)
 4719 if test -n "$DEFAULT_MAILER" ; then
 4720 	CF_FIX_SLASHES(ac_cv_path_DEFAULT_MAILER)
 4721 	CF_FIX_SLASHES(DEFAULT_MAILER)
 4722 	AC_DEFINE_UNQUOTED(DEFAULT_MAILER,"$DEFAULT_MAILER",[Define this to the default mailer-program])
 4723 else
 4724 	DEFAULT_MAILER=none
 4725 fi
 4726 AC_MSG_RESULT($DEFAULT_MAILER)
 4727 ])dnl
 4728 dnl ---------------------------------------------------------------------------
 4729 dnl CF_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20
 4730 dnl --------------
 4731 dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
 4732 dnl begins with one of the prefix/exec_prefix variables, and then again if the
 4733 dnl result begins with 'NONE'.  This is necessary to work around autoconf's
 4734 dnl delayed evaluation of those symbols.
 4735 AC_DEFUN([CF_PATH_SYNTAX],[
 4736 if test "x$prefix" != xNONE; then
 4737 	cf_path_syntax="$prefix"
 4738 else
 4739 	cf_path_syntax="$ac_default_prefix"
 4740 fi
 4741 
 4742 case ".[$]$1" in
 4743 .\[$]\(*\)*|.\'*\'*)
 4744 	;;
 4745 ..|./*|.\\*)
 4746 	;;
 4747 .[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
 4748 	;;
 4749 .\[$]\{*prefix\}*|.\[$]\{*dir\}*)
 4750 	eval $1="[$]$1"
 4751 	case ".[$]$1" in
 4752 	.NONE/*)
 4753 		$1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
 4754 		;;
 4755 	esac
 4756 	;;
 4757 .no|.NONE/*)
 4758 	$1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%`
 4759 	;;
 4760 *)
 4761 	ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
 4762 	;;
 4763 esac
 4764 ])dnl
 4765 dnl ---------------------------------------------------------------------------
 4766 dnl CF_PDCURSES_X11 version: 15 updated: 2021/01/02 09:31:20
 4767 dnl ---------------
 4768 dnl Configure for PDCurses' X11 library
 4769 AC_DEFUN([CF_PDCURSES_X11],[
 4770 AC_REQUIRE([CF_X_ATHENA])
 4771 
 4772 CF_ACVERSION_CHECK(2.52,
 4773 	[AC_CHECK_TOOLS(XCURSES_CONFIG, xcurses-config, none)],
 4774 	[AC_PATH_PROGS(XCURSES_CONFIG, xcurses-config, none)])
 4775 
 4776 if test "$XCURSES_CONFIG" != none ; then
 4777 
 4778 CF_ADD_CFLAGS(`$XCURSES_CONFIG --cflags`)
 4779 CF_ADD_LIBS(`$XCURSES_CONFIG --libs`)
 4780 
 4781 cf_cv_lib_XCurses=yes
 4782 
 4783 else
 4784 
 4785 LDFLAGS="$LDFLAGS $X_LIBS"
 4786 CF_CHECK_CFLAGS($X_CFLAGS)
 4787 AC_CHECK_LIB(X11,XOpenDisplay,
 4788 	[CF_ADD_LIBS(-lX11)],,
 4789 	[$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
 4790 AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[
 4791 CF_ADD_LIBS(-lXCurses)
 4792 AC_TRY_LINK([
 4793 #include <xcurses.h>
 4794 char *XCursesProgramName = "test";
 4795 ],[XCursesExit();],
 4796 [cf_cv_lib_XCurses=yes],
 4797 [cf_cv_lib_XCurses=no])
 4798 ])
 4799 
 4800 fi
 4801 
 4802 if test "$cf_cv_lib_XCurses" = yes ; then
 4803 	AC_DEFINE(UNIX,1,[Define to 1 if using PDCurses on Unix])
 4804 	AC_DEFINE(XCURSES,1,[Define to 1 if using PDCurses on Unix])
 4805 	AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES,1,[Define to 1 if using PDCurses on Unix]))
 4806 else
 4807 	AC_MSG_ERROR(Cannot link with XCurses)
 4808 fi
 4809 ])dnl
 4810 dnl ---------------------------------------------------------------------------
 4811 dnl CF_PKG_CONFIG version: 12 updated: 2021/10/10 20:18:09
 4812 dnl -------------
 4813 dnl Check for the package-config program, unless disabled by command-line.
 4814 dnl
 4815 dnl Sets $PKG_CONFIG to the pathname of the pkg-config program.
 4816 AC_DEFUN([CF_PKG_CONFIG],
 4817 [
 4818 AC_MSG_CHECKING(if you want to use pkg-config)
 4819 AC_ARG_WITH(pkg-config,
 4820 	[  --with-pkg-config{=path} enable/disable use of pkg-config],
 4821 	[cf_pkg_config=$withval],
 4822 	[cf_pkg_config=yes])
 4823 AC_MSG_RESULT($cf_pkg_config)
 4824 
 4825 case "$cf_pkg_config" in
 4826 no)
 4827 	PKG_CONFIG=none
 4828 	;;
 4829 yes)
 4830 	CF_ACVERSION_CHECK(2.52,
 4831 		[AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)],
 4832 		[AC_PATH_PROG(PKG_CONFIG, pkg-config, none)])
 4833 	;;
 4834 *)
 4835 	PKG_CONFIG=$withval
 4836 	;;
 4837 esac
 4838 
 4839 test -z "$PKG_CONFIG" && PKG_CONFIG=none
 4840 if test "$PKG_CONFIG" != none ; then
 4841 	CF_PATH_SYNTAX(PKG_CONFIG)
 4842 elif test "x$cf_pkg_config" != xno ; then
 4843 	AC_MSG_WARN(pkg-config is not installed)
 4844 fi
 4845 
 4846 AC_SUBST(PKG_CONFIG)
 4847 ])dnl
 4848 dnl ---------------------------------------------------------------------------
 4849 dnl CF_POSIX_C_SOURCE version: 11 updated: 2018/12/31 20:46:17
 4850 dnl -----------------
 4851 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
 4852 dnl
 4853 dnl	POSIX.1-1990				_POSIX_SOURCE
 4854 dnl	POSIX.1-1990 and			_POSIX_SOURCE and
 4855 dnl		POSIX.2-1992 C-Language			_POSIX_C_SOURCE=2
 4856 dnl		Bindings Option
 4857 dnl	POSIX.1b-1993				_POSIX_C_SOURCE=199309L
 4858 dnl	POSIX.1c-1996				_POSIX_C_SOURCE=199506L
 4859 dnl	X/Open 2000				_POSIX_C_SOURCE=200112L
 4860 dnl
 4861 dnl Parameters:
 4862 dnl	$1 is the nominal value for _POSIX_C_SOURCE
 4863 AC_DEFUN([CF_POSIX_C_SOURCE],
 4864 [AC_REQUIRE([CF_POSIX_VISIBLE])dnl
 4865 
 4866 if test "$cf_cv_posix_visible" = no; then
 4867 
 4868 cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
 4869 
 4870 cf_save_CFLAGS="$CFLAGS"
 4871 cf_save_CPPFLAGS="$CPPFLAGS"
 4872 
 4873 CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
 4874 CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
 4875 
 4876 AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
 4877 	CF_MSG_LOG(if the symbol is already defined go no further)
 4878 	AC_TRY_COMPILE([#include <sys/types.h>],[
 4879 #ifndef _POSIX_C_SOURCE
 4880 make an error
 4881 #endif],
 4882 	[cf_cv_posix_c_source=no],
 4883 	[cf_want_posix_source=no
 4884 	 case .$cf_POSIX_C_SOURCE in
 4885 	 .[[12]]??*)
 4886 		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
 4887 		;;
 4888 	 .2)
 4889 		cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
 4890 		cf_want_posix_source=yes
 4891 		;;
 4892 	 .*)
 4893 		cf_want_posix_source=yes
 4894 		;;
 4895 	 esac
 4896 	 if test "$cf_want_posix_source" = yes ; then
 4897 		AC_TRY_COMPILE([#include <sys/types.h>],[
 4898 #ifdef _POSIX_SOURCE
 4899 make an error
 4900 #endif],[],
 4901 		cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
 4902 	 fi
 4903 	 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
 4904 	 CFLAGS="$cf_trim_CFLAGS"
 4905 	 CPPFLAGS="$cf_trim_CPPFLAGS"
 4906 	 CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source)
 4907 	 CF_MSG_LOG(if the second compile does not leave our definition intact error)
 4908 	 AC_TRY_COMPILE([#include <sys/types.h>],[
 4909 #ifndef _POSIX_C_SOURCE
 4910 make an error
 4911 #endif],,
 4912 	 [cf_cv_posix_c_source=no])
 4913 	 CFLAGS="$cf_save_CFLAGS"
 4914 	 CPPFLAGS="$cf_save_CPPFLAGS"
 4915 	])
 4916 ])
 4917 
 4918 if test "$cf_cv_posix_c_source" != no ; then
 4919 	CFLAGS="$cf_trim_CFLAGS"
 4920 	CPPFLAGS="$cf_trim_CPPFLAGS"
 4921 	CF_ADD_CFLAGS($cf_cv_posix_c_source)
 4922 fi
 4923 
 4924 fi # cf_cv_posix_visible
 4925 
 4926 ])dnl
 4927 dnl ---------------------------------------------------------------------------
 4928 dnl CF_POSIX_JC version: 4 updated: 2019/12/31 20:39:42
 4929 dnl -----------
 4930 dnl Check if we have POSIX-style job control (i.e., sigaction), or if we must
 4931 dnl use the signal functions.  Use AC_CHECK_FUNCS(sigaction) first.
 4932 AC_DEFUN([CF_POSIX_JC],[
 4933 
 4934 AC_REQUIRE([AC_TYPE_SIGNAL])
 4935 AC_REQUIRE([CF_SIG_ARGS])
 4936 
 4937 if test "$ac_cv_func_sigaction" = yes; then
 4938 
 4939 AC_CACHE_CHECK(whether sigaction needs _POSIX_SOURCE,cf_cv_sigact_bad,[
 4940 AC_TRY_COMPILE([
 4941 #include <sys/types.h>
 4942 #include <signal.h>],[struct sigaction act],
 4943   [cf_cv_sigact_bad=no],[cf_cv_sigact_bad=yes])
 4944 ])
 4945 
 4946 test "$cf_cv_sigact_bad" = yes && AC_DEFINE(SVR4_ACTION,1,[Define this to 1 if sigaction needs _POSIX_SOURCE])
 4947 
 4948 AC_CACHE_CHECK(if we have sigaction/related functions,cf_cv_sigaction_funcs,[
 4949 AC_TRY_LINK([
 4950 #ifdef SVR4_ACTION
 4951 #define _POSIX_SOURCE
 4952 #endif
 4953 #include <sys/types.h>
 4954 #include <signal.h>],[
 4955     RETSIGTYPE (*func)(SIG_ARGS) = SIG_IGN;
 4956     struct sigaction sa, osa;
 4957     sa.sa_handler = func;
 4958     sa.sa_flags = 0;
 4959     sigemptyset (&sa.sa_mask);
 4960     sigaction (SIGBUS,&sa,&osa);],
 4961     [cf_cv_sigaction_funcs=yes],
 4962     [cf_cv_sigaction_funcs=no])])
 4963 
 4964 test "$cf_cv_sigaction_funcs" = yes && AC_DEFINE(HAVE_POSIX_JC,1,[Define this to 1 if we have POSIX-style job-control functions])
 4965 
 4966 fi
 4967 ])dnl
 4968 dnl ---------------------------------------------------------------------------
 4969 dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17
 4970 dnl ----------------
 4971 dnl POSIX documents test-macros which an application may set before any system
 4972 dnl headers are included to make features available.
 4973 dnl
 4974 dnl Some BSD platforms (originally FreeBSD, but copied by a few others)
 4975 dnl diverged from POSIX in 2002 by setting symbols which make all of the most
 4976 dnl recent features visible in the system header files unless the application
 4977 dnl overrides the corresponding test-macros.  Doing that introduces portability
 4978 dnl problems.
 4979 dnl
 4980 dnl This macro makes a special check for the symbols used for this, to avoid a
 4981 dnl conflicting definition.
 4982 AC_DEFUN([CF_POSIX_VISIBLE],
 4983 [
 4984 AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[
 4985 AC_TRY_COMPILE([#include <stdio.h>],[
 4986 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
 4987 	&& defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
 4988 	&& defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
 4989 	&& defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
 4990 #error conflicting symbols found
 4991 #endif
 4992 ],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes])
 4993 ])
 4994 ])dnl
 4995 dnl ---------------------------------------------------------------------------
 4996 dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22
 4997 dnl ----------
 4998 dnl Check for archiver "ar".
 4999 AC_DEFUN([CF_PROG_AR],[
 5000 AC_CHECK_TOOL(AR, ar, ar)
 5001 ])
 5002 dnl ---------------------------------------------------------------------------
 5003 dnl CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54
 5004 dnl ----------
 5005 dnl standard check for CC, plus followup sanity checks
 5006 dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
 5007 AC_DEFUN([CF_PROG_CC],[
 5008 CF_ACVERSION_CHECK(2.53,
 5009 	[AC_MSG_WARN(this will incorrectly handle gnatgcc choice)
 5010 	 AC_REQUIRE([AC_PROG_CC])],
 5011 	[])
 5012 ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
 5013 CF_GCC_VERSION
 5014 CF_ACVERSION_CHECK(2.52,
 5015 	[AC_PROG_CC_STDC],
 5016 	[CF_ANSI_CC_REQD])
 5017 CF_CC_ENV_FLAGS
 5018 ])dnl
 5019 dnl ---------------------------------------------------------------------------
 5020 dnl CF_PROG_EXT version: 15 updated: 2021/01/02 09:31:20
 5021 dnl -----------
 5022 dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
 5023 AC_DEFUN([CF_PROG_EXT],
 5024 [
 5025 AC_REQUIRE([CF_CHECK_CACHE])
 5026 case "$cf_cv_system_name" in
 5027 os2*)
 5028 	CFLAGS="$CFLAGS -Zmt"
 5029 	CF_APPEND_TEXT(CPPFLAGS,-D__ST_MT_ERRNO__)
 5030 	CXXFLAGS="$CXXFLAGS -Zmt"
 5031 	# autoconf's macro sets -Zexe and suffix both, which conflict:w
 5032 	LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
 5033 	ac_cv_exeext=.exe
 5034 	;;
 5035 esac
 5036 
 5037 AC_EXEEXT
 5038 AC_OBJEXT
 5039 
 5040 PROG_EXT="$EXEEXT"
 5041 AC_SUBST(PROG_EXT)
 5042 test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)])
 5043 ])dnl
 5044 dnl ---------------------------------------------------------------------------
 5045 dnl CF_PROG_SUM_R version: 3 updated: 2019/12/31 20:39:42
 5046 dnl -------------
 5047 dnl See if sum can take -r
 5048 AC_DEFUN([CF_PROG_SUM_R],
 5049 [
 5050 if test $ac_cv_path_PATH_SUM
 5051 then
 5052 AC_MSG_CHECKING([if $ac_cv_path_PATH_SUM takes -r])
 5053 AC_CACHE_VAL(ac_cv_prog_sum_r,[
 5054 if AC_TRY_COMMAND($ac_cv_path_PATH_SUM -r config.log 1>&AC_FD_CC)
 5055 then
 5056 	ac_cv_prog_sum_r=yes
 5057 else
 5058 	ac_cv_prog_sum_r=no
 5059 fi
 5060 ])
 5061 if test $ac_cv_prog_sum_r = yes; then
 5062 	AC_DEFINE(SUM_TAKES_DASH_R,1,[Define this if the sum command support -r option])
 5063 	AC_DEFINE_UNQUOTED(PATH_SUM_R, "$ac_cv_path_PATH_SUM -r", [Define this to the sum command, with -r option if supported])
 5064 else
 5065 	AC_DEFINE_UNQUOTED(PATH_SUM_R, "$ac_cv_path_PATH_SUM")
 5066 fi
 5067 AC_MSG_RESULT($ac_cv_prog_sum_r)
 5068 fi
 5069 ])dnl
 5070 dnl ---------------------------------------------------------------------------
 5071 dnl CF_PROG_YACC version: 2 updated: 1997/12/16 11:20:41
 5072 dnl ------------
 5073 dnl A better version of AC_PROC_YACC, verifies that we'll only choose bison if
 5074 dnl we'll be able to compile with it.  Bison uses alloca, which isn't all that
 5075 dnl portable.
 5076 AC_DEFUN([CF_PROG_YACC],
 5077 [
 5078 AC_REQUIRE([AC_PROG_CC])
 5079 AC_CACHE_VAL(cf_cv_prog_YACC,[
 5080 if test -n "$YACC" ; then
 5081   cf_cv_prog_YACC="$YACC" # Let the user override the test.
 5082 else
 5083 cat >conftest.y <<EOF
 5084 %{
 5085 void yyerror(s) char *s; { }
 5086 %}
 5087 %token	NUMBER
 5088 %%
 5089 time	: NUMBER ':' NUMBER
 5090 	;
 5091 %%
 5092 int yylex() { return NUMBER; }
 5093 int main() { return yyparse(); }
 5094 EOF
 5095   for cf_prog in 'bison -y' byacc yacc
 5096   do
 5097     rm -f y.tab.[ch]
 5098     AC_MSG_CHECKING(for $cf_prog)
 5099     cf_command="$cf_prog conftest.y"
 5100     cf_result=no
 5101     if AC_TRY_EVAL(cf_command) && test -s y.tab.c ; then
 5102       mv y.tab.c conftest.c
 5103       rm -f y.tab.h
 5104       if test "$cf_prog" = 'bison -y' ; then
 5105         if AC_TRY_EVAL(ac_link) && test -s conftest ; then
 5106           cf_result=yes
 5107         fi
 5108       else
 5109         cf_result=yes
 5110       fi
 5111     fi
 5112     AC_MSG_RESULT($cf_result)
 5113     if test $cf_result = yes ; then
 5114       cf_cv_prog_YACC="$cf_prog"
 5115       break
 5116     fi
 5117   done
 5118 fi
 5119 ])
 5120 YACC="$cf_cv_prog_YACC"
 5121 AC_SUBST(YACC)dnl
 5122 ])dnl
 5123 dnl ---------------------------------------------------------------------------
 5124 dnl CF_PW_GECOS version: 3 updated: 2019/12/31 20:39:42
 5125 dnl -----------
 5126 dnl Check if the passwd-struct defines the '.pw_gecos' member (useful
 5127 dnl in decoding user names).
 5128 AC_DEFUN([CF_PW_GECOS],
 5129 [
 5130 AC_CACHE_CHECK([for passwd.pw_gecos], cf_cv_pw_gecos,[
 5131 	AC_TRY_COMPILE([
 5132 #include <pwd.h>
 5133 ],[
 5134 	struct passwd foo;
 5135 	char bar = foo.pw_gecos],
 5136 	[cf_cv_pw_gecos=yes],
 5137 	[cf_cv_pw_gecos=no])])
 5138 test $cf_cv_pw_gecos = no && AC_DEFINE(DONT_HAVE_PW_GECOS,1,[Define this to 1 if passwd struct has .pw_gecos])
 5139 ])dnl
 5140 dnl ---------------------------------------------------------------------------
 5141 dnl CF_RECHECK_FUNC version: 3 updated: 2000/10/18 19:29:13
 5142 dnl ---------------
 5143 dnl Re-check on a function to see if we can pick it up by adding a library.
 5144 dnl	$1 = function to check
 5145 dnl	$2 = library to check in
 5146 dnl	$3 = environment to update (e.g., $LIBS)
 5147 dnl	$4 = what to do if this fails
 5148 dnl
 5149 dnl This uses 'unset' if the shell happens to support it, but leaves the
 5150 dnl configuration variable set to 'unknown' if not.  This is a little better
 5151 dnl than the normal autoconf test, which gives misleading results if a test
 5152 dnl for the function is made (e.g., with AC_CHECK_FUNC) after this macro is
 5153 dnl used (autoconf does not distinguish between a null token and one that is
 5154 dnl set to 'no').
 5155 AC_DEFUN([CF_RECHECK_FUNC],[
 5156 AC_CHECK_LIB($2,$1,[
 5157 	CF_UPPER(cf_tr_func,$1)
 5158 	AC_DEFINE_UNQUOTED(HAVE_$cf_tr_func)
 5159 	ac_cv_func_$1=yes
 5160 	if test "$cf_used_lib_$2" != yes ; then cf_used_lib_$2=yes; $3="-l$2 [$]$3"; fi],[
 5161 	ac_cv_func_$1=unknown
 5162 	unset ac_cv_func_$1 2>/dev/null
 5163 	$4],
 5164 	[[$]$3])
 5165 ])dnl
 5166 dnl ---------------------------------------------------------------------------
 5167 dnl CF_REMOVE_CFLAGS version: 3 updated: 2021/09/05 17:25:40
 5168 dnl ----------------
 5169 dnl Remove a given option from CFLAGS/CPPFLAGS
 5170 dnl $1 = option to remove
 5171 dnl $2 = variable to update
 5172 dnl $3 = nonempty to allow verbose message
 5173 define([CF_REMOVE_CFLAGS],
 5174 [
 5175 cf_tmp_cflag=`echo "x$1" | sed -e 's/^.//' -e 's/=.*//'`
 5176 while true
 5177 do
 5178 	cf_old_cflag=`echo "x[$]$2" | sed -e 's/^.//' -e 's/[[ 	]][[ 	]]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[[^ 	]][[^ 	]]*\\)\?%%" -e 's/^[[ 	]]*//' -e 's%[[ ]][[ ]]*-D% -D%g' -e 's%[[ ]][[ ]]*-I% -I%g'`
 5179 	test "[$]$2" != "$cf_old_cflag" || break
 5180 	ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)])
 5181 	$2="$cf_old_cflag"
 5182 done
 5183 ])dnl
 5184 dnl ---------------------------------------------------------------------------
 5185 dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
 5186 dnl ----------------
 5187 dnl Remove all -U and -D options that refer to the given symbol from a list
 5188 dnl of C compiler options.  This works around the problem that not all
 5189 dnl compilers process -U and -D options from left-to-right, so a -U option
 5190 dnl cannot be used to cancel the effect of a preceding -D option.
 5191 dnl
 5192 dnl $1 = target (which could be the same as the source variable)
 5193 dnl $2 = source (including '$')
 5194 dnl $3 = symbol to remove
 5195 define([CF_REMOVE_DEFINE],
 5196 [
 5197 $1=`echo "$2" | \
 5198 	sed	-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[[ 	]]/ /g' \
 5199 		-e 's/-[[UD]]'"$3"'\(=[[^ 	]]*\)\?[$]//g'`
 5200 ])dnl
 5201 dnl ---------------------------------------------------------------------------
 5202 dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45
 5203 dnl ---------------------
 5204 dnl Restore flags saved in CF_SAVE_XTRA_FLAGS
 5205 dnl $1 = name of current macro
 5206 define([CF_RESTORE_XTRA_FLAGS],
 5207 [
 5208 LIBS="$cf_save_LIBS_$1"
 5209 CFLAGS="$cf_save_CFLAGS_$1"
 5210 CPPFLAGS="$cf_save_CPPFLAGS_$1"
 5211 ])dnl
 5212 dnl ---------------------------------------------------------------------------
 5213 dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44
 5214 dnl ------------------
 5215 dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers
 5216 dnl and libraries which do not update those variables.
 5217 dnl
 5218 dnl $1 = name of current macro
 5219 define([CF_SAVE_XTRA_FLAGS],
 5220 [
 5221 cf_save_LIBS_$1="$LIBS"
 5222 cf_save_CFLAGS_$1="$CFLAGS"
 5223 cf_save_CPPFLAGS_$1="$CPPFLAGS"
 5224 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
 5225 for cf_X_CFLAGS in $X_CFLAGS
 5226 do
 5227 	case "x$cf_X_CFLAGS" in
 5228 	x-[[IUD]]*)
 5229 		CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
 5230 		;;
 5231 	*)
 5232 		CFLAGS="$CFLAGS $cf_X_CFLAGS"
 5233 		;;
 5234 	esac
 5235 done
 5236 ])dnl
 5237 dnl ---------------------------------------------------------------------------
 5238 dnl CF_SIGWINCH version: 6 updated: 2021/01/01 13:31:04
 5239 dnl -----------
 5240 dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all
 5241 dnl programs need this test).
 5242 dnl
 5243 dnl This is really a Mac OS X 10.4.3 workaround.  Defining _POSIX_C_SOURCE
 5244 dnl forces SIGWINCH to be undefined (breaks xterm, ncurses).  Oddly, the struct
 5245 dnl winsize declaration is left alone - we may revisit this if Apple choose to
 5246 dnl break that part of the interface as well.
 5247 AC_DEFUN([CF_SIGWINCH],
 5248 [
 5249 AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[
 5250 	AC_TRY_COMPILE([
 5251 #include <sys/types.h>
 5252 #include <sys/signal.h>
 5253 ],[int x = SIGWINCH; (void)x],
 5254 	[cf_cv_define_sigwinch=yes],
 5255 	[AC_TRY_COMPILE([
 5256 #undef _XOPEN_SOURCE
 5257 #undef _POSIX_SOURCE
 5258 #undef _POSIX_C_SOURCE
 5259 #include <sys/types.h>
 5260 #include <sys/signal.h>
 5261 ],[int x = SIGWINCH; (void)x],
 5262 	[cf_cv_define_sigwinch=maybe],
 5263 	[cf_cv_define_sigwinch=no])
 5264 ])
 5265 ])
 5266 
 5267 if test "$cf_cv_define_sigwinch" = maybe ; then
 5268 AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[
 5269 cf_cv_fixup_sigwinch=unknown
 5270 cf_sigwinch=32
 5271 while test "$cf_sigwinch" != 1
 5272 do
 5273 	AC_TRY_COMPILE([
 5274 #undef _XOPEN_SOURCE
 5275 #undef _POSIX_SOURCE
 5276 #undef _POSIX_C_SOURCE
 5277 #include <sys/types.h>
 5278 #include <sys/signal.h>
 5279 ],[
 5280 #if SIGWINCH != $cf_sigwinch
 5281 make an error
 5282 #endif
 5283 int x = SIGWINCH; (void)x],
 5284 	[cf_cv_fixup_sigwinch=$cf_sigwinch
 5285 	 break])
 5286 
 5287 cf_sigwinch="`expr "$cf_sigwinch" - 1`"
 5288 done
 5289 ])
 5290 
 5291 	if test "$cf_cv_fixup_sigwinch" != unknown ; then
 5292 		CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
 5293 	fi
 5294 fi
 5295 ])dnl
 5296 dnl ---------------------------------------------------------------------------
 5297 dnl CF_SIG_ARGS version: 3 updated: 2019/12/31 20:39:42
 5298 dnl -----------
 5299 dnl Check for systems that have signal-handlers prototyped with one argument
 5300 dnl versus those with more than one argument, define the symbol SIG_ARGS to
 5301 dnl match.  (If it's empty, that's ok too).
 5302 AC_DEFUN([CF_SIG_ARGS],
 5303 [
 5304 AC_MSG_CHECKING([declaration of signal arguments])
 5305 AC_CACHE_VAL(cf_cv_sig_args,[
 5306 cf_cv_sig_args=
 5307 for cf_test in "int sig" "int sig, ..."
 5308 do
 5309 	AC_TRY_COMPILE([
 5310 #include <signal.h>],
 5311 	[extern RETSIGTYPE catch($cf_test); signal(SIGINT, catch)],
 5312 	[cf_cv_sig_args="$cf_test";break])
 5313 done
 5314 ])
 5315 AC_MSG_RESULT($cf_cv_sig_args)
 5316 AC_DEFINE_UNQUOTED(SIG_ARGS,$cf_cv_sig_args,[Define this to 1 if signal handlers are prototyped with more than one argument])
 5317 ])dnl
 5318 dnl ---------------------------------------------------------------------------
 5319 dnl CF_SIG_CONST version: 5 updated: 2019/12/31 20:39:42
 5320 dnl ------------
 5321 dnl Check for systems where the special signal constants aren't prototyped
 5322 dnl (there's a lot of them, and the compiler can generate a lot of warning
 5323 dnl messages that make it hard to pick out genuine errors).
 5324 AC_DEFUN([CF_SIG_CONST],
 5325 [
 5326 AC_REQUIRE([CF_SIG_ARGS])
 5327 AC_MSG_CHECKING([for redefinable signal constants])
 5328 AC_CACHE_VAL(cf_cv_sig_const,[
 5329 cf_cv_sig_const=no
 5330 if test -n "$cf_cv_sig_args"; then
 5331 	cf_test=`echo $cf_cv_sig_args|sed -e s/sig//`
 5332 	AC_TRY_RUN([
 5333 #define NEW_DFL	((RETSIGTYPE (*)($cf_test))0)
 5334 #define NEW_IGN	((RETSIGTYPE (*)($cf_test))1)
 5335 #define NEW_ERR	((RETSIGTYPE (*)($cf_test))-1)
 5336 
 5337 #include <signal.h>
 5338 
 5339 int main()
 5340 {
 5341 	if (NEW_DFL != SIG_DFL
 5342 	 || NEW_IGN != SIG_IGN
 5343 	 || NEW_ERR != SIG_ERR
 5344 	 /* at least one system won't let me redefine these! */
 5345 #undef SIG_DFL
 5346 #undef SIG_IGN
 5347 #undef SIG_ERR
 5348 #define SIG_DFL NEW_DFL
 5349 #define SIG_IGN NEW_IGN
 5350 #define SIG_ERR NEW_ERR
 5351 	 || NEW_DFL != SIG_DFL)
 5352 	 	${cf_cv_main_return:-return}(1);
 5353 	signal(SIGINT, SIG_DFL);
 5354 	${cf_cv_main_return:-return}(0);
 5355 }],
 5356 	[cf_cv_sig_const=yes],
 5357 	[cf_cv_sig_const=no],
 5358 	[cf_cv_sig_const=unknown])
 5359 fi
 5360 ])
 5361 AC_MSG_RESULT($cf_cv_sig_const)
 5362 test "$cf_cv_sig_const" = yes && AC_DEFINE(DECL_SIG_CONST,1,[Define this to 1 for redefinable signal constants])
 5363 ])dnl
 5364 dnl ---------------------------------------------------------------------------
 5365 dnl CF_SIZECHANGE version: 18 updated: 2021/09/04 06:35:04
 5366 dnl -------------
 5367 dnl Check for definitions & structures needed for window size-changing
 5368 dnl
 5369 dnl https://stackoverflow.com/questions/18878141/difference-between-structures-ttysize-and-winsize/50769952#50769952
 5370 AC_DEFUN([CF_SIZECHANGE],
 5371 [
 5372 AC_REQUIRE([CF_STRUCT_TERMIOS])
 5373 AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[
 5374 	cf_cv_sizechange=unknown
 5375 	cf_save_CPPFLAGS="$CPPFLAGS"
 5376 
 5377 for cf_opts in "" "NEED_PTEM_H"
 5378 do
 5379 
 5380 	CPPFLAGS="$cf_save_CPPFLAGS"
 5381 	if test -n "$cf_opts"
 5382 	then
 5383 		CF_APPEND_TEXT(CPPFLAGS,-D$cf_opts)
 5384 	fi
 5385 	AC_TRY_COMPILE([#include <sys/types.h>
 5386 #ifdef HAVE_TERMIOS_H
 5387 #include <termios.h>
 5388 #else
 5389 #ifdef HAVE_TERMIO_H
 5390 #include <termio.h>
 5391 #endif
 5392 #endif
 5393 
 5394 #ifdef NEED_PTEM_H
 5395 /* This is a workaround for SCO:  they neglected to define struct winsize in
 5396  * termios.h -- it is only in termio.h and ptem.h
 5397  */
 5398 #include <sys/stream.h>
 5399 #include <sys/ptem.h>
 5400 #endif
 5401 
 5402 #ifdef HAVE_SYS_IOCTL_H
 5403 #include <sys/ioctl.h>
 5404 #endif
 5405 ],[
 5406 #ifdef TIOCGSIZE
 5407 	struct ttysize win;	/* SunOS 3.0... */
 5408 	int y = win.ts_lines = 2;
 5409 	int x = win.ts_cols = 1;
 5410 	(void)y;
 5411 	(void)x;
 5412 #else
 5413 #ifdef TIOCGWINSZ
 5414 	struct winsize win;	/* everything else */
 5415 	int y = win.ws_row = 2;
 5416 	int x = win.ws_col = 1;
 5417 	(void)y;
 5418 	(void)x;
 5419 #else
 5420 	no TIOCGSIZE or TIOCGWINSZ
 5421 #endif /* TIOCGWINSZ */
 5422 #endif /* TIOCGSIZE */
 5423 	],
 5424 	[cf_cv_sizechange=yes],
 5425 	[cf_cv_sizechange=no])
 5426 
 5427 	CPPFLAGS="$cf_save_CPPFLAGS"
 5428 	if test "$cf_cv_sizechange" = yes ; then
 5429 		echo "size-change succeeded ($cf_opts)" >&AC_FD_CC
 5430 		test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
 5431 		break
 5432 	fi
 5433 done
 5434 ])
 5435 if test "$cf_cv_sizechange" != no ; then
 5436 	AC_DEFINE(HAVE_SIZECHANGE,1,[Define to 1 if sizechange declarations are provided])
 5437 	case "$cf_cv_sizechange" in
 5438 	NEED*)
 5439 		AC_DEFINE_UNQUOTED($cf_cv_sizechange )
 5440 		;;
 5441 	esac
 5442 fi
 5443 ])dnl
 5444 dnl ---------------------------------------------------------------------------
 5445 dnl CF_SOCKS version: 9 updated: 2012/11/08 20:57:52
 5446 dnl --------
 5447 dnl Check for socks library
 5448 dnl $1 = the [optional] directory in which the library may be found
 5449 AC_DEFUN([CF_SOCKS],[
 5450   CF_ADD_OPTIONAL_PATH($1, [socks library])
 5451   CF_FIND_LINKAGE([
 5452 #include <stdio.h>
 5453 ],[
 5454       Raccept((char *)0)
 5455 ],
 5456       socks)
 5457 
 5458   if test "x$cf_cv_find_linkage_socks" = "xyes" ; then
 5459     AC_DEFINE(SOCKS,1,[Define to 1 if we are using socks library])
 5460 
 5461     AC_DEFINE(accept,Raccept,[Define to override function name if using socks library])
 5462     AC_DEFINE(bind,Rbind,[Define to override function name if using socks library])
 5463     AC_DEFINE(connect,Rconnect,[Define to override function name if using socks library])
 5464     AC_DEFINE(getpeername,Rgetpeername,[Define to override function name if using socks library])
 5465     AC_DEFINE(getsockname,Rgetsockname,[Define to override function name if using socks library])
 5466     AC_DEFINE(listen,Rlisten,[Define to override function name if using socks library])
 5467     AC_DEFINE(recvfrom,Rrecvfrom,[Define to override function name if using socks library])
 5468     AC_DEFINE(select,Rselect,[Define to override function name if using socks library])
 5469   else
 5470     AC_MSG_ERROR(cannot link with socks library)
 5471   fi
 5472 ])dnl
 5473 dnl ---------------------------------------------------------------------------
 5474 dnl CF_SOCKS5 version: 12 updated: 2012/11/08 20:57:52
 5475 dnl ---------
 5476 dnl Check for socks5 configuration
 5477 dnl $1 = the [optional] directory in which the library may be found
 5478 AC_DEFUN([CF_SOCKS5],[
 5479   CF_ADD_OPTIONAL_PATH($1, [socks5 library])
 5480 
 5481 CF_ADD_LIBS(-lsocks5)
 5482 
 5483 AC_DEFINE(USE_SOCKS5,1,[Define to 1 if we are using socks5 library])
 5484 AC_DEFINE(SOCKS,1,[Define to 1 if we are using socks library])
 5485 
 5486 AC_MSG_CHECKING(if the socks library uses socks4 prefix)
 5487 cf_use_socks4=error
 5488 AC_TRY_LINK([
 5489 #include <socks.h>],[
 5490 	Rinit((char *)0)],
 5491 	[AC_DEFINE(USE_SOCKS4_PREFIX,1,[Define to 1 if socks library uses socks4 prefix])
 5492 	 cf_use_socks4=yes],
 5493 	[AC_TRY_LINK([#include <socks.h>],
 5494 		[SOCKSinit((char *)0)],
 5495 		[cf_use_socks4=no],
 5496 		[AC_MSG_ERROR(Cannot link with socks5 library)])])
 5497 AC_MSG_RESULT($cf_use_socks4)
 5498 
 5499 if test "$cf_use_socks4" = "yes" ; then
 5500 	AC_DEFINE(accept,Raccept)
 5501 	AC_DEFINE(bind,Rbind)
 5502 	AC_DEFINE(connect,Rconnect)
 5503 	AC_DEFINE(getpeername,Rgetpeername)
 5504 	AC_DEFINE(getsockname,Rgetsockname)
 5505 	AC_DEFINE(listen,Rlisten)
 5506 	AC_DEFINE(recvfrom,Rrecvfrom)
 5507 	AC_DEFINE(select,Rselect)
 5508 else
 5509 	AC_DEFINE(accept,SOCKSaccept)
 5510 	AC_DEFINE(getpeername,SOCKSgetpeername)
 5511 	AC_DEFINE(getsockname,SOCKSgetsockname)
 5512 	AC_DEFINE(recvfrom,SOCKSrecvfrom)
 5513 fi
 5514 
 5515 AC_MSG_CHECKING(if socks5p.h is available)
 5516 AC_TRY_COMPILE([
 5517 #define INCLUDE_PROTOTYPES
 5518 #include <socks.h>],[
 5519 	init((char *)0)],
 5520 	[cf_use_socks5p_h=yes],
 5521 	[cf_use_socks5p_h=no])
 5522 AC_MSG_RESULT($cf_use_socks5p_h)
 5523 
 5524 test "$cf_use_socks5p_h" = yes && AC_DEFINE(INCLUDE_PROTOTYPES,1,[Define to 1 if needed to declare prototypes in socks headers])
 5525 ])dnl
 5526 dnl ---------------------------------------------------------------------------
 5527 dnl CF_STRERROR version: 2 updated: 2001/07/11 09:34:49
 5528 dnl -----------
 5529 dnl Check for strerror(), or it is not found, for the related data.  POSIX
 5530 dnl requires strerror(), so only old systems such as SunOS lack it.
 5531 AC_DEFUN([CF_STRERROR],[
 5532 AC_CHECK_FUNCS(strerror, AC_DEFINE(HAVE_STRERROR),[CF_SYS_ERRLIST])
 5533 ])dnl
 5534 dnl ---------------------------------------------------------------------------
 5535 dnl CF_STRUCT_TERMIOS version: 11 updated: 2020/03/19 20:46:13
 5536 dnl -----------------
 5537 dnl Some machines require _POSIX_SOURCE to completely define struct termios.
 5538 AC_DEFUN([CF_STRUCT_TERMIOS],[
 5539 AC_REQUIRE([CF_XOPEN_SOURCE])
 5540 
 5541 AC_CHECK_HEADERS( \
 5542 termio.h \
 5543 termios.h \
 5544 unistd.h \
 5545 sys/ioctl.h \
 5546 sys/termio.h \
 5547 )
 5548 
 5549 if test "$ac_cv_header_termios_h" = yes ; then
 5550 	case "$CFLAGS $CPPFLAGS" in
 5551 	*-D_POSIX_SOURCE*)
 5552 		termios_bad=dunno ;;
 5553 	*)	termios_bad=maybe ;;
 5554 	esac
 5555 	if test "$termios_bad" = maybe ; then
 5556 	AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
 5557 	AC_TRY_COMPILE([#include <termios.h>],
 5558 		[struct termios foo; int x = foo.c_iflag = 1; (void)x],
 5559 		termios_bad=no, [
 5560 		AC_TRY_COMPILE([
 5561 #define _POSIX_SOURCE
 5562 #include <termios.h>],
 5563 			[struct termios foo; int x = foo.c_iflag = 2; (void)x],
 5564 			termios_bad=unknown,
 5565 			termios_bad=yes AC_DEFINE(_POSIX_SOURCE,1,[Define to 1 if we must define _POSIX_SOURCE]))
 5566 			])
 5567 	AC_MSG_RESULT($termios_bad)
 5568 	fi
 5569 fi
 5570 ])dnl
 5571 dnl ---------------------------------------------------------------------------
 5572 dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06
 5573 dnl --------------
 5574 dnl Construct a search-list for a nonstandard header/lib-file
 5575 dnl	$1 = the variable to return as result
 5576 dnl	$2 = the package name
 5577 dnl	$3 = the subdirectory, e.g., bin, include or lib
 5578 AC_DEFUN([CF_SUBDIR_PATH],
 5579 [
 5580 $1=
 5581 
 5582 CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
 5583 
 5584 for cf_subdir_prefix in \
 5585 	/usr \
 5586 	/usr/local \
 5587 	/usr/pkg \
 5588 	/opt \
 5589 	/opt/local \
 5590 	[$]HOME
 5591 do
 5592 	CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix)
 5593 done
 5594 ])dnl
 5595 dnl ---------------------------------------------------------------------------
 5596 dnl CF_SYS_ERRLIST version: 6 updated: 2001/12/30 13:03:23
 5597 dnl --------------
 5598 dnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and
 5599 dnl errno.h.  Declaration of sys_errlist on BSD4.4 interferes with our
 5600 dnl declaration.  Reported by Keith Bostic.
 5601 AC_DEFUN([CF_SYS_ERRLIST],
 5602 [
 5603     CF_CHECK_ERRNO(sys_nerr)
 5604     CF_CHECK_ERRNO(sys_errlist)
 5605 ])dnl
 5606 dnl ---------------------------------------------------------------------------
 5607 dnl CF_SYS_SELECT_TIMEVAL version: 5 updated: 2019/12/31 20:39:42
 5608 dnl ---------------------
 5609 dnl Check if there is a conflict between <sys/select.h> and <sys/time.h>.
 5610 dnl This is known to be a problem with SCO.
 5611 AC_DEFUN([CF_SYS_SELECT_TIMEVAL],
 5612 [
 5613 AC_MSG_CHECKING(if sys/time.h conflicts with sys/select.h)
 5614 AC_CACHE_VAL(cf_cv_sys_select_timeval,[
 5615 for cf_opts in no yes
 5616 do
 5617 AC_TRY_COMPILE([
 5618 #define yes 1
 5619 #define no 0
 5620 #if $cf_opts
 5621 #define timeval fake_timeval
 5622 #endif
 5623 #include <sys/types.h>
 5624 #ifdef TIME_WITH_SYS_TIME
 5625 #	include <sys/time.h>
 5626 #	include <time.h>
 5627 #else
 5628 #	ifdef HAVE_SYS_TIME_H
 5629 #		include <sys/time.h>
 5630 #	else
 5631 #		include <time.h>
 5632 #	endif
 5633 #endif
 5634 #undef timeval
 5635 #ifdef HAVE_SYS_SELECT_H
 5636 #	include <sys/select.h>
 5637 #endif
 5638 ],[struct timeval foo],
 5639 	[cf_cv_sys_select_timeval=$cf_opts
 5640 	 break],
 5641 	[cf_cv_sys_select_timeval=no])
 5642 done
 5643 ])
 5644 AC_MSG_RESULT($cf_cv_sys_select_timeval)
 5645 test $cf_cv_sys_select_timeval = yes && AC_DEFINE(NEED_TIMEVAL_FIX,1,[Define this to 1 if sys/time.h conflicts with sys/select.h])
 5646 ])
 5647 dnl ---------------------------------------------------------------------------
 5648 dnl CF_TERMCAP_LIBS version: 15 updated: 2015/04/15 19:08:48
 5649 dnl ---------------
 5650 dnl Look for termcap libraries, or the equivalent in terminfo.
 5651 dnl
 5652 dnl The optional parameter may be "ncurses", "ncursesw".
 5653 AC_DEFUN([CF_TERMCAP_LIBS],
 5654 [
 5655 AC_CACHE_VAL(cf_cv_termlib,[
 5656 cf_cv_termlib=none
 5657 AC_TRY_LINK([],[char *x=(char*)tgoto("",0,0)],
 5658 [AC_TRY_LINK([],[int x=tigetstr("")],
 5659 	[cf_cv_termlib=terminfo],
 5660 	[cf_cv_termlib=termcap])
 5661 	CF_VERBOSE(using functions in predefined $cf_cv_termlib LIBS)
 5662 ],[
 5663 ifelse([$1],,,[
 5664 case "$1" in
 5665 ncurses*)
 5666 	CF_NCURSES_CONFIG($1)
 5667 	cf_cv_termlib=terminfo
 5668 	;;
 5669 esac
 5670 ])
 5671 if test "$cf_cv_termlib" = none; then
 5672 	# FreeBSD's linker gives bogus results for AC_CHECK_LIB, saying that
 5673 	# tgetstr lives in -lcurses when it is only an unsatisfied extern.
 5674 	cf_save_LIBS="$LIBS"
 5675 	for cf_lib in tinfo curses ncurses termlib termcap
 5676 	do
 5677 		LIBS="-l$cf_lib $cf_save_LIBS"
 5678 		for cf_func in tigetstr tgetstr
 5679 		do
 5680 			AC_MSG_CHECKING(for $cf_func in -l$cf_lib)
 5681 			AC_TRY_LINK([],[int x=$cf_func("")],[cf_result=yes],[cf_result=no])
 5682 			AC_MSG_RESULT($cf_result)
 5683 			if test "$cf_result" = yes ; then
 5684 				if test "$cf_func" = tigetstr ; then
 5685 					cf_cv_termlib=terminfo
 5686 				else
 5687 					cf_cv_termlib=termcap
 5688 				fi
 5689 				break
 5690 			fi
 5691 		done
 5692 		test "$cf_result" = yes && break
 5693 	done
 5694 	test "$cf_result" = no && LIBS="$cf_save_LIBS"
 5695 fi
 5696 if test "$cf_cv_termlib" = none; then
 5697 	# allow curses library for broken AIX system.
 5698 	AC_CHECK_LIB(curses, initscr, [CF_ADD_LIBS(-lcurses)])
 5699 	AC_CHECK_LIB(termcap, tgoto, [CF_ADD_LIBS(-ltermcap) cf_cv_termlib=termcap])
 5700 fi
 5701 ])
 5702 if test "$cf_cv_termlib" = none; then
 5703 	AC_MSG_WARN([Cannot find -ltermlib, -lcurses, or -ltermcap])
 5704 fi
 5705 ])])dnl
 5706 dnl ---------------------------------------------------------------------------
 5707 dnl CF_TERMIOS version: 3 updated: 2019/12/31 20:39:42
 5708 dnl ----------
 5709 dnl See if we can link with the termios functions tcsetattr/tcgetattr
 5710 AC_DEFUN([CF_TERMIOS],
 5711 [
 5712 AC_MSG_CHECKING([for nonconflicting termios.h])
 5713 AC_CACHE_VAL(cf_cv_use_termios_h,[
 5714 	AC_TRY_LINK([
 5715 #ifdef HAVE_IOCTL_H
 5716 #	include <ioctl.h>
 5717 #else
 5718 #	ifdef HAVE_SYS_IOCTL_H
 5719 #		include <sys/ioctl.h>
 5720 #	endif
 5721 #endif
 5722 
 5723 #if !defined(sun) || !defined(NL0)
 5724 #include <termios.h>
 5725 #endif
 5726 ],[
 5727 	struct termios save_tty;
 5728 	(void) tcsetattr (0, TCSANOW, &save_tty);
 5729 	(void) tcgetattr (0, &save_tty)],
 5730 	[cf_cv_use_termios_h=yes],
 5731 	[cf_cv_use_termios_h=no])
 5732 ])
 5733 AC_MSG_RESULT($cf_cv_use_termios_h)
 5734 if test $cf_cv_use_termios_h = yes; then
 5735 	AC_DEFINE(HAVE_TERMIOS_H,1,[Define this to 1 if we have header termios.h])
 5736 	AC_DEFINE(HAVE_TCGETATTR,1,[Define this to 1 if we have function tcgetattr])
 5737 	AC_DEFINE(HAVE_TCSETATTR,1,[Define this to 1 if we have function tcsetattr])
 5738 fi
 5739 ])dnl
 5740 dnl ---------------------------------------------------------------------------
 5741 dnl CF_TERM_HEADER version: 6 updated: 2021/01/02 09:31:20
 5742 dnl --------------
 5743 dnl Look for term.h, which is part of X/Open curses.  It defines the interface
 5744 dnl to terminfo database.  Usually it is in the same include-path as curses.h,
 5745 dnl but some packagers change this, breaking various applications.
 5746 AC_DEFUN([CF_TERM_HEADER],[
 5747 AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
 5748 case "${cf_cv_ncurses_header}" in
 5749 */ncurses.h|*/ncursesw.h)
 5750 	cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
 5751 	;;
 5752 *)
 5753 	cf_term_header=term.h
 5754 	;;
 5755 esac
 5756 
 5757 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
 5758 do
 5759 AC_TRY_COMPILE([#include <stdio.h>
 5760 #include <${cf_cv_ncurses_header:-curses.h}>
 5761 #include <$cf_test>
 5762 ],[int x = auto_left_margin; (void)x],[
 5763 	cf_cv_term_header="$cf_test"],[
 5764 	cf_cv_term_header=unknown
 5765 	])
 5766 	test "$cf_cv_term_header" != unknown && break
 5767 done
 5768 ])
 5769 
 5770 # Set definitions to allow ifdef'ing to accommodate subdirectories
 5771 
 5772 case "$cf_cv_term_header" in
 5773 *term.h)
 5774 	AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
 5775 	;;
 5776 esac
 5777 
 5778 case "$cf_cv_term_header" in
 5779 ncurses/term.h)
 5780 	AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
 5781 	;;
 5782 ncursesw/term.h)
 5783 	AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
 5784 	;;
 5785 esac
 5786 ])dnl
 5787 dnl ---------------------------------------------------------------------------
 5788 dnl CF_TIOCGWINSZ version: 6 updated: 2019/12/31 20:39:42
 5789 dnl -------------
 5790 dnl On some systems ioctl(fd, TIOCGWINSZ, &size) will always return {0,0} until
 5791 dnl ioctl(fd, TIOCSWINSZ, &size) is called to explicitly set the size of the
 5792 dnl screen.
 5793 dnl
 5794 dnl Attempt to determine if we're on such a system by running a test-program.
 5795 dnl This won't work, of course, if the configure script is run in batch mode,
 5796 dnl since we've got to have access to the terminal.
 5797 dnl
 5798 dnl CHECK_DECL_FLAG and CHECK_DECL_HDRS must be set in configure.in
 5799 AC_DEFUN([CF_TIOCGWINSZ],
 5800 [
 5801 AC_MSG_CHECKING([for working TIOCGWINSZ])
 5802 AC_CACHE_VAL(cf_cv_use_tiocgwinsz,[
 5803 	cf_save_CFLAGS="$CFLAGS"
 5804 	CFLAGS="$CFLAGS -D__CPROTO__ $CHECK_DECL_FLAG"
 5805 	AC_TRY_RUN([
 5806 $CHECK_DECL_HDRS
 5807 int main()
 5808 {
 5809 	int fd;
 5810 	for (fd = 0; fd <= 2; fd++) {	/* try in/out/err in case redirected */
 5811 #ifdef TIOCGSIZE
 5812 		struct ttysize size;
 5813 		if (ioctl (0, TIOCGSIZE, &size) == 0
 5814 		 && size.ts_lines > 0
 5815 		 && size.ts_cols > 0)
 5816 			${cf_cv_main_return:-return}(0);
 5817 #else
 5818 		struct winsize size;
 5819 		if (ioctl(0, TIOCGWINSZ, &size) == 0
 5820 		 && size.ws_row > 0
 5821 		 && size.ws_col > 0)
 5822 			${cf_cv_main_return:-return}(0);
 5823 #endif
 5824 	}
 5825 	${cf_cv_main_return:-return}(0);	/* we cannot guarantee this is run interactively */
 5826 }],
 5827 		[cf_cv_use_tiocgwinsz=yes],
 5828 		[cf_cv_use_tiocgwinsz=no],
 5829 		[cf_cv_use_tiocgwinsz=unknown])
 5830 		rm -f autoconf.h
 5831 		CFLAGS="$cf_save_CFLAGS"])
 5832 AC_MSG_RESULT($cf_cv_use_tiocgwinsz)
 5833 test $cf_cv_use_tiocgwinsz != yes && AC_DEFINE(DONT_HAVE_SIGWINCH,1,[Define this to 1 for working TIOCGWINSZ])
 5834 ])dnl
 5835 dnl ---------------------------------------------------------------------------
 5836 dnl CF_TM_GMTOFF version: 5 updated: 2021/06/08 18:08:14
 5837 dnl ------------
 5838 dnl Check if the tm-struct defines the '.tm_gmtoff' member (useful in decoding
 5839 dnl dates).
 5840 AC_DEFUN([CF_TM_GMTOFF],
 5841 [
 5842 AC_MSG_CHECKING([for tm.tm_gmtoff])
 5843 AC_CACHE_VAL(cf_cv_tm_gmtoff,[
 5844 	AC_TRY_COMPILE([
 5845 #ifdef TIME_WITH_SYS_TIME
 5846 #	include <sys/time.h>
 5847 #	include <time.h>
 5848 #else
 5849 #	ifdef HAVE_SYS_TIME_H
 5850 #		include <sys/time.h>
 5851 #	else
 5852 #		include <time.h>
 5853 #	endif
 5854 #endif
 5855 ],[
 5856 	static struct tm foo;
 5857 	long bar = foo.tm_gmtoff; (void) bar],
 5858 	[cf_cv_tm_gmtoff=yes],
 5859 	[cf_cv_tm_gmtoff=no])])
 5860 AC_MSG_RESULT($cf_cv_tm_gmtoff)
 5861 test "$cf_cv_tm_gmtoff" = no && AC_DEFINE(DONT_HAVE_TM_GMTOFF,1,[Define to 1 if the tm-struct defines .tm_gmtoff member])
 5862 ])dnl
 5863 dnl ---------------------------------------------------------------------------
 5864 dnl CF_TRIM_X_LIBS version: 3 updated: 2015/04/12 15:39:00
 5865 dnl --------------
 5866 dnl Trim extra base X libraries added as a workaround for inconsistent library
 5867 dnl dependencies returned by "new" pkg-config files.
 5868 AC_DEFUN([CF_TRIM_X_LIBS],[
 5869 	for cf_trim_lib in Xmu Xt X11
 5870 	do
 5871 		case "$LIBS" in
 5872 		*-l$cf_trim_lib\ *-l$cf_trim_lib*)
 5873 			LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
 5874 			CF_VERBOSE(..trimmed $LIBS)
 5875 			;;
 5876 		esac
 5877 	done
 5878 ])
 5879 dnl ---------------------------------------------------------------------------
 5880 dnl CF_TRY_PKG_CONFIG version: 6 updated: 2020/12/31 10:54:15
 5881 dnl -----------------
 5882 dnl This is a simple wrapper to use for pkg-config, for libraries which may be
 5883 dnl available in that form.
 5884 dnl
 5885 dnl $1 = package name, which may be a shell variable
 5886 dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS
 5887 dnl $3 = logic to use if pkg-config does not have the package
 5888 AC_DEFUN([CF_TRY_PKG_CONFIG],[
 5889 AC_REQUIRE([CF_PKG_CONFIG])
 5890 
 5891 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists "$1"; then
 5892 	CF_VERBOSE(found package $1)
 5893 	cf_pkgconfig_incs="`$PKG_CONFIG --cflags "$1" 2>/dev/null`"
 5894 	cf_pkgconfig_libs="`$PKG_CONFIG --libs   "$1" 2>/dev/null`"
 5895 	CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs)
 5896 	CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs)
 5897 	CF_ADD_CFLAGS($cf_pkgconfig_incs)
 5898 	CF_ADD_LIBS($cf_pkgconfig_libs)
 5899 	ifelse([$2],,:,[$2])
 5900 else
 5901 	cf_pkgconfig_incs=
 5902 	cf_pkgconfig_libs=
 5903 	ifelse([$3],,:,[$3])
 5904 fi
 5905 ])
 5906 dnl ---------------------------------------------------------------------------
 5907 dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37
 5908 dnl -------------------
 5909 dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
 5910 dnl can define it successfully.
 5911 AC_DEFUN([CF_TRY_XOPEN_SOURCE],[
 5912 AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
 5913 	AC_TRY_COMPILE([
 5914 #include <stdlib.h>
 5915 #include <string.h>
 5916 #include <sys/types.h>
 5917 ],[
 5918 #ifndef _XOPEN_SOURCE
 5919 make an error
 5920 #endif],
 5921 	[cf_cv_xopen_source=no],
 5922 	[cf_save="$CPPFLAGS"
 5923 	 CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE)
 5924 	 AC_TRY_COMPILE([
 5925 #include <stdlib.h>
 5926 #include <string.h>
 5927 #include <sys/types.h>
 5928 ],[
 5929 #ifdef _XOPEN_SOURCE
 5930 make an error
 5931 #endif],
 5932 	[cf_cv_xopen_source=no],
 5933 	[cf_cv_xopen_source=$cf_XOPEN_SOURCE])
 5934 	CPPFLAGS="$cf_save"
 5935 	])
 5936 ])
 5937 
 5938 if test "$cf_cv_xopen_source" != no ; then
 5939 	CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
 5940 	CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
 5941 	cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
 5942 	CF_APPEND_CFLAGS($cf_temp_xopen_source)
 5943 fi
 5944 ])
 5945 dnl ---------------------------------------------------------------------------
 5946 dnl CF_TYPE_FD_SET version: 6 updated: 2020/03/10 18:53:47
 5947 dnl --------------
 5948 dnl Check for the declaration of fd_set.  Some platforms declare it in
 5949 dnl <sys/types.h>, and some in <sys/select.h>, which requires <sys/types.h>.
 5950 dnl Finally, if we are using this for an X application, Xpoll.h may include
 5951 dnl <sys/select.h>, so we don't want to do it twice.
 5952 AC_DEFUN([CF_TYPE_FD_SET],
 5953 [
 5954 AC_CHECK_HEADERS(X11/Xpoll.h)
 5955 
 5956 AC_CACHE_CHECK(for declaration of fd_set,cf_cv_type_fd_set,
 5957 	[CF_MSG_LOG(sys/types alone)
 5958 AC_TRY_COMPILE([
 5959 #include <sys/types.h>],
 5960 	[fd_set x; (void)x],
 5961 	[cf_cv_type_fd_set=sys/types.h],
 5962 	[CF_MSG_LOG(X11/Xpoll.h)
 5963 AC_TRY_COMPILE([
 5964 #ifdef HAVE_X11_XPOLL_H
 5965 #include <X11/Xpoll.h>
 5966 #endif],
 5967 	[fd_set x; (void)x],
 5968 	[cf_cv_type_fd_set=X11/Xpoll.h],
 5969 	[CF_MSG_LOG(sys/select.h)
 5970 AC_TRY_COMPILE([
 5971 #include <sys/types.h>
 5972 #include <sys/select.h>],
 5973 	[fd_set x; (void)x],
 5974 	[cf_cv_type_fd_set=sys/select.h],
 5975 	[cf_cv_type_fd_set=unknown])])])])
 5976 if test $cf_cv_type_fd_set = sys/select.h ; then
 5977 	AC_DEFINE(USE_SYS_SELECT_H,1,[Define to 1 to include sys/select.h to declare fd_set])
 5978 fi
 5979 ])
 5980 dnl ---------------------------------------------------------------------------
 5981 dnl CF_TYPE_OUTCHAR version: 15 updated: 2015/05/15 19:42:24
 5982 dnl ---------------
 5983 dnl Check for return and param type of 3rd -- OutChar() -- param of tputs().
 5984 dnl
 5985 dnl For this check, and for CF_CURSES_TERMCAP, the $CHECK_DECL_HDRS variable
 5986 dnl must point to a header file containing this (or equivalent):
 5987 dnl
 5988 dnl	#ifdef NEED_CURSES_H
 5989 dnl	# ifdef HAVE_NCURSES_NCURSES_H
 5990 dnl	#  include <ncurses/ncurses.h>
 5991 dnl	# else
 5992 dnl	#  ifdef HAVE_NCURSES_H
 5993 dnl	#   include <ncurses.h>
 5994 dnl	#  else
 5995 dnl	#   include <curses.h>
 5996 dnl	#  endif
 5997 dnl	# endif
 5998 dnl	#endif
 5999 dnl
 6000 dnl	#ifdef HAVE_NCURSES_TERM_H
 6001 dnl	#  include <ncurses/term.h>
 6002 dnl	#else
 6003 dnl	# ifdef HAVE_TERM_H
 6004 dnl	#  include <term.h>
 6005 dnl	# endif
 6006 dnl	#endif
 6007 dnl
 6008 dnl	#if NEED_TERMCAP_H
 6009 dnl	# include <termcap.h>
 6010 dnl	#endif
 6011 dnl
 6012 AC_DEFUN([CF_TYPE_OUTCHAR],
 6013 [
 6014 AC_REQUIRE([CF_CURSES_TERMCAP])
 6015 
 6016 AC_CACHE_CHECK(declaration of tputs 3rd param, cf_cv_type_outchar,[
 6017 
 6018 cf_cv_type_outchar="int OutChar(int)"
 6019 cf_cv_found=no
 6020 cf_save_CPPFLAGS="$CPPFLAGS"
 6021 CPPFLAGS="$CPPFLAGS $CHECK_DECL_FLAG"
 6022 
 6023 for P in int void; do
 6024 for Q in int void; do
 6025 for R in int char; do
 6026 for S in "" const; do
 6027 	CF_MSG_LOG(loop variables [P:[$]P, Q:[$]Q, R:[$]R, S:[$]S])
 6028 	AC_TRY_COMPILE([$CHECK_DECL_HDRS],
 6029 	[extern $Q OutChar($R);
 6030 	extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
 6031 	tputs("", 1, OutChar)],
 6032 	[cf_cv_type_outchar="$Q OutChar($R)"
 6033 	 cf_cv_found=yes
 6034 	 break])
 6035 done
 6036 	test $cf_cv_found = yes && break
 6037 done
 6038 	test $cf_cv_found = yes && break
 6039 done
 6040 	test $cf_cv_found = yes && break
 6041 done
 6042 ])
 6043 
 6044 case $cf_cv_type_outchar in
 6045 int*)
 6046 	AC_DEFINE(OUTC_RETURN,1,[Define to 1 if tputs outc function returns a value])
 6047 	;;
 6048 esac
 6049 case $cf_cv_type_outchar in
 6050 *char*)
 6051 	AC_DEFINE(OUTC_ARGS,char c,[Define to actual type to override tputs outc parameter type])
 6052 	;;
 6053 esac
 6054 
 6055 CPPFLAGS="$cf_save_CPPFLAGS"
 6056 ])dnl
 6057 dnl ---------------------------------------------------------------------------
 6058 dnl CF_TYPE_SIGACTION version: 4 updated: 2012/10/06 17:56:13
 6059 dnl -----------------
 6060 dnl
 6061 AC_DEFUN([CF_TYPE_SIGACTION],
 6062 [
 6063 AC_MSG_CHECKING([for type sigaction_t])
 6064 AC_CACHE_VAL(cf_cv_type_sigaction,[
 6065 	AC_TRY_COMPILE([
 6066 #include <signal.h>],
 6067 		[sigaction_t x],
 6068 		[cf_cv_type_sigaction=yes],
 6069 		[cf_cv_type_sigaction=no])])
 6070 AC_MSG_RESULT($cf_cv_type_sigaction)
 6071 test "$cf_cv_type_sigaction" = yes && AC_DEFINE(HAVE_TYPE_SIGACTION,1,[Define to 1 if we have the sigaction_t type])
 6072 ])dnl
 6073 dnl ---------------------------------------------------------------------------
 6074 dnl CF_UNION_WAIT version: 9 updated: 2021/06/08 18:08:14
 6075 dnl -------------
 6076 dnl Check to see if the BSD-style union wait is declared.  Some platforms may
 6077 dnl use this, though it is deprecated in favor of the 'int' type in Posix.
 6078 dnl Some vendors provide a bogus implementation that declares union wait, but
 6079 dnl uses the 'int' type instead; we try to spot these by checking for the
 6080 dnl associated macros.
 6081 dnl
 6082 dnl Ahem.  Some implementers cast the status value to an int*, as an attempt to
 6083 dnl use the macros for either union wait or int.  So we do a check compile to
 6084 dnl see if the macros are defined and apply to an int.
 6085 dnl
 6086 dnl Sets: $cf_cv_type_unionwait
 6087 dnl Defines: HAVE_TYPE_UNIONWAIT
 6088 AC_DEFUN([CF_UNION_WAIT],
 6089 [
 6090 AC_REQUIRE([CF_WAIT_HEADERS])
 6091 AC_MSG_CHECKING([for union wait])
 6092 AC_CACHE_VAL(cf_cv_type_unionwait,[
 6093 	AC_TRY_LINK($cf_wait_headers,
 6094 	[static int x;
 6095 	 int y = WEXITSTATUS(x);
 6096 	 int z = WTERMSIG(x);
 6097 	 wait(&x);
 6098 	 (void)x;
 6099 	 (void)y;
 6100 	 (void)z;
 6101 	],
 6102 	[cf_cv_type_unionwait=no
 6103 	 echo compiles ok w/o union wait 1>&AC_FD_CC
 6104 	],[
 6105 	AC_TRY_LINK($cf_wait_headers,
 6106 	[union wait x;
 6107 #ifdef WEXITSTATUS
 6108 	 int y = WEXITSTATUS(x);
 6109 #endif
 6110 #ifdef WTERMSIG
 6111 	 int z = WTERMSIG(x);
 6112 #endif
 6113 	 wait(&x);
 6114 	 (void)x;
 6115 #ifdef WEXITSTATUS
 6116 	 (void)y;
 6117 #endif
 6118 #ifdef WTERMSIG
 6119 	 (void)z;
 6120 #endif
 6121 	],
 6122 	[cf_cv_type_unionwait=yes
 6123 	 echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC
 6124 	],
 6125 	[cf_cv_type_unionwait=no])])])
 6126 AC_MSG_RESULT($cf_cv_type_unionwait)
 6127 test "$cf_cv_type_unionwait" = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT,1,[Define to 1 if type unionwait is declared])
 6128 ])dnl
 6129 dnl ---------------------------------------------------------------------------
 6130 dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
 6131 dnl --------
 6132 dnl Make an uppercase version of a variable
 6133 dnl $1=uppercase($2)
 6134 AC_DEFUN([CF_UPPER],
 6135 [
 6136 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 6137 ])dnl
 6138 dnl ---------------------------------------------------------------------------
 6139 dnl CF_VA_COPY version: 6 updated: 2018/12/04 18:14:25
 6140 dnl ----------
 6141 dnl check for va_copy, part of stdarg.h starting with ISO C 1999.
 6142 dnl Also, workaround for glibc's __va_copy, by checking for both.
 6143 dnl Finally, try to accommodate pre-ISO C 1999 headers.
 6144 AC_DEFUN([CF_VA_COPY],[
 6145 AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[
 6146 AC_TRY_LINK([
 6147 #include <stdarg.h>
 6148 ],[
 6149 	static va_list dst;
 6150 	static va_list src;
 6151 	va_copy(dst, src)],
 6152 	cf_cv_have_va_copy=yes,
 6153 	cf_cv_have_va_copy=no)])
 6154 
 6155 if test "$cf_cv_have_va_copy" = yes;
 6156 then
 6157 	AC_DEFINE(HAVE_VA_COPY,1,[Define to 1 if we have va_copy])
 6158 else # !cf_cv_have_va_copy
 6159 
 6160 AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[
 6161 AC_TRY_LINK([
 6162 #include <stdarg.h>
 6163 ],[
 6164 	static va_list dst;
 6165 	static va_list src;
 6166 	__va_copy(dst, src)],
 6167 	cf_cv_have___va_copy=yes,
 6168 	cf_cv_have___va_copy=no)])
 6169 
 6170 if test "$cf_cv_have___va_copy" = yes
 6171 then
 6172 	AC_DEFINE(HAVE___VA_COPY,1,[Define to 1 if we have __va_copy])
 6173 else # !cf_cv_have___va_copy
 6174 
 6175 AC_CACHE_CHECK(for __builtin_va_copy, cf_cv_have___builtin_va_copy,[
 6176 AC_TRY_LINK([
 6177 #include <stdarg.h>
 6178 ],[
 6179 	static va_list dst;
 6180 	static va_list src;
 6181 	__builtin_va_copy(dst, src)],
 6182 	cf_cv_have___builtin_va_copy=yes,
 6183 	cf_cv_have___builtin_va_copy=no)])
 6184 
 6185 test "$cf_cv_have___builtin_va_copy" = yes &&
 6186 	AC_DEFINE(HAVE___BUILTIN_VA_COPY,1,[Define to 1 if we have __builtin_va_copy])
 6187 
 6188 fi # cf_cv_have___va_copy
 6189 
 6190 fi # cf_cv_have_va_copy
 6191 
 6192 case "${cf_cv_have_va_copy}${cf_cv_have___va_copy}${cf_cv_have___builtin_va_copy}" in
 6193 *yes*)
 6194 	;;
 6195 
 6196 *)
 6197 	AC_CACHE_CHECK(if we can simply copy va_list, cf_cv_pointer_va_list,[
 6198 AC_TRY_LINK([
 6199 #include <stdarg.h>
 6200 ],[
 6201 	va_list dst;
 6202 	va_list src;
 6203 	dst = src],
 6204 	cf_cv_pointer_va_list=yes,
 6205 	cf_cv_pointer_va_list=no)])
 6206 
 6207 	if test "$cf_cv_pointer_va_list" = no
 6208 	then
 6209 		AC_CACHE_CHECK(if we can copy va_list indirectly, cf_cv_array_va_list,[
 6210 AC_TRY_LINK([
 6211 #include <stdarg.h>
 6212 ],[
 6213 	va_list dst;
 6214 	va_list src;
 6215 	*dst = *src],
 6216 			cf_cv_array_va_list=yes,
 6217 			cf_cv_array_va_list=no)])
 6218 		test "$cf_cv_array_va_list" = yes && AC_DEFINE(ARRAY_VA_LIST,1,[Define to 1 if we can copy va_list indirectly])
 6219 	fi
 6220 	;;
 6221 esac
 6222 ])
 6223 dnl ---------------------------------------------------------------------------
 6224 dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
 6225 dnl ----------
 6226 dnl Use AC_VERBOSE w/o the warnings
 6227 AC_DEFUN([CF_VERBOSE],
 6228 [test -n "$verbose" && echo "	$1" 1>&AC_FD_MSG
 6229 CF_MSG_LOG([$1])
 6230 ])dnl
 6231 dnl ---------------------------------------------------------------------------
 6232 dnl CF_WAIT_HEADERS version: 3 updated: 2021/01/02 09:31:20
 6233 dnl ---------------
 6234 dnl Build up an expression $cf_wait_headers with the header files needed to
 6235 dnl compile against the prototypes for 'wait()', 'waitpid()', etc.  Assume it's
 6236 dnl Posix, which uses <sys/types.h> and <sys/wait.h>, but allow SVr4 variation
 6237 dnl with <wait.h>.
 6238 AC_DEFUN([CF_WAIT_HEADERS],
 6239 [
 6240 AC_HAVE_HEADERS(sys/wait.h)
 6241 cf_wait_headers="#include <sys/types.h>
 6242 "
 6243 if test "$ac_cv_header_sys_wait_h" = yes; then
 6244 cf_wait_headers="$cf_wait_headers
 6245 #include <sys/wait.h>
 6246 "
 6247 else
 6248 AC_HAVE_HEADERS(wait.h)
 6249 AC_HAVE_HEADERS(waitstatus.h)
 6250 if test "$ac_cv_header_wait_h" = yes; then
 6251 cf_wait_headers="$cf_wait_headers
 6252 #include <wait.h>
 6253 "
 6254 fi
 6255 if test "$ac_cv_header_waitstatus_h" = yes; then
 6256 cf_wait_headers="$cf_wait_headers
 6257 #include <waitstatus.h>
 6258 "
 6259 fi
 6260 fi
 6261 ])dnl
 6262 dnl ---------------------------------------------------------------------------
 6263 dnl CF_WITH_CURSES_DIR version: 4 updated: 2021/01/02 19:22:58
 6264 dnl ------------------
 6265 dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
 6266 dnl libraries.
 6267 AC_DEFUN([CF_WITH_CURSES_DIR],[
 6268 
 6269 AC_MSG_CHECKING(for specific curses-directory)
 6270 AC_ARG_WITH(curses-dir,
 6271 	[  --with-curses-dir=DIR   directory in which (n)curses is installed],
 6272 	[cf_cv_curses_dir=$withval],
 6273 	[cf_cv_curses_dir=no])
 6274 AC_MSG_RESULT($cf_cv_curses_dir)
 6275 
 6276 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no"
 6277 then
 6278 	CF_PATH_SYNTAX(withval)
 6279 	if test -d "$cf_cv_curses_dir"
 6280 	then
 6281 		CF_ADD_INCDIR($cf_cv_curses_dir/include)
 6282 		CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
 6283 	fi
 6284 fi
 6285 ])dnl
 6286 dnl ---------------------------------------------------------------------------
 6287 dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
 6288 dnl ----------------
 6289 dnl Configure-option for dbmalloc.  The optional parameter is used to override
 6290 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
 6291 AC_DEFUN([CF_WITH_DBMALLOC],[
 6292 CF_NO_LEAKS_OPTION(dbmalloc,
 6293 	[  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
 6294 	[USE_DBMALLOC])
 6295 
 6296 if test "$with_dbmalloc" = yes ; then
 6297 	AC_CHECK_HEADER(dbmalloc.h,
 6298 		[AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
 6299 fi
 6300 ])dnl
 6301 dnl ---------------------------------------------------------------------------
 6302 dnl CF_WITH_DFTENV version: 6 updated: 2019/12/31 20:39:42
 6303 dnl --------------
 6304 dnl Wrapper for AC_ARG_WITH to inherit/override an environment variable's
 6305 dnl "#define" in the compile.
 6306 dnl $1 = option name
 6307 dnl $2 = help-message
 6308 dnl $3 = name of variable to inherit/override
 6309 dnl $4 = default value of variable, if any
 6310 AC_DEFUN([CF_WITH_DFTENV],
 6311 [AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),,
 6312 ifelse($4,,[withval="${$3}"],[withval="${$3-$4}"]))
 6313 case "$withval" in #(vi
 6314 yes|no)
 6315   AC_MSG_ERROR(expected a value for --with-$1)
 6316   ;;
 6317 esac
 6318 $3="$withval"
 6319 AC_DEFINE_UNQUOTED($3,"[$]$3",[Define $2])dnl
 6320 ])dnl
 6321 dnl ---------------------------------------------------------------------------
 6322 dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
 6323 dnl ---------------
 6324 dnl Configure-option for dmalloc.  The optional parameter is used to override
 6325 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
 6326 AC_DEFUN([CF_WITH_DMALLOC],[
 6327 CF_NO_LEAKS_OPTION(dmalloc,
 6328 	[  --with-dmalloc          test: use Gray Watson's dmalloc library],
 6329 	[USE_DMALLOC])
 6330 
 6331 if test "$with_dmalloc" = yes ; then
 6332 	AC_CHECK_HEADER(dmalloc.h,
 6333 		[AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
 6334 fi
 6335 ])dnl
 6336 dnl ---------------------------------------------------------------------------
 6337 dnl CF_WITH_PATH version: 12 updated: 2021/09/04 06:35:04
 6338 dnl ------------
 6339 dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
 6340 dnl defaulting to yes/no.
 6341 dnl
 6342 dnl $1 = option name
 6343 dnl $2 = help-text
 6344 dnl $3 = environment variable to set
 6345 dnl $4 = default value, shown in the help-message, must be a constant
 6346 dnl $5 = default value, if it is an expression & cannot be in the help-message
 6347 dnl
 6348 AC_DEFUN([CF_WITH_PATH],
 6349 [AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),,
 6350 ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl
 6351 if ifelse([$5],,true,[test -n "$5"]) ; then
 6352 CF_PATH_SYNTAX(withval)
 6353 fi
 6354 eval $3="$withval"
 6355 AC_SUBST($3)dnl
 6356 ])dnl
 6357 dnl ---------------------------------------------------------------------------
 6358 dnl CF_WITH_PROGRAM version: 7 updated: 2019/12/31 20:39:42
 6359 dnl ---------------
 6360 dnl Wrapper for AC_PATH_PROG, with command-line option.
 6361 dnl Params:
 6362 dnl $1 = program name
 6363 dnl $2 = help-string (I'd use format, but someone's disable it in autoconf)
 6364 dnl $3 = caller-supplied default if no --with option is given.  If this is
 6365 dnl      blank, the macro uses AC_PATH_PROG.
 6366 AC_DEFUN([CF_WITH_PROGRAM],
 6367 [dnl
 6368 define([cf_path_name], PATH_[]translit($1, [a-z], [A-Z]))dnl
 6369 define([cf_have_name], HAVE_[]translit($1, [a-z], [A-Z]))dnl
 6370 AC_ARG_WITH($1,[$2],ifelse($3,,
 6371 [case "$withval" in #(vi
 6372   yes[)]
 6373    AC_MSG_ERROR(expected a value for --with-$1)
 6374    ;; #(vi
 6375   no[)]
 6376    ;; #(vi
 6377   *[)]
 6378    # user supplied option-value for "--with-$1=path"
 6379    AC_MSG_CHECKING(for $1)
 6380    ac_cv_path_]cf_path_name[="$withval"
 6381    AC_DEFINE_UNQUOTED(cf_path_name,"$withval",[Define this to the pathname for $1])dnl
 6382    AC_DEFINE(cf_have_name,1,[Define this to 1 if the $1 program exists])dnl
 6383    AC_MSG_RESULT($withval)
 6384    ;;
 6385  esac],[$3]),[
 6386   # user did not specify "--with-$1"; do automatic check
 6387   AC_PATH_PROG(cf_path_name,$1)
 6388   if test -n "$cf_path_name"; then
 6389     AC_DEFINE_UNQUOTED(cf_path_name,"$cf_path_name")dnl
 6390     AC_DEFINE(cf_have_name)dnl
 6391   fi
 6392 ])dnl
 6393 undefine([cf_path_name])undefine([cf_have_name])])dnl
 6394 dnl ---------------------------------------------------------------------------
 6395 dnl CF_WITH_VALUE version: 4 updated: 2019/12/31 20:39:42
 6396 dnl -------------
 6397 dnl Wrapper for AC_ARG_WITH to ensure that if the user supplies a value, it is
 6398 dnl not simply defaulting to yes/no.  Empty strings are ok if the macro is
 6399 dnl invoked without a default value
 6400 dnl $1 = option name
 6401 dnl $2 = help-message
 6402 dnl $3 = variable to inherit/override
 6403 dnl $4 = default value, if any.
 6404 AC_DEFUN([CF_WITH_VALUE],
 6405 [CF_ARG_WITH($1,[$2],[$3],[$4])
 6406  AC_DEFINE_UNQUOTED($3,"$withval",[Define a value for $1])dnl
 6407 ])dnl
 6408 dnl ---------------------------------------------------------------------------
 6409 dnl CF_XOPEN_CURSES version: 17 updated: 2021/07/10 12:22:27
 6410 dnl ---------------
 6411 dnl Test if we should define X/Open source for curses, needed on Digital Unix
 6412 dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
 6413 dnl
 6414 dnl The getbegyx() check is needed for HPUX, which omits legacy macros such
 6415 dnl as getbegy().  The latter is better design, but the former is standard.
 6416 AC_DEFUN([CF_XOPEN_CURSES],
 6417 [
 6418 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
 6419 AC_CACHE_CHECK(definition to turn on extended curses functions,cf_cv_need_xopen_extension,[
 6420 cf_cv_need_xopen_extension=unknown
 6421 AC_TRY_LINK([
 6422 #include <stdlib.h>
 6423 #include <${cf_cv_ncurses_header:-curses.h}>],[
 6424 #if defined(NCURSES_VERSION_PATCH)
 6425 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
 6426 	make an error
 6427 #endif
 6428 #endif
 6429 #ifdef NCURSES_WIDECHAR
 6430 make an error	/* prefer to fall-through on the second checks */
 6431 #endif
 6432 	cchar_t check;
 6433 	int check2 = curs_set((int)sizeof(check));
 6434 	long x = winnstr(stdscr, "", 0);
 6435 	int x1, y1;
 6436 	(void)check2;
 6437 	getbegyx(stdscr, y1, x1);
 6438 	(void)x;
 6439 	(void)y1;
 6440 	(void)x1;
 6441 	],
 6442 	[cf_cv_need_xopen_extension=none],
 6443 	[
 6444 	for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
 6445 	do
 6446 		AC_TRY_LINK([
 6447 #define $cf_try_xopen_extension 1
 6448 #include <stdlib.h>
 6449 #include <${cf_cv_ncurses_header:-curses.h}>],[
 6450 		cchar_t check;
 6451 		int check2 = curs_set((int)sizeof(check));
 6452 		long x = winnstr(stdscr, "", 0);
 6453 		int x1, y1;
 6454 		getbegyx(stdscr, y1, x1);
 6455 		(void)check2;
 6456 		(void)x;
 6457 		(void)y1;
 6458 		(void)x1;
 6459 		],
 6460 		[cf_cv_need_xopen_extension=$cf_try_xopen_extension; break])
 6461 	done
 6462 	])
 6463 ])
 6464 
 6465 case "$cf_cv_need_xopen_extension" in
 6466 *_*)
 6467 	CF_APPEND_TEXT(CPPFLAGS,-D$cf_cv_need_xopen_extension)
 6468 	;;
 6469 esac
 6470 
 6471 ])dnl
 6472 dnl ---------------------------------------------------------------------------
 6473 dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37
 6474 dnl ---------------
 6475 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
 6476 dnl or adapt to the vendor's definitions to get equivalent functionality,
 6477 dnl without losing the common non-POSIX features.
 6478 dnl
 6479 dnl Parameters:
 6480 dnl	$1 is the nominal value for _XOPEN_SOURCE
 6481 dnl	$2 is the nominal value for _POSIX_C_SOURCE
 6482 AC_DEFUN([CF_XOPEN_SOURCE],[
 6483 AC_REQUIRE([AC_CANONICAL_HOST])
 6484 AC_REQUIRE([CF_POSIX_VISIBLE])
 6485 
 6486 if test "$cf_cv_posix_visible" = no; then
 6487 
 6488 cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
 6489 cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
 6490 cf_xopen_source=
 6491 
 6492 case "$host_os" in
 6493 aix[[4-7]]*)
 6494 	cf_xopen_source="-D_ALL_SOURCE"
 6495 	;;
 6496 msys)
 6497 	cf_XOPEN_SOURCE=600
 6498 	;;
 6499 darwin[[0-8]].*)
 6500 	cf_xopen_source="-D_APPLE_C_SOURCE"
 6501 	;;
 6502 darwin*)
 6503 	cf_xopen_source="-D_DARWIN_C_SOURCE"
 6504 	cf_XOPEN_SOURCE=
 6505 	;;
 6506 freebsd*|dragonfly*|midnightbsd*)
 6507 	# 5.x headers associate
 6508 	#	_XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
 6509 	#	_XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
 6510 	cf_POSIX_C_SOURCE=200112L
 6511 	cf_XOPEN_SOURCE=600
 6512 	cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
 6513 	;;
 6514 hpux11*)
 6515 	cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
 6516 	;;
 6517 hpux*)
 6518 	cf_xopen_source="-D_HPUX_SOURCE"
 6519 	;;
 6520 irix[[56]].*)
 6521 	cf_xopen_source="-D_SGI_SOURCE"
 6522 	cf_XOPEN_SOURCE=
 6523 	;;
 6524 linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
 6525 	CF_GNU_SOURCE($cf_XOPEN_SOURCE)
 6526 	;;
 6527 minix*)
 6528 	cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
 6529 	;;
 6530 mirbsd*)
 6531 	# setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
 6532 	cf_XOPEN_SOURCE=
 6533 	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
 6534 	;;
 6535 netbsd*)
 6536 	cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
 6537 	;;
 6538 openbsd[[6-9]]*)
 6539 	# OpenBSD 6.x has broken locale support, both compile-time and runtime.
 6540 	# see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
 6541 	# Abusing the conformance level is a workaround.
 6542 	AC_MSG_WARN(this system does not provide usable locale support)
 6543 	cf_xopen_source="-D_BSD_SOURCE"
 6544 	cf_XOPEN_SOURCE=700
 6545 	;;
 6546 openbsd[[4-5]]*)
 6547 	# setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
 6548 	cf_xopen_source="-D_BSD_SOURCE"
 6549 	cf_XOPEN_SOURCE=600
 6550 	;;
 6551 openbsd*)
 6552 	# setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
 6553 	;;
 6554 osf[[45]]*)
 6555 	cf_xopen_source="-D_OSF_SOURCE"
 6556 	;;
 6557 nto-qnx*)
 6558 	cf_xopen_source="-D_QNX_SOURCE"
 6559 	;;
 6560 sco*)
 6561 	# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
 6562 	;;
 6563 solaris2.*)
 6564 	cf_xopen_source="-D__EXTENSIONS__"
 6565 	cf_cv_xopen_source=broken
 6566 	;;
 6567 sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
 6568 	cf_XOPEN_SOURCE=
 6569 	cf_POSIX_C_SOURCE=
 6570 	;;
 6571 *)
 6572 	CF_TRY_XOPEN_SOURCE
 6573 	CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
 6574 	;;
 6575 esac
 6576 
 6577 if test -n "$cf_xopen_source" ; then
 6578 	CF_APPEND_CFLAGS($cf_xopen_source,true)
 6579 fi
 6580 
 6581 dnl In anything but the default case, we may have system-specific setting
 6582 dnl which is still not guaranteed to provide all of the entrypoints that
 6583 dnl _XOPEN_SOURCE would yield.
 6584 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
 6585 	AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
 6586 	AC_TRY_COMPILE([#include <stdlib.h>],[
 6587 #ifndef _XOPEN_SOURCE
 6588 make an error
 6589 #endif],
 6590 	[cf_XOPEN_SOURCE_set=yes],
 6591 	[cf_XOPEN_SOURCE_set=no])
 6592 	AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
 6593 	if test "$cf_XOPEN_SOURCE_set" = yes
 6594 	then
 6595 		AC_TRY_COMPILE([#include <stdlib.h>],[
 6596 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
 6597 make an error
 6598 #endif],
 6599 		[cf_XOPEN_SOURCE_set_ok=yes],
 6600 		[cf_XOPEN_SOURCE_set_ok=no])
 6601 		if test "$cf_XOPEN_SOURCE_set_ok" = no
 6602 		then
 6603 			AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
 6604 		fi
 6605 	else
 6606 		CF_TRY_XOPEN_SOURCE
 6607 	fi
 6608 fi
 6609 fi # cf_cv_posix_visible
 6610 ])
 6611 dnl ---------------------------------------------------------------------------
 6612 dnl CF_X_ATHENA version: 24 updated: 2020/03/10 18:53:47
 6613 dnl -----------
 6614 dnl Check for Xaw (Athena) libraries
 6615 dnl
 6616 dnl Sets $cf_x_athena according to the flavor of Xaw which is used.
 6617 AC_DEFUN([CF_X_ATHENA],
 6618 [
 6619 cf_x_athena=${cf_x_athena:-Xaw}
 6620 
 6621 AC_MSG_CHECKING(if you want to link with Xaw 3d library)
 6622 withval=
 6623 AC_ARG_WITH(Xaw3d,
 6624 	[  --with-Xaw3d            link with Xaw 3d library])
 6625 if test "$withval" = yes ; then
 6626 	cf_x_athena=Xaw3d
 6627 	AC_MSG_RESULT(yes)
 6628 else
 6629 	AC_MSG_RESULT(no)
 6630 fi
 6631 
 6632 AC_MSG_CHECKING(if you want to link with Xaw 3d xft library)
 6633 withval=
 6634 AC_ARG_WITH(Xaw3dxft,
 6635 	[  --with-Xaw3dxft         link with Xaw 3d xft library])
 6636 if test "$withval" = yes ; then
 6637 	cf_x_athena=Xaw3dxft
 6638 	AC_MSG_RESULT(yes)
 6639 else
 6640 	AC_MSG_RESULT(no)
 6641 fi
 6642 
 6643 AC_MSG_CHECKING(if you want to link with neXT Athena library)
 6644 withval=
 6645 AC_ARG_WITH(neXtaw,
 6646 	[  --with-neXtaw           link with neXT Athena library])
 6647 if test "$withval" = yes ; then
 6648 	cf_x_athena=neXtaw
 6649 	AC_MSG_RESULT(yes)
 6650 else
 6651 	AC_MSG_RESULT(no)
 6652 fi
 6653 
 6654 AC_MSG_CHECKING(if you want to link with Athena-Plus library)
 6655 withval=
 6656 AC_ARG_WITH(XawPlus,
 6657 	[  --with-XawPlus          link with Athena-Plus library])
 6658 if test "$withval" = yes ; then
 6659 	cf_x_athena=XawPlus
 6660 	AC_MSG_RESULT(yes)
 6661 else
 6662 	AC_MSG_RESULT(no)
 6663 fi
 6664 
 6665 cf_x_athena_lib=""
 6666 
 6667 if test "$PKG_CONFIG" != none ; then
 6668 	cf_athena_list=
 6669 	test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
 6670 	for cf_athena_pkg in \
 6671 		$cf_athena_list \
 6672 		${cf_x_athena} \
 6673 		${cf_x_athena}-devel \
 6674 		lib${cf_x_athena} \
 6675 		lib${cf_x_athena}-devel
 6676 	do
 6677 		CF_TRY_PKG_CONFIG($cf_athena_pkg,[
 6678 			cf_x_athena_lib="$cf_pkgconfig_libs"
 6679 			CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
 6680 			AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
 6681 
 6682 			CF_TRIM_X_LIBS
 6683 
 6684 AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[
 6685 AC_TRY_LINK([
 6686 #include <X11/Xmu/CharSet.h>
 6687 ],[
 6688 int check = XmuCompareISOLatin1("big", "small");
 6689 (void)check;
 6690 ],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
 6691 
 6692 			if test "$cf_cv_xaw_compat" = no
 6693 			then
 6694 				# workaround for broken ".pc" files...
 6695 				case "$cf_x_athena_lib" in
 6696 				*-lXmu*)
 6697 					;;
 6698 				*)
 6699 					CF_VERBOSE(work around broken package)
 6700 					cf_save_xmu="$LIBS"
 6701 					cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^[ ][ ]*//' -e 's/ .*//'`
 6702 					CF_TRY_PKG_CONFIG(xmu,[
 6703 							LIBS="$cf_save_xmu"
 6704 							CF_ADD_LIB_AFTER($cf_first_lib,$cf_pkgconfig_libs)
 6705 						],[
 6706 							CF_ADD_LIB_AFTER($cf_first_lib,-lXmu)
 6707 						])
 6708 					CF_TRIM_X_LIBS
 6709 					;;
 6710 				esac
 6711 			fi
 6712 
 6713 			break])
 6714 	done
 6715 fi
 6716 
 6717 if test -z "$cf_x_athena_lib" ; then
 6718 	CF_X_EXT
 6719 	CF_X_TOOLKIT
 6720 	CF_X_ATHENA_CPPFLAGS($cf_x_athena)
 6721 	CF_X_ATHENA_LIBS($cf_x_athena)
 6722 fi
 6723 ])dnl
 6724 dnl ---------------------------------------------------------------------------
 6725 dnl CF_X_ATHENA_CPPFLAGS version: 9 updated: 2020/12/31 10:54:15
 6726 dnl --------------------
 6727 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
 6728 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
 6729 AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
 6730 [
 6731 AC_REQUIRE([AC_PATH_XTRA])
 6732 cf_x_athena_root=ifelse([$1],,Xaw,[$1])
 6733 cf_x_athena_inc=""
 6734 
 6735 for cf_path in default \
 6736 	/usr/contrib/X11R6 \
 6737 	/usr/contrib/X11R5 \
 6738 	/usr/lib/X11R5 \
 6739 	/usr/local
 6740 do
 6741 	if test -z "$cf_x_athena_inc" ; then
 6742 		CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS])
 6743 		cf_test=X11/$cf_x_athena_root/SimpleMenu.h
 6744 		if test "$cf_path" != default ; then
 6745 			CF_APPEND_TEXT(CPPFLAGS,-I$cf_path/include)
 6746 			AC_MSG_CHECKING(for $cf_test in $cf_path)
 6747 		else
 6748 			AC_MSG_CHECKING(for $cf_test)
 6749 		fi
 6750 		AC_TRY_COMPILE([
 6751 #include <X11/Intrinsic.h>
 6752 #include <$cf_test>],[],
 6753 			[cf_result=yes],
 6754 			[cf_result=no])
 6755 		AC_MSG_RESULT($cf_result)
 6756 		CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_CPPFLAGS])
 6757 		if test "$cf_result" = yes ; then
 6758 			test "$cf_path"  = default && cf_x_athena_inc=default
 6759 			test "$cf_path" != default && cf_x_athena_inc="$cf_path/include"
 6760 			break
 6761 		fi
 6762 	fi
 6763 done
 6764 
 6765 if test -z "$cf_x_athena_inc" ; then
 6766 	AC_MSG_WARN([Unable to find Athena header files])
 6767 elif test "$cf_x_athena_inc" != default ; then
 6768 	CF_APPEND_TEXT(CPPFLAGS,-I$cf_x_athena_inc)
 6769 fi
 6770 ])
 6771 dnl ---------------------------------------------------------------------------
 6772 dnl CF_X_ATHENA_LIBS version: 13 updated: 2020/01/11 18:16:10
 6773 dnl ----------------
 6774 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
 6775 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
 6776 AC_DEFUN([CF_X_ATHENA_LIBS],
 6777 [AC_REQUIRE([CF_X_TOOLKIT])
 6778 cf_x_athena_root=ifelse([$1],,Xaw,[$1])
 6779 cf_x_athena_lib=""
 6780 
 6781 for cf_path in default \
 6782 	/usr/contrib/X11R6 \
 6783 	/usr/contrib/X11R5 \
 6784 	/usr/lib/X11R5 \
 6785 	/usr/local
 6786 do
 6787 	for cf_lib in \
 6788 		${cf_x_athena_root} \
 6789 		${cf_x_athena_root}7 \
 6790 		${cf_x_athena_root}6
 6791 	do
 6792 	for cf_libs in \
 6793 		"-l$cf_lib -lXmu" \
 6794 		"-l$cf_lib -lXpm -lXmu" \
 6795 		"-l${cf_lib}_s -lXmu_s"
 6796 	do
 6797 		test -n "$cf_x_athena_lib" && break
 6798 
 6799 		CF_SAVE_XTRA_FLAGS([CF_X_ATHENA_LIBS])
 6800 		cf_test=XawSimpleMenuAddGlobalActions
 6801 		test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
 6802 		CF_ADD_LIBS($cf_libs)
 6803 		AC_MSG_CHECKING(for $cf_test in $cf_libs)
 6804 		AC_TRY_LINK([
 6805 #include <X11/Intrinsic.h>
 6806 #include <X11/$cf_x_athena_root/SimpleMenu.h>
 6807 ],[
 6808 $cf_test((XtAppContext) 0)],
 6809 			[cf_result=yes],
 6810 			[cf_result=no])
 6811 		AC_MSG_RESULT($cf_result)
 6812 		CF_RESTORE_XTRA_FLAGS([CF_X_ATHENA_LIBS])
 6813 
 6814 		if test "$cf_result" = yes ; then
 6815 			cf_x_athena_lib="$cf_libs"
 6816 			break
 6817 		fi
 6818 	done # cf_libs
 6819 		test -n "$cf_x_athena_lib" && break
 6820 	done # cf_lib
 6821 done
 6822 
 6823 if test -z "$cf_x_athena_lib" ; then
 6824 	AC_MSG_ERROR(
 6825 [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
 6826 fi
 6827 
 6828 CF_ADD_LIBS($cf_x_athena_lib)
 6829 CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
 6830 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
 6831 ])
 6832 dnl ---------------------------------------------------------------------------
 6833 dnl CF_X_EXT version: 3 updated: 2010/06/02 05:03:05
 6834 dnl --------
 6835 AC_DEFUN([CF_X_EXT],[
 6836 CF_TRY_PKG_CONFIG(Xext,,[
 6837 	AC_CHECK_LIB(Xext,XextCreateExtension,
 6838 		[CF_ADD_LIB(Xext)])])
 6839 ])dnl
 6840 dnl ---------------------------------------------------------------------------
 6841 dnl CF_X_TOOLKIT version: 26 updated: 2021/01/02 09:31:20
 6842 dnl ------------
 6843 dnl Check for X Toolkit libraries
 6844 AC_DEFUN([CF_X_TOOLKIT],
 6845 [
 6846 AC_REQUIRE([AC_PATH_XTRA])
 6847 AC_REQUIRE([CF_CHECK_CACHE])
 6848 
 6849 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
 6850 # in some cases has installed dummy files in the former, other cases replaced
 6851 # it with a link to the new location).  This complicates the configure script.
 6852 # Check for that pitfall, and recover using pkg-config
 6853 #
 6854 # If none of these are set, the configuration is almost certainly broken.
 6855 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
 6856 then
 6857 	CF_TRY_PKG_CONFIG(x11,,[AC_MSG_WARN(unable to find X11 library)])
 6858 	CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
 6859 	CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
 6860 	CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
 6861 else
 6862 	LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
 6863 fi
 6864 
 6865 cf_have_X_LIBS=no
 6866 
 6867 CF_TRY_PKG_CONFIG(xt,[
 6868 
 6869 	case "x$LIBS" in
 6870 	*-lX11*)
 6871 		;;
 6872 	*)
 6873 # we have an "xt" package, but it may omit Xt's dependency on X11
 6874 AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
 6875 AC_TRY_LINK([
 6876 #include <X11/Xlib.h>
 6877 ],[
 6878 	int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
 6879 	int rc2 = XClearWindow((Display*) 0, (Window) 0);
 6880 	int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
 6881 	int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
 6882 ],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])])
 6883 		if test "$cf_cv_xt_x11_compat" = no
 6884 		then
 6885 			CF_VERBOSE(work around broken X11 dependency)
 6886 			# 2010/11/19 - good enough until a working Xt on Xcb is delivered.
 6887 			CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)])
 6888 		fi
 6889 		;;
 6890 	esac
 6891 
 6892 AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[
 6893 AC_TRY_LINK([
 6894 #include <X11/Shell.h>
 6895 ],[int num = IceConnectionNumber(0); (void) num
 6896 ],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
 6897 
 6898 	if test "$cf_cv_xt_ice_compat" = no
 6899 	then
 6900 		# workaround for broken ".pc" files used for X Toolkit.
 6901 		case "x$X_PRE_LIBS" in
 6902 		*-lICE*)
 6903 			case "x$LIBS" in
 6904 			*-lICE*)
 6905 				;;
 6906 			*)
 6907 				CF_VERBOSE(work around broken ICE dependency)
 6908 				CF_TRY_PKG_CONFIG(ice,
 6909 					[CF_TRY_PKG_CONFIG(sm)],
 6910 					[CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)])
 6911 				;;
 6912 			esac
 6913 			;;
 6914 		esac
 6915 	fi
 6916 
 6917 	cf_have_X_LIBS=yes
 6918 ],[
 6919 
 6920 	LDFLAGS="$X_LIBS $LDFLAGS"
 6921 	CF_CHECK_CFLAGS($X_CFLAGS)
 6922 
 6923 	AC_CHECK_FUNC(XOpenDisplay,,[
 6924 	AC_CHECK_LIB(X11,XOpenDisplay,
 6925 		[CF_ADD_LIB(X11)])])
 6926 
 6927 	AC_CHECK_FUNC(XtAppInitialize,,[
 6928 	AC_CHECK_LIB(Xt, XtAppInitialize,
 6929 		[AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library])
 6930 		 cf_have_X_LIBS=Xt
 6931 		 LIBS="-lXt $LIBS"])])
 6932 ])
 6933 
 6934 if test "$cf_have_X_LIBS" = no ; then
 6935 	AC_MSG_WARN(
 6936 [Unable to successfully link X Toolkit library (-lXt) with
 6937 test program.  You will have to check and add the proper libraries by hand
 6938 to makefile.])
 6939 fi
 6940 ])dnl
 6941 dnl ---------------------------------------------------------------------------
 6942 dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49
 6943 dnl ---------------
 6944 dnl Define a reusable chunk which includes <curses.h> and <term.h> when they
 6945 dnl are both available.
 6946 define([CF__CURSES_HEAD],[
 6947 #ifdef HAVE_XCURSES
 6948 #include <xcurses.h>
 6949 char * XCursesProgramName = "test";
 6950 #else
 6951 #include <${cf_cv_ncurses_header:-curses.h}>
 6952 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
 6953 #include <ncursesw/term.h>
 6954 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
 6955 #include <ncurses/term.h>
 6956 #elif defined(HAVE_TERM_H)
 6957 #include <term.h>
 6958 #endif
 6959 #endif
 6960 ])
 6961 dnl ---------------------------------------------------------------------------
 6962 dnl CF__ICONV_BODY version: 2 updated: 2007/07/26 17:35:47
 6963 dnl --------------
 6964 dnl Test-code needed for iconv compile-checks
 6965 define([CF__ICONV_BODY],[
 6966 	iconv_t cd = iconv_open("","");
 6967 	iconv(cd,NULL,NULL,NULL,NULL);
 6968 	iconv_close(cd);]
 6969 )dnl
 6970 dnl ---------------------------------------------------------------------------
 6971 dnl CF__ICONV_HEAD version: 1 updated: 2007/07/26 15:57:03
 6972 dnl --------------
 6973 dnl Header-files needed for iconv compile-checks
 6974 define([CF__ICONV_HEAD],[
 6975 #include <stdlib.h>
 6976 #include <iconv.h>]
 6977 )dnl
 6978 dnl ---------------------------------------------------------------------------
 6979 dnl CF__INTL_BODY version: 4 updated: 2021/05/19 19:35:25
 6980 dnl -------------
 6981 dnl Test-code needed for libintl compile-checks
 6982 dnl $1 = parameter 2 from AM_WITH_NLS
 6983 define([CF__INTL_BODY],[
 6984 	bindtextdomain ("", "");
 6985 	return (gettext ("") != 0)
 6986 			ifelse([$1], need-ngettext, [ + (ngettext ("", "", 0) != 0)], [])
 6987 #ifndef IGNORE_MSGFMT_HACK
 6988 			[ + _nl_msg_cat_cntr]
 6989 #endif
 6990 ])
 6991 dnl ---------------------------------------------------------------------------
 6992 dnl CF__INTL_HEAD version: 1 updated: 2007/07/26 17:35:47
 6993 dnl -------------
 6994 dnl Header-files needed for libintl compile-checks
 6995 define([CF__INTL_HEAD],[
 6996 #include <libintl.h>
 6997 extern int _nl_msg_cat_cntr;
 6998 ])dnl
 6999 dnl ---------------------------------------------------------------------------
 7000 dnl jm_GLIBC21 version: 4 updated: 2015/05/10 19:52:14
 7001 dnl ----------
 7002 dnl Inserted as requested by gettext 0.10.40
 7003 dnl File from /usr/share/aclocal
 7004 dnl glibc21.m4
 7005 dnl ====================
 7006 dnl serial 2
 7007 dnl
 7008 dnl Test for the GNU C Library, version 2.1 or newer.
 7009 dnl From Bruno Haible.
 7010 AC_DEFUN([jm_GLIBC21],
 7011 [
 7012 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
 7013 	ac_cv_gnu_library_2_1,
 7014 	[AC_EGREP_CPP([Lucky GNU user],
 7015 	[
 7016 #include <features.h>
 7017 #ifdef __GNU_LIBRARY__
 7018  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
 7019   Lucky GNU user
 7020  #endif
 7021 #endif
 7022 	],
 7023 	ac_cv_gnu_library_2_1=yes,
 7024 	ac_cv_gnu_library_2_1=no)])
 7025 	AC_SUBST(GLIBC21)
 7026 	GLIBC21="$ac_cv_gnu_library_2_1"
 7027 ])