"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.2/configure.in" (24 Dec 2017, 36613 Bytes) of package /linux/misc/tin-2.4.2.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.1_vs_2.4.2.

    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   : 2017-06-13
    6 dnl Notes     :
    7 dnl
    8 dnl Copyright (c) 1995-2018 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.2
   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 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 MacOS X, exclude Darwin on ix86
  110 #   powerpc:apple:darwin*)  #(vi
  111 #       AC_DEFINE(MAC_OS_X)
  112 #       ;;
  113     # check for cygwin environment
  114     # -DSTATIC is needed for pcre
  115     *:*:*cygwin*)   #(vi
  116         PCRE_DEFINES="$PCRE_DEFINES -DSTATIC"
  117         ;;
  118     # SEIUX doesn't have any useful preprocessor symbol
  119     mips:sei:seiux*)    #(vi
  120         AC_DEFINE(SEIUX)
  121         ;;
  122 esac
  123 
  124 dnl TODO: also check for heapsort(3) in libbsd?
  125 AC_MSG_CHECKING(if you would like to use heapsort)
  126 CF_ARG_DISABLE(heapsort,
  127     [  --disable-heapsort      disable heapsort() as alternative to qsort],
  128     [cf_use_heapsort=no],
  129     [cf_use_heapsort=yes])
  130 AC_MSG_RESULT($cf_use_heapsort)
  131 if test "x$cf_use_heapsort" = xyes; then
  132     AC_CHECK_FUNCS(heapsort)
  133     if test x"$ac_cv_func_heapsort" = xyes; then
  134         AC_MSG_CHECKING(if its prototype is compatible with qsort)
  135         AC_TRY_COMPILE([
  136 #include <stdlib.h>
  137 #include <sys/types.h>
  138 extern int my_compare(const void *, const void *);
  139 ],[
  140     char *base = 0;
  141     heapsort((void *)0, 1, 2, my_compare);
  142 ],,[cf_use_heapsort=no]);
  143         AC_MSG_RESULT($cf_use_heapsort)
  144     else
  145         CF_VERBOSE(will use our own heapsort function)
  146         EXTRAO_DEP=''
  147         EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/heapsort.o"
  148     fi
  149 fi
  150 if test "x$cf_use_heapsort" = xyes; then
  151     AC_DEFINE(USE_HEAPSORT)
  152 fi
  153 
  154 CF_WITH_PROGRAM(ispell,
  155 [  --with-ispell           (default: from system path)])
  156 
  157 CF_WITH_PROGRAM(metamail,
  158 [  --with-metamail         (default: from system path)])
  159 
  160 CF_WITH_PROGRAM(sum,
  161 [  --with-sum              (default: from system path)])
  162 CF_PROG_SUM_R
  163 
  164 CF_PATH_EDITOR
  165 CF_PATH_MAILER
  166 CF_PATH_MAILBOX
  167 
  168 ## PGP Support
  169 AC_MSG_CHECKING(if you want PGP/GPG-Support)
  170 CF_ARG_DISABLE(pgp-gpg,
  171     [  --disable-pgp-gpg       disable PGP/GPG Support],
  172     [USE_PGP_GPG=no],
  173     [USE_PGP_GPG=yes])
  174 AC_MSG_RESULT($enableval)
  175 if test "$USE_PGP_GPG" = "yes" ; then
  176     CF_WITH_PROGRAM(pgp,
  177     [  --with-pgp              (default: from system path)])
  178     # FIXME: check if pgp is pgp2 or pgp6
  179 
  180     CF_WITH_PROGRAM(pgpk,
  181     [  --with-pgpk             (default: from system path)])
  182     # FIXME: remove tailing k
  183 
  184     CF_WITH_PROGRAM(gpg,
  185     [  --with-gpg              (default: from system path)])
  186 fi
  187 
  188 ## slrnface
  189 CF_WITH_PROGRAM(slrnface,
  190 [  --with-slrnface         (default: from system path)])
  191 if test -n "$ac_cv_path_PATH_SLRNFACE"; then
  192     EXTRAO_DEP=""
  193     EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/xface.o"
  194 fi
  195 
  196 ## Default shell
  197 AC_ARG_WITH(shell,
  198     [  --with-shell=PROG       default $SHELL program (default: sh)],
  199     [cf_cv_default_shell=$withval],
  200     [cf_cv_default_shell=])
  201 CF_DEFAULT_SHELL($cf_cv_default_shell)
  202 
  203 ### check for this early, since it'll override several options
  204 AC_MSG_CHECKING(if NNTP-support will be used)
  205 CF_ARG_DISABLE(nntp,
  206     [  --disable-nntp          disable reading via NNTP],
  207     [USE_NNTP=no],
  208     [USE_NNTP=yes])
  209 AC_MSG_RESULT($enableval)
  210 
  211 USE_SPOOLDIR=yes
  212 if test "$USE_NNTP" = "yes" ; then
  213 AC_MSG_CHECKING(whether to be NNTP_ONLY)
  214 CF_ARG_ENABLE(nntp-only,
  215     [  --enable-nntp-only      enable reading via NNTP only],
  216     [AC_DEFINE(NNTP_ONLY)
  217      USE_SPOOLDIR=no],
  218     [AC_DEFINE(NNTP_ABLE)])
  219 AC_MSG_RESULT($enableval)
  220 fi
  221 
  222 ### use option --enable-debug to compile-in test/development code
  223 AC_MSG_CHECKING(if you want to compile-in debug support)
  224 CF_ARG_ENABLE(debug,
  225     [  --enable-debug          turn on debug support],
  226     [ENABLE_DEBUG=''
  227     CFLAGS="-g $CFLAGS"
  228     LDFLAGS="-g $LDFLAGS"],
  229     [ENABLE_DEBUG='#'
  230     test -z "$save_CFLAGS" && CFLAGS=`echo $CFLAGS|sed -e 's/-g //' -e 's/-g$//'`])
  231 AC_MSG_RESULT($enableval)
  232 AC_SUBST(ENABLE_DEBUG)
  233 
  234 ### use option --disable-echo to suppress full display compiling commands
  235 CF_DISABLE_ECHO
  236 
  237 ### use option --enable-prototypes to turn on optional prototypes
  238 AC_MSG_CHECKING(if you want to compile with fallback prototypes)
  239 CF_ARG_ENABLE(prototypes,
  240     [  --enable-prototypes     check for optional prototypes],
  241     [with_decl_check=yes],
  242     [with_decl_check=no])
  243 AC_MSG_RESULT($enableval)
  244 
  245 ### use option --enable-warnings to turn on all gcc warnings
  246 EXTRA_CFLAGS=""
  247 if test -n "$GCC"
  248 then
  249 AC_MSG_CHECKING(if you want to turn on gcc warnings)
  250 CF_ARG_ENABLE(warnings,
  251     [  --enable-warnings       turn on GCC compiler warnings],
  252     [with_warnings=yes],
  253     [with_warnings=no])
  254 AC_MSG_RESULT($with_warnings)
  255 if test "$with_warnings" = "yes"
  256 then
  257     with_ext_const=yes
  258     CF_GCC_WARNINGS
  259 fi
  260 fi
  261 
  262 ## !NNTP_ONLY
  263 if test "$USE_SPOOLDIR" = "yes"; then
  264     ## options for directories
  265     AC_MSG_CHECKING(for news-library path)
  266     CF_WITH_PATH(libdir,
  267         [  --with-libdir=PATH      news-library],
  268         NEWSLIBDIR,/usr/lib/news)
  269     AC_MSG_RESULT($NEWSLIBDIR)
  270 
  271     AC_MSG_CHECKING(for news spool-directory path)
  272     CF_WITH_PATH(spooldir,
  273         [  --with-spooldir=PATH    news spool-directory],
  274         SPOOLDIR,/var/spool/news)
  275     AC_MSG_RESULT($SPOOLDIR)
  276 
  277     AC_MSG_CHECKING(for news overview-directory path)
  278     CF_WITH_PATH(nov-dir,
  279         [  --with-nov-dir=PATH     news overview-directory],
  280         NOVROOTDIR,$SPOOLDIR)
  281     AC_MSG_RESULT($NOVROOTDIR)
  282 
  283     AC_MSG_CHECKING(for overview filename)
  284     CF_WITH_VALUE(nov-fname,
  285         [  --with-nov-fname        specify names of overview files],
  286         OVERVIEW_FILE,.overview)
  287     AC_MSG_RESULT($OVERVIEW_FILE)
  288 
  289     INEWSPATH="$NEWSLIBDIR"
  290 else
  291     NEWSLIBDIR=""
  292     SPOOLDIR=""
  293     NOVROOTDIR=""
  294     INEWSPATH="/usr/lib/news"
  295 fi
  296 
  297 ## TODO: kick the --with-inews-dir= stuff, the check below should be enough
  298 ## (requires some code rework in tin)
  299 AC_MSG_CHECKING(for directory containing \"inews\")
  300 CF_WITH_PATH(inews-dir,
  301     [  --with-inews-dir=PATH   directory containing "inews"],
  302     INEWSDIR,$INEWSPATH)
  303 INEWSDIR=`echo $INEWSDIR |sed -e 's,/$,,'`
  304 AC_MSG_RESULT($INEWSDIR)
  305 
  306 AC_PATH_PROG(INEWS,
  307     inews, --internal,
  308     $INEWSDIR:/news/bin:/usr/lib/news/bin:$INEWSPATH)
  309 if test "$ac_cv_path_INEWS" != ""; then
  310     if test "$ac_cv_path_INEWS" = "--internal"; then
  311         CF_DEFINE_STRING(PATH_INEWS, "$INEWS")
  312     else
  313         CF_DEFINE_STRING(PATH_INEWS, "$INEWS -h")
  314     fi
  315 fi
  316 
  317 ### Look for network libraries first, since some functions (such as gethostname)
  318 ### are used in a lot of places.
  319 AC_CACHE_CHECK(if you want socks library,cf_cv_use_libsocks,[
  320 AC_ARG_WITH(socks,
  321     [  --with-socks[=path]       link with socks library if available],
  322     [cf_cv_use_libsocks=$withval],
  323     [cf_cv_use_libsocks=no])
  324 ])
  325 
  326 AC_CACHE_CHECK(if you want socks5 library,cf_cv_use_libsocks5,[
  327 AC_ARG_WITH(socks5,
  328     [  --with-socks5[=path]      link with socks5 library if available],
  329     [cf_cv_use_libsocks5=$withval],
  330     [cf_cv_use_libsocks5=no])
  331 ])
  332 
  333 if test "x$cf_cv_use_libsocks" != xno ; then
  334     CF_SOCKS($cf_cv_use_libsocks)
  335 else
  336     CF_NETLIBS
  337     if test "x$cf_cv_use_libsocks5" != xno ; then
  338     CF_SOCKS5($cf_cv_use_libsocks5)
  339     fi
  340 fi
  341 
  342 ### which locking method should be used for mailbox locking
  343 ### first look for all available locking methods
  344 CF_LOCKFILE
  345 
  346 AC_MSG_CHECKING(which locking method will be used)
  347 ### fcntl() is preferred, if the user just disables fcntl()
  348 ### without specifying an alternative lockf() is preferred
  349 CF_ARG_DISABLE(fcntl,
  350     [  --disable-fcntl         disable fcntl() locking],
  351         requested_lock="lockf",
  352         requested_lock="fcntl")
  353 CF_ARG_ENABLE(lockf,
  354     [  --enable-lockf          enable lockf() locking],
  355         requested_lock="lockf")
  356 CF_ARG_ENABLE(flock,
  357     [  --enable-flock          enable flock() locking],
  358         requested_lock="flock")
  359 ### now check the users wishes against available locking methods
  360 if test -n "$cf_cv_lockfile"; then
  361     for lock in $cf_cv_lockfile; do
  362         if test "$lock" = "$requested_lock"; then
  363             used_locking=$lock
  364             break
  365         fi
  366     done
  367 ### if none of them matched use the one with the highest priority
  368     if test "x$used_locking" = "x"; then
  369         used_locking=`echo $cf_cv_lockfile|sed -e 's/^\([[^ ]]\+\).*/\1/g'`
  370     fi
  371     AC_MSG_RESULT($used_locking)
  372     CF_UPPER(used_locking,$used_locking)
  373     AC_DEFINE_UNQUOTED(USE_$used_locking)
  374 else
  375     AC_MSG_RESULT(none);
  376     AC_MSG_WARN([[None of fcntl(), lockf(), flock() available]])
  377 fi
  378 
  379 AC_MSG_CHECKING(for screen type)
  380 AC_ARG_WITH(screen,
  381 [  --with-screen=xxx       specify screen type, which must be one of:
  382                           termcap, terminfo, curses, ncurses, ncursesw, or
  383                           pdcurses (replaces options --enable-curses and
  384                           --with-ncurses)],
  385     [cf_with_screen=$withval],
  386     [cf_with_screen=none])
  387 AC_MSG_RESULT($cf_with_screen)
  388 
  389 use_curses=no
  390 use_ncurses=no
  391 
  392 CF_WITH_CURSES_DIR($cf_with_screen)
  393 
  394 case $cf_with_screen in #(vi
  395 termcap|terminfo) #(we will determine which it really is
  396     ;;
  397 curses) #(vi
  398     use_curses=yes
  399     ;;
  400 ncurses) #(vi
  401     use_curses=yes
  402     use_ncurses=yes
  403     ;;
  404 ncursesw) #(vi
  405     use_curses=yes
  406     use_ncurses=yes
  407     ;;
  408 pdcurses) #(vi
  409     use_curses=yes
  410     ;;
  411 none)
  412     AC_MSG_CHECKING(if you want to use ncurses library)
  413     AC_ARG_WITH(ncurses,
  414         [  --with-ncurses          link with ncurses if available (deprecated)],
  415         [use_ncurses=$withval],
  416         [use_ncurses=no])
  417     AC_MSG_RESULT($use_ncurses)
  418 
  419     AC_MSG_CHECKING(if you want curses rather than termcap interface)
  420     CF_ARG_ENABLE(curses,
  421         [  --enable-curses         use curses interface (deprecated)],
  422         [cf_with_screen=curses;  use_curses=$withval],
  423         [cf_with_screen=termcap; use_curses=no])
  424     AC_MSG_RESULT($enableval)
  425     ;;
  426 esac
  427 
  428 if test $use_curses != no ; then
  429     AC_DEFINE(USE_CURSES)
  430     case $cf_with_screen in #(vi
  431     ncurses) #(vi
  432         CF_NCURSES_CONFIG
  433         ;;
  434     ncursesw) #(vi
  435         CF_CHECK_HEADERS(stdlib.h wchar.h wctype.h)
  436         AM_MULTIBYTE_ABLE
  437         CF_NCURSES_CONFIG(ncursesw)
  438         CF_XOPEN_CURSES
  439         test "$cf_cv_need_xopen_extension" = unknown && AC_ERROR(X/Open curses not found)
  440         ;;
  441     curses) #(vi
  442         CF_CURSES_CONFIG
  443         CF_XOPEN_CURSES
  444         ;;
  445     esac
  446 fi
  447 
  448 ## substitute externally-installed PCRE library for our bundled version
  449 AC_MSG_CHECKING(if you want to use installed version of pcre)
  450 AC_ARG_WITH(pcre,
  451     [  --with-pcre=PATH        use installed pcre versus bundled],
  452     [PCRE_HOME=$withval],
  453     [PCRE_HOME=no])
  454 AC_MSG_RESULT($PCRE_HOME)
  455 CF_BUNDLED_PCRE($PCRE_HOME)
  456 
  457 PCRE_MAKEFILE=
  458 if test "$PCRE_HOME" = "no" ; then
  459     LINK_SIZE="-DLINK_SIZE=2"
  460     AC_SUBST(LINK_SIZE)
  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 
  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     net/socket.h \
  761     netdb.h \
  762     netinet/in.h \
  763     netlib.h \
  764     nl_types.h \
  765     nomacros.h \
  766     paths.h \
  767     poll.h \
  768     prototypes.h \
  769     pwd.h \
  770     sgtty.h \
  771     socket.h \
  772     stdarg.h \
  773     stdbool.h \
  774     stddef.h \
  775     stdint.h \
  776     stdlib.h \
  777     string.h \
  778     strings.h \
  779     stropts.h \
  780     sys/bsdtypes.h \
  781     sys/errno.h \
  782     sys/file.h \
  783     sys/ioctl.h \
  784     sys/param.h \
  785     sys/poll.h \
  786     sys/ptem.h \
  787     sys/pty.h \
  788     sys/select.h \
  789     sys/stat.h \
  790     sys/stream.h \
  791     sys/socket.h \
  792     sys/time.h \
  793     sys/timeb.h \
  794     sys/times.h \
  795     sys/types.h \
  796     sys/utsname.h \
  797     term.h \
  798     termio.h \
  799     time.h \
  800     unistd.h \
  801     varargs.h \
  802     wchar.h \
  803     wctype.h \
  804 )
  805 
  806 ### Checks that depend on existence-checks for headers
  807 CF_SIZECHANGE
  808 CF_SYS_SELECT_TIMEVAL
  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()
  915 #  - uidna_IDNToUnicode()
  916 #  - ubidi_open()
  917 # and for IDNA2008
  918 #  - uidna_openUTS46()
  919 #  - uidna_nameToUnicode()
  920 cf_try_icuuc="no"
  921 cf_try_icuuc46="no"
  922 AC_CHECK_HEADER(unicode/unorm.h,[
  923     AC_CHECK_HEADER(unicode/ustring.h, [
  924         AC_DEFINE(HAVE_UNICODE_UNORM_H)
  925         AC_DEFINE(HAVE_UNICODE_USTRING_H)
  926         AC_MSG_CHECKING(for unorm_normalize in libicuuc)
  927         cf_save_LIBS="$LIBS"
  928         cf_try_icuuc="no"
  929         LIBS="$LIBS -licuuc"
  930         AC_TRY_LINK([#include <unicode/unorm.h>], [
  931             int32_t needed, ustr = NULL;
  932             UErrorCode status;
  933             needed = unorm_normalize(ustr, -1, UNORM_DEFAULT, 0, NULL, 0, &status);], [
  934             AC_DEFINE(HAVE_LIBICUUC)
  935             cf_try_icuuc="yes"],
  936             LIBS=$cf_save_LIBS
  937         )
  938         AC_MSG_RESULT($cf_try_icuuc)
  939         cf_save_LIBS="$LIBS"
  940         AC_CHECK_HEADER(unicode/uidna.h, [
  941             AC_DEFINE(HAVE_UNICODE_UIDNA_H)
  942         ])
  943         AC_MSG_CHECKING(for uidna_nameToUnicode in libicuuc)
  944         AC_TRY_LINK([#include <unicode/uidna.h>
  945             #include <unicode/unorm.h>], [
  946             UErrorCode status = U_ZERO_ERROR;
  947             UIDNAInfo info = UIDNA_INFO_INITIALIZER;
  948             UIDNA *uts46;
  949             uidna_openUTS46(UNORM_DEFAULT, &status);
  950             uidna_nameToUnicode(uts46, NULL, 0, NULL, 0, &info, &status);
  951             uidna_close(uts46);], [
  952             AC_DEFINE(HAVE_LIBICUUC_46_API)
  953             cf_try_icuuc46="yes"],
  954             LIBS=$cf_save_LIBS
  955         )
  956         AC_MSG_RESULT($cf_try_icuuc46)
  957         AC_CHECK_HEADER(unicode/ubidi.h, [
  958             AC_DEFINE(HAVE_UNICODE_UBIDI_H)
  959         ])
  960     ])
  961 ])
  962 
  963 # without icuuc try GNU libunistring for normalization
  964 if test $cf_try_icuuc = no ; then
  965     AC_CHECK_HEADER(unitypes.h,[
  966         AC_CHECK_HEADER(uninorm.h,[
  967             AC_DEFINE(HAVE_UNITYPES_H)
  968             AC_DEFINE(HAVE_UNINORM_H)
  969             AC_MSG_CHECKING(for u8_normalize in libunistring)
  970             cf_save_LIBS="$LIBS"
  971             cf_try_unistring="no"
  972             LIBS="$LIBS -lunistring"
  973             AC_TRY_LINK([#include <unitypes.h>
  974                 #include <uninorm.h>], [
  975                 size_t ol = 0;
  976                 u8_normalize(UNINORM_NFC, (uint8_t *) "x", 2, NULL, &ol);], [
  977                 AC_DEFINE(HAVE_LIBUNISTRING)
  978                 cf_try_unistring="yes"],
  979                 LIBS=$cf_save_LIBS
  980             )
  981             AC_MSG_RESULT($cf_try_unistring)
  982         ])
  983     ])
  984 fi
  985 
  986 # without icuuc try libidn for Internationalized Domain Names / IDN 2003
  987 # TODO: check for libidn2
  988 if test $cf_try_icuuc = no ; then
  989     AC_CHECK_LIB(idn, stringprep_check_version,
  990         [AC_CHECK_HEADER(stringprep.h,[
  991             AC_DEFINE(HAVE_STRINGPREP_H)
  992             AC_CHECK_HEADER(idna.h, [
  993                 AC_DEFINE(HAVE_IDNA_H)
  994                 AC_CHECK_LIB(idn, idna_to_unicode_lzlz, [
  995                     AC_DEFINE(HAVE_IDNA_TO_UNICODE_LZLZ)
  996                     AC_MSG_CHECKING(for IDNA_USE_STD3_ASCII_RULES)
  997                     AC_EGREP_HEADER(IDNA_USE_STD3_ASCII_RULES, idna.h, [
  998                         AC_DEFINE(HAVE_IDNA_USE_STD3_ASCII_RULES)
  999                         AC_MSG_RESULT(yes)],
 1000                         AC_MSG_RESULT(no)
 1001                     )
 1002                 ])
 1003                 AC_CHECK_LIB(idn, idna_strerror, [
 1004                     AC_DEFINE(HAVE_IDNA_STRERROR)
 1005                 ])
 1006             ])
 1007             AC_DEFINE(HAVE_LIBIDN)
 1008             LIBS="$LIBS -lidn"]
 1009         )]
 1010     )
 1011 fi
 1012 
 1013 # libidnkit - Internationalized Domain Names / IDN 2008
 1014 AC_CHECK_LIB(idnkit, idn_decodename, [
 1015     AC_CHECK_HEADER(idn/api.h, [
 1016         AC_MSG_CHECKING(for IDN_DECODE_LOOKUP)
 1017         cf_save_LIBS="$LIBS"
 1018         LIBS="$LIBS -lidnkit"
 1019         AC_TRY_LINK([#include <idn/api.h>
 1020             #include <string.h>], [
 1021             idn_result_t rs;
 1022             char in[255], out[255];
 1023             strcpy(in, "xn--brenfe-fta9a2q.de");
 1024             rs = idn_decodename(IDN_DECODE_LOOKUP, &in, &out, 254);
 1025             idn_result_tostring(rs);], [
 1026             AC_DEFINE(HAVE_LIBIDNKIT)
 1027             AC_DEFINE(HAVE_IDN_API_H)
 1028             AC_DEFINE(HAVE_IDN_DECODENAME)
 1029             AC_MSG_RESULT(yes)], [
 1030             LIBS=$cf_save_LIBS
 1031             AC_MSG_RESULT(no)
 1032         ])
 1033     ])
 1034 ])
 1035 
 1036 
 1037 if test $use_curses != no ; then
 1038     cf_cv_termlib=$cf_with_screen
 1039 else
 1040     CF_TERMCAP_LIBS
 1041     # terminfo-based termcap interfaces may be prototyped in <curses.h>,
 1042     # which may/may not be compatible with <termcap.h>
 1043     AC_MSG_CHECKING(if we should include termcap.h)
 1044     cf_save_CFLAGS="$CFLAGS"
 1045     CFLAGS="$CFLAGS -I$srcdir/include"
 1046     AC_TRY_COMPILE([
 1047 #define HAVE_TERMCAP_H 1
 1048 #include <tcurses.h>],[
 1049 #ifdef NCURSES_VERSION
 1050 make an error
 1051 #endif
 1052 ],
 1053         [cf_result=yes],
 1054         [cf_result=no])
 1055     AC_MSG_RESULT($cf_result)
 1056     CFLAGS="$cf_save_CFLAGS"
 1057     test $cf_result = yes && AC_DEFINE(HAVE_TERMCAP_H)
 1058     CF_TYPE_OUTCHAR
 1059 fi
 1060 
 1061 cf_tc_funcs=
 1062 cf_tc_externs=
 1063 if test ".$cf_cv_termlib" = .terminfo ; then
 1064     AC_DEFINE(USE_TERMINFO)
 1065     cf_tc_funcs="tigetint tigetnum tparam tparm"
 1066     cf_tc_externs="$cf_tc_funcs tgoto tigetstr tputs tigetflag"
 1067 elif test ".$cf_cv_termlib" = .termcap ; then
 1068     # BSD 'tputs()' may need 'PC' to be set.
 1069     AC_TRY_LINK([],[extern char PC; PC = 0],
 1070         [AC_DEFINE(HAVE_EXTERN_TCAP_PC)])
 1071     cf_tc_funcs="tgetint tgetnum tparam tparm"
 1072     cf_tc_externs="$cf_tc_funcs tgoto tgetstr tputs tgetent tgetflag"
 1073 fi
 1074 
 1075 ### Checks for external-data
 1076 CF_ERRNO
 1077 CF_STRERROR
 1078 
 1079 ### Checks for library functions.
 1080 AC_CHECK_FUNCS(\
 1081     alarm \
 1082     atoi \
 1083     atol \
 1084     atoll \
 1085     atoq \
 1086     bcopy \
 1087     chmod \
 1088     closesocket \
 1089     execlp \
 1090     fcntl \
 1091     fdopen \
 1092     fork \
 1093     ftime \
 1094     ftruncate \
 1095     fsync \
 1096     getcwd \
 1097     gettimeofday \
 1098     getwd \
 1099     inet_aton \
 1100     is_xterm \
 1101     isascii \
 1102     lockf \
 1103     memcmp \
 1104     memcpy \
 1105     memmove \
 1106     memset \
 1107     mkdir \
 1108     mkfifo \
 1109     mktemp \
 1110     mkstemp \
 1111     nl_langinfo \
 1112     poll \
 1113     putenv \
 1114     rewinddir \
 1115     resizeterm \
 1116     select \
 1117     setenv \
 1118     setlocale \
 1119     settz \
 1120     setvbuf \
 1121     sigaction \
 1122     snprintf \
 1123     stpcpy \
 1124     strchr \
 1125     strcasecmp \
 1126     strcasestr \
 1127     strdup \
 1128     strftime \
 1129     strpbrk \
 1130     strrchr \
 1131     strrstr \
 1132     strsep \
 1133     strstr \
 1134     strtol \
 1135     strtoll \
 1136     tmpfile \
 1137     tzset \
 1138     uname \
 1139     unlink \
 1140     use_default_colors \
 1141     usleep \
 1142     vasprintf \
 1143     vsnprintf \
 1144     waitpid \
 1145 $cf_tc_funcs )
 1146 
 1147 AC_CHECK_FUNC(flock,
 1148     AC_DEFINE(HAVE_FLOCK),[
 1149     AC_CHECK_LIB(bsd, flock,
 1150         AC_DEFINE(HAVE_FLOCK)
 1151         LIBS="$LIBS -lbsd")])
 1152 
 1153 # clock_gettime() / librt
 1154 AC_CHECK_FUNC(clock_gettime,
 1155     AC_DEFINE(HAVE_CLOCK_GETTIME),[
 1156         AC_CHECK_LIB(rt, clock_gettime,
 1157             AC_DEFINE(HAVE_CLOCK_GETTIME)
 1158             LIBS="$LIBS -lrt"
 1159         )
 1160     ]
 1161 )
 1162 
 1163 AM_MULTIBYTE_ABLE
 1164 
 1165 AC_MSG_CHECKING(if gettimeofday takes two arguments)
 1166 AC_TRY_COMPILE([
 1167 #if HAVE_SYS_TIME_H
 1168 #include <sys/time.h>
 1169 #endif],
 1170 [struct timeval *tv;
 1171 struct timezone *tz;
 1172 gettimeofday(&tv, &tz);],
 1173 ac_cv_func_gettimeofday_2args=yes, ac_cv_func_gettimeofday_2args=no)
 1174 AC_MSG_RESULT($ac_cv_func_gettimeofday_2args)
 1175 if test $ac_cv_func_gettimeofday_2args = yes; then
 1176     AC_DEFINE(GETTIMEOFDAY_2ARGS)
 1177 fi
 1178 
 1179 CF_POSIX_JC
 1180 CF_FUNC_FORK
 1181 CF_FUNC_MEMMOVE
 1182 
 1183 AC_MSG_CHECKING(if select expects int * arguments)
 1184 AC_EGREP_HEADER([select\(.*, *int *\*,],time.h,
 1185     AC_DEFINE(HAVE_SELECT_INTP) AC_MSG_RESULT(yes),
 1186     AC_MSG_RESULT(no)
 1187 )
 1188 
 1189 AC_FUNC_CLOSEDIR_VOID
 1190 
 1191 # autoconf 2.5x assumes setvbuf is not reversed when cross-compiling
 1192 if test "$cross_compiling" != yes ; then
 1193     AC_FUNC_SETVBUF_REVERSED
 1194 fi
 1195 
 1196 ### Checks for network library functions.
 1197 AC_CHECK_FUNCS(\
 1198     gai_strerror \
 1199     getaddrinfo \
 1200     gethostname \
 1201     gethostbyname \
 1202     getservbyname \
 1203     inet_addr \
 1204     inet_ntoa \
 1205     strncasecmp \
 1206 )
 1207 
 1208 CF_TYPE_SIGACTION
 1209 CF_TERMIOS
 1210 CF_PW_GECOS
 1211 CF_TM_GMTOFF
 1212 
 1213 AC_SYS_LONG_FILE_NAMES
 1214 CF_FUNC_SYSTEM
 1215 
 1216 # Check if we are trying to use curses+color, but cannot
 1217 if test $use_color = yes ; then
 1218     if test $use_curses = no ; then
 1219         AC_DEFINE(HAVE_COLOR)
 1220     elif test $cf_with_screen = pdcurses ; then
 1221         AC_DEFINE(HAVE_COLOR)
 1222     else
 1223         CF_NCURSES_BROKEN
 1224         CF_COLOR_CURSES
 1225         if test $cf_cv_color_curses = yes ; then
 1226             AC_DEFINE(HAVE_COLOR)
 1227         else
 1228             AC_MSG_WARN(This curses library does not support color)
 1229         fi
 1230     fi
 1231 fi
 1232 
 1233 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 1234 if test -n "$GCC"; then
 1235     check_sig_const=yes
 1236 elif test -f /sys/dm/dm ; then
 1237     check_sig_const=yes
 1238 elif test -f /sys/dm/spm ; then
 1239     check_sig_const=yes
 1240 else
 1241     check_sig_const=no
 1242 fi
 1243 
 1244 if test $check_sig_const = yes ; then
 1245     CF_SIG_CONST
 1246 fi
 1247 
 1248 CF_COMPTYPE
 1249 CF_COREFILE
 1250 
 1251 ### test this last, since it uses a partly-built autoconf.h
 1252 # Setup includes for test-program to verify declarations
 1253 CHECK_DECL_FLAG="-I$srcdir/include -I$srcdir/pcre"
 1254 CHECK_DECL_HDRS='
 1255 #define M_UNIX
 1256 #define __CPROTO__
 1257 #define HAVE_CONFDEFS_H
 1258 #include <tin.h>'
 1259 TIN_DECL_HDRS="$CHECK_DECL_HDRS"
 1260 
 1261 dnl These return non-int values, and can be troublesome if not declared
 1262 CF_CHECK_DECL(\
 1263     errno \
 1264     getenv \
 1265     getlogin \
 1266     getpwnam \
 1267     popen \
 1268     strchr \
 1269     strcasestr \
 1270     strsep \
 1271     tmpfile \
 1272 )
 1273 
 1274 dnl Check network stuff separately, to limit the effect of inconsistent headers
 1275 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1276 #include <tnntp.h>"
 1277 CF_CHECK_DECL(\
 1278     gethostbyname \
 1279     getservbyname \
 1280     inet_aton \
 1281     inet_ntoa \
 1282     socket \
 1283 )
 1284 
 1285 if test $use_curses = no ; then
 1286 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1287 #include <tcurses.h>"
 1288 CF_CHECK_DECL(\
 1289     tgetstr \
 1290     tgoto \
 1291 )
 1292 fi
 1293 
 1294 if test $with_decl_check = yes; then
 1295 CHECK_DECL_HDRS="$TIN_DECL_HDRS"
 1296 CF_CHECK_DECL(\
 1297     _flsbuf \
 1298     alarm \
 1299     atoi \
 1300     atol \
 1301     atoll \
 1302     atoq \
 1303     bcopy \
 1304     bzero \
 1305     calloc \
 1306     fchmod \
 1307     fclose \
 1308     fdopen \
 1309     fflush \
 1310     fgetc \
 1311     fileno \
 1312     fprintf \
 1313     fputc \
 1314     fputs \
 1315     fread \
 1316     free \
 1317     fseek \
 1318     fwrite \
 1319     getcwd \
 1320     getopt \
 1321     getwd \
 1322     heapsort \
 1323     ioctl \
 1324     isascii \
 1325     kill \
 1326     malloc \
 1327     memset \
 1328     mkstemp \
 1329     mktemp \
 1330     pclose \
 1331     perror \
 1332     printf \
 1333     putenv \
 1334     qsort \
 1335     realloc \
 1336     rename \
 1337     rewind \
 1338     select \
 1339     setenv \
 1340     snprintf \
 1341     sscanf \
 1342     strcasecmp \
 1343     strftime \
 1344     strncasecmp \
 1345     strtol \
 1346     strtoll \
 1347     system \
 1348     time \
 1349     tolower \
 1350     toupper \
 1351     ungetc \
 1352     usleep \
 1353     vsprintf \
 1354     vsnprintf \
 1355 )
 1356 
 1357 if test $use_curses = no ; then
 1358 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1359 #include <tcurses.h>"
 1360 CF_CHECK_DECL($cf_tc_externs)
 1361 fi
 1362 
 1363 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1364 #include <tnntp.h>"
 1365 CF_CHECK_DECL(\
 1366     connect \
 1367     gethostname \
 1368 )
 1369 
 1370 fi
 1371 
 1372 CF_TIOCGWINSZ
 1373 
 1374 ### append special libraries that get in the way of testing
 1375 case $debug_malloc in
 1376 DBMALLOC)
 1377     AC_DEFINE(USE_DBMALLOC)
 1378     LIBS="$LIBS -ldbmalloc"
 1379     ;;
 1380 DMALLOC)
 1381     AC_DEFINE(USE_DMALLOC)
 1382     LIBS="$LIBS -ldmalloc"
 1383     ;;
 1384 esac
 1385 
 1386 ### Use gettext
 1387 ### this also calls AM_LANGINFO_CODESET and AM_ICONV
 1388 ### so we don't need to do the tests ourselves.
 1389 CF_BUNDLED_INTL
 1390 LIBS="$LIBS $LIBICONV"
 1391 
 1392 ### check for alloca (required for bison and/or intl/*)
 1393 case "$YACC" in
 1394 bison*)
 1395     use_alloca=yes
 1396     ;;
 1397 *)
 1398     use_alloca=$USE_INCLUDED_LIBINTL
 1399     ;;
 1400 esac
 1401 
 1402 if test ".$use_alloca" = .yes ; then
 1403     CF_FUNC_ALLOCA
 1404 else
 1405     ALLOCA=""
 1406     AC_SUBST(ALLOCA)
 1407 fi
 1408 
 1409 CF_CHECK_HEADERS(iconv.h)
 1410 AC_MSG_CHECKING(for iconv_open() //TRANSLIT extension)
 1411 AC_TRY_RUN([
 1412 #ifdef HAVE_ICONV_H
 1413 #   include <iconv.h>
 1414 #endif /* HAVE_ICONV_H */
 1415 #ifdef HAVE_STDLIB_H
 1416 #   include <stdlib.h>
 1417 #endif /* HAVE_STDLIB_H */
 1418 int main() {
 1419     iconv_t cd;
 1420 
 1421     if ((cd = iconv_open("US-ASCII//TRANSLIT", "ISO-8859-1")) == (iconv_t) (-1))
 1422         exit(1);
 1423     exit(0);
 1424 }],
 1425     AC_DEFINE(HAVE_ICONV_OPEN_TRANSLIT) AC_MSG_RESULT(yes),
 1426     AC_MSG_RESULT(no),
 1427     AC_MSG_RESULT(unknown)
 1428 )
 1429 
 1430 # FIXME / TESTME
 1431 # locale is broken on cygwin < 1.7.0
 1432 # group/other bits don't work on cygwin < 1.7.0
 1433 # locking doesn't work on cygwin < 2.0 as link(2) is detected but doesn't work
 1434 case "$host_os" in
 1435     *cygwin*)
 1436         case `uname -r | sed 's,(.*,,'` in
 1437             B*|1.0-6].*)
 1438                 # multiple defects
 1439                 AC_DEFINE(NO_LOCALE)
 1440                 AC_DEFINE(NO_LOCKING)
 1441                 AC_DEFINE(FILE_MODE_BROKEN)
 1442                 ;;
 1443             1.7.*)
 1444                 # link does not work
 1445                 AC_DEFINE(NO_LOCKING)
 1446                 ;;
 1447             *)
 1448                 AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1449                 ;;
 1450             esac
 1451         ;;
 1452     *haiku*)
 1453         # link does not work
 1454         AC_DEFINE(NO_LOCKING)
 1455         ;;
 1456     *)
 1457         AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1458 esac
 1459 
 1460 if test "$cf_cv_termlib" = pdcurses ; then
 1461     CF_PDCURSES_X11
 1462 fi
 1463 AC_CHECK_FUNCS(vwprintw)
 1464 
 1465 ### sum up warnings
 1466 if test "$cf_cv_termlib" = none ; then
 1467     AC_MSG_WARN([no term-lib found, you might run into trouble later.])
 1468 fi
 1469 if test "$YACC" = "" ; then
 1470     AC_MSG_WARN([no yacc-parser found, you might run into trouble later.])
 1471 fi
 1472 if test "$RANLIB" = "" ; then
 1473     AC_MSG_WARN([no library archive builder found, you might run into trouble later.])
 1474 fi
 1475 
 1476 ### Finally, build autoconf.h and the makefiles
 1477 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
 1478 
 1479 LINTFLAGS=$LINTFLAGS
 1480 AC_SUBST(LINTFLAGS)
 1481 
 1482 CF_DEFINE_STRING(TIN_CC,       "$CC")
 1483 CF_DEFINE_STRING(TIN_CFLAGS,   "$CFLAGS")
 1484 CF_DEFINE_STRING(TIN_CPP,      "$CPP")
 1485 CF_DEFINE_STRING(TIN_CPPFLAGS, "$CPPFLAGS")
 1486 CF_DEFINE_STRING(TIN_LD,       "$CC")
 1487 CF_DEFINE_STRING(TIN_LDFLAGS,  "$LDFLAGS")
 1488 CF_DEFINE_STRING(TIN_LIBS,     "$LIBS")
 1489 
 1490 AC_OUTPUT($PCRE_MAKEFILE
 1491     $SUB_MAKEFILE
 1492     $CAN_MAKEFILE
 1493     src/Makefile)