home *** CD-ROM | disk | FTP | other *** search
/ ftp.ncftp.com / ftp.ncftp.com.zip / ftp.ncftp.com / ncftp / older_versions / ncftp-3.2.2-src.tar.bz2 / ncftp-3.2.2-src.tar / ncftp-3.2.2 / configure < prev    next >
Text File  |  2008-08-18  |  262KB  |  10,402 lines

  1. #! /bin/sh
  2.  
  3. # Guess values for system-dependent variables and create Makefiles.
  4. # Generated automatically using autoconf version 2.13 
  5. # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
  6. #
  7. # This configure script is free software; the Free Software Foundation
  8. # gives unlimited permission to copy, distribute and modify it.
  9.  
  10. # Defaults:
  11. ac_help=
  12. ac_default_prefix=/usr/local
  13. # Any additions from configure.in:
  14. ac_help="$ac_help
  15.   --disable-ccdv          disable use of ccdv program in Makefiles"
  16. ac_help="$ac_help
  17.   --without-curses        do not try to find and use the curses library"
  18. ac_help="$ac_help
  19.   --enable-debug          enable debugging symbols"
  20. ac_help="$ac_help
  21.   --without-ncurses       do not try to find and use the ncurses library"
  22. ac_help="$ac_help
  23.   --disable-precomp       disable use of precompiled header files"
  24. ac_help="$ac_help
  25.   --with-socks5           try to find and use the SOCKS5 library"
  26. ac_help="$ac_help
  27.   --disable-universal     disable production of universal binaries on Mac OS X"
  28.  
  29. # Initialize some variables set by options.
  30. # The variables have the same names as the options, with
  31. # dashes changed to underlines.
  32. build=NONE
  33. cache_file=./config.cache
  34. exec_prefix=NONE
  35. host=NONE
  36. no_create=
  37. nonopt=NONE
  38. no_recursion=
  39. prefix=NONE
  40. program_prefix=NONE
  41. program_suffix=NONE
  42. program_transform_name=s,x,x,
  43. silent=
  44. site=
  45. srcdir=
  46. target=NONE
  47. verbose=
  48. x_includes=NONE
  49. x_libraries=NONE
  50. bindir='${exec_prefix}/bin'
  51. sbindir='${exec_prefix}/sbin'
  52. libexecdir='${exec_prefix}/libexec'
  53. datadir='${prefix}/share'
  54. sysconfdir='${prefix}/etc'
  55. sharedstatedir='${prefix}/com'
  56. localstatedir='${prefix}/var'
  57. libdir='${exec_prefix}/lib'
  58. includedir='${prefix}/include'
  59. oldincludedir='/usr/include'
  60. infodir='${prefix}/info'
  61. mandir='${prefix}/man'
  62.  
  63. # Initialize some other variables.
  64. subdirs=
  65. MFLAGS= MAKEFLAGS=
  66. SHELL=${CONFIG_SHELL-/bin/sh}
  67. # Maximum number of lines to put in a shell here document.
  68. ac_max_here_lines=12
  69.  
  70. ac_prev=
  71. for ac_option
  72. do
  73.  
  74.   # If the previous option needs an argument, assign it.
  75.   if test -n "$ac_prev"; then
  76.     eval "$ac_prev=\$ac_option"
  77.     ac_prev=
  78.     continue
  79.   fi
  80.  
  81.   case "$ac_option" in
  82.   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  83.   *) ac_optarg= ;;
  84.   esac
  85.  
  86.   # Accept the important Cygnus configure options, so we can diagnose typos.
  87.  
  88.   case "$ac_option" in
  89.  
  90.   -bindir | --bindir | --bindi | --bind | --bin | --bi)
  91.     ac_prev=bindir ;;
  92.   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
  93.     bindir="$ac_optarg" ;;
  94.  
  95.   -build | --build | --buil | --bui | --bu)
  96.     ac_prev=build ;;
  97.   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
  98.     build="$ac_optarg" ;;
  99.  
  100.   -cache-file | --cache-file | --cache-fil | --cache-fi \
  101.   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  102.     ac_prev=cache_file ;;
  103.   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  104.   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  105.     cache_file="$ac_optarg" ;;
  106.  
  107.   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
  108.     ac_prev=datadir ;;
  109.   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
  110.   | --da=*)
  111.     datadir="$ac_optarg" ;;
  112.  
  113.   -disable-* | --disable-*)
  114.     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
  115.     # Reject names that are not valid shell variable names.
  116.     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
  117.       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
  118.     fi
  119.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  120.     eval "enable_${ac_feature}=no" ;;
  121.  
  122.   -enable-* | --enable-*)
  123.     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
  124.     # Reject names that are not valid shell variable names.
  125.     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
  126.       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
  127.     fi
  128.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  129.     case "$ac_option" in
  130.       *=*) ;;
  131.       *) ac_optarg=yes ;;
  132.     esac
  133.     eval "enable_${ac_feature}='$ac_optarg'" ;;
  134.  
  135.   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  136.   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  137.   | --exec | --exe | --ex)
  138.     ac_prev=exec_prefix ;;
  139.   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  140.   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  141.   | --exec=* | --exe=* | --ex=*)
  142.     exec_prefix="$ac_optarg" ;;
  143.  
  144.   -gas | --gas | --ga | --g)
  145.     # Obsolete; use --with-gas.
  146.     with_gas=yes ;;
  147.  
  148.   -help | --help | --hel | --he)
  149.     # Omit some internal or obsolete options to make the list less imposing.
  150.     # This message is too long to be a string in the A/UX 3.1 sh.
  151.     cat << EOF
  152. Usage: configure [options] [host]
  153. Options: [defaults in brackets after descriptions]
  154. Configuration:
  155.   --cache-file=FILE       cache test results in FILE
  156.   --help                  print this message
  157.   --no-create             do not create output files
  158.   --quiet, --silent       do not print \`checking...' messages
  159.   --version               print the version of autoconf that created configure
  160. Directory and file names:
  161.   --prefix=PREFIX         install architecture-independent files in PREFIX
  162.                           [$ac_default_prefix]
  163.   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
  164.                           [same as prefix]
  165.   --bindir=DIR            user executables in DIR [EPREFIX/bin]
  166.   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
  167.   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
  168.   --datadir=DIR           read-only architecture-independent data in DIR
  169.                           [PREFIX/share]
  170.   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
  171.   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
  172.                           [PREFIX/com]
  173.   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
  174.   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
  175.   --includedir=DIR        C header files in DIR [PREFIX/include]
  176.   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
  177.   --infodir=DIR           info documentation in DIR [PREFIX/info]
  178.   --mandir=DIR            man documentation in DIR [PREFIX/man]
  179.   --srcdir=DIR            find the sources in DIR [configure dir or ..]
  180.   --program-prefix=PREFIX prepend PREFIX to installed program names
  181.   --program-suffix=SUFFIX append SUFFIX to installed program names
  182.   --program-transform-name=PROGRAM
  183.                           run sed PROGRAM on installed program names
  184. EOF
  185.     cat << EOF
  186. Host type:
  187.   --build=BUILD           configure for building on BUILD [BUILD=HOST]
  188.   --host=HOST             configure for HOST [guessed]
  189.   --target=TARGET         configure for TARGET [TARGET=HOST]
  190. Features and packages:
  191.   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  192.   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  193.   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  194.   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  195.   --x-includes=DIR        X include files are in DIR
  196.   --x-libraries=DIR       X library files are in DIR
  197. EOF
  198.     if test -n "$ac_help"; then
  199.       echo "--enable and --with options recognized:$ac_help"
  200.     fi
  201.     exit 0 ;;
  202.  
  203.   -host | --host | --hos | --ho)
  204.     ac_prev=host ;;
  205.   -host=* | --host=* | --hos=* | --ho=*)
  206.     host="$ac_optarg" ;;
  207.  
  208.   -includedir | --includedir | --includedi | --included | --include \
  209.   | --includ | --inclu | --incl | --inc)
  210.     ac_prev=includedir ;;
  211.   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
  212.   | --includ=* | --inclu=* | --incl=* | --inc=*)
  213.     includedir="$ac_optarg" ;;
  214.  
  215.   -infodir | --infodir | --infodi | --infod | --info | --inf)
  216.     ac_prev=infodir ;;
  217.   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
  218.     infodir="$ac_optarg" ;;
  219.  
  220.   -libdir | --libdir | --libdi | --libd)
  221.     ac_prev=libdir ;;
  222.   -libdir=* | --libdir=* | --libdi=* | --libd=*)
  223.     libdir="$ac_optarg" ;;
  224.  
  225.   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
  226.   | --libexe | --libex | --libe)
  227.     ac_prev=libexecdir ;;
  228.   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
  229.   | --libexe=* | --libex=* | --libe=*)
  230.     libexecdir="$ac_optarg" ;;
  231.  
  232.   -localstatedir | --localstatedir | --localstatedi | --localstated \
  233.   | --localstate | --localstat | --localsta | --localst \
  234.   | --locals | --local | --loca | --loc | --lo)
  235.     ac_prev=localstatedir ;;
  236.   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
  237.   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
  238.   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
  239.     localstatedir="$ac_optarg" ;;
  240.  
  241.   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
  242.     ac_prev=mandir ;;
  243.   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
  244.     mandir="$ac_optarg" ;;
  245.  
  246.   -nfp | --nfp | --nf)
  247.     # Obsolete; use --without-fp.
  248.     with_fp=no ;;
  249.  
  250.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  251.   | --no-cr | --no-c)
  252.     no_create=yes ;;
  253.  
  254.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  255.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  256.     no_recursion=yes ;;
  257.  
  258.   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
  259.   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
  260.   | --oldin | --oldi | --old | --ol | --o)
  261.     ac_prev=oldincludedir ;;
  262.   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
  263.   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
  264.   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
  265.     oldincludedir="$ac_optarg" ;;
  266.  
  267.   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  268.     ac_prev=prefix ;;
  269.   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  270.     prefix="$ac_optarg" ;;
  271.  
  272.   -program-prefix | --program-prefix | --program-prefi | --program-pref \
  273.   | --program-pre | --program-pr | --program-p)
  274.     ac_prev=program_prefix ;;
  275.   -program-prefix=* | --program-prefix=* | --program-prefi=* \
  276.   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  277.     program_prefix="$ac_optarg" ;;
  278.  
  279.   -program-suffix | --program-suffix | --program-suffi | --program-suff \
  280.   | --program-suf | --program-su | --program-s)
  281.     ac_prev=program_suffix ;;
  282.   -program-suffix=* | --program-suffix=* | --program-suffi=* \
  283.   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  284.     program_suffix="$ac_optarg" ;;
  285.  
  286.   -program-transform-name | --program-transform-name \
  287.   | --program-transform-nam | --program-transform-na \
  288.   | --program-transform-n | --program-transform- \
  289.   | --program-transform | --program-transfor \
  290.   | --program-transfo | --program-transf \
  291.   | --program-trans | --program-tran \
  292.   | --progr-tra | --program-tr | --program-t)
  293.     ac_prev=program_transform_name ;;
  294.   -program-transform-name=* | --program-transform-name=* \
  295.   | --program-transform-nam=* | --program-transform-na=* \
  296.   | --program-transform-n=* | --program-transform-=* \
  297.   | --program-transform=* | --program-transfor=* \
  298.   | --program-transfo=* | --program-transf=* \
  299.   | --program-trans=* | --program-tran=* \
  300.   | --progr-tra=* | --program-tr=* | --program-t=*)
  301.     program_transform_name="$ac_optarg" ;;
  302.  
  303.   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  304.   | -silent | --silent | --silen | --sile | --sil)
  305.     silent=yes ;;
  306.  
  307.   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
  308.     ac_prev=sbindir ;;
  309.   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
  310.   | --sbi=* | --sb=*)
  311.     sbindir="$ac_optarg" ;;
  312.  
  313.   -sharedstatedir | --sharedstatedir | --sharedstatedi \
  314.   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
  315.   | --sharedst | --shareds | --shared | --share | --shar \
  316.   | --sha | --sh)
  317.     ac_prev=sharedstatedir ;;
  318.   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
  319.   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
  320.   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
  321.   | --sha=* | --sh=*)
  322.     sharedstatedir="$ac_optarg" ;;
  323.  
  324.   -site | --site | --sit)
  325.     ac_prev=site ;;
  326.   -site=* | --site=* | --sit=*)
  327.     site="$ac_optarg" ;;
  328.  
  329.   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  330.     ac_prev=srcdir ;;
  331.   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  332.     srcdir="$ac_optarg" ;;
  333.  
  334.   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
  335.   | --syscon | --sysco | --sysc | --sys | --sy)
  336.     ac_prev=sysconfdir ;;
  337.   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
  338.   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
  339.     sysconfdir="$ac_optarg" ;;
  340.  
  341.   -target | --target | --targe | --targ | --tar | --ta | --t)
  342.     ac_prev=target ;;
  343.   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  344.     target="$ac_optarg" ;;
  345.  
  346.   -v | -verbose | --verbose | --verbos | --verbo | --verb)
  347.     verbose=yes ;;
  348.  
  349.   -version | --version | --versio | --versi | --vers)
  350.     echo "configure generated by autoconf version 2.13"
  351.     exit 0 ;;
  352.  
  353.   -with-* | --with-*)
  354.     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
  355.     # Reject names that are not valid shell variable names.
  356.     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
  357.       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
  358.     fi
  359.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  360.     case "$ac_option" in
  361.       *=*) ;;
  362.       *) ac_optarg=yes ;;
  363.     esac
  364.     eval "with_${ac_package}='$ac_optarg'" ;;
  365.  
  366.   -without-* | --without-*)
  367.     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
  368.     # Reject names that are not valid shell variable names.
  369.     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  370.       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
  371.     fi
  372.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  373.     eval "with_${ac_package}=no" ;;
  374.  
  375.   --x)
  376.     # Obsolete; use --with-x.
  377.     with_x=yes ;;
  378.  
  379.   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  380.   | --x-incl | --x-inc | --x-in | --x-i)
  381.     ac_prev=x_includes ;;
  382.   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  383.   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  384.     x_includes="$ac_optarg" ;;
  385.  
  386.   -x-libraries | --x-libraries | --x-librarie | --x-librari \
  387.   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  388.     ac_prev=x_libraries ;;
  389.   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  390.   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  391.     x_libraries="$ac_optarg" ;;
  392.  
  393.   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
  394.     ;;
  395.  
  396.   *)
  397.     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
  398.       echo "configure: warning: $ac_option: invalid host type" 1>&2
  399.     fi
  400.     if test "x$nonopt" != xNONE; then
  401.       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
  402.     fi
  403.     nonopt="$ac_option"
  404.     ;;
  405.  
  406.   esac
  407. done
  408.  
  409. if test -n "$ac_prev"; then
  410.   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
  411. fi
  412.  
  413. trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
  414.  
  415. # File descriptor usage:
  416. # 0 standard input
  417. # 1 file creation
  418. # 2 errors and warnings
  419. # 3 some systems may open it to /dev/tty
  420. # 4 used on the Kubota Titan
  421. # 6 checking for... messages and results
  422. # 5 compiler messages saved in config.log
  423. if test "$silent" = yes; then
  424.   exec 6>/dev/null
  425. else
  426.   exec 6>&1
  427. fi
  428. exec 5>./config.log
  429.  
  430. echo "\
  431. This file contains any messages produced by compilers while
  432. running configure, to aid debugging if configure makes a mistake.
  433. " 1>&5
  434.  
  435. # Strip out --no-create and --no-recursion so they do not pile up.
  436. # Also quote any args containing shell metacharacters.
  437. ac_configure_args=
  438. for ac_arg
  439. do
  440.   case "$ac_arg" in
  441.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  442.   | --no-cr | --no-c) ;;
  443.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  444.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  445.   *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  446.   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  447.   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  448.   esac
  449. done
  450.  
  451. # NLS nuisances.
  452. # Only set these to C if already set.  These must not be set unconditionally
  453. # because not all systems understand e.g. LANG=C (notably SCO).
  454. # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
  455. # Non-C LC_CTYPE values break the ctype check.
  456. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  457. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  458. if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
  459. if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
  460.  
  461. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  462. rm -rf conftest* confdefs.h
  463. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  464. echo > confdefs.h
  465.  
  466. # A filename unique to this package, relative to the directory that
  467. # configure is in, which we can look for to find out if srcdir is correct.
  468. ac_unique_file=ncftp/main.c
  469.  
  470. # Find the source files, if location was not specified.
  471. if test -z "$srcdir"; then
  472.   ac_srcdir_defaulted=yes
  473.   # Try the directory containing this script, then its parent.
  474.   ac_prog=$0
  475.   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  476.   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  477.   srcdir=$ac_confdir
  478.   if test ! -r $srcdir/$ac_unique_file; then
  479.     srcdir=..
  480.   fi
  481. else
  482.   ac_srcdir_defaulted=no
  483. fi
  484. if test ! -r $srcdir/$ac_unique_file; then
  485.   if test "$ac_srcdir_defaulted" = yes; then
  486.     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  487.   else
  488.     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  489.   fi
  490. fi
  491. srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
  492.  
  493. # Prefer explicitly selected file to automatically selected ones.
  494. if test -z "$CONFIG_SITE"; then
  495.   if test "x$prefix" != xNONE; then
  496.     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  497.   else
  498.     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  499.   fi
  500. fi
  501. for ac_site_file in $CONFIG_SITE; do
  502.   if test -r "$ac_site_file"; then
  503.     echo "loading site script $ac_site_file"
  504.     . "$ac_site_file"
  505.   fi
  506. done
  507.  
  508. if test -r "$cache_file"; then
  509.   echo "loading cache $cache_file"
  510.   . $cache_file
  511. else
  512.   echo "creating cache $cache_file"
  513.   > $cache_file
  514. fi
  515.  
  516. ac_ext=c
  517. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  518. ac_cpp='$CPP $CPPFLAGS'
  519. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
  520. ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
  521. cross_compiling=$ac_cv_prog_cc_cross
  522.  
  523. ac_exeext=
  524. ac_objext=o
  525. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  526.   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  527.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  528.     ac_n= ac_c='
  529. ' ac_t='    '
  530.   else
  531.     ac_n=-n ac_c= ac_t=
  532.   fi
  533. else
  534.   ac_n= ac_c='\c' ac_t=
  535. fi
  536.  
  537.  
  538.  
  539.  
  540.  
  541. # Check whether --enable-ccdv or --disable-ccdv was given.
  542. if test "${enable_ccdv+set}" = set; then
  543.   enableval="$enable_ccdv"
  544.   use_ccdv="$enableval"
  545. else
  546.   use_ccdv=yes
  547. fi
  548.  
  549.  
  550. # Check whether --with-curses or --without-curses was given.
  551. if test "${with_curses+set}" = set; then
  552.   withval="$with_curses"
  553.   nc_cv_curses=$withval
  554. else
  555.   nc_cv_curses=yes
  556. fi
  557.  
  558.  
  559. # if DEBUGBUILD is yes, other macros try to set up a compilation environment
  560. # with debugging symbols enabled.  Example macros which are affected are
  561. # wi_CFLAGS and wi_SFLAG.
  562. #
  563. # Check whether --enable-debug or --disable-debug was given.
  564. if test "${enable_debug+set}" = set; then
  565.   enableval="$enable_debug"
  566.   
  567.     DEBUGBUILD=no
  568.     DEBUGCONFIGUREFLAG=""
  569.     if test "$enableval" != "no" ; then
  570.         DEBUGBUILD=yes
  571.         DEBUGCONFIGUREFLAG="--enable-debug"
  572.     fi
  573.  
  574. else
  575.   
  576.     DEBUGBUILD=no
  577.     DEBUGCONFIGUREFLAG=""
  578.  
  579. fi
  580.  
  581.  
  582. # Check whether --with-ncurses or --without-ncurses was given.
  583. if test "${with_ncurses+set}" = set; then
  584.   withval="$with_ncurses"
  585.   nc_cv_ncurses=$withval
  586. else
  587.   nc_cv_ncurses=yes
  588. fi
  589.  
  590.  
  591. # Check whether --enable-precomp or --disable-precomp was given.
  592. if test "${enable_precomp+set}" = set; then
  593.   enableval="$enable_precomp"
  594.   use_precomp="$enableval"
  595. else
  596.   use_precomp=yes
  597. fi
  598.  
  599.  
  600.  
  601.     # Check whether --with-socks5 or --without-socks5 was given.
  602. if test "${with_socks5+set}" = set; then
  603.   withval="$with_socks5"
  604.   wi_want_socks5=$withval
  605. else
  606.   wi_want_socks5=no
  607. fi
  608.  
  609.  
  610.  
  611. # Check whether --enable-universal or --disable-universal was given.
  612. if test "${enable_universal+set}" = set; then
  613.   enableval="$enable_universal"
  614.   use_macosx_universal="$enableval"
  615. else
  616.   use_macosx_universal=yes
  617. fi
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624. echo $ac_n "checking if you set and exported the environment variable CC""... $ac_c" 1>&6
  625. echo "configure:626: checking if you set and exported the environment variable CC" >&5
  626. if test "x$CC" = x ; then
  627.     echo "$ac_t""no (you may want to do that since configure scripts look for gcc first)" 1>&6
  628. else
  629.     echo "$ac_t""$CC" 1>&6
  630. fi
  631. echo $ac_n "checking for environment variable CFLAGS""... $ac_c" 1>&6
  632. echo "configure:633: checking for environment variable CFLAGS" >&5
  633. if test "x$CFLAGS" = x ; then
  634.     echo "$ac_t""no (we will choose a default set for you)" 1>&6
  635. else
  636.     echo "$ac_t""$CFLAGS" 1>&6
  637. fi
  638. echo $ac_n "checking for environment variable CPPFLAGS""... $ac_c" 1>&6
  639. echo "configure:640: checking for environment variable CPPFLAGS" >&5
  640. echo "$ac_t""${CPPFLAGS-no}" 1>&6
  641. echo $ac_n "checking for environment variable LDFLAGS""... $ac_c" 1>&6
  642. echo "configure:643: checking for environment variable LDFLAGS" >&5
  643. echo "$ac_t""${LDFLAGS-no}" 1>&6
  644. echo $ac_n "checking for environment variable LIBS""... $ac_c" 1>&6
  645. echo "configure:646: checking for environment variable LIBS" >&5
  646. echo "$ac_t""${LIBS-no}" 1>&6
  647.  
  648.  
  649. #
  650. # Take note if the user is or is not exporting a CFLAGS env var.
  651. #
  652. wi_orig_CFLAGS="$CFLAGS"
  653. wi_CFLAGS_TO_ADD_LATER=""
  654. if [ -x "$HOME/bin/OS" ] ; then
  655.     HOME_OS=`$HOME/bin/OS`
  656.     HOME_OS="$HOME/$HOME_OS"
  657. fi
  658. host=`uname -n 2>/dev/null | tr '[A-Z]' '[a-z]'`
  659. os=`uname -s 2>/dev/null | tr '[A-Z]' '[a-z]'`
  660. if [ "$os" = "TvoPT" ] ; then os="sunos" ; fi
  661. os_v=`uname -v 2>/dev/null | sed 's/^[^0-9.]*//;s/[^0-9.].*$//;' | awk '-F[-/: ]' '{n = 1; print $n; }'`
  662. os_r=`uname -r 2>/dev/null | sed 's/^[^0-9.]*//;s/[^0-9.].*$//;' | awk '-F[-/: ]' '{n = 1; print $n; }'`
  663. os_r1=`echo "${os_r}" | cut -c1`
  664. arch=`uname -m 2>/dev/null | tr '[A-Z]' '[a-z]'`
  665. archp=`uname -p 2>/dev/null | tr '[A-Z]' '[a-z]'`
  666. OS=''
  667. SYS=''
  668. NDEFS=''
  669. unset CDPATH    # Not relevant here, but needs to be done eventually.
  670.  
  671. # Special case a few systems where if your CFLAGS appear
  672. # to want to generate for 32 bit, use that mode rather
  673. # than 64 bit.
  674. #
  675. case "$os,$CFLAGS" in
  676.     irix64,*-n32*)
  677.         os=irix
  678.         # then go to regular "irix" instead of "irix64" below.
  679.         ;;
  680. esac
  681.  
  682. case "$os" in
  683.     osf1)
  684.         case "$os_r" in
  685.             3*|4*)
  686.                 OS="digitalunix${os_r}-$arch"
  687.                 SYS=digitalunix
  688.                 NDEFS="$NDEFS -DDIGITAL_UNIX=$os_r1"
  689.                 ;;
  690.             *)
  691.                 OS="tru64unix${os_r}-$arch"
  692.                 SYS=tru64unix
  693.                 NDEFS="$NDEFS -DTRU64UNIX=$os_r1"
  694.                 ;;
  695.         esac
  696.         ;;
  697.     aix)
  698.         os_lev=`/usr/bin/oslevel 2>/dev/null`
  699.         if [ "$os_lev" = "" ] ; then
  700.             if [ "$os_r" = "" ] ; then os_r=0 ; fi
  701.             OS="aix${os_v}.${os_r}"
  702.             os_int=`expr $os_v$os_r '*' 10`
  703.         else
  704.             os_v=`echo "$os_lev" | cut -d. -f1-3`
  705.             os_v1=`echo "$os_v" | cut -d. -f1`
  706.             os_v2=`echo "$os_v" | cut -d. -f2`
  707.             if [ "$os_v2" = "" ] ; then os_v2=0 ; fi
  708.             os_v3=`echo "$os_v" | cut -d. -f3`
  709.             if [ "$os_v3" = "" ] ; then os_v3=0 ; fi
  710.             os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"`
  711.             OS="aix${os_v}"
  712.         fi
  713.         SYS=aix
  714.         NDEFS="$NDEFS -DAIX=${os_int}"
  715.         ;;
  716.     irix)
  717.         OS="irix${os_r}"
  718.         SYS=irix
  719.         NDEFS="$NDEFS -DIRIX=$os_r1"
  720.         ;;
  721.     irix64)
  722.         OS="irix64_${os_r}"
  723.         SYS=irix64
  724.         NDEFS="$NDEFS -DIRIX=$os_r1 -DIRIX64=$os_r1"
  725.         ;;
  726.     hp-ux)
  727.         os_r=`echo "${os_r}" | cut -d. -f2-`
  728.         os_r1=`echo "$os_r" | cut -d. -f1`
  729.         os_r2=`echo "${os_r}" | cut -d. -f2`
  730.         os_int=`expr "$os_r1" '*' 100 + "$os_r2"`
  731.         if [ "$arch" != "ia64" ] ; then
  732.             arch="hppa"
  733.         fi
  734.         OS="hpux${os_r}-$arch"
  735.         SYS=hpux
  736.         NDEFS="$NDEFS -DHPUX=$os_int"
  737.         ;;
  738.     freebsd)
  739.         if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi
  740.         OS="freebsd${os_r}-$arch"
  741.         os_r1=`echo "$os_r" | cut -d. -f1`
  742.         os_r2=`echo "$os_r" | cut -d. -f2`
  743.         if [ "$os_r2" = "" ] ; then os_r2=0 ; fi
  744.         os_r3=`echo "$os_r" | cut -d. -f3`
  745.         if [ "$os_r3" = "" ] ; then os_r3=0 ; fi
  746.         os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"`
  747.         SYS=freebsd
  748.         NDEFS="$NDEFS -DFREEBSD=$os_int"
  749.         ;;
  750.     netbsd)
  751.         if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi
  752.         OS="netbsd${os_r}-$arch"
  753.         os_r1=`echo "$os_r" | cut -d. -f1`
  754.         os_r2=`echo "$os_r" | cut -d. -f2`
  755.         if [ "$os_r2" = "" ] ; then os_r2=0 ; fi
  756.         os_r3=`echo "$os_r" | cut -d. -f3`
  757.         if [ "$os_r3" = "" ] ; then os_r3=0 ; fi
  758.         os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"`
  759.         NDEFS="$NDEFS -DNETBSD=$os_int"
  760.         SYS=netbsd
  761.         ;;
  762.     openbsd)
  763.         if [ "$arch" = "amd64" ] ; then arch="x86_64" ; fi
  764.         OS="openbsd${os_r}-$arch"
  765.         os_r1=`echo "$os_r" | cut -d. -f1`
  766.         os_r2=`echo "$os_r" | cut -d. -f2`
  767.         if [ "$os_r2" = "" ] ; then os_r2=0 ; fi
  768.         os_r3=`echo "$os_r" | cut -d. -f3`
  769.         if [ "$os_r3" = "" ] ; then os_r3=0 ; fi
  770.         os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"`
  771.         SYS=openbsd
  772.         NDEFS="$NDEFS -DOPENBSD=$os_int"
  773.         ;;
  774.     sco*)
  775.         OS=scosv
  776.         SYS=sco
  777.         os_v1=`echo "$os_v" | cut -d. -f1`
  778.         case "$os_v1" in
  779.             [1-9])
  780.                 os_v2=`echo "$os_v" | cut -d. -f2`
  781.                 if [ "$os_v2" = "" ] ; then os_v2=0 ; fi
  782.                 os_v3=`echo "$os_v" | cut -d. -f3`
  783.                 if [ "$os_v3" = "" ] ; then os_v3=0 ; fi
  784.                 os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"`
  785.                 NDEFS="$NDEFS -DSCO=$os_int"
  786.                 ;;
  787.             *)
  788.                 NDEFS="$NDEFS -DSCO=1"
  789.                 ;;
  790.         esac
  791.         ;;
  792.     dynix*)
  793.         OS="dynixptx${os_v}"
  794.         SYS=dynixptx
  795.         os_v1=`echo "$os_v" | cut -d. -f1`
  796.         os_v2=`echo "$os_v" | cut -d. -f2`
  797.         os_v3=`echo "$os_v" | cut -d. -f3`
  798.         if [ "$os_v3" = "" ] ; then os_v3=0 ; fi
  799.         os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"`
  800.         NDEFS="$NDEFS -DDYNIX=$os_int"
  801.         ;;
  802.     linux)
  803.         case "$arch" in
  804.             *86)
  805.                 arch=x86
  806.                 ;;
  807.         esac
  808.  
  809.         libc=""
  810.         os_r1=`echo "$os_r" | cut -d. -f1`
  811.         os_r2=`echo "$os_r" | cut -d. -f2`
  812.         os_r3=`echo "$os_r" | cut -d- -f1 | cut -d. -f3`
  813.         os_int=`expr "$os_r1" '*' 10000 + "$os_r2" '*' 1000 + "$os_r3"`
  814.         NDEFS="$NDEFS -DLINUX=$os_int"
  815.  
  816.         vertest="./vertest.$$"
  817.         rm -f "$vertest" "$vertest.c"
  818.         cat <<EOF > "$vertest.c"
  819. #include <stdio.h>
  820. #include <gnu/libc-version.h>
  821.  
  822. main()
  823. {
  824.     const char *ver = gnu_get_libc_version();
  825.     const char *rel = gnu_get_libc_release();
  826.  
  827.     fprintf(stdout, "glibc%s\n", ver);
  828.     exit(0);
  829. }
  830. EOF
  831.         echo $ac_n "checking version of C library""... $ac_c" 1>&6
  832.         echo "configure:: checking version of C library" >&5
  833.         ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "$vertest.c" -o "$vertest" >/dev/null 2>&1
  834.         if [ -x "$vertest" ] ; then libc=`$vertest 2>/dev/null` ; fi
  835.         rm -f "$vertest" "$vertest.c"
  836.  
  837.         if [ "$libc" = "" ] ; then
  838.             libc_sysroot=`"${CC-gcc}" -v 2>&1 | sed -n '/with-libc_sysroot/{s/^.*--with-libc_sysroot=//;s/ .*//;p;q;}'`    # Only results in non-empty with a GCC cross-compiler
  839.  
  840.             libc_file=`/bin/ls -1 -t "${libc_sysroot}"/lib/libc.so.* 2>/dev/null | sed -n 1,1p`
  841.             if [ "$libc_file" != "" ] ; then
  842.                 libc_file=`echo "$libc_file" | sed 's|^.*/||'`
  843.                 libc_file="$libc_sysroot/lib/$libc_file"
  844.             elif [ -f "$libc_sysroot/usr/lib/libc.a" ] ; then
  845.                 libc_file="$libc_sysroot/usr/lib/libc.a"
  846.             else
  847.                 libc_file="/error"
  848.             fi
  849.  
  850.             libc=`strings -n 40 "$libc_file" 2>/dev/null | fgrep 'GNU C Library' | sed 's/^.*version //;s/[^0-9\.].*$//;' | sed -n 1,1p`
  851.  
  852.             if [ "$libc" != "" ] ; then
  853.                 libc="glibc${libc}"
  854.             fi
  855.         fi
  856.  
  857.         case "$libc" in
  858.             glibc*)
  859.                 echo "$libc" 1>&6
  860.                 glibc_r=`echo "$libc" | sed 's/glibc//'`
  861.                 glibc_r1=`echo "$glibc_r" | cut -d. -f1`
  862.                 glibc_r2=`echo "$glibc_r" | cut -d. -f2`
  863.                 glibc_r3=`echo "$glibc_r" | cut -d- -f1 | cut -d. -f3`
  864.                 if test "$glibc_r1" = "" ; then glibc_r1=0 ; fi
  865.                 if test "$glibc_r2" = "" ; then glibc_r2=0 ; fi
  866.                 if test "$glibc_r3" = "" ; then glibc_r3=0 ; fi
  867.                 glibc_int=`expr "$glibc_r1" '*' 10000 + "$glibc_r2" '*' 1000 + "$glibc_r3"`
  868.                 NDEFS="$NDEFS -DLINUX_GLIBC=$glibc_int"
  869.                 libc="glibc${glibc_r1}.${glibc_r2}"
  870.                 OS="linux-$arch"
  871.                 ;;
  872.             *)
  873.                 if test -f /lib/libc-2.1.3.so ; then
  874.                     NDEFS="$NDEFS -DLINUX_GLIBC=21003"
  875.                     libc="glibc2.1"
  876.                     OS="linux-$arch"
  877.                 elif test -f /lib/libc-2.1.2.so ; then
  878.                     NDEFS="$NDEFS -DLINUX_GLIBC=21002"
  879.                     libc="glibc2.1"
  880.                     OS="linux-$arch"
  881.                 elif test -f /lib/libc-2.1.1.so ; then
  882.                     NDEFS="$NDEFS -DLINUX_GLIBC=21001"
  883.                     libc="glibc2.1"
  884.                     OS="linux-$arch"
  885.                 elif test -f /lib/libc.so.6 ; then
  886.                     NDEFS="$NDEFS -DLINUX_GLIBC=20000"
  887.                     libc="glibc2.0"
  888.                     OS="linux-$arch"
  889.                 elif test -f /lib/libc.so.6.1 ; then
  890.                     NDEFS="$NDEFS -DLINUX_GLIBC=20001"
  891.                     libc="glibc2.0"
  892.                     OS="linux-$arch"
  893.                 else
  894.                     NDEFS="$NDEFS -DLINUX_LIBC=5"
  895.                     libc="libc5"
  896.                     OS="linux-$arch"
  897.                 fi
  898.                 echo "$libc" 1>&6
  899.                 ;;
  900.         esac
  901.         SYS=linux
  902.         ;;
  903.     bsd/os)
  904.         OS="bsdos${os_r}"
  905.         SYS=bsdos
  906.         NDEFS="$NDEFS -DBSDOS=$os_r1"
  907.         ;;
  908.     ultrix)
  909.         OS="ultrix-$arch"
  910.         SYS=ultrix
  911.         NDEFS="$NDEFS -DULTRIX"
  912.         ;;
  913.     unixware)
  914.         OS="unixware${os_v}"
  915.         SYS=unixware
  916.         os_v1=`echo "$os_v" | cut -d. -f1`
  917.         case "$os_v1" in
  918.             [1-9])
  919.                 os_v2=`echo "$os_v" | cut -d. -f2`
  920.                 os_v3=`echo "$os_v" | cut -d. -f3`
  921.                 if [ "$os_v3" = "" ] ; then os_v3=0 ; fi
  922.                 os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"`
  923.                 NDEFS="$NDEFS -DUNIXWARE=$os_int"
  924.                 ;;
  925.             *)
  926.                 NDEFS="$NDEFS -DUNIXWARE=1"
  927.                 ;;
  928.         esac
  929.         ;;
  930.     openunix)
  931.         OS="openunix${os_v}"
  932.         SYS=openunix
  933.         os_v1=`echo "$os_v" | cut -d. -f1`
  934.         os_v2=`echo "$os_v" | cut -d. -f2`
  935.         os_v3=`echo "$os_v" | cut -d. -f3`
  936.         if [ "$os_v3" = "" ] ; then os_v3=0 ; fi
  937.         os_int=`expr "$os_v1" '*' 100 + "$os_v2" '*' 10 + "$os_v3"`
  938.         NDEFS="$NDEFS -DOPENUNIX=$os_int -DUNIXWARE=$os_int"
  939.         ;;
  940.     macos*|darwin|rhapsody)
  941.         OS="macosx"
  942.         SYS="macosx"
  943.         os_v=`perl -e '{open(F, "< /System/Library/CoreServices/SystemVersion.plist") or exit(2); my ($doc) = ""; my ($line); while (defined($line = <F>)) { $doc .= $line; } close(F); $doc =~ s/\s+//gs; if ($doc =~ /<key>ProductVersion<\/key><string>([^<]+)<\/string>/) { print , "\n"; exit(0); } exit(1); }' 2>/dev/null`
  944.         if [ "$os_v" = "" ] && [ -x "$HOME/bin/macosver" ] ; then
  945.             os_v=`"$HOME/bin/macosver" 2>/dev/null`
  946.         fi
  947.         if [ "$os_v" = "" ] ; then
  948.             cat > "$HOME/macosver.c" <<EOF
  949. /*
  950. <?xml version="1.0" encoding="UTF-8"?>
  951. <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
  952. <plist version="0.9">
  953. <dict>
  954.     <key>ProductBuildVersion</key>
  955.     <string>5S66</string>
  956.     <key>ProductName</key>
  957.     <string>Mac OS X</string>
  958.     <key>ProductVersion</key>
  959.     <string>10.1.5</string>
  960. </dict>
  961. </plist>
  962. */
  963.  
  964. #include <stdio.h>
  965. #include <string.h>
  966. #include <stdlib.h>
  967. #include <ctype.h>
  968.  
  969. main()
  970. {
  971.     char line[256], *cp, *cp2; 
  972.     FILE *fp;
  973.  
  974.     fp = fopen("/System/Library/CoreServices/SystemVersion.plist", "r");
  975.  
  976.     if (fp != NULL) {
  977.         memset(line, 0, sizeof(line));
  978.         while (fgets(line, sizeof(line) - 1, fp) != NULL) {
  979.             cp = strstr(line, "<key>ProductVersion</key>");
  980.             if (cp != NULL) {
  981.                 memset(line, 0, sizeof(line));
  982.                 if (fgets(line, sizeof(line) - 2, fp) != NULL) {
  983.                     for (cp = line; ((*cp != '\0') && (! isdigit(*cp))); ) cp++;
  984.                     for (cp2 = cp; ((*cp2 != '\0') && (! isspace(*cp2)) && (*cp2 != '<') && (*cp2 != '>')); ) cp2++;
  985.                     cp2[0] = '\0';
  986.                     fclose(fp);
  987.                     fprintf(stdout, "%s\n", cp);
  988.                     exit(0);
  989.                 }
  990.             }
  991.         }
  992.     }
  993.     fclose(fp);
  994.     exit(1);
  995. }
  996. EOF
  997.             ${CC-cc} "$HOME/macosver.c" -o "$HOME/macosver" > /dev/null 2>&1
  998.             os_v=`"$HOME/macosver" 2>/dev/null`
  999.             mv "$HOME/macosver" "$HOME/bin/macosver" 2>/dev/null
  1000.             rm -f "$HOME/macosver.c" "$HOME/macosver"
  1001.         fi
  1002.         if [ "$os_v" != "" ] ; then
  1003.             OS="macosx${os_v}"
  1004.             os_v1=`echo "$os_v" | cut -d. -f1`
  1005.             os_v2=`echo "$os_v" | cut -d. -f2`
  1006.             os_v3=`echo "$os_v" | cut -d. -f3`
  1007.             if [ "$os_v3" = "" ] ; then os_v3=0 ; fi
  1008.             os_int=`expr "$os_v1" '*' 1000 + "$os_v2" '*' 100 + "$os_v3"`
  1009.             NDEFS="$NDEFS -DMACOSX=$os_int"
  1010.         else
  1011.             NDEFS="$NDEFS -DMACOSX"
  1012.         fi
  1013.         ;;
  1014.     sunos)
  1015.         if [ "$arch" = "" ] ; then arch="sparc" ; fi
  1016.         if [ "$archp" = "" ] ; then archp="$arch" ; fi
  1017.         case "$os_r" in
  1018.             5.*)
  1019.                 case "$os_r" in
  1020.                     5.[023456]*|5.1)
  1021.                         os_r=`echo "$os_r" | sed 's/^5/2/;'`
  1022.                         os_r1=`echo "$os_r" | cut -d. -f1`
  1023.                         os_r2=`echo "$os_r" | cut -d. -f2`
  1024.                         if [ "$os_r2" = "" ] ; then os_r2=0 ; fi
  1025.                         os_r3=`echo "$os_r" | cut -d. -f3`
  1026.                         if [ "$os_r3" = "" ] ; then os_r3=0 ; fi
  1027.                         os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"`
  1028.                         ;;
  1029.                     5.[789]*|5.1[0-9]*)
  1030.                         os_r1=`echo "$os_r" | cut -d. -f2`
  1031.                         os_r2=`echo "$os_r" | cut -d. -f3`
  1032.                         if [ "$os_r2" = "" ] ; then os_r2=0 ; fi
  1033.                         os_r3=`echo "$os_r" | cut -d. -f4`
  1034.                         if [ "$os_r3" = "" ] ; then os_r3=0 ; fi
  1035.                         os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"`
  1036.                         os_r=`echo "$os_r" | cut -c3-`
  1037.                         ;;
  1038.                 esac
  1039.                 case "`/usr/bin/isainfo -n 2>/dev/null`" in
  1040.                     amd64)
  1041.                         OS="solaris${os_r}-x86_64"
  1042.                         ;;
  1043.                     *86)
  1044.                         OS="solaris${os_r}-x86"
  1045.                         ;;
  1046.                     sparcv9*|sparcv1[0-9]*)
  1047.                         OS="solaris${os_r}-sparc64"
  1048.                         ;;
  1049.                     *)
  1050.                         OS="solaris${os_r}-$archp"
  1051.                         ;;
  1052.                 esac
  1053.                 NDEFS="$NDEFS -DSOLARIS=$os_int"
  1054.                 SYS=solaris
  1055.                 ;;
  1056.             4.*)
  1057.                 OS="sunos${os_r}-sparc"
  1058.                 NDEFS="$NDEFS -DSUNOS=\\\"$os_r\\\""
  1059.                 SYS=sunos
  1060.                 ;;
  1061.             *)
  1062.                 os_r1=`echo "$os_r" | cut -d. -f1`
  1063.                 if [ "$os_r1" = "" ] ; then os_r1=0 ; fi
  1064.                 os_r2=`echo "$os_r" | cut -d. -f2`
  1065.                 if [ "$os_r2" = "" ] ; then os_r2=0 ; fi
  1066.                 os_r3=`echo "$os_r" | cut -d. -f3`
  1067.                 if [ "$os_r3" = "" ] ; then os_r3=0 ; fi
  1068.                 os_int=`expr "$os_r1" '*' 100 + "$os_r2" '*' 10 + "$os_r3"`
  1069.                 OS="solaris${os_r}-$archp"
  1070.                 NDEFS="$NDEFS -DSOLARIS=$os_int"
  1071.                 SYS=solaris
  1072.                 ;;
  1073.         esac
  1074.         ;;
  1075.     *)
  1076.         OS="$os"
  1077.         SYS="$os"
  1078.  
  1079.         if grep Novell /usr/include/sys/types.h ; then
  1080.             OS="unixware${os_v}"
  1081.             SYS="unixware"
  1082.         fi
  1083.         ;;
  1084. esac
  1085.  
  1086. if [ "x$wi_cv_OS" != "x" ] && [ "$wi_cv_OS" != "$OS" ] ; then
  1087.  
  1088.     { echo "configure: error: Your config.cache file is invalid.  It was created on $wi_cv_OS, but this machine is running $OS.  Remove the config.cache file if you wish to continue." 1>&2; exit 1; }
  1089. fi
  1090. wi_cv_OS="$OS"
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097. echo $ac_n "checking platform""... $ac_c" 1>&6
  1098. echo "configure:1099: checking platform" >&5
  1099. echo "$ac_t"""$OS"" 1>&6
  1100.  
  1101.  
  1102. case "$os" in
  1103.     linux)
  1104.         OS="linux-$arch-$libc"
  1105.         ;;
  1106. esac
  1107.  
  1108. if test -f sh/install-sh ; then chmod 755 sh/*.sh sh/config.* sh/install-sh ; fi
  1109. ac_aux_dir=
  1110. for ac_dir in sh $srcdir/sh; do
  1111.   if test -f $ac_dir/install-sh; then
  1112.     ac_aux_dir=$ac_dir
  1113.     ac_install_sh="$ac_aux_dir/install-sh -c"
  1114.     break
  1115.   elif test -f $ac_dir/install.sh; then
  1116.     ac_aux_dir=$ac_dir
  1117.     ac_install_sh="$ac_aux_dir/install.sh -c"
  1118.     break
  1119.   fi
  1120. done
  1121. if test -z "$ac_aux_dir"; then
  1122.   { echo "configure: error: can not find install-sh or install.sh in sh $srcdir/sh" 1>&2; exit 1; }
  1123. fi
  1124. ac_config_guess=$ac_aux_dir/config.guess
  1125. ac_config_sub=$ac_aux_dir/config.sub
  1126. ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
  1127.  
  1128. # Extract the first word of "gcc", so it can be a program name with args.
  1129. set dummy gcc; ac_word=$2
  1130. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  1131. echo "configure:1132: checking for $ac_word" >&5
  1132. if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  1133.   echo $ac_n "(cached) $ac_c" 1>&6
  1134. else
  1135.   if test -n "$CC"; then
  1136.   ac_cv_prog_CC="$CC" # Let the user override the test.
  1137. else
  1138.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  1139.   ac_dummy="$PATH"
  1140.   for ac_dir in $ac_dummy; do
  1141.     test -z "$ac_dir" && ac_dir=.
  1142.     if test -f $ac_dir/$ac_word; then
  1143.       ac_cv_prog_CC="gcc"
  1144.       break
  1145.     fi
  1146.   done
  1147.   IFS="$ac_save_ifs"
  1148. fi
  1149. fi
  1150. CC="$ac_cv_prog_CC"
  1151. if test -n "$CC"; then
  1152.   echo "$ac_t""$CC" 1>&6
  1153. else
  1154.   echo "$ac_t""no" 1>&6
  1155. fi
  1156.  
  1157. if test -z "$CC"; then
  1158.   # Extract the first word of "cc", so it can be a program name with args.
  1159. set dummy cc; ac_word=$2
  1160. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  1161. echo "configure:1162: checking for $ac_word" >&5
  1162. if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  1163.   echo $ac_n "(cached) $ac_c" 1>&6
  1164. else
  1165.   if test -n "$CC"; then
  1166.   ac_cv_prog_CC="$CC" # Let the user override the test.
  1167. else
  1168.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  1169.   ac_prog_rejected=no
  1170.   ac_dummy="$PATH"
  1171.   for ac_dir in $ac_dummy; do
  1172.     test -z "$ac_dir" && ac_dir=.
  1173.     if test -f $ac_dir/$ac_word; then
  1174.       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
  1175.         ac_prog_rejected=yes
  1176.     continue
  1177.       fi
  1178.       ac_cv_prog_CC="cc"
  1179.       break
  1180.     fi
  1181.   done
  1182.   IFS="$ac_save_ifs"
  1183. if test $ac_prog_rejected = yes; then
  1184.   # We found a bogon in the path, so make sure we never use it.
  1185.   set dummy $ac_cv_prog_CC
  1186.   shift
  1187.   if test $# -gt 0; then
  1188.     # We chose a different compiler from the bogus one.
  1189.     # However, it has the same basename, so the bogon will be chosen
  1190.     # first if we set CC to just the basename; use the full file name.
  1191.     shift
  1192.     set dummy "$ac_dir/$ac_word" "$@"
  1193.     shift
  1194.     ac_cv_prog_CC="$@"
  1195.   fi
  1196. fi
  1197. fi
  1198. fi
  1199. CC="$ac_cv_prog_CC"
  1200. if test -n "$CC"; then
  1201.   echo "$ac_t""$CC" 1>&6
  1202. else
  1203.   echo "$ac_t""no" 1>&6
  1204. fi
  1205.  
  1206.   if test -z "$CC"; then
  1207.     case "`uname -s`" in
  1208.     *win32* | *WIN32*)
  1209.       # Extract the first word of "cl", so it can be a program name with args.
  1210. set dummy cl; ac_word=$2
  1211. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  1212. echo "configure:1213: checking for $ac_word" >&5
  1213. if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
  1214.   echo $ac_n "(cached) $ac_c" 1>&6
  1215. else
  1216.   if test -n "$CC"; then
  1217.   ac_cv_prog_CC="$CC" # Let the user override the test.
  1218. else
  1219.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  1220.   ac_dummy="$PATH"
  1221.   for ac_dir in $ac_dummy; do
  1222.     test -z "$ac_dir" && ac_dir=.
  1223.     if test -f $ac_dir/$ac_word; then
  1224.       ac_cv_prog_CC="cl"
  1225.       break
  1226.     fi
  1227.   done
  1228.   IFS="$ac_save_ifs"
  1229. fi
  1230. fi
  1231. CC="$ac_cv_prog_CC"
  1232. if test -n "$CC"; then
  1233.   echo "$ac_t""$CC" 1>&6
  1234. else
  1235.   echo "$ac_t""no" 1>&6
  1236. fi
  1237.  ;;
  1238.     esac
  1239.   fi
  1240.   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
  1241. fi
  1242.  
  1243. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
  1244. echo "configure:1245: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
  1245.  
  1246. ac_ext=c
  1247. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  1248. ac_cpp='$CPP $CPPFLAGS'
  1249. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
  1250. ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
  1251. cross_compiling=$ac_cv_prog_cc_cross
  1252.  
  1253. cat > conftest.$ac_ext << EOF
  1254.  
  1255. #line 1256 "configure"
  1256. #include "confdefs.h"
  1257.  
  1258. main(){return(0);}
  1259. EOF
  1260. if { (eval echo configure:1261: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  1261.   ac_cv_prog_cc_works=yes
  1262.   # If we can't run a trivial program, we are probably using a cross compiler.
  1263.   if (./conftest; exit) 2>/dev/null; then
  1264.     ac_cv_prog_cc_cross=no
  1265.   else
  1266.     ac_cv_prog_cc_cross=yes
  1267.   fi
  1268. else
  1269.   echo "configure: failed program was:" >&5
  1270.   cat conftest.$ac_ext >&5
  1271.   ac_cv_prog_cc_works=no
  1272. fi
  1273. rm -fr conftest*
  1274. ac_ext=c
  1275. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  1276. ac_cpp='$CPP $CPPFLAGS'
  1277. ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
  1278. ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
  1279. cross_compiling=$ac_cv_prog_cc_cross
  1280.  
  1281. echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
  1282. if test $ac_cv_prog_cc_works = no; then
  1283.   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
  1284. fi
  1285. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
  1286. echo "configure:1287: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
  1287. echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
  1288. cross_compiling=$ac_cv_prog_cc_cross
  1289.  
  1290. echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
  1291. echo "configure:1292: checking whether we are using GNU C" >&5
  1292. if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
  1293.   echo $ac_n "(cached) $ac_c" 1>&6
  1294. else
  1295.   cat > conftest.c <<EOF
  1296. #ifdef __GNUC__
  1297.   yes;
  1298. #endif
  1299. EOF
  1300. if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  1301.   ac_cv_prog_gcc=yes
  1302. else
  1303.   ac_cv_prog_gcc=no
  1304. fi
  1305. fi
  1306.  
  1307. echo "$ac_t""$ac_cv_prog_gcc" 1>&6
  1308.  
  1309. if test $ac_cv_prog_gcc = yes; then
  1310.   GCC=yes
  1311. else
  1312.   GCC=
  1313. fi
  1314.  
  1315. ac_test_CFLAGS="${CFLAGS+set}"
  1316. ac_save_CFLAGS="$CFLAGS"
  1317. CFLAGS=
  1318. echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
  1319. echo "configure:1320: checking whether ${CC-cc} accepts -g" >&5
  1320. if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
  1321.   echo $ac_n "(cached) $ac_c" 1>&6
  1322. else
  1323.   echo 'void f(){}' > conftest.c
  1324. if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
  1325.   ac_cv_prog_cc_g=yes
  1326. else
  1327.   ac_cv_prog_cc_g=no
  1328. fi
  1329. rm -rf conftest*
  1330.  
  1331. fi
  1332.  
  1333. echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
  1334. if test "$ac_test_CFLAGS" = set; then
  1335.   CFLAGS="$ac_save_CFLAGS"
  1336. elif test $ac_cv_prog_cc_g = yes; then
  1337.   if test "$GCC" = yes; then
  1338.     CFLAGS="-g -O2"
  1339.   else
  1340.     CFLAGS="-g"
  1341.   fi
  1342. else
  1343.   if test "$GCC" = yes; then
  1344.     CFLAGS="-O2"
  1345.   else
  1346.     CFLAGS=
  1347.   fi
  1348. fi
  1349.  
  1350.  
  1351. echo $ac_n "checking if the C compiler can use precompiled headers""... $ac_c" 1>&6
  1352. echo "configure:1353: checking if the C compiler can use precompiled headers" >&5
  1353. if eval "test \"`echo '$''{'wi_cv_cc_precomp'+set}'`\" = set"; then
  1354.   echo $ac_n "(cached) $ac_c" 1>&6
  1355. else
  1356.   
  1357.     result="no"
  1358.     if test "${use_macosx_universal}" != no ; then
  1359.         # Precompiling the headers doesn't seem to work when building universal binaries
  1360.         use_precomp=no
  1361.     fi
  1362.     if test "${use_precomp-yes}" != no ; then
  1363.         wi_cv_cc_precomp_type="unknown"
  1364.         rm -f pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.h.gch
  1365.         cat <<EOF > pchtest.h
  1366. /* pchtest.h */
  1367. #include <stdio.h>
  1368. #include <string.h>
  1369. #include <stdlib.h>
  1370. #define FOOBAR 33    /* Make sure it can compile custom headers too */
  1371. EOF
  1372.         cat <<EOF > pchtest.c
  1373. /* pchtest.c */
  1374. #include "pchtest.h"
  1375.  
  1376. int main(int argc, char **argv)
  1377. {
  1378.     if (FOOBAR == 33)
  1379.         exit(0);
  1380.     exit(1);
  1381. }
  1382. EOF
  1383.         if test "$GCC" = yes ; then
  1384.             #
  1385.             # Try gcc 3.4's built-in implementation first
  1386.             #
  1387.             echo ${CC-cc} $CPPFLAGS pchtest.h -c >&5
  1388.             ${CC-cc} $CPPFLAGS pchtest.h -c >&5 2>&5
  1389.             if test -f pchtest.h.gch ; then
  1390.                 #
  1391.                 # Good, the .gch file was created.
  1392.                 # Odds are we're good to go.
  1393.                 #
  1394.                 echo "Successfully compiled pchtest.h into the precompiled header file pchtest.h.gch." >&5
  1395.                 cat > conftest.$ac_ext <<EOF
  1396. #line 1397 "configure"
  1397. #include "confdefs.h"
  1398. #include "pchtest.h"
  1399. int main() {
  1400. if (FOOBAR == 33) exit(0)
  1401. ; return 0; }
  1402. EOF
  1403. if { (eval echo configure:1404: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  1404.   rm -rf conftest*
  1405.   result="yes" ; wi_cv_cc_precomp_type="gcc_gch_files"
  1406. else
  1407.   echo "configure: failed program was:" >&5
  1408.   cat conftest.$ac_ext >&5
  1409.   rm -rf conftest*
  1410.   result="no"
  1411. fi
  1412. rm -rf conftest*
  1413.             else
  1414.                 echo "This version of GCC did not compile pchtest.h into the precompiled header file pchtest.h.gch." >&5
  1415.                 #
  1416.                 # See if Apple's implementation works.
  1417.                 #
  1418.                 echo ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 
  1419.                 ${CC-cc} $CPPFLAGS -precomp pchtest.h -o pchtest.p >&5 2>&5
  1420.                 if test -s pchtest.p ; then
  1421.                     cat > conftest.$ac_ext <<EOF
  1422. #line 1423 "configure"
  1423. #include "confdefs.h"
  1424. #include "pchtest.h"
  1425. int main() {
  1426. if (FOOBAR == 33) exit(0)
  1427. ; return 0; }
  1428. EOF
  1429. if { (eval echo configure:1430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  1430.   rm -rf conftest*
  1431.   result="yes" ; wi_cv_cc_precomp_type="gcc_dash_precomp"
  1432. else
  1433.   echo "configure: failed program was:" >&5
  1434.   cat conftest.$ac_ext >&5
  1435.   rm -rf conftest*
  1436.   result="no"
  1437. fi
  1438. rm -rf conftest*
  1439.                 fi
  1440.             fi
  1441.         elif test "${result}_${SYS-aix}_${GCC}" = "no_aix_no" ; then
  1442.             #
  1443.             # AIX xlc
  1444.             #
  1445.             echo ${CC-cc} $CPPFLAGS -qusepcomp -qgenpcomp pchtest.c -o pchtest >&5
  1446.             ${CC-cc} $CPPFLAGS -qusepcomp -qgenpcomp pchtest.c -o pchtest >&5 2>&5
  1447.             if test -s pchtest ; then
  1448.                 result="yes"
  1449.                 wi_cv_cc_precomp_type="xlc"
  1450.                 wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER -qusepcomp -qgenpcomp"
  1451.             fi
  1452.         else
  1453.             #
  1454.             # IRIX, Compaq C, Sun C
  1455.             #
  1456.             cat <<EOF > pchtest.c
  1457. #include "pchtest.h"
  1458. #pragma hdrstop
  1459. #include <stdarg.h>
  1460.  
  1461. int main(int argc, char **argv)
  1462. {
  1463.     if (FOOBAR == 33)
  1464.         exit(0);
  1465.     exit(1);
  1466. }
  1467. EOF
  1468.             for pchflags in "-xpch=auto" "-pch -no_pch_messages" "-pch" "-LANG:pch"
  1469.             do
  1470.                 rm -rf SunWS_cache pchtest.pch pchtest.cpch
  1471.                 echo ${CC-cc} $CPPFLAGS $pchflags pchtest.c -o pchtest >&5
  1472.                 ${CC-cc} $CPPFLAGS $pchflags pchtest.c -o pchtest >&5 2>&5
  1473.                 if test -f pchtest.pch ; then
  1474.                     result="yes"
  1475.                     wi_cv_cc_precomp_type="ccc"
  1476.                     wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER $pchflags"
  1477.                     cat >> confdefs.h <<\EOF
  1478. #define PRAGMA_HDRSTOP 1
  1479. EOF
  1480.  
  1481.                     break
  1482.                 elif test -d SunWS_cache ; then
  1483.                     result="yes"
  1484.                     wi_cv_cc_precomp_type="SunWS"
  1485.                     wi_CFLAGS_TO_ADD_LATER="$wi_CFLAGS_TO_ADD_LATER $pchflags -erroff=E_PCH_CONDITIONAL_PREFIX"
  1486.                     cat >> confdefs.h <<\EOF
  1487. #define PRAGMA_HDRSTOP 1
  1488. EOF
  1489.  
  1490.                     break
  1491.                 fi
  1492.             done
  1493.             unset pchflags
  1494.         fi
  1495.         rm -rf SunWS_cache pchtest.h pchtest.p pchtest.c pchtest.o pchtest csetc.pch pchtest.pch pchtest.cpch pchtest.h.gch
  1496.     fi
  1497.     wi_cv_cc_precomp="$result"
  1498.  
  1499. fi
  1500.  
  1501. echo "$ac_t""$wi_cv_cc_precomp" 1>&6
  1502.  
  1503.  
  1504.     wi_request_no_y2k_warnings=yes
  1505.  
  1506. echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
  1507. echo "configure:1508: checking how to run the C preprocessor" >&5
  1508. # On Suns, sometimes $CPP names a directory.
  1509. if test -n "$CPP" && test -d "$CPP"; then
  1510.   CPP=
  1511. fi
  1512. if test -z "$CPP"; then
  1513. if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
  1514.   echo $ac_n "(cached) $ac_c" 1>&6
  1515. else
  1516.     # This must be in double quotes, not single quotes, because CPP may get
  1517.   # substituted into the Makefile and "${CC-cc}" will confuse make.
  1518.   CPP="${CC-cc} -E"
  1519.   # On the NeXT, cc -E runs the code through the compiler's parser,
  1520.   # not just through cpp.
  1521.   cat > conftest.$ac_ext <<EOF
  1522. #line 1523 "configure"
  1523. #include "confdefs.h"
  1524. #include <assert.h>
  1525. Syntax Error
  1526. EOF
  1527. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1528. { (eval echo configure:1529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  1529. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  1530. if test -z "$ac_err"; then
  1531.   :
  1532. else
  1533.   echo "$ac_err" >&5
  1534.   echo "configure: failed program was:" >&5
  1535.   cat conftest.$ac_ext >&5
  1536.   rm -rf conftest*
  1537.   CPP="${CC-cc} -E -traditional-cpp"
  1538.   cat > conftest.$ac_ext <<EOF
  1539. #line 1540 "configure"
  1540. #include "confdefs.h"
  1541. #include <assert.h>
  1542. Syntax Error
  1543. EOF
  1544. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1545. { (eval echo configure:1546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  1546. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  1547. if test -z "$ac_err"; then
  1548.   :
  1549. else
  1550.   echo "$ac_err" >&5
  1551.   echo "configure: failed program was:" >&5
  1552.   cat conftest.$ac_ext >&5
  1553.   rm -rf conftest*
  1554.   CPP="${CC-cc} -nologo -E"
  1555.   cat > conftest.$ac_ext <<EOF
  1556. #line 1557 "configure"
  1557. #include "confdefs.h"
  1558. #include <assert.h>
  1559. Syntax Error
  1560. EOF
  1561. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1562. { (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  1563. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  1564. if test -z "$ac_err"; then
  1565.   :
  1566. else
  1567.   echo "$ac_err" >&5
  1568.   echo "configure: failed program was:" >&5
  1569.   cat conftest.$ac_ext >&5
  1570.   rm -rf conftest*
  1571.   CPP=/lib/cpp
  1572. fi
  1573. rm -rf conftest*
  1574. fi
  1575. rm -rf conftest*
  1576. fi
  1577. rm -rf conftest*
  1578.   ac_cv_prog_CPP="$CPP"
  1579. fi
  1580.   CPP="$ac_cv_prog_CPP"
  1581. else
  1582.   ac_cv_prog_CPP="$CPP"
  1583. fi
  1584. echo "$ac_t""$CPP" 1>&6
  1585.  
  1586.  
  1587.  
  1588.  
  1589.     
  1590.  
  1591. if test "$GCC" = yes ; then
  1592.     echo $ac_n "checking the version of GCC""... $ac_c" 1>&6
  1593. echo "configure:1594: checking the version of GCC" >&5
  1594. if eval "test \"`echo '$''{'wi_cv_gcc_version'+set}'`\" = set"; then
  1595.   echo $ac_n "(cached) $ac_c" 1>&6
  1596. else
  1597.   
  1598.     wi_cv_gcc_version=`$CC -v 2>&1 | sed -n '/gcc version/{s/^.*gcc version//;s/^[^1-9]*//;s/\ .*//;p;q;}'`
  1599.  
  1600. fi
  1601.  
  1602. echo "$ac_t""$wi_cv_gcc_version" 1>&6
  1603. else
  1604.     wi_cv_gcc_version="0"
  1605. fi
  1606.  
  1607.     
  1608.     
  1609.  
  1610. if test "${SYS}_${GCC}" != solaris_no ; then
  1611.     wi_cv_cc_is_sunwspro_cc="no"
  1612.     wi_cv_sunwspro_cc_version="0"
  1613.     wi_cv_sunwspro_cc_version2="0"
  1614. else
  1615.     echo $ac_n "checking if the C compiler is Sun WorkShop C""... $ac_c" 1>&6
  1616. echo "configure:1617: checking if the C compiler is Sun WorkShop C" >&5
  1617. if eval "test \"`echo '$''{'wi_cv_cc_is_sunwspro_cc'+set}'`\" = set"; then
  1618.   echo $ac_n "(cached) $ac_c" 1>&6
  1619. else
  1620.   
  1621. #
  1622. # cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
  1623. # usage: cc [ options] files.  Use 'cc -flags' for details
  1624. #
  1625. # cc: WorkShop Compilers 4.2 30 Oct 1996 C 4.2
  1626. # usage: cc [ options] files.  Use 'cc -flags' for details
  1627. #
  1628.         wi_cv_sunwspro_cc_version=`$CC -V 2>&1 | sed -n '/WorkShop.*C\ [1-9]/{s/^.*C/C/;s/^C\ \([^\ ]*\).*/\1/;p;q;}'`
  1629.         case "$wi_cv_sunwspro_cc_version" in
  1630.             [1-9]*)
  1631.                 wi_cv_cc_is_sunwspro_cc="yes"
  1632.                 ver1=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f1`
  1633.                 ver2=`echo "$wi_cv_sunwspro_cc_version" | cut -d. -f2`
  1634.                 ver3=0
  1635.                 wi_cv_sunwspro_cc_version2=`expr "$ver1" '*' 100 + "$ver2" "*" 10 + "$ver3"`
  1636.                 unset ver1 ver2 ver3
  1637.                 ;;
  1638.             *)
  1639.                 wi_cv_cc_is_sunwspro_cc="no"
  1640.                 wi_cv_sunwspro_cc_version="0"
  1641.                 wi_cv_sunwspro_cc_version2="0"
  1642.                 ;;
  1643.         esac
  1644.     
  1645. fi
  1646.  
  1647. echo "$ac_t""$wi_cv_cc_is_sunwspro_cc" 1>&6
  1648.     if test "$wi_cv_cc_is_sunwspro_cc" = yes ; then
  1649.         echo $ac_n "checking output of "cc -V" to determine version of Sun WorkShop C""... $ac_c" 1>&6
  1650. echo "configure:1651: checking output of "cc -V" to determine version of Sun WorkShop C" >&5
  1651.         echo "$ac_t"""version $wi_cv_sunwspro_cc_version"" 1>&6
  1652.     fi
  1653. fi
  1654.  
  1655.     
  1656. echo $ac_n "checking if we should customize your CFLAGS environment variable""... $ac_c" 1>&6
  1657. echo "configure:1658: checking if we should customize your CFLAGS environment variable" >&5
  1658. wi_replace_O_with_g="no"
  1659. case "$wi_orig_CFLAGS" in
  1660.     "")
  1661.         wi_replace_O_with_g="no"
  1662.         ;;
  1663.     "-g -O2")
  1664.         wi_replace_O_with_g="no"
  1665.         ;;
  1666.     "-g -O")
  1667.         wi_replace_O_with_g="no"
  1668.         ;;
  1669.     "-O2 -g")
  1670.         wi_replace_O_with_g="no"
  1671.         ;;
  1672.     "-O -g")
  1673.         wi_replace_O_with_g="no"
  1674.         ;;
  1675.     -g)
  1676.         wi_replace_O_with_g="yes"
  1677.         ;;
  1678. esac
  1679.  
  1680. #
  1681. # See if your CFLAGS environment variable wasn't set or exported,
  1682. # or if you are using a conservative default.  If so, we will
  1683. # add some additional flags for better performance, warning reporting,
  1684. # etc.
  1685. #
  1686. # Note we are now checking the current value of CFLAGS, which may have
  1687. # been changed by configure.
  1688. #
  1689. wi_os_default_cflags="no"
  1690. case "$CFLAGS" in
  1691.     "")
  1692.         wi_os_default_cflags="yes"
  1693.         ;;
  1694.     "-g -O2")
  1695.         wi_os_default_cflags="yes"
  1696.         ;;
  1697.     "-g -O")
  1698.         wi_os_default_cflags="yes"
  1699.         ;;
  1700.     "-O2 -g")
  1701.         wi_os_default_cflags="yes"
  1702.         ;;
  1703.     "-O -g")
  1704.         wi_os_default_cflags="yes"
  1705.         ;;
  1706.     -g)
  1707.         wi_os_default_cflags="yes"
  1708.         ;;
  1709.     -O)
  1710.         wi_os_default_cflags="yes"
  1711.         ;;
  1712.     -O2)
  1713.         wi_os_default_cflags="yes"
  1714.         ;;
  1715. esac
  1716.  
  1717. if test "$wi_os_default_cflags" = yes ; then
  1718.     if test "$GCC" = yes ; then
  1719.         #
  1720.         # gcc
  1721.         #
  1722.         wi_gcc_optimizer_flags=''
  1723.         case "$wi_cv_gcc_version" in
  1724.             2.7.*|2.8.*|2.9*)
  1725.                 wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline"
  1726.                 ;;
  1727.             3.*)
  1728.                 wi_os_default_cflags="-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wbad-function-cast -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Winline -Wmissing-format-attribute -Wformat-security"
  1729.                 wi_gcc_optimizer_flags='-Wdisabled-optimization'
  1730.                 ;;
  1731.             *)
  1732.                 wi_os_default_cflags="-W -Wall"
  1733.                 ;;
  1734.         esac
  1735.         if test "$wi_replace_O_with_g" = yes ; then
  1736.             wi_os_default_cflags="-g $wi_os_default_cflags"
  1737.         else
  1738.             wi_os_default_cflags="-O2 $wi_os_default_cflags"
  1739.             if test "$wi_gcc_optimizer_flags" != "" ; then
  1740.                 wi_os_default_cflags="$wi_os_default_cflags $wi_gcc_optimizer_flags"
  1741.             fi
  1742.         fi
  1743.         case "$OS" in
  1744.             hpux*)
  1745.                 wi_os_default_cflags="-D_HPUX_SOURCE $wi_os_default_cflags"
  1746.                 ;;
  1747.             bsdos*)
  1748.                 wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wcast-qual//g'`        # avoid va_start() problem
  1749.                 wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'`
  1750.                 ;;
  1751.             openbsd*|unixware*|openunix*)
  1752.                 wi_os_default_cflags=`echo "$wi_os_default_cflags" | sed 's/\ -Wredundant-decls//g'`
  1753.                 ;;
  1754.         esac
  1755.     else
  1756.         #
  1757.         # regular cc
  1758.         #
  1759.         case "${wi_replace_O_with_g}_${OS}" in
  1760.             no_aix*)
  1761.                 wi_os_default_cflags="-O -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409"
  1762.                 ;;
  1763.             yes_aix*)
  1764.                 wi_os_default_cflags="-g -qinfo=cmp:cnd:dcl:eff:gen:ini:par:pro:rea:use -qlonglong -qro -qroconst -qlanglvl=extended -qsrcmsg -qmaxmem=20480 -qsuppress=1506-469:1506-409"
  1765.                 ;;
  1766.             no_irix2345*|no_irix6.01234*)
  1767.                 wi_os_default_cflags="-O2 -xansi -fullwarn -use_readonly_const -G0 -rdata_shared"
  1768.                 ;;
  1769.             yes_irix2345*|yes_irix6.01234*)
  1770.                 wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared"
  1771.                 ;;
  1772.             no_irix*)
  1773.                 wi_os_default_cflags="-O2 -IPA -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174"
  1774.                 ;;
  1775.             yes_irix*)
  1776.                 wi_os_default_cflags="-g -xansi -fullwarn -use_readonly_const -G0 -rdata_shared -woff 1174"
  1777.                 ;;
  1778.             no_digitalunix*)
  1779.                 wi_os_default_cflags="-O4 -std1 -portable -readonly_strings"
  1780.                 ;;
  1781.             yes_digitalunix*)
  1782.                 wi_os_default_cflags="-g -std1 -portable -readonly_strings"
  1783.                 ;;
  1784.             no_hpux*)
  1785.                 wi_os_default_cflags="-Ae +O2 +Ovolatile +Olibcalls +ESlit +w1 +DAportable"
  1786.                 ;;
  1787.             yes_hpux*)
  1788.                 wi_os_default_cflags="-Ae -g +w1 +DAportable"
  1789.                 ;;
  1790.             no_solaris*86|no_solaris*intel)
  1791.                 # Not really any significant differences
  1792.                 # from the sparc flags, but reserved for
  1793.                 # future use.
  1794.                 #
  1795.                 if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then
  1796.                     wi_os_default_cflags="-xipo -xO4 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc"
  1797.                 else
  1798.                     wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn"
  1799.                 fi
  1800.                 ;;
  1801.             yes_solaris*86|yes_solaris*intel)
  1802.                 if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then
  1803.                     wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED"
  1804.                 else
  1805.                     wi_os_default_cflags="-g -xstrconst -dalign -Qn"
  1806.                 fi
  1807.                 ;;
  1808.             no_solaris*)
  1809.                 if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then
  1810.                     wi_os_default_cflags="-xipo -xO5 -xc99 -xbuiltin -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED -mc"
  1811.                 else
  1812.                     wi_os_default_cflags="-xO4 -xstrconst -dalign -Qn"
  1813.                 fi
  1814.                 ;;
  1815.             yes_solaris*)
  1816.                 if test "$wi_cv_sunwspro_cc_version2" -ge 530 ; then
  1817.                     wi_os_default_cflags="-g -xc99 -xstrconst -dalign -Qn -errtags=yes -erroff=E_END_OF_LOOP_CODE_NOT_REACHED"
  1818.                 else
  1819.                     wi_os_default_cflags="-g -xstrconst -dalign -Qn"
  1820.                 fi
  1821.                 ;;
  1822.             no_tru64*)
  1823.                 wi_os_default_cflags="-O4 -tune host -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment"
  1824.                 ;;
  1825.             yes_tru64*)
  1826.                 wi_os_default_cflags="-g -std1 -readonly_strings -portable -warnprotos -msg_enable level6 -msg_disable longlongtype,hexoctunsign,unusedincl,unnecincl,nestincl,unusedtop,unknownmacro,ignorecallval,strctpadding,truncintasn,truncintcast,trunclongcast,ansialiascast,conststocls,unrefsdecl,subscrbounds2,intconcastsgn,longlongsufx,unreachcode,valuepres,embedcomment"
  1827.                 ;;
  1828.             no_unixware*|no_openunix*)
  1829.                 wi_os_default_cflags='-O -K inline -K host -Q n'
  1830.                 ;;
  1831.             yes_unixware*|yes_openunix*)
  1832.                 wi_os_default_cflags='-g -K host -Q n'
  1833.                 ;;
  1834.             *)
  1835.                 wi_os_default_cflags="no"
  1836.                 ;;
  1837.         esac
  1838.     fi
  1839. fi
  1840. if test "$wi_os_default_cflags" != "no" ; then
  1841.     CFLAGS="$wi_os_default_cflags"
  1842. fi
  1843. echo "$ac_t""$wi_os_default_cflags" 1>&6
  1844.  
  1845.     
  1846.  
  1847. if test "x$wi_request_no_y2k_warnings" = xyes ; then
  1848. case "${wi_cv_gcc_version-0}" in
  1849.     0|1.*|2.[012345678].*)
  1850.         ;;
  1851.     *)
  1852.         case "$CFLAGS" in
  1853.             *-Wno-format-y2k*)
  1854.                 ;;
  1855.             *)
  1856.                 oldCFLAGS="$CFLAGS"
  1857.                 CFLAGS="$CFLAGS -Wno-format-y2k"
  1858.                 #
  1859.                 # Now check if this version of GCC
  1860.                 # accepts this flag...
  1861.                 #
  1862.                 cat > conftest.$ac_ext <<EOF
  1863. #line 1864 "configure"
  1864. #include "confdefs.h"
  1865.  
  1866. int main() {
  1867. int junk;
  1868. ; return 0; }
  1869. EOF
  1870. if { (eval echo configure:1871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  1871.   :
  1872. else
  1873.   echo "configure: failed program was:" >&5
  1874.   cat conftest.$ac_ext >&5
  1875.   rm -rf conftest*
  1876.   CFLAGS="$oldCFLAGS"
  1877. fi
  1878. rm -rf conftest*
  1879.                 unset oldCFLAGS
  1880.                 ;;
  1881.         esac
  1882.         ;;
  1883. esac
  1884. fi
  1885.  
  1886.     
  1887. echo $ac_n "checking for ldd""... $ac_c" 1>&6
  1888. echo "configure:1889: checking for ldd" >&5
  1889. if eval "test \"`echo '$''{'wi_cv_prog_ldd'+set}'`\" = set"; then
  1890.   echo $ac_n "(cached) $ac_c" 1>&6
  1891. else
  1892.   
  1893. wi_cv_prog_ldd="no"
  1894.     cat > conftest.c <<EOF
  1895. #include <stdio.h>
  1896. #include <stdlib.h>
  1897. int main(int argc, char **argv)
  1898. {
  1899.     (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World"));
  1900.     exit(0);
  1901. }
  1902. EOF
  1903.     ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5
  1904.     wi_cv_prog_ldd=`ldd ./conftest 2>&1 | sed -n -e '/lib/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'`
  1905.     /bin/rm -rf conftest*
  1906.  
  1907. fi
  1908.  
  1909. echo "$ac_t""$wi_cv_prog_ldd" 1>&6
  1910.  
  1911.     
  1912. echo $ac_n "checking if compiled programs use a shared library version of libgcc""... $ac_c" 1>&6
  1913. echo "configure:1914: checking if compiled programs use a shared library version of libgcc" >&5
  1914. if eval "test \"`echo '$''{'wi_cv_shared_libgcc'+set}'`\" = set"; then
  1915.   echo $ac_n "(cached) $ac_c" 1>&6
  1916. else
  1917.   
  1918.     if test "$wi_cv_prog_ldd" = no ; then
  1919.         wi_cv_shared_libgcc="unknown (ldd is not available to check)"
  1920.     else
  1921.         cat > conftest.c <<EOF
  1922. #include <stdio.h>
  1923. #include <stdlib.h>
  1924. int main(int argc, char **argv)
  1925. {
  1926.     (void) printf("%s\n", ((argc > 66) ? argv[0] : "Hello World"));
  1927.     exit(0);
  1928. }
  1929. EOF
  1930.         ${CC-cc} $CFLAGS $CPPFLAGS conftest.c -o conftest 1>&5
  1931.         wi_cv_shared_libgcc=`ldd ./conftest 2>&1 | sed -n -e '/libgcc/{s/.*/yes/g;p;q;}' -e '${s/.*/no/g;p;q;}'`
  1932.         /bin/rm -rf conftest*
  1933.     fi
  1934.  
  1935. fi
  1936.  
  1937. echo "$ac_t""$wi_cv_shared_libgcc" 1>&6
  1938.     if test "$wi_cv_shared_libgcc" != no ; then
  1939.         
  1940.     if test "x$ac_cv_prog_gcc" = "xyes" ; then
  1941.         case "$CFLAGS" in
  1942.             *-static-libgcc*)
  1943.                 ;;
  1944.             *)
  1945.                 oldCFLAGS="$CFLAGS"
  1946.                 CFLAGS="$CFLAGS -static-libgcc"
  1947.                 #
  1948.                 # Now check if this version of GCC
  1949.                 # accepts this flag...
  1950.                 #
  1951.                 cat > conftest.$ac_ext <<EOF
  1952. #line 1953 "configure"
  1953. #include "confdefs.h"
  1954.  
  1955. int main() {
  1956. int junk;
  1957. ; return 0; }
  1958. EOF
  1959. if { (eval echo configure:1960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  1960.   :
  1961. else
  1962.   echo "configure: failed program was:" >&5
  1963.   cat conftest.$ac_ext >&5
  1964.   rm -rf conftest*
  1965.   CFLAGS="$oldCFLAGS"
  1966. fi
  1967. rm -rf conftest*
  1968.                 unset oldCFLAGS
  1969.                 ;;
  1970.         esac
  1971.     fi
  1972.  
  1973.     fi
  1974.  
  1975.     
  1976.     if test "x$cross_compiling" = "xyes" ; then
  1977.         
  1978.     if test "x$ac_cv_prog_gcc" = "xyes" ; then
  1979.         case "$CFLAGS" in
  1980.             *-static-libgcc*)
  1981.                 ;;
  1982.             *)
  1983.                 oldCFLAGS="$CFLAGS"
  1984.                 CFLAGS="$CFLAGS -static-libgcc"
  1985.                 #
  1986.                 # Now check if this version of GCC
  1987.                 # accepts this flag...
  1988.                 #
  1989.                 cat > conftest.$ac_ext <<EOF
  1990. #line 1991 "configure"
  1991. #include "confdefs.h"
  1992.  
  1993. int main() {
  1994. int junk;
  1995. ; return 0; }
  1996. EOF
  1997. if { (eval echo configure:1998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  1998.   :
  1999. else
  2000.   echo "configure: failed program was:" >&5
  2001.   cat conftest.$ac_ext >&5
  2002.   rm -rf conftest*
  2003.   CFLAGS="$oldCFLAGS"
  2004. fi
  2005. rm -rf conftest*
  2006.                 unset oldCFLAGS
  2007.                 ;;
  2008.         esac
  2009.     fi
  2010.  
  2011.     fi
  2012.  
  2013.     add_O0="no"
  2014.     if [ "$NOOPTCFLAGS" = "" ] ; then
  2015.         NOOPTCFLAGS=`echo "$CFLAGS" | sed 's/[-+]O[0-9A-Za-z]*//g;s/-xO[0-9]//g;s/-Wc,-O3//g;s/-IPA//g;s/-xipo=?[0-9]?//g;s/\ \ */ /g;s/^\ *//;s/\ *$//;'`
  2016.         if [ "$GCC" = "yes" ] ; then
  2017.             add_O0="yes"
  2018.         else
  2019.             case "$CC" in
  2020.                 ccc|*/ccc)
  2021.                     # Compaq CC
  2022.                     add_O0="yes"
  2023.                     ;;
  2024.             esac
  2025.         fi
  2026.     fi
  2027.     if [ "$DEBUGCFLAGS" = "" ] ; then
  2028.         DEBUGCFLAGS="-g $NOOPTCFLAGS"
  2029.     fi
  2030.     if [ "$add_O0" = yes ] ; then
  2031.         NOOPTCFLAGS="-O0 $NOOPTCFLAGS"
  2032.     fi
  2033.     #
  2034.     # Was it ./configure --enable-debug ?
  2035.     #
  2036.     echo $ac_n "checking if this is a debug build""... $ac_c" 1>&6
  2037. echo "configure:2038: checking if this is a debug build" >&5
  2038.     if test "$DEBUGBUILD" = yes ; then
  2039.         echo "$ac_t""yes" 1>&6
  2040.         CFLAGS="$DEBUGCFLAGS"
  2041.     else
  2042.         echo "$ac_t""no" 1>&6
  2043.     fi
  2044.  
  2045. wi_cv_lfs="no"
  2046. result="no"
  2047. if test "os_${os}_gcc_${GCC}" = os_hp-ux_gcc_yes ; then
  2048.     
  2049. CFLAGS=`echo "$CFLAGS" | sed s/-D__STDC_EXT__//g`
  2050. echo $ac_n "checking if -D__STDC_EXT__ is needed with GCC on HP-UX""... $ac_c" 1>&6
  2051. echo "configure:2052: checking if -D__STDC_EXT__ is needed with GCC on HP-UX" >&5
  2052. if test "$cross_compiling" = yes; then
  2053.   
  2054.     # action if cross-compiling, guess
  2055.     CFLAGS="-D__STDC_EXT__ $CFLAGS"
  2056.     echo "$ac_t""(guessing) yes" 1>&6
  2057.  
  2058. else
  2059.   cat > conftest.$ac_ext <<EOF
  2060. #line 2061 "configure"
  2061. #include "confdefs.h"
  2062.  
  2063. #include <stdio.h>
  2064.  
  2065. main()
  2066. {
  2067. #ifdef __STDC_EXT__
  2068.     if (__STDC_EXT__ == 0)
  2069.         exit(1);        /* have __STDC_EXT__=0 */
  2070.     exit(0);            /* have __STDC_EXT__=1 */
  2071. #else
  2072.     exit(1);            /* do not have __STDC_EXT__ */
  2073. #endif
  2074. }
  2075. EOF
  2076. if { (eval echo configure:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  2077. then
  2078.   
  2079.     # action if true
  2080.     #
  2081.     # Already have it defined.
  2082.     #
  2083.     echo "$ac_t""no" 1>&6
  2084.  
  2085. else
  2086.   echo "configure: failed program was:" >&5
  2087.   cat conftest.$ac_ext >&5
  2088.   rm -fr conftest*
  2089.   
  2090.     # action if false
  2091.     #
  2092.     # Not defined -- we need to define it then.
  2093.     # This is required for the extended
  2094.     # namespace symbols for Large Files.
  2095.     #
  2096.     CFLAGS="-D__STDC_EXT__ $CFLAGS"
  2097.     echo "$ac_t""yes" 1>&6
  2098.  
  2099. fi
  2100. rm -fr conftest*
  2101. fi
  2102.  
  2103.  
  2104. fi
  2105. for ac_hdr in unistd.h
  2106. do
  2107. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  2108. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  2109. echo "configure:2110: checking for $ac_hdr" >&5
  2110. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2111.   echo $ac_n "(cached) $ac_c" 1>&6
  2112. else
  2113.   cat > conftest.$ac_ext <<EOF
  2114. #line 2115 "configure"
  2115. #include "confdefs.h"
  2116. #include <$ac_hdr>
  2117. EOF
  2118. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2119. { (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  2120. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  2121. if test -z "$ac_err"; then
  2122.   rm -rf conftest*
  2123.   eval "ac_cv_header_$ac_safe=yes"
  2124. else
  2125.   echo "$ac_err" >&5
  2126.   echo "configure: failed program was:" >&5
  2127.   cat conftest.$ac_ext >&5
  2128.   rm -rf conftest*
  2129.   eval "ac_cv_header_$ac_safe=no"
  2130. fi
  2131. rm -rf conftest*
  2132. fi
  2133. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2134.   echo "$ac_t""yes" 1>&6
  2135.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  2136.   cat >> confdefs.h <<EOF
  2137. #define $ac_tr_hdr 1
  2138. EOF
  2139.  
  2140. else
  2141.   echo "$ac_t""no" 1>&6
  2142. fi
  2143. done
  2144.  
  2145. if test "x$ac_cv_sizeof_stat_st_size" = x ; then
  2146.     
  2147. echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6
  2148. echo "configure:2149: checking size of st_size field in struct stat" >&5
  2149.  
  2150.     if test "x$ac_cv_header_unistd_h" = x ; then
  2151.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; }
  2152.     fi
  2153.  
  2154. if test "$cross_compiling" = yes; then
  2155.   
  2156.     # action if cross compiling
  2157.     x="unknown"
  2158.     ac_cv_sizeof_stat_st_size="4"
  2159.     rm -f conftest.out
  2160.  
  2161. else
  2162.   cat > conftest.$ac_ext <<EOF
  2163. #line 2164 "configure"
  2164. #include "confdefs.h"
  2165.  
  2166.     /* program */
  2167. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  2168. #    define _ALL_SOURCE 1
  2169. #endif
  2170. #ifdef HAVE_UNISTD_H
  2171. #    include <unistd.h>
  2172. #endif
  2173. #include <sys/types.h>
  2174. #include <sys/stat.h>
  2175. #include <stdio.h>
  2176. #include <stdlib.h>
  2177.  
  2178. main()
  2179. {
  2180.     struct stat x;
  2181.     FILE *fp;
  2182.  
  2183.     fp = fopen("conftest.out", "w");
  2184.     if (fp != NULL) {
  2185.         fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size));
  2186.         fclose(fp);
  2187.         exit(0);    /* OK */
  2188.     }
  2189.     exit(1);        /* Not OK */
  2190. }
  2191.  
  2192. EOF
  2193. if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  2194. then
  2195.   
  2196.     # action if true
  2197.     x=`cat conftest.out`
  2198.     case "$x" in
  2199.         [0-9]*)
  2200.                         ac_cv_sizeof_stat_st_size="$x"
  2201.             ;;
  2202.         *)
  2203.             x="failed"
  2204.             ac_cv_sizeof_stat_st_size="4"
  2205.             ;;
  2206.     esac
  2207.     rm -f conftest.out
  2208.  
  2209. else
  2210.   echo "configure: failed program was:" >&5
  2211.   cat conftest.$ac_ext >&5
  2212.   rm -fr conftest*
  2213.   
  2214.     # action if false
  2215.     x="failed"
  2216.     ac_cv_sizeof_stat_st_size="4"
  2217.     rm -f conftest.out
  2218.  
  2219. fi
  2220. rm -fr conftest*
  2221. fi
  2222.  
  2223. echo "$ac_t""$x" 1>&6
  2224.  
  2225. fi
  2226. if test "x$ac_cv_sizeof_off_t" = x ; then
  2227.     
  2228. echo $ac_n "checking size of off_t""... $ac_c" 1>&6
  2229. echo "configure:2230: checking size of off_t" >&5
  2230.  
  2231.     if test "x$ac_cv_header_unistd_h" = x ; then
  2232.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; }
  2233.     fi
  2234.  
  2235. if test "$cross_compiling" = yes; then
  2236.   
  2237.     # action if cross compiling
  2238.     x="unknown"
  2239.     ac_cv_sizeof_off_t="4"
  2240.     rm -f conftest.out
  2241.  
  2242. else
  2243.   cat > conftest.$ac_ext <<EOF
  2244. #line 2245 "configure"
  2245. #include "confdefs.h"
  2246.  
  2247.     /* program */
  2248. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  2249. #    define _ALL_SOURCE 1
  2250. #endif
  2251. #ifdef HAVE_UNISTD_H
  2252. #    include <unistd.h>
  2253. #endif
  2254. #include <sys/types.h>
  2255. #include <sys/stat.h>
  2256. #include <stdio.h>
  2257. #include <stdlib.h>
  2258.  
  2259. main()
  2260. {
  2261.     off_t x = 0;
  2262.     FILE *fp;
  2263.  
  2264.     fp = fopen("conftest.out", "w");
  2265.     if (fp != NULL) {
  2266.         fprintf(fp, "%u\n", (unsigned int) sizeof(x));
  2267.         fclose(fp);
  2268.         exit(0);    /* OK */
  2269.     }
  2270.     exit(1);        /* Not OK */
  2271. }
  2272.  
  2273. EOF
  2274. if { (eval echo configure:2275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  2275. then
  2276.   
  2277.     # action if true
  2278.     x=`cat conftest.out`
  2279.     case "$x" in
  2280.         [0-9]*)
  2281.                         ac_cv_sizeof_off_t="$x"
  2282.             ;;
  2283.         *)
  2284.             x="failed"
  2285.             ac_cv_sizeof_off_t="4"
  2286.             ;;
  2287.     esac
  2288.     rm -f conftest.out
  2289.  
  2290. else
  2291.   echo "configure: failed program was:" >&5
  2292.   cat conftest.$ac_ext >&5
  2293.   rm -fr conftest*
  2294.   
  2295.     # action if false
  2296.     x="failed"
  2297.     ac_cv_sizeof_off_t="4"
  2298.     rm -f conftest.out
  2299.  
  2300. fi
  2301. rm -fr conftest*
  2302. fi
  2303.  
  2304. echo "$ac_t""$x" 1>&6
  2305.  
  2306. fi
  2307. if test "$ac_cv_sizeof_stat_st_size" -le 4 || test "$ac_cv_sizeof_off_t" -le 4 ; then
  2308.     unset ac_cv_sizeof_stat_st_size ac_cv_sizeof_off_t
  2309.     CFLAGS=`echo "$CFLAGS" | sed 's/-D_LARGEFILE64_SOURCE//g'`
  2310.     case "$CFLAGS" in
  2311.         *-D_LARGEFILE_SOURCE*)
  2312.             result="already included -D_LARGEFILE_SOURCE"
  2313.             ;;
  2314.         *)
  2315.             CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $CFLAGS"
  2316.             DEBUGCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $DEBUGCFLAGS"
  2317.             NOOPTCFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $NOOPTCFLAGS"
  2318.             result="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
  2319.             ;;
  2320.     esac
  2321.     wi_cv_lfs="yes"
  2322. fi
  2323. echo $ac_n "checking if we should add CFLAGS for Large File Support""... $ac_c" 1>&6
  2324. echo "configure:2325: checking if we should add CFLAGS for Large File Support" >&5
  2325. echo "$ac_t""$result" 1>&6
  2326. if test "x$ac_cv_sizeof_off_t" = x ; then
  2327.     # Recheck, to see if the defines took effect.
  2328.     
  2329. echo $ac_n "checking size of st_size field in struct stat""... $ac_c" 1>&6
  2330. echo "configure:2331: checking size of st_size field in struct stat" >&5
  2331.  
  2332.     if test "x$ac_cv_header_unistd_h" = x ; then
  2333.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_ST_SIZE." 1>&2; exit 1; }
  2334.     fi
  2335.  
  2336. if test "$cross_compiling" = yes; then
  2337.   
  2338.     # action if cross compiling
  2339.     x="unknown"
  2340.     ac_cv_sizeof_stat_st_size="4"
  2341.     rm -f conftest.out
  2342.  
  2343. else
  2344.   cat > conftest.$ac_ext <<EOF
  2345. #line 2346 "configure"
  2346. #include "confdefs.h"
  2347.  
  2348.     /* program */
  2349. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  2350. #    define _ALL_SOURCE 1
  2351. #endif
  2352. #ifdef HAVE_UNISTD_H
  2353. #    include <unistd.h>
  2354. #endif
  2355. #include <sys/types.h>
  2356. #include <sys/stat.h>
  2357. #include <stdio.h>
  2358. #include <stdlib.h>
  2359.  
  2360. main()
  2361. {
  2362.     struct stat x;
  2363.     FILE *fp;
  2364.  
  2365.     fp = fopen("conftest.out", "w");
  2366.     if (fp != NULL) {
  2367.         fprintf(fp, "%u\n", (unsigned int) sizeof(x.st_size));
  2368.         fclose(fp);
  2369.         exit(0);    /* OK */
  2370.     }
  2371.     exit(1);        /* Not OK */
  2372. }
  2373.  
  2374. EOF
  2375. if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  2376. then
  2377.   
  2378.     # action if true
  2379.     x=`cat conftest.out`
  2380.     case "$x" in
  2381.         [0-9]*)
  2382.                         ac_cv_sizeof_stat_st_size="$x"
  2383.             ;;
  2384.         *)
  2385.             x="failed"
  2386.             ac_cv_sizeof_stat_st_size="4"
  2387.             ;;
  2388.     esac
  2389.     rm -f conftest.out
  2390.  
  2391. else
  2392.   echo "configure: failed program was:" >&5
  2393.   cat conftest.$ac_ext >&5
  2394.   rm -fr conftest*
  2395.   
  2396.     # action if false
  2397.     x="failed"
  2398.     ac_cv_sizeof_stat_st_size="4"
  2399.     rm -f conftest.out
  2400.  
  2401. fi
  2402. rm -fr conftest*
  2403. fi
  2404.  
  2405. echo "$ac_t""$x" 1>&6
  2406.  
  2407.     
  2408. echo $ac_n "checking size of off_t""... $ac_c" 1>&6
  2409. echo "configure:2410: checking size of off_t" >&5
  2410.  
  2411.     if test "x$ac_cv_header_unistd_h" = x ; then
  2412.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SIZEOF_OFF_T." 1>&2; exit 1; }
  2413.     fi
  2414.  
  2415. if test "$cross_compiling" = yes; then
  2416.   
  2417.     # action if cross compiling
  2418.     x="unknown"
  2419.     ac_cv_sizeof_off_t="4"
  2420.     rm -f conftest.out
  2421.  
  2422. else
  2423.   cat > conftest.$ac_ext <<EOF
  2424. #line 2425 "configure"
  2425. #include "confdefs.h"
  2426.  
  2427.     /* program */
  2428. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  2429. #    define _ALL_SOURCE 1
  2430. #endif
  2431. #ifdef HAVE_UNISTD_H
  2432. #    include <unistd.h>
  2433. #endif
  2434. #include <sys/types.h>
  2435. #include <sys/stat.h>
  2436. #include <stdio.h>
  2437. #include <stdlib.h>
  2438.  
  2439. main()
  2440. {
  2441.     off_t x = 0;
  2442.     FILE *fp;
  2443.  
  2444.     fp = fopen("conftest.out", "w");
  2445.     if (fp != NULL) {
  2446.         fprintf(fp, "%u\n", (unsigned int) sizeof(x));
  2447.         fclose(fp);
  2448.         exit(0);    /* OK */
  2449.     }
  2450.     exit(1);        /* Not OK */
  2451. }
  2452.  
  2453. EOF
  2454. if { (eval echo configure:2455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  2455. then
  2456.   
  2457.     # action if true
  2458.     x=`cat conftest.out`
  2459.     case "$x" in
  2460.         [0-9]*)
  2461.                         ac_cv_sizeof_off_t="$x"
  2462.             ;;
  2463.         *)
  2464.             x="failed"
  2465.             ac_cv_sizeof_off_t="4"
  2466.             ;;
  2467.     esac
  2468.     rm -f conftest.out
  2469.  
  2470. else
  2471.   echo "configure: failed program was:" >&5
  2472.   cat conftest.$ac_ext >&5
  2473.   rm -fr conftest*
  2474.   
  2475.     # action if false
  2476.     x="failed"
  2477.     ac_cv_sizeof_off_t="4"
  2478.     rm -f conftest.out
  2479.  
  2480. fi
  2481. rm -fr conftest*
  2482. fi
  2483.  
  2484. echo "$ac_t""$x" 1>&6
  2485.  
  2486. fi
  2487.  
  2488.  
  2489. result="no"
  2490. case "$CFLAGS" in
  2491.     *-D_REENTRANT*)
  2492.         result="already included"
  2493.         ;;
  2494.     *)
  2495.         CFLAGS="-D_REENTRANT $CFLAGS"
  2496.         result="-D_REENTRANT"
  2497.         ;;
  2498. esac
  2499. echo $ac_n "checking if we should add CFLAGS for reentrancy""... $ac_c" 1>&6
  2500. echo "configure:2501: checking if we should add CFLAGS for reentrancy" >&5
  2501. echo "$ac_t""$result" 1>&6
  2502.  
  2503.  
  2504.  
  2505. if test "$SYS" = macosx ; then
  2506.     ac_cv_macosx_cflags=no
  2507.     ac_cv_macosx_ldflags=no
  2508.     if test "${use_macosx_universal}" != no ; then
  2509.         macosx_sdk_path="/Developer/SDKs/MacOSX10.4u.sdk"
  2510.         macosx_arch_flags="-arch i386 -arch ppc"
  2511.         case "$CFLAGS" in
  2512.             *"-isysroot"*"-arch"*|*"-arch"*"-isysroot"*)
  2513.                 # User already had both SDK path and desired architecture(s) in CFLAGS
  2514.                 ;;
  2515.             *"-arch"*)
  2516.                 ac_cv_macosx_cflags="-isysroot ${macosx_sdk_path}"
  2517.                 CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}"
  2518.                 ;;
  2519.             *"-isysroot"*)
  2520.                 ac_cv_macosx_cflags="${macosx_arch_flags}"
  2521.                 CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}"
  2522.                 ;;
  2523.             *)
  2524.                 ac_cv_macosx_cflags="-isysroot ${macosx_sdk_path} ${macosx_arch_flags}"
  2525.                 CFLAGS="${ac_cv_macosx_cflags} ${CFLAGS}"
  2526.                 ;;
  2527.         esac
  2528.     #
  2529.     # Apparently, only libtool (glibtool) needs this -syslibroot flag.
  2530.     #
  2531.     #    case "$LDFLAGS" in
  2532.     #        *"-syslibroot"*)
  2533.     #            # User already had SDK path in LDFLAGS
  2534.     #            ;;
  2535.     #        *)
  2536.     #            ac_cv_macosx_ldflags="-syslibroot ${macosx_sdk_path}"
  2537.     #            LDFLAGS="${ac_cv_macosx_ldflags} ${LDFLAGS}"
  2538.     #            ;;
  2539.     #    esac
  2540.     fi
  2541. echo $ac_n "checking if we should add CFLAGS for Mac OS X""... $ac_c" 1>&6
  2542. echo "configure:2543: checking if we should add CFLAGS for Mac OS X" >&5
  2543. echo "$ac_t""$ac_cv_macosx_cflags" 1>&6
  2544. fi
  2545.  
  2546.  
  2547. echo $ac_n "checking for strip""... $ac_c" 1>&6
  2548. echo "configure:2549: checking for strip" >&5
  2549. STRIP="strip"
  2550. if [ "x$cross_compiling" = "xyes" ] ; then
  2551.     machine=`${CC-gcc} -dumpmachine 2>/dev/null`
  2552.     case "$CC" in
  2553.         *${machine}*)
  2554.             f=`echo "$CC" | sed 's|/[^/]*$||'`
  2555.             if [ -x "$f/${machine}-strip" ] ; then
  2556.                 STRIP="$f/${machine}-strip"
  2557.             elif [ -x "$f/strip" ] ; then
  2558.                 STRIP="$f/strip"
  2559.             fi
  2560.             ;;
  2561.     esac
  2562.     unset machine f
  2563. fi
  2564. echo "$ac_t""$STRIP" 1>&6
  2565.  
  2566. if test "$SFLAG" = "" ; then
  2567.     SFLAG="-s"
  2568.     case "$OS" in
  2569.         macosx*)
  2570.             SFLAG='-Wl,-x'
  2571.             ;;
  2572.     esac
  2573. fi
  2574. #
  2575. # Was it ./configure --enable-debug ?
  2576. #
  2577. if test "$DEBUGBUILD" = yes ; then
  2578.     # It was directly indicated by the user with --enable-debug.
  2579.     SFLAG=""
  2580.     if test "x$STRIP" = "x" ; then
  2581.         STRIP=":"
  2582.     else
  2583.         STRIP=": #${STRIP}"
  2584.     fi
  2585. else
  2586.     # Not directly indicated, but maybe their CFLAGS hint at a debug build.
  2587.     case "$CFLAGS" in
  2588.         "-g"|"-g "*|*" -g"|*" -g "*|*"-g"0-9*)
  2589.             # SFLAG="# $SFLAG"
  2590.             SFLAG=""
  2591.             if test "x$STRIP" = "x" ; then
  2592.                 STRIP=":"
  2593.             else
  2594.                 STRIP=": #${STRIP}"
  2595.             fi
  2596.             ;;
  2597.     esac
  2598. fi
  2599. STRIPFLAG="$SFLAG"
  2600.  
  2601. echo $ac_n "checking for object suffix""... $ac_c" 1>&6
  2602. echo "configure:2603: checking for object suffix" >&5
  2603. if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
  2604.   echo $ac_n "(cached) $ac_c" 1>&6
  2605. else
  2606.   rm -rf conftest*
  2607. if test "x${SYS}" = "xmacosx" ; then
  2608.     ac_cv_objext="o"
  2609. else
  2610. echo 'int i = 1;' > conftest.$ac_ext
  2611. if { (eval echo configure:2612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  2612.   for ac_file in conftest.*; do
  2613.     case $ac_file in
  2614.     *.c) ;;
  2615.     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
  2616.     esac
  2617.   done
  2618. else
  2619.   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
  2620. fi
  2621. fi
  2622. rm -rf conftest*
  2623. fi
  2624.  
  2625. echo "$ac_t""$ac_cv_objext" 1>&6
  2626. OBJEXT=$ac_cv_objext
  2627. ac_objext=$ac_cv_objext
  2628.  
  2629. echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
  2630. echo "configure:2631: checking for Cygwin environment" >&5
  2631. if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
  2632.   echo $ac_n "(cached) $ac_c" 1>&6
  2633. else
  2634.   cat > conftest.$ac_ext <<EOF
  2635. #line 2636 "configure"
  2636. #include "confdefs.h"
  2637.  
  2638. int main() {
  2639.  
  2640. #ifndef __CYGWIN__
  2641. #define __CYGWIN__ __CYGWIN32__
  2642. #endif
  2643. return __CYGWIN__;
  2644. ; return 0; }
  2645. EOF
  2646. if { (eval echo configure:2647: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  2647.   rm -rf conftest*
  2648.   ac_cv_cygwin=yes
  2649. else
  2650.   echo "configure: failed program was:" >&5
  2651.   cat conftest.$ac_ext >&5
  2652.   rm -rf conftest*
  2653.   ac_cv_cygwin=no
  2654. fi
  2655. rm -rf conftest*
  2656. rm -rf conftest*
  2657. fi
  2658.  
  2659. echo "$ac_t""$ac_cv_cygwin" 1>&6
  2660. CYGWIN=
  2661. test "$ac_cv_cygwin" = yes && CYGWIN=yes
  2662. echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
  2663. echo "configure:2664: checking for mingw32 environment" >&5
  2664. if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
  2665.   echo $ac_n "(cached) $ac_c" 1>&6
  2666. else
  2667.   cat > conftest.$ac_ext <<EOF
  2668. #line 2669 "configure"
  2669. #include "confdefs.h"
  2670.  
  2671. int main() {
  2672. return __MINGW32__;
  2673. ; return 0; }
  2674. EOF
  2675. if { (eval echo configure:2676: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  2676.   rm -rf conftest*
  2677.   ac_cv_mingw32=yes
  2678. else
  2679.   echo "configure: failed program was:" >&5
  2680.   cat conftest.$ac_ext >&5
  2681.   rm -rf conftest*
  2682.   ac_cv_mingw32=no
  2683. fi
  2684. rm -rf conftest*
  2685. rm -rf conftest*
  2686. fi
  2687.  
  2688. echo "$ac_t""$ac_cv_mingw32" 1>&6
  2689. MINGW32=
  2690. test "$ac_cv_mingw32" = yes && MINGW32=yes
  2691.  
  2692.  
  2693. echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
  2694. echo "configure:2695: checking for executable suffix" >&5
  2695. if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
  2696.   echo $ac_n "(cached) $ac_c" 1>&6
  2697. else
  2698.   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
  2699.   ac_cv_exeext=.exe
  2700. elif test "x${SYS}" = "xmacosx" ; then
  2701.   ac_cv_exeext=""
  2702. else
  2703.   rm -rf conftest*
  2704.   echo 'int main () { return 0; }' > conftest.$ac_ext
  2705.   ac_cv_exeext=
  2706.   if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
  2707.     for file in conftest.*; do
  2708.       case $file in
  2709.       *.c | *.o | *.obj) ;;
  2710.       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
  2711.       esac
  2712.     done
  2713.   else
  2714.     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
  2715.   fi
  2716.   rm -rf conftest*
  2717.   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
  2718. fi
  2719. fi
  2720.  
  2721. EXEEXT=""
  2722. test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
  2723. echo "$ac_t""${ac_cv_exeext}" 1>&6
  2724. ac_exeext=$EXEEXT
  2725.  
  2726.  
  2727. # Get first 127 chars of all uname information.  Some folks have
  2728. # way too much stuff there, so grab only the first 127.
  2729. unam=`uname -a 2>/dev/null | cut -c1-127 | sed 's-"-\\"-g'`
  2730. if test "$unam" != "" ; then
  2731.     cat >> confdefs.h <<EOF
  2732. #define UNAME "$unam"
  2733. EOF
  2734.  
  2735. fi
  2736.  
  2737.  
  2738. if test "${SYS-sunos}" = sunos ; then
  2739.     echo $ac_n "checking for System V compatibility directories""... $ac_c" 1>&6
  2740. echo "configure:2741: checking for System V compatibility directories" >&5
  2741.     echo "$ac_t""" 1>&6
  2742.     
  2743. incdir=""/usr/5include""
  2744. if test -r $incdir ; then
  2745.     case "$CPPFLAGS" in
  2746.         *${incdir}*)
  2747.             # echo "   + already had $incdir" 1>&6
  2748.             ;;
  2749.         *)
  2750.             if test "$CPPFLAGS" = "" ; then
  2751.                 CPPFLAGS="-I$incdir"
  2752.             else
  2753.                 CPPFLAGS="$CPPFLAGS -I$incdir"
  2754.             fi
  2755.             echo "   + found $incdir" 1>&6
  2756.             ;;
  2757.     esac
  2758. fi
  2759.  
  2760.     
  2761. libdir=""/usr/5lib""
  2762. if test -r $libdir ; then
  2763.     case "$LDFLAGS" in
  2764.         *${libdir}*)
  2765.             # echo "   + already had $libdir" 1>&6
  2766.             ;;
  2767.         *)
  2768.             if test "$LDFLAGS" = "" ; then
  2769.                 LDFLAGS="-L$libdir"
  2770.             else
  2771.                 LDFLAGS="$LDFLAGS -L$libdir"
  2772.             fi
  2773.             echo "   + found $libdir" 1>&6
  2774.             ;;
  2775.     esac
  2776. fi
  2777.  
  2778. fi
  2779.     if test "${prefix-NONE}" = "NONE" ; then
  2780.     cat >> confdefs.h <<EOF
  2781. #define PREFIX_BINDIR "/usr/local/bin"
  2782. EOF
  2783.  
  2784. else
  2785.     cat >> confdefs.h <<EOF
  2786. #define PREFIX_BINDIR "$prefix/bin"
  2787. EOF
  2788.  
  2789. fi
  2790.  
  2791.  
  2792.  
  2793. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
  2794. echo "configure:2795: checking for ANSI C header files" >&5
  2795. if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
  2796.   echo $ac_n "(cached) $ac_c" 1>&6
  2797. else
  2798.   cat > conftest.$ac_ext <<EOF
  2799. #line 2800 "configure"
  2800. #include "confdefs.h"
  2801. #include <stdlib.h>
  2802. #include <stdarg.h>
  2803. #include <string.h>
  2804. #include <float.h>
  2805. EOF
  2806. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2807. { (eval echo configure:2808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  2808. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  2809. if test -z "$ac_err"; then
  2810.   rm -rf conftest*
  2811.   ac_cv_header_stdc=yes
  2812. else
  2813.   echo "$ac_err" >&5
  2814.   echo "configure: failed program was:" >&5
  2815.   cat conftest.$ac_ext >&5
  2816.   rm -rf conftest*
  2817.   ac_cv_header_stdc=no
  2818. fi
  2819. rm -rf conftest*
  2820.  
  2821. if test $ac_cv_header_stdc = yes; then
  2822.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  2823. cat > conftest.$ac_ext <<EOF
  2824. #line 2825 "configure"
  2825. #include "confdefs.h"
  2826. #include <string.h>
  2827. EOF
  2828. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  2829.   egrep "memchr" >/dev/null 2>&1; then
  2830.   :
  2831. else
  2832.   rm -rf conftest*
  2833.   ac_cv_header_stdc=no
  2834. fi
  2835. rm -rf conftest*
  2836.  
  2837. fi
  2838.  
  2839. if test $ac_cv_header_stdc = yes; then
  2840.   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  2841. cat > conftest.$ac_ext <<EOF
  2842. #line 2843 "configure"
  2843. #include "confdefs.h"
  2844. #include <stdlib.h>
  2845. EOF
  2846. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  2847.   egrep "free" >/dev/null 2>&1; then
  2848.   :
  2849. else
  2850.   rm -rf conftest*
  2851.   ac_cv_header_stdc=no
  2852. fi
  2853. rm -rf conftest*
  2854.  
  2855. fi
  2856.  
  2857. if test $ac_cv_header_stdc = yes; then
  2858.   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  2859. if test "$cross_compiling" = yes; then
  2860.   :
  2861. else
  2862.   cat > conftest.$ac_ext <<EOF
  2863. #line 2864 "configure"
  2864. #include "confdefs.h"
  2865. #include <ctype.h>
  2866. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  2867. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  2868. #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
  2869. int main () { int i; for (i = 0; i < 256; i++)
  2870. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  2871. exit (0); }
  2872.  
  2873. EOF
  2874. if { (eval echo configure:2875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  2875. then
  2876.   :
  2877. else
  2878.   echo "configure: failed program was:" >&5
  2879.   cat conftest.$ac_ext >&5
  2880.   rm -fr conftest*
  2881.   ac_cv_header_stdc=no
  2882. fi
  2883. rm -fr conftest*
  2884. fi
  2885.  
  2886. fi
  2887. fi
  2888.  
  2889. echo "$ac_t""$ac_cv_header_stdc" 1>&6
  2890. if test $ac_cv_header_stdc = yes; then
  2891.   cat >> confdefs.h <<\EOF
  2892. #define STDC_HEADERS 1
  2893. EOF
  2894.  
  2895. fi
  2896.  
  2897. for ac_hdr in arpa/nameser.h gnu/libc-version.h locale.h net/errno.h nserve.h resolv.h sgtty.h string.h strings.h sys/id.h sys/ioctl.h syslog.h sys/socket.h sys/time.h sys/types.h sys/utsname.h sys/systeminfo.h termio.h termios.h time.h utime.h unistd.h gnu/libc-version.h
  2898. do
  2899. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  2900. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  2901. echo "configure:2902: checking for $ac_hdr" >&5
  2902. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2903.   echo $ac_n "(cached) $ac_c" 1>&6
  2904. else
  2905.   cat > conftest.$ac_ext <<EOF
  2906. #line 2907 "configure"
  2907. #include "confdefs.h"
  2908. #include <$ac_hdr>
  2909. EOF
  2910. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2911. { (eval echo configure:2912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  2912. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  2913. if test -z "$ac_err"; then
  2914.   rm -rf conftest*
  2915.   eval "ac_cv_header_$ac_safe=yes"
  2916. else
  2917.   echo "$ac_err" >&5
  2918.   echo "configure: failed program was:" >&5
  2919.   cat conftest.$ac_ext >&5
  2920.   rm -rf conftest*
  2921.   eval "ac_cv_header_$ac_safe=no"
  2922. fi
  2923. rm -rf conftest*
  2924. fi
  2925. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2926.   echo "$ac_t""yes" 1>&6
  2927.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  2928.   cat >> confdefs.h <<EOF
  2929. #define $ac_tr_hdr 1
  2930. EOF
  2931.  
  2932. else
  2933.   echo "$ac_t""no" 1>&6
  2934. fi
  2935. done
  2936.  
  2937. echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
  2938. echo "configure:2939: checking whether time.h and sys/time.h may both be included" >&5
  2939. if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
  2940.   echo $ac_n "(cached) $ac_c" 1>&6
  2941. else
  2942.   cat > conftest.$ac_ext <<EOF
  2943. #line 2944 "configure"
  2944. #include "confdefs.h"
  2945. #include <sys/types.h>
  2946. #include <sys/time.h>
  2947. #include <time.h>
  2948. int main() {
  2949. struct tm *tp;
  2950. ; return 0; }
  2951. EOF
  2952. if { (eval echo configure:2953: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  2953.   rm -rf conftest*
  2954.   ac_cv_header_time=yes
  2955. else
  2956.   echo "configure: failed program was:" >&5
  2957.   cat conftest.$ac_ext >&5
  2958.   rm -rf conftest*
  2959.   ac_cv_header_time=no
  2960. fi
  2961. rm -rf conftest*
  2962. fi
  2963.  
  2964. echo "$ac_t""$ac_cv_header_time" 1>&6
  2965. if test $ac_cv_header_time = yes; then
  2966.   cat >> confdefs.h <<\EOF
  2967. #define TIME_WITH_SYS_TIME 1
  2968. EOF
  2969.  
  2970. fi
  2971.  
  2972.  
  2973. if test "x$want_unix_domain_sockets" != xno ; then
  2974.     
  2975.     if test "x$ac_cv_header_unistd_h" = x ; then
  2976.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_UNIX_DOMAIN_SOCKETS." 1>&2; exit 1; }
  2977.     fi
  2978.  
  2979.     for ac_hdr in sys/un.h
  2980. do
  2981. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  2982. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  2983. echo "configure:2984: checking for $ac_hdr" >&5
  2984. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2985.   echo $ac_n "(cached) $ac_c" 1>&6
  2986. else
  2987.   cat > conftest.$ac_ext <<EOF
  2988. #line 2989 "configure"
  2989. #include "confdefs.h"
  2990. #include <$ac_hdr>
  2991. EOF
  2992. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2993. { (eval echo configure:2994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  2994. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  2995. if test -z "$ac_err"; then
  2996.   rm -rf conftest*
  2997.   eval "ac_cv_header_$ac_safe=yes"
  2998. else
  2999.   echo "$ac_err" >&5
  3000.   echo "configure: failed program was:" >&5
  3001.   cat conftest.$ac_ext >&5
  3002.   rm -rf conftest*
  3003.   eval "ac_cv_header_$ac_safe=no"
  3004. fi
  3005. rm -rf conftest*
  3006. fi
  3007. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  3008.   echo "$ac_t""yes" 1>&6
  3009.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  3010.   cat >> confdefs.h <<EOF
  3011. #define $ac_tr_hdr 1
  3012. EOF
  3013.  
  3014. else
  3015.   echo "$ac_t""no" 1>&6
  3016. fi
  3017. done
  3018.  
  3019.     echo $ac_n "checking for UNIX domain sockets""... $ac_c" 1>&6
  3020. echo "configure:3021: checking for UNIX domain sockets" >&5
  3021. if eval "test \"`echo '$''{'wi_cv_unix_domain_sockets'+set}'`\" = set"; then
  3022.   echo $ac_n "(cached) $ac_c" 1>&6
  3023. else
  3024.   
  3025.     if test "$cross_compiling" = yes; then
  3026.   
  3027.     # action if cross-compiling, guess
  3028.     guess="(guessing) "
  3029.     wi_cv_unix_domain_sockets=yes
  3030.  
  3031. else
  3032.   cat > conftest.$ac_ext <<EOF
  3033. #line 3034 "configure"
  3034. #include "confdefs.h"
  3035.  
  3036. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  3037. #    define _ALL_SOURCE 1
  3038. #endif
  3039. #ifdef HAVE_UNISTD_H
  3040. #    include <unistd.h>
  3041. #endif
  3042. #include <sys/types.h>
  3043. #include <sys/socket.h>
  3044. #ifdef HAVE_SYS_UN_H
  3045. #include <sys/un.h>
  3046. #endif
  3047.  
  3048. main()
  3049. {
  3050.     int sfd;
  3051.  
  3052.     sfd = socket(AF_UNIX, SOCK_STREAM, 0);
  3053.     if (sfd < 0)
  3054.         exit(1);        /* do not have UNIX domain sockets */
  3055.     close(sfd);
  3056.     exit(0);            /* do have UNIX domain sockets */
  3057. }
  3058. EOF
  3059. if { (eval echo configure:3060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  3060. then
  3061.   
  3062.     # action if true
  3063.     guess=""
  3064.     wi_cv_unix_domain_sockets=yes
  3065.  
  3066. else
  3067.   echo "configure: failed program was:" >&5
  3068.   cat conftest.$ac_ext >&5
  3069.   rm -fr conftest*
  3070.   
  3071.     # action if false
  3072.     guess=""
  3073.     wi_cv_unix_domain_sockets=no
  3074.  
  3075. fi
  3076. rm -fr conftest*
  3077. fi
  3078.  
  3079.  
  3080. fi
  3081.  
  3082. echo "$ac_t""$guess$wi_cv_unix_domain_sockets" 1>&6
  3083. guess=""
  3084.  
  3085.     if test "x$wi_cv_unix_domain_sockets" = xyes ; then
  3086.         cat >> confdefs.h <<\EOF
  3087. #define HAVE_UNIX_DOMAIN_SOCKETS 1
  3088. EOF
  3089.  
  3090.     fi
  3091.     
  3092. echo $ac_n "checking for sun_len field in struct sockaddr_un""... $ac_c" 1>&6
  3093. echo "configure:3094: checking for sun_len field in struct sockaddr_un" >&5
  3094. if eval "test \"`echo '$''{'wi_cv_sockaddr_un_sun_len'+set}'`\" = set"; then
  3095.   echo $ac_n "(cached) $ac_c" 1>&6
  3096. else
  3097.   
  3098. cat > conftest.$ac_ext <<EOF
  3099. #line 3100 "configure"
  3100. #include "confdefs.h"
  3101.  
  3102.     /* includes */
  3103. #include <unistd.h>
  3104. #include <sys/types.h>
  3105. #include <sys/uio.h>
  3106. #include <sys/socket.h>
  3107. #include <sys/un.h>
  3108.  
  3109. int main() {
  3110.  
  3111. struct sockaddr_un uaddr;
  3112.  
  3113. uaddr.sun_len = strlen("/tmp/test.sock");
  3114. exit(((int) uaddr.sun_len);    /* bogus code, of course. */
  3115.  
  3116. ; return 0; }
  3117. EOF
  3118. if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3119.   rm -rf conftest*
  3120.   
  3121.     wi_cv_sockaddr_un_sun_len=yes
  3122.  
  3123. else
  3124.   echo "configure: failed program was:" >&5
  3125.   cat conftest.$ac_ext >&5
  3126.   rm -rf conftest*
  3127.   
  3128.     wi_cv_sockaddr_un_sun_len=no
  3129.  
  3130. fi
  3131. rm -rf conftest*
  3132.  
  3133. fi
  3134.  
  3135. echo "$ac_t""$wi_cv_sockaddr_un_sun_len" 1>&6
  3136. if test "$wi_cv_sockaddr_un_sun_len" = yes ; then
  3137.     cat >> confdefs.h <<\EOF
  3138. #define HAVE_SOCKADDR_UN_SUN_LEN 1
  3139. EOF
  3140.  
  3141. fi
  3142.  
  3143. fi
  3144.  
  3145. SIO_OBJS_U=''
  3146. SIO_SOBJS_U=''
  3147. if test "$wi_cv_unix_domain_sockets" = yes ; then
  3148.     SIO_OBJS_U='$(OBJS_U) '
  3149.     SIO_SOBJS_U='$(SOBJS_U) '
  3150. fi
  3151.  
  3152.  
  3153.  
  3154.  
  3155.  
  3156.  
  3157. # Mostly for SunOS 4 -- needs to come first because other libs depend on it
  3158.  
  3159. echo $ac_n "checking for strerror""... $ac_c" 1>&6
  3160. echo "configure:3161: checking for strerror" >&5
  3161. if eval "test \"`echo '$''{'ac_cv_func_strerror'+set}'`\" = set"; then
  3162.   echo $ac_n "(cached) $ac_c" 1>&6
  3163. else
  3164.   cat > conftest.$ac_ext <<EOF
  3165. #line 3166 "configure"
  3166. #include "confdefs.h"
  3167. /* System header to define __stub macros and hopefully few prototypes,
  3168.     which can conflict with char strerror(); below.  */
  3169. #include <assert.h>
  3170. /* Override any gcc2 internal prototype to avoid an error.  */
  3171. /* We use char because int might match the return type of a gcc2
  3172.     builtin and then its argument prototype would still apply.  */
  3173. char strerror();
  3174.  
  3175. int main() {
  3176.  
  3177. /* The GNU C library defines this for functions which it implements
  3178.     to always fail with ENOSYS.  Some functions are actually named
  3179.     something starting with __ and the normal name is an alias.  */
  3180. #if defined (__stub_strerror) || defined (__stub___strerror)
  3181. choke me
  3182. #else
  3183. strerror();
  3184. #endif
  3185.  
  3186. ; return 0; }
  3187. EOF
  3188. if { (eval echo configure:3189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3189.   rm -rf conftest*
  3190.   eval "ac_cv_func_strerror=yes"
  3191. else
  3192.   echo "configure: failed program was:" >&5
  3193.   cat conftest.$ac_ext >&5
  3194.   rm -rf conftest*
  3195.   eval "ac_cv_func_strerror=no"
  3196. fi
  3197. rm -rf conftest*
  3198. fi
  3199.  
  3200. if eval "test \"`echo '$ac_cv_func_'strerror`\" = yes"; then
  3201.   echo "$ac_t""yes" 1>&6
  3202.   a=yes
  3203. else
  3204.   echo "$ac_t""no" 1>&6
  3205. a=no
  3206. fi
  3207.  
  3208. if test "$a" = no ; then
  3209.     # Not in libc, try lib44bsd.
  3210.     echo $ac_n "checking for strerror in -l44bsd""... $ac_c" 1>&6
  3211. echo "configure:3212: checking for strerror in -l44bsd" >&5
  3212. ac_lib_var=`echo 44bsd'_'strerror | sed 'y%./+-%__p_%'`
  3213. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3214.   echo $ac_n "(cached) $ac_c" 1>&6
  3215. else
  3216.   ac_save_LIBS="$LIBS"
  3217. LIBS="-l44bsd  $LIBS"
  3218. cat > conftest.$ac_ext <<EOF
  3219. #line 3220 "configure"
  3220. #include "confdefs.h"
  3221. /* Override any gcc2 internal prototype to avoid an error.  */
  3222. /* We use char because int might match the return type of a gcc2
  3223.     builtin and then its argument prototype would still apply.  */
  3224. char strerror();
  3225.  
  3226. int main() {
  3227. strerror()
  3228. ; return 0; }
  3229. EOF
  3230. if { (eval echo configure:3231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3231.   rm -rf conftest*
  3232.   eval "ac_cv_lib_$ac_lib_var=yes"
  3233. else
  3234.   echo "configure: failed program was:" >&5
  3235.   cat conftest.$ac_ext >&5
  3236.   rm -rf conftest*
  3237.   eval "ac_cv_lib_$ac_lib_var=no"
  3238. fi
  3239. rm -rf conftest*
  3240. LIBS="$ac_save_LIBS"
  3241.  
  3242. fi
  3243. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3244.   echo "$ac_t""yes" 1>&6
  3245.     ac_tr_lib=HAVE_LIB`echo 44bsd | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  3246.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  3247.   cat >> confdefs.h <<EOF
  3248. #define $ac_tr_lib 1
  3249. EOF
  3250.  
  3251.   LIBS="-l44bsd $LIBS"
  3252.  
  3253. else
  3254.   echo "$ac_t""no" 1>&6
  3255. fi
  3256.  
  3257. fi
  3258.  
  3259.  
  3260.  
  3261. echo $ac_n "checking for socket""... $ac_c" 1>&6
  3262. echo "configure:3263: checking for socket" >&5
  3263. if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
  3264.   echo $ac_n "(cached) $ac_c" 1>&6
  3265. else
  3266.   cat > conftest.$ac_ext <<EOF
  3267. #line 3268 "configure"
  3268. #include "confdefs.h"
  3269. /* System header to define __stub macros and hopefully few prototypes,
  3270.     which can conflict with char socket(); below.  */
  3271. #include <assert.h>
  3272. /* Override any gcc2 internal prototype to avoid an error.  */
  3273. /* We use char because int might match the return type of a gcc2
  3274.     builtin and then its argument prototype would still apply.  */
  3275. char socket();
  3276.  
  3277. int main() {
  3278.  
  3279. /* The GNU C library defines this for functions which it implements
  3280.     to always fail with ENOSYS.  Some functions are actually named
  3281.     something starting with __ and the normal name is an alias.  */
  3282. #if defined (__stub_socket) || defined (__stub___socket)
  3283. choke me
  3284. #else
  3285. socket();
  3286. #endif
  3287.  
  3288. ; return 0; }
  3289. EOF
  3290. if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3291.   rm -rf conftest*
  3292.   eval "ac_cv_func_socket=yes"
  3293. else
  3294.   echo "configure: failed program was:" >&5
  3295.   cat conftest.$ac_ext >&5
  3296.   rm -rf conftest*
  3297.   eval "ac_cv_func_socket=no"
  3298. fi
  3299. rm -rf conftest*
  3300. fi
  3301.  
  3302. if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
  3303.   echo "$ac_t""yes" 1>&6
  3304.   a=yes
  3305. else
  3306.   echo "$ac_t""no" 1>&6
  3307. a=no
  3308. fi
  3309.  
  3310. if test "$a" = no ; then
  3311.     # Not in libc, try libsocket.
  3312.     echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
  3313. echo "configure:3314: checking for socket in -lsocket" >&5
  3314. ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
  3315. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3316.   echo $ac_n "(cached) $ac_c" 1>&6
  3317. else
  3318.   ac_save_LIBS="$LIBS"
  3319. LIBS="-lsocket  $LIBS"
  3320. cat > conftest.$ac_ext <<EOF
  3321. #line 3322 "configure"
  3322. #include "confdefs.h"
  3323. /* Override any gcc2 internal prototype to avoid an error.  */
  3324. /* We use char because int might match the return type of a gcc2
  3325.     builtin and then its argument prototype would still apply.  */
  3326. char socket();
  3327.  
  3328. int main() {
  3329. socket()
  3330. ; return 0; }
  3331. EOF
  3332. if { (eval echo configure:3333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3333.   rm -rf conftest*
  3334.   eval "ac_cv_lib_$ac_lib_var=yes"
  3335. else
  3336.   echo "configure: failed program was:" >&5
  3337.   cat conftest.$ac_ext >&5
  3338.   rm -rf conftest*
  3339.   eval "ac_cv_lib_$ac_lib_var=no"
  3340. fi
  3341. rm -rf conftest*
  3342. LIBS="$ac_save_LIBS"
  3343.  
  3344. fi
  3345. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3346.   echo "$ac_t""yes" 1>&6
  3347.     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  3348.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  3349.   cat >> confdefs.h <<EOF
  3350. #define $ac_tr_lib 1
  3351. EOF
  3352.  
  3353.   LIBS="-lsocket $LIBS"
  3354.  
  3355. else
  3356.   echo "$ac_t""no" 1>&6
  3357. fi
  3358.  
  3359. fi
  3360.  
  3361.  
  3362. if test "$SYS" = unixware ; then
  3363.     case "$OS" in
  3364.         unixware2*)
  3365.             # So far, only UnixWare needs this.
  3366.             echo $ac_n "checking for syslog in -lgen""... $ac_c" 1>&6
  3367. echo "configure:3368: checking for syslog in -lgen" >&5
  3368. ac_lib_var=`echo gen'_'syslog | sed 'y%./+-%__p_%'`
  3369. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3370.   echo $ac_n "(cached) $ac_c" 1>&6
  3371. else
  3372.   ac_save_LIBS="$LIBS"
  3373. LIBS="-lgen  $LIBS"
  3374. cat > conftest.$ac_ext <<EOF
  3375. #line 3376 "configure"
  3376. #include "confdefs.h"
  3377. /* Override any gcc2 internal prototype to avoid an error.  */
  3378. /* We use char because int might match the return type of a gcc2
  3379.     builtin and then its argument prototype would still apply.  */
  3380. char syslog();
  3381.  
  3382. int main() {
  3383. syslog()
  3384. ; return 0; }
  3385. EOF
  3386. if { (eval echo configure:3387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3387.   rm -rf conftest*
  3388.   eval "ac_cv_lib_$ac_lib_var=yes"
  3389. else
  3390.   echo "configure: failed program was:" >&5
  3391.   cat conftest.$ac_ext >&5
  3392.   rm -rf conftest*
  3393.   eval "ac_cv_lib_$ac_lib_var=no"
  3394. fi
  3395. rm -rf conftest*
  3396. LIBS="$ac_save_LIBS"
  3397.  
  3398. fi
  3399. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3400.   echo "$ac_t""yes" 1>&6
  3401.     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  3402.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  3403.   cat >> confdefs.h <<EOF
  3404. #define $ac_tr_lib 1
  3405. EOF
  3406.  
  3407.   LIBS="-lgen $LIBS"
  3408.  
  3409. else
  3410.   echo "$ac_t""no" 1>&6
  3411. fi
  3412.  
  3413.  
  3414.             if test -f /usr/ucblib/libucb.a ; then
  3415.                 LDFLAGS="$LDFLAGS -L/usr/ucblib"
  3416.                 LIBS="$LIBS -lucb"
  3417.             fi
  3418.             if test -f /usr/include/unistd.h ; then
  3419.                 ac_cv_header_unistd_h=yes
  3420.             fi
  3421.  
  3422.             # UnixWare 2 needs both lsocket and lnsl, and configure
  3423.             # script won't detect this condition properly because 
  3424.             # the libraries are interdependent.
  3425.             #
  3426.             LIBS="$LIBS -lsocket -lnsl"
  3427.  
  3428.             # Now look for socket()
  3429.             #
  3430.             # AC_CHECK_FUNC(socket,[a=yes],[a=no])
  3431.             #
  3432.             echo $ac_n "checking for socket""... $ac_c" 1>&6
  3433. echo "configure:3434: checking for socket" >&5
  3434. if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
  3435.   echo $ac_n "(cached) $ac_c" 1>&6
  3436. else
  3437.   cat > conftest.$ac_ext <<EOF
  3438. #line 3439 "configure"
  3439. #include "confdefs.h"
  3440. /* System header to define __stub macros and hopefully few prototypes,
  3441.     which can conflict with char socket(); below.  */
  3442. #include <assert.h>
  3443. /* Override any gcc2 internal prototype to avoid an error.  */
  3444. /* We use char because int might match the return type of a gcc2
  3445.     builtin and then its argument prototype would still apply.  */
  3446. char socket();
  3447.  
  3448. int main() {
  3449.  
  3450. /* The GNU C library defines this for functions which it implements
  3451.     to always fail with ENOSYS.  Some functions are actually named
  3452.     something starting with __ and the normal name is an alias.  */
  3453. #if defined (__stub_socket) || defined (__stub___socket)
  3454. choke me
  3455. #else
  3456. socket();
  3457. #endif
  3458.  
  3459. ; return 0; }
  3460. EOF
  3461. if { (eval echo configure:3462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3462.   rm -rf conftest*
  3463.   eval "ac_cv_func_socket=yes"
  3464. else
  3465.   echo "configure: failed program was:" >&5
  3466.   cat conftest.$ac_ext >&5
  3467.   rm -rf conftest*
  3468.   eval "ac_cv_func_socket=no"
  3469. fi
  3470. rm -rf conftest*
  3471. fi
  3472.  
  3473. if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
  3474.   echo "$ac_t""yes" 1>&6
  3475.   a=yes
  3476. else
  3477.   echo "$ac_t""no" 1>&6
  3478. a=no
  3479. fi
  3480.  
  3481.             ;;
  3482.         *)
  3483.             ;;
  3484.     esac
  3485. fi
  3486.  
  3487.  
  3488.  
  3489.  
  3490. case "$OS" in
  3491.     hpux1123456789*)
  3492.         # HP-UX 11 uses NSL for YP services
  3493.         echo $ac_n "checking for getpwent in -lnsl""... $ac_c" 1>&6
  3494. echo "configure:3495: checking for getpwent in -lnsl" >&5
  3495. ac_lib_var=`echo nsl'_'getpwent | sed 'y%./+-%__p_%'`
  3496. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3497.   echo $ac_n "(cached) $ac_c" 1>&6
  3498. else
  3499.   ac_save_LIBS="$LIBS"
  3500. LIBS="-lnsl  $LIBS"
  3501. cat > conftest.$ac_ext <<EOF
  3502. #line 3503 "configure"
  3503. #include "confdefs.h"
  3504. /* Override any gcc2 internal prototype to avoid an error.  */
  3505. /* We use char because int might match the return type of a gcc2
  3506.     builtin and then its argument prototype would still apply.  */
  3507. char getpwent();
  3508.  
  3509. int main() {
  3510. getpwent()
  3511. ; return 0; }
  3512. EOF
  3513. if { (eval echo configure:3514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3514.   rm -rf conftest*
  3515.   eval "ac_cv_lib_$ac_lib_var=yes"
  3516. else
  3517.   echo "configure: failed program was:" >&5
  3518.   cat conftest.$ac_ext >&5
  3519.   rm -rf conftest*
  3520.   eval "ac_cv_lib_$ac_lib_var=no"
  3521. fi
  3522. rm -rf conftest*
  3523. LIBS="$ac_save_LIBS"
  3524.  
  3525. fi
  3526. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3527.   echo "$ac_t""yes" 1>&6
  3528.     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  3529.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  3530.   cat >> confdefs.h <<EOF
  3531. #define $ac_tr_lib 1
  3532. EOF
  3533.  
  3534.   LIBS="-lnsl $LIBS"
  3535.  
  3536. else
  3537.   echo "$ac_t""no" 1>&6
  3538. fi
  3539.  
  3540.         ;;
  3541.  
  3542.     *)
  3543.         echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
  3544. echo "configure:3545: checking for gethostbyname" >&5
  3545. if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
  3546.   echo $ac_n "(cached) $ac_c" 1>&6
  3547. else
  3548.   cat > conftest.$ac_ext <<EOF
  3549. #line 3550 "configure"
  3550. #include "confdefs.h"
  3551. /* System header to define __stub macros and hopefully few prototypes,
  3552.     which can conflict with char gethostbyname(); below.  */
  3553. #include <assert.h>
  3554. /* Override any gcc2 internal prototype to avoid an error.  */
  3555. /* We use char because int might match the return type of a gcc2
  3556.     builtin and then its argument prototype would still apply.  */
  3557. char gethostbyname();
  3558.  
  3559. int main() {
  3560.  
  3561. /* The GNU C library defines this for functions which it implements
  3562.     to always fail with ENOSYS.  Some functions are actually named
  3563.     something starting with __ and the normal name is an alias.  */
  3564. #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
  3565. choke me
  3566. #else
  3567. gethostbyname();
  3568. #endif
  3569.  
  3570. ; return 0; }
  3571. EOF
  3572. if { (eval echo configure:3573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3573.   rm -rf conftest*
  3574.   eval "ac_cv_func_gethostbyname=yes"
  3575. else
  3576.   echo "configure: failed program was:" >&5
  3577.   cat conftest.$ac_ext >&5
  3578.   rm -rf conftest*
  3579.   eval "ac_cv_func_gethostbyname=no"
  3580. fi
  3581. rm -rf conftest*
  3582. fi
  3583.  
  3584. if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
  3585.   echo "$ac_t""yes" 1>&6
  3586.   a=yes
  3587. else
  3588.   echo "$ac_t""no" 1>&6
  3589. a=no
  3590. fi
  3591.  
  3592.         if test "$a" = no ; then
  3593.             # Not in libc, try libnsl.
  3594.             echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
  3595. echo "configure:3596: checking for gethostbyname in -lnsl" >&5
  3596. ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
  3597. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3598.   echo $ac_n "(cached) $ac_c" 1>&6
  3599. else
  3600.   ac_save_LIBS="$LIBS"
  3601. LIBS="-lnsl  $LIBS"
  3602. cat > conftest.$ac_ext <<EOF
  3603. #line 3604 "configure"
  3604. #include "confdefs.h"
  3605. /* Override any gcc2 internal prototype to avoid an error.  */
  3606. /* We use char because int might match the return type of a gcc2
  3607.     builtin and then its argument prototype would still apply.  */
  3608. char gethostbyname();
  3609.  
  3610. int main() {
  3611. gethostbyname()
  3612. ; return 0; }
  3613. EOF
  3614. if { (eval echo configure:3615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3615.   rm -rf conftest*
  3616.   eval "ac_cv_lib_$ac_lib_var=yes"
  3617. else
  3618.   echo "configure: failed program was:" >&5
  3619.   cat conftest.$ac_ext >&5
  3620.   rm -rf conftest*
  3621.   eval "ac_cv_lib_$ac_lib_var=no"
  3622. fi
  3623. rm -rf conftest*
  3624. LIBS="$ac_save_LIBS"
  3625.  
  3626. fi
  3627. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3628.   echo "$ac_t""yes" 1>&6
  3629.     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  3630.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  3631.   cat >> confdefs.h <<EOF
  3632. #define $ac_tr_lib 1
  3633. EOF
  3634.  
  3635.   LIBS="-lnsl $LIBS"
  3636.  
  3637. else
  3638.   echo "$ac_t""no" 1>&6
  3639. fi
  3640.  
  3641.         fi
  3642.         ;;
  3643. esac
  3644.  
  3645.  
  3646.  
  3647. # See if we could access two well-known sites without help of any special
  3648. # libraries, like resolv.
  3649. echo $ac_n "checking if we need to look for a separate DNS resolver library""... $ac_c" 1>&6
  3650. echo "configure:3651: checking if we need to look for a separate DNS resolver library" >&5
  3651. if eval "test \"`echo '$''{'wi_cv_look_for_resolv'+set}'`\" = set"; then
  3652.   echo $ac_n "(cached) $ac_c" 1>&6
  3653. else
  3654.   
  3655.  
  3656.     if test "x$ac_cv_header_unistd_h" = x ; then
  3657.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_LIB_RESOLV." 1>&2; exit 1; }
  3658.     fi
  3659.  
  3660. if test "$cross_compiling" = yes; then
  3661.   
  3662.     # action if cross compiling
  3663.     guess="(guessing) "
  3664.     wi_cv_look_for_resolv=yes
  3665.  
  3666. else
  3667.   cat > conftest.$ac_ext <<EOF
  3668. #line 3669 "configure"
  3669. #include "confdefs.h"
  3670.  
  3671. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  3672. #    define _ALL_SOURCE 1
  3673. #endif
  3674. #ifdef HAVE_UNISTD_H
  3675. #    include <unistd.h>
  3676. #endif
  3677. #include <sys/types.h>
  3678. #include <sys/socket.h>
  3679. #include <netinet/in.h>
  3680. #include <netdb.h>
  3681.  
  3682. main()
  3683. {
  3684.     struct hostent *hp1, *hp2;
  3685.  
  3686.     hp1 = gethostbyname("ftp.ncftp.com");
  3687.     if (hp1 == (struct hostent *) 0) {
  3688.         hp2 = gethostbyname("www.ibm.com");
  3689.         if (hp2 == (struct hostent *) 0)
  3690.             exit(1);
  3691.     }
  3692.     exit(0);
  3693. }
  3694. EOF
  3695. if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  3696. then
  3697.   
  3698.     # action if true
  3699.     guess=""
  3700.     wi_cv_look_for_resolv=no
  3701.  
  3702. else
  3703.   echo "configure: failed program was:" >&5
  3704.   cat conftest.$ac_ext >&5
  3705.   rm -fr conftest*
  3706.   
  3707.     # action if false
  3708.     guess=""
  3709.     wi_cv_look_for_resolv=yes
  3710.  
  3711. fi
  3712. rm -fr conftest*
  3713. fi
  3714.  
  3715. fi
  3716.  
  3717. echo "$ac_t""$guess$wi_cv_look_for_resolv" 1>&6
  3718. guess=""
  3719.  
  3720.  
  3721. if test "$wi_cv_look_for_resolv" = yes ; then
  3722. echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6
  3723. echo "configure:3724: checking for main in -lresolv" >&5
  3724. ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'`
  3725. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3726.   echo $ac_n "(cached) $ac_c" 1>&6
  3727. else
  3728.   ac_save_LIBS="$LIBS"
  3729. LIBS="-lresolv  $LIBS"
  3730. cat > conftest.$ac_ext <<EOF
  3731. #line 3732 "configure"
  3732. #include "confdefs.h"
  3733.  
  3734. int main() {
  3735. main()
  3736. ; return 0; }
  3737. EOF
  3738. if { (eval echo configure:3739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3739.   rm -rf conftest*
  3740.   eval "ac_cv_lib_$ac_lib_var=yes"
  3741. else
  3742.   echo "configure: failed program was:" >&5
  3743.   cat conftest.$ac_ext >&5
  3744.   rm -rf conftest*
  3745.   eval "ac_cv_lib_$ac_lib_var=no"
  3746. fi
  3747. rm -rf conftest*
  3748. LIBS="$ac_save_LIBS"
  3749.  
  3750. fi
  3751. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3752.   echo "$ac_t""yes" 1>&6
  3753.     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  3754.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  3755.   cat >> confdefs.h <<EOF
  3756. #define $ac_tr_lib 1
  3757. EOF
  3758.  
  3759.   LIBS="-lresolv $LIBS"
  3760.  
  3761. else
  3762.   echo "$ac_t""no" 1>&6
  3763. fi
  3764.  
  3765. else
  3766.     ac_cv_lib_resolv=no
  3767. fi
  3768.  
  3769.  
  3770. if test "$SYS" = dynixptx ; then
  3771.     LIBS="$LIBS -lsocket -lnsl"
  3772. fi
  3773.  
  3774.  
  3775.  
  3776.     if test "$wi_want_socks5" != yes ; then
  3777.         ac_cv_lib_socks5_SOCKSinit=no
  3778.     else
  3779.         # Look for the "SOCKS" library for use with Firewalls/Gateways.
  3780.         SOCKS_LIBS=''
  3781.  
  3782.         # First check for extra libraries that may be needed to
  3783.         # link against socks.  If we already checked for one or
  3784.         # more of these libraries, we don't want to count them
  3785.         # in the socks-only list.
  3786.         #
  3787.         if test "x$ac_cv_lib_db_main" = "x" ; then
  3788.             echo $ac_n "checking for main in -ldb""... $ac_c" 1>&6
  3789. echo "configure:3790: checking for main in -ldb" >&5
  3790. ac_lib_var=`echo db'_'main | sed 'y%./+-%__p_%'`
  3791. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3792.   echo $ac_n "(cached) $ac_c" 1>&6
  3793. else
  3794.   ac_save_LIBS="$LIBS"
  3795. LIBS="-ldb  $LIBS"
  3796. cat > conftest.$ac_ext <<EOF
  3797. #line 3798 "configure"
  3798. #include "confdefs.h"
  3799.  
  3800. int main() {
  3801. main()
  3802. ; return 0; }
  3803. EOF
  3804. if { (eval echo configure:3805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3805.   rm -rf conftest*
  3806.   eval "ac_cv_lib_$ac_lib_var=yes"
  3807. else
  3808.   echo "configure: failed program was:" >&5
  3809.   cat conftest.$ac_ext >&5
  3810.   rm -rf conftest*
  3811.   eval "ac_cv_lib_$ac_lib_var=no"
  3812. fi
  3813. rm -rf conftest*
  3814. LIBS="$ac_save_LIBS"
  3815.  
  3816. fi
  3817. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3818.   echo "$ac_t""yes" 1>&6
  3819.   SOCKS_LIBS="$SOCKS_LIBS -ldb"
  3820. else
  3821.   echo "$ac_t""no" 1>&6
  3822. fi
  3823.  
  3824.         fi
  3825.         if test "x$ac_cv_lib_isode_main" = "x" ; then
  3826.             echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
  3827. echo "configure:3828: checking for main in -lisode" >&5
  3828. ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
  3829. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3830.   echo $ac_n "(cached) $ac_c" 1>&6
  3831. else
  3832.   ac_save_LIBS="$LIBS"
  3833. LIBS="-lisode  $LIBS"
  3834. cat > conftest.$ac_ext <<EOF
  3835. #line 3836 "configure"
  3836. #include "confdefs.h"
  3837.  
  3838. int main() {
  3839. main()
  3840. ; return 0; }
  3841. EOF
  3842. if { (eval echo configure:3843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3843.   rm -rf conftest*
  3844.   eval "ac_cv_lib_$ac_lib_var=yes"
  3845. else
  3846.   echo "configure: failed program was:" >&5
  3847.   cat conftest.$ac_ext >&5
  3848.   rm -rf conftest*
  3849.   eval "ac_cv_lib_$ac_lib_var=no"
  3850. fi
  3851. rm -rf conftest*
  3852. LIBS="$ac_save_LIBS"
  3853.  
  3854. fi
  3855. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3856.   echo "$ac_t""yes" 1>&6
  3857.   SOCKS_LIBS="$SOCKS_LIBS -lisode"
  3858. else
  3859.   echo "$ac_t""no" 1>&6
  3860. fi
  3861.  
  3862.         fi
  3863.         if test "x$ac_cv_lib_com_err_main" = "x" ; then
  3864.             echo $ac_n "checking for main in -lcom_err""... $ac_c" 1>&6
  3865. echo "configure:3866: checking for main in -lcom_err" >&5
  3866. ac_lib_var=`echo com_err'_'main | sed 'y%./+-%__p_%'`
  3867. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3868.   echo $ac_n "(cached) $ac_c" 1>&6
  3869. else
  3870.   ac_save_LIBS="$LIBS"
  3871. LIBS="-lcom_err  $LIBS"
  3872. cat > conftest.$ac_ext <<EOF
  3873. #line 3874 "configure"
  3874. #include "confdefs.h"
  3875.  
  3876. int main() {
  3877. main()
  3878. ; return 0; }
  3879. EOF
  3880. if { (eval echo configure:3881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3881.   rm -rf conftest*
  3882.   eval "ac_cv_lib_$ac_lib_var=yes"
  3883. else
  3884.   echo "configure: failed program was:" >&5
  3885.   cat conftest.$ac_ext >&5
  3886.   rm -rf conftest*
  3887.   eval "ac_cv_lib_$ac_lib_var=no"
  3888. fi
  3889. rm -rf conftest*
  3890. LIBS="$ac_save_LIBS"
  3891.  
  3892. fi
  3893. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3894.   echo "$ac_t""yes" 1>&6
  3895.   SOCKS_LIBS="$SOCKS_LIBS -lcom_err"
  3896. else
  3897.   echo "$ac_t""no" 1>&6
  3898. fi
  3899.  
  3900.         fi
  3901.         if test "x$ac_cv_lib_crypto_main" = "x" ; then
  3902.             echo $ac_n "checking for main in -lcrypto""... $ac_c" 1>&6
  3903. echo "configure:3904: checking for main in -lcrypto" >&5
  3904. ac_lib_var=`echo crypto'_'main | sed 'y%./+-%__p_%'`
  3905. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3906.   echo $ac_n "(cached) $ac_c" 1>&6
  3907. else
  3908.   ac_save_LIBS="$LIBS"
  3909. LIBS="-lcrypto  $LIBS"
  3910. cat > conftest.$ac_ext <<EOF
  3911. #line 3912 "configure"
  3912. #include "confdefs.h"
  3913.  
  3914. int main() {
  3915. main()
  3916. ; return 0; }
  3917. EOF
  3918. if { (eval echo configure:3919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3919.   rm -rf conftest*
  3920.   eval "ac_cv_lib_$ac_lib_var=yes"
  3921. else
  3922.   echo "configure: failed program was:" >&5
  3923.   cat conftest.$ac_ext >&5
  3924.   rm -rf conftest*
  3925.   eval "ac_cv_lib_$ac_lib_var=no"
  3926. fi
  3927. rm -rf conftest*
  3928. LIBS="$ac_save_LIBS"
  3929.  
  3930. fi
  3931. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3932.   echo "$ac_t""yes" 1>&6
  3933.   SOCKS_LIBS="$SOCKS_LIBS -lcrypto"
  3934. else
  3935.   echo "$ac_t""no" 1>&6
  3936. fi
  3937.  
  3938.         fi
  3939.         if test "x$ac_cv_lib_krb5_main" = "x" ; then
  3940.             echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
  3941. echo "configure:3942: checking for main in -lkrb5" >&5
  3942. ac_lib_var=`echo krb5'_'main | sed 'y%./+-%__p_%'`
  3943. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3944.   echo $ac_n "(cached) $ac_c" 1>&6
  3945. else
  3946.   ac_save_LIBS="$LIBS"
  3947. LIBS="-lkrb5  $LIBS"
  3948. cat > conftest.$ac_ext <<EOF
  3949. #line 3950 "configure"
  3950. #include "confdefs.h"
  3951.  
  3952. int main() {
  3953. main()
  3954. ; return 0; }
  3955. EOF
  3956. if { (eval echo configure:3957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3957.   rm -rf conftest*
  3958.   eval "ac_cv_lib_$ac_lib_var=yes"
  3959. else
  3960.   echo "configure: failed program was:" >&5
  3961.   cat conftest.$ac_ext >&5
  3962.   rm -rf conftest*
  3963.   eval "ac_cv_lib_$ac_lib_var=no"
  3964. fi
  3965. rm -rf conftest*
  3966. LIBS="$ac_save_LIBS"
  3967.  
  3968. fi
  3969. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  3970.   echo "$ac_t""yes" 1>&6
  3971.   SOCKS_LIBS="$SOCKS_LIBS -lkrb5"
  3972. else
  3973.   echo "$ac_t""no" 1>&6
  3974. fi
  3975.  
  3976.         fi
  3977.         if test "x$ac_cv_lib_gssapi_krb5_main" = "x" ; then
  3978.             echo $ac_n "checking for main in -lgssapi_krb5""... $ac_c" 1>&6
  3979. echo "configure:3980: checking for main in -lgssapi_krb5" >&5
  3980. ac_lib_var=`echo gssapi_krb5'_'main | sed 'y%./+-%__p_%'`
  3981. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  3982.   echo $ac_n "(cached) $ac_c" 1>&6
  3983. else
  3984.   ac_save_LIBS="$LIBS"
  3985. LIBS="-lgssapi_krb5  $LIBS"
  3986. cat > conftest.$ac_ext <<EOF
  3987. #line 3988 "configure"
  3988. #include "confdefs.h"
  3989.  
  3990. int main() {
  3991. main()
  3992. ; return 0; }
  3993. EOF
  3994. if { (eval echo configure:3995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  3995.   rm -rf conftest*
  3996.   eval "ac_cv_lib_$ac_lib_var=yes"
  3997. else
  3998.   echo "configure: failed program was:" >&5
  3999.   cat conftest.$ac_ext >&5
  4000.   rm -rf conftest*
  4001.   eval "ac_cv_lib_$ac_lib_var=no"
  4002. fi
  4003. rm -rf conftest*
  4004. LIBS="$ac_save_LIBS"
  4005.  
  4006. fi
  4007. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  4008.   echo "$ac_t""yes" 1>&6
  4009.   SOCKS_LIBS="$SOCKS_LIBS -lgssapi_krb5"
  4010. else
  4011.   echo "$ac_t""no" 1>&6
  4012. fi
  4013.  
  4014.         fi
  4015.  
  4016.         echo $ac_n "checking for SOCKSinit in -lsocks5""... $ac_c" 1>&6
  4017. echo "configure:4018: checking for SOCKSinit in -lsocks5" >&5
  4018. ac_lib_var=`echo socks5'_'SOCKSinit | sed 'y%./+-%__p_%'`
  4019. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  4020.   echo $ac_n "(cached) $ac_c" 1>&6
  4021. else
  4022.   ac_save_LIBS="$LIBS"
  4023. LIBS="-lsocks5  $LIBS"
  4024. cat > conftest.$ac_ext <<EOF
  4025. #line 4026 "configure"
  4026. #include "confdefs.h"
  4027. /* Override any gcc2 internal prototype to avoid an error.  */
  4028. /* We use char because int might match the return type of a gcc2
  4029.     builtin and then its argument prototype would still apply.  */
  4030. char SOCKSinit();
  4031.  
  4032. int main() {
  4033. SOCKSinit()
  4034. ; return 0; }
  4035. EOF
  4036. if { (eval echo configure:4037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  4037.   rm -rf conftest*
  4038.   eval "ac_cv_lib_$ac_lib_var=yes"
  4039. else
  4040.   echo "configure: failed program was:" >&5
  4041.   cat conftest.$ac_ext >&5
  4042.   rm -rf conftest*
  4043.   eval "ac_cv_lib_$ac_lib_var=no"
  4044. fi
  4045. rm -rf conftest*
  4046. LIBS="$ac_save_LIBS"
  4047.  
  4048. fi
  4049. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  4050.   echo "$ac_t""yes" 1>&6
  4051.   SOCKS_LIBS="$SOCKS_LIBS -lsocks5"
  4052. else
  4053.   echo "$ac_t""no" 1>&6
  4054. fi
  4055.  
  4056.         for ac_hdr in socks.h socks5p.h
  4057. do
  4058. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  4059. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  4060. echo "configure:4061: checking for $ac_hdr" >&5
  4061. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  4062.   echo $ac_n "(cached) $ac_c" 1>&6
  4063. else
  4064.   cat > conftest.$ac_ext <<EOF
  4065. #line 4066 "configure"
  4066. #include "confdefs.h"
  4067. #include <$ac_hdr>
  4068. EOF
  4069. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  4070. { (eval echo configure:4071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  4071. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  4072. if test -z "$ac_err"; then
  4073.   rm -rf conftest*
  4074.   eval "ac_cv_header_$ac_safe=yes"
  4075. else
  4076.   echo "$ac_err" >&5
  4077.   echo "configure: failed program was:" >&5
  4078.   cat conftest.$ac_ext >&5
  4079.   rm -rf conftest*
  4080.   eval "ac_cv_header_$ac_safe=no"
  4081. fi
  4082. rm -rf conftest*
  4083. fi
  4084. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  4085.   echo "$ac_t""yes" 1>&6
  4086.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  4087.   cat >> confdefs.h <<EOF
  4088. #define $ac_tr_hdr 1
  4089. EOF
  4090.  
  4091. else
  4092.   echo "$ac_t""no" 1>&6
  4093. fi
  4094. done
  4095.  
  4096.  
  4097.         if test "$ac_cv_lib_socks5_SOCKSinit" != yes ; then
  4098.             ac_cv_lib_socks5_SOCKSinit=no
  4099.             unset SOCKS_LIBS
  4100.         else
  4101.             
  4102.             cat >> confdefs.h <<\EOF
  4103. #define SOCKS 5
  4104. EOF
  4105.  
  4106.         fi
  4107.     fi
  4108.     echo $ac_n "checking if SOCKS5 will be used""... $ac_c" 1>&6
  4109. echo "configure:4110: checking if SOCKS5 will be used" >&5
  4110.     echo "$ac_t""$ac_cv_lib_socks5_SOCKSinit" 1>&6
  4111.  
  4112.  
  4113. LIBCURSES=''
  4114. if test "$nc_cv_curses" = yes ; then
  4115.     
  4116.  
  4117. echo $ac_n "checking for curses library headers""... $ac_c" 1>&6
  4118. echo "configure:4119: checking for curses library headers" >&5
  4119. if test "$wi_cv_ncurses" != "no" ; then
  4120.     for ac_hdr in ncurses.h curses.h termios.h termio.h sgtty.h sys/ioctl.h
  4121. do
  4122. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  4123. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  4124. echo "configure:4125: checking for $ac_hdr" >&5
  4125. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  4126.   echo $ac_n "(cached) $ac_c" 1>&6
  4127. else
  4128.   cat > conftest.$ac_ext <<EOF
  4129. #line 4130 "configure"
  4130. #include "confdefs.h"
  4131. #include <$ac_hdr>
  4132. EOF
  4133. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  4134. { (eval echo configure:4135: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  4135. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  4136. if test -z "$ac_err"; then
  4137.   rm -rf conftest*
  4138.   eval "ac_cv_header_$ac_safe=yes"
  4139. else
  4140.   echo "$ac_err" >&5
  4141.   echo "configure: failed program was:" >&5
  4142.   cat conftest.$ac_ext >&5
  4143.   rm -rf conftest*
  4144.   eval "ac_cv_header_$ac_safe=no"
  4145. fi
  4146. rm -rf conftest*
  4147. fi
  4148. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  4149.   echo "$ac_t""yes" 1>&6
  4150.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  4151.   cat >> confdefs.h <<EOF
  4152. #define $ac_tr_hdr 1
  4153. EOF
  4154.  
  4155. else
  4156.   echo "$ac_t""no" 1>&6
  4157. fi
  4158. done
  4159.  
  4160. else
  4161.     for ac_hdr in curses.h termios.h termio.h sgtty.h sys/ioctl.h
  4162. do
  4163. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  4164. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  4165. echo "configure:4166: checking for $ac_hdr" >&5
  4166. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  4167.   echo $ac_n "(cached) $ac_c" 1>&6
  4168. else
  4169.   cat > conftest.$ac_ext <<EOF
  4170. #line 4171 "configure"
  4171. #include "confdefs.h"
  4172. #include <$ac_hdr>
  4173. EOF
  4174. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  4175. { (eval echo configure:4176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  4176. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  4177. if test -z "$ac_err"; then
  4178.   rm -rf conftest*
  4179.   eval "ac_cv_header_$ac_safe=yes"
  4180. else
  4181.   echo "$ac_err" >&5
  4182.   echo "configure: failed program was:" >&5
  4183.   cat conftest.$ac_ext >&5
  4184.   rm -rf conftest*
  4185.   eval "ac_cv_header_$ac_safe=no"
  4186. fi
  4187. rm -rf conftest*
  4188. fi
  4189. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  4190.   echo "$ac_t""yes" 1>&6
  4191.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  4192.   cat >> confdefs.h <<EOF
  4193. #define $ac_tr_hdr 1
  4194. EOF
  4195.  
  4196. else
  4197.   echo "$ac_t""no" 1>&6
  4198. fi
  4199. done
  4200.  
  4201. fi
  4202. if test "$ac_cv_header_curses_h" = no ; then
  4203.     if test -f /usr/include/curses.h ; then
  4204.         cat >> confdefs.h <<\EOF
  4205. #define HAVE_CURSES_H 1
  4206. EOF
  4207.  
  4208.         ac_cv_header_curses_h=yes
  4209.     fi
  4210. fi
  4211.  
  4212. echo $ac_n "checking for curses library""... $ac_c" 1>&6
  4213. echo "configure:4214: checking for curses library" >&5
  4214.  
  4215. wi_cv_lib_curses=no
  4216. wi_cv_lib_curses_result=no
  4217. ac_save_LIBS="$LIBS"
  4218. for LIBCURSES in "-lncurses" "-lcurses" "-lcurses -ltermcap" "-ltermcap -lcurses"
  4219. do
  4220.     if test "x$LIBCURSES-$wi_cv_ncurses" = "x-lncurses-no" ; then
  4221.         # This should never work
  4222.         LIBCURSES="-lkdfjkdjfs"
  4223.     fi
  4224.     LIBS="$ac_save_LIBS $LIBCURSES"
  4225.     cat > conftest.$ac_ext <<EOF
  4226. #line 4227 "configure"
  4227. #include "confdefs.h"
  4228.  
  4229.         /* includes */
  4230. #include <stdio.h>
  4231. #include <stdlib.h>
  4232.  
  4233. #ifdef HAVE_NCURSES_H
  4234. #    include <ncurses.h>
  4235. #else
  4236. #    include <curses.h>
  4237. #endif
  4238.     
  4239. int main() {
  4240.  
  4241.         /* function body */
  4242.         if (strcmp("jimmy", "floyd") == 0)
  4243.             initscr();
  4244.         exit(0);
  4245.     
  4246. ; return 0; }
  4247. EOF
  4248. if { (eval echo configure:4249: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  4249.   rm -rf conftest*
  4250.   
  4251.         linked_with_LIBCURSES=yes
  4252.     
  4253. else
  4254.   echo "configure: failed program was:" >&5
  4255.   cat conftest.$ac_ext >&5
  4256.   rm -rf conftest*
  4257.   
  4258.         linked_with_LIBCURSES=no
  4259.     
  4260. fi
  4261. rm -rf conftest*
  4262.     if test "x$linked_with_LIBCURSES" != "xyes" ; then continue ; fi
  4263.     if test "$cross_compiling" = yes; then
  4264.   
  4265.     # action if cross compiling
  4266.     wi_cv_lib_curses=yes
  4267.     wi_cv_lib_curses_result="yes"
  4268.     guess="(guessing) "
  4269.  
  4270. else
  4271.   cat > conftest.$ac_ext <<EOF
  4272. #line 4273 "configure"
  4273. #include "confdefs.h"
  4274.  
  4275.     /* program */
  4276. #include <stdio.h>
  4277. #include <stdlib.h>
  4278.  
  4279. #ifdef HAVE_NCURSES_H
  4280. #    include <ncurses.h>
  4281. #else
  4282. #    include <curses.h>
  4283. #endif
  4284.  
  4285.  
  4286. main(int argc, char **argv)
  4287. {
  4288.     /* Note:  don't actually call curses, since it may block;
  4289.      * We just want to see if it (dynamic) linked in okay.
  4290.      */
  4291.     if (argc == 0)
  4292.         initscr();
  4293.     exit(0);
  4294. }
  4295.  
  4296. EOF
  4297. if { (eval echo configure:4298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  4298. then
  4299.   
  4300.     # action if true
  4301.     wi_cv_lib_curses=yes
  4302.     guess=""
  4303.     wi_cv_lib_curses_result="yes"
  4304.  
  4305. else
  4306.   echo "configure: failed program was:" >&5
  4307.   cat conftest.$ac_ext >&5
  4308.   rm -fr conftest*
  4309.   
  4310.     # action if false
  4311.     wi_cv_lib_curses=no
  4312.     guess=""
  4313.  
  4314. fi
  4315. rm -fr conftest*
  4316. fi
  4317.  
  4318.  
  4319.     if test "$wi_cv_lib_curses" = yes ; then break ; fi
  4320. done
  4321.  
  4322. # restore LIBS
  4323. LIBS="$ac_save_LIBS"
  4324.  
  4325. if test "$wi_cv_lib_curses_result" != "no" ; then
  4326.     case "$LIBCURSES" in
  4327.         "-lncurses")
  4328.             cat >> confdefs.h <<\EOF
  4329. #define HAVE_LIBNCURSES 1
  4330. EOF
  4331.  
  4332.             ;;
  4333.         "-lcurses")
  4334.             cat >> confdefs.h <<\EOF
  4335. #define HAVE_LIBCURSES 1
  4336. EOF
  4337.  
  4338.             ;;
  4339.         "-lcurses -ltermcap")
  4340.             cat >> confdefs.h <<\EOF
  4341. #define HAVE_LIBCURSES 1
  4342. EOF
  4343.  
  4344.             ;;
  4345.         "-ltermcap -lcurses")
  4346.             cat >> confdefs.h <<\EOF
  4347. #define HAVE_LIBCURSES 1
  4348. EOF
  4349.  
  4350.             ;;
  4351.     esac
  4352. else
  4353.     LIBCURSES=''
  4354. fi
  4355.  
  4356.  
  4357. echo "$ac_t""$wi_cv_lib_curses_result" 1>&6
  4358.  
  4359. fi
  4360.  
  4361.  
  4362.  
  4363. echo $ac_n "checking for working const""... $ac_c" 1>&6
  4364. echo "configure:4365: checking for working const" >&5
  4365. if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
  4366.   echo $ac_n "(cached) $ac_c" 1>&6
  4367. else
  4368.   cat > conftest.$ac_ext <<EOF
  4369. #line 4370 "configure"
  4370. #include "confdefs.h"
  4371.  
  4372. int main() {
  4373.  
  4374. /* Ultrix mips cc rejects this.  */
  4375. typedef int charset[2]; const charset x;
  4376. /* SunOS 4.1.1 cc rejects this.  */
  4377. char const *const *ccp;
  4378. char **p;
  4379. /* NEC SVR4.0.2 mips cc rejects this.  */
  4380. struct point {int x, y;};
  4381. static struct point const zero = {0,0};
  4382. /* AIX XL C 1.02.0.0 rejects this.
  4383.    It does not let you subtract one const X* pointer from another in an arm
  4384.    of an if-expression whose if-part is not a constant expression */
  4385. const char *g = "string";
  4386. ccp = &g + (g ? g-g : 0);
  4387. /* HPUX 7.0 cc rejects these. */
  4388. ++ccp;
  4389. p = (char**) ccp;
  4390. ccp = (char const *const *) p;
  4391. { /* SCO 3.2v4 cc rejects this.  */
  4392.   char *t;
  4393.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  4394.  
  4395.   *t++ = 0;
  4396. }
  4397. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  4398.   int x[] = {25, 17};
  4399.   const int *foo = &x[0];
  4400.   ++foo;
  4401. }
  4402. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  4403.   typedef const int *iptr;
  4404.   iptr p = 0;
  4405.   ++p;
  4406. }
  4407. { /* AIX XL C 1.02.0.0 rejects this saying
  4408.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  4409.   struct s { int j; const int *ap[3]; };
  4410.   struct s *b; b->j = 5;
  4411. }
  4412. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  4413.   const int foo = 10;
  4414. }
  4415.  
  4416. ; return 0; }
  4417. EOF
  4418. if { (eval echo configure:4419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  4419.   rm -rf conftest*
  4420.   ac_cv_c_const=yes
  4421. else
  4422.   echo "configure: failed program was:" >&5
  4423.   cat conftest.$ac_ext >&5
  4424.   rm -rf conftest*
  4425.   ac_cv_c_const=no
  4426. fi
  4427. rm -rf conftest*
  4428. fi
  4429.  
  4430. echo "$ac_t""$ac_cv_c_const" 1>&6
  4431. if test $ac_cv_c_const = no; then
  4432.   cat >> confdefs.h <<\EOF
  4433. #define const 
  4434. EOF
  4435.  
  4436. fi
  4437.  
  4438. echo $ac_n "checking for size_t""... $ac_c" 1>&6
  4439. echo "configure:4440: checking for size_t" >&5
  4440. if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
  4441.   echo $ac_n "(cached) $ac_c" 1>&6
  4442. else
  4443.   cat > conftest.$ac_ext <<EOF
  4444. #line 4445 "configure"
  4445. #include "confdefs.h"
  4446. #include <sys/types.h>
  4447. #if STDC_HEADERS
  4448. #include <stdlib.h>
  4449. #include <stddef.h>
  4450. #endif
  4451. EOF
  4452. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4453.   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  4454.   rm -rf conftest*
  4455.   ac_cv_type_size_t=yes
  4456. else
  4457.   rm -rf conftest*
  4458.   ac_cv_type_size_t=no
  4459. fi
  4460. rm -rf conftest*
  4461.  
  4462. fi
  4463. echo "$ac_t""$ac_cv_type_size_t" 1>&6
  4464. if test $ac_cv_type_size_t = no; then
  4465.   cat >> confdefs.h <<\EOF
  4466. #define size_t unsigned
  4467. EOF
  4468.  
  4469. fi
  4470.  
  4471. echo $ac_n "checking for off_t""... $ac_c" 1>&6
  4472. echo "configure:4473: checking for off_t" >&5
  4473. if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
  4474.   echo $ac_n "(cached) $ac_c" 1>&6
  4475. else
  4476.   cat > conftest.$ac_ext <<EOF
  4477. #line 4478 "configure"
  4478. #include "confdefs.h"
  4479. #include <sys/types.h>
  4480. #if STDC_HEADERS
  4481. #include <stdlib.h>
  4482. #include <stddef.h>
  4483. #endif
  4484. EOF
  4485. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4486.   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  4487.   rm -rf conftest*
  4488.   ac_cv_type_off_t=yes
  4489. else
  4490.   rm -rf conftest*
  4491.   ac_cv_type_off_t=no
  4492. fi
  4493. rm -rf conftest*
  4494.  
  4495. fi
  4496. echo "$ac_t""$ac_cv_type_off_t" 1>&6
  4497. if test $ac_cv_type_off_t = no; then
  4498.   cat >> confdefs.h <<\EOF
  4499. #define off_t long
  4500. EOF
  4501.  
  4502. fi
  4503.  
  4504. echo $ac_n "checking for mode_t""... $ac_c" 1>&6
  4505. echo "configure:4506: checking for mode_t" >&5
  4506. if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
  4507.   echo $ac_n "(cached) $ac_c" 1>&6
  4508. else
  4509.   cat > conftest.$ac_ext <<EOF
  4510. #line 4511 "configure"
  4511. #include "confdefs.h"
  4512. #include <sys/types.h>
  4513. #if STDC_HEADERS
  4514. #include <stdlib.h>
  4515. #include <stddef.h>
  4516. #endif
  4517. EOF
  4518. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4519.   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  4520.   rm -rf conftest*
  4521.   ac_cv_type_mode_t=yes
  4522. else
  4523.   rm -rf conftest*
  4524.   ac_cv_type_mode_t=no
  4525. fi
  4526. rm -rf conftest*
  4527.  
  4528. fi
  4529. echo "$ac_t""$ac_cv_type_mode_t" 1>&6
  4530. if test $ac_cv_type_mode_t = no; then
  4531.   cat >> confdefs.h <<\EOF
  4532. #define mode_t int
  4533. EOF
  4534.  
  4535. fi
  4536.  
  4537. echo $ac_n "checking for pid_t""... $ac_c" 1>&6
  4538. echo "configure:4539: checking for pid_t" >&5
  4539. if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
  4540.   echo $ac_n "(cached) $ac_c" 1>&6
  4541. else
  4542.   cat > conftest.$ac_ext <<EOF
  4543. #line 4544 "configure"
  4544. #include "confdefs.h"
  4545. #include <sys/types.h>
  4546. #if STDC_HEADERS
  4547. #include <stdlib.h>
  4548. #include <stddef.h>
  4549. #endif
  4550. EOF
  4551. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4552.   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
  4553.   rm -rf conftest*
  4554.   ac_cv_type_pid_t=yes
  4555. else
  4556.   rm -rf conftest*
  4557.   ac_cv_type_pid_t=no
  4558. fi
  4559. rm -rf conftest*
  4560.  
  4561. fi
  4562. echo "$ac_t""$ac_cv_type_pid_t" 1>&6
  4563. if test $ac_cv_type_pid_t = no; then
  4564.   cat >> confdefs.h <<\EOF
  4565. #define pid_t int
  4566. EOF
  4567.  
  4568. fi
  4569.  
  4570. echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
  4571. echo "configure:4572: checking for uid_t in sys/types.h" >&5
  4572. if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
  4573.   echo $ac_n "(cached) $ac_c" 1>&6
  4574. else
  4575.   cat > conftest.$ac_ext <<EOF
  4576. #line 4577 "configure"
  4577. #include "confdefs.h"
  4578. #include <sys/types.h>
  4579. EOF
  4580. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4581.   egrep "uid_t" >/dev/null 2>&1; then
  4582.   rm -rf conftest*
  4583.   ac_cv_type_uid_t=yes
  4584. else
  4585.   rm -rf conftest*
  4586.   ac_cv_type_uid_t=no
  4587. fi
  4588. rm -rf conftest*
  4589.  
  4590. fi
  4591.  
  4592. echo "$ac_t""$ac_cv_type_uid_t" 1>&6
  4593. if test $ac_cv_type_uid_t = no; then
  4594.   cat >> confdefs.h <<\EOF
  4595. #define uid_t int
  4596. EOF
  4597.  
  4598.   cat >> confdefs.h <<\EOF
  4599. #define gid_t int
  4600. EOF
  4601.  
  4602. fi
  4603.  
  4604.  
  4605. echo $ac_n "checking what type main() should return""... $ac_c" 1>&6
  4606. echo "configure:4607: checking what type main() should return" >&5
  4607. if eval "test \"`echo '$''{'wi_cv_main_void_return_t'+set}'`\" = set"; then
  4608.   echo $ac_n "(cached) $ac_c" 1>&6
  4609. else
  4610.   
  4611. wi_cv_main_void_return_t="int"
  4612. case "${GCC}_${SYS}" in
  4613.     no_irix*|no_hpux)
  4614.         wi_cv_main_void_return_t="void"
  4615.         ;;
  4616. esac
  4617.  
  4618. fi
  4619.  
  4620. echo "$ac_t""$wi_cv_main_void_return_t" 1>&6
  4621. cat >> confdefs.h <<EOF
  4622. #define main_void_return_t $wi_cv_main_void_return_t
  4623. EOF
  4624.  
  4625.  
  4626.  
  4627.  
  4628.     if test "x$ac_cv_header_unistd_h" = x ; then
  4629.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_USE_LONG_LONG." 1>&2; exit 1; }
  4630.     fi
  4631.  
  4632. echo $ac_n "checking for 64-bit integral type: long long""... $ac_c" 1>&6
  4633. echo "configure:4634: checking for 64-bit integral type: long long" >&5
  4634. LONGEST_INT="long"
  4635. if test "$cross_compiling" = yes; then
  4636.   
  4637.     # action if cross compiling
  4638.     guess="(guessing) "
  4639.     wi_cv_type_long_long=yes
  4640.     LONGEST_INT="long long"
  4641.  
  4642. else
  4643.   cat > conftest.$ac_ext <<EOF
  4644. #line 4645 "configure"
  4645. #include "confdefs.h"
  4646.  
  4647.     /* program */
  4648. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  4649. #    define _ALL_SOURCE 1
  4650. #endif
  4651. #ifdef HAVE_UNISTD_H
  4652. #    include <unistd.h>
  4653. #endif
  4654. #include <sys/types.h>
  4655. #include <stdio.h>
  4656.  
  4657. long long hugeNumvar = 1;
  4658.  
  4659. main()
  4660. {
  4661.     long long hugeNumtoo = 2;
  4662.  
  4663.     if (hugeNumtoo > hugeNumvar)
  4664.         hugeNumvar++;
  4665.     if (sizeof(hugeNumvar) < 8)
  4666.         exit(1);
  4667.     exit(0);
  4668. }
  4669.  
  4670.  
  4671. EOF
  4672. if { (eval echo configure:4673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  4673. then
  4674.   
  4675.     # action if true
  4676.     guess=""
  4677.     wi_cv_type_long_long=yes
  4678.     LONGEST_INT="long long"
  4679.  
  4680. else
  4681.   echo "configure: failed program was:" >&5
  4682.   cat conftest.$ac_ext >&5
  4683.   rm -fr conftest*
  4684.   
  4685.     # action if false
  4686.     guess=""
  4687.       wi_cv_type_long_long=no
  4688.  
  4689. fi
  4690. rm -fr conftest*
  4691. fi
  4692.  
  4693. echo "$ac_t""$guess$wi_cv_type_long_long" 1>&6
  4694.  
  4695. if test "$wi_cv_type_long_long" = yes ; then
  4696.     
  4697. echo $ac_n "checking how to print a 64-bit integral type""... $ac_c" 1>&6
  4698. echo "configure:4699: checking how to print a 64-bit integral type" >&5
  4699. wi_cv_printf_long_long=fail
  4700.  
  4701. if test "$cross_compiling" = yes; then
  4702.   
  4703.     # action if cross compiling
  4704.     guess="(guessing) "
  4705.     wi_cv_printf_long_long="%lld"
  4706.  
  4707. else
  4708.   cat > conftest.$ac_ext <<EOF
  4709. #line 4710 "configure"
  4710. #include "confdefs.h"
  4711.  
  4712.     /* program */
  4713. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  4714. #    define _ALL_SOURCE 1
  4715. #endif
  4716. #ifdef HAVE_UNISTD_H
  4717. #    include <unistd.h>
  4718. #endif
  4719. #include <sys/types.h>
  4720. #include <stdio.h>
  4721. #include <string.h>
  4722. #include <stdlib.h>
  4723.  
  4724. main()
  4725. {
  4726.     char s[80];
  4727.     long long hugeNum;
  4728.  
  4729.     hugeNum = (long long) 1000000000;
  4730.     hugeNum = hugeNum * (long long) 99;
  4731.     hugeNum = hugeNum + (long long) 1;
  4732.  
  4733.     (void) sprintf(s, "%lld", hugeNum);
  4734.     exit((strcmp(s, "99000000001") == 0) ? 0 : 1);
  4735. }
  4736.  
  4737. EOF
  4738. if { (eval echo configure:4739: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  4739. then
  4740.   
  4741.     # action if true
  4742.     guess=""
  4743.     wi_cv_printf_long_long="%lld"
  4744.  
  4745. else
  4746.   echo "configure: failed program was:" >&5
  4747.   cat conftest.$ac_ext >&5
  4748.   rm -fr conftest*
  4749.   
  4750.     # action if false
  4751.     guess=""
  4752.  
  4753. fi
  4754. rm -fr conftest*
  4755. fi
  4756.  
  4757.  
  4758.  
  4759. if test "$wi_cv_printf_long_long" = fail ; then
  4760.  
  4761. if test "$cross_compiling" = yes; then
  4762.   
  4763.     # action if cross compiling
  4764.     :
  4765.  
  4766. else
  4767.   cat > conftest.$ac_ext <<EOF
  4768. #line 4769 "configure"
  4769. #include "confdefs.h"
  4770.  
  4771.     /* program */
  4772. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  4773. #    define _ALL_SOURCE 1
  4774. #endif
  4775. #ifdef HAVE_UNISTD_H
  4776. #    include <unistd.h>
  4777. #endif
  4778. #include <sys/types.h>
  4779. #include <stdio.h>
  4780. #include <string.h>
  4781. #include <stdlib.h>
  4782.  
  4783. main()
  4784. {
  4785.     char s[80];
  4786.     long long hugeNum;
  4787.  
  4788.     hugeNum = (long long) 1000000000;
  4789.     hugeNum = hugeNum * (long long) 99;
  4790.     hugeNum = hugeNum + (long long) 1;
  4791.  
  4792.     (void) sprintf(s, "%qd", hugeNum);
  4793.     exit((strcmp(s, "99000000001") == 0) ? 0 : 1);
  4794. }
  4795.  
  4796. EOF
  4797. if { (eval echo configure:4798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  4798. then
  4799.   
  4800.     # action if true
  4801.     wi_cv_printf_long_long="%qd"
  4802.  
  4803. else
  4804.   echo "configure: failed program was:" >&5
  4805.   cat conftest.$ac_ext >&5
  4806.   rm -fr conftest*
  4807.   
  4808.     # action if false
  4809.     :
  4810.  
  4811. fi
  4812. rm -fr conftest*
  4813. fi
  4814.  
  4815. fi
  4816.  
  4817. if test "$wi_cv_printf_long_long" = fail ; then
  4818.     wi_cv_printf_long_long_msg_result='cannot print'
  4819. else
  4820.     wi_cv_printf_long_long_msg_result="$wi_cv_printf_long_long"
  4821. fi
  4822.  
  4823. echo "$ac_t""$guess$wi_cv_printf_long_long_msg_result" 1>&6
  4824.  
  4825.     
  4826. echo $ac_n "checking how to scan a 64-bit integral type""... $ac_c" 1>&6
  4827. echo "configure:4828: checking how to scan a 64-bit integral type" >&5
  4828. wi_cv_scanf_long_long=fail
  4829.  
  4830. if test "$cross_compiling" = yes; then
  4831.   
  4832.     # action if cross compiling
  4833.     guess="(guessing) "
  4834.     wi_cv_scanf_long_long="%lld"
  4835.  
  4836. else
  4837.   cat > conftest.$ac_ext <<EOF
  4838. #line 4839 "configure"
  4839. #include "confdefs.h"
  4840.  
  4841.     /* program */
  4842. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  4843. #    define _ALL_SOURCE 1
  4844. #endif
  4845. #ifdef HAVE_UNISTD_H
  4846. #    include <unistd.h>
  4847. #endif
  4848. #include <sys/types.h>
  4849. #include <stdio.h>
  4850. #include <string.h>
  4851. #include <stdlib.h>
  4852.  
  4853. main()
  4854. {
  4855.     long long hugeNum, justAsHugeNum;
  4856.  
  4857.     hugeNum = (long long) 1000000000;
  4858.     hugeNum = hugeNum * (long long) 99;
  4859.     hugeNum = hugeNum + (long long) 1;
  4860.  
  4861.     justAsHugeNum = (long long) 0;
  4862.     --justAsHugeNum;
  4863.     sscanf("99000000001", "%lld", &justAsHugeNum);
  4864.     if (memcmp(&hugeNum, &justAsHugeNum, sizeof(hugeNum)) == 0)
  4865.         exit(0);
  4866.     exit(1);
  4867. }
  4868.  
  4869. EOF
  4870. if { (eval echo configure:4871: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  4871. then
  4872.   
  4873.     # action if true
  4874.     guess=""
  4875.     wi_cv_scanf_long_long="%lld"
  4876.  
  4877. else
  4878.   echo "configure: failed program was:" >&5
  4879.   cat conftest.$ac_ext >&5
  4880.   rm -fr conftest*
  4881.   
  4882.     # action if false
  4883.     guess=""
  4884.  
  4885. fi
  4886. rm -fr conftest*
  4887. fi
  4888.  
  4889.  
  4890.  
  4891. if test "$wi_cv_scanf_long_long" = fail ; then
  4892.  
  4893. if test "$cross_compiling" = yes; then
  4894.   
  4895.     # action if cross compiling
  4896.     :
  4897.  
  4898. else
  4899.   cat > conftest.$ac_ext <<EOF
  4900. #line 4901 "configure"
  4901. #include "confdefs.h"
  4902.  
  4903.     /* program */
  4904. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  4905. #    define _ALL_SOURCE 1
  4906. #endif
  4907. #ifdef HAVE_UNISTD_H
  4908. #    include <unistd.h>
  4909. #endif
  4910. #include <sys/types.h>
  4911. #include <stdio.h>
  4912. #include <string.h>
  4913. #include <stdlib.h>
  4914.  
  4915. main()
  4916. {
  4917.     long long hugeNum, justAsHugeNum;
  4918.  
  4919.     hugeNum = (long long) 1000000000;
  4920.     hugeNum = hugeNum * (long long) 99;
  4921.     hugeNum = hugeNum + (long long) 1;
  4922.  
  4923.     justAsHugeNum = (long long) 0;
  4924.     --justAsHugeNum;
  4925.     sscanf("99000000001", "%qd", &justAsHugeNum);
  4926.     if (memcmp(&hugeNum, &justAsHugeNum, sizeof(hugeNum)) == 0)
  4927.         exit(0);
  4928.     exit(1);
  4929. }
  4930.  
  4931. EOF
  4932. if { (eval echo configure:4933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  4933. then
  4934.   
  4935.     # action if true
  4936.     wi_cv_scanf_long_long="%qd"
  4937.  
  4938. else
  4939.   echo "configure: failed program was:" >&5
  4940.   cat conftest.$ac_ext >&5
  4941.   rm -fr conftest*
  4942.   
  4943.     # action if false
  4944.     :
  4945.  
  4946. fi
  4947. rm -fr conftest*
  4948. fi
  4949.  
  4950. fi
  4951.  
  4952. if test "$wi_cv_scanf_long_long" = fail ; then
  4953.     wi_cv_scanf_long_long_msg_result='cannot scan'
  4954. else
  4955.     wi_cv_scanf_long_long_msg_result="$wi_cv_scanf_long_long"
  4956. fi
  4957.  
  4958. echo "$ac_t""$guess$wi_cv_scanf_long_long_msg_result" 1>&6
  4959.  
  4960. fi
  4961.  
  4962. echo $ac_n "checking if everything was available to use the 64-bit integral type""... $ac_c" 1>&6
  4963. echo "configure:4964: checking if everything was available to use the 64-bit integral type" >&5
  4964.  
  4965. if test "$wi_cv_type_long_long" = no ; then
  4966.     wi_cv_use_long_long_msg_result="no (long long type not available)"
  4967.     wi_cv_use_long_long="no"
  4968.     wi_cv_scanf_long_long="fail"
  4969.     wi_cv_prihtf_long_long="fail"
  4970.     LONGEST_INT="long"
  4971. elif test "$wi_cv_printf_long_long" = fail ; then
  4972.     wi_cv_use_long_long_msg_result="no (libc printf() does not support them)"
  4973.     wi_cv_use_long_long="no"
  4974.     wi_cv_scanf_long_long="fail"
  4975.     wi_cv_prihtf_long_long="fail"
  4976.     LONGEST_INT="long"
  4977. elif test "$wi_cv_scanf_long_long" = fail ; then
  4978.     wi_cv_use_long_long_msg_result="no (libc scanf() does not support them)"
  4979.     wi_cv_use_long_long="no"
  4980.     wi_cv_scanf_long_long="fail"
  4981.     wi_cv_prihtf_long_long="fail"
  4982.     LONGEST_INT="long"
  4983. else
  4984.     cat >> confdefs.h <<\EOF
  4985. #define HAVE_LONG_LONG 1
  4986. EOF
  4987.  
  4988.     if test "$wi_cv_printf_long_long$wi_cv_scanf_long_long" = "%lld%qd" ; then
  4989.         # FreeBSD 3.2 has %lld and %qd, but we want to
  4990.         # run on 3.1 and 3.0.
  4991.         #
  4992.         wi_cv_printf_long_long="%qd"
  4993.     fi
  4994.     wi_cv_printf_ulong_long=`echo "$wi_cv_printf_long_long" | sed 's/d$/u/;'`
  4995.     wi_cv_scanf_ulong_long=`echo "$wi_cv_scanf_long_long" | sed 's/d$/u/;'`
  4996.     cat >> confdefs.h <<EOF
  4997. #define PRINTF_LONG_LONG "$wi_cv_printf_long_long"
  4998. EOF
  4999.  
  5000.     cat >> confdefs.h <<EOF
  5001. #define SCANF_LONG_LONG  "$wi_cv_scanf_long_long"
  5002. EOF
  5003.  
  5004.     cat >> confdefs.h <<EOF
  5005. #define PRINTF_ULONG_LONG "$wi_cv_printf_ulong_long"
  5006. EOF
  5007.  
  5008.     cat >> confdefs.h <<EOF
  5009. #define SCANF_ULONG_LONG  "$wi_cv_scanf_ulong_long"
  5010. EOF
  5011.  
  5012.     if test "$wi_cv_printf_long_long" = "%qd" ; then
  5013.         cat >> confdefs.h <<\EOF
  5014. #define PRINTF_LONG_LONG_QD 1
  5015. EOF
  5016.  
  5017.     else
  5018.         cat >> confdefs.h <<\EOF
  5019. #define PRINTF_LONG_LONG_LLD 1
  5020. EOF
  5021.  
  5022.     fi
  5023.     if test "$wi_cv_scanf_long_long" = "%qd" ; then
  5024.         cat >> confdefs.h <<\EOF
  5025. #define SCANF_LONG_LONG_QD 1
  5026. EOF
  5027.  
  5028.     else
  5029.         cat >> confdefs.h <<\EOF
  5030. #define SCANF_LONG_LONG_LLD 1
  5031. EOF
  5032.  
  5033.     fi
  5034.     wi_cv_use_long_long="yes"
  5035.     wi_cv_use_long_long_msg_result="yes"
  5036. fi
  5037. echo "$ac_t""$wi_cv_use_long_long_msg_result" 1>&6
  5038.  
  5039.  
  5040. wi_struct_timeval_field_checks="cached"
  5041. echo $ac_n "checking what type the tv_sec field of struct timeval is""... $ac_c" 1>&6
  5042. echo "configure:5043: checking what type the tv_sec field of struct timeval is" >&5
  5043. if eval "test \"`echo '$''{'wi_cv_struct_timeval_tv_sec'+set}'`\" = set"; then
  5044.   echo $ac_n "(cached) $ac_c" 1>&6
  5045. else
  5046.   
  5047. wi_struct_timeval_field_checks="uncached"
  5048.  
  5049.     if test "x$ac_cv_header_unistd_h" = x ; then
  5050.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_STRUCT_TIMEVAL_FIELD_TYPES." 1>&2; exit 1; }
  5051.     fi
  5052.  
  5053. if test "$cross_compiling" = yes; then
  5054.   
  5055.     # action if cross compiling
  5056.     guess="(guessing) "
  5057.     guess2="$guess"
  5058.     wi_cv_struct_timeval_tv_sec="long"
  5059.     wi_cv_struct_timeval_tv_usec="long"
  5060.  
  5061. else
  5062.   cat > conftest.$ac_ext <<EOF
  5063. #line 5064 "configure"
  5064. #include "confdefs.h"
  5065.  
  5066.     /* program */
  5067. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  5068. #    define _ALL_SOURCE 1
  5069. #endif
  5070. #ifdef HAVE_UNISTD_H
  5071. #    include <unistd.h>
  5072. #endif
  5073. #include <sys/types.h>
  5074. #include <sys/time.h>
  5075. #include <stdio.h>
  5076. #include <stdlib.h>
  5077. #include <string.h>
  5078.  
  5079. static void
  5080. neg(void *dst0, size_t siz)
  5081. {
  5082.     unsigned char *dst = (unsigned char *) dst0;
  5083.     unsigned char *dlim;
  5084.  
  5085.     dlim = dst + siz;
  5086.     while (dst < dlim)
  5087.         *dst++ = (unsigned char) 0xEE;
  5088. }
  5089.  
  5090. int
  5091. main(int argc, char **argv)
  5092. {
  5093.     FILE *fp;
  5094.     const char *typ;
  5095.     struct timeval tv;
  5096. #define x tv.tv_sec
  5097.  
  5098.     memset(&tv, 0, sizeof(tv));
  5099.     fp = stdout;
  5100.     if (argc == 1) {
  5101.         fp = fopen("conftest.out", "w");
  5102.         if (fp == NULL) {
  5103.             perror("could not write to ./conftest.out");
  5104.             exit(1);
  5105.         }
  5106.     }
  5107.  
  5108.     neg(&x, sizeof(x));
  5109. #ifdef HAVE_LONG_LONG
  5110.     if (sizeof(x) == sizeof(long long)) {
  5111.         typ = "long long";
  5112.     } else
  5113. #endif
  5114.     if (sizeof(x) == sizeof(long)) {
  5115.         typ = "long";
  5116.     } else {
  5117.         typ = "int";
  5118.     }
  5119.     (void) fprintf(fp, "%s%s\n", (x > 0) ? "unsigned " : "", typ);
  5120. #undef x
  5121.  
  5122. #define x tv.tv_usec
  5123.     neg(&x, sizeof(x));
  5124. #ifdef HAVE_LONG_LONG
  5125.     if (sizeof(x) == sizeof(long long)) {
  5126.         typ = "long long";
  5127.     } else
  5128. #endif
  5129.     if (sizeof(x) == sizeof(long)) {
  5130.         typ = "long";
  5131.     } else {
  5132.         typ = "int";
  5133.     }
  5134.     (void) fprintf(fp, "%s%s\n", (x > 0) ? "unsigned " : "", typ);
  5135. #undef x
  5136.  
  5137.     if (fp != stdout)
  5138.         (void) fclose(fp);
  5139.     exit(0);
  5140. }
  5141.  
  5142. EOF
  5143. if { (eval echo configure:5144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  5144. then
  5145.   
  5146.     # action if true
  5147.     guess=""
  5148.     if test -f conftest.out ; then
  5149.         wi_cv_struct_timeval_tv_sec="`sed -n '1,1p' conftest.out`"
  5150.         wi_cv_struct_timeval_tv_usec="`sed -n '2,2p' conftest.out`"
  5151.     fi
  5152.  
  5153. else
  5154.   echo "configure: failed program was:" >&5
  5155.   cat conftest.$ac_ext >&5
  5156.   rm -fr conftest*
  5157.   
  5158.     # action if false
  5159.     guess=""
  5160.     wi_cv_struct_timeval_tv_sec="long"
  5161.     wi_cv_struct_timeval_tv_usec="long"
  5162.  
  5163. fi
  5164. rm -fr conftest*
  5165. fi
  5166.  
  5167.     rm -f conftest.out
  5168.  
  5169. fi
  5170.  
  5171. echo "$ac_t""$guess$wi_cv_struct_timeval_tv_sec" 1>&6
  5172. guess=""
  5173.  
  5174. if test "$wi_struct_timeval_field_checks" = "uncached" ; then
  5175.     guess="$guess2"
  5176.     echo $ac_n "checking what type the tv_usec field of struct timeval is""... $ac_c" 1>&6
  5177. echo "configure:5178: checking what type the tv_usec field of struct timeval is" >&5
  5178.     echo "$ac_t""$guess$wi_cv_struct_timeval_tv_usec" 1>&6
  5179. else
  5180.     guess="$guess2"
  5181.     echo $ac_n "checking what type the tv_usec field of struct timeval is""... $ac_c" 1>&6
  5182. echo "configure:5183: checking what type the tv_usec field of struct timeval is" >&5
  5183. if eval "test \"`echo '$''{'wi_cv_struct_timeval_tv_usec'+set}'`\" = set"; then
  5184.   echo $ac_n "(cached) $ac_c" 1>&6
  5185. else
  5186.   :
  5187. fi
  5188.  
  5189. echo "$ac_t""$guess$wi_cv_struct_timeval_tv_usec" 1>&6
  5190. guess=""
  5191.  
  5192. fi
  5193. cat >> confdefs.h <<EOF
  5194. #define tv_sec_t $wi_cv_struct_timeval_tv_sec
  5195. EOF
  5196.  
  5197. cat >> confdefs.h <<EOF
  5198. #define tv_usec_t $wi_cv_struct_timeval_tv_usec
  5199. EOF
  5200.  
  5201.  
  5202.  
  5203. # Extract the first word of ""perl"", so it can be a program name with args.
  5204. set dummy "perl"; ac_word=$2
  5205. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  5206. echo "configure:5207: checking for $ac_word" >&5
  5207. if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
  5208.   echo $ac_n "(cached) $ac_c" 1>&6
  5209. else
  5210.   case "$PERL" in
  5211.   /*)
  5212.   ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
  5213.   ;;
  5214.   ?:/*)             
  5215.   ac_cv_path_PERL="$PERL" # Let the user override the test with a dos path.
  5216.   ;;
  5217.   *)
  5218.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  5219.   ac_dummy="$PATH"
  5220.   for ac_dir in $ac_dummy; do 
  5221.     test -z "$ac_dir" && ac_dir=.
  5222.     if test -f $ac_dir/$ac_word; then
  5223.       ac_cv_path_PERL="$ac_dir/$ac_word"
  5224.       break
  5225.     fi
  5226.   done
  5227.   IFS="$ac_save_ifs"
  5228.   test -z "$ac_cv_path_PERL" && ac_cv_path_PERL=""perl""
  5229.   ;;
  5230. esac
  5231. fi
  5232. PERL="$ac_cv_path_PERL"
  5233. if test -n "$PERL"; then
  5234.   echo "$ac_t""$PERL" 1>&6
  5235. else
  5236.   echo "$ac_t""no" 1>&6
  5237. fi
  5238.  
  5239.  
  5240.  
  5241. # Extract the first word of ""mktemp"", so it can be a program name with args.
  5242. set dummy "mktemp"; ac_word=$2
  5243. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  5244. echo "configure:5245: checking for $ac_word" >&5
  5245. if eval "test \"`echo '$''{'ac_cv_path_MKTEMP'+set}'`\" = set"; then
  5246.   echo $ac_n "(cached) $ac_c" 1>&6
  5247. else
  5248.   case "$MKTEMP" in
  5249.   /*)
  5250.   ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a path.
  5251.   ;;
  5252.   ?:/*)             
  5253.   ac_cv_path_MKTEMP="$MKTEMP" # Let the user override the test with a dos path.
  5254.   ;;
  5255.   *)
  5256.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  5257.   ac_dummy="$PATH"
  5258.   for ac_dir in $ac_dummy; do 
  5259.     test -z "$ac_dir" && ac_dir=.
  5260.     if test -f $ac_dir/$ac_word; then
  5261.       ac_cv_path_MKTEMP="$ac_dir/$ac_word"
  5262.       break
  5263.     fi
  5264.   done
  5265.   IFS="$ac_save_ifs"
  5266.   test -z "$ac_cv_path_MKTEMP" && ac_cv_path_MKTEMP=""""
  5267.   ;;
  5268. esac
  5269. fi
  5270. MKTEMP="$ac_cv_path_MKTEMP"
  5271. if test -n "$MKTEMP"; then
  5272.   echo "$ac_t""$MKTEMP" 1>&6
  5273. else
  5274.   echo "$ac_t""no" 1>&6
  5275. fi
  5276.  
  5277.  
  5278.  
  5279.  
  5280.  
  5281.  
  5282.  
  5283.  
  5284.     if test "x$ac_cv_header_unistd_h" = x ; then
  5285.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_UNISTD_FUNC_PARAM_TYPES." 1>&2; exit 1; }
  5286.     fi
  5287.  
  5288. echo $ac_n "checking for return type from write""... $ac_c" 1>&6
  5289. echo "configure:5290: checking for return type from write" >&5
  5290. if eval "test \"`echo '$''{'wi_cv_write_return_t'+set}'`\" = set"; then
  5291.   echo $ac_n "(cached) $ac_c" 1>&6
  5292. else
  5293.   
  5294. used_cache_for_wi_unistd_fpt="no"
  5295.  
  5296.  
  5297. wi_tmpdir=""
  5298. if [ "x$MKTEMP" != "x" ] ; then
  5299.     # Ignore error from mktemp, since some old versions of Linux
  5300.     # print an error about not supporting -d.
  5301.     #
  5302.     wi_tmpdir=`"$MKTEMP" -d /tmp/configure.XXXXXXXXXX 2>/dev/null`
  5303.     if [ $? -ne 0 ] ; then
  5304.         wi_tmpdir=""
  5305.     fi
  5306. fi
  5307. if [ "x$wi_tmpdir" = "x" ] ; then
  5308.     for wi_tmpdir in . $TMPDIR $TEMPDIR /tmp ABORT
  5309.     do
  5310.         if [ "$wi_tmpdir" = ABORT ] ; then
  5311.             echo "Cannot create temporary directory."
  5312.             exit 1
  5313.         fi
  5314.         wi_tmpdir="$wi_tmpdir/config_tmp.$$"
  5315.         if [ -d "$wi_tmpdir" ] || [ -f "$wi_tmpdir" ] ; then
  5316.             echo "Will not create temporary directory."
  5317.             exit 1
  5318.         fi
  5319.         mkdir "$wi_tmpdir"
  5320.         if [ $? -eq 0 ] && [ -d "$wi_tmpdir" ] ; then break ;  fi
  5321.     done
  5322. fi
  5323.  
  5324. # Use the temporary directory here...
  5325.  
  5326.  
  5327. cat << 'EOF' > "$wi_tmpdir/prpp.pl"
  5328. #!/usr/bin/perl -w
  5329. #
  5330. # prpp.pl
  5331. #
  5332. # Feed the output of your CPP to this to print a list of function prototypes.
  5333. #use strict;
  5334.  
  5335. my ($c) = "";
  5336. my ($unputc) = "";
  5337. my ($line) = "";
  5338. my ($lines) = "";
  5339. my ($cline) = "";
  5340. my ($skipping) = 0;
  5341. my ($numclines) = 0;
  5342.  
  5343. MAINLOOP: while (1) {
  5344.     if ($unputc ne "") {
  5345.         $c = $unputc;
  5346.         $unputc = "";
  5347.     } else {
  5348.         last unless (read(STDIN, $c, 1) == 1);
  5349.     }
  5350.     if ($c eq "{") {
  5351.         $skipping++;
  5352.     } elsif ($c eq "}") {
  5353.         --$skipping;
  5354.         $unputc = ";";
  5355.     } elsif ($skipping) {
  5356.         next MAINLOOP;
  5357.     } elsif ($c eq ";") {
  5358.         if ($line =~ m/^\s*(\S.*\S)\s*$/s) {
  5359.             $lines .= $1;
  5360.             $line = "";
  5361.         }
  5362.         if ($lines =~ m/^\s*(extern\s*)?(\S.*\S)\s*$/s) {
  5363.             $cline = $2;
  5364.             $cline =~ s/\s+/\ /g;
  5365.             if ($cline =~ /^typedef/) {
  5366.                 $cline = "";
  5367.             } elsif ($cline =~ /\(.*\)$/) {
  5368.                 # found a proto
  5369.                 print $cline, ";\n";
  5370.                 $numclines++;
  5371.             } else {
  5372.                 $cline = "";
  5373.             }
  5374.         }
  5375.         $lines = "";
  5376.         $line = "";
  5377.     } elsif ($c eq "\n") {
  5378.         if ($line =~ m/^\s*(\S.*\S)\s*$/s) {
  5379.             $lines .= $1 . " ";
  5380.             $line = "";
  5381.         }
  5382.     } elsif (($c eq "#") && ($line eq "")) {
  5383.         # Looks like a preprocessor line, kill it
  5384.         {
  5385.             last MAINLOOP if (read(STDIN, $c, 1) != 1);
  5386.             last if ($c eq "\n");
  5387.             redo;
  5388.         }
  5389.     } elsif ($c =~ /^\s$/) {
  5390.         $line .= " " if ($line ne "");
  5391.     } elsif (! $skipping) {
  5392.         $line .= $c;
  5393.     }
  5394. }
  5395. exit(($numclines == 0) ? 1 : 0);
  5396. EOF
  5397. chmod 755 "$wi_tmpdir/prpp.pl"
  5398.  
  5399.  
  5400. cat << 'EOF' > "$wi_tmpdir/unistd.c"
  5401. #include <confdefs.h>
  5402.  
  5403. #include <unistd.h>
  5404. #include <sys/types.h>
  5405. #include <sys/socket.h>
  5406. #include <netinet/in.h>
  5407. #include <arpa/inet.h>
  5408. #include <netdb.h>
  5409.  
  5410. main()
  5411. {
  5412.     exit(0);
  5413. }
  5414. EOF
  5415.  
  5416. cat << 'EOF' > "$wi_tmpdir/sed.sh"
  5417. #!/bin/sh
  5418.  
  5419. if [ $# -eq 0 ] ; then exit 1 ; fi
  5420. x="$1"
  5421.  
  5422. sed -n 's/extern//;s/static//;
  5423.         /[\ \*]'"$x"'\ *(/{
  5424.             s/^.*'"$x"'\ *(/(/
  5425.             s/)\ *[;,].*$/)/
  5426.             /ssize_t/{
  5427.                 c\
  5428. ssize_t
  5429.             }
  5430.             /size_t/{
  5431.                 c\
  5432. size_t
  5433.             }
  5434.             /socklen_t/{
  5435.                 c\
  5436. socklen_t
  5437.             }
  5438.             /unsigned int/{
  5439.                 c\
  5440. unsigned int
  5441.             }
  5442.             /unsigned long/{
  5443.                 c\
  5444. unsigned long
  5445.             }
  5446.             /long/{
  5447.                 c\
  5448. long
  5449.             }
  5450.             q
  5451. }' | sed 's/int int/int/g'
  5452. EOF
  5453. chmod 755 "$wi_tmpdir/sed.sh"
  5454.  
  5455.  
  5456. cat << 'EOF' > "$wi_tmpdir/sed2.sh"
  5457. #!/bin/sh
  5458.  
  5459. if [ $# -eq 0 ] ; then exit 1 ; fi
  5460. x="$1"
  5461.  
  5462. sed -n 's/extern//;s/static//;
  5463.         /[\ \*]'"$x"'\ *(/{
  5464.             s/^.*'"$x"'\ *(/(/
  5465.             s/)\ *[;,].*$/)/
  5466.             /const char/{
  5467.                 c\
  5468. const char *
  5469.             }
  5470.             /char/{
  5471.                 c\
  5472. char *
  5473.             }
  5474.             /const/{
  5475.                 c\
  5476. const void
  5477.             }
  5478.             q
  5479. }'
  5480. EOF
  5481. chmod 755 "$wi_tmpdir/sed2.sh"
  5482.  
  5483. $CPP "-I${srcdir-.}" "$wi_tmpdir/unistd.c" > "$wi_tmpdir/unistd.i"
  5484. if [ -s "$wi_tmpdir/unistd.i" ] ; then
  5485.     "$PERL" "$wi_tmpdir/prpp.pl" < "$wi_tmpdir/unistd.i" > "$wi_tmpdir/protos.h"
  5486. fi
  5487. if [ -f "$wi_tmpdir/protos.h" ] ; then
  5488.     #
  5489.     # Check the return type of write()
  5490.     #
  5491.     x="write"
  5492.     wi_cv_write_return_t=`sed -n 's/extern//;s/static//;
  5493.         s/__attribute__((__cdecl__))//;
  5494.         /[\ \*]'"$x"'\ *(/{
  5495.             s/'"$x"'\ *(.*//
  5496.             s/^\ *//
  5497.             s/\ *$//
  5498.             p;q
  5499.         }' "$wi_tmpdir/protos.h"`
  5500.     #
  5501.     # Check what type write() expects for the size parameter
  5502.     #
  5503.     x="write"
  5504.     wi_cv_write_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5505.     #
  5506.     # Check the return type of send()
  5507.     #
  5508.     x="send"
  5509.     wi_cv_send_return_t=`sed -n 's/extern//;s/static//;
  5510.         s/__attribute__((__cdecl__))//;
  5511.         /[\ \*]'"$x"'\ *(/{
  5512.             s/'"$x"'\ *(.*//
  5513.             s/^\ *//
  5514.             s/\ *$//
  5515.             p;q
  5516.         }' "$wi_tmpdir/protos.h"`
  5517.     #
  5518.     # Check what type send() expects for the size parameter
  5519.     # Tru64 is one example where send() differs from write()  :-(
  5520.     #
  5521.     x="send"
  5522.     wi_cv_send_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5523.     #
  5524.     # Check what type connect() expects for the size parameter
  5525.     #
  5526.     x="connect"
  5527.     wi_cv_sockaddr_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5528.     #
  5529.     # Check what type setsockopt() expects for the size parameter
  5530.     #
  5531.     x="setsockopt"
  5532.     wi_cv_sockopt_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5533.     #
  5534.     # Check what type listen() expects for the backlog parameter
  5535.     #
  5536.     x="listen"
  5537.     wi_cv_listen_backlog_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5538.     #
  5539.     # Check what type alarm() expects for the seconds parameter
  5540.     #
  5541.     x="alarm"
  5542.     wi_cv_alarm_time_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5543.     #
  5544.     # Check what type gethostbyaddr() expects for the addr parameter
  5545.     #
  5546.     x="gethostbyaddr"
  5547.     wi_cv_gethost_addrptr_t=`/bin/sh "$wi_tmpdir/sed2.sh" "$x" < "$wi_tmpdir/protos.h"`
  5548.     #
  5549.     # Check what type gethostname() expects for the size parameter
  5550.     #
  5551.     x="gethostname"
  5552.     wi_cv_gethostname_size_t=`/bin/sh "$wi_tmpdir/sed.sh" "$x" < "$wi_tmpdir/protos.h"`
  5553. fi
  5554. if [ "x$wi_cv_write_return_t" = "x" ] ; then
  5555.     wi_cv_write_return_t="int"
  5556. fi
  5557. if [ "x$wi_cv_write_size_t" = "x" ] ; then
  5558.     wi_cv_write_size_t="int"
  5559. fi
  5560. if [ "x$wi_cv_send_return_t" = "x" ] ; then
  5561.     wi_cv_send_return_t="int"
  5562. fi
  5563. if [ "x$wi_cv_send_size_t" = "x" ] ; then
  5564.     wi_cv_send_size_t="int"
  5565. fi
  5566. if [ "x$wi_cv_sockaddr_size_t" = "x" ] ; then
  5567.     wi_cv_sockaddr_size_t="int"
  5568. fi
  5569. if [ "x$wi_cv_sockopt_size_t" = "x" ] ; then
  5570.     wi_cv_sockopt_size_t="int"
  5571. fi
  5572. if [ "x$wi_cv_listen_backlog_t" = "x" ] ; then
  5573.     wi_cv_listen_backlog_t="int"
  5574. fi
  5575. if [ "x$wi_cv_alarm_time_t" = "x" ] ; then
  5576.     wi_cv_alarm_time_t="int"
  5577. fi
  5578. if [ "x$wi_cv_gethost_addrptr_t" = "x" ] ; then
  5579.     wi_cv_gethost_addrptr_t="struct in_addr *"
  5580. fi
  5581. if [ "$wi_cv_gethost_addrptr_t" = "const void" ] ; then
  5582.     wi_cv_gethost_addrptr_t="const struct in_addr *"
  5583. fi
  5584. if [ "x$wi_cv_gethostname_size_t" = "x" ] ; then
  5585.     wi_cv_gethostname_size_t="int"
  5586. fi
  5587.  
  5588. # Done using the temporary directory here.
  5589.  
  5590. rm -r "$wi_tmpdir"
  5591. unset wi_tmpdir
  5592.  
  5593.  
  5594. fi
  5595.  
  5596. echo "$ac_t""$wi_cv_write_return_t" 1>&6
  5597. if test "x$used_cache_for_wi_unistd_fpt" = "xno" ; then
  5598.     echo $ac_n "checking for size parameter to write""... $ac_c" 1>&6
  5599. echo "configure:5601: checking for size parameter to write" >&5
  5600.     echo "$ac_t""$wi_cv_write_size_t" 1>&6
  5601.     echo $ac_n "checking for return type from send""... $ac_c" 1>&6
  5602. echo "configure:5604: checking for return type from send" >&5
  5603.     echo "$ac_t""$wi_cv_send_return_t" 1>&6
  5604.     echo $ac_n "checking for size parameter to send""... $ac_c" 1>&6
  5605. echo "configure:5607: checking for size parameter to send" >&5
  5606.     echo "$ac_t""$wi_cv_send_size_t" 1>&6
  5607.     echo $ac_n "checking for size parameter to connect""... $ac_c" 1>&6
  5608. echo "configure:5610: checking for size parameter to connect" >&5
  5609.     echo "$ac_t""$wi_cv_sockaddr_size_t" 1>&6
  5610.     echo $ac_n "checking for size parameter to setsockopt""... $ac_c" 1>&6
  5611. echo "configure:5613: checking for size parameter to setsockopt" >&5
  5612.     echo "$ac_t""$wi_cv_sockopt_size_t" 1>&6
  5613.     echo $ac_n "checking for backlog parameter to listen""... $ac_c" 1>&6
  5614. echo "configure:5616: checking for backlog parameter to listen" >&5
  5615.     echo "$ac_t""$wi_cv_listen_backlog_t" 1>&6
  5616.     echo $ac_n "checking for seconds parameter to alarm""... $ac_c" 1>&6
  5617. echo "configure:5619: checking for seconds parameter to alarm" >&5
  5618.     echo "$ac_t""$wi_cv_alarm_time_t" 1>&6
  5619.     echo $ac_n "checking for address parameter to gethostbyaddr""... $ac_c" 1>&6
  5620. echo "configure:5622: checking for address parameter to gethostbyaddr" >&5
  5621.     echo "$ac_t""$wi_cv_gethost_addrptr_t" 1>&6
  5622.     echo $ac_n "checking for size parameter to gethostname""... $ac_c" 1>&6
  5623. echo "configure:5625: checking for size parameter to gethostname" >&5
  5624.     echo "$ac_t""$wi_cv_gethostname_size_t" 1>&6
  5625. else
  5626.     echo $ac_n "checking for size parameter to write""... $ac_c" 1>&6
  5627. echo "configure:5629: checking for size parameter to write" >&5
  5628. if eval "test \"`echo '$''{'wi_cv_write_size_t'+set}'`\" = set"; then
  5629.   echo $ac_n "(cached) $ac_c" 1>&6
  5630. else
  5631.   :
  5632. fi
  5633.  
  5634. echo "$ac_t""$wi_cv_write_size_t" 1>&6
  5635.     echo $ac_n "checking for return type from send""... $ac_c" 1>&6
  5636. echo "configure:5638: checking for return type from send" >&5
  5637. if eval "test \"`echo '$''{'wi_cv_send_return_t'+set}'`\" = set"; then
  5638.   echo $ac_n "(cached) $ac_c" 1>&6
  5639. else
  5640.   :
  5641. fi
  5642.  
  5643. echo "$ac_t""$wi_cv_send_return_t" 1>&6
  5644.     echo $ac_n "checking for size parameter to send""... $ac_c" 1>&6
  5645. echo "configure:5647: checking for size parameter to send" >&5
  5646. if eval "test \"`echo '$''{'wi_cv_send_size_t'+set}'`\" = set"; then
  5647.   echo $ac_n "(cached) $ac_c" 1>&6
  5648. else
  5649.   :
  5650. fi
  5651.  
  5652. echo "$ac_t""$wi_cv_send_size_t" 1>&6
  5653.     echo $ac_n "checking for size parameter to connect""... $ac_c" 1>&6
  5654. echo "configure:5656: checking for size parameter to connect" >&5
  5655. if eval "test \"`echo '$''{'wi_cv_sockaddr_size_t'+set}'`\" = set"; then
  5656.   echo $ac_n "(cached) $ac_c" 1>&6
  5657. else
  5658.   :
  5659. fi
  5660.  
  5661. echo "$ac_t""$wi_cv_sockaddr_size_t" 1>&6
  5662.     echo $ac_n "checking for size parameter to setsockopt""... $ac_c" 1>&6
  5663. echo "configure:5665: checking for size parameter to setsockopt" >&5
  5664. if eval "test \"`echo '$''{'wi_cv_sockopt_size_t'+set}'`\" = set"; then
  5665.   echo $ac_n "(cached) $ac_c" 1>&6
  5666. else
  5667.   :
  5668. fi
  5669.  
  5670. echo "$ac_t""$wi_cv_sockopt_size_t" 1>&6
  5671.     echo $ac_n "checking for backlog parameter to listen""... $ac_c" 1>&6
  5672. echo "configure:5674: checking for backlog parameter to listen" >&5
  5673. if eval "test \"`echo '$''{'wi_cv_listen_backlog_t'+set}'`\" = set"; then
  5674.   echo $ac_n "(cached) $ac_c" 1>&6
  5675. else
  5676.   :
  5677. fi
  5678.  
  5679. echo "$ac_t""$wi_cv_listen_backlog_t" 1>&6
  5680.     echo $ac_n "checking for seconds parameter to alarm""... $ac_c" 1>&6
  5681. echo "configure:5683: checking for seconds parameter to alarm" >&5
  5682. if eval "test \"`echo '$''{'wi_cv_alarm_time_t'+set}'`\" = set"; then
  5683.   echo $ac_n "(cached) $ac_c" 1>&6
  5684. else
  5685.   :
  5686. fi
  5687.  
  5688. echo "$ac_t""$wi_cv_alarm_time_t" 1>&6
  5689.     echo $ac_n "checking for address parameter to gethostbyaddr""... $ac_c" 1>&6
  5690. echo "configure:5692: checking for address parameter to gethostbyaddr" >&5
  5691. if eval "test \"`echo '$''{'wi_cv_gethost_addrptr_t'+set}'`\" = set"; then
  5692.   echo $ac_n "(cached) $ac_c" 1>&6
  5693. else
  5694.   :
  5695. fi
  5696.  
  5697. echo "$ac_t""$wi_cv_gethost_addrptr_t" 1>&6
  5698.     echo $ac_n "checking for size parameter to gethostname""... $ac_c" 1>&6
  5699. echo "configure:5701: checking for size parameter to gethostname" >&5
  5700. if eval "test \"`echo '$''{'wi_cv_gethostname_size_t'+set}'`\" = set"; then
  5701.   echo $ac_n "(cached) $ac_c" 1>&6
  5702. else
  5703.   :
  5704. fi
  5705.  
  5706. echo "$ac_t""$wi_cv_gethostname_size_t" 1>&6
  5707. fi
  5708. unset used_cache_for_wi_unistd_fpt
  5709. cat >> confdefs.h <<EOF
  5710. #define write_return_t $wi_cv_write_return_t
  5711. EOF
  5712.  
  5713. cat >> confdefs.h <<EOF
  5714. #define write_size_t $wi_cv_write_size_t
  5715. EOF
  5716.  
  5717. cat >> confdefs.h <<EOF
  5718. #define read_return_t $wi_cv_write_return_t
  5719. EOF
  5720.  
  5721. cat >> confdefs.h <<EOF
  5722. #define read_size_t $wi_cv_write_size_t
  5723. EOF
  5724.  
  5725. cat >> confdefs.h <<EOF
  5726. #define send_return_t $wi_cv_send_return_t
  5727. EOF
  5728.  
  5729. cat >> confdefs.h <<EOF
  5730. #define send_size_t $wi_cv_send_size_t
  5731. EOF
  5732.  
  5733. cat >> confdefs.h <<EOF
  5734. #define recv_return_t $wi_cv_send_return_t
  5735. EOF
  5736.  
  5737. cat >> confdefs.h <<EOF
  5738. #define recv_size_t $wi_cv_send_size_t
  5739. EOF
  5740.  
  5741. cat >> confdefs.h <<EOF
  5742. #define sockaddr_size_t $wi_cv_sockaddr_size_t
  5743. EOF
  5744.  
  5745. cat >> confdefs.h <<EOF
  5746. #define sockopt_size_t $wi_cv_sockopt_size_t
  5747. EOF
  5748.  
  5749. cat >> confdefs.h <<EOF
  5750. #define listen_backlog_t $wi_cv_listen_backlog_t
  5751. EOF
  5752.  
  5753. cat >> confdefs.h <<EOF
  5754. #define alarm_time_t $wi_cv_alarm_time_t
  5755. EOF
  5756.  
  5757. cat >> confdefs.h <<EOF
  5758. #define gethost_addrptr_t $wi_cv_gethost_addrptr_t
  5759. EOF
  5760.  
  5761. cat >> confdefs.h <<EOF
  5762. #define gethostname_size_t $wi_cv_gethostname_size_t
  5763. EOF
  5764.  
  5765.  
  5766.  
  5767.  
  5768.     if test "x$ac_cv_header_unistd_h" = x ; then
  5769.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_FUNC_SELECT_ARGTYPES." 1>&2; exit 1; }
  5770.     fi
  5771.  
  5772. echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
  5773. echo "configure:5775: checking types of arguments for select()" >&5
  5774.  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
  5775.   echo $ac_n "(cached) $ac_c" 1>&6
  5776. else
  5777.    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
  5778.   echo $ac_n "(cached) $ac_c" 1>&6
  5779. else
  5780.     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
  5781.   echo $ac_n "(cached) $ac_c" 1>&6
  5782. else
  5783.      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
  5784.      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
  5785.       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
  5786.        cat > conftest.$ac_ext <<EOF
  5787. #line 5789 "configure"
  5788. #include "confdefs.h"
  5789. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)    /* MG */
  5790. #    define _ALL_SOURCE 1    /* MG */
  5791. #endif
  5792. #ifdef HAVE_UNISTD_H    /* MG */
  5793. #include <unistd.h>
  5794. #endif            /* MG */
  5795. #include <sys/types.h>    /* MG: always incl */
  5796. #include <sys/time.h>    /* MG: always incl */
  5797. #ifdef HAVE_SYS_SELECT_H
  5798. #include <sys/select.h>
  5799. #endif
  5800. #include <sys/socket.h>    /* MG: always incl */
  5801. extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
  5802. int main() {
  5803.  
  5804. ; return 0; }
  5805. EOF
  5806. if { (eval echo configure:5808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  5807.   rm -rf conftest*
  5808.           ac_not_found=no ; break 3
  5809. else
  5810.   echo "configure: failed program was:" >&5
  5811.   cat conftest.$ac_ext >&5
  5812.   rm -rf conftest*
  5813.   ac_not_found=yes
  5814. fi
  5815. rm -rf conftest*
  5816.       done
  5817.      done
  5818.     done
  5819.    
  5820. fi
  5821.   
  5822. fi
  5823.  
  5824. fi
  5825.  if test "$ac_not_found" = yes; then
  5826.   ac_cv_func_select_arg1=int 
  5827.   ac_cv_func_select_arg234='int *' 
  5828.   ac_cv_func_select_arg5='struct timeval *'
  5829.  fi
  5830.  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
  5831.  cat >> confdefs.h <<EOF
  5832. #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
  5833. EOF
  5834.  
  5835.  cat >> confdefs.h <<EOF
  5836. #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
  5837. EOF
  5838.  
  5839.  cat >> confdefs.h <<EOF
  5840. #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
  5841. EOF
  5842.  
  5843.  
  5844.  
  5845. if test "$wi_cv_lfs64" != "yes" ; then
  5846.     echo $ac_n "checking for struct stat64""... $ac_c" 1>&6
  5847. echo "configure:5849: checking for struct stat64" >&5
  5848.     echo "$ac_t""not needed" 1>&6
  5849.     wi_cv_struct_stat64=no
  5850. else
  5851. echo $ac_n "checking for struct stat64""... $ac_c" 1>&6
  5852. echo "configure:5854: checking for struct stat64" >&5
  5853. cat > conftest.$ac_ext <<EOF
  5854. #line 5856 "configure"
  5855. #include "confdefs.h"
  5856.  
  5857.     /* includes */
  5858. #include <unistd.h>
  5859. #include <sys/types.h>
  5860. #include <sys/stat.h>
  5861.  
  5862. int main() {
  5863.  
  5864. struct stat64 st;
  5865.  
  5866. st.st_size = 0;
  5867. exit(((int) &st.st_size) & 0xff);    /* bogus code, of course. */
  5868.  
  5869. ; return 0; }
  5870. EOF
  5871. if { (eval echo configure:5873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  5872.   rm -rf conftest*
  5873.   
  5874.     wi_cv_struct_stat64=yes
  5875.     cat >> confdefs.h <<\EOF
  5876. #define HAVE_STRUCT_STAT64 1
  5877. EOF
  5878.  
  5879.  
  5880. else
  5881.   echo "configure: failed program was:" >&5
  5882.   cat conftest.$ac_ext >&5
  5883.   rm -rf conftest*
  5884.   
  5885.     wi_cv_struct_stat64=no
  5886.  
  5887. fi
  5888. rm -rf conftest*
  5889. echo "$ac_t""$wi_cv_struct_stat64" 1>&6
  5890. fi
  5891.  
  5892.  
  5893.  
  5894.     if test "x$ac_cv_header_unistd_h" = x ; then
  5895.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_TYPE_SIG_ATOMIC_T." 1>&2; exit 1; }
  5896.     fi
  5897.  
  5898. echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
  5899. echo "configure:5901: checking for sig_atomic_t" >&5
  5900. cat > conftest.$ac_ext <<EOF
  5901. #line 5903 "configure"
  5902. #include "confdefs.h"
  5903.  
  5904.     /* includes */
  5905. #ifdef HAVE_UNISTD_H
  5906. #include <unistd.h>
  5907. #endif
  5908. #include <sys/types.h>
  5909. #include <sys/signal.h>
  5910. #include <signal.h>    /* MG: for IRIX */
  5911. #if STDC_HEADERS
  5912. #include <stdlib.h>
  5913. #include <stddef.h>
  5914. #endif
  5915.  
  5916. int main() {
  5917.  
  5918.     /* function-body */
  5919.     sig_atomic_t sample;
  5920.  
  5921.     sample = (sig_atomic_t) getpid();    /* bogus code, of course */
  5922.     exit((sample > 0) ? 0 : 1);
  5923.  
  5924. ; return 0; }
  5925. EOF
  5926. if { (eval echo configure:5928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  5927.   rm -rf conftest*
  5928.   
  5929.     ac_cv_type_sig_atomic_t=yes
  5930.  
  5931. else
  5932.   echo "configure: failed program was:" >&5
  5933.   cat conftest.$ac_ext >&5
  5934.   rm -rf conftest*
  5935.   
  5936.     ac_cv_type_sig_atomic_t=no
  5937.  
  5938. fi
  5939. rm -rf conftest*
  5940. echo "$ac_t""$ac_cv_type_sig_atomic_t" 1>&6
  5941. if test $ac_cv_type_sig_atomic_t = no ; then
  5942.     cat >> confdefs.h <<\EOF
  5943. #define sig_atomic_t int
  5944. EOF
  5945.  
  5946. fi
  5947.  
  5948.  
  5949. echo $ac_n "checking how to access getopt() global variables""... $ac_c" 1>&6
  5950. echo "configure:5952: checking how to access getopt() global variables" >&5
  5951. if eval "test \"`echo '$''{'wi_cv_getopt_decl'+set}'`\" = set"; then
  5952.   echo $ac_n "(cached) $ac_c" 1>&6
  5953. else
  5954.   
  5955.  
  5956.     if test "x$ac_cv_header_unistd_h" = x ; then
  5957.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_GETOPT." 1>&2; exit 1; }
  5958.     fi
  5959.  
  5960. cat > conftest.$ac_ext <<EOF
  5961. #line 5963 "configure"
  5962. #include "confdefs.h"
  5963.  
  5964. /* includes */
  5965. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  5966. #    define _ALL_SOURCE 1
  5967. #endif
  5968. #ifdef HAVE_UNISTD_H
  5969. #    include <unistd.h>
  5970. #endif
  5971. #include <stdio.h>
  5972. #include <stdlib.h>
  5973.  
  5974. int main() {
  5975.  
  5976.     optind = (optarg == 0) ? 66 : 99;
  5977.  
  5978. ; return 0; }
  5979. EOF
  5980. if { (eval echo configure:5982: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  5981.   rm -rf conftest*
  5982.   wi_cv_getopt_decl="automatic"
  5983. else
  5984.   echo "configure: failed program was:" >&5
  5985.   cat conftest.$ac_ext >&5
  5986.   rm -rf conftest*
  5987.   wi_cv_getopt_decl="unknown"
  5988. fi
  5989. rm -rf conftest*
  5990.  
  5991.  
  5992.  
  5993. if test "$wi_cv_getopt_decl" = unknown ; then
  5994. cat > conftest.$ac_ext <<EOF
  5995. #line 5997 "configure"
  5996. #include "confdefs.h"
  5997.  
  5998. /* includes */
  5999. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  6000. #    define _ALL_SOURCE 1
  6001. #endif
  6002. #ifdef HAVE_UNISTD_H
  6003. #    include <unistd.h>
  6004. #endif
  6005. #include <stdio.h>
  6006. #include <stdlib.h>
  6007. #include <getopt.h>
  6008.  
  6009. int main() {
  6010.  
  6011.     optind = (optarg == 0) ? 66 : 99;
  6012.  
  6013. ; return 0; }
  6014. EOF
  6015. if { (eval echo configure:6017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  6016.   rm -rf conftest*
  6017.   
  6018. #
  6019. # Looks like <getopt.h> declares the variables as extern.
  6020. #
  6021. wi_cv_getopt_decl="getopt.h"
  6022. else
  6023.   echo "configure: failed program was:" >&5
  6024.   cat conftest.$ac_ext >&5
  6025.   rm -rf conftest*
  6026.   
  6027. #
  6028. # You'll need to declare them yourself.
  6029. #
  6030. wi_cv_getopt_decl="manual"
  6031.  
  6032. fi
  6033. rm -rf conftest*
  6034. fi
  6035.  
  6036. fi
  6037.  
  6038. echo "$ac_t""$wi_cv_getopt_decl" 1>&6
  6039. if test "$wi_cv_getopt_decl" = "getopt.h" ; then
  6040.     cat >> confdefs.h <<\EOF
  6041. #define NEED_GETOPT_H 1
  6042. EOF
  6043.  
  6044. elif test "$wi_cv_getopt_decl" = "manual" ; then
  6045.     cat >> confdefs.h <<\EOF
  6046. #define NEED_GETOPT_EXTERN_DECLS 1
  6047. EOF
  6048.  
  6049. fi
  6050.  
  6051.  
  6052. echo $ac_n "checking for useable _res global variable""... $ac_c" 1>&6
  6053. echo "configure:6055: checking for useable _res global variable" >&5
  6054. cat > conftest.$ac_ext <<EOF
  6055. #line 6057 "configure"
  6056. #include "confdefs.h"
  6057.  
  6058.     /* includes */
  6059. #include <unistd.h>
  6060. #include <sys/types.h>
  6061. #include <sys/stat.h>
  6062. #include <sys/socket.h>
  6063. #include <arpa/inet.h>
  6064. #include <netinet/in.h>
  6065. #ifdef HAVE_ARPA_NAMESER_H
  6066. #    include <arpa/nameser.h>
  6067. #endif
  6068. #ifdef HAVE_RESOLV_H
  6069. #    include <resolv.h>
  6070. #endif
  6071.  
  6072. int main() {
  6073.  
  6074.     /* function-body */
  6075.     int len;
  6076.  
  6077.     res_init();
  6078.     len = (int) strlen(_res.defdname);
  6079.  
  6080. ; return 0; }
  6081. EOF
  6082. if { (eval echo configure:6084: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6083.   rm -rf conftest*
  6084.   
  6085.     wi_cv__res_defdname=yes
  6086.     cat >> confdefs.h <<\EOF
  6087. #define HAVE__RES_DEFDNAME 1
  6088. EOF
  6089.  
  6090.  
  6091. else
  6092.   echo "configure: failed program was:" >&5
  6093.   cat conftest.$ac_ext >&5
  6094.   rm -rf conftest*
  6095.   
  6096.     wi_cv__res_defdname=no
  6097.  
  6098. fi
  6099. rm -rf conftest*
  6100. echo "$ac_t""$wi_cv__res_defdname" 1>&6
  6101.     
  6102. echo $ac_n "checking for struct cmsghdr""... $ac_c" 1>&6
  6103. echo "configure:6105: checking for struct cmsghdr" >&5
  6104. if eval "test \"`echo '$''{'wi_cv_struct_cmsghdr'+set}'`\" = set"; then
  6105.   echo $ac_n "(cached) $ac_c" 1>&6
  6106. else
  6107.   
  6108. cat > conftest.$ac_ext <<EOF
  6109. #line 6111 "configure"
  6110. #include "confdefs.h"
  6111.  
  6112.     /* includes */
  6113. #include <unistd.h>
  6114. #include <sys/types.h>
  6115. #include <sys/uio.h>
  6116. #include <sys/socket.h>
  6117. #include <sys/un.h>
  6118.  
  6119. int main() {
  6120.  
  6121. struct cmsghdr cm;
  6122.  
  6123. cm.cmsg_len = 0;
  6124. cm.cmsg_level = 0;
  6125. cm.cmsg_type = 0;
  6126. exit(((int) &cm.cmsg_type) & 0xff);    /* bogus code, of course. */
  6127.  
  6128. ; return 0; }
  6129. EOF
  6130. if { (eval echo configure:6132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6131.   rm -rf conftest*
  6132.   
  6133.     wi_cv_struct_cmsghdr=yes
  6134.  
  6135. else
  6136.   echo "configure: failed program was:" >&5
  6137.   cat conftest.$ac_ext >&5
  6138.   rm -rf conftest*
  6139.   
  6140.     wi_cv_struct_cmsghdr=no
  6141.  
  6142. fi
  6143. rm -rf conftest*
  6144.  
  6145. fi
  6146.  
  6147. echo "$ac_t""$wi_cv_struct_cmsghdr" 1>&6
  6148. if test "$wi_cv_struct_cmsghdr" = yes ; then
  6149.     cat >> confdefs.h <<\EOF
  6150. #define HAVE_STRUCT_CMSGDHR 1
  6151. EOF
  6152.  
  6153. fi
  6154.     
  6155. echo $ac_n "checking for msg_control field in struct msghdr""... $ac_c" 1>&6
  6156. echo "configure:6158: checking for msg_control field in struct msghdr" >&5
  6157. if eval "test \"`echo '$''{'wi_cv_msghdr_control'+set}'`\" = set"; then
  6158.   echo $ac_n "(cached) $ac_c" 1>&6
  6159. else
  6160.   
  6161. cat > conftest.$ac_ext <<EOF
  6162. #line 6164 "configure"
  6163. #include "confdefs.h"
  6164.  
  6165.     /* includes */
  6166. #include <unistd.h>
  6167. #include <sys/types.h>
  6168. #include <sys/uio.h>
  6169. #include <sys/socket.h>
  6170. #include <sys/un.h>
  6171.  
  6172. int main() {
  6173.  
  6174. struct msghdr m;
  6175.  
  6176. m.msg_control = &m;
  6177. m.msg_controllen = sizeof(m);
  6178. exit(((int) &m.msg_control) & 0xff);    /* bogus code, of course. */
  6179.  
  6180. ; return 0; }
  6181. EOF
  6182. if { (eval echo configure:6184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6183.   rm -rf conftest*
  6184.   
  6185.     wi_cv_msghdr_control=yes
  6186.  
  6187. else
  6188.   echo "configure: failed program was:" >&5
  6189.   cat conftest.$ac_ext >&5
  6190.   rm -rf conftest*
  6191.   
  6192.     wi_cv_msghdr_control=no
  6193.  
  6194. fi
  6195. rm -rf conftest*
  6196.  
  6197. fi
  6198.  
  6199. echo "$ac_t""$wi_cv_msghdr_control" 1>&6
  6200. if test "$wi_cv_msghdr_control" = yes ; then
  6201.     cat >> confdefs.h <<\EOF
  6202. #define HAVE_MSGHDR_CONTROL 1
  6203. EOF
  6204.  
  6205. fi
  6206.     
  6207. echo $ac_n "checking for msg_accrights field in struct msghdr""... $ac_c" 1>&6
  6208. echo "configure:6210: checking for msg_accrights field in struct msghdr" >&5
  6209. if eval "test \"`echo '$''{'wi_cv_msghdr_accrights'+set}'`\" = set"; then
  6210.   echo $ac_n "(cached) $ac_c" 1>&6
  6211. else
  6212.   
  6213. cat > conftest.$ac_ext <<EOF
  6214. #line 6216 "configure"
  6215. #include "confdefs.h"
  6216.  
  6217.     /* includes */
  6218. #include <unistd.h>
  6219. #include <sys/types.h>
  6220. #include <sys/uio.h>
  6221. #include <sys/socket.h>
  6222. #include <sys/un.h>
  6223.  
  6224. int main() {
  6225.  
  6226. struct msghdr m;
  6227.  
  6228. m.msg_accrights = &m;
  6229. m.msg_accrightslen = sizeof(m);
  6230. exit(((int) &m.msg_accrights) & 0xff);    /* bogus code, of course. */
  6231.  
  6232. ; return 0; }
  6233. EOF
  6234. if { (eval echo configure:6236: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6235.   rm -rf conftest*
  6236.   
  6237.     wi_cv_msghdr_accrights=yes
  6238.  
  6239. else
  6240.   echo "configure: failed program was:" >&5
  6241.   cat conftest.$ac_ext >&5
  6242.   rm -rf conftest*
  6243.   
  6244.     wi_cv_msghdr_accrights=no
  6245.  
  6246. fi
  6247. rm -rf conftest*
  6248.  
  6249. fi
  6250.  
  6251. echo "$ac_t""$wi_cv_msghdr_accrights" 1>&6
  6252. if test "$wi_cv_msghdr_accrights" = yes ; then
  6253.     cat >> confdefs.h <<\EOF
  6254. #define HAVE_MSGHDR_ACCRIGHTS 1
  6255. EOF
  6256.  
  6257. fi
  6258.     
  6259.  
  6260.     if test "x$ac_cv_header_unistd_h" = x ; then
  6261.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_HEADER_SYS_SELECT_H." 1>&2; exit 1; }
  6262.     fi
  6263.  
  6264. # See if <sys/select.h> is includable after <sys/time.h>
  6265. if test "$ac_cv_header_sys_time_h" = no ; then
  6266.     wi_chk_headers="sys/time.h sys/select.h"
  6267. else
  6268.     wi_chk_headers="sys/time.h"
  6269. fi
  6270. for ac_hdr in $wi_chk_headers
  6271. do
  6272. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  6273. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  6274. echo "configure:6276: checking for $ac_hdr" >&5
  6275. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  6276.   echo $ac_n "(cached) $ac_c" 1>&6
  6277. else
  6278.   cat > conftest.$ac_ext <<EOF
  6279. #line 6281 "configure"
  6280. #include "confdefs.h"
  6281. #include <$ac_hdr>
  6282. EOF
  6283. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  6284. { (eval echo configure:6286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  6285. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  6286. if test -z "$ac_err"; then
  6287.   rm -rf conftest*
  6288.   eval "ac_cv_header_$ac_safe=yes"
  6289. else
  6290.   echo "$ac_err" >&5
  6291.   echo "configure: failed program was:" >&5
  6292.   cat conftest.$ac_ext >&5
  6293.   rm -rf conftest*
  6294.   eval "ac_cv_header_$ac_safe=no"
  6295. fi
  6296. rm -rf conftest*
  6297. fi
  6298. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  6299.   echo "$ac_t""yes" 1>&6
  6300.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  6301.   cat >> confdefs.h <<EOF
  6302. #define $ac_tr_hdr 1
  6303. EOF
  6304.  
  6305. else
  6306.   echo "$ac_t""no" 1>&6
  6307. fi
  6308. done
  6309.  
  6310. if test "$ac_cv_header_sys_select_h" = yes ; then
  6311.     echo $ac_n "checking if <sys/select.h> is compatible with <sys/time.h>""... $ac_c" 1>&6
  6312. echo "configure:6314: checking if <sys/select.h> is compatible with <sys/time.h>" >&5
  6313.     selecth=yes
  6314.     if test "$ac_cv_header_sys_time_h" = yes ; then
  6315.         cat > conftest.$ac_ext <<EOF
  6316. #line 6318 "configure"
  6317. #include "confdefs.h"
  6318.  
  6319. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  6320. #    define _ALL_SOURCE 1
  6321. #endif
  6322. #ifdef HAVE_UNISTD_H
  6323. #    include <unistd.h>
  6324. #endif
  6325. #include <sys/types.h>
  6326. #include <sys/time.h>
  6327. #include <sys/select.h>
  6328. int main() {
  6329.  
  6330.         fd_set a;
  6331.         struct timeval tmval;
  6332.  
  6333.         tmval.tv_sec = 0;
  6334. ; return 0; }
  6335. EOF
  6336. if { (eval echo configure:6338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  6337.   rm -rf conftest*
  6338.   selecth=yes
  6339. else
  6340.   echo "configure: failed program was:" >&5
  6341.   cat conftest.$ac_ext >&5
  6342.   rm -rf conftest*
  6343.   selecth=no
  6344. fi
  6345. rm -rf conftest*
  6346.     fi
  6347.     if test "$selecth" = yes ; then
  6348.         cat >> confdefs.h <<\EOF
  6349. #define CAN_USE_SYS_SELECT_H 1
  6350. EOF
  6351.  
  6352.     fi
  6353.     echo "$ac_t""$selecth" 1>&6
  6354. fi
  6355.     
  6356.  
  6357.  
  6358.  
  6359. if test "${SYS}" = sunos ; then
  6360.     # Use getwd on SunOS -- getcwd does a "popen("/bin/pwd")" -- aaaccck.
  6361.     #
  6362.     for ac_func in getwd
  6363. do
  6364. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  6365. echo "configure:6367: checking for $ac_func" >&5
  6366. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6367.   echo $ac_n "(cached) $ac_c" 1>&6
  6368. else
  6369.   cat > conftest.$ac_ext <<EOF
  6370. #line 6372 "configure"
  6371. #include "confdefs.h"
  6372. /* System header to define __stub macros and hopefully few prototypes,
  6373.     which can conflict with char $ac_func(); below.  */
  6374. #include <assert.h>
  6375. /* Override any gcc2 internal prototype to avoid an error.  */
  6376. /* We use char because int might match the return type of a gcc2
  6377.     builtin and then its argument prototype would still apply.  */
  6378. char $ac_func();
  6379.  
  6380. int main() {
  6381.  
  6382. /* The GNU C library defines this for functions which it implements
  6383.     to always fail with ENOSYS.  Some functions are actually named
  6384.     something starting with __ and the normal name is an alias.  */
  6385. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6386. choke me
  6387. #else
  6388. $ac_func();
  6389. #endif
  6390.  
  6391. ; return 0; }
  6392. EOF
  6393. if { (eval echo configure:6395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6394.   rm -rf conftest*
  6395.   eval "ac_cv_func_$ac_func=yes"
  6396. else
  6397.   echo "configure: failed program was:" >&5
  6398.   cat conftest.$ac_ext >&5
  6399.   rm -rf conftest*
  6400.   eval "ac_cv_func_$ac_func=no"
  6401. fi
  6402. rm -rf conftest*
  6403. fi
  6404.  
  6405. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6406.   echo "$ac_t""yes" 1>&6
  6407.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  6408.   cat >> confdefs.h <<EOF
  6409. #define $ac_tr_func 1
  6410. EOF
  6411.  
  6412. else
  6413.   echo "$ac_t""no" 1>&6
  6414. fi
  6415. done
  6416.  
  6417. else
  6418.     for ac_func in getcwd getwd
  6419. do
  6420. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  6421. echo "configure:6423: checking for $ac_func" >&5
  6422. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6423.   echo $ac_n "(cached) $ac_c" 1>&6
  6424. else
  6425.   cat > conftest.$ac_ext <<EOF
  6426. #line 6428 "configure"
  6427. #include "confdefs.h"
  6428. /* System header to define __stub macros and hopefully few prototypes,
  6429.     which can conflict with char $ac_func(); below.  */
  6430. #include <assert.h>
  6431. /* Override any gcc2 internal prototype to avoid an error.  */
  6432. /* We use char because int might match the return type of a gcc2
  6433.     builtin and then its argument prototype would still apply.  */
  6434. char $ac_func();
  6435.  
  6436. int main() {
  6437.  
  6438. /* The GNU C library defines this for functions which it implements
  6439.     to always fail with ENOSYS.  Some functions are actually named
  6440.     something starting with __ and the normal name is an alias.  */
  6441. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6442. choke me
  6443. #else
  6444. $ac_func();
  6445. #endif
  6446.  
  6447. ; return 0; }
  6448. EOF
  6449. if { (eval echo configure:6451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6450.   rm -rf conftest*
  6451.   eval "ac_cv_func_$ac_func=yes"
  6452. else
  6453.   echo "configure: failed program was:" >&5
  6454.   cat conftest.$ac_ext >&5
  6455.   rm -rf conftest*
  6456.   eval "ac_cv_func_$ac_func=no"
  6457. fi
  6458. rm -rf conftest*
  6459. fi
  6460.  
  6461. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6462.   echo "$ac_t""yes" 1>&6
  6463.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  6464.   cat >> confdefs.h <<EOF
  6465. #define $ac_tr_func 1
  6466. EOF
  6467.  
  6468. else
  6469.   echo "$ac_t""no" 1>&6
  6470. fi
  6471. done
  6472.  
  6473. fi
  6474. if test "$ac_cv_func_getcwd" = no && test "$ac_cv_func_getwd" = no ; then
  6475. echo "configure: warning: This system does not have either getwd or getcwd?" 1>&2
  6476. echo "configure: warning: I find that a little hard to believe." 1>&2
  6477. echo "configure: warning: You may want to try -DHAVE_GETWD anyway." 1>&2
  6478. echo "configure: warning: 
  6479. This could also mean that your compiler isn't working" 1>&2
  6480. echo "configure: warning: with this configure script.  Check the ./config.log" 1>&2
  6481. echo "configure: warning: and look for anomalies." 1>&2
  6482. fi
  6483.  
  6484. for ac_func in fstat64 getdomainname gethostname getpass getpassphrase gnu_get_libc_release gnu_get_libc_version inet_aton inet_ntop llseek lseek64 lstat64 memmove mktime open64 pathconf readlink res_init setlocale setpgid setpgrp setsid setvbuf sigaction sigsetjmp stat64 strcasecmp strcoll strdup strerror strncoll strstr strtoq symlink sysconf sysctl sysinfo syslog tcgetattr uname waitpid
  6485. do
  6486. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  6487. echo "configure:6489: checking for $ac_func" >&5
  6488. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6489.   echo $ac_n "(cached) $ac_c" 1>&6
  6490. else
  6491.   cat > conftest.$ac_ext <<EOF
  6492. #line 6494 "configure"
  6493. #include "confdefs.h"
  6494. /* System header to define __stub macros and hopefully few prototypes,
  6495.     which can conflict with char $ac_func(); below.  */
  6496. #include <assert.h>
  6497. /* Override any gcc2 internal prototype to avoid an error.  */
  6498. /* We use char because int might match the return type of a gcc2
  6499.     builtin and then its argument prototype would still apply.  */
  6500. char $ac_func();
  6501.  
  6502. int main() {
  6503.  
  6504. /* The GNU C library defines this for functions which it implements
  6505.     to always fail with ENOSYS.  Some functions are actually named
  6506.     something starting with __ and the normal name is an alias.  */
  6507. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6508. choke me
  6509. #else
  6510. $ac_func();
  6511. #endif
  6512.  
  6513. ; return 0; }
  6514. EOF
  6515. if { (eval echo configure:6517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6516.   rm -rf conftest*
  6517.   eval "ac_cv_func_$ac_func=yes"
  6518. else
  6519.   echo "configure: failed program was:" >&5
  6520.   cat conftest.$ac_ext >&5
  6521.   rm -rf conftest*
  6522.   eval "ac_cv_func_$ac_func=no"
  6523. fi
  6524. rm -rf conftest*
  6525. fi
  6526.  
  6527. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6528.   echo "$ac_t""yes" 1>&6
  6529.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  6530.   cat >> confdefs.h <<EOF
  6531. #define $ac_tr_func 1
  6532. EOF
  6533.  
  6534. else
  6535.   echo "$ac_t""no" 1>&6
  6536. fi
  6537. done
  6538.  
  6539. for ac_func in gethostbyaddr_r gethostbyname_r gethostbyname2_r getlogin_r getpwnam_r _posix_getpwnam_r getpwuid_r _posix_getpwuid_r getservbyname_r getservbyport_r gmtime_r localtime_r readdir_r
  6540. do
  6541. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  6542. echo "configure:6544: checking for $ac_func" >&5
  6543. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6544.   echo $ac_n "(cached) $ac_c" 1>&6
  6545. else
  6546.   cat > conftest.$ac_ext <<EOF
  6547. #line 6549 "configure"
  6548. #include "confdefs.h"
  6549. /* System header to define __stub macros and hopefully few prototypes,
  6550.     which can conflict with char $ac_func(); below.  */
  6551. #include <assert.h>
  6552. /* Override any gcc2 internal prototype to avoid an error.  */
  6553. /* We use char because int might match the return type of a gcc2
  6554.     builtin and then its argument prototype would still apply.  */
  6555. char $ac_func();
  6556.  
  6557. int main() {
  6558.  
  6559. /* The GNU C library defines this for functions which it implements
  6560.     to always fail with ENOSYS.  Some functions are actually named
  6561.     something starting with __ and the normal name is an alias.  */
  6562. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6563. choke me
  6564. #else
  6565. $ac_func();
  6566. #endif
  6567.  
  6568. ; return 0; }
  6569. EOF
  6570. if { (eval echo configure:6572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6571.   rm -rf conftest*
  6572.   eval "ac_cv_func_$ac_func=yes"
  6573. else
  6574.   echo "configure: failed program was:" >&5
  6575.   cat conftest.$ac_ext >&5
  6576.   rm -rf conftest*
  6577.   eval "ac_cv_func_$ac_func=no"
  6578. fi
  6579. rm -rf conftest*
  6580. fi
  6581.  
  6582. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6583.   echo "$ac_t""yes" 1>&6
  6584.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  6585.   cat >> confdefs.h <<EOF
  6586. #define $ac_tr_func 1
  6587. EOF
  6588.  
  6589. else
  6590.   echo "$ac_t""no" 1>&6
  6591. fi
  6592. done
  6593.  
  6594.  
  6595. unset ac_cv_func_snprintf
  6596. unset ac_cv_func_vsnprintf
  6597.  
  6598. for ac_func in snprintf vsnprintf
  6599. do
  6600. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  6601. echo "configure:6603: checking for $ac_func" >&5
  6602. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6603.   echo $ac_n "(cached) $ac_c" 1>&6
  6604. else
  6605.   cat > conftest.$ac_ext <<EOF
  6606. #line 6608 "configure"
  6607. #include "confdefs.h"
  6608. /* System header to define __stub macros and hopefully few prototypes,
  6609.     which can conflict with char $ac_func(); below.  */
  6610. #include <assert.h>
  6611. /* Override any gcc2 internal prototype to avoid an error.  */
  6612. /* We use char because int might match the return type of a gcc2
  6613.     builtin and then its argument prototype would still apply.  */
  6614. char $ac_func();
  6615.  
  6616. int main() {
  6617.  
  6618. /* The GNU C library defines this for functions which it implements
  6619.     to always fail with ENOSYS.  Some functions are actually named
  6620.     something starting with __ and the normal name is an alias.  */
  6621. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6622. choke me
  6623. #else
  6624. $ac_func();
  6625. #endif
  6626.  
  6627. ; return 0; }
  6628. EOF
  6629. if { (eval echo configure:6631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6630.   rm -rf conftest*
  6631.   eval "ac_cv_func_$ac_func=yes"
  6632. else
  6633.   echo "configure: failed program was:" >&5
  6634.   cat conftest.$ac_ext >&5
  6635.   rm -rf conftest*
  6636.   eval "ac_cv_func_$ac_func=no"
  6637. fi
  6638. rm -rf conftest*
  6639. fi
  6640.  
  6641. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6642.   echo "$ac_t""yes" 1>&6
  6643.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  6644.   cat >> confdefs.h <<EOF
  6645. #define $ac_tr_func 1
  6646. EOF
  6647.  
  6648. else
  6649.   echo "$ac_t""no" 1>&6
  6650. fi
  6651. done
  6652.  
  6653. if test "$ac_cv_func_snprintf" = yes ; then
  6654.     
  6655. if test "$ac_cv_func_snprintf" != "no" ; then
  6656. echo $ac_n "checking if snprintf works correctly""... $ac_c" 1>&6
  6657. echo "configure:6659: checking if snprintf works correctly" >&5
  6658.  
  6659.     if test "x$ac_cv_header_unistd_h" = x ; then
  6660.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SNPRINTF_TERMINATES." 1>&2; exit 1; }
  6661.     fi
  6662.  
  6663. if test "$cross_compiling" = yes; then
  6664.   
  6665.     # action if cross compiling
  6666.     wi_cv_snprintf_terminates=yes
  6667.     cat >> confdefs.h <<\EOF
  6668. #define SNPRINTF_TERMINATES 1
  6669. EOF
  6670.  
  6671.     guess="(guessing) "
  6672.     x="yes"
  6673.  
  6674. else
  6675.   cat > conftest.$ac_ext <<EOF
  6676. #line 6678 "configure"
  6677. #include "confdefs.h"
  6678.  
  6679.     /* program */
  6680. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  6681. #    define _ALL_SOURCE 1
  6682. #endif
  6683. #ifdef HAVE_UNISTD_H
  6684. #    include <unistd.h>
  6685. #endif
  6686. #include <stdio.h>
  6687. #include <string.h>
  6688. #ifdef HAVE_STRINGS_H
  6689. #include <strings.h>
  6690. #endif
  6691. #include <stdlib.h>
  6692. #ifdef HAVE_SNPRINTF_H
  6693. #    include <snprintf.h>
  6694. #endif
  6695.  
  6696. main()
  6697. {
  6698.     char s[16];
  6699.     int i, result;
  6700.  
  6701.     for (i=0; i<(int)(sizeof(s)/sizeof(char)); i++)
  6702.         s[i] = 'x';
  6703.     result = (int) snprintf(s + 1, 10, "%s %s!", "hello", "world");
  6704.     if (s[10] != '\0')
  6705.         exit(1);    /* did not force termination! */
  6706.     if (s[11] != 'x')
  6707.         exit(2);    /* overflow! */
  6708.     if (s[0] != 'x')
  6709.         exit(3);    /* underflow! */
  6710.     exit(0);
  6711. }
  6712.  
  6713. EOF
  6714. if { (eval echo configure:6716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  6715. then
  6716.   
  6717.     # action if true
  6718.     wi_cv_snprintf_terminates=yes
  6719.     cat >> confdefs.h <<\EOF
  6720. #define SNPRINTF_TERMINATES 1
  6721. EOF
  6722.  
  6723.     guess=""
  6724.     x="yes"
  6725.  
  6726. else
  6727.   echo "configure: failed program was:" >&5
  6728.   cat conftest.$ac_ext >&5
  6729.   rm -fr conftest*
  6730.   
  6731.     # action if false
  6732.       wi_cv_snprintf_terminates=no
  6733.     guess=""
  6734.     x="no"
  6735.  
  6736. fi
  6737. rm -fr conftest*
  6738. fi
  6739.  
  6740. echo "$ac_t""$guess$x" 1>&6
  6741. fi
  6742.  
  6743.     
  6744. echo $ac_n "checking what snprintf() returns""... $ac_c" 1>&6
  6745. echo "configure:6747: checking what snprintf() returns" >&5
  6746. if test "$cross_compiling" = yes; then
  6747.   
  6748.     # action if cross compiling
  6749.     wi_cv_snprintf_returns_ptr=no
  6750.     guess="(guessing) "
  6751.     x="length of data written"
  6752.  
  6753. else
  6754.   cat > conftest.$ac_ext <<EOF
  6755. #line 6757 "configure"
  6756. #include "confdefs.h"
  6757.  
  6758.     /* program */
  6759. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  6760. #    define _ALL_SOURCE 1
  6761. #endif
  6762. #ifdef HAVE_UNISTD_H
  6763. #    include <unistd.h>
  6764. #endif
  6765. #include <stdio.h>
  6766. #include <string.h>
  6767. #ifdef HAVE_STRINGS_H
  6768. #include <strings.h>
  6769. #endif
  6770. #include <stdlib.h>
  6771. #ifdef HAVE_SNPRINTF_H
  6772. #    include <snprintf.h>
  6773. #endif
  6774.  
  6775. main()
  6776. {
  6777.     int result;
  6778.     char s[8];
  6779.  
  6780.     result = (int) snprintf(s, sizeof(s) - 1, "%d", 22);
  6781.     if (result == 2)
  6782.         exit(0);
  6783.     exit(1);
  6784.  
  6785. }
  6786.  
  6787. EOF
  6788. if { (eval echo configure:6790: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  6789. then
  6790.   
  6791.     # action if true
  6792.     wi_cv_snprintf_returns_ptr=no
  6793.     guess=""
  6794.     x="length of data written"
  6795.  
  6796. else
  6797.   echo "configure: failed program was:" >&5
  6798.   cat conftest.$ac_ext >&5
  6799.   rm -fr conftest*
  6800.   
  6801.     # action if false
  6802.       wi_cv_snprintf_returns_ptr=yes
  6803.     cat >> confdefs.h <<\EOF
  6804. #define SNPRINTF_RETURNS_PTR 1
  6805. EOF
  6806.  
  6807.     guess=""
  6808.     x="pointer to data"
  6809.  
  6810. fi
  6811. rm -fr conftest*
  6812. fi
  6813.  
  6814. echo "$ac_t""$guess$x" 1>&6
  6815.  
  6816.     
  6817. if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then
  6818.     echo $ac_n "checking for snprintf in -lsnprintf""... $ac_c" 1>&6
  6819. echo "configure:6821: checking for snprintf in -lsnprintf" >&5
  6820. ac_lib_var=`echo snprintf'_'snprintf | sed 'y%./+-%__p_%'`
  6821. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6822.   echo $ac_n "(cached) $ac_c" 1>&6
  6823. else
  6824.   ac_save_LIBS="$LIBS"
  6825. LIBS="-lsnprintf  $LIBS"
  6826. cat > conftest.$ac_ext <<EOF
  6827. #line 6829 "configure"
  6828. #include "confdefs.h"
  6829. /* Override any gcc2 internal prototype to avoid an error.  */
  6830. /* We use char because int might match the return type of a gcc2
  6831.     builtin and then its argument prototype would still apply.  */
  6832. char snprintf();
  6833.  
  6834. int main() {
  6835. snprintf()
  6836. ; return 0; }
  6837. EOF
  6838. if { (eval echo configure:6840: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6839.   rm -rf conftest*
  6840.   eval "ac_cv_lib_$ac_lib_var=yes"
  6841. else
  6842.   echo "configure: failed program was:" >&5
  6843.   cat conftest.$ac_ext >&5
  6844.   rm -rf conftest*
  6845.   eval "ac_cv_lib_$ac_lib_var=no"
  6846. fi
  6847. rm -rf conftest*
  6848. LIBS="$ac_save_LIBS"
  6849.  
  6850. fi
  6851. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6852.   echo "$ac_t""yes" 1>&6
  6853.     ac_tr_lib=HAVE_LIB`echo snprintf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  6854.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  6855.   cat >> confdefs.h <<EOF
  6856. #define $ac_tr_lib 1
  6857. EOF
  6858.  
  6859.   LIBS="-lsnprintf $LIBS"
  6860.  
  6861. else
  6862.   echo "$ac_t""no" 1>&6
  6863. fi
  6864.  
  6865.     if test "$ac_cv_lib_snprintf_snprintf" = yes ; then
  6866.         unset ac_cv_func_snprintf ac_cv_func_vsnprintf
  6867.         for ac_hdr in snprintf.h
  6868. do
  6869. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  6870. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  6871. echo "configure:6873: checking for $ac_hdr" >&5
  6872. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  6873.   echo $ac_n "(cached) $ac_c" 1>&6
  6874. else
  6875.   cat > conftest.$ac_ext <<EOF
  6876. #line 6878 "configure"
  6877. #include "confdefs.h"
  6878. #include <$ac_hdr>
  6879. EOF
  6880. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  6881. { (eval echo configure:6883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  6882. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  6883. if test -z "$ac_err"; then
  6884.   rm -rf conftest*
  6885.   eval "ac_cv_header_$ac_safe=yes"
  6886. else
  6887.   echo "$ac_err" >&5
  6888.   echo "configure: failed program was:" >&5
  6889.   cat conftest.$ac_ext >&5
  6890.   rm -rf conftest*
  6891.   eval "ac_cv_header_$ac_safe=no"
  6892. fi
  6893. rm -rf conftest*
  6894. fi
  6895. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  6896.   echo "$ac_t""yes" 1>&6
  6897.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  6898.   cat >> confdefs.h <<EOF
  6899. #define $ac_tr_hdr 1
  6900. EOF
  6901.  
  6902. else
  6903.   echo "$ac_t""no" 1>&6
  6904. fi
  6905. done
  6906.  
  6907.         for ac_func in snprintf vsnprintf
  6908. do
  6909. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  6910. echo "configure:6912: checking for $ac_func" >&5
  6911. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6912.   echo $ac_n "(cached) $ac_c" 1>&6
  6913. else
  6914.   cat > conftest.$ac_ext <<EOF
  6915. #line 6917 "configure"
  6916. #include "confdefs.h"
  6917. /* System header to define __stub macros and hopefully few prototypes,
  6918.     which can conflict with char $ac_func(); below.  */
  6919. #include <assert.h>
  6920. /* Override any gcc2 internal prototype to avoid an error.  */
  6921. /* We use char because int might match the return type of a gcc2
  6922.     builtin and then its argument prototype would still apply.  */
  6923. char $ac_func();
  6924.  
  6925. int main() {
  6926.  
  6927. /* The GNU C library defines this for functions which it implements
  6928.     to always fail with ENOSYS.  Some functions are actually named
  6929.     something starting with __ and the normal name is an alias.  */
  6930. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6931. choke me
  6932. #else
  6933. $ac_func();
  6934. #endif
  6935.  
  6936. ; return 0; }
  6937. EOF
  6938. if { (eval echo configure:6940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6939.   rm -rf conftest*
  6940.   eval "ac_cv_func_$ac_func=yes"
  6941. else
  6942.   echo "configure: failed program was:" >&5
  6943.   cat conftest.$ac_ext >&5
  6944.   rm -rf conftest*
  6945.   eval "ac_cv_func_$ac_func=no"
  6946. fi
  6947. rm -rf conftest*
  6948. fi
  6949.  
  6950. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6951.   echo "$ac_t""yes" 1>&6
  6952.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  6953.   cat >> confdefs.h <<EOF
  6954. #define $ac_tr_func 1
  6955. EOF
  6956.  
  6957. else
  6958.   echo "$ac_t""no" 1>&6
  6959. fi
  6960. done
  6961.  
  6962.     fi
  6963. fi
  6964.  
  6965. else
  6966.     
  6967. if [ "$ac_cv_func_snprintf" = "no" ] || [ "$wi_cv_snprintf_terminates" = "no" ] || [ "$wi_cv_snprintf_returns_ptr" = "yes" ] ; then
  6968.     echo $ac_n "checking for snprintf in -lsnprintf""... $ac_c" 1>&6
  6969. echo "configure:6971: checking for snprintf in -lsnprintf" >&5
  6970. ac_lib_var=`echo snprintf'_'snprintf | sed 'y%./+-%__p_%'`
  6971. if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6972.   echo $ac_n "(cached) $ac_c" 1>&6
  6973. else
  6974.   ac_save_LIBS="$LIBS"
  6975. LIBS="-lsnprintf  $LIBS"
  6976. cat > conftest.$ac_ext <<EOF
  6977. #line 6979 "configure"
  6978. #include "confdefs.h"
  6979. /* Override any gcc2 internal prototype to avoid an error.  */
  6980. /* We use char because int might match the return type of a gcc2
  6981.     builtin and then its argument prototype would still apply.  */
  6982. char snprintf();
  6983.  
  6984. int main() {
  6985. snprintf()
  6986. ; return 0; }
  6987. EOF
  6988. if { (eval echo configure:6990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6989.   rm -rf conftest*
  6990.   eval "ac_cv_lib_$ac_lib_var=yes"
  6991. else
  6992.   echo "configure: failed program was:" >&5
  6993.   cat conftest.$ac_ext >&5
  6994.   rm -rf conftest*
  6995.   eval "ac_cv_lib_$ac_lib_var=no"
  6996. fi
  6997. rm -rf conftest*
  6998. LIBS="$ac_save_LIBS"
  6999.  
  7000. fi
  7001. if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  7002.   echo "$ac_t""yes" 1>&6
  7003.     ac_tr_lib=HAVE_LIB`echo snprintf | sed -e 's/[^a-zA-Z0-9_]/_/g' \
  7004.     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
  7005.   cat >> confdefs.h <<EOF
  7006. #define $ac_tr_lib 1
  7007. EOF
  7008.  
  7009.   LIBS="-lsnprintf $LIBS"
  7010.  
  7011. else
  7012.   echo "$ac_t""no" 1>&6
  7013. fi
  7014.  
  7015.     if test "$ac_cv_lib_snprintf_snprintf" = yes ; then
  7016.         unset ac_cv_func_snprintf ac_cv_func_vsnprintf
  7017.         for ac_hdr in snprintf.h
  7018. do
  7019. ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  7020. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  7021. echo "configure:7023: checking for $ac_hdr" >&5
  7022. if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  7023.   echo $ac_n "(cached) $ac_c" 1>&6
  7024. else
  7025.   cat > conftest.$ac_ext <<EOF
  7026. #line 7028 "configure"
  7027. #include "confdefs.h"
  7028. #include <$ac_hdr>
  7029. EOF
  7030. ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  7031. { (eval echo configure:7033: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  7032. ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  7033. if test -z "$ac_err"; then
  7034.   rm -rf conftest*
  7035.   eval "ac_cv_header_$ac_safe=yes"
  7036. else
  7037.   echo "$ac_err" >&5
  7038.   echo "configure: failed program was:" >&5
  7039.   cat conftest.$ac_ext >&5
  7040.   rm -rf conftest*
  7041.   eval "ac_cv_header_$ac_safe=no"
  7042. fi
  7043. rm -rf conftest*
  7044. fi
  7045. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  7046.   echo "$ac_t""yes" 1>&6
  7047.     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
  7048.   cat >> confdefs.h <<EOF
  7049. #define $ac_tr_hdr 1
  7050. EOF
  7051.  
  7052. else
  7053.   echo "$ac_t""no" 1>&6
  7054. fi
  7055. done
  7056.  
  7057.         for ac_func in snprintf vsnprintf
  7058. do
  7059. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  7060. echo "configure:7062: checking for $ac_func" >&5
  7061. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7062.   echo $ac_n "(cached) $ac_c" 1>&6
  7063. else
  7064.   cat > conftest.$ac_ext <<EOF
  7065. #line 7067 "configure"
  7066. #include "confdefs.h"
  7067. /* System header to define __stub macros and hopefully few prototypes,
  7068.     which can conflict with char $ac_func(); below.  */
  7069. #include <assert.h>
  7070. /* Override any gcc2 internal prototype to avoid an error.  */
  7071. /* We use char because int might match the return type of a gcc2
  7072.     builtin and then its argument prototype would still apply.  */
  7073. char $ac_func();
  7074.  
  7075. int main() {
  7076.  
  7077. /* The GNU C library defines this for functions which it implements
  7078.     to always fail with ENOSYS.  Some functions are actually named
  7079.     something starting with __ and the normal name is an alias.  */
  7080. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7081. choke me
  7082. #else
  7083. $ac_func();
  7084. #endif
  7085.  
  7086. ; return 0; }
  7087. EOF
  7088. if { (eval echo configure:7090: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  7089.   rm -rf conftest*
  7090.   eval "ac_cv_func_$ac_func=yes"
  7091. else
  7092.   echo "configure: failed program was:" >&5
  7093.   cat conftest.$ac_ext >&5
  7094.   rm -rf conftest*
  7095.   eval "ac_cv_func_$ac_func=no"
  7096. fi
  7097. rm -rf conftest*
  7098. fi
  7099.  
  7100. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7101.   echo "$ac_t""yes" 1>&6
  7102.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  7103.   cat >> confdefs.h <<EOF
  7104. #define $ac_tr_func 1
  7105. EOF
  7106.  
  7107. else
  7108.   echo "$ac_t""no" 1>&6
  7109. fi
  7110. done
  7111.  
  7112.     fi
  7113. fi
  7114.  
  7115.     
  7116. if test "$ac_cv_func_snprintf" != "no" ; then
  7117. echo $ac_n "checking if snprintf works correctly""... $ac_c" 1>&6
  7118. echo "configure:7120: checking if snprintf works correctly" >&5
  7119.  
  7120.     if test "x$ac_cv_header_unistd_h" = x ; then
  7121.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_SNPRINTF_TERMINATES." 1>&2; exit 1; }
  7122.     fi
  7123.  
  7124. if test "$cross_compiling" = yes; then
  7125.   
  7126.     # action if cross compiling
  7127.     wi_cv_snprintf_terminates=yes
  7128.     cat >> confdefs.h <<\EOF
  7129. #define SNPRINTF_TERMINATES 1
  7130. EOF
  7131.  
  7132.     guess="(guessing) "
  7133.     x="yes"
  7134.  
  7135. else
  7136.   cat > conftest.$ac_ext <<EOF
  7137. #line 7139 "configure"
  7138. #include "confdefs.h"
  7139.  
  7140.     /* program */
  7141. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  7142. #    define _ALL_SOURCE 1
  7143. #endif
  7144. #ifdef HAVE_UNISTD_H
  7145. #    include <unistd.h>
  7146. #endif
  7147. #include <stdio.h>
  7148. #include <string.h>
  7149. #ifdef HAVE_STRINGS_H
  7150. #include <strings.h>
  7151. #endif
  7152. #include <stdlib.h>
  7153. #ifdef HAVE_SNPRINTF_H
  7154. #    include <snprintf.h>
  7155. #endif
  7156.  
  7157. main()
  7158. {
  7159.     char s[16];
  7160.     int i, result;
  7161.  
  7162.     for (i=0; i<(int)(sizeof(s)/sizeof(char)); i++)
  7163.         s[i] = 'x';
  7164.     result = (int) snprintf(s + 1, 10, "%s %s!", "hello", "world");
  7165.     if (s[10] != '\0')
  7166.         exit(1);    /* did not force termination! */
  7167.     if (s[11] != 'x')
  7168.         exit(2);    /* overflow! */
  7169.     if (s[0] != 'x')
  7170.         exit(3);    /* underflow! */
  7171.     exit(0);
  7172. }
  7173.  
  7174. EOF
  7175. if { (eval echo configure:7177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  7176. then
  7177.   
  7178.     # action if true
  7179.     wi_cv_snprintf_terminates=yes
  7180.     cat >> confdefs.h <<\EOF
  7181. #define SNPRINTF_TERMINATES 1
  7182. EOF
  7183.  
  7184.     guess=""
  7185.     x="yes"
  7186.  
  7187. else
  7188.   echo "configure: failed program was:" >&5
  7189.   cat conftest.$ac_ext >&5
  7190.   rm -fr conftest*
  7191.   
  7192.     # action if false
  7193.       wi_cv_snprintf_terminates=no
  7194.     guess=""
  7195.     x="no"
  7196.  
  7197. fi
  7198. rm -fr conftest*
  7199. fi
  7200.  
  7201. echo "$ac_t""$guess$x" 1>&6
  7202. fi
  7203.  
  7204.     
  7205. echo $ac_n "checking what snprintf() returns""... $ac_c" 1>&6
  7206. echo "configure:7208: checking what snprintf() returns" >&5
  7207. if test "$cross_compiling" = yes; then
  7208.   
  7209.     # action if cross compiling
  7210.     wi_cv_snprintf_returns_ptr=no
  7211.     guess="(guessing) "
  7212.     x="length of data written"
  7213.  
  7214. else
  7215.   cat > conftest.$ac_ext <<EOF
  7216. #line 7218 "configure"
  7217. #include "confdefs.h"
  7218.  
  7219.     /* program */
  7220. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  7221. #    define _ALL_SOURCE 1
  7222. #endif
  7223. #ifdef HAVE_UNISTD_H
  7224. #    include <unistd.h>
  7225. #endif
  7226. #include <stdio.h>
  7227. #include <string.h>
  7228. #ifdef HAVE_STRINGS_H
  7229. #include <strings.h>
  7230. #endif
  7231. #include <stdlib.h>
  7232. #ifdef HAVE_SNPRINTF_H
  7233. #    include <snprintf.h>
  7234. #endif
  7235.  
  7236. main()
  7237. {
  7238.     int result;
  7239.     char s[8];
  7240.  
  7241.     result = (int) snprintf(s, sizeof(s) - 1, "%d", 22);
  7242.     if (result == 2)
  7243.         exit(0);
  7244.     exit(1);
  7245.  
  7246. }
  7247.  
  7248. EOF
  7249. if { (eval echo configure:7251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  7250. then
  7251.   
  7252.     # action if true
  7253.     wi_cv_snprintf_returns_ptr=no
  7254.     guess=""
  7255.     x="length of data written"
  7256.  
  7257. else
  7258.   echo "configure: failed program was:" >&5
  7259.   cat conftest.$ac_ext >&5
  7260.   rm -fr conftest*
  7261.   
  7262.     # action if false
  7263.       wi_cv_snprintf_returns_ptr=yes
  7264.     cat >> confdefs.h <<\EOF
  7265. #define SNPRINTF_RETURNS_PTR 1
  7266. EOF
  7267.  
  7268.     guess=""
  7269.     x="pointer to data"
  7270.  
  7271. fi
  7272. rm -fr conftest*
  7273. fi
  7274.  
  7275. echo "$ac_t""$guess$x" 1>&6
  7276.  
  7277. fi
  7278.  
  7279.  
  7280.  
  7281.     if test "x$ac_cv_header_unistd_h" = x ; then
  7282.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_FUNC_SIGSETJMP." 1>&2; exit 1; }
  7283.     fi
  7284.  
  7285. echo $ac_n "checking for sigsetjmp and siglongjmp""... $ac_c" 1>&6
  7286. echo "configure:7288: checking for sigsetjmp and siglongjmp" >&5
  7287. if eval "test \"`echo '$''{'wi_cv_func_sigsetjmp'+set}'`\" = set"; then
  7288.   echo $ac_n "(cached) $ac_c" 1>&6
  7289. else
  7290.   
  7291.  
  7292. cat > conftest.$ac_ext <<EOF
  7293. #line 7295 "configure"
  7294. #include "confdefs.h"
  7295.  
  7296.     /* includes */
  7297. #ifdef HAVE_UNISTD_H
  7298. #    include <unistd.h>
  7299. #endif
  7300. #include <sys/types.h>
  7301. #include <stdio.h>
  7302. #include <signal.h>
  7303. #include <setjmp.h>
  7304.  
  7305. int main() {
  7306.  
  7307.     /* function-body */
  7308.     sigjmp_buf sjb;
  7309.  
  7310.     if (sigsetjmp(sjb, 1) != 0)
  7311.         siglongjmp(sjb, 1);    /* bogus code, of course. */
  7312.     exit(0);
  7313.  
  7314. ; return 0; }
  7315. EOF
  7316. if { (eval echo configure:7318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  7317.   rm -rf conftest*
  7318.   
  7319.     wi_cv_func_sigsetjmp=yes
  7320.  
  7321. else
  7322.   echo "configure: failed program was:" >&5
  7323.   cat conftest.$ac_ext >&5
  7324.   rm -rf conftest*
  7325.   
  7326.     wi_cv_func_sigsetjmp=no
  7327.  
  7328. fi
  7329. rm -rf conftest*
  7330.  
  7331. fi
  7332.  
  7333. echo "$ac_t""$wi_cv_func_sigsetjmp" 1>&6
  7334. if test "$wi_cv_func_sigsetjmp" = yes ; then
  7335.     cat >> confdefs.h <<\EOF
  7336. #define HAVE_SIGSETJMP 1
  7337. EOF
  7338.  
  7339. fi
  7340.  
  7341.  
  7342. if test "x$ac_cv_func_setpgid" = "x" ; then
  7343.     for ac_func in setpgid setpgrp
  7344. do
  7345. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  7346. echo "configure:7348: checking for $ac_func" >&5
  7347. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7348.   echo $ac_n "(cached) $ac_c" 1>&6
  7349. else
  7350.   cat > conftest.$ac_ext <<EOF
  7351. #line 7353 "configure"
  7352. #include "confdefs.h"
  7353. /* System header to define __stub macros and hopefully few prototypes,
  7354.     which can conflict with char $ac_func(); below.  */
  7355. #include <assert.h>
  7356. /* Override any gcc2 internal prototype to avoid an error.  */
  7357. /* We use char because int might match the return type of a gcc2
  7358.     builtin and then its argument prototype would still apply.  */
  7359. char $ac_func();
  7360.  
  7361. int main() {
  7362.  
  7363. /* The GNU C library defines this for functions which it implements
  7364.     to always fail with ENOSYS.  Some functions are actually named
  7365.     something starting with __ and the normal name is an alias.  */
  7366. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7367. choke me
  7368. #else
  7369. $ac_func();
  7370. #endif
  7371.  
  7372. ; return 0; }
  7373. EOF
  7374. if { (eval echo configure:7376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  7375.   rm -rf conftest*
  7376.   eval "ac_cv_func_$ac_func=yes"
  7377. else
  7378.   echo "configure: failed program was:" >&5
  7379.   cat conftest.$ac_ext >&5
  7380.   rm -rf conftest*
  7381.   eval "ac_cv_func_$ac_func=no"
  7382. fi
  7383. rm -rf conftest*
  7384. fi
  7385.  
  7386. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7387.   echo "$ac_t""yes" 1>&6
  7388.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  7389.   cat >> confdefs.h <<EOF
  7390. #define $ac_tr_func 1
  7391. EOF
  7392.  
  7393. else
  7394.   echo "$ac_t""no" 1>&6
  7395. fi
  7396. done
  7397.  
  7398. fi
  7399. echo $ac_n "checking if setpgrp behavior needs to be checked""... $ac_c" 1>&6
  7400. echo "configure:7402: checking if setpgrp behavior needs to be checked" >&5
  7401. if test "x$ac_cv_func_setpgid" = "xyes" ; then
  7402.     # OK, we will be using setpgid instead of setpgrp then...
  7403.     echo "$ac_t""no" 1>&6
  7404.     ac_cv_func_setpgrp_void=dontcare
  7405. elif test "x$cross_compiling" = "xyes" ; then
  7406.     echo "$ac_t""yes" 1>&6
  7407.     echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
  7408. echo "configure:7410: checking whether setpgrp takes no argument" >&5
  7409.     case "`uname -a`" in
  7410.         *BSD*|*bsd*)
  7411.             ac_cv_func_setpgrp_void="no"
  7412.             ;;
  7413.         *)
  7414.             ac_cv_func_setpgrp_void="yes"
  7415.             cat >> confdefs.h <<\EOF
  7416. #define SETPGRP_VOID 1
  7417. EOF
  7418.  
  7419.             ;;
  7420.     esac
  7421.     echo "$ac_t"""${ac_cv_func_setpgrp_void}?"" 1>&6
  7422. else
  7423.     # We're not cross compiling, so we can try this check
  7424.     echo "$ac_t""yes" 1>&6
  7425.     echo $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>&6
  7426. echo "configure:7428: checking whether setpgrp takes no argument" >&5
  7427. if eval "test \"`echo '$''{'ac_cv_func_setpgrp_void'+set}'`\" = set"; then
  7428.   echo $ac_n "(cached) $ac_c" 1>&6
  7429. else
  7430.   if test "$cross_compiling" = yes; then
  7431.   { echo "configure: error: cannot check setpgrp if cross compiling" 1>&2; exit 1; }
  7432. else
  7433.   cat > conftest.$ac_ext <<EOF
  7434. #line 7436 "configure"
  7435. #include "confdefs.h"
  7436.  
  7437. #ifdef HAVE_UNISTD_H
  7438. #include <unistd.h>
  7439. #endif
  7440.  
  7441. /*
  7442.  * If this system has a BSD-style setpgrp, which takes arguments, exit
  7443.  * successfully.
  7444.  */
  7445. main()
  7446. {
  7447.     if (setpgrp(1,1) == -1)
  7448.     exit(0);
  7449.     else
  7450.     exit(1);
  7451. }
  7452.  
  7453. EOF
  7454. if { (eval echo configure:7456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  7455. then
  7456.   ac_cv_func_setpgrp_void=no
  7457. else
  7458.   echo "configure: failed program was:" >&5
  7459.   cat conftest.$ac_ext >&5
  7460.   rm -fr conftest*
  7461.   ac_cv_func_setpgrp_void=yes
  7462. fi
  7463. rm -fr conftest*
  7464. fi
  7465.  
  7466.  
  7467. fi
  7468.  
  7469. echo "$ac_t""$ac_cv_func_setpgrp_void" 1>&6
  7470. if test $ac_cv_func_setpgrp_void = yes; then
  7471.   cat >> confdefs.h <<\EOF
  7472. #define SETPGRP_VOID 1
  7473. EOF
  7474.  
  7475. fi
  7476.  
  7477. fi
  7478.  
  7479.  
  7480. echo $ac_n "checking whether setvbuf behavior can be checked""... $ac_c" 1>&6
  7481. echo "configure:7483: checking whether setvbuf behavior can be checked" >&5
  7482. if test "x$cross_compiling" = "xyes" ; then
  7483.     echo "$ac_t""no" 1>&6
  7484. else
  7485.     echo "$ac_t""yes" 1>&6
  7486.         echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
  7487. echo "configure:7489: checking whether setvbuf arguments are reversed" >&5
  7488. if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
  7489.   echo $ac_n "(cached) $ac_c" 1>&6
  7490. else
  7491.   if test "$cross_compiling" = yes; then
  7492.   ac_cv_func_setvbuf_reversed=no
  7493. else
  7494.   cat > conftest.$ac_ext <<EOF
  7495. #line 7497 "configure"
  7496. #include "confdefs.h"
  7497. #include <stdio.h>
  7498.     /* If setvbuf has the reversed format, exit 0. */
  7499.     main () {
  7500.       /* This call has the arguments reversed.
  7501.          A reversed system may check and see that the address of main
  7502.          is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
  7503.       if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
  7504.         exit(1);
  7505.       putc('\r', stdout);
  7506.       exit(0);            /* Non-reversed systems segv here.  */
  7507.     }
  7508. EOF
  7509. if { (eval echo configure:7511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  7510. then
  7511.   ac_cv_func_setvbuf_reversed=yes
  7512. else
  7513.   echo "configure: failed program was:" >&5
  7514.   cat conftest.$ac_ext >&5
  7515.   rm -fr conftest*
  7516.   ac_cv_func_setvbuf_reversed=no
  7517. fi
  7518. rm -fr conftest*
  7519. fi
  7520.  
  7521.     rm -f core core.* *.core
  7522. fi
  7523.  
  7524. echo "$ac_t""$ac_cv_func_setvbuf_reversed" 1>&6
  7525.     if test $ac_cv_func_setvbuf_reversed = yes; then
  7526.       cat >> confdefs.h <<\EOF
  7527. #define SETVBUF_REVERSED 1
  7528. EOF
  7529.  
  7530.     fi
  7531. fi
  7532.  
  7533. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  7534. # for constant arguments.  Useless!
  7535. echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
  7536. echo "configure:7538: checking for working alloca.h" >&5
  7537. if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
  7538.   echo $ac_n "(cached) $ac_c" 1>&6
  7539. else
  7540.   cat > conftest.$ac_ext <<EOF
  7541. #line 7543 "configure"
  7542. #include "confdefs.h"
  7543. #include <alloca.h>
  7544. int main() {
  7545. char *p = alloca(2 * sizeof(int));
  7546. ; return 0; }
  7547. EOF
  7548. if { (eval echo configure:7550: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  7549.   rm -rf conftest*
  7550.   ac_cv_header_alloca_h=yes
  7551. else
  7552.   echo "configure: failed program was:" >&5
  7553.   cat conftest.$ac_ext >&5
  7554.   rm -rf conftest*
  7555.   ac_cv_header_alloca_h=no
  7556. fi
  7557. rm -rf conftest*
  7558. fi
  7559.  
  7560. echo "$ac_t""$ac_cv_header_alloca_h" 1>&6
  7561. if test $ac_cv_header_alloca_h = yes; then
  7562.   cat >> confdefs.h <<\EOF
  7563. #define HAVE_ALLOCA_H 1
  7564. EOF
  7565.  
  7566. fi
  7567.  
  7568. echo $ac_n "checking for alloca""... $ac_c" 1>&6
  7569. echo "configure:7571: checking for alloca" >&5
  7570. if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
  7571.   echo $ac_n "(cached) $ac_c" 1>&6
  7572. else
  7573.   cat > conftest.$ac_ext <<EOF
  7574. #line 7576 "configure"
  7575. #include "confdefs.h"
  7576.  
  7577. #ifdef __GNUC__
  7578. # define alloca __builtin_alloca
  7579. #else
  7580. # ifdef _MSC_VER
  7581. #  include <malloc.h>
  7582. #  define alloca _alloca
  7583. # else
  7584. #  if HAVE_ALLOCA_H
  7585. #   include <alloca.h>
  7586. #  else
  7587. #   ifdef _AIX
  7588.  #pragma alloca
  7589. #   else
  7590. #    ifndef alloca /* predefined by HP cc +Olibcalls */
  7591. char *alloca ();
  7592. #    endif
  7593. #   endif
  7594. #  endif
  7595. # endif
  7596. #endif
  7597.  
  7598. int main() {
  7599. char *p = (char *) alloca(1);
  7600. ; return 0; }
  7601. EOF
  7602. if { (eval echo configure:7604: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  7603.   rm -rf conftest*
  7604.   ac_cv_func_alloca_works=yes
  7605. else
  7606.   echo "configure: failed program was:" >&5
  7607.   cat conftest.$ac_ext >&5
  7608.   rm -rf conftest*
  7609.   ac_cv_func_alloca_works=no
  7610. fi
  7611. rm -rf conftest*
  7612. fi
  7613.  
  7614. echo "$ac_t""$ac_cv_func_alloca_works" 1>&6
  7615. if test $ac_cv_func_alloca_works = yes; then
  7616.   cat >> confdefs.h <<\EOF
  7617. #define HAVE_ALLOCA 1
  7618. EOF
  7619.  
  7620. fi
  7621.  
  7622. if test $ac_cv_func_alloca_works = no; then
  7623.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  7624.   # that cause trouble.  Some versions do not even contain alloca or
  7625.   # contain a buggy version.  If you still want to use their alloca,
  7626.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  7627.   ALLOCA=alloca.${ac_objext}
  7628.   cat >> confdefs.h <<\EOF
  7629. #define C_ALLOCA 1
  7630. EOF
  7631.  
  7632.  
  7633. echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
  7634. echo "configure:7636: checking whether alloca needs Cray hooks" >&5
  7635. if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
  7636.   echo $ac_n "(cached) $ac_c" 1>&6
  7637. else
  7638.   cat > conftest.$ac_ext <<EOF
  7639. #line 7641 "configure"
  7640. #include "confdefs.h"
  7641. #if defined(CRAY) && ! defined(CRAY2)
  7642. webecray
  7643. #else
  7644. wenotbecray
  7645. #endif
  7646.  
  7647. EOF
  7648. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7649.   egrep "webecray" >/dev/null 2>&1; then
  7650.   rm -rf conftest*
  7651.   ac_cv_os_cray=yes
  7652. else
  7653.   rm -rf conftest*
  7654.   ac_cv_os_cray=no
  7655. fi
  7656. rm -rf conftest*
  7657.  
  7658. fi
  7659.  
  7660. echo "$ac_t""$ac_cv_os_cray" 1>&6
  7661. if test $ac_cv_os_cray = yes; then
  7662. for ac_func in _getb67 GETB67 getb67; do
  7663.   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  7664. echo "configure:7666: checking for $ac_func" >&5
  7665. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7666.   echo $ac_n "(cached) $ac_c" 1>&6
  7667. else
  7668.   cat > conftest.$ac_ext <<EOF
  7669. #line 7671 "configure"
  7670. #include "confdefs.h"
  7671. /* System header to define __stub macros and hopefully few prototypes,
  7672.     which can conflict with char $ac_func(); below.  */
  7673. #include <assert.h>
  7674. /* Override any gcc2 internal prototype to avoid an error.  */
  7675. /* We use char because int might match the return type of a gcc2
  7676.     builtin and then its argument prototype would still apply.  */
  7677. char $ac_func();
  7678.  
  7679. int main() {
  7680.  
  7681. /* The GNU C library defines this for functions which it implements
  7682.     to always fail with ENOSYS.  Some functions are actually named
  7683.     something starting with __ and the normal name is an alias.  */
  7684. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7685. choke me
  7686. #else
  7687. $ac_func();
  7688. #endif
  7689.  
  7690. ; return 0; }
  7691. EOF
  7692. if { (eval echo configure:7694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  7693.   rm -rf conftest*
  7694.   eval "ac_cv_func_$ac_func=yes"
  7695. else
  7696.   echo "configure: failed program was:" >&5
  7697.   cat conftest.$ac_ext >&5
  7698.   rm -rf conftest*
  7699.   eval "ac_cv_func_$ac_func=no"
  7700. fi
  7701. rm -rf conftest*
  7702. fi
  7703.  
  7704. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7705.   echo "$ac_t""yes" 1>&6
  7706.   cat >> confdefs.h <<EOF
  7707. #define CRAY_STACKSEG_END $ac_func
  7708. EOF
  7709.  
  7710.   break
  7711. else
  7712.   echo "$ac_t""no" 1>&6
  7713. fi
  7714.  
  7715. done
  7716. fi
  7717.  
  7718. echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
  7719. echo "configure:7721: checking stack direction for C alloca" >&5
  7720. if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
  7721.   echo $ac_n "(cached) $ac_c" 1>&6
  7722. else
  7723.   if test "$cross_compiling" = yes; then
  7724.   ac_cv_c_stack_direction=0
  7725. else
  7726.   cat > conftest.$ac_ext <<EOF
  7727. #line 7729 "configure"
  7728. #include "confdefs.h"
  7729. find_stack_direction ()
  7730. {
  7731.   static char *addr = 0;
  7732.   auto char dummy;
  7733.   if (addr == 0)
  7734.     {
  7735.       addr = &dummy;
  7736.       return find_stack_direction ();
  7737.     }
  7738.   else
  7739.     return (&dummy > addr) ? 1 : -1;
  7740. }
  7741. main ()
  7742. {
  7743.   exit (find_stack_direction() < 0);
  7744. }
  7745. EOF
  7746. if { (eval echo configure:7748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
  7747. then
  7748.   ac_cv_c_stack_direction=1
  7749. else
  7750.   echo "configure: failed program was:" >&5
  7751.   cat conftest.$ac_ext >&5
  7752.   rm -fr conftest*
  7753.   ac_cv_c_stack_direction=-1
  7754. fi
  7755. rm -fr conftest*
  7756. fi
  7757.  
  7758. fi
  7759.  
  7760. echo "$ac_t""$ac_cv_c_stack_direction" 1>&6
  7761. cat >> confdefs.h <<EOF
  7762. #define STACK_DIRECTION $ac_cv_c_stack_direction
  7763. EOF
  7764.  
  7765. fi
  7766.     
  7767. if test "$wi_cv_lib_curses" = "yes" ; then
  7768.  
  7769.     if test "x$ac_cv_header_unistd_h" = x ; then
  7770.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_CURSES_FEATURES." 1>&2; exit 1; }
  7771.     fi
  7772.  
  7773.     # Then $LIBCURSES is a list of curses and support libraries.
  7774.     ac_save_LIBS="$LIBS";
  7775.     LIBS="$LIBS $LIBCURSES";
  7776.  
  7777.  
  7778.  
  7779.  
  7780.  
  7781.  
  7782.     if test "x$ac_cv_header_unistd_h" = x ; then
  7783.         { echo "configure: error: Script needs to check for <unistd.h> before calling wi_CURSES_FUNC_PARAM_TYPES." 1>&2; exit 1; }
  7784.     fi
  7785.  
  7786. echo $ac_n "checking string parameter to waddstr""... $ac_c" 1>&6
  7787. echo "configure:7789: checking string parameter to waddstr" >&5
  7788. if eval "test \"`echo '$''{'wi_cv_waddstr_str_t'+set}'`\" = set"; then
  7789.   echo $ac_n "(cached) $ac_c" 1>&6
  7790. else
  7791.   
  7792. used_cache_for_wi_curses_fpt="no"
  7793.  
  7794.  
  7795. wi_tmpdir=""
  7796. if [ "x$MKTEMP" != "x" ] ; then
  7797.     # Ignore error from mktemp, since some old versions of Linux
  7798.     # print an error about not supporting -d.
  7799.     #
  7800.     wi_tmpdir=`"$MKTEMP" -d /tmp/configure.XXXXXXXXXX 2>/dev/null`
  7801.     if [ $? -ne 0 ] ; then
  7802.         wi_tmpdir=""
  7803.     fi
  7804. fi
  7805. if [ "x$wi_tmpdir" = "x" ] ; then
  7806.     for wi_tmpdir in . $TMPDIR $TEMPDIR /tmp ABORT
  7807.     do
  7808.         if [ "$wi_tmpdir" = ABORT ] ; then
  7809.             echo "Cannot create temporary directory."
  7810.             exit 1
  7811.         fi
  7812.         wi_tmpdir="$wi_tmpdir/config_tmp.$$"
  7813.         if [ -d "$wi_tmpdir" ] || [ -f "$wi_tmpdir" ] ; then
  7814.             echo "Will not create temporary directory."
  7815.             exit 1
  7816.         fi
  7817.         mkdir "$wi_tmpdir"
  7818.         if [ $? -eq 0 ] && [ -d "$wi_tmpdir" ] ; then break ;  fi
  7819.     done
  7820. fi
  7821.  
  7822. # Use the temporary directory here...
  7823.  
  7824.  
  7825. cat << 'EOF' > "$wi_tmpdir/prpp.pl"
  7826. #!/usr/bin/perl -w
  7827. #
  7828. # prpp.pl
  7829. #
  7830. # Feed the output of your CPP to this to print a list of function prototypes.
  7831. #use strict;
  7832.  
  7833. my ($c) = "";
  7834. my ($unputc) = "";
  7835. my ($line) = "";
  7836. my ($lines) = "";
  7837. my ($cline) = "";
  7838. my ($skipping) = 0;
  7839. my ($numclines) = 0;
  7840.  
  7841. MAINLOOP: while (1) {
  7842.     if ($unputc ne "") {
  7843.         $c = $unputc;
  7844.         $unputc = "";
  7845.     } else {
  7846.         last unless (read(STDIN, $c, 1) == 1);
  7847.     }
  7848.     if ($c eq "{") {
  7849.         $skipping++;
  7850.     } elsif ($c eq "}") {
  7851.         --$skipping;
  7852.         $unputc = ";";
  7853.     } elsif ($skipping) {
  7854.         next MAINLOOP;
  7855.     } elsif ($c eq ";") {
  7856.         if ($line =~ m/^\s*(\S.*\S)\s*$/s) {
  7857.             $lines .= $1;
  7858.             $line = "";
  7859.         }
  7860.         if ($lines =~ m/^\s*(extern\s*)?(\S.*\S)\s*$/s) {
  7861.             $cline = $2;
  7862.             $cline =~ s/\s+/\ /g;
  7863.             if ($cline =~ /^typedef/) {
  7864.                 $cline = "";
  7865.             } elsif ($cline =~ /\(.*\)$/) {
  7866.                 # found a proto
  7867.                 print $cline, ";\n";
  7868.                 $numclines++;
  7869.             } else {
  7870.                 $cline = "";
  7871.             }
  7872.         }
  7873.         $lines = "";
  7874.         $line = "";
  7875.     } elsif ($c eq "\n") {
  7876.         if ($line =~ m/^\s*(\S.*\S)\s*$/s) {
  7877.             $lines .= $1 . " ";
  7878.             $line = "";
  7879.         }
  7880.     } elsif (($c eq "#") && ($line eq "")) {
  7881.         # Looks like a preprocessor line, kill it
  7882.         {
  7883.             last MAINLOOP if (read(STDIN, $c, 1) != 1);
  7884.             last if ($c eq "\n");
  7885.             redo;
  7886.         }
  7887.     } elsif ($c =~ /^\s$/) {
  7888.         $line .= " " if ($line ne "");
  7889.     } elsif (! $skipping) {
  7890.         $line .= $c;
  7891.     }
  7892. }
  7893. exit(($numclines == 0) ? 1 : 0);
  7894. EOF
  7895. chmod 755 "$wi_tmpdir/prpp.pl"
  7896.  
  7897.  
  7898. cat << 'EOF' > "$wi_tmpdir/curses.c"
  7899. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  7900. #    define _ALL_SOURCE 1
  7901. #endif
  7902. #include <confdefs.h>
  7903. #ifdef HAVE_UNISTD_H
  7904. #    include <unistd.h>
  7905. #endif
  7906. #include <sys/types.h>
  7907. #include <stdio.h>
  7908. #include <string.h>
  7909. #include <stdlib.h>
  7910.  
  7911. #ifdef HAVE_NCURSES_H
  7912. #    include <ncurses.h>
  7913. #else
  7914. #    include <curses.h>
  7915. #endif
  7916.  
  7917. main()
  7918. {
  7919.     exit(0);
  7920. }
  7921. EOF
  7922.  
  7923. cat << 'EOF' > "$wi_tmpdir/sed2.sh"
  7924. #!/bin/sh
  7925.  
  7926. if [ $# -eq 0 ] ; then exit 1 ; fi
  7927. x="$1"
  7928.  
  7929. sed -n 's/extern//;s/static//;
  7930.         /[\ \*]'"$x"'\ *(/{
  7931.             s/^.*'"$x"'\ *(/(/
  7932.             s/)\ *[;,].*$/)/
  7933.             /const char/{
  7934.                 c\
  7935. const char *
  7936.             }
  7937.             /char/{
  7938.                 c\
  7939. char *
  7940.             }
  7941.             /const/{
  7942.                 c\
  7943. const void
  7944.             }
  7945.             q
  7946. }'
  7947. EOF
  7948. chmod 755 "$wi_tmpdir/sed2.sh"
  7949.  
  7950. $CPP "-I${srcdir-.}" "$wi_tmpdir/curses.c" > "$wi_tmpdir/curses.i"
  7951. if [ -s "$wi_tmpdir/curses.i" ] ; then
  7952.     "$PERL" "$wi_tmpdir/prpp.pl" < "$wi_tmpdir/curses.i" > "$wi_tmpdir/protos.h"
  7953. fi
  7954. if [ -f "$wi_tmpdir/protos.h" ] ; then
  7955.     #
  7956.     # Check what type waddstr() expects for the string parameter
  7957.     #
  7958.     x="waddstr"
  7959.     wi_cv_waddstr_str_t=`/bin/sh "$wi_tmpdir/sed2.sh" "$x" < "$wi_tmpdir/protos.h"`
  7960. fi
  7961. if [ "x$wi_cv_waddstr_str_t" = "x" ] ; then
  7962.     wi_cv_waddstr_str_t="const char *"
  7963. fi
  7964.  
  7965. # Done using the temporary directory here.
  7966.  
  7967. rm -r "$wi_tmpdir"
  7968. unset wi_tmpdir
  7969.  
  7970.  
  7971. fi
  7972.  
  7973. echo "$ac_t""$wi_cv_waddstr_str_t" 1>&6
  7974. unset used_cache_for_wi_curses_fpt
  7975. cat >> confdefs.h <<EOF
  7976. #define waddstr_str_t $wi_cv_waddstr_str_t
  7977. EOF
  7978.  
  7979. if test "$wi_cv_waddstr_str_t" = "const char *" ; then
  7980.     cat >> confdefs.h <<\EOF
  7981. #define WADDSTR_TYPE_ARG1_CONST 1
  7982. EOF
  7983.  
  7984. fi
  7985.  
  7986.  
  7987.     # maxx or _maxx
  7988.     echo $ac_n "checking whether curses structure has maxx or _maxx field""... $ac_c" 1>&6
  7989. echo "configure:7992: checking whether curses structure has maxx or _maxx field" >&5
  7990.     cat > conftest.$ac_ext <<EOF
  7991. #line 7994 "configure"
  7992. #include "confdefs.h"
  7993.  
  7994.     /* includes */
  7995. #if defined(AIX) || defined(_AIX) || defined(__HOS_AIX__)
  7996. #    define _ALL_SOURCE 1
  7997. #endif
  7998. #ifdef HAVE_UNISTD_H
  7999. #    include <unistd.h>
  8000. #endif
  8001. #include <sys/types.h>
  8002. #include <stdio.h>
  8003. #include <string.h>
  8004. #include <stdlib.h>
  8005.  
  8006. #ifdef HAVE_NCURSES_H
  8007. #    include <ncurses.h>
  8008. #else
  8009. #    include <curses.h>
  8010. #endif
  8011.  
  8012. int main() {
  8013.  
  8014.         WINDOW *w;
  8015.     
  8016.         w = newwin(10, 10, 1, 1);
  8017.         w->maxx = 0;
  8018.  
  8019. ; return 0; }
  8020. EOF
  8021. if { (eval echo configure:8024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
  8022.   rm -rf conftest*
  8023.   
  8024. echo "$ac_t""maxx" 1>&6
  8025.  
  8026. else
  8027.   echo "configure: failed program was:" >&5
  8028.   cat conftest.$ac_ext >&5
  8029.   rm -rf conftest*
  8030.   
  8031. cat >> confdefs.h <<\EOF
  8032. #define HAVE__MAXX 1
  8033. EOF
  8034.  
  8035. echo "$ac_t""_maxx" 1>&6
  8036.  
  8037. fi
  8038. rm -rf conftest*
  8039.  
  8040.     if test "${SYS-hpux}" = hpux ; then
  8041.     for ac_func in __getcurx __getcury __getmaxx __getmaxy __getbegx __getbegy
  8042. do
  8043. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  8044. echo "configure:8047: checking for $ac_func" >&5
  8045. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  8046.   echo $ac_n "(cached) $ac_c" 1>&6
  8047. else
  8048.   cat > conftest.$ac_ext <<EOF
  8049. #line 8052 "configure"
  8050. #include "confdefs.h"
  8051. /* System header to define __stub macros and hopefully few prototypes,
  8052.     which can conflict with char $ac_func(); below.  */
  8053. #include <assert.h>
  8054. /* Override any gcc2 internal prototype to avoid an error.  */
  8055. /* We use char because int might match the return type of a gcc2
  8056.     builtin and then its argument prototype would still apply.  */
  8057. char $ac_func();
  8058.  
  8059. int main() {
  8060.  
  8061. /* The GNU C library defines this for functions which it implements
  8062.     to always fail with ENOSYS.  Some functions are actually named
  8063.     something starting with __ and the normal name is an alias.  */
  8064. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  8065. choke me
  8066. #else
  8067. $ac_func();
  8068. #endif
  8069.  
  8070. ; return 0; }
  8071. EOF
  8072. if { (eval echo configure:8075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8073.   rm -rf conftest*
  8074.   eval "ac_cv_func_$ac_func=yes"
  8075. else
  8076.   echo "configure: failed program was:" >&5
  8077.   cat conftest.$ac_ext >&5
  8078.   rm -rf conftest*
  8079.   eval "ac_cv_func_$ac_func=no"
  8080. fi
  8081. rm -rf conftest*
  8082. fi
  8083.  
  8084. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  8085.   echo "$ac_t""yes" 1>&6
  8086.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  8087.   cat >> confdefs.h <<EOF
  8088. #define $ac_tr_func 1
  8089. EOF
  8090.  
  8091. else
  8092.   echo "$ac_t""no" 1>&6
  8093. fi
  8094. done
  8095.  
  8096.     fi
  8097.  
  8098.     # getcurx
  8099.     echo $ac_n "checking for getcurx() functionality in curses library""... $ac_c" 1>&6
  8100. echo "configure:8103: checking for getcurx() functionality in curses library" >&5
  8101.     cat > conftest.$ac_ext <<EOF
  8102. #line 8105 "configure"
  8103. #include "confdefs.h"
  8104.  
  8105.     /* includes */
  8106. #ifdef HAVE_UNISTD_H
  8107. #    include <unistd.h>
  8108. #endif
  8109. #include <sys/types.h>
  8110. #include <stdio.h>
  8111. #include <string.h>
  8112. #include <stdlib.h>
  8113.  
  8114. #ifdef HAVE_NCURSES_H
  8115. #    include <ncurses.h>
  8116. #else
  8117. #    include <curses.h>
  8118. #endif
  8119.  
  8120.  
  8121. int main() {
  8122.  
  8123.     /* function-body */
  8124.     WINDOW *junk = 0;
  8125.     int mx = 0;
  8126.  
  8127.     mx = getcurx(junk);
  8128.     exit(0);
  8129.  
  8130. ; return 0; }
  8131. EOF
  8132. if { (eval echo configure:8135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8133.   rm -rf conftest*
  8134.   
  8135.     cat >> confdefs.h <<\EOF
  8136. #define HAVE_GETCURX 1
  8137. EOF
  8138.  
  8139.     echo "$ac_t""yes" 1>&6
  8140.  
  8141. else
  8142.   echo "configure: failed program was:" >&5
  8143.   cat conftest.$ac_ext >&5
  8144.   rm -rf conftest*
  8145.   
  8146.     echo "$ac_t""no" 1>&6
  8147.  
  8148. fi
  8149. rm -rf conftest*
  8150.  
  8151.     # getyx
  8152.     echo $ac_n "checking for getyx() functionality in curses library""... $ac_c" 1>&6
  8153. echo "configure:8156: checking for getyx() functionality in curses library" >&5
  8154.     cat > conftest.$ac_ext <<EOF
  8155. #line 8158 "configure"
  8156. #include "confdefs.h"
  8157.  
  8158.     /* includes */
  8159. #ifdef HAVE_UNISTD_H
  8160. #    include <unistd.h>
  8161. #endif
  8162. #include <sys/types.h>
  8163. #include <stdio.h>
  8164. #include <string.h>
  8165. #include <stdlib.h>
  8166.  
  8167. #ifdef HAVE_NCURSES_H
  8168. #    include <ncurses.h>
  8169. #else
  8170. #    include <curses.h>
  8171. #endif
  8172.  
  8173.  
  8174. int main() {
  8175.  
  8176.     /* function-body */
  8177.     WINDOW *junk = 0;
  8178.     int mx = 0, my = 0;
  8179.  
  8180.     getyx(junk, my, mx);
  8181.     exit(0);
  8182.  
  8183. ; return 0; }
  8184. EOF
  8185. if { (eval echo configure:8188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8186.   rm -rf conftest*
  8187.   
  8188.     cat >> confdefs.h <<\EOF
  8189. #define HAVE_GETYX 1
  8190. EOF
  8191.  
  8192.     echo "$ac_t""yes" 1>&6
  8193.  
  8194. else
  8195.   echo "configure: failed program was:" >&5
  8196.   cat conftest.$ac_ext >&5
  8197.   rm -rf conftest*
  8198.   
  8199.     echo "$ac_t""no" 1>&6
  8200.  
  8201. fi
  8202. rm -rf conftest*
  8203.  
  8204.     # getmaxx
  8205.     echo $ac_n "checking for getmaxx() functionality in curses library""... $ac_c" 1>&6
  8206. echo "configure:8209: checking for getmaxx() functionality in curses library" >&5
  8207.     cat > conftest.$ac_ext <<EOF
  8208. #line 8211 "configure"
  8209. #include "confdefs.h"
  8210.  
  8211.     /* includes */
  8212. #ifdef HAVE_UNISTD_H
  8213. #    include <unistd.h>
  8214. #endif
  8215. #include <sys/types.h>
  8216. #include <stdio.h>
  8217. #include <string.h>
  8218. #include <stdlib.h>
  8219.  
  8220. #ifdef HAVE_NCURSES_H
  8221. #    include <ncurses.h>
  8222. #else
  8223. #    include <curses.h>
  8224. #endif
  8225.  
  8226. int main() {
  8227.  
  8228.     /* function-body */
  8229.     WINDOW *junk = 0;
  8230.     int mx = 0;
  8231.  
  8232.     mx = getmaxx(junk);
  8233.     exit(0);
  8234.  
  8235. ; return 0; }
  8236. EOF
  8237. if { (eval echo configure:8240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8238.   rm -rf conftest*
  8239.   
  8240.     cat >> confdefs.h <<\EOF
  8241. #define HAVE_GETMAXX 1
  8242. EOF
  8243.  
  8244.     echo "$ac_t""yes" 1>&6
  8245.  
  8246. else
  8247.   echo "configure: failed program was:" >&5
  8248.   cat conftest.$ac_ext >&5
  8249.   rm -rf conftest*
  8250.   
  8251.     echo "$ac_t""no" 1>&6
  8252.  
  8253. fi
  8254. rm -rf conftest*
  8255.  
  8256.     # getmaxyx
  8257.     echo $ac_n "checking for getmaxyx() functionality in curses library""... $ac_c" 1>&6
  8258. echo "configure:8261: checking for getmaxyx() functionality in curses library" >&5
  8259.     cat > conftest.$ac_ext <<EOF
  8260. #line 8263 "configure"
  8261. #include "confdefs.h"
  8262.  
  8263.     /* includes */
  8264. #ifdef HAVE_UNISTD_H
  8265. #    include <unistd.h>
  8266. #endif
  8267. #include <sys/types.h>
  8268. #include <stdio.h>
  8269. #include <string.h>
  8270. #include <stdlib.h>
  8271.  
  8272. #ifdef HAVE_NCURSES_H
  8273. #    include <ncurses.h>
  8274. #else
  8275. #    include <curses.h>
  8276. #endif
  8277.  
  8278. int main() {
  8279.  
  8280.     /* function-body */
  8281.     WINDOW *junk = 0;
  8282.     int mx = 0, my = 0;
  8283.  
  8284.     getmaxyx(junk, my, mx);
  8285.     exit(my < 0 ? my : 0);
  8286.  
  8287. ; return 0; }
  8288. EOF
  8289. if { (eval echo configure:8292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8290.   rm -rf conftest*
  8291.   
  8292.     cat >> confdefs.h <<\EOF
  8293. #define HAVE_GETMAXYX 1
  8294. EOF
  8295.  
  8296.     echo "$ac_t""yes" 1>&6
  8297.  
  8298. else
  8299.   echo "configure: failed program was:" >&5
  8300.   cat conftest.$ac_ext >&5
  8301.   rm -rf conftest*
  8302.   
  8303.     echo "$ac_t""no" 1>&6
  8304.  
  8305. fi
  8306. rm -rf conftest*
  8307.  
  8308.     # getbegx
  8309.     echo $ac_n "checking for getbegx() functionality in curses library""... $ac_c" 1>&6
  8310. echo "configure:8313: checking for getbegx() functionality in curses library" >&5
  8311.     cat > conftest.$ac_ext <<EOF
  8312. #line 8315 "configure"
  8313. #include "confdefs.h"
  8314.  
  8315.     /* includes */
  8316. #ifdef HAVE_UNISTD_H
  8317. #    include <unistd.h>
  8318. #endif
  8319. #include <sys/types.h>
  8320. #include <stdio.h>
  8321. #include <string.h>
  8322. #include <stdlib.h>
  8323.  
  8324. #ifdef HAVE_NCURSES_H
  8325. #    include <ncurses.h>
  8326. #else
  8327. #    include <curses.h>
  8328. #endif
  8329.  
  8330.  
  8331. int main() {
  8332.  
  8333.     /* function-body */
  8334.     WINDOW *junk = 0;
  8335.     int mx = 0;
  8336.  
  8337.     mx = getbegx(junk);
  8338.     exit(0);
  8339.  
  8340. ; return 0; }
  8341. EOF
  8342. if { (eval echo configure:8345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8343.   rm -rf conftest*
  8344.   
  8345.     cat >> confdefs.h <<\EOF
  8346. #define HAVE_GETBEGX 1
  8347. EOF
  8348.  
  8349.     echo "$ac_t""yes" 1>&6
  8350.  
  8351. else
  8352.   echo "configure: failed program was:" >&5
  8353.   cat conftest.$ac_ext >&5
  8354.   rm -rf conftest*
  8355.   
  8356.     echo "$ac_t""no" 1>&6
  8357.  
  8358. fi
  8359. rm -rf conftest*
  8360.  
  8361.     # getbegyx
  8362.     echo $ac_n "checking for getbegyx() functionality in curses library""... $ac_c" 1>&6
  8363. echo "configure:8366: checking for getbegyx() functionality in curses library" >&5
  8364.     cat > conftest.$ac_ext <<EOF
  8365. #line 8368 "configure"
  8366. #include "confdefs.h"
  8367.  
  8368.     /* includes */
  8369. #ifdef HAVE_UNISTD_H
  8370. #    include <unistd.h>
  8371. #endif
  8372. #include <sys/types.h>
  8373. #include <stdio.h>
  8374. #include <string.h>
  8375. #include <stdlib.h>
  8376.  
  8377. #ifdef HAVE_NCURSES_H
  8378. #    include <ncurses.h>
  8379. #else
  8380. #    include <curses.h>
  8381. #endif
  8382.  
  8383. int main() {
  8384.  
  8385.     /* function-body */
  8386.     WINDOW *junk = 0;
  8387.     int mx = 0, my = 0;
  8388.  
  8389.     getbegyx(junk, my, mx);
  8390.     exit(my < 0 ? my : 0);
  8391.  
  8392. ; return 0; }
  8393. EOF
  8394. if { (eval echo configure:8397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8395.   rm -rf conftest*
  8396.   
  8397.     cat >> confdefs.h <<\EOF
  8398. #define HAVE_GETBEGYX 1
  8399. EOF
  8400.  
  8401.     echo "$ac_t""yes" 1>&6
  8402.  
  8403. else
  8404.   echo "configure: failed program was:" >&5
  8405.   cat conftest.$ac_ext >&5
  8406.   rm -rf conftest*
  8407.   
  8408.     echo "$ac_t""no" 1>&6
  8409.  
  8410. fi
  8411. rm -rf conftest*
  8412.  
  8413.     # touchwin
  8414.     echo $ac_n "checking for touchwin() functionality in curses library""... $ac_c" 1>&6
  8415. echo "configure:8418: checking for touchwin() functionality in curses library" >&5
  8416.     cat > conftest.$ac_ext <<EOF
  8417. #line 8420 "configure"
  8418. #include "confdefs.h"
  8419.  
  8420.     /* includes */
  8421. #ifdef HAVE_UNISTD_H
  8422. #    include <unistd.h>
  8423. #endif
  8424. #include <sys/types.h>
  8425. #include <stdio.h>
  8426. #include <string.h>
  8427. #include <stdlib.h>
  8428.  
  8429. #ifdef HAVE_NCURSES_H
  8430. #    include <ncurses.h>
  8431. #else
  8432. #    include <curses.h>
  8433. #endif
  8434.  
  8435. int main() {
  8436.  
  8437.     /* function-body */
  8438.     WINDOW *junk = 0;
  8439.     touchwin(junk);
  8440.     exit(0);
  8441.  
  8442. ; return 0; }
  8443. EOF
  8444. if { (eval echo configure:8447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8445.   rm -rf conftest*
  8446.   
  8447.     cat >> confdefs.h <<\EOF
  8448. #define HAVE_TOUCHWIN 1
  8449. EOF
  8450.  
  8451.     echo "$ac_t""yes" 1>&6
  8452.  
  8453. else
  8454.   echo "configure: failed program was:" >&5
  8455.   cat conftest.$ac_ext >&5
  8456.   rm -rf conftest*
  8457.   
  8458.     echo "$ac_t""no" 1>&6
  8459.  
  8460. fi
  8461. rm -rf conftest*
  8462.  
  8463.     # beep
  8464.     echo $ac_n "checking for beep() functionality in curses library""... $ac_c" 1>&6
  8465. echo "configure:8468: checking for beep() functionality in curses library" >&5
  8466.     cat > conftest.$ac_ext <<EOF
  8467. #line 8470 "configure"
  8468. #include "confdefs.h"
  8469.  
  8470.     /* includes */
  8471. #ifdef HAVE_UNISTD_H
  8472. #    include <unistd.h>
  8473. #endif
  8474. #include <sys/types.h>
  8475. #include <stdio.h>
  8476. #include <string.h>
  8477. #include <stdlib.h>
  8478.  
  8479. #ifdef HAVE_NCURSES_H
  8480. #    include <ncurses.h>
  8481. #else
  8482. #    include <curses.h>
  8483. #endif
  8484.  
  8485. int main() {
  8486.  
  8487.     /* function-body */
  8488.     beep();
  8489.     exit(getpid() & 1);
  8490.  
  8491. ; return 0; }
  8492. EOF
  8493. if { (eval echo configure:8496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8494.   rm -rf conftest*
  8495.   
  8496.     cat >> confdefs.h <<\EOF
  8497. #define HAVE_BEEP 1
  8498. EOF
  8499.  
  8500.     echo "$ac_t""yes" 1>&6
  8501.  
  8502. else
  8503.   echo "configure: failed program was:" >&5
  8504.   cat conftest.$ac_ext >&5
  8505.   rm -rf conftest*
  8506.   
  8507.     echo "$ac_t""no" 1>&6
  8508.  
  8509. fi
  8510. rm -rf conftest*
  8511.  
  8512.     for ac_func in keypad nodelay curs_set doupdate wnoutrefresh
  8513. do
  8514. echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
  8515. echo "configure:8518: checking for $ac_func" >&5
  8516. if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
  8517.   echo $ac_n "(cached) $ac_c" 1>&6
  8518. else
  8519.   cat > conftest.$ac_ext <<EOF
  8520. #line 8523 "configure"
  8521. #include "confdefs.h"
  8522. /* System header to define __stub macros and hopefully few prototypes,
  8523.     which can conflict with char $ac_func(); below.  */
  8524. #include <assert.h>
  8525. /* Override any gcc2 internal prototype to avoid an error.  */
  8526. /* We use char because int might match the return type of a gcc2
  8527.     builtin and then its argument prototype would still apply.  */
  8528. char $ac_func();
  8529.  
  8530. int main() {
  8531.  
  8532. /* The GNU C library defines this for functions which it implements
  8533.     to always fail with ENOSYS.  Some functions are actually named
  8534.     something starting with __ and the normal name is an alias.  */
  8535. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  8536. choke me
  8537. #else
  8538. $ac_func();
  8539. #endif
  8540.  
  8541. ; return 0; }
  8542. EOF
  8543. if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  8544.   rm -rf conftest*
  8545.   eval "ac_cv_func_$ac_func=yes"
  8546. else
  8547.   echo "configure: failed program was:" >&5
  8548.   cat conftest.$ac_ext >&5
  8549.   rm -rf conftest*
  8550.   eval "ac_cv_func_$ac_func=no"
  8551. fi
  8552. rm -rf conftest*
  8553. fi
  8554.  
  8555. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  8556.   echo "$ac_t""yes" 1>&6
  8557.     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
  8558.   cat >> confdefs.h <<EOF
  8559. #define $ac_tr_func 1
  8560. EOF
  8561.  
  8562. else
  8563.   echo "$ac_t""no" 1>&6
  8564. fi
  8565. done
  8566.  
  8567.  
  8568.     LIBS="$ac_save_LIBS";
  8569. fi
  8570.  
  8571. if test "x$LIBCURSES" = "x" ; then
  8572.     VIS_DPROGS="# ../bin/ncftpbookmarks${EXEEXT}"
  8573. else
  8574.     VIS_DPROGS="../bin/ncftpbookmarks${EXEEXT}"
  8575. fi
  8576.  
  8577.  
  8578.  
  8579. echo $ac_n "checking for long file names""... $ac_c" 1>&6
  8580. echo "configure:8583: checking for long file names" >&5
  8581. if eval "test \"`echo '$''{'ac_cv_sys_long_file_names'+set}'`\" = set"; then
  8582.   echo $ac_n "(cached) $ac_c" 1>&6
  8583. else
  8584.   ac_cv_sys_long_file_names=yes
  8585. # Test for long file names in all the places we know might matter:
  8586. #      .        the current directory, where building will happen
  8587. #      $prefix/lib    where we will be installing things
  8588. #      $exec_prefix/lib    likewise
  8589. # eval it to expand exec_prefix.
  8590. #      $TMPDIR        if set, where it might want to write temporary files
  8591. # if $TMPDIR is not set:
  8592. #      /tmp        where it might want to write temporary files
  8593. #      /var/tmp        likewise
  8594. #      /usr/tmp        likewise
  8595. if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then
  8596.   ac_tmpdirs="$TMPDIR"
  8597. else
  8598.   ac_tmpdirs='/tmp /var/tmp /usr/tmp'
  8599. fi
  8600. for ac_dir in  . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do
  8601.   test -d $ac_dir || continue
  8602.   test -w $ac_dir || continue # It is less confusing to not echo anything here.
  8603.   (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
  8604.   (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
  8605.   val=`cat $ac_dir/conftest9012345 2>/dev/null`
  8606.   if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then
  8607.     ac_cv_sys_long_file_names=no
  8608.     rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
  8609.     break
  8610.   fi
  8611.   rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null
  8612. done
  8613. fi
  8614.  
  8615. echo "$ac_t""$ac_cv_sys_long_file_names" 1>&6
  8616. if test $ac_cv_sys_long_file_names = yes; then
  8617.   cat >> confdefs.h <<\EOF
  8618. #define HAVE_LONG_FILE_NAMES 1
  8619. EOF
  8620.  
  8621. fi
  8622.  
  8623. echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
  8624. echo "configure:8627: checking whether ${MAKE-make} sets \${MAKE}" >&5
  8625. set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
  8626. if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
  8627.   echo $ac_n "(cached) $ac_c" 1>&6
  8628. else
  8629.   cat > conftestmake <<\EOF
  8630. all:
  8631.     @echo 'ac_maketemp="${MAKE}"'
  8632. EOF
  8633. # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  8634. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
  8635. if test -n "$ac_maketemp"; then
  8636.   eval ac_cv_prog_make_${ac_make}_set=yes
  8637. else
  8638.   eval ac_cv_prog_make_${ac_make}_set=no
  8639. fi
  8640. rm -f conftestmake
  8641. fi
  8642. if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
  8643.   echo "$ac_t""yes" 1>&6
  8644.   SET_MAKE=
  8645. else
  8646.   echo "$ac_t""no" 1>&6
  8647.   SET_MAKE="MAKE=${MAKE-make}"
  8648. fi
  8649.  
  8650.  
  8651. # Extract the first word of ""gtar"", so it can be a program name with args.
  8652. set dummy "gtar"; ac_word=$2
  8653. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  8654. echo "configure:8657: checking for $ac_word" >&5
  8655. if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
  8656.   echo $ac_n "(cached) $ac_c" 1>&6
  8657. else
  8658.   case "$TAR" in
  8659.   /*)
  8660.   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
  8661.   ;;
  8662.   ?:/*)             
  8663.   ac_cv_path_TAR="$TAR" # Let the user override the test with a dos path.
  8664.   ;;
  8665.   *)
  8666.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  8667.   ac_dummy="$PATH"
  8668.   for ac_dir in $ac_dummy; do 
  8669.     test -z "$ac_dir" && ac_dir=.
  8670.     if test -f $ac_dir/$ac_word; then
  8671.       ac_cv_path_TAR="$ac_dir/$ac_word"
  8672.       break
  8673.     fi
  8674.   done
  8675.   IFS="$ac_save_ifs"
  8676.   test -z "$ac_cv_path_TAR" && ac_cv_path_TAR=""""
  8677.   ;;
  8678. esac
  8679. fi
  8680. TAR="$ac_cv_path_TAR"
  8681. if test -n "$TAR"; then
  8682.   echo "$ac_t""$TAR" 1>&6
  8683. else
  8684.   echo "$ac_t""no" 1>&6
  8685. fi
  8686.  
  8687. if test "x$TAR" = "x" ; then
  8688.     unset TAR
  8689.     unset ac_cv_path_TAR
  8690.     # Extract the first word of ""tar"", so it can be a program name with args.
  8691. set dummy "tar"; ac_word=$2
  8692. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  8693. echo "configure:8696: checking for $ac_word" >&5
  8694. if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then
  8695.   echo $ac_n "(cached) $ac_c" 1>&6
  8696. else
  8697.   case "$TAR" in
  8698.   /*)
  8699.   ac_cv_path_TAR="$TAR" # Let the user override the test with a path.
  8700.   ;;
  8701.   ?:/*)             
  8702.   ac_cv_path_TAR="$TAR" # Let the user override the test with a dos path.
  8703.   ;;
  8704.   *)
  8705.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  8706.   ac_dummy="$PATH"
  8707.   for ac_dir in $ac_dummy; do 
  8708.     test -z "$ac_dir" && ac_dir=.
  8709.     if test -f $ac_dir/$ac_word; then
  8710.       ac_cv_path_TAR="$ac_dir/$ac_word"
  8711.       break
  8712.     fi
  8713.   done
  8714.   IFS="$ac_save_ifs"
  8715.   test -z "$ac_cv_path_TAR" && ac_cv_path_TAR=""""
  8716.   ;;
  8717. esac
  8718. fi
  8719. TAR="$ac_cv_path_TAR"
  8720. if test -n "$TAR"; then
  8721.   echo "$ac_t""$TAR" 1>&6
  8722. else
  8723.   echo "$ac_t""no" 1>&6
  8724. fi
  8725.  
  8726. fi
  8727.  
  8728.  
  8729.  
  8730. if test "x$TAR" != "x" ; then
  8731.     cat >> confdefs.h <<EOF
  8732. #define TAR "$TAR"
  8733. EOF
  8734.  
  8735. fi
  8736.  
  8737.  
  8738.  
  8739.  
  8740. echo $ac_n "checking how to create TAR files""... $ac_c" 1>&6
  8741. echo "configure:8744: checking how to create TAR files" >&5
  8742. x=""
  8743. if [ -x /usr/bin/what ] ; then
  8744.     x=`/usr/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'`
  8745. elif [ -x /bin/what ] ; then
  8746.     x=`/bin/what "$TAR" 2>&1 | sed -n 's/.*pax.*/pax/g;/pax/p'`
  8747. fi
  8748. if [ "x$x" != "xpax" ] ; then
  8749.     # The junk above is because Mac OS X Server's tar freaks out
  8750.     # and does not exit if you do "tar --help".
  8751.     #
  8752.     x=`"$TAR" --help 2>&1 | sed -n 's/.*owner=NAME.*/owner=NAME/g;/owner=NAME/p'`
  8753. fi
  8754. TARFLAGS="cvf"
  8755. case "$x" in
  8756.     *owner=NAME*)
  8757.         case "$OS" in
  8758.             cygwin*)
  8759.                 ;;
  8760.             macosx*)
  8761.                 TARFLAGS="-c --owner=root --group=wheel --verbose -f"
  8762.                 ;;
  8763.             *)
  8764.                 if grep '^root:' /etc/group >/dev/null 2>&1 ; then
  8765.                     TARFLAGS="-c --owner=root --group=root --verbose -f"
  8766.                 elif grep '^wheel:' /etc/group >/dev/null 2>&1 ; then
  8767.                     TARFLAGS="-c --owner=root --group=wheel --verbose -f"
  8768.                 fi
  8769.                 ;;
  8770.         esac
  8771.         ;;
  8772. esac
  8773.  
  8774. echo "$ac_t""$TAR $TARFLAGS" 1>&6
  8775.  
  8776.  
  8777. if test "x$cross_compiling" = "xyes" ; then
  8778.     # Help out if the cross ranlib isn't in your path,
  8779.     # for example, maybe you set CC=/path/to/cross-gcc
  8780.     # rather than put PATH=/path/to/crosstools:$PATH
  8781.     # and let cc be found in your PATH.
  8782.     #
  8783.     machine=`${CC-gcc} -dumpmachine 2>/dev/null`
  8784.     case "$CC" in
  8785.         *${machine}*)
  8786.             f=`echo "$CC" | sed 's|/[^/]*$||'`
  8787.             if [ -x "$f/${machine}-ranlib" ] ; then
  8788.                 RANLIB="$f/${machine}-ranlib"
  8789.             elif [ -x "$f/ranlib" ] ; then
  8790.                 RANLIB="$f/ranlib"
  8791.             fi
  8792.             ;;
  8793.     esac
  8794.     unset machine f
  8795. fi
  8796. # Extract the first word of "ranlib", so it can be a program name with args.
  8797. set dummy ranlib; ac_word=$2
  8798. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  8799. echo "configure:8802: checking for $ac_word" >&5
  8800. if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  8801.   echo $ac_n "(cached) $ac_c" 1>&6
  8802. else
  8803.   if test -n "$RANLIB"; then
  8804.   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
  8805. else
  8806.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  8807.   ac_dummy="$PATH"
  8808.   for ac_dir in $ac_dummy; do
  8809.     test -z "$ac_dir" && ac_dir=.
  8810.     if test -f $ac_dir/$ac_word; then
  8811.       ac_cv_prog_RANLIB="ranlib"
  8812.       break
  8813.     fi
  8814.   done
  8815.   IFS="$ac_save_ifs"
  8816.   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
  8817. fi
  8818. fi
  8819. RANLIB="$ac_cv_prog_RANLIB"
  8820. if test -n "$RANLIB"; then
  8821.   echo "$ac_t""$RANLIB" 1>&6
  8822. else
  8823.   echo "$ac_t""no" 1>&6
  8824. fi
  8825.  
  8826.  
  8827.  
  8828. echo $ac_n "checking for ar""... $ac_c" 1>&6
  8829. echo "configure:8832: checking for ar" >&5
  8830. AR="ar"
  8831. if [ "x$cross_compiling" = "xyes" ] ; then
  8832.     machine=`${CC-gcc} -dumpmachine 2>/dev/null`
  8833.     case "$CC" in
  8834.         *${machine}*)
  8835.             f=`echo "$CC" | sed 's|/[^/]*$||'`
  8836.             if [ -x "$f/${machine}-ar" ] ; then
  8837.                 AR="$f/${machine}-ar"
  8838.             elif [ -x "$f/ar" ] ; then
  8839.                 AR="$f/ar"
  8840.             fi
  8841.             ;;
  8842.     esac
  8843.     unset machine f
  8844. fi
  8845. echo "$ac_t""$AR" 1>&6
  8846.  
  8847.  
  8848. # Find a good install program.  We prefer a C program (faster),
  8849. # so one script is as good as another.  But avoid the broken or
  8850. # incompatible versions:
  8851. # SysV /etc/install, /usr/sbin/install
  8852. # SunOS /usr/etc/install
  8853. # IRIX /sbin/install
  8854. # AIX /bin/install
  8855. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
  8856. # AFS /usr/afsws/bin/install, which mishandles nonexistent args
  8857. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  8858. # ./install, which can be erroneously created by make from ./install.sh.
  8859. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
  8860. echo "configure:8863: checking for a BSD compatible install" >&5
  8861. if test -z "$INSTALL"; then
  8862. if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  8863.   echo $ac_n "(cached) $ac_c" 1>&6
  8864. else
  8865.     IFS="${IFS=     }"; ac_save_IFS="$IFS"; IFS=":"
  8866.   for ac_dir in $PATH; do
  8867.     # Account for people who put trailing slashes in PATH elements.
  8868.     case "$ac_dir/" in
  8869.     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
  8870.     *)
  8871.       # OSF1 and SCO ODT 3.0 have their own names for install.
  8872.       # Don't use installbsd from OSF since it installs stuff as root
  8873.       # by default.
  8874.       for ac_prog in ginstall scoinst install; do
  8875.         if test -f $ac_dir/$ac_prog; then
  8876.       if test $ac_prog = install &&
  8877.             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  8878.         # AIX install.  It has an incompatible calling convention.
  8879.         :
  8880.       else
  8881.         ac_cv_path_install="$ac_dir/$ac_prog -c"
  8882.         break 2
  8883.       fi
  8884.     fi
  8885.       done
  8886.       ;;
  8887.     esac
  8888.   done
  8889.   IFS="$ac_save_IFS"
  8890.  
  8891. fi
  8892.   if test "${ac_cv_path_install+set}" = set; then
  8893.     INSTALL="$ac_cv_path_install"
  8894.   else
  8895.     # As a last resort, use the slow shell script.  We don't cache a
  8896.     # path for INSTALL within a source directory, because that will
  8897.     # break other packages using the cache if that directory is
  8898.     # removed, or if the path is relative.
  8899.     INSTALL="$ac_install_sh"
  8900.   fi
  8901. fi
  8902. echo "$ac_t""$INSTALL" 1>&6
  8903.  
  8904. # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  8905. # It thinks the first close brace ends the variable substitution.
  8906. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
  8907.  
  8908. test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
  8909.  
  8910. test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
  8911.  
  8912.  
  8913. # Extract the first word of ""pwd"", so it can be a program name with args.
  8914. set dummy "pwd"; ac_word=$2
  8915. echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
  8916. echo "configure:8919: checking for $ac_word" >&5
  8917. if eval "test \"`echo '$''{'ac_cv_path_wi_PWD'+set}'`\" = set"; then
  8918.   echo $ac_n "(cached) $ac_c" 1>&6
  8919. else
  8920.   case "$wi_PWD" in
  8921.   /*)
  8922.   ac_cv_path_wi_PWD="$wi_PWD" # Let the user override the test with a path.
  8923.   ;;
  8924.   ?:/*)             
  8925.   ac_cv_path_wi_PWD="$wi_PWD" # Let the user override the test with a dos path.
  8926.   ;;
  8927.   *)
  8928.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS=":"
  8929.   ac_dummy="$PATH"
  8930.   for ac_dir in $ac_dummy; do 
  8931.     test -z "$ac_dir" && ac_dir=.
  8932.     if test -f $ac_dir/$ac_word; then
  8933.       ac_cv_path_wi_PWD="$ac_dir/$ac_word"
  8934.       break
  8935.     fi
  8936.   done
  8937.   IFS="$ac_save_ifs"
  8938.   test -z "$ac_cv_path_wi_PWD" && ac_cv_path_wi_PWD=""pwd""
  8939.   ;;
  8940. esac
  8941. fi
  8942. wi_PWD="$ac_cv_path_wi_PWD"
  8943. if test -n "$wi_PWD"; then
  8944.   echo "$ac_t""$wi_PWD" 1>&6
  8945. else
  8946.   echo "$ac_t""no" 1>&6
  8947. fi
  8948.  
  8949.  
  8950.  
  8951. if test "x$use_ccdv" = "xno" ; then
  8952.     echo $ac_n "checking for ccdv""... $ac_c" 1>&6
  8953. echo "configure:8956: checking for ccdv" >&5
  8954.     echo "$ac_t""(disabled)" 1>&6
  8955. else
  8956. unset wi_cv_path_ccdv    # can't use cache if it was a temp prog last time
  8957. wi_used_cache_path_ccdv="yes"
  8958. echo $ac_n "checking for ccdv""... $ac_c" 1>&6
  8959. echo "configure:8962: checking for ccdv" >&5
  8960. if eval "test \"`echo '$''{'wi_cv_path_ccdv'+set}'`\" = set"; then
  8961.   echo $ac_n "(cached) $ac_c" 1>&6
  8962. else
  8963.   
  8964. wi_used_cache_path_ccdv="no"
  8965. for CCDV in /usr/bin/ccdv /usr/local/bin/ccdv /usr/ccs/bin/ccdv NONE
  8966. do
  8967.     if test "$CCDV" = NONE ; then CCDV="" ; break ; fi
  8968.     $CCDV >/dev/null 2>&1
  8969.     if test $? -eq 96 ; then
  8970.         break
  8971.     fi
  8972. done
  8973. if test "x$CCDV" = "x" ; then
  8974.         cat > ccdv.c << 'EOF'
  8975. /* ccdv.c
  8976.  *
  8977.  * Copyright (C) 2002-2003, by Mike Gleason, NcFTP Software.
  8978.  * All Rights Reserved.
  8979.  *
  8980.  * Licensed under the GNU Public License.
  8981.  */
  8982. #include <unistd.h>
  8983. #include <sys/types.h>
  8984. #include <sys/time.h>
  8985. #include <sys/wait.h>
  8986. #include <fcntl.h>
  8987. #include <stdio.h>
  8988. #include <string.h>
  8989. #include <stdlib.h>
  8990. #include <errno.h>
  8991.  
  8992. #define SETCOLOR_SUCCESS    (gANSIEscapes ? "\033\1331;32m" : "")
  8993. #define SETCOLOR_FAILURE    (gANSIEscapes ? "\033\1331;31m" : "")
  8994. #define SETCOLOR_WARNING    (gANSIEscapes ? "\033\1331;33m" : "")
  8995. #define SETCOLOR_NORMAL        (gANSIEscapes ? "\033\1330;39m" : "")
  8996.  
  8997. #define TEXT_BLOCK_SIZE 8192
  8998. #define INDENT 2
  8999.  
  9000. #define TERMS "vt100:vt102:vt220:vt320:xterm:xterm-color:ansi:linux:scoterm:scoansi:dtterm:cons25:cygwin:screen"
  9001.  
  9002. size_t gNBufUsed = 0, gNBufAllocated = 0;
  9003. char *gBuf = NULL;
  9004. int gCCPID;
  9005. char gAction[64] = "";
  9006. char gTarget[64] = "";
  9007. char gAr[32] = "";
  9008. char gArLibraryTarget[64] = "";
  9009. int gDumpCmdArgs = 0;
  9010. char gArgsStr[800];
  9011. int gColumns = 80;
  9012. int gANSIEscapes = 0;
  9013. int gExitStatus = 95;
  9014.  
  9015. static void
  9016. DumpFormattedOutput(void)
  9017. {
  9018.     char *cp;
  9019.     char spaces[8 + 1] = "        ";
  9020.     char *saved;
  9021.     int curcol;
  9022.     int i;
  9023.  
  9024.     curcol = 0;
  9025.     saved = NULL;
  9026.     for (cp = gBuf + ((gDumpCmdArgs == 0) ? strlen(gArgsStr) : 0); ; cp++) {
  9027.         if (*cp == '\0') {
  9028.             if (saved != NULL) {
  9029.                 cp = saved;
  9030.                 saved = NULL;
  9031.             } else break;
  9032.         }
  9033.         if (*cp == '\r')
  9034.             continue;
  9035.         if (*cp == '\t') {
  9036.             saved = cp + 1;
  9037.             cp = spaces + 8 - (8 - ((curcol - INDENT - 1) % 8));
  9038.         }
  9039.         if (curcol == 0) {
  9040.             for (i = INDENT; --i >= 0; )
  9041.                 putchar(' ');
  9042.             curcol = INDENT;
  9043.         }
  9044.         putchar(*cp);
  9045.         if (++curcol == (gColumns - 1)) {
  9046.             putchar('\n');
  9047.             curcol = 0;
  9048.         } else if (*cp == '\n')
  9049.             curcol = 0;
  9050.     }
  9051.     free(gBuf);
  9052. }    /* DumpFormattedOutput */
  9053.  
  9054.  
  9055.  
  9056. /* Difftime(), only for timeval structures.  */
  9057. static void TimeValSubtract(struct timeval *tdiff, struct timeval *t1, struct timeval *t0)
  9058. {
  9059.     tdiff->tv_sec = t1->tv_sec - t0->tv_sec;
  9060.     tdiff->tv_usec = t1->tv_usec - t0->tv_usec;
  9061.     if (tdiff->tv_usec < 0) {
  9062.         tdiff->tv_sec--;
  9063.         tdiff->tv_usec += 1000000;
  9064.     }
  9065. }    /* TimeValSubtract */
  9066.  
  9067.  
  9068.  
  9069. static void
  9070. Wait(void)
  9071. {
  9072.     int pid2, status;
  9073.  
  9074.     do {
  9075.         status = 0;
  9076.         pid2 = (int) waitpid(gCCPID, &status, 0);
  9077.     } while (((pid2 >= 0) && (! WIFEXITED(status))) || ((pid2 < 0) && (errno == EINTR)));
  9078.     if (WIFEXITED(status))
  9079.         gExitStatus = WEXITSTATUS(status);
  9080. }    /* Wait */
  9081.  
  9082.  
  9083.  
  9084. static int
  9085. SlurpProgress(int fd)
  9086. {
  9087.     char s1[71];
  9088.     char *newbuf;
  9089.     int nready;
  9090.     size_t ntoread;
  9091.     ssize_t nread;
  9092.     struct timeval now, tnext, tleft;
  9093.     fd_set ss;
  9094.     fd_set ss2;
  9095.     const char *trail = "/-\\|", *trailcp;
  9096.  
  9097.     trailcp = trail;
  9098.     snprintf(s1, sizeof(s1), "%s%s%s... ", gAction, gTarget[0] ? " " : "", gTarget);
  9099.     printf("\r%-70s%-9s", s1, "");
  9100.     fflush(stdout);
  9101.  
  9102.     gettimeofday(&now, NULL);
  9103.     tnext = now;
  9104.     tnext.tv_sec++;
  9105.     tleft.tv_sec = 1;
  9106.     tleft.tv_usec = 0;
  9107.     FD_ZERO(&ss2);
  9108.     FD_SET(fd, &ss2);
  9109.     for(;;) {
  9110.         if (gNBufUsed == (gNBufAllocated - 1)) {
  9111.             if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) {
  9112.                 perror("ccdv: realloc");
  9113.                 return (-1);
  9114.             }
  9115.             gNBufAllocated += TEXT_BLOCK_SIZE;
  9116.             gBuf = newbuf;
  9117.         }
  9118.         for (;;) {
  9119.             ss = ss2;
  9120.             nready = select(fd + 1, &ss, NULL, NULL, &tleft);
  9121.             if (nready == 1)
  9122.                 break;
  9123.             if (nready < 0) {
  9124.                 if (errno != EINTR) {
  9125.                     perror("ccdv: select");
  9126.                     return (-1);
  9127.                 }
  9128.                 continue;
  9129.             }
  9130.             gettimeofday(&now, NULL);
  9131.             if ((now.tv_sec > tnext.tv_sec) || ((now.tv_sec == tnext.tv_sec) && (now.tv_usec >= tnext.tv_usec))) {
  9132.                 tnext = now;
  9133.                 tnext.tv_sec++;
  9134.                 tleft.tv_sec = 1;
  9135.                 tleft.tv_usec = 0;
  9136.                 printf("\r%-71s%c%-7s", s1, *trailcp, "");
  9137.                 fflush(stdout);
  9138.                 if (*++trailcp == '\0')
  9139.                     trailcp = trail;
  9140.             } else {
  9141.                 TimeValSubtract(&tleft, &tnext, &now);
  9142.             }
  9143.         }
  9144.         ntoread = (gNBufAllocated - gNBufUsed - 1);
  9145.         nread = read(fd, gBuf + gNBufUsed, ntoread);
  9146.         if (nread < 0) {
  9147.             if (errno == EINTR)
  9148.                 continue;
  9149.             perror("ccdv: read");
  9150.             return (-1);
  9151.         } else if (nread == 0) {
  9152.             break;
  9153.         }
  9154.         gNBufUsed += nread;
  9155.         gBuf[gNBufUsed] = '\0';
  9156.     }
  9157.     snprintf(s1, sizeof(s1), "%s%s%s: ", gAction, gTarget[0] ? " " : "", gTarget);
  9158.     Wait();
  9159.     if (gExitStatus == 0) {
  9160.         printf("\r%-70s", s1);
  9161.         printf("[%s%s%s]", ((gNBufUsed - strlen(gArgsStr)) < 4) ? SETCOLOR_SUCCESS : SETCOLOR_WARNING, "OK", SETCOLOR_NORMAL);
  9162.         printf("%-5s\n", " ");
  9163.     } else {
  9164.         printf("\r%-70s", s1);
  9165.         printf("[%s%s%s]", SETCOLOR_FAILURE, "ERROR", SETCOLOR_NORMAL);
  9166.         printf("%-2s\n", " ");
  9167.         gDumpCmdArgs = 1;    /* print cmd when there are errors */
  9168.     }
  9169.     fflush(stdout);
  9170.     return (0);
  9171. }    /* SlurpProgress */
  9172.  
  9173.  
  9174.  
  9175. static int
  9176. SlurpAll(int fd)
  9177. {
  9178.     char *newbuf;
  9179.     size_t ntoread;
  9180.     ssize_t nread;
  9181.  
  9182.     printf("%s%s%s.\n", gAction, gTarget[0] ? " " : "", gTarget);
  9183.     fflush(stdout);
  9184.  
  9185.     for(;;) {
  9186.         if (gNBufUsed == (gNBufAllocated - 1)) {
  9187.             if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) {
  9188.                 perror("ccdv: realloc");
  9189.                 return (-1);
  9190.             }
  9191.             gNBufAllocated += TEXT_BLOCK_SIZE;
  9192.             gBuf = newbuf;
  9193.         }
  9194.         ntoread = (gNBufAllocated - gNBufUsed - 1);
  9195.         nread = read(fd, gBuf + gNBufUsed, ntoread);
  9196.         if (nread < 0) {
  9197.             if (errno == EINTR)
  9198.                 continue;
  9199.             perror("ccdv: read");
  9200.             return (-1);
  9201.         } else if (nread == 0) {
  9202.             break;
  9203.         }
  9204.         gNBufUsed += nread;
  9205.         gBuf[gNBufUsed] = '\0';
  9206.     }
  9207.     Wait();
  9208.     gDumpCmdArgs = (gExitStatus != 0);    /* print cmd when there are errors */
  9209.     return (0);
  9210. }    /* SlurpAll */
  9211.  
  9212.  
  9213.  
  9214. static const char *
  9215. Basename(const char *path)
  9216. {
  9217.     const char *cp;
  9218.     cp = strrchr(path, '/');
  9219.     if (cp == NULL)
  9220.         return (path);
  9221.     return (cp + 1);
  9222. }    /* Basename */
  9223.  
  9224.  
  9225.  
  9226. static const char *
  9227. Extension(const char *path)
  9228. {
  9229.     const char *cp = path;
  9230.     cp = strrchr(path, '.');
  9231.     if (cp == NULL)
  9232.         return ("");
  9233.     return (cp);
  9234. }    /* Extension */
  9235.  
  9236.  
  9237.  
  9238. static void
  9239. Usage(void)
  9240. {
  9241.     fprintf(stderr, "Usage: ccdv /path/to/cc CFLAGS...\n\n");
  9242.     fprintf(stderr, "I wrote this to reduce the deluge Make output to make finding actual problems\n");
  9243.     fprintf(stderr, "easier.  It is intended to be invoked from Makefiles, like this.  Instead of:\n\n");
  9244.     fprintf(stderr, "\t.c.o:\n");
  9245.     fprintf(stderr, "\t\t$(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n");
  9246.     fprintf(stderr, "\nRewrite your rule so it looks like:\n\n");
  9247.     fprintf(stderr, "\t.c.o:\n");
  9248.     fprintf(stderr, "\t\t@ccdv $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n\n");
  9249.     fprintf(stderr, "ccdv 1.1.0 is Free under the GNU Public License.  Enjoy!\n");
  9250.     fprintf(stderr, "  -- Mike Gleason, NcFTP Software <http://www.ncftp.com>\n");
  9251.     exit(96);
  9252. }    /* Usage */
  9253.  
  9254.  
  9255.  
  9256. int
  9257. main(int argc, char **argv)
  9258. {
  9259.     int pipe1[2];
  9260.     int devnull;
  9261.     char emerg[256];
  9262.     int fd;
  9263.     int nread;
  9264.     int i;
  9265.     int cc = 0, pch = 0;
  9266.     const char *quote;
  9267.  
  9268.     if (argc < 2)
  9269.         Usage();
  9270.  
  9271.     snprintf(gAction, sizeof(gAction), "Running %s", Basename(argv[1]));
  9272.     memset(gArgsStr, 0, sizeof(gArgsStr));
  9273.     for (i = 1; i < argc; i++) {
  9274.         quote = (strchr(argv[i], ' ') != NULL) ? "\"" : "";
  9275.         snprintf(gArgsStr + strlen(gArgsStr), sizeof(gArgsStr) - strlen(gArgsStr), "%s%s%s%s%s", (i == 1) ? "" : " ", quote, argv[i], quote, (i == (argc - 1)) ? "\n" : "");
  9276.         if ((strcmp(argv[i], "-o") == 0) && ((i + 1) < argc)) {
  9277.             if (strcasecmp(Extension(argv[i + 1]), ".o") != 0) {
  9278.                 strcpy(gAction, "Linking");
  9279.                 snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i + 1]));
  9280.             }
  9281.         } else if (strchr("-+/", (int) argv[i][0]) != NULL) {
  9282.             continue;
  9283.         } else if (strncasecmp(Extension(argv[i]), ".c", 2) == 0) {
  9284.             cc++;
  9285.             snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i]));
  9286.         } else if ((strncasecmp(Extension(argv[i]), ".h", 2) == 0) && (cc == 0)) {
  9287.             pch++;
  9288.             snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i]));
  9289.         } else if ((i == 1) && (strcmp(Basename(argv[i]), "ar") == 0)) {
  9290.             snprintf(gAr, sizeof(gAr), "%s", Basename(argv[i]));
  9291.         } else if ((gArLibraryTarget[0] == '\0') && (strcasecmp(Extension(argv[i]), ".a") == 0)) {
  9292.             snprintf(gArLibraryTarget, sizeof(gArLibraryTarget), "%s", Basename(argv[i]));
  9293.         }
  9294.     }
  9295.     if ((gAr[0] != '\0') && (gArLibraryTarget[0] != '\0')) {
  9296.         strcpy(gAction, "Creating library");
  9297.         snprintf(gTarget, sizeof(gTarget), "%s", gArLibraryTarget);
  9298.     } else if (pch > 0) {
  9299.         strcpy(gAction, "Precompiling");
  9300.     } else if (cc > 0) {
  9301.         strcpy(gAction, "Compiling");
  9302.     }
  9303.  
  9304.     if (pipe(pipe1) < 0) {
  9305.         perror("ccdv: pipe");
  9306.         exit(97);
  9307.     }
  9308.  
  9309.     (void) close(0);
  9310.     devnull = open("/dev/null", O_RDWR, 00666);
  9311.     if ((devnull != 0) && (dup2(devnull, 0) == 0))
  9312.         close(devnull);
  9313.  
  9314.     gCCPID = (int) fork();
  9315.     if (gCCPID < 0) {
  9316.         (void) close(pipe1[0]);
  9317.         (void) close(pipe1[1]);
  9318.         perror("ccdv: fork");
  9319.         exit(98);
  9320.     } else if (gCCPID == 0) {
  9321.         /* Child */
  9322.         (void) close(pipe1[0]);        /* close read end */
  9323.         if (pipe1[1] != 1) {        /* use write end on stdout */
  9324.             (void) dup2(pipe1[1], 1);
  9325.             (void) close(pipe1[1]);
  9326.         }
  9327.         (void) dup2(1, 2);        /* use write end on stderr */
  9328.         execvp(argv[1], argv + 1);
  9329.         perror(argv[1]);
  9330.         exit(99);
  9331.     }
  9332.  
  9333.     /* parent */
  9334.     (void) close(pipe1[1]);        /* close write end */
  9335.     fd = pipe1[0];            /* use read end */
  9336.  
  9337.     gColumns = (getenv("COLUMNS") != NULL) ? atoi(getenv("COLUMNS")) : 80;
  9338.     gANSIEscapes = (getenv("TERM") != NULL) && (strstr(TERMS, getenv("TERM")) != NULL);
  9339.     gBuf = (char *) malloc(TEXT_BLOCK_SIZE);
  9340.     if (gBuf == NULL) 
  9341.         goto panic;
  9342.     gNBufUsed = 0;
  9343.     gNBufAllocated = TEXT_BLOCK_SIZE;
  9344.     if (strlen(gArgsStr) < (gNBufAllocated - 1)) {
  9345.         strcpy(gBuf, gArgsStr);
  9346.         gNBufUsed = strlen(gArgsStr);
  9347.     }
  9348.  
  9349.     if (isatty(1)) {
  9350.         if (SlurpProgress(fd) < 0)
  9351.             goto panic;
  9352.     } else {
  9353.         if (SlurpAll(fd) < 0)
  9354.             goto panic;
  9355.     }
  9356.     DumpFormattedOutput();
  9357.     exit(gExitStatus);
  9358.  
  9359. panic:
  9360.     gDumpCmdArgs = 1;    /* print cmd when there are errors */
  9361.     DumpFormattedOutput();
  9362.     while ((nread = read(fd, emerg, (size_t) sizeof(emerg))) > 0)
  9363.         (void) write(2, emerg, (size_t) nread);
  9364.     Wait();
  9365.     exit(gExitStatus);
  9366. }    /* main */
  9367. /* eof ccdv.c */
  9368. EOF
  9369.         ${CC-cc} $DEFS $CPPFLAGS $CFLAGS "ccdv.c" -o "ccdv" >/dev/null 2>&1
  9370.     rm -f ccdv.c ccdv.o ccdv.c.gz.uu ccdv.c.gz
  9371.     strip ./ccdv >/dev/null 2>&1
  9372.     ./ccdv >/dev/null 2>&1
  9373.     if test $? -eq 96 ; then
  9374.         CCDV="./ccdv"
  9375.     else
  9376.         rm -f ccdv
  9377.     fi
  9378. fi
  9379. if test "x$CCDV" != x ; then
  9380.     
  9381.  
  9382. wi_path="$CCDV"
  9383. if test -d "$wi_path" ; then
  9384.     wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null`
  9385. elif test ! -f "$wi_path" ; then
  9386.     wi_resolved_path="$wi_path"
  9387. else
  9388.     wi_parent_dir="$wi_path"
  9389.     wi_file_name="$wi_path"
  9390.     
  9391. wi_parent_dir=`echo "$wi_parent_dir" | sed -n '
  9392. s-//*-/-g
  9393. s-/*$--
  9394. /^\/\/*[^/]*$/{
  9395.     c\\
  9396. /
  9397.     p
  9398.     q
  9399. }
  9400. /^[^/]*$/{
  9401.     c\\
  9402. .
  9403.     p
  9404.     q
  9405. }
  9406. /./{
  9407.     s-/[^/]*$--
  9408.     p
  9409.     q
  9410. }'`
  9411.     
  9412. wi_file_name=`echo "$wi_file_name" | sed -n '
  9413. s-//*-/-g
  9414. s-/*$--
  9415. s-^/$--
  9416. s-^.*/--
  9417. p
  9418. q'`
  9419.     wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null`
  9420.     if test "x$wi_resolved_path" != x ; then
  9421.         wi_resolved_path="$wi_resolved_path/$wi_file_name"
  9422.     fi
  9423.     unset wi_parent_dir wi_file_name
  9424. fi
  9425. if test "x$wi_resolved_path" = x ; then
  9426.     CCDV="$$CCDV"
  9427. else
  9428.     CCDV="$wi_resolved_path"
  9429. fi
  9430. unset wi_resolved_path wi_path
  9431.  
  9432.     wi_cv_path_ccdv="$CCDV"
  9433.     CCDV="@$CCDV "    # trailing space needed
  9434. else
  9435.     wi_cv_path_ccdv=""
  9436. fi
  9437.  
  9438. fi
  9439.  
  9440. echo "$ac_t""$wi_cv_path_ccdv" 1>&6
  9441. if test "$wi_used_cache_path_ccdv" = yes ; then
  9442.     CCDV="$wi_cv_path_ccdv"
  9443.     if test "x$CCDV" != x ; then
  9444.         CCDV="@$CCDV "    # trailing space needed
  9445.     fi
  9446. fi
  9447.  
  9448. fi
  9449.  
  9450.  
  9451. if test "x$mandir" = 'x${prefix}/man' ; then
  9452.     # Mandir is at default value -- try to see
  9453.     # if $prefix/share/man would be better.
  9454.     #
  9455.  
  9456.     # $prefix is probably set to NONE.
  9457.     #
  9458.     p=`cd / ; cd $prefix 2>/dev/null ; pwd`
  9459.     if test "x$p" = "x/" ; then
  9460.         p="/usr/local"
  9461.     fi
  9462.     if test -d "$p/share/man" ; then
  9463.         mandir="$p/share/man"
  9464.     fi
  9465. fi
  9466.  
  9467.  
  9468. echo $ac_n "checking if shell can test for symlinks""... $ac_c" 1>&6
  9469. echo "configure:9472: checking if shell can test for symlinks" >&5
  9470. if eval "test \"`echo '$''{'wi_cv_shell_test_symlinks'+set}'`\" = set"; then
  9471.   echo $ac_n "(cached) $ac_c" 1>&6
  9472. else
  9473.   
  9474. wi_cv_shell_test_symlinks="no"
  9475. wi_cv_test_L="false"
  9476. wi_cv_test_not_L=":"
  9477. rm -f config.lnk
  9478. if test ! -f "config.lnk" ; then
  9479.     ln -s /bin/sh${ac_exeext} config.lnk
  9480.     if test -f "config.lnk" ; then
  9481.         ( if test -L config.lnk ; then rm -f config.lnk ; fi ) 2>/dev/null
  9482.         if test ! -f "config.lnk" ; then
  9483.             wi_cv_shell_test_symlinks="yes"
  9484.             wi_cv_test_L='test -L'
  9485.             wi_cv_test_not_L='test ! -L'
  9486.         else
  9487.             ( if test -h config.lnk ; then rm -f config.lnk ; fi ) 2>/dev/null
  9488.             if test ! -f "config.lnk" ; then
  9489.                 wi_cv_shell_test_symlinks="yes"
  9490.                 wi_cv_test_L='test -h'
  9491.                 wi_cv_test_not_L='test ! -h'
  9492.             fi
  9493.         fi
  9494.     fi
  9495.     rm -f config.lnk
  9496. fi
  9497.  
  9498. fi
  9499.  
  9500. echo "$ac_t""$wi_cv_shell_test_symlinks" 1>&6
  9501. test_L="$wi_cv_test_L"
  9502. test_not_L="$wi_cv_test_not_L"
  9503.  
  9504.  
  9505.  
  9506. h_file="libncftp/ncftp.h"
  9507. if test -f "$h_file" && $test_not_L "$h_file" ; then
  9508.     h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'`
  9509.     longest_int_subst="${LONGEST_INT-long}"
  9510.     if sed 's!\ */\*\ set\ by\ configure\ at\ .*\*/!!' "$h_file" > "$h_tmp" ; then
  9511.         touch -r "$h_file" "$h_tmp"
  9512.         if cmp -s "$h_file" "$h_tmp" ; then
  9513.             :
  9514.         else
  9515.             /bin/mv "$h_tmp" "$h_file"
  9516.             chmod a+r "$h_file"
  9517.         fi
  9518.     fi
  9519.     if sed 's/^#define longest_int.*/#define longest_int '"$longest_int_subst"'/;s/^#define longest_uint.*/#define longest_uint unsigned '"$longest_int_subst"'/;' "$h_file" > "$h_tmp" ; then
  9520.         if cmp -s "$h_file" "$h_tmp" ; then
  9521.             datestr=`date '+%Y-%m-%d %H:%M:%S'`
  9522.             sed '/^#define longest_u?int/{s!$!    /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file"
  9523.             unset datestr
  9524.             /bin/rm -f "$h_tmp"
  9525.             chmod a+r "$h_file"
  9526.         fi
  9527.     fi
  9528.     /bin/rm -f "$h_tmp"
  9529.     unset h_tmp longest_int_subst
  9530. fi
  9531. unset h_file
  9532.  
  9533.  
  9534.  
  9535. h_file="libncftp/ncftp.h"
  9536. if test -f "$h_file" && $test_not_L "$h_file" ; then
  9537.     h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'`
  9538.     if sed 's!\ */\*\ set\ by\ configure\ at\ .*\*/!!' "$h_file" > "$h_tmp" ; then
  9539.         touch -r "$h_file" "$h_tmp"
  9540.         if cmp -s "$h_file" "$h_tmp" ; then
  9541.             :
  9542.         else
  9543.             /bin/mv "$h_tmp" "$h_file"
  9544.             chmod a+r "$h_file"
  9545.         fi
  9546.     fi
  9547.     if test "x$wi_cv_struct_stat64" = xyes ; then
  9548.         if sed 's/^#define Stat .*/#define Stat stat64/;s/^#define Lstat .*/#define Lstat lstat64/;s/^#define Fstat .*/#define Fstat fstat64/;' "$h_file" > "$h_tmp" ; then
  9549.             if cmp -s "$h_file" "$h_tmp" ; then
  9550.                 :
  9551.             else
  9552.                 datestr=`date '+%Y-%m-%d %H:%M:%S'`
  9553.                 sed '/^#define [SLFs]*tat /{s!$!    /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file"
  9554.                 unset datestr
  9555.                 /bin/rm -f "$h_tmp"
  9556.                 chmod a+r "$h_file"
  9557.             fi
  9558.         fi
  9559.     else
  9560.         if sed 's/^#define Stat .*/#define Stat stat/;s/^#define Lstat .*/#define Lstat lstat/;s/^#define Fstat .*/#define Fstat fstat/;' "$h_file" > "$h_tmp" ; then
  9561.             if cmp -s "$h_file" "$h_tmp" ; then
  9562.                 :
  9563.             else
  9564.                 datestr=`date '+%Y-%m-%d %H:%M:%S'`
  9565.                 sed '/^#define [SLFs]*tat /{s!$!    /* set by configure at '"${datestr}"' */!;}' "$h_tmp" > "$h_file"
  9566.                 unset datestr
  9567.                 /bin/rm -f "$h_tmp"
  9568.                 chmod a+r "$h_file"
  9569.             fi
  9570.         fi
  9571.     fi
  9572.     /bin/rm -f "$h_tmp"
  9573.     unset h_tmp longest_int_subst
  9574. fi
  9575. unset h_file
  9576.  
  9577.  
  9578.  
  9579. h_file="libncftp/ncftp.h"
  9580. if test -f "$h_file" && $test_not_L "$h_file" ; then
  9581.     h_tmp=`echo "$h_file" | sed 's/\.h/.tmp/;'`
  9582.  
  9583.     remove_cpp_warning=yes
  9584.     if [ "$SYS" = linux ] ; then
  9585.         #
  9586.         # We need to retain #warning on Linux
  9587.         #
  9588.         remove_cpp_warning=no
  9589.     fi
  9590.     if [ "$GCC" = yes ] ; then
  9591.         #
  9592.         # GCC accepts #warning
  9593.         #
  9594.         remove_cpp_warning=no
  9595.     fi
  9596.  
  9597.     if [ "$remove_cpp_warning" = yes ] ; then
  9598.         #
  9599.         # Remove "#warning", since compiler will complain about it
  9600.         # not being recognized.
  9601.         #
  9602.         sed 's/^\([\ \    ]*#[\ \    ]*warning.*\)/\/* \1 *\//;' "$h_file" > "$h_tmp"
  9603.         cmp -s "$h_file" "$h_tmp"
  9604.         if test $? -ne 0 ; then 
  9605.             mv "$h_tmp" "$h_file"
  9606.             chmod a+r "$h_file"
  9607.         fi
  9608.         rm -f "$h_tmp"
  9609.         unset h_tmp longest_int_subst
  9610.     fi
  9611. fi
  9612. unset h_file remove_cpp_warning
  9613.  
  9614. LIBSET='$(LIB)'
  9615. Z30='#'
  9616. case "$HOME" in
  9617.     *lcompile*)
  9618.         ;;
  9619.     *)
  9620.         if test -x /usr/local/bin/incrementor ; then
  9621.             Z30='    -@/usr/local/bin/incrementor -b -f version.c -f version.o'
  9622.         fi
  9623.         ;;
  9624. esac
  9625.  
  9626.  
  9627. wi_path="$srcdir"
  9628. if test -d "$wi_path" ; then
  9629.     wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null`
  9630. elif test ! -f "$wi_path" ; then
  9631.     wi_resolved_path="$wi_path"
  9632. else
  9633.     wi_parent_dir="$wi_path"
  9634.     wi_file_name="$wi_path"
  9635.     
  9636. wi_parent_dir=`echo "$wi_parent_dir" | sed -n '
  9637. s-//*-/-g
  9638. s-/*$--
  9639. /^\/\/*[^/]*$/{
  9640.     c\\
  9641. /
  9642.     p
  9643.     q
  9644. }
  9645. /^[^/]*$/{
  9646.     c\\
  9647. .
  9648.     p
  9649.     q
  9650. }
  9651. /./{
  9652.     s-/[^/]*$--
  9653.     p
  9654.     q
  9655. }'`
  9656.     
  9657. wi_file_name=`echo "$wi_file_name" | sed -n '
  9658. s-//*-/-g
  9659. s-/*$--
  9660. s-^/$--
  9661. s-^.*/--
  9662. p
  9663. q'`
  9664.     wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null`
  9665.     if test "x$wi_resolved_path" != x ; then
  9666.         wi_resolved_path="$wi_resolved_path/$wi_file_name"
  9667.     fi
  9668.     unset wi_parent_dir wi_file_name
  9669. fi
  9670. if test "x$wi_resolved_path" = x ; then
  9671.     MAINDIR="$$srcdir"
  9672. else
  9673.     MAINDIR="$wi_resolved_path"
  9674. fi
  9675. unset wi_resolved_path wi_path
  9676.  
  9677.  
  9678.  
  9679. wi_path="$MAINDIR/libncftp/ncftp.h"
  9680. if test -d "$wi_path" ; then
  9681.     wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null`
  9682. elif test ! -f "$wi_path" ; then
  9683.     wi_resolved_path="$wi_path"
  9684. else
  9685.     wi_parent_dir="$wi_path"
  9686.     wi_file_name="$wi_path"
  9687.     
  9688. wi_parent_dir=`echo "$wi_parent_dir" | sed -n '
  9689. s-//*-/-g
  9690. s-/*$--
  9691. /^\/\/*[^/]*$/{
  9692.     c\\
  9693. /
  9694.     p
  9695.     q
  9696. }
  9697. /^[^/]*$/{
  9698.     c\\
  9699. .
  9700.     p
  9701.     q
  9702. }
  9703. /./{
  9704.     s-/[^/]*$--
  9705.     p
  9706.     q
  9707. }'`
  9708.     
  9709. wi_file_name=`echo "$wi_file_name" | sed -n '
  9710. s-//*-/-g
  9711. s-/*$--
  9712. s-^/$--
  9713. s-^.*/--
  9714. p
  9715. q'`
  9716.     wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null`
  9717.     if test "x$wi_resolved_path" != x ; then
  9718.         wi_resolved_path="$wi_resolved_path/$wi_file_name"
  9719.     fi
  9720.     unset wi_parent_dir wi_file_name
  9721. fi
  9722. if test "x$wi_resolved_path" = x ; then
  9723.     libncftp_h="$$MAINDIR/libncftp/ncftp.h"
  9724. else
  9725.     libncftp_h="$wi_resolved_path"
  9726. fi
  9727. unset wi_resolved_path wi_path
  9728.  
  9729.  
  9730. libncftp_h=`echo "$libncftp_h" | sed -n '
  9731. s-//*-/-g
  9732. s-/*$--
  9733. /^\/\/*[^/]*$/{
  9734.     c\\
  9735. /
  9736.     p
  9737.     q
  9738. }
  9739. /^[^/]*$/{
  9740.     c\\
  9741. .
  9742.     p
  9743.     q
  9744. }
  9745. /./{
  9746.     s-/[^/]*$--
  9747.     p
  9748.     q
  9749. }'`
  9750.  
  9751.  
  9752. wi_path="$MAINDIR/sio/sio.h"
  9753. if test -d "$wi_path" ; then
  9754.     wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null`
  9755. elif test ! -f "$wi_path" ; then
  9756.     wi_resolved_path="$wi_path"
  9757. else
  9758.     wi_parent_dir="$wi_path"
  9759.     wi_file_name="$wi_path"
  9760.     
  9761. wi_parent_dir=`echo "$wi_parent_dir" | sed -n '
  9762. s-//*-/-g
  9763. s-/*$--
  9764. /^\/\/*[^/]*$/{
  9765.     c\\
  9766. /
  9767.     p
  9768.     q
  9769. }
  9770. /^[^/]*$/{
  9771.     c\\
  9772. .
  9773.     p
  9774.     q
  9775. }
  9776. /./{
  9777.     s-/[^/]*$--
  9778.     p
  9779.     q
  9780. }'`
  9781.     
  9782. wi_file_name=`echo "$wi_file_name" | sed -n '
  9783. s-//*-/-g
  9784. s-/*$--
  9785. s-^/$--
  9786. s-^.*/--
  9787. p
  9788. q'`
  9789.     wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null`
  9790.     if test "x$wi_resolved_path" != x ; then
  9791.         wi_resolved_path="$wi_resolved_path/$wi_file_name"
  9792.     fi
  9793.     unset wi_parent_dir wi_file_name
  9794. fi
  9795. if test "x$wi_resolved_path" = x ; then
  9796.     sio_h="$$MAINDIR/sio/sio.h"
  9797. else
  9798.     sio_h="$wi_resolved_path"
  9799. fi
  9800. unset wi_resolved_path wi_path
  9801.  
  9802.  
  9803. sio_h=`echo "$sio_h" | sed -n '
  9804. s-//*-/-g
  9805. s-/*$--
  9806. /^\/\/*[^/]*$/{
  9807.     c\\
  9808. /
  9809.     p
  9810.     q
  9811. }
  9812. /^[^/]*$/{
  9813.     c\\
  9814. .
  9815.     p
  9816.     q
  9817. }
  9818. /./{
  9819.     s-/[^/]*$--
  9820.     p
  9821.     q
  9822. }'`
  9823.  
  9824.  
  9825. wi_path="$MAINDIR/Strn/Strn.h"
  9826. if test -d "$wi_path" ; then
  9827.     wi_resolved_path=`cd "$wi_path" ; $wi_PWD 2>/dev/null`
  9828. elif test ! -f "$wi_path" ; then
  9829.     wi_resolved_path="$wi_path"
  9830. else
  9831.     wi_parent_dir="$wi_path"
  9832.     wi_file_name="$wi_path"
  9833.     
  9834. wi_parent_dir=`echo "$wi_parent_dir" | sed -n '
  9835. s-//*-/-g
  9836. s-/*$--
  9837. /^\/\/*[^/]*$/{
  9838.     c\\
  9839. /
  9840.     p
  9841.     q
  9842. }
  9843. /^[^/]*$/{
  9844.     c\\
  9845. .
  9846.     p
  9847.     q
  9848. }
  9849. /./{
  9850.     s-/[^/]*$--
  9851.     p
  9852.     q
  9853. }'`
  9854.     
  9855. wi_file_name=`echo "$wi_file_name" | sed -n '
  9856. s-//*-/-g
  9857. s-/*$--
  9858. s-^/$--
  9859. s-^.*/--
  9860. p
  9861. q'`
  9862.     wi_resolved_path=`cd "$wi_parent_dir" ; $wi_PWD 2>/dev/null`
  9863.     if test "x$wi_resolved_path" != x ; then
  9864.         wi_resolved_path="$wi_resolved_path/$wi_file_name"
  9865.     fi
  9866.     unset wi_parent_dir wi_file_name
  9867. fi
  9868. if test "x$wi_resolved_path" = x ; then
  9869.     strn_h="$$MAINDIR/Strn/Strn.h"
  9870. else
  9871.     strn_h="$wi_resolved_path"
  9872. fi
  9873. unset wi_resolved_path wi_path
  9874.  
  9875.  
  9876. strn_h=`echo "$strn_h" | sed -n '
  9877. s-//*-/-g
  9878. s-/*$--
  9879. /^\/\/*[^/]*$/{
  9880.     c\\
  9881. /
  9882.     p
  9883.     q
  9884. }
  9885. /^[^/]*$/{
  9886.     c\\
  9887. .
  9888.     p
  9889.     q
  9890. }
  9891. /./{
  9892.     s-/[^/]*$--
  9893.     p
  9894.     q
  9895. }'`
  9896. CPPFLAGS="-I${MAINDIR} -I${libncftp_h} -I${sio_h} -I${strn_h} $CPPFLAGS"
  9897. LDFLAGS="-L${libncftp_h} -L${sio_h} -L${strn_h} $LDFLAGS"
  9898.  
  9899. LIBS=`echo "$LIBS" | sed 's/^ *//;s/ *$//;s/  */ /g'`
  9900. LDFLAGS=`echo "$LDFLAGS" | sed 's/^ *//;s/ *$//;s/  */ /g'`
  9901. CPPFLAGS=`echo "$CPPFLAGS" | sed 's/^ *//;s/ *$//;s/  */ /g'`
  9902. CFLAGS=`echo "$CFLAGS $wi_CFLAGS_TO_ADD_LATER" | sed 's/^ *//;s/ *$//;s/  */ /g'`
  9903. DEFS=`echo "$DEFS" | sed 's/^ *//;s/ *$//;s/  */ /g'`
  9904.  
  9905.  
  9906.  
  9907.  
  9908. LIBNCFTP_PRECOMP="libncftp/pch.mk.none"
  9909. SIO_PRECOMP="sio/pch.mk.none"
  9910. if test "${wi_cv_cc_precomp}_${wi_cv_cc_precomp_type}" = "yes_gcc_gch_files" ; then
  9911.     LIBNCFTP_PRECOMP="libncftp/pch.mk.gcc-gch"
  9912.     SIO_PRECOMP="sio/pch.mk.gcc-gch"
  9913. elif test "${wi_cv_cc_precomp}_${SYS}" = "yes_macosx" ; then
  9914.     LIBNCFTP_PRECOMP="libncftp/pch.mk.$SYS"
  9915.     SIO_PRECOMP="sio/pch.mk.$SYS"
  9916. fi
  9917.  
  9918.  
  9919.  
  9920.  
  9921.  
  9922. LIBNCFTP_VERSION=`sed -n '/kLibraryVersion/{
  9923.     s/^[^0-9]*//
  9924.     s/\ .*$//
  9925.     p
  9926.     q
  9927. }' libncftp/ncftp.h`
  9928.  
  9929. NCFTP_VERSION=`sed -n '/gVersion\[\]/{
  9930.     s/^[^0-9]*//
  9931.     s/\/.*$//
  9932.     p
  9933.     q
  9934. }' ncftp/version.c`
  9935.  
  9936. SIO_VERSION=`sed -n '/kSioVersion/{
  9937.     s/^[^0-9]*//
  9938.     s/\ .*$//
  9939.     p
  9940.     q
  9941. }' sio/sio.h`
  9942.  
  9943. STRN_VERSION=`sed -n '/gStrnLibVersion\[\]/{
  9944.     s/^[^0-9]*//
  9945.     s/\".*$//
  9946.     p
  9947.     q
  9948. }' Strn/Strncpy.c`
  9949.  
  9950. Z00="unknown_id"
  9951. Z31=''
  9952. if [ -x /sbin/md5 ] ; then
  9953.     Z00=`hostname | tr '[A-Z]' '[a-z]' | /sbin/md5`
  9954. elif [ -x /usr/bin/md5sum ] ; then
  9955.     Z00=`hostname -f | tr '[A-Z]' '[a-z]' | /usr/bin/md5sum | cut -d ' ' -f1`
  9956. fi
  9957.  
  9958. case "$Z00" in
  9959.     'e85dfd19937dece65225d717f4cd5f22'|'816c501837158512dc4f606d58f4993b'|'9aa70fa2084f59bab13fe52bdfff65f4')
  9960.         Z31='    scp -p "$(STGZFILE)" build@Src:src/ncftp/current/ ; mv ncftp-*-src.* /ztmp/'
  9961.         ;;
  9962.     
  9963. esac
  9964.  
  9965.  
  9966. echo $ac_n "checking CFLAGS""... $ac_c" 1>&6
  9967. echo "configure:9970: checking CFLAGS" >&5
  9968. echo "$ac_t""$CFLAGS" 1>&6
  9969. echo $ac_n "checking CPPFLAGS""... $ac_c" 1>&6
  9970. echo "configure:9973: checking CPPFLAGS" >&5
  9971. echo "$ac_t""$CPPFLAGS" 1>&6
  9972. echo $ac_n "checking DEFS""... $ac_c" 1>&6
  9973. echo "configure:9976: checking DEFS" >&5
  9974. echo "$ac_t""$DEFS" 1>&6
  9975. echo $ac_n "checking LDFLAGS""... $ac_c" 1>&6
  9976. echo "configure:9979: checking LDFLAGS" >&5
  9977. echo "$ac_t""$LDFLAGS" 1>&6
  9978. echo $ac_n "checking LIBS""... $ac_c" 1>&6
  9979. echo "configure:9982: checking LIBS" >&5
  9980. echo "$ac_t""$LIBS" 1>&6
  9981. #
  9982. # Also take the opportunity to do some post-configure clean-up
  9983. #
  9984. /bin/rm -rf "conftest.dSYM" "a.out"
  9985.  
  9986.  
  9987.  
  9988.  
  9989.  
  9990.  
  9991.  
  9992.  
  9993.  
  9994.  
  9995.  
  9996.  
  9997.  
  9998.  
  9999.  
  10000.  
  10001.  
  10002.  
  10003.  
  10004. trap '' 1 2 15
  10005. cat > confcache <<\EOF
  10006. # This file is a shell script that caches the results of configure
  10007. # tests run on this system so they can be shared between configure
  10008. # scripts and configure runs.  It is not useful on other systems.
  10009. # If it contains results you don't want to keep, you may remove or edit it.
  10010. #
  10011. # By default, configure uses ./config.cache as the cache file,
  10012. # creating it if it does not exist already.  You can give configure
  10013. # the --cache-file=FILE option to use a different cache file; that is
  10014. # what configure does when it calls configure scripts in
  10015. # subdirectories, so they share the cache.
  10016. # Giving --cache-file=/dev/null disables caching, for debugging configure.
  10017. # config.status only pays attention to the cache file if you give it the
  10018. # --recheck option to rerun configure.
  10019. #
  10020. EOF
  10021. # The following way of writing the cache mishandles newlines in values,
  10022. # but we know of no workaround that is simple, portable, and efficient.
  10023. # So, don't put newlines in cache variables' values.
  10024. # Ultrix sh set writes to stderr and can't be redirected directly,
  10025. # and sets the high bit in the cache file unless we assign to the vars.
  10026. (set) 2>&1 |
  10027.   case `(ac_space=' '; set | grep ac_space) 2>&1` in
  10028.   *ac_space=\ *)
  10029.     # `set' does not quote correctly, so add quotes (double-quote substitution
  10030.     # turns \\\\ into \\, and sed turns \\ into \).
  10031.     sed -n \
  10032.       -e "s/'/'\\\\''/g" \
  10033.       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
  10034.     ;;
  10035.   *)
  10036.     # `set' quotes correctly as required by POSIX, so do not add quotes.
  10037.     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
  10038.     ;;
  10039.   esac >> confcache
  10040. if cmp -s $cache_file confcache; then
  10041.   :
  10042. else
  10043.   if test -w $cache_file; then
  10044.     echo "updating cache $cache_file"
  10045.     cat confcache > $cache_file
  10046.   else
  10047.     echo "not updating unwritable cache $cache_file"
  10048.   fi
  10049. fi
  10050. rm -f confcache
  10051.  
  10052. trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
  10053.  
  10054. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  10055. # Let make expand exec_prefix.
  10056. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  10057.  
  10058. # Any assignment to VPATH causes Sun make to only execute
  10059. # the first set of double-colon rules, so remove it if not needed.
  10060. # If there is a colon in the path, we need to keep it.
  10061. if test "x$srcdir" = x.; then
  10062.   ac_vpsub='/^[     ]*VPATH[     ]*=[^:]*$/d'
  10063. fi
  10064.  
  10065. trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
  10066.  
  10067. DEFS=-DHAVE_CONFIG_H
  10068.  
  10069. # Without the "./", some shells look in PATH for config.status.
  10070. : ${CONFIG_STATUS=./config.status}
  10071.  
  10072. echo creating $CONFIG_STATUS
  10073. rm -f $CONFIG_STATUS
  10074. cat > $CONFIG_STATUS <<EOF
  10075. #! /bin/sh
  10076. # Generated automatically by configure.
  10077. # Run this file to recreate the current configuration.
  10078. # This directory was configured as follows,
  10079. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  10080. #
  10081. # $0 $ac_configure_args
  10082. #
  10083. # Compiler output produced by configure, useful for debugging
  10084. # configure, is in ./config.log if it exists.
  10085.  
  10086. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
  10087. for ac_option
  10088. do
  10089.   case "\$ac_option" in
  10090.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  10091.     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
  10092.     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  10093.   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
  10094.     echo "$CONFIG_STATUS generated by autoconf version 2.13"
  10095.     exit 0 ;;
  10096.   -help | --help | --hel | --he | --h)
  10097.     echo "\$ac_cs_usage"; exit 0 ;;
  10098.   *) echo "\$ac_cs_usage"; exit 1 ;;
  10099.   esac
  10100. done
  10101.  
  10102. ac_given_srcdir=$srcdir
  10103. ac_given_INSTALL="$INSTALL"
  10104.  
  10105. trap 'rm -fr `echo "Makefile Makefile.bin ncftp/Makefile libncftp/Makefile Strn/Makefile sio/Makefile sh_util/Makefile vis/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  10106. EOF
  10107. cat >> $CONFIG_STATUS <<EOF
  10108.  
  10109. # Protect against being on the right side of a sed subst in config.status.
  10110. sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
  10111.  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
  10112. $ac_vpsub
  10113. $extrasub
  10114. s%@SHELL@%$SHELL%g
  10115. s%@CFLAGS@%$CFLAGS%g
  10116. s%@CPPFLAGS@%$CPPFLAGS%g
  10117. s%@CXXFLAGS@%$CXXFLAGS%g
  10118. s%@FFLAGS@%$FFLAGS%g
  10119. s%@DEFS@%$DEFS%g
  10120. s%@LDFLAGS@%$LDFLAGS%g
  10121. s%@LIBS@%$LIBS%g
  10122. s%@exec_prefix@%$exec_prefix%g
  10123. s%@prefix@%$prefix%g
  10124. s%@program_transform_name@%$program_transform_name%g
  10125. s%@bindir@%$bindir%g
  10126. s%@sbindir@%$sbindir%g
  10127. s%@libexecdir@%$libexecdir%g
  10128. s%@datadir@%$datadir%g
  10129. s%@sysconfdir@%$sysconfdir%g
  10130. s%@sharedstatedir@%$sharedstatedir%g
  10131. s%@localstatedir@%$localstatedir%g
  10132. s%@libdir@%$libdir%g
  10133. s%@includedir@%$includedir%g
  10134. s%@oldincludedir@%$oldincludedir%g
  10135. s%@infodir@%$infodir%g
  10136. s%@mandir@%$mandir%g
  10137. s%@NDEFS@%$NDEFS%g
  10138. s%@OS@%$OS%g
  10139. s%@host@%$host%g
  10140. s%@SYS@%$SYS%g
  10141. s%@HOME_OS@%$HOME_OS%g
  10142. s%@CC@%$CC%g
  10143. s%@CPP@%$CPP%g
  10144. s%@STRIP@%$STRIP%g
  10145. s%@OBJEXT@%$OBJEXT%g
  10146. s%@EXEEXT@%$EXEEXT%g
  10147. s%@SIO_OBJS_U@%$SIO_OBJS_U%g
  10148. s%@SIO_SOBJS_U@%$SIO_SOBJS_U%g
  10149. s%@SOCKS_LIBS@%$SOCKS_LIBS%g
  10150. s%@LIBCURSES@%$LIBCURSES%g
  10151. s%@PERL@%$PERL%g
  10152. s%@MKTEMP@%$MKTEMP%g
  10153. s%@ALLOCA@%$ALLOCA%g
  10154. s%@SET_MAKE@%$SET_MAKE%g
  10155. s%@TAR@%$TAR%g
  10156. s%@TARFLAGS@%$TARFLAGS%g
  10157. s%@RANLIB@%$RANLIB%g
  10158. s%@AR@%$AR%g
  10159. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  10160. s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
  10161. s%@INSTALL_DATA@%$INSTALL_DATA%g
  10162. s%@wi_PWD@%$wi_PWD%g
  10163. s%@CCDV@%$CCDV%g
  10164. /@LIBNCFTP_PRECOMP@/r $LIBNCFTP_PRECOMP
  10165. s%@LIBNCFTP_PRECOMP@%%g
  10166. /@SIO_PRECOMP@/r $SIO_PRECOMP
  10167. s%@SIO_PRECOMP@%%g
  10168. s%@SFLAG@%$SFLAG%g
  10169. s%@MAKE@%$MAKE%g
  10170. s%@Z30@%$Z30%g
  10171. s%@Z31@%$Z31%g
  10172. s%@LIBSET@%$LIBSET%g
  10173. s%@MAINDIR@%$MAINDIR%g
  10174. s%@NCFTP_VERSION@%$NCFTP_VERSION%g
  10175. s%@LIBNCFTP_VERSION@%$LIBNCFTP_VERSION%g
  10176. s%@SIO_VERSION@%$SIO_VERSION%g
  10177. s%@STRN_VERSION@%$STRN_VERSION%g
  10178. s%@VIS_DPROGS@%$VIS_DPROGS%g
  10179.  
  10180. CEOF
  10181. EOF
  10182.  
  10183. cat >> $CONFIG_STATUS <<\EOF
  10184.  
  10185. # Split the substitutions into bite-sized pieces for seds with
  10186. # small command number limits, like on Digital OSF/1 and HP-UX.
  10187. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
  10188. ac_file=1 # Number of current file.
  10189. ac_beg=1 # First line for current file.
  10190. ac_end=$ac_max_sed_cmds # Line after last line for current file.
  10191. ac_more_lines=:
  10192. ac_sed_cmds=""
  10193. while $ac_more_lines; do
  10194.   if test $ac_beg -gt 1; then
  10195.     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
  10196.   else
  10197.     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
  10198.   fi
  10199.   if test ! -s conftest.s$ac_file; then
  10200.     ac_more_lines=false
  10201.     rm -f conftest.s$ac_file
  10202.   else
  10203.     if test -z "$ac_sed_cmds"; then
  10204.       ac_sed_cmds="sed -f conftest.s$ac_file"
  10205.     else
  10206.       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
  10207.     fi
  10208.     ac_file=`expr $ac_file + 1`
  10209.     ac_beg=$ac_end
  10210.     ac_end=`expr $ac_end + $ac_max_sed_cmds`
  10211.   fi
  10212. done
  10213. if test -z "$ac_sed_cmds"; then
  10214.   ac_sed_cmds=cat
  10215. fi
  10216. EOF
  10217.  
  10218. cat >> $CONFIG_STATUS <<EOF
  10219.  
  10220. CONFIG_FILES=\${CONFIG_FILES-"Makefile Makefile.bin ncftp/Makefile libncftp/Makefile Strn/Makefile sio/Makefile sh_util/Makefile vis/Makefile"}
  10221. EOF
  10222. cat >> $CONFIG_STATUS <<\EOF
  10223. for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  10224.   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  10225.   case "$ac_file" in
  10226.   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
  10227.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  10228.   *) ac_file_in="${ac_file}.in" ;;
  10229.   esac
  10230.  
  10231.   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
  10232.  
  10233.   # Remove last slash and all that follows it.  Not all systems have dirname.
  10234.   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  10235.   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  10236.     # The file is in a subdirectory.
  10237.     test ! -d "$ac_dir" && mkdir "$ac_dir"
  10238.     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
  10239.     # A "../" for each directory in $ac_dir_suffix.
  10240.     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  10241.   else
  10242.     ac_dir_suffix= ac_dots=
  10243.   fi
  10244.  
  10245.   case "$ac_given_srcdir" in
  10246.   .)  srcdir=.
  10247.       if test -z "$ac_dots"; then top_srcdir=.
  10248.       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  10249.   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  10250.   *) # Relative path.
  10251.     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
  10252.     top_srcdir="$ac_dots$ac_given_srcdir" ;;
  10253.   esac
  10254.  
  10255.   case "$ac_given_INSTALL" in
  10256.   [/$]*) INSTALL="$ac_given_INSTALL" ;;
  10257.   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
  10258.   esac
  10259.  
  10260.   echo creating "$ac_file"
  10261.   rm -f "$ac_file"
  10262.   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  10263.   case "$ac_file" in
  10264.   *Makefile*) ac_comsub="1i\\
  10265. # $configure_input" ;;
  10266.   *) ac_comsub= ;;
  10267.   esac
  10268.  
  10269.   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  10270.   sed -e "$ac_comsub
  10271. s%@configure_input@%$configure_input%g
  10272. s%@srcdir@%$srcdir%g
  10273. s%@top_srcdir@%$top_srcdir%g
  10274. s%@INSTALL@%$INSTALL%g
  10275. " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
  10276. fi; done
  10277. rm -f conftest.s*
  10278.  
  10279. # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  10280. # NAME is the cpp macro being defined and VALUE is the value it is being given.
  10281. #
  10282. # ac_d sets the value in "#define NAME VALUE" lines.
  10283. ac_dA='s%^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  10284. ac_dB='\([     ][     ]*\)[^     ]*%\1#\2'
  10285. ac_dC='\3'
  10286. ac_dD='%g'
  10287. # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  10288. ac_uA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  10289. ac_uB='\([     ]\)%\1#\2define\3'
  10290. ac_uC=' '
  10291. ac_uD='\4%g'
  10292. # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  10293. ac_eA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  10294. ac_eB='$%\1#\2define\3'
  10295. ac_eC=' '
  10296. ac_eD='%g'
  10297.  
  10298. if test "${CONFIG_HEADERS+set}" != set; then
  10299. EOF
  10300. cat >> $CONFIG_STATUS <<EOF
  10301.   CONFIG_HEADERS="config.h"
  10302. EOF
  10303. cat >> $CONFIG_STATUS <<\EOF
  10304. fi
  10305. for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  10306.   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
  10307.   case "$ac_file" in
  10308.   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
  10309.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  10310.   *) ac_file_in="${ac_file}.in" ;;
  10311.   esac
  10312.  
  10313.   echo creating $ac_file
  10314.  
  10315.   rm -f conftest.frag conftest.in conftest.out
  10316.   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
  10317.   cat $ac_file_inputs > conftest.in
  10318.  
  10319. EOF
  10320.  
  10321. # Transform confdefs.h into a sed script conftest.vals that substitutes
  10322. # the proper values into config.h.in to produce config.h.  And first:
  10323. # Protect against being on the right side of a sed subst in config.status.
  10324. # Protect against being in an unquoted here document in config.status.
  10325. rm -f conftest.vals
  10326. cat > conftest.hdr <<\EOF
  10327. s/[\\&%]/\\&/g
  10328. s%[\\$`]%\\&%g
  10329. s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
  10330. s%ac_d%ac_u%gp
  10331. s%ac_u%ac_e%gp
  10332. EOF
  10333. sed -n -f conftest.hdr confdefs.h > conftest.vals
  10334. rm -f conftest.hdr
  10335.  
  10336. # This sed command replaces #undef with comments.  This is necessary, for
  10337. # example, in the case of _POSIX_SOURCE, which is predefined and required
  10338. # on some systems where configure will not decide to define it.
  10339. cat >> conftest.vals <<\EOF
  10340. s%^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
  10341. EOF
  10342.  
  10343. # Break up conftest.vals because some shells have a limit on
  10344. # the size of here documents, and old seds have small limits too.
  10345.  
  10346. rm -f conftest.tail
  10347. while :
  10348. do
  10349.   ac_lines=`grep -c . conftest.vals`
  10350.   # grep -c gives empty output for an empty file on some AIX systems.
  10351.   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  10352.   # Write a limited-size here document to conftest.frag.
  10353.   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  10354.   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  10355.   echo 'CEOF
  10356.   sed -f conftest.frag conftest.in > conftest.out
  10357.   rm -f conftest.in
  10358.   mv conftest.out conftest.in
  10359. ' >> $CONFIG_STATUS
  10360.   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  10361.   rm -f conftest.vals
  10362.   mv conftest.tail conftest.vals
  10363. done
  10364. rm -f conftest.vals
  10365.  
  10366. cat >> $CONFIG_STATUS <<\EOF
  10367.   rm -f conftest.frag conftest.h
  10368.   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  10369.   cat conftest.in >> conftest.h
  10370.   rm -f conftest.in
  10371.   if cmp -s $ac_file conftest.h 2>/dev/null; then
  10372.     echo "$ac_file is unchanged"
  10373.     rm -f conftest.h
  10374.   else
  10375.     # Remove last slash and all that follows it.  Not all systems have dirname.
  10376.       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  10377.       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  10378.       # The file is in a subdirectory.
  10379.       test ! -d "$ac_dir" && mkdir "$ac_dir"
  10380.     fi
  10381.     rm -f $ac_file
  10382.     mv conftest.h $ac_file
  10383.   fi
  10384. fi; done
  10385.  
  10386. EOF
  10387. cat >> $CONFIG_STATUS <<EOF
  10388.  
  10389.  
  10390. EOF
  10391. cat >> $CONFIG_STATUS <<\EOF
  10392. /bin/rm -f ./ncftp/readln.o
  10393.  
  10394. exit 0
  10395. EOF
  10396. chmod +x $CONFIG_STATUS
  10397. rm -fr confdefs* $ac_clean_files
  10398. test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
  10399.  
  10400.