home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / D / CLISP / CLISPSRC.TAR / clisp-1995-01-01 / src / configure < prev    next >
Encoding:
Text File  |  1994-12-30  |  219.5 KB  |  9,925 lines

  1. #!/bin/sh
  2.  
  3. # Guess values for system-dependent variables and create Makefiles.
  4. # Generated automatically using autoconf version 2.1 
  5. # Copyright (C) 1992, 1993, 1994 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.   --with-x                use the X Window System"
  16.  
  17. # Initialize some variables set by options.
  18. # The variables have the same names as the options, with
  19. # dashes changed to underlines.
  20. build=NONE
  21. cache_file=./config.cache
  22. exec_prefix=NONE
  23. host=NONE
  24. no_create=
  25. nonopt=NONE
  26. no_recursion=
  27. prefix=NONE
  28. program_prefix=NONE
  29. program_suffix=NONE
  30. program_transform_name=s,x,x,
  31. silent=
  32. site=
  33. srcdir=
  34. target=NONE
  35. verbose=
  36. x_includes=NONE
  37. x_libraries=NONE
  38.  
  39. # Initialize some other variables.
  40. subdirs=
  41.  
  42. ac_prev=
  43. for ac_option
  44. do
  45.  
  46.   # If the previous option needs an argument, assign it.
  47.   if test -n "$ac_prev"; then
  48.     eval "$ac_prev=\$ac_option"
  49.     ac_prev=
  50.     continue
  51.   fi
  52.  
  53.   case "$ac_option" in
  54.   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  55.   *) ac_optarg= ;;
  56.   esac
  57.  
  58.   # Accept the important Cygnus configure options, so we can diagnose typos.
  59.  
  60.   case "$ac_option" in
  61.  
  62.   -build | --build | --buil | --bui | --bu | --b)
  63.     ac_prev=build ;;
  64.   -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
  65.     build="$ac_optarg" ;;
  66.  
  67.   -cache-file | --cache-file | --cache-fil | --cache-fi \
  68.   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
  69.     ac_prev=cache_file ;;
  70.   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
  71.   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
  72.     cache_file="$ac_optarg" ;;
  73.  
  74.   -disable-* | --disable-*)
  75.     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
  76.     # Reject names that are not valid shell variable names.
  77.     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
  78.       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
  79.     fi
  80.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  81.     eval "enable_${ac_feature}=no" ;;
  82.  
  83.   -enable-* | --enable-*)
  84.     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
  85.     # Reject names that are not valid shell variable names.
  86.     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
  87.       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
  88.     fi
  89.     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
  90.     case "$ac_option" in
  91.       *=*) ;;
  92.       *) ac_optarg=yes ;;
  93.     esac
  94.     eval "enable_${ac_feature}='$ac_optarg'" ;;
  95.  
  96.   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
  97.   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
  98.   | --exec | --exe | --ex)
  99.     ac_prev=exec_prefix ;;
  100.   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
  101.   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
  102.   | --exec=* | --exe=* | --ex=*)
  103.     exec_prefix="$ac_optarg" ;;
  104.  
  105.   -gas | --gas | --ga | --g)
  106.     # Obsolete; use --with-gas.
  107.     with_gas=yes ;;
  108.  
  109.   -help | --help | --hel | --he)
  110.     # Omit some internal or obsolete options to make the list less imposing.
  111.     # This message is too long to be a string in the A/UX 3.1 sh.
  112.     cat << EOF
  113. Usage: configure [options] [host]
  114. Options: [defaults in brackets after descriptions]
  115. Configuration:
  116.   --cache-file=FILE       cache test results in FILE
  117.   --help                  print this message
  118.   --no-create             do not create output files
  119.   --quiet, --silent       do not print \`checking...' messages
  120.   --version               print the version of autoconf that created configure
  121. Directory and file names:
  122.   --prefix=PREFIX         install architecture-independent files in PREFIX
  123.                           [$ac_default_prefix]
  124.   --exec-prefix=PREFIX    install architecture-dependent files in PREFIX
  125.                           [same as prefix]
  126.   --srcdir=DIR            find the sources in DIR [configure dir or ..]
  127.   --program-prefix=PREFIX prepend PREFIX to installed program names
  128.   --program-suffix=SUFFIX append SUFFIX to installed program names
  129.   --program-transform-name=PROGRAM run sed PROGRAM on installed program names
  130. Host type:
  131.   --build=BUILD           configure for building on BUILD [BUILD=HOST]
  132.   --host=HOST             configure for HOST [guessed]
  133.   --target=TARGET         configure for TARGET [TARGET=HOST]
  134. Features and packages:
  135.   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  136.   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  137.   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  138.   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  139.   --x-includes=DIR        X include files are in DIR
  140.   --x-libraries=DIR       X library files are in DIR
  141. --enable and --with options recognized:$ac_help
  142. EOF
  143.     exit 0 ;;
  144.  
  145.   -host | --host | --hos | --ho)
  146.     ac_prev=host ;;
  147.   -host=* | --host=* | --hos=* | --ho=*)
  148.     host="$ac_optarg" ;;
  149.  
  150.   -nfp | --nfp | --nf)
  151.     # Obsolete; use --without-fp.
  152.     with_fp=no ;;
  153.  
  154.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  155.   | --no-cr | --no-c)
  156.     no_create=yes ;;
  157.  
  158.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  159.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
  160.     no_recursion=yes ;;
  161.  
  162.   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  163.     ac_prev=prefix ;;
  164.   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  165.     prefix="$ac_optarg" ;;
  166.  
  167.   -program-prefix | --program-prefix | --program-prefi | --program-pref \
  168.   | --program-pre | --program-pr | --program-p)
  169.     ac_prev=program_prefix ;;
  170.   -program-prefix=* | --program-prefix=* | --program-prefi=* \
  171.   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
  172.     program_prefix="$ac_optarg" ;;
  173.  
  174.   -program-suffix | --program-suffix | --program-suffi | --program-suff \
  175.   | --program-suf | --program-su | --program-s)
  176.     ac_prev=program_suffix ;;
  177.   -program-suffix=* | --program-suffix=* | --program-suffi=* \
  178.   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
  179.     program_suffix="$ac_optarg" ;;
  180.  
  181.   -program-transform-name | --program-transform-name \
  182.   | --program-transform-nam | --program-transform-na \
  183.   | --program-transform-n | --program-transform- \
  184.   | --program-transform | --program-transfor \
  185.   | --program-transfo | --program-transf \
  186.   | --program-trans | --program-tran \
  187.   | --progr-tra | --program-tr | --program-t)
  188.     ac_prev=program_transform_name ;;
  189.   -program-transform-name=* | --program-transform-name=* \
  190.   | --program-transform-nam=* | --program-transform-na=* \
  191.   | --program-transform-n=* | --program-transform-=* \
  192.   | --program-transform=* | --program-transfor=* \
  193.   | --program-transfo=* | --program-transf=* \
  194.   | --program-trans=* | --program-tran=* \
  195.   | --progr-tra=* | --program-tr=* | --program-t=*)
  196.     program_transform_name="$ac_optarg" ;;
  197.  
  198.   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
  199.   | -silent | --silent | --silen | --sile | --sil)
  200.     silent=yes ;;
  201.  
  202.   -site | --site | --sit)
  203.     ac_prev=site ;;
  204.   -site=* | --site=* | --sit=*)
  205.     site="$ac_optarg" ;;
  206.  
  207.   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
  208.     ac_prev=srcdir ;;
  209.   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
  210.     srcdir="$ac_optarg" ;;
  211.  
  212.   -target | --target | --targe | --targ | --tar | --ta | --t)
  213.     ac_prev=target ;;
  214.   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
  215.     target="$ac_optarg" ;;
  216.  
  217.   -v | -verbose | --verbose | --verbos | --verbo | --verb)
  218.     verbose=yes ;;
  219.  
  220.   -version | --version | --versio | --versi | --vers)
  221.     echo "configure generated by autoconf version 2.1"
  222.     exit 0 ;;
  223.  
  224.   -with-* | --with-*)
  225.     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
  226.     # Reject names that are not valid shell variable names.
  227.     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
  228.       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
  229.     fi
  230.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  231.     case "$ac_option" in
  232.       *=*) ;;
  233.       *) ac_optarg=yes ;;
  234.     esac
  235.     eval "with_${ac_package}='$ac_optarg'" ;;
  236.  
  237.   -without-* | --without-*)
  238.     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
  239.     # Reject names that are not valid shell variable names.
  240.     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  241.       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
  242.     fi
  243.     ac_package=`echo $ac_package| sed 's/-/_/g'`
  244.     eval "with_${ac_package}=no" ;;
  245.  
  246.   --x)
  247.     # Obsolete; use --with-x.
  248.     with_x=yes ;;
  249.  
  250.   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
  251.   | --x-incl | --x-inc | --x-in | --x-i)
  252.     ac_prev=x_includes ;;
  253.   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
  254.   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
  255.     x_includes="$ac_optarg" ;;
  256.  
  257.   -x-libraries | --x-libraries | --x-librarie | --x-librari \
  258.   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
  259.     ac_prev=x_libraries ;;
  260.   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
  261.   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
  262.     x_libraries="$ac_optarg" ;;
  263.  
  264.   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
  265.     ;;
  266.  
  267.   *) 
  268.     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
  269.       echo "configure: warning: $ac_option: invalid host type" 1>&2
  270.     fi
  271.     if test "x$nonopt" != xNONE; then
  272.       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
  273.     fi
  274.     nonopt="$ac_option"
  275.     ;;
  276.  
  277.   esac
  278. done
  279.  
  280. if test -n "$ac_prev"; then
  281.   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
  282. fi
  283.  
  284. trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
  285.  
  286. # File descriptor usage:
  287. # 0 unused; standard input
  288. # 1 file creation
  289. # 2 errors and warnings
  290. # 3 unused; some systems may open it to /dev/tty
  291. # 4 checking for... messages and results
  292. # 5 compiler messages saved in config.log
  293. if test "$silent" = yes; then
  294.   exec 4>/dev/null
  295. else
  296.   exec 4>&1
  297. fi
  298. exec 5>./config.log
  299.  
  300. echo "\
  301. This file contains any messages produced by compilers while
  302. running configure, to aid debugging if configure makes a mistake.
  303. " 1>&5
  304.  
  305. # Strip out --no-create and --no-recursion so they do not pile up.
  306. # Also quote any args containing shell metacharacters.
  307. ac_configure_args=
  308. for ac_arg
  309. do
  310.   case "$ac_arg" in
  311.   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
  312.   | --no-cr | --no-c) ;;
  313.   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
  314.   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
  315.   *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
  316.   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
  317.   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
  318.   esac
  319. done
  320.  
  321. # NLS nuisances.
  322. # Only set LANG and LC_ALL to C if already set.
  323. # These must not be set unconditionally because not all systems understand
  324. # e.g. LANG=C (notably SCO).
  325. if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  326. if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  327.  
  328. # confdefs.h avoids OS command line length limits that DEFS can exceed.
  329. rm -rf conftest* confdefs.h
  330. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  331. echo > confdefs.h
  332.  
  333. # A filename unique to this package, relative to the directory that
  334. # configure is in, which we can look for to find out if srcdir is correct.
  335. ac_unique_file=lispbibl.d
  336.  
  337. # Find the source files, if location was not specified.
  338. if test -z "$srcdir"; then
  339.   ac_srcdir_defaulted=yes
  340.   # Try the directory containing this script, then its parent.
  341.   ac_prog=$0
  342.   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
  343.   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
  344.   srcdir=$ac_confdir
  345.   if test ! -r $srcdir/$ac_unique_file; then
  346.     srcdir=..
  347.   fi
  348. else
  349.   ac_srcdir_defaulted=no
  350. fi
  351. if test ! -r $srcdir/$ac_unique_file; then
  352.   if test "$ac_srcdir_defaulted" = yes; then
  353.     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
  354.   else
  355.     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
  356.   fi
  357. fi
  358. srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
  359.  
  360. # Prefer explicitly selected file to automatically selected ones.
  361. if test -z "$CONFIG_SITE"; then
  362.   if test "x$prefix" != xNONE; then
  363.     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
  364.   else
  365.     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
  366.   fi
  367. fi
  368. for ac_site_file in $CONFIG_SITE; do
  369.   if test -r "$ac_site_file"; then
  370.     echo "loading site script $ac_site_file"
  371.     . "$ac_site_file"
  372.   fi
  373. done
  374.  
  375. if test -r "$cache_file"; then
  376.   echo "loading cache $cache_file"
  377.   . $cache_file
  378. else
  379.   echo "creating cache $cache_file"
  380.   > $cache_file
  381. fi
  382.  
  383. ac_ext=c
  384. # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
  385. ac_cpp='$CPP $CPPFLAGS'
  386. ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
  387. ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'
  388.  
  389. if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  390.   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  391.   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  392.     ac_n= ac_c='
  393. ' ac_t='    ' ac_tt=
  394.   else
  395.     ac_n=-n ac_c= ac_t= ac_tt='
  396.          '
  397.   fi
  398. else
  399.   ac_n= ac_c='\c' ac_t= ac_tt='
  400.          '
  401. fi
  402.  
  403.  
  404.  
  405. # Extract the first word of "gcc", so it can be a program name with args.
  406. set dummy gcc; ac_word=$2
  407. echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
  408. if eval "test \"`echo '${'ac_cv_prog_CC'+set}'`\" = set"; then
  409.   echo $ac_n "(cached) $ac_c" 1>&4
  410. else
  411.   if test -n "$CC"; then
  412.   ac_cv_prog_CC="$CC" # Let the user override the test.
  413. else
  414.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  415.   for ac_dir in $PATH; do
  416.     test -z "$ac_dir" && ac_dir=.
  417.     if test -f $ac_dir/$ac_word; then
  418.       ac_cv_prog_CC="gcc"
  419.       break
  420.     fi
  421.   done
  422.   IFS="$ac_save_ifs"
  423.   test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
  424. fi
  425. fi
  426. CC="$ac_cv_prog_CC"
  427. if test -n "$CC"; then
  428.   echo "$ac_t""$CC" 1>&4
  429. else
  430.   echo "$ac_t""no" 1>&4
  431. fi
  432.  
  433.  
  434. echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&4
  435. if eval "test \"`echo '${'ac_cv_prog_gcc'+set}'`\" = set"; then
  436.   echo $ac_n "(cached) $ac_c" 1>&4
  437. else
  438.   cat > conftest.c <<EOF
  439. #ifdef __GNUC__
  440.   yes;
  441. #endif
  442. EOF
  443. if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
  444.   ac_cv_prog_gcc=yes
  445.   # Add "-O" to both the CC and CPP commands, to eliminate possible confusion
  446.   # that results from __OPTIMIZE__ being defined for CC but not CPP.
  447.   CC="$CC -O"
  448. else
  449.   ac_cv_prog_gcc=no
  450. fi
  451.  
  452. fi
  453. echo "$ac_t""$ac_cv_prog_gcc" 1>&4
  454. if test $ac_cv_prog_gcc = yes; then
  455.   GCC=yes
  456. else
  457.   GCC=
  458. fi
  459.  
  460.                       echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
  461. # On Suns, sometimes $CPP names a directory.
  462. if test -n "$CPP" && test -d "$CPP"; then
  463.   CPP=
  464. fi
  465. if test -z "$CPP"; then
  466. if eval "test \"`echo '${'ac_cv_prog_CPP'+set}'`\" = set"; then
  467.   echo $ac_n "(cached) $ac_c" 1>&4
  468. else
  469.     # This must be in double quotes, not single quotes, because CPP may get
  470.   # substituted into the Makefile and "${CC-cc}" will confuse make.
  471.   CPP="${CC-cc} -E"
  472.   if test -n "$GCC"; then
  473.     # Suppress warning messages.
  474.     CPP="$CPP -w"
  475.   fi
  476.   # On the NeXT, cc -E runs the code through the compiler's parser,
  477.   # not just through cpp. On NeXTstep 3.1 the same holds for /lib/cpp; use
  478.   # "cc -E -traditional-cpp" instead.
  479.   cat > conftest.$ac_ext <<EOF
  480. #line 481 "configure"
  481. #include "confdefs.h"
  482. #include <assert.h>
  483. Syntax Error
  484. EOF
  485. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  486. ac_err=`grep -v '^ *+' conftest.out`
  487. if test -z "$ac_err"; then
  488.   rm -rf conftest*
  489.   ac_have_cpp=1
  490. else
  491.   echo "$ac_err" >&5
  492. fi
  493. rm -f conftest*
  494.   if test -z "$ac_have_cpp"; then
  495.     CPP="${CC-cc} -E -traditional-cpp"
  496.     cat > conftest.$ac_ext <<EOF
  497. #line 498 "configure"
  498. #include "confdefs.h"
  499. #include <assert.h>
  500. Syntax Error
  501. EOF
  502. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  503. ac_err=`grep -v '^ *+' conftest.out`
  504. if test -z "$ac_err"; then
  505.   rm -rf conftest*
  506.   CC="${CC-cc} -traditional-cpp"
  507. else
  508.   echo "$ac_err" >&5
  509.   rm -rf conftest*
  510.   CPP=/lib/cpp
  511. fi
  512. rm -f conftest*
  513.   fi
  514.   ac_cv_prog_CC="$CC"
  515.   ac_cv_prog_CPP="$CPP"
  516. fi
  517. fi
  518. CPP="$ac_cv_prog_CPP"
  519. echo "$ac_t""$CPP" 1>&4
  520.  
  521.                       if test $ac_cv_prog_gcc = yes; then
  522.   echo $ac_n "checking whether -traditional is needed for ${CC-cc} on this system""... $ac_c" 1>&4
  523. if eval "test \"`echo '${'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
  524.   echo $ac_n "(cached) $ac_c" 1>&4
  525. else
  526.     ac_pattern="Autoconf.*'x'"
  527.   cat > conftest.$ac_ext <<EOF
  528. #line 529 "configure"
  529. #include "confdefs.h"
  530. #include <sgtty.h>
  531. Autoconf TIOCGETP
  532. EOF
  533. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  534.   egrep "$ac_pattern" >/dev/null 2>&1; then
  535.   rm -rf conftest*
  536.   ac_cv_prog_gcc_traditional=yes
  537. else
  538.   rm -rf conftest*
  539.   ac_cv_prog_gcc_traditional=no
  540. fi
  541. rm -f conftest*
  542.  
  543.  
  544.   if test $ac_cv_prog_gcc_traditional = no; then
  545.     cat > conftest.$ac_ext <<EOF
  546. #line 547 "configure"
  547. #include "confdefs.h"
  548. #include <termio.h>
  549. Autoconf TCGETA
  550. EOF
  551. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  552.   egrep "$ac_pattern" >/dev/null 2>&1; then
  553.   rm -rf conftest*
  554.   ac_cv_prog_gcc_traditional=yes
  555. fi
  556. rm -f conftest*
  557.  
  558.   fi
  559.   if test $ac_cv_prog_gcc_traditional = no; then
  560.     # On some USL SVR4 systems, gcc's fixinc.svr4 modifies <signal.h> and
  561.     # <sys/signal.h> in such a way that "#include <signal.h>" results in a
  562.     # syntax error because of `sigset_t' if gcc is called with __STDC__=1
  563.     # but __STRICT_ANSI__ undefined. Remedy: use -traditional.
  564.     ac_prog='
  565. #include <sys/types.h>
  566. #include <signal.h>
  567. int main() { exit(0); }'
  568.     echo "$ac_prog" > conftest.c
  569.     if eval $ac_link; then
  570.       :
  571.     else
  572.       ac_prog='
  573. #undef __STDC__
  574. #include <sys/types.h>
  575. #include <signal.h>
  576. int main() { exit(0); }'
  577.       echo "$ac_prog" > conftest.c
  578.       if eval $ac_link; then
  579.         ac_cv_prog_gcc_traditional=yes
  580.       fi
  581.     fi
  582.     rm -f conftest*
  583.   fi
  584. fi
  585.   echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&4
  586.   if test $ac_cv_prog_gcc_traditional = yes; then
  587.     CC="$CC -traditional"
  588.   fi
  589. fi
  590.  
  591.                       echo $ac_n "checking for AIX""... $ac_c" 1>&4
  592. if eval "test \"`echo '${'ac_cv_sys_aix'+set}'`\" = set"; then
  593.   echo $ac_n "(cached) $ac_c" 1>&4
  594. else
  595.   
  596. cat > conftest.$ac_ext <<EOF
  597. #line 598 "configure"
  598. #include "confdefs.h"
  599. #ifdef _AIX
  600.   yes
  601. #endif
  602.  
  603. EOF
  604. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  605.   egrep "yes" >/dev/null 2>&1; then
  606.   rm -rf conftest*
  607.   ac_cv_sys_aix=yes
  608. else
  609.   rm -rf conftest*
  610.   ac_cv_sys_aix=no
  611. fi
  612. rm -f conftest*
  613.  
  614. fi
  615.  
  616. echo "$ac_t""$ac_cv_sys_aix" 1>&4
  617. if test $ac_cv_sys_aix = yes; then
  618.   cat >> confdefs.h <<\EOF
  619. #define _ALL_SOURCE 1
  620. EOF
  621.  
  622. fi
  623.  
  624.                       echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&4
  625. if eval "test \"`echo '${'ac_cv_sys_isc_posix'+set}'`\" = set"; then
  626.   echo $ac_n "(cached) $ac_c" 1>&4
  627. else
  628.   
  629. if test -d /etc/conf/kconfig.d &&
  630.   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
  631. then
  632.   ac_cv_sys_isc_posix=yes
  633. else
  634.   ac_cv_sys_isc_posix=no
  635. fi
  636.  
  637. fi
  638.  
  639. echo "$ac_t""$ac_cv_sys_isc_posix" 1>&4
  640. if test $ac_cv_sys_isc_posix = yes; then
  641.   ISC=yes # If later tests want to check for ISC.
  642.   cat >> confdefs.h <<\EOF
  643. #define _POSIX_SOURCE 1
  644. EOF
  645.  
  646.   if test "$GCC" = yes; then
  647.     CC="$CC -posix"
  648.   else
  649.     CC="$CC -Xp"
  650.   fi
  651. else
  652.   ISC=
  653. fi
  654.  
  655.                       ac_safe=`echo "minix/config.h" | tr './\055' '___'`
  656. echo $ac_n "checking for minix/config.h""... $ac_c" 1>&4
  657. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  658.   echo $ac_n "(cached) $ac_c" 1>&4
  659. else
  660.   cat > conftest.$ac_ext <<EOF
  661. #line 662 "configure"
  662. #include "confdefs.h"
  663. #include <minix/config.h>
  664. EOF
  665. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  666. ac_err=`grep -v '^ *+' conftest.out`
  667. if test -z "$ac_err"; then
  668.   rm -rf conftest*
  669.   eval "ac_cv_header_$ac_safe=yes"
  670. else
  671.   echo "$ac_err" >&5
  672.   rm -rf conftest*
  673.   eval "ac_cv_header_$ac_safe=no"
  674. fi
  675. rm -f conftest*
  676. fi
  677. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  678.   echo "$ac_t""yes" 1>&4
  679.   MINIX=yes
  680. else
  681.   echo "$ac_t""no" 1>&4
  682. MINIX=
  683. fi
  684.  
  685. if test "$MINIX" = yes; then
  686.   cat >> confdefs.h <<\EOF
  687. #define _POSIX_SOURCE 1
  688. EOF
  689.  
  690.   cat >> confdefs.h <<\EOF
  691. #define _POSIX_1_SOURCE 2
  692. EOF
  693.  
  694.   cat >> confdefs.h <<\EOF
  695. #define _MINIX 1
  696. EOF
  697.  
  698. fi
  699.  
  700.                       
  701. echo $ac_n "checking whether using GNU C""... $ac_c" 1>&4
  702. if eval "test \"`echo '${'cl_cv_prog_cc_gcc'+set}'`\" = set"; then
  703.   echo $ac_n "(cached) $ac_c" 1>&4
  704. else
  705.   
  706. cat > conftest.$ac_ext <<EOF
  707. #line 708 "configure"
  708. #include "confdefs.h"
  709. #ifdef __GNUC__
  710.   yes
  711. #endif
  712.  
  713. EOF
  714. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  715.   egrep "yes" >/dev/null 2>&1; then
  716.   rm -rf conftest*
  717.   cl_cv_prog_cc_gcc=yes
  718. else
  719.   rm -rf conftest*
  720.   cl_cv_prog_cc_gcc=no
  721. fi
  722. rm -f conftest*
  723.  
  724.  
  725. fi
  726.  
  727. echo "$ac_t""$cl_cv_prog_cc_gcc" 1>&4
  728. if test $cl_cv_prog_cc_gcc = yes; then
  729.   CC_GCC=true
  730. else
  731.   CC_GCC=false
  732. fi
  733.  
  734.                       
  735. echo $ac_n "checking whether using ANSI C""... $ac_c" 1>&4
  736. if eval "test \"`echo '${'cl_cv_prog_cc_ansi'+set}'`\" = set"; then
  737.   echo $ac_n "(cached) $ac_c" 1>&4
  738. else
  739.   
  740. cat > conftest.$ac_ext <<EOF
  741. #line 742 "configure"
  742. #include "confdefs.h"
  743. #ifdef __STDC__
  744.   yes
  745. #endif
  746.  
  747. EOF
  748. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  749.   egrep "yes" >/dev/null 2>&1; then
  750.   rm -rf conftest*
  751.   cl_cv_prog_cc_ansi=yes
  752. else
  753.   rm -rf conftest*
  754.   cl_cv_prog_cc_ansi=no
  755. fi
  756. rm -f conftest*
  757.  
  758.  
  759. fi
  760.  
  761. echo "$ac_t""$cl_cv_prog_cc_ansi" 1>&4
  762. if test $cl_cv_prog_cc_ansi = yes; then
  763.   CC_ANSI=true
  764. else
  765.   CC_ANSI=false
  766. fi
  767.  
  768.                       
  769. echo $ac_n "checking whether CPP likes indented directives""... $ac_c" 1>&4
  770. if eval "test \"`echo '${'cl_cv_prog_cc_indented'+set}'`\" = set"; then
  771.   echo $ac_n "(cached) $ac_c" 1>&4
  772. else
  773.   
  774. cat > conftest.$ac_ext <<EOF
  775. #line 776 "configure"
  776. #include "confdefs.h"
  777.  #define foo
  778. EOF
  779. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  780.   egrep "#.*foo" >/dev/null 2>&1; then
  781.   rm -rf conftest*
  782.   cl_cv_prog_cc_indented=no
  783. else
  784.   rm -rf conftest*
  785.   cl_cv_prog_cc_indented=yes
  786. fi
  787. rm -f conftest*
  788.  
  789.  
  790. fi
  791.  
  792. echo "$ac_t""$cl_cv_prog_cc_indented" 1>&4
  793. if test $cl_cv_prog_cc_indented = yes; then
  794.   CC_NEED_CCPAUX=false
  795. else
  796.   CC_NEED_CCPAUX=true
  797. fi
  798.  
  799.                       
  800. sharp='#elif'
  801. echo $ac_n "checking whether CPP understands $sharp""... $ac_c" 1>&4
  802. if eval "test \"`echo '${'cl_cv_prog_cc_elif'+set}'`\" = set"; then
  803.   echo $ac_n "(cached) $ac_c" 1>&4
  804. else
  805.   
  806. cat > conftest.$ac_ext <<EOF
  807. #line 808 "configure"
  808. #include "confdefs.h"
  809. #if 0
  810. #elif 1
  811. #else
  812. #endif
  813. EOF
  814. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  815. ac_err=`grep -v '^ *+' conftest.out`
  816. if test -z "$ac_err"; then
  817.   rm -rf conftest*
  818.   cl_cv_prog_cc_elif=yes
  819. else
  820.   echo "$ac_err" >&5
  821.   rm -rf conftest*
  822.   cl_cv_prog_cc_elif=no
  823. fi
  824. rm -f conftest*
  825.  
  826. fi
  827.  
  828. echo "$ac_t""$cl_cv_prog_cc_elif" 1>&4
  829. if test $cl_cv_prog_cc_elif = yes; then
  830.   CC_NEED_DEELIF=false
  831. else
  832.   CC_NEED_DEELIF=true
  833. fi
  834.  
  835.                       
  836. sharp='#error'
  837. echo $ac_n "checking whether CPP understands $sharp""... $ac_c" 1>&4
  838. if eval "test \"`echo '${'cl_cv_prog_cc_error'+set}'`\" = set"; then
  839.   echo $ac_n "(cached) $ac_c" 1>&4
  840. else
  841.   
  842. cat > conftest.$ac_ext <<EOF
  843. #line 844 "configure"
  844. #include "confdefs.h"
  845. #if 0
  846. #error "bla"
  847. #endif
  848. EOF
  849. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  850. ac_err=`grep -v '^ *+' conftest.out`
  851. if test -z "$ac_err"; then
  852.   rm -rf conftest*
  853.   cl_cv_prog_cc_error=yes
  854. else
  855.   echo "$ac_err" >&5
  856.   rm -rf conftest*
  857.   cl_cv_prog_cc_error=no
  858. fi
  859. rm -f conftest*
  860.  
  861. fi
  862.  
  863. echo "$ac_t""$cl_cv_prog_cc_error" 1>&4
  864. if test $cl_cv_prog_cc_error = yes; then
  865.   CC_NEED_DEERROR=false
  866. else
  867.   CC_NEED_DEERROR=true
  868. fi
  869.  
  870.                       
  871. echo $ac_n "checking whether CPP likes empty macro arguments""... $ac_c" 1>&4
  872. if eval "test \"`echo '${'cl_cv_prog_cc_ema'+set}'`\" = set"; then
  873.   echo $ac_n "(cached) $ac_c" 1>&4
  874. else
  875.   
  876. cat > conftest.$ac_ext <<EOF
  877. #line 878 "configure"
  878. #include "confdefs.h"
  879. #define divide(x,y,q_zuw,r_zuw) (r_zuw(x)-(q_zuw(x)/(y))*(y))
  880. foo(x,y) int x,y; { int q; divide(x,y,q=,); return q; }
  881. EOF
  882. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  883. ac_err=`grep -v '^ *+' conftest.out`
  884. if test -z "$ac_err"; then
  885.   rm -rf conftest*
  886.   cl_cv_prog_cc_ema=yes
  887. else
  888.   echo "$ac_err" >&5
  889.   rm -rf conftest*
  890.   cl_cv_prog_cc_ema=no
  891. fi
  892. rm -f conftest*
  893.  
  894. fi
  895.  
  896. echo "$ac_t""$cl_cv_prog_cc_ema" 1>&4
  897. if test $cl_cv_prog_cc_ema = yes; then
  898.   CC_NEED_DEEMA=false
  899. else
  900.   CC_NEED_DEEMA=true
  901. fi
  902.  
  903.                       
  904. echo $ac_n "checking whether CC merges adjacent strings""... $ac_c" 1>&4
  905. if eval "test \"`echo '${'cl_cv_prog_cc_mergestrings'+set}'`\" = set"; then
  906.   echo $ac_n "(cached) $ac_c" 1>&4
  907. else
  908.   
  909. cat > conftest.$ac_ext <<EOF
  910. #line 911 "configure"
  911. #include "confdefs.h"
  912.  
  913. int main() { return 0; }
  914. int t() {
  915. char* foo = "abc" "def";
  916. ; return 0; }
  917. EOF
  918. if eval $ac_compile; then
  919.   rm -rf conftest*
  920.   cl_cv_prog_cc_mergestrings=yes
  921. else
  922.   rm -rf conftest*
  923.   cl_cv_prog_cc_mergestrings=no
  924. fi
  925. rm -f conftest*
  926.  
  927. rm -f conftest*
  928.  
  929. fi
  930.  
  931. echo "$ac_t""$cl_cv_prog_cc_mergestrings" 1>&4
  932. if test $cl_cv_prog_cc_mergestrings = yes; then
  933.   CC_NEED_MERGESTRINGS=false
  934. else
  935.   CC_NEED_MERGESTRINGS=true
  936. fi
  937.  
  938.                       echo $ac_n "checking for underscore in external names""... $ac_c" 1>&4
  939. if eval "test \"`echo '${'cl_cv_prog_as_underscore'+set}'`\" = set"; then
  940.   echo $ac_n "(cached) $ac_c" 1>&4
  941. else
  942.   
  943. cat > conftest.c <<EOF
  944. int foo() { return 0; }
  945. EOF
  946. ${CC-cc} -c conftest.c >/dev/null 2>&1
  947. # check whether nm exists
  948. if (nm conftest.o) >/dev/null 2>&1 ; then
  949.   # use nm to see the assembly language name
  950.   if nm conftest.o | grep _foo >/dev/null 2>&1 ; then
  951.     cl_cv_prog_as_underscore=yes
  952.   else
  953.     cl_cv_prog_as_underscore=no
  954.   fi
  955. else
  956.   # look for the assembly language name in the .s file
  957.   ${CC-cc} -S conftest.c >/dev/null 2>&1
  958.   if grep _foo conftest.s >/dev/null ; then
  959.     cl_cv_prog_as_underscore=yes
  960.   else
  961.     cl_cv_prog_as_underscore=no
  962.   fi
  963. fi
  964. rm -f conftest*
  965.  
  966. fi
  967.  
  968. echo "$ac_t""$cl_cv_prog_as_underscore" 1>&4
  969. if test $cl_cv_prog_as_underscore = yes; then
  970.   AS_UNDERSCORE=true
  971. else
  972.   AS_UNDERSCORE=false
  973. fi
  974.  
  975.                       # Extract the first word of "ranlib", so it can be a program name with args.
  976. set dummy ranlib; ac_word=$2
  977. echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
  978. if eval "test \"`echo '${'ac_cv_prog_RANLIB'+set}'`\" = set"; then
  979.   echo $ac_n "(cached) $ac_c" 1>&4
  980. else
  981.   if test -n "$RANLIB"; then
  982.   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
  983. else
  984.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  985.   for ac_dir in $PATH; do
  986.     test -z "$ac_dir" && ac_dir=.
  987.     if test -f $ac_dir/$ac_word; then
  988.       ac_cv_prog_RANLIB="ranlib"
  989.       break
  990.     fi
  991.   done
  992.   IFS="$ac_save_ifs"
  993.   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB="true"
  994. fi
  995. fi
  996. RANLIB="$ac_cv_prog_RANLIB"
  997. if test -n "$RANLIB"; then
  998.   echo "$ac_t""$RANLIB" 1>&4
  999. else
  1000.   echo "$ac_t""no" 1>&4
  1001. fi
  1002.  
  1003.                       # Find a good install program.  We prefer a C program (faster),
  1004. # so one script is as good as another.  But avoid the broken or
  1005. # incompatible versions:
  1006. # SysV /etc/install, /usr/sbin/install
  1007. # SunOS /usr/etc/install
  1008. # IRIX /sbin/install
  1009. # AIX /bin/install
  1010. # AFS /usr/afsws/bin/install, which mishandles nonexistent args
  1011. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
  1012. # ./install, which can be erroneously created by make from ./install.sh.
  1013. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4
  1014. if test -z "$INSTALL"; then
  1015. if eval "test \"`echo '${'cl_cv_path_install'+set}'`\" = set"; then
  1016.   echo $ac_n "(cached) $ac_c" 1>&4
  1017. else
  1018.     IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  1019.   for ac_dir in $PATH; do
  1020.     case "$ac_dir" in
  1021.     ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
  1022.     *)
  1023.       # OSF1 and SCO ODT 3.0 have their own names for install.
  1024.       for ac_prog in ginstall installbsd scoinst install; do
  1025.         if test -f $ac_dir/$ac_prog; then
  1026.       if test $ac_prog = install &&
  1027.             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
  1028.         # AIX install.  It has an incompatible calling convention.
  1029.         # OSF/1 installbsd also uses dspmsg, but is usable.
  1030.         :
  1031.       else
  1032.         cl_cv_path_install="$ac_dir/$ac_prog -c"
  1033.         break 2
  1034.       fi
  1035.     fi
  1036.       done
  1037.       ;;
  1038.     esac
  1039.   done
  1040.   IFS="$ac_save_ifs"
  1041.   # As a last resort, use cp.
  1042.   test -z "$cl_cv_path_install" && cl_cv_path_install="cp"
  1043.  
  1044. fi
  1045.   INSTALL="$cl_cv_path_install"
  1046. fi
  1047. echo "$ac_t""$INSTALL" 1>&4
  1048. # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
  1049. # It thinks the first close brace ends the variable substitution.
  1050. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='$(INSTALL)'
  1051. if test -z "$INSTALL_DATA"; then
  1052.   case "$INSTALL" in
  1053.     cp | */cp ) INSTALL_DATA='$(INSTALL)' ;;
  1054.     * )         INSTALL_DATA='$(INSTALL) -m 644' ;;
  1055.   esac
  1056. fi
  1057.  
  1058.                       echo $ac_n "checking how to copy files""... $ac_c" 1>&4
  1059. if eval "test \"`echo '${'cl_cv_prog_cp'+set}'`\" = set"; then
  1060.   echo $ac_n "(cached) $ac_c" 1>&4
  1061. else
  1062.   
  1063. echo "blabla" > conftest.x
  1064. err=`/bin/sh -c "cp -p conftest.x conftest.y 2>&1"`
  1065. if test -z "$err"; then
  1066.   cl_cv_prog_cp='cp -p'
  1067. else
  1068.   cl_cv_prog_cp='cp'
  1069. fi
  1070. rm -f conftest*
  1071.  
  1072. fi
  1073.  
  1074. echo "$ac_t""$cl_cv_prog_cp" 1>&4
  1075. CP="$cl_cv_prog_cp"
  1076.  
  1077.                       echo $ac_n "checking whether ln -s works""... $ac_c" 1>&4
  1078. if eval "test \"`echo '${'ac_cv_prog_LN_S'+set}'`\" = set"; then
  1079.   echo $ac_n "(cached) $ac_c" 1>&4
  1080. else
  1081.   rm -f conftestdata
  1082. if ln -s X conftestdata 2>/dev/null
  1083. then
  1084.   rm -f conftestdata
  1085.   ac_cv_prog_LN_S="ln -s"
  1086. else
  1087.   ac_cv_prog_LN_S=ln
  1088. fi
  1089. fi
  1090. LN_S="$ac_cv_prog_LN_S"
  1091. if test "$ac_cv_prog_LN_S" = "ln -s"; then
  1092.   echo "$ac_t""yes" 1>&4
  1093. else
  1094.   echo "$ac_t""no" 1>&4
  1095. fi
  1096.  
  1097.                       echo $ac_n "checking for getpwnam""... $ac_c" 1>&4
  1098. if eval "test \"`echo '${'ac_cv_func_getpwnam'+set}'`\" = set"; then
  1099.   echo $ac_n "(cached) $ac_c" 1>&4
  1100. else
  1101.   cat > conftest.$ac_ext <<EOF
  1102. #line 1103 "configure"
  1103. #include "confdefs.h"
  1104. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  1105. /* The GNU C library defines this for functions which it implements
  1106.     to always fail with ENOSYS.  Some functions are actually named
  1107.     something starting with __ and the normal name is an alias.  */
  1108. #if defined (__stub_getpwnam) || defined (__stub___getpwnam)
  1109. choke me
  1110. #endif
  1111.  
  1112. EOF
  1113. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  1114.   egrep "choke" >/dev/null 2>&1; then
  1115.   rm -rf conftest*
  1116.   eval "ac_cv_func_getpwnam=no"
  1117. else
  1118.   rm -rf conftest*
  1119.   cat > conftest.$ac_ext <<EOF
  1120. #line 1121 "configure"
  1121. #include "confdefs.h"
  1122. /* Override any gcc2 internal prototype to avoid an error.  */
  1123. char getpwnam(); 
  1124.  
  1125. int main() { return 0; }
  1126. int t() {
  1127.  
  1128. getpwnam();
  1129.  
  1130. ; return 0; }
  1131. EOF
  1132. if eval $ac_link; then
  1133.   rm -rf conftest*
  1134.   eval "ac_cv_func_getpwnam=yes"
  1135. else
  1136.   rm -rf conftest*
  1137.   eval "ac_cv_func_getpwnam=no"
  1138. fi
  1139. rm -f conftest*
  1140.  
  1141. fi
  1142. rm -f conftest*
  1143.  
  1144. fi
  1145. if eval "test \"`echo '$ac_cv_func_'getpwnam`\" = yes"; then
  1146.   echo "$ac_t""yes" 1>&4
  1147.   have_getpwnam=1
  1148. else
  1149.   echo "$ac_t""no" 1>&4
  1150. fi
  1151.  
  1152. if test -z "$have_getpwnam"; then
  1153.   echo $ac_n "checking for -lsun""... $ac_c" 1>&4
  1154. if eval "test \"`echo '${'ac_cv_lib_sun'+set}'`\" = set"; then
  1155.   echo $ac_n "(cached) $ac_c" 1>&4
  1156. else
  1157.   ac_save_LIBS="$LIBS"
  1158. LIBS="$LIBS -lsun "
  1159. cat > conftest.$ac_ext <<EOF
  1160. #line 1161 "configure"
  1161. #include "confdefs.h"
  1162.  
  1163. int main() { return 0; }
  1164. int t() {
  1165. getpwnam()
  1166. ; return 0; }
  1167. EOF
  1168. if eval $ac_link; then
  1169.   rm -rf conftest*
  1170.   eval "ac_cv_lib_sun=yes"
  1171. else
  1172.   rm -rf conftest*
  1173.   eval "ac_cv_lib_sun=no"
  1174. fi
  1175. rm -f conftest*
  1176. LIBS="$ac_save_LIBS"
  1177.  
  1178. fi
  1179. if eval "test \"`echo '$ac_cv_lib_'sun`\" = yes"; then
  1180.   echo "$ac_t""yes" 1>&4
  1181.     ac_tr_lib=HAVE_LIB`echo sun | tr '[a-z]' '[A-Z]'`
  1182.   cat >> confdefs.h <<EOF
  1183. #define $ac_tr_lib 1
  1184. EOF
  1185.  
  1186.   LIBS="$LIBS -lsun"
  1187.  
  1188. else
  1189.   echo "$ac_t""no" 1>&4
  1190. fi
  1191.  
  1192. fi
  1193.  
  1194.                       echo $ac_n "checking for DYNIX/ptx libseq or libsocket""... $ac_c" 1>&4
  1195. if eval "test \"`echo '${'cl_cv_lib_sequent'+set}'`\" = set"; then
  1196.   echo $ac_n "(cached) $ac_c" 1>&4
  1197. else
  1198.   
  1199. cat > conftest.$ac_ext <<EOF
  1200. #line 1201 "configure"
  1201. #include "confdefs.h"
  1202. #if defined(_SEQUENT_)
  1203.   yes
  1204. #endif
  1205.  
  1206. EOF
  1207. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  1208.   egrep "yes" >/dev/null 2>&1; then
  1209.   rm -rf conftest*
  1210.   cl_cv_lib_sequent=yes
  1211. else
  1212.   rm -rf conftest*
  1213.   cl_cv_lib_sequent=no
  1214. fi
  1215. rm -f conftest*
  1216.  
  1217.  
  1218. fi
  1219.  
  1220. echo "$ac_t""$cl_cv_lib_sequent" 1>&4
  1221. if test $cl_cv_lib_sequent = yes; then
  1222. echo $ac_n "checking for -lseq""... $ac_c" 1>&4
  1223. if eval "test \"`echo '${'ac_cv_lib_seq'+set}'`\" = set"; then
  1224.   echo $ac_n "(cached) $ac_c" 1>&4
  1225. else
  1226.   ac_save_LIBS="$LIBS"
  1227. LIBS="$LIBS -lseq "
  1228. cat > conftest.$ac_ext <<EOF
  1229. #line 1230 "configure"
  1230. #include "confdefs.h"
  1231.  
  1232. int main() { return 0; }
  1233. int t() {
  1234. main()
  1235. ; return 0; }
  1236. EOF
  1237. if eval $ac_link; then
  1238.   rm -rf conftest*
  1239.   eval "ac_cv_lib_seq=yes"
  1240. else
  1241.   rm -rf conftest*
  1242.   eval "ac_cv_lib_seq=no"
  1243. fi
  1244. rm -f conftest*
  1245. LIBS="$ac_save_LIBS"
  1246.  
  1247. fi
  1248. if eval "test \"`echo '$ac_cv_lib_'seq`\" = yes"; then
  1249.   echo "$ac_t""yes" 1>&4
  1250.   LIBS="$LIBS -lseq"
  1251. else
  1252.   echo "$ac_t""no" 1>&4
  1253. fi
  1254.  
  1255. echo $ac_n "checking for -lsocket""... $ac_c" 1>&4
  1256. if eval "test \"`echo '${'ac_cv_lib_socket'+set}'`\" = set"; then
  1257.   echo $ac_n "(cached) $ac_c" 1>&4
  1258. else
  1259.   ac_save_LIBS="$LIBS"
  1260. LIBS="$LIBS -lsocket "
  1261. cat > conftest.$ac_ext <<EOF
  1262. #line 1263 "configure"
  1263. #include "confdefs.h"
  1264.  
  1265. int main() { return 0; }
  1266. int t() {
  1267. main()
  1268. ; return 0; }
  1269. EOF
  1270. if eval $ac_link; then
  1271.   rm -rf conftest*
  1272.   eval "ac_cv_lib_socket=yes"
  1273. else
  1274.   rm -rf conftest*
  1275.   eval "ac_cv_lib_socket=no"
  1276. fi
  1277. rm -f conftest*
  1278. LIBS="$ac_save_LIBS"
  1279.  
  1280. fi
  1281. if eval "test \"`echo '$ac_cv_lib_'socket`\" = yes"; then
  1282.   echo "$ac_t""yes" 1>&4
  1283.   LIBS="$LIBS -lsocket"
  1284. else
  1285.   echo "$ac_t""no" 1>&4
  1286. fi
  1287.  
  1288. fi
  1289.  
  1290.                       echo $ac_n "checking whether gethostbyname requires -lsocket""... $ac_c" 1>&4
  1291. if eval "test \"`echo '${'cl_cv_lib_socket'+set}'`\" = set"; then
  1292.   echo $ac_n "(cached) $ac_c" 1>&4
  1293. else
  1294.   
  1295. cl_cv_lib_socket=no
  1296. cat > conftest.$ac_ext <<EOF
  1297. #line 1298 "configure"
  1298. #include "confdefs.h"
  1299. extern char gethostbyname();
  1300. int main() { return 0; }
  1301. int t() {
  1302. gethostbyname();
  1303. ; return 0; }
  1304. EOF
  1305. if eval $ac_link; then
  1306.   rm -rf conftest*
  1307.   have_gethostbyname=1
  1308. fi
  1309. rm -f conftest*
  1310.  
  1311. if test -z "$have_gethostbyname"; then
  1312. cl_save_LIBS="$LIBS"
  1313. LIBS="$LIBS -lsocket"
  1314. cat > conftest.$ac_ext <<EOF
  1315. #line 1316 "configure"
  1316. #include "confdefs.h"
  1317. extern char gethostbyname();
  1318. int main() { return 0; }
  1319. int t() {
  1320. gethostbyname();
  1321. ; return 0; }
  1322. EOF
  1323. if eval $ac_link; then
  1324.   rm -rf conftest*
  1325.   cl_cv_lib_socket=yes
  1326. fi
  1327. rm -f conftest*
  1328.  
  1329. LIBS="$cl_save_LIBS"
  1330. fi
  1331.  
  1332. fi
  1333.  
  1334. echo "$ac_t""$cl_cv_lib_socket" 1>&4
  1335. if test $cl_cv_lib_socket = yes; then
  1336.   LIBS="$LIBS -lsocket"
  1337. fi
  1338.  
  1339.                       # If we cannot run a trivial program, we must be cross compiling.
  1340. echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
  1341. if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
  1342.   echo $ac_n "(cached) $ac_c" 1>&4
  1343. else
  1344.   if test "$cross_compiling" = yes; then
  1345.   ac_cv_cross=yes
  1346. else
  1347. cat > conftest.$ac_ext <<EOF
  1348. #line 1349 "configure"
  1349. #include "confdefs.h"
  1350. main(){return(0);}
  1351. EOF
  1352. eval $ac_link
  1353. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1354.   ac_cv_c_cross=no
  1355. else
  1356.   ac_cv_c_cross=yes
  1357. fi
  1358. if test -f core; then
  1359.   coredir=core`/bin/sh -c 'echo $$'`
  1360.   mkdir $coredir
  1361.   cp confdefs.h $coredir/confdefs.h
  1362.   mv conftest.c $coredir/conftest.c
  1363.   mv conftest $coredir/conftest
  1364.   mv core $coredir/core
  1365.   echo "warning: test program dumped core -- see subdirectory $coredir"
  1366. fi
  1367. fi
  1368. rm -fr conftest*
  1369. fi
  1370. cross_compiling=$ac_cv_c_cross
  1371. echo "$ac_t""$ac_cv_c_cross" 1>&4
  1372.  
  1373. echo $ac_n "checking whether CC works at all""... $ac_c" 1>&4
  1374. if eval "test \"`echo '${'cl_cv_prog_cc_works'+set}'`\" = set"; then
  1375.   echo $ac_n "(cached) $ac_c" 1>&4
  1376. else
  1377.   
  1378. if test "$cross_compiling" = yes; then
  1379.   cl_cv_prog_cc_works="guessing yes"
  1380. else
  1381. cat > conftest.$ac_ext <<EOF
  1382. #line 1383 "configure"
  1383. #include "confdefs.h"
  1384. main() { exit(0); }
  1385. EOF
  1386. eval $ac_link
  1387. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1388.   cl_cv_prog_cc_works=yes
  1389. else
  1390.   cl_cv_prog_cc_works=no
  1391. fi
  1392. if test -f core; then
  1393.   coredir=core`/bin/sh -c 'echo $$'`
  1394.   mkdir $coredir
  1395.   cp confdefs.h $coredir/confdefs.h
  1396.   mv conftest.c $coredir/conftest.c
  1397.   mv conftest $coredir/conftest
  1398.   mv core $coredir/core
  1399.   echo "warning: test program dumped core -- see subdirectory $coredir"
  1400. fi
  1401. fi
  1402. rm -fr conftest*
  1403.  
  1404. fi
  1405.  
  1406. echo "$ac_t""$cl_cv_prog_cc_works" 1>&4
  1407. case "$cl_cv_prog_cc_works" in
  1408.   *no) echo "Installation or configuration problem: C compiler cannot create executables."; exit 1;;
  1409.   *yes) ;;
  1410. esac
  1411.  
  1412.                       echo $ac_n "checking for broken HP/UX, A/UX, OSF/1 and NeXTstep shell""... $ac_c" 1>&4
  1413. if eval "test \"`echo '${'cl_cv_prog_sh_broken'+set}'`\" = set"; then
  1414.   echo $ac_n "(cached) $ac_c" 1>&4
  1415. else
  1416.   
  1417. if test $cross_compiling = no; then
  1418. # A program that outputs its argument count:
  1419. cat > conftest.c <<EOF
  1420. #include "confdefs.h"
  1421. #include <stdio.h>
  1422. #ifdef __STDC__
  1423. main (int argc, char** argv)
  1424. #else
  1425. main (argc,argv) int argc; char** argv;
  1426. #endif
  1427. { printf("%d\n",argc); exit(0); }
  1428. EOF
  1429. eval $ac_link
  1430. # How can a shell script forward its arguments to another program?
  1431. #                                    $ * "$ *" "$ @"
  1432. # conftest.sh                         1    2     1 (*)
  1433. # conftest.sh foo                     2    2     2
  1434. # conftest.sh foo bar                 3    2     3
  1435. # conftest.sh "foo bar"               3    2     2
  1436. # (*): 2 with HP-UX /bin/sh. We must use /bin/ksh instead.
  1437. #      2 as well with NeXTstep /bin/sh. No /bin/ksh. Examine 0 first.
  1438. psubs='"$''@"'
  1439. cat > conftest.sh <<EOF
  1440. #!/bin/sh
  1441. exec ./conftest $psubs
  1442. EOF
  1443. chmod a+x conftest.sh
  1444. if test `./conftest.sh` = "1"; then
  1445.   cl_cv_prog_sh_broken=no
  1446.   cl_cv_prog_sh_good='/bin/sh'
  1447. else
  1448.   cl_cv_prog_sh_broken=yes
  1449.   if test -x /bin/ksh; then
  1450.     cl_cv_prog_sh_good='/bin/ksh'
  1451.   else
  1452.     cl_cv_prog_sh_good=''
  1453.   fi
  1454. fi
  1455. else
  1456. cl_cv_prog_sh_broken="guessing no"
  1457. cl_cv_prog_sh_good='/bin/sh'
  1458. fi
  1459. rm -f conftest*
  1460.  
  1461. fi
  1462.  
  1463. echo "$ac_t""$cl_cv_prog_sh_broken" 1>&4
  1464. GOOD_SH="$cl_cv_prog_sh_good"
  1465. if test "$GOOD_SH" = '/bin/ksh'; then
  1466.   cat >> confdefs.h <<\EOF
  1467. #define UNIX_USE_KSH 1
  1468. EOF
  1469.  
  1470. fi
  1471. if test "$GOOD_SH" = ''; then
  1472.   cat >> confdefs.h <<\EOF
  1473. #define UNIX_BROKEN_SH 1
  1474. EOF
  1475.  
  1476. fi
  1477.  
  1478.                       echo $ac_n "checking for working const""... $ac_c" 1>&4
  1479. if eval "test \"`echo '${'ac_cv_c_const'+set}'`\" = set"; then
  1480.   echo $ac_n "(cached) $ac_c" 1>&4
  1481. else
  1482.   cat > conftest.$ac_ext <<EOF
  1483. #line 1484 "configure"
  1484. #include "confdefs.h"
  1485.  
  1486. int main() { return 0; }
  1487. int t() {
  1488.  
  1489. /* Ultrix mips cc rejects this.  */
  1490. typedef int charset[2]; const charset x;
  1491. /* SunOS 4.1.1 cc rejects this.  */
  1492. char const *const *ccp;
  1493. char **p;
  1494. /* NEC SVR4.0.2 mips cc rejects this.  */
  1495. struct point {int x, y;};
  1496. static struct point const zero;
  1497. /* AIX XL C 1.02.0.0 rejects this.
  1498.    It does not let you subtract one const X* pointer from another in an arm
  1499.    of an if-expression whose if-part is not a constant expression */
  1500. const char *g = "string";
  1501. ccp = &g + (g ? g-g : 0);
  1502. /* HPUX 7.0 cc rejects these. */
  1503. ++ccp;
  1504. p = (char**) ccp;
  1505. ccp = (char const *const *) p;
  1506. { /* SCO 3.2v4 cc rejects this.  */
  1507.   char *t;
  1508.   char const *s = 0 ? (char *) 0 : (char const *) 0;
  1509.  
  1510.   *t++ = 0;
  1511. }
  1512. { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
  1513.   int x[] = {25, 17};
  1514.   const int *foo = &x[0];
  1515.   ++foo;
  1516. }
  1517. { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
  1518.   typedef const int *iptr;
  1519.   iptr p = 0;
  1520.   ++p;
  1521. }
  1522. { /* AIX XL C 1.02.0.0 rejects this saying
  1523.      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
  1524.   struct s { int j; const int *ap[3]; };
  1525.   struct s *b; b->j = 5;
  1526. }
  1527. { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
  1528.   const int foo = 10;
  1529. }
  1530.  
  1531. ; return 0; }
  1532. EOF
  1533. if eval $ac_compile; then
  1534.   rm -rf conftest*
  1535.   ac_cv_c_const=yes
  1536. else
  1537.   rm -rf conftest*
  1538.   ac_cv_c_const=no
  1539. fi
  1540. rm -f conftest*
  1541.  
  1542. fi
  1543. echo "$ac_t""$ac_cv_c_const" 1>&4
  1544. if test $ac_cv_c_const = no; then
  1545.   cat >> confdefs.h <<\EOF
  1546. #define const 
  1547. EOF
  1548.  
  1549. fi
  1550.  
  1551.                       echo $ac_n "checking for inline""... $ac_c" 1>&4
  1552. if eval "test \"`echo '${'ac_cv_c_inline'+set}'`\" = set"; then
  1553.   echo $ac_n "(cached) $ac_c" 1>&4
  1554. else
  1555.   if test "$GCC" = yes; then
  1556. cat > conftest.$ac_ext <<EOF
  1557. #line 1558 "configure"
  1558. #include "confdefs.h"
  1559.  
  1560. int main() { return 0; }
  1561. int t() {
  1562. } inline foo() {
  1563. ; return 0; }
  1564. EOF
  1565. if eval $ac_compile; then
  1566.   rm -rf conftest*
  1567.   ac_cv_c_inline=yes
  1568. else
  1569.   rm -rf conftest*
  1570.   ac_cv_c_inline=__inline
  1571. fi
  1572. rm -f conftest*
  1573.  
  1574. else
  1575.   ac_cv_c_inline=no
  1576. fi
  1577. fi
  1578. echo "$ac_t""$ac_cv_c_inline" 1>&4
  1579. if test $ac_cv_c_inline != yes -a $ac_cv_c_inline != no; then
  1580.   cat >> confdefs.h <<EOF
  1581. #define inline $ac_cv_c_inline
  1582. EOF
  1583.  
  1584. fi
  1585.  
  1586.                       
  1587. if test $ac_cv_prog_gcc = yes; then
  1588. echo $ac_n "checking for __nowarn__""... $ac_c" 1>&4
  1589. if eval "test \"`echo '${'cl_cv_c_nowarn'+set}'`\" = set"; then
  1590.   echo $ac_n "(cached) $ac_c" 1>&4
  1591. else
  1592.   
  1593. cat > conftest.$ac_ext <<EOF
  1594. #line 1595 "configure"
  1595. #include "confdefs.h"
  1596. int x;
  1597. int main() { return 0; }
  1598. int t() {
  1599. __nowarn__ x;
  1600. ; return 0; }
  1601. EOF
  1602. if eval $ac_compile; then
  1603.   rm -rf conftest*
  1604.   cl_cv_c_nowarn=yes
  1605. else
  1606.   rm -rf conftest*
  1607.   cl_cv_c_nowarn=no
  1608. fi
  1609. rm -f conftest*
  1610.  
  1611.  
  1612. fi
  1613.  
  1614. echo "$ac_t""$cl_cv_c_nowarn" 1>&4
  1615. if test $cl_cv_c_nowarn = yes; then
  1616.   have_nowarn=1
  1617. fi
  1618.  
  1619. fi
  1620. if test -z "$have_nowarn"; then
  1621. cat >> confdefs.h <<\EOF
  1622. #define __nowarn__ 
  1623. EOF
  1624.  
  1625. fi
  1626.  
  1627.                       echo $ac_n "checking for working void""... $ac_c" 1>&4
  1628. if eval "test \"`echo '${'cl_cv_c_void'+set}'`\" = set"; then
  1629.   echo $ac_n "(cached) $ac_c" 1>&4
  1630. else
  1631.   
  1632. cat > conftest.$ac_ext <<EOF
  1633. #line 1634 "configure"
  1634. #include "confdefs.h"
  1635.  
  1636. int main() { return 0; }
  1637. int t() {
  1638. void f();
  1639. typedef void x; x g();
  1640. typedef void* y; y a;
  1641.  
  1642. ; return 0; }
  1643. EOF
  1644. if eval $ac_compile; then
  1645.   rm -rf conftest*
  1646.   cl_cv_c_void=yes
  1647. else
  1648.   rm -rf conftest*
  1649.   cl_cv_c_void=no
  1650. fi
  1651. rm -f conftest*
  1652.  
  1653.  
  1654. fi
  1655.  
  1656. echo "$ac_t""$cl_cv_c_void" 1>&4
  1657. if test $cl_cv_c_void = yes; then
  1658.   have_void=1
  1659. else
  1660.   cat >> confdefs.h <<\EOF
  1661. #define void char
  1662. EOF
  1663.  
  1664. fi
  1665. if test -n "$have_void"; then
  1666. echo $ac_n "checking for working \"return void\"""... $ac_c" 1>&4
  1667. if eval "test \"`echo '${'cl_cv_c_return_void'+set}'`\" = set"; then
  1668.   echo $ac_n "(cached) $ac_c" 1>&4
  1669. else
  1670.   
  1671. cat > conftest.$ac_ext <<EOF
  1672. #line 1673 "configure"
  1673. #include "confdefs.h"
  1674. void f() {} typedef void x; x g() { return f(); }
  1675. int main() { return 0; }
  1676. int t() {
  1677.  
  1678. ; return 0; }
  1679. EOF
  1680. if eval $ac_compile; then
  1681.   rm -rf conftest*
  1682.   cl_cv_c_return_void=yes
  1683. else
  1684.   rm -rf conftest*
  1685.   cl_cv_c_return_void=no
  1686. fi
  1687. rm -f conftest*
  1688.  
  1689.  
  1690. fi
  1691.  
  1692. echo "$ac_t""$cl_cv_c_return_void" 1>&4
  1693. if test $cl_cv_c_return_void = yes; then
  1694.   cat >> confdefs.h <<\EOF
  1695. #define return_void return
  1696. EOF
  1697.  
  1698. fi
  1699. fi
  1700.  
  1701.                       echo $ac_n "checking for long long type""... $ac_c" 1>&4
  1702. if eval "test \"`echo '${'cl_cv_c_longlong'+set}'`\" = set"; then
  1703.   echo $ac_n "(cached) $ac_c" 1>&4
  1704. else
  1705.   
  1706. if test "$cross_compiling" = yes; then
  1707.   cl_cv_c_longlong="guessing no"
  1708. else
  1709. cat > conftest.$ac_ext <<EOF
  1710. #line 1711 "configure"
  1711. #include "confdefs.h"
  1712. main()
  1713. { long x = 944938507; long y = 737962842; long z = 162359677;
  1714.   exit(!(((long long) x)*((long long) y)>>32 == z)); }
  1715. EOF
  1716. eval $ac_link
  1717. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  1718.   cl_cv_c_longlong=yes
  1719. else
  1720.   cl_cv_c_longlong=no
  1721. fi
  1722. if test -f core; then
  1723.   coredir=core`/bin/sh -c 'echo $$'`
  1724.   mkdir $coredir
  1725.   cp confdefs.h $coredir/confdefs.h
  1726.   mv conftest.c $coredir/conftest.c
  1727.   mv conftest $coredir/conftest
  1728.   mv core $coredir/core
  1729.   echo "warning: test program dumped core -- see subdirectory $coredir"
  1730. fi
  1731. fi
  1732. rm -fr conftest*
  1733.  
  1734. fi
  1735.  
  1736. echo "$ac_t""$cl_cv_c_longlong" 1>&4
  1737. case "$cl_cv_c_longlong" in
  1738.   *yes) cat >> confdefs.h <<\EOF
  1739. #define HAVE_LONGLONG 1
  1740. EOF
  1741.  ;;
  1742.   *no) ;;
  1743. esac
  1744.  
  1745.                       echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&4
  1746. if eval "test \"`echo '${'cl_cv_header_stdc'+set}'`\" = set"; then
  1747.   echo $ac_n "(cached) $ac_c" 1>&4
  1748. else
  1749.   
  1750. cat > conftest.$ac_ext <<EOF
  1751. #line 1752 "configure"
  1752. #include "confdefs.h"
  1753. #include <stdlib.h>
  1754. #include <stdarg.h>
  1755. #include <string.h>
  1756. #include <float.h>
  1757. #include <limits.h>
  1758. EOF
  1759. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1760. ac_err=`grep -v '^ *+' conftest.out`
  1761. if test -z "$ac_err"; then
  1762.   rm -rf conftest*
  1763.   cl_cv_header_stdc=yes
  1764. else
  1765.   echo "$ac_err" >&5
  1766.   rm -rf conftest*
  1767.   cl_cv_header_stdc=no
  1768. fi
  1769. rm -f conftest*
  1770.  
  1771. fi
  1772.  
  1773. echo "$ac_t""$cl_cv_header_stdc" 1>&4
  1774. if test $cl_cv_header_stdc = yes; then
  1775.   cat >> confdefs.h <<\EOF
  1776. #define STDC_HEADERS 1
  1777. EOF
  1778.  
  1779. fi
  1780.  
  1781.  
  1782.                       for ac_hdr in stdlib.h
  1783. do
  1784. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  1785. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  1786. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  1787.   echo $ac_n "(cached) $ac_c" 1>&4
  1788. else
  1789.   cat > conftest.$ac_ext <<EOF
  1790. #line 1791 "configure"
  1791. #include "confdefs.h"
  1792. #include <$ac_hdr>
  1793. EOF
  1794. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1795. ac_err=`grep -v '^ *+' conftest.out`
  1796. if test -z "$ac_err"; then
  1797.   rm -rf conftest*
  1798.   eval "ac_cv_header_$ac_safe=yes"
  1799. else
  1800.   echo "$ac_err" >&5
  1801.   rm -rf conftest*
  1802.   eval "ac_cv_header_$ac_safe=no"
  1803. fi
  1804. rm -f conftest*
  1805. fi
  1806. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  1807.   echo "$ac_t""yes" 1>&4
  1808.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  1809.   cat >> confdefs.h <<EOF
  1810. #define $ac_tr_hdr 1
  1811. EOF
  1812.  
  1813. else
  1814.   echo "$ac_t""no" 1>&4
  1815. fi
  1816. done
  1817.  
  1818.  
  1819.                       for ac_hdr in unistd.h
  1820. do
  1821. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  1822. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  1823. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  1824.   echo $ac_n "(cached) $ac_c" 1>&4
  1825. else
  1826.   cat > conftest.$ac_ext <<EOF
  1827. #line 1828 "configure"
  1828. #include "confdefs.h"
  1829. #include <$ac_hdr>
  1830. EOF
  1831. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1832. ac_err=`grep -v '^ *+' conftest.out`
  1833. if test -z "$ac_err"; then
  1834.   rm -rf conftest*
  1835.   eval "ac_cv_header_$ac_safe=yes"
  1836. else
  1837.   echo "$ac_err" >&5
  1838.   rm -rf conftest*
  1839.   eval "ac_cv_header_$ac_safe=no"
  1840. fi
  1841. rm -f conftest*
  1842. fi
  1843. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  1844.   echo "$ac_t""yes" 1>&4
  1845.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  1846.   cat >> confdefs.h <<EOF
  1847. #define $ac_tr_hdr 1
  1848. EOF
  1849.  
  1850. else
  1851.   echo "$ac_t""no" 1>&4
  1852. fi
  1853. done
  1854.  
  1855.  
  1856.                       
  1857. for ac_hdr in sys/file.h
  1858. do
  1859. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  1860. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  1861. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  1862.   echo $ac_n "(cached) $ac_c" 1>&4
  1863. else
  1864.   cat > conftest.$ac_ext <<EOF
  1865. #line 1866 "configure"
  1866. #include "confdefs.h"
  1867. #include <$ac_hdr>
  1868. EOF
  1869. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  1870. ac_err=`grep -v '^ *+' conftest.out`
  1871. if test -z "$ac_err"; then
  1872.   rm -rf conftest*
  1873.   eval "ac_cv_header_$ac_safe=yes"
  1874. else
  1875.   echo "$ac_err" >&5
  1876.   rm -rf conftest*
  1877.   eval "ac_cv_header_$ac_safe=no"
  1878. fi
  1879. rm -f conftest*
  1880. fi
  1881. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  1882.   echo "$ac_t""yes" 1>&4
  1883.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  1884.   cat >> confdefs.h <<EOF
  1885. #define $ac_tr_hdr 1
  1886. EOF
  1887.  
  1888. else
  1889.   echo "$ac_t""no" 1>&4
  1890. fi
  1891. done
  1892.  
  1893. if test $ac_cv_header_sys_file_h = yes; then
  1894. openflags_decl='#ifdef STDC_HEADERS
  1895. #include <stdlib.h>
  1896. #endif
  1897. #ifdef HAVE_UNISTD_H
  1898. #include <sys/types.h>
  1899. #include <unistd.h>
  1900. #endif
  1901. #include <fcntl.h>
  1902. '
  1903. openflags_prog='int x = O_RDWR | O_RDONLY | O_WRONLY | O_CREAT | O_TRUNC;'
  1904. echo $ac_n "checking for O_RDWR in fcntl.h""... $ac_c" 1>&4
  1905. if eval "test \"`echo '${'cl_cv_decl_O_RDWR_fcntl_h'+set}'`\" = set"; then
  1906.   echo $ac_n "(cached) $ac_c" 1>&4
  1907. else
  1908.   
  1909. cat > conftest.$ac_ext <<EOF
  1910. #line 1911 "configure"
  1911. #include "confdefs.h"
  1912. $openflags_decl
  1913. int main() { return 0; }
  1914. int t() {
  1915. $openflags_prog
  1916. ; return 0; }
  1917. EOF
  1918. if eval $ac_compile; then
  1919.   rm -rf conftest*
  1920.   cl_cv_decl_O_RDWR_fcntl_h=yes
  1921. else
  1922.   rm -rf conftest*
  1923.   cl_cv_decl_O_RDWR_fcntl_h=no
  1924. fi
  1925. rm -f conftest*
  1926.  
  1927.  
  1928. fi
  1929.  
  1930. echo "$ac_t""$cl_cv_decl_O_RDWR_fcntl_h" 1>&4
  1931. if test $cl_cv_decl_O_RDWR_fcntl_h = yes; then
  1932.   openflags_ok=1
  1933. fi
  1934. if test -z "$openflags_ok"; then
  1935. $openflags_decl#include <sys/file.h>, $openflags_prog,
  1936. cat >> confdefs.h <<\EOF
  1937. #define NEED_SYS_FILE_H 1
  1938. EOF
  1939.  
  1940. fi
  1941. fi
  1942.  
  1943.                       ac_header_dirent=no
  1944. for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
  1945.   ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  1946. echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&4
  1947. if eval "test \"`echo '${'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
  1948.   echo $ac_n "(cached) $ac_c" 1>&4
  1949. else
  1950.   cat > conftest.$ac_ext <<EOF
  1951. #line 1952 "configure"
  1952. #include "confdefs.h"
  1953. #include <sys/types.h>
  1954. #include <$ac_hdr>
  1955. int main() { return 0; }
  1956. int t() {
  1957. DIR *dirp = 0;
  1958. ; return 0; }
  1959. EOF
  1960. if eval $ac_compile; then
  1961.   rm -rf conftest*
  1962.   eval "ac_cv_header_dirent_$ac_safe=yes"
  1963. else
  1964.   rm -rf conftest*
  1965.   eval "ac_cv_header_dirent_$ac_safe=no"
  1966. fi
  1967. rm -f conftest*
  1968.  
  1969. fi
  1970. if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
  1971.   echo "$ac_t""yes" 1>&4
  1972.   ac_header_dirent=$ac_hdr; break
  1973. else
  1974.   echo "$ac_t""no" 1>&4
  1975. fi
  1976.  
  1977. done
  1978. case "$ac_header_dirent" in
  1979. dirent.h) cat >> confdefs.h <<\EOF
  1980. #define DIRENT 1
  1981. EOF
  1982.  ;;
  1983. sys/ndir.h) cat >> confdefs.h <<\EOF
  1984. #define SYSNDIR 1
  1985. EOF
  1986.  ;;
  1987. sys/dir.h) cat >> confdefs.h <<\EOF
  1988. #define SYSDIR 1
  1989. EOF
  1990.  ;;
  1991. ndir.h) cat >> confdefs.h <<\EOF
  1992. #define NDIR 1
  1993. EOF
  1994.  ;;
  1995. esac
  1996. # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
  1997. if test $ac_header_dirent = dirent.h; then
  1998. echo $ac_n "checking for -ldir""... $ac_c" 1>&4
  1999. if eval "test \"`echo '${'ac_cv_lib_dir'+set}'`\" = set"; then
  2000.   echo $ac_n "(cached) $ac_c" 1>&4
  2001. else
  2002.   ac_save_LIBS="$LIBS"
  2003. LIBS="$LIBS -ldir "
  2004. cat > conftest.$ac_ext <<EOF
  2005. #line 2006 "configure"
  2006. #include "confdefs.h"
  2007.  
  2008. int main() { return 0; }
  2009. int t() {
  2010. opendir()
  2011. ; return 0; }
  2012. EOF
  2013. if eval $ac_link; then
  2014.   rm -rf conftest*
  2015.   eval "ac_cv_lib_dir=yes"
  2016. else
  2017.   rm -rf conftest*
  2018.   eval "ac_cv_lib_dir=no"
  2019. fi
  2020. rm -f conftest*
  2021. LIBS="$ac_save_LIBS"
  2022.  
  2023. fi
  2024. if eval "test \"`echo '$ac_cv_lib_'dir`\" = yes"; then
  2025.   echo "$ac_t""yes" 1>&4
  2026.   LIBS="$LIBS -ldir"
  2027. else
  2028.   echo "$ac_t""no" 1>&4
  2029. fi
  2030.  
  2031. else
  2032. echo $ac_n "checking for -lx""... $ac_c" 1>&4
  2033. if eval "test \"`echo '${'ac_cv_lib_x'+set}'`\" = set"; then
  2034.   echo $ac_n "(cached) $ac_c" 1>&4
  2035. else
  2036.   ac_save_LIBS="$LIBS"
  2037. LIBS="$LIBS -lx "
  2038. cat > conftest.$ac_ext <<EOF
  2039. #line 2040 "configure"
  2040. #include "confdefs.h"
  2041.  
  2042. int main() { return 0; }
  2043. int t() {
  2044. opendir()
  2045. ; return 0; }
  2046. EOF
  2047. if eval $ac_link; then
  2048.   rm -rf conftest*
  2049.   eval "ac_cv_lib_x=yes"
  2050. else
  2051.   rm -rf conftest*
  2052.   eval "ac_cv_lib_x=no"
  2053. fi
  2054. rm -f conftest*
  2055. LIBS="$ac_save_LIBS"
  2056.  
  2057. fi
  2058. if eval "test \"`echo '$ac_cv_lib_'x`\" = yes"; then
  2059.   echo "$ac_t""yes" 1>&4
  2060.   LIBS="$LIBS -lx"
  2061. else
  2062.   echo "$ac_t""no" 1>&4
  2063. fi
  2064.  
  2065. fi
  2066. echo $ac_n "checking for closedir return value""... $ac_c" 1>&4
  2067. if eval "test \"`echo '${'ac_cv_func_closedir_void'+set}'`\" = set"; then
  2068.   echo $ac_n "(cached) $ac_c" 1>&4
  2069. else
  2070.   
  2071. if test "$cross_compiling" = yes; then
  2072.   # When cross-compiling, don't assume a return value.
  2073. ac_cv_func_closedir_void=yes
  2074. echo $ac_n "guessing $ac_c" 1>&4
  2075. else
  2076. cat > conftest.$ac_ext <<EOF
  2077. #line 2078 "configure"
  2078. #include "confdefs.h"
  2079. #include <sys/types.h>
  2080. #include <$ac_header_dirent>
  2081. int closedir(); main() { exit(closedir(opendir(".")) != 0); }
  2082. EOF
  2083. eval $ac_link
  2084. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  2085.   ac_cv_func_closedir_void=no
  2086. else
  2087.   ac_cv_func_closedir_void=yes
  2088. fi
  2089. if test -f core; then
  2090.   coredir=core`/bin/sh -c 'echo $$'`
  2091.   mkdir $coredir
  2092.   cp confdefs.h $coredir/confdefs.h
  2093.   mv conftest.c $coredir/conftest.c
  2094.   mv conftest $coredir/conftest
  2095.   mv core $coredir/core
  2096.   echo "warning: test program dumped core -- see subdirectory $coredir"
  2097. fi
  2098. fi
  2099. rm -fr conftest*
  2100. fi
  2101. if test $ac_cv_func_closedir_void = yes; then
  2102.   echo "$ac_t""void" 1>&4
  2103.   cat >> confdefs.h <<\EOF
  2104. #define VOID_CLOSEDIR 1
  2105. EOF
  2106.  
  2107. else
  2108.   echo "$ac_t""int" 1>&4
  2109. fi
  2110.  
  2111.                       echo $ac_n "checking for sys/utsname.h and struct utsname""... $ac_c" 1>&4
  2112. if eval "test \"`echo '${'cl_cv_struct_utsname'+set}'`\" = set"; then
  2113.   echo $ac_n "(cached) $ac_c" 1>&4
  2114. else
  2115.   
  2116. cat > conftest.$ac_ext <<EOF
  2117. #line 2118 "configure"
  2118. #include "confdefs.h"
  2119. #include <sys/utsname.h>
  2120. int main() { return 0; }
  2121. int t() {
  2122. struct utsname u;
  2123. ; return 0; }
  2124. EOF
  2125. if eval $ac_compile; then
  2126.   rm -rf conftest*
  2127.   cl_cv_struct_utsname=yes
  2128. else
  2129.   rm -rf conftest*
  2130.   cl_cv_struct_utsname=no
  2131. fi
  2132. rm -f conftest*
  2133.  
  2134.  
  2135. fi
  2136.  
  2137. echo "$ac_t""$cl_cv_struct_utsname" 1>&4
  2138. if test $cl_cv_struct_utsname = yes; then
  2139.   cat >> confdefs.h <<\EOF
  2140. #define HAVE_SYS_UTSNAME_H 1
  2141. EOF
  2142.  
  2143. fi
  2144.  
  2145.                       
  2146. for ac_hdr in netdb.h
  2147. do
  2148. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  2149. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  2150. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2151.   echo $ac_n "(cached) $ac_c" 1>&4
  2152. else
  2153.   cat > conftest.$ac_ext <<EOF
  2154. #line 2155 "configure"
  2155. #include "confdefs.h"
  2156. #include <$ac_hdr>
  2157. EOF
  2158. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2159. ac_err=`grep -v '^ *+' conftest.out`
  2160. if test -z "$ac_err"; then
  2161.   rm -rf conftest*
  2162.   eval "ac_cv_header_$ac_safe=yes"
  2163. else
  2164.   echo "$ac_err" >&5
  2165.   rm -rf conftest*
  2166.   eval "ac_cv_header_$ac_safe=no"
  2167. fi
  2168. rm -f conftest*
  2169. fi
  2170. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2171.   echo "$ac_t""yes" 1>&4
  2172.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  2173.   cat >> confdefs.h <<EOF
  2174. #define $ac_tr_hdr 1
  2175. EOF
  2176.  
  2177. else
  2178.   echo "$ac_t""no" 1>&4
  2179. fi
  2180. done
  2181.  
  2182.  
  2183.                       for ac_hdr in sys/shm.h
  2184. do
  2185. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  2186. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  2187. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2188.   echo $ac_n "(cached) $ac_c" 1>&4
  2189. else
  2190.   cat > conftest.$ac_ext <<EOF
  2191. #line 2192 "configure"
  2192. #include "confdefs.h"
  2193. #include <$ac_hdr>
  2194. EOF
  2195. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2196. ac_err=`grep -v '^ *+' conftest.out`
  2197. if test -z "$ac_err"; then
  2198.   rm -rf conftest*
  2199.   eval "ac_cv_header_$ac_safe=yes"
  2200. else
  2201.   echo "$ac_err" >&5
  2202.   rm -rf conftest*
  2203.   eval "ac_cv_header_$ac_safe=no"
  2204. fi
  2205. rm -f conftest*
  2206. fi
  2207. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2208.   echo "$ac_t""yes" 1>&4
  2209.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  2210.   cat >> confdefs.h <<EOF
  2211. #define $ac_tr_hdr 1
  2212. EOF
  2213.  
  2214. else
  2215.   echo "$ac_t""no" 1>&4
  2216. fi
  2217. done
  2218.  
  2219. if test $ac_cv_header_sys_shm_h = yes; then
  2220. for ac_hdr in sys/ipc.h
  2221. do
  2222. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  2223. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  2224. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2225.   echo $ac_n "(cached) $ac_c" 1>&4
  2226. else
  2227.   cat > conftest.$ac_ext <<EOF
  2228. #line 2229 "configure"
  2229. #include "confdefs.h"
  2230. #include <$ac_hdr>
  2231. EOF
  2232. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2233. ac_err=`grep -v '^ *+' conftest.out`
  2234. if test -z "$ac_err"; then
  2235.   rm -rf conftest*
  2236.   eval "ac_cv_header_$ac_safe=yes"
  2237. else
  2238.   echo "$ac_err" >&5
  2239.   rm -rf conftest*
  2240.   eval "ac_cv_header_$ac_safe=no"
  2241. fi
  2242. rm -f conftest*
  2243. fi
  2244. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2245.   echo "$ac_t""yes" 1>&4
  2246.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  2247.   cat >> confdefs.h <<EOF
  2248. #define $ac_tr_hdr 1
  2249. EOF
  2250.  
  2251. else
  2252.   echo "$ac_t""no" 1>&4
  2253. fi
  2254. done
  2255.  
  2256. if test $ac_cv_header_sys_ipc_h = yes; then
  2257. # This test is from Marcus Daniels
  2258. echo $ac_n "checking for working shared memory""... $ac_c" 1>&4
  2259. if eval "test \"`echo '${'cl_cv_sys_shm_works'+set}'`\" = set"; then
  2260.   echo $ac_n "(cached) $ac_c" 1>&4
  2261. else
  2262.   
  2263. if test "$cross_compiling" = yes; then
  2264.   cl_cv_sys_shm_works="guessing no"
  2265. else
  2266. cat > conftest.$ac_ext <<EOF
  2267. #line 2268 "configure"
  2268. #include "confdefs.h"
  2269. #include <sys/types.h>
  2270. #include <sys/ipc.h>
  2271. #include <sys/shm.h>
  2272. /* try attaching a single segment to multiple addresses */
  2273. #define segsize 0x10000
  2274. #define attaches 128
  2275. #define base_addr 0x01000000
  2276. main ()
  2277. { int shmid, i; char* addr; char* result;
  2278.   if ((shmid = shmget(IPC_PRIVATE,segsize,0400)) < 0) exit(1);
  2279.   for (i=0, addr = (char*)0x01000000; i<attaches; i++, addr += segsize)
  2280.     { if ((result = shmat(shmid,addr,SHM_RDONLY)) == (char*)(-1)) break; }
  2281.   for (i=0, addr = (char*)0x01000000; i<attaches; i++, addr += segsize)
  2282.     shmdt(addr);
  2283.   shmctl(shmid,IPC_RMID,0);
  2284.   exit(result == (char*)(-1));
  2285. }
  2286. EOF
  2287. eval $ac_link
  2288. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  2289.   cl_cv_sys_shm_works=yes
  2290. else
  2291.   cl_cv_sys_shm_works=no
  2292. fi
  2293. if test -f core; then
  2294.   coredir=core`/bin/sh -c 'echo $$'`
  2295.   mkdir $coredir
  2296.   cp confdefs.h $coredir/confdefs.h
  2297.   mv conftest.c $coredir/conftest.c
  2298.   mv conftest $coredir/conftest
  2299.   mv core $coredir/core
  2300.   echo "warning: test program dumped core -- see subdirectory $coredir"
  2301. fi
  2302. fi
  2303. rm -fr conftest*
  2304.  
  2305. fi
  2306.  
  2307. echo "$ac_t""$cl_cv_sys_shm_works" 1>&4
  2308. fi
  2309. fi
  2310. case "$cl_cv_sys_shm_works" in
  2311.   *yes) have_shm=1
  2312.         cat >> confdefs.h <<\EOF
  2313. #define HAVE_SHM 1
  2314. EOF
  2315.  
  2316.         for ac_hdr in sys/sysmacros.h
  2317. do
  2318. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  2319. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  2320. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2321.   echo $ac_n "(cached) $ac_c" 1>&4
  2322. else
  2323.   cat > conftest.$ac_ext <<EOF
  2324. #line 2325 "configure"
  2325. #include "confdefs.h"
  2326. #include <$ac_hdr>
  2327. EOF
  2328. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2329. ac_err=`grep -v '^ *+' conftest.out`
  2330. if test -z "$ac_err"; then
  2331.   rm -rf conftest*
  2332.   eval "ac_cv_header_$ac_safe=yes"
  2333. else
  2334.   echo "$ac_err" >&5
  2335.   rm -rf conftest*
  2336.   eval "ac_cv_header_$ac_safe=no"
  2337. fi
  2338. rm -f conftest*
  2339. fi
  2340. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2341.   echo "$ac_t""yes" 1>&4
  2342.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  2343.   cat >> confdefs.h <<EOF
  2344. #define $ac_tr_hdr 1
  2345. EOF
  2346.  
  2347. else
  2348.   echo "$ac_t""no" 1>&4
  2349. fi
  2350. done
  2351.  
  2352.         ;;
  2353.   *) ;;
  2354. esac
  2355.  
  2356.                       
  2357. for ac_hdr in termios.h termio.h sys/termio.h sgtty.h
  2358. do
  2359. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  2360. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  2361. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  2362.   echo $ac_n "(cached) $ac_c" 1>&4
  2363. else
  2364.   cat > conftest.$ac_ext <<EOF
  2365. #line 2366 "configure"
  2366. #include "confdefs.h"
  2367. #include <$ac_hdr>
  2368. EOF
  2369. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2370. ac_err=`grep -v '^ *+' conftest.out`
  2371. if test -z "$ac_err"; then
  2372.   rm -rf conftest*
  2373.   eval "ac_cv_header_$ac_safe=yes"
  2374. else
  2375.   echo "$ac_err" >&5
  2376.   rm -rf conftest*
  2377.   eval "ac_cv_header_$ac_safe=no"
  2378. fi
  2379. rm -f conftest*
  2380. fi
  2381. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  2382.   echo "$ac_t""yes" 1>&4
  2383.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  2384.   cat >> confdefs.h <<EOF
  2385. #define $ac_tr_hdr 1
  2386. EOF
  2387.  
  2388. else
  2389.   echo "$ac_t""no" 1>&4
  2390. fi
  2391. done
  2392. if test $ac_cv_header_termios_h = yes; then
  2393. echo $ac_n "checking for tcgetattr""... $ac_c" 1>&4
  2394. if eval "test \"`echo '${'cl_cv_func_tcgetattr'+set}'`\" = set"; then
  2395.   echo $ac_n "(cached) $ac_c" 1>&4
  2396. else
  2397.   
  2398. cat > conftest.$ac_ext <<EOF
  2399. #line 2400 "configure"
  2400. #include "confdefs.h"
  2401. #include <termios.h>
  2402. int main() { return 0; }
  2403. int t() {
  2404. struct termios t; tcgetattr(0,&t);
  2405. ; return 0; }
  2406. EOF
  2407. if eval $ac_link; then
  2408.   rm -rf conftest*
  2409.   cl_cv_func_tcgetattr=yes
  2410. else
  2411.   rm -rf conftest*
  2412.   cl_cv_func_tcgetattr=no
  2413. fi
  2414. rm -f conftest*
  2415.  
  2416.  
  2417. fi
  2418.  
  2419. echo "$ac_t""$cl_cv_func_tcgetattr" 1>&4
  2420. if test $cl_cv_func_tcgetattr = yes; then
  2421.   cat >> confdefs.h <<\EOF
  2422. #define HAVE_TCGETATTR 1
  2423. EOF
  2424.  
  2425. fi
  2426. echo $ac_n "checking for TCSAFLUSH in termios.h""... $ac_c" 1>&4
  2427. if eval "test \"`echo '${'cl_cv_decl_TCSAFLUSH'+set}'`\" = set"; then
  2428.   echo $ac_n "(cached) $ac_c" 1>&4
  2429. else
  2430.   
  2431. cat > conftest.$ac_ext <<EOF
  2432. #line 2433 "configure"
  2433. #include "confdefs.h"
  2434. #include <termios.h>
  2435. int main() { return 0; }
  2436. int t() {
  2437. int x = TCSAFLUSH;
  2438. ; return 0; }
  2439. EOF
  2440. if eval $ac_link; then
  2441.   rm -rf conftest*
  2442.   cl_cv_decl_TCSAFLUSH=yes
  2443. else
  2444.   rm -rf conftest*
  2445.   cl_cv_decl_TCSAFLUSH=no
  2446. fi
  2447. rm -f conftest*
  2448.  
  2449.  
  2450. fi
  2451.  
  2452. echo "$ac_t""$cl_cv_decl_TCSAFLUSH" 1>&4
  2453. if test $cl_cv_decl_TCSAFLUSH = yes; then
  2454.   cat >> confdefs.h <<\EOF
  2455. #define HAVE_TCSAFLUSH 1
  2456. EOF
  2457.  
  2458. fi
  2459. fi
  2460.  
  2461.                       echo checking for X11
  2462. X_INCLUDES=''
  2463. X_LIBS=''
  2464. # Extract the first word of "xmkmf", so it can be a program name with args.
  2465. set dummy xmkmf; ac_word=$2
  2466. echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
  2467. if eval "test \"`echo '${'ac_cv_prog_HAVE_XMKMF'+set}'`\" = set"; then
  2468.   echo $ac_n "(cached) $ac_c" 1>&4
  2469. else
  2470.   if test -n "$HAVE_XMKMF"; then
  2471.   ac_cv_prog_HAVE_XMKMF="$HAVE_XMKMF" # Let the user override the test.
  2472. else
  2473.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  2474.   for ac_dir in $PATH; do
  2475.     test -z "$ac_dir" && ac_dir=.
  2476.     if test -f $ac_dir/$ac_word; then
  2477.       ac_cv_prog_HAVE_XMKMF="yes"
  2478.       break
  2479.     fi
  2480.   done
  2481.   IFS="$ac_save_ifs"
  2482. fi
  2483. fi
  2484. HAVE_XMKMF="$ac_cv_prog_HAVE_XMKMF"
  2485. if test -n "$HAVE_XMKMF"; then
  2486.   echo "$ac_t""$HAVE_XMKMF" 1>&4
  2487. else
  2488.   echo "$ac_t""no" 1>&4
  2489. fi
  2490. if test "$HAVE_XMKMF" = yes; then
  2491.   have_x11=1
  2492.   cat >> confdefs.h <<\EOF
  2493. #define HAVE_X11 1
  2494. EOF
  2495.  
  2496.   X_LIBS='-lX11'
  2497.   # If we find X, set shell vars x_includes and x_libraries to the
  2498. # paths, otherwise set no_x=yes.
  2499. # Uses ac_ vars as temps to allow command line to override cache and checks.
  2500. # --without-x overrides everything else, but does not touch the cache.
  2501. echo $ac_n "checking for X""... $ac_c" 1>&4
  2502.  
  2503. # Check whether --with-x or --without-x was given.
  2504. withval="$with_x"
  2505. if test -n "$withval"; then
  2506.   :
  2507. fi
  2508.  
  2509. if test "x$with_x" = xno; then
  2510.   no_x=yes
  2511. else
  2512.   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
  2513.     no_x=
  2514.   else
  2515. if eval "test \"`echo '${'ac_cv_path_x'+set}'`\" = set"; then
  2516.   echo $ac_n "(cached) $ac_c" 1>&4
  2517. else
  2518.   # One or both of the vars are not set, and there is no cached value.
  2519. no_x=yes
  2520. rm -fr conftestdir
  2521. if mkdir conftestdir; then
  2522.   cd conftestdir
  2523.   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
  2524.   cat > Imakefile <<'EOF'
  2525. acfindx:
  2526.     @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
  2527. EOF
  2528.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  2529.     no_x=
  2530.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  2531.     eval `make acfindx 2>/dev/null | grep -v make`
  2532.     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
  2533.     if test ! -f $ac_im_usrlibdir/libX11.a && test -f $ac_im_libdir/libX11.a
  2534.     then
  2535.       ac_im_usrlibdir=$ac_im_libdir
  2536.     fi
  2537.     case "$ac_im_incroot" in
  2538.     /usr/include) ;;
  2539.     *) ac_x_includes="$ac_im_incroot" ;;
  2540.     esac
  2541.     case "$ac_im_usrlibdir" in
  2542.     /usr/lib | /lib) ;;
  2543.     *) ac_x_libraries="$ac_im_usrlibdir" ;;
  2544.     esac
  2545.   fi
  2546.   cd ..
  2547.   rm -fr conftestdir
  2548. fi
  2549.  
  2550. if test "$no_x" = yes; then
  2551. test -z "$x_direct_test_library" && x_direct_test_library=Xt
  2552. test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
  2553. test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
  2554. cat > conftest.$ac_ext <<EOF
  2555. #line 2556 "configure"
  2556. #include "confdefs.h"
  2557. #include <$x_direct_test_include>
  2558. EOF
  2559. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2560. ac_err=`grep -v '^ *+' conftest.out`
  2561. if test -z "$ac_err"; then
  2562.   rm -rf conftest*
  2563.   no_x= ac_x_includes=
  2564. else
  2565.   echo "$ac_err" >&5
  2566.   rm -rf conftest*
  2567.     for ac_dir in               \
  2568.     /usr/X11R6/include        \
  2569.     /usr/X11R5/include        \
  2570.     /usr/X11R4/include        \
  2571.                               \
  2572.     /usr/include/X11R6        \
  2573.     /usr/include/X11R5        \
  2574.     /usr/include/X11R4        \
  2575.                               \
  2576.     /usr/local/X11R6/include  \
  2577.     /usr/local/X11R5/include  \
  2578.     /usr/local/X11R4/include  \
  2579.                               \
  2580.     /usr/local/include/X11R6  \
  2581.     /usr/local/include/X11R5  \
  2582.     /usr/local/include/X11R4  \
  2583.                               \
  2584.     /usr/X11/include          \
  2585.     /usr/include/X11          \
  2586.     /usr/local/X11/include    \
  2587.     /usr/local/include/X11    \
  2588.                               \
  2589.     /usr/X386/include         \
  2590.     /usr/x386/include         \
  2591.     /usr/XFree86/include/X11  \
  2592.                               \
  2593.     /usr/include              \
  2594.     /usr/local/include        \
  2595.     /usr/unsupported/include  \
  2596.     /usr/athena/include       \
  2597.     /usr/local/x11r5/include  \
  2598.     /usr/lpp/Xamples/include  \
  2599.                               \
  2600.     /usr/openwin/include      \
  2601.     /usr/openwin/share/include \
  2602.     ; \
  2603.   do
  2604.     if test -r "$ac_dir/$x_direct_test_include"; then
  2605.       no_x= ac_x_includes=$ac_dir
  2606.       break
  2607.     fi
  2608.   done
  2609. fi
  2610. rm -f conftest*
  2611.  
  2612. # Check for the libraries.
  2613. # See if we find them without any special options.
  2614. # Don't add to $LIBS permanently.
  2615. ac_save_LIBS="$LIBS"
  2616. LIBS="$LIBS -l$x_direct_test_library"
  2617. cat > conftest.$ac_ext <<EOF
  2618. #line 2619 "configure"
  2619. #include "confdefs.h"
  2620.  
  2621. int main() { return 0; }
  2622. int t() {
  2623. ${x_direct_test_function}()
  2624. ; return 0; }
  2625. EOF
  2626. if eval $ac_link; then
  2627.   rm -rf conftest*
  2628.   LIBS="$ac_save_LIBS" no_x= ac_x_libraries=
  2629. else
  2630.   rm -rf conftest*
  2631.   LIBS="$ac_save_LIBS"
  2632. # First see if replacing the include by lib works.
  2633. for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
  2634.     /usr/X11R6/lib        \
  2635.     /usr/X11R5/lib        \
  2636.     /usr/X11R4/lib        \
  2637.                           \
  2638.     /usr/lib/X11R6        \
  2639.     /usr/lib/X11R5        \
  2640.     /usr/lib/X11R4        \
  2641.                           \
  2642.     /usr/local/X11R6/lib  \
  2643.     /usr/local/X11R5/lib  \
  2644.     /usr/local/X11R4/lib  \
  2645.                           \
  2646.     /usr/local/lib/X11R6  \
  2647.     /usr/local/lib/X11R5  \
  2648.     /usr/local/lib/X11R4  \
  2649.                           \
  2650.     /usr/X11/lib          \
  2651.     /usr/lib/X11          \
  2652.     /usr/local/X11/lib    \
  2653.     /usr/local/lib/X11    \
  2654.                           \
  2655.     /usr/X386/lib         \
  2656.     /usr/x386/lib         \
  2657.     /usr/XFree86/lib/X11  \
  2658.                           \
  2659.     /usr/lib              \
  2660.     /usr/local/lib        \
  2661.     /usr/unsupported/lib  \
  2662.     /usr/athena/lib       \
  2663.     /usr/local/x11r5/lib  \
  2664.     /usr/lpp/Xamples/lib  \
  2665.                           \
  2666.     /usr/openwin/lib      \
  2667.     /usr/openwin/share/lib \
  2668.     ; \
  2669. do
  2670.   for ac_extension in a so sl; do
  2671.     if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
  2672.       no_x= ac_x_libraries=$ac_dir
  2673.       break 2
  2674.     fi
  2675.   done
  2676. done
  2677. fi
  2678. rm -f conftest*
  2679.  
  2680. fi
  2681. if test "$no_x" = yes; then
  2682.   ac_cv_path_x="no_x=yes"
  2683. else
  2684.   ac_cv_path_x="no_x= ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
  2685. fi
  2686. fi
  2687.   fi
  2688.   eval "$ac_cv_path_x"
  2689. fi # $with_x != no
  2690.  
  2691. if test "$no_x" = yes; then
  2692.   echo "$ac_t""no" 1>&4
  2693. else
  2694.   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
  2695.   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
  2696.   ac_cv_path_x="no_x= ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
  2697.   echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&4
  2698. fi
  2699.   if test -n "$x_includes" -a "$x_includes" != NONE; then
  2700.     # Adding -I/usr/include may override gcc's private include hierarchy.
  2701.     if test "$x_includes" != "/usr/include"; then
  2702.       X_INCLUDES="-I$x_includes"
  2703.     fi
  2704.   fi
  2705.   if test -n "$x_libraries" -a "$x_libraries" != NONE; then
  2706.     X_LIBS="-L$x_libraries "$X_LIBS
  2707.   fi
  2708. else
  2709.       echo $ac_n "checking for X11 header files""... $ac_c" 1>&4
  2710.   cat > conftest.$ac_ext <<EOF
  2711. #line 2712 "configure"
  2712. #include "confdefs.h"
  2713. #include <X11/Intrinsic.h>
  2714. EOF
  2715. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2716. ac_err=`grep -v '^ *+' conftest.out`
  2717. if test -z "$ac_err"; then
  2718.   rm -rf conftest*
  2719.   have_x_includes=1
  2720. else
  2721.   echo "$ac_err" >&5
  2722. fi
  2723. rm -f conftest*
  2724.   if test -z "$have_x_includes"; then
  2725.     for dir in /usr/X11/include /usr/openwin/include /usr/include/X11R5 /usr/X11R5/include /usr/include/X11R4 /usr/X386/include /usr/x386/include /usr/local/include /usr/unsupported/include; do
  2726.       if test -z "$have_x_includes"; then
  2727.         if test -r $dir/X11/Intrinsic.h; then
  2728.           x_includes="$dir"
  2729.           have_x_includes=1
  2730.         fi
  2731.       fi
  2732.     done
  2733.   fi
  2734.   if test -n "$x_includes" -a "$x_includes" != NONE; then
  2735.     X_INCLUDES="-I$x_includes"
  2736.   fi
  2737.   echo "$ac_t""$X_INCLUDES" 1>&4
  2738.   echo $ac_n "checking for X11 library""... $ac_c" 1>&4
  2739.   
  2740.   :
  2741. if eval "test \"`echo '${'ac_cv_lib_X11'+set}'`\" = set"; then
  2742.   echo $ac_n "(cached) $ac_c" 1>&4
  2743. else
  2744.   ac_save_LIBS="$LIBS"
  2745. LIBS="$LIBS -lX11 "
  2746. cat > conftest.$ac_ext <<EOF
  2747. #line 2748 "configure"
  2748. #include "confdefs.h"
  2749.  
  2750. int main() { return 0; }
  2751. int t() {
  2752. main()
  2753. ; return 0; }
  2754. EOF
  2755. if eval $ac_link; then
  2756.   rm -rf conftest*
  2757.   eval "ac_cv_lib_X11=yes"
  2758. else
  2759.   rm -rf conftest*
  2760.   eval "ac_cv_lib_X11=no"
  2761. fi
  2762. rm -f conftest*
  2763. LIBS="$ac_save_LIBS"
  2764.  
  2765. fi
  2766. if eval "test \"`echo '$ac_cv_lib_'X11`\" = yes"; then
  2767.   :
  2768.   have_x_libraries=1
  2769. else
  2770.   :
  2771. fi
  2772.   if test -z "$have_x_libraries"; then
  2773.     for dir in /usr/X11/lib /usr/openwin/lib /usr/lib/X11R5 /usr/X11R5/lib /usr/lib/X11R4 /usr/X386/lib /usr/x386/lib /usr/local/lib /usr/unsupported/lib; do
  2774.       if test -z "$have_x_libraries"; then
  2775.         if test -r $dir/libX11.a; then
  2776.           x_libraries="$dir"
  2777.           have_x_libraries=1
  2778.         fi
  2779.       fi
  2780.     done
  2781.   fi
  2782.   if test -n "$have_x_libraries"; then
  2783.     X_LIBS='-lX11'
  2784.     if test -n "$x_libraries" -a "$x_libraries" != NONE; then
  2785.       X_LIBS="-L$x_libraries "$X_LIBS
  2786.     fi
  2787.   else
  2788.     :
  2789. if eval "test \"`echo '${'ac_cv_lib_Xwindow'+set}'`\" = set"; then
  2790.   echo $ac_n "(cached) $ac_c" 1>&4
  2791. else
  2792.   ac_save_LIBS="$LIBS"
  2793. LIBS="$LIBS -lXwindow "
  2794. cat > conftest.$ac_ext <<EOF
  2795. #line 2796 "configure"
  2796. #include "confdefs.h"
  2797.  
  2798. int main() { return 0; }
  2799. int t() {
  2800. main()
  2801. ; return 0; }
  2802. EOF
  2803. if eval $ac_link; then
  2804.   rm -rf conftest*
  2805.   eval "ac_cv_lib_Xwindow=yes"
  2806. else
  2807.   rm -rf conftest*
  2808.   eval "ac_cv_lib_Xwindow=no"
  2809. fi
  2810. rm -f conftest*
  2811. LIBS="$ac_save_LIBS"
  2812.  
  2813. fi
  2814. if eval "test \"`echo '$ac_cv_lib_'Xwindow`\" = yes"; then
  2815.   :
  2816.   X_LIBS='-lXwindow' have_x_libraries=1
  2817. else
  2818.   :
  2819. fi
  2820.   fi
  2821.   
  2822.   echo "$ac_t""$X_LIBS" 1>&4
  2823.     if test -n "$have_x_includes" -a -n "$have_x_libraries"; then
  2824.     have_x11=1
  2825.     cat >> confdefs.h <<\EOF
  2826. #define HAVE_X11 1
  2827. EOF
  2828.  
  2829.   else
  2830.     X_INCLUDES=''
  2831.     X_LIBS=''
  2832.   fi
  2833. fi
  2834.  
  2835.                       echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&4
  2836. if eval "test \"`echo '${'ac_cv_header_stdc'+set}'`\" = set"; then
  2837.   echo $ac_n "(cached) $ac_c" 1>&4
  2838. else
  2839.   cat > conftest.$ac_ext <<EOF
  2840. #line 2841 "configure"
  2841. #include "confdefs.h"
  2842. #include <stdlib.h>
  2843. #include <stdarg.h>
  2844. #include <string.h>
  2845. #include <float.h>
  2846. EOF
  2847. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  2848. ac_err=`grep -v '^ *+' conftest.out`
  2849. if test -z "$ac_err"; then
  2850.   rm -rf conftest*
  2851.   ac_cv_header_stdc=yes
  2852. else
  2853.   echo "$ac_err" >&5
  2854.   rm -rf conftest*
  2855.   ac_cv_header_stdc=no
  2856. fi
  2857. rm -f conftest*
  2858.  
  2859. if test $ac_cv_header_stdc = yes; then
  2860.   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
  2861. cat > conftest.$ac_ext <<EOF
  2862. #line 2863 "configure"
  2863. #include "confdefs.h"
  2864. #include <string.h>
  2865. EOF
  2866. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  2867.   egrep "memchr" >/dev/null 2>&1; then
  2868.   :
  2869. else
  2870.   rm -rf conftest*
  2871.   ac_cv_header_stdc=no
  2872. fi
  2873. rm -f conftest*
  2874.  
  2875. fi
  2876.  
  2877. if test $ac_cv_header_stdc = yes; then
  2878.   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
  2879. cat > conftest.$ac_ext <<EOF
  2880. #line 2881 "configure"
  2881. #include "confdefs.h"
  2882. #include <stdlib.h>
  2883. EOF
  2884. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  2885.   egrep "free" >/dev/null 2>&1; then
  2886.   :
  2887. else
  2888.   rm -rf conftest*
  2889.   ac_cv_header_stdc=no
  2890. fi
  2891. rm -f conftest*
  2892.  
  2893. fi
  2894.  
  2895. if test $ac_cv_header_stdc = yes; then
  2896.   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
  2897. if test "$cross_compiling" = yes; then
  2898.   ac_cv_header_stdc=no
  2899. else
  2900. cat > conftest.$ac_ext <<EOF
  2901. #line 2902 "configure"
  2902. #include "confdefs.h"
  2903. #include <ctype.h>
  2904. #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
  2905. #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
  2906. #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
  2907. int main () { int i; for (i = 0; i < 256; i++)
  2908. if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
  2909. exit (0); }
  2910.  
  2911. EOF
  2912. eval $ac_link
  2913. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  2914.   :
  2915. else
  2916.   ac_cv_header_stdc=no
  2917. fi
  2918. if test -f core; then
  2919.   coredir=core`/bin/sh -c 'echo $$'`
  2920.   mkdir $coredir
  2921.   cp confdefs.h $coredir/confdefs.h
  2922.   mv conftest.c $coredir/conftest.c
  2923.   mv conftest $coredir/conftest
  2924.   mv core $coredir/core
  2925.   echo "warning: test program dumped core -- see subdirectory $coredir"
  2926. fi
  2927. fi
  2928. rm -fr conftest*
  2929. fi
  2930. fi
  2931. echo "$ac_t""$ac_cv_header_stdc" 1>&4
  2932. if test $ac_cv_header_stdc = yes; then
  2933.   cat >> confdefs.h <<\EOF
  2934. #define STDC_HEADERS 1
  2935. EOF
  2936.  
  2937. fi
  2938.  
  2939. echo $ac_n "checking for size_t""... $ac_c" 1>&4
  2940. if eval "test \"`echo '${'ac_cv_type_size_t'+set}'`\" = set"; then
  2941.   echo $ac_n "(cached) $ac_c" 1>&4
  2942. else
  2943.   cat > conftest.$ac_ext <<EOF
  2944. #line 2945 "configure"
  2945. #include "confdefs.h"
  2946. #include <sys/types.h>
  2947. #ifdef STDC_HEADERS
  2948. #include <stdlib.h>
  2949. #endif
  2950. EOF
  2951. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  2952.   egrep "size_t" >/dev/null 2>&1; then
  2953.   rm -rf conftest*
  2954.   ac_cv_type_size_t=yes
  2955. else
  2956.   rm -rf conftest*
  2957.   ac_cv_type_size_t=no
  2958. fi
  2959. rm -f conftest*
  2960.  
  2961. fi
  2962. echo "$ac_t""$ac_cv_type_size_t" 1>&4
  2963. if test $ac_cv_type_size_t = no; then
  2964.   cat >> confdefs.h <<\EOF
  2965. #define size_t unsigned
  2966. EOF
  2967.  
  2968. fi
  2969.  
  2970.                       echo $ac_n "checking for pid_t""... $ac_c" 1>&4
  2971. if eval "test \"`echo '${'ac_cv_type_pid_t'+set}'`\" = set"; then
  2972.   echo $ac_n "(cached) $ac_c" 1>&4
  2973. else
  2974.   cat > conftest.$ac_ext <<EOF
  2975. #line 2976 "configure"
  2976. #include "confdefs.h"
  2977. #include <sys/types.h>
  2978. #ifdef STDC_HEADERS
  2979. #include <stdlib.h>
  2980. #endif
  2981. EOF
  2982. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  2983.   egrep "pid_t" >/dev/null 2>&1; then
  2984.   rm -rf conftest*
  2985.   ac_cv_type_pid_t=yes
  2986. else
  2987.   rm -rf conftest*
  2988.   ac_cv_type_pid_t=no
  2989. fi
  2990. rm -f conftest*
  2991.  
  2992. fi
  2993. echo "$ac_t""$ac_cv_type_pid_t" 1>&4
  2994. if test $ac_cv_type_pid_t = no; then
  2995.   cat >> confdefs.h <<\EOF
  2996. #define pid_t int
  2997. EOF
  2998.  
  2999. fi
  3000.  
  3001.                       echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&4
  3002. if eval "test \"`echo '${'ac_cv_type_uid_t'+set}'`\" = set"; then
  3003.   echo $ac_n "(cached) $ac_c" 1>&4
  3004. else
  3005.   cat > conftest.$ac_ext <<EOF
  3006. #line 3007 "configure"
  3007. #include "confdefs.h"
  3008. #include <sys/types.h>
  3009. EOF
  3010. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3011.   egrep "uid_t" >/dev/null 2>&1; then
  3012.   rm -rf conftest*
  3013.   ac_cv_type_uid_t=yes
  3014. else
  3015.   rm -rf conftest*
  3016.   ac_cv_type_uid_t=no
  3017. fi
  3018. rm -f conftest*
  3019.  
  3020. fi
  3021. echo "$ac_t""$ac_cv_type_uid_t" 1>&4
  3022. if test $ac_cv_type_uid_t = no; then
  3023.   cat >> confdefs.h <<\EOF
  3024. #define uid_t int
  3025. EOF
  3026.  
  3027.   cat >> confdefs.h <<\EOF
  3028. #define gid_t int
  3029. EOF
  3030.  
  3031. fi
  3032.  
  3033.                       echo $ac_n "checking for off_t""... $ac_c" 1>&4
  3034. if eval "test \"`echo '${'ac_cv_type_off_t'+set}'`\" = set"; then
  3035.   echo $ac_n "(cached) $ac_c" 1>&4
  3036. else
  3037.   cat > conftest.$ac_ext <<EOF
  3038. #line 3039 "configure"
  3039. #include "confdefs.h"
  3040. #include <sys/types.h>
  3041. #ifdef STDC_HEADERS
  3042. #include <stdlib.h>
  3043. #endif
  3044. EOF
  3045. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3046.   egrep "off_t" >/dev/null 2>&1; then
  3047.   rm -rf conftest*
  3048.   ac_cv_type_off_t=yes
  3049. else
  3050.   rm -rf conftest*
  3051.   ac_cv_type_off_t=no
  3052. fi
  3053. rm -f conftest*
  3054.  
  3055. fi
  3056. echo "$ac_t""$ac_cv_type_off_t" 1>&4
  3057. if test $ac_cv_type_off_t = no; then
  3058.   cat >> confdefs.h <<\EOF
  3059. #define off_t long
  3060. EOF
  3061.  
  3062. fi
  3063.  
  3064.                       echo $ac_n "checking for caddr_t in sys/types.h""... $ac_c" 1>&4
  3065. if eval "test \"`echo '${'cl_cv_type_caddr_t'+set}'`\" = set"; then
  3066.   echo $ac_n "(cached) $ac_c" 1>&4
  3067. else
  3068.   
  3069. cat > conftest.$ac_ext <<EOF
  3070. #line 3071 "configure"
  3071. #include "confdefs.h"
  3072. #include <sys/types.h>
  3073. EOF
  3074. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3075.   egrep "caddr_t" >/dev/null 2>&1; then
  3076.   rm -rf conftest*
  3077.   cl_cv_type_caddr_t=yes
  3078. else
  3079.   rm -rf conftest*
  3080.   cl_cv_type_caddr_t=no
  3081. fi
  3082. rm -f conftest*
  3083.  
  3084.  
  3085. fi
  3086.  
  3087. echo "$ac_t""$cl_cv_type_caddr_t" 1>&4
  3088. if test $cl_cv_type_caddr_t = yes; then
  3089.   cat >> confdefs.h <<\EOF
  3090. #define CADDR_T caddr_t
  3091. EOF
  3092.  
  3093. else
  3094.   cat >> confdefs.h <<\EOF
  3095. #define CADDR_T void*
  3096. EOF
  3097.  
  3098. fi
  3099.  
  3100.  
  3101.                       echo $ac_n "checking for clock_t in sys/types.h etc.""... $ac_c" 1>&4
  3102. if eval "test \"`echo '${'cl_cv_type_clock_t'+set}'`\" = set"; then
  3103.   echo $ac_n "(cached) $ac_c" 1>&4
  3104. else
  3105.   
  3106. cat > conftest.$ac_ext <<EOF
  3107. #line 3108 "configure"
  3108. #include "confdefs.h"
  3109. #include <sys/types.h>
  3110. EOF
  3111. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3112.   egrep "clock_t" >/dev/null 2>&1; then
  3113.   rm -rf conftest*
  3114.   have_clock=1
  3115. fi
  3116. rm -f conftest*
  3117. if test -z "$have_clock"; then
  3118. cat > conftest.$ac_ext <<EOF
  3119. #line 3120 "configure"
  3120. #include "confdefs.h"
  3121. #include <sys/times.h>
  3122. EOF
  3123. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3124.   egrep "clock_t" >/dev/null 2>&1; then
  3125.   rm -rf conftest*
  3126.   have_clock=1
  3127. fi
  3128. rm -f conftest*
  3129. fi
  3130. if test -z "$have_clock"; then
  3131. cat > conftest.$ac_ext <<EOF
  3132. #line 3133 "configure"
  3133. #include "confdefs.h"
  3134. #include <time.h>
  3135. EOF
  3136. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3137.   egrep "clock_t" >/dev/null 2>&1; then
  3138.   rm -rf conftest*
  3139.   have_clock=1
  3140. fi
  3141. rm -f conftest*
  3142. fi
  3143. if test -z "$have_clock"; then
  3144.   cl_cv_type_clock_t=no
  3145. else
  3146.   cl_cv_type_clock_t=yes
  3147. fi
  3148.  
  3149. fi
  3150.  
  3151. echo "$ac_t""$cl_cv_type_clock_t" 1>&4
  3152. if test $cl_cv_type_clock_t = yes; then
  3153.   cat >> confdefs.h <<\EOF
  3154. #define CLOCK_T clock_t
  3155. EOF
  3156.  
  3157. else
  3158.   cat >> confdefs.h <<\EOF
  3159. #define CLOCK_T int
  3160. EOF
  3161.  
  3162. fi
  3163.  
  3164.                       echo $ac_n "checking for d_namlen in struct dirent""... $ac_c" 1>&4
  3165. if eval "test \"`echo '${'cl_cv_struct_dirent_d_namlen'+set}'`\" = set"; then
  3166.   echo $ac_n "(cached) $ac_c" 1>&4
  3167. else
  3168.   
  3169. cat > conftest.$ac_ext <<EOF
  3170. #line 3171 "configure"
  3171. #include "confdefs.h"
  3172. #include <dirent.h>
  3173. int main() { return 0; }
  3174. int t() {
  3175. struct dirent d; d.d_namlen;
  3176. ; return 0; }
  3177. EOF
  3178. if eval $ac_compile; then
  3179.   rm -rf conftest*
  3180.   cl_cv_struct_dirent_d_namlen=yes
  3181. else
  3182.   rm -rf conftest*
  3183.   cl_cv_struct_dirent_d_namlen=no
  3184. fi
  3185. rm -f conftest*
  3186.  
  3187.  
  3188. fi
  3189.  
  3190. echo "$ac_t""$cl_cv_struct_dirent_d_namlen" 1>&4
  3191. if test $cl_cv_struct_dirent_d_namlen = yes; then
  3192.   :
  3193. else
  3194.   cat >> confdefs.h <<\EOF
  3195. #define DIRENT_WITHOUT_NAMLEN 1
  3196. EOF
  3197.  
  3198. fi
  3199.  
  3200.  
  3201.                       echo $ac_n "checking for struct tm in sys/time.h""... $ac_c" 1>&4
  3202. if eval "test \"`echo '${'cl_cv_struct_tm_sys_time_h'+set}'`\" = set"; then
  3203.   echo $ac_n "(cached) $ac_c" 1>&4
  3204. else
  3205.   
  3206. cat > conftest.$ac_ext <<EOF
  3207. #line 3208 "configure"
  3208. #include "confdefs.h"
  3209. #include <sys/types.h>
  3210. #include <sys/time.h>
  3211. int main() { return 0; }
  3212. int t() {
  3213. struct tm *tp; tp->tm_sec;
  3214. ; return 0; }
  3215. EOF
  3216. if eval $ac_compile; then
  3217.   rm -rf conftest*
  3218.   cl_cv_struct_tm_sys_time_h=yes
  3219. else
  3220.   rm -rf conftest*
  3221.   cl_cv_struct_tm_sys_time_h=no
  3222. fi
  3223. rm -f conftest*
  3224.  
  3225.  
  3226. fi
  3227.  
  3228. echo "$ac_t""$cl_cv_struct_tm_sys_time_h" 1>&4
  3229. if test $cl_cv_struct_tm_sys_time_h = yes; then
  3230.   cat >> confdefs.h <<\EOF
  3231. #define TM_IN_SYS_TIME 1
  3232. EOF
  3233.  
  3234. fi
  3235.  
  3236.                       
  3237. # This is a bit tricky since strlen is a gcc2 built-in function, and
  3238. # gcc's criterion when to reject a prototype for it is extremely mysterious.
  3239. #   extern int strlen (char * s); extern unsigned int strlen (char * s);
  3240. # produces an error, while
  3241. #   extern unsigned int strlen (char * s); extern int strlen (char * s);
  3242. # compiles well.
  3243. if test -z "$cl_cv_proto_strlen_macro"; then
  3244. cat > conftest.$ac_ext <<EOF
  3245. #line 3246 "configure"
  3246. #include "confdefs.h"
  3247. #include <string.h>
  3248. #ifdef strlen
  3249. is a macro
  3250. #endif
  3251.  
  3252. EOF
  3253. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3254.   egrep "is a macro" >/dev/null 2>&1; then
  3255.   rm -rf conftest*
  3256.   cl_cv_proto_strlen_macro=yes
  3257. else
  3258.   rm -rf conftest*
  3259.   cl_cv_proto_strlen_macro=no
  3260. fi
  3261. rm -f conftest*
  3262.  
  3263. fi
  3264. if test $cl_cv_proto_strlen_macro = no; then
  3265. echo $ac_n "checking for strlen declaration""... $ac_c" 1>&4
  3266. if eval "test \"`echo '${'cl_cv_proto_strlen'+set}'`\" = set"; then
  3267.   echo $ac_n "(cached) $ac_c" 1>&4
  3268. else
  3269.   cat > conftest.$ac_ext <<EOF
  3270. #line 3271 "configure"
  3271. #include "confdefs.h"
  3272. #define strlen foo
  3273. #include <string.h>
  3274.  
  3275. extern int strlen();
  3276.  
  3277. int main() { return 0; }
  3278. int t() {
  3279.  
  3280. ; return 0; }
  3281. EOF
  3282. if eval $ac_compile; then
  3283.   rm -rf conftest*
  3284.   cl_cv_proto_strlen_ret="int"
  3285. else
  3286.   rm -rf conftest*
  3287.   cl_cv_proto_strlen_ret="size_t"
  3288. fi
  3289. rm -f conftest*
  3290.  
  3291.  
  3292. cat > conftest.$ac_ext <<EOF
  3293. #line 3294 "configure"
  3294. #include "confdefs.h"
  3295. #define strlen foo
  3296. #include <string.h>
  3297.  
  3298. extern 
  3299. #ifdef __STDC__
  3300. $cl_cv_proto_strlen_ret strlen (char* s);
  3301. #else
  3302. $cl_cv_proto_strlen_ret strlen();
  3303. #endif
  3304.  
  3305. int main() { return 0; }
  3306. int t() {
  3307.  
  3308. ; return 0; }
  3309. EOF
  3310. if eval $ac_compile; then
  3311.   rm -rf conftest*
  3312.   cl_cv_proto_strlen_arg1=""
  3313. else
  3314.   rm -rf conftest*
  3315.   cl_cv_proto_strlen_arg1="const"
  3316. fi
  3317. rm -f conftest*
  3318.  
  3319.  
  3320.  
  3321. cl_cv_proto_strlen="extern $cl_cv_proto_strlen_ret strlen ($cl_cv_proto_strlen_arg1 char*);"
  3322. fi
  3323.  
  3324. cl_cv_proto_strlen=`echo "$cl_cv_proto_strlen" | tr -s ' ' | sed -e 's/( /(/'`
  3325. echo "$ac_t""${ac_tt}$cl_cv_proto_strlen" 1>&4
  3326.  
  3327.  
  3328. cat >> confdefs.h <<EOF
  3329. #define RETSTRLENTYPE $cl_cv_proto_strlen_ret
  3330. EOF
  3331.  
  3332. cat >> confdefs.h <<EOF
  3333. #define STRLEN_CONST $cl_cv_proto_strlen_arg1
  3334. EOF
  3335.  
  3336. fi
  3337.  
  3338.                       for ac_func in memset
  3339. do
  3340. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  3341. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  3342.   echo $ac_n "(cached) $ac_c" 1>&4
  3343. else
  3344.   cat > conftest.$ac_ext <<EOF
  3345. #line 3346 "configure"
  3346. #include "confdefs.h"
  3347. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  3348. /* The GNU C library defines this for functions which it implements
  3349.     to always fail with ENOSYS.  Some functions are actually named
  3350.     something starting with __ and the normal name is an alias.  */
  3351. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  3352. choke me
  3353. #endif
  3354.  
  3355. EOF
  3356. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3357.   egrep "choke" >/dev/null 2>&1; then
  3358.   rm -rf conftest*
  3359.   eval "ac_cv_func_$ac_func=no"
  3360. else
  3361.   rm -rf conftest*
  3362.   cat > conftest.$ac_ext <<EOF
  3363. #line 3364 "configure"
  3364. #include "confdefs.h"
  3365. /* Override any gcc2 internal prototype to avoid an error.  */
  3366. char $ac_func(); 
  3367.  
  3368. int main() { return 0; }
  3369. int t() {
  3370.  
  3371. $ac_func();
  3372.  
  3373. ; return 0; }
  3374. EOF
  3375. if eval $ac_link; then
  3376.   rm -rf conftest*
  3377.   eval "ac_cv_func_$ac_func=yes"
  3378. else
  3379.   rm -rf conftest*
  3380.   eval "ac_cv_func_$ac_func=no"
  3381. fi
  3382. rm -f conftest*
  3383.  
  3384. fi
  3385. rm -f conftest*
  3386.  
  3387. fi
  3388. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  3389.   echo "$ac_t""yes" 1>&4
  3390.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  3391.   cat >> confdefs.h <<EOF
  3392. #define $ac_tr_func 1
  3393. EOF
  3394.  
  3395. else
  3396.   echo "$ac_t""no" 1>&4
  3397. fi
  3398. done
  3399.  
  3400.                       echo $ac_n "checking for broken HP/UX and SunOS malloc""... $ac_c" 1>&4
  3401. if eval "test \"`echo '${'cl_cv_func_malloc_broken'+set}'`\" = set"; then
  3402.   echo $ac_n "(cached) $ac_c" 1>&4
  3403. else
  3404.   
  3405. if test $cross_compiling = no; then
  3406. # Note that HP-UX has two different malloc() implementations.
  3407. # Both are broken. When used with CLISP, the one in the default libc.a
  3408. # leads to a SIGSEGV, the one in libmalloc.a leads to a SIGBUS.
  3409. # The SunOS 4.1.1 malloc() breaks when used by CLISP's generational GC.
  3410. os_name=`(uname -s) 2> /dev/null`
  3411. if test "$os_name" = HP-UX -o "$os_name" = SunOS ; then
  3412. cl_cv_func_malloc_broken=yes
  3413. else
  3414. cl_cv_func_malloc_broken=no
  3415. fi
  3416. else
  3417. cl_cv_func_malloc_broken="guessing no"
  3418. fi
  3419.  
  3420. fi
  3421.  
  3422. echo "$ac_t""$cl_cv_func_malloc_broken" 1>&4
  3423. case "$cl_cv_func_malloc_broken" in
  3424.   *yes) # Remedy: Use GNU malloc.
  3425.         GMALLOC=gmalloc ;;
  3426.   *no)  GMALLOC='' ;;
  3427. esac
  3428.  
  3429.  
  3430.                       echo $ac_n "checking for malloc declaration""... $ac_c" 1>&4
  3431. if eval "test \"`echo '${'cl_cv_proto_malloc'+set}'`\" = set"; then
  3432.   echo $ac_n "(cached) $ac_c" 1>&4
  3433. else
  3434.   cat > conftest.$ac_ext <<EOF
  3435. #line 3436 "configure"
  3436. #include "confdefs.h"
  3437. #include <stdlib.h>
  3438. EOF
  3439. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3440.   egrep "void.*\*.*malloc" >/dev/null 2>&1; then
  3441.   rm -rf conftest*
  3442.   malloc_void=1
  3443. fi
  3444. rm -f conftest*
  3445. if test -z "$malloc_void"; then
  3446. cat > conftest.$ac_ext <<EOF
  3447. #line 3448 "configure"
  3448. #include "confdefs.h"
  3449.  
  3450. #ifdef HAVE_STDLIB_H
  3451. #include <stdlib.h>
  3452. #endif
  3453. #ifdef HAVE_UNISTD_H
  3454. #include <unistd.h>
  3455. #endif
  3456. extern void* malloc();
  3457. int main() { return 0; }
  3458. int t() {
  3459.  
  3460. ; return 0; }
  3461. EOF
  3462. if eval $ac_compile; then
  3463.   rm -rf conftest*
  3464.   malloc_void=1
  3465. fi
  3466. rm -f conftest*
  3467.  
  3468. fi
  3469. if test -n "$malloc_void"; then
  3470. cl_cv_proto_malloc_ret="void*"
  3471. else
  3472. cl_cv_proto_malloc_ret="char*"
  3473. fi
  3474. cat > conftest.$ac_ext <<EOF
  3475. #line 3476 "configure"
  3476. #include "confdefs.h"
  3477.  
  3478. #ifdef HAVE_STDLIB_H
  3479. #include <stdlib.h>
  3480. #endif
  3481. #ifdef HAVE_UNISTD_H
  3482. #include <unistd.h>
  3483. #endif
  3484.  
  3485. extern 
  3486. #ifdef __STDC__
  3487. $cl_cv_proto_malloc_ret malloc (unsigned int size);
  3488. #else
  3489. $cl_cv_proto_malloc_ret malloc();
  3490. #endif
  3491.  
  3492. int main() { return 0; }
  3493. int t() {
  3494.  
  3495. ; return 0; }
  3496. EOF
  3497. if eval $ac_compile; then
  3498.   rm -rf conftest*
  3499.   cl_cv_proto_malloc_arg1="unsigned int"
  3500. else
  3501.   rm -rf conftest*
  3502.   cl_cv_proto_malloc_arg1="size_t"
  3503. fi
  3504. rm -f conftest*
  3505.  
  3506.  
  3507.  
  3508. cl_cv_proto_malloc="extern $cl_cv_proto_malloc_ret malloc ($cl_cv_proto_malloc_arg1);"
  3509. fi
  3510.  
  3511. cl_cv_proto_malloc=`echo "$cl_cv_proto_malloc" | tr -s ' ' | sed -e 's/( /(/'`
  3512. echo "$ac_t""${ac_tt}$cl_cv_proto_malloc" 1>&4
  3513.  
  3514.  
  3515. cat >> confdefs.h <<EOF
  3516. #define RETMALLOCTYPE $cl_cv_proto_malloc_ret
  3517. EOF
  3518.  
  3519. cat >> confdefs.h <<EOF
  3520. #define MALLOC_SIZE_T $cl_cv_proto_malloc_arg1
  3521. EOF
  3522.  
  3523.  
  3524.                       echo $ac_n "checking for free declaration""... $ac_c" 1>&4
  3525. if eval "test \"`echo '${'cl_cv_proto_free'+set}'`\" = set"; then
  3526.   echo $ac_n "(cached) $ac_c" 1>&4
  3527. else
  3528.   cat > conftest.$ac_ext <<EOF
  3529. #line 3530 "configure"
  3530. #include "confdefs.h"
  3531.  
  3532. #ifdef HAVE_STDLIB_H
  3533. #include <stdlib.h>
  3534. #endif
  3535. #ifdef HAVE_UNISTD_H
  3536. #include <unistd.h>
  3537. #endif
  3538.  
  3539. extern int free();
  3540.  
  3541. int main() { return 0; }
  3542. int t() {
  3543.  
  3544. ; return 0; }
  3545. EOF
  3546. if eval $ac_compile; then
  3547.   rm -rf conftest*
  3548.   cl_cv_proto_free_ret="int"
  3549. else
  3550.   rm -rf conftest*
  3551.   cl_cv_proto_free_ret="void"
  3552. fi
  3553. rm -f conftest*
  3554.  
  3555.  
  3556. cl_cv_proto_free="extern $cl_cv_proto_free_ret free ($cl_cv_proto_malloc_ret);"
  3557. fi
  3558.  
  3559. cl_cv_proto_free=`echo "$cl_cv_proto_free" | tr -s ' ' | sed -e 's/( /(/'`
  3560. echo "$ac_t""${ac_tt}$cl_cv_proto_free" 1>&4
  3561.  
  3562.  
  3563. cat >> confdefs.h <<EOF
  3564. #define RETFREETYPE $cl_cv_proto_free_ret
  3565. EOF
  3566.  
  3567.  
  3568.                       # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
  3569. # for constant arguments.  Useless!
  3570. echo $ac_n "checking for working alloca.h""... $ac_c" 1>&4
  3571. if eval "test \"`echo '${'cl_cv_header_alloca_h'+set}'`\" = set"; then
  3572.   echo $ac_n "(cached) $ac_c" 1>&4
  3573. else
  3574.   
  3575. cat > conftest.$ac_ext <<EOF
  3576. #line 3577 "configure"
  3577. #include "confdefs.h"
  3578. #include <alloca.h>
  3579. int main() { return 0; }
  3580. int t() {
  3581. char *p = alloca(2 * sizeof(int));
  3582. ; return 0; }
  3583. EOF
  3584. if eval $ac_link; then
  3585.   rm -rf conftest*
  3586.   cl_cv_header_alloca_h=yes
  3587. else
  3588.   rm -rf conftest*
  3589.   cl_cv_header_alloca_h=no
  3590. fi
  3591. rm -f conftest*
  3592.  
  3593.  
  3594. fi
  3595.  
  3596. echo "$ac_t""$cl_cv_header_alloca_h" 1>&4
  3597. if test $cl_cv_header_alloca_h = yes; then
  3598.   cat >> confdefs.h <<\EOF
  3599. #define HAVE_ALLOCA_H 1
  3600. EOF
  3601.  
  3602. fi
  3603. decl="#ifdef __GNUC__
  3604. #define alloca __builtin_alloca
  3605. #else
  3606. #ifdef HAVE_ALLOCA_H
  3607. #include <alloca.h>
  3608. #else
  3609. #ifdef _AIX
  3610.  #pragma alloca
  3611. #else
  3612. char *alloca ();
  3613. #endif
  3614. #endif
  3615. #endif
  3616. "
  3617. echo $ac_n "checking for alloca""... $ac_c" 1>&4
  3618. if eval "test \"`echo '${'cl_cv_func_alloca'+set}'`\" = set"; then
  3619.   echo $ac_n "(cached) $ac_c" 1>&4
  3620. else
  3621.   
  3622. cat > conftest.$ac_ext <<EOF
  3623. #line 3624 "configure"
  3624. #include "confdefs.h"
  3625. $decl
  3626. int main() { return 0; }
  3627. int t() {
  3628. char *p = (char *) alloca(1);
  3629. ; return 0; }
  3630. EOF
  3631. if eval $ac_link; then
  3632.   rm -rf conftest*
  3633.   cl_cv_func_alloca=yes
  3634. else
  3635.   rm -rf conftest*
  3636.   cl_cv_func_alloca=no
  3637. fi
  3638. rm -f conftest*
  3639.  
  3640.  
  3641. fi
  3642.  
  3643. echo "$ac_t""$cl_cv_func_alloca" 1>&4
  3644. if test $cl_cv_func_alloca = yes; then
  3645.   :
  3646. else
  3647.   alloca_missing=1
  3648. fi
  3649. if test -n "$alloca_missing"; then
  3650.   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
  3651.   # that cause trouble.  Some versions do not even contain alloca or
  3652.   # contain a buggy version.  If you still want to use their alloca,
  3653.   # use ar to extract alloca.o from them instead of compiling alloca.c.
  3654.   ALLOCA=alloca.o
  3655.   cat >> confdefs.h <<\EOF
  3656. #define NO_ALLOCA 1
  3657. EOF
  3658.  
  3659. fi
  3660.  
  3661.                       echo $ac_n "checking for _setjmp""... $ac_c" 1>&4
  3662. if eval "test \"`echo '${'ac_cv_func__setjmp'+set}'`\" = set"; then
  3663.   echo $ac_n "(cached) $ac_c" 1>&4
  3664. else
  3665.   cat > conftest.$ac_ext <<EOF
  3666. #line 3667 "configure"
  3667. #include "confdefs.h"
  3668. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  3669. /* The GNU C library defines this for functions which it implements
  3670.     to always fail with ENOSYS.  Some functions are actually named
  3671.     something starting with __ and the normal name is an alias.  */
  3672. #if defined (__stub__setjmp) || defined (__stub____setjmp)
  3673. choke me
  3674. #endif
  3675.  
  3676. EOF
  3677. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3678.   egrep "choke" >/dev/null 2>&1; then
  3679.   rm -rf conftest*
  3680.   eval "ac_cv_func__setjmp=no"
  3681. else
  3682.   rm -rf conftest*
  3683.   cat > conftest.$ac_ext <<EOF
  3684. #line 3685 "configure"
  3685. #include "confdefs.h"
  3686. /* Override any gcc2 internal prototype to avoid an error.  */
  3687. char _setjmp(); 
  3688.  
  3689. int main() { return 0; }
  3690. int t() {
  3691.  
  3692. _setjmp();
  3693.  
  3694. ; return 0; }
  3695. EOF
  3696. if eval $ac_link; then
  3697.   rm -rf conftest*
  3698.   eval "ac_cv_func__setjmp=yes"
  3699. else
  3700.   rm -rf conftest*
  3701.   eval "ac_cv_func__setjmp=no"
  3702. fi
  3703. rm -f conftest*
  3704.  
  3705. fi
  3706. rm -f conftest*
  3707.  
  3708. fi
  3709. if eval "test \"`echo '$ac_cv_func_'_setjmp`\" = yes"; then
  3710.   echo "$ac_t""yes" 1>&4
  3711.   :
  3712. else
  3713.   echo "$ac_t""no" 1>&4
  3714. no__jmp=1
  3715. fi
  3716. if test -z "$no__jmp"; then
  3717. echo $ac_n "checking for _longjmp""... $ac_c" 1>&4
  3718. if eval "test \"`echo '${'ac_cv_func__longjmp'+set}'`\" = set"; then
  3719.   echo $ac_n "(cached) $ac_c" 1>&4
  3720. else
  3721.   cat > conftest.$ac_ext <<EOF
  3722. #line 3723 "configure"
  3723. #include "confdefs.h"
  3724. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  3725. /* The GNU C library defines this for functions which it implements
  3726.     to always fail with ENOSYS.  Some functions are actually named
  3727.     something starting with __ and the normal name is an alias.  */
  3728. #if defined (__stub__longjmp) || defined (__stub____longjmp)
  3729. choke me
  3730. #endif
  3731.  
  3732. EOF
  3733. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3734.   egrep "choke" >/dev/null 2>&1; then
  3735.   rm -rf conftest*
  3736.   eval "ac_cv_func__longjmp=no"
  3737. else
  3738.   rm -rf conftest*
  3739.   cat > conftest.$ac_ext <<EOF
  3740. #line 3741 "configure"
  3741. #include "confdefs.h"
  3742. /* Override any gcc2 internal prototype to avoid an error.  */
  3743. char _longjmp(); 
  3744.  
  3745. int main() { return 0; }
  3746. int t() {
  3747.  
  3748. _longjmp();
  3749.  
  3750. ; return 0; }
  3751. EOF
  3752. if eval $ac_link; then
  3753.   rm -rf conftest*
  3754.   eval "ac_cv_func__longjmp=yes"
  3755. else
  3756.   rm -rf conftest*
  3757.   eval "ac_cv_func__longjmp=no"
  3758. fi
  3759. rm -f conftest*
  3760.  
  3761. fi
  3762. rm -f conftest*
  3763.  
  3764. fi
  3765. if eval "test \"`echo '$ac_cv_func_'_longjmp`\" = yes"; then
  3766.   echo "$ac_t""yes" 1>&4
  3767.   :
  3768. else
  3769.   echo "$ac_t""no" 1>&4
  3770. no__jmp=1
  3771. fi
  3772. fi
  3773. if test -z "$no__jmp"; then
  3774. cat >> confdefs.h <<\EOF
  3775. #define HAVE__JMP 1
  3776. EOF
  3777.  
  3778. fi
  3779. cat > conftest.$ac_ext <<EOF
  3780. #line 3781 "configure"
  3781. #include "confdefs.h"
  3782. #include <setjmp.h>
  3783. EOF
  3784. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3785.   egrep "void.* longjmp" >/dev/null 2>&1; then
  3786.   :
  3787. else
  3788.   rm -rf conftest*
  3789.   cat >> confdefs.h <<\EOF
  3790. #define LONGJMP_RETURNS 1
  3791. EOF
  3792.  
  3793. fi
  3794. rm -f conftest*
  3795.  
  3796.  
  3797.                       echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&4
  3798. if eval "test \"`echo '${'ac_cv_type_signal'+set}'`\" = set"; then
  3799.   echo $ac_n "(cached) $ac_c" 1>&4
  3800. else
  3801.   cat > conftest.$ac_ext <<EOF
  3802. #line 3803 "configure"
  3803. #include "confdefs.h"
  3804. #include <sys/types.h>
  3805. #include <signal.h>
  3806. #ifdef signal
  3807. #undef signal
  3808. #endif
  3809. extern void (*signal ()) ();
  3810. int main() { return 0; }
  3811. int t() {
  3812. int i;
  3813. ; return 0; }
  3814. EOF
  3815. if eval $ac_compile; then
  3816.   rm -rf conftest*
  3817.   ac_cv_type_signal=void
  3818. else
  3819.   rm -rf conftest*
  3820.   ac_cv_type_signal=int
  3821. fi
  3822. rm -f conftest*
  3823.  
  3824. fi
  3825. echo "$ac_t""$ac_cv_type_signal" 1>&4
  3826. cat >> confdefs.h <<EOF
  3827. #define RETSIGTYPE $ac_cv_type_signal
  3828. EOF
  3829.  
  3830.  
  3831.                       echo $ac_n "checking whether signal handlers need to be reinstalled""... $ac_c" 1>&4
  3832. if eval "test \"`echo '${'cl_cv_func_signal_reinstall'+set}'`\" = set"; then
  3833.   echo $ac_n "(cached) $ac_c" 1>&4
  3834. else
  3835.   
  3836. if test "$cross_compiling" = yes; then
  3837.   cl_cv_func_signal_reinstall="guessing yes"
  3838. else
  3839. cat > conftest.$ac_ext <<EOF
  3840. #line 3841 "configure"
  3841. #include "confdefs.h"
  3842.  
  3843. #ifdef STDC_HEADERS
  3844. #include <stdlib.h>
  3845. #endif
  3846. #ifdef HAVE_UNISTD_H
  3847. #include <unistd.h>
  3848. #endif
  3849. #include <signal.h>
  3850. /* volatile */ int gotsig=0;
  3851. RETSIGTYPE sigalrm_handler() { gotsig=1; }
  3852. int got_sig () { return gotsig; }
  3853. typedef RETSIGTYPE (*signal_handler) ();
  3854. main() { /* returns 0 if they need not to be reinstalled */
  3855.   signal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  3856.   exit(!( (signal_handler)signal(SIGALRM,(signal_handler)sigalrm_handler)
  3857.           == (signal_handler)sigalrm_handler
  3858.       ) );
  3859. }
  3860. EOF
  3861. eval $ac_link
  3862. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  3863.   cl_cv_func_signal_reinstall=no
  3864. else
  3865.   cl_cv_func_signal_reinstall=yes
  3866. fi
  3867. if test -f core; then
  3868.   coredir=core`/bin/sh -c 'echo $$'`
  3869.   mkdir $coredir
  3870.   cp confdefs.h $coredir/confdefs.h
  3871.   mv conftest.c $coredir/conftest.c
  3872.   mv conftest $coredir/conftest
  3873.   mv core $coredir/core
  3874.   echo "warning: test program dumped core -- see subdirectory $coredir"
  3875. fi
  3876. fi
  3877. rm -fr conftest*
  3878.  
  3879. fi
  3880.  
  3881. echo "$ac_t""$cl_cv_func_signal_reinstall" 1>&4
  3882. case "$cl_cv_func_signal_reinstall" in
  3883.   *yes) cat >> confdefs.h <<\EOF
  3884. #define SIGNAL_NEED_REINSTALL 1
  3885. EOF
  3886.  ;;
  3887.   *no) ;;
  3888. esac
  3889.  
  3890.                       signalblocks=""
  3891. echo $ac_n "checking for sighold""... $ac_c" 1>&4
  3892. if eval "test \"`echo '${'ac_cv_func_sighold'+set}'`\" = set"; then
  3893.   echo $ac_n "(cached) $ac_c" 1>&4
  3894. else
  3895.   cat > conftest.$ac_ext <<EOF
  3896. #line 3897 "configure"
  3897. #include "confdefs.h"
  3898. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  3899. /* The GNU C library defines this for functions which it implements
  3900.     to always fail with ENOSYS.  Some functions are actually named
  3901.     something starting with __ and the normal name is an alias.  */
  3902. #if defined (__stub_sighold) || defined (__stub___sighold)
  3903. choke me
  3904. #endif
  3905.  
  3906. EOF
  3907. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3908.   egrep "choke" >/dev/null 2>&1; then
  3909.   rm -rf conftest*
  3910.   eval "ac_cv_func_sighold=no"
  3911. else
  3912.   rm -rf conftest*
  3913.   cat > conftest.$ac_ext <<EOF
  3914. #line 3915 "configure"
  3915. #include "confdefs.h"
  3916. /* Override any gcc2 internal prototype to avoid an error.  */
  3917. char sighold(); 
  3918.  
  3919. int main() { return 0; }
  3920. int t() {
  3921.  
  3922. sighold();
  3923.  
  3924. ; return 0; }
  3925. EOF
  3926. if eval $ac_link; then
  3927.   rm -rf conftest*
  3928.   eval "ac_cv_func_sighold=yes"
  3929. else
  3930.   rm -rf conftest*
  3931.   eval "ac_cv_func_sighold=no"
  3932. fi
  3933. rm -f conftest*
  3934.  
  3935. fi
  3936. rm -f conftest*
  3937.  
  3938. fi
  3939. if eval "test \"`echo '$ac_cv_func_'sighold`\" = yes"; then
  3940.   echo "$ac_t""yes" 1>&4
  3941.   cat >> confdefs.h <<\EOF
  3942. #define SIGNALBLOCK_SYSV 1
  3943. EOF
  3944.  
  3945. signalblocks="$signalblocks SystemV"
  3946. else
  3947.   echo "$ac_t""no" 1>&4
  3948. fi
  3949. cat > conftest.$ac_ext <<EOF
  3950. #line 3951 "configure"
  3951. #include "confdefs.h"
  3952. #include <signal.h>
  3953. EOF
  3954. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3955.   egrep "sigset_t" >/dev/null 2>&1; then
  3956.   :
  3957. else
  3958.   rm -rf conftest*
  3959.   signals_not_posix=1
  3960. fi
  3961. rm -f conftest*
  3962. if test -z "$signals_not_posix"; then
  3963. echo $ac_n "checking for sigprocmask""... $ac_c" 1>&4
  3964. if eval "test \"`echo '${'ac_cv_func_sigprocmask'+set}'`\" = set"; then
  3965.   echo $ac_n "(cached) $ac_c" 1>&4
  3966. else
  3967.   cat > conftest.$ac_ext <<EOF
  3968. #line 3969 "configure"
  3969. #include "confdefs.h"
  3970. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  3971. /* The GNU C library defines this for functions which it implements
  3972.     to always fail with ENOSYS.  Some functions are actually named
  3973.     something starting with __ and the normal name is an alias.  */
  3974. #if defined (__stub_sigprocmask) || defined (__stub___sigprocmask)
  3975. choke me
  3976. #endif
  3977.  
  3978. EOF
  3979. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  3980.   egrep "choke" >/dev/null 2>&1; then
  3981.   rm -rf conftest*
  3982.   eval "ac_cv_func_sigprocmask=no"
  3983. else
  3984.   rm -rf conftest*
  3985.   cat > conftest.$ac_ext <<EOF
  3986. #line 3987 "configure"
  3987. #include "confdefs.h"
  3988. /* Override any gcc2 internal prototype to avoid an error.  */
  3989. char sigprocmask(); 
  3990.  
  3991. int main() { return 0; }
  3992. int t() {
  3993.  
  3994. sigprocmask();
  3995.  
  3996. ; return 0; }
  3997. EOF
  3998. if eval $ac_link; then
  3999.   rm -rf conftest*
  4000.   eval "ac_cv_func_sigprocmask=yes"
  4001. else
  4002.   rm -rf conftest*
  4003.   eval "ac_cv_func_sigprocmask=no"
  4004. fi
  4005. rm -f conftest*
  4006.  
  4007. fi
  4008. rm -f conftest*
  4009.  
  4010. fi
  4011. if eval "test \"`echo '$ac_cv_func_'sigprocmask`\" = yes"; then
  4012.   echo "$ac_t""yes" 1>&4
  4013.   cat >> confdefs.h <<\EOF
  4014. #define SIGNALBLOCK_POSIX 1
  4015. EOF
  4016.  
  4017. signalblocks="$signalblocks POSIX"
  4018. else
  4019.   echo "$ac_t""no" 1>&4
  4020. fi
  4021. fi
  4022. echo $ac_n "checking for sigblock""... $ac_c" 1>&4
  4023. if eval "test \"`echo '${'ac_cv_func_sigblock'+set}'`\" = set"; then
  4024.   echo $ac_n "(cached) $ac_c" 1>&4
  4025. else
  4026.   cat > conftest.$ac_ext <<EOF
  4027. #line 4028 "configure"
  4028. #include "confdefs.h"
  4029. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  4030. /* The GNU C library defines this for functions which it implements
  4031.     to always fail with ENOSYS.  Some functions are actually named
  4032.     something starting with __ and the normal name is an alias.  */
  4033. #if defined (__stub_sigblock) || defined (__stub___sigblock)
  4034. choke me
  4035. #endif
  4036.  
  4037. EOF
  4038. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4039.   egrep "choke" >/dev/null 2>&1; then
  4040.   rm -rf conftest*
  4041.   eval "ac_cv_func_sigblock=no"
  4042. else
  4043.   rm -rf conftest*
  4044.   cat > conftest.$ac_ext <<EOF
  4045. #line 4046 "configure"
  4046. #include "confdefs.h"
  4047. /* Override any gcc2 internal prototype to avoid an error.  */
  4048. char sigblock(); 
  4049.  
  4050. int main() { return 0; }
  4051. int t() {
  4052.  
  4053. sigblock();
  4054.  
  4055. ; return 0; }
  4056. EOF
  4057. if eval $ac_link; then
  4058.   rm -rf conftest*
  4059.   eval "ac_cv_func_sigblock=yes"
  4060. else
  4061.   rm -rf conftest*
  4062.   eval "ac_cv_func_sigblock=no"
  4063. fi
  4064. rm -f conftest*
  4065.  
  4066. fi
  4067. rm -f conftest*
  4068.  
  4069. fi
  4070. if eval "test \"`echo '$ac_cv_func_'sigblock`\" = yes"; then
  4071.   echo "$ac_t""yes" 1>&4
  4072.   cat >> confdefs.h <<\EOF
  4073. #define SIGNALBLOCK_BSD 1
  4074. EOF
  4075.  
  4076. signalblocks="$signalblocks BSD"
  4077. else
  4078.   echo "$ac_t""no" 1>&4
  4079. fi
  4080. echo $ac_n "checking for signal blocking interfaces""... $ac_c" 1>&4
  4081. if eval "test \"`echo '${'cl_cv_func_signalblocks'+set}'`\" = set"; then
  4082.   echo $ac_n "(cached) $ac_c" 1>&4
  4083. else
  4084.   
  4085. if test -z "$signalblocks"; then
  4086.   cl_cv_func_signalblocks="none"
  4087. else
  4088.   cl_cv_func_signalblocks=`echo $signalblocks`
  4089. fi
  4090.  
  4091. fi
  4092.  
  4093. echo "$ac_t""$cl_cv_func_signalblocks" 1>&4
  4094.  
  4095.                       case "$signalblocks" in
  4096.   *BSD*)
  4097. echo $ac_n "checking whether signals are blocked when signal handlers are entered""... $ac_c" 1>&4
  4098. if eval "test \"`echo '${'cl_cv_func_signal_blocked'+set}'`\" = set"; then
  4099.   echo $ac_n "(cached) $ac_c" 1>&4
  4100. else
  4101.   
  4102. if test "$cross_compiling" = yes; then
  4103.   cl_cv_func_signal_blocked="guessing yes"
  4104. else
  4105. cat > conftest.$ac_ext <<EOF
  4106. #line 4107 "configure"
  4107. #include "confdefs.h"
  4108.  
  4109. #ifdef STDC_HEADERS
  4110. #include <stdlib.h>
  4111. #endif
  4112. #ifdef HAVE_UNISTD_H
  4113. #include <unistd.h>
  4114. #endif
  4115. #include <signal.h>
  4116. int gotsig=0;
  4117. int wasblocked=0;
  4118. typedef RETSIGTYPE (*signal_handler) ();
  4119. RETSIGTYPE sigalrm_handler()
  4120. { gotsig=1;
  4121. #ifdef SIGNAL_NEED_REINSTALL
  4122.   signal(SIGALRM,(signal_handler)sigalrm_handler);
  4123. #endif
  4124. #ifdef SIGNALBLOCK_POSIX
  4125.   { sigset_t blocked;
  4126.     sigprocmask(SIG_BLOCK, (sigset_t *) 0, &blocked);
  4127.     wasblocked = sigismember(&blocked,SIGALRM) ? 1 : 0;
  4128.   }
  4129. #else
  4130.   wasblocked = ((sigblock(0) & sigmask(SIGALRM)) != 0);
  4131. #endif
  4132. }
  4133. int got_sig () { return gotsig; }
  4134. main() { /* returns 0 if they need not to be unblocked */
  4135.   signal(SIGALRM,(signal_handler)sigalrm_handler); alarm(1); while (!got_sig());
  4136.   exit(wasblocked);
  4137. }
  4138. EOF
  4139. eval $ac_link
  4140. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  4141.   cl_cv_func_signal_blocked=no
  4142. else
  4143.   cl_cv_func_signal_blocked=yes
  4144. fi
  4145. if test -f core; then
  4146.   coredir=core`/bin/sh -c 'echo $$'`
  4147.   mkdir $coredir
  4148.   cp confdefs.h $coredir/confdefs.h
  4149.   mv conftest.c $coredir/conftest.c
  4150.   mv conftest $coredir/conftest
  4151.   mv core $coredir/core
  4152.   echo "warning: test program dumped core -- see subdirectory $coredir"
  4153. fi
  4154. fi
  4155. rm -fr conftest*
  4156.  
  4157. fi
  4158.  
  4159. echo "$ac_t""$cl_cv_func_signal_blocked" 1>&4
  4160. case "$cl_cv_func_signal_blocked" in
  4161.   *yes) cat >> confdefs.h <<\EOF
  4162. #define SIGNAL_NEED_UNBLOCK 1
  4163. EOF
  4164.  ;;
  4165.   *no) ;;
  4166. esac
  4167.   ;;
  4168.   *) ;;
  4169. esac
  4170.  
  4171.                       case "$signalblocks" in
  4172.   *POSIX*)
  4173. echo $ac_n "checking for sigprocmask declaration""... $ac_c" 1>&4
  4174. if eval "test \"`echo '${'cl_cv_proto_sigprocmask'+set}'`\" = set"; then
  4175.   echo $ac_n "(cached) $ac_c" 1>&4
  4176. else
  4177.   cat > conftest.$ac_ext <<EOF
  4178. #line 4179 "configure"
  4179. #include "confdefs.h"
  4180.  
  4181. #ifdef STDC_HEADERS
  4182. #include <stdlib.h>
  4183. #endif
  4184. #ifdef HAVE_UNISTD_H
  4185. #include <unistd.h>
  4186. #endif
  4187. #include <signal.h>
  4188.  
  4189. extern 
  4190. #ifdef __STDC__
  4191. int sigprocmask (int how, sigset_t* set, sigset_t* oset);
  4192. #else
  4193. int sigprocmask();
  4194. #endif
  4195.  
  4196. int main() { return 0; }
  4197. int t() {
  4198.  
  4199. ; return 0; }
  4200. EOF
  4201. if eval $ac_compile; then
  4202.   rm -rf conftest*
  4203.   cl_cv_proto_sigprocmask_arg2=""
  4204. else
  4205.   rm -rf conftest*
  4206.   cl_cv_proto_sigprocmask_arg2="const"
  4207. fi
  4208. rm -f conftest*
  4209.  
  4210.  
  4211.  
  4212. cl_cv_proto_sigprocmask="extern int sigprocmask (int, $cl_cv_proto_sigprocmask_arg2 sigset_t*, sigset_t*);"
  4213. fi
  4214.  
  4215. cl_cv_proto_sigprocmask=`echo "$cl_cv_proto_sigprocmask" | tr -s ' ' | sed -e 's/( /(/'`
  4216. echo "$ac_t""${ac_tt}$cl_cv_proto_sigprocmask" 1>&4
  4217.  
  4218.  
  4219. cat >> confdefs.h <<EOF
  4220. #define SIGPROCMASK_CONST $cl_cv_proto_sigprocmask_arg2
  4221. EOF
  4222.  
  4223.   ;;
  4224.   *) ;;
  4225. esac
  4226.  
  4227.                       
  4228. echo $ac_n "checking for sigaction""... $ac_c" 1>&4
  4229. if eval "test \"`echo '${'ac_cv_func_sigaction'+set}'`\" = set"; then
  4230.   echo $ac_n "(cached) $ac_c" 1>&4
  4231. else
  4232.   cat > conftest.$ac_ext <<EOF
  4233. #line 4234 "configure"
  4234. #include "confdefs.h"
  4235. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  4236. /* The GNU C library defines this for functions which it implements
  4237.     to always fail with ENOSYS.  Some functions are actually named
  4238.     something starting with __ and the normal name is an alias.  */
  4239. #if defined (__stub_sigaction) || defined (__stub___sigaction)
  4240. choke me
  4241. #endif
  4242.  
  4243. EOF
  4244. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4245.   egrep "choke" >/dev/null 2>&1; then
  4246.   rm -rf conftest*
  4247.   eval "ac_cv_func_sigaction=no"
  4248. else
  4249.   rm -rf conftest*
  4250.   cat > conftest.$ac_ext <<EOF
  4251. #line 4252 "configure"
  4252. #include "confdefs.h"
  4253. /* Override any gcc2 internal prototype to avoid an error.  */
  4254. char sigaction(); 
  4255.  
  4256. int main() { return 0; }
  4257. int t() {
  4258.  
  4259. sigaction();
  4260.  
  4261. ; return 0; }
  4262. EOF
  4263. if eval $ac_link; then
  4264.   rm -rf conftest*
  4265.   eval "ac_cv_func_sigaction=yes"
  4266. else
  4267.   rm -rf conftest*
  4268.   eval "ac_cv_func_sigaction=no"
  4269. fi
  4270. rm -f conftest*
  4271.  
  4272. fi
  4273. rm -f conftest*
  4274.  
  4275. fi
  4276. if eval "test \"`echo '$ac_cv_func_'sigaction`\" = yes"; then
  4277.   echo "$ac_t""yes" 1>&4
  4278.   cat >> confdefs.h <<\EOF
  4279. #define HAVE_SIGACTION 1
  4280. EOF
  4281.  
  4282. have_sigaction=1
  4283. else
  4284.   echo "$ac_t""no" 1>&4
  4285. fi
  4286.  
  4287.                       echo $ac_n "checking for siginterrupt""... $ac_c" 1>&4
  4288. if eval "test \"`echo '${'ac_cv_func_siginterrupt'+set}'`\" = set"; then
  4289.   echo $ac_n "(cached) $ac_c" 1>&4
  4290. else
  4291.   cat > conftest.$ac_ext <<EOF
  4292. #line 4293 "configure"
  4293. #include "confdefs.h"
  4294. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  4295. /* The GNU C library defines this for functions which it implements
  4296.     to always fail with ENOSYS.  Some functions are actually named
  4297.     something starting with __ and the normal name is an alias.  */
  4298. #if defined (__stub_siginterrupt) || defined (__stub___siginterrupt)
  4299. choke me
  4300. #endif
  4301.  
  4302. EOF
  4303. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4304.   egrep "choke" >/dev/null 2>&1; then
  4305.   rm -rf conftest*
  4306.   eval "ac_cv_func_siginterrupt=no"
  4307. else
  4308.   rm -rf conftest*
  4309.   cat > conftest.$ac_ext <<EOF
  4310. #line 4311 "configure"
  4311. #include "confdefs.h"
  4312. /* Override any gcc2 internal prototype to avoid an error.  */
  4313. char siginterrupt(); 
  4314.  
  4315. int main() { return 0; }
  4316. int t() {
  4317.  
  4318. siginterrupt();
  4319.  
  4320. ; return 0; }
  4321. EOF
  4322. if eval $ac_link; then
  4323.   rm -rf conftest*
  4324.   eval "ac_cv_func_siginterrupt=yes"
  4325. else
  4326.   rm -rf conftest*
  4327.   eval "ac_cv_func_siginterrupt=no"
  4328. fi
  4329. rm -f conftest*
  4330.  
  4331. fi
  4332. rm -f conftest*
  4333.  
  4334. fi
  4335. if eval "test \"`echo '$ac_cv_func_'siginterrupt`\" = yes"; then
  4336.   echo "$ac_t""yes" 1>&4
  4337.   cat >> confdefs.h <<\EOF
  4338. #define HAVE_SIGINTERRUPT 1
  4339. EOF
  4340.  
  4341. have_siginterrupt=1
  4342. else
  4343.   echo "$ac_t""no" 1>&4
  4344. fi
  4345. if test -z "$have_siginterrupt" -a -z "$have_sigaction"; then
  4346. for ac_func in sigvec
  4347. do
  4348. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  4349. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  4350.   echo $ac_n "(cached) $ac_c" 1>&4
  4351. else
  4352.   cat > conftest.$ac_ext <<EOF
  4353. #line 4354 "configure"
  4354. #include "confdefs.h"
  4355. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  4356. /* The GNU C library defines this for functions which it implements
  4357.     to always fail with ENOSYS.  Some functions are actually named
  4358.     something starting with __ and the normal name is an alias.  */
  4359. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  4360. choke me
  4361. #endif
  4362.  
  4363. EOF
  4364. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4365.   egrep "choke" >/dev/null 2>&1; then
  4366.   rm -rf conftest*
  4367.   eval "ac_cv_func_$ac_func=no"
  4368. else
  4369.   rm -rf conftest*
  4370.   cat > conftest.$ac_ext <<EOF
  4371. #line 4372 "configure"
  4372. #include "confdefs.h"
  4373. /* Override any gcc2 internal prototype to avoid an error.  */
  4374. char $ac_func(); 
  4375.  
  4376. int main() { return 0; }
  4377. int t() {
  4378.  
  4379. $ac_func();
  4380.  
  4381. ; return 0; }
  4382. EOF
  4383. if eval $ac_link; then
  4384.   rm -rf conftest*
  4385.   eval "ac_cv_func_$ac_func=yes"
  4386. else
  4387.   rm -rf conftest*
  4388.   eval "ac_cv_func_$ac_func=no"
  4389. fi
  4390. rm -f conftest*
  4391.  
  4392. fi
  4393. rm -f conftest*
  4394.  
  4395. fi
  4396. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  4397.   echo "$ac_t""yes" 1>&4
  4398.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  4399.   cat >> confdefs.h <<EOF
  4400. #define $ac_tr_func 1
  4401. EOF
  4402.  
  4403. else
  4404.   echo "$ac_t""no" 1>&4
  4405. fi
  4406. done
  4407. fi
  4408.  
  4409.                       echo $ac_n "checking for abort declaration""... $ac_c" 1>&4
  4410. if eval "test \"`echo '${'cl_cv_proto_abort'+set}'`\" = set"; then
  4411.   echo $ac_n "(cached) $ac_c" 1>&4
  4412. else
  4413.   cat > conftest.$ac_ext <<EOF
  4414. #line 4415 "configure"
  4415. #include "confdefs.h"
  4416.  
  4417. #ifdef STDC_HEADERS
  4418. #include <stdlib.h>
  4419. #endif
  4420. #ifdef HAVE_UNISTD_H
  4421. #include <unistd.h>
  4422. #endif
  4423.  
  4424. extern int abort();
  4425.  
  4426. int main() { return 0; }
  4427. int t() {
  4428.  
  4429. ; return 0; }
  4430. EOF
  4431. if eval $ac_compile; then
  4432.   rm -rf conftest*
  4433.   cl_cv_proto_abort_ret="int"
  4434. else
  4435.   rm -rf conftest*
  4436.   cl_cv_proto_abort_ret="void"
  4437. fi
  4438. rm -f conftest*
  4439.  
  4440.  
  4441. cat > conftest.$ac_ext <<EOF
  4442. #line 4443 "configure"
  4443. #include "confdefs.h"
  4444.  
  4445. #ifdef STDC_HEADERS
  4446. #include <stdlib.h>
  4447. #endif
  4448. #ifdef HAVE_UNISTD_H
  4449. #include <unistd.h>
  4450. #endif
  4451.  
  4452. extern $cl_cv_proto_abort_ret abort();
  4453.  
  4454. int main() { return 0; }
  4455. int t() {
  4456.  
  4457. ; return 0; }
  4458. EOF
  4459. if eval $ac_compile; then
  4460.   rm -rf conftest*
  4461.   cl_cv_proto_abort_vol=""
  4462. else
  4463.   rm -rf conftest*
  4464.   cl_cv_proto_abort_vol="__volatile__"
  4465. fi
  4466. rm -f conftest*
  4467.  
  4468.  
  4469.  
  4470. cl_cv_proto_abort="extern $cl_cv_proto_abort_vol $cl_cv_proto_abort_ret abort (void);"
  4471. fi
  4472.  
  4473. cl_cv_proto_abort=`echo "$cl_cv_proto_abort" | tr -s ' ' | sed -e 's/( /(/'`
  4474. echo "$ac_t""${ac_tt}$cl_cv_proto_abort" 1>&4
  4475.  
  4476.  
  4477. cat >> confdefs.h <<EOF
  4478. #define RETABORTTYPE $cl_cv_proto_abort_ret
  4479. EOF
  4480.  
  4481. cat >> confdefs.h <<EOF
  4482. #define ABORT_VOLATILE $cl_cv_proto_abort_vol
  4483. EOF
  4484.  
  4485.  
  4486.                       brackets='[]'
  4487. echo $ac_n "checking for sys_errlist declaration""... $ac_c" 1>&4
  4488. if eval "test \"`echo '${'cl_cv_proto_sys_errlist'+set}'`\" = set"; then
  4489.   echo $ac_n "(cached) $ac_c" 1>&4
  4490. else
  4491.   cat > conftest.$ac_ext <<EOF
  4492. #line 4493 "configure"
  4493. #include "confdefs.h"
  4494.  
  4495. /* Most systems declare sys_errlist in <errno.h>, NetBSD 1.0 in <stdio.h>. */
  4496. #include <stdio.h>
  4497. #include <errno.h>
  4498. extern char* sys_errlist $brackets ;
  4499.  
  4500. int main() { return 0; }
  4501. int t() {
  4502.  
  4503. ; return 0; }
  4504. EOF
  4505. if eval $ac_compile; then
  4506.   rm -rf conftest*
  4507.   cl_cv_proto_sys_errlist_const=""
  4508. else
  4509.   rm -rf conftest*
  4510.   cl_cv_proto_sys_errlist_const="const"
  4511. fi
  4512. rm -f conftest*
  4513.  
  4514.  
  4515. cl_cv_proto_sys_errlist="extern $cl_cv_proto_sys_errlist_const char* $cl_cv_proto_sys_errlist_const sys_errlist$brackets;"
  4516. fi
  4517.  
  4518. cl_cv_proto_sys_errlist=`echo "$cl_cv_proto_sys_errlist" | tr -s ' ' | sed -e 's/( /(/'`
  4519. echo "$ac_t""${ac_tt}$cl_cv_proto_sys_errlist" 1>&4
  4520.  
  4521.  
  4522. cat >> confdefs.h <<EOF
  4523. #define SYS_ERRLIST_CONST $cl_cv_proto_sys_errlist_const
  4524. EOF
  4525.  
  4526.  
  4527.                       echo $ac_n "checking for getenv declaration""... $ac_c" 1>&4
  4528. if eval "test \"`echo '${'cl_cv_proto_getenv'+set}'`\" = set"; then
  4529.   echo $ac_n "(cached) $ac_c" 1>&4
  4530. else
  4531.   cat > conftest.$ac_ext <<EOF
  4532. #line 4533 "configure"
  4533. #include "confdefs.h"
  4534.  
  4535. #ifdef STDC_HEADERS
  4536. #include <stdlib.h>
  4537. #endif
  4538. #ifdef HAVE_UNISTD_H
  4539. #include <unistd.h>
  4540. #endif
  4541.  
  4542. extern 
  4543. #ifdef __STDC__
  4544. char* getenv (char* name);
  4545. #else
  4546. char* getenv();
  4547. #endif
  4548.  
  4549. int main() { return 0; }
  4550. int t() {
  4551.  
  4552. ; return 0; }
  4553. EOF
  4554. if eval $ac_compile; then
  4555.   rm -rf conftest*
  4556.   cl_cv_proto_getenv_arg1=""
  4557. else
  4558.   rm -rf conftest*
  4559.   cl_cv_proto_getenv_arg1="const"
  4560. fi
  4561. rm -f conftest*
  4562.  
  4563.  
  4564.  
  4565.  
  4566. cl_cv_proto_getenv="extern char* getenv ($cl_cv_proto_getenv_arg1 char*);"
  4567. fi
  4568.  
  4569. cl_cv_proto_getenv=`echo "$cl_cv_proto_getenv" | tr -s ' ' | sed -e 's/( /(/'`
  4570. echo "$ac_t""${ac_tt}$cl_cv_proto_getenv" 1>&4
  4571.  
  4572.  
  4573. cat >> confdefs.h <<EOF
  4574. #define GETENV_CONST $cl_cv_proto_getenv_arg1
  4575. EOF
  4576.  
  4577.  
  4578.                       ac_safe=`echo "vfork.h" | tr './\055' '___'`
  4579. echo $ac_n "checking for vfork.h""... $ac_c" 1>&4
  4580. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  4581.   echo $ac_n "(cached) $ac_c" 1>&4
  4582. else
  4583.   cat > conftest.$ac_ext <<EOF
  4584. #line 4585 "configure"
  4585. #include "confdefs.h"
  4586. #include <vfork.h>
  4587. EOF
  4588. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  4589. ac_err=`grep -v '^ *+' conftest.out`
  4590. if test -z "$ac_err"; then
  4591.   rm -rf conftest*
  4592.   eval "ac_cv_header_$ac_safe=yes"
  4593. else
  4594.   echo "$ac_err" >&5
  4595.   rm -rf conftest*
  4596.   eval "ac_cv_header_$ac_safe=no"
  4597. fi
  4598. rm -f conftest*
  4599. fi
  4600. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  4601.   echo "$ac_t""yes" 1>&4
  4602.   cat >> confdefs.h <<\EOF
  4603. #define HAVE_VFORK_H 1
  4604. EOF
  4605.  
  4606. else
  4607.   echo "$ac_t""no" 1>&4
  4608. fi
  4609.  
  4610. echo $ac_n "checking for working vfork""... $ac_c" 1>&4
  4611. if eval "test \"`echo '${'ac_cv_func_vfork'+set}'`\" = set"; then
  4612.   echo $ac_n "(cached) $ac_c" 1>&4
  4613. else
  4614.   
  4615. if test "$cross_compiling" = yes; then
  4616.   ac_cv_func_vfork=no
  4617. else
  4618. cat > conftest.$ac_ext <<EOF
  4619. #line 4620 "configure"
  4620. #include "confdefs.h"
  4621. /* Thanks to Paul Eggert for this test.  */
  4622. #include <stdio.h>
  4623. #include <sys/types.h>
  4624. #include <sys/stat.h>
  4625. #include <signal.h>
  4626. #ifdef HAVE_UNISTD_H
  4627. #include <unistd.h>
  4628. #endif
  4629. #ifdef HAVE_VFORK_H
  4630. #include <vfork.h>
  4631. #endif
  4632. /* On sparc systems, changes by the child to local and incoming
  4633.    argument registers are propagated back to the parent.
  4634.    The compiler is told about this with #include <vfork.h>,
  4635.    but some compilers (e.g. gcc -O) don't grok <vfork.h>.
  4636.    Test for this by using a static variable whose address
  4637.    is put into a register that is clobbered by the vfork.  */
  4638. static
  4639. #ifdef __cplusplus
  4640. sparc_address_test (int arg)
  4641. #else
  4642. sparc_address_test (arg) int arg;
  4643. #endif
  4644. {
  4645.   static pid_t child;
  4646.   if (!child) {
  4647.     child = vfork ();
  4648.     if (child < 0)
  4649.       perror ("vfork");
  4650.     if (!child) {
  4651.       arg = getpid();
  4652.       write(-1, "", 0);
  4653.       _exit (arg);
  4654.     }
  4655.   }
  4656. }
  4657. static int signalled;
  4658. static RETSIGTYPE catch (s) int s; { signalled = 1; }
  4659. main() {
  4660.   pid_t parent = getpid ();
  4661.   pid_t child;
  4662.  
  4663.   sparc_address_test ();
  4664.  
  4665.   signal (SIGINT, catch);
  4666.  
  4667.   child = vfork ();
  4668.  
  4669.   if (child == 0) {
  4670.     /* Here is another test for sparc vfork register problems.
  4671.        This test uses lots of local variables, at least
  4672.        as many local variables as main has allocated so far
  4673.        including compiler temporaries.  4 locals are enough for
  4674.        gcc 1.40.3 on a sparc, but we use 8 to be safe.
  4675.        A buggy compiler should reuse the register of parent
  4676.        for one of the local variables, since it will think that
  4677.        parent can't possibly be used any more in this routine.
  4678.        Assigning to the local variable will thus munge parent
  4679.        in the parent process.  */
  4680.     pid_t
  4681.       p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(),
  4682.       p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid();
  4683.     /* Convince the compiler that p..p7 are live; otherwise, it might
  4684.        use the same hardware register for all 8 local variables.  */
  4685.     if (p != p1 || p != p2 || p != p3 || p != p4
  4686.     || p != p5 || p != p6 || p != p7)
  4687.       _exit(1);
  4688.  
  4689.     /* On some systems (e.g. SunOS 5.2), if the parent is catching
  4690.        a signal, the child ignores the signal before execing,
  4691.        and the parent later receives that signal, the parent dumps core.
  4692.        Test for this by ignoring SIGINT in the child.  */
  4693.     signal (SIGINT, SIG_IGN);
  4694.  
  4695.     /* On some systems (e.g. IRIX 3.3),
  4696.        vfork doesn't separate parent from child file descriptors.
  4697.        If the child closes a descriptor before it execs or exits,
  4698.        this munges the parent's descriptor as well.
  4699.        Test for this by closing stdout in the child.  */
  4700.     _exit(close(fileno(stdout)) != 0);
  4701.   } else {
  4702.     int status;
  4703.     struct stat st;
  4704.  
  4705.     while (wait(&status) != child)
  4706.       ;
  4707.     exit(
  4708.      /* Was there some problem with vforking?  */
  4709.      child < 0
  4710.  
  4711.      /* Did the child fail?  (This shouldn't happen.)  */
  4712.      || status
  4713.  
  4714.      /* Did the vfork/compiler bug occur?  */
  4715.      || parent != getpid()
  4716.  
  4717.      /* Did the signal handling bug occur?  */
  4718.      || kill(parent, SIGINT) != 0
  4719.      || signalled != 1
  4720.  
  4721.      /* Did the file descriptor bug occur?  */
  4722.      || fstat(fileno(stdout), &st) != 0
  4723.      );
  4724.   }
  4725. }
  4726. EOF
  4727. eval $ac_link
  4728. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  4729.   ac_cv_func_vfork=yes
  4730. else
  4731.   ac_cv_func_vfork=no
  4732. fi
  4733. if test -f core; then
  4734.   coredir=core`/bin/sh -c 'echo $$'`
  4735.   mkdir $coredir
  4736.   cp confdefs.h $coredir/confdefs.h
  4737.   mv conftest.c $coredir/conftest.c
  4738.   mv conftest $coredir/conftest
  4739.   mv core $coredir/core
  4740.   echo "warning: test program dumped core -- see subdirectory $coredir"
  4741. fi
  4742. fi
  4743. rm -fr conftest*
  4744. fi
  4745. echo "$ac_t""$ac_cv_func_vfork" 1>&4
  4746. if test $ac_cv_func_vfork = no; then
  4747.   cat >> confdefs.h <<\EOF
  4748. #define vfork fork
  4749. EOF
  4750.  
  4751. fi
  4752.  
  4753.                       echo $ac_n "checking for vfork declaration""... $ac_c" 1>&4
  4754. if eval "test \"`echo '${'cl_cv_proto_vfork'+set}'`\" = set"; then
  4755.   echo $ac_n "(cached) $ac_c" 1>&4
  4756. else
  4757.   cat > conftest.$ac_ext <<EOF
  4758. #line 4759 "configure"
  4759. #include "confdefs.h"
  4760.  
  4761. #ifdef STDC_HEADERS
  4762. #include <stdlib.h>
  4763. #endif
  4764. #ifdef HAVE_UNISTD_H
  4765. #include <unistd.h>
  4766. #endif
  4767. #ifdef HAVE_VFORK_H
  4768. #include <vfork.h>
  4769. #endif
  4770.  
  4771. extern 
  4772. #ifdef __STDC__
  4773. pid_t vfork (void);
  4774. #else
  4775. pid_t vfork();
  4776. #endif
  4777.  
  4778. int main() { return 0; }
  4779. int t() {
  4780.  
  4781. ; return 0; }
  4782. EOF
  4783. if eval $ac_compile; then
  4784.   rm -rf conftest*
  4785.   cl_cv_proto_vfork_ret="pid_t"
  4786. else
  4787.   rm -rf conftest*
  4788.   cl_cv_proto_vfork_ret="int"
  4789. fi
  4790. rm -f conftest*
  4791.  
  4792.  
  4793.  
  4794. cl_cv_proto_vfork="extern $cl_cv_proto_vfork_ret vfork (void);"
  4795. fi
  4796.  
  4797. cl_cv_proto_vfork=`echo "$cl_cv_proto_vfork" | tr -s ' ' | sed -e 's/( /(/'`
  4798. echo "$ac_t""${ac_tt}$cl_cv_proto_vfork" 1>&4
  4799.  
  4800.  
  4801. cat >> confdefs.h <<EOF
  4802. #define RETVFORKTYPE $cl_cv_proto_vfork_ret
  4803. EOF
  4804.  
  4805.  
  4806.                       for ac_func in setsid setpgid
  4807. do
  4808. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  4809. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  4810.   echo $ac_n "(cached) $ac_c" 1>&4
  4811. else
  4812.   cat > conftest.$ac_ext <<EOF
  4813. #line 4814 "configure"
  4814. #include "confdefs.h"
  4815. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  4816. /* The GNU C library defines this for functions which it implements
  4817.     to always fail with ENOSYS.  Some functions are actually named
  4818.     something starting with __ and the normal name is an alias.  */
  4819. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  4820. choke me
  4821. #endif
  4822.  
  4823. EOF
  4824. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  4825.   egrep "choke" >/dev/null 2>&1; then
  4826.   rm -rf conftest*
  4827.   eval "ac_cv_func_$ac_func=no"
  4828. else
  4829.   rm -rf conftest*
  4830.   cat > conftest.$ac_ext <<EOF
  4831. #line 4832 "configure"
  4832. #include "confdefs.h"
  4833. /* Override any gcc2 internal prototype to avoid an error.  */
  4834. char $ac_func(); 
  4835.  
  4836. int main() { return 0; }
  4837. int t() {
  4838.  
  4839. $ac_func();
  4840.  
  4841. ; return 0; }
  4842. EOF
  4843. if eval $ac_link; then
  4844.   rm -rf conftest*
  4845.   eval "ac_cv_func_$ac_func=yes"
  4846. else
  4847.   rm -rf conftest*
  4848.   eval "ac_cv_func_$ac_func=no"
  4849. fi
  4850. rm -f conftest*
  4851.  
  4852. fi
  4853. rm -f conftest*
  4854.  
  4855. fi
  4856. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  4857.   echo "$ac_t""yes" 1>&4
  4858.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  4859.   cat >> confdefs.h <<EOF
  4860. #define $ac_tr_func 1
  4861. EOF
  4862.  
  4863. else
  4864.   echo "$ac_t""no" 1>&4
  4865. fi
  4866. done
  4867.  
  4868.                       brackets='[]'
  4869. echo $ac_n "checking for execv declaration""... $ac_c" 1>&4
  4870. if eval "test \"`echo '${'cl_cv_proto_execv'+set}'`\" = set"; then
  4871.   echo $ac_n "(cached) $ac_c" 1>&4
  4872. else
  4873.   for z in '' 'const'; do
  4874. for y in '' 'const'; do
  4875. for x in '' 'const'; do
  4876. if test -z "$have_execv"; then
  4877. cat > conftest.$ac_ext <<EOF
  4878. #line 4879 "configure"
  4879. #include "confdefs.h"
  4880.  
  4881. #ifdef STDC_HEADERS
  4882. #include <stdlib.h>
  4883. #endif
  4884. #ifdef HAVE_UNISTD_H
  4885. #include <unistd.h>
  4886. #endif
  4887. extern 
  4888. #ifdef __STDC__
  4889. int execv ($x char* path, $y char* $z argv$brackets);
  4890. #else
  4891. int execv();
  4892. #endif
  4893.  
  4894. int main() { return 0; }
  4895. int t() {
  4896.  
  4897. ; return 0; }
  4898. EOF
  4899. if eval $ac_compile; then
  4900.   rm -rf conftest*
  4901.   cl_cv_proto_execv_arg1="$x"
  4902. cl_cv_proto_execv_arg2a="$y"
  4903. cl_cv_proto_execv_arg2b="$z"
  4904. have_execv=1
  4905. fi
  4906. rm -f conftest*
  4907.  
  4908. fi
  4909. done
  4910. done
  4911. done
  4912.  
  4913. cl_cv_proto_execv="extern int execv ($cl_cv_proto_execv_arg1 char*, $cl_cv_proto_execv_arg2a char* $cl_cv_proto_execv_arg2b$brackets);"
  4914. fi
  4915.  
  4916. cl_cv_proto_execv=`echo "$cl_cv_proto_execv" | tr -s ' ' | sed -e 's/( /(/'`
  4917. echo "$ac_t""${ac_tt}$cl_cv_proto_execv" 1>&4
  4918.  
  4919.  
  4920. cat >> confdefs.h <<EOF
  4921. #define EXECV_CONST $cl_cv_proto_execv_arg1
  4922. EOF
  4923.  
  4924. cat >> confdefs.h <<EOF
  4925. #define EXECV1_CONST $cl_cv_proto_execv_arg2a
  4926. EOF
  4927.  
  4928. cat >> confdefs.h <<EOF
  4929. #define EXECV2_CONST $cl_cv_proto_execv_arg2b
  4930. EOF
  4931.  
  4932.  
  4933.                       echo $ac_n "checking for execl declaration""... $ac_c" 1>&4
  4934. if eval "test \"`echo '${'cl_cv_proto_execl'+set}'`\" = set"; then
  4935.   echo $ac_n "(cached) $ac_c" 1>&4
  4936. else
  4937.   for x in '' 'const'; do
  4938. if test -z "$have_execl"; then
  4939. cat > conftest.$ac_ext <<EOF
  4940. #line 4941 "configure"
  4941. #include "confdefs.h"
  4942.  
  4943. #ifdef STDC_HEADERS
  4944. #include <stdlib.h>
  4945. #endif
  4946. #ifdef HAVE_UNISTD_H
  4947. #include <unistd.h>
  4948. #endif
  4949. extern 
  4950. #ifdef __STDC__
  4951. int execl (EXECV_CONST char* path, $x char* arg, ...);
  4952. #else
  4953. int execl();
  4954. #endif
  4955.  
  4956. int main() { return 0; }
  4957. int t() {
  4958.  
  4959. ; return 0; }
  4960. EOF
  4961. if eval $ac_compile; then
  4962.   rm -rf conftest*
  4963.    cl_cv_proto_execl_arg2="$x"
  4964. cl_cv_proto_execl_dots=yes
  4965. cl_cv_proto_execl_args="$cl_cv_proto_execv_arg1 char*, $cl_cv_proto_execl_arg2 char*, ..."
  4966. have_execl=1
  4967. fi
  4968. rm -f conftest*
  4969.  
  4970. fi
  4971. done
  4972. for x in '' 'const'; do
  4973. if test -z "$have_execl"; then
  4974. cat > conftest.$ac_ext <<EOF
  4975. #line 4976 "configure"
  4976. #include "confdefs.h"
  4977.  
  4978. #ifdef STDC_HEADERS
  4979. #include <stdlib.h>
  4980. #endif
  4981. #ifdef HAVE_UNISTD_H
  4982. #include <unistd.h>
  4983. #endif
  4984. extern 
  4985. #ifdef __STDC__
  4986. int execl (EXECV_CONST char* path, $x char* arg0, $x char* arg1, $x char* arg2, $x char* arg3);
  4987. #else
  4988. int execl();
  4989. #endif
  4990.  
  4991. int main() { return 0; }
  4992. int t() {
  4993.  
  4994. ; return 0; }
  4995. EOF
  4996. if eval $ac_compile; then
  4997.   rm -rf conftest*
  4998.    cl_cv_proto_execl_arg2="$x"
  4999. cl_cv_proto_execl_dots=no
  5000. cl_cv_proto_execl_args="$cl_cv_proto_execv_arg1 char*, $cl_cv_proto_execl_arg2 char*, $cl_cv_proto_execl_arg2 char*, $cl_cv_proto_execl_arg2 char*, $cl_cv_proto_execl_arg2 char*"
  5001. have_execl=1
  5002. fi
  5003. rm -f conftest*
  5004.  
  5005. fi
  5006. done
  5007.  
  5008. cl_cv_proto_execl="extern int execl ($cl_cv_proto_execl_args);"
  5009. fi
  5010.  
  5011. cl_cv_proto_execl=`echo "$cl_cv_proto_execl" | tr -s ' ' | sed -e 's/( /(/'`
  5012. echo "$ac_t""${ac_tt}$cl_cv_proto_execl" 1>&4
  5013.  
  5014.  
  5015. cat >> confdefs.h <<EOF
  5016. #define EXECL_CONST $cl_cv_proto_execl_arg2
  5017. EOF
  5018.  
  5019. if test $cl_cv_proto_execl_dots = yes; then
  5020.   cat >> confdefs.h <<\EOF
  5021. #define EXECL_DOTS 1
  5022. EOF
  5023.  
  5024. fi
  5025.  
  5026.                       for ac_func in waitpid
  5027. do
  5028. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  5029. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  5030.   echo $ac_n "(cached) $ac_c" 1>&4
  5031. else
  5032.   cat > conftest.$ac_ext <<EOF
  5033. #line 5034 "configure"
  5034. #include "confdefs.h"
  5035. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  5036. /* The GNU C library defines this for functions which it implements
  5037.     to always fail with ENOSYS.  Some functions are actually named
  5038.     something starting with __ and the normal name is an alias.  */
  5039. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  5040. choke me
  5041. #endif
  5042.  
  5043. EOF
  5044. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  5045.   egrep "choke" >/dev/null 2>&1; then
  5046.   rm -rf conftest*
  5047.   eval "ac_cv_func_$ac_func=no"
  5048. else
  5049.   rm -rf conftest*
  5050.   cat > conftest.$ac_ext <<EOF
  5051. #line 5052 "configure"
  5052. #include "confdefs.h"
  5053. /* Override any gcc2 internal prototype to avoid an error.  */
  5054. char $ac_func(); 
  5055.  
  5056. int main() { return 0; }
  5057. int t() {
  5058.  
  5059. $ac_func();
  5060.  
  5061. ; return 0; }
  5062. EOF
  5063. if eval $ac_link; then
  5064.   rm -rf conftest*
  5065.   eval "ac_cv_func_$ac_func=yes"
  5066. else
  5067.   rm -rf conftest*
  5068.   eval "ac_cv_func_$ac_func=no"
  5069. fi
  5070. rm -f conftest*
  5071.  
  5072. fi
  5073. rm -f conftest*
  5074.  
  5075. fi
  5076. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  5077.   echo "$ac_t""yes" 1>&4
  5078.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  5079.   cat >> confdefs.h <<EOF
  5080. #define $ac_tr_func 1
  5081. EOF
  5082.  
  5083. else
  5084.   echo "$ac_t""no" 1>&4
  5085. fi
  5086. done
  5087.  
  5088. if test $ac_cv_func_waitpid = yes; then
  5089. echo $ac_n "checking for waitpid declaration""... $ac_c" 1>&4
  5090. if eval "test \"`echo '${'cl_cv_proto_waitpid'+set}'`\" = set"; then
  5091.   echo $ac_n "(cached) $ac_c" 1>&4
  5092. else
  5093.   cat > conftest.$ac_ext <<EOF
  5094. #line 5095 "configure"
  5095. #include "confdefs.h"
  5096.  
  5097. #ifdef STDC_HEADERS
  5098. #include <stdlib.h>
  5099. #endif
  5100. #ifdef HAVE_UNISTD_H
  5101. #include <unistd.h>
  5102. #endif
  5103.  
  5104. extern 
  5105. #ifdef __STDC__
  5106. pid_t waitpid (pid_t pid, int* statusp, int options);
  5107. #else
  5108. pid_t waitpid();
  5109. #endif
  5110.  
  5111. int main() { return 0; }
  5112. int t() {
  5113.  
  5114. ; return 0; }
  5115. EOF
  5116. if eval $ac_compile; then
  5117.   rm -rf conftest*
  5118.   cl_cv_proto_waitpid_arg1="pid_t"
  5119. else
  5120.   rm -rf conftest*
  5121.   cl_cv_proto_waitpid_arg1="int"
  5122. fi
  5123. rm -f conftest*
  5124.  
  5125.  
  5126.  
  5127. cl_cv_proto_waitpid="extern pid_t waitpid ($cl_cv_proto_waitpid_arg1, int*, int);"
  5128. fi
  5129.  
  5130. cl_cv_proto_waitpid=`echo "$cl_cv_proto_waitpid" | tr -s ' ' | sed -e 's/( /(/'`
  5131. echo "$ac_t""${ac_tt}$cl_cv_proto_waitpid" 1>&4
  5132.  
  5133.  
  5134. cat >> confdefs.h <<EOF
  5135. #define PID_T $cl_cv_proto_waitpid_arg1
  5136. EOF
  5137.  
  5138. else
  5139. for ac_hdr in sys/wait.h
  5140. do
  5141. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  5142. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  5143. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  5144.   echo $ac_n "(cached) $ac_c" 1>&4
  5145. else
  5146.   cat > conftest.$ac_ext <<EOF
  5147. #line 5148 "configure"
  5148. #include "confdefs.h"
  5149. #include <$ac_hdr>
  5150. EOF
  5151. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  5152. ac_err=`grep -v '^ *+' conftest.out`
  5153. if test -z "$ac_err"; then
  5154.   rm -rf conftest*
  5155.   eval "ac_cv_header_$ac_safe=yes"
  5156. else
  5157.   echo "$ac_err" >&5
  5158.   rm -rf conftest*
  5159.   eval "ac_cv_header_$ac_safe=no"
  5160. fi
  5161. rm -f conftest*
  5162. fi
  5163. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  5164.   echo "$ac_t""yes" 1>&4
  5165.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  5166.   cat >> confdefs.h <<EOF
  5167. #define $ac_tr_hdr 1
  5168. EOF
  5169.  
  5170. else
  5171.   echo "$ac_t""no" 1>&4
  5172. fi
  5173. done
  5174. fi
  5175.  
  5176.                       for ac_hdr in sys/resource.h sys/times.h
  5177. do
  5178. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  5179. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  5180. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  5181.   echo $ac_n "(cached) $ac_c" 1>&4
  5182. else
  5183.   cat > conftest.$ac_ext <<EOF
  5184. #line 5185 "configure"
  5185. #include "confdefs.h"
  5186. #include <$ac_hdr>
  5187. EOF
  5188. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  5189. ac_err=`grep -v '^ *+' conftest.out`
  5190. if test -z "$ac_err"; then
  5191.   rm -rf conftest*
  5192.   eval "ac_cv_header_$ac_safe=yes"
  5193. else
  5194.   echo "$ac_err" >&5
  5195.   rm -rf conftest*
  5196.   eval "ac_cv_header_$ac_safe=no"
  5197. fi
  5198. rm -f conftest*
  5199. fi
  5200. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  5201.   echo "$ac_t""yes" 1>&4
  5202.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  5203.   cat >> confdefs.h <<EOF
  5204. #define $ac_tr_hdr 1
  5205. EOF
  5206.  
  5207. else
  5208.   echo "$ac_t""no" 1>&4
  5209. fi
  5210. done
  5211. if test $ac_cv_header_sys_resource_h = yes; then
  5212.     echo $ac_n "checking for getrusage""... $ac_c" 1>&4
  5213. if eval "test \"`echo '${'cl_cv_func_getrusage'+set}'`\" = set"; then
  5214.   echo $ac_n "(cached) $ac_c" 1>&4
  5215. else
  5216.   
  5217. cat > conftest.$ac_ext <<EOF
  5218. #line 5219 "configure"
  5219. #include "confdefs.h"
  5220. #include <sys/types.h> /* NetBSD 1.0 needs this */
  5221. #include <sys/time.h>
  5222. #include <sys/resource.h>
  5223. int main() { return 0; }
  5224. int t() {
  5225. struct rusage x; int y = RUSAGE_SELF; getrusage(y,&x); x.ru_utime.tv_sec;
  5226. ; return 0; }
  5227. EOF
  5228. if eval $ac_compile; then
  5229.   rm -rf conftest*
  5230.   cl_cv_func_getrusage=yes
  5231. else
  5232.   rm -rf conftest*
  5233.   cl_cv_func_getrusage=no
  5234. fi
  5235. rm -f conftest*
  5236.  
  5237.  
  5238. fi
  5239.  
  5240. echo "$ac_t""$cl_cv_func_getrusage" 1>&4
  5241. if test $cl_cv_func_getrusage = yes; then
  5242.   cat >> confdefs.h <<\EOF
  5243. #define HAVE_GETRUSAGE 1
  5244. EOF
  5245.  
  5246. fi
  5247. fi
  5248.  
  5249.                       
  5250. echo $ac_n "checking for getwd""... $ac_c" 1>&4
  5251. if eval "test \"`echo '${'cl_cv_func_getwd'+set}'`\" = set"; then
  5252.   echo $ac_n "(cached) $ac_c" 1>&4
  5253. else
  5254.   
  5255. cat > conftest.$ac_ext <<EOF
  5256. #line 5257 "configure"
  5257. #include "confdefs.h"
  5258.  
  5259. int main() { return 0; }
  5260. int t() {
  5261. getwd();
  5262. ; return 0; }
  5263. EOF
  5264. if eval $ac_link; then
  5265.   rm -rf conftest*
  5266.   cl_cv_func_getwd=yes
  5267. else
  5268.   rm -rf conftest*
  5269.   cl_cv_func_getwd=no
  5270. fi
  5271. rm -f conftest*
  5272.  
  5273.  
  5274. fi
  5275.  
  5276. echo "$ac_t""$cl_cv_func_getwd" 1>&4
  5277. if test $cl_cv_func_getwd = yes; then
  5278.   cat >> confdefs.h <<\EOF
  5279. #define HAVE_GETWD 1
  5280. EOF
  5281.  
  5282. fi
  5283.  
  5284.  
  5285.                       if test $cl_cv_func_getwd = no; then
  5286. echo $ac_n "checking for getcwd declaration""... $ac_c" 1>&4
  5287. if eval "test \"`echo '${'cl_cv_proto_getcwd'+set}'`\" = set"; then
  5288.   echo $ac_n "(cached) $ac_c" 1>&4
  5289. else
  5290.   cat > conftest.$ac_ext <<EOF
  5291. #line 5292 "configure"
  5292. #include "confdefs.h"
  5293.  
  5294. #ifdef STDC_HEADERS
  5295. #include <stdlib.h>
  5296. #endif
  5297. #ifdef HAVE_UNISTD_H
  5298. #include <unistd.h>
  5299. #endif
  5300.  
  5301. extern 
  5302. #ifdef __STDC__
  5303. char* getcwd (char* buf, int bufsize);
  5304. #else
  5305. char* getcwd();
  5306. #endif
  5307.  
  5308. int main() { return 0; }
  5309. int t() {
  5310.  
  5311. ; return 0; }
  5312. EOF
  5313. if eval $ac_compile; then
  5314.   rm -rf conftest*
  5315.   cl_cv_proto_getcwd_arg2="int"
  5316. else
  5317.   rm -rf conftest*
  5318.   cl_cv_proto_getcwd_arg2="size_t"
  5319. fi
  5320. rm -f conftest*
  5321.  
  5322.  
  5323.  
  5324. cl_cv_proto_getcwd="extern char* getcwd (char*, $cl_cv_proto_getcwd_arg2);"
  5325. fi
  5326.  
  5327. cl_cv_proto_getcwd=`echo "$cl_cv_proto_getcwd" | tr -s ' ' | sed -e 's/( /(/'`
  5328. echo "$ac_t""${ac_tt}$cl_cv_proto_getcwd" 1>&4
  5329.  
  5330.  
  5331. cat >> confdefs.h <<EOF
  5332. #define GETCWD_SIZE_T $cl_cv_proto_getcwd_arg2
  5333. EOF
  5334.  
  5335. fi
  5336.  
  5337.                       echo $ac_n "checking for chdir declaration""... $ac_c" 1>&4
  5338. if eval "test \"`echo '${'cl_cv_proto_chdir'+set}'`\" = set"; then
  5339.   echo $ac_n "(cached) $ac_c" 1>&4
  5340. else
  5341.   cat > conftest.$ac_ext <<EOF
  5342. #line 5343 "configure"
  5343. #include "confdefs.h"
  5344.  
  5345. #ifdef STDC_HEADERS
  5346. #include <stdlib.h>
  5347. #endif
  5348. #ifdef HAVE_UNISTD_H
  5349. #include <unistd.h>
  5350. #endif
  5351.  
  5352. extern 
  5353. #ifdef __STDC__
  5354. int chdir (char* path);
  5355. #else
  5356. int chdir();
  5357. #endif
  5358.  
  5359. int main() { return 0; }
  5360. int t() {
  5361.  
  5362. ; return 0; }
  5363. EOF
  5364. if eval $ac_compile; then
  5365.   rm -rf conftest*
  5366.   cl_cv_proto_chdir_arg1=""
  5367. else
  5368.   rm -rf conftest*
  5369.   cl_cv_proto_chdir_arg1="const"
  5370. fi
  5371. rm -f conftest*
  5372.  
  5373.  
  5374.  
  5375.  
  5376. cl_cv_proto_chdir="extern int chdir ($cl_cv_proto_chdir_arg1 char*);"
  5377. fi
  5378.  
  5379. cl_cv_proto_chdir=`echo "$cl_cv_proto_chdir" | tr -s ' ' | sed -e 's/( /(/'`
  5380. echo "$ac_t""${ac_tt}$cl_cv_proto_chdir" 1>&4
  5381.  
  5382.  
  5383. cat >> confdefs.h <<EOF
  5384. #define CHDIR_CONST $cl_cv_proto_chdir_arg1
  5385. EOF
  5386.  
  5387.  
  5388.                       echo $ac_n "checking for mkdir declaration""... $ac_c" 1>&4
  5389. if eval "test \"`echo '${'cl_cv_proto_mkdir'+set}'`\" = set"; then
  5390.   echo $ac_n "(cached) $ac_c" 1>&4
  5391. else
  5392.   cat > conftest.$ac_ext <<EOF
  5393. #line 5394 "configure"
  5394. #include "confdefs.h"
  5395. #include <sys/types.h>
  5396. EOF
  5397. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  5398.   egrep "mode_t" >/dev/null 2>&1; then
  5399.   rm -rf conftest*
  5400.   cat > conftest.$ac_ext <<EOF
  5401. #line 5402 "configure"
  5402. #include "confdefs.h"
  5403.  
  5404. #ifdef STDC_HEADERS
  5405. #include <stdlib.h>
  5406. #endif
  5407. #ifdef HAVE_UNISTD_H
  5408. #include <unistd.h>
  5409. #endif
  5410. #include <sys/types.h>
  5411. #include <sys/stat.h>
  5412.  
  5413. extern 
  5414. #ifdef __STDC__
  5415. int mkdir (char* path, mode_t mode);
  5416. #else
  5417. int mkdir();
  5418. #endif
  5419.  
  5420. int main() { return 0; }
  5421. int t() {
  5422.  
  5423. ; return 0; }
  5424. EOF
  5425. if eval $ac_compile; then
  5426.   rm -rf conftest*
  5427.   mode_t_unneeded=1
  5428. fi
  5429. rm -f conftest*
  5430.  
  5431.  
  5432. if test -z "$mode_t_unneeded"; then
  5433. cat > conftest.$ac_ext <<EOF
  5434. #line 5435 "configure"
  5435. #include "confdefs.h"
  5436.  
  5437. #ifdef STDC_HEADERS
  5438. #include <stdlib.h>
  5439. #endif
  5440. #ifdef HAVE_UNISTD_H
  5441. #include <unistd.h>
  5442. #endif
  5443. #include <sys/types.h>
  5444. #include <sys/stat.h>
  5445.  
  5446. extern 
  5447. #ifdef __STDC__
  5448. int mkdir (const char* path, mode_t mode);
  5449. #else
  5450. int mkdir();
  5451. #endif
  5452.  
  5453. int main() { return 0; }
  5454. int t() {
  5455.  
  5456. ; return 0; }
  5457. EOF
  5458. if eval $ac_compile; then
  5459.   rm -rf conftest*
  5460.   mode_t_unneeded=1
  5461. fi
  5462. rm -f conftest*
  5463.  
  5464.  
  5465. fi
  5466. fi
  5467. rm -f conftest*
  5468. if test -n "$mode_t_unneeded"; then
  5469. cl_cv_type_mode_t="mode_t"
  5470. else
  5471. cl_cv_type_mode_t="int"
  5472. fi
  5473. cat > conftest.$ac_ext <<EOF
  5474. #line 5475 "configure"
  5475. #include "confdefs.h"
  5476.  
  5477. #ifdef STDC_HEADERS
  5478. #include <stdlib.h>
  5479. #endif
  5480. #ifdef HAVE_UNISTD_H
  5481. #include <unistd.h>
  5482. #endif
  5483. #include <sys/types.h>
  5484. #include <sys/stat.h>
  5485.  
  5486. extern 
  5487. #ifdef __STDC__
  5488. int mkdir (char* path, $cl_cv_type_mode_t mode);
  5489. #else
  5490. int mkdir();
  5491. #endif
  5492.  
  5493. int main() { return 0; }
  5494. int t() {
  5495.  
  5496. ; return 0; }
  5497. EOF
  5498. if eval $ac_compile; then
  5499.   rm -rf conftest*
  5500.   cl_cv_proto_mkdir_arg1=""
  5501. else
  5502.   rm -rf conftest*
  5503.   cl_cv_proto_mkdir_arg1="const"
  5504. fi
  5505. rm -f conftest*
  5506.  
  5507.  
  5508.  
  5509.  
  5510. cl_cv_proto_mkdir="extern int mkdir ($cl_cv_proto_mkdir_arg1 char*, $cl_cv_type_mode_t);"
  5511. fi
  5512.  
  5513. cl_cv_proto_mkdir=`echo "$cl_cv_proto_mkdir" | tr -s ' ' | sed -e 's/( /(/'`
  5514. echo "$ac_t""${ac_tt}$cl_cv_proto_mkdir" 1>&4
  5515.  
  5516.  
  5517. cat >> confdefs.h <<EOF
  5518. #define MODE_T $cl_cv_type_mode_t
  5519. EOF
  5520.  
  5521. cat >> confdefs.h <<EOF
  5522. #define MKDIR_CONST $cl_cv_proto_mkdir_arg1
  5523. EOF
  5524.  
  5525.  
  5526.                       echo $ac_n "checking for rmdir declaration""... $ac_c" 1>&4
  5527. if eval "test \"`echo '${'cl_cv_proto_rmdir'+set}'`\" = set"; then
  5528.   echo $ac_n "(cached) $ac_c" 1>&4
  5529. else
  5530.   cat > conftest.$ac_ext <<EOF
  5531. #line 5532 "configure"
  5532. #include "confdefs.h"
  5533.  
  5534. #ifdef STDC_HEADERS
  5535. #include <stdlib.h>
  5536. #endif
  5537. #ifdef HAVE_UNISTD_H
  5538. #include <unistd.h>
  5539. #endif
  5540.  
  5541. extern 
  5542. #ifdef __STDC__
  5543. int rmdir (char* path);
  5544. #else
  5545. int rmdir();
  5546. #endif
  5547.  
  5548. int main() { return 0; }
  5549. int t() {
  5550.  
  5551. ; return 0; }
  5552. EOF
  5553. if eval $ac_compile; then
  5554.   rm -rf conftest*
  5555.   cl_cv_proto_rmdir_arg1=""
  5556. else
  5557.   rm -rf conftest*
  5558.   cl_cv_proto_rmdir_arg1="const"
  5559. fi
  5560. rm -f conftest*
  5561.  
  5562.  
  5563.  
  5564.  
  5565. cl_cv_proto_rmdir="extern int rmdir ($cl_cv_proto_rmdir_arg1 char*);"
  5566. fi
  5567.  
  5568. cl_cv_proto_rmdir=`echo "$cl_cv_proto_rmdir" | tr -s ' ' | sed -e 's/( /(/'`
  5569. echo "$ac_t""${ac_tt}$cl_cv_proto_rmdir" 1>&4
  5570.  
  5571.  
  5572. cat >> confdefs.h <<EOF
  5573. #define RMDIR_CONST $cl_cv_proto_rmdir_arg1
  5574. EOF
  5575.  
  5576.  
  5577.                       echo $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&4
  5578. if eval "test \"`echo '${'ac_cv_header_stat_broken'+set}'`\" = set"; then
  5579.   echo $ac_n "(cached) $ac_c" 1>&4
  5580. else
  5581.   cat > conftest.$ac_ext <<EOF
  5582. #line 5583 "configure"
  5583. #include "confdefs.h"
  5584. #include <sys/types.h>
  5585. #include <sys/stat.h>
  5586. #ifdef S_ISBLK
  5587. # if S_ISBLK (S_IFDIR)
  5588. You lose.
  5589. # endif
  5590. # ifdef S_IFCHR
  5591. #  if S_ISBLK (S_IFCHR)
  5592. You lose.
  5593. #  endif
  5594. # endif
  5595. #endif
  5596.  
  5597. #ifdef S_ISLNK
  5598. # if S_ISLNK (S_IFREG)
  5599. You lose.
  5600. # endif
  5601. #endif
  5602.  
  5603. #ifdef S_ISSOCK
  5604. # if S_ISSOCK (S_IFREG)
  5605. You lose.
  5606. # endif
  5607. #endif
  5608.  
  5609. EOF
  5610. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  5611.   egrep "You lose" >/dev/null 2>&1; then
  5612.   rm -rf conftest*
  5613.   ac_cv_header_stat_broken=yes
  5614. else
  5615.   rm -rf conftest*
  5616.   ac_cv_header_stat_broken=no
  5617. fi
  5618. rm -f conftest*
  5619.  
  5620. fi
  5621. echo "$ac_t""$ac_cv_header_stat_broken" 1>&4
  5622. if test $ac_cv_header_stat_broken = yes; then
  5623.   cat >> confdefs.h <<\EOF
  5624. #define STAT_MACROS_BROKEN 1
  5625. EOF
  5626.  
  5627. fi
  5628.  
  5629.                       echo $ac_n "checking for stat declaration""... $ac_c" 1>&4
  5630. if eval "test \"`echo '${'cl_cv_proto_stat'+set}'`\" = set"; then
  5631.   echo $ac_n "(cached) $ac_c" 1>&4
  5632. else
  5633.   cat > conftest.$ac_ext <<EOF
  5634. #line 5635 "configure"
  5635. #include "confdefs.h"
  5636.  
  5637. #ifdef STDC_HEADERS
  5638. #include <stdlib.h>
  5639. #endif
  5640. #ifdef HAVE_UNISTD_H
  5641. #include <unistd.h>
  5642. #endif
  5643. #include <sys/types.h>
  5644. #include <sys/stat.h>
  5645.  
  5646. extern 
  5647. #ifdef __STDC__
  5648. int stat (char* path, struct stat * buf);
  5649. #else
  5650. int stat();
  5651. #endif
  5652.  
  5653. int main() { return 0; }
  5654. int t() {
  5655.  
  5656. ; return 0; }
  5657. EOF
  5658. if eval $ac_compile; then
  5659.   rm -rf conftest*
  5660.   cl_cv_proto_stat_arg1=""
  5661. else
  5662.   rm -rf conftest*
  5663.   cl_cv_proto_stat_arg1="const"
  5664. fi
  5665. rm -f conftest*
  5666.  
  5667.  
  5668.  
  5669.  
  5670. cl_cv_proto_stat="extern int stat ($cl_cv_proto_stat_arg1 char*, struct stat *);"
  5671. fi
  5672.  
  5673. cl_cv_proto_stat=`echo "$cl_cv_proto_stat" | tr -s ' ' | sed -e 's/( /(/'`
  5674. echo "$ac_t""${ac_tt}$cl_cv_proto_stat" 1>&4
  5675.  
  5676.  
  5677. cat >> confdefs.h <<EOF
  5678. #define STAT_CONST $cl_cv_proto_stat_arg1
  5679. EOF
  5680.  
  5681.  
  5682.                       for ac_func in lstat
  5683. do
  5684. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  5685. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  5686.   echo $ac_n "(cached) $ac_c" 1>&4
  5687. else
  5688.   cat > conftest.$ac_ext <<EOF
  5689. #line 5690 "configure"
  5690. #include "confdefs.h"
  5691. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  5692. /* The GNU C library defines this for functions which it implements
  5693.     to always fail with ENOSYS.  Some functions are actually named
  5694.     something starting with __ and the normal name is an alias.  */
  5695. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  5696. choke me
  5697. #endif
  5698.  
  5699. EOF
  5700. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  5701.   egrep "choke" >/dev/null 2>&1; then
  5702.   rm -rf conftest*
  5703.   eval "ac_cv_func_$ac_func=no"
  5704. else
  5705.   rm -rf conftest*
  5706.   cat > conftest.$ac_ext <<EOF
  5707. #line 5708 "configure"
  5708. #include "confdefs.h"
  5709. /* Override any gcc2 internal prototype to avoid an error.  */
  5710. char $ac_func(); 
  5711.  
  5712. int main() { return 0; }
  5713. int t() {
  5714.  
  5715. $ac_func();
  5716.  
  5717. ; return 0; }
  5718. EOF
  5719. if eval $ac_link; then
  5720.   rm -rf conftest*
  5721.   eval "ac_cv_func_$ac_func=yes"
  5722. else
  5723.   rm -rf conftest*
  5724.   eval "ac_cv_func_$ac_func=no"
  5725. fi
  5726. rm -f conftest*
  5727.  
  5728. fi
  5729. rm -f conftest*
  5730.  
  5731. fi
  5732. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  5733.   echo "$ac_t""yes" 1>&4
  5734.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  5735.   cat >> confdefs.h <<EOF
  5736. #define $ac_tr_func 1
  5737. EOF
  5738.  
  5739. else
  5740.   echo "$ac_t""no" 1>&4
  5741. fi
  5742. done
  5743. if test $ac_cv_func_lstat = yes; then
  5744. echo $ac_n "checking for lstat declaration""... $ac_c" 1>&4
  5745. if eval "test \"`echo '${'cl_cv_proto_lstat'+set}'`\" = set"; then
  5746.   echo $ac_n "(cached) $ac_c" 1>&4
  5747. else
  5748.   cat > conftest.$ac_ext <<EOF
  5749. #line 5750 "configure"
  5750. #include "confdefs.h"
  5751.  
  5752. #ifdef STDC_HEADERS
  5753. #include <stdlib.h>
  5754. #endif
  5755. #ifdef HAVE_UNISTD_H
  5756. #include <unistd.h>
  5757. #endif
  5758. #include <sys/types.h>
  5759. #include <sys/stat.h>
  5760.  
  5761. extern 
  5762. #ifdef __STDC__
  5763. int lstat (char* path, struct stat * buf);
  5764. #else
  5765. int lstat();
  5766. #endif
  5767.  
  5768. int main() { return 0; }
  5769. int t() {
  5770.  
  5771. ; return 0; }
  5772. EOF
  5773. if eval $ac_compile; then
  5774.   rm -rf conftest*
  5775.   cl_cv_proto_lstat_arg1=""
  5776. else
  5777.   rm -rf conftest*
  5778.   cl_cv_proto_lstat_arg1="const"
  5779. fi
  5780. rm -f conftest*
  5781.  
  5782.  
  5783.  
  5784.  
  5785. cl_cv_proto_lstat="extern int lstat ($cl_cv_proto_lstat_arg1 char*, struct stat *);"
  5786. fi
  5787.  
  5788. cl_cv_proto_lstat=`echo "$cl_cv_proto_lstat" | tr -s ' ' | sed -e 's/( /(/'`
  5789. echo "$ac_t""${ac_tt}$cl_cv_proto_lstat" 1>&4
  5790.  
  5791.  
  5792. cat >> confdefs.h <<EOF
  5793. #define LSTAT_CONST $cl_cv_proto_lstat_arg1
  5794. EOF
  5795.  
  5796. fi
  5797.  
  5798.                       for ac_func in readlink
  5799. do
  5800. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  5801. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  5802.   echo $ac_n "(cached) $ac_c" 1>&4
  5803. else
  5804.   cat > conftest.$ac_ext <<EOF
  5805. #line 5806 "configure"
  5806. #include "confdefs.h"
  5807. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  5808. /* The GNU C library defines this for functions which it implements
  5809.     to always fail with ENOSYS.  Some functions are actually named
  5810.     something starting with __ and the normal name is an alias.  */
  5811. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  5812. choke me
  5813. #endif
  5814.  
  5815. EOF
  5816. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  5817.   egrep "choke" >/dev/null 2>&1; then
  5818.   rm -rf conftest*
  5819.   eval "ac_cv_func_$ac_func=no"
  5820. else
  5821.   rm -rf conftest*
  5822.   cat > conftest.$ac_ext <<EOF
  5823. #line 5824 "configure"
  5824. #include "confdefs.h"
  5825. /* Override any gcc2 internal prototype to avoid an error.  */
  5826. char $ac_func(); 
  5827.  
  5828. int main() { return 0; }
  5829. int t() {
  5830.  
  5831. $ac_func();
  5832.  
  5833. ; return 0; }
  5834. EOF
  5835. if eval $ac_link; then
  5836.   rm -rf conftest*
  5837.   eval "ac_cv_func_$ac_func=yes"
  5838. else
  5839.   rm -rf conftest*
  5840.   eval "ac_cv_func_$ac_func=no"
  5841. fi
  5842. rm -f conftest*
  5843.  
  5844. fi
  5845. rm -f conftest*
  5846.  
  5847. fi
  5848. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  5849.   echo "$ac_t""yes" 1>&4
  5850.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  5851.   cat >> confdefs.h <<EOF
  5852. #define $ac_tr_func 1
  5853. EOF
  5854.  
  5855. else
  5856.   echo "$ac_t""no" 1>&4
  5857. fi
  5858. done
  5859. if test $ac_cv_func_readlink = yes; then
  5860. echo $ac_n "checking for readlink declaration""... $ac_c" 1>&4
  5861. if eval "test \"`echo '${'cl_cv_proto_readlink'+set}'`\" = set"; then
  5862.   echo $ac_n "(cached) $ac_c" 1>&4
  5863. else
  5864.   for z in 'int' 'size_t'; do
  5865. for y in 'char*' 'void*'; do
  5866. for x in '' 'const'; do
  5867. if test -z "$have_readlink"; then
  5868. cat > conftest.$ac_ext <<EOF
  5869. #line 5870 "configure"
  5870. #include "confdefs.h"
  5871.  
  5872. #ifdef STDC_HEADERS
  5873. #include <stdlib.h>
  5874. #endif
  5875. #ifdef HAVE_UNISTD_H
  5876. #include <unistd.h>
  5877. #endif
  5878. extern 
  5879. #ifdef __STDC__
  5880. int readlink ($x char* path, $y buf, $z bufsiz);
  5881. #else
  5882. int readlink();
  5883. #endif
  5884.  
  5885. int main() { return 0; }
  5886. int t() {
  5887.  
  5888. ; return 0; }
  5889. EOF
  5890. if eval $ac_compile; then
  5891.   rm -rf conftest*
  5892.   cl_cv_proto_readlink_arg1="$x"
  5893. cl_cv_proto_readlink_arg2="$y"
  5894. cl_cv_proto_readlink_arg3="$z"
  5895. have_readlink=1
  5896. fi
  5897. rm -f conftest*
  5898.  
  5899. fi
  5900. done
  5901. done
  5902. done
  5903.  
  5904. cl_cv_proto_readlink="extern int readlink ($cl_cv_proto_readlink_arg1 char*, $cl_cv_proto_readlink_arg2, $cl_cv_proto_readlink_arg3);"
  5905. fi
  5906.  
  5907. cl_cv_proto_readlink=`echo "$cl_cv_proto_readlink" | tr -s ' ' | sed -e 's/( /(/'`
  5908. echo "$ac_t""${ac_tt}$cl_cv_proto_readlink" 1>&4
  5909.  
  5910.  
  5911. cat >> confdefs.h <<EOF
  5912. #define READLINK_CONST $cl_cv_proto_readlink_arg1
  5913. EOF
  5914.  
  5915. cat >> confdefs.h <<EOF
  5916. #define READLINK_BUF_T $cl_cv_proto_readlink_arg2
  5917. EOF
  5918.  
  5919. cat >> confdefs.h <<EOF
  5920. #define READLINK_SIZE_T $cl_cv_proto_readlink_arg3
  5921. EOF
  5922.  
  5923. fi
  5924.  
  5925.                       echo $ac_n "checking for ELOOP""... $ac_c" 1>&4
  5926. if eval "test \"`echo '${'cl_cv_decl_eloop'+set}'`\" = set"; then
  5927.   echo $ac_n "(cached) $ac_c" 1>&4
  5928. else
  5929.   
  5930. if test $cross_compiling = no; then
  5931. cat > conftest.c <<EOF
  5932. #include "confdefs.h"
  5933. #ifdef STDC_HEADERS
  5934. #include <stdlib.h>
  5935. #endif
  5936. #ifdef HAVE_UNISTD_H
  5937. #include <unistd.h>
  5938. #endif
  5939. #include <errno.h>
  5940. #include <stdio.h>
  5941. #ifdef ELOOP
  5942. main () { printf("ELOOP\n"); exit(0); }
  5943. #else
  5944. extern int errno;
  5945. #define foo "conflink"
  5946. #define foobar "conflink/somefile"
  5947. main()
  5948. { /* If a system goes into an endless loop on this, it must be really broken. */
  5949.   if (symlink(foo,foo)<0) exit(1);
  5950.   if (unlink(foobar)>=0) { unlink(foo); exit(1); }
  5951.   printf("%d\n",errno); unlink(foo); exit(0);
  5952. }
  5953. #endif
  5954. EOF
  5955. eval $ac_link
  5956. cl_cv_decl_ELOOP=`./conftest`
  5957. if test "$cl_cv_decl_ELOOP" = "ELOOP"; then
  5958.   cl_cv_decl_eloop=yes
  5959. else
  5960.   cl_cv_decl_eloop="$cl_cv_decl_ELOOP"
  5961. fi
  5962. else
  5963. cat > conftest.$ac_ext <<EOF
  5964. #line 5965 "configure"
  5965. #include "confdefs.h"
  5966.  
  5967. #ifdef STDC_HEADERS
  5968. #include <stdlib.h>
  5969. #endif
  5970. #ifdef HAVE_UNISTD_H
  5971. #include <unistd.h>
  5972. #endif
  5973. #include <errno.h>
  5974. #include <stdio.h>
  5975. #ifdef ELOOP
  5976. yes
  5977. #endif
  5978.  
  5979. EOF
  5980. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  5981.   egrep "yes" >/dev/null 2>&1; then
  5982.   rm -rf conftest*
  5983.   cl_cv_decl_eloop=yes
  5984. else
  5985.   rm -rf conftest*
  5986.   cl_cv_decl_eloop=no
  5987. fi
  5988. rm -f conftest*
  5989.  
  5990. cl_cv_decl_ELOOP="ELOOP"
  5991. fi
  5992. rm -f conftest*
  5993.  
  5994. fi
  5995.  
  5996. echo "$ac_t""$cl_cv_decl_eloop" 1>&4
  5997. cat >> confdefs.h <<EOF
  5998. #define ELOOP_VALUE $cl_cv_decl_ELOOP
  5999. EOF
  6000.  
  6001.  
  6002.                       echo $ac_n "checking for opendir declaration""... $ac_c" 1>&4
  6003. if eval "test \"`echo '${'cl_cv_proto_opendir'+set}'`\" = set"; then
  6004.   echo $ac_n "(cached) $ac_c" 1>&4
  6005. else
  6006.   cat > conftest.$ac_ext <<EOF
  6007. #line 6008 "configure"
  6008. #include "confdefs.h"
  6009.  
  6010. #ifdef STDC_HEADERS
  6011. #include <stdlib.h>
  6012. #endif
  6013. #ifdef HAVE_UNISTD_H
  6014. #include <unistd.h>
  6015. #endif
  6016. #include <$ac_header_dirent>
  6017.  
  6018. extern 
  6019. #ifdef __STDC__
  6020. DIR* opendir (char* dirname);
  6021. #else
  6022. DIR* opendir();
  6023. #endif
  6024.  
  6025. int main() { return 0; }
  6026. int t() {
  6027.  
  6028. ; return 0; }
  6029. EOF
  6030. if eval $ac_compile; then
  6031.   rm -rf conftest*
  6032.   cl_cv_proto_opendir_arg1=""
  6033. else
  6034.   rm -rf conftest*
  6035.   cl_cv_proto_opendir_arg1="const"
  6036. fi
  6037. rm -f conftest*
  6038.  
  6039.  
  6040.  
  6041.  
  6042. cl_cv_proto_opendir="extern DIR* opendir ($cl_cv_proto_opendir_arg1 char*);"
  6043. fi
  6044.  
  6045. cl_cv_proto_opendir=`echo "$cl_cv_proto_opendir" | tr -s ' ' | sed -e 's/( /(/'`
  6046. echo "$ac_t""${ac_tt}$cl_cv_proto_opendir" 1>&4
  6047.  
  6048.  
  6049. cat >> confdefs.h <<EOF
  6050. #define OPENDIR_CONST $cl_cv_proto_opendir_arg1
  6051. EOF
  6052.  
  6053.  
  6054.                       echo $ac_n "checking for open declaration""... $ac_c" 1>&4
  6055. if eval "test \"`echo '${'cl_cv_proto_open'+set}'`\" = set"; then
  6056.   echo $ac_n "(cached) $ac_c" 1>&4
  6057. else
  6058.   for y in 'MODE_T mode' '...'; do
  6059. for x in '' 'const'; do
  6060. if test -z "$have_open"; then
  6061. cat > conftest.$ac_ext <<EOF
  6062. #line 6063 "configure"
  6063. #include "confdefs.h"
  6064.  
  6065. #ifdef STDC_HEADERS
  6066. #include <stdlib.h>
  6067. #endif
  6068. #ifdef HAVE_UNISTD_H
  6069. #include <unistd.h>
  6070. #endif
  6071. #include <fcntl.h>
  6072.  
  6073. extern 
  6074. #ifdef __STDC__
  6075. int open ($x char* path, int flags, $y);
  6076. #else
  6077. int open();
  6078. #endif
  6079.  
  6080. int main() { return 0; }
  6081. int t() {
  6082.  
  6083. ; return 0; }
  6084. EOF
  6085. if eval $ac_compile; then
  6086.   rm -rf conftest*
  6087.   cl_cv_proto_open_arg1="$x"
  6088. if test "$y" = "..."; then
  6089. cl_cv_proto_open_dots=yes
  6090. else
  6091. cl_cv_proto_open_dots=no
  6092. fi
  6093. have_open=1
  6094. fi
  6095. rm -f conftest*
  6096.  
  6097.  
  6098. fi
  6099. done
  6100. done
  6101.  if test $cl_cv_proto_open_dots = yes; then
  6102. cl_cv_proto_open_args="$cl_cv_proto_open_arg1 char*, int, ..."
  6103. else
  6104. cl_cv_proto_open_args="$cl_cv_proto_open_arg1 char*, int, $cl_cv_type_mode_t"
  6105. fi
  6106.  
  6107. cl_cv_proto_open="extern int open ($cl_cv_proto_open_args);"
  6108. fi
  6109.  
  6110. cl_cv_proto_open=`echo "$cl_cv_proto_open" | tr -s ' ' | sed -e 's/( /(/'`
  6111. echo "$ac_t""${ac_tt}$cl_cv_proto_open" 1>&4
  6112.  
  6113.  
  6114. cat >> confdefs.h <<EOF
  6115. #define OPEN_CONST $cl_cv_proto_open_arg1
  6116. EOF
  6117.  
  6118. if test $cl_cv_proto_open_dots = yes; then
  6119. cat >> confdefs.h <<\EOF
  6120. #define OPEN_DOTS 1
  6121. EOF
  6122.  
  6123. fi
  6124.  
  6125.                       echo $ac_n "checking for read declaration""... $ac_c" 1>&4
  6126. if eval "test \"`echo '${'cl_cv_proto_read'+set}'`\" = set"; then
  6127.   echo $ac_n "(cached) $ac_c" 1>&4
  6128. else
  6129.   cat > conftest.$ac_ext <<EOF
  6130. #line 6131 "configure"
  6131. #include "confdefs.h"
  6132.  
  6133. #ifdef STDC_HEADERS
  6134. #include <stdlib.h>
  6135. #endif
  6136. #ifdef HAVE_UNISTD_H
  6137. #include <unistd.h>
  6138. #endif
  6139.  
  6140. extern int read();
  6141.  
  6142. int main() { return 0; }
  6143. int t() {
  6144.  
  6145. ; return 0; }
  6146. EOF
  6147. if eval $ac_compile; then
  6148.   rm -rf conftest*
  6149.   cl_cv_proto_retrwtype="int"
  6150. else
  6151.   rm -rf conftest*
  6152.   cl_cv_proto_retrwtype="long"
  6153. fi
  6154. rm -f conftest*
  6155.  
  6156.  
  6157. for y in 'int' 'size_t' "unsigned $cl_cv_proto_retrwtype" 'off_t'; do
  6158. for x in 'char*' 'void*'; do
  6159. if test -z "$have_rw"; then
  6160. cat > conftest.$ac_ext <<EOF
  6161. #line 6162 "configure"
  6162. #include "confdefs.h"
  6163.  
  6164. #ifdef STDC_HEADERS
  6165. #include <stdlib.h>
  6166. #endif
  6167. #ifdef HAVE_UNISTD_H
  6168. #include <unistd.h>
  6169. #endif
  6170.  
  6171. extern 
  6172. #ifdef __STDC__
  6173. $cl_cv_proto_retrwtype read (int fd, $x buf, $y count);
  6174. #else
  6175. $cl_cv_proto_retrwtype read();
  6176. #endif
  6177.  
  6178. int main() { return 0; }
  6179. int t() {
  6180.  
  6181. ; return 0; }
  6182. EOF
  6183. if eval $ac_compile; then
  6184.   rm -rf conftest*
  6185.   cl_cv_proto_rw_buf_t="$x"
  6186. cl_cv_proto_rw_size_t="$y"
  6187. have_rw=1
  6188. fi
  6189. rm -f conftest*
  6190.  
  6191.  
  6192. fi
  6193. done
  6194. done
  6195.  
  6196. cl_cv_proto_read="extern $cl_cv_proto_retrwtype read (int, $cl_cv_proto_rw_buf_t, $cl_cv_proto_rw_size_t);"
  6197. fi
  6198.  
  6199. cl_cv_proto_read=`echo "$cl_cv_proto_read" | tr -s ' ' | sed -e 's/( /(/'`
  6200. echo "$ac_t""${ac_tt}$cl_cv_proto_read" 1>&4
  6201.  
  6202.  
  6203. cat >> confdefs.h <<EOF
  6204. #define RETRWTYPE $cl_cv_proto_retrwtype
  6205. EOF
  6206.  
  6207. cat >> confdefs.h <<EOF
  6208. #define RW_BUF_T $cl_cv_proto_rw_buf_t
  6209. EOF
  6210.  
  6211. cat >> confdefs.h <<EOF
  6212. #define RW_SIZE_T $cl_cv_proto_rw_size_t
  6213. EOF
  6214.  
  6215.  
  6216.                       echo $ac_n "checking for write declaration""... $ac_c" 1>&4
  6217. if eval "test \"`echo '${'cl_cv_proto_write'+set}'`\" = set"; then
  6218.   echo $ac_n "(cached) $ac_c" 1>&4
  6219. else
  6220.   cat > conftest.$ac_ext <<EOF
  6221. #line 6222 "configure"
  6222. #include "confdefs.h"
  6223.  
  6224. #ifdef STDC_HEADERS
  6225. #include <stdlib.h>
  6226. #endif
  6227. #ifdef HAVE_UNISTD_H
  6228. #include <unistd.h>
  6229. #endif
  6230.  
  6231. extern 
  6232. #ifdef __STDC__
  6233. $cl_cv_proto_retrwtype write (int fd, $cl_cv_proto_rw_buf_t buf, $cl_cv_proto_rw_size_t count);
  6234. #else
  6235. $cl_cv_proto_retrwtype write();
  6236. #endif
  6237.  
  6238. int main() { return 0; }
  6239. int t() {
  6240.  
  6241. ; return 0; }
  6242. EOF
  6243. if eval $ac_compile; then
  6244.   rm -rf conftest*
  6245.   cl_cv_proto_write_arg2=""
  6246. else
  6247.   rm -rf conftest*
  6248.   cl_cv_proto_write_arg2="const"
  6249. fi
  6250. rm -f conftest*
  6251.  
  6252.  
  6253.  
  6254.  
  6255. cl_cv_proto_write="extern $cl_cv_proto_retrwtype write (int, $cl_cv_proto_write_arg2 $cl_cv_proto_rw_buf_t, $cl_cv_proto_rw_size_t);"
  6256. fi
  6257.  
  6258. cl_cv_proto_write=`echo "$cl_cv_proto_write" | tr -s ' ' | sed -e 's/( /(/'`
  6259. echo "$ac_t""${ac_tt}$cl_cv_proto_write" 1>&4
  6260.  
  6261.  
  6262. cat >> confdefs.h <<EOF
  6263. #define WRITE_CONST $cl_cv_proto_write_arg2
  6264. EOF
  6265.  
  6266.  
  6267.                       for ac_func in rename
  6268. do
  6269. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  6270. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6271.   echo $ac_n "(cached) $ac_c" 1>&4
  6272. else
  6273.   cat > conftest.$ac_ext <<EOF
  6274. #line 6275 "configure"
  6275. #include "confdefs.h"
  6276. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  6277. /* The GNU C library defines this for functions which it implements
  6278.     to always fail with ENOSYS.  Some functions are actually named
  6279.     something starting with __ and the normal name is an alias.  */
  6280. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6281. choke me
  6282. #endif
  6283.  
  6284. EOF
  6285. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  6286.   egrep "choke" >/dev/null 2>&1; then
  6287.   rm -rf conftest*
  6288.   eval "ac_cv_func_$ac_func=no"
  6289. else
  6290.   rm -rf conftest*
  6291.   cat > conftest.$ac_ext <<EOF
  6292. #line 6293 "configure"
  6293. #include "confdefs.h"
  6294. /* Override any gcc2 internal prototype to avoid an error.  */
  6295. char $ac_func(); 
  6296.  
  6297. int main() { return 0; }
  6298. int t() {
  6299.  
  6300. $ac_func();
  6301.  
  6302. ; return 0; }
  6303. EOF
  6304. if eval $ac_link; then
  6305.   rm -rf conftest*
  6306.   eval "ac_cv_func_$ac_func=yes"
  6307. else
  6308.   rm -rf conftest*
  6309.   eval "ac_cv_func_$ac_func=no"
  6310. fi
  6311. rm -f conftest*
  6312.  
  6313. fi
  6314. rm -f conftest*
  6315.  
  6316. fi
  6317. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6318.   echo "$ac_t""yes" 1>&4
  6319.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  6320.   cat >> confdefs.h <<EOF
  6321. #define $ac_tr_func 1
  6322. EOF
  6323.  
  6324. else
  6325.   echo "$ac_t""no" 1>&4
  6326. fi
  6327. done
  6328. if test $ac_cv_func_rename = yes; then
  6329. echo $ac_n "checking for rename declaration""... $ac_c" 1>&4
  6330. if eval "test \"`echo '${'cl_cv_proto_rename'+set}'`\" = set"; then
  6331.   echo $ac_n "(cached) $ac_c" 1>&4
  6332. else
  6333.   cat > conftest.$ac_ext <<EOF
  6334. #line 6335 "configure"
  6335. #include "confdefs.h"
  6336.  
  6337. #ifdef STDC_HEADERS
  6338. #include <stdlib.h>
  6339. #endif
  6340. #ifdef HAVE_UNISTD_H
  6341. #include <unistd.h>
  6342. #endif
  6343. #include <stdio.h>
  6344.  
  6345. extern 
  6346. #ifdef __STDC__
  6347. int rename (char* oldpath, char* newpath);
  6348. #else
  6349. int rename();
  6350. #endif
  6351.  
  6352. int main() { return 0; }
  6353. int t() {
  6354.  
  6355. ; return 0; }
  6356. EOF
  6357. if eval $ac_compile; then
  6358.   rm -rf conftest*
  6359.   cl_cv_proto_rename_arg1=""
  6360. else
  6361.   rm -rf conftest*
  6362.   cl_cv_proto_rename_arg1="const"
  6363. fi
  6364. rm -f conftest*
  6365.  
  6366.  
  6367.  
  6368.  
  6369. cl_cv_proto_rename="extern int rename ($cl_cv_proto_rename_arg1 char*, $cl_cv_proto_rename_arg1 char*);"
  6370. fi
  6371.  
  6372. cl_cv_proto_rename=`echo "$cl_cv_proto_rename" | tr -s ' ' | sed -e 's/( /(/'`
  6373. echo "$ac_t""${ac_tt}$cl_cv_proto_rename" 1>&4
  6374.  
  6375.  
  6376. cat >> confdefs.h <<EOF
  6377. #define RENAME_CONST $cl_cv_proto_rename_arg1
  6378. EOF
  6379.  
  6380. fi
  6381.  
  6382.                       echo $ac_n "checking for unlink declaration""... $ac_c" 1>&4
  6383. if eval "test \"`echo '${'cl_cv_proto_unlink'+set}'`\" = set"; then
  6384.   echo $ac_n "(cached) $ac_c" 1>&4
  6385. else
  6386.   cat > conftest.$ac_ext <<EOF
  6387. #line 6388 "configure"
  6388. #include "confdefs.h"
  6389.  
  6390. #ifdef STDC_HEADERS
  6391. #include <stdlib.h>
  6392. #endif
  6393. #ifdef HAVE_UNISTD_H
  6394. #include <unistd.h>
  6395. #endif
  6396.  
  6397. extern 
  6398. #ifdef __STDC__
  6399. int unlink (char* path);
  6400. #else
  6401. int unlink();
  6402. #endif
  6403.  
  6404. int main() { return 0; }
  6405. int t() {
  6406.  
  6407. ; return 0; }
  6408. EOF
  6409. if eval $ac_compile; then
  6410.   rm -rf conftest*
  6411.   cl_cv_proto_unlink_arg1=""
  6412. else
  6413.   rm -rf conftest*
  6414.   cl_cv_proto_unlink_arg1="const"
  6415. fi
  6416. rm -f conftest*
  6417.  
  6418.  
  6419.  
  6420.  
  6421. cl_cv_proto_unlink="extern int unlink ($cl_cv_proto_unlink_arg1 char*);"
  6422. fi
  6423.  
  6424. cl_cv_proto_unlink=`echo "$cl_cv_proto_unlink" | tr -s ' ' | sed -e 's/( /(/'`
  6425. echo "$ac_t""${ac_tt}$cl_cv_proto_unlink" 1>&4
  6426.  
  6427.  
  6428. cat >> confdefs.h <<EOF
  6429. #define UNLINK_CONST $cl_cv_proto_unlink_arg1
  6430. EOF
  6431.  
  6432.  
  6433.                       for ac_func in fsync
  6434. do
  6435. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  6436. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6437.   echo $ac_n "(cached) $ac_c" 1>&4
  6438. else
  6439.   cat > conftest.$ac_ext <<EOF
  6440. #line 6441 "configure"
  6441. #include "confdefs.h"
  6442. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  6443. /* The GNU C library defines this for functions which it implements
  6444.     to always fail with ENOSYS.  Some functions are actually named
  6445.     something starting with __ and the normal name is an alias.  */
  6446. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6447. choke me
  6448. #endif
  6449.  
  6450. EOF
  6451. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  6452.   egrep "choke" >/dev/null 2>&1; then
  6453.   rm -rf conftest*
  6454.   eval "ac_cv_func_$ac_func=no"
  6455. else
  6456.   rm -rf conftest*
  6457.   cat > conftest.$ac_ext <<EOF
  6458. #line 6459 "configure"
  6459. #include "confdefs.h"
  6460. /* Override any gcc2 internal prototype to avoid an error.  */
  6461. char $ac_func(); 
  6462.  
  6463. int main() { return 0; }
  6464. int t() {
  6465.  
  6466. $ac_func();
  6467.  
  6468. ; return 0; }
  6469. EOF
  6470. if eval $ac_link; then
  6471.   rm -rf conftest*
  6472.   eval "ac_cv_func_$ac_func=yes"
  6473. else
  6474.   rm -rf conftest*
  6475.   eval "ac_cv_func_$ac_func=no"
  6476. fi
  6477. rm -f conftest*
  6478.  
  6479. fi
  6480. rm -f conftest*
  6481.  
  6482. fi
  6483. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6484.   echo "$ac_t""yes" 1>&4
  6485.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  6486.   cat >> confdefs.h <<EOF
  6487. #define $ac_tr_func 1
  6488. EOF
  6489.  
  6490. else
  6491.   echo "$ac_t""no" 1>&4
  6492. fi
  6493. done
  6494.  
  6495.  
  6496.                       echo $ac_n "checking for ioctl declaration""... $ac_c" 1>&4
  6497. if eval "test \"`echo '${'cl_cv_proto_ioctl'+set}'`\" = set"; then
  6498.   echo $ac_n "(cached) $ac_c" 1>&4
  6499. else
  6500.   ioctl_decl1='#ifdef STDC_HEADERS
  6501. #include <stdlib.h>
  6502. #endif
  6503. #ifdef HAVE_UNISTD_H
  6504. #include <sys/types.h>
  6505. #include <unistd.h>
  6506. #endif
  6507. #ifndef HAVE_TCSAFLUSH
  6508. #undef HAVE_TERMIOS_H
  6509. #endif
  6510. #ifdef HAVE_TERMIOS_H
  6511. #include <termios.h>
  6512. #else
  6513. #ifdef HAVE_SYS_TERMIO_H
  6514. #include <sys/termio.h>
  6515. #else
  6516. #ifdef HAVE_TERMIO_H
  6517. #include <termio.h>
  6518. #else
  6519. #ifdef HAVE_SGTTY_H
  6520. #include <sgtty.h>
  6521. #include <sys/ioctl.h>
  6522. #endif
  6523. #endif
  6524. #endif
  6525. #endif
  6526. '
  6527. cat > conftest.$ac_ext <<EOF
  6528. #line 6529 "configure"
  6529. #include "confdefs.h"
  6530. $ioctl_decl1
  6531. extern char* ioctl();
  6532. int main() { return 0; }
  6533. int t() {
  6534.  
  6535. ; return 0; }
  6536. EOF
  6537. if eval $ac_compile; then
  6538.   rm -rf conftest*
  6539.   try_sys_ioctl=1
  6540. else
  6541.   rm -rf conftest*
  6542.   ioctl_decl="$ioctl_decl1"
  6543. fi
  6544. rm -f conftest*
  6545.  
  6546. if test -n "try_sys_ioctl"; then
  6547. ioctl_decl2='#ifdef STDC_HEADERS
  6548. #include <stdlib.h>
  6549. #endif
  6550. #ifdef HAVE_UNISTD_H
  6551. #include <sys/types.h>
  6552. #include <unistd.h>
  6553. #endif
  6554. #include <sys/ioctl.h>
  6555. '
  6556. cat > conftest.$ac_ext <<EOF
  6557. #line 6558 "configure"
  6558. #include "confdefs.h"
  6559. $ioctl_decl2
  6560. extern char* ioctl();
  6561. int main() { return 0; }
  6562. int t() {
  6563.  
  6564. ; return 0; }
  6565. EOF
  6566. if eval $ac_compile; then
  6567.   rm -rf conftest*
  6568.   ioctl_decl="$ioctl_decl1"
  6569. else
  6570.   rm -rf conftest*
  6571.   ioctl_decl="$ioctl_decl2"
  6572. fi
  6573. rm -f conftest*
  6574.  
  6575. fi
  6576. for y in 'caddr_t arg' '...'; do
  6577. for x in 'int' 'unsigned long' 'long'; do
  6578. if test -z "$have_ioctl"; then
  6579. cat > conftest.$ac_ext <<EOF
  6580. #line 6581 "configure"
  6581. #include "confdefs.h"
  6582. $ioctl_decl
  6583. #ifdef INCLUDE_SYS_IOCTL_H
  6584. #include <sys/ioctl.h>
  6585. #endif
  6586.  
  6587. extern 
  6588. #ifdef __STDC__
  6589. int ioctl (int fd, $x request, $y);
  6590. #else
  6591. int ioctl();
  6592. #endif
  6593.  
  6594. int main() { return 0; }
  6595. int t() {
  6596.  
  6597. ; return 0; }
  6598. EOF
  6599. if eval $ac_compile; then
  6600.   rm -rf conftest*
  6601.    cl_cv_proto_ioctl_arg2="$x"
  6602. if test "$y" = "..."; then
  6603. cl_cv_proto_ioctl_dots=yes
  6604. cl_cv_proto_ioctl_args="int, $cl_cv_proto_ioctl_arg2, ..."
  6605. else
  6606. cl_cv_proto_ioctl_dots=no
  6607. cl_cv_proto_ioctl_args="int, $cl_cv_proto_ioctl_arg2, caddr_t"
  6608. fi
  6609. have_ioctl=1
  6610. fi
  6611. rm -f conftest*
  6612.  
  6613.  
  6614. fi
  6615. done
  6616. done
  6617.  
  6618. cl_cv_proto_ioctl="extern int ioctl ($cl_cv_proto_ioctl_args);"
  6619. fi
  6620.  
  6621. cl_cv_proto_ioctl=`echo "$cl_cv_proto_ioctl" | tr -s ' ' | sed -e 's/( /(/'`
  6622. echo "$ac_t""${ac_tt}$cl_cv_proto_ioctl" 1>&4
  6623.  
  6624.  
  6625. cat >> confdefs.h <<EOF
  6626. #define IOCTL_REQUEST_T $cl_cv_proto_ioctl_arg2
  6627. EOF
  6628.  
  6629. if test $cl_cv_proto_ioctl_dots = yes; then
  6630. cat >> confdefs.h <<\EOF
  6631. #define IOCTL_DOTS 1
  6632. EOF
  6633.  
  6634. fi
  6635. ioctl_decl="$ioctl_decl1"
  6636. ioctl_prog='int x = FIONREAD;'
  6637. echo $ac_n "checking for FIONREAD""... $ac_c" 1>&4
  6638. if eval "test \"`echo '${'cl_cv_decl_FIONREAD_1'+set}'`\" = set"; then
  6639.   echo $ac_n "(cached) $ac_c" 1>&4
  6640. else
  6641.   
  6642. cat > conftest.$ac_ext <<EOF
  6643. #line 6644 "configure"
  6644. #include "confdefs.h"
  6645. $ioctl_decl
  6646. int main() { return 0; }
  6647. int t() {
  6648. $ioctl_prog
  6649. ; return 0; }
  6650. EOF
  6651. if eval $ac_compile; then
  6652.   rm -rf conftest*
  6653.   cl_cv_decl_FIONREAD_1=yes
  6654. else
  6655.   rm -rf conftest*
  6656.   cl_cv_decl_FIONREAD_1=no
  6657. fi
  6658. rm -f conftest*
  6659.  
  6660.  
  6661. fi
  6662.  
  6663. echo "$ac_t""$cl_cv_decl_FIONREAD_1" 1>&4
  6664. if test $cl_cv_decl_FIONREAD_1 = yes; then
  6665.   ioctl_ok=1
  6666. fi
  6667. if test -z "$ioctl_ok"; then
  6668. echo $ac_n "checking for FIONREAD in sys/filio.h""... $ac_c" 1>&4
  6669. if eval "test \"`echo '${'cl_cv_decl_FIONREAD_1_sys_filio_h'+set}'`\" = set"; then
  6670.   echo $ac_n "(cached) $ac_c" 1>&4
  6671. else
  6672.   
  6673. cat > conftest.$ac_ext <<EOF
  6674. #line 6675 "configure"
  6675. #include "confdefs.h"
  6676. $ioctl_decl#include <sys/filio.h>
  6677. int main() { return 0; }
  6678. int t() {
  6679. $ioctl_prog
  6680. ; return 0; }
  6681. EOF
  6682. if eval $ac_compile; then
  6683.   rm -rf conftest*
  6684.   cl_cv_decl_FIONREAD_1_sys_filio_h=yes
  6685. else
  6686.   rm -rf conftest*
  6687.   cl_cv_decl_FIONREAD_1_sys_filio_h=no
  6688. fi
  6689. rm -f conftest*
  6690.  
  6691.  
  6692. fi
  6693.  
  6694. echo "$ac_t""$cl_cv_decl_FIONREAD_1_sys_filio_h" 1>&4
  6695. if test $cl_cv_decl_FIONREAD_1_sys_filio_h = yes; then
  6696.   cat >> confdefs.h <<\EOF
  6697. #define NEED_SYS_FILIO_H 1
  6698. EOF
  6699.  
  6700. ioctl_ok=1
  6701. fi
  6702. fi
  6703. if test -z "$ioctl_ok"; then
  6704. echo $ac_n "checking for FIONREAD in sys/ioctl.h""... $ac_c" 1>&4
  6705. if eval "test \"`echo '${'cl_cv_decl_FIONREAD_1_sys_ioctl_h'+set}'`\" = set"; then
  6706.   echo $ac_n "(cached) $ac_c" 1>&4
  6707. else
  6708.   
  6709. cat > conftest.$ac_ext <<EOF
  6710. #line 6711 "configure"
  6711. #include "confdefs.h"
  6712. $ioctl_decl#include <sys/ioctl.h>
  6713. int main() { return 0; }
  6714. int t() {
  6715. $ioctl_prog
  6716. ; return 0; }
  6717. EOF
  6718. if eval $ac_compile; then
  6719.   rm -rf conftest*
  6720.   cl_cv_decl_FIONREAD_1_sys_ioctl_h=yes
  6721. else
  6722.   rm -rf conftest*
  6723.   cl_cv_decl_FIONREAD_1_sys_ioctl_h=no
  6724. fi
  6725. rm -f conftest*
  6726.  
  6727.  
  6728. fi
  6729.  
  6730. echo "$ac_t""$cl_cv_decl_FIONREAD_1_sys_ioctl_h" 1>&4
  6731. if test $cl_cv_decl_FIONREAD_1_sys_ioctl_h = yes; then
  6732.   cat >> confdefs.h <<\EOF
  6733. #define NEED_SYS_IOCTL_H 1
  6734. EOF
  6735.  
  6736. ioctl_ok=1
  6737. fi
  6738. fi
  6739. if test -n "$ioctl_ok"; then
  6740. cat >> confdefs.h <<\EOF
  6741. #define HAVE_FIONREAD 1
  6742. EOF
  6743.  
  6744. fi
  6745.  
  6746.                       echo $ac_n "checking for fcntl declaration""... $ac_c" 1>&4
  6747. if eval "test \"`echo '${'cl_cv_proto_fcntl'+set}'`\" = set"; then
  6748.   echo $ac_n "(cached) $ac_c" 1>&4
  6749. else
  6750.   for x in 'int arg' '...'; do
  6751. if test -z "$have_fcntl"; then
  6752. cat > conftest.$ac_ext <<EOF
  6753. #line 6754 "configure"
  6754. #include "confdefs.h"
  6755.  
  6756. #ifdef HAVE_UNISTD_H
  6757. #include <unistd.h>
  6758. #endif
  6759. #include <fcntl.h>
  6760.  
  6761. extern 
  6762. #ifdef __STDC__
  6763. int fcntl (int fd, int cmd, $x);
  6764. #else
  6765. int fcntl();
  6766. #endif
  6767.  
  6768. int main() { return 0; }
  6769. int t() {
  6770.  
  6771. ; return 0; }
  6772. EOF
  6773. if eval $ac_compile; then
  6774.   rm -rf conftest*
  6775.   if test "$x" = "..."; then
  6776. cl_cv_fcntl_arg3="..."
  6777. else
  6778. cl_cv_fcntl_arg3="int"
  6779. fi
  6780. have_fcntl=1
  6781. fi
  6782. rm -f conftest*
  6783.  
  6784.  
  6785. fi
  6786. done
  6787.  
  6788. cl_cv_proto_fcntl="extern int fcntl (int, int, $cl_cv_fcntl_arg3);"
  6789. fi
  6790.  
  6791. cl_cv_proto_fcntl=`echo "$cl_cv_proto_fcntl" | tr -s ' ' | sed -e 's/( /(/'`
  6792. echo "$ac_t""${ac_tt}$cl_cv_proto_fcntl" 1>&4
  6793.  
  6794.  
  6795. if test "$cl_cv_fcntl_arg3" = "..."; then
  6796. cat >> confdefs.h <<\EOF
  6797. #define FCNTL_DOTS 1
  6798. EOF
  6799.  
  6800. fi
  6801.  
  6802.                       for ac_func in select
  6803. do
  6804. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  6805. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6806.   echo $ac_n "(cached) $ac_c" 1>&4
  6807. else
  6808.   cat > conftest.$ac_ext <<EOF
  6809. #line 6810 "configure"
  6810. #include "confdefs.h"
  6811. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  6812. /* The GNU C library defines this for functions which it implements
  6813.     to always fail with ENOSYS.  Some functions are actually named
  6814.     something starting with __ and the normal name is an alias.  */
  6815. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6816. choke me
  6817. #endif
  6818.  
  6819. EOF
  6820. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  6821.   egrep "choke" >/dev/null 2>&1; then
  6822.   rm -rf conftest*
  6823.   eval "ac_cv_func_$ac_func=no"
  6824. else
  6825.   rm -rf conftest*
  6826.   cat > conftest.$ac_ext <<EOF
  6827. #line 6828 "configure"
  6828. #include "confdefs.h"
  6829. /* Override any gcc2 internal prototype to avoid an error.  */
  6830. char $ac_func(); 
  6831.  
  6832. int main() { return 0; }
  6833. int t() {
  6834.  
  6835. $ac_func();
  6836.  
  6837. ; return 0; }
  6838. EOF
  6839. if eval $ac_link; then
  6840.   rm -rf conftest*
  6841.   eval "ac_cv_func_$ac_func=yes"
  6842. else
  6843.   rm -rf conftest*
  6844.   eval "ac_cv_func_$ac_func=no"
  6845. fi
  6846. rm -f conftest*
  6847.  
  6848. fi
  6849. rm -f conftest*
  6850.  
  6851. fi
  6852. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  6853.   echo "$ac_t""yes" 1>&4
  6854.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  6855.   cat >> confdefs.h <<EOF
  6856. #define $ac_tr_func 1
  6857. EOF
  6858.  
  6859. else
  6860.   echo "$ac_t""no" 1>&4
  6861. fi
  6862. done
  6863. if test $ac_cv_func_select = yes; then
  6864. for ac_hdr in sys/select.h
  6865. do
  6866. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  6867. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  6868. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  6869.   echo $ac_n "(cached) $ac_c" 1>&4
  6870. else
  6871.   cat > conftest.$ac_ext <<EOF
  6872. #line 6873 "configure"
  6873. #include "confdefs.h"
  6874. #include <$ac_hdr>
  6875. EOF
  6876. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  6877. ac_err=`grep -v '^ *+' conftest.out`
  6878. if test -z "$ac_err"; then
  6879.   rm -rf conftest*
  6880.   eval "ac_cv_header_$ac_safe=yes"
  6881. else
  6882.   echo "$ac_err" >&5
  6883.   rm -rf conftest*
  6884.   eval "ac_cv_header_$ac_safe=no"
  6885. fi
  6886. rm -f conftest*
  6887. fi
  6888. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  6889.   echo "$ac_t""yes" 1>&4
  6890.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  6891.   cat >> confdefs.h <<EOF
  6892. #define $ac_tr_hdr 1
  6893. EOF
  6894.  
  6895. else
  6896.   echo "$ac_t""no" 1>&4
  6897. fi
  6898. done
  6899. echo $ac_n "checking for select declaration""... $ac_c" 1>&4
  6900. if eval "test \"`echo '${'cl_cv_proto_select'+set}'`\" = set"; then
  6901.   echo $ac_n "(cached) $ac_c" 1>&4
  6902. else
  6903.   for z in '' 'const'; do
  6904. for y in 'fd_set' 'int' 'void'; do
  6905. for x in 'int' 'size_t'; do
  6906. if test -z "$have_select"; then
  6907. cat > conftest.$ac_ext <<EOF
  6908. #line 6909 "configure"
  6909. #include "confdefs.h"
  6910.  
  6911. #ifdef STDC_HEADERS
  6912. #include <stdlib.h>
  6913. #endif
  6914. #ifdef HAVE_UNISTD_H
  6915. #include <unistd.h>
  6916. #endif
  6917. #include <sys/types.h>
  6918. #include <sys/time.h>
  6919. #ifdef HAVE_SYS_SELECT_H
  6920. #include <sys/select.h>
  6921. #endif
  6922.  
  6923. extern 
  6924. #ifdef __STDC__
  6925. int select ($x width, $y * readfds, $y * writefds, $y * exceptfds, $z struct timeval * timeout);
  6926. #else
  6927. int select();
  6928. #endif
  6929.  
  6930. int main() { return 0; }
  6931. int t() {
  6932.  
  6933. ; return 0; }
  6934. EOF
  6935. if eval $ac_compile; then
  6936.   rm -rf conftest*
  6937.   cl_cv_proto_select_arg1="$x"
  6938. cl_cv_proto_select_arg2="$y"
  6939. cl_cv_proto_select_arg5="$z"
  6940. have_select=1
  6941. fi
  6942. rm -f conftest*
  6943.  
  6944.  
  6945. fi
  6946. done
  6947. done
  6948. done
  6949.  
  6950. cl_cv_proto_select="extern int select ($cl_cv_proto_select_arg1, $cl_cv_proto_select_arg2 *, $cl_cv_proto_select_arg2 *, $cl_cv_proto_select_arg2 *, $cl_cv_proto_select_arg5 struct timeval *);"
  6951. fi
  6952.  
  6953. cl_cv_proto_select=`echo "$cl_cv_proto_select" | tr -s ' ' | sed -e 's/( /(/'`
  6954. echo "$ac_t""${ac_tt}$cl_cv_proto_select" 1>&4
  6955.  
  6956.  
  6957. cat >> confdefs.h <<EOF
  6958. #define SELECT_WIDTH_T $cl_cv_proto_select_arg1
  6959. EOF
  6960.  
  6961. cat >> confdefs.h <<EOF
  6962. #define SELECT_SET_T $cl_cv_proto_select_arg2
  6963. EOF
  6964.  
  6965. cat >> confdefs.h <<EOF
  6966. #define SELECT_CONST $cl_cv_proto_select_arg5
  6967. EOF
  6968.  
  6969. else
  6970. for ac_func in poll
  6971. do
  6972. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  6973. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  6974.   echo $ac_n "(cached) $ac_c" 1>&4
  6975. else
  6976.   cat > conftest.$ac_ext <<EOF
  6977. #line 6978 "configure"
  6978. #include "confdefs.h"
  6979. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  6980. /* The GNU C library defines this for functions which it implements
  6981.     to always fail with ENOSYS.  Some functions are actually named
  6982.     something starting with __ and the normal name is an alias.  */
  6983. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  6984. choke me
  6985. #endif
  6986.  
  6987. EOF
  6988. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  6989.   egrep "choke" >/dev/null 2>&1; then
  6990.   rm -rf conftest*
  6991.   eval "ac_cv_func_$ac_func=no"
  6992. else
  6993.   rm -rf conftest*
  6994.   cat > conftest.$ac_ext <<EOF
  6995. #line 6996 "configure"
  6996. #include "confdefs.h"
  6997. /* Override any gcc2 internal prototype to avoid an error.  */
  6998. char $ac_func(); 
  6999.  
  7000. int main() { return 0; }
  7001. int t() {
  7002.  
  7003. $ac_func();
  7004.  
  7005. ; return 0; }
  7006. EOF
  7007. if eval $ac_link; then
  7008.   rm -rf conftest*
  7009.   eval "ac_cv_func_$ac_func=yes"
  7010. else
  7011.   rm -rf conftest*
  7012.   eval "ac_cv_func_$ac_func=no"
  7013. fi
  7014. rm -f conftest*
  7015.  
  7016. fi
  7017. rm -f conftest*
  7018.  
  7019. fi
  7020. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7021.   echo "$ac_t""yes" 1>&4
  7022.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7023.   cat >> confdefs.h <<EOF
  7024. #define $ac_tr_func 1
  7025. EOF
  7026.  
  7027. else
  7028.   echo "$ac_t""no" 1>&4
  7029. fi
  7030. done
  7031. fi
  7032.  
  7033.                       for ac_func in ualarm
  7034. do
  7035. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  7036. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7037.   echo $ac_n "(cached) $ac_c" 1>&4
  7038. else
  7039.   cat > conftest.$ac_ext <<EOF
  7040. #line 7041 "configure"
  7041. #include "confdefs.h"
  7042. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7043. /* The GNU C library defines this for functions which it implements
  7044.     to always fail with ENOSYS.  Some functions are actually named
  7045.     something starting with __ and the normal name is an alias.  */
  7046. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7047. choke me
  7048. #endif
  7049.  
  7050. EOF
  7051. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7052.   egrep "choke" >/dev/null 2>&1; then
  7053.   rm -rf conftest*
  7054.   eval "ac_cv_func_$ac_func=no"
  7055. else
  7056.   rm -rf conftest*
  7057.   cat > conftest.$ac_ext <<EOF
  7058. #line 7059 "configure"
  7059. #include "confdefs.h"
  7060. /* Override any gcc2 internal prototype to avoid an error.  */
  7061. char $ac_func(); 
  7062.  
  7063. int main() { return 0; }
  7064. int t() {
  7065.  
  7066. $ac_func();
  7067.  
  7068. ; return 0; }
  7069. EOF
  7070. if eval $ac_link; then
  7071.   rm -rf conftest*
  7072.   eval "ac_cv_func_$ac_func=yes"
  7073. else
  7074.   rm -rf conftest*
  7075.   eval "ac_cv_func_$ac_func=no"
  7076. fi
  7077. rm -f conftest*
  7078.  
  7079. fi
  7080. rm -f conftest*
  7081.  
  7082. fi
  7083. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7084.   echo "$ac_t""yes" 1>&4
  7085.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7086.   cat >> confdefs.h <<EOF
  7087. #define $ac_tr_func 1
  7088. EOF
  7089.  
  7090. else
  7091.   echo "$ac_t""no" 1>&4
  7092. fi
  7093. done
  7094.  
  7095.  
  7096.                       for ac_func in setitimer
  7097. do
  7098. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  7099. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7100.   echo $ac_n "(cached) $ac_c" 1>&4
  7101. else
  7102.   cat > conftest.$ac_ext <<EOF
  7103. #line 7104 "configure"
  7104. #include "confdefs.h"
  7105. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7106. /* The GNU C library defines this for functions which it implements
  7107.     to always fail with ENOSYS.  Some functions are actually named
  7108.     something starting with __ and the normal name is an alias.  */
  7109. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7110. choke me
  7111. #endif
  7112.  
  7113. EOF
  7114. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7115.   egrep "choke" >/dev/null 2>&1; then
  7116.   rm -rf conftest*
  7117.   eval "ac_cv_func_$ac_func=no"
  7118. else
  7119.   rm -rf conftest*
  7120.   cat > conftest.$ac_ext <<EOF
  7121. #line 7122 "configure"
  7122. #include "confdefs.h"
  7123. /* Override any gcc2 internal prototype to avoid an error.  */
  7124. char $ac_func(); 
  7125.  
  7126. int main() { return 0; }
  7127. int t() {
  7128.  
  7129. $ac_func();
  7130.  
  7131. ; return 0; }
  7132. EOF
  7133. if eval $ac_link; then
  7134.   rm -rf conftest*
  7135.   eval "ac_cv_func_$ac_func=yes"
  7136. else
  7137.   rm -rf conftest*
  7138.   eval "ac_cv_func_$ac_func=no"
  7139. fi
  7140. rm -f conftest*
  7141.  
  7142. fi
  7143. rm -f conftest*
  7144.  
  7145. fi
  7146. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7147.   echo "$ac_t""yes" 1>&4
  7148.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7149.   cat >> confdefs.h <<EOF
  7150. #define $ac_tr_func 1
  7151. EOF
  7152.  
  7153. else
  7154.   echo "$ac_t""no" 1>&4
  7155. fi
  7156. done
  7157. if test $ac_cv_func_setitimer = yes; then
  7158. echo $ac_n "checking for setitimer declaration""... $ac_c" 1>&4
  7159. if eval "test \"`echo '${'cl_cv_proto_setitimer'+set}'`\" = set"; then
  7160.   echo $ac_n "(cached) $ac_c" 1>&4
  7161. else
  7162.   cat > conftest.$ac_ext <<EOF
  7163. #line 7164 "configure"
  7164. #include "confdefs.h"
  7165.  
  7166. #ifdef STDC_HEADERS
  7167. #include <stdlib.h>
  7168. #endif
  7169. #ifdef HAVE_UNISTD_H
  7170. #include <unistd.h>
  7171. #endif
  7172. #include <sys/time.h>
  7173.  
  7174. extern 
  7175. #ifdef __STDC__
  7176. int setitimer (int which, struct itimerval * ivalue, struct itimerval * ovalue);
  7177. #else
  7178. int setitimer();
  7179. #endif
  7180.  
  7181. int main() { return 0; }
  7182. int t() {
  7183.  
  7184. ; return 0; }
  7185. EOF
  7186. if eval $ac_compile; then
  7187.   rm -rf conftest*
  7188.   cl_cv_proto_setitimer_arg2=""
  7189. else
  7190.   rm -rf conftest*
  7191.   cl_cv_proto_setitimer_arg2="const"
  7192. fi
  7193. rm -f conftest*
  7194.  
  7195.  
  7196.  
  7197.  
  7198. cl_cv_proto_setitimer="extern int setitimer (int, $cl_cv_proto_setitimer_arg2 struct itimerval *, struct itimerval *);"
  7199. fi
  7200.  
  7201. cl_cv_proto_setitimer=`echo "$cl_cv_proto_setitimer" | tr -s ' ' | sed -e 's/( /(/'`
  7202. echo "$ac_t""${ac_tt}$cl_cv_proto_setitimer" 1>&4
  7203.  
  7204.  
  7205. cat >> confdefs.h <<EOF
  7206. #define SETITIMER_CONST $cl_cv_proto_setitimer_arg2
  7207. EOF
  7208.  
  7209. fi
  7210.  
  7211.                       for ac_func in usleep
  7212. do
  7213. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  7214. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7215.   echo $ac_n "(cached) $ac_c" 1>&4
  7216. else
  7217.   cat > conftest.$ac_ext <<EOF
  7218. #line 7219 "configure"
  7219. #include "confdefs.h"
  7220. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7221. /* The GNU C library defines this for functions which it implements
  7222.     to always fail with ENOSYS.  Some functions are actually named
  7223.     something starting with __ and the normal name is an alias.  */
  7224. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7225. choke me
  7226. #endif
  7227.  
  7228. EOF
  7229. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7230.   egrep "choke" >/dev/null 2>&1; then
  7231.   rm -rf conftest*
  7232.   eval "ac_cv_func_$ac_func=no"
  7233. else
  7234.   rm -rf conftest*
  7235.   cat > conftest.$ac_ext <<EOF
  7236. #line 7237 "configure"
  7237. #include "confdefs.h"
  7238. /* Override any gcc2 internal prototype to avoid an error.  */
  7239. char $ac_func(); 
  7240.  
  7241. int main() { return 0; }
  7242. int t() {
  7243.  
  7244. $ac_func();
  7245.  
  7246. ; return 0; }
  7247. EOF
  7248. if eval $ac_link; then
  7249.   rm -rf conftest*
  7250.   eval "ac_cv_func_$ac_func=yes"
  7251. else
  7252.   rm -rf conftest*
  7253.   eval "ac_cv_func_$ac_func=no"
  7254. fi
  7255. rm -f conftest*
  7256.  
  7257. fi
  7258. rm -f conftest*
  7259.  
  7260. fi
  7261. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7262.   echo "$ac_t""yes" 1>&4
  7263.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7264.   cat >> confdefs.h <<EOF
  7265. #define $ac_tr_func 1
  7266. EOF
  7267.  
  7268. else
  7269.   echo "$ac_t""no" 1>&4
  7270. fi
  7271. done
  7272.  
  7273.  
  7274.                       echo $ac_n "checking for localtime declaration""... $ac_c" 1>&4
  7275. if eval "test \"`echo '${'cl_cv_proto_localtime'+set}'`\" = set"; then
  7276.   echo $ac_n "(cached) $ac_c" 1>&4
  7277. else
  7278.   cat > conftest.$ac_ext <<EOF
  7279. #line 7280 "configure"
  7280. #include "confdefs.h"
  7281.  
  7282. #ifdef STDC_HEADERS
  7283. #include <stdlib.h>
  7284. #endif
  7285. #ifdef HAVE_UNISTD_H
  7286. #include <unistd.h>
  7287. #endif
  7288. #ifdef TM_IN_SYS_TIME
  7289. #include <sys/time.h>
  7290. #else
  7291. #include <time.h>
  7292. #endif
  7293.  
  7294. extern 
  7295. #ifdef __STDC__
  7296. struct tm * localtime (time_t* clock);
  7297. #else
  7298. struct tm * localtime();
  7299. #endif
  7300.  
  7301. int main() { return 0; }
  7302. int t() {
  7303.  
  7304. ; return 0; }
  7305. EOF
  7306. if eval $ac_compile; then
  7307.   rm -rf conftest*
  7308.   cl_cv_proto_localtime_arg1=""
  7309. else
  7310.   rm -rf conftest*
  7311.   cl_cv_proto_localtime_arg1="const"
  7312. fi
  7313. rm -f conftest*
  7314.  
  7315.  
  7316.  
  7317.  
  7318. cl_cv_proto_localtime="extern struct tm * localtime ($cl_cv_proto_localtime_arg1 time_t*);"
  7319. fi
  7320.  
  7321. cl_cv_proto_localtime=`echo "$cl_cv_proto_localtime" | tr -s ' ' | sed -e 's/( /(/'`
  7322. echo "$ac_t""${ac_tt}$cl_cv_proto_localtime" 1>&4
  7323.  
  7324.  
  7325. cat >> confdefs.h <<EOF
  7326. #define LOCALTIME_CONST $cl_cv_proto_localtime_arg1
  7327. EOF
  7328.  
  7329.  
  7330.                       
  7331. for ac_func in gettimeofday
  7332. do
  7333. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  7334. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7335.   echo $ac_n "(cached) $ac_c" 1>&4
  7336. else
  7337.   cat > conftest.$ac_ext <<EOF
  7338. #line 7339 "configure"
  7339. #include "confdefs.h"
  7340. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7341. /* The GNU C library defines this for functions which it implements
  7342.     to always fail with ENOSYS.  Some functions are actually named
  7343.     something starting with __ and the normal name is an alias.  */
  7344. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7345. choke me
  7346. #endif
  7347.  
  7348. EOF
  7349. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7350.   egrep "choke" >/dev/null 2>&1; then
  7351.   rm -rf conftest*
  7352.   eval "ac_cv_func_$ac_func=no"
  7353. else
  7354.   rm -rf conftest*
  7355.   cat > conftest.$ac_ext <<EOF
  7356. #line 7357 "configure"
  7357. #include "confdefs.h"
  7358. /* Override any gcc2 internal prototype to avoid an error.  */
  7359. char $ac_func(); 
  7360.  
  7361. int main() { return 0; }
  7362. int t() {
  7363.  
  7364. $ac_func();
  7365.  
  7366. ; return 0; }
  7367. EOF
  7368. if eval $ac_link; then
  7369.   rm -rf conftest*
  7370.   eval "ac_cv_func_$ac_func=yes"
  7371. else
  7372.   rm -rf conftest*
  7373.   eval "ac_cv_func_$ac_func=no"
  7374. fi
  7375. rm -f conftest*
  7376.  
  7377. fi
  7378. rm -f conftest*
  7379.  
  7380. fi
  7381. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7382.   echo "$ac_t""yes" 1>&4
  7383.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7384.   cat >> confdefs.h <<EOF
  7385. #define $ac_tr_func 1
  7386. EOF
  7387.  
  7388. else
  7389.   echo "$ac_t""no" 1>&4
  7390. fi
  7391. done
  7392. if test $ac_cv_func_gettimeofday = yes; then
  7393. echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&4
  7394. if eval "test \"`echo '${'cl_cv_proto_gettimeofday'+set}'`\" = set"; then
  7395.   echo $ac_n "(cached) $ac_c" 1>&4
  7396. else
  7397.   cat > conftest.$ac_ext <<EOF
  7398. #line 7399 "configure"
  7399. #include "confdefs.h"
  7400.  
  7401. #include <sys/types.h>
  7402. #include <sys/time.h>
  7403.  
  7404. extern 
  7405. #ifdef __STDC__
  7406. int gettimeofday (struct timeval * tp, struct timezone * tzp);
  7407. #else
  7408. int gettimeofday();
  7409. #endif
  7410.  
  7411. int main() { return 0; }
  7412. int t() {
  7413.  
  7414. ; return 0; }
  7415. EOF
  7416. if eval $ac_compile; then
  7417.   rm -rf conftest*
  7418.    cl_cv_proto_gettimeofday_dots=no
  7419. cl_cv_proto_gettimeofday_args="struct timeval *, struct timezone *"
  7420. else
  7421.   rm -rf conftest*
  7422.    cl_cv_proto_gettimeofday_dots=yes
  7423. cl_cv_proto_gettimeofday_args="struct timeval *, ..."
  7424. fi
  7425. rm -f conftest*
  7426.  
  7427.  
  7428.  
  7429. cl_cv_proto_gettimeofday="extern int gettimeofday ($cl_cv_proto_gettimeofday_args);"
  7430. fi
  7431.  
  7432. cl_cv_proto_gettimeofday=`echo "$cl_cv_proto_gettimeofday" | tr -s ' ' | sed -e 's/( /(/'`
  7433. echo "$ac_t""${ac_tt}$cl_cv_proto_gettimeofday" 1>&4
  7434.  
  7435.  
  7436. if test $cl_cv_proto_gettimeofday_dots = yes; then
  7437. cat >> confdefs.h <<\EOF
  7438. #define GETTIMEOFDAY_DOTS 1
  7439. EOF
  7440.  
  7441. fi
  7442. fi
  7443.  
  7444.                       
  7445. for ac_func in ftime
  7446. do
  7447. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  7448. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7449.   echo $ac_n "(cached) $ac_c" 1>&4
  7450. else
  7451.   cat > conftest.$ac_ext <<EOF
  7452. #line 7453 "configure"
  7453. #include "confdefs.h"
  7454. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7455. /* The GNU C library defines this for functions which it implements
  7456.     to always fail with ENOSYS.  Some functions are actually named
  7457.     something starting with __ and the normal name is an alias.  */
  7458. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7459. choke me
  7460. #endif
  7461.  
  7462. EOF
  7463. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7464.   egrep "choke" >/dev/null 2>&1; then
  7465.   rm -rf conftest*
  7466.   eval "ac_cv_func_$ac_func=no"
  7467. else
  7468.   rm -rf conftest*
  7469.   cat > conftest.$ac_ext <<EOF
  7470. #line 7471 "configure"
  7471. #include "confdefs.h"
  7472. /* Override any gcc2 internal prototype to avoid an error.  */
  7473. char $ac_func(); 
  7474.  
  7475. int main() { return 0; }
  7476. int t() {
  7477.  
  7478. $ac_func();
  7479.  
  7480. ; return 0; }
  7481. EOF
  7482. if eval $ac_link; then
  7483.   rm -rf conftest*
  7484.   eval "ac_cv_func_$ac_func=yes"
  7485. else
  7486.   rm -rf conftest*
  7487.   eval "ac_cv_func_$ac_func=no"
  7488. fi
  7489. rm -f conftest*
  7490.  
  7491. fi
  7492. rm -f conftest*
  7493.  
  7494. fi
  7495. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7496.   echo "$ac_t""yes" 1>&4
  7497.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7498.   cat >> confdefs.h <<EOF
  7499. #define $ac_tr_func 1
  7500. EOF
  7501.  
  7502. else
  7503.   echo "$ac_t""no" 1>&4
  7504. fi
  7505. done
  7506.  
  7507.                       if test $ac_cv_func_gettimeofday = no -a $ac_cv_func_ftime = no; then
  7508. echo $ac_n "checking for times""... $ac_c" 1>&4
  7509. if eval "test \"`echo '${'ac_cv_func_times'+set}'`\" = set"; then
  7510.   echo $ac_n "(cached) $ac_c" 1>&4
  7511. else
  7512.   cat > conftest.$ac_ext <<EOF
  7513. #line 7514 "configure"
  7514. #include "confdefs.h"
  7515. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7516. /* The GNU C library defines this for functions which it implements
  7517.     to always fail with ENOSYS.  Some functions are actually named
  7518.     something starting with __ and the normal name is an alias.  */
  7519. #if defined (__stub_times) || defined (__stub___times)
  7520. choke me
  7521. #endif
  7522.  
  7523. EOF
  7524. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7525.   egrep "choke" >/dev/null 2>&1; then
  7526.   rm -rf conftest*
  7527.   eval "ac_cv_func_times=no"
  7528. else
  7529.   rm -rf conftest*
  7530.   cat > conftest.$ac_ext <<EOF
  7531. #line 7532 "configure"
  7532. #include "confdefs.h"
  7533. /* Override any gcc2 internal prototype to avoid an error.  */
  7534. char times(); 
  7535.  
  7536. int main() { return 0; }
  7537. int t() {
  7538.  
  7539. times();
  7540.  
  7541. ; return 0; }
  7542. EOF
  7543. if eval $ac_link; then
  7544.   rm -rf conftest*
  7545.   eval "ac_cv_func_times=yes"
  7546. else
  7547.   rm -rf conftest*
  7548.   eval "ac_cv_func_times=no"
  7549. fi
  7550. rm -f conftest*
  7551.  
  7552. fi
  7553. rm -f conftest*
  7554.  
  7555. fi
  7556. if eval "test \"`echo '$ac_cv_func_'times`\" = yes"; then
  7557.   echo "$ac_t""yes" 1>&4
  7558.   :
  7559. else
  7560.   echo "$ac_t""no" 1>&4
  7561. no_times=1
  7562. fi
  7563. if test -z "$no_times"; then
  7564. echo $ac_n "checking for times return value""... $ac_c" 1>&4
  7565. if eval "test \"`echo '${'cl_cv_func_times_return'+set}'`\" = set"; then
  7566.   echo $ac_n "(cached) $ac_c" 1>&4
  7567. else
  7568.   
  7569. if test "$cross_compiling" = yes; then
  7570.   cl_cv_func_times_return="guessing no"
  7571. else
  7572. cat > conftest.$ac_ext <<EOF
  7573. #line 7574 "configure"
  7574. #include "confdefs.h"
  7575.  
  7576. #include <sys/types.h>
  7577. #include <time.h> /* needed for CLK_TCK */
  7578. #ifndef CLK_TCK
  7579. #include <sys/time.h> /* needed for CLK_TCK on SYSV PTX */
  7580. #endif
  7581. #include <sys/times.h>
  7582. main ()
  7583. { struct tms buffer;
  7584.   clock_t result1;
  7585.   clock_t result2;
  7586.   int ticks;
  7587.   result1 = times(&buffer);
  7588.   if ((result1 == (clock_t)0) || (result1 == (clock_t)(-1))) exit(1);
  7589.   sleep(1);
  7590.   result2 = times(&buffer);
  7591.   if ((result2 == (clock_t)0) || (result2 == (clock_t)(-1))) exit(1);
  7592.   ticks = result2 - result1;
  7593.   exit(!((ticks >= CLK_TCK/2) && (ticks <= 3*CLK_TCK/2)));
  7594. }
  7595. EOF
  7596. eval $ac_link
  7597. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  7598.   cl_cv_func_times_return=yes
  7599. else
  7600.   cl_cv_func_times_return=no
  7601. fi
  7602. if test -f core; then
  7603.   coredir=core`/bin/sh -c 'echo $$'`
  7604.   mkdir $coredir
  7605.   cp confdefs.h $coredir/confdefs.h
  7606.   mv conftest.c $coredir/conftest.c
  7607.   mv conftest $coredir/conftest
  7608.   mv core $coredir/core
  7609.   echo "warning: test program dumped core -- see subdirectory $coredir"
  7610. fi
  7611. fi
  7612. rm -fr conftest*
  7613.  
  7614. fi
  7615.  
  7616. case "$cl_cv_func_times_return" in
  7617.   *yes) cat >> confdefs.h <<\EOF
  7618. #define HAVE_TIMES_CLOCK 1
  7619. EOF
  7620.  ;;
  7621.   *no)  ;;
  7622. esac
  7623. fi
  7624. fi
  7625.  
  7626.                       echo $ac_n "checking for getpwnam declaration""... $ac_c" 1>&4
  7627. if eval "test \"`echo '${'cl_cv_proto_getpwnam'+set}'`\" = set"; then
  7628.   echo $ac_n "(cached) $ac_c" 1>&4
  7629. else
  7630.   cat > conftest.$ac_ext <<EOF
  7631. #line 7632 "configure"
  7632. #include "confdefs.h"
  7633.  
  7634. #ifdef STDC_HEADERS
  7635. #include <stdlib.h>
  7636. #endif
  7637. #ifdef HAVE_UNISTD_H
  7638. #include <unistd.h>
  7639. #endif
  7640. #include <pwd.h>
  7641.  
  7642. extern 
  7643. #ifdef __STDC__
  7644. struct passwd * getpwnam (char* name);
  7645. #else
  7646. struct passwd * getpwnam();
  7647. #endif
  7648.  
  7649. int main() { return 0; }
  7650. int t() {
  7651.  
  7652. ; return 0; }
  7653. EOF
  7654. if eval $ac_compile; then
  7655.   rm -rf conftest*
  7656.   cl_cv_proto_getpwnam_arg1=""
  7657. else
  7658.   rm -rf conftest*
  7659.   cl_cv_proto_getpwnam_arg1="const"
  7660. fi
  7661. rm -f conftest*
  7662.  
  7663.  
  7664.  
  7665.  
  7666. cl_cv_proto_getpwnam="extern struct passwd * getpwnam ($cl_cv_proto_getpwnam_arg1 char*);"
  7667. fi
  7668.  
  7669. cl_cv_proto_getpwnam=`echo "$cl_cv_proto_getpwnam" | tr -s ' ' | sed -e 's/( /(/'`
  7670. echo "$ac_t""${ac_tt}$cl_cv_proto_getpwnam" 1>&4
  7671.  
  7672.  
  7673. cat >> confdefs.h <<EOF
  7674. #define GETPWNAM_CONST $cl_cv_proto_getpwnam_arg1
  7675. EOF
  7676.  
  7677.  
  7678.                       echo $ac_n "checking for getpwuid declaration""... $ac_c" 1>&4
  7679. if eval "test \"`echo '${'cl_cv_proto_getpwuid'+set}'`\" = set"; then
  7680.   echo $ac_n "(cached) $ac_c" 1>&4
  7681. else
  7682.   cat > conftest.$ac_ext <<EOF
  7683. #line 7684 "configure"
  7684. #include "confdefs.h"
  7685.  
  7686. #ifdef STDC_HEADERS
  7687. #include <stdlib.h>
  7688. #endif
  7689. #ifdef HAVE_UNISTD_H
  7690. #include <unistd.h>
  7691. #endif
  7692. #include <pwd.h>
  7693.  
  7694. extern 
  7695. #ifdef __STDC__
  7696. struct passwd * getpwuid (uid_t uid);
  7697. #else
  7698. struct passwd * getpwuid();
  7699. #endif
  7700.  
  7701. int main() { return 0; }
  7702. int t() {
  7703.  
  7704. ; return 0; }
  7705. EOF
  7706. if eval $ac_compile; then
  7707.   rm -rf conftest*
  7708.   cl_cv_proto_getpwuid_arg1="uid_t"
  7709. else
  7710.   rm -rf conftest*
  7711.   cl_cv_proto_getpwuid_arg1="int"
  7712. fi
  7713. rm -f conftest*
  7714.  
  7715.  
  7716.  
  7717. cl_cv_proto_getpwuid="extern struct passwd * getpwuid ($cl_cv_proto_getpwuid_arg1);"
  7718. fi
  7719.  
  7720. cl_cv_proto_getpwuid=`echo "$cl_cv_proto_getpwuid" | tr -s ' ' | sed -e 's/( /(/'`
  7721. echo "$ac_t""${ac_tt}$cl_cv_proto_getpwuid" 1>&4
  7722.  
  7723.  
  7724. cat >> confdefs.h <<EOF
  7725. #define GETPWUID_UID_T $cl_cv_proto_getpwuid_arg1
  7726. EOF
  7727.  
  7728.  
  7729.                       for ac_func in gethostname
  7730. do
  7731. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  7732. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  7733.   echo $ac_n "(cached) $ac_c" 1>&4
  7734. else
  7735.   cat > conftest.$ac_ext <<EOF
  7736. #line 7737 "configure"
  7737. #include "confdefs.h"
  7738. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  7739. /* The GNU C library defines this for functions which it implements
  7740.     to always fail with ENOSYS.  Some functions are actually named
  7741.     something starting with __ and the normal name is an alias.  */
  7742. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  7743. choke me
  7744. #endif
  7745.  
  7746. EOF
  7747. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  7748.   egrep "choke" >/dev/null 2>&1; then
  7749.   rm -rf conftest*
  7750.   eval "ac_cv_func_$ac_func=no"
  7751. else
  7752.   rm -rf conftest*
  7753.   cat > conftest.$ac_ext <<EOF
  7754. #line 7755 "configure"
  7755. #include "confdefs.h"
  7756. /* Override any gcc2 internal prototype to avoid an error.  */
  7757. char $ac_func(); 
  7758.  
  7759. int main() { return 0; }
  7760. int t() {
  7761.  
  7762. $ac_func();
  7763.  
  7764. ; return 0; }
  7765. EOF
  7766. if eval $ac_link; then
  7767.   rm -rf conftest*
  7768.   eval "ac_cv_func_$ac_func=yes"
  7769. else
  7770.   rm -rf conftest*
  7771.   eval "ac_cv_func_$ac_func=no"
  7772. fi
  7773. rm -f conftest*
  7774.  
  7775. fi
  7776. rm -f conftest*
  7777.  
  7778. fi
  7779. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  7780.   echo "$ac_t""yes" 1>&4
  7781.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  7782.   cat >> confdefs.h <<EOF
  7783. #define $ac_tr_func 1
  7784. EOF
  7785.  
  7786. else
  7787.   echo "$ac_t""no" 1>&4
  7788. fi
  7789. done
  7790. if test $ac_cv_func_gethostname = yes; then
  7791. echo $ac_n "checking for gethostname declaration""... $ac_c" 1>&4
  7792. if eval "test \"`echo '${'cl_cv_proto_gethostname'+set}'`\" = set"; then
  7793.   echo $ac_n "(cached) $ac_c" 1>&4
  7794. else
  7795.   cat > conftest.$ac_ext <<EOF
  7796. #line 7797 "configure"
  7797. #include "confdefs.h"
  7798.  
  7799. #ifdef STDC_HEADERS
  7800. #include <stdlib.h>
  7801. #endif
  7802. #ifdef HAVE_UNISTD_H
  7803. #include <unistd.h>
  7804. #endif
  7805.  
  7806. extern 
  7807. #ifdef __STDC__
  7808. int gethostname (char* name, int namelen);
  7809. #else
  7810. int gethostname();
  7811. #endif
  7812.  
  7813. int main() { return 0; }
  7814. int t() {
  7815.  
  7816. ; return 0; }
  7817. EOF
  7818. if eval $ac_compile; then
  7819.   rm -rf conftest*
  7820.   cl_cv_proto_gethostname_arg2="int"
  7821. else
  7822.   rm -rf conftest*
  7823.   cl_cv_proto_gethostname_arg2="size_t"
  7824. fi
  7825. rm -f conftest*
  7826.  
  7827.  
  7828.  
  7829. cl_cv_proto_gethostname="extern int gethostname (char*, $cl_cv_proto_gethostname_arg2);"
  7830. fi
  7831.  
  7832. cl_cv_proto_gethostname=`echo "$cl_cv_proto_gethostname" | tr -s ' ' | sed -e 's/( /(/'`
  7833. echo "$ac_t""${ac_tt}$cl_cv_proto_gethostname" 1>&4
  7834.  
  7835.  
  7836. cat >> confdefs.h <<EOF
  7837. #define GETHOSTNAME_SIZE_T $cl_cv_proto_gethostname_arg2
  7838. EOF
  7839.  
  7840. fi
  7841.  
  7842.                       if test $ac_cv_header_netdb_h = yes; then
  7843.   have_netdb=1
  7844. else
  7845.   ac_safe=`echo "sun/netdb.h" | tr './\055' '___'`
  7846. echo $ac_n "checking for sun/netdb.h""... $ac_c" 1>&4
  7847. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  7848.   echo $ac_n "(cached) $ac_c" 1>&4
  7849. else
  7850.   cat > conftest.$ac_ext <<EOF
  7851. #line 7852 "configure"
  7852. #include "confdefs.h"
  7853. #include <sun/netdb.h>
  7854. EOF
  7855. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  7856. ac_err=`grep -v '^ *+' conftest.out`
  7857. if test -z "$ac_err"; then
  7858.   rm -rf conftest*
  7859.   eval "ac_cv_header_$ac_safe=yes"
  7860. else
  7861.   echo "$ac_err" >&5
  7862.   rm -rf conftest*
  7863.   eval "ac_cv_header_$ac_safe=no"
  7864. fi
  7865. rm -f conftest*
  7866. fi
  7867. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  7868.   echo "$ac_t""yes" 1>&4
  7869.   have_netdb=1
  7870. else
  7871.   echo "$ac_t""no" 1>&4
  7872. fi
  7873.  
  7874. fi
  7875. if test -n "$have_netdb"; then
  7876. cat >> confdefs.h <<\EOF
  7877. #define HAVE_GETHOSTBYNAME 1
  7878. EOF
  7879.  
  7880. echo $ac_n "checking for gethostbyname declaration""... $ac_c" 1>&4
  7881. if eval "test \"`echo '${'cl_cv_proto_gethostbyname'+set}'`\" = set"; then
  7882.   echo $ac_n "(cached) $ac_c" 1>&4
  7883. else
  7884.   cat > conftest.$ac_ext <<EOF
  7885. #line 7886 "configure"
  7886. #include "confdefs.h"
  7887.  
  7888. #ifdef STDC_HEADERS
  7889. #include <stdlib.h>
  7890. #endif
  7891. #ifdef HAVE_UNISTD_H
  7892. #include <unistd.h>
  7893. #endif
  7894. #include <sys/types.h>
  7895. #ifdef HAVE_NETDB_H
  7896. #include <sys/socket.h>
  7897. #include <netdb.h>
  7898. #else
  7899. #include <sun/netdb.h>
  7900. #endif
  7901.  
  7902. extern 
  7903. #ifdef __STDC__
  7904. struct hostent * gethostbyname (char* name);
  7905. #else
  7906. struct hostent * gethostbyname();
  7907. #endif
  7908.  
  7909. int main() { return 0; }
  7910. int t() {
  7911.  
  7912. ; return 0; }
  7913. EOF
  7914. if eval $ac_compile; then
  7915.   rm -rf conftest*
  7916.   cl_cv_proto_gethostbyname_arg1=""
  7917. else
  7918.   rm -rf conftest*
  7919.   cl_cv_proto_gethostbyname_arg1="const"
  7920. fi
  7921. rm -f conftest*
  7922.  
  7923.  
  7924.  
  7925.  
  7926. cl_cv_proto_gethostbyname="extern struct hostent * gethostbyname ($cl_cv_proto_gethostbyname_arg1 char*);"
  7927. fi
  7928.  
  7929. cl_cv_proto_gethostbyname=`echo "$cl_cv_proto_gethostbyname" | tr -s ' ' | sed -e 's/( /(/'`
  7930. echo "$ac_t""${ac_tt}$cl_cv_proto_gethostbyname" 1>&4
  7931.  
  7932.  
  7933. cat >> confdefs.h <<EOF
  7934. #define GETHOSTBYNAME_CONST $cl_cv_proto_gethostbyname_arg1
  7935. EOF
  7936.  
  7937. fi
  7938.  
  7939.                       echo $ac_n "checking for connect declaration""... $ac_c" 1>&4
  7940. if eval "test \"`echo '${'cl_cv_proto_connect'+set}'`\" = set"; then
  7941.   echo $ac_n "(cached) $ac_c" 1>&4
  7942. else
  7943.   for x in '' 'const'; do
  7944. for y in 'struct sockaddr *' 'void*'; do
  7945. if test -z "$have_connect"; then
  7946. cat > conftest.$ac_ext <<EOF
  7947. #line 7948 "configure"
  7948. #include "confdefs.h"
  7949.  
  7950. #ifdef HAVE_UNISTD_H
  7951. #include <unistd.h>
  7952. #endif
  7953. #include <sys/types.h>
  7954. #include <sys/socket.h>
  7955.  
  7956. extern 
  7957. #ifdef __STDC__
  7958. int connect (int fd, $x $y name, int namelen);
  7959. #else
  7960. int connect();
  7961. #endif
  7962.  
  7963. int main() { return 0; }
  7964. int t() {
  7965.  
  7966. ; return 0; }
  7967. EOF
  7968. if eval $ac_compile; then
  7969.   rm -rf conftest*
  7970.   cl_cv_proto_connect_arg2a="$x"
  7971. cl_cv_proto_connect_arg2b="$y"
  7972. have_connect=1
  7973. fi
  7974. rm -f conftest*
  7975.  
  7976.  
  7977. fi
  7978. done
  7979. done
  7980.  
  7981. cl_cv_proto_connect="extern int connect (int, $cl_cv_proto_connect_arg2a $cl_cv_proto_connect_arg2b, int);"
  7982. fi
  7983.  
  7984. cl_cv_proto_connect=`echo "$cl_cv_proto_connect" | tr -s ' ' | sed -e 's/( /(/'`
  7985. echo "$ac_t""${ac_tt}$cl_cv_proto_connect" 1>&4
  7986.  
  7987.  
  7988. cat >> confdefs.h <<EOF
  7989. #define CONNECT_CONST $cl_cv_proto_connect_arg2a
  7990. EOF
  7991.  
  7992. cat >> confdefs.h <<EOF
  7993. #define CONNECT_NAME_T $cl_cv_proto_connect_arg2b
  7994. EOF
  7995.  
  7996.  
  7997.                       for ac_hdr in sys/un.h
  7998. do
  7999. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  8000. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  8001. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  8002.   echo $ac_n "(cached) $ac_c" 1>&4
  8003. else
  8004.   cat > conftest.$ac_ext <<EOF
  8005. #line 8006 "configure"
  8006. #include "confdefs.h"
  8007. #include <$ac_hdr>
  8008. EOF
  8009. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  8010. ac_err=`grep -v '^ *+' conftest.out`
  8011. if test -z "$ac_err"; then
  8012.   rm -rf conftest*
  8013.   eval "ac_cv_header_$ac_safe=yes"
  8014. else
  8015.   echo "$ac_err" >&5
  8016.   rm -rf conftest*
  8017.   eval "ac_cv_header_$ac_safe=no"
  8018. fi
  8019. rm -f conftest*
  8020. fi
  8021. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  8022.   echo "$ac_t""yes" 1>&4
  8023.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  8024.   cat >> confdefs.h <<EOF
  8025. #define $ac_tr_hdr 1
  8026. EOF
  8027.  
  8028. else
  8029.   echo "$ac_t""no" 1>&4
  8030. fi
  8031. done
  8032. if test $ac_cv_header_sys_un_h = yes; then
  8033. echo $ac_n "checking for sun_len in struct sockaddr_un""... $ac_c" 1>&4
  8034. if eval "test \"`echo '${'cl_cv_struct_sockaddr_sun_len'+set}'`\" = set"; then
  8035.   echo $ac_n "(cached) $ac_c" 1>&4
  8036. else
  8037.   
  8038. cat > conftest.$ac_ext <<EOF
  8039. #line 8040 "configure"
  8040. #include "confdefs.h"
  8041. #include <sys/types.h> /* NetBSD 1.0 needs this */
  8042. #include <sys/un.h>
  8043. int main() { return 0; }
  8044. int t() {
  8045. struct sockaddr_un unaddr; unaddr.sun_len;
  8046. ; return 0; }
  8047. EOF
  8048. if eval $ac_compile; then
  8049.   rm -rf conftest*
  8050.   cl_cv_struct_sockaddr_sun_len=yes
  8051. else
  8052.   rm -rf conftest*
  8053.   cl_cv_struct_sockaddr_sun_len=no
  8054. fi
  8055. rm -f conftest*
  8056.  
  8057.  
  8058. fi
  8059.  
  8060. echo "$ac_t""$cl_cv_struct_sockaddr_sun_len" 1>&4
  8061. if test $cl_cv_struct_sockaddr_sun_len = yes; then
  8062.   cat >> confdefs.h <<\EOF
  8063. #define HAVE_SOCKADDR_UN_LEN 1
  8064. EOF
  8065.  
  8066. fi
  8067. fi
  8068.  
  8069.                       for ac_hdr in netinet/in.h arpa/inet.h
  8070. do
  8071. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  8072. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  8073. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  8074.   echo $ac_n "(cached) $ac_c" 1>&4
  8075. else
  8076.   cat > conftest.$ac_ext <<EOF
  8077. #line 8078 "configure"
  8078. #include "confdefs.h"
  8079. #include <$ac_hdr>
  8080. EOF
  8081. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  8082. ac_err=`grep -v '^ *+' conftest.out`
  8083. if test -z "$ac_err"; then
  8084.   rm -rf conftest*
  8085.   eval "ac_cv_header_$ac_safe=yes"
  8086. else
  8087.   echo "$ac_err" >&5
  8088.   rm -rf conftest*
  8089.   eval "ac_cv_header_$ac_safe=no"
  8090. fi
  8091. rm -f conftest*
  8092. fi
  8093. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  8094.   echo "$ac_t""yes" 1>&4
  8095.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  8096.   cat >> confdefs.h <<EOF
  8097. #define $ac_tr_hdr 1
  8098. EOF
  8099.  
  8100. else
  8101.   echo "$ac_t""no" 1>&4
  8102. fi
  8103. done
  8104. echo $ac_n "checking for inet_addr declaration""... $ac_c" 1>&4
  8105. if eval "test \"`echo '${'cl_cv_proto_inet_addr'+set}'`\" = set"; then
  8106.   echo $ac_n "(cached) $ac_c" 1>&4
  8107. else
  8108.   cat > conftest.$ac_ext <<EOF
  8109. #line 8110 "configure"
  8110. #include "confdefs.h"
  8111.  
  8112. #ifdef HAVE_UNISTD_H
  8113. #include <unistd.h>
  8114. #endif
  8115. #include <sys/types.h>
  8116. #include <netinet/in.h>
  8117. #ifdef HAVE_ARPA_INET_H
  8118. #include <arpa/inet.h>
  8119. #endif
  8120.  
  8121. extern 
  8122. #ifdef __STDC__
  8123. struct in_addr inet_addr();
  8124. #else
  8125. struct in_addr inet_addr();
  8126. #endif
  8127.  
  8128. int main() { return 0; }
  8129. int t() {
  8130.  
  8131. ; return 0; }
  8132. EOF
  8133. if eval $ac_compile; then
  8134.   rm -rf conftest*
  8135.   cl_cv_proto_inet_addr_ret="struct in_addr"
  8136. have_inet_addr=1
  8137. fi
  8138. rm -f conftest*
  8139.  
  8140.  
  8141. if test -z "$have_inet_addr"; then
  8142. cat > conftest.$ac_ext <<EOF
  8143. #line 8144 "configure"
  8144. #include "confdefs.h"
  8145.  
  8146. #ifdef HAVE_UNISTD_H
  8147. #include <unistd.h>
  8148. #endif
  8149. #include <sys/types.h>
  8150. #include <netinet/in.h>
  8151. #ifdef HAVE_ARPA_INET_H
  8152. #include <arpa/inet.h>
  8153. #endif
  8154.  
  8155. extern 
  8156. #ifdef __STDC__
  8157. unsigned long inet_addr();
  8158. #else
  8159. unsigned long inet_addr();
  8160. #endif
  8161.  
  8162. int main() { return 0; }
  8163. int t() {
  8164.  
  8165. ; return 0; }
  8166. EOF
  8167. if eval $ac_compile; then
  8168.   rm -rf conftest*
  8169.   cl_cv_proto_inet_addr_ret="unsigned long"
  8170. else
  8171.   rm -rf conftest*
  8172.   cl_cv_proto_inet_addr_ret="unsigned int"
  8173. fi
  8174. rm -f conftest*
  8175.  
  8176.  
  8177. fi
  8178. cat > conftest.$ac_ext <<EOF
  8179. #line 8180 "configure"
  8180. #include "confdefs.h"
  8181.  
  8182. #ifdef HAVE_UNISTD_H
  8183. #include <unistd.h>
  8184. #endif
  8185. #include <sys/types.h>
  8186. #include <netinet/in.h>
  8187. #ifdef HAVE_ARPA_INET_H
  8188. #include <arpa/inet.h>
  8189. #endif
  8190.  
  8191. extern 
  8192. #ifdef __STDC__
  8193. $cl_cv_proto_inet_addr_ret inet_addr (char* cp);
  8194. #else
  8195. $cl_cv_proto_inet_addr_ret inet_addr();
  8196. #endif
  8197.  
  8198. int main() { return 0; }
  8199. int t() {
  8200.  
  8201. ; return 0; }
  8202. EOF
  8203. if eval $ac_compile; then
  8204.   rm -rf conftest*
  8205.   cl_cv_proto_inet_addr_arg1=""
  8206. else
  8207.   rm -rf conftest*
  8208.   cl_cv_proto_inet_addr_arg1="const"
  8209. fi
  8210. rm -f conftest*
  8211.  
  8212.  
  8213.  
  8214.  
  8215. cl_cv_proto_inet_addr="extern $cl_cv_proto_inet_addr_ret inet_addr ($cl_cv_proto_inet_addr_arg1 char*);"
  8216. fi
  8217.  
  8218. cl_cv_proto_inet_addr=`echo "$cl_cv_proto_inet_addr" | tr -s ' ' | sed -e 's/( /(/'`
  8219. echo "$ac_t""${ac_tt}$cl_cv_proto_inet_addr" 1>&4
  8220.  
  8221.  
  8222. cat >> confdefs.h <<EOF
  8223. #define RET_INET_ADDR_TYPE $cl_cv_proto_inet_addr_ret
  8224. EOF
  8225.  
  8226. cat >> confdefs.h <<EOF
  8227. #define INET_ADDR_CONST $cl_cv_proto_inet_addr_arg1
  8228. EOF
  8229.  
  8230. if test "$cl_cv_proto_inet_addr_ret" = "struct in_addr"; then
  8231. cat >> confdefs.h <<\EOF
  8232. #define INET_ADDR_SUFFIX .s_addr
  8233. EOF
  8234.  
  8235. else
  8236. cat >> confdefs.h <<\EOF
  8237. #define INET_ADDR_SUFFIX 
  8238. EOF
  8239.  
  8240. fi
  8241. for ac_hdr in netinet/tcp.h
  8242. do
  8243. ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
  8244. echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
  8245. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  8246.   echo $ac_n "(cached) $ac_c" 1>&4
  8247. else
  8248.   cat > conftest.$ac_ext <<EOF
  8249. #line 8250 "configure"
  8250. #include "confdefs.h"
  8251. #include <$ac_hdr>
  8252. EOF
  8253. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  8254. ac_err=`grep -v '^ *+' conftest.out`
  8255. if test -z "$ac_err"; then
  8256.   rm -rf conftest*
  8257.   eval "ac_cv_header_$ac_safe=yes"
  8258. else
  8259.   echo "$ac_err" >&5
  8260.   rm -rf conftest*
  8261.   eval "ac_cv_header_$ac_safe=no"
  8262. fi
  8263. rm -f conftest*
  8264. fi
  8265. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  8266.   echo "$ac_t""yes" 1>&4
  8267.     ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
  8268.   cat >> confdefs.h <<EOF
  8269. #define $ac_tr_hdr 1
  8270. EOF
  8271.  
  8272. else
  8273.   echo "$ac_t""no" 1>&4
  8274. fi
  8275. done
  8276.  
  8277.                       
  8278. echo $ac_n "checking for getpagesize""... $ac_c" 1>&4
  8279. if eval "test \"`echo '${'cl_cv_func_getpagesize'+set}'`\" = set"; then
  8280.   echo $ac_n "(cached) $ac_c" 1>&4
  8281. else
  8282.   
  8283. cat > conftest.$ac_ext <<EOF
  8284. #line 8285 "configure"
  8285. #include "confdefs.h"
  8286.  
  8287. int main() { return 0; }
  8288. int t() {
  8289. getpagesize();
  8290. ; return 0; }
  8291. EOF
  8292. if eval $ac_link; then
  8293.   rm -rf conftest*
  8294.   cl_cv_func_getpagesize=yes
  8295. else
  8296.   rm -rf conftest*
  8297.   cl_cv_func_getpagesize=no
  8298. fi
  8299. rm -f conftest*
  8300.  
  8301.  
  8302. fi
  8303.  
  8304. echo "$ac_t""$cl_cv_func_getpagesize" 1>&4
  8305. if test $cl_cv_func_getpagesize = yes; then
  8306.   cat >> confdefs.h <<\EOF
  8307. #define HAVE_GETPAGESIZE 1
  8308. EOF
  8309.  
  8310. have_getpagesize=1
  8311. fi
  8312. if test -n "$have_getpagesize"; then
  8313. echo $ac_n "checking for getpagesize declaration""... $ac_c" 1>&4
  8314. if eval "test \"`echo '${'cl_cv_proto_getpagesize'+set}'`\" = set"; then
  8315.   echo $ac_n "(cached) $ac_c" 1>&4
  8316. else
  8317.   cat > conftest.$ac_ext <<EOF
  8318. #line 8319 "configure"
  8319. #include "confdefs.h"
  8320.  
  8321. #ifdef STDC_HEADERS
  8322. #include <stdlib.h>
  8323. #endif
  8324. #ifdef HAVE_UNISTD_H
  8325. #include <unistd.h>
  8326. #endif
  8327.  
  8328. extern int getpagesize();
  8329.  
  8330. int main() { return 0; }
  8331. int t() {
  8332.  
  8333. ; return 0; }
  8334. EOF
  8335. if eval $ac_compile; then
  8336.   rm -rf conftest*
  8337.   cl_cv_proto_getpagesize_ret="int"
  8338. else
  8339.   rm -rf conftest*
  8340.   cl_cv_proto_getpagesize_ret="size_t"
  8341. fi
  8342. rm -f conftest*
  8343.  
  8344.  
  8345.  
  8346. cl_cv_proto_getpagesize="extern $cl_cv_proto_getpagesize_ret getpagesize (void);"
  8347. fi
  8348.  
  8349. cl_cv_proto_getpagesize=`echo "$cl_cv_proto_getpagesize" | tr -s ' ' | sed -e 's/( /(/'`
  8350. echo "$ac_t""${ac_tt}$cl_cv_proto_getpagesize" 1>&4
  8351.  
  8352.  
  8353. cat >> confdefs.h <<EOF
  8354. #define RETGETPAGESIZETYPE $cl_cv_proto_getpagesize_ret
  8355. EOF
  8356.  
  8357. fi
  8358.  
  8359.                       echo $ac_n "checking for vadvise""... $ac_c" 1>&4
  8360. if eval "test \"`echo '${'cl_cv_func_vadvise'+set}'`\" = set"; then
  8361.   echo $ac_n "(cached) $ac_c" 1>&4
  8362. else
  8363.   
  8364. cat > conftest.$ac_ext <<EOF
  8365. #line 8366 "configure"
  8366. #include "confdefs.h"
  8367. #include <sys/vadvise.h>
  8368. int main() { return 0; }
  8369. int t() {
  8370. vadvise(0);
  8371. ; return 0; }
  8372. EOF
  8373. if eval $ac_link; then
  8374.   rm -rf conftest*
  8375.   cl_cv_func_vadvise=yes
  8376. else
  8377.   rm -rf conftest*
  8378.   cl_cv_func_vadvise=no
  8379. fi
  8380. rm -f conftest*
  8381.  
  8382.  
  8383. fi
  8384.  
  8385. echo "$ac_t""$cl_cv_func_vadvise" 1>&4
  8386. if test $cl_cv_func_vadvise = yes; then
  8387.   cat >> confdefs.h <<\EOF
  8388. #define HAVE_VADVISE 1
  8389. EOF
  8390.  
  8391. fi
  8392.  
  8393.                       echo $ac_n "checking for vm_allocate""... $ac_c" 1>&4
  8394. if eval "test \"`echo '${'cl_cv_func_vm'+set}'`\" = set"; then
  8395.   echo $ac_n "(cached) $ac_c" 1>&4
  8396. else
  8397.   
  8398. cat > conftest.$ac_ext <<EOF
  8399. #line 8400 "configure"
  8400. #include "confdefs.h"
  8401.  
  8402. int main() { return 0; }
  8403. int t() {
  8404. vm_allocate(); task_self();
  8405. ; return 0; }
  8406. EOF
  8407. if eval $ac_link; then
  8408.   rm -rf conftest*
  8409.   cl_cv_func_vm=yes
  8410. else
  8411.   rm -rf conftest*
  8412.   cl_cv_func_vm=no
  8413. fi
  8414. rm -f conftest*
  8415.  
  8416.  
  8417. fi
  8418.  
  8419. echo "$ac_t""$cl_cv_func_vm" 1>&4
  8420. if test $cl_cv_func_vm = yes; then
  8421.   cat >> confdefs.h <<\EOF
  8422. #define HAVE_MACH_VM 1
  8423. EOF
  8424.  
  8425. fi
  8426.  
  8427.                       
  8428. ac_safe=`echo "sys/mman.h" | tr './\055' '___'`
  8429. echo $ac_n "checking for sys/mman.h""... $ac_c" 1>&4
  8430. if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  8431.   echo $ac_n "(cached) $ac_c" 1>&4
  8432. else
  8433.   cat > conftest.$ac_ext <<EOF
  8434. #line 8435 "configure"
  8435. #include "confdefs.h"
  8436. #include <sys/mman.h>
  8437. EOF
  8438. eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
  8439. ac_err=`grep -v '^ *+' conftest.out`
  8440. if test -z "$ac_err"; then
  8441.   rm -rf conftest*
  8442.   eval "ac_cv_header_$ac_safe=yes"
  8443. else
  8444.   echo "$ac_err" >&5
  8445.   rm -rf conftest*
  8446.   eval "ac_cv_header_$ac_safe=no"
  8447. fi
  8448. rm -f conftest*
  8449. fi
  8450. if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  8451.   echo "$ac_t""yes" 1>&4
  8452.   :
  8453. else
  8454.   echo "$ac_t""no" 1>&4
  8455. no_mmap=1
  8456. fi
  8457. if test -z "$no_mmap"; then
  8458. echo $ac_n "checking for mmap""... $ac_c" 1>&4
  8459. if eval "test \"`echo '${'ac_cv_func_mmap'+set}'`\" = set"; then
  8460.   echo $ac_n "(cached) $ac_c" 1>&4
  8461. else
  8462.   cat > conftest.$ac_ext <<EOF
  8463. #line 8464 "configure"
  8464. #include "confdefs.h"
  8465. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  8466. /* The GNU C library defines this for functions which it implements
  8467.     to always fail with ENOSYS.  Some functions are actually named
  8468.     something starting with __ and the normal name is an alias.  */
  8469. #if defined (__stub_mmap) || defined (__stub___mmap)
  8470. choke me
  8471. #endif
  8472.  
  8473. EOF
  8474. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  8475.   egrep "choke" >/dev/null 2>&1; then
  8476.   rm -rf conftest*
  8477.   eval "ac_cv_func_mmap=no"
  8478. else
  8479.   rm -rf conftest*
  8480.   cat > conftest.$ac_ext <<EOF
  8481. #line 8482 "configure"
  8482. #include "confdefs.h"
  8483. /* Override any gcc2 internal prototype to avoid an error.  */
  8484. char mmap(); 
  8485.  
  8486. int main() { return 0; }
  8487. int t() {
  8488.  
  8489. mmap();
  8490.  
  8491. ; return 0; }
  8492. EOF
  8493. if eval $ac_link; then
  8494.   rm -rf conftest*
  8495.   eval "ac_cv_func_mmap=yes"
  8496. else
  8497.   rm -rf conftest*
  8498.   eval "ac_cv_func_mmap=no"
  8499. fi
  8500. rm -f conftest*
  8501.  
  8502. fi
  8503. rm -f conftest*
  8504.  
  8505. fi
  8506. if eval "test \"`echo '$ac_cv_func_'mmap`\" = yes"; then
  8507.   echo "$ac_t""yes" 1>&4
  8508.   :
  8509. else
  8510.   echo "$ac_t""no" 1>&4
  8511. no_mmap=1
  8512. fi
  8513. if test -z "$no_mmap"; then
  8514. cat >> confdefs.h <<\EOF
  8515. #define HAVE_MMAP 1
  8516. EOF
  8517.  
  8518. echo $ac_n "checking for mmap declaration""... $ac_c" 1>&4
  8519. if eval "test \"`echo '${'cl_cv_proto_mmap'+set}'`\" = set"; then
  8520.   echo $ac_n "(cached) $ac_c" 1>&4
  8521. else
  8522.   # Note: gcc2 does not consider
  8523. #   void* mmap (void*, size_t, int, int, int, off_t);
  8524. #   char* mmap();
  8525. # to be an error, if the first declaration comes from a system include file.
  8526. cat > conftest.$ac_ext <<EOF
  8527. #line 8528 "configure"
  8528. #include "confdefs.h"
  8529.  
  8530. #ifdef STDC_HEADERS
  8531. #include <stdlib.h>
  8532. #endif
  8533. #ifdef HAVE_UNISTD_H
  8534. #include <unistd.h>
  8535. #endif
  8536. #include <sys/types.h>
  8537. #include <sys/mman.h>
  8538.  
  8539. extern void* mmap();
  8540.  
  8541. int main() { return 0; }
  8542. int t() {
  8543.  
  8544. ; return 0; }
  8545. EOF
  8546. if eval $ac_compile; then
  8547.   rm -rf conftest*
  8548.   cl_cv_proto_mmap_ret="void*"
  8549. else
  8550.   rm -rf conftest*
  8551.   cl_cv_proto_mmap_ret="caddr_t"
  8552. fi
  8553. rm -f conftest*
  8554.  
  8555.  
  8556. for y in 'int' 'size_t'; do
  8557. for x in 'void*' 'caddr_t'; do
  8558. if test -z "$have_mmap_decl"; then
  8559. cat > conftest.$ac_ext <<EOF
  8560. #line 8561 "configure"
  8561. #include "confdefs.h"
  8562.  
  8563. #ifdef STDC_HEADERS
  8564. #include <stdlib.h>
  8565. #endif
  8566. #ifdef HAVE_UNISTD_H
  8567. #include <unistd.h>
  8568. #endif
  8569. #include <sys/types.h>
  8570. #include <sys/mman.h>
  8571.  
  8572. extern 
  8573. #ifdef __STDC__
  8574. $cl_cv_proto_mmap_ret mmap ($x addr, $y length, int prot, int flags, int fd, off_t off);
  8575. #else
  8576. $cl_cv_proto_mmap_ret mmap();
  8577. #endif
  8578.  
  8579. int main() { return 0; }
  8580. int t() {
  8581.  
  8582. ; return 0; }
  8583. EOF
  8584. if eval $ac_compile; then
  8585.   rm -rf conftest*
  8586.   cl_cv_proto_mmap_arg1="$x"
  8587. cl_cv_proto_mmap_arg2="$y"
  8588. have_mmap_decl=1
  8589. fi
  8590. rm -f conftest*
  8591.  
  8592.  
  8593. fi
  8594. done
  8595. done
  8596.  
  8597. cl_cv_proto_mmap="extern $cl_cv_proto_mmap_ret mmap ($cl_cv_proto_mmap_arg1, $cl_cv_proto_mmap_arg2, int, int, int, off_t);"
  8598. fi
  8599.  
  8600. cl_cv_proto_mmap=`echo "$cl_cv_proto_mmap" | tr -s ' ' | sed -e 's/( /(/'`
  8601. echo "$ac_t""${ac_tt}$cl_cv_proto_mmap" 1>&4
  8602.  
  8603.  
  8604. cat >> confdefs.h <<EOF
  8605. #define RETMMAPTYPE $cl_cv_proto_mmap_ret
  8606. EOF
  8607.  
  8608. cat >> confdefs.h <<EOF
  8609. #define MMAP_ADDR_T $cl_cv_proto_mmap_arg1
  8610. EOF
  8611.  
  8612. cat >> confdefs.h <<EOF
  8613. #define MMAP_SIZE_T $cl_cv_proto_mmap_arg2
  8614. EOF
  8615.  
  8616. echo $ac_n "checking for working mmap""... $ac_c" 1>&4
  8617. if eval "test \"`echo '${'cl_cv_func_mmap_works'+set}'`\" = set"; then
  8618.   echo $ac_n "(cached) $ac_c" 1>&4
  8619. else
  8620.   
  8621. mmap_prog_1='
  8622. #ifdef STDC_HEADERS
  8623. #include <stdlib.h>
  8624. #endif
  8625. #ifdef HAVE_UNISTD_H
  8626. #include <unistd.h>
  8627. #endif
  8628. #include <fcntl.h>
  8629. #ifdef NEED_SYS_FILE_H
  8630. #include <sys/file.h>
  8631. #endif
  8632. #include <sys/types.h>
  8633. #include <sys/mman.h>
  8634. extern 
  8635. #ifdef __STDC__
  8636. RETMMAPTYPE mmap (MMAP_ADDR_T addr, MMAP_SIZE_T length, int prot, int flags, int fd, off_t off);
  8637. #else
  8638. RETMMAPTYPE mmap();
  8639. #endif
  8640. main () {
  8641. '
  8642. mmap_prog_2='
  8643. #define my_shift 24
  8644. #define my_low   1
  8645. #ifdef FOR_SUN4_29
  8646. #define my_high  31
  8647. #define my_size  32768 /* hope that 32768 is a multiple of the page size */
  8648. /* i*32 KB for i=1..31 gives a total of 15.5 MB, which is close to what we need */
  8649. #else
  8650. #define my_high  64
  8651. #define my_size  8192 /* hope that 8192 is a multiple of the page size */
  8652. /* i*8 KB for i=1..64 gives a total of 16.25 MB, which is close to what we need */
  8653. #endif
  8654.  {long i;
  8655.   for (i=my_low; i<=my_high; i++)
  8656.     { caddr_t addr = (caddr_t)(i << my_shift);
  8657. #if 0 /* Check for 16 MB. */
  8658.       long size = i*my_size;
  8659. #else /* Check for 8 MB. This is more likely to work on Solaris 2. */
  8660.       long size = ((i+1)/2)*my_size;
  8661. #endif
  8662.       if (mmap(addr,size,PROT_READ|PROT_WRITE,flags|MAP_FIXED,fd,0) == (RETMMAPTYPE)-1) exit(1);
  8663.     }
  8664. #define x(i)  *(unsigned char *) ((i<<my_shift) + (i*i))
  8665. #define y(i)  (unsigned char)((3*i-4)*(7*i+3))
  8666.   for (i=my_low; i<=my_high; i++) { x(i) = y(i); }
  8667.   for (i=my_high; i>=my_low; i--) { if (x(i) != y(i)) exit(1); }
  8668.   exit(0);
  8669. }}
  8670. '
  8671. if test "$cross_compiling" = yes; then
  8672.   : # When cross-compiling, don't assume anything.
  8673.  
  8674. else
  8675. cat > conftest.$ac_ext <<EOF
  8676. #line 8677 "configure"
  8677. #include "confdefs.h"
  8678. $mmap_prog_1
  8679.   int flags = MAP_ANON | MAP_PRIVATE;
  8680.   int fd = -1;
  8681. $mmap_prog_2
  8682.  
  8683. EOF
  8684. eval $ac_link
  8685. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  8686.   have_mmap_anon=1
  8687. cl_cv_func_mmap_anon=yes
  8688. else
  8689.   rm -f core
  8690. fi
  8691. if test -f core; then
  8692.   coredir=core`/bin/sh -c 'echo $$'`
  8693.   mkdir $coredir
  8694.   cp confdefs.h $coredir/confdefs.h
  8695.   mv conftest.c $coredir/conftest.c
  8696.   mv conftest $coredir/conftest
  8697.   mv core $coredir/core
  8698.   echo "warning: test program dumped core -- see subdirectory $coredir"
  8699. fi
  8700. fi
  8701. rm -fr conftest*
  8702. if test "$cross_compiling" = yes; then
  8703.   : # When cross-compiling, don't assume anything.
  8704.  
  8705. else
  8706. cat > conftest.$ac_ext <<EOF
  8707. #line 8708 "configure"
  8708. #include "confdefs.h"
  8709. $mmap_prog_1
  8710.   int flags = MAP_ANONYMOUS | MAP_PRIVATE;
  8711.   int fd = -1;
  8712. $mmap_prog_2
  8713.  
  8714. EOF
  8715. eval $ac_link
  8716. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  8717.   have_mmap_anon=1
  8718. cl_cv_func_mmap_anonymous=yes
  8719. else
  8720.   rm -f core
  8721. fi
  8722. if test -f core; then
  8723.   coredir=core`/bin/sh -c 'echo $$'`
  8724.   mkdir $coredir
  8725.   cp confdefs.h $coredir/confdefs.h
  8726.   mv conftest.c $coredir/conftest.c
  8727.   mv conftest $coredir/conftest
  8728.   mv core $coredir/core
  8729.   echo "warning: test program dumped core -- see subdirectory $coredir"
  8730. fi
  8731. fi
  8732. rm -fr conftest*
  8733. if test "$cross_compiling" = yes; then
  8734.   : # When cross-compiling, don't assume anything.
  8735.  
  8736. else
  8737. cat > conftest.$ac_ext <<EOF
  8738. #line 8739 "configure"
  8739. #include "confdefs.h"
  8740. $mmap_prog_1
  8741. #ifndef MAP_FILE
  8742. #define MAP_FILE 0
  8743. #endif
  8744.   int flags = MAP_FILE | MAP_PRIVATE;
  8745.   int fd = open("/dev/zero",O_RDONLY,0666);
  8746.   if (fd<0) exit(1);
  8747. $mmap_prog_2
  8748.  
  8749. EOF
  8750. eval $ac_link
  8751. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  8752.   have_mmap_devzero=1
  8753. cl_cv_func_mmap_devzero=yes
  8754. else
  8755.   rm -f core
  8756. retry_mmap=1
  8757. fi
  8758. if test -f core; then
  8759.   coredir=core`/bin/sh -c 'echo $$'`
  8760.   mkdir $coredir
  8761.   cp confdefs.h $coredir/confdefs.h
  8762.   mv conftest.c $coredir/conftest.c
  8763.   mv conftest $coredir/conftest
  8764.   mv core $coredir/core
  8765.   echo "warning: test program dumped core -- see subdirectory $coredir"
  8766. fi
  8767. fi
  8768. rm -fr conftest*
  8769. if test -n "$retry_mmap"; then
  8770. if test "$cross_compiling" = yes; then
  8771.   : # When cross-compiling, don't assume anything.
  8772.  
  8773. else
  8774. cat > conftest.$ac_ext <<EOF
  8775. #line 8776 "configure"
  8776. #include "confdefs.h"
  8777. #define FOR_SUN4_29
  8778. $mmap_prog_1
  8779. #ifndef MAP_FILE
  8780. #define MAP_FILE 0
  8781. #endif
  8782.   int flags = MAP_FILE | MAP_PRIVATE;
  8783.   int fd = open("/dev/zero",O_RDONLY,0666);
  8784.   if (fd<0) exit(1);
  8785. $mmap_prog_2
  8786.  
  8787. EOF
  8788. eval $ac_link
  8789. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  8790.   have_mmap_devzero=1
  8791. cl_cv_func_mmap_devzero_sun4_29=yes
  8792. else
  8793.   rm -f core
  8794. fi
  8795. if test -f core; then
  8796.   coredir=core`/bin/sh -c 'echo $$'`
  8797.   mkdir $coredir
  8798.   cp confdefs.h $coredir/confdefs.h
  8799.   mv conftest.c $coredir/conftest.c
  8800.   mv conftest $coredir/conftest
  8801.   mv core $coredir/core
  8802.   echo "warning: test program dumped core -- see subdirectory $coredir"
  8803. fi
  8804. fi
  8805. rm -fr conftest*
  8806. fi
  8807. if test -n "$have_mmap_anon" -o -n "$have_mmap_devzero"; then
  8808. cl_cv_func_mmap_works=yes
  8809. else
  8810. cl_cv_func_mmap_works=no
  8811. fi
  8812.  
  8813. fi
  8814.  
  8815. echo "$ac_t""$cl_cv_func_mmap_works" 1>&4
  8816. if test "$cl_cv_func_mmap_anon" = yes; then
  8817. cat >> confdefs.h <<\EOF
  8818. #define HAVE_MMAP_ANON 1
  8819. EOF
  8820.  
  8821. fi
  8822. if test "$cl_cv_func_mmap_anonymous" = yes; then
  8823. cat >> confdefs.h <<\EOF
  8824. #define HAVE_MMAP_ANONYMOUS 1
  8825. EOF
  8826.  
  8827. fi
  8828. if test "$cl_cv_func_mmap_devzero" = yes; then
  8829. cat >> confdefs.h <<\EOF
  8830. #define HAVE_MMAP_DEVZERO 1
  8831. EOF
  8832.  
  8833. fi
  8834. if test "$cl_cv_func_mmap_devzero_sun4_29" = yes; then
  8835. cat >> confdefs.h <<\EOF
  8836. #define HAVE_MMAP_DEVZERO_SUN4_29 1
  8837. EOF
  8838.  
  8839. fi
  8840. fi
  8841. fi
  8842.  
  8843.                       if test -z "$no_mmap"; then
  8844. for ac_func in munmap
  8845. do
  8846. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  8847. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  8848.   echo $ac_n "(cached) $ac_c" 1>&4
  8849. else
  8850.   cat > conftest.$ac_ext <<EOF
  8851. #line 8852 "configure"
  8852. #include "confdefs.h"
  8853. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  8854. /* The GNU C library defines this for functions which it implements
  8855.     to always fail with ENOSYS.  Some functions are actually named
  8856.     something starting with __ and the normal name is an alias.  */
  8857. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  8858. choke me
  8859. #endif
  8860.  
  8861. EOF
  8862. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  8863.   egrep "choke" >/dev/null 2>&1; then
  8864.   rm -rf conftest*
  8865.   eval "ac_cv_func_$ac_func=no"
  8866. else
  8867.   rm -rf conftest*
  8868.   cat > conftest.$ac_ext <<EOF
  8869. #line 8870 "configure"
  8870. #include "confdefs.h"
  8871. /* Override any gcc2 internal prototype to avoid an error.  */
  8872. char $ac_func(); 
  8873.  
  8874. int main() { return 0; }
  8875. int t() {
  8876.  
  8877. $ac_func();
  8878.  
  8879. ; return 0; }
  8880. EOF
  8881. if eval $ac_link; then
  8882.   rm -rf conftest*
  8883.   eval "ac_cv_func_$ac_func=yes"
  8884. else
  8885.   rm -rf conftest*
  8886.   eval "ac_cv_func_$ac_func=no"
  8887. fi
  8888. rm -f conftest*
  8889.  
  8890. fi
  8891. rm -f conftest*
  8892.  
  8893. fi
  8894. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  8895.   echo "$ac_t""yes" 1>&4
  8896.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  8897.   cat >> confdefs.h <<EOF
  8898. #define $ac_tr_func 1
  8899. EOF
  8900.  
  8901. else
  8902.   echo "$ac_t""no" 1>&4
  8903. fi
  8904. done
  8905. fi
  8906.  
  8907.                       for ac_func in mprotect
  8908. do
  8909. echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
  8910. if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
  8911.   echo $ac_n "(cached) $ac_c" 1>&4
  8912. else
  8913.   cat > conftest.$ac_ext <<EOF
  8914. #line 8915 "configure"
  8915. #include "confdefs.h"
  8916. #include <ctype.h> /* Arbitrary system header to define __stub macros. */
  8917. /* The GNU C library defines this for functions which it implements
  8918.     to always fail with ENOSYS.  Some functions are actually named
  8919.     something starting with __ and the normal name is an alias.  */
  8920. #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
  8921. choke me
  8922. #endif
  8923.  
  8924. EOF
  8925. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  8926.   egrep "choke" >/dev/null 2>&1; then
  8927.   rm -rf conftest*
  8928.   eval "ac_cv_func_$ac_func=no"
  8929. else
  8930.   rm -rf conftest*
  8931.   cat > conftest.$ac_ext <<EOF
  8932. #line 8933 "configure"
  8933. #include "confdefs.h"
  8934. /* Override any gcc2 internal prototype to avoid an error.  */
  8935. char $ac_func(); 
  8936.  
  8937. int main() { return 0; }
  8938. int t() {
  8939.  
  8940. $ac_func();
  8941.  
  8942. ; return 0; }
  8943. EOF
  8944. if eval $ac_link; then
  8945.   rm -rf conftest*
  8946.   eval "ac_cv_func_$ac_func=yes"
  8947. else
  8948.   rm -rf conftest*
  8949.   eval "ac_cv_func_$ac_func=no"
  8950. fi
  8951. rm -f conftest*
  8952.  
  8953. fi
  8954. rm -f conftest*
  8955.  
  8956. fi
  8957. if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
  8958.   echo "$ac_t""yes" 1>&4
  8959.     ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
  8960.   cat >> confdefs.h <<EOF
  8961. #define $ac_tr_func 1
  8962. EOF
  8963.  
  8964. else
  8965.   echo "$ac_t""no" 1>&4
  8966. fi
  8967. done
  8968. if test $ac_cv_func_mprotect = yes; then
  8969. echo $ac_n "checking for mprotect declaration""... $ac_c" 1>&4
  8970. if eval "test \"`echo '${'cl_cv_proto_mprotect'+set}'`\" = set"; then
  8971.   echo $ac_n "(cached) $ac_c" 1>&4
  8972. else
  8973.   cat > conftest.$ac_ext <<EOF
  8974. #line 8975 "configure"
  8975. #include "confdefs.h"
  8976.  
  8977. #ifdef STDC_HEADERS
  8978. #include <stdlib.h>
  8979. #endif
  8980. #ifdef HAVE_UNISTD_H
  8981. #include <unistd.h>
  8982. #endif
  8983. #include <sys/types.h>
  8984. #include <sys/mman.h>
  8985.  
  8986. extern 
  8987. #ifdef __STDC__
  8988. int mprotect (MMAP_ADDR_T addr, MMAP_SIZE_T len, int prot);
  8989. #else
  8990. int mprotect();
  8991. #endif
  8992.  
  8993. int main() { return 0; }
  8994. int t() {
  8995.  
  8996. ; return 0; }
  8997. EOF
  8998. if eval $ac_compile; then
  8999.   rm -rf conftest*
  9000.   cl_cv_proto_mprotect_arg1=""
  9001. else
  9002.   rm -rf conftest*
  9003.   cl_cv_proto_mprotect_arg1="const"
  9004. fi
  9005. rm -f conftest*
  9006.  
  9007.  
  9008.  
  9009.  
  9010. cl_cv_proto_mprotect="extern int mprotect ($cl_cv_proto_mprotect_arg1 $cl_cv_proto_mmap_arg1, $cl_cv_proto_mmap_arg2, int);"
  9011. fi
  9012.  
  9013. cl_cv_proto_mprotect=`echo "$cl_cv_proto_mprotect" | tr -s ' ' | sed -e 's/( /(/'`
  9014. echo "$ac_t""${ac_tt}$cl_cv_proto_mprotect" 1>&4
  9015.  
  9016.  
  9017. cat >> confdefs.h <<EOF
  9018. #define MPROTECT_CONST $cl_cv_proto_mprotect_arg1
  9019. EOF
  9020.  
  9021. echo $ac_n "checking for working mprotect""... $ac_c" 1>&4
  9022. if eval "test \"`echo '${'cl_cv_func_mprotect_works'+set}'`\" = set"; then
  9023.   echo $ac_n "(cached) $ac_c" 1>&4
  9024. else
  9025.   
  9026. mprotect_prog='
  9027. #include <sys/types.h>
  9028. /* declare malloc() */
  9029. #ifdef HAVE_STDLIB_H
  9030. #include <stdlib.h>
  9031. #endif
  9032. #ifdef HAVE_UNISTD_H
  9033. #include <unistd.h>
  9034. #endif
  9035. #ifndef malloc
  9036. extern 
  9037. #ifdef __STDC__
  9038. RETMALLOCTYPE malloc (MALLOC_SIZE_T size);
  9039. #else
  9040. RETMALLOCTYPE malloc();
  9041. #endif
  9042. #endif
  9043. /* declare getpagesize() and mprotect() */
  9044. #include <sys/mman.h>
  9045. #ifndef HAVE_GETPAGESIZE
  9046. #include <sys/param.h>
  9047. #define getpagesize() PAGESIZE
  9048. #else
  9049. extern 
  9050. #ifdef __STDC__
  9051. RETGETPAGESIZETYPE getpagesize (void);
  9052. #else
  9053. RETGETPAGESIZETYPE getpagesize();
  9054. #endif
  9055. #endif
  9056. extern 
  9057. #ifdef __STDC__
  9058. int mprotect (MPROTECT_CONST MMAP_ADDR_T addr, MMAP_SIZE_T len, int prot);
  9059. #else
  9060. int mprotect();
  9061. #endif
  9062. char foo;
  9063. main () {
  9064.   unsigned long pagesize = getpagesize();
  9065. #define page_align(address)  (char*)((unsigned long)(address) & -pagesize)
  9066. '
  9067. if test "$cross_compiling" = yes; then
  9068.   # When cross-compiling, don't assume anything.
  9069. no_mprotect=1
  9070. else
  9071. cat > conftest.$ac_ext <<EOF
  9072. #line 9073 "configure"
  9073. #include "confdefs.h"
  9074. $mprotect_prog
  9075.   if ((pagesize-1) & pagesize) exit(1);
  9076.   exit(0); }
  9077. EOF
  9078. eval $ac_link
  9079. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9080.   :
  9081. else
  9082.   no_mprotect=1
  9083. fi
  9084. if test -f core; then
  9085.   coredir=core`/bin/sh -c 'echo $$'`
  9086.   mkdir $coredir
  9087.   cp confdefs.h $coredir/confdefs.h
  9088.   mv conftest.c $coredir/conftest.c
  9089.   mv conftest $coredir/conftest
  9090.   mv core $coredir/core
  9091.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9092. fi
  9093. fi
  9094. rm -fr conftest*
  9095. mprotect_prog="$mprotect_prog"'
  9096.   char* area = malloc(6*pagesize);
  9097.   char* fault_address = area + pagesize*7/2;
  9098. '
  9099. if test -z "$no_mprotect"; then
  9100. if test "$cross_compiling" = yes; then
  9101.   : # When cross-compiling, don't assume anything.
  9102.  
  9103. else
  9104. cat > conftest.$ac_ext <<EOF
  9105. #line 9106 "configure"
  9106. #include "confdefs.h"
  9107. $mprotect_prog
  9108.   if (mprotect(page_align(fault_address),pagesize,PROT_NONE) < 0) exit(0);
  9109.   foo = *fault_address; /* this should cause a core dump */
  9110.   exit(0); }
  9111. EOF
  9112. eval $ac_link
  9113. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9114.   no_mprotect=1
  9115. else
  9116.   rm -f core
  9117. fi
  9118. if test -f core; then
  9119.   coredir=core`/bin/sh -c 'echo $$'`
  9120.   mkdir $coredir
  9121.   cp confdefs.h $coredir/confdefs.h
  9122.   mv conftest.c $coredir/conftest.c
  9123.   mv conftest $coredir/conftest
  9124.   mv core $coredir/core
  9125.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9126. fi
  9127. fi
  9128. rm -fr conftest*
  9129. fi
  9130. if test -z "$no_mprotect"; then
  9131. if test "$cross_compiling" = yes; then
  9132.   : # When cross-compiling, don't assume anything.
  9133.  
  9134. else
  9135. cat > conftest.$ac_ext <<EOF
  9136. #line 9137 "configure"
  9137. #include "confdefs.h"
  9138. $mprotect_prog
  9139.   if (mprotect(page_align(fault_address),pagesize,PROT_NONE) < 0) exit(0);
  9140.   *fault_address = 'z'; /* this should cause a core dump */
  9141.   exit(0); }
  9142. EOF
  9143. eval $ac_link
  9144. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9145.   no_mprotect=1
  9146. else
  9147.   rm -f core
  9148. fi
  9149. if test -f core; then
  9150.   coredir=core`/bin/sh -c 'echo $$'`
  9151.   mkdir $coredir
  9152.   cp confdefs.h $coredir/confdefs.h
  9153.   mv conftest.c $coredir/conftest.c
  9154.   mv conftest $coredir/conftest
  9155.   mv core $coredir/core
  9156.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9157. fi
  9158. fi
  9159. rm -fr conftest*
  9160. fi
  9161. if test -z "$no_mprotect"; then
  9162. if test "$cross_compiling" = yes; then
  9163.   : # When cross-compiling, don't assume anything.
  9164.  
  9165. else
  9166. cat > conftest.$ac_ext <<EOF
  9167. #line 9168 "configure"
  9168. #include "confdefs.h"
  9169. $mprotect_prog
  9170.   if (mprotect(page_align(fault_address),pagesize,PROT_READ) < 0) exit(0);
  9171.   *fault_address = 'z'; /* this should cause a core dump */
  9172.   exit(0); }
  9173. EOF
  9174. eval $ac_link
  9175. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9176.   no_mprotect=1
  9177. else
  9178.   rm -f core
  9179. fi
  9180. if test -f core; then
  9181.   coredir=core`/bin/sh -c 'echo $$'`
  9182.   mkdir $coredir
  9183.   cp confdefs.h $coredir/confdefs.h
  9184.   mv conftest.c $coredir/conftest.c
  9185.   mv conftest $coredir/conftest
  9186.   mv core $coredir/core
  9187.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9188. fi
  9189. fi
  9190. rm -fr conftest*
  9191. fi
  9192. if test -z "$no_mprotect"; then
  9193. if test "$cross_compiling" = yes; then
  9194.   : # When cross-compiling, don't assume anything.
  9195.  
  9196. else
  9197. cat > conftest.$ac_ext <<EOF
  9198. #line 9199 "configure"
  9199. #include "confdefs.h"
  9200. $mprotect_prog
  9201.   if (mprotect(page_align(fault_address),pagesize,PROT_READ) < 0) exit(1);
  9202.   if (mprotect(page_align(fault_address),pagesize,PROT_READ|PROT_WRITE) < 0) exit(1);
  9203.   *fault_address = 'z'; /* this should not cause a core dump */
  9204.   exit(0); }
  9205. EOF
  9206. eval $ac_link
  9207. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9208.   :
  9209. else
  9210.   no_mprotect=1
  9211. rm -f core
  9212. fi
  9213. if test -f core; then
  9214.   coredir=core`/bin/sh -c 'echo $$'`
  9215.   mkdir $coredir
  9216.   cp confdefs.h $coredir/confdefs.h
  9217.   mv conftest.c $coredir/conftest.c
  9218.   mv conftest $coredir/conftest
  9219.   mv core $coredir/core
  9220.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9221. fi
  9222. fi
  9223. rm -fr conftest*
  9224. fi
  9225. if test -z "$no_mprotect"; then
  9226.   cl_cv_func_mprotect_works=yes
  9227. else
  9228.   cl_cv_func_mprotect_works=no
  9229. fi
  9230.  
  9231. fi
  9232.  
  9233. echo "$ac_t""$cl_cv_func_mprotect_works" 1>&4
  9234. if test $cl_cv_func_mprotect_works = yes; then
  9235.   cat >> confdefs.h <<\EOF
  9236. #define HAVE_WORKING_MPROTECT 1
  9237. EOF
  9238.  
  9239. fi
  9240. fi
  9241.  
  9242.                       if test -n "$have_shm"; then
  9243. echo $ac_n "checking for shmget declaration""... $ac_c" 1>&4
  9244. if eval "test \"`echo '${'cl_cv_proto_shmget'+set}'`\" = set"; then
  9245.   echo $ac_n "(cached) $ac_c" 1>&4
  9246. else
  9247.   cat > conftest.$ac_ext <<EOF
  9248. #line 9249 "configure"
  9249. #include "confdefs.h"
  9250.  
  9251. #ifdef STDC_HEADERS
  9252. #include <stdlib.h>
  9253. #endif
  9254. #ifdef HAVE_UNISTD_H
  9255. #include <unistd.h>
  9256. #endif
  9257. #include <sys/types.h>
  9258. #include <sys/ipc.h>
  9259. #include <sys/shm.h>
  9260.  
  9261. extern 
  9262. #ifdef __STDC__
  9263. int shmget (key_t key, int size, int shmflg);
  9264. #else
  9265. int shmget();
  9266. #endif
  9267.  
  9268. int main() { return 0; }
  9269. int t() {
  9270.  
  9271. ; return 0; }
  9272. EOF
  9273. if eval $ac_compile; then
  9274.   rm -rf conftest*
  9275.   cl_cv_proto_shmget_arg2="int"
  9276. else
  9277.   rm -rf conftest*
  9278.   cl_cv_proto_shmget_arg2="size_t"
  9279. fi
  9280. rm -f conftest*
  9281.  
  9282.  
  9283.  
  9284. cl_cv_proto_shmget="extern int shmget (key_t, $cl_cv_proto_shmget_arg2, int);"
  9285. fi
  9286.  
  9287. cl_cv_proto_shmget=`echo "$cl_cv_proto_shmget" | tr -s ' ' | sed -e 's/( /(/'`
  9288. echo "$ac_t""${ac_tt}$cl_cv_proto_shmget" 1>&4
  9289.  
  9290.  
  9291. cat >> confdefs.h <<EOF
  9292. #define SHMGET_SIZE_T $cl_cv_proto_shmget_arg2
  9293. EOF
  9294.  
  9295. fi
  9296.  
  9297.                       if test -n "$have_shm"; then
  9298. echo $ac_n "checking for shmat declaration""... $ac_c" 1>&4
  9299. if eval "test \"`echo '${'cl_cv_proto_shmat'+set}'`\" = set"; then
  9300.   echo $ac_n "(cached) $ac_c" 1>&4
  9301. else
  9302.   cat > conftest.$ac_ext <<EOF
  9303. #line 9304 "configure"
  9304. #include "confdefs.h"
  9305.  
  9306. #ifdef STDC_HEADERS
  9307. #include <stdlib.h>
  9308. #endif
  9309. #ifdef HAVE_UNISTD_H
  9310. #include <unistd.h>
  9311. #endif
  9312. #include <sys/types.h>
  9313. #include <sys/ipc.h>
  9314. #include <sys/shm.h>
  9315.  
  9316. extern void* shmat();
  9317.  
  9318. int main() { return 0; }
  9319. int t() {
  9320.  
  9321. ; return 0; }
  9322. EOF
  9323. if eval $ac_compile; then
  9324.   rm -rf conftest*
  9325.   cl_cv_proto_shmat_ret="void*"
  9326. else
  9327.   rm -rf conftest*
  9328.   cl_cv_proto_shmat_ret="char*"
  9329. fi
  9330. rm -f conftest*
  9331.  
  9332.  
  9333. cat > conftest.$ac_ext <<EOF
  9334. #line 9335 "configure"
  9335. #include "confdefs.h"
  9336.  
  9337. #ifdef STDC_HEADERS
  9338. #include <stdlib.h>
  9339. #endif
  9340. #ifdef HAVE_UNISTD_H
  9341. #include <unistd.h>
  9342. #endif
  9343. #include <sys/types.h>
  9344. #include <sys/ipc.h>
  9345. #include <sys/shm.h>
  9346.  
  9347. extern 
  9348. #ifdef __STDC__
  9349. $cl_cv_proto_shmat_ret shmat (int shmid, $cl_cv_proto_shmat_ret shmaddr, int shmflg);
  9350. #else
  9351. $cl_cv_proto_shmat_ret shmat();
  9352. #endif
  9353.  
  9354. int main() { return 0; }
  9355. int t() {
  9356.  
  9357. ; return 0; }
  9358. EOF
  9359. if eval $ac_compile; then
  9360.   rm -rf conftest*
  9361.   cl_cv_proto_shmat_arg2=""
  9362. else
  9363.   rm -rf conftest*
  9364.   cl_cv_proto_shmat_arg2="const"
  9365. fi
  9366. rm -f conftest*
  9367.  
  9368.  
  9369.  
  9370.  
  9371. cl_cv_proto_shmat="extern $retshmattype shmat (int, $cl_cv_proto_shmat_arg2 $cl_cv_proto_shmat_ret, int);"
  9372. fi
  9373.  
  9374. cl_cv_proto_shmat=`echo "$cl_cv_proto_shmat" | tr -s ' ' | sed -e 's/( /(/'`
  9375. echo "$ac_t""${ac_tt}$cl_cv_proto_shmat" 1>&4
  9376.  
  9377.  
  9378. cat >> confdefs.h <<EOF
  9379. #define RETSHMATTYPE $cl_cv_proto_shmat_ret
  9380. EOF
  9381.  
  9382. cat >> confdefs.h <<EOF
  9383. #define SHMAT_CONST $cl_cv_proto_shmat_arg2
  9384. EOF
  9385.  
  9386. fi
  9387.  
  9388.                       if test -n "$have_shm"; then
  9389. echo $ac_n "checking for shmctl declaration""... $ac_c" 1>&4
  9390. if eval "test \"`echo '${'cl_cv_proto_shmctl'+set}'`\" = set"; then
  9391.   echo $ac_n "(cached) $ac_c" 1>&4
  9392. else
  9393.   cat > conftest.$ac_ext <<EOF
  9394. #line 9395 "configure"
  9395. #include "confdefs.h"
  9396.  
  9397. #ifdef STDC_HEADERS
  9398. #include <stdlib.h>
  9399. #endif
  9400. #ifdef HAVE_UNISTD_H
  9401. #include <unistd.h>
  9402. #endif
  9403. #include <sys/types.h>
  9404. #include <sys/ipc.h>
  9405. #include <sys/shm.h>
  9406.  
  9407. extern 
  9408. #ifdef __STDC__
  9409. int shmctl (int shmid, int cmd, struct shmid_ds * buf);
  9410. #else
  9411. int shmctl();
  9412. #endif
  9413.  
  9414. int main() { return 0; }
  9415. int t() {
  9416.  
  9417. ; return 0; }
  9418. EOF
  9419. if eval $ac_compile; then
  9420.   rm -rf conftest*
  9421.    cl_cv_proto_shmctl_dots=no
  9422. cl_cv_proto_shmctl_args="int, int, struct shmid_ds *"
  9423. else
  9424.   rm -rf conftest*
  9425.    cl_cv_proto_shmctl_dots=yes
  9426. cl_cv_proto_shmctl_args="int, int, ..."
  9427. fi
  9428. rm -f conftest*
  9429.  
  9430.  
  9431.  
  9432. cl_cv_proto_shmctl="extern int shmctl ($cl_cv_proto_shmctl_args);"
  9433. fi
  9434.  
  9435. cl_cv_proto_shmctl=`echo "$cl_cv_proto_shmctl" | tr -s ' ' | sed -e 's/( /(/'`
  9436. echo "$ac_t""${ac_tt}$cl_cv_proto_shmctl" 1>&4
  9437.  
  9438.  
  9439. if test $cl_cv_proto_shmctl_dots = yes; then
  9440.   cat >> confdefs.h <<\EOF
  9441. #define SHMCTL_DOTS 1
  9442. EOF
  9443.  
  9444. fi
  9445. fi
  9446.  
  9447.                       if test -n "$have_shm"; then
  9448. echo $ac_n "checking for attachability of removed shared memory""... $ac_c" 1>&4
  9449. if eval "test \"`echo '${'cl_cv_func_shmctl_attachable'+set}'`\" = set"; then
  9450.   echo $ac_n "(cached) $ac_c" 1>&4
  9451. else
  9452.   
  9453. if test "$cross_compiling" = yes; then
  9454.   cl_cv_func_shmctl_attachable="guessing no"
  9455. else
  9456. cat > conftest.$ac_ext <<EOF
  9457. #line 9458 "configure"
  9458. #include "confdefs.h"
  9459.  
  9460. #ifdef STDC_HEADERS
  9461. #include <stdlib.h>
  9462. #endif
  9463. #ifdef HAVE_UNISTD_H
  9464. #include <unistd.h>
  9465. #endif
  9466. #include <sys/types.h>
  9467. #include <sys/ipc.h>
  9468. #include <sys/shm.h>
  9469. #ifdef HAVE_SYS_SYSMACROS_H
  9470. #include <sys/sysmacros.h>
  9471. #endif
  9472. #ifdef __STDC__
  9473. extern int shmget (key_t key, SHMGET_SIZE_T size, int shmflg);
  9474. extern RETSHMATTYPE shmat (int shmid, SHMAT_CONST RETSHMATTYPE shmaddr, int shmflg);
  9475. extern 
  9476. #ifdef SHMCTL_DOTS
  9477. int shmctl (int shmid, int cmd, ...);
  9478. #else
  9479. int shmctl (int shmid, int cmd, struct shmid_ds * buf);
  9480. #endif
  9481. #else
  9482. extern int shmget();
  9483. extern RETSHMATTYPE shmat();
  9484. extern int shmctl();
  9485. #endif
  9486. main ()
  9487. { unsigned int pagesize = 8192; /* should be a multiple of SHMLBA */
  9488.   unsigned long addr = (unsigned long) malloc(2*pagesize);
  9489.   addr += pagesize-1; addr = (addr/pagesize)*pagesize;
  9490.  {unsigned long addr1 = addr + 0x10000;
  9491.   unsigned long addr2 = addr + 0x20000;
  9492.   int id = shmget(IPC_PRIVATE,pagesize,IPC_CREAT|0600);
  9493.   if (id<0)
  9494.     { exit(1); }
  9495.   if (shmat(id,(RETSHMATTYPE)addr1,0) == (RETSHMATTYPE)(-1))
  9496.     { shmctl(id,IPC_RMID,NULL); exit(1); }
  9497.   if (shmctl(id,IPC_RMID,NULL) < 0)
  9498.     { exit(1); }
  9499.   if (shmat(id,(RETSHMATTYPE)addr2,0) == (RETSHMATTYPE)(-1))
  9500.     { shmctl(id,IPC_RMID,NULL); exit(1); }
  9501.   shmctl(id,IPC_RMID,NULL);
  9502.   exit(0);
  9503. }}
  9504.  
  9505. EOF
  9506. eval $ac_link
  9507. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9508.   cl_cv_func_shmctl_attachable=yes
  9509. else
  9510.   cl_cv_func_shmctl_attachable=no
  9511. fi
  9512. if test -f core; then
  9513.   coredir=core`/bin/sh -c 'echo $$'`
  9514.   mkdir $coredir
  9515.   cp confdefs.h $coredir/confdefs.h
  9516.   mv conftest.c $coredir/conftest.c
  9517.   mv conftest $coredir/conftest
  9518.   mv core $coredir/core
  9519.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9520. fi
  9521. fi
  9522. rm -fr conftest*
  9523.  
  9524. fi
  9525.  
  9526. echo "$ac_t""$cl_cv_func_shmctl_attachable" 1>&4
  9527. case "$cl_cv_func_shmctl_attachable" in
  9528.   *yes) cat >> confdefs.h <<\EOF
  9529. #define SHM_RMID_VALID 1
  9530. EOF
  9531.  ;;
  9532.   *no)  ;;
  9533. esac
  9534. fi
  9535.  
  9536.                       echo $ac_n "checking whether characters are unsigned""... $ac_c" 1>&4
  9537. if eval "test \"`echo '${'ac_cv_c_char_unsigned'+set}'`\" = set"; then
  9538.   echo $ac_n "(cached) $ac_c" 1>&4
  9539. else
  9540.   
  9541. if test $ac_cv_prog_gcc = yes; then
  9542.   # GCC predefines this symbol on systems where it applies.
  9543. cat > conftest.$ac_ext <<EOF
  9544. #line 9545 "configure"
  9545. #include "confdefs.h"
  9546. #ifdef __CHAR_UNSIGNED__
  9547.   yes
  9548. #endif
  9549.  
  9550. EOF
  9551. if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
  9552.   egrep "yes" >/dev/null 2>&1; then
  9553.   rm -rf conftest*
  9554.   ac_cv_c_char_unsigned=yes
  9555. else
  9556.   rm -rf conftest*
  9557.   ac_cv_c_char_unsigned=no
  9558. fi
  9559. rm -f conftest*
  9560.  
  9561. else
  9562. if test "$cross_compiling" = yes; then
  9563.   ac_cv_c_char_unsigned="guessing no"
  9564. else
  9565. cat > conftest.$ac_ext <<EOF
  9566. #line 9567 "configure"
  9567. #include "confdefs.h"
  9568. /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
  9569. #if !defined(__STDC__) || __STDC__ != 1
  9570. #define volatile
  9571. #endif
  9572. main() {
  9573.   volatile char c = 255; exit(c < 0);
  9574. }
  9575. EOF
  9576. eval $ac_link
  9577. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  9578.   ac_cv_c_char_unsigned=yes
  9579. else
  9580.   ac_cv_c_char_unsigned=no
  9581. fi
  9582. if test -f core; then
  9583.   coredir=core`/bin/sh -c 'echo $$'`
  9584.   mkdir $coredir
  9585.   cp confdefs.h $coredir/confdefs.h
  9586.   mv conftest.c $coredir/conftest.c
  9587.   mv conftest $coredir/conftest
  9588.   mv core $coredir/core
  9589.   echo "warning: test program dumped core -- see subdirectory $coredir"
  9590. fi
  9591. fi
  9592. rm -fr conftest*
  9593. fi
  9594. fi
  9595. echo "$ac_t""$ac_cv_c_char_unsigned" 1>&4
  9596. if test $ac_cv_prog_gcc = no; then
  9597.   # GCC defines __CHAR_UNSIGNED__ by itself, no need to fix up.
  9598.   case "$ac_cv_c_char_unsigned" in
  9599.     *yes) cat >> confdefs.h <<\EOF
  9600. #define __CHAR_UNSIGNED__ 1
  9601. EOF
  9602.  ;;
  9603.     *no) ;;
  9604.   esac
  9605. fi
  9606.  
  9607.                       if test $cross_compiling = no; then
  9608. if test -z "$cl_cv_file_machine_h"; then
  9609. echo checking for integer types and behaviour
  9610. cat > conftest.c <<EOF
  9611. #include "confdefs.h"
  9612. EOF
  9613. cat ${srcdir}/machine.c >> conftest.c
  9614. ORIGCC="$CC"
  9615. if test $ac_cv_prog_gcc = yes; then
  9616. # gcc -O (gcc version <= 2.3.2) crashes when compiling long long shifts for
  9617. # target 80386. Strip "-O".
  9618. CC=`echo "$CC " | sed -e 's/-O //g'`
  9619. fi
  9620. eval $ac_link
  9621. CC="$ORIGCC"
  9622. if test -s conftest; then
  9623.   echo creating machine.h
  9624.   ./conftest > conftest.h
  9625.   if cmp -s machine.h conftest.h 2>/dev/null; then
  9626.     # The file exists and we would not be changing it
  9627.     rm -f conftest.h
  9628.   else
  9629.     rm -f machine.h
  9630.     mv conftest.h machine.h
  9631.   fi
  9632.   cl_cv_file_machine_h=1
  9633. else
  9634.   echo creation of machine.h failed
  9635. fi
  9636. rm -f conftest*
  9637. fi
  9638. else
  9639. echo cross-compiling - cannot create machine.h
  9640. fi
  9641.  
  9642.                       trap '' 1 2 15
  9643. if test -w $cache_file; then
  9644. echo "updating cache $cache_file"
  9645. cat > $cache_file <<\EOF
  9646. # This file is a shell script that caches the results of configure
  9647. # tests run on this system so they can be shared between configure
  9648. # scripts and configure runs.  It is not useful on other systems.
  9649. # If it contains results you don't want to keep, you may remove or edit it.
  9650. #
  9651. # By default, configure uses ./config.cache as the cache file,
  9652. # creating it if it does not exist already.  You can give configure
  9653. # the --cache-file=FILE option to use a different cache file; that is
  9654. # what configure does when it calls configure scripts in
  9655. # subdirectories, so they share the cache.
  9656. # Giving --cache-file=/dev/null disables caching, for debugging configure.
  9657. # config.status only pays attention to the cache file if you give it the
  9658. # --recheck option to rerun configure.
  9659. #
  9660. EOF
  9661. # Ultrix sh set writes to stderr and can't be redirected directly.
  9662. (set) 2>&1 |
  9663.   sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
  9664.   >> $cache_file
  9665. else
  9666. echo "not updating unwritable cache $cache_file"
  9667. fi
  9668.  
  9669. trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
  9670.  
  9671. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  9672. # Let make expand exec_prefix.
  9673. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
  9674.  
  9675. # Any assignment to VPATH causes Sun make to only execute
  9676. # the first set of double-colon rules, so remove it if not needed.
  9677. # If there is a colon in the path, we need to keep it.
  9678. if test "x$srcdir" = x.; then
  9679.   ac_vpsub='/^[     ]*VPATH[     ]*=[^:]*$/d'
  9680. fi
  9681.  
  9682. trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
  9683.  
  9684. DEFS=-DHAVE_CONFIG_H
  9685.  
  9686. # Without the "./", some shells look in PATH for config.status.
  9687. : ${CONFIG_STATUS=./config.status}
  9688.  
  9689. echo creating $CONFIG_STATUS
  9690. rm -f $CONFIG_STATUS
  9691. cat > $CONFIG_STATUS <<EOF
  9692. #!/bin/sh
  9693. # Generated automatically by configure.
  9694. # Run this file to recreate the current configuration.
  9695. # This directory was configured as follows,
  9696. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  9697. #
  9698. # $0 $ac_configure_args
  9699. #
  9700. # Compiler output produced by configure, useful for debugging
  9701. # configure, is in ./config.log if it exists.
  9702.  
  9703. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
  9704. for ac_option
  9705. do
  9706.   case "\$ac_option" in
  9707.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  9708.     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
  9709.     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
  9710.   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
  9711.     echo "$CONFIG_STATUS generated by autoconf version 2.1"
  9712.     exit 0 ;;
  9713.   -help | --help | --hel | --he | --h)
  9714.     echo "\$ac_cs_usage"; exit 0 ;;
  9715.   *) echo "\$ac_cs_usage"; exit 1 ;;
  9716.   esac
  9717. done
  9718.  
  9719. ac_given_srcdir=$srcdir
  9720.  
  9721. trap 'rm -fr makemake unixconf.h conftest*; exit 1' 1 2 15
  9722.  
  9723. # Protect against being on the right side of a sed subst in config.status. 
  9724. sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; 
  9725.  s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
  9726. $ac_vpsub
  9727. $extrasub
  9728. s%@CFLAGS@%$CFLAGS%g
  9729. s%@CPPFLAGS@%$CPPFLAGS%g
  9730. s%@CXXFLAGS@%$CXXFLAGS%g
  9731. s%@DEFS@%$DEFS%g
  9732. s%@LDFLAGS@%$LDFLAGS%g
  9733. s%@LIBS@%$LIBS%g
  9734. s%@exec_prefix@%$exec_prefix%g
  9735. s%@prefix@%$prefix%g
  9736. s%@program_transform_name@%$program_transform_name%g
  9737. s%@CC@%$CC%g
  9738. s%@CPP@%$CPP%g
  9739. s%@CC_GCC@%$CC_GCC%g
  9740. s%@CC_ANSI@%$CC_ANSI%g
  9741. s%@CC_NEED_CCPAUX@%$CC_NEED_CCPAUX%g
  9742. s%@CC_NEED_DEELIF@%$CC_NEED_DEELIF%g
  9743. s%@CC_NEED_DEERROR@%$CC_NEED_DEERROR%g
  9744. s%@CC_NEED_DEEMA@%$CC_NEED_DEEMA%g
  9745. s%@CC_NEED_MERGESTRINGS@%$CC_NEED_MERGESTRINGS%g
  9746. s%@AS_UNDERSCORE@%$AS_UNDERSCORE%g
  9747. s%@RANLIB@%$RANLIB%g
  9748. s%@INSTALL@%$INSTALL%g
  9749. s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
  9750. s%@INSTALL_DATA@%$INSTALL_DATA%g
  9751. s%@CP@%$CP%g
  9752. s%@LN_S@%$LN_S%g
  9753. s%@GOOD_SH@%$GOOD_SH%g
  9754. s%@HAVE_XMKMF@%$HAVE_XMKMF%g
  9755. s%@X_INCLUDES@%$X_INCLUDES%g
  9756. s%@X_LIBS@%$X_LIBS%g
  9757. s%@GMALLOC@%$GMALLOC%g
  9758. s%@ALLOCA@%$ALLOCA%g
  9759.  
  9760. CEOF
  9761. EOF
  9762. cat >> $CONFIG_STATUS <<EOF
  9763.  
  9764. CONFIG_FILES=\${CONFIG_FILES-"makemake"}
  9765. EOF
  9766. cat >> $CONFIG_STATUS <<\EOF
  9767. for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
  9768.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  9769.   case "$ac_file" in
  9770.   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
  9771.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  9772.   *) ac_file_in="${ac_file}.in" ;;
  9773.   esac
  9774.  
  9775.   # Adjust relative srcdir, etc. for subdirectories.
  9776.  
  9777.   # Remove last slash and all that follows it.  Not all systems have dirname.
  9778.   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
  9779.   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
  9780.     # The file is in a subdirectory.
  9781.     test ! -d "$ac_dir" && mkdir "$ac_dir"
  9782.     ac_dir_suffix="/$ac_dir"
  9783.     # A "../" for each directory in $ac_dir_suffix.
  9784.     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
  9785.   else
  9786.     ac_dir_suffix= ac_dots=
  9787.   fi
  9788.  
  9789.   case "$ac_given_srcdir" in
  9790.   .)  srcdir=.
  9791.       if test -z "$ac_dots"; then top_srcdir=.
  9792.       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
  9793.   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
  9794.   *) # Relative path.
  9795.     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
  9796.     top_srcdir="$ac_dots$ac_given_srcdir" ;;
  9797.   esac
  9798.  
  9799.   echo creating "$ac_file"
  9800.   rm -f "$ac_file"
  9801.   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
  9802.   case "$ac_file" in
  9803.   *Makefile*) ac_comsub="1i\\
  9804. # $configure_input" ;;
  9805.   *) ac_comsub= ;;
  9806.   esac
  9807.   sed -e "$ac_comsub
  9808. s%@configure_input@%$configure_input%g
  9809. s%@srcdir@%$srcdir%g
  9810. s%@top_srcdir@%$top_srcdir%g
  9811. " -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
  9812. fi; done
  9813. rm -f conftest.subs
  9814.  
  9815. # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
  9816. # NAME is the cpp macro being defined and VALUE is the value it is being given.
  9817. #
  9818. # ac_d sets the value in "#define NAME VALUE" lines.
  9819. ac_dA='s%^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  9820. ac_dB='\([     ][     ]*\)[^     ]*%\1#\2'
  9821. ac_dC='\3'
  9822. ac_dD='%g'
  9823. # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  9824. ac_uA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  9825. ac_uB='\([     ]\)%\1#\2define\3'
  9826. ac_uC=' '
  9827. ac_uD='\4%g'
  9828. # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  9829. ac_eA='s%^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  9830. ac_eB='$%\1#\2define\3'
  9831. ac_eC=' '
  9832. ac_eD='%g'
  9833. # ac_f turns "#define NAME" without trailing blanks into "#define NAME VALUE".
  9834. ac_fA='s%^\([     ]*\)#\([     ]*\)define\([     ][     ]*\)'
  9835. ac_fB='$%\1#\2define\3'
  9836. ac_fC=' '
  9837. ac_fD='%g'
  9838.  
  9839. CONFIG_HEADERS=${CONFIG_HEADERS-"unixconf.h"}
  9840. for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
  9841.   # Support "outfile[:infile]", defaulting infile="outfile.in".
  9842.   case "$ac_file" in
  9843.   *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
  9844.        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
  9845.   *) ac_file_in="${ac_file}.in" ;;
  9846.   esac
  9847.  
  9848.   echo creating $ac_file
  9849.  
  9850.   rm -f conftest.frag conftest.in conftest.out
  9851.   cp $ac_given_srcdir/$ac_file_in conftest.in
  9852.  
  9853. EOF
  9854.  
  9855. # Transform confdefs.h into a sed script conftest.vals that substitutes
  9856. # the proper values into config.h.in to produce config.h.  And first:
  9857. # Protect against being on the right side of a sed subst in config.status. 
  9858. # Protect against being in an unquoted here document in config.status.
  9859. rm -f conftest.vals
  9860. cat > conftest.hdr <<\EOF
  9861. s/[\\&%]/\\&/g
  9862. s%[\\$`]%\\&%g
  9863. s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
  9864. s%ac_d%ac_u%gp
  9865. s%ac_u%ac_e%gp
  9866. s%ac_e%ac_f%gp
  9867. EOF
  9868. sed -n -f conftest.hdr confdefs.h > conftest.vals
  9869. rm -f conftest.hdr
  9870.  
  9871.  
  9872. # Break up conftest.vals because some shells have a limit on
  9873. # the size of here documents, and old seds have small limits too.
  9874. # Maximum number of lines to put in a single here document.
  9875. ac_max_here_lines=12
  9876.  
  9877. rm -f conftest.tail
  9878. while :
  9879. do
  9880.   ac_lines=`grep -c . conftest.vals`
  9881.   # grep -c gives empty output for an empty file on some AIX systems.
  9882.   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
  9883.   # Write a limited-size here document to conftest.frag.
  9884.   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
  9885.   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
  9886.   echo 'CEOF
  9887.   sed -f conftest.frag conftest.in > conftest.out
  9888.   rm -f conftest.in
  9889.   mv conftest.out conftest.in
  9890. ' >> $CONFIG_STATUS
  9891.   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
  9892.   rm -f conftest.vals
  9893.   mv conftest.tail conftest.vals
  9894. done
  9895. rm -f conftest.vals
  9896.  
  9897. cat >> $CONFIG_STATUS <<\EOF
  9898.   rm -f conftest.frag conftest.h
  9899.   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
  9900.   cat conftest.in >> conftest.h
  9901.   rm -f conftest.in
  9902.   if cmp -s $ac_file conftest.h 2>/dev/null; then
  9903.     echo "$ac_file is unchanged"
  9904.     rm -f conftest.h
  9905.   else
  9906.     rm -f $ac_file
  9907.     mv conftest.h $ac_file
  9908.   fi
  9909. fi; done
  9910.  
  9911.  
  9912. echo '#!/bin/sh' > makemake.tmp
  9913. echo '# Generated automatically from makemake.in by configure.' >> makemake.tmp
  9914. cat makemake >> makemake.tmp
  9915. mv makemake.tmp makemake
  9916. chmod a+x makemake
  9917.  
  9918. exit 0
  9919. EOF
  9920. chmod +x $CONFIG_STATUS
  9921. rm -fr confdefs* $ac_clean_files
  9922. test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
  9923.  
  9924.  
  9925.