"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.3/configure.in" (24 Dec 2018, 37185 Bytes) of package /linux/misc/tin-2.4.3.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.2_vs_2.4.3.

    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   : 2018-12-05
    6 dnl Notes     :
    7 dnl
    8 dnl Copyright (c) 1995-2019 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.13.20110430)
   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.3
   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" && case "$DOMAIN_NAME" in #(((
  509         /*)
  510             if test -r "$DOMAIN_NAME" ; then
  511                 NNTP_DEFAULT_SERVER="news.`cat $DOMAIN_NAME`"
  512             else
  513                 NNTP_DEFAULT_SERVER="news"
  514             fi
  515             ;;
  516         *)
  517             NNTP_DEFAULT_SERVER="news.$DOMAIN_NAME"
  518             ;;
  519         esac
  520     else
  521         NNTP_DEFAULT_SERVER="news"
  522     fi
  523     fi
  524 AC_MSG_RESULT($NNTP_DEFAULT_SERVER)
  525 fi
  526 
  527 ## These options are interdependent, so we delay defining them til now:
  528 test -n "$NNTP_DEFAULT_SERVER" \
  529     && AC_DEFINE_UNQUOTED(NNTP_DEFAULT_SERVER,"$NNTP_DEFAULT_SERVER")
  530 test ".$INEWSDIR" != ".$NEWSLIBDIR" && AC_DEFINE_UNQUOTED(INEWSDIR,"$INEWSDIR")
  531 AC_DEFINE_UNQUOTED(NEWSLIBDIR,"$NEWSLIBDIR")
  532 AC_DEFINE_UNQUOTED(NOVROOTDIR,"$NOVROOTDIR")
  533 AC_DEFINE_UNQUOTED(SPOOLDIR,"$SPOOLDIR")
  534 
  535 ## optional features
  536 AC_MSG_CHECKING(whether to use MH style mail handling for mailgroups)
  537 CF_ARG_ENABLE(mh-mail-handling,
  538     [  --enable-mh-mail-handling
  539                           use MH style mail handling for mailgroups],
  540     [AC_DEFINE(HAVE_MH_MAIL_HANDLING)])
  541 AC_MSG_RESULT($enableval)
  542 
  543 CAN_MAKEFILE=
  544 CANDIR_MAKE=
  545 AC_MSG_CHECKING(whether to use Cancel-Locks)
  546 CF_ARG_ENABLE(cancel-locks,
  547     [  --enable-cancel-locks   enable creation of Cancel-Locks],
  548     [CANLIBS='-L../libcanlock -lcanlock'
  549     CAN_MAKEFILE="libcanlock/Makefile"
  550     AC_DEFINE(USE_CANLOCK)],
  551     [CANDIR_MAKE='#'
  552     CANLIBS=''])
  553 AC_MSG_RESULT($enableval)
  554 AC_SUBST(CANDIR_MAKE)
  555 AC_SUBST(CANLIBS)
  556 
  557 ## gsasl - used for AUTH SASL PLAIN
  558 gsasl=no
  559 AC_CHECK_HEADER(gsasl.h,
  560     [AC_CHECK_LIB(gsasl, gsasl_check_version, gsasl=yes)]
  561 )
  562 if test "$gsasl" = "yes"; then
  563     CF_ARG_DISABLE(gsasl,
  564         [  --disable-gsasl         don't use GNU SASL],
  565         USE_SASL=no,
  566         [USE_SASL=yes
  567         AC_DEFINE(USE_SASL, 1, [Define to 1 if you want GNU SASL.])
  568         LIBS="$LIBS -lgsasl"])
  569 fi
  570 
  571 AC_MSG_CHECKING(whether to enable 8-bit keycodes)
  572 CF_ARG_DISABLE(8bit-keys,
  573     [  --disable-8bit-keys     disable 8-bit keycode support],,
  574     [AC_DEFINE(HAVE_KEY_PREFIX)])
  575 AC_MSG_RESULT($enableval)
  576 
  577 AC_MSG_CHECKING(whether to enable ANSI-color)
  578 CF_ARG_DISABLE(color,
  579     [  --disable-color         disable ANSI-color support])
  580 use_color=$enableval
  581 AC_MSG_RESULT($use_color)
  582 
  583 AC_MSG_CHECKING(whether to enable posting-etiquette)
  584 CF_ARG_DISABLE(etiquette,
  585     [  --disable-etiquette     disable printing of posting-etiquette],
  586     [AC_DEFINE(NO_ETIQUETTE)])
  587 AC_MSG_RESULT($enableval)
  588 
  589 AC_MSG_CHECKING(whether to strictly observe RFC2047 and break long lines)
  590 CF_ARG_DISABLE(break-long-lines,
  591     [  --disable-break-long-lines
  592                           don't break long mime-encoded lines],,
  593     [AC_DEFINE(MIME_BREAK_LONG_LINES)])
  594 AC_MSG_RESULT($enableval)
  595 
  596 AC_MSG_CHECKING(whether to force MM_CHARSET obeyance when decoding mime)
  597 CF_ARG_DISABLE(mime-strict-charset,
  598     [  --disable-mime-strict-charset
  599                           force MM_CHARSET obeyance],,
  600     [AC_DEFINE(MIME_STRICT_CHARSET)])
  601 AC_MSG_RESULT($enableval)
  602 
  603 AC_MSG_CHECKING(for MIME character-set)
  604 CF_WITH_DFTENV(mime-default-charset,
  605     [  --with-mime-default-charset=CHARSET
  606                           fallback for $MM_CHARSET],
  607     MM_CHARSET,US-ASCII)
  608 AC_MSG_RESULT($MM_CHARSET)
  609 
  610 AC_MSG_CHECKING(for default ISO/ASCII table)
  611 CF_WITH_DFTENV(iso-to-ascii,
  612     [  --with-iso-to-ascii     ISO -> ASCII conversion],
  613     DEFAULT_ISO2ASC,-1)
  614 AC_MSG_RESULT($DEFAULT_ISO2ASC)
  615 
  616 AC_MSG_CHECKING(whether to enable locale support)
  617 CF_ARG_DISABLE(locale,
  618     [  --disable-locale        disable locale support],
  619     [AC_DEFINE(NO_LOCALE)])
  620 AC_MSG_RESULT($enableval)
  621 
  622 AC_MSG_CHECKING(whether to enable posting)
  623 CF_ARG_DISABLE(posting,
  624     [  --disable-posting       disable posting],
  625     [AC_DEFINE(NO_POSTING)])
  626 AC_MSG_RESULT($enableval)
  627 
  628 AC_MSG_CHECKING(whether to enable shell escape)
  629 CF_ARG_DISABLE(shell-escape,
  630     [  --disable-shell-escape  disable shell escape],
  631     [AC_DEFINE(NO_SHELL_ESCAPE)])
  632 AC_MSG_RESULT($enableval)
  633 
  634 AC_MSG_CHECKING(whether to have fascist newsadmin)
  635 CF_ARG_ENABLE(fascist-newsadmin,
  636     [  --enable-fascist-newsadmin
  637                           have fascist newsadmin],
  638     [AC_DEFINE(HAVE_FASCIST_NEWSADMIN)])
  639 AC_MSG_RESULT($enableval)
  640 
  641 AC_MSG_CHECKING(whether to enable inverse video and highlighting)
  642 CF_ARG_DISABLE(inverse-video,
  643     [  --disable-inverse-video disable inverse video and highlighting],
  644     [AC_DEFINE(USE_INVERSE_HACK)])
  645 AC_MSG_RESULT($enableval)
  646 
  647 AC_MSG_CHECKING(whether to enable piping support)
  648 CF_ARG_DISABLE(piping,
  649     [  --disable-piping        disable piping support],
  650     [AC_DEFINE(DONT_HAVE_PIPING)])
  651 AC_MSG_RESULT($enableval)
  652 
  653 AC_MSG_CHECKING(whether to enable printer support)
  654 CF_ARG_DISABLE(printing,
  655     [  --disable-printing      disable printer support],
  656     [AC_DEFINE(DISABLE_PRINTING)])
  657 AC_MSG_RESULT($enableval)
  658 
  659 AC_MSG_CHECKING(whether to unique tmp-files by appending .pid)
  660 CF_ARG_DISABLE(append-pid,
  661     [  --disable-append-pid    disable appending .pid to tmp-files],,
  662     [AC_DEFINE(APPEND_PID)])
  663 AC_MSG_RESULT($enableval)
  664 
  665 AC_MSG_CHECKING(whether to fallback to XHDR XREF if XOVER isn't supported)
  666 CF_ARG_DISABLE(xhdr-xref,
  667     [  --disable-xhdr-xref     disable XHDR XREF fallback],,
  668     [AC_DEFINE(XHDR_XREF)])
  669 AC_MSG_RESULT($enableval)
  670 
  671 ### bypass a bug in old versions of leafnode & NNTPcache
  672 AC_MSG_CHECKING(whether to send a GROUP command before a LISTGROUP)
  673 CF_ARG_ENABLE(broken-listgroup-fix,
  674     [  --enable-broken-listgroup-fix
  675                           send extra GROUP command before LISTGROUP],
  676     [AC_DEFINE(BROKEN_LISTGROUP)])
  677 AC_MSG_RESULT($enableval)
  678 
  679 ### on some old systems the WIFEXITED()/WEXITSTATUS() macros do not work
  680 AC_MSG_CHECKING(whether to ignore system()s return value)
  681 CF_ARG_ENABLE(broken-system-fix,
  682     [  --enable-broken-system-fix
  683                           ignore system()s return value],
  684     [AC_DEFINE(IGNORE_SYSTEM_STATUS)])
  685 AC_MSG_RESULT($enableval)
  686 
  687 ### checks for the location of the system-wide default setting file
  688 AC_MSG_CHECKING(for directory containing tin.defaults file)
  689 CF_WITH_PATH(defaults-dir,
  690     [  --with-defaults-dir=PATH
  691                           directory containing tin.defaults file
  692                          ],
  693     TIN_DEFAULTS_DIR,/etc/tin)
  694 AC_MSG_RESULT($TIN_DEFAULTS_DIR)
  695 AC_DEFINE_UNQUOTED(TIN_DEFAULTS_DIR,"$TIN_DEFAULTS_DIR")
  696 
  697 ### check for ipv6 support
  698 AC_MSG_CHECKING([whether to enable IPv6])
  699 CF_ARG_DISABLE(ipv6,
  700     [  --disable-ipv6          disable IPv6 support (default: enabled)],
  701     ,
  702     [AC_DEFINE(ENABLE_IPV6)])
  703 AC_MSG_RESULT($enableval)
  704 if test "$enableval" = "yes"; then
  705     CF_CHECK_IPV6
  706 fi
  707 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
  708 
  709 ### should we use 64 bit article numbers if possible?
  710 AC_MSG_CHECKING([whether to enable long article numbers])
  711 CF_ARG_ENABLE(long-article-numbers,
  712         [  --enable-long-article-numbers
  713                           enable long article numbers (default: disabled)],
  714 [AC_DEFINE(ENABLE_LONG_ARTICLE_NUMBERS)])
  715 AC_MSG_RESULT($enableval)
  716 
  717 ### checks for operator characteristics (should be the last option)
  718 AC_MSG_CHECKING(whether to make a coffee while compiling)
  719 AC_ARG_WITH(coffee,
  720     [  --with-coffee           coffee support],
  721     [ case "$withval" in
  722     yes)
  723     AC_MSG_RESULT(yes - with milk - please!)
  724     AC_DEFINE(HAVE_COFFEE)
  725     ;;
  726     *)
  727     AC_MSG_RESULT(no)
  728     ;;
  729     esac],
  730     AC_MSG_RESULT(no))
  731 
  732 ### checks for compiler characteristics
  733 CF_MAKEFLAGS
  734 AC_LANG_C
  735 AC_C_CONST
  736 AC_C_INLINE
  737 CF_CPP_EXPANDS
  738 CF_CPP_CONCATS
  739 CF_CHECK_NESTED_PARAMS
  740 
  741 ### Checks for header files.
  742 AC_HEADER_STDC
  743 AC_HEADER_DIRENT
  744 AC_HEADER_TIME
  745 AC_HEADER_SYS_WAIT
  746 CF_CHECK_HEADERS(\
  747     argz.h \
  748     arpa/inet.h \
  749     curses.h \
  750     errno.h \
  751     fcntl.h \
  752     getopt.h \
  753     ioctl.h \
  754     inttypes.h \
  755     langinfo.h \
  756     libc.h \
  757     locale.h \
  758     malloc.h \
  759     net/socket.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     closesocket \
 1094     execlp \
 1095     explicit_bzero \
 1096     explicit_memset \
 1097     fcntl \
 1098     fdopen \
 1099     fork \
 1100     ftime \
 1101     ftruncate \
 1102     fsync \
 1103     getcwd \
 1104     gettimeofday \
 1105     getwd \
 1106     inet_aton \
 1107     is_xterm \
 1108     isascii \
 1109     lockf \
 1110     memcmp \
 1111     memcpy \
 1112     memmove \
 1113     memset \
 1114     mkdir \
 1115     mkfifo \
 1116     mktemp \
 1117     mkstemp \
 1118     nl_langinfo \
 1119     poll \
 1120     putenv \
 1121     rewinddir \
 1122     resizeterm \
 1123     select \
 1124     setenv \
 1125     setlocale \
 1126     settz \
 1127     setvbuf \
 1128     sigaction \
 1129     snprintf \
 1130     stpcpy \
 1131     strchr \
 1132     strcasecmp \
 1133     strcasestr \
 1134     strdup \
 1135     strftime \
 1136     strpbrk \
 1137     strrchr \
 1138     strrstr \
 1139     strsep \
 1140     strstr \
 1141     strtol \
 1142     strtoll \
 1143     tmpfile \
 1144     tzset \
 1145     uname \
 1146     unlink \
 1147     use_default_colors \
 1148     usleep \
 1149     vsnprintf \
 1150     waitpid \
 1151 $cf_tc_funcs )
 1152 
 1153 AC_CHECK_FUNC(flock,
 1154     AC_DEFINE(HAVE_FLOCK),[
 1155     AC_CHECK_LIB(bsd, flock,
 1156         AC_DEFINE(HAVE_FLOCK)
 1157         LIBS="$LIBS -lbsd")])
 1158 
 1159 # clock_gettime() / librt
 1160 AC_CHECK_FUNC(clock_gettime,
 1161     AC_DEFINE(HAVE_CLOCK_GETTIME),[
 1162         AC_CHECK_LIB(rt, clock_gettime,
 1163             AC_DEFINE(HAVE_CLOCK_GETTIME)
 1164             LIBS="$LIBS -lrt"
 1165         )
 1166     ]
 1167 )
 1168 
 1169 AC_MSG_CHECKING([for memset_s])
 1170 AC_TRY_RUN([
 1171 /* Request C11 Annex K */
 1172 #define __STDC_WANT_LIB_EXT1__ 1
 1173 #include <string.h>
 1174 #include <stddef.h>
 1175 int main()
 1176 {
 1177     char buf[10] = { 1 };
 1178     if (memset_s((void*) buf, (size_t) 100, 0, (size_t) 1))
 1179         return(-1);
 1180 }],
 1181     [
 1182         AC_MSG_RESULT([yes])
 1183         AC_DEFINE(HAVE_MEMSET_S)
 1184     ],
 1185     [AC_MSG_RESULT([no])],
 1186     [AC_MSG_RESULT([unknown])]
 1187 )
 1188 
 1189 AM_MULTIBYTE_ABLE
 1190 
 1191 AC_MSG_CHECKING(if gettimeofday takes two arguments)
 1192 AC_TRY_COMPILE([
 1193 #if HAVE_SYS_TIME_H
 1194 #include <sys/time.h>
 1195 #endif],
 1196 [struct timeval *tv;
 1197 struct timezone *tz;
 1198 gettimeofday(&tv, &tz);],
 1199 ac_cv_func_gettimeofday_2args=yes, ac_cv_func_gettimeofday_2args=no)
 1200 AC_MSG_RESULT($ac_cv_func_gettimeofday_2args)
 1201 if test $ac_cv_func_gettimeofday_2args = yes; then
 1202     AC_DEFINE(GETTIMEOFDAY_2ARGS)
 1203 fi
 1204 
 1205 CF_POSIX_JC
 1206 CF_FUNC_FORK
 1207 CF_FUNC_MEMMOVE
 1208 
 1209 AC_MSG_CHECKING(if select expects int * arguments)
 1210 AC_EGREP_HEADER([select\(.*, *int *\*,],time.h,
 1211     AC_DEFINE(HAVE_SELECT_INTP) AC_MSG_RESULT(yes),
 1212     AC_MSG_RESULT(no)
 1213 )
 1214 
 1215 AC_FUNC_CLOSEDIR_VOID
 1216 
 1217 # autoconf 2.5x assumes setvbuf is not reversed when cross-compiling
 1218 if test "$cross_compiling" != yes ; then
 1219     AC_FUNC_SETVBUF_REVERSED
 1220 fi
 1221 
 1222 ### Checks for network library functions.
 1223 AC_CHECK_FUNCS(\
 1224     gai_strerror \
 1225     getaddrinfo \
 1226     gethostname \
 1227     gethostbyname \
 1228     getservbyname \
 1229     inet_addr \
 1230     inet_ntoa \
 1231     strncasecmp \
 1232 )
 1233 
 1234 CF_TYPE_SIGACTION
 1235 CF_TERMIOS
 1236 CF_PW_GECOS
 1237 CF_TM_GMTOFF
 1238 
 1239 AC_SYS_LONG_FILE_NAMES
 1240 CF_FUNC_SYSTEM
 1241 
 1242 # Check if we are trying to use curses+color, but cannot
 1243 if test $use_color = yes ; then
 1244     if test $use_curses = no ; then
 1245         AC_DEFINE(HAVE_COLOR)
 1246     elif test $cf_with_screen = pdcurses ; then
 1247         AC_DEFINE(HAVE_COLOR)
 1248     else
 1249         CF_NCURSES_BROKEN
 1250         CF_COLOR_CURSES
 1251         if test $cf_cv_color_curses = yes ; then
 1252             AC_DEFINE(HAVE_COLOR)
 1253         else
 1254             AC_MSG_WARN(This curses library does not support color)
 1255         fi
 1256     fi
 1257 fi
 1258 
 1259 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 1260 if test -n "$GCC"; then
 1261     check_sig_const=yes
 1262 elif test -f /sys/dm/dm ; then
 1263     check_sig_const=yes
 1264 elif test -f /sys/dm/spm ; then
 1265     check_sig_const=yes
 1266 else
 1267     check_sig_const=no
 1268 fi
 1269 
 1270 if test $check_sig_const = yes ; then
 1271     CF_SIG_CONST
 1272 fi
 1273 
 1274 CF_COMPTYPE
 1275 CF_COREFILE
 1276 
 1277 ### test this last, since it uses a partly-built autoconf.h
 1278 # Setup includes for test-program to verify declarations
 1279 CHECK_DECL_FLAG="-I$srcdir/include -I$srcdir/pcre"
 1280 CHECK_DECL_HDRS='
 1281 #define M_UNIX
 1282 #define __CPROTO__
 1283 #define HAVE_CONFDEFS_H
 1284 #include <tin.h>'
 1285 TIN_DECL_HDRS="$CHECK_DECL_HDRS"
 1286 
 1287 dnl These return non-int values, and can be troublesome if not declared
 1288 CF_CHECK_DECL(\
 1289     errno \
 1290     getenv \
 1291     getlogin \
 1292     getpwnam \
 1293     popen \
 1294     strchr \
 1295     strcasestr \
 1296     strsep \
 1297     tmpfile \
 1298 )
 1299 
 1300 dnl Check network stuff separately, to limit the effect of inconsistent headers
 1301 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1302 #include <tnntp.h>"
 1303 CF_CHECK_DECL(\
 1304     gethostbyname \
 1305     getservbyname \
 1306     inet_aton \
 1307     inet_ntoa \
 1308     socket \
 1309 )
 1310 
 1311 if test $use_curses = no ; then
 1312 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1313 #include <tcurses.h>"
 1314 CF_CHECK_DECL(\
 1315     tgetstr \
 1316     tgoto \
 1317 )
 1318 fi
 1319 
 1320 if test $with_decl_check = yes; then
 1321 CHECK_DECL_HDRS="$TIN_DECL_HDRS"
 1322 CF_CHECK_DECL(\
 1323     _flsbuf \
 1324     alarm \
 1325     atoi \
 1326     atol \
 1327     atoll \
 1328     atoq \
 1329     bcopy \
 1330     bzero \
 1331     calloc \
 1332     fchmod \
 1333     fclose \
 1334     fdopen \
 1335     fflush \
 1336     fgetc \
 1337     fileno \
 1338     fprintf \
 1339     fputc \
 1340     fputs \
 1341     fread \
 1342     free \
 1343     fseek \
 1344     fwrite \
 1345     getcwd \
 1346     getopt \
 1347     getwd \
 1348     heapsort \
 1349     ioctl \
 1350     isascii \
 1351     kill \
 1352     malloc \
 1353     memset \
 1354     mkstemp \
 1355     mktemp \
 1356     pclose \
 1357     perror \
 1358     printf \
 1359     putenv \
 1360     qsort \
 1361     realloc \
 1362     rename \
 1363     rewind \
 1364     select \
 1365     setenv \
 1366     snprintf \
 1367     sscanf \
 1368     strcasecmp \
 1369     strftime \
 1370     strncasecmp \
 1371     strtol \
 1372     strtoll \
 1373     system \
 1374     time \
 1375     tolower \
 1376     toupper \
 1377     ungetc \
 1378     usleep \
 1379     vsprintf \
 1380     vsnprintf \
 1381 )
 1382 
 1383 if test $use_curses = no ; then
 1384 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1385 #include <tcurses.h>"
 1386 CF_CHECK_DECL($cf_tc_externs)
 1387 fi
 1388 
 1389 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1390 #include <tnntp.h>"
 1391 CF_CHECK_DECL(\
 1392     connect \
 1393     gethostname \
 1394 )
 1395 
 1396 fi
 1397 
 1398 CF_TIOCGWINSZ
 1399 
 1400 ### append special libraries that get in the way of testing
 1401 case $debug_malloc in
 1402 DBMALLOC)
 1403     AC_DEFINE(USE_DBMALLOC)
 1404     LIBS="$LIBS -ldbmalloc"
 1405     ;;
 1406 DMALLOC)
 1407     AC_DEFINE(USE_DMALLOC)
 1408     LIBS="$LIBS -ldmalloc"
 1409     ;;
 1410 esac
 1411 
 1412 ### Use gettext
 1413 ### this also calls AM_LANGINFO_CODESET and AM_ICONV
 1414 ### so we don't need to do the tests ourselves.
 1415 CF_BUNDLED_INTL
 1416 LIBS="$LIBS $LIBICONV"
 1417 
 1418 ### check for alloca (required for bison and/or intl/*)
 1419 case "$YACC" in
 1420 bison*)
 1421     use_alloca=yes
 1422     ;;
 1423 *)
 1424     use_alloca=$USE_INCLUDED_LIBINTL
 1425     ;;
 1426 esac
 1427 
 1428 if test ".$use_alloca" = .yes ; then
 1429     CF_FUNC_ALLOCA
 1430 else
 1431     ALLOCA=""
 1432     AC_SUBST(ALLOCA)
 1433 fi
 1434 
 1435 CF_CHECK_HEADERS(iconv.h)
 1436 AC_MSG_CHECKING(for iconv_open() //TRANSLIT extension)
 1437 AC_TRY_RUN([
 1438 #ifdef HAVE_ICONV_H
 1439 #   include <iconv.h>
 1440 #endif /* HAVE_ICONV_H */
 1441 #ifdef HAVE_STDLIB_H
 1442 #   include <stdlib.h>
 1443 #endif /* HAVE_STDLIB_H */
 1444 int main() {
 1445     iconv_t cd;
 1446 
 1447     if ((cd = iconv_open("US-ASCII//TRANSLIT", "ISO-8859-1")) == (iconv_t) (-1))
 1448         exit(1);
 1449     exit(0);
 1450 }],
 1451     [
 1452         AC_DEFINE(HAVE_ICONV_OPEN_TRANSLIT)
 1453         AC_MSG_RESULT(yes)
 1454     ],
 1455     [
 1456         AC_MSG_RESULT(no)
 1457     ],
 1458     [
 1459         AC_MSG_RESULT(unknown)
 1460     ]
 1461 )
 1462 
 1463 # FIXME / TESTME
 1464 # locale is broken on cygwin < 1.7.0
 1465 # group/other bits don't work on cygwin < 1.7.0
 1466 # locking doesn't work on cygwin < 2.0 as link(2) is detected but doesn't work
 1467 case "$host_os" in
 1468     *cygwin*)
 1469         case `uname -r | sed 's,(.*,,'` in
 1470             B*|1.0-6].*)
 1471                 # multiple defects
 1472                 AC_DEFINE(NO_LOCALE)
 1473                 AC_DEFINE(NO_LOCKING)
 1474                 AC_DEFINE(FILE_MODE_BROKEN)
 1475                 ;;
 1476             1.7.*)
 1477                 # link does not work
 1478                 AC_DEFINE(NO_LOCKING)
 1479                 ;;
 1480             *)
 1481                 AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1482                 ;;
 1483             esac
 1484         ;;
 1485     *haiku*)
 1486         # link does not work
 1487         AC_DEFINE(NO_LOCKING)
 1488         ;;
 1489     *)
 1490         AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1491 esac
 1492 
 1493 if test "$cf_cv_termlib" = pdcurses ; then
 1494     CF_PDCURSES_X11
 1495 fi
 1496 AC_CHECK_FUNCS(vw_printw)
 1497 
 1498 ### sum up warnings
 1499 if test "$cf_cv_termlib" = none ; then
 1500     AC_MSG_WARN([no term-lib found, you might run into trouble later.])
 1501 fi
 1502 if test "$YACC" = "" ; then
 1503     AC_MSG_WARN([no yacc-parser found, you might run into trouble later.])
 1504 fi
 1505 if test "$RANLIB" = "" ; then
 1506     AC_MSG_WARN([no library archive builder found, you might run into trouble later.])
 1507 fi
 1508 
 1509 ### Finally, build autoconf.h and the makefiles
 1510 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
 1511 
 1512 LINTFLAGS=$LINTFLAGS
 1513 AC_SUBST(LINTFLAGS)
 1514 
 1515 CF_DEFINE_STRING(TIN_CC,       "$CC")
 1516 CF_DEFINE_STRING(TIN_CFLAGS,   "$CFLAGS")
 1517 CF_DEFINE_STRING(TIN_CPP,      "$CPP")
 1518 CF_DEFINE_STRING(TIN_CPPFLAGS, "$CPPFLAGS")
 1519 CF_DEFINE_STRING(TIN_LD,       "$CC")
 1520 CF_DEFINE_STRING(TIN_LDFLAGS,  "$LDFLAGS")
 1521 CF_DEFINE_STRING(TIN_LIBS,     "$PCREDIR_LIBS $LIBS")
 1522 
 1523 AC_OUTPUT($PCRE_MAKEFILE
 1524     $SUB_MAKEFILE
 1525     $CAN_MAKEFILE
 1526     src/Makefile)