"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.4/configure.in" (24 Dec 2019, 38801 Bytes) of package /linux/misc/tin-2.4.4.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. 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 "configure.in": 2.4.3_vs_2.4.4.

    1 dnl Project   : tin - a Usenet reader
    2 dnl Module    : configure.in
    3 dnl Author    : Thomas E. Dickey <dickey@invisible-island.net>
    4 dnl Created   : 1995-08-24
    5 dnl Updated   : 2019-03-12
    6 dnl Notes     :
    7 dnl
    8 dnl Copyright (c) 1995-2020 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 Process this file with autoconf to produce a configure script.
   36 
   37 AC_PREREQ(2.52.20181006)
   38 AC_INIT(include/tin.h)
   39 AC_CONFIG_HEADER(include/autoconf.h:include/autoconf.hin)
   40 AC_PREFIX_DEFAULT(/usr/local)
   41 
   42 dnl PACKAGE is required for GNU gettext
   43 PACKAGE=tin
   44 VERSION=2.4.4
   45 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
   46 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
   47 AC_SUBST(PACKAGE)
   48 AC_SUBST(VERSION)
   49 
   50 EXTRAO_DEP='#'
   51 
   52 CF_CHECK_CACHE
   53 
   54 CF_PATHSEP
   55 CF_WITH_PATH(install-prefix,
   56     [  --with-install-prefix   prefixes actual install location],
   57     DESTDIR,/)
   58 case ".$DESTDIR" in # (vi
   59 ./) DESTDIR=
   60     ;; # (vi
   61 ./*/)   ;; # (vi
   62 ./*)    DESTDIR="$DESTDIR/"
   63     ;;
   64 esac
   65 
   66 AC_ARG_PROGRAM
   67 
   68 ### Compiler/options that autoconf doesn't get right
   69 case "$host_os" in
   70     aix*)   #(vi
   71         if test "$CC" = ""; then
   72             AC_PATH_PROG(XLC, xlc)
   73             if test "$ac_cv_path_XLC" != ""; then
   74                 CC="$ac_cv_path_XLC"
   75             fi
   76         fi
   77         ;;
   78     hpux*)  #(vi
   79         test "$CC" != "cc" && test -z "$CFLAGS" && CFLAGS="-O"
   80         ;;
   81 esac
   82 
   83 ### Native Language Support
   84 ALL_LINGUAS="da de en_GB es et fr ru sv tr zh_CN zh_TW"
   85 
   86 ### Checks for programs
   87 save_CFLAGS="$CFLAGS"
   88 CF_PROG_CC
   89 AC_PROG_GCC_TRADITIONAL
   90 AC_PROG_MAKE_SET
   91 AC_PROG_INSTALL
   92 CF_PROG_YACC
   93 AC_CHECK_PROGS(LINT, lint alint lclint tdlint splint, :)
   94 CF_XOPEN_SOURCE
   95 CF_SIGWINCH
   96 CF_PROG_EXT
   97 CF_LIB_PREFIX(LIB_PREFIX)
   98 AC_PROG_LN_S
   99 
  100 CF_BUILD_CC([-I$(INCDIR)],[])
  101 
  102 dnl These are standard among *NIX systems, but not when cross-compiling
  103 AC_CHECK_TOOL(RANLIB, ranlib, ':')
  104 AC_CHECK_TOOL(LD, ld, ld)
  105 CF_PROG_AR
  106 CF_AR_FLAGS
  107 
  108 case "$host_cpu:$host_vendor:$host_os" in
  109     # check for cygwin environment
  110     # -DSTATIC is needed for pcre
  111     *:*:*cygwin*)   #(vi
  112         PCRE_DEFINES="$PCRE_DEFINES -DSTATIC"
  113         ;;
  114     # SEIUX doesn't have any useful preprocessor symbol
  115     mips:sei:seiux*)    #(vi
  116         AC_DEFINE(SEIUX)
  117         ;;
  118 esac
  119 
  120 dnl TODO: also check for heapsort(3) in libbsd?
  121 AC_MSG_CHECKING(if you would like to use heapsort)
  122 CF_ARG_DISABLE(heapsort,
  123     [  --disable-heapsort      disable heapsort() as alternative to qsort],
  124     [cf_use_heapsort=no],
  125     [cf_use_heapsort=yes])
  126 AC_MSG_RESULT($cf_use_heapsort)
  127 if test "x$cf_use_heapsort" = xyes; then
  128     AC_CHECK_FUNCS(heapsort)
  129     if test x"$ac_cv_func_heapsort" = xyes; then
  130         AC_MSG_CHECKING(if its prototype is compatible with qsort)
  131         AC_TRY_COMPILE([
  132 #include <stdlib.h>
  133 #include <sys/types.h>
  134 extern int my_compare(const void *, const void *);
  135 ],[
  136     char *base = 0;
  137     heapsort((void *)0, 1, 2, my_compare);
  138 ],,[cf_use_heapsort=no]);
  139         AC_MSG_RESULT($cf_use_heapsort)
  140     else
  141         CF_VERBOSE(will use our own heapsort function)
  142         EXTRAO_DEP=''
  143         EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/heapsort.o"
  144     fi
  145 fi
  146 if test "x$cf_use_heapsort" = xyes; then
  147     AC_DEFINE(USE_HEAPSORT)
  148 fi
  149 
  150 CF_WITH_PROGRAM(ispell,
  151 [  --with-ispell           (default: from system path)])
  152 
  153 CF_WITH_PROGRAM(metamail,
  154 [  --with-metamail         (default: from system path)])
  155 
  156 CF_WITH_PROGRAM(sum,
  157 [  --with-sum              (default: from system path)])
  158 CF_PROG_SUM_R
  159 
  160 CF_PATH_EDITOR
  161 CF_PATH_MAILER
  162 CF_PATH_MAILBOX
  163 
  164 ## PGP Support
  165 AC_MSG_CHECKING(if you want PGP/GPG-Support)
  166 CF_ARG_DISABLE(pgp-gpg,
  167     [  --disable-pgp-gpg       disable PGP/GPG Support],
  168     [USE_PGP_GPG=no],
  169     [USE_PGP_GPG=yes])
  170 AC_MSG_RESULT($enableval)
  171 if test "$USE_PGP_GPG" = "yes" ; then
  172     CF_WITH_PROGRAM(pgp,
  173     [  --with-pgp              (default: from system path)])
  174     # FIXME: check if pgp is pgp2 or pgp6
  175 
  176     CF_WITH_PROGRAM(pgpk,
  177     [  --with-pgpk             (default: from system path)])
  178     # FIXME: remove tailing k
  179 
  180     CF_WITH_PROGRAM(gpg,
  181     [  --with-gpg              (default: from system path)])
  182 fi
  183 
  184 ## slrnface
  185 CF_WITH_PROGRAM(slrnface,
  186 [  --with-slrnface         (default: from system path)])
  187 if test -n "$ac_cv_path_PATH_SLRNFACE"; then
  188     EXTRAO_DEP=""
  189     EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/xface.o"
  190 fi
  191 
  192 ## Default shell
  193 AC_ARG_WITH(shell,
  194     [  --with-shell=PROG       default $SHELL program (default: sh)],
  195     [cf_cv_default_shell=$withval],
  196     [cf_cv_default_shell=])
  197 CF_DEFAULT_SHELL($cf_cv_default_shell)
  198 
  199 ### check for this early, since it'll override several options
  200 AC_MSG_CHECKING(if NNTP-support will be used)
  201 CF_ARG_DISABLE(nntp,
  202     [  --disable-nntp          disable reading via NNTP],
  203     [USE_NNTP=no],
  204     [USE_NNTP=yes])
  205 AC_MSG_RESULT($enableval)
  206 
  207 USE_SPOOLDIR=yes
  208 if test "$USE_NNTP" = "yes" ; then
  209 AC_MSG_CHECKING(whether to be NNTP_ONLY)
  210 CF_ARG_ENABLE(nntp-only,
  211     [  --enable-nntp-only      enable reading via NNTP only],
  212     [AC_DEFINE(NNTP_ONLY)
  213      USE_SPOOLDIR=no],
  214     [AC_DEFINE(NNTP_ABLE)])
  215 AC_MSG_RESULT($enableval)
  216 fi
  217 
  218 ### use option --enable-debug to compile-in test/development code
  219 AC_MSG_CHECKING(if you want to compile-in debug support)
  220 CF_ARG_ENABLE(debug,
  221     [  --enable-debug          turn on debug support],
  222     [ENABLE_DEBUG=''
  223     CFLAGS="-g $CFLAGS"
  224     LDFLAGS="-g $LDFLAGS"],
  225     [ENABLE_DEBUG='#'
  226     test -z "$save_CFLAGS" && CFLAGS=`echo $CFLAGS|sed -e 's/-g //' -e 's/-g$//'`])
  227 AC_MSG_RESULT($enableval)
  228 AC_SUBST(ENABLE_DEBUG)
  229 
  230 ### use option --disable-echo to suppress full display compiling commands
  231 CF_DISABLE_ECHO
  232 
  233 ### use option --enable-prototypes to turn on optional prototypes
  234 AC_MSG_CHECKING(if you want to compile with fallback prototypes)
  235 CF_ARG_ENABLE(prototypes,
  236     [  --enable-prototypes     check for optional prototypes],
  237     [with_decl_check=yes],
  238     [with_decl_check=no])
  239 AC_MSG_RESULT($enableval)
  240 
  241 ### use option --enable-warnings to turn on all gcc warnings
  242 EXTRA_CFLAGS=""
  243 if test -n "$GCC"
  244 then
  245 AC_MSG_CHECKING(if you want to turn on gcc warnings)
  246 CF_ARG_ENABLE(warnings,
  247     [  --enable-warnings       turn on GCC compiler warnings],
  248     [with_warnings=yes],
  249     [with_warnings=no])
  250 AC_MSG_RESULT($with_warnings)
  251 if test "$with_warnings" = "yes"
  252 then
  253     with_ext_const=yes
  254     CF_GCC_WARNINGS
  255 fi
  256 fi
  257 
  258 ## !NNTP_ONLY
  259 if test "$USE_SPOOLDIR" = "yes"; then
  260     ## options for directories
  261     AC_MSG_CHECKING(for news-library path)
  262     CF_WITH_PATH(libdir,
  263         [  --with-libdir=PATH      news-library],
  264         NEWSLIBDIR,/usr/lib/news)
  265     AC_MSG_RESULT($NEWSLIBDIR)
  266 
  267     AC_MSG_CHECKING(for news spool-directory path)
  268     CF_WITH_PATH(spooldir,
  269         [  --with-spooldir=PATH    news spool-directory],
  270         SPOOLDIR,/var/spool/news)
  271     AC_MSG_RESULT($SPOOLDIR)
  272 
  273     AC_MSG_CHECKING(for news overview-directory path)
  274     CF_WITH_PATH(nov-dir,
  275         [  --with-nov-dir=PATH     news overview-directory],
  276         NOVROOTDIR,$SPOOLDIR)
  277     AC_MSG_RESULT($NOVROOTDIR)
  278 
  279     AC_MSG_CHECKING(for overview filename)
  280     CF_WITH_VALUE(nov-fname,
  281         [  --with-nov-fname        specify names of overview files],
  282         OVERVIEW_FILE,.overview)
  283     AC_MSG_RESULT($OVERVIEW_FILE)
  284 
  285     INEWSPATH="$NEWSLIBDIR"
  286 else
  287     NEWSLIBDIR=""
  288     SPOOLDIR=""
  289     NOVROOTDIR=""
  290     INEWSPATH="/usr/lib/news"
  291 fi
  292 
  293 ## TODO: kick the --with-inews-dir= stuff, the check below should be enough
  294 ## (requires some code rework in tin)
  295 AC_MSG_CHECKING(for directory containing \"inews\")
  296 CF_WITH_PATH(inews-dir,
  297     [  --with-inews-dir=PATH   directory containing "inews"],
  298     INEWSDIR,$INEWSPATH)
  299 INEWSDIR=`echo $INEWSDIR |sed -e 's,/$,,'`
  300 AC_MSG_RESULT($INEWSDIR)
  301 
  302 AC_PATH_PROG(INEWS,
  303     inews, --internal,
  304     $INEWSDIR:/news/bin:/usr/lib/news/bin:$INEWSPATH)
  305 if test "$ac_cv_path_INEWS" != ""; then
  306     if test "$ac_cv_path_INEWS" = "--internal"; then
  307         CF_DEFINE_STRING(PATH_INEWS, "$INEWS")
  308     else
  309         CF_DEFINE_STRING(PATH_INEWS, "$INEWS -h")
  310     fi
  311 fi
  312 
  313 ### Look for network libraries first, since some functions (such as gethostname)
  314 ### are used in a lot of places.
  315 AC_CACHE_CHECK(if you want socks library,cf_cv_use_libsocks,[
  316 AC_ARG_WITH(socks,
  317     [  --with-socks[=path]       link with socks library if available],
  318     [cf_cv_use_libsocks=$withval],
  319     [cf_cv_use_libsocks=no])
  320 ])
  321 
  322 AC_CACHE_CHECK(if you want socks5 library,cf_cv_use_libsocks5,[
  323 AC_ARG_WITH(socks5,
  324     [  --with-socks5[=path]      link with socks5 library if available],
  325     [cf_cv_use_libsocks5=$withval],
  326     [cf_cv_use_libsocks5=no])
  327 ])
  328 
  329 if test "x$cf_cv_use_libsocks" != xno ; then
  330     CF_SOCKS($cf_cv_use_libsocks)
  331 else
  332     CF_NETLIBS
  333     if test "x$cf_cv_use_libsocks5" != xno ; then
  334     CF_SOCKS5($cf_cv_use_libsocks5)
  335     fi
  336 fi
  337 
  338 ### which locking method should be used for mailbox locking
  339 ### first look for all available locking methods
  340 CF_LOCKFILE
  341 
  342 AC_MSG_CHECKING(which locking method will be used)
  343 ### fcntl() is preferred, if the user just disables fcntl()
  344 ### without specifying an alternative lockf() is preferred
  345 CF_ARG_DISABLE(fcntl,
  346     [  --disable-fcntl         disable fcntl() locking],
  347         requested_lock="lockf",
  348         requested_lock="fcntl")
  349 CF_ARG_ENABLE(lockf,
  350     [  --enable-lockf          enable lockf() locking],
  351         requested_lock="lockf")
  352 CF_ARG_ENABLE(flock,
  353     [  --enable-flock          enable flock() locking],
  354         requested_lock="flock")
  355 ### now check the users wishes against available locking methods
  356 if test -n "$cf_cv_lockfile"; then
  357     for lock in $cf_cv_lockfile; do
  358         if test "$lock" = "$requested_lock"; then
  359             used_locking=$lock
  360             break
  361         fi
  362     done
  363 ### if none of them matched use the one with the highest priority
  364     if test "x$used_locking" = "x"; then
  365         used_locking=`echo $cf_cv_lockfile|sed -e 's/^\([[^ ]]\+\).*/\1/g'`
  366     fi
  367     AC_MSG_RESULT($used_locking)
  368     CF_UPPER(used_locking,$used_locking)
  369     AC_DEFINE_UNQUOTED(USE_$used_locking)
  370 else
  371     AC_MSG_RESULT(none);
  372     AC_MSG_WARN([[None of fcntl(), lockf(), flock() available]])
  373 fi
  374 
  375 AC_MSG_CHECKING(for screen type)
  376 AC_ARG_WITH(screen,
  377 [  --with-screen=xxx       specify screen type, which must be one of:
  378                           termcap, terminfo, curses, ncurses, ncursesw, or
  379                           pdcurses (replaces options --enable-curses and
  380                           --with-ncurses)],
  381     [cf_with_screen=$withval],
  382     [cf_with_screen=none])
  383 AC_MSG_RESULT($cf_with_screen)
  384 
  385 use_curses=no
  386 use_ncurses=no
  387 
  388 CF_WITH_CURSES_DIR($cf_with_screen)
  389 
  390 case $cf_with_screen in #(vi
  391 termcap|terminfo) #(we will determine which it really is
  392     ;;
  393 curses) #(vi
  394     use_curses=yes
  395     ;;
  396 ncurses) #(vi
  397     use_curses=yes
  398     use_ncurses=yes
  399     ;;
  400 ncursesw) #(vi
  401     use_curses=yes
  402     use_ncurses=yes
  403     ;;
  404 pdcurses) #(vi
  405     use_curses=yes
  406     ;;
  407 none)
  408     AC_MSG_CHECKING(if you want to use ncurses library)
  409     AC_ARG_WITH(ncurses,
  410         [  --with-ncurses          link with ncurses if available (deprecated)],
  411         [use_ncurses=$withval],
  412         [use_ncurses=no])
  413     AC_MSG_RESULT($use_ncurses)
  414 
  415     AC_MSG_CHECKING(if you want curses rather than termcap interface)
  416     CF_ARG_ENABLE(curses,
  417         [  --enable-curses         use curses interface (deprecated)],
  418         [cf_with_screen=curses;  use_curses=$withval],
  419         [cf_with_screen=termcap; use_curses=no])
  420     AC_MSG_RESULT($enableval)
  421     ;;
  422 esac
  423 
  424 if test $use_curses != no ; then
  425     AC_DEFINE(USE_CURSES)
  426     case $cf_with_screen in #(vi
  427     ncurses) #(vi
  428         CF_NCURSES_CONFIG
  429         ;;
  430     ncursesw) #(vi
  431         CF_CHECK_HEADERS(stdlib.h wchar.h wctype.h)
  432         AM_MULTIBYTE_ABLE
  433         CF_NCURSES_CONFIG(ncursesw)
  434         CF_XOPEN_CURSES
  435         test "$cf_cv_need_xopen_extension" = unknown && AC_ERROR(X/Open curses not found)
  436         ;;
  437     curses) #(vi
  438         CF_CURSES_CONFIG
  439         CF_XOPEN_CURSES
  440         ;;
  441     esac
  442 fi
  443 
  444 ## substitute externally-installed PCRE library for our bundled version
  445 AC_MSG_CHECKING(if you want to use installed version of pcre)
  446 AC_ARG_WITH(pcre,
  447     [  --with-pcre=PATH        use installed pcre versus bundled],
  448     [PCRE_HOME=$withval],
  449     [PCRE_HOME=no])
  450 AC_MSG_RESULT($PCRE_HOME)
  451 CF_BUNDLED_PCRE($PCRE_HOME)
  452 
  453 PCRE_MAKEFILE=
  454 if test "$PCRE_HOME" = "no" ; then
  455     LINK_SIZE="-DLINK_SIZE=2"
  456     AC_SUBST(LINK_SIZE)
  457     UTF8="-DSUPPORT_UTF8"
  458     UCP="-DSUPPORT_UCP"
  459     AC_SUBST(UTF8)
  460     AC_SUBST(UCP)
  461     PCRE_MAKEFILE="$PCRE_MAKEFILE pcre/Makefile pcre/RunTest"
  462 fi
  463 
  464 ## debugging libraries (do this after other libraries)
  465 debug_malloc=none
  466 CF_WITH_DBMALLOC(debug_malloc=DBMALLOC)
  467 CF_WITH_DMALLOC(debug_malloc=DMALLOC)
  468 
  469 AC_ARG_WITH(trace,
  470     [  --with-trace            use debugging/traces for screen output],
  471     [
  472     AC_CHECK_FUNC(_tracef,[AC_DEFINE(HAVE__TRACEF)],[
  473     AC_CHECK_LIB(${cf_with_screen}_g,_tracef,
  474         [AC_DEFINE(HAVE__TRACEF)
  475          LIBS=`echo "$LIBS" | sed -e s/-l${cf_with_screen}// -e s/-lcurses//`
  476          LIBS="-l${cf_with_screen}_g $LIBS"
  477          use_trace=yes
  478          AC_DEFINE(USE_TRACE)
  479          EXTRAO_DEP=''
  480          EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/trace.o"],
  481          use_trace=no)])],
  482     [use_trace=no])
  483 #AC_MSG_CHECKING(if you want debugging-trace)
  484 #AC_MSG_RESULT($use_trace)
  485 AC_SUBST(EXTRAOBJS)
  486 AC_SUBST(EXTRAO_DEP)
  487 
  488 ## options for miscellaneous definitions
  489 AC_MSG_CHECKING(for domain-name)
  490 CF_ARG_WITH(domain-name,
  491     [  --with-domain-name      sets $DOMAIN_NAME],
  492     DOMAIN_NAME)
  493 if test "$DOMAIN_NAME" != ""; then
  494     AC_DEFINE_UNQUOTED(DOMAIN_NAME, "$DOMAIN_NAME")
  495 fi
  496 AC_MSG_RESULT($DOMAIN_NAME)
  497 
  498 if test "$USE_NNTP" = "yes" ; then
  499 AC_MSG_CHECKING(for NNTP default-server)
  500 CF_ARG_WITH(nntp-default-server,
  501     [  --with-nntp-default-server
  502                           (sets NNTP_DEFAULT_SERVER)
  503                          ],
  504     [NNTP_DEFAULT_SERVER], news.$DOMAIN_NAME)
  505 
  506     if test "$NNTP_DEFAULT_SERVER" = "" ; then
  507     if test "$DOMAIN_NAME" != "" ; then
  508         test -z "$NNTP_DEFAULT_SERVER" && \
  509         case "$DOMAIN_NAME" in #(((
  510         /*)
  511             if test -r "$DOMAIN_NAME" ; then
  512                 NNTP_DEFAULT_SERVER="news.`cat $DOMAIN_NAME`"
  513             else
  514                 NNTP_DEFAULT_SERVER="news"
  515             fi
  516             ;;
  517         *)
  518             NNTP_DEFAULT_SERVER="news.$DOMAIN_NAME"
  519             ;;
  520         esac
  521     else
  522         NNTP_DEFAULT_SERVER="news"
  523     fi
  524     fi
  525 AC_MSG_RESULT($NNTP_DEFAULT_SERVER)
  526 fi
  527 
  528 ## These options are interdependent, so we delay defining them til now:
  529 test -n "$NNTP_DEFAULT_SERVER" \
  530     && AC_DEFINE_UNQUOTED(NNTP_DEFAULT_SERVER,"$NNTP_DEFAULT_SERVER")
  531 test ".$INEWSDIR" != ".$NEWSLIBDIR" && AC_DEFINE_UNQUOTED(INEWSDIR,"$INEWSDIR")
  532 AC_DEFINE_UNQUOTED(NEWSLIBDIR,"$NEWSLIBDIR")
  533 AC_DEFINE_UNQUOTED(NOVROOTDIR,"$NOVROOTDIR")
  534 AC_DEFINE_UNQUOTED(SPOOLDIR,"$SPOOLDIR")
  535 
  536 ## optional features
  537 AC_MSG_CHECKING(whether to use MH style mail handling for mailgroups)
  538 CF_ARG_ENABLE(mh-mail-handling,
  539     [  --enable-mh-mail-handling
  540                           use MH style mail handling for mailgroups],
  541     [AC_DEFINE(HAVE_MH_MAIL_HANDLING)])
  542 AC_MSG_RESULT($enableval)
  543 
  544 CAN_MAKEFILE=
  545 CANDIR_MAKE=
  546 AC_MSG_CHECKING(whether to use Cancel-Locks)
  547 CF_ARG_ENABLE(cancel-locks,
  548     [  --enable-cancel-locks   enable creation of Cancel-Locks],
  549     [CANLIBS='-L../libcanlock -lcanlock'
  550     CAN_MAKEFILE="libcanlock/Makefile"
  551     AC_DEFINE(USE_CANLOCK)],
  552     [CANDIR_MAKE='#'
  553     CANLIBS=''])
  554 AC_MSG_RESULT($enableval)
  555 AC_SUBST(CANDIR_MAKE)
  556 AC_SUBST(CANLIBS)
  557 
  558 ## gsasl - used for AUTH SASL PLAIN
  559 gsasl=no
  560 AC_CHECK_HEADER(gsasl.h,
  561     [AC_CHECK_LIB(gsasl, gsasl_check_version, gsasl=yes)]
  562 )
  563 if test "$gsasl" = "yes"; then
  564     CF_ARG_DISABLE(gsasl,
  565         [  --disable-gsasl         don't use GNU SASL],
  566         USE_SASL=no,
  567         [USE_SASL=yes
  568         AC_DEFINE(USE_SASL, 1, [Define to 1 if you want GNU SASL.])
  569         LIBS="$LIBS -lgsasl"])
  570 fi
  571 
  572 AC_MSG_CHECKING(whether to enable 8-bit keycodes)
  573 CF_ARG_DISABLE(8bit-keys,
  574     [  --disable-8bit-keys     disable 8-bit keycode support],,
  575     [AC_DEFINE(HAVE_KEY_PREFIX)])
  576 AC_MSG_RESULT($enableval)
  577 
  578 AC_MSG_CHECKING(whether to enable ANSI-color)
  579 CF_ARG_DISABLE(color,
  580     [  --disable-color         disable ANSI-color support])
  581 use_color=$enableval
  582 AC_MSG_RESULT($use_color)
  583 
  584 AC_MSG_CHECKING(whether to enable posting-etiquette)
  585 CF_ARG_DISABLE(etiquette,
  586     [  --disable-etiquette     disable printing of posting-etiquette],
  587     [AC_DEFINE(NO_ETIQUETTE)])
  588 AC_MSG_RESULT($enableval)
  589 
  590 AC_MSG_CHECKING(whether to strictly observe RFC2047 and break long lines)
  591 CF_ARG_DISABLE(break-long-lines,
  592     [  --disable-break-long-lines
  593                           don't break long mime-encoded lines],,
  594     [AC_DEFINE(MIME_BREAK_LONG_LINES)])
  595 AC_MSG_RESULT($enableval)
  596 
  597 AC_MSG_CHECKING(whether to force MM_CHARSET obeyance when decoding mime)
  598 CF_ARG_DISABLE(mime-strict-charset,
  599     [  --disable-mime-strict-charset
  600                           force MM_CHARSET obeyance],,
  601     [AC_DEFINE(MIME_STRICT_CHARSET)])
  602 AC_MSG_RESULT($enableval)
  603 
  604 AC_MSG_CHECKING(for MIME character-set)
  605 CF_WITH_DFTENV(mime-default-charset,
  606     [  --with-mime-default-charset=CHARSET
  607                           fallback for $MM_CHARSET],
  608     MM_CHARSET,US-ASCII)
  609 AC_MSG_RESULT($MM_CHARSET)
  610 
  611 AC_MSG_CHECKING(for default ISO/ASCII table)
  612 CF_WITH_DFTENV(iso-to-ascii,
  613     [  --with-iso-to-ascii     ISO -> ASCII conversion],
  614     DEFAULT_ISO2ASC,-1)
  615 AC_MSG_RESULT($DEFAULT_ISO2ASC)
  616 
  617 AC_MSG_CHECKING(whether to enable locale support)
  618 CF_ARG_DISABLE(locale,
  619     [  --disable-locale        disable locale support],
  620     [AC_DEFINE(NO_LOCALE)])
  621 AC_MSG_RESULT($enableval)
  622 
  623 AC_MSG_CHECKING(whether to enable posting)
  624 CF_ARG_DISABLE(posting,
  625     [  --disable-posting       disable posting],
  626     [AC_DEFINE(NO_POSTING)])
  627 AC_MSG_RESULT($enableval)
  628 
  629 AC_MSG_CHECKING(whether to enable shell escape)
  630 CF_ARG_DISABLE(shell-escape,
  631     [  --disable-shell-escape  disable shell escape],
  632     [AC_DEFINE(NO_SHELL_ESCAPE)])
  633 AC_MSG_RESULT($enableval)
  634 
  635 AC_MSG_CHECKING(whether to have fascist newsadmin)
  636 CF_ARG_ENABLE(fascist-newsadmin,
  637     [  --enable-fascist-newsadmin
  638                           have fascist newsadmin],
  639     [AC_DEFINE(HAVE_FASCIST_NEWSADMIN)])
  640 AC_MSG_RESULT($enableval)
  641 
  642 AC_MSG_CHECKING(whether to enable inverse video and highlighting)
  643 CF_ARG_DISABLE(inverse-video,
  644     [  --disable-inverse-video disable inverse video and highlighting],
  645     [AC_DEFINE(USE_INVERSE_HACK)])
  646 AC_MSG_RESULT($enableval)
  647 
  648 AC_MSG_CHECKING(whether to enable piping support)
  649 CF_ARG_DISABLE(piping,
  650     [  --disable-piping        disable piping support],
  651     [AC_DEFINE(DONT_HAVE_PIPING)])
  652 AC_MSG_RESULT($enableval)
  653 
  654 AC_MSG_CHECKING(whether to enable printer support)
  655 CF_ARG_DISABLE(printing,
  656     [  --disable-printing      disable printer support],
  657     [AC_DEFINE(DISABLE_PRINTING)])
  658 AC_MSG_RESULT($enableval)
  659 
  660 AC_MSG_CHECKING(whether to unique tmp-files by appending .pid)
  661 CF_ARG_DISABLE(append-pid,
  662     [  --disable-append-pid    disable appending .pid to tmp-files],,
  663     [AC_DEFINE(APPEND_PID)])
  664 AC_MSG_RESULT($enableval)
  665 
  666 AC_MSG_CHECKING(whether to fallback to XHDR XREF if XOVER isn't supported)
  667 CF_ARG_DISABLE(xhdr-xref,
  668     [  --disable-xhdr-xref     disable XHDR XREF fallback],,
  669     [AC_DEFINE(XHDR_XREF)])
  670 AC_MSG_RESULT($enableval)
  671 
  672 ### bypass a bug in old versions of leafnode & NNTPcache
  673 AC_MSG_CHECKING(whether to send a GROUP command before a LISTGROUP)
  674 CF_ARG_ENABLE(broken-listgroup-fix,
  675     [  --enable-broken-listgroup-fix
  676                           send extra GROUP command before LISTGROUP],
  677     [AC_DEFINE(BROKEN_LISTGROUP)])
  678 AC_MSG_RESULT($enableval)
  679 
  680 ### on some old systems the WIFEXITED()/WEXITSTATUS() macros do not work
  681 AC_MSG_CHECKING(whether to ignore system()s return value)
  682 CF_ARG_ENABLE(broken-system-fix,
  683     [  --enable-broken-system-fix
  684                           ignore system()s return value],
  685     [AC_DEFINE(IGNORE_SYSTEM_STATUS)])
  686 AC_MSG_RESULT($enableval)
  687 
  688 ### checks for the location of the system-wide default setting file
  689 AC_MSG_CHECKING(for directory containing tin.defaults file)
  690 CF_WITH_PATH(defaults-dir,
  691     [  --with-defaults-dir=PATH
  692                           directory containing tin.defaults file
  693                          ],
  694     TIN_DEFAULTS_DIR,/etc/tin)
  695 AC_MSG_RESULT($TIN_DEFAULTS_DIR)
  696 AC_DEFINE_UNQUOTED(TIN_DEFAULTS_DIR,"$TIN_DEFAULTS_DIR")
  697 
  698 ### check for ipv6 support
  699 AC_MSG_CHECKING([whether to enable IPv6])
  700 CF_ARG_DISABLE(ipv6,
  701     [  --disable-ipv6          disable IPv6 support (default: enabled)],
  702     ,
  703     [AC_DEFINE(ENABLE_IPV6)])
  704 AC_MSG_RESULT($enableval)
  705 if test "$enableval" = "yes"; then
  706     CF_CHECK_IPV6
  707 fi
  708 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
  709 
  710 ### should we use 64 bit article numbers if possible?
  711 AC_MSG_CHECKING([whether to enable long article numbers])
  712 CF_ARG_ENABLE(long-article-numbers,
  713         [  --enable-long-article-numbers
  714                           enable long article numbers (default: disabled)],
  715 [AC_DEFINE(ENABLE_LONG_ARTICLE_NUMBERS)])
  716 AC_MSG_RESULT($enableval)
  717 
  718 ### checks for operator characteristics (should be the last option)
  719 AC_MSG_CHECKING(whether to make a coffee while compiling)
  720 AC_ARG_WITH(coffee,
  721     [  --with-coffee           coffee support],
  722     [ case "$withval" in
  723     yes)
  724     AC_MSG_RESULT(yes - with milk - please!)
  725     AC_DEFINE(HAVE_COFFEE)
  726     ;;
  727     *)
  728     AC_MSG_RESULT(no)
  729     ;;
  730     esac],
  731     AC_MSG_RESULT(no))
  732 
  733 ### checks for compiler characteristics
  734 CF_MAKEFLAGS
  735 AC_LANG_C
  736 AC_C_CONST
  737 AC_C_INLINE
  738 CF_CPP_EXPANDS
  739 CF_CPP_CONCATS
  740 CF_CHECK_NESTED_PARAMS
  741 
  742 ### Checks for header files.
  743 AC_HEADER_STDC
  744 AC_HEADER_DIRENT
  745 AC_HEADER_TIME
  746 AC_HEADER_SYS_WAIT
  747 CF_CHECK_HEADERS(\
  748     argz.h \
  749     arpa/inet.h \
  750     curses.h \
  751     errno.h \
  752     fcntl.h \
  753     getopt.h \
  754     ioctl.h \
  755     inttypes.h \
  756     langinfo.h \
  757     libc.h \
  758     locale.h \
  759     malloc.h \
  760     netdb.h \
  761     netinet/in.h \
  762     netlib.h \
  763     nl_types.h \
  764     nomacros.h \
  765     paths.h \
  766     poll.h \
  767     prototypes.h \
  768     pwd.h \
  769     sgtty.h \
  770     socket.h \
  771     stdarg.h \
  772     stdbool.h \
  773     stddef.h \
  774     stdint.h \
  775     stdlib.h \
  776     string.h \
  777     strings.h \
  778     stropts.h \
  779     sys/bsdtypes.h \
  780     sys/errno.h \
  781     sys/file.h \
  782     sys/ioctl.h \
  783     sys/param.h \
  784     sys/poll.h \
  785     sys/ptem.h \
  786     sys/pty.h \
  787     sys/select.h \
  788     sys/stat.h \
  789     sys/stream.h \
  790     sys/socket.h \
  791     sys/time.h \
  792     sys/timeb.h \
  793     sys/times.h \
  794     sys/types.h \
  795     sys/utsname.h \
  796     term.h \
  797     termio.h \
  798     time.h \
  799     unistd.h \
  800     varargs.h \
  801     wchar.h \
  802     wctype.h \
  803 )
  804 
  805 ### Checks that depend on existence-checks for headers
  806 CF_SIZECHANGE
  807 CF_SYS_SELECT_TIMEVAL
  808 CF_VA_COPY
  809 
  810 ### Checks for Datatypes.
  811 AC_CHECK_TYPE(gid_t, int)
  812 AC_TYPE_MODE_T
  813 AC_TYPE_OFF_T
  814 AC_TYPE_PID_T
  815 AC_TYPE_SIZE_T
  816 AC_CHECK_TYPE(ssize_t, int)
  817 AC_CHECK_TYPE(time_t, long)
  818 AC_EGREP_HEADER(in_addr_t, netinet/in.h, ,[
  819     AC_EGREP_HEADER(in_addr_t, sys/endian.h, ,[
  820         AC_CHECK_TYPE(in_addr_t, unsigned long)]
  821     )]
  822 )
  823 AC_TYPE_UID_T
  824 
  825 dnl test to see if quad_t is defined
  826 AC_MSG_CHECKING(for quad_t)
  827 AC_TRY_COMPILE([
  828 #include <sys/types.h>
  829 #if 0
  830 #include <stdlib.h>
  831 #include <stddef.h>
  832 #endif /* 0 */
  833 ],[quad_t x; x = 0],
  834 ac_cv_quad_t=yes, ac_cv_quad_t=no)
  835 AC_MSG_RESULT($ac_cv_quad_t)
  836 if test $ac_cv_quad_t = yes; then
  837     AC_DEFINE(HAVE_QUAD_T)
  838 fi
  839 
  840 dnl test to see if long long is defined
  841 AC_MSG_CHECKING(for long long)
  842 AC_TRY_COMPILE([
  843 #include <sys/types.h>
  844 ],[long long x; x = 0],
  845 ac_cv_long_long=yes, ac_cv_long_long=no)
  846 AC_MSG_RESULT($ac_cv_long_long)
  847 if test $ac_cv_long_long = yes; then
  848     AC_DEFINE(HAVE_LONG_LONG)
  849 fi
  850 
  851 dnl test to see if int_least64_t is defined
  852 AC_MSG_CHECKING(for int_least64_t)
  853 AC_TRY_COMPILE([
  854 #ifdef HAVE_STDINT_H
  855 #include <stdint.h>
  856 #endif
  857 #ifdef HAVE_HAVE_INTTYPES_H
  858 #include <inttypes.h>
  859 #endif
  860 ],[int_least64_t x; x = 0],
  861 ac_cv_int_least64_t=yes, ac_cv_int_least64_t=no)
  862 AC_MSG_RESULT($ac_cv_int_least64_t)
  863 if test $ac_cv_int_least64_t = yes; then
  864     AC_DEFINE(HAVE_INT_LEAST64_T)
  865 
  866     AC_MSG_CHECKING(for INT64_C)
  867     AC_TRY_COMPILE([
  868 #ifdef HAVE_STDINT_H
  869 #include <stdint.h>
  870 #endif
  871 #ifdef HAVE_HAVE_INTTYPES_H
  872 #include <inttypes.h>
  873 #endif
  874 ],[int_least64_t x; x = INT64_C(0)],
  875     ac_cv_int64_c=yes, ac_cv_int64_c=no)
  876     AC_MSG_RESULT($ac_cv_int64_c)
  877     if test $ac_cv_int64_c = yes; then
  878         AC_DEFINE(HAVE_INT64_C)
  879     fi
  880 fi
  881 
  882 
  883 dnl test to see if nl_item is defined
  884 AC_MSG_CHECKING(for nl_item)
  885 AC_TRY_COMPILE([
  886 #ifdef HAVE_LANGINFO_H
  887 #include <langinfo.h>
  888 #else
  889 #ifdef HAVE_NL_TYPES_H
  890 #include <nl_types.h>
  891 #endif
  892 #endif
  893 ],[nl_item x; x = 0],
  894 ac_cv_nl_item=yes, ac_cv_nl_item=no)
  895 AC_MSG_RESULT($ac_cv_nl_item)
  896 if test $ac_cv_nl_item = yes; then
  897         AC_DEFINE(HAVE_NL_ITEM)
  898 fi
  899 
  900 ### Checks for libraries.
  901 # libuu/uudeview
  902 # only define HAVE_LIBUU and HAVE_UUDEVIEW_H if both are found
  903 AC_CHECK_LIB(uu, UUInitialize,
  904     [AC_CHECK_HEADER(uudeview.h,
  905         [AC_DEFINE(HAVE_LIBUU)
  906         AC_DEFINE(HAVE_UUDEVIEW_H)
  907         LIBS="$LIBS -luu"]
  908     )]
  909 )
  910 
  911 
  912 # ICU - International Components for Unicode
  913 # TODO: do separate checks for
  914 #  - unorm_normalize() # deprecated since ICU 56
  915 #  - uidna_IDNToUnicode() # deprecated since ICU 56
  916 #  - ubidi_open()
  917 # and for IDNA2008
  918 #  - uidna_openUTS46()
  919 #  - uidna_nameToUnicode()
  920 #  - unorm2_normalize()
  921 cf_try_icuuc="no"
  922 cf_try_icuuc46="no"
  923 AC_CHECK_HEADER(unicode/unorm.h,[
  924     AC_CHECK_HEADER(unicode/ustring.h, [
  925         AC_DEFINE(HAVE_UNICODE_UNORM_H)
  926         AC_DEFINE(HAVE_UNICODE_USTRING_H)
  927         AC_MSG_CHECKING(for unorm_normalize in libicuuc)
  928         cf_save_LIBS="$LIBS"
  929         cf_try_icuuc="no"
  930         LIBS="$LIBS -licuuc"
  931         AC_TRY_LINK([#include <unicode/unorm.h>], [
  932             int32_t needed, ustr = NULL;
  933             UErrorCode status;
  934             needed = unorm_normalize(ustr, -1, UNORM_DEFAULT, 0, NULL, 0, &status);], [
  935             AC_DEFINE(HAVE_LIBICUUC)
  936             cf_try_icuuc="yes"],
  937             LIBS=$cf_save_LIBS
  938         )
  939         AC_MSG_RESULT($cf_try_icuuc)
  940         cf_save_LIBS="$LIBS"
  941         AC_CHECK_HEADER(unicode/uidna.h, [
  942             AC_DEFINE(HAVE_UNICODE_UIDNA_H)
  943         ])
  944         AC_MSG_CHECKING(for uidna_nameToUnicode in libicuuc)
  945         AC_TRY_LINK([#include <unicode/uidna.h>
  946             #include <unicode/unorm.h>], [
  947             UErrorCode status = U_ZERO_ERROR;
  948             UIDNAInfo info = UIDNA_INFO_INITIALIZER;
  949             UIDNA *uts46;
  950             uidna_openUTS46(UNORM_DEFAULT, &status);
  951             uidna_nameToUnicode(uts46, NULL, 0, NULL, 0, &info, &status);
  952             uidna_close(uts46);], [
  953             AC_DEFINE(HAVE_LIBICUUC_46_API)
  954             cf_try_icuuc46="yes"],
  955             LIBS=$cf_save_LIBS
  956         )
  957         AC_MSG_RESULT($cf_try_icuuc46)
  958         AC_CHECK_HEADER(unicode/ubidi.h, [
  959             AC_DEFINE(HAVE_UNICODE_UBIDI_H)
  960         ])
  961     ])
  962 ])
  963 # IDNA2008
  964 AC_CHECK_HEADER(unicode/unorm2.h, [
  965     AC_DEFINE(HAVE_UNICODE_UNORM2_H)
  966 ])
  967 
  968 # without icuuc try GNU libunistring for normalization
  969 if test $cf_try_icuuc = no ; then
  970     AC_CHECK_HEADER(unitypes.h,[
  971         AC_CHECK_HEADER(uninorm.h,[
  972             AC_DEFINE(HAVE_UNITYPES_H)
  973             AC_DEFINE(HAVE_UNINORM_H)
  974             AC_MSG_CHECKING(for u8_normalize in libunistring)
  975             cf_save_LIBS="$LIBS"
  976             cf_try_unistring="no"
  977             LIBS="$LIBS -lunistring"
  978             AC_TRY_LINK([#include <unitypes.h>
  979                 #include <uninorm.h>], [
  980                 size_t ol = 0;
  981                 u8_normalize(UNINORM_NFC, (uint8_t *) "x", 2, NULL, &ol);], [
  982                 AC_DEFINE(HAVE_LIBUNISTRING)
  983                 cf_try_unistring="yes"],
  984                 LIBS=$cf_save_LIBS
  985             )
  986             AC_MSG_RESULT($cf_try_unistring)
  987         ])
  988     ])
  989 fi
  990 
  991 # without icuuc try libidn for Internationalized Domain Names / IDN 2003
  992 # TODO: check for libidn2
  993 if test $cf_try_icuuc = no ; then
  994     AC_CHECK_LIB(idn, stringprep_check_version,
  995         [AC_CHECK_HEADER(stringprep.h,[
  996             AC_DEFINE(HAVE_STRINGPREP_H)
  997             AC_CHECK_HEADER(idna.h, [
  998                 AC_DEFINE(HAVE_IDNA_H)
  999                 AC_CHECK_LIB(idn, idna_to_unicode_lzlz, [
 1000                     AC_DEFINE(HAVE_IDNA_TO_UNICODE_LZLZ)
 1001                     AC_MSG_CHECKING(for IDNA_USE_STD3_ASCII_RULES)
 1002                     AC_EGREP_HEADER(IDNA_USE_STD3_ASCII_RULES, idna.h, [
 1003                         AC_DEFINE(HAVE_IDNA_USE_STD3_ASCII_RULES)
 1004                         AC_MSG_RESULT(yes)],
 1005                         AC_MSG_RESULT(no)
 1006                     )
 1007                 ])
 1008                 AC_CHECK_LIB(idn, idna_strerror, [
 1009                     AC_DEFINE(HAVE_IDNA_STRERROR)
 1010                 ])
 1011             ])
 1012             AC_DEFINE(HAVE_LIBIDN)
 1013             LIBS="$LIBS -lidn"]
 1014         )]
 1015     )
 1016 fi
 1017 
 1018 # libidnkit - Internationalized Domain Names / IDN 2008
 1019 AC_CHECK_LIB(idnkit, idn_decodename, [
 1020     AC_CHECK_HEADER(idn/api.h, [
 1021         AC_MSG_CHECKING(for IDN_DECODE_LOOKUP)
 1022         cf_save_LIBS="$LIBS"
 1023         LIBS="$LIBS -lidnkit"
 1024         AC_TRY_LINK([#include <idn/api.h>
 1025             #include <string.h>], [
 1026             idn_result_t rs;
 1027             char in[255], out[255];
 1028             strcpy(in, "xn--brenfe-fta9a2q.de");
 1029             rs = idn_decodename(IDN_DECODE_LOOKUP, &in, &out, 254);
 1030             idn_result_tostring(rs);], [
 1031             AC_DEFINE(HAVE_LIBIDNKIT)
 1032             AC_DEFINE(HAVE_IDN_API_H)
 1033             AC_DEFINE(HAVE_IDN_DECODENAME)
 1034             AC_MSG_RESULT(yes)], [
 1035             LIBS=$cf_save_LIBS
 1036             AC_MSG_RESULT(no)
 1037         ])
 1038     ])
 1039 ])
 1040 
 1041 
 1042 if test $use_curses != no ; then
 1043     cf_cv_termlib=$cf_with_screen
 1044 else
 1045     CF_TERMCAP_LIBS
 1046     # terminfo-based termcap interfaces may be prototyped in <curses.h>,
 1047     # which may/may not be compatible with <termcap.h>
 1048     AC_MSG_CHECKING(if we should include termcap.h)
 1049     cf_save_CFLAGS="$CFLAGS"
 1050     CFLAGS="$CFLAGS -I$srcdir/include"
 1051     AC_TRY_COMPILE([
 1052 #define HAVE_TERMCAP_H 1
 1053 #include <tcurses.h>],[
 1054 #ifdef NCURSES_VERSION
 1055 make an error
 1056 #endif
 1057 ],
 1058         [cf_result=yes],
 1059         [cf_result=no])
 1060     AC_MSG_RESULT($cf_result)
 1061     CFLAGS="$cf_save_CFLAGS"
 1062     test $cf_result = yes && AC_DEFINE(HAVE_TERMCAP_H)
 1063     CF_TYPE_OUTCHAR
 1064 fi
 1065 
 1066 cf_tc_funcs=
 1067 cf_tc_externs=
 1068 if test ".$cf_cv_termlib" = .terminfo ; then
 1069     AC_DEFINE(USE_TERMINFO)
 1070     cf_tc_funcs="tigetint tigetnum tparam tparm"
 1071     cf_tc_externs="$cf_tc_funcs tgoto tigetstr tputs tigetflag"
 1072 elif test ".$cf_cv_termlib" = .termcap ; then
 1073     # BSD 'tputs()' may need 'PC' to be set.
 1074     AC_TRY_LINK([],[extern char PC; PC = 0],
 1075         [AC_DEFINE(HAVE_EXTERN_TCAP_PC)])
 1076     cf_tc_funcs="tgetint tgetnum tparam tparm"
 1077     cf_tc_externs="$cf_tc_funcs tgoto tgetstr tputs tgetent tgetflag"
 1078 fi
 1079 
 1080 ### Checks for external-data
 1081 CF_ERRNO
 1082 CF_STRERROR
 1083 
 1084 ### Checks for library functions.
 1085 AC_CHECK_FUNCS(\
 1086     alarm \
 1087     atoi \
 1088     atol \
 1089     atoll \
 1090     atoq \
 1091     bcopy \
 1092     chmod \
 1093     execlp \
 1094     explicit_bzero \
 1095     explicit_memset \
 1096     fcntl \
 1097     fdopen \
 1098     fork \
 1099     ftime \
 1100     ftruncate \
 1101     fsync \
 1102     getcwd \
 1103     gettimeofday \
 1104     getwd \
 1105     inet_aton \
 1106     is_xterm \
 1107     isascii \
 1108     lockf \
 1109     memcmp \
 1110     memcpy \
 1111     memmove \
 1112     memset \
 1113     mkdir \
 1114     mkfifo \
 1115     mktemp \
 1116     mkstemp \
 1117     nl_langinfo \
 1118     poll \
 1119     putenv \
 1120     rewinddir \
 1121     resizeterm \
 1122     select \
 1123     setenv \
 1124     setlocale \
 1125     settz \
 1126     setvbuf \
 1127     sigaction \
 1128     snprintf \
 1129     stpcpy \
 1130     strchr \
 1131     strcasecmp \
 1132     strcasestr \
 1133     strdup \
 1134     strftime \
 1135     strpbrk \
 1136     strrchr \
 1137     strrstr \
 1138     strsep \
 1139     strstr \
 1140     strtol \
 1141     strtoll \
 1142     tmpfile \
 1143     tzset \
 1144     uname \
 1145     unlink \
 1146     use_default_colors \
 1147     usleep \
 1148     vsnprintf \
 1149     waitpid \
 1150 $cf_tc_funcs )
 1151 
 1152 AC_CHECK_FUNC(flock,
 1153     AC_DEFINE(HAVE_FLOCK),[
 1154     AC_CHECK_LIB(bsd, flock,
 1155         AC_DEFINE(HAVE_FLOCK)
 1156         LIBS="$LIBS -lbsd")])
 1157 
 1158 # clock_gettime() / librt
 1159 AC_CHECK_FUNC(clock_gettime,
 1160     AC_DEFINE(HAVE_CLOCK_GETTIME),[
 1161         AC_CHECK_LIB(rt, clock_gettime,
 1162             AC_DEFINE(HAVE_CLOCK_GETTIME)
 1163             LIBS="$LIBS -lrt"
 1164         )
 1165     ]
 1166 )
 1167 
 1168 AC_MSG_CHECKING([for memset_s])
 1169 AC_TRY_RUN([
 1170 /* Request C11 Annex K */
 1171 #define __STDC_WANT_LIB_EXT1__ 1
 1172 #include <string.h>
 1173 #include <stddef.h>
 1174 int main()
 1175 {
 1176     char buf[10] = { 1 };
 1177     if (memset_s((void*) buf, (size_t) 100, 0, (size_t) 1))
 1178         return(-1);
 1179 }],
 1180     [
 1181         AC_MSG_RESULT([yes])
 1182         AC_DEFINE(HAVE_MEMSET_S)
 1183     ],
 1184     [AC_MSG_RESULT([no])],
 1185     [AC_MSG_RESULT([unknown])]
 1186 )
 1187 
 1188 AM_MULTIBYTE_ABLE
 1189 
 1190 AC_MSG_CHECKING(if gettimeofday takes two arguments)
 1191 AC_TRY_COMPILE([
 1192 #if HAVE_SYS_TIME_H
 1193 #include <sys/time.h>
 1194 #endif],
 1195 [struct timeval *tv;
 1196 struct timezone *tz;
 1197 gettimeofday(&tv, &tz);],
 1198 ac_cv_func_gettimeofday_2args=yes, ac_cv_func_gettimeofday_2args=no)
 1199 AC_MSG_RESULT($ac_cv_func_gettimeofday_2args)
 1200 if test $ac_cv_func_gettimeofday_2args = yes; then
 1201     AC_DEFINE(GETTIMEOFDAY_2ARGS)
 1202 fi
 1203 
 1204 CF_POSIX_JC
 1205 CF_FUNC_FORK
 1206 CF_FUNC_MEMMOVE
 1207 
 1208 AC_MSG_CHECKING(if select expects int * arguments)
 1209 AC_EGREP_HEADER([select\(.*, *int *\*,],time.h,
 1210     AC_DEFINE(HAVE_SELECT_INTP) AC_MSG_RESULT(yes),
 1211     AC_MSG_RESULT(no)
 1212 )
 1213 
 1214 AC_FUNC_CLOSEDIR_VOID
 1215 
 1216 # autoconf 2.5x assumes setvbuf is not reversed when cross-compiling
 1217 if test "$cross_compiling" != yes ; then
 1218     AC_FUNC_SETVBUF_REVERSED
 1219 fi
 1220 
 1221 ### Checks for network library functions.
 1222 AC_CHECK_FUNCS(\
 1223     gai_strerror \
 1224     getaddrinfo \
 1225     gethostname \
 1226     gethostbyname \
 1227     getservbyname \
 1228     inet_addr \
 1229     inet_ntoa \
 1230     strncasecmp \
 1231 )
 1232 
 1233 CF_TYPE_SIGACTION
 1234 CF_TERMIOS
 1235 CF_PW_GECOS
 1236 CF_TM_GMTOFF
 1237 
 1238 AC_SYS_LONG_FILE_NAMES
 1239 CF_FUNC_SYSTEM
 1240 
 1241 # Check if we are trying to use curses+color, but cannot
 1242 if test $use_color = yes ; then
 1243     if test $use_curses = no ; then
 1244         AC_DEFINE(HAVE_COLOR)
 1245     elif test $cf_with_screen = pdcurses ; then
 1246         AC_DEFINE(HAVE_COLOR)
 1247     else
 1248         CF_NCURSES_BROKEN
 1249         CF_COLOR_CURSES
 1250         if test $cf_cv_color_curses = yes ; then
 1251             AC_DEFINE(HAVE_COLOR)
 1252         else
 1253             AC_MSG_WARN(This curses library does not support color)
 1254         fi
 1255     fi
 1256 fi
 1257 
 1258 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 1259 if test -n "$GCC"; then
 1260     check_sig_const=yes
 1261 elif test -f /sys/dm/dm ; then
 1262     check_sig_const=yes
 1263 elif test -f /sys/dm/spm ; then
 1264     check_sig_const=yes
 1265 else
 1266     check_sig_const=no
 1267 fi
 1268 
 1269 if test $check_sig_const = yes ; then
 1270     CF_SIG_CONST
 1271 fi
 1272 
 1273 CF_COMPTYPE
 1274 CF_COREFILE
 1275 
 1276 ### test this last, since it uses a partly-built autoconf.h
 1277 # Setup includes for test-program to verify declarations
 1278 CHECK_DECL_FLAG="-I$srcdir/include -I$srcdir/pcre"
 1279 CHECK_DECL_HDRS='
 1280 #define __CPROTO__
 1281 #define HAVE_CONFDEFS_H
 1282 #include <tin.h>'
 1283 TIN_DECL_HDRS="$CHECK_DECL_HDRS"
 1284 
 1285 dnl These return non-int values, and can be troublesome if not declared
 1286 CF_CHECK_DECL(\
 1287     errno \
 1288     getenv \
 1289     getlogin \
 1290     getpwnam \
 1291     popen \
 1292     strchr \
 1293     strcasestr \
 1294     strsep \
 1295     tmpfile \
 1296 )
 1297 
 1298 dnl Check network stuff separately, to limit the effect of inconsistent headers
 1299 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1300 #include <tnntp.h>"
 1301 CF_CHECK_DECL(\
 1302     gethostbyname \
 1303     getservbyname \
 1304     inet_aton \
 1305     inet_ntoa \
 1306     socket \
 1307 )
 1308 
 1309 if test $use_curses = no ; then
 1310 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1311 #include <tcurses.h>"
 1312 CF_CHECK_DECL(\
 1313     tgetstr \
 1314     tgoto \
 1315 )
 1316 fi
 1317 
 1318 if test $with_decl_check = yes; then
 1319 CHECK_DECL_HDRS="$TIN_DECL_HDRS"
 1320 CF_CHECK_DECL(\
 1321     _flsbuf \
 1322     alarm \
 1323     atoi \
 1324     atol \
 1325     atoll \
 1326     atoq \
 1327     bcopy \
 1328     bzero \
 1329     calloc \
 1330     fchmod \
 1331     fclose \
 1332     fdopen \
 1333     fflush \
 1334     fgetc \
 1335     fileno \
 1336     fprintf \
 1337     fputc \
 1338     fputs \
 1339     fread \
 1340     free \
 1341     fseek \
 1342     fwrite \
 1343     getcwd \
 1344     getopt \
 1345     getwd \
 1346     heapsort \
 1347     ioctl \
 1348     isascii \
 1349     kill \
 1350     malloc \
 1351     memset \
 1352     mkstemp \
 1353     mktemp \
 1354     pclose \
 1355     perror \
 1356     printf \
 1357     putenv \
 1358     qsort \
 1359     realloc \
 1360     rename \
 1361     rewind \
 1362     select \
 1363     setenv \
 1364     snprintf \
 1365     sscanf \
 1366     strcasecmp \
 1367     strftime \
 1368     strncasecmp \
 1369     strtol \
 1370     strtoll \
 1371     system \
 1372     time \
 1373     tolower \
 1374     toupper \
 1375     ungetc \
 1376     usleep \
 1377     vsprintf \
 1378     vsnprintf \
 1379 )
 1380 
 1381 if test $use_curses = no ; then
 1382 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1383 #include <tcurses.h>"
 1384 CF_CHECK_DECL($cf_tc_externs)
 1385 fi
 1386 
 1387 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1388 #include <tnntp.h>"
 1389 CF_CHECK_DECL(\
 1390     connect \
 1391     gethostname \
 1392 )
 1393 
 1394 fi
 1395 
 1396 CF_TIOCGWINSZ
 1397 
 1398 ### append special libraries that get in the way of testing
 1399 case $debug_malloc in
 1400 DBMALLOC)
 1401     AC_DEFINE(USE_DBMALLOC)
 1402     LIBS="$LIBS -ldbmalloc"
 1403     ;;
 1404 DMALLOC)
 1405     AC_DEFINE(USE_DMALLOC)
 1406     LIBS="$LIBS -ldmalloc"
 1407     ;;
 1408 esac
 1409 
 1410 ### Use gettext
 1411 ### this also calls AM_LANGINFO_CODESET and AM_ICONV
 1412 ### so we don't need to do the tests ourselves.
 1413 CF_BUNDLED_INTL
 1414 LIBS="$LIBS $LIBICONV"
 1415 
 1416 ### check for alloca (required for bison and/or intl/*)
 1417 case "$YACC" in
 1418 bison*)
 1419     use_alloca=yes
 1420     ;;
 1421 *)
 1422     use_alloca=$USE_INCLUDED_LIBINTL
 1423     ;;
 1424 esac
 1425 
 1426 if test ".$use_alloca" = .yes ; then
 1427     CF_FUNC_ALLOCA
 1428 else
 1429     ALLOCA=""
 1430     AC_SUBST(ALLOCA)
 1431 fi
 1432 
 1433 # if struct hostent contains h_addr_list or not (SunOS-3.5)
 1434 AC_MSG_CHECKING(for h_addr_list in struct hostent)
 1435 AC_TRY_COMPILE([
 1436 #ifdef HAVE_NETDB_H
 1437 #include <netdb.h>
 1438 #endif
 1439 ],[
 1440 struct hostent h;
 1441 h.h_addr_list[0]=0;
 1442 ],ac_cv_hostent_h_addr_list=yes,ac_cv_hostent_h_addr_list=no)
 1443 AC_MSG_RESULT($ac_cv_hostent_h_addr_list)
 1444 if test $ac_cv_hostent_h_addr_list = yes; then
 1445     AC_DEFINE(HAVE_HOSTENT_H_ADDR_LIST)
 1446 fi
 1447 
 1448 CF_CHECK_FD_SET
 1449 
 1450 # tolower() is known to be broken on 4.2BSD by
 1451 # not checking if input is an uppercase letter
 1452 # /* #define tolower(c) ((c)-'A'+'a') */
 1453 AC_MSG_CHECKING(for working tolower())
 1454 AC_TRY_RUN([
 1455 #include <ctype.h>
 1456 int main() {
 1457     unsigned char str;
 1458 
 1459     for (str = 1; str < 127; str++) {
 1460             if ((char) tolower(str) != ((str >= 'A' && str <= 'Z') ? ((unsigned char) (str - 'A' + 'a')) : str))
 1461             return 1;
 1462     }
 1463     return 0;
 1464 }],
 1465         [
 1466                 AC_MSG_RESULT(yes)
 1467         ],
 1468         [
 1469         AC_DEFINE(TOLOWER_BROKEN)
 1470                 AC_MSG_RESULT(no)
 1471         ],
 1472         [
 1473                 AC_MSG_RESULT(unknown)
 1474         ]
 1475 )
 1476 
 1477 # toupper is known to be broken on 4.2BSD by
 1478 # not checking if input is an lowercase letter
 1479 # /* #define toupper(c) ((c)-'a'+'A') */
 1480 AC_MSG_CHECKING(for working toupper())
 1481 AC_TRY_RUN([
 1482 #include <ctype.h>
 1483 int main() {
 1484     unsigned char str;
 1485 
 1486     for (str = 1; str < 127; str++) {
 1487             if ((char) toupper(str) != ((str >= 'a' && str <= 'z') ? ((unsigned char) (str - 'a' + 'A')) : str))
 1488             return 1;
 1489     }
 1490     return 0;
 1491 }],
 1492         [
 1493                 AC_MSG_RESULT(yes)
 1494         ],
 1495         [
 1496         AC_DEFINE(TOUPPER_BROKEN)
 1497                 AC_MSG_RESULT(no)
 1498         ],
 1499         [
 1500                 AC_MSG_RESULT(unknown)
 1501         ]
 1502 )
 1503 
 1504 
 1505 CF_CHECK_HEADERS(iconv.h)
 1506 AC_MSG_CHECKING(for iconv_open() //TRANSLIT extension)
 1507 AC_TRY_RUN([
 1508 #ifdef HAVE_ICONV_H
 1509 #   include <iconv.h>
 1510 #endif /* HAVE_ICONV_H */
 1511 #ifdef HAVE_STDLIB_H
 1512 #   include <stdlib.h>
 1513 #endif /* HAVE_STDLIB_H */
 1514 int main() {
 1515     iconv_t cd;
 1516 
 1517     if ((cd = iconv_open("US-ASCII//TRANSLIT", "ISO-8859-1")) == (iconv_t) (-1))
 1518         exit(1);
 1519     exit(0);
 1520 }],
 1521     [
 1522         AC_DEFINE(HAVE_ICONV_OPEN_TRANSLIT)
 1523         AC_MSG_RESULT(yes)
 1524     ],
 1525     [
 1526         AC_MSG_RESULT(no)
 1527     ],
 1528     [
 1529         AC_MSG_RESULT(unknown)
 1530     ]
 1531 )
 1532 
 1533 # FIXME / TESTME
 1534 # locale is broken on cygwin < 1.7.0
 1535 # group/other bits don't work on cygwin < 1.7.0
 1536 # locking doesn't work on cygwin < 2.0 as link(2) is detected but doesn't work
 1537 case "$host_os" in
 1538     *cygwin*)
 1539         case `uname -r | sed 's,(.*,,'` in
 1540             B*|1.0-6].*)
 1541                 # multiple defects
 1542                 AC_DEFINE(NO_LOCALE)
 1543                 AC_DEFINE(NO_LOCKING)
 1544                 AC_DEFINE(FILE_MODE_BROKEN)
 1545                 ;;
 1546             1.7.*)
 1547                 # link does not work
 1548                 AC_DEFINE(NO_LOCKING)
 1549                 ;;
 1550             *)
 1551                 AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1552                 ;;
 1553             esac
 1554         ;;
 1555     *haiku*)
 1556         # link does not work
 1557         AC_DEFINE(NO_LOCKING)
 1558         ;;
 1559     *)
 1560         AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1561 esac
 1562 
 1563 if test "$cf_cv_termlib" = pdcurses ; then
 1564     CF_PDCURSES_X11
 1565 fi
 1566 AC_CHECK_FUNCS(vw_printw)
 1567 
 1568 ### sum up warnings
 1569 if test "$cf_cv_termlib" = none ; then
 1570     AC_MSG_WARN([no term-lib found, you might run into trouble later.])
 1571 fi
 1572 if test "$YACC" = "" ; then
 1573     AC_MSG_WARN([no yacc-parser found, you might run into trouble later.])
 1574 fi
 1575 if test "$RANLIB" = "" ; then
 1576     AC_MSG_WARN([no library archive builder found, you might run into trouble later.])
 1577 fi
 1578 
 1579 ### Finally, build autoconf.h and the makefiles
 1580 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
 1581 
 1582 LINTFLAGS=$LINTFLAGS
 1583 AC_SUBST(LINTFLAGS)
 1584 
 1585 CF_DEFINE_STRING(TIN_CC,       "$CC")
 1586 CF_DEFINE_STRING(TIN_CFLAGS,   "$CFLAGS")
 1587 CF_DEFINE_STRING(TIN_CPP,      "$CPP")
 1588 CF_DEFINE_STRING(TIN_CPPFLAGS, "$CPPFLAGS")
 1589 CF_DEFINE_STRING(TIN_LD,       "$CC")
 1590 CF_DEFINE_STRING(TIN_LDFLAGS,  "$LDFLAGS")
 1591 CF_DEFINE_STRING(TIN_LIBS,     "$PCREDIR_LIBS $LIBS")
 1592 
 1593 AC_OUTPUT($PCRE_MAKEFILE
 1594     $SUB_MAKEFILE
 1595     $CAN_MAKEFILE
 1596     src/Makefile)