"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.5/configure.in" (24 Dec 2020, 43287 Bytes) of package /linux/misc/tin-2.4.5.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.4_vs_2.4.5.

    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   : 2020-12-02
    6 dnl Notes     :
    7 dnl
    8 dnl Copyright (c) 1995-2021 Thomas E. Dickey <dickey@invisible-island.net>
    9 dnl All rights reserved.
   10 dnl
   11 dnl Redistribution and use in source and binary forms, with or without
   12 dnl modification, are permitted provided that the following conditions
   13 dnl are met:
   14 dnl 1. Redistributions of source code must retain the above copyright
   15 dnl    notice, this list of conditions and the following disclaimer.
   16 dnl 2. Redistributions in binary form must reproduce the above copyright
   17 dnl    notice, this list of conditions and the following disclaimer in the
   18 dnl    documentation and/or other materials provided with the distribution.
   19 dnl 3. The name of the author may not be used to endorse or promote
   20 dnl    products derived from this software without specific prior written
   21 dnl    permission.
   22 dnl
   23 dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
   24 dnl OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   25 dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   26 dnl ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
   27 dnl DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   28 dnl DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   29 dnl GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   30 dnl INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   31 dnl WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   32 dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   33 dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   34 dnl
   35 dnl Process this file with autoconf to produce a configure script.
   36 
   37 AC_PREREQ(2.52.20181006)
   38 AC_INIT(include/tin.h)
   39 AC_CONFIG_HEADER(include/autoconf.h:include/autoconf.hin)
   40 AC_PREFIX_DEFAULT(/usr/local)
   41 
   42 dnl PACKAGE is required for GNU gettext
   43 PACKAGE=tin
   44 VERSION=2.4.5
   45 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Define this to the package name])
   46 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Define this to the package version])
   47 AC_SUBST(PACKAGE)
   48 AC_SUBST(VERSION)
   49 
   50 EXTRAO_DEP='#'
   51 
   52 CF_CHECK_CACHE
   53 
   54 CF_PATHSEP
   55 CF_WITH_PATH(install-prefix,
   56     [  --with-install-prefix   prefixes actual install location],
   57     DESTDIR,/)
   58 case ".$DESTDIR" in # (vi
   59 ./) DESTDIR=
   60     ;; # (vi
   61 ./*/)   ;; # (vi
   62 ./*)    DESTDIR="$DESTDIR/"
   63     ;;
   64 esac
   65 
   66 AC_ARG_PROGRAM
   67 
   68 ### Compiler/options that autoconf doesn't get right
   69 case "$host_os" in
   70     aix*)   #(vi
   71         if test "$CC" = ""; then
   72             AC_PATH_PROG(XLC, xlc)
   73             if test "$ac_cv_path_XLC" != ""; then
   74                 CC="$ac_cv_path_XLC"
   75             fi
   76         fi
   77         ;;
   78     hpux*)  #(vi
   79         test "$CC" != "cc" && test -z "$CFLAGS" && CFLAGS="-O"
   80         ;;
   81 esac
   82 
   83 ### Native Language Support
   84 ALL_LINGUAS="da de en_GB es et fr ru sv tr zh_CN zh_TW"
   85 
   86 ### Checks for programs
   87 save_CFLAGS="$CFLAGS"
   88 CF_PROG_CC
   89 AC_PROG_GCC_TRADITIONAL
   90 AC_PROG_MAKE_SET
   91 AC_PROG_INSTALL
   92 CF_PROG_YACC
   93 AC_CHECK_PROGS(LINT, lint alint lclint tdlint splint, :)
   94 CF_XOPEN_SOURCE
   95 CF_SIGWINCH
   96 CF_PROG_EXT
   97 CF_LIB_PREFIX(LIB_PREFIX)
   98 AC_PROG_LN_S
   99 
  100 CF_BUILD_CC([-I$(INCDIR)],[])
  101 
  102 dnl These are standard among *NIX systems, but not when cross-compiling
  103 AC_CHECK_TOOL(RANLIB, ranlib, ':')
  104 AC_CHECK_TOOL(LD, ld, ld)
  105 CF_PROG_AR
  106 CF_AR_FLAGS
  107 
  108 case "$host_cpu:$host_vendor:$host_os" in
  109     # check for cygwin environment
  110     # -DSTATIC is needed for pcre
  111     *:*:*cygwin*)   #(vi
  112         PCRE_DEFINES="$PCRE_DEFINES -DSTATIC"
  113         ;;
  114     # SEIUX doesn't have any useful preprocessor symbol
  115     mips:sei:seiux*)    #(vi
  116         AC_DEFINE(SEIUX,1,[Define this to 1 for the MIPS/SEIUX system])
  117         ;;
  118     # ISC Interactive Unix likewise
  119     i386:pc:isc*)   #(vi
  120         AC_DEFINE(ISC_UNIX,1,[Define this to 1 for the i386/ISC system])
  121 esac
  122 
  123 dnl TODO: also check for heapsort(3) in libbsd?
  124 AC_MSG_CHECKING(if you would like to use heapsort)
  125 CF_ARG_DISABLE(heapsort,
  126     [  --disable-heapsort      disable heapsort() as alternative to qsort],
  127     [cf_use_heapsort=no],
  128     [cf_use_heapsort=yes])
  129 AC_MSG_RESULT($cf_use_heapsort)
  130 if test "x$cf_use_heapsort" = xyes; then
  131     AC_CHECK_FUNCS(heapsort)
  132     if test x"$ac_cv_func_heapsort" = xyes; then
  133         AC_MSG_CHECKING(if its prototype is compatible with qsort)
  134         AC_TRY_COMPILE([
  135 #include <stdlib.h>
  136 #include <sys/types.h>
  137 extern int my_compare(const void *, const void *);
  138 ],[
  139     char *base = 0;
  140     heapsort((void *)0, 1, 2, my_compare);
  141 ],,[cf_use_heapsort=no]);
  142         AC_MSG_RESULT($cf_use_heapsort)
  143     else
  144         CF_VERBOSE(will use our own heapsort function)
  145         EXTRAO_DEP=''
  146         EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/heapsort.o"
  147     fi
  148 fi
  149 if test "x$cf_use_heapsort" = xyes; then
  150     AC_DEFINE(USE_HEAPSORT,1,[Define this to 1 to use the heapsort function])
  151 fi
  152 
  153 CF_WITH_PROGRAM(ispell,
  154 [  --with-ispell           (default: from system path)])
  155 
  156 CF_WITH_PROGRAM(metamail,
  157 [  --with-metamail         (default: from system path)])
  158 
  159 CF_WITH_PROGRAM(sum,
  160 [  --with-sum              (default: from system path)])
  161 CF_PROG_SUM_R
  162 
  163 CF_PATH_EDITOR
  164 CF_PATH_MAILER
  165 CF_PATH_MAILBOX
  166 CF_PKG_CONFIG
  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,1,[Define this to 1 to be NNTP-only])
  217      USE_SPOOLDIR=no],
  218     [AC_DEFINE(NNTP_ABLE,1,[Define this to 1 to be NNTP-capable])])
  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,1,[Define this to 1 if we will use the curses library])
  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 "$cf_pcre_home" = "no" ; then
  459     LINK_SIZE="-DLINK_SIZE=2"
  460     AC_SUBST(LINK_SIZE)
  461     UTF8="-DSUPPORT_UTF8"
  462     UCP="-DSUPPORT_UCP"
  463     AC_SUBST(UTF8)
  464     AC_SUBST(UCP)
  465     PCRE_MAKEFILE="$PCRE_MAKEFILE pcre/Makefile pcre/RunTest"
  466 fi
  467 
  468 ## debugging libraries (do this after other libraries)
  469 debug_malloc=none
  470 CF_WITH_DBMALLOC(debug_malloc=DBMALLOC)
  471 CF_WITH_DMALLOC(debug_malloc=DMALLOC)
  472 
  473 AC_ARG_WITH(trace,
  474     [  --with-trace            use debugging/traces for screen output],
  475     [
  476     AC_CHECK_FUNC(_tracef,[AC_DEFINE(HAVE__TRACEF,1,[Define this to 1 if we have function _tracef])],[
  477     AC_CHECK_LIB(${cf_with_screen}_g,_tracef,
  478         [AC_DEFINE(HAVE__TRACEF)
  479          LIBS=`echo "$LIBS" | sed -e s/-l${cf_with_screen}// -e s/-lcurses//`
  480          LIBS="-l${cf_with_screen}_g $LIBS"
  481          use_trace=yes
  482          AC_DEFINE(USE_TRACE,1,[Define this to 1 if we will use ncurses' trace-functions])
  483          EXTRAO_DEP=''
  484          EXTRAOBJS="$EXTRAOBJS \$(OBJDIR)/trace.o"],
  485          use_trace=no)])],
  486     [use_trace=no])
  487 #AC_MSG_CHECKING(if you want debugging-trace)
  488 #AC_MSG_RESULT($use_trace)
  489 AC_SUBST(EXTRAOBJS)
  490 AC_SUBST(EXTRAO_DEP)
  491 
  492 ## options for miscellaneous definitions
  493 AC_MSG_CHECKING(for domain-name)
  494 CF_ARG_WITH(domain-name,
  495     [  --with-domain-name      sets $DOMAIN_NAME],
  496     DOMAIN_NAME)
  497 if test "$DOMAIN_NAME" != ""; then
  498     AC_DEFINE_UNQUOTED(DOMAIN_NAME, "$DOMAIN_NAME",[Define this to the news server's domain-name])
  499 fi
  500 AC_MSG_RESULT($DOMAIN_NAME)
  501 
  502 if test "$USE_NNTP" = "yes" ; then
  503 AC_MSG_CHECKING(for NNTP default-server)
  504 CF_ARG_WITH(nntp-default-server,
  505     [  --with-nntp-default-server
  506                           (sets NNTP_DEFAULT_SERVER)
  507                          ],
  508     [NNTP_DEFAULT_SERVER], news.$DOMAIN_NAME)
  509 
  510     if test "$NNTP_DEFAULT_SERVER" = "" ; then
  511     if test "$DOMAIN_NAME" != "" ; then
  512         test -z "$NNTP_DEFAULT_SERVER" && \
  513         case "$DOMAIN_NAME" in #(((
  514         /*)
  515             if test -r "$DOMAIN_NAME" ; then
  516                 NNTP_DEFAULT_SERVER="news.`cat $DOMAIN_NAME`"
  517             else
  518                 NNTP_DEFAULT_SERVER="news"
  519             fi
  520             ;;
  521         *)
  522             NNTP_DEFAULT_SERVER="news.$DOMAIN_NAME"
  523             ;;
  524         esac
  525     else
  526         NNTP_DEFAULT_SERVER="news"
  527     fi
  528     fi
  529 AC_MSG_RESULT($NNTP_DEFAULT_SERVER)
  530 fi
  531 
  532 ## These options are interdependent, so we delay defining them til now:
  533 test -n "$NNTP_DEFAULT_SERVER" \
  534     && AC_DEFINE_UNQUOTED(NNTP_DEFAULT_SERVER,"$NNTP_DEFAULT_SERVER",[Define this to the default NNTP server])
  535 test ".$INEWSDIR" != ".$NEWSLIBDIR" && AC_DEFINE_UNQUOTED(INEWSDIR,"$INEWSDIR",[Define this to the inews directory path])
  536 AC_DEFINE_UNQUOTED(NEWSLIBDIR,"$NEWSLIBDIR",[Define this to the news library directory path])
  537 AC_DEFINE_UNQUOTED(NOVROOTDIR,"$NOVROOTDIR",[Define this to the news overview directory path])
  538 AC_DEFINE_UNQUOTED(SPOOLDIR,"$SPOOLDIR",[Define this to the spool directory path])
  539 
  540 ## optional features
  541 AC_MSG_CHECKING(whether to use MH style mail handling for mailgroups)
  542 CF_ARG_ENABLE(mh-mail-handling,
  543     [  --enable-mh-mail-handling
  544                           use MH style mail handling for mailgroups],
  545     [AC_DEFINE(HAVE_MH_MAIL_HANDLING,1,[Define this to 1 to use MH style mail handling for mailgroups])])
  546 AC_MSG_RESULT($enableval)
  547 
  548 AC_MSG_CHECKING(whether to use Cancel-Locks)
  549 CF_ARG_ENABLE(cancel-locks,
  550     [  --enable-cancel-locks   enable creation of Cancel-Locks])
  551 AC_MSG_RESULT($enableval)
  552 USE_CANLOCK=$enableval
  553 
  554 if test "$USE_CANLOCK" = yes ; then
  555     AC_MSG_CHECKING(whether to use installed canlock rather than bundled)
  556     AC_ARG_WITH(canlock,
  557         [  --with-cancel-locks=PATH use installed canlock versus bundled],
  558         [CANLOCK_HOME=$withval],
  559         [CANLOCK_HOME=$USE_CANLOCK])
  560     AC_MSG_RESULT($CANLOCK_HOME)
  561     CF_BUNDLED_CANLOCK($CANLOCK_HOME)
  562 else
  563     CANDIR_MAKE='#'
  564 fi
  565 AC_SUBST(CANDIR_MAKE)
  566 
  567 ## gsasl - used for AUTH SASL PLAIN
  568 gsasl=no
  569 AC_CHECK_HEADER(gsasl.h,
  570     [AC_CHECK_LIB(gsasl, gsasl_check_version, gsasl=yes)]
  571 )
  572 if test "$gsasl" = "yes"; then
  573     CF_ARG_DISABLE(gsasl,
  574         [  --disable-gsasl         don't use GNU SASL],
  575         USE_SASL=no,
  576         [USE_SASL=yes
  577         AC_DEFINE(USE_SASL, 1, [Define to 1 if you want GNU SASL.])
  578         LIBS="$LIBS -lgsasl"])
  579 fi
  580 
  581 AC_MSG_CHECKING(whether to enable 8-bit keycodes)
  582 CF_ARG_DISABLE(8bit-keys,
  583     [  --disable-8bit-keys     disable 8-bit keycode support],,
  584     [AC_DEFINE(HAVE_KEY_PREFIX,1,[Define this to 1 to enable 8-bit keycodes])])
  585 AC_MSG_RESULT($enableval)
  586 
  587 AC_MSG_CHECKING(whether to enable ANSI-color)
  588 CF_ARG_DISABLE(color,
  589     [  --disable-color         disable ANSI-color support])
  590 use_color=$enableval
  591 AC_MSG_RESULT($use_color)
  592 
  593 AC_MSG_CHECKING(whether to enable posting-etiquette)
  594 CF_ARG_DISABLE(etiquette,
  595     [  --disable-etiquette     disable printing of posting-etiquette],
  596     [AC_DEFINE(NO_ETIQUETTE,1,[Define this to 1 to enable posting-etiquette])])
  597 AC_MSG_RESULT($enableval)
  598 
  599 AC_MSG_CHECKING(whether to strictly observe RFC2047 and break long lines)
  600 CF_ARG_DISABLE(break-long-lines,
  601     [  --disable-break-long-lines
  602                           don't break long mime-encoded lines],,
  603     [AC_DEFINE(MIME_BREAK_LONG_LINES,1,[Define this to 1 to strictly observe RFC2047 and break long lines])])
  604 AC_MSG_RESULT($enableval)
  605 
  606 AC_MSG_CHECKING(whether to force MM_CHARSET obeyance when decoding mime)
  607 CF_ARG_DISABLE(mime-strict-charset,
  608     [  --disable-mime-strict-charset
  609                           force MM_CHARSET obeyance],,
  610     [AC_DEFINE(MIME_STRICT_CHARSET,1,[Define this to 1 to force MM_CHARSET obeyance when decoding mime])])
  611 AC_MSG_RESULT($enableval)
  612 
  613 AC_MSG_CHECKING(for MIME character-set)
  614 CF_WITH_DFTENV(mime-default-charset,
  615     [  --with-mime-default-charset=CHARSET
  616                           fallback for $MM_CHARSET],
  617     MM_CHARSET,US-ASCII)
  618 AC_MSG_RESULT($MM_CHARSET)
  619 
  620 AC_MSG_CHECKING(for default ISO/ASCII table)
  621 CF_WITH_DFTENV(iso-to-ascii,
  622     [  --with-iso-to-ascii     ISO -> ASCII conversion],
  623     DEFAULT_ISO2ASC,-1)
  624 AC_MSG_RESULT($DEFAULT_ISO2ASC)
  625 
  626 AC_MSG_CHECKING(whether to enable locale support)
  627 CF_ARG_DISABLE(locale,
  628     [  --disable-locale        disable locale support],
  629     [AC_DEFINE(NO_LOCALE,1,[Define this to 1 to disable locale support])])
  630 AC_MSG_RESULT($enableval)
  631 
  632 AC_MSG_CHECKING(whether to enable posting)
  633 CF_ARG_DISABLE(posting,
  634     [  --disable-posting       disable posting],
  635     [AC_DEFINE(NO_POSTING,1,[Define this to 1 to disable posting])])
  636 AC_MSG_RESULT($enableval)
  637 
  638 AC_MSG_CHECKING(whether to enable shell escape)
  639 CF_ARG_DISABLE(shell-escape,
  640     [  --disable-shell-escape  disable shell escape],
  641     [AC_DEFINE(NO_SHELL_ESCAPE,1,[Define this to 1 to disable shell escape])])
  642 AC_MSG_RESULT($enableval)
  643 
  644 AC_MSG_CHECKING(whether to have fascist newsadmin)
  645 CF_ARG_ENABLE(fascist-newsadmin,
  646     [  --enable-fascist-newsadmin
  647                           have fascist newsadmin],
  648     [AC_DEFINE(HAVE_FASCIST_NEWSADMIN,1,[Define this to 1 to have fascist newsadmin])])
  649 AC_MSG_RESULT($enableval)
  650 
  651 AC_MSG_CHECKING(whether to enable inverse video and highlighting)
  652 CF_ARG_DISABLE(inverse-video,
  653     [  --disable-inverse-video disable inverse video and highlighting],
  654     [AC_DEFINE(USE_INVERSE_HACK,1,[Define this to 1 to enable inverse video and highlighting])])
  655 AC_MSG_RESULT($enableval)
  656 
  657 AC_MSG_CHECKING(whether to enable piping support)
  658 CF_ARG_DISABLE(piping,
  659     [  --disable-piping        disable piping support],
  660     [AC_DEFINE(DONT_HAVE_PIPING,1,[Define this to 1 to enable piping support])])
  661 AC_MSG_RESULT($enableval)
  662 
  663 AC_MSG_CHECKING(whether to enable printer support)
  664 CF_ARG_DISABLE(printing,
  665     [  --disable-printing      disable printer support],
  666     [AC_DEFINE(DISABLE_PRINTING,1,[Define this to 1 to enable printer support])])
  667 AC_MSG_RESULT($enableval)
  668 
  669 AC_MSG_CHECKING(whether to unique tmp-files by appending .pid)
  670 CF_ARG_DISABLE(append-pid,
  671     [  --disable-append-pid    disable appending .pid to tmp-files],,
  672     [AC_DEFINE(APPEND_PID,1,[Define this to 1 to unique tmp-files by appending .pid])])
  673 AC_MSG_RESULT($enableval)
  674 
  675 AC_MSG_CHECKING(whether to fallback to XHDR XREF if XOVER isn't supported)
  676 CF_ARG_DISABLE(xhdr-xref,
  677     [  --disable-xhdr-xref     disable XHDR XREF fallback],,
  678     [AC_DEFINE(XHDR_XREF,1,[Define this to 1 to fallback to XHDR XREF if XOVER isn't supported])])
  679 AC_MSG_RESULT($enableval)
  680 
  681 ### bypass a bug in old versions of leafnode & NNTPcache
  682 AC_MSG_CHECKING(whether to send a GROUP command before a LISTGROUP)
  683 CF_ARG_ENABLE(broken-listgroup-fix,
  684     [  --enable-broken-listgroup-fix
  685                           send extra GROUP command before LISTGROUP],
  686     [AC_DEFINE(BROKEN_LISTGROUP,1,[Define this to 1 to send a GROUP command before a LISTGROUP])])
  687 AC_MSG_RESULT($enableval)
  688 
  689 ### on some old systems the WIFEXITED()/WEXITSTATUS() macros do not work
  690 AC_MSG_CHECKING(whether to ignore system()s return value)
  691 CF_ARG_ENABLE(broken-system-fix,
  692     [  --enable-broken-system-fix
  693                           ignore system()s return value],
  694     [AC_DEFINE(IGNORE_SYSTEM_STATUS,1,[Define this to 1 to ignore system()s return value])])
  695 AC_MSG_RESULT($enableval)
  696 
  697 ### checks for the location of the system-wide default setting file
  698 AC_MSG_CHECKING(for directory containing tin.defaults file)
  699 CF_WITH_PATH(defaults-dir,
  700     [  --with-defaults-dir=PATH
  701                           directory containing tin.defaults file
  702                          ],
  703     TIN_DEFAULTS_DIR,/etc/tin)
  704 AC_MSG_RESULT($TIN_DEFAULTS_DIR)
  705 AC_DEFINE_UNQUOTED(TIN_DEFAULTS_DIR,"$TIN_DEFAULTS_DIR",[Define this to the directory containing tin.defaults file])
  706 
  707 ### check for ipv6 support
  708 AC_MSG_CHECKING([whether to enable IPv6])
  709 CF_ARG_DISABLE(ipv6,
  710     [  --disable-ipv6          disable IPv6 support (default: enabled)],
  711     ,
  712     [AC_DEFINE(ENABLE_IPV6,1,[Define this to 1 to enable IPv6])])
  713 AC_MSG_RESULT($enableval)
  714 if test "$enableval" = "yes"; then
  715     CF_CHECK_IPV6
  716 fi
  717 AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
  718 
  719 ### should we use 64 bit article numbers if possible?
  720 AC_MSG_CHECKING([whether to enable long article numbers])
  721 CF_ARG_ENABLE(long-article-numbers,
  722         [  --enable-long-article-numbers
  723                           enable long article numbers (default: disabled)],
  724 [AC_DEFINE(ENABLE_LONG_ARTICLE_NUMBERS,1,[Define this to 1 to enable long article numbers])])
  725 AC_MSG_RESULT($enableval)
  726 
  727 ### checks for operator characteristics (should be the last option)
  728 AC_MSG_CHECKING(whether to make a coffee while compiling)
  729 AC_ARG_WITH(coffee,
  730     [  --with-coffee           coffee support],
  731     [ case "$withval" in
  732     yes)
  733     AC_MSG_RESULT(yes - with milk - please!)
  734     AC_DEFINE(HAVE_COFFEE,1,[Define this to 1 to make a coffee while compiling])
  735     ;;
  736     *)
  737     AC_MSG_RESULT(no)
  738     ;;
  739     esac],
  740     AC_MSG_RESULT(no))
  741 
  742 ### checks for compiler characteristics
  743 CF_MAKEFLAGS
  744 AC_LANG_C
  745 AC_C_CONST
  746 AC_C_INLINE
  747 CF_CPP_EXPANDS
  748 CF_CPP_CONCATS
  749 CF_CHECK_NESTED_PARAMS
  750 
  751 ### Checks for header files.
  752 AC_HEADER_STDC
  753 AC_HEADER_DIRENT
  754 AC_HEADER_TIME
  755 AC_HEADER_SYS_WAIT
  756 CF_CHECK_HEADERS(\
  757     argz.h \
  758     arpa/inet.h \
  759     curses.h \
  760     errno.h \
  761     fcntl.h \
  762     getopt.h \
  763     ioctl.h \
  764     inttypes.h \
  765     langinfo.h \
  766     libc.h \
  767     locale.h \
  768     malloc.h \
  769     netdb.h \
  770     netinet/in.h \
  771     netlib.h \
  772     nl_types.h \
  773     nomacros.h \
  774     paths.h \
  775     poll.h \
  776     prototypes.h \
  777     pwd.h \
  778     sgtty.h \
  779     socket.h \
  780     stdarg.h \
  781     stdbool.h \
  782     stddef.h \
  783     stdint.h \
  784     stdlib.h \
  785     string.h \
  786     strings.h \
  787     stropts.h \
  788     sys/bsdtypes.h \
  789     sys/errno.h \
  790     sys/file.h \
  791     sys/ioctl.h \
  792     sys/param.h \
  793     sys/poll.h \
  794     sys/ptem.h \
  795     sys/pty.h \
  796     sys/select.h \
  797     sys/stat.h \
  798     sys/stream.h \
  799     sys/socket.h \
  800     sys/time.h \
  801     sys/timeb.h \
  802     sys/times.h \
  803     sys/types.h \
  804     sys/utsname.h \
  805     term.h \
  806     termio.h \
  807     time.h \
  808     unistd.h \
  809     varargs.h \
  810     wchar.h \
  811     wctype.h \
  812 )
  813 
  814 ### Checks that depend on existence-checks for headers
  815 CF_SIZECHANGE
  816 CF_SYS_SELECT_TIMEVAL
  817 CF_VA_COPY
  818 
  819 ### Checks for Datatypes.
  820 AC_CHECK_TYPE(gid_t, int)
  821 AC_TYPE_MODE_T
  822 AC_TYPE_OFF_T
  823 AC_TYPE_PID_T
  824 AC_TYPE_SIZE_T
  825 AC_CHECK_TYPE(ssize_t, int)
  826 AC_CHECK_TYPE(time_t, long)
  827 AC_EGREP_HEADER(in_addr_t, netinet/in.h, ,[
  828     AC_EGREP_HEADER(in_addr_t, sys/endian.h, ,[
  829         AC_CHECK_TYPE(in_addr_t, unsigned long)]
  830     )]
  831 )
  832 AC_TYPE_UID_T
  833 
  834 dnl test to see if quad_t is defined
  835 AC_MSG_CHECKING(for quad_t)
  836 AC_TRY_COMPILE([
  837 #include <sys/types.h>
  838 #if 0
  839 #include <stdlib.h>
  840 #include <stddef.h>
  841 #endif /* 0 */
  842 ],[quad_t x; x = 0],
  843 ac_cv_quad_t=yes, ac_cv_quad_t=no)
  844 AC_MSG_RESULT($ac_cv_quad_t)
  845 if test $ac_cv_quad_t = yes; then
  846     AC_DEFINE(HAVE_QUAD_T,1,[Define this to 1 if we have type quad_t])
  847 fi
  848 
  849 dnl test to see if long long is defined
  850 AC_MSG_CHECKING(for long long)
  851 AC_TRY_COMPILE([
  852 #include <sys/types.h>
  853 ],[long long x; x = 0],
  854 ac_cv_long_long=yes, ac_cv_long_long=no)
  855 AC_MSG_RESULT($ac_cv_long_long)
  856 if test $ac_cv_long_long = yes; then
  857     AC_DEFINE(HAVE_LONG_LONG,1,[Define this to 1 if we have long-long type])
  858 fi
  859 
  860 dnl test to see if int_least64_t is defined
  861 AC_MSG_CHECKING(for int_least64_t)
  862 AC_TRY_COMPILE([
  863 #ifdef HAVE_STDINT_H
  864 #include <stdint.h>
  865 #endif
  866 #ifdef HAVE_HAVE_INTTYPES_H
  867 #include <inttypes.h>
  868 #endif
  869 ],[int_least64_t x; x = 0],
  870 ac_cv_int_least64_t=yes, ac_cv_int_least64_t=no)
  871 AC_MSG_RESULT($ac_cv_int_least64_t)
  872 if test $ac_cv_int_least64_t = yes; then
  873     AC_DEFINE(HAVE_INT_LEAST64_T,1,[Define this to 1 if we have type least64_t])
  874 
  875     AC_MSG_CHECKING(for INT64_C)
  876     AC_TRY_COMPILE([
  877 #ifdef HAVE_STDINT_H
  878 #include <stdint.h>
  879 #endif
  880 #ifdef HAVE_HAVE_INTTYPES_H
  881 #include <inttypes.h>
  882 #endif
  883 ],[int_least64_t x; x = INT64_C(0)],
  884     ac_cv_int64_c=yes, ac_cv_int64_c=no)
  885     AC_MSG_RESULT($ac_cv_int64_c)
  886     if test $ac_cv_int64_c = yes; then
  887         AC_DEFINE(HAVE_INT64_C,1,[Define this to 1 if we have function INT64_C])
  888     fi
  889 fi
  890 
  891 
  892 dnl test to see if nl_item is defined
  893 AC_MSG_CHECKING(for nl_item)
  894 AC_TRY_COMPILE([
  895 #ifdef HAVE_LANGINFO_H
  896 #include <langinfo.h>
  897 #else
  898 #ifdef HAVE_NL_TYPES_H
  899 #include <nl_types.h>
  900 #endif
  901 #endif
  902 ],[nl_item x; x = 0],
  903 ac_cv_nl_item=yes, ac_cv_nl_item=no)
  904 AC_MSG_RESULT($ac_cv_nl_item)
  905 if test $ac_cv_nl_item = yes; then
  906         AC_DEFINE(HAVE_NL_ITEM,1,[Define this to 1 if we have header nl_types.h])
  907 fi
  908 
  909 ### Checks for libraries.
  910 # libuu/uudeview
  911 # only define HAVE_LIBUU and HAVE_UUDEVIEW_H if both are found
  912 AC_CHECK_LIB(uu, UUInitialize,
  913     [AC_CHECK_HEADER(uudeview.h,
  914         [AC_DEFINE(HAVE_LIBUU,1,[Define this to 1 if we have library uu])
  915         AC_DEFINE(HAVE_UUDEVIEW_H,1,[Define this to 1 if we have header uudeview.h])
  916         LIBS="$LIBS -luu"]
  917     )]
  918 )
  919 
  920 
  921 # ICU - International Components for Unicode
  922 # TODO: do separate checks for
  923 #  - unorm_normalize() # deprecated since ICU 56
  924 #  - uidna_IDNToUnicode() # deprecated since ICU 56
  925 #  - ubidi_open()
  926 # and for IDNA2008
  927 #  - uidna_openUTS46()
  928 #  - uidna_nameToUnicode()
  929 #  - unorm2_normalize()
  930 # get $CFLAGS/$LDFLAGS from pkg-config icu-uc if possible
  931 cf_try_icuuc="no"
  932 cf_try_icuuc46="no"
  933 AC_CHECK_HEADER(unicode/unorm.h,[
  934     AC_CHECK_HEADER(unicode/ustring.h, [
  935         AC_DEFINE(HAVE_UNICODE_UNORM_H,1,[Define this to 1 if we have header unicode/unorm.h])
  936         AC_DEFINE(HAVE_UNICODE_USTRING_H,1,[Define this to 1 if we have header unicode/ustring.h])
  937         AC_MSG_CHECKING(for unorm_normalize in libicuuc)
  938         cf_save_LIBS="$LIBS"
  939         cf_try_icuuc="no"
  940         LIBS="$LIBS -licuuc"
  941         AC_TRY_LINK([#include <unicode/unorm.h>], [
  942             int32_t needed, ustr = NULL;
  943             UErrorCode status;
  944             needed = unorm_normalize(ustr, -1, UNORM_DEFAULT, 0, NULL, 0, &status);], [
  945             AC_DEFINE(HAVE_LIBICUUC,1,[Define this to 1 if we have libicuuc])
  946             cf_try_icuuc="yes"],
  947             LIBS=$cf_save_LIBS
  948         )
  949         AC_MSG_RESULT($cf_try_icuuc)
  950         cf_save_LIBS="$LIBS"
  951         AC_CHECK_HEADER(unicode/uidna.h, [
  952             AC_DEFINE(HAVE_UNICODE_UIDNA_H,1,[Define this to 1 if we have header unicode/uidna.h])
  953         ])
  954         AC_MSG_CHECKING(for uidna_nameToUnicode in libicuuc)
  955         AC_TRY_LINK([#include <unicode/uidna.h>
  956             #include <unicode/unorm.h>], [
  957             UErrorCode status = U_ZERO_ERROR;
  958             UIDNAInfo info = UIDNA_INFO_INITIALIZER;
  959             UIDNA *uts46;
  960             uidna_openUTS46(UNORM_DEFAULT, &status);
  961             uidna_nameToUnicode(uts46, NULL, 0, NULL, 0, &info, &status);
  962             uidna_close(uts46);], [
  963             AC_DEFINE(HAVE_LIBICUUC_46_API,1,[Define this to 1 if we have libicuus 46-API])
  964             cf_try_icuuc46="yes"],
  965             LIBS=$cf_save_LIBS
  966         )
  967         AC_MSG_RESULT($cf_try_icuuc46)
  968         AC_CHECK_HEADER(unicode/ubidi.h, [
  969             AC_DEFINE(HAVE_UNICODE_UBIDI_H,1,[Define this to 1 if we have header unicode/ubidi.h])
  970         ])
  971     ])
  972 ])
  973 # IDNA2008
  974 AC_CHECK_HEADER(unicode/unorm2.h, [
  975     AC_DEFINE(HAVE_UNICODE_UNORM2_H,1,[Define this to 1 if we have header unicode/unorm2.h])
  976 ])
  977 
  978 # without icuuc try GNU libunistring for normalization
  979 if test $cf_try_icuuc = no ; then
  980     AC_CHECK_HEADER(unitypes.h,[
  981         AC_CHECK_HEADER(uninorm.h,[
  982             AC_DEFINE(HAVE_UNITYPES_H,1,[Define this to 1 if we have header unitypes.h])
  983             AC_DEFINE(HAVE_UNINORM_H,1,[Define this to 1 if we have header uninorm.h])
  984             AC_MSG_CHECKING(for u8_normalize in libunistring)
  985             cf_save_LIBS="$LIBS"
  986             cf_try_unistring="no"
  987             LIBS="$LIBS -lunistring"
  988             AC_TRY_LINK([#include <unitypes.h>
  989                 #include <uninorm.h>], [
  990                 size_t ol = 0;
  991                 u8_normalize(UNINORM_NFC, (uint8_t *) "x", 2, NULL, &ol);], [
  992                 AC_DEFINE(HAVE_LIBUNISTRING,1,[Define this to 1 if we have library unistring])
  993                 cf_try_unistring="yes"],
  994                 LIBS=$cf_save_LIBS
  995             )
  996             AC_MSG_RESULT($cf_try_unistring)
  997         ])
  998     ])
  999 fi
 1000 
 1001 # without icuuc try libidn for Internationalized Domain Names / IDN 2003
 1002 # TODO: check for libidn2
 1003 #       get $CFLAGS/$LDFLAGS from pkg-config libidn[2] if possible
 1004 if test $cf_try_icuuc = no ; then
 1005     AC_CHECK_LIB(idn, stringprep_check_version,
 1006         [AC_CHECK_HEADER(stringprep.h,[
 1007             AC_DEFINE(HAVE_STRINGPREP_H,1,[Define this to 1 if we have header stringprep.h])
 1008             AC_CHECK_HEADER(idna.h, [
 1009                 AC_DEFINE(HAVE_IDNA_H,1,[Define this to 1 if we have header idna.h])
 1010                 AC_CHECK_LIB(idn, idna_to_unicode_lzlz, [
 1011                     AC_DEFINE(HAVE_IDNA_TO_UNICODE_LZLZ,1,[Define this to 1 if we have function idna_to_unicode_lzlz])
 1012                     AC_MSG_CHECKING(for IDNA_USE_STD3_ASCII_RULES)
 1013                     AC_EGREP_HEADER(IDNA_USE_STD3_ASCII_RULES, idna.h, [
 1014                         AC_DEFINE(HAVE_IDNA_USE_STD3_ASCII_RULES,1,[Define this to 1 if we have symbol IDNA_USE_STD3_ASCII_RULES in idna.h])
 1015                         AC_MSG_RESULT(yes)],
 1016                         AC_MSG_RESULT(no)
 1017                     )
 1018                 ])
 1019                 AC_CHECK_LIB(idn, idna_strerror, [
 1020                     AC_DEFINE(HAVE_IDNA_STRERROR,1,[Define this to 1 if we have function idna_strerror])
 1021                 ])
 1022             ])
 1023             AC_DEFINE(HAVE_LIBIDN,1,[Define this to 1 if we have library idn])
 1024             LIBS="$LIBS -lidn"]
 1025         )]
 1026     )
 1027 fi
 1028 
 1029 # libidnkit - Internationalized Domain Names / IDN 2008
 1030 AC_CHECK_LIB(idnkit, idn_decodename, [
 1031     AC_CHECK_HEADER(idn/api.h, [
 1032         AC_MSG_CHECKING(for IDN_DECODE_LOOKUP)
 1033         cf_save_LIBS="$LIBS"
 1034         LIBS="$LIBS -lidnkit"
 1035         AC_TRY_LINK([#include <idn/api.h>
 1036             #include <string.h>], [
 1037             idn_result_t rs;
 1038             char in[255], out[255];
 1039             strcpy(in, "xn--brenfe-fta9a2q.de");
 1040             rs = idn_decodename(IDN_DECODE_LOOKUP, &in, &out, 254);
 1041             idn_result_tostring(rs);], [
 1042             AC_DEFINE(HAVE_LIBIDNKIT,1,[Define this to 1 if we can link with idnkit library])
 1043             AC_DEFINE(HAVE_IDN_API_H,1,[Define this to 1 if we have header idn/api.h])
 1044             AC_DEFINE(HAVE_IDN_DECODENAME,1,[Define this to 1 if we have function idn_decodename])
 1045             AC_MSG_RESULT(yes)], [
 1046             LIBS=$cf_save_LIBS
 1047             AC_MSG_RESULT(no)
 1048         ])
 1049     ])
 1050 ])
 1051 
 1052 
 1053 if test $use_curses != no ; then
 1054     cf_cv_termlib=$cf_with_screen
 1055 else
 1056     CF_TERMCAP_LIBS
 1057     # terminfo-based termcap interfaces may be prototyped in <curses.h>,
 1058     # which may/may not be compatible with <termcap.h>
 1059     AC_MSG_CHECKING(if we should include termcap.h)
 1060     cf_save_CFLAGS="$CFLAGS"
 1061     CFLAGS="$CFLAGS -I$srcdir/include"
 1062     AC_TRY_COMPILE([
 1063 #define HAVE_TERMCAP_H 1
 1064 #include <tcurses.h>],[
 1065 #ifdef NCURSES_VERSION
 1066 make an error
 1067 #endif
 1068 ],
 1069         [cf_result=yes],
 1070         [cf_result=no])
 1071     AC_MSG_RESULT($cf_result)
 1072     CFLAGS="$cf_save_CFLAGS"
 1073     test $cf_result = yes && AC_DEFINE(HAVE_TERMCAP_H,1,[Define this to 1 if we have non-ncurses header termcap.h])
 1074     CF_TYPE_OUTCHAR
 1075 fi
 1076 
 1077 cf_tc_funcs=
 1078 cf_tc_externs=
 1079 if test ".$cf_cv_termlib" = .terminfo ; then
 1080     AC_DEFINE(USE_TERMINFO,1,[Define this to 1 if we use terminfo functions for screen management])
 1081     cf_tc_funcs="tigetint tigetnum tparam tparm"
 1082     cf_tc_externs="$cf_tc_funcs tgoto tigetstr tputs tigetflag"
 1083 elif test ".$cf_cv_termlib" = .termcap ; then
 1084     # BSD 'tputs()' may need 'PC' to be set.
 1085     AC_TRY_LINK([],[extern char PC; PC = 0],
 1086         [AC_DEFINE(HAVE_EXTERN_TCAP_PC,1,[Define this if termcap's extern PC exists])])
 1087     cf_tc_funcs="tgetint tgetnum tparam tparm"
 1088     cf_tc_externs="$cf_tc_funcs tgoto tgetstr tputs tgetent tgetflag"
 1089 fi
 1090 
 1091 ### Checks for external-data
 1092 CF_ERRNO
 1093 CF_STRERROR
 1094 
 1095 ### Checks for library functions.
 1096 AC_CHECK_FUNCS(\
 1097     alarm \
 1098     atoi \
 1099     atol \
 1100     atoll \
 1101     atoq \
 1102     bcopy \
 1103     chmod \
 1104     execlp \
 1105     explicit_bzero \
 1106     explicit_memset \
 1107     fchmod \
 1108     fcntl \
 1109     fdopen \
 1110     fork \
 1111     ftime \
 1112     ftruncate \
 1113     fsync \
 1114     getcwd \
 1115     gettimeofday \
 1116     getwd \
 1117     inet_aton \
 1118     is_xterm \
 1119     isascii \
 1120     lockf \
 1121     memcmp \
 1122     memcpy \
 1123     memmove \
 1124     memset \
 1125     mkdir \
 1126     mkfifo \
 1127     mktemp \
 1128     mkstemp \
 1129     nl_langinfo \
 1130     poll \
 1131     putenv \
 1132     rewinddir \
 1133     resizeterm \
 1134     select \
 1135     setenv \
 1136     setlocale \
 1137     settz \
 1138     setvbuf \
 1139     sigaction \
 1140     snprintf \
 1141     stpcpy \
 1142     strchr \
 1143     strcasecmp \
 1144     strcasestr \
 1145     strdup \
 1146     strftime \
 1147     strpbrk \
 1148     strrchr \
 1149     strrstr \
 1150     strsep \
 1151     strstr \
 1152     strtol \
 1153     strtoll \
 1154     tmpfile \
 1155     tzset \
 1156     uname \
 1157     unlink \
 1158     use_default_colors \
 1159     usleep \
 1160     vsnprintf \
 1161     waitpid \
 1162 $cf_tc_funcs )
 1163 
 1164 AC_CHECK_FUNC(flock,
 1165     AC_DEFINE(HAVE_FLOCK,1,[Define this to 1 if flock function exists]),[
 1166     AC_CHECK_LIB(bsd, flock,
 1167         AC_DEFINE(HAVE_FLOCK)
 1168         LIBS="$LIBS -lbsd")])
 1169 
 1170 # clock_gettime() / librt
 1171 AC_CHECK_FUNC(clock_gettime,
 1172     AC_DEFINE(HAVE_CLOCK_GETTIME,1,[Define this to 1 if clock_gettime function exists]),[
 1173         AC_CHECK_LIB(rt, clock_gettime,
 1174             AC_DEFINE(HAVE_CLOCK_GETTIME)
 1175             LIBS="$LIBS -lrt"
 1176         )
 1177     ]
 1178 )
 1179 
 1180 AC_MSG_CHECKING([for memset_s])
 1181 AC_TRY_RUN([
 1182 /* Request C11 Annex K */
 1183 #define __STDC_WANT_LIB_EXT1__ 1
 1184 #include <string.h>
 1185 #include <stddef.h>
 1186 int main()
 1187 {
 1188     char buf[10] = { 1 };
 1189     if (memset_s((void*) buf, (size_t) 100, 0, (size_t) 1))
 1190         return(-1);
 1191 }],
 1192     [
 1193         AC_MSG_RESULT([yes])
 1194         AC_DEFINE(HAVE_MEMSET_S,1,[Define this to 1 if we have function memset_s])
 1195     ],
 1196     [AC_MSG_RESULT([no])],
 1197     [AC_MSG_RESULT([unknown])]
 1198 )
 1199 
 1200 AM_MULTIBYTE_ABLE
 1201 
 1202 AC_MSG_CHECKING(if gettimeofday takes two arguments)
 1203 AC_TRY_COMPILE([
 1204 #if HAVE_SYS_TIME_H
 1205 #include <sys/time.h>
 1206 #endif],
 1207 [struct timeval *tv;
 1208 struct timezone *tz;
 1209 gettimeofday(&tv, &tz);],
 1210 ac_cv_func_gettimeofday_2args=yes, ac_cv_func_gettimeofday_2args=no)
 1211 AC_MSG_RESULT($ac_cv_func_gettimeofday_2args)
 1212 if test $ac_cv_func_gettimeofday_2args = yes; then
 1213     AC_DEFINE(GETTIMEOFDAY_2ARGS,1,[Define this to 1 if gettimeofday takes two arguments])
 1214 fi
 1215 
 1216 CF_POSIX_JC
 1217 CF_FUNC_FORK
 1218 CF_FUNC_MEMMOVE
 1219 
 1220 AC_MSG_CHECKING(if select expects int * arguments)
 1221 AC_EGREP_HEADER([select\(.*, *int *\*,],time.h,
 1222     AC_DEFINE(HAVE_SELECT_INTP,1,[Define this to 1 if select expects int * arguments]) AC_MSG_RESULT(yes),
 1223     AC_MSG_RESULT(no)
 1224 )
 1225 
 1226 AC_FUNC_CLOSEDIR_VOID
 1227 
 1228 # autoconf 2.5x assumes setvbuf is not reversed when cross-compiling
 1229 if test "$cross_compiling" != yes ; then
 1230     AC_FUNC_SETVBUF_REVERSED
 1231 fi
 1232 
 1233 ### Checks for network library functions.
 1234 AC_CHECK_FUNCS(\
 1235     gai_strerror \
 1236     getaddrinfo \
 1237     gethostname \
 1238     gethostbyname \
 1239     getservbyname \
 1240     inet_addr \
 1241     inet_ntoa \
 1242     strncasecmp \
 1243 )
 1244 
 1245 CF_TYPE_SIGACTION
 1246 CF_TERMIOS
 1247 CF_PW_GECOS
 1248 CF_TM_GMTOFF
 1249 
 1250 AC_SYS_LONG_FILE_NAMES
 1251 CF_FUNC_SYSTEM
 1252 
 1253 # Check if we are trying to use curses+color, but cannot
 1254 if test $use_color = yes ; then
 1255     if test $use_curses = no ; then
 1256         AC_DEFINE(HAVE_COLOR,1,[Define this to 1 if curses supports color])
 1257     elif test $cf_with_screen = pdcurses ; then
 1258         AC_DEFINE(HAVE_COLOR)
 1259     else
 1260         CF_NCURSES_BROKEN
 1261         CF_COLOR_CURSES
 1262         if test $cf_cv_color_curses = yes ; then
 1263             AC_DEFINE(HAVE_COLOR)
 1264         else
 1265             AC_MSG_WARN(This curses library does not support color)
 1266         fi
 1267     fi
 1268 fi
 1269 
 1270 # GCC and Apollo compilers are quite noisy about signal constants (quiet them).
 1271 if test -n "$GCC"; then
 1272     check_sig_const=yes
 1273 elif test -f /sys/dm/dm ; then
 1274     check_sig_const=yes
 1275 elif test -f /sys/dm/spm ; then
 1276     check_sig_const=yes
 1277 else
 1278     check_sig_const=no
 1279 fi
 1280 
 1281 if test $check_sig_const = yes ; then
 1282     CF_SIG_CONST
 1283 fi
 1284 
 1285 CF_COMPTYPE
 1286 CF_COREFILE
 1287 
 1288 ### test this last, since it uses a partly-built autoconf.h
 1289 # Setup includes for test-program to verify declarations
 1290 CHECK_DECL_FLAG="-I$srcdir/include -I$srcdir/pcre"
 1291 CHECK_DECL_HDRS='
 1292 #define __CPROTO__
 1293 #define HAVE_CONFDEFS_H
 1294 #include <tin.h>'
 1295 TIN_DECL_HDRS="$CHECK_DECL_HDRS"
 1296 
 1297 dnl These return non-int values, and can be troublesome if not declared
 1298 CF_CHECK_DECL(\
 1299     errno \
 1300     getenv \
 1301     getlogin \
 1302     getpwnam \
 1303     popen \
 1304     strchr \
 1305     strcasestr \
 1306     strsep \
 1307     tmpfile \
 1308 )
 1309 
 1310 dnl Check network stuff separately, to limit the effect of inconsistent headers
 1311 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1312 #include <tnntp.h>"
 1313 CF_CHECK_DECL(\
 1314     gethostbyname \
 1315     getservbyname \
 1316     inet_aton \
 1317     inet_ntoa \
 1318     socket \
 1319 )
 1320 
 1321 if test $use_curses = no ; then
 1322 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1323 #include <tcurses.h>"
 1324 CF_CHECK_DECL(\
 1325     tgetstr \
 1326     tgoto \
 1327 )
 1328 fi
 1329 
 1330 if test $with_decl_check = yes; then
 1331 CHECK_DECL_HDRS="$TIN_DECL_HDRS"
 1332 CF_CHECK_DECL(\
 1333     _flsbuf \
 1334     alarm \
 1335     atoi \
 1336     atol \
 1337     atoll \
 1338     atoq \
 1339     bcopy \
 1340     bzero \
 1341     calloc \
 1342     fchmod \
 1343     fclose \
 1344     fdopen \
 1345     fflush \
 1346     fgetc \
 1347     fileno \
 1348     fprintf \
 1349     fputc \
 1350     fputs \
 1351     fread \
 1352     free \
 1353     fseek \
 1354     fwrite \
 1355     getcwd \
 1356     getopt \
 1357     getwd \
 1358     heapsort \
 1359     ioctl \
 1360     isascii \
 1361     kill \
 1362     malloc \
 1363     memset \
 1364     mkstemp \
 1365     mktemp \
 1366     pclose \
 1367     perror \
 1368     printf \
 1369     putenv \
 1370     qsort \
 1371     realloc \
 1372     rename \
 1373     rewind \
 1374     select \
 1375     setenv \
 1376     snprintf \
 1377     sscanf \
 1378     strcasecmp \
 1379     strftime \
 1380     strncasecmp \
 1381     strtol \
 1382     strtoll \
 1383     system \
 1384     time \
 1385     tolower \
 1386     toupper \
 1387     ungetc \
 1388     usleep \
 1389     vsprintf \
 1390     vsnprintf \
 1391 )
 1392 
 1393 if test $use_curses = no ; then
 1394 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1395 #include <tcurses.h>"
 1396 CF_CHECK_DECL($cf_tc_externs)
 1397 fi
 1398 
 1399 CHECK_DECL_HDRS="$TIN_DECL_HDRS
 1400 #include <tnntp.h>"
 1401 CF_CHECK_DECL(\
 1402     connect \
 1403     gethostname \
 1404 )
 1405 
 1406 fi
 1407 
 1408 CF_TIOCGWINSZ
 1409 
 1410 ### append special libraries that get in the way of testing
 1411 case $debug_malloc in
 1412 DBMALLOC)
 1413     AC_DEFINE(USE_DBMALLOC)
 1414     LIBS="$LIBS -ldbmalloc"
 1415     ;;
 1416 DMALLOC)
 1417     AC_DEFINE(USE_DMALLOC)
 1418     LIBS="$LIBS -ldmalloc"
 1419     ;;
 1420 esac
 1421 
 1422 ### Use gettext
 1423 ### this also calls AM_LANGINFO_CODESET and AM_ICONV
 1424 ### so we don't need to do the tests ourselves.
 1425 CF_BUNDLED_INTL
 1426 LIBS="$LIBS $LIBICONV"
 1427 
 1428 ### check for alloca (required for bison and/or intl/*)
 1429 case "$YACC" in
 1430 bison*)
 1431     use_alloca=yes
 1432     ;;
 1433 *)
 1434     use_alloca=$USE_INCLUDED_LIBINTL
 1435     ;;
 1436 esac
 1437 
 1438 if test ".$use_alloca" = .yes ; then
 1439     CF_FUNC_ALLOCA
 1440 else
 1441     ALLOCA=""
 1442     AC_SUBST(ALLOCA)
 1443 fi
 1444 
 1445 # if struct hostent contains h_addr_list or not (SunOS-3.5)
 1446 AC_MSG_CHECKING(for h_addr_list in struct hostent)
 1447 AC_TRY_COMPILE([
 1448 #ifdef HAVE_NETDB_H
 1449 #include <netdb.h>
 1450 #endif
 1451 ],[
 1452 struct hostent h;
 1453 h.h_addr_list[0]=0;
 1454 ],ac_cv_hostent_h_addr_list=yes,ac_cv_hostent_h_addr_list=no)
 1455 AC_MSG_RESULT($ac_cv_hostent_h_addr_list)
 1456 if test $ac_cv_hostent_h_addr_list = yes; then
 1457     AC_DEFINE(HAVE_HOSTENT_H_ADDR_LIST,1,[Define this to 1 if we have h_addr_list in struct hostent])
 1458 fi
 1459 
 1460 CF_CHECK_FD_SET
 1461 
 1462 # tolower() is known to be broken on 4.2BSD by
 1463 # not checking if input is an uppercase letter
 1464 # /* #define tolower(c) ((c)-'A'+'a') */
 1465 AC_MSG_CHECKING(for working tolower())
 1466 AC_TRY_RUN([
 1467 #include <ctype.h>
 1468 int main() {
 1469     unsigned char str;
 1470 
 1471     for (str = 1; str < 127; str++) {
 1472             if ((char) tolower(str) != ((str >= 'A' && str <= 'Z') ? ((unsigned char) (str - 'A' + 'a')) : str))
 1473             return 1;
 1474     }
 1475     return 0;
 1476 }],
 1477         [
 1478                 AC_MSG_RESULT(yes)
 1479         ],
 1480         [
 1481         AC_DEFINE(TOLOWER_BROKEN,1,[Define this to 1 if function tolower if broken])
 1482                 AC_MSG_RESULT(no)
 1483         ],
 1484         [
 1485                 AC_MSG_RESULT(unknown)
 1486         ]
 1487 )
 1488 
 1489 # toupper is known to be broken on 4.2BSD by
 1490 # not checking if input is an lowercase letter
 1491 # /* #define toupper(c) ((c)-'a'+'A') */
 1492 AC_MSG_CHECKING(for working toupper())
 1493 AC_TRY_RUN([
 1494 #include <ctype.h>
 1495 int main() {
 1496     unsigned char str;
 1497 
 1498     for (str = 1; str < 127; str++) {
 1499             if ((char) toupper(str) != ((str >= 'a' && str <= 'z') ? ((unsigned char) (str - 'a' + 'A')) : str))
 1500             return 1;
 1501     }
 1502     return 0;
 1503 }],
 1504         [
 1505                 AC_MSG_RESULT(yes)
 1506         ],
 1507         [
 1508         AC_DEFINE(TOUPPER_BROKEN,1,[Define this to 1 if function toupper if broken])
 1509                 AC_MSG_RESULT(no)
 1510         ],
 1511         [
 1512                 AC_MSG_RESULT(unknown)
 1513         ]
 1514 )
 1515 
 1516 
 1517 CF_CHECK_HEADERS(iconv.h)
 1518 AC_MSG_CHECKING(for iconv_open() //TRANSLIT extension)
 1519 AC_TRY_RUN([
 1520 #ifdef HAVE_ICONV_H
 1521 #   include <iconv.h>
 1522 #endif /* HAVE_ICONV_H */
 1523 #ifdef HAVE_STDLIB_H
 1524 #   include <stdlib.h>
 1525 #endif /* HAVE_STDLIB_H */
 1526 int main() {
 1527     iconv_t cd;
 1528 
 1529     if ((cd = iconv_open("US-ASCII//TRANSLIT", "ISO-8859-1")) == (iconv_t) (-1))
 1530         exit(1);
 1531     exit(0);
 1532 }],
 1533     [
 1534         AC_DEFINE(HAVE_ICONV_OPEN_TRANSLIT,1,[Define this to 1 if iconv_open() //TRANSLIT extension works])
 1535         AC_MSG_RESULT(yes)
 1536     ],
 1537     [
 1538         AC_MSG_RESULT(no)
 1539     ],
 1540     [
 1541         AC_MSG_RESULT(unknown)
 1542     ]
 1543 )
 1544 
 1545 # FIXME / TESTME
 1546 # locale is broken on cygwin < 1.7.0
 1547 # group/other bits don't work on cygwin < 1.7.0
 1548 # locking doesn't work on cygwin < 2.0 as link(2) is detected but doesn't work
 1549 case "$host_os" in
 1550     *cygwin*)
 1551         case `uname -r | sed 's,(.*,,'` in
 1552             B*|1.0-6].*)
 1553                 # multiple defects
 1554                 AC_DEFINE(NO_LOCALE,1,[Define this to 1 if locale does not work])
 1555                 AC_DEFINE(NO_LOCKING,1,[Define this to 1 if locking does not work])
 1556                 AC_DEFINE(FILE_MODE_BROKEN,1,[Define this to 1 if file-permissions are broken])
 1557                 ;;
 1558             1.7.*)
 1559                 # link does not work
 1560                 AC_DEFINE(NO_LOCKING)
 1561                 ;;
 1562             *)
 1563                 AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK,1,[Define this to 1 if we have function link]))
 1564                 ;;
 1565             esac
 1566         ;;
 1567     *haiku*)
 1568         # link does not work
 1569         AC_DEFINE(NO_LOCKING)
 1570         ;;
 1571     *)
 1572         AC_CHECK_FUNC(link, AC_DEFINE(HAVE_LINK))
 1573 esac
 1574 
 1575 if test "$cf_cv_termlib" = pdcurses ; then
 1576     CF_PDCURSES_X11
 1577 fi
 1578 AC_CHECK_FUNCS(vw_printw)
 1579 
 1580 ### sum up warnings
 1581 if test "$cf_cv_termlib" = none ; then
 1582     AC_MSG_WARN([no term-lib found, you might run into trouble later.])
 1583 fi
 1584 if test "$YACC" = "" ; then
 1585     AC_MSG_WARN([no yacc-parser found, you might run into trouble later.])
 1586 fi
 1587 if test "$RANLIB" = "" ; then
 1588     AC_MSG_WARN([no library archive builder found, you might run into trouble later.])
 1589 fi
 1590 
 1591 ### Finally, build autoconf.h and the makefiles
 1592 CFLAGS="$CFLAGS $EXTRA_CFLAGS"
 1593 
 1594 LINTFLAGS=$LINTFLAGS
 1595 AC_SUBST(LINTFLAGS)
 1596 
 1597 CF_DEFINE_STRING(TIN_CC,       "$CC")
 1598 CF_DEFINE_STRING(TIN_CFLAGS,   "$CFLAGS")
 1599 CF_DEFINE_STRING(TIN_CPP,      "$CPP")
 1600 CF_DEFINE_STRING(TIN_CPPFLAGS, "$CPPFLAGS")
 1601 CF_DEFINE_STRING(TIN_LD,       "$CC")
 1602 CF_DEFINE_STRING(TIN_LDFLAGS,  "$LDFLAGS")
 1603 CF_DEFINE_STRING(TIN_LIBS,     "$PCREDIR_LIBS $CANLIBS $LIBS")
 1604 
 1605 AC_OUTPUT($PCRE_MAKEFILE
 1606     $SUB_MAKEFILE
 1607     $CAN_MAKEFILE
 1608     src/Makefile)