"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.1/configure.in" (24 Dec 2016, 36085 Bytes) of archive /linux/misc/tin-2.4.1.tar.gz:


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.0_vs_2.4.1.

    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   : 2015-11-03
    6 dnl Notes     :
    7 dnl
    8 dnl Copyright (c) 1995-2017 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.1
   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 AC_CHECK_HEADER(unicode/unorm.h,[
  922     AC_CHECK_HEADER(unicode/ustring.h, [
  923         AC_DEFINE(HAVE_UNICODE_UNORM_H)
  924         AC_DEFINE(HAVE_UNICODE_USTRING_H)
  925         AC_MSG_CHECKING(for unorm_normalize in libicuuc)
  926         cf_save_LIBS="$LIBS"
  927         cf_try_icuuc="no"
  928         LIBS="$LIBS -licuuc"
  929         AC_TRY_LINK([#include <unicode/unorm.h>], [
  930             int32_t needed, ustr = NULL;
  931             UErrorCode status;
  932             needed = unorm_normalize(ustr, -1, UNORM_DEFAULT, 0, NULL, 0, &status);], [
  933             AC_DEFINE(HAVE_LIBICUUC)
  934             cf_try_icuuc="yes"],
  935             LIBS=$cf_save_LIBS
  936         )
  937         AC_MSG_RESULT($cf_try_icuuc)
  938         AC_CHECK_HEADER(unicode/uidna.h, [
  939             AC_DEFINE(HAVE_UNICODE_UIDNA_H)
  940         ])
  941         AC_CHECK_HEADER(unicode/ubidi.h, [
  942             AC_DEFINE(HAVE_UNICODE_UBIDI_H)
  943         ])
  944     ])
  945 ])
  946 
  947 # without icuuc try GNU libunistring for normalization
  948 if test $cf_try_icuuc = no ; then
  949     AC_CHECK_HEADER(unitypes.h,[
  950         AC_CHECK_HEADER(uninorm.h,[
  951             AC_DEFINE(HAVE_UNITYPES_H)
  952             AC_DEFINE(HAVE_UNINORM_H)
  953             AC_MSG_CHECKING(for u8_normalize in libunistring)
  954             cf_save_LIBS="$LIBS"
  955             cf_try_unistring="no"
  956             LIBS="$LIBS -lunistring"
  957             AC_TRY_LINK([#include <unitypes.h>
  958                 #include <uninorm.h>], [
  959                 size_t ol = 0;
  960                 u8_normalize(UNINORM_NFC, (uint8_t *) "x", 2, NULL, &ol);], [
  961                 AC_DEFINE(HAVE_LIBUNISTRING)
  962                 cf_try_unistring="yes"],
  963                 LIBS=$cf_save_LIBS
  964             )
  965             AC_MSG_RESULT($cf_try_unistring)
  966         ])
  967     ])
  968 fi
  969 
  970 # without icuuc try libidn for Internationalized Domain Names / IDN 2003
  971 # TODO: check for libidn2
  972 if test $cf_try_icuuc = no ; then
  973     AC_CHECK_LIB(idn, stringprep_check_version,
  974         [AC_CHECK_HEADER(stringprep.h,[
  975             AC_DEFINE(HAVE_STRINGPREP_H)
  976             AC_CHECK_HEADER(idna.h, [
  977                 AC_DEFINE(HAVE_IDNA_H)
  978                 AC_CHECK_LIB(idn, idna_to_unicode_lzlz, [
  979                     AC_DEFINE(HAVE_IDNA_TO_UNICODE_LZLZ)
  980                     AC_MSG_CHECKING(for IDNA_USE_STD3_ASCII_RULES)
  981                     AC_EGREP_HEADER(IDNA_USE_STD3_ASCII_RULES, idna.h, [
  982                         AC_DEFINE(HAVE_IDNA_USE_STD3_ASCII_RULES)
  983                         AC_MSG_RESULT(yes)],
  984                         AC_MSG_RESULT(no)
  985                     )
  986                 ])
  987                 AC_CHECK_LIB(idn, idna_strerror, [
  988                     AC_DEFINE(HAVE_IDNA_STRERROR)
  989                 ])
  990             ])
  991             AC_DEFINE(HAVE_LIBIDN)
  992             LIBS="$LIBS -lidn"]
  993         )]
  994     )
  995 fi
  996 
  997 # libidnkit - Internationalized Domain Names / IDN 2008
  998 AC_CHECK_LIB(idnkit, idn_decodename, [
  999     AC_CHECK_HEADER(idn/api.h, [
 1000         AC_MSG_CHECKING(for IDN_DECODE_LOOKUP)
 1001         cf_save_LIBS="$LIBS"
 1002         LIBS="$LIBS -lidnkit"
 1003         AC_TRY_LINK([#include <idn/api.h>
 1004             #include <string.h>], [
 1005             idn_result_t rs;
 1006             char in[255], out[255];
 1007             strcpy(in, "xn--brenfe-fta9a2q.de");
 1008             rs = idn_decodename(IDN_DECODE_LOOKUP, &in, &out, 254);
 1009             idn_result_tostring(rs);], [
 1010             AC_DEFINE(HAVE_LIBIDNKIT)
 1011             AC_DEFINE(HAVE_IDN_API_H)
 1012             AC_DEFINE(HAVE_IDN_DECODENAME)
 1013             AC_MSG_RESULT(yes)], [
 1014             LIBS=$cf_save_LIBS
 1015             AC_MSG_RESULT(no)
 1016         ])
 1017     ])
 1018 ])
 1019 
 1020 
 1021 if test $use_curses != no ; then
 1022     cf_cv_termlib=$cf_with_screen
 1023 else
 1024     CF_TERMCAP_LIBS
 1025     # terminfo-based termcap interfaces may be prototyped in <curses.h>,
 1026     # which may/may not be compatible with <termcap.h>
 1027     AC_MSG_CHECKING(if we should include termcap.h)
 1028     cf_save_CFLAGS="$CFLAGS"
 1029     CFLAGS="$CFLAGS -I$srcdir/include"
 1030     AC_TRY_COMPILE([
 1031 #define HAVE_TERMCAP_H 1
 1032 #include <tcurses.h>],[
 1033 #ifdef NCURSES_VERSION
 1034 make an error
 1035 #endif
 1036 ],
 1037         [cf_result=yes],
 1038         [cf_result=no])
 1039     AC_MSG_RESULT($cf_result)
 1040     CFLAGS="$cf_save_CFLAGS"
 1041     test $cf_result = yes && AC_DEFINE(HAVE_TERMCAP_H)
 1042     CF_TYPE_OUTCHAR
 1043 fi
 1044 
 1045 cf_tc_funcs=
 1046 cf_tc_externs=
 1047 if test ".$cf_cv_termlib" = .terminfo ; then
 1048     AC_DEFINE(USE_TERMINFO)
 1049     cf_tc_funcs="tigetint tigetnum tparam tparm"
 1050     cf_tc_externs="$cf_tc_funcs tgoto tigetstr tputs tigetflag"
 1051 elif test ".$cf_cv_termlib" = .termcap ; then
 1052     # BSD 'tputs()' may need 'PC' to be set.
 1053     AC_TRY_LINK([],[extern char PC; PC = 0],
 1054         [AC_DEFINE(HAVE_EXTERN_TCAP_PC)])
 1055     cf_tc_funcs="tgetint tgetnum tparam tparm"
 1056     cf_tc_externs="$cf_tc_funcs tgoto tgetstr tputs tgetent tgetflag"
 1057 fi
 1058 
 1059 ### Checks for external-data
 1060 CF_ERRNO
 1061 CF_STRERROR
 1062 
 1063 ### Checks for library functions.
 1064 AC_CHECK_FUNCS(\
 1065     alarm \
 1066     atoi \
 1067     atol \
 1068     atoll \
 1069     atoq \
 1070     bcopy \
 1071     chmod \
 1072     closesocket \
 1073     execlp \
 1074     fcntl \
 1075     fdopen \
 1076     fork \
 1077     ftime \
 1078     ftruncate \
 1079     fsync \
 1080     getcwd \
 1081     gettimeofday \
 1082     getwd \
 1083     inet_aton \
 1084     is_xterm \
 1085     isascii \
 1086     lockf \
 1087     memcmp \
 1088     memcpy \
 1089     memmove \
 1090     memset \
 1091     mkdir \
 1092     mkfifo \
 1093     mktemp \
 1094     mkstemp \
 1095     nl_langinfo \
 1096     poll \
 1097     putenv \
 1098     rewinddir \
 1099     resizeterm \
 1100     select \
 1101     setenv \
 1102     setlocale \
 1103     settz \
 1104     setvbuf \
 1105     sigaction \
 1106     snprintf \
 1107     stpcpy \
 1108     strchr \
 1109     strcasecmp \
 1110     strcasestr \
 1111     strdup \
 1112     strftime \
 1113     strpbrk \
 1114     strrchr \
 1115     strrstr \
 1116     strsep \
 1117     strstr \
 1118     strtol \
 1119     strtoll \
 1120     tmpfile \
 1121     tzset \
 1122     uname \
 1123     unlink \
 1124     use_default_colors \
 1125     usleep \
 1126     vasprintf \
 1127     vsnprintf \
 1128     waitpid \
 1129 $cf_tc_funcs )
 1130 
 1131 AC_CHECK_FUNC(flock,
 1132     AC_DEFINE(HAVE_FLOCK),[
 1133     AC_CHECK_LIB(bsd, flock,
 1134         AC_DEFINE(HAVE_FLOCK)
 1135         LIBS="$LIBS -lbsd")])
 1136 
 1137 # clock_gettime() / librt
 1138 AC_CHECK_FUNC(clock_gettime,
 1139     AC_DEFINE(HAVE_CLOCK_GETTIME),[
 1140         AC_CHECK_LIB(rt, clock_gettime,
 1141             AC_DEFINE(HAVE_CLOCK_GETTIME)
 1142             LIBS="$LIBS -lrt"
 1143         )
 1144     ]
 1145 )
 1146 
 1147 AM_MULTIBYTE_ABLE
 1148 
 1149 AC_MSG_CHECKING(if gettimeofday takes two arguments)
 1150 AC_TRY_COMPILE([
 1151 #if HAVE_SYS_TIME_H
 1152 #include <sys/time.h>
 1153 #endif],
 1154 [struct timeval *tv;
 1155 struct timezone *tz;
 1156 gettimeofday(&tv, &tz);],
 1157 ac_cv_func_gettimeofday_2args=yes, ac_cv_func_gettimeofday_2args=no)
 1158 AC_MSG_RESULT($ac_cv_func_gettimeofday_2args)
 1159 if test $ac_cv_func_gettimeofday_2args = yes; then
 1160     AC_DEFINE(GETTIMEOFDAY_2ARGS)
 1161 fi
 1162 
 1163 CF_POSIX_JC
 1164 CF_FUNC_FORK
 1165 CF_FUNC_MEMMOVE
 1166 
 1167 AC_MSG_CHECKING(if select expects int * arguments)
 1168 AC_EGREP_HEADER([select\(.*, *int *\*,],time.h,
 1169     AC_DEFINE(HAVE_SELECT_INTP) AC_MSG_RESULT(yes),
 1170     AC_MSG_RESULT(no)
 1171 )
 1172 
 1173 AC_FUNC_CLOSEDIR_VOID
 1174 
 1175 # autoconf 2.5x assumes setvbuf is not reversed when cross-compiling
 1176 if test "$cross_compiling" != yes ; then
 1177     AC_FUNC_SETVBUF_REVERSED
 1178 fi
 1179 
 1180 ### Checks for network library functions.
 1181 AC_CHECK_FUNCS(\
 1182     gai_strerror \
 1183     getaddrinfo \
 1184     gethostname \
 1185     gethostbyname \
 1186     getservbyname \
 1187     inet_addr \
 1188     inet_ntoa \
 1189     strncasecmp \
 1190 )
 1191 
 1192 CF_TYPE_SIGACTION
 1193 CF_TERMIOS
 1194 CF_PW_GECOS
 1195 CF_TM_GMTOFF
 1196 
 1197 AC_SYS_LONG_FILE_NAMES
 1198 CF_FUNC_SYSTEM
 1199 
 1200 # Check if we are trying to use curses+color, but cannot
 1201 if test $use_color = yes ; then
 1202     if test $use_curses = no ; then
 1203         AC_DEFINE(HAVE_COLOR)
 1204     elif test $cf_with_screen = pdcurses ; then
 1205         AC_DEFINE(HAVE_COLOR)
 1206     else
 1207         CF_NCURSES_BROKEN
 1208         CF_COLOR_CURSES
 1209         if test $cf_cv_color_curses = yes ; then
 1210             AC_DEFINE(HAVE_COLOR)
 1211         else
 1212             AC_MSG_WARN(This curses library does not support color)
 1213         fi
 1214     fi
 1215 fi
 1216 
 1217 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 1218 if test -n "$GCC"; then
 1219     check_sig_const=yes
 1220 elif test -f /sys/dm/dm ; then
 1221     check_sig_const=yes
 1222 elif test -f /sys/dm/spm ; then
 1223     check_sig_const=yes
 1224 else
 1225     check_sig_const=no
 1226 fi
 1227 
 1228 if test $check_sig_const = yes ; then
 1229     CF_SIG_CONST
 1230 fi
 1231 
 1232 CF_COMPTYPE
 1233 CF_COREFILE
 1234 
 1235 ### test this last, since it uses a partly-built autoconf.h
 1236 # Setup includes for test-program to verify declarations
 1237 CHECK_DECL_FLAG="-I$srcdir/include -I$srcdir/pcre"
 1238 CHECK_DECL_HDRS='
 1239 #define M_UNIX
 1240 #define __CPROTO__
 1241 #define HAVE_CONFDEFS_H
 1242 #include <tin.h>'
 1243 TIN_DECL_HDRS="$CHECK_DECL_HDRS"
 1244 
 1245 dnl These return non-int values, and can be troublesome if not declared
 1246 CF_CHECK_DECL(\
 1247     errno \
 1248     getenv \
 1249     getlogin \
 1250     getpwnam \
 1251     popen \
 1252     strchr \
 1253     strcasestr \
 1254     strsep \
 1255     tmpfile \
 1256 )
 1257 
 1258 dnl Check network stuff separately, to limit the effect of inconsistent headers
 1259 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1260 #include <tnntp.h>"
 1261 CF_CHECK_DECL(\
 1262     gethostbyname \
 1263     getservbyname \
 1264     inet_aton \
 1265     inet_ntoa \
 1266     socket \
 1267 )
 1268 
 1269 if test $use_curses = no ; then
 1270 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1271 #include <tcurses.h>"
 1272 CF_CHECK_DECL(\
 1273     tgetstr \
 1274     tgoto \
 1275 )
 1276 fi
 1277 
 1278 if test $with_decl_check = yes; then
 1279 CHECK_DECL_HDRS="$TIN_DECL_HDRS"
 1280 CF_CHECK_DECL(\
 1281     _flsbuf \
 1282     alarm \
 1283     atoi \
 1284     atol \
 1285     atoll \
 1286     atoq \
 1287     bcopy \
 1288     bzero \
 1289     calloc \
 1290     fchmod \
 1291     fclose \
 1292     fdopen \
 1293     fflush \
 1294     fgetc \
 1295     fileno \
 1296     fprintf \
 1297     fputc \
 1298     fputs \
 1299     fread \
 1300     free \
 1301     fseek \
 1302     fwrite \
 1303     getcwd \
 1304     getopt \
 1305     getwd \
 1306     heapsort \
 1307     ioctl \
 1308     isascii \
 1309     kill \
 1310     malloc \
 1311     memset \
 1312     mkstemp \
 1313     mktemp \
 1314     pclose \
 1315     perror \
 1316     printf \
 1317     putenv \
 1318     qsort \
 1319     realloc \
 1320     rename \
 1321     rewind \
 1322     select \
 1323     setenv \
 1324     snprintf \
 1325     sscanf \
 1326     strcasecmp \
 1327     strftime \
 1328     strncasecmp \
 1329     strtol \
 1330     strtoll \
 1331     system \
 1332     time \
 1333     tolower \
 1334     toupper \
 1335     ungetc \
 1336     usleep \
 1337     vsprintf \
 1338     vsnprintf \
 1339 )
 1340 
 1341 if test $use_curses = no ; then
 1342 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1343 #include <tcurses.h>"
 1344 CF_CHECK_DECL($cf_tc_externs)
 1345 fi
 1346 
 1347 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1348 #include <tnntp.h>"
 1349 CF_CHECK_DECL(\
 1350     connect \
 1351     gethostname \
 1352 )
 1353 
 1354 fi
 1355 
 1356 CF_TIOCGWINSZ
 1357 
 1358 ### append special libraries that get in the way of testing
 1359 case $debug_malloc in
 1360 DBMALLOC)
 1361     AC_DEFINE(USE_DBMALLOC)
 1362     LIBS="$LIBS -ldbmalloc"
 1363     ;;
 1364 DMALLOC)
 1365     AC_DEFINE(USE_DMALLOC)
 1366     LIBS="$LIBS -ldmalloc"
 1367     ;;
 1368 esac
 1369 
 1370 ### Use gettext
 1371 ### this also calls AM_LANGINFO_CODESET and AM_ICONV
 1372 ### so we don't need to do the tests ourselves.
 1373 CF_BUNDLED_INTL
 1374 LIBS="$LIBS $LIBICONV"
 1375 
 1376 ### check for alloca (required for bison and/or intl/*)
 1377 case "$YACC" in
 1378 bison*)
 1379     use_alloca=yes
 1380     ;;
 1381 *)
 1382     use_alloca=$USE_INCLUDED_LIBINTL
 1383     ;;
 1384 esac
 1385 
 1386 if test ".$use_alloca" = .yes ; then
 1387     CF_FUNC_ALLOCA
 1388 else
 1389     ALLOCA=""
 1390     AC_SUBST(ALLOCA)
 1391 fi
 1392 
 1393 CF_CHECK_HEADERS(iconv.h)
 1394 AC_MSG_CHECKING(for iconv_open() //TRANSLIT extension)
 1395 AC_TRY_RUN([
 1396 #ifdef HAVE_ICONV_H
 1397 #   include <iconv.h>
 1398 #endif /* HAVE_ICONV_H */
 1399 #ifdef HAVE_STDLIB_H
 1400 #   include <stdlib.h>
 1401 #endif /* HAVE_STDLIB_H */
 1402 int main() {
 1403     iconv_t cd;
 1404 
 1405     if ((cd = iconv_open("US-ASCII//TRANSLIT", "ISO-8859-1")) == (iconv_t) (-1))
 1406         exit(1);
 1407     exit(0);
 1408 }],
 1409     AC_DEFINE(HAVE_ICONV_OPEN_TRANSLIT) AC_MSG_RESULT(yes),
 1410     AC_MSG_RESULT(no),
 1411     AC_MSG_RESULT(unknown)
 1412 )
 1413 
 1414 # FIXME / TESTME
 1415 # locale is broken on cygwin < 1.7.0
 1416 # group/other bits don't work on cygwin < 1.7.0
 1417 # locking doesn't work on cygwin < 2.0 as link(2) is detected but doesn't work
 1418 case "$host_os" in
 1419     *cygwin*)
 1420         case `uname -r | sed 's,(.*,,'` in
 1421             B*|1.0-6].*)
 1422                 # multiple defects
 1423                 AC_DEFINE(NO_LOCALE)
 1424                 AC_DEFINE(NO_LOCKING)
 1425                 AC_DEFINE(FILE_MODE_BROKEN)
 1426                 ;;
 1427             1.7.*)
 1428                 # link does not work
 1429                 AC_DEFINE(NO_LOCKING)
 1430                 ;;
 1431             *)
 1432                 AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1433                 ;;
 1434             esac
 1435         ;;
 1436     *haiku*)
 1437         # link does not work
 1438         AC_DEFINE(NO_LOCKING)
 1439         ;;
 1440     *)
 1441         AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1442 esac
 1443 
 1444 if test "$cf_cv_termlib" = pdcurses ; then
 1445     CF_PDCURSES_X11
 1446 fi
 1447 AC_CHECK_FUNCS(vwprintw)
 1448 
 1449 ### sum up warnings
 1450 if test "$cf_cv_termlib" = none ; then
 1451     AC_MSG_WARN([no term-lib found, you might run into trouble later.])
 1452 fi
 1453 if test "$YACC" = "" ; then
 1454     AC_MSG_WARN([no yacc-parser found, you might run into trouble later.])
 1455 fi
 1456 if test "$RANLIB" = "" ; then
 1457     AC_MSG_WARN([no library archive builder found, you might run into trouble later.])
 1458 fi
 1459 
 1460 ### Finally, build autoconf.h and the makefiles
 1461 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
 1462 
 1463 LINTFLAGS=$LINTFLAGS
 1464 AC_SUBST(LINTFLAGS)
 1465 
 1466 CF_DEFINE_STRING(TIN_CC,       "$CC")
 1467 CF_DEFINE_STRING(TIN_CFLAGS,   "$CFLAGS")
 1468 CF_DEFINE_STRING(TIN_CPP,      "$CPP")
 1469 CF_DEFINE_STRING(TIN_CPPFLAGS, "$CPPFLAGS")
 1470 CF_DEFINE_STRING(TIN_LD,       "$CC")
 1471 CF_DEFINE_STRING(TIN_LDFLAGS,  "$LDFLAGS")
 1472 CF_DEFINE_STRING(TIN_LIBS,     "$LIBS")
 1473 
 1474 AC_OUTPUT($PCRE_MAKEFILE
 1475     $SUB_MAKEFILE
 1476     $CAN_MAKEFILE
 1477     src/Makefile)