1#! /bin/sh
2# From configure.ac Id: configure.ac.
3# Guess values for system-dependent variables and create Makefiles.
4# Generated by GNU Autoconf 2.69.
5#
6#
7# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
8#
9#
10# This configure script is free software; the Free Software Foundation
11# gives unlimited permission to copy, distribute and modify it.
12## -------------------- ##
13## M4sh Initialization. ##
14## -------------------- ##
15
16# Be more Bourne compatible
17DUALCASE=1; export DUALCASE # for MKS sh
18if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
19  emulate sh
20  NULLCMD=:
21  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
22  # is contrary to our usage.  Disable this feature.
23  alias -g '${1+"$@"}'='"$@"'
24  setopt NO_GLOB_SUBST
25else
26  case `(set -o) 2>/dev/null` in #(
27  *posix*) :
28    set -o posix ;; #(
29  *) :
30     ;;
31esac
32fi
33
34
35as_nl='
36'
37export as_nl
38# Printing a long string crashes Solaris 7 /usr/bin/printf.
39as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
40as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
41as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
42# Prefer a ksh shell builtin over an external printf program on Solaris,
43# but without wasting forks for bash or zsh.
44if test -z "$BASH_VERSION$ZSH_VERSION" \
45    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
46  as_echo='print -r --'
47  as_echo_n='print -rn --'
48elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
49  as_echo='printf %s\n'
50  as_echo_n='printf %s'
51else
52  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
53    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
54    as_echo_n='/usr/ucb/echo -n'
55  else
56    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
57    as_echo_n_body='eval
58      arg=$1;
59      case $arg in #(
60      *"$as_nl"*)
61	expr "X$arg" : "X\\(.*\\)$as_nl";
62	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
63      esac;
64      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
65    '
66    export as_echo_n_body
67    as_echo_n='sh -c $as_echo_n_body as_echo'
68  fi
69  export as_echo_body
70  as_echo='sh -c $as_echo_body as_echo'
71fi
72
73# The user is always right.
74if test "${PATH_SEPARATOR+set}" != set; then
75  PATH_SEPARATOR=:
76  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
77    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
78      PATH_SEPARATOR=';'
79  }
80fi
81
82
83# IFS
84# We need space, tab and new line, in precisely that order.  Quoting is
85# there to prevent editors from complaining about space-tab.
86# (If _AS_PATH_WALK were called with IFS unset, it would disable word
87# splitting by setting IFS to empty value.)
88IFS=" ""	$as_nl"
89
90# Find who we are.  Look in the path if we contain no directory separator.
91as_myself=
92case $0 in #((
93  *[\\/]* ) as_myself=$0 ;;
94  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
95for as_dir in $PATH
96do
97  IFS=$as_save_IFS
98  test -z "$as_dir" && as_dir=.
99    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
100  done
101IFS=$as_save_IFS
102
103     ;;
104esac
105# We did not find ourselves, most probably we were run as `sh COMMAND'
106# in which case we are not to be found in the path.
107if test "x$as_myself" = x; then
108  as_myself=$0
109fi
110if test ! -f "$as_myself"; then
111  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
112  exit 1
113fi
114
115# Unset variables that we do not need and which cause bugs (e.g. in
116# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
117# suppresses any "Segmentation fault" message there.  '((' could
118# trigger a bug in pdksh 5.2.14.
119for as_var in BASH_ENV ENV MAIL MAILPATH
120do eval test x\${$as_var+set} = xset \
121  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
122done
123PS1='$ '
124PS2='> '
125PS4='+ '
126
127# NLS nuisances.
128LC_ALL=C
129export LC_ALL
130LANGUAGE=C
131export LANGUAGE
132
133# CDPATH.
134(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
135
136# Use a proper internal environment variable to ensure we don't fall
137  # into an infinite loop, continuously re-executing ourselves.
138  if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
139    _as_can_reexec=no; export _as_can_reexec;
140    # We cannot yet assume a decent shell, so we have to provide a
141# neutralization value for shells without unset; and this also
142# works around shells that cannot unset nonexistent variables.
143# Preserve -v and -x to the replacement shell.
144BASH_ENV=/dev/null
145ENV=/dev/null
146(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
147case $- in # ((((
148  *v*x* | *x*v* ) as_opts=-vx ;;
149  *v* ) as_opts=-v ;;
150  *x* ) as_opts=-x ;;
151  * ) as_opts= ;;
152esac
153exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
154# Admittedly, this is quite paranoid, since all the known shells bail
155# out after a failed `exec'.
156$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
157as_fn_exit 255
158  fi
159  # We don't want this to propagate to other subprocesses.
160          { _as_can_reexec=; unset _as_can_reexec;}
161if test "x$CONFIG_SHELL" = x; then
162  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
163  emulate sh
164  NULLCMD=:
165  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
166  # is contrary to our usage.  Disable this feature.
167  alias -g '\${1+\"\$@\"}'='\"\$@\"'
168  setopt NO_GLOB_SUBST
169else
170  case \`(set -o) 2>/dev/null\` in #(
171  *posix*) :
172    set -o posix ;; #(
173  *) :
174     ;;
175esac
176fi
177"
178  as_required="as_fn_return () { (exit \$1); }
179as_fn_success () { as_fn_return 0; }
180as_fn_failure () { as_fn_return 1; }
181as_fn_ret_success () { return 0; }
182as_fn_ret_failure () { return 1; }
183
184exitcode=0
185as_fn_success || { exitcode=1; echo as_fn_success failed.; }
186as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
187as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
188as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
189if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
190
191else
192  exitcode=1; echo positional parameters were not saved.
193fi
194test x\$exitcode = x0 || exit 1
195test -x / || exit 1"
196  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
197  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
198  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
199  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
200
201  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
202    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
203    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
204    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
205    PATH=/empty FPATH=/empty; export PATH FPATH
206    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
207      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
208test \$(( 1 + 1 )) = 2 || exit 1"
209  if (eval "$as_required") 2>/dev/null; then :
210  as_have_required=yes
211else
212  as_have_required=no
213fi
214  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
215
216else
217  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
218as_found=false
219for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
220do
221  IFS=$as_save_IFS
222  test -z "$as_dir" && as_dir=.
223  as_found=:
224  case $as_dir in #(
225	 /*)
226	   for as_base in sh bash ksh sh5; do
227	     # Try only shells that exist, to save several forks.
228	     as_shell=$as_dir/$as_base
229	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
230		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
231  CONFIG_SHELL=$as_shell as_have_required=yes
232		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
233  break 2
234fi
235fi
236	   done;;
237       esac
238  as_found=false
239done
240$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
241	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
242  CONFIG_SHELL=$SHELL as_have_required=yes
243fi; }
244IFS=$as_save_IFS
245
246
247      if test "x$CONFIG_SHELL" != x; then :
248  export CONFIG_SHELL
249             # We cannot yet assume a decent shell, so we have to provide a
250# neutralization value for shells without unset; and this also
251# works around shells that cannot unset nonexistent variables.
252# Preserve -v and -x to the replacement shell.
253BASH_ENV=/dev/null
254ENV=/dev/null
255(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
256case $- in # ((((
257  *v*x* | *x*v* ) as_opts=-vx ;;
258  *v* ) as_opts=-v ;;
259  *x* ) as_opts=-x ;;
260  * ) as_opts= ;;
261esac
262exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
263# Admittedly, this is quite paranoid, since all the known shells bail
264# out after a failed `exec'.
265$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
266exit 255
267fi
268
269    if test x$as_have_required = xno; then :
270  $as_echo "$0: This script requires a shell more modern than all"
271  $as_echo "$0: the shells that I found on your system."
272  if test x${ZSH_VERSION+set} = xset ; then
273    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
274    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
275  else
276    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
277$0: including any error possibly output before this
278$0: message. Then install a modern shell, or manually run
279$0: the script under such a shell if you do have one."
280  fi
281  exit 1
282fi
283fi
284fi
285SHELL=${CONFIG_SHELL-/bin/sh}
286export SHELL
287# Unset more variables known to interfere with behavior of common tools.
288CLICOLOR_FORCE= GREP_OPTIONS=
289unset CLICOLOR_FORCE GREP_OPTIONS
290
291## --------------------- ##
292## M4sh Shell Functions. ##
293## --------------------- ##
294# as_fn_unset VAR
295# ---------------
296# Portably unset VAR.
297as_fn_unset ()
298{
299  { eval $1=; unset $1;}
300}
301as_unset=as_fn_unset
302
303# as_fn_set_status STATUS
304# -----------------------
305# Set $? to STATUS, without forking.
306as_fn_set_status ()
307{
308  return $1
309} # as_fn_set_status
310
311# as_fn_exit STATUS
312# -----------------
313# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
314as_fn_exit ()
315{
316  set +e
317  as_fn_set_status $1
318  exit $1
319} # as_fn_exit
320
321# as_fn_mkdir_p
322# -------------
323# Create "$as_dir" as a directory, including parents if necessary.
324as_fn_mkdir_p ()
325{
326
327  case $as_dir in #(
328  -*) as_dir=./$as_dir;;
329  esac
330  test -d "$as_dir" || eval $as_mkdir_p || {
331    as_dirs=
332    while :; do
333      case $as_dir in #(
334      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
335      *) as_qdir=$as_dir;;
336      esac
337      as_dirs="'$as_qdir' $as_dirs"
338      as_dir=`$as_dirname -- "$as_dir" ||
339$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
340	 X"$as_dir" : 'X\(//\)[^/]' \| \
341	 X"$as_dir" : 'X\(//\)$' \| \
342	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
343$as_echo X"$as_dir" |
344    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
345	    s//\1/
346	    q
347	  }
348	  /^X\(\/\/\)[^/].*/{
349	    s//\1/
350	    q
351	  }
352	  /^X\(\/\/\)$/{
353	    s//\1/
354	    q
355	  }
356	  /^X\(\/\).*/{
357	    s//\1/
358	    q
359	  }
360	  s/.*/./; q'`
361      test -d "$as_dir" && break
362    done
363    test -z "$as_dirs" || eval "mkdir $as_dirs"
364  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
365
366
367} # as_fn_mkdir_p
368
369# as_fn_executable_p FILE
370# -----------------------
371# Test if FILE is an executable regular file.
372as_fn_executable_p ()
373{
374  test -f "$1" && test -x "$1"
375} # as_fn_executable_p
376# as_fn_append VAR VALUE
377# ----------------------
378# Append the text in VALUE to the end of the definition contained in VAR. Take
379# advantage of any shell optimizations that allow amortized linear growth over
380# repeated appends, instead of the typical quadratic growth present in naive
381# implementations.
382if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
383  eval 'as_fn_append ()
384  {
385    eval $1+=\$2
386  }'
387else
388  as_fn_append ()
389  {
390    eval $1=\$$1\$2
391  }
392fi # as_fn_append
393
394# as_fn_arith ARG...
395# ------------------
396# Perform arithmetic evaluation on the ARGs, and store the result in the
397# global $as_val. Take advantage of shells that can avoid forks. The arguments
398# must be portable across $(()) and expr.
399if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
400  eval 'as_fn_arith ()
401  {
402    as_val=$(( $* ))
403  }'
404else
405  as_fn_arith ()
406  {
407    as_val=`expr "$@" || test $? -eq 1`
408  }
409fi # as_fn_arith
410
411
412# as_fn_error STATUS ERROR [LINENO LOG_FD]
413# ----------------------------------------
414# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
415# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
416# script with STATUS, using 1 if that was 0.
417as_fn_error ()
418{
419  as_status=$1; test $as_status -eq 0 && as_status=1
420  if test "$4"; then
421    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
422    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
423  fi
424  $as_echo "$as_me: error: $2" >&2
425  as_fn_exit $as_status
426} # as_fn_error
427
428if expr a : '\(a\)' >/dev/null 2>&1 &&
429   test "X`expr 00001 : '.*\(...\)'`" = X001; then
430  as_expr=expr
431else
432  as_expr=false
433fi
434
435if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
436  as_basename=basename
437else
438  as_basename=false
439fi
440
441if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
442  as_dirname=dirname
443else
444  as_dirname=false
445fi
446
447as_me=`$as_basename -- "$0" ||
448$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
449	 X"$0" : 'X\(//\)$' \| \
450	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
451$as_echo X/"$0" |
452    sed '/^.*\/\([^/][^/]*\)\/*$/{
453	    s//\1/
454	    q
455	  }
456	  /^X\/\(\/\/\)$/{
457	    s//\1/
458	    q
459	  }
460	  /^X\/\(\/\).*/{
461	    s//\1/
462	    q
463	  }
464	  s/.*/./; q'`
465
466# Avoid depending upon Character Ranges.
467as_cr_letters='abcdefghijklmnopqrstuvwxyz'
468as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
469as_cr_Letters=$as_cr_letters$as_cr_LETTERS
470as_cr_digits='0123456789'
471as_cr_alnum=$as_cr_Letters$as_cr_digits
472
473
474  as_lineno_1=$LINENO as_lineno_1a=$LINENO
475  as_lineno_2=$LINENO as_lineno_2a=$LINENO
476  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
477  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
478  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
479  sed -n '
480    p
481    /[$]LINENO/=
482  ' <$as_myself |
483    sed '
484      s/[$]LINENO.*/&-/
485      t lineno
486      b
487      :lineno
488      N
489      :loop
490      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
491      t loop
492      s/-\n.*//
493    ' >$as_me.lineno &&
494  chmod +x "$as_me.lineno" ||
495    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
496
497  # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
498  # already done that, so ensure we don't try to do so again and fall
499  # in an infinite loop.  This has already happened in practice.
500  _as_can_reexec=no; export _as_can_reexec
501  # Don't try to exec as it changes $[0], causing all sort of problems
502  # (the dirname of $[0] is not the place where we might find the
503  # original and so on.  Autoconf is especially sensitive to this).
504  . "./$as_me.lineno"
505  # Exit status is that of the last command.
506  exit
507}
508
509ECHO_C= ECHO_N= ECHO_T=
510case `echo -n x` in #(((((
511-n*)
512  case `echo 'xy\c'` in
513  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
514  xy)  ECHO_C='\c';;
515  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
516       ECHO_T='	';;
517  esac;;
518*)
519  ECHO_N='-n';;
520esac
521
522rm -f conf$$ conf$$.exe conf$$.file
523if test -d conf$$.dir; then
524  rm -f conf$$.dir/conf$$.file
525else
526  rm -f conf$$.dir
527  mkdir conf$$.dir 2>/dev/null
528fi
529if (echo >conf$$.file) 2>/dev/null; then
530  if ln -s conf$$.file conf$$ 2>/dev/null; then
531    as_ln_s='ln -s'
532    # ... but there are two gotchas:
533    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
534    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
535    # In both cases, we have to default to `cp -pR'.
536    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
537      as_ln_s='cp -pR'
538  elif ln conf$$.file conf$$ 2>/dev/null; then
539    as_ln_s=ln
540  else
541    as_ln_s='cp -pR'
542  fi
543else
544  as_ln_s='cp -pR'
545fi
546rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
547rmdir conf$$.dir 2>/dev/null
548
549if mkdir -p . 2>/dev/null; then
550  as_mkdir_p='mkdir -p "$as_dir"'
551else
552  test -d ./-p && rmdir ./-p
553  as_mkdir_p=false
554fi
555
556as_test_x='test -x'
557as_executable_p=as_fn_executable_p
558
559# Sed expression to map a string onto a valid CPP name.
560as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
561
562# Sed expression to map a string onto a valid variable name.
563as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
564
565SHELL=${CONFIG_SHELL-/bin/sh}
566
567
568test -n "$DJDIR" || exec 7<&0 </dev/null
569exec 6>&1
570
571# Name of the host.
572# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
573# so uname gets run too.
574ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
575
576#
577# Initializations.
578#
579ac_default_prefix=/usr/local
580ac_clean_files=
581ac_config_libobj_dir=.
582LIBOBJS=
583cross_compiling=no
584subdirs=
585MFLAGS=
586MAKEFLAGS=
587
588# Identity of this package.
589PACKAGE_NAME=
590PACKAGE_TARNAME=
591PACKAGE_VERSION=
592PACKAGE_STRING=
593PACKAGE_BUGREPORT=
594PACKAGE_URL=
595
596ac_unique_file="include/common.h"
597# Factoring default headers for most tests.
598ac_includes_default="\
599#include <stdio.h>
600#ifdef HAVE_SYS_TYPES_H
601# include <sys/types.h>
602#endif
603#ifdef HAVE_SYS_STAT_H
604# include <sys/stat.h>
605#endif
606#ifdef STDC_HEADERS
607# include <stdlib.h>
608# include <stddef.h>
609#else
610# ifdef HAVE_STDLIB_H
611#  include <stdlib.h>
612# endif
613#endif
614#ifdef HAVE_STRING_H
615# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
616#  include <memory.h>
617# endif
618# include <string.h>
619#endif
620#ifdef HAVE_STRINGS_H
621# include <strings.h>
622#endif
623#ifdef HAVE_INTTYPES_H
624# include <inttypes.h>
625#endif
626#ifdef HAVE_STDINT_H
627# include <stdint.h>
628#endif
629#ifdef HAVE_UNISTD_H
630# include <unistd.h>
631#endif"
632
633ac_header_list=
634ac_subst_vars='am__EXEEXT_FALSE
635am__EXEEXT_TRUE
636LTLIBOBJS
637UNITSUBDIRS
638LIBSCOMPAT
639SOCKDDEPS
640DLIBDEPS
641TOPEXTRADIST
642DISTSUBDIRS
643TOPSUBDIRS
644HAVEMOD_PAC_FALSE
645HAVEMOD_PAC_TRUE
646MAPOPT
647ac_krb5_config
648SOFULLPATH
649NOPRELOAD
650LIBRARY_PREFIX
651SOCKSIFY_PRELOAD_LIBS
652SERVER_INTERPOSITION_ALWAYS_FALSE
653SERVER_INTERPOSITION_ALWAYS_TRUE
654SERVER_INTERPOSITION_FALSE
655SERVER_INTERPOSITION_TRUE
656PRELOAD_POSTFIX
657PRELOAD_VARIABLE
658PRELOAD_SEPERATOR
659SOLIB_POSTFIX
660LINTSCCOMPATLIB
661SCCOMPATLIB
662SOCKDCOMPAT
663LIBDSCSRC
664LIBSCSRC
665LIBOBJS
666LINTLIBOPT
667LINTPASS2
668LINTPASS1
669LINTFLAGS
670RUNLINT_FALSE
671RUNLINT_TRUE
672LINT
673ISA64DIR
674LEXLIB
675LEX_OUTPUT_ROOT
676LEX
677YFLAGS
678YACC
679PRERELEASE_FALSE
680PRERELEASE_TRUE
681CPP
682OTOOL64
683OTOOL
684LIPO
685NMEDIT
686DSYMUTIL
687MANIFEST_TOOL
688RANLIB
689ac_ct_AR
690AR
691DLLTOOL
692OBJDUMP
693LN_S
694NM
695ac_ct_DUMPBIN
696DUMPBIN
697LD
698FGREP
699EGREP
700GREP
701SED
702am__fastdepCC_FALSE
703am__fastdepCC_TRUE
704CCDEPMODE
705am__nodep
706AMDEPBACKSLASH
707AMDEP_FALSE
708AMDEP_TRUE
709am__quote
710am__include
711DEPDIR
712OBJEXT
713EXEEXT
714ac_ct_CC
715CPPFLAGS
716LDFLAGS
717CFLAGS
718CC
719host_os
720host_vendor
721host_cpu
722host
723build_os
724build_vendor
725build_cpu
726build
727LIBTOOL
728AM_BACKSLASH
729AM_DEFAULT_VERBOSITY
730AM_DEFAULT_V
731AM_V
732am__untar
733am__tar
734AMTAR
735am__leading_dot
736SET_MAKE
737AWK
738mkdir_p
739MKDIR_P
740INSTALL_STRIP_PROGRAM
741STRIP
742install_sh
743MAKEINFO
744AUTOHEADER
745AUTOMAKE
746AUTOCONF
747ACLOCAL
748VERSION
749PACKAGE
750CYGPATH_W
751am__isrc
752INSTALL_DATA
753INSTALL_SCRIPT
754INSTALL_PROGRAM
755RPMVERSION2
756RPMVERSION1
757target_alias
758host_alias
759build_alias
760LIBS
761ECHO_T
762ECHO_N
763ECHO_C
764DEFS
765mandir
766localedir
767libdir
768psdir
769pdfdir
770dvidir
771htmldir
772infodir
773docdir
774oldincludedir
775includedir
776localstatedir
777sharedstatedir
778sysconfdir
779datadir
780datarootdir
781libexecdir
782sbindir
783bindir
784program_transform_name
785prefix
786exec_prefix
787PACKAGE_URL
788PACKAGE_BUGREPORT
789PACKAGE_STRING
790PACKAGE_VERSION
791PACKAGE_TARNAME
792PACKAGE_NAME
793PATH_SEPARATOR
794SHELL'
795ac_subst_files=''
796ac_user_opts='
797enable_option_checking
798enable_silent_rules
799enable_shared
800enable_static
801with_pic
802enable_fast_install
803enable_dependency_tracking
804with_gnu_ld
805with_sysroot
806enable_libtool_lock
807enable_release
808enable_debug
809enable_livedebug
810enable_warnings
811enable_diagnostic
812enable_profiling
813enable_coverage
814enable_linting
815enable_largefile
816with_glibc_secure
817enable_client
818enable_server
819with_socks_conf
820with_sockd_conf
821with_bsdauth
822with_full_env
823enable_drt_fallback
824enable_preload
825enable_clientdl
826enable_serverdl
827with_libc
828with_gssapi_path
829with_gssapi
830with_krb5_config
831with_pac
832with_sasl
833with_sasl_path
834with_ldap
835with_ldap_path
836with_upnp
837enable_pidfile
838with_pidfile
839with_iomax
840with_negmax
841with_bufsize
842with_libwrap
843enable_libwrap
844with_pam
845enable_libcfail
846'
847      ac_precious_vars='build_alias
848host_alias
849target_alias
850CC
851CFLAGS
852LDFLAGS
853LIBS
854CPPFLAGS
855CPP
856YACC
857YFLAGS'
858
859
860# Initialize some variables set by options.
861ac_init_help=
862ac_init_version=false
863ac_unrecognized_opts=
864ac_unrecognized_sep=
865# The variables have the same names as the options, with
866# dashes changed to underlines.
867cache_file=/dev/null
868exec_prefix=NONE
869no_create=
870no_recursion=
871prefix=NONE
872program_prefix=NONE
873program_suffix=NONE
874program_transform_name=s,x,x,
875silent=
876site=
877srcdir=
878verbose=
879x_includes=NONE
880x_libraries=NONE
881
882# Installation directory options.
883# These are left unexpanded so users can "make install exec_prefix=/foo"
884# and all the variables that are supposed to be based on exec_prefix
885# by default will actually change.
886# Use braces instead of parens because sh, perl, etc. also accept them.
887# (The list follows the same order as the GNU Coding Standards.)
888bindir='${exec_prefix}/bin'
889sbindir='${exec_prefix}/sbin'
890libexecdir='${exec_prefix}/libexec'
891datarootdir='${prefix}/share'
892datadir='${datarootdir}'
893sysconfdir='${prefix}/etc'
894sharedstatedir='${prefix}/com'
895localstatedir='${prefix}/var'
896includedir='${prefix}/include'
897oldincludedir='/usr/include'
898docdir='${datarootdir}/doc/${PACKAGE}'
899infodir='${datarootdir}/info'
900htmldir='${docdir}'
901dvidir='${docdir}'
902pdfdir='${docdir}'
903psdir='${docdir}'
904libdir='${exec_prefix}/lib'
905localedir='${datarootdir}/locale'
906mandir='${datarootdir}/man'
907
908ac_prev=
909ac_dashdash=
910for ac_option
911do
912  # If the previous option needs an argument, assign it.
913  if test -n "$ac_prev"; then
914    eval $ac_prev=\$ac_option
915    ac_prev=
916    continue
917  fi
918
919  case $ac_option in
920  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
921  *=)   ac_optarg= ;;
922  *)    ac_optarg=yes ;;
923  esac
924
925  # Accept the important Cygnus configure options, so we can diagnose typos.
926
927  case $ac_dashdash$ac_option in
928  --)
929    ac_dashdash=yes ;;
930
931  -bindir | --bindir | --bindi | --bind | --bin | --bi)
932    ac_prev=bindir ;;
933  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
934    bindir=$ac_optarg ;;
935
936  -build | --build | --buil | --bui | --bu)
937    ac_prev=build_alias ;;
938  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
939    build_alias=$ac_optarg ;;
940
941  -cache-file | --cache-file | --cache-fil | --cache-fi \
942  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
943    ac_prev=cache_file ;;
944  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
945  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
946    cache_file=$ac_optarg ;;
947
948  --config-cache | -C)
949    cache_file=config.cache ;;
950
951  -datadir | --datadir | --datadi | --datad)
952    ac_prev=datadir ;;
953  -datadir=* | --datadir=* | --datadi=* | --datad=*)
954    datadir=$ac_optarg ;;
955
956  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
957  | --dataroo | --dataro | --datar)
958    ac_prev=datarootdir ;;
959  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
960  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
961    datarootdir=$ac_optarg ;;
962
963  -disable-* | --disable-*)
964    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
965    # Reject names that are not valid shell variable names.
966    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
967      as_fn_error $? "invalid feature name: $ac_useropt"
968    ac_useropt_orig=$ac_useropt
969    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
970    case $ac_user_opts in
971      *"
972"enable_$ac_useropt"
973"*) ;;
974      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
975	 ac_unrecognized_sep=', ';;
976    esac
977    eval enable_$ac_useropt=no ;;
978
979  -docdir | --docdir | --docdi | --doc | --do)
980    ac_prev=docdir ;;
981  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
982    docdir=$ac_optarg ;;
983
984  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
985    ac_prev=dvidir ;;
986  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
987    dvidir=$ac_optarg ;;
988
989  -enable-* | --enable-*)
990    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
991    # Reject names that are not valid shell variable names.
992    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
993      as_fn_error $? "invalid feature name: $ac_useropt"
994    ac_useropt_orig=$ac_useropt
995    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
996    case $ac_user_opts in
997      *"
998"enable_$ac_useropt"
999"*) ;;
1000      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
1001	 ac_unrecognized_sep=', ';;
1002    esac
1003    eval enable_$ac_useropt=\$ac_optarg ;;
1004
1005  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
1006  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
1007  | --exec | --exe | --ex)
1008    ac_prev=exec_prefix ;;
1009  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
1010  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
1011  | --exec=* | --exe=* | --ex=*)
1012    exec_prefix=$ac_optarg ;;
1013
1014  -gas | --gas | --ga | --g)
1015    # Obsolete; use --with-gas.
1016    with_gas=yes ;;
1017
1018  -help | --help | --hel | --he | -h)
1019    ac_init_help=long ;;
1020  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
1021    ac_init_help=recursive ;;
1022  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
1023    ac_init_help=short ;;
1024
1025  -host | --host | --hos | --ho)
1026    ac_prev=host_alias ;;
1027  -host=* | --host=* | --hos=* | --ho=*)
1028    host_alias=$ac_optarg ;;
1029
1030  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
1031    ac_prev=htmldir ;;
1032  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
1033  | --ht=*)
1034    htmldir=$ac_optarg ;;
1035
1036  -includedir | --includedir | --includedi | --included | --include \
1037  | --includ | --inclu | --incl | --inc)
1038    ac_prev=includedir ;;
1039  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
1040  | --includ=* | --inclu=* | --incl=* | --inc=*)
1041    includedir=$ac_optarg ;;
1042
1043  -infodir | --infodir | --infodi | --infod | --info | --inf)
1044    ac_prev=infodir ;;
1045  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
1046    infodir=$ac_optarg ;;
1047
1048  -libdir | --libdir | --libdi | --libd)
1049    ac_prev=libdir ;;
1050  -libdir=* | --libdir=* | --libdi=* | --libd=*)
1051    libdir=$ac_optarg ;;
1052
1053  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
1054  | --libexe | --libex | --libe)
1055    ac_prev=libexecdir ;;
1056  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
1057  | --libexe=* | --libex=* | --libe=*)
1058    libexecdir=$ac_optarg ;;
1059
1060  -localedir | --localedir | --localedi | --localed | --locale)
1061    ac_prev=localedir ;;
1062  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
1063    localedir=$ac_optarg ;;
1064
1065  -localstatedir | --localstatedir | --localstatedi | --localstated \
1066  | --localstate | --localstat | --localsta | --localst | --locals)
1067    ac_prev=localstatedir ;;
1068  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
1069  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
1070    localstatedir=$ac_optarg ;;
1071
1072  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
1073    ac_prev=mandir ;;
1074  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
1075    mandir=$ac_optarg ;;
1076
1077  -nfp | --nfp | --nf)
1078    # Obsolete; use --without-fp.
1079    with_fp=no ;;
1080
1081  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1082  | --no-cr | --no-c | -n)
1083    no_create=yes ;;
1084
1085  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1086  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
1087    no_recursion=yes ;;
1088
1089  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
1090  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
1091  | --oldin | --oldi | --old | --ol | --o)
1092    ac_prev=oldincludedir ;;
1093  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
1094  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
1095  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
1096    oldincludedir=$ac_optarg ;;
1097
1098  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
1099    ac_prev=prefix ;;
1100  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
1101    prefix=$ac_optarg ;;
1102
1103  -program-prefix | --program-prefix | --program-prefi | --program-pref \
1104  | --program-pre | --program-pr | --program-p)
1105    ac_prev=program_prefix ;;
1106  -program-prefix=* | --program-prefix=* | --program-prefi=* \
1107  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
1108    program_prefix=$ac_optarg ;;
1109
1110  -program-suffix | --program-suffix | --program-suffi | --program-suff \
1111  | --program-suf | --program-su | --program-s)
1112    ac_prev=program_suffix ;;
1113  -program-suffix=* | --program-suffix=* | --program-suffi=* \
1114  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
1115    program_suffix=$ac_optarg ;;
1116
1117  -program-transform-name | --program-transform-name \
1118  | --program-transform-nam | --program-transform-na \
1119  | --program-transform-n | --program-transform- \
1120  | --program-transform | --program-transfor \
1121  | --program-transfo | --program-transf \
1122  | --program-trans | --program-tran \
1123  | --progr-tra | --program-tr | --program-t)
1124    ac_prev=program_transform_name ;;
1125  -program-transform-name=* | --program-transform-name=* \
1126  | --program-transform-nam=* | --program-transform-na=* \
1127  | --program-transform-n=* | --program-transform-=* \
1128  | --program-transform=* | --program-transfor=* \
1129  | --program-transfo=* | --program-transf=* \
1130  | --program-trans=* | --program-tran=* \
1131  | --progr-tra=* | --program-tr=* | --program-t=*)
1132    program_transform_name=$ac_optarg ;;
1133
1134  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
1135    ac_prev=pdfdir ;;
1136  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
1137    pdfdir=$ac_optarg ;;
1138
1139  -psdir | --psdir | --psdi | --psd | --ps)
1140    ac_prev=psdir ;;
1141  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
1142    psdir=$ac_optarg ;;
1143
1144  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
1145  | -silent | --silent | --silen | --sile | --sil)
1146    silent=yes ;;
1147
1148  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1149    ac_prev=sbindir ;;
1150  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
1151  | --sbi=* | --sb=*)
1152    sbindir=$ac_optarg ;;
1153
1154  -sharedstatedir | --sharedstatedir | --sharedstatedi \
1155  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
1156  | --sharedst | --shareds | --shared | --share | --shar \
1157  | --sha | --sh)
1158    ac_prev=sharedstatedir ;;
1159  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
1160  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
1161  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
1162  | --sha=* | --sh=*)
1163    sharedstatedir=$ac_optarg ;;
1164
1165  -site | --site | --sit)
1166    ac_prev=site ;;
1167  -site=* | --site=* | --sit=*)
1168    site=$ac_optarg ;;
1169
1170  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
1171    ac_prev=srcdir ;;
1172  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
1173    srcdir=$ac_optarg ;;
1174
1175  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
1176  | --syscon | --sysco | --sysc | --sys | --sy)
1177    ac_prev=sysconfdir ;;
1178  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
1179  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
1180    sysconfdir=$ac_optarg ;;
1181
1182  -target | --target | --targe | --targ | --tar | --ta | --t)
1183    ac_prev=target_alias ;;
1184  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
1185    target_alias=$ac_optarg ;;
1186
1187  -v | -verbose | --verbose | --verbos | --verbo | --verb)
1188    verbose=yes ;;
1189
1190  -version | --version | --versio | --versi | --vers | -V)
1191    ac_init_version=: ;;
1192
1193  -with-* | --with-*)
1194    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
1195    # Reject names that are not valid shell variable names.
1196    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1197      as_fn_error $? "invalid package name: $ac_useropt"
1198    ac_useropt_orig=$ac_useropt
1199    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1200    case $ac_user_opts in
1201      *"
1202"with_$ac_useropt"
1203"*) ;;
1204      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
1205	 ac_unrecognized_sep=', ';;
1206    esac
1207    eval with_$ac_useropt=\$ac_optarg ;;
1208
1209  -without-* | --without-*)
1210    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
1211    # Reject names that are not valid shell variable names.
1212    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
1213      as_fn_error $? "invalid package name: $ac_useropt"
1214    ac_useropt_orig=$ac_useropt
1215    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
1216    case $ac_user_opts in
1217      *"
1218"with_$ac_useropt"
1219"*) ;;
1220      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
1221	 ac_unrecognized_sep=', ';;
1222    esac
1223    eval with_$ac_useropt=no ;;
1224
1225  --x)
1226    # Obsolete; use --with-x.
1227    with_x=yes ;;
1228
1229  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
1230  | --x-incl | --x-inc | --x-in | --x-i)
1231    ac_prev=x_includes ;;
1232  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
1233  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
1234    x_includes=$ac_optarg ;;
1235
1236  -x-libraries | --x-libraries | --x-librarie | --x-librari \
1237  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
1238    ac_prev=x_libraries ;;
1239  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
1240  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
1241    x_libraries=$ac_optarg ;;
1242
1243  -*) as_fn_error $? "unrecognized option: \`$ac_option'
1244Try \`$0 --help' for more information"
1245    ;;
1246
1247  *=*)
1248    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
1249    # Reject names that are not valid shell variable names.
1250    case $ac_envvar in #(
1251      '' | [0-9]* | *[!_$as_cr_alnum]* )
1252      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
1253    esac
1254    eval $ac_envvar=\$ac_optarg
1255    export $ac_envvar ;;
1256
1257  *)
1258    # FIXME: should be removed in autoconf 3.0.
1259    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
1260    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
1261      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
1262    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
1263    ;;
1264
1265  esac
1266done
1267
1268if test -n "$ac_prev"; then
1269  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
1270  as_fn_error $? "missing argument to $ac_option"
1271fi
1272
1273if test -n "$ac_unrecognized_opts"; then
1274  case $enable_option_checking in
1275    no) ;;
1276    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
1277    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
1278  esac
1279fi
1280
1281# Check all directory arguments for consistency.
1282for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1283		datadir sysconfdir sharedstatedir localstatedir includedir \
1284		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1285		libdir localedir mandir
1286do
1287  eval ac_val=\$$ac_var
1288  # Remove trailing slashes.
1289  case $ac_val in
1290    */ )
1291      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
1292      eval $ac_var=\$ac_val;;
1293  esac
1294  # Be sure to have absolute directory names.
1295  case $ac_val in
1296    [\\/$]* | ?:[\\/]* )  continue;;
1297    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
1298  esac
1299  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
1300done
1301
1302# There might be people who depend on the old broken behavior: `$host'
1303# used to hold the argument of --host etc.
1304# FIXME: To remove some day.
1305build=$build_alias
1306host=$host_alias
1307target=$target_alias
1308
1309# FIXME: To remove some day.
1310if test "x$host_alias" != x; then
1311  if test "x$build_alias" = x; then
1312    cross_compiling=maybe
1313  elif test "x$build_alias" != "x$host_alias"; then
1314    cross_compiling=yes
1315  fi
1316fi
1317
1318ac_tool_prefix=
1319test -n "$host_alias" && ac_tool_prefix=$host_alias-
1320
1321test "$silent" = yes && exec 6>/dev/null
1322
1323
1324ac_pwd=`pwd` && test -n "$ac_pwd" &&
1325ac_ls_di=`ls -di .` &&
1326ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
1327  as_fn_error $? "working directory cannot be determined"
1328test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
1329  as_fn_error $? "pwd does not report name of working directory"
1330
1331
1332# Find the source files, if location was not specified.
1333if test -z "$srcdir"; then
1334  ac_srcdir_defaulted=yes
1335  # Try the directory containing this script, then the parent directory.
1336  ac_confdir=`$as_dirname -- "$as_myself" ||
1337$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
1338	 X"$as_myself" : 'X\(//\)[^/]' \| \
1339	 X"$as_myself" : 'X\(//\)$' \| \
1340	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
1341$as_echo X"$as_myself" |
1342    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
1343	    s//\1/
1344	    q
1345	  }
1346	  /^X\(\/\/\)[^/].*/{
1347	    s//\1/
1348	    q
1349	  }
1350	  /^X\(\/\/\)$/{
1351	    s//\1/
1352	    q
1353	  }
1354	  /^X\(\/\).*/{
1355	    s//\1/
1356	    q
1357	  }
1358	  s/.*/./; q'`
1359  srcdir=$ac_confdir
1360  if test ! -r "$srcdir/$ac_unique_file"; then
1361    srcdir=..
1362  fi
1363else
1364  ac_srcdir_defaulted=no
1365fi
1366if test ! -r "$srcdir/$ac_unique_file"; then
1367  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
1368  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
1369fi
1370ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
1371ac_abs_confdir=`(
1372	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
1373	pwd)`
1374# When building in place, set srcdir=.
1375if test "$ac_abs_confdir" = "$ac_pwd"; then
1376  srcdir=.
1377fi
1378# Remove unnecessary trailing slashes from srcdir.
1379# Double slashes in file names in object file debugging info
1380# mess up M-x gdb in Emacs.
1381case $srcdir in
1382*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
1383esac
1384for ac_var in $ac_precious_vars; do
1385  eval ac_env_${ac_var}_set=\${${ac_var}+set}
1386  eval ac_env_${ac_var}_value=\$${ac_var}
1387  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
1388  eval ac_cv_env_${ac_var}_value=\$${ac_var}
1389done
1390
1391#
1392# Report the --help message.
1393#
1394if test "$ac_init_help" = "long"; then
1395  # Omit some internal or obsolete options to make the list less imposing.
1396  # This message is too long to be a string in the A/UX 3.1 sh.
1397  cat <<_ACEOF
1398\`configure' configures this package to adapt to many kinds of systems.
1399
1400Usage: $0 [OPTION]... [VAR=VALUE]...
1401
1402To assign environment variables (e.g., CC, CFLAGS...), specify them as
1403VAR=VALUE.  See below for descriptions of some of the useful variables.
1404
1405Defaults for the options are specified in brackets.
1406
1407Configuration:
1408  -h, --help              display this help and exit
1409      --help=short        display options specific to this package
1410      --help=recursive    display the short help of all the included packages
1411  -V, --version           display version information and exit
1412  -q, --quiet, --silent   do not print \`checking ...' messages
1413      --cache-file=FILE   cache test results in FILE [disabled]
1414  -C, --config-cache      alias for \`--cache-file=config.cache'
1415  -n, --no-create         do not create output files
1416      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
1417
1418Installation directories:
1419  --prefix=PREFIX         install architecture-independent files in PREFIX
1420                          [$ac_default_prefix]
1421  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
1422                          [PREFIX]
1423
1424By default, \`make install' will install all the files in
1425\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
1426an installation prefix other than \`$ac_default_prefix' using \`--prefix',
1427for instance \`--prefix=\$HOME'.
1428
1429For better control, use the options below.
1430
1431Fine tuning of the installation directories:
1432  --bindir=DIR            user executables [EPREFIX/bin]
1433  --sbindir=DIR           system admin executables [EPREFIX/sbin]
1434  --libexecdir=DIR        program executables [EPREFIX/libexec]
1435  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1436  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1437  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1438  --libdir=DIR            object code libraries [EPREFIX/lib]
1439  --includedir=DIR        C header files [PREFIX/include]
1440  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
1441  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
1442  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
1443  --infodir=DIR           info documentation [DATAROOTDIR/info]
1444  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
1445  --mandir=DIR            man documentation [DATAROOTDIR/man]
1446  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
1447  --htmldir=DIR           html documentation [DOCDIR]
1448  --dvidir=DIR            dvi documentation [DOCDIR]
1449  --pdfdir=DIR            pdf documentation [DOCDIR]
1450  --psdir=DIR             ps documentation [DOCDIR]
1451_ACEOF
1452
1453  cat <<\_ACEOF
1454
1455Program names:
1456  --program-prefix=PREFIX            prepend PREFIX to installed program names
1457  --program-suffix=SUFFIX            append SUFFIX to installed program names
1458  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
1459
1460System types:
1461  --build=BUILD     configure for building on BUILD [guessed]
1462  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
1463_ACEOF
1464fi
1465
1466if test -n "$ac_init_help"; then
1467
1468  cat <<\_ACEOF
1469
1470Optional Features:
1471  --disable-option-checking  ignore unrecognized --enable/--with options
1472  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
1473  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
1474  --enable-silent-rules   less verbose build output (undo: "make V=1")
1475  --disable-silent-rules  verbose build output (undo: "make V=0")
1476  --enable-shared[=PKGS]  build shared libraries [default=yes]
1477  --enable-static[=PKGS]  build static libraries [default=yes]
1478  --enable-fast-install[=PKGS]
1479                          optimize for fast installation [default=yes]
1480  --enable-dependency-tracking
1481                          do not reject slow dependency extractors
1482  --disable-dependency-tracking
1483                          speeds up one-time build
1484  --disable-libtool-lock  avoid locking (might break parallel builds)
1485  --enable-release        build prerelease as full release
1486  --enable-debug          compile with debugging support
1487  --enable-livedebug      enable low-overhead debugging mode
1488  --enable-warnings       show compilation warnings
1489  --enable-diagnostic     enable diagnostic
1490  --enable-profiling      compile with profiling support in server
1491  --enable-coverage       compile with coverage
1492  --enable-linting        enable lint
1493  --disable-largefile     omit support for large files
1494  --disable-client        disable compilation of client library
1495  --disable-server        disable compilation of server
1496  --enable-drt-fallback   enable direct route fallback in client [default=disabled]
1497  --disable-preload       disable preloading in server and client
1498  --disable-clientdl      disable support for preloading in the client
1499  --disable-serverdl      disable support for preloading in the server
1500  --disable-pidfile       disable server pidfile creation
1501  --disable-libwrap       deprecated, use --without-libwrap
1502  --enable-libcfail       testing option, enable unreliable libc [default=disabled]
1503
1504Optional Packages:
1505  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
1506  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
1507  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
1508                          both]
1509  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
1510  --with-sysroot=DIR Search for dependent libraries within DIR
1511                        (or the compiler's sysroot if not specified).
1512  --without-glibc-secure  disable libc_enable_secure check [default=detect]
1513  --with-socks-conf=FILE  change location of socks client configuration file
1514  --with-sockd-conf=FILE  change location of socks server configuration file
1515  --without-bsdauth       disable bsdauth support [default=detect]
1516  --without-full-env      restrictive environment variable usage [default=with]
1517  --with-libc=NAME        manually set name of c library if necessary
1518  --with-gssapi-path=PATH specify gssapi path
1519  --without-gssapi        disable gssapi support
1520  --with-krb5-config=PATH specify path to krb5-config [default=detect]
1521  --without-pac           disable PAC support [default=detect]
1522  --without-sasl          disable sasl support [default=detect]
1523  --with-sasl-path=PATH   specify sasl path
1524  --without-ldap          disable ldap support [default=detect]
1525  --with-ldap-path=PATH   specify ldap path
1526  --without-upnp          disable upnp support [default=detect]
1527  --with-pidfile=FILE     change location of server pidfile
1528  --with-iomax=NUMBER     change number of clients per io process
1529  --with-negmax=NUMBER    change number of clients per negotiate process
1530  --with-bufsize=NUMBER    change size of data buffers
1531  --without-libwrap       never use libwrap, even if it is available
1532  --without-pam           disable pam support [default=detect]
1533
1534Some influential environment variables:
1535  CC          C compiler command
1536  CFLAGS      C compiler flags
1537  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
1538              nonstandard directory <lib dir>
1539  LIBS        libraries to pass to the linker, e.g. -l<library>
1540  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
1541              you have headers in a nonstandard directory <include dir>
1542  CPP         C preprocessor
1543  YACC        The `Yet Another Compiler Compiler' implementation to use.
1544              Defaults to the first program found out of: `bison -y', `byacc',
1545              `yacc'.
1546  YFLAGS      The list of arguments that will be passed by default to $YACC.
1547              This script will default YFLAGS to the empty string to avoid a
1548              default value of `-d' given by some make applications.
1549
1550Use these variables to override the choices made by `configure' or to help
1551it to find libraries and programs with nonstandard names/locations.
1552
1553Report bugs to the package provider.
1554_ACEOF
1555ac_status=$?
1556fi
1557
1558if test "$ac_init_help" = "recursive"; then
1559  # If there are subdirs, report their specific --help.
1560  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
1561    test -d "$ac_dir" ||
1562      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
1563      continue
1564    ac_builddir=.
1565
1566case "$ac_dir" in
1567.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
1568*)
1569  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
1570  # A ".." for each directory in $ac_dir_suffix.
1571  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
1572  case $ac_top_builddir_sub in
1573  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
1574  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
1575  esac ;;
1576esac
1577ac_abs_top_builddir=$ac_pwd
1578ac_abs_builddir=$ac_pwd$ac_dir_suffix
1579# for backward compatibility:
1580ac_top_builddir=$ac_top_build_prefix
1581
1582case $srcdir in
1583  .)  # We are building in place.
1584    ac_srcdir=.
1585    ac_top_srcdir=$ac_top_builddir_sub
1586    ac_abs_top_srcdir=$ac_pwd ;;
1587  [\\/]* | ?:[\\/]* )  # Absolute name.
1588    ac_srcdir=$srcdir$ac_dir_suffix;
1589    ac_top_srcdir=$srcdir
1590    ac_abs_top_srcdir=$srcdir ;;
1591  *) # Relative name.
1592    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
1593    ac_top_srcdir=$ac_top_build_prefix$srcdir
1594    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
1595esac
1596ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
1597
1598    cd "$ac_dir" || { ac_status=$?; continue; }
1599    # Check for guested configure.
1600    if test -f "$ac_srcdir/configure.gnu"; then
1601      echo &&
1602      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
1603    elif test -f "$ac_srcdir/configure"; then
1604      echo &&
1605      $SHELL "$ac_srcdir/configure" --help=recursive
1606    else
1607      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
1608    fi || ac_status=$?
1609    cd "$ac_pwd" || { ac_status=$?; break; }
1610  done
1611fi
1612
1613test -n "$ac_init_help" && exit $ac_status
1614if $ac_init_version; then
1615  cat <<\_ACEOF
1616configure
1617generated by GNU Autoconf 2.69
1618
1619Copyright (C) 2012 Free Software Foundation, Inc.
1620This configure script is free software; the Free Software Foundation
1621gives unlimited permission to copy, distribute and modify it.
1622_ACEOF
1623  exit
1624fi
1625
1626## ------------------------ ##
1627## Autoconf initialization. ##
1628## ------------------------ ##
1629
1630# ac_fn_c_try_compile LINENO
1631# --------------------------
1632# Try to compile conftest.$ac_ext, and return whether this succeeded.
1633ac_fn_c_try_compile ()
1634{
1635  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1636  rm -f conftest.$ac_objext
1637  if { { ac_try="$ac_compile"
1638case "(($ac_try" in
1639  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1640  *) ac_try_echo=$ac_try;;
1641esac
1642eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1643$as_echo "$ac_try_echo"; } >&5
1644  (eval "$ac_compile") 2>conftest.err
1645  ac_status=$?
1646  if test -s conftest.err; then
1647    grep -v '^ *+' conftest.err >conftest.er1
1648    cat conftest.er1 >&5
1649    mv -f conftest.er1 conftest.err
1650  fi
1651  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1652  test $ac_status = 0; } && {
1653	 test -z "$ac_c_werror_flag" ||
1654	 test ! -s conftest.err
1655       } && test -s conftest.$ac_objext; then :
1656  ac_retval=0
1657else
1658  $as_echo "$as_me: failed program was:" >&5
1659sed 's/^/| /' conftest.$ac_ext >&5
1660
1661	ac_retval=1
1662fi
1663  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1664  as_fn_set_status $ac_retval
1665
1666} # ac_fn_c_try_compile
1667
1668# ac_fn_c_try_link LINENO
1669# -----------------------
1670# Try to link conftest.$ac_ext, and return whether this succeeded.
1671ac_fn_c_try_link ()
1672{
1673  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1674  rm -f conftest.$ac_objext conftest$ac_exeext
1675  if { { ac_try="$ac_link"
1676case "(($ac_try" in
1677  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1678  *) ac_try_echo=$ac_try;;
1679esac
1680eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1681$as_echo "$ac_try_echo"; } >&5
1682  (eval "$ac_link") 2>conftest.err
1683  ac_status=$?
1684  if test -s conftest.err; then
1685    grep -v '^ *+' conftest.err >conftest.er1
1686    cat conftest.er1 >&5
1687    mv -f conftest.er1 conftest.err
1688  fi
1689  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1690  test $ac_status = 0; } && {
1691	 test -z "$ac_c_werror_flag" ||
1692	 test ! -s conftest.err
1693       } && test -s conftest$ac_exeext && {
1694	 test "$cross_compiling" = yes ||
1695	 test -x conftest$ac_exeext
1696       }; then :
1697  ac_retval=0
1698else
1699  $as_echo "$as_me: failed program was:" >&5
1700sed 's/^/| /' conftest.$ac_ext >&5
1701
1702	ac_retval=1
1703fi
1704  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
1705  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
1706  # interfere with the next link command; also delete a directory that is
1707  # left behind by Apple's compiler.  We do this before executing the actions.
1708  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1709  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1710  as_fn_set_status $ac_retval
1711
1712} # ac_fn_c_try_link
1713
1714# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
1715# -------------------------------------------------------
1716# Tests whether HEADER exists and can be compiled using the include files in
1717# INCLUDES, setting the cache variable VAR accordingly.
1718ac_fn_c_check_header_compile ()
1719{
1720  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1721  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1722$as_echo_n "checking for $2... " >&6; }
1723if eval \${$3+:} false; then :
1724  $as_echo_n "(cached) " >&6
1725else
1726  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1727/* end confdefs.h.  */
1728$4
1729#include <$2>
1730_ACEOF
1731if ac_fn_c_try_compile "$LINENO"; then :
1732  eval "$3=yes"
1733else
1734  eval "$3=no"
1735fi
1736rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1737fi
1738eval ac_res=\$$3
1739	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1740$as_echo "$ac_res" >&6; }
1741  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1742
1743} # ac_fn_c_check_header_compile
1744
1745# ac_fn_c_try_cpp LINENO
1746# ----------------------
1747# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
1748ac_fn_c_try_cpp ()
1749{
1750  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1751  if { { ac_try="$ac_cpp conftest.$ac_ext"
1752case "(($ac_try" in
1753  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1754  *) ac_try_echo=$ac_try;;
1755esac
1756eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1757$as_echo "$ac_try_echo"; } >&5
1758  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
1759  ac_status=$?
1760  if test -s conftest.err; then
1761    grep -v '^ *+' conftest.err >conftest.er1
1762    cat conftest.er1 >&5
1763    mv -f conftest.er1 conftest.err
1764  fi
1765  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1766  test $ac_status = 0; } > conftest.i && {
1767	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
1768	 test ! -s conftest.err
1769       }; then :
1770  ac_retval=0
1771else
1772  $as_echo "$as_me: failed program was:" >&5
1773sed 's/^/| /' conftest.$ac_ext >&5
1774
1775    ac_retval=1
1776fi
1777  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1778  as_fn_set_status $ac_retval
1779
1780} # ac_fn_c_try_cpp
1781
1782# ac_fn_c_try_run LINENO
1783# ----------------------
1784# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
1785# that executables *can* be run.
1786ac_fn_c_try_run ()
1787{
1788  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1789  if { { ac_try="$ac_link"
1790case "(($ac_try" in
1791  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1792  *) ac_try_echo=$ac_try;;
1793esac
1794eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1795$as_echo "$ac_try_echo"; } >&5
1796  (eval "$ac_link") 2>&5
1797  ac_status=$?
1798  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1799  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
1800  { { case "(($ac_try" in
1801  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
1802  *) ac_try_echo=$ac_try;;
1803esac
1804eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
1805$as_echo "$ac_try_echo"; } >&5
1806  (eval "$ac_try") 2>&5
1807  ac_status=$?
1808  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
1809  test $ac_status = 0; }; }; then :
1810  ac_retval=0
1811else
1812  $as_echo "$as_me: program exited with status $ac_status" >&5
1813       $as_echo "$as_me: failed program was:" >&5
1814sed 's/^/| /' conftest.$ac_ext >&5
1815
1816       ac_retval=$ac_status
1817fi
1818  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
1819  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1820  as_fn_set_status $ac_retval
1821
1822} # ac_fn_c_try_run
1823
1824# ac_fn_c_check_func LINENO FUNC VAR
1825# ----------------------------------
1826# Tests whether FUNC exists, setting the cache variable VAR accordingly
1827ac_fn_c_check_func ()
1828{
1829  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1830  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
1831$as_echo_n "checking for $2... " >&6; }
1832if eval \${$3+:} false; then :
1833  $as_echo_n "(cached) " >&6
1834else
1835  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1836/* end confdefs.h.  */
1837/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
1838   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
1839#define $2 innocuous_$2
1840
1841/* System header to define __stub macros and hopefully few prototypes,
1842    which can conflict with char $2 (); below.
1843    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
1844    <limits.h> exists even on freestanding compilers.  */
1845
1846#ifdef __STDC__
1847# include <limits.h>
1848#else
1849# include <assert.h>
1850#endif
1851
1852#undef $2
1853
1854/* Override any GCC internal prototype to avoid an error.
1855   Use char because int might match the return type of a GCC
1856   builtin and then its argument prototype would still apply.  */
1857#ifdef __cplusplus
1858extern "C"
1859#endif
1860char $2 ();
1861/* The GNU C library defines this for functions which it implements
1862    to always fail with ENOSYS.  Some functions are actually named
1863    something starting with __ and the normal name is an alias.  */
1864#if defined __stub_$2 || defined __stub___$2
1865choke me
1866#endif
1867
1868int
1869main ()
1870{
1871return $2 ();
1872  ;
1873  return 0;
1874}
1875_ACEOF
1876if ac_fn_c_try_link "$LINENO"; then :
1877  eval "$3=yes"
1878else
1879  eval "$3=no"
1880fi
1881rm -f core conftest.err conftest.$ac_objext \
1882    conftest$ac_exeext conftest.$ac_ext
1883fi
1884eval ac_res=\$$3
1885	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
1886$as_echo "$ac_res" >&6; }
1887  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
1888
1889} # ac_fn_c_check_func
1890
1891# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
1892# --------------------------------------------
1893# Tries to find the compile-time value of EXPR in a program that includes
1894# INCLUDES, setting VAR accordingly. Returns whether the value could be
1895# computed
1896ac_fn_c_compute_int ()
1897{
1898  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
1899  if test "$cross_compiling" = yes; then
1900    # Depending upon the size, compute the lo and hi bounds.
1901cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1902/* end confdefs.h.  */
1903$4
1904int
1905main ()
1906{
1907static int test_array [1 - 2 * !(($2) >= 0)];
1908test_array [0] = 0;
1909return test_array [0];
1910
1911  ;
1912  return 0;
1913}
1914_ACEOF
1915if ac_fn_c_try_compile "$LINENO"; then :
1916  ac_lo=0 ac_mid=0
1917  while :; do
1918    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1919/* end confdefs.h.  */
1920$4
1921int
1922main ()
1923{
1924static int test_array [1 - 2 * !(($2) <= $ac_mid)];
1925test_array [0] = 0;
1926return test_array [0];
1927
1928  ;
1929  return 0;
1930}
1931_ACEOF
1932if ac_fn_c_try_compile "$LINENO"; then :
1933  ac_hi=$ac_mid; break
1934else
1935  as_fn_arith $ac_mid + 1 && ac_lo=$as_val
1936			if test $ac_lo -le $ac_mid; then
1937			  ac_lo= ac_hi=
1938			  break
1939			fi
1940			as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
1941fi
1942rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1943  done
1944else
1945  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1946/* end confdefs.h.  */
1947$4
1948int
1949main ()
1950{
1951static int test_array [1 - 2 * !(($2) < 0)];
1952test_array [0] = 0;
1953return test_array [0];
1954
1955  ;
1956  return 0;
1957}
1958_ACEOF
1959if ac_fn_c_try_compile "$LINENO"; then :
1960  ac_hi=-1 ac_mid=-1
1961  while :; do
1962    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1963/* end confdefs.h.  */
1964$4
1965int
1966main ()
1967{
1968static int test_array [1 - 2 * !(($2) >= $ac_mid)];
1969test_array [0] = 0;
1970return test_array [0];
1971
1972  ;
1973  return 0;
1974}
1975_ACEOF
1976if ac_fn_c_try_compile "$LINENO"; then :
1977  ac_lo=$ac_mid; break
1978else
1979  as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
1980			if test $ac_mid -le $ac_hi; then
1981			  ac_lo= ac_hi=
1982			  break
1983			fi
1984			as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
1985fi
1986rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1987  done
1988else
1989  ac_lo= ac_hi=
1990fi
1991rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1992fi
1993rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
1994# Binary search between lo and hi bounds.
1995while test "x$ac_lo" != "x$ac_hi"; do
1996  as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
1997  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
1998/* end confdefs.h.  */
1999$4
2000int
2001main ()
2002{
2003static int test_array [1 - 2 * !(($2) <= $ac_mid)];
2004test_array [0] = 0;
2005return test_array [0];
2006
2007  ;
2008  return 0;
2009}
2010_ACEOF
2011if ac_fn_c_try_compile "$LINENO"; then :
2012  ac_hi=$ac_mid
2013else
2014  as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
2015fi
2016rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2017done
2018case $ac_lo in #((
2019?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
2020'') ac_retval=1 ;;
2021esac
2022  else
2023    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2024/* end confdefs.h.  */
2025$4
2026static long int longval () { return $2; }
2027static unsigned long int ulongval () { return $2; }
2028#include <stdio.h>
2029#include <stdlib.h>
2030int
2031main ()
2032{
2033
2034  FILE *f = fopen ("conftest.val", "w");
2035  if (! f)
2036    return 1;
2037  if (($2) < 0)
2038    {
2039      long int i = longval ();
2040      if (i != ($2))
2041	return 1;
2042      fprintf (f, "%ld", i);
2043    }
2044  else
2045    {
2046      unsigned long int i = ulongval ();
2047      if (i != ($2))
2048	return 1;
2049      fprintf (f, "%lu", i);
2050    }
2051  /* Do not output a trailing newline, as this causes \r\n confusion
2052     on some platforms.  */
2053  return ferror (f) || fclose (f) != 0;
2054
2055  ;
2056  return 0;
2057}
2058_ACEOF
2059if ac_fn_c_try_run "$LINENO"; then :
2060  echo >>conftest.val; read $3 <conftest.val; ac_retval=0
2061else
2062  ac_retval=1
2063fi
2064rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
2065  conftest.$ac_objext conftest.beam conftest.$ac_ext
2066rm -f conftest.val
2067
2068  fi
2069  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2070  as_fn_set_status $ac_retval
2071
2072} # ac_fn_c_compute_int
2073
2074# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
2075# -------------------------------------------------------
2076# Tests whether HEADER exists, giving a warning if it cannot be compiled using
2077# the include files in INCLUDES and setting the cache variable VAR
2078# accordingly.
2079ac_fn_c_check_header_mongrel ()
2080{
2081  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2082  if eval \${$3+:} false; then :
2083  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2084$as_echo_n "checking for $2... " >&6; }
2085if eval \${$3+:} false; then :
2086  $as_echo_n "(cached) " >&6
2087fi
2088eval ac_res=\$$3
2089	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2090$as_echo "$ac_res" >&6; }
2091else
2092  # Is the header compilable?
2093{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
2094$as_echo_n "checking $2 usability... " >&6; }
2095cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2096/* end confdefs.h.  */
2097$4
2098#include <$2>
2099_ACEOF
2100if ac_fn_c_try_compile "$LINENO"; then :
2101  ac_header_compiler=yes
2102else
2103  ac_header_compiler=no
2104fi
2105rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2106{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
2107$as_echo "$ac_header_compiler" >&6; }
2108
2109# Is the header present?
2110{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
2111$as_echo_n "checking $2 presence... " >&6; }
2112cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2113/* end confdefs.h.  */
2114#include <$2>
2115_ACEOF
2116if ac_fn_c_try_cpp "$LINENO"; then :
2117  ac_header_preproc=yes
2118else
2119  ac_header_preproc=no
2120fi
2121rm -f conftest.err conftest.i conftest.$ac_ext
2122{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
2123$as_echo "$ac_header_preproc" >&6; }
2124
2125# So?  What about this header?
2126case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
2127  yes:no: )
2128    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
2129$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
2130    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2131$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2132    ;;
2133  no:yes:* )
2134    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
2135$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
2136    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
2137$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
2138    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
2139$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
2140    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
2141$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
2142    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
2143$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
2144    ;;
2145esac
2146  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2147$as_echo_n "checking for $2... " >&6; }
2148if eval \${$3+:} false; then :
2149  $as_echo_n "(cached) " >&6
2150else
2151  eval "$3=\$ac_header_compiler"
2152fi
2153eval ac_res=\$$3
2154	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2155$as_echo "$ac_res" >&6; }
2156fi
2157  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2158
2159} # ac_fn_c_check_header_mongrel
2160
2161# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
2162# -------------------------------------------
2163# Tests whether TYPE exists after having included INCLUDES, setting cache
2164# variable VAR accordingly.
2165ac_fn_c_check_type ()
2166{
2167  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2168  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
2169$as_echo_n "checking for $2... " >&6; }
2170if eval \${$3+:} false; then :
2171  $as_echo_n "(cached) " >&6
2172else
2173  eval "$3=no"
2174  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2175/* end confdefs.h.  */
2176$4
2177int
2178main ()
2179{
2180if (sizeof ($2))
2181	 return 0;
2182  ;
2183  return 0;
2184}
2185_ACEOF
2186if ac_fn_c_try_compile "$LINENO"; then :
2187  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2188/* end confdefs.h.  */
2189$4
2190int
2191main ()
2192{
2193if (sizeof (($2)))
2194	    return 0;
2195  ;
2196  return 0;
2197}
2198_ACEOF
2199if ac_fn_c_try_compile "$LINENO"; then :
2200
2201else
2202  eval "$3=yes"
2203fi
2204rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2205fi
2206rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2207fi
2208eval ac_res=\$$3
2209	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2210$as_echo "$ac_res" >&6; }
2211  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2212
2213} # ac_fn_c_check_type
2214
2215# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
2216# ---------------------------------------------
2217# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
2218# accordingly.
2219ac_fn_c_check_decl ()
2220{
2221  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2222  as_decl_name=`echo $2|sed 's/ *(.*//'`
2223  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
2224  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
2225$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
2226if eval \${$3+:} false; then :
2227  $as_echo_n "(cached) " >&6
2228else
2229  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2230/* end confdefs.h.  */
2231$4
2232int
2233main ()
2234{
2235#ifndef $as_decl_name
2236#ifdef __cplusplus
2237  (void) $as_decl_use;
2238#else
2239  (void) $as_decl_name;
2240#endif
2241#endif
2242
2243  ;
2244  return 0;
2245}
2246_ACEOF
2247if ac_fn_c_try_compile "$LINENO"; then :
2248  eval "$3=yes"
2249else
2250  eval "$3=no"
2251fi
2252rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2253fi
2254eval ac_res=\$$3
2255	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2256$as_echo "$ac_res" >&6; }
2257  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2258
2259} # ac_fn_c_check_decl
2260
2261# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
2262# ----------------------------------------------------
2263# Tries to find if the field MEMBER exists in type AGGR, after including
2264# INCLUDES, setting cache variable VAR accordingly.
2265ac_fn_c_check_member ()
2266{
2267  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
2268  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
2269$as_echo_n "checking for $2.$3... " >&6; }
2270if eval \${$4+:} false; then :
2271  $as_echo_n "(cached) " >&6
2272else
2273  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2274/* end confdefs.h.  */
2275$5
2276int
2277main ()
2278{
2279static $2 ac_aggr;
2280if (ac_aggr.$3)
2281return 0;
2282  ;
2283  return 0;
2284}
2285_ACEOF
2286if ac_fn_c_try_compile "$LINENO"; then :
2287  eval "$4=yes"
2288else
2289  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
2290/* end confdefs.h.  */
2291$5
2292int
2293main ()
2294{
2295static $2 ac_aggr;
2296if (sizeof ac_aggr.$3)
2297return 0;
2298  ;
2299  return 0;
2300}
2301_ACEOF
2302if ac_fn_c_try_compile "$LINENO"; then :
2303  eval "$4=yes"
2304else
2305  eval "$4=no"
2306fi
2307rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2308fi
2309rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
2310fi
2311eval ac_res=\$$4
2312	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
2313$as_echo "$ac_res" >&6; }
2314  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
2315
2316} # ac_fn_c_check_member
2317cat >config.log <<_ACEOF
2318This file contains any messages produced by compilers while
2319running configure, to aid debugging if configure makes a mistake.
2320
2321It was created by $as_me, which was
2322generated by GNU Autoconf 2.69.  Invocation command line was
2323
2324  $ $0 $@
2325
2326_ACEOF
2327exec 5>>config.log
2328{
2329cat <<_ASUNAME
2330## --------- ##
2331## Platform. ##
2332## --------- ##
2333
2334hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
2335uname -m = `(uname -m) 2>/dev/null || echo unknown`
2336uname -r = `(uname -r) 2>/dev/null || echo unknown`
2337uname -s = `(uname -s) 2>/dev/null || echo unknown`
2338uname -v = `(uname -v) 2>/dev/null || echo unknown`
2339
2340/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
2341/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
2342
2343/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
2344/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
2345/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
2346/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
2347/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
2348/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
2349/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
2350
2351_ASUNAME
2352
2353as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2354for as_dir in $PATH
2355do
2356  IFS=$as_save_IFS
2357  test -z "$as_dir" && as_dir=.
2358    $as_echo "PATH: $as_dir"
2359  done
2360IFS=$as_save_IFS
2361
2362} >&5
2363
2364cat >&5 <<_ACEOF
2365
2366
2367## ----------- ##
2368## Core tests. ##
2369## ----------- ##
2370
2371_ACEOF
2372
2373
2374# Keep a trace of the command line.
2375# Strip out --no-create and --no-recursion so they do not pile up.
2376# Strip out --silent because we don't want to record it for future runs.
2377# Also quote any args containing shell meta-characters.
2378# Make two passes to allow for proper duplicate-argument suppression.
2379ac_configure_args=
2380ac_configure_args0=
2381ac_configure_args1=
2382ac_must_keep_next=false
2383for ac_pass in 1 2
2384do
2385  for ac_arg
2386  do
2387    case $ac_arg in
2388    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
2389    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
2390    | -silent | --silent | --silen | --sile | --sil)
2391      continue ;;
2392    *\'*)
2393      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
2394    esac
2395    case $ac_pass in
2396    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2397    2)
2398      as_fn_append ac_configure_args1 " '$ac_arg'"
2399      if test $ac_must_keep_next = true; then
2400	ac_must_keep_next=false # Got value, back to normal.
2401      else
2402	case $ac_arg in
2403	  *=* | --config-cache | -C | -disable-* | --disable-* \
2404	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
2405	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
2406	  | -with-* | --with-* | -without-* | --without-* | --x)
2407	    case "$ac_configure_args0 " in
2408	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
2409	    esac
2410	    ;;
2411	  -* ) ac_must_keep_next=true ;;
2412	esac
2413      fi
2414      as_fn_append ac_configure_args " '$ac_arg'"
2415      ;;
2416    esac
2417  done
2418done
2419{ ac_configure_args0=; unset ac_configure_args0;}
2420{ ac_configure_args1=; unset ac_configure_args1;}
2421
2422# When interrupted or exit'd, cleanup temporary files, and complete
2423# config.log.  We remove comments because anyway the quotes in there
2424# would cause problems or look ugly.
2425# WARNING: Use '\'' to represent an apostrophe within the trap.
2426# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
2427trap 'exit_status=$?
2428  # Save into config.log some information that might help in debugging.
2429  {
2430    echo
2431
2432    $as_echo "## ---------------- ##
2433## Cache variables. ##
2434## ---------------- ##"
2435    echo
2436    # The following way of writing the cache mishandles newlines in values,
2437(
2438  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
2439    eval ac_val=\$$ac_var
2440    case $ac_val in #(
2441    *${as_nl}*)
2442      case $ac_var in #(
2443      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
2444$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
2445      esac
2446      case $ac_var in #(
2447      _ | IFS | as_nl) ;; #(
2448      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
2449      *) { eval $ac_var=; unset $ac_var;} ;;
2450      esac ;;
2451    esac
2452  done
2453  (set) 2>&1 |
2454    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
2455    *${as_nl}ac_space=\ *)
2456      sed -n \
2457	"s/'\''/'\''\\\\'\'''\''/g;
2458	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
2459      ;; #(
2460    *)
2461      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
2462      ;;
2463    esac |
2464    sort
2465)
2466    echo
2467
2468    $as_echo "## ----------------- ##
2469## Output variables. ##
2470## ----------------- ##"
2471    echo
2472    for ac_var in $ac_subst_vars
2473    do
2474      eval ac_val=\$$ac_var
2475      case $ac_val in
2476      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2477      esac
2478      $as_echo "$ac_var='\''$ac_val'\''"
2479    done | sort
2480    echo
2481
2482    if test -n "$ac_subst_files"; then
2483      $as_echo "## ------------------- ##
2484## File substitutions. ##
2485## ------------------- ##"
2486      echo
2487      for ac_var in $ac_subst_files
2488      do
2489	eval ac_val=\$$ac_var
2490	case $ac_val in
2491	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
2492	esac
2493	$as_echo "$ac_var='\''$ac_val'\''"
2494      done | sort
2495      echo
2496    fi
2497
2498    if test -s confdefs.h; then
2499      $as_echo "## ----------- ##
2500## confdefs.h. ##
2501## ----------- ##"
2502      echo
2503      cat confdefs.h
2504      echo
2505    fi
2506    test "$ac_signal" != 0 &&
2507      $as_echo "$as_me: caught signal $ac_signal"
2508    $as_echo "$as_me: exit $exit_status"
2509  } >&5
2510  rm -f core *.core core.conftest.* &&
2511    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
2512    exit $exit_status
2513' 0
2514for ac_signal in 1 2 13 15; do
2515  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
2516done
2517ac_signal=0
2518
2519# confdefs.h avoids OS command line length limits that DEFS can exceed.
2520rm -f -r conftest* confdefs.h
2521
2522$as_echo "/* confdefs.h */" > confdefs.h
2523
2524# Predefined preprocessor variables.
2525
2526cat >>confdefs.h <<_ACEOF
2527#define PACKAGE_NAME "$PACKAGE_NAME"
2528_ACEOF
2529
2530cat >>confdefs.h <<_ACEOF
2531#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
2532_ACEOF
2533
2534cat >>confdefs.h <<_ACEOF
2535#define PACKAGE_VERSION "$PACKAGE_VERSION"
2536_ACEOF
2537
2538cat >>confdefs.h <<_ACEOF
2539#define PACKAGE_STRING "$PACKAGE_STRING"
2540_ACEOF
2541
2542cat >>confdefs.h <<_ACEOF
2543#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
2544_ACEOF
2545
2546cat >>confdefs.h <<_ACEOF
2547#define PACKAGE_URL "$PACKAGE_URL"
2548_ACEOF
2549
2550
2551# Let the site file select an alternate cache file if it wants to.
2552# Prefer an explicitly selected file to automatically selected ones.
2553ac_site_file1=NONE
2554ac_site_file2=NONE
2555if test -n "$CONFIG_SITE"; then
2556  # We do not want a PATH search for config.site.
2557  case $CONFIG_SITE in #((
2558    -*)  ac_site_file1=./$CONFIG_SITE;;
2559    */*) ac_site_file1=$CONFIG_SITE;;
2560    *)   ac_site_file1=./$CONFIG_SITE;;
2561  esac
2562elif test "x$prefix" != xNONE; then
2563  ac_site_file1=$prefix/share/config.site
2564  ac_site_file2=$prefix/etc/config.site
2565else
2566  ac_site_file1=$ac_default_prefix/share/config.site
2567  ac_site_file2=$ac_default_prefix/etc/config.site
2568fi
2569for ac_site_file in "$ac_site_file1" "$ac_site_file2"
2570do
2571  test "x$ac_site_file" = xNONE && continue
2572  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
2573    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
2574$as_echo "$as_me: loading site script $ac_site_file" >&6;}
2575    sed 's/^/| /' "$ac_site_file" >&5
2576    . "$ac_site_file" \
2577      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2578$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2579as_fn_error $? "failed to load site script $ac_site_file
2580See \`config.log' for more details" "$LINENO" 5; }
2581  fi
2582done
2583
2584if test -r "$cache_file"; then
2585  # Some versions of bash will fail to source /dev/null (special files
2586  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
2587  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
2588    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
2589$as_echo "$as_me: loading cache $cache_file" >&6;}
2590    case $cache_file in
2591      [\\/]* | ?:[\\/]* ) . "$cache_file";;
2592      *)                      . "./$cache_file";;
2593    esac
2594  fi
2595else
2596  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
2597$as_echo "$as_me: creating cache $cache_file" >&6;}
2598  >$cache_file
2599fi
2600
2601as_fn_append ac_header_list " utime.h"
2602# Check that the precious variables saved in the cache have kept the same
2603# value.
2604ac_cache_corrupted=false
2605for ac_var in $ac_precious_vars; do
2606  eval ac_old_set=\$ac_cv_env_${ac_var}_set
2607  eval ac_new_set=\$ac_env_${ac_var}_set
2608  eval ac_old_val=\$ac_cv_env_${ac_var}_value
2609  eval ac_new_val=\$ac_env_${ac_var}_value
2610  case $ac_old_set,$ac_new_set in
2611    set,)
2612      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
2613$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
2614      ac_cache_corrupted=: ;;
2615    ,set)
2616      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
2617$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
2618      ac_cache_corrupted=: ;;
2619    ,);;
2620    *)
2621      if test "x$ac_old_val" != "x$ac_new_val"; then
2622	# differences in whitespace do not lead to failure.
2623	ac_old_val_w=`echo x $ac_old_val`
2624	ac_new_val_w=`echo x $ac_new_val`
2625	if test "$ac_old_val_w" != "$ac_new_val_w"; then
2626	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
2627$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
2628	  ac_cache_corrupted=:
2629	else
2630	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
2631$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
2632	  eval $ac_var=\$ac_old_val
2633	fi
2634	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
2635$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
2636	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
2637$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
2638      fi;;
2639  esac
2640  # Pass precious variables to config.status.
2641  if test "$ac_new_set" = set; then
2642    case $ac_new_val in
2643    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
2644    *) ac_arg=$ac_var=$ac_new_val ;;
2645    esac
2646    case " $ac_configure_args " in
2647      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
2648      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
2649    esac
2650  fi
2651done
2652if $ac_cache_corrupted; then
2653  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
2654$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
2655  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
2656$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
2657  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
2658fi
2659## -------------------- ##
2660## Main body of script. ##
2661## -------------------- ##
2662
2663ac_ext=c
2664ac_cpp='$CPP $CPPFLAGS'
2665ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2666ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2667ac_compiler_gnu=$ac_cv_c_compiler_gnu
2668
2669
2670
2671
2672
2673unset TAG
2674lcase () {
2675      tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
2676}
2677ucase () {
2678      tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
2679}
2680
2681#current software version, typically three sets of numbers (x.y.z).
2682#can have an added tag, giving a version such as x.y.z-tag.
2683version=1.4.3
2684#TAG="foo"
2685
2686#NOTE: rpm will not accept '-' chars i version numbers
2687unset lcTAG
2688if test x"$TAG" != x; then
2689   lctag=`echo $TAG | lcase`
2690fi
2691RPMVERSION1="$version"
2692#set this to enable prerelease, changes some defaults (debug enabled)
2693#prerelease="1"
2694if test x"$prerelease" != x; then
2695    prename="pre$prerelease"
2696    version="${version}${TAG:+-}$TAG-$prename"
2697    RPMVERSION2="$lctag${lctag:+.}0.$prename"
2698    TOPEXTRADIST="${TOPEXTRADIST} PRERELEASE"
2699else
2700    version="${version}${TAG:+-}$TAG"
2701    RPMVERSION2="$lctag${lctag:+.}1"
2702fi
2703
2704
2705
2706
2707unset initCC initCPP initCFLAGS initCPPFLAGS initLDFLAGS initLIBS
2708if test x"$CC" != x; then
2709    initCC="($CC)"
2710fi
2711if test x"$CPP" != x; then
2712    initCPP="($CPP)"
2713fi
2714if test x"$CFLAGS" != x; then
2715    initCFLAGS="($CFLAGS)"
2716fi
2717if test x"$CPPFLAGS" != x; then
2718    initCPPFLAGS="($CPPFLAGS)"
2719fi
2720if test x"$LDFLAGS" != x; then
2721    initLDFLAGS="($LDFLAGS)"
2722fi
2723if test x"$LIBS" != x; then
2724    initLIBS="($LIBS)"
2725fi
2726
2727APP=dante
2728UCAPP=Dante
2729SERVNAME=sockd
2730echo "Configuring $UCAPP ${version}:"
2731
2732case $host in
2733    *-*-darwin*)
2734	#XXX problem with -MD and -arch values
2735	enable_dependency_tracking=no
2736	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling dependency tracking on this platform" >&5
2737$as_echo "$as_me: WARNING: disabling dependency tracking on this platform" >&2;}
2738	;;
2739esac
2740
2741am__api_version='1.13'
2742
2743ac_aux_dir=
2744for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
2745  if test -f "$ac_dir/install-sh"; then
2746    ac_aux_dir=$ac_dir
2747    ac_install_sh="$ac_aux_dir/install-sh -c"
2748    break
2749  elif test -f "$ac_dir/install.sh"; then
2750    ac_aux_dir=$ac_dir
2751    ac_install_sh="$ac_aux_dir/install.sh -c"
2752    break
2753  elif test -f "$ac_dir/shtool"; then
2754    ac_aux_dir=$ac_dir
2755    ac_install_sh="$ac_aux_dir/shtool install -c"
2756    break
2757  fi
2758done
2759if test -z "$ac_aux_dir"; then
2760  as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
2761fi
2762
2763# These three variables are undocumented and unsupported,
2764# and are intended to be withdrawn in a future Autoconf release.
2765# They can cause serious problems if a builder's source tree is in a directory
2766# whose full name contains unusual characters.
2767ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
2768ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
2769ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
2770
2771
2772# Find a good install program.  We prefer a C program (faster),
2773# so one script is as good as another.  But avoid the broken or
2774# incompatible versions:
2775# SysV /etc/install, /usr/sbin/install
2776# SunOS /usr/etc/install
2777# IRIX /sbin/install
2778# AIX /bin/install
2779# AmigaOS /C/install, which installs bootblocks on floppy discs
2780# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2781# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2782# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2783# OS/2's system install, which has a completely different semantic
2784# ./install, which can be erroneously created by make from ./install.sh.
2785# Reject install programs that cannot install multiple files.
2786{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
2787$as_echo_n "checking for a BSD-compatible install... " >&6; }
2788if test -z "$INSTALL"; then
2789if ${ac_cv_path_install+:} false; then :
2790  $as_echo_n "(cached) " >&6
2791else
2792  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2793for as_dir in $PATH
2794do
2795  IFS=$as_save_IFS
2796  test -z "$as_dir" && as_dir=.
2797    # Account for people who put trailing slashes in PATH elements.
2798case $as_dir/ in #((
2799  ./ | .// | /[cC]/* | \
2800  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
2801  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
2802  /usr/ucb/* ) ;;
2803  *)
2804    # OSF1 and SCO ODT 3.0 have their own names for install.
2805    # Don't use installbsd from OSF since it installs stuff as root
2806    # by default.
2807    for ac_prog in ginstall scoinst install; do
2808      for ac_exec_ext in '' $ac_executable_extensions; do
2809	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
2810	  if test $ac_prog = install &&
2811	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2812	    # AIX install.  It has an incompatible calling convention.
2813	    :
2814	  elif test $ac_prog = install &&
2815	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
2816	    # program-specific install script used by HP pwplus--don't use.
2817	    :
2818	  else
2819	    rm -rf conftest.one conftest.two conftest.dir
2820	    echo one > conftest.one
2821	    echo two > conftest.two
2822	    mkdir conftest.dir
2823	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
2824	      test -s conftest.one && test -s conftest.two &&
2825	      test -s conftest.dir/conftest.one &&
2826	      test -s conftest.dir/conftest.two
2827	    then
2828	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
2829	      break 3
2830	    fi
2831	  fi
2832	fi
2833      done
2834    done
2835    ;;
2836esac
2837
2838  done
2839IFS=$as_save_IFS
2840
2841rm -rf conftest.one conftest.two conftest.dir
2842
2843fi
2844  if test "${ac_cv_path_install+set}" = set; then
2845    INSTALL=$ac_cv_path_install
2846  else
2847    # As a last resort, use the slow shell script.  Don't cache a
2848    # value for INSTALL within a source directory, because that will
2849    # break other packages using the cache if that directory is
2850    # removed, or if the value is a relative name.
2851    INSTALL=$ac_install_sh
2852  fi
2853fi
2854{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
2855$as_echo "$INSTALL" >&6; }
2856
2857# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2858# It thinks the first close brace ends the variable substitution.
2859test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2860
2861test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2862
2863test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2864
2865{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
2866$as_echo_n "checking whether build environment is sane... " >&6; }
2867# Reject unsafe characters in $srcdir or the absolute working directory
2868# name.  Accept space and tab only in the latter.
2869am_lf='
2870'
2871case `pwd` in
2872  *[\\\"\#\$\&\'\`$am_lf]*)
2873    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
2874esac
2875case $srcdir in
2876  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
2877    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
2878esac
2879
2880# Do 'set' in a subshell so we don't clobber the current shell's
2881# arguments.  Must try -L first in case configure is actually a
2882# symlink; some systems play weird games with the mod time of symlinks
2883# (eg FreeBSD returns the mod time of the symlink's containing
2884# directory).
2885if (
2886   am_has_slept=no
2887   for am_try in 1 2; do
2888     echo "timestamp, slept: $am_has_slept" > conftest.file
2889     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
2890     if test "$*" = "X"; then
2891	# -L didn't work.
2892	set X `ls -t "$srcdir/configure" conftest.file`
2893     fi
2894     if test "$*" != "X $srcdir/configure conftest.file" \
2895	&& test "$*" != "X conftest.file $srcdir/configure"; then
2896
2897	# If neither matched, then we have a broken ls.  This can happen
2898	# if, for instance, CONFIG_SHELL is bash and it inherits a
2899	# broken ls alias from the environment.  This has actually
2900	# happened.  Such a system could not be considered "sane".
2901	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
2902  alias in your environment" "$LINENO" 5
2903     fi
2904     if test "$2" = conftest.file || test $am_try -eq 2; then
2905       break
2906     fi
2907     # Just in case.
2908     sleep 1
2909     am_has_slept=yes
2910   done
2911   test "$2" = conftest.file
2912   )
2913then
2914   # Ok.
2915   :
2916else
2917   as_fn_error $? "newly created file is older than distributed files!
2918Check your system clock" "$LINENO" 5
2919fi
2920{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
2921$as_echo "yes" >&6; }
2922# If we didn't sleep, we still need to ensure time stamps of config.status and
2923# generated files are strictly newer.
2924am_sleep_pid=
2925if grep 'slept: no' conftest.file >/dev/null 2>&1; then
2926  ( sleep 1 ) &
2927  am_sleep_pid=$!
2928fi
2929
2930rm -f conftest.file
2931
2932test "$program_prefix" != NONE &&
2933  program_transform_name="s&^&$program_prefix&;$program_transform_name"
2934# Use a double $ so make ignores it.
2935test "$program_suffix" != NONE &&
2936  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
2937# Double any \ or $.
2938# By default was `s,x,x', remove it if useless.
2939ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2940program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2941
2942# expand $ac_aux_dir to an absolute path
2943am_aux_dir=`cd $ac_aux_dir && pwd`
2944
2945if test x"${MISSING+set}" != xset; then
2946  case $am_aux_dir in
2947  *\ * | *\	*)
2948    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
2949  *)
2950    MISSING="\${SHELL} $am_aux_dir/missing" ;;
2951  esac
2952fi
2953# Use eval to expand $SHELL
2954if eval "$MISSING --is-lightweight"; then
2955  am_missing_run="$MISSING "
2956else
2957  am_missing_run=
2958  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
2959$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
2960fi
2961
2962if test x"${install_sh}" != xset; then
2963  case $am_aux_dir in
2964  *\ * | *\	*)
2965    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
2966  *)
2967    install_sh="\${SHELL} $am_aux_dir/install-sh"
2968  esac
2969fi
2970
2971# Installed binaries are usually stripped using 'strip' when the user
2972# run "make install-strip".  However 'strip' might not be the right
2973# tool to use in cross-compilation environments, therefore Automake
2974# will honor the 'STRIP' environment variable to overrule this program.
2975if test "$cross_compiling" != no; then
2976  if test -n "$ac_tool_prefix"; then
2977  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
2978set dummy ${ac_tool_prefix}strip; ac_word=$2
2979{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
2980$as_echo_n "checking for $ac_word... " >&6; }
2981if ${ac_cv_prog_STRIP+:} false; then :
2982  $as_echo_n "(cached) " >&6
2983else
2984  if test -n "$STRIP"; then
2985  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
2986else
2987as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2988for as_dir in $PATH
2989do
2990  IFS=$as_save_IFS
2991  test -z "$as_dir" && as_dir=.
2992    for ac_exec_ext in '' $ac_executable_extensions; do
2993  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2994    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
2995    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
2996    break 2
2997  fi
2998done
2999  done
3000IFS=$as_save_IFS
3001
3002fi
3003fi
3004STRIP=$ac_cv_prog_STRIP
3005if test -n "$STRIP"; then
3006  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
3007$as_echo "$STRIP" >&6; }
3008else
3009  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3010$as_echo "no" >&6; }
3011fi
3012
3013
3014fi
3015if test -z "$ac_cv_prog_STRIP"; then
3016  ac_ct_STRIP=$STRIP
3017  # Extract the first word of "strip", so it can be a program name with args.
3018set dummy strip; ac_word=$2
3019{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3020$as_echo_n "checking for $ac_word... " >&6; }
3021if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
3022  $as_echo_n "(cached) " >&6
3023else
3024  if test -n "$ac_ct_STRIP"; then
3025  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
3026else
3027as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3028for as_dir in $PATH
3029do
3030  IFS=$as_save_IFS
3031  test -z "$as_dir" && as_dir=.
3032    for ac_exec_ext in '' $ac_executable_extensions; do
3033  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3034    ac_cv_prog_ac_ct_STRIP="strip"
3035    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3036    break 2
3037  fi
3038done
3039  done
3040IFS=$as_save_IFS
3041
3042fi
3043fi
3044ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
3045if test -n "$ac_ct_STRIP"; then
3046  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
3047$as_echo "$ac_ct_STRIP" >&6; }
3048else
3049  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3050$as_echo "no" >&6; }
3051fi
3052
3053  if test "x$ac_ct_STRIP" = x; then
3054    STRIP=":"
3055  else
3056    case $cross_compiling:$ac_tool_warned in
3057yes:)
3058{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3059$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3060ac_tool_warned=yes ;;
3061esac
3062    STRIP=$ac_ct_STRIP
3063  fi
3064else
3065  STRIP="$ac_cv_prog_STRIP"
3066fi
3067
3068fi
3069INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
3070
3071{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
3072$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
3073if test -z "$MKDIR_P"; then
3074  if ${ac_cv_path_mkdir+:} false; then :
3075  $as_echo_n "(cached) " >&6
3076else
3077  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3078for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
3079do
3080  IFS=$as_save_IFS
3081  test -z "$as_dir" && as_dir=.
3082    for ac_prog in mkdir gmkdir; do
3083	 for ac_exec_ext in '' $ac_executable_extensions; do
3084	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
3085	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
3086	     'mkdir (GNU coreutils) '* | \
3087	     'mkdir (coreutils) '* | \
3088	     'mkdir (fileutils) '4.1*)
3089	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
3090	       break 3;;
3091	   esac
3092	 done
3093       done
3094  done
3095IFS=$as_save_IFS
3096
3097fi
3098
3099  test -d ./--version && rmdir ./--version
3100  if test "${ac_cv_path_mkdir+set}" = set; then
3101    MKDIR_P="$ac_cv_path_mkdir -p"
3102  else
3103    # As a last resort, use the slow shell script.  Don't cache a
3104    # value for MKDIR_P within a source directory, because that will
3105    # break other packages using the cache if that directory is
3106    # removed, or if the value is a relative name.
3107    MKDIR_P="$ac_install_sh -d"
3108  fi
3109fi
3110{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
3111$as_echo "$MKDIR_P" >&6; }
3112
3113for ac_prog in gawk mawk nawk awk
3114do
3115  # Extract the first word of "$ac_prog", so it can be a program name with args.
3116set dummy $ac_prog; ac_word=$2
3117{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3118$as_echo_n "checking for $ac_word... " >&6; }
3119if ${ac_cv_prog_AWK+:} false; then :
3120  $as_echo_n "(cached) " >&6
3121else
3122  if test -n "$AWK"; then
3123  ac_cv_prog_AWK="$AWK" # Let the user override the test.
3124else
3125as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3126for as_dir in $PATH
3127do
3128  IFS=$as_save_IFS
3129  test -z "$as_dir" && as_dir=.
3130    for ac_exec_ext in '' $ac_executable_extensions; do
3131  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3132    ac_cv_prog_AWK="$ac_prog"
3133    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3134    break 2
3135  fi
3136done
3137  done
3138IFS=$as_save_IFS
3139
3140fi
3141fi
3142AWK=$ac_cv_prog_AWK
3143if test -n "$AWK"; then
3144  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
3145$as_echo "$AWK" >&6; }
3146else
3147  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3148$as_echo "no" >&6; }
3149fi
3150
3151
3152  test -n "$AWK" && break
3153done
3154
3155{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
3156$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
3157set x ${MAKE-make}
3158ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
3159if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
3160  $as_echo_n "(cached) " >&6
3161else
3162  cat >conftest.make <<\_ACEOF
3163SHELL = /bin/sh
3164all:
3165	@echo '@@@%%%=$(MAKE)=@@@%%%'
3166_ACEOF
3167# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
3168case `${MAKE-make} -f conftest.make 2>/dev/null` in
3169  *@@@%%%=?*=@@@%%%*)
3170    eval ac_cv_prog_make_${ac_make}_set=yes;;
3171  *)
3172    eval ac_cv_prog_make_${ac_make}_set=no;;
3173esac
3174rm -f conftest.make
3175fi
3176if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
3177  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3178$as_echo "yes" >&6; }
3179  SET_MAKE=
3180else
3181  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3182$as_echo "no" >&6; }
3183  SET_MAKE="MAKE=${MAKE-make}"
3184fi
3185
3186rm -rf .tst 2>/dev/null
3187mkdir .tst 2>/dev/null
3188if test -d .tst; then
3189  am__leading_dot=.
3190else
3191  am__leading_dot=_
3192fi
3193rmdir .tst 2>/dev/null
3194
3195# Check whether --enable-silent-rules was given.
3196if test "${enable_silent_rules+set}" = set; then :
3197  enableval=$enable_silent_rules;
3198fi
3199
3200case $enable_silent_rules in # (((
3201  yes) AM_DEFAULT_VERBOSITY=0;;
3202   no) AM_DEFAULT_VERBOSITY=1;;
3203    *) AM_DEFAULT_VERBOSITY=1;;
3204esac
3205am_make=${MAKE-make}
3206{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
3207$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
3208if ${am_cv_make_support_nested_variables+:} false; then :
3209  $as_echo_n "(cached) " >&6
3210else
3211  if $as_echo 'TRUE=$(BAR$(V))
3212BAR0=false
3213BAR1=true
3214V=1
3215am__doit:
3216	@$(TRUE)
3217.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
3218  am_cv_make_support_nested_variables=yes
3219else
3220  am_cv_make_support_nested_variables=no
3221fi
3222fi
3223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
3224$as_echo "$am_cv_make_support_nested_variables" >&6; }
3225if test $am_cv_make_support_nested_variables = yes; then
3226    AM_V='$(V)'
3227  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
3228else
3229  AM_V=$AM_DEFAULT_VERBOSITY
3230  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
3231fi
3232AM_BACKSLASH='\'
3233
3234if test "`cd $srcdir && pwd`" != "`pwd`"; then
3235  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
3236  # is not polluted with repeated "-I."
3237  am__isrc=' -I$(srcdir)'
3238  # test to see if srcdir already configured
3239  if test -f $srcdir/config.status; then
3240    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
3241  fi
3242fi
3243
3244# test whether we have cygpath
3245if test -z "$CYGPATH_W"; then
3246  if (cygpath --version) >/dev/null 2>/dev/null; then
3247    CYGPATH_W='cygpath -w'
3248  else
3249    CYGPATH_W=echo
3250  fi
3251fi
3252
3253
3254# Define the identity of the package.
3255
3256 PACKAGE=dante
3257 VERSION=${version}
3258
3259
3260cat >>confdefs.h <<_ACEOF
3261#define PACKAGE "$PACKAGE"
3262_ACEOF
3263
3264
3265cat >>confdefs.h <<_ACEOF
3266#define VERSION "$VERSION"
3267_ACEOF
3268
3269# Some tools Automake needs.
3270
3271ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
3272
3273
3274AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
3275
3276
3277AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
3278
3279
3280AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
3281
3282
3283MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
3284
3285# For better backward compatibility.  To be removed once Automake 1.9.x
3286# dies out for good.  For more background, see:
3287# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
3288# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
3289mkdir_p='$(MKDIR_P)'
3290
3291# We need awk for the "check" target.  The system "awk" is bad on
3292# some platforms.
3293# Always define AMTAR for backward compatibility.  Yes, it's still used
3294# in the wild :-(  We should find a proper way to deprecate it ...
3295AMTAR='$${TAR-tar}'
3296
3297
3298# We'll loop over all known methods to create a tar archive until one works.
3299_am_tools='gnutar  pax cpio none'
3300
3301am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
3302
3303
3304
3305
3306
3307
3308
3309ac_config_headers="$ac_config_headers include/autoconf.h"
3310
3311
3312
3313
3314#NOTE: save CFLAGS; wish to compile without -O2 when debugging
3315oCFLAGS="$CFLAGS"
3316oLDFLAGS="$LDFLAGS"
3317unset CFLAGS
3318unset LDFLAGS
3319case `pwd` in
3320  *\ * | *\	*)
3321    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
3322$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
3323esac
3324
3325
3326
3327macro_version='2.4.2'
3328macro_revision='1.3337'
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342ltmain="$ac_aux_dir/ltmain.sh"
3343
3344# Make sure we can run config.sub.
3345$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
3346  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
3347
3348{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
3349$as_echo_n "checking build system type... " >&6; }
3350if ${ac_cv_build+:} false; then :
3351  $as_echo_n "(cached) " >&6
3352else
3353  ac_build_alias=$build_alias
3354test "x$ac_build_alias" = x &&
3355  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
3356test "x$ac_build_alias" = x &&
3357  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
3358ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
3359  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
3360
3361fi
3362{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
3363$as_echo "$ac_cv_build" >&6; }
3364case $ac_cv_build in
3365*-*-*) ;;
3366*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
3367esac
3368build=$ac_cv_build
3369ac_save_IFS=$IFS; IFS='-'
3370set x $ac_cv_build
3371shift
3372build_cpu=$1
3373build_vendor=$2
3374shift; shift
3375# Remember, the first character of IFS is used to create $*,
3376# except with old shells:
3377build_os=$*
3378IFS=$ac_save_IFS
3379case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
3380
3381
3382{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
3383$as_echo_n "checking host system type... " >&6; }
3384if ${ac_cv_host+:} false; then :
3385  $as_echo_n "(cached) " >&6
3386else
3387  if test "x$host_alias" = x; then
3388  ac_cv_host=$ac_cv_build
3389else
3390  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
3391    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
3392fi
3393
3394fi
3395{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
3396$as_echo "$ac_cv_host" >&6; }
3397case $ac_cv_host in
3398*-*-*) ;;
3399*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
3400esac
3401host=$ac_cv_host
3402ac_save_IFS=$IFS; IFS='-'
3403set x $ac_cv_host
3404shift
3405host_cpu=$1
3406host_vendor=$2
3407shift; shift
3408# Remember, the first character of IFS is used to create $*,
3409# except with old shells:
3410host_os=$*
3411IFS=$ac_save_IFS
3412case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
3413
3414
3415# Backslashify metacharacters that are still active within
3416# double-quoted strings.
3417sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
3418
3419# Same as above, but do not quote variable references.
3420double_quote_subst='s/\(["`\\]\)/\\\1/g'
3421
3422# Sed substitution to delay expansion of an escaped shell variable in a
3423# double_quote_subst'ed string.
3424delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
3425
3426# Sed substitution to delay expansion of an escaped single quote.
3427delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
3428
3429# Sed substitution to avoid accidental globbing in evaled expressions
3430no_glob_subst='s/\*/\\\*/g'
3431
3432ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
3433ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
3434ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
3435
3436{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
3437$as_echo_n "checking how to print strings... " >&6; }
3438# Test print first, because it will be a builtin if present.
3439if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
3440   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
3441  ECHO='print -r --'
3442elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
3443  ECHO='printf %s\n'
3444else
3445  # Use this function as a fallback that always works.
3446  func_fallback_echo ()
3447  {
3448    eval 'cat <<_LTECHO_EOF
3449$1
3450_LTECHO_EOF'
3451  }
3452  ECHO='func_fallback_echo'
3453fi
3454
3455# func_echo_all arg...
3456# Invoke $ECHO with all args, space-separated.
3457func_echo_all ()
3458{
3459    $ECHO ""
3460}
3461
3462case "$ECHO" in
3463  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
3464$as_echo "printf" >&6; } ;;
3465  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
3466$as_echo "print -r" >&6; } ;;
3467  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
3468$as_echo "cat" >&6; } ;;
3469esac
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484DEPDIR="${am__leading_dot}deps"
3485
3486ac_config_commands="$ac_config_commands depfiles"
3487
3488
3489am_make=${MAKE-make}
3490cat > confinc << 'END'
3491am__doit:
3492	@echo this is the am__doit target
3493.PHONY: am__doit
3494END
3495# If we don't find an include directive, just comment out the code.
3496{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
3497$as_echo_n "checking for style of include used by $am_make... " >&6; }
3498am__include="#"
3499am__quote=
3500_am_result=none
3501# First try GNU make style include.
3502echo "include confinc" > confmf
3503# Ignore all kinds of additional output from 'make'.
3504case `$am_make -s -f confmf 2> /dev/null` in #(
3505*the\ am__doit\ target*)
3506  am__include=include
3507  am__quote=
3508  _am_result=GNU
3509  ;;
3510esac
3511# Now try BSD make style include.
3512if test "$am__include" = "#"; then
3513   echo '.include "confinc"' > confmf
3514   case `$am_make -s -f confmf 2> /dev/null` in #(
3515   *the\ am__doit\ target*)
3516     am__include=.include
3517     am__quote="\""
3518     _am_result=BSD
3519     ;;
3520   esac
3521fi
3522
3523
3524{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
3525$as_echo "$_am_result" >&6; }
3526rm -f confinc confmf
3527
3528# Check whether --enable-dependency-tracking was given.
3529if test "${enable_dependency_tracking+set}" = set; then :
3530  enableval=$enable_dependency_tracking;
3531fi
3532
3533if test "x$enable_dependency_tracking" != xno; then
3534  am_depcomp="$ac_aux_dir/depcomp"
3535  AMDEPBACKSLASH='\'
3536  am__nodep='_no'
3537fi
3538 if test "x$enable_dependency_tracking" != xno; then
3539  AMDEP_TRUE=
3540  AMDEP_FALSE='#'
3541else
3542  AMDEP_TRUE='#'
3543  AMDEP_FALSE=
3544fi
3545
3546
3547ac_ext=c
3548ac_cpp='$CPP $CPPFLAGS'
3549ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3550ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3551ac_compiler_gnu=$ac_cv_c_compiler_gnu
3552if test -n "$ac_tool_prefix"; then
3553  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
3554set dummy ${ac_tool_prefix}gcc; ac_word=$2
3555{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3556$as_echo_n "checking for $ac_word... " >&6; }
3557if ${ac_cv_prog_CC+:} false; then :
3558  $as_echo_n "(cached) " >&6
3559else
3560  if test -n "$CC"; then
3561  ac_cv_prog_CC="$CC" # Let the user override the test.
3562else
3563as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3564for as_dir in $PATH
3565do
3566  IFS=$as_save_IFS
3567  test -z "$as_dir" && as_dir=.
3568    for ac_exec_ext in '' $ac_executable_extensions; do
3569  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3570    ac_cv_prog_CC="${ac_tool_prefix}gcc"
3571    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3572    break 2
3573  fi
3574done
3575  done
3576IFS=$as_save_IFS
3577
3578fi
3579fi
3580CC=$ac_cv_prog_CC
3581if test -n "$CC"; then
3582  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3583$as_echo "$CC" >&6; }
3584else
3585  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3586$as_echo "no" >&6; }
3587fi
3588
3589
3590fi
3591if test -z "$ac_cv_prog_CC"; then
3592  ac_ct_CC=$CC
3593  # Extract the first word of "gcc", so it can be a program name with args.
3594set dummy gcc; ac_word=$2
3595{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3596$as_echo_n "checking for $ac_word... " >&6; }
3597if ${ac_cv_prog_ac_ct_CC+:} false; then :
3598  $as_echo_n "(cached) " >&6
3599else
3600  if test -n "$ac_ct_CC"; then
3601  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3602else
3603as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3604for as_dir in $PATH
3605do
3606  IFS=$as_save_IFS
3607  test -z "$as_dir" && as_dir=.
3608    for ac_exec_ext in '' $ac_executable_extensions; do
3609  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3610    ac_cv_prog_ac_ct_CC="gcc"
3611    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3612    break 2
3613  fi
3614done
3615  done
3616IFS=$as_save_IFS
3617
3618fi
3619fi
3620ac_ct_CC=$ac_cv_prog_ac_ct_CC
3621if test -n "$ac_ct_CC"; then
3622  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3623$as_echo "$ac_ct_CC" >&6; }
3624else
3625  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3626$as_echo "no" >&6; }
3627fi
3628
3629  if test "x$ac_ct_CC" = x; then
3630    CC=""
3631  else
3632    case $cross_compiling:$ac_tool_warned in
3633yes:)
3634{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3635$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3636ac_tool_warned=yes ;;
3637esac
3638    CC=$ac_ct_CC
3639  fi
3640else
3641  CC="$ac_cv_prog_CC"
3642fi
3643
3644if test -z "$CC"; then
3645          if test -n "$ac_tool_prefix"; then
3646    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
3647set dummy ${ac_tool_prefix}cc; ac_word=$2
3648{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3649$as_echo_n "checking for $ac_word... " >&6; }
3650if ${ac_cv_prog_CC+:} false; then :
3651  $as_echo_n "(cached) " >&6
3652else
3653  if test -n "$CC"; then
3654  ac_cv_prog_CC="$CC" # Let the user override the test.
3655else
3656as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3657for as_dir in $PATH
3658do
3659  IFS=$as_save_IFS
3660  test -z "$as_dir" && as_dir=.
3661    for ac_exec_ext in '' $ac_executable_extensions; do
3662  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3663    ac_cv_prog_CC="${ac_tool_prefix}cc"
3664    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3665    break 2
3666  fi
3667done
3668  done
3669IFS=$as_save_IFS
3670
3671fi
3672fi
3673CC=$ac_cv_prog_CC
3674if test -n "$CC"; then
3675  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3676$as_echo "$CC" >&6; }
3677else
3678  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3679$as_echo "no" >&6; }
3680fi
3681
3682
3683  fi
3684fi
3685if test -z "$CC"; then
3686  # Extract the first word of "cc", so it can be a program name with args.
3687set dummy cc; ac_word=$2
3688{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3689$as_echo_n "checking for $ac_word... " >&6; }
3690if ${ac_cv_prog_CC+:} false; then :
3691  $as_echo_n "(cached) " >&6
3692else
3693  if test -n "$CC"; then
3694  ac_cv_prog_CC="$CC" # Let the user override the test.
3695else
3696  ac_prog_rejected=no
3697as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3698for as_dir in $PATH
3699do
3700  IFS=$as_save_IFS
3701  test -z "$as_dir" && as_dir=.
3702    for ac_exec_ext in '' $ac_executable_extensions; do
3703  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3704    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
3705       ac_prog_rejected=yes
3706       continue
3707     fi
3708    ac_cv_prog_CC="cc"
3709    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3710    break 2
3711  fi
3712done
3713  done
3714IFS=$as_save_IFS
3715
3716if test $ac_prog_rejected = yes; then
3717  # We found a bogon in the path, so make sure we never use it.
3718  set dummy $ac_cv_prog_CC
3719  shift
3720  if test $# != 0; then
3721    # We chose a different compiler from the bogus one.
3722    # However, it has the same basename, so the bogon will be chosen
3723    # first if we set CC to just the basename; use the full file name.
3724    shift
3725    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
3726  fi
3727fi
3728fi
3729fi
3730CC=$ac_cv_prog_CC
3731if test -n "$CC"; then
3732  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3733$as_echo "$CC" >&6; }
3734else
3735  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3736$as_echo "no" >&6; }
3737fi
3738
3739
3740fi
3741if test -z "$CC"; then
3742  if test -n "$ac_tool_prefix"; then
3743  for ac_prog in cl.exe
3744  do
3745    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
3746set dummy $ac_tool_prefix$ac_prog; ac_word=$2
3747{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3748$as_echo_n "checking for $ac_word... " >&6; }
3749if ${ac_cv_prog_CC+:} false; then :
3750  $as_echo_n "(cached) " >&6
3751else
3752  if test -n "$CC"; then
3753  ac_cv_prog_CC="$CC" # Let the user override the test.
3754else
3755as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3756for as_dir in $PATH
3757do
3758  IFS=$as_save_IFS
3759  test -z "$as_dir" && as_dir=.
3760    for ac_exec_ext in '' $ac_executable_extensions; do
3761  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3762    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
3763    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3764    break 2
3765  fi
3766done
3767  done
3768IFS=$as_save_IFS
3769
3770fi
3771fi
3772CC=$ac_cv_prog_CC
3773if test -n "$CC"; then
3774  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
3775$as_echo "$CC" >&6; }
3776else
3777  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3778$as_echo "no" >&6; }
3779fi
3780
3781
3782    test -n "$CC" && break
3783  done
3784fi
3785if test -z "$CC"; then
3786  ac_ct_CC=$CC
3787  for ac_prog in cl.exe
3788do
3789  # Extract the first word of "$ac_prog", so it can be a program name with args.
3790set dummy $ac_prog; ac_word=$2
3791{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3792$as_echo_n "checking for $ac_word... " >&6; }
3793if ${ac_cv_prog_ac_ct_CC+:} false; then :
3794  $as_echo_n "(cached) " >&6
3795else
3796  if test -n "$ac_ct_CC"; then
3797  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
3798else
3799as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3800for as_dir in $PATH
3801do
3802  IFS=$as_save_IFS
3803  test -z "$as_dir" && as_dir=.
3804    for ac_exec_ext in '' $ac_executable_extensions; do
3805  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3806    ac_cv_prog_ac_ct_CC="$ac_prog"
3807    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
3808    break 2
3809  fi
3810done
3811  done
3812IFS=$as_save_IFS
3813
3814fi
3815fi
3816ac_ct_CC=$ac_cv_prog_ac_ct_CC
3817if test -n "$ac_ct_CC"; then
3818  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
3819$as_echo "$ac_ct_CC" >&6; }
3820else
3821  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3822$as_echo "no" >&6; }
3823fi
3824
3825
3826  test -n "$ac_ct_CC" && break
3827done
3828
3829  if test "x$ac_ct_CC" = x; then
3830    CC=""
3831  else
3832    case $cross_compiling:$ac_tool_warned in
3833yes:)
3834{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
3835$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
3836ac_tool_warned=yes ;;
3837esac
3838    CC=$ac_ct_CC
3839  fi
3840fi
3841
3842fi
3843
3844
3845test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3846$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3847as_fn_error $? "no acceptable C compiler found in \$PATH
3848See \`config.log' for more details" "$LINENO" 5; }
3849
3850# Provide some information about the compiler.
3851$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
3852set X $ac_compile
3853ac_compiler=$2
3854for ac_option in --version -v -V -qversion; do
3855  { { ac_try="$ac_compiler $ac_option >&5"
3856case "(($ac_try" in
3857  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3858  *) ac_try_echo=$ac_try;;
3859esac
3860eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3861$as_echo "$ac_try_echo"; } >&5
3862  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
3863  ac_status=$?
3864  if test -s conftest.err; then
3865    sed '10a\
3866... rest of stderr output deleted ...
3867         10q' conftest.err >conftest.er1
3868    cat conftest.er1 >&5
3869  fi
3870  rm -f conftest.er1 conftest.err
3871  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3872  test $ac_status = 0; }
3873done
3874
3875cat confdefs.h - <<_ACEOF >conftest.$ac_ext
3876/* end confdefs.h.  */
3877
3878int
3879main ()
3880{
3881
3882  ;
3883  return 0;
3884}
3885_ACEOF
3886ac_clean_files_save=$ac_clean_files
3887ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
3888# Try to create an executable without -o first, disregard a.out.
3889# It will help us diagnose broken compilers, and finding out an intuition
3890# of exeext.
3891{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
3892$as_echo_n "checking whether the C compiler works... " >&6; }
3893ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
3894
3895# The possible output files:
3896ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
3897
3898ac_rmfiles=
3899for ac_file in $ac_files
3900do
3901  case $ac_file in
3902    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3903    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
3904  esac
3905done
3906rm -f $ac_rmfiles
3907
3908if { { ac_try="$ac_link_default"
3909case "(($ac_try" in
3910  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3911  *) ac_try_echo=$ac_try;;
3912esac
3913eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3914$as_echo "$ac_try_echo"; } >&5
3915  (eval "$ac_link_default") 2>&5
3916  ac_status=$?
3917  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3918  test $ac_status = 0; }; then :
3919  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
3920# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
3921# in a Makefile.  We should not override ac_cv_exeext if it was cached,
3922# so that the user can short-circuit this test for compilers unknown to
3923# Autoconf.
3924for ac_file in $ac_files ''
3925do
3926  test -f "$ac_file" || continue
3927  case $ac_file in
3928    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
3929	;;
3930    [ab].out )
3931	# We found the default executable, but exeext='' is most
3932	# certainly right.
3933	break;;
3934    *.* )
3935	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
3936	then :; else
3937	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3938	fi
3939	# We set ac_cv_exeext here because the later test for it is not
3940	# safe: cross compilers may not add the suffix if given an `-o'
3941	# argument, so we may need to know it at that point already.
3942	# Even if this section looks crufty: it has the advantage of
3943	# actually working.
3944	break;;
3945    * )
3946	break;;
3947  esac
3948done
3949test "$ac_cv_exeext" = no && ac_cv_exeext=
3950
3951else
3952  ac_file=''
3953fi
3954if test -z "$ac_file"; then :
3955  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
3956$as_echo "no" >&6; }
3957$as_echo "$as_me: failed program was:" >&5
3958sed 's/^/| /' conftest.$ac_ext >&5
3959
3960{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
3961$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
3962as_fn_error 77 "C compiler cannot create executables
3963See \`config.log' for more details" "$LINENO" 5; }
3964else
3965  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
3966$as_echo "yes" >&6; }
3967fi
3968{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
3969$as_echo_n "checking for C compiler default output file name... " >&6; }
3970{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
3971$as_echo "$ac_file" >&6; }
3972ac_exeext=$ac_cv_exeext
3973
3974rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
3975ac_clean_files=$ac_clean_files_save
3976{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
3977$as_echo_n "checking for suffix of executables... " >&6; }
3978if { { ac_try="$ac_link"
3979case "(($ac_try" in
3980  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
3981  *) ac_try_echo=$ac_try;;
3982esac
3983eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
3984$as_echo "$ac_try_echo"; } >&5
3985  (eval "$ac_link") 2>&5
3986  ac_status=$?
3987  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
3988  test $ac_status = 0; }; then :
3989  # If both `conftest.exe' and `conftest' are `present' (well, observable)
3990# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
3991# work properly (i.e., refer to `conftest.exe'), while it won't with
3992# `rm'.
3993for ac_file in conftest.exe conftest conftest.*; do
3994  test -f "$ac_file" || continue
3995  case $ac_file in
3996    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
3997    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
3998	  break;;
3999    * ) break;;
4000  esac
4001done
4002else
4003  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4004$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4005as_fn_error $? "cannot compute suffix of executables: cannot compile and link
4006See \`config.log' for more details" "$LINENO" 5; }
4007fi
4008rm -f conftest conftest$ac_cv_exeext
4009{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
4010$as_echo "$ac_cv_exeext" >&6; }
4011
4012rm -f conftest.$ac_ext
4013EXEEXT=$ac_cv_exeext
4014ac_exeext=$EXEEXT
4015cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4016/* end confdefs.h.  */
4017#include <stdio.h>
4018int
4019main ()
4020{
4021FILE *f = fopen ("conftest.out", "w");
4022 return ferror (f) || fclose (f) != 0;
4023
4024  ;
4025  return 0;
4026}
4027_ACEOF
4028ac_clean_files="$ac_clean_files conftest.out"
4029# Check that the compiler produces executables we can run.  If not, either
4030# the compiler is broken, or we cross compile.
4031{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
4032$as_echo_n "checking whether we are cross compiling... " >&6; }
4033if test "$cross_compiling" != yes; then
4034  { { ac_try="$ac_link"
4035case "(($ac_try" in
4036  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4037  *) ac_try_echo=$ac_try;;
4038esac
4039eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4040$as_echo "$ac_try_echo"; } >&5
4041  (eval "$ac_link") 2>&5
4042  ac_status=$?
4043  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4044  test $ac_status = 0; }
4045  if { ac_try='./conftest$ac_cv_exeext'
4046  { { case "(($ac_try" in
4047  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4048  *) ac_try_echo=$ac_try;;
4049esac
4050eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4051$as_echo "$ac_try_echo"; } >&5
4052  (eval "$ac_try") 2>&5
4053  ac_status=$?
4054  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4055  test $ac_status = 0; }; }; then
4056    cross_compiling=no
4057  else
4058    if test "$cross_compiling" = maybe; then
4059	cross_compiling=yes
4060    else
4061	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4062$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4063as_fn_error $? "cannot run C compiled programs.
4064If you meant to cross compile, use \`--host'.
4065See \`config.log' for more details" "$LINENO" 5; }
4066    fi
4067  fi
4068fi
4069{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
4070$as_echo "$cross_compiling" >&6; }
4071
4072rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
4073ac_clean_files=$ac_clean_files_save
4074{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
4075$as_echo_n "checking for suffix of object files... " >&6; }
4076if ${ac_cv_objext+:} false; then :
4077  $as_echo_n "(cached) " >&6
4078else
4079  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4080/* end confdefs.h.  */
4081
4082int
4083main ()
4084{
4085
4086  ;
4087  return 0;
4088}
4089_ACEOF
4090rm -f conftest.o conftest.obj
4091if { { ac_try="$ac_compile"
4092case "(($ac_try" in
4093  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
4094  *) ac_try_echo=$ac_try;;
4095esac
4096eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
4097$as_echo "$ac_try_echo"; } >&5
4098  (eval "$ac_compile") 2>&5
4099  ac_status=$?
4100  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
4101  test $ac_status = 0; }; then :
4102  for ac_file in conftest.o conftest.obj conftest.*; do
4103  test -f "$ac_file" || continue;
4104  case $ac_file in
4105    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
4106    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
4107       break;;
4108  esac
4109done
4110else
4111  $as_echo "$as_me: failed program was:" >&5
4112sed 's/^/| /' conftest.$ac_ext >&5
4113
4114{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
4115$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
4116as_fn_error $? "cannot compute suffix of object files: cannot compile
4117See \`config.log' for more details" "$LINENO" 5; }
4118fi
4119rm -f conftest.$ac_cv_objext conftest.$ac_ext
4120fi
4121{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
4122$as_echo "$ac_cv_objext" >&6; }
4123OBJEXT=$ac_cv_objext
4124ac_objext=$OBJEXT
4125{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
4126$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
4127if ${ac_cv_c_compiler_gnu+:} false; then :
4128  $as_echo_n "(cached) " >&6
4129else
4130  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4131/* end confdefs.h.  */
4132
4133int
4134main ()
4135{
4136#ifndef __GNUC__
4137       choke me
4138#endif
4139
4140  ;
4141  return 0;
4142}
4143_ACEOF
4144if ac_fn_c_try_compile "$LINENO"; then :
4145  ac_compiler_gnu=yes
4146else
4147  ac_compiler_gnu=no
4148fi
4149rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4150ac_cv_c_compiler_gnu=$ac_compiler_gnu
4151
4152fi
4153{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
4154$as_echo "$ac_cv_c_compiler_gnu" >&6; }
4155if test $ac_compiler_gnu = yes; then
4156  GCC=yes
4157else
4158  GCC=
4159fi
4160ac_test_CFLAGS=${CFLAGS+set}
4161ac_save_CFLAGS=$CFLAGS
4162{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
4163$as_echo_n "checking whether $CC accepts -g... " >&6; }
4164if ${ac_cv_prog_cc_g+:} false; then :
4165  $as_echo_n "(cached) " >&6
4166else
4167  ac_save_c_werror_flag=$ac_c_werror_flag
4168   ac_c_werror_flag=yes
4169   ac_cv_prog_cc_g=no
4170   CFLAGS="-g"
4171   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4172/* end confdefs.h.  */
4173
4174int
4175main ()
4176{
4177
4178  ;
4179  return 0;
4180}
4181_ACEOF
4182if ac_fn_c_try_compile "$LINENO"; then :
4183  ac_cv_prog_cc_g=yes
4184else
4185  CFLAGS=""
4186      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4187/* end confdefs.h.  */
4188
4189int
4190main ()
4191{
4192
4193  ;
4194  return 0;
4195}
4196_ACEOF
4197if ac_fn_c_try_compile "$LINENO"; then :
4198
4199else
4200  ac_c_werror_flag=$ac_save_c_werror_flag
4201	 CFLAGS="-g"
4202	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4203/* end confdefs.h.  */
4204
4205int
4206main ()
4207{
4208
4209  ;
4210  return 0;
4211}
4212_ACEOF
4213if ac_fn_c_try_compile "$LINENO"; then :
4214  ac_cv_prog_cc_g=yes
4215fi
4216rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4217fi
4218rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4219fi
4220rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
4221   ac_c_werror_flag=$ac_save_c_werror_flag
4222fi
4223{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
4224$as_echo "$ac_cv_prog_cc_g" >&6; }
4225if test "$ac_test_CFLAGS" = set; then
4226  CFLAGS=$ac_save_CFLAGS
4227elif test $ac_cv_prog_cc_g = yes; then
4228  if test "$GCC" = yes; then
4229    CFLAGS="-g -O2"
4230  else
4231    CFLAGS="-g"
4232  fi
4233else
4234  if test "$GCC" = yes; then
4235    CFLAGS="-O2"
4236  else
4237    CFLAGS=
4238  fi
4239fi
4240{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
4241$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
4242if ${ac_cv_prog_cc_c89+:} false; then :
4243  $as_echo_n "(cached) " >&6
4244else
4245  ac_cv_prog_cc_c89=no
4246ac_save_CC=$CC
4247cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4248/* end confdefs.h.  */
4249#include <stdarg.h>
4250#include <stdio.h>
4251struct stat;
4252/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4253struct buf { int x; };
4254FILE * (*rcsopen) (struct buf *, struct stat *, int);
4255static char *e (p, i)
4256     char **p;
4257     int i;
4258{
4259  return p[i];
4260}
4261static char *f (char * (*g) (char **, int), char **p, ...)
4262{
4263  char *s;
4264  va_list v;
4265  va_start (v,p);
4266  s = g (p, va_arg (v,int));
4267  va_end (v);
4268  return s;
4269}
4270
4271/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
4272   function prototypes and stuff, but not '\xHH' hex character constants.
4273   These don't provoke an error unfortunately, instead are silently treated
4274   as 'x'.  The following induces an error, until -std is added to get
4275   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
4276   array size at least.  It's necessary to write '\x00'==0 to get something
4277   that's true only with -std.  */
4278int osf4_cc_array ['\x00' == 0 ? 1 : -1];
4279
4280/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
4281   inside strings and character constants.  */
4282#define FOO(x) 'x'
4283int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
4284
4285int test (int i, double x);
4286struct s1 {int (*f) (int a);};
4287struct s2 {int (*f) (double a);};
4288int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4289int argc;
4290char **argv;
4291int
4292main ()
4293{
4294return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4295  ;
4296  return 0;
4297}
4298_ACEOF
4299for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
4300	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4301do
4302  CC="$ac_save_CC $ac_arg"
4303  if ac_fn_c_try_compile "$LINENO"; then :
4304  ac_cv_prog_cc_c89=$ac_arg
4305fi
4306rm -f core conftest.err conftest.$ac_objext
4307  test "x$ac_cv_prog_cc_c89" != "xno" && break
4308done
4309rm -f conftest.$ac_ext
4310CC=$ac_save_CC
4311
4312fi
4313# AC_CACHE_VAL
4314case "x$ac_cv_prog_cc_c89" in
4315  x)
4316    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
4317$as_echo "none needed" >&6; } ;;
4318  xno)
4319    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
4320$as_echo "unsupported" >&6; } ;;
4321  *)
4322    CC="$CC $ac_cv_prog_cc_c89"
4323    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
4324$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
4325esac
4326if test "x$ac_cv_prog_cc_c89" != xno; then :
4327
4328fi
4329
4330ac_ext=c
4331ac_cpp='$CPP $CPPFLAGS'
4332ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
4333ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
4334ac_compiler_gnu=$ac_cv_c_compiler_gnu
4335
4336depcc="$CC"   am_compiler_list=
4337
4338{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
4339$as_echo_n "checking dependency style of $depcc... " >&6; }
4340if ${am_cv_CC_dependencies_compiler_type+:} false; then :
4341  $as_echo_n "(cached) " >&6
4342else
4343  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
4344  # We make a subdir and do the tests there.  Otherwise we can end up
4345  # making bogus files that we don't know about and never remove.  For
4346  # instance it was reported that on HP-UX the gcc test will end up
4347  # making a dummy file named 'D' -- because '-MD' means "put the output
4348  # in D".
4349  rm -rf conftest.dir
4350  mkdir conftest.dir
4351  # Copy depcomp to subdir because otherwise we won't find it if we're
4352  # using a relative directory.
4353  cp "$am_depcomp" conftest.dir
4354  cd conftest.dir
4355  # We will build objects and dependencies in a subdirectory because
4356  # it helps to detect inapplicable dependency modes.  For instance
4357  # both Tru64's cc and ICC support -MD to output dependencies as a
4358  # side effect of compilation, but ICC will put the dependencies in
4359  # the current directory while Tru64 will put them in the object
4360  # directory.
4361  mkdir sub
4362
4363  am_cv_CC_dependencies_compiler_type=none
4364  if test "$am_compiler_list" = ""; then
4365     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
4366  fi
4367  am__universal=false
4368  case " $depcc " in #(
4369     *\ -arch\ *\ -arch\ *) am__universal=true ;;
4370     esac
4371
4372  for depmode in $am_compiler_list; do
4373    # Setup a source with many dependencies, because some compilers
4374    # like to wrap large dependency lists on column 80 (with \), and
4375    # we should not choose a depcomp mode which is confused by this.
4376    #
4377    # We need to recreate these files for each test, as the compiler may
4378    # overwrite some of them when testing with obscure command lines.
4379    # This happens at least with the AIX C compiler.
4380    : > sub/conftest.c
4381    for i in 1 2 3 4 5 6; do
4382      echo '#include "conftst'$i'.h"' >> sub/conftest.c
4383      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
4384      # Solaris 10 /bin/sh.
4385      echo '/* dummy */' > sub/conftst$i.h
4386    done
4387    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
4388
4389    # We check with '-c' and '-o' for the sake of the "dashmstdout"
4390    # mode.  It turns out that the SunPro C++ compiler does not properly
4391    # handle '-M -o', and we need to detect this.  Also, some Intel
4392    # versions had trouble with output in subdirs.
4393    am__obj=sub/conftest.${OBJEXT-o}
4394    am__minus_obj="-o $am__obj"
4395    case $depmode in
4396    gcc)
4397      # This depmode causes a compiler race in universal mode.
4398      test "$am__universal" = false || continue
4399      ;;
4400    nosideeffect)
4401      # After this tag, mechanisms are not by side-effect, so they'll
4402      # only be used when explicitly requested.
4403      if test "x$enable_dependency_tracking" = xyes; then
4404	continue
4405      else
4406	break
4407      fi
4408      ;;
4409    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
4410      # This compiler won't grok '-c -o', but also, the minuso test has
4411      # not run yet.  These depmodes are late enough in the game, and
4412      # so weak that their functioning should not be impacted.
4413      am__obj=conftest.${OBJEXT-o}
4414      am__minus_obj=
4415      ;;
4416    none) break ;;
4417    esac
4418    if depmode=$depmode \
4419       source=sub/conftest.c object=$am__obj \
4420       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
4421       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
4422         >/dev/null 2>conftest.err &&
4423       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
4424       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
4425       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
4426       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
4427      # icc doesn't choke on unknown options, it will just issue warnings
4428      # or remarks (even with -Werror).  So we grep stderr for any message
4429      # that says an option was ignored or not supported.
4430      # When given -MP, icc 7.0 and 7.1 complain thusly:
4431      #   icc: Command line warning: ignoring option '-M'; no argument required
4432      # The diagnosis changed in icc 8.0:
4433      #   icc: Command line remark: option '-MP' not supported
4434      if (grep 'ignoring option' conftest.err ||
4435          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
4436        am_cv_CC_dependencies_compiler_type=$depmode
4437        break
4438      fi
4439    fi
4440  done
4441
4442  cd ..
4443  rm -rf conftest.dir
4444else
4445  am_cv_CC_dependencies_compiler_type=none
4446fi
4447
4448fi
4449{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
4450$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
4451CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
4452
4453 if
4454  test "x$enable_dependency_tracking" != xno \
4455  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
4456  am__fastdepCC_TRUE=
4457  am__fastdepCC_FALSE='#'
4458else
4459  am__fastdepCC_TRUE='#'
4460  am__fastdepCC_FALSE=
4461fi
4462
4463
4464{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
4465$as_echo_n "checking for a sed that does not truncate output... " >&6; }
4466if ${ac_cv_path_SED+:} false; then :
4467  $as_echo_n "(cached) " >&6
4468else
4469            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
4470     for ac_i in 1 2 3 4 5 6 7; do
4471       ac_script="$ac_script$as_nl$ac_script"
4472     done
4473     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
4474     { ac_script=; unset ac_script;}
4475     if test -z "$SED"; then
4476  ac_path_SED_found=false
4477  # Loop through the user's path and test for each of PROGNAME-LIST
4478  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4479for as_dir in $PATH
4480do
4481  IFS=$as_save_IFS
4482  test -z "$as_dir" && as_dir=.
4483    for ac_prog in sed gsed; do
4484    for ac_exec_ext in '' $ac_executable_extensions; do
4485      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
4486      as_fn_executable_p "$ac_path_SED" || continue
4487# Check for GNU ac_path_SED and select it if it is found.
4488  # Check for GNU $ac_path_SED
4489case `"$ac_path_SED" --version 2>&1` in
4490*GNU*)
4491  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
4492*)
4493  ac_count=0
4494  $as_echo_n 0123456789 >"conftest.in"
4495  while :
4496  do
4497    cat "conftest.in" "conftest.in" >"conftest.tmp"
4498    mv "conftest.tmp" "conftest.in"
4499    cp "conftest.in" "conftest.nl"
4500    $as_echo '' >> "conftest.nl"
4501    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
4502    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4503    as_fn_arith $ac_count + 1 && ac_count=$as_val
4504    if test $ac_count -gt ${ac_path_SED_max-0}; then
4505      # Best one so far, save it but keep looking for a better one
4506      ac_cv_path_SED="$ac_path_SED"
4507      ac_path_SED_max=$ac_count
4508    fi
4509    # 10*(2^10) chars as input seems more than enough
4510    test $ac_count -gt 10 && break
4511  done
4512  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4513esac
4514
4515      $ac_path_SED_found && break 3
4516    done
4517  done
4518  done
4519IFS=$as_save_IFS
4520  if test -z "$ac_cv_path_SED"; then
4521    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
4522  fi
4523else
4524  ac_cv_path_SED=$SED
4525fi
4526
4527fi
4528{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
4529$as_echo "$ac_cv_path_SED" >&6; }
4530 SED="$ac_cv_path_SED"
4531  rm -f conftest.sed
4532
4533test -z "$SED" && SED=sed
4534Xsed="$SED -e 1s/^X//"
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
4547$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
4548if ${ac_cv_path_GREP+:} false; then :
4549  $as_echo_n "(cached) " >&6
4550else
4551  if test -z "$GREP"; then
4552  ac_path_GREP_found=false
4553  # Loop through the user's path and test for each of PROGNAME-LIST
4554  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4555for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4556do
4557  IFS=$as_save_IFS
4558  test -z "$as_dir" && as_dir=.
4559    for ac_prog in grep ggrep; do
4560    for ac_exec_ext in '' $ac_executable_extensions; do
4561      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
4562      as_fn_executable_p "$ac_path_GREP" || continue
4563# Check for GNU ac_path_GREP and select it if it is found.
4564  # Check for GNU $ac_path_GREP
4565case `"$ac_path_GREP" --version 2>&1` in
4566*GNU*)
4567  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
4568*)
4569  ac_count=0
4570  $as_echo_n 0123456789 >"conftest.in"
4571  while :
4572  do
4573    cat "conftest.in" "conftest.in" >"conftest.tmp"
4574    mv "conftest.tmp" "conftest.in"
4575    cp "conftest.in" "conftest.nl"
4576    $as_echo 'GREP' >> "conftest.nl"
4577    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4578    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4579    as_fn_arith $ac_count + 1 && ac_count=$as_val
4580    if test $ac_count -gt ${ac_path_GREP_max-0}; then
4581      # Best one so far, save it but keep looking for a better one
4582      ac_cv_path_GREP="$ac_path_GREP"
4583      ac_path_GREP_max=$ac_count
4584    fi
4585    # 10*(2^10) chars as input seems more than enough
4586    test $ac_count -gt 10 && break
4587  done
4588  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4589esac
4590
4591      $ac_path_GREP_found && break 3
4592    done
4593  done
4594  done
4595IFS=$as_save_IFS
4596  if test -z "$ac_cv_path_GREP"; then
4597    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4598  fi
4599else
4600  ac_cv_path_GREP=$GREP
4601fi
4602
4603fi
4604{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
4605$as_echo "$ac_cv_path_GREP" >&6; }
4606 GREP="$ac_cv_path_GREP"
4607
4608
4609{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
4610$as_echo_n "checking for egrep... " >&6; }
4611if ${ac_cv_path_EGREP+:} false; then :
4612  $as_echo_n "(cached) " >&6
4613else
4614  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
4615   then ac_cv_path_EGREP="$GREP -E"
4616   else
4617     if test -z "$EGREP"; then
4618  ac_path_EGREP_found=false
4619  # Loop through the user's path and test for each of PROGNAME-LIST
4620  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4621for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4622do
4623  IFS=$as_save_IFS
4624  test -z "$as_dir" && as_dir=.
4625    for ac_prog in egrep; do
4626    for ac_exec_ext in '' $ac_executable_extensions; do
4627      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
4628      as_fn_executable_p "$ac_path_EGREP" || continue
4629# Check for GNU ac_path_EGREP and select it if it is found.
4630  # Check for GNU $ac_path_EGREP
4631case `"$ac_path_EGREP" --version 2>&1` in
4632*GNU*)
4633  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
4634*)
4635  ac_count=0
4636  $as_echo_n 0123456789 >"conftest.in"
4637  while :
4638  do
4639    cat "conftest.in" "conftest.in" >"conftest.tmp"
4640    mv "conftest.tmp" "conftest.in"
4641    cp "conftest.in" "conftest.nl"
4642    $as_echo 'EGREP' >> "conftest.nl"
4643    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
4644    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4645    as_fn_arith $ac_count + 1 && ac_count=$as_val
4646    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
4647      # Best one so far, save it but keep looking for a better one
4648      ac_cv_path_EGREP="$ac_path_EGREP"
4649      ac_path_EGREP_max=$ac_count
4650    fi
4651    # 10*(2^10) chars as input seems more than enough
4652    test $ac_count -gt 10 && break
4653  done
4654  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4655esac
4656
4657      $ac_path_EGREP_found && break 3
4658    done
4659  done
4660  done
4661IFS=$as_save_IFS
4662  if test -z "$ac_cv_path_EGREP"; then
4663    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4664  fi
4665else
4666  ac_cv_path_EGREP=$EGREP
4667fi
4668
4669   fi
4670fi
4671{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
4672$as_echo "$ac_cv_path_EGREP" >&6; }
4673 EGREP="$ac_cv_path_EGREP"
4674
4675
4676{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
4677$as_echo_n "checking for fgrep... " >&6; }
4678if ${ac_cv_path_FGREP+:} false; then :
4679  $as_echo_n "(cached) " >&6
4680else
4681  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
4682   then ac_cv_path_FGREP="$GREP -F"
4683   else
4684     if test -z "$FGREP"; then
4685  ac_path_FGREP_found=false
4686  # Loop through the user's path and test for each of PROGNAME-LIST
4687  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4688for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
4689do
4690  IFS=$as_save_IFS
4691  test -z "$as_dir" && as_dir=.
4692    for ac_prog in fgrep; do
4693    for ac_exec_ext in '' $ac_executable_extensions; do
4694      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
4695      as_fn_executable_p "$ac_path_FGREP" || continue
4696# Check for GNU ac_path_FGREP and select it if it is found.
4697  # Check for GNU $ac_path_FGREP
4698case `"$ac_path_FGREP" --version 2>&1` in
4699*GNU*)
4700  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
4701*)
4702  ac_count=0
4703  $as_echo_n 0123456789 >"conftest.in"
4704  while :
4705  do
4706    cat "conftest.in" "conftest.in" >"conftest.tmp"
4707    mv "conftest.tmp" "conftest.in"
4708    cp "conftest.in" "conftest.nl"
4709    $as_echo 'FGREP' >> "conftest.nl"
4710    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
4711    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
4712    as_fn_arith $ac_count + 1 && ac_count=$as_val
4713    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
4714      # Best one so far, save it but keep looking for a better one
4715      ac_cv_path_FGREP="$ac_path_FGREP"
4716      ac_path_FGREP_max=$ac_count
4717    fi
4718    # 10*(2^10) chars as input seems more than enough
4719    test $ac_count -gt 10 && break
4720  done
4721  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
4722esac
4723
4724      $ac_path_FGREP_found && break 3
4725    done
4726  done
4727  done
4728IFS=$as_save_IFS
4729  if test -z "$ac_cv_path_FGREP"; then
4730    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
4731  fi
4732else
4733  ac_cv_path_FGREP=$FGREP
4734fi
4735
4736   fi
4737fi
4738{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
4739$as_echo "$ac_cv_path_FGREP" >&6; }
4740 FGREP="$ac_cv_path_FGREP"
4741
4742
4743test -z "$GREP" && GREP=grep
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763# Check whether --with-gnu-ld was given.
4764if test "${with_gnu_ld+set}" = set; then :
4765  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
4766else
4767  with_gnu_ld=no
4768fi
4769
4770ac_prog=ld
4771if test "$GCC" = yes; then
4772  # Check if gcc -print-prog-name=ld gives a path.
4773  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
4774$as_echo_n "checking for ld used by $CC... " >&6; }
4775  case $host in
4776  *-*-mingw*)
4777    # gcc leaves a trailing carriage return which upsets mingw
4778    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4779  *)
4780    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4781  esac
4782  case $ac_prog in
4783    # Accept absolute paths.
4784    [\\/]* | ?:[\\/]*)
4785      re_direlt='/[^/][^/]*/\.\./'
4786      # Canonicalize the pathname of ld
4787      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
4788      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
4789	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
4790      done
4791      test -z "$LD" && LD="$ac_prog"
4792      ;;
4793  "")
4794    # If it fails, then pretend we aren't using GCC.
4795    ac_prog=ld
4796    ;;
4797  *)
4798    # If it is relative, then search for the first ld in PATH.
4799    with_gnu_ld=unknown
4800    ;;
4801  esac
4802elif test "$with_gnu_ld" = yes; then
4803  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
4804$as_echo_n "checking for GNU ld... " >&6; }
4805else
4806  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
4807$as_echo_n "checking for non-GNU ld... " >&6; }
4808fi
4809if ${lt_cv_path_LD+:} false; then :
4810  $as_echo_n "(cached) " >&6
4811else
4812  if test -z "$LD"; then
4813  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4814  for ac_dir in $PATH; do
4815    IFS="$lt_save_ifs"
4816    test -z "$ac_dir" && ac_dir=.
4817    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4818      lt_cv_path_LD="$ac_dir/$ac_prog"
4819      # Check to see if the program is GNU ld.  I'd rather use --version,
4820      # but apparently some variants of GNU ld only accept -v.
4821      # Break only if it was the GNU/non-GNU ld that we prefer.
4822      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
4823      *GNU* | *'with BFD'*)
4824	test "$with_gnu_ld" != no && break
4825	;;
4826      *)
4827	test "$with_gnu_ld" != yes && break
4828	;;
4829      esac
4830    fi
4831  done
4832  IFS="$lt_save_ifs"
4833else
4834  lt_cv_path_LD="$LD" # Let the user override the test with a path.
4835fi
4836fi
4837
4838LD="$lt_cv_path_LD"
4839if test -n "$LD"; then
4840  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
4841$as_echo "$LD" >&6; }
4842else
4843  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4844$as_echo "no" >&6; }
4845fi
4846test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
4847{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
4848$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
4849if ${lt_cv_prog_gnu_ld+:} false; then :
4850  $as_echo_n "(cached) " >&6
4851else
4852  # I'd rather use --version here, but apparently some GNU lds only accept -v.
4853case `$LD -v 2>&1 </dev/null` in
4854*GNU* | *'with BFD'*)
4855  lt_cv_prog_gnu_ld=yes
4856  ;;
4857*)
4858  lt_cv_prog_gnu_ld=no
4859  ;;
4860esac
4861fi
4862{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
4863$as_echo "$lt_cv_prog_gnu_ld" >&6; }
4864with_gnu_ld=$lt_cv_prog_gnu_ld
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
4875$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
4876if ${lt_cv_path_NM+:} false; then :
4877  $as_echo_n "(cached) " >&6
4878else
4879  if test -n "$NM"; then
4880  # Let the user override the test.
4881  lt_cv_path_NM="$NM"
4882else
4883  lt_nm_to_check="${ac_tool_prefix}nm"
4884  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
4885    lt_nm_to_check="$lt_nm_to_check nm"
4886  fi
4887  for lt_tmp_nm in $lt_nm_to_check; do
4888    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
4889    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
4890      IFS="$lt_save_ifs"
4891      test -z "$ac_dir" && ac_dir=.
4892      tmp_nm="$ac_dir/$lt_tmp_nm"
4893      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
4894	# Check to see if the nm accepts a BSD-compat flag.
4895	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
4896	#   nm: unknown option "B" ignored
4897	# Tru64's nm complains that /dev/null is an invalid object file
4898	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
4899	*/dev/null* | *'Invalid file or object type'*)
4900	  lt_cv_path_NM="$tmp_nm -B"
4901	  break
4902	  ;;
4903	*)
4904	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
4905	  */dev/null*)
4906	    lt_cv_path_NM="$tmp_nm -p"
4907	    break
4908	    ;;
4909	  *)
4910	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
4911	    continue # so that we can try to find one that supports BSD flags
4912	    ;;
4913	  esac
4914	  ;;
4915	esac
4916      fi
4917    done
4918    IFS="$lt_save_ifs"
4919  done
4920  : ${lt_cv_path_NM=no}
4921fi
4922fi
4923{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
4924$as_echo "$lt_cv_path_NM" >&6; }
4925if test "$lt_cv_path_NM" != "no"; then
4926  NM="$lt_cv_path_NM"
4927else
4928  # Didn't find any BSD compatible name lister, look for dumpbin.
4929  if test -n "$DUMPBIN"; then :
4930    # Let the user override the test.
4931  else
4932    if test -n "$ac_tool_prefix"; then
4933  for ac_prog in dumpbin "link -dump"
4934  do
4935    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
4936set dummy $ac_tool_prefix$ac_prog; ac_word=$2
4937{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4938$as_echo_n "checking for $ac_word... " >&6; }
4939if ${ac_cv_prog_DUMPBIN+:} false; then :
4940  $as_echo_n "(cached) " >&6
4941else
4942  if test -n "$DUMPBIN"; then
4943  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
4944else
4945as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4946for as_dir in $PATH
4947do
4948  IFS=$as_save_IFS
4949  test -z "$as_dir" && as_dir=.
4950    for ac_exec_ext in '' $ac_executable_extensions; do
4951  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4952    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
4953    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4954    break 2
4955  fi
4956done
4957  done
4958IFS=$as_save_IFS
4959
4960fi
4961fi
4962DUMPBIN=$ac_cv_prog_DUMPBIN
4963if test -n "$DUMPBIN"; then
4964  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
4965$as_echo "$DUMPBIN" >&6; }
4966else
4967  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4968$as_echo "no" >&6; }
4969fi
4970
4971
4972    test -n "$DUMPBIN" && break
4973  done
4974fi
4975if test -z "$DUMPBIN"; then
4976  ac_ct_DUMPBIN=$DUMPBIN
4977  for ac_prog in dumpbin "link -dump"
4978do
4979  # Extract the first word of "$ac_prog", so it can be a program name with args.
4980set dummy $ac_prog; ac_word=$2
4981{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
4982$as_echo_n "checking for $ac_word... " >&6; }
4983if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
4984  $as_echo_n "(cached) " >&6
4985else
4986  if test -n "$ac_ct_DUMPBIN"; then
4987  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
4988else
4989as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4990for as_dir in $PATH
4991do
4992  IFS=$as_save_IFS
4993  test -z "$as_dir" && as_dir=.
4994    for ac_exec_ext in '' $ac_executable_extensions; do
4995  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
4996    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
4997    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
4998    break 2
4999  fi
5000done
5001  done
5002IFS=$as_save_IFS
5003
5004fi
5005fi
5006ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
5007if test -n "$ac_ct_DUMPBIN"; then
5008  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
5009$as_echo "$ac_ct_DUMPBIN" >&6; }
5010else
5011  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5012$as_echo "no" >&6; }
5013fi
5014
5015
5016  test -n "$ac_ct_DUMPBIN" && break
5017done
5018
5019  if test "x$ac_ct_DUMPBIN" = x; then
5020    DUMPBIN=":"
5021  else
5022    case $cross_compiling:$ac_tool_warned in
5023yes:)
5024{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5025$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5026ac_tool_warned=yes ;;
5027esac
5028    DUMPBIN=$ac_ct_DUMPBIN
5029  fi
5030fi
5031
5032    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
5033    *COFF*)
5034      DUMPBIN="$DUMPBIN -symbols"
5035      ;;
5036    *)
5037      DUMPBIN=:
5038      ;;
5039    esac
5040  fi
5041
5042  if test "$DUMPBIN" != ":"; then
5043    NM="$DUMPBIN"
5044  fi
5045fi
5046test -z "$NM" && NM=nm
5047
5048
5049
5050
5051
5052
5053{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
5054$as_echo_n "checking the name lister ($NM) interface... " >&6; }
5055if ${lt_cv_nm_interface+:} false; then :
5056  $as_echo_n "(cached) " >&6
5057else
5058  lt_cv_nm_interface="BSD nm"
5059  echo "int some_variable = 0;" > conftest.$ac_ext
5060  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
5061  (eval "$ac_compile" 2>conftest.err)
5062  cat conftest.err >&5
5063  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
5064  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
5065  cat conftest.err >&5
5066  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
5067  cat conftest.out >&5
5068  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
5069    lt_cv_nm_interface="MS dumpbin"
5070  fi
5071  rm -f conftest*
5072fi
5073{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
5074$as_echo "$lt_cv_nm_interface" >&6; }
5075
5076{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
5077$as_echo_n "checking whether ln -s works... " >&6; }
5078LN_S=$as_ln_s
5079if test "$LN_S" = "ln -s"; then
5080  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
5081$as_echo "yes" >&6; }
5082else
5083  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
5084$as_echo "no, using $LN_S" >&6; }
5085fi
5086
5087# find the maximum length of command line arguments
5088{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
5089$as_echo_n "checking the maximum length of command line arguments... " >&6; }
5090if ${lt_cv_sys_max_cmd_len+:} false; then :
5091  $as_echo_n "(cached) " >&6
5092else
5093    i=0
5094  teststring="ABCD"
5095
5096  case $build_os in
5097  msdosdjgpp*)
5098    # On DJGPP, this test can blow up pretty badly due to problems in libc
5099    # (any single argument exceeding 2000 bytes causes a buffer overrun
5100    # during glob expansion).  Even if it were fixed, the result of this
5101    # check would be larger than it should be.
5102    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
5103    ;;
5104
5105  gnu*)
5106    # Under GNU Hurd, this test is not required because there is
5107    # no limit to the length of command line arguments.
5108    # Libtool will interpret -1 as no limit whatsoever
5109    lt_cv_sys_max_cmd_len=-1;
5110    ;;
5111
5112  cygwin* | mingw* | cegcc*)
5113    # On Win9x/ME, this test blows up -- it succeeds, but takes
5114    # about 5 minutes as the teststring grows exponentially.
5115    # Worse, since 9x/ME are not pre-emptively multitasking,
5116    # you end up with a "frozen" computer, even though with patience
5117    # the test eventually succeeds (with a max line length of 256k).
5118    # Instead, let's just punt: use the minimum linelength reported by
5119    # all of the supported platforms: 8192 (on NT/2K/XP).
5120    lt_cv_sys_max_cmd_len=8192;
5121    ;;
5122
5123  mint*)
5124    # On MiNT this can take a long time and run out of memory.
5125    lt_cv_sys_max_cmd_len=8192;
5126    ;;
5127
5128  amigaos*)
5129    # On AmigaOS with pdksh, this test takes hours, literally.
5130    # So we just punt and use a minimum line length of 8192.
5131    lt_cv_sys_max_cmd_len=8192;
5132    ;;
5133
5134  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
5135    # This has been around since 386BSD, at least.  Likely further.
5136    if test -x /sbin/sysctl; then
5137      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
5138    elif test -x /usr/sbin/sysctl; then
5139      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
5140    else
5141      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
5142    fi
5143    # And add a safety zone
5144    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5145    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5146    ;;
5147
5148  interix*)
5149    # We know the value 262144 and hardcode it with a safety zone (like BSD)
5150    lt_cv_sys_max_cmd_len=196608
5151    ;;
5152
5153  os2*)
5154    # The test takes a long time on OS/2.
5155    lt_cv_sys_max_cmd_len=8192
5156    ;;
5157
5158  osf*)
5159    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
5160    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
5161    # nice to cause kernel panics so lets avoid the loop below.
5162    # First set a reasonable default.
5163    lt_cv_sys_max_cmd_len=16384
5164    #
5165    if test -x /sbin/sysconfig; then
5166      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
5167        *1*) lt_cv_sys_max_cmd_len=-1 ;;
5168      esac
5169    fi
5170    ;;
5171  sco3.2v5*)
5172    lt_cv_sys_max_cmd_len=102400
5173    ;;
5174  sysv5* | sco5v6* | sysv4.2uw2*)
5175    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
5176    if test -n "$kargmax"; then
5177      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
5178    else
5179      lt_cv_sys_max_cmd_len=32768
5180    fi
5181    ;;
5182  *)
5183    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
5184    if test -n "$lt_cv_sys_max_cmd_len"; then
5185      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
5186      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
5187    else
5188      # Make teststring a little bigger before we do anything with it.
5189      # a 1K string should be a reasonable start.
5190      for i in 1 2 3 4 5 6 7 8 ; do
5191        teststring=$teststring$teststring
5192      done
5193      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
5194      # If test is not a shell built-in, we'll probably end up computing a
5195      # maximum length that is only half of the actual maximum length, but
5196      # we can't tell.
5197      while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
5198	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
5199	      test $i != 17 # 1/2 MB should be enough
5200      do
5201        i=`expr $i + 1`
5202        teststring=$teststring$teststring
5203      done
5204      # Only check the string length outside the loop.
5205      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
5206      teststring=
5207      # Add a significant safety factor because C++ compilers can tack on
5208      # massive amounts of additional arguments before passing them to the
5209      # linker.  It appears as though 1/2 is a usable value.
5210      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
5211    fi
5212    ;;
5213  esac
5214
5215fi
5216
5217if test -n $lt_cv_sys_max_cmd_len ; then
5218  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
5219$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
5220else
5221  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
5222$as_echo "none" >&6; }
5223fi
5224max_cmd_len=$lt_cv_sys_max_cmd_len
5225
5226
5227
5228
5229
5230
5231: ${CP="cp -f"}
5232: ${MV="mv -f"}
5233: ${RM="rm -f"}
5234
5235{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
5236$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
5237# Try some XSI features
5238xsi_shell=no
5239( _lt_dummy="a/b/c"
5240  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
5241      = c,a/b,b/c, \
5242    && eval 'test $(( 1 + 1 )) -eq 2 \
5243    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
5244  && xsi_shell=yes
5245{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
5246$as_echo "$xsi_shell" >&6; }
5247
5248
5249{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
5250$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
5251lt_shell_append=no
5252( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
5253    >/dev/null 2>&1 \
5254  && lt_shell_append=yes
5255{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
5256$as_echo "$lt_shell_append" >&6; }
5257
5258
5259if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
5260  lt_unset=unset
5261else
5262  lt_unset=false
5263fi
5264
5265
5266
5267
5268
5269# test EBCDIC or ASCII
5270case `echo X|tr X '\101'` in
5271 A) # ASCII based system
5272    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
5273  lt_SP2NL='tr \040 \012'
5274  lt_NL2SP='tr \015\012 \040\040'
5275  ;;
5276 *) # EBCDIC based system
5277  lt_SP2NL='tr \100 \n'
5278  lt_NL2SP='tr \r\n \100\100'
5279  ;;
5280esac
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
5291$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
5292if ${lt_cv_to_host_file_cmd+:} false; then :
5293  $as_echo_n "(cached) " >&6
5294else
5295  case $host in
5296  *-*-mingw* )
5297    case $build in
5298      *-*-mingw* ) # actually msys
5299        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
5300        ;;
5301      *-*-cygwin* )
5302        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
5303        ;;
5304      * ) # otherwise, assume *nix
5305        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
5306        ;;
5307    esac
5308    ;;
5309  *-*-cygwin* )
5310    case $build in
5311      *-*-mingw* ) # actually msys
5312        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
5313        ;;
5314      *-*-cygwin* )
5315        lt_cv_to_host_file_cmd=func_convert_file_noop
5316        ;;
5317      * ) # otherwise, assume *nix
5318        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
5319        ;;
5320    esac
5321    ;;
5322  * ) # unhandled hosts (and "normal" native builds)
5323    lt_cv_to_host_file_cmd=func_convert_file_noop
5324    ;;
5325esac
5326
5327fi
5328
5329to_host_file_cmd=$lt_cv_to_host_file_cmd
5330{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
5331$as_echo "$lt_cv_to_host_file_cmd" >&6; }
5332
5333
5334
5335
5336
5337{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
5338$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
5339if ${lt_cv_to_tool_file_cmd+:} false; then :
5340  $as_echo_n "(cached) " >&6
5341else
5342  #assume ordinary cross tools, or native build.
5343lt_cv_to_tool_file_cmd=func_convert_file_noop
5344case $host in
5345  *-*-mingw* )
5346    case $build in
5347      *-*-mingw* ) # actually msys
5348        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
5349        ;;
5350    esac
5351    ;;
5352esac
5353
5354fi
5355
5356to_tool_file_cmd=$lt_cv_to_tool_file_cmd
5357{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
5358$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
5359
5360
5361
5362
5363
5364{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
5365$as_echo_n "checking for $LD option to reload object files... " >&6; }
5366if ${lt_cv_ld_reload_flag+:} false; then :
5367  $as_echo_n "(cached) " >&6
5368else
5369  lt_cv_ld_reload_flag='-r'
5370fi
5371{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
5372$as_echo "$lt_cv_ld_reload_flag" >&6; }
5373reload_flag=$lt_cv_ld_reload_flag
5374case $reload_flag in
5375"" | " "*) ;;
5376*) reload_flag=" $reload_flag" ;;
5377esac
5378reload_cmds='$LD$reload_flag -o $output$reload_objs'
5379case $host_os in
5380  cygwin* | mingw* | pw32* | cegcc*)
5381    if test "$GCC" != yes; then
5382      reload_cmds=false
5383    fi
5384    ;;
5385  darwin*)
5386    if test "$GCC" = yes; then
5387      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
5388    else
5389      reload_cmds='$LD$reload_flag -o $output$reload_objs'
5390    fi
5391    ;;
5392esac
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402if test -n "$ac_tool_prefix"; then
5403  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
5404set dummy ${ac_tool_prefix}objdump; ac_word=$2
5405{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5406$as_echo_n "checking for $ac_word... " >&6; }
5407if ${ac_cv_prog_OBJDUMP+:} false; then :
5408  $as_echo_n "(cached) " >&6
5409else
5410  if test -n "$OBJDUMP"; then
5411  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
5412else
5413as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5414for as_dir in $PATH
5415do
5416  IFS=$as_save_IFS
5417  test -z "$as_dir" && as_dir=.
5418    for ac_exec_ext in '' $ac_executable_extensions; do
5419  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5420    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
5421    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5422    break 2
5423  fi
5424done
5425  done
5426IFS=$as_save_IFS
5427
5428fi
5429fi
5430OBJDUMP=$ac_cv_prog_OBJDUMP
5431if test -n "$OBJDUMP"; then
5432  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
5433$as_echo "$OBJDUMP" >&6; }
5434else
5435  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5436$as_echo "no" >&6; }
5437fi
5438
5439
5440fi
5441if test -z "$ac_cv_prog_OBJDUMP"; then
5442  ac_ct_OBJDUMP=$OBJDUMP
5443  # Extract the first word of "objdump", so it can be a program name with args.
5444set dummy objdump; ac_word=$2
5445{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5446$as_echo_n "checking for $ac_word... " >&6; }
5447if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
5448  $as_echo_n "(cached) " >&6
5449else
5450  if test -n "$ac_ct_OBJDUMP"; then
5451  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
5452else
5453as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5454for as_dir in $PATH
5455do
5456  IFS=$as_save_IFS
5457  test -z "$as_dir" && as_dir=.
5458    for ac_exec_ext in '' $ac_executable_extensions; do
5459  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5460    ac_cv_prog_ac_ct_OBJDUMP="objdump"
5461    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5462    break 2
5463  fi
5464done
5465  done
5466IFS=$as_save_IFS
5467
5468fi
5469fi
5470ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
5471if test -n "$ac_ct_OBJDUMP"; then
5472  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
5473$as_echo "$ac_ct_OBJDUMP" >&6; }
5474else
5475  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5476$as_echo "no" >&6; }
5477fi
5478
5479  if test "x$ac_ct_OBJDUMP" = x; then
5480    OBJDUMP="false"
5481  else
5482    case $cross_compiling:$ac_tool_warned in
5483yes:)
5484{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5485$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5486ac_tool_warned=yes ;;
5487esac
5488    OBJDUMP=$ac_ct_OBJDUMP
5489  fi
5490else
5491  OBJDUMP="$ac_cv_prog_OBJDUMP"
5492fi
5493
5494test -z "$OBJDUMP" && OBJDUMP=objdump
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
5505$as_echo_n "checking how to recognize dependent libraries... " >&6; }
5506if ${lt_cv_deplibs_check_method+:} false; then :
5507  $as_echo_n "(cached) " >&6
5508else
5509  lt_cv_file_magic_cmd='$MAGIC_CMD'
5510lt_cv_file_magic_test_file=
5511lt_cv_deplibs_check_method='unknown'
5512# Need to set the preceding variable on all platforms that support
5513# interlibrary dependencies.
5514# 'none' -- dependencies not supported.
5515# `unknown' -- same as none, but documents that we really don't know.
5516# 'pass_all' -- all dependencies passed with no checks.
5517# 'test_compile' -- check by making test program.
5518# 'file_magic [[regex]]' -- check by looking for files in library path
5519# which responds to the $file_magic_cmd with a given extended regex.
5520# If you have `file' or equivalent on your system and you're not sure
5521# whether `pass_all' will *always* work, you probably want this one.
5522
5523case $host_os in
5524aix[4-9]*)
5525  lt_cv_deplibs_check_method=pass_all
5526  ;;
5527
5528beos*)
5529  lt_cv_deplibs_check_method=pass_all
5530  ;;
5531
5532bsdi[45]*)
5533  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
5534  lt_cv_file_magic_cmd='/usr/bin/file -L'
5535  lt_cv_file_magic_test_file=/shlib/libc.so
5536  ;;
5537
5538cygwin*)
5539  # func_win32_libid is a shell function defined in ltmain.sh
5540  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5541  lt_cv_file_magic_cmd='func_win32_libid'
5542  ;;
5543
5544mingw* | pw32*)
5545  # Base MSYS/MinGW do not provide the 'file' command needed by
5546  # func_win32_libid shell function, so use a weaker test based on 'objdump',
5547  # unless we find 'file', for example because we are cross-compiling.
5548  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
5549  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
5550    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
5551    lt_cv_file_magic_cmd='func_win32_libid'
5552  else
5553    # Keep this pattern in sync with the one in func_win32_libid.
5554    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
5555    lt_cv_file_magic_cmd='$OBJDUMP -f'
5556  fi
5557  ;;
5558
5559cegcc*)
5560  # use the weaker test based on 'objdump'. See mingw*.
5561  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
5562  lt_cv_file_magic_cmd='$OBJDUMP -f'
5563  ;;
5564
5565darwin* | rhapsody*)
5566  lt_cv_deplibs_check_method=pass_all
5567  ;;
5568
5569freebsd* | dragonfly*)
5570  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5571    case $host_cpu in
5572    i*86 )
5573      # Not sure whether the presence of OpenBSD here was a mistake.
5574      # Let's accept both of them until this is cleared up.
5575      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
5576      lt_cv_file_magic_cmd=/usr/bin/file
5577      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
5578      ;;
5579    esac
5580  else
5581    lt_cv_deplibs_check_method=pass_all
5582  fi
5583  ;;
5584
5585gnu*)
5586  lt_cv_deplibs_check_method=pass_all
5587  ;;
5588
5589haiku*)
5590  lt_cv_deplibs_check_method=pass_all
5591  ;;
5592
5593hpux10.20* | hpux11*)
5594  lt_cv_file_magic_cmd=/usr/bin/file
5595  case $host_cpu in
5596  ia64*)
5597    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
5598    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
5599    ;;
5600  hppa*64*)
5601    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
5602    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
5603    ;;
5604  *)
5605    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
5606    lt_cv_file_magic_test_file=/usr/lib/libc.sl
5607    ;;
5608  esac
5609  ;;
5610
5611interix[3-9]*)
5612  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
5613  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
5614  ;;
5615
5616irix5* | irix6* | nonstopux*)
5617  case $LD in
5618  *-32|*"-32 ") libmagic=32-bit;;
5619  *-n32|*"-n32 ") libmagic=N32;;
5620  *-64|*"-64 ") libmagic=64-bit;;
5621  *) libmagic=never-match;;
5622  esac
5623  lt_cv_deplibs_check_method=pass_all
5624  ;;
5625
5626# This must be glibc/ELF.
5627linux* | k*bsd*-gnu | kopensolaris*-gnu)
5628  lt_cv_deplibs_check_method=pass_all
5629  ;;
5630
5631netbsd*)
5632  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
5633    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5634  else
5635    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
5636  fi
5637  ;;
5638
5639newos6*)
5640  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
5641  lt_cv_file_magic_cmd=/usr/bin/file
5642  lt_cv_file_magic_test_file=/usr/lib/libnls.so
5643  ;;
5644
5645*nto* | *qnx*)
5646  lt_cv_deplibs_check_method=pass_all
5647  ;;
5648
5649openbsd*)
5650  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
5651    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
5652  else
5653    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
5654  fi
5655  ;;
5656
5657osf3* | osf4* | osf5*)
5658  lt_cv_deplibs_check_method=pass_all
5659  ;;
5660
5661rdos*)
5662  lt_cv_deplibs_check_method=pass_all
5663  ;;
5664
5665solaris*)
5666  lt_cv_deplibs_check_method=pass_all
5667  ;;
5668
5669sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
5670  lt_cv_deplibs_check_method=pass_all
5671  ;;
5672
5673sysv4 | sysv4.3*)
5674  case $host_vendor in
5675  motorola)
5676    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
5677    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
5678    ;;
5679  ncr)
5680    lt_cv_deplibs_check_method=pass_all
5681    ;;
5682  sequent)
5683    lt_cv_file_magic_cmd='/bin/file'
5684    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
5685    ;;
5686  sni)
5687    lt_cv_file_magic_cmd='/bin/file'
5688    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
5689    lt_cv_file_magic_test_file=/lib/libc.so
5690    ;;
5691  siemens)
5692    lt_cv_deplibs_check_method=pass_all
5693    ;;
5694  pc)
5695    lt_cv_deplibs_check_method=pass_all
5696    ;;
5697  esac
5698  ;;
5699
5700tpf*)
5701  lt_cv_deplibs_check_method=pass_all
5702  ;;
5703esac
5704
5705fi
5706{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
5707$as_echo "$lt_cv_deplibs_check_method" >&6; }
5708
5709file_magic_glob=
5710want_nocaseglob=no
5711if test "$build" = "$host"; then
5712  case $host_os in
5713  mingw* | pw32*)
5714    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
5715      want_nocaseglob=yes
5716    else
5717      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
5718    fi
5719    ;;
5720  esac
5721fi
5722
5723file_magic_cmd=$lt_cv_file_magic_cmd
5724deplibs_check_method=$lt_cv_deplibs_check_method
5725test -z "$deplibs_check_method" && deplibs_check_method=unknown
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748if test -n "$ac_tool_prefix"; then
5749  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
5750set dummy ${ac_tool_prefix}dlltool; ac_word=$2
5751{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5752$as_echo_n "checking for $ac_word... " >&6; }
5753if ${ac_cv_prog_DLLTOOL+:} false; then :
5754  $as_echo_n "(cached) " >&6
5755else
5756  if test -n "$DLLTOOL"; then
5757  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
5758else
5759as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5760for as_dir in $PATH
5761do
5762  IFS=$as_save_IFS
5763  test -z "$as_dir" && as_dir=.
5764    for ac_exec_ext in '' $ac_executable_extensions; do
5765  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5766    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
5767    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5768    break 2
5769  fi
5770done
5771  done
5772IFS=$as_save_IFS
5773
5774fi
5775fi
5776DLLTOOL=$ac_cv_prog_DLLTOOL
5777if test -n "$DLLTOOL"; then
5778  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
5779$as_echo "$DLLTOOL" >&6; }
5780else
5781  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5782$as_echo "no" >&6; }
5783fi
5784
5785
5786fi
5787if test -z "$ac_cv_prog_DLLTOOL"; then
5788  ac_ct_DLLTOOL=$DLLTOOL
5789  # Extract the first word of "dlltool", so it can be a program name with args.
5790set dummy dlltool; ac_word=$2
5791{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5792$as_echo_n "checking for $ac_word... " >&6; }
5793if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
5794  $as_echo_n "(cached) " >&6
5795else
5796  if test -n "$ac_ct_DLLTOOL"; then
5797  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
5798else
5799as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5800for as_dir in $PATH
5801do
5802  IFS=$as_save_IFS
5803  test -z "$as_dir" && as_dir=.
5804    for ac_exec_ext in '' $ac_executable_extensions; do
5805  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5806    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
5807    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5808    break 2
5809  fi
5810done
5811  done
5812IFS=$as_save_IFS
5813
5814fi
5815fi
5816ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
5817if test -n "$ac_ct_DLLTOOL"; then
5818  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
5819$as_echo "$ac_ct_DLLTOOL" >&6; }
5820else
5821  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5822$as_echo "no" >&6; }
5823fi
5824
5825  if test "x$ac_ct_DLLTOOL" = x; then
5826    DLLTOOL="false"
5827  else
5828    case $cross_compiling:$ac_tool_warned in
5829yes:)
5830{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5831$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5832ac_tool_warned=yes ;;
5833esac
5834    DLLTOOL=$ac_ct_DLLTOOL
5835  fi
5836else
5837  DLLTOOL="$ac_cv_prog_DLLTOOL"
5838fi
5839
5840test -z "$DLLTOOL" && DLLTOOL=dlltool
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
5852$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
5853if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
5854  $as_echo_n "(cached) " >&6
5855else
5856  lt_cv_sharedlib_from_linklib_cmd='unknown'
5857
5858case $host_os in
5859cygwin* | mingw* | pw32* | cegcc*)
5860  # two different shell functions defined in ltmain.sh
5861  # decide which to use based on capabilities of $DLLTOOL
5862  case `$DLLTOOL --help 2>&1` in
5863  *--identify-strict*)
5864    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
5865    ;;
5866  *)
5867    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
5868    ;;
5869  esac
5870  ;;
5871*)
5872  # fallback: assume linklib IS sharedlib
5873  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
5874  ;;
5875esac
5876
5877fi
5878{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
5879$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
5880sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
5881test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
5882
5883
5884
5885
5886
5887
5888
5889
5890if test -n "$ac_tool_prefix"; then
5891  for ac_prog in ar
5892  do
5893    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
5894set dummy $ac_tool_prefix$ac_prog; ac_word=$2
5895{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5896$as_echo_n "checking for $ac_word... " >&6; }
5897if ${ac_cv_prog_AR+:} false; then :
5898  $as_echo_n "(cached) " >&6
5899else
5900  if test -n "$AR"; then
5901  ac_cv_prog_AR="$AR" # Let the user override the test.
5902else
5903as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5904for as_dir in $PATH
5905do
5906  IFS=$as_save_IFS
5907  test -z "$as_dir" && as_dir=.
5908    for ac_exec_ext in '' $ac_executable_extensions; do
5909  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5910    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
5911    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5912    break 2
5913  fi
5914done
5915  done
5916IFS=$as_save_IFS
5917
5918fi
5919fi
5920AR=$ac_cv_prog_AR
5921if test -n "$AR"; then
5922  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
5923$as_echo "$AR" >&6; }
5924else
5925  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5926$as_echo "no" >&6; }
5927fi
5928
5929
5930    test -n "$AR" && break
5931  done
5932fi
5933if test -z "$AR"; then
5934  ac_ct_AR=$AR
5935  for ac_prog in ar
5936do
5937  # Extract the first word of "$ac_prog", so it can be a program name with args.
5938set dummy $ac_prog; ac_word=$2
5939{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
5940$as_echo_n "checking for $ac_word... " >&6; }
5941if ${ac_cv_prog_ac_ct_AR+:} false; then :
5942  $as_echo_n "(cached) " >&6
5943else
5944  if test -n "$ac_ct_AR"; then
5945  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
5946else
5947as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
5948for as_dir in $PATH
5949do
5950  IFS=$as_save_IFS
5951  test -z "$as_dir" && as_dir=.
5952    for ac_exec_ext in '' $ac_executable_extensions; do
5953  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
5954    ac_cv_prog_ac_ct_AR="$ac_prog"
5955    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
5956    break 2
5957  fi
5958done
5959  done
5960IFS=$as_save_IFS
5961
5962fi
5963fi
5964ac_ct_AR=$ac_cv_prog_ac_ct_AR
5965if test -n "$ac_ct_AR"; then
5966  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
5967$as_echo "$ac_ct_AR" >&6; }
5968else
5969  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
5970$as_echo "no" >&6; }
5971fi
5972
5973
5974  test -n "$ac_ct_AR" && break
5975done
5976
5977  if test "x$ac_ct_AR" = x; then
5978    AR="false"
5979  else
5980    case $cross_compiling:$ac_tool_warned in
5981yes:)
5982{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
5983$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
5984ac_tool_warned=yes ;;
5985esac
5986    AR=$ac_ct_AR
5987  fi
5988fi
5989
5990: ${AR=ar}
5991: ${AR_FLAGS=cru}
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
6004$as_echo_n "checking for archiver @FILE support... " >&6; }
6005if ${lt_cv_ar_at_file+:} false; then :
6006  $as_echo_n "(cached) " >&6
6007else
6008  lt_cv_ar_at_file=no
6009   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6010/* end confdefs.h.  */
6011
6012int
6013main ()
6014{
6015
6016  ;
6017  return 0;
6018}
6019_ACEOF
6020if ac_fn_c_try_compile "$LINENO"; then :
6021  echo conftest.$ac_objext > conftest.lst
6022      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
6023      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
6024  (eval $lt_ar_try) 2>&5
6025  ac_status=$?
6026  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6027  test $ac_status = 0; }
6028      if test "$ac_status" -eq 0; then
6029	# Ensure the archiver fails upon bogus file names.
6030	rm -f conftest.$ac_objext libconftest.a
6031	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
6032  (eval $lt_ar_try) 2>&5
6033  ac_status=$?
6034  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6035  test $ac_status = 0; }
6036	if test "$ac_status" -ne 0; then
6037          lt_cv_ar_at_file=@
6038        fi
6039      fi
6040      rm -f conftest.* libconftest.a
6041
6042fi
6043rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
6044
6045fi
6046{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
6047$as_echo "$lt_cv_ar_at_file" >&6; }
6048
6049if test "x$lt_cv_ar_at_file" = xno; then
6050  archiver_list_spec=
6051else
6052  archiver_list_spec=$lt_cv_ar_at_file
6053fi
6054
6055
6056
6057
6058
6059
6060
6061if test -n "$ac_tool_prefix"; then
6062  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
6063set dummy ${ac_tool_prefix}strip; ac_word=$2
6064{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6065$as_echo_n "checking for $ac_word... " >&6; }
6066if ${ac_cv_prog_STRIP+:} false; then :
6067  $as_echo_n "(cached) " >&6
6068else
6069  if test -n "$STRIP"; then
6070  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
6071else
6072as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6073for as_dir in $PATH
6074do
6075  IFS=$as_save_IFS
6076  test -z "$as_dir" && as_dir=.
6077    for ac_exec_ext in '' $ac_executable_extensions; do
6078  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6079    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
6080    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6081    break 2
6082  fi
6083done
6084  done
6085IFS=$as_save_IFS
6086
6087fi
6088fi
6089STRIP=$ac_cv_prog_STRIP
6090if test -n "$STRIP"; then
6091  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
6092$as_echo "$STRIP" >&6; }
6093else
6094  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6095$as_echo "no" >&6; }
6096fi
6097
6098
6099fi
6100if test -z "$ac_cv_prog_STRIP"; then
6101  ac_ct_STRIP=$STRIP
6102  # Extract the first word of "strip", so it can be a program name with args.
6103set dummy strip; ac_word=$2
6104{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6105$as_echo_n "checking for $ac_word... " >&6; }
6106if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
6107  $as_echo_n "(cached) " >&6
6108else
6109  if test -n "$ac_ct_STRIP"; then
6110  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
6111else
6112as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6113for as_dir in $PATH
6114do
6115  IFS=$as_save_IFS
6116  test -z "$as_dir" && as_dir=.
6117    for ac_exec_ext in '' $ac_executable_extensions; do
6118  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6119    ac_cv_prog_ac_ct_STRIP="strip"
6120    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6121    break 2
6122  fi
6123done
6124  done
6125IFS=$as_save_IFS
6126
6127fi
6128fi
6129ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
6130if test -n "$ac_ct_STRIP"; then
6131  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
6132$as_echo "$ac_ct_STRIP" >&6; }
6133else
6134  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6135$as_echo "no" >&6; }
6136fi
6137
6138  if test "x$ac_ct_STRIP" = x; then
6139    STRIP=":"
6140  else
6141    case $cross_compiling:$ac_tool_warned in
6142yes:)
6143{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6144$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6145ac_tool_warned=yes ;;
6146esac
6147    STRIP=$ac_ct_STRIP
6148  fi
6149else
6150  STRIP="$ac_cv_prog_STRIP"
6151fi
6152
6153test -z "$STRIP" && STRIP=:
6154
6155
6156
6157
6158
6159
6160if test -n "$ac_tool_prefix"; then
6161  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
6162set dummy ${ac_tool_prefix}ranlib; ac_word=$2
6163{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6164$as_echo_n "checking for $ac_word... " >&6; }
6165if ${ac_cv_prog_RANLIB+:} false; then :
6166  $as_echo_n "(cached) " >&6
6167else
6168  if test -n "$RANLIB"; then
6169  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
6170else
6171as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6172for as_dir in $PATH
6173do
6174  IFS=$as_save_IFS
6175  test -z "$as_dir" && as_dir=.
6176    for ac_exec_ext in '' $ac_executable_extensions; do
6177  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6178    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
6179    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6180    break 2
6181  fi
6182done
6183  done
6184IFS=$as_save_IFS
6185
6186fi
6187fi
6188RANLIB=$ac_cv_prog_RANLIB
6189if test -n "$RANLIB"; then
6190  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
6191$as_echo "$RANLIB" >&6; }
6192else
6193  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6194$as_echo "no" >&6; }
6195fi
6196
6197
6198fi
6199if test -z "$ac_cv_prog_RANLIB"; then
6200  ac_ct_RANLIB=$RANLIB
6201  # Extract the first word of "ranlib", so it can be a program name with args.
6202set dummy ranlib; ac_word=$2
6203{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6204$as_echo_n "checking for $ac_word... " >&6; }
6205if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
6206  $as_echo_n "(cached) " >&6
6207else
6208  if test -n "$ac_ct_RANLIB"; then
6209  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
6210else
6211as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6212for as_dir in $PATH
6213do
6214  IFS=$as_save_IFS
6215  test -z "$as_dir" && as_dir=.
6216    for ac_exec_ext in '' $ac_executable_extensions; do
6217  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6218    ac_cv_prog_ac_ct_RANLIB="ranlib"
6219    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6220    break 2
6221  fi
6222done
6223  done
6224IFS=$as_save_IFS
6225
6226fi
6227fi
6228ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
6229if test -n "$ac_ct_RANLIB"; then
6230  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
6231$as_echo "$ac_ct_RANLIB" >&6; }
6232else
6233  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6234$as_echo "no" >&6; }
6235fi
6236
6237  if test "x$ac_ct_RANLIB" = x; then
6238    RANLIB=":"
6239  else
6240    case $cross_compiling:$ac_tool_warned in
6241yes:)
6242{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6243$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6244ac_tool_warned=yes ;;
6245esac
6246    RANLIB=$ac_ct_RANLIB
6247  fi
6248else
6249  RANLIB="$ac_cv_prog_RANLIB"
6250fi
6251
6252test -z "$RANLIB" && RANLIB=:
6253
6254
6255
6256
6257
6258
6259# Determine commands to create old-style static archives.
6260old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
6261old_postinstall_cmds='chmod 644 $oldlib'
6262old_postuninstall_cmds=
6263
6264if test -n "$RANLIB"; then
6265  case $host_os in
6266  openbsd*)
6267    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
6268    ;;
6269  *)
6270    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
6271    ;;
6272  esac
6273  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
6274fi
6275
6276case $host_os in
6277  darwin*)
6278    lock_old_archive_extraction=yes ;;
6279  *)
6280    lock_old_archive_extraction=no ;;
6281esac
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321# If no C compiler was specified, use CC.
6322LTCC=${LTCC-"$CC"}
6323
6324# If no C compiler flags were specified, use CFLAGS.
6325LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
6326
6327# Allow CC to be a program name with arguments.
6328compiler=$CC
6329
6330
6331# Check for command to grab the raw symbol name followed by C symbol from nm.
6332{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
6333$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
6334if ${lt_cv_sys_global_symbol_pipe+:} false; then :
6335  $as_echo_n "(cached) " >&6
6336else
6337
6338# These are sane defaults that work on at least a few old systems.
6339# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
6340
6341# Character class describing NM global symbol codes.
6342symcode='[BCDEGRST]'
6343
6344# Regexp to match symbols that can be accessed directly from C.
6345sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
6346
6347# Define system-specific variables.
6348case $host_os in
6349aix*)
6350  symcode='[BCDT]'
6351  ;;
6352cygwin* | mingw* | pw32* | cegcc*)
6353  symcode='[ABCDGISTW]'
6354  ;;
6355hpux*)
6356  if test "$host_cpu" = ia64; then
6357    symcode='[ABCDEGRST]'
6358  fi
6359  ;;
6360irix* | nonstopux*)
6361  symcode='[BCDEGRST]'
6362  ;;
6363osf*)
6364  symcode='[BCDEGQRST]'
6365  ;;
6366solaris*)
6367  symcode='[BDRT]'
6368  ;;
6369sco3.2v5*)
6370  symcode='[DT]'
6371  ;;
6372sysv4.2uw2*)
6373  symcode='[DT]'
6374  ;;
6375sysv5* | sco5v6* | unixware* | OpenUNIX*)
6376  symcode='[ABDT]'
6377  ;;
6378sysv4)
6379  symcode='[DFNSTU]'
6380  ;;
6381esac
6382
6383# If we're using GNU nm, then use its standard symbol codes.
6384case `$NM -V 2>&1` in
6385*GNU* | *'with BFD'*)
6386  symcode='[ABCDGIRSTW]' ;;
6387esac
6388
6389# Transform an extracted symbol line into a proper C declaration.
6390# Some systems (esp. on ia64) link data and code symbols differently,
6391# so use this general approach.
6392lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
6393
6394# Transform an extracted symbol line into symbol name and symbol address
6395lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
6396lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
6397
6398# Handle CRLF in mingw tool chain
6399opt_cr=
6400case $build_os in
6401mingw*)
6402  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
6403  ;;
6404esac
6405
6406# Try without a prefix underscore, then with it.
6407for ac_symprfx in "" "_"; do
6408
6409  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
6410  symxfrm="\\1 $ac_symprfx\\2 \\2"
6411
6412  # Write the raw and C identifiers.
6413  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6414    # Fake it for dumpbin and say T for any non-static function
6415    # and D for any global variable.
6416    # Also find C++ and __fastcall symbols from MSVC++,
6417    # which start with @ or ?.
6418    lt_cv_sys_global_symbol_pipe="$AWK '"\
6419"     {last_section=section; section=\$ 3};"\
6420"     /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
6421"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
6422"     \$ 0!~/External *\|/{next};"\
6423"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
6424"     {if(hide[section]) next};"\
6425"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
6426"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
6427"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
6428"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
6429"     ' prfx=^$ac_symprfx"
6430  else
6431    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
6432  fi
6433  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
6434
6435  # Check to see that the pipe works correctly.
6436  pipe_works=no
6437
6438  rm -f conftest*
6439  cat > conftest.$ac_ext <<_LT_EOF
6440#ifdef __cplusplus
6441extern "C" {
6442#endif
6443char nm_test_var;
6444void nm_test_func(void);
6445void nm_test_func(void){}
6446#ifdef __cplusplus
6447}
6448#endif
6449int main(){nm_test_var='a';nm_test_func();return(0);}
6450_LT_EOF
6451
6452  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6453  (eval $ac_compile) 2>&5
6454  ac_status=$?
6455  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6456  test $ac_status = 0; }; then
6457    # Now try to grab the symbols.
6458    nlist=conftest.nm
6459    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
6460  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
6461  ac_status=$?
6462  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6463  test $ac_status = 0; } && test -s "$nlist"; then
6464      # Try sorting and uniquifying the output.
6465      if sort "$nlist" | uniq > "$nlist"T; then
6466	mv -f "$nlist"T "$nlist"
6467      else
6468	rm -f "$nlist"T
6469      fi
6470
6471      # Make sure that we snagged all the symbols we need.
6472      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
6473	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
6474	  cat <<_LT_EOF > conftest.$ac_ext
6475/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
6476#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
6477/* DATA imports from DLLs on WIN32 con't be const, because runtime
6478   relocations are performed -- see ld's documentation on pseudo-relocs.  */
6479# define LT_DLSYM_CONST
6480#elif defined(__osf__)
6481/* This system does not cope well with relocations in const data.  */
6482# define LT_DLSYM_CONST
6483#else
6484# define LT_DLSYM_CONST const
6485#endif
6486
6487#ifdef __cplusplus
6488extern "C" {
6489#endif
6490
6491_LT_EOF
6492	  # Now generate the symbol file.
6493	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
6494
6495	  cat <<_LT_EOF >> conftest.$ac_ext
6496
6497/* The mapping between symbol names and symbols.  */
6498LT_DLSYM_CONST struct {
6499  const char *name;
6500  void       *address;
6501}
6502lt__PROGRAM__LTX_preloaded_symbols[] =
6503{
6504  { "@PROGRAM@", (void *) 0 },
6505_LT_EOF
6506	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
6507	  cat <<\_LT_EOF >> conftest.$ac_ext
6508  {0, (void *) 0}
6509};
6510
6511/* This works around a problem in FreeBSD linker */
6512#ifdef FREEBSD_WORKAROUND
6513static const void *lt_preloaded_setup() {
6514  return lt__PROGRAM__LTX_preloaded_symbols;
6515}
6516#endif
6517
6518#ifdef __cplusplus
6519}
6520#endif
6521_LT_EOF
6522	  # Now try linking the two files.
6523	  mv conftest.$ac_objext conftstm.$ac_objext
6524	  lt_globsym_save_LIBS=$LIBS
6525	  lt_globsym_save_CFLAGS=$CFLAGS
6526	  LIBS="conftstm.$ac_objext"
6527	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
6528	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
6529  (eval $ac_link) 2>&5
6530  ac_status=$?
6531  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6532  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
6533	    pipe_works=yes
6534	  fi
6535	  LIBS=$lt_globsym_save_LIBS
6536	  CFLAGS=$lt_globsym_save_CFLAGS
6537	else
6538	  echo "cannot find nm_test_func in $nlist" >&5
6539	fi
6540      else
6541	echo "cannot find nm_test_var in $nlist" >&5
6542      fi
6543    else
6544      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
6545    fi
6546  else
6547    echo "$progname: failed program was:" >&5
6548    cat conftest.$ac_ext >&5
6549  fi
6550  rm -rf conftest* conftst*
6551
6552  # Do not use the global_symbol_pipe unless it works.
6553  if test "$pipe_works" = yes; then
6554    break
6555  else
6556    lt_cv_sys_global_symbol_pipe=
6557  fi
6558done
6559
6560fi
6561
6562if test -z "$lt_cv_sys_global_symbol_pipe"; then
6563  lt_cv_sys_global_symbol_to_cdecl=
6564fi
6565if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
6566  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
6567$as_echo "failed" >&6; }
6568else
6569  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
6570$as_echo "ok" >&6; }
6571fi
6572
6573# Response file support.
6574if test "$lt_cv_nm_interface" = "MS dumpbin"; then
6575  nm_file_list_spec='@'
6576elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
6577  nm_file_list_spec='@'
6578fi
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
6607$as_echo_n "checking for sysroot... " >&6; }
6608
6609# Check whether --with-sysroot was given.
6610if test "${with_sysroot+set}" = set; then :
6611  withval=$with_sysroot;
6612else
6613  with_sysroot=no
6614fi
6615
6616
6617lt_sysroot=
6618case ${with_sysroot} in #(
6619 yes)
6620   if test "$GCC" = yes; then
6621     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
6622   fi
6623   ;; #(
6624 /*)
6625   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
6626   ;; #(
6627 no|'')
6628   ;; #(
6629 *)
6630   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
6631$as_echo "${with_sysroot}" >&6; }
6632   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
6633   ;;
6634esac
6635
6636 { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
6637$as_echo "${lt_sysroot:-no}" >&6; }
6638
6639
6640
6641
6642
6643# Check whether --enable-libtool-lock was given.
6644if test "${enable_libtool_lock+set}" = set; then :
6645  enableval=$enable_libtool_lock;
6646fi
6647
6648test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
6649
6650# Some flags need to be propagated to the compiler or linker for good
6651# libtool support.
6652case $host in
6653ia64-*-hpux*)
6654  # Find out which ABI we are using.
6655  echo 'int i;' > conftest.$ac_ext
6656  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6657  (eval $ac_compile) 2>&5
6658  ac_status=$?
6659  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6660  test $ac_status = 0; }; then
6661    case `/usr/bin/file conftest.$ac_objext` in
6662      *ELF-32*)
6663	HPUX_IA64_MODE="32"
6664	;;
6665      *ELF-64*)
6666	HPUX_IA64_MODE="64"
6667	;;
6668    esac
6669  fi
6670  rm -rf conftest*
6671  ;;
6672*-*-irix6*)
6673  # Find out which ABI we are using.
6674  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
6675  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6676  (eval $ac_compile) 2>&5
6677  ac_status=$?
6678  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6679  test $ac_status = 0; }; then
6680    if test "$lt_cv_prog_gnu_ld" = yes; then
6681      case `/usr/bin/file conftest.$ac_objext` in
6682	*32-bit*)
6683	  LD="${LD-ld} -melf32bsmip"
6684	  ;;
6685	*N32*)
6686	  LD="${LD-ld} -melf32bmipn32"
6687	  ;;
6688	*64-bit*)
6689	  LD="${LD-ld} -melf64bmip"
6690	;;
6691      esac
6692    else
6693      case `/usr/bin/file conftest.$ac_objext` in
6694	*32-bit*)
6695	  LD="${LD-ld} -32"
6696	  ;;
6697	*N32*)
6698	  LD="${LD-ld} -n32"
6699	  ;;
6700	*64-bit*)
6701	  LD="${LD-ld} -64"
6702	  ;;
6703      esac
6704    fi
6705  fi
6706  rm -rf conftest*
6707  ;;
6708
6709x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
6710s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
6711  # Find out which ABI we are using.
6712  echo 'int i;' > conftest.$ac_ext
6713  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6714  (eval $ac_compile) 2>&5
6715  ac_status=$?
6716  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6717  test $ac_status = 0; }; then
6718    case `/usr/bin/file conftest.o` in
6719      *32-bit*)
6720	case $host in
6721	  x86_64-*kfreebsd*-gnu)
6722	    LD="${LD-ld} -m elf_i386_fbsd"
6723	    ;;
6724	  x86_64-*linux*)
6725	    LD="${LD-ld} -m elf_i386"
6726	    ;;
6727	  ppc64-*linux*|powerpc64-*linux*)
6728	    LD="${LD-ld} -m elf32ppclinux"
6729	    ;;
6730	  s390x-*linux*)
6731	    LD="${LD-ld} -m elf_s390"
6732	    ;;
6733	  sparc64-*linux*)
6734	    LD="${LD-ld} -m elf32_sparc"
6735	    ;;
6736	esac
6737	;;
6738      *64-bit*)
6739	case $host in
6740	  x86_64-*kfreebsd*-gnu)
6741	    LD="${LD-ld} -m elf_x86_64_fbsd"
6742	    ;;
6743	  x86_64-*linux*)
6744	    LD="${LD-ld} -m elf_x86_64"
6745	    ;;
6746	  ppc*-*linux*|powerpc*-*linux*)
6747	    LD="${LD-ld} -m elf64ppc"
6748	    ;;
6749	  s390*-*linux*|s390*-*tpf*)
6750	    LD="${LD-ld} -m elf64_s390"
6751	    ;;
6752	  sparc*-*linux*)
6753	    LD="${LD-ld} -m elf64_sparc"
6754	    ;;
6755	esac
6756	;;
6757    esac
6758  fi
6759  rm -rf conftest*
6760  ;;
6761
6762*-*-sco3.2v5*)
6763  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
6764  SAVE_CFLAGS="$CFLAGS"
6765  CFLAGS="$CFLAGS -belf"
6766  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
6767$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
6768if ${lt_cv_cc_needs_belf+:} false; then :
6769  $as_echo_n "(cached) " >&6
6770else
6771  ac_ext=c
6772ac_cpp='$CPP $CPPFLAGS'
6773ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6774ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6775ac_compiler_gnu=$ac_cv_c_compiler_gnu
6776
6777     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6778/* end confdefs.h.  */
6779
6780int
6781main ()
6782{
6783
6784  ;
6785  return 0;
6786}
6787_ACEOF
6788if ac_fn_c_try_link "$LINENO"; then :
6789  lt_cv_cc_needs_belf=yes
6790else
6791  lt_cv_cc_needs_belf=no
6792fi
6793rm -f core conftest.err conftest.$ac_objext \
6794    conftest$ac_exeext conftest.$ac_ext
6795     ac_ext=c
6796ac_cpp='$CPP $CPPFLAGS'
6797ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
6798ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
6799ac_compiler_gnu=$ac_cv_c_compiler_gnu
6800
6801fi
6802{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
6803$as_echo "$lt_cv_cc_needs_belf" >&6; }
6804  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
6805    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
6806    CFLAGS="$SAVE_CFLAGS"
6807  fi
6808  ;;
6809*-*solaris*)
6810  # Find out which ABI we are using.
6811  echo 'int i;' > conftest.$ac_ext
6812  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
6813  (eval $ac_compile) 2>&5
6814  ac_status=$?
6815  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
6816  test $ac_status = 0; }; then
6817    case `/usr/bin/file conftest.o` in
6818    *64-bit*)
6819      case $lt_cv_prog_gnu_ld in
6820      yes*)
6821        case $host in
6822        i?86-*-solaris*)
6823          LD="${LD-ld} -m elf_x86_64"
6824          ;;
6825        sparc*-*-solaris*)
6826          LD="${LD-ld} -m elf64_sparc"
6827          ;;
6828        esac
6829        # GNU ld 2.21 introduced _sol2 emulations.  Use them if available.
6830        if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
6831          LD="${LD-ld}_sol2"
6832        fi
6833        ;;
6834      *)
6835	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
6836	  LD="${LD-ld} -64"
6837	fi
6838	;;
6839      esac
6840      ;;
6841    esac
6842  fi
6843  rm -rf conftest*
6844  ;;
6845esac
6846
6847need_locks="$enable_libtool_lock"
6848
6849if test -n "$ac_tool_prefix"; then
6850  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
6851set dummy ${ac_tool_prefix}mt; ac_word=$2
6852{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6853$as_echo_n "checking for $ac_word... " >&6; }
6854if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
6855  $as_echo_n "(cached) " >&6
6856else
6857  if test -n "$MANIFEST_TOOL"; then
6858  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
6859else
6860as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6861for as_dir in $PATH
6862do
6863  IFS=$as_save_IFS
6864  test -z "$as_dir" && as_dir=.
6865    for ac_exec_ext in '' $ac_executable_extensions; do
6866  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6867    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
6868    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6869    break 2
6870  fi
6871done
6872  done
6873IFS=$as_save_IFS
6874
6875fi
6876fi
6877MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
6878if test -n "$MANIFEST_TOOL"; then
6879  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
6880$as_echo "$MANIFEST_TOOL" >&6; }
6881else
6882  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6883$as_echo "no" >&6; }
6884fi
6885
6886
6887fi
6888if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
6889  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
6890  # Extract the first word of "mt", so it can be a program name with args.
6891set dummy mt; ac_word=$2
6892{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6893$as_echo_n "checking for $ac_word... " >&6; }
6894if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
6895  $as_echo_n "(cached) " >&6
6896else
6897  if test -n "$ac_ct_MANIFEST_TOOL"; then
6898  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
6899else
6900as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6901for as_dir in $PATH
6902do
6903  IFS=$as_save_IFS
6904  test -z "$as_dir" && as_dir=.
6905    for ac_exec_ext in '' $ac_executable_extensions; do
6906  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6907    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
6908    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6909    break 2
6910  fi
6911done
6912  done
6913IFS=$as_save_IFS
6914
6915fi
6916fi
6917ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
6918if test -n "$ac_ct_MANIFEST_TOOL"; then
6919  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
6920$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
6921else
6922  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
6923$as_echo "no" >&6; }
6924fi
6925
6926  if test "x$ac_ct_MANIFEST_TOOL" = x; then
6927    MANIFEST_TOOL=":"
6928  else
6929    case $cross_compiling:$ac_tool_warned in
6930yes:)
6931{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
6932$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
6933ac_tool_warned=yes ;;
6934esac
6935    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
6936  fi
6937else
6938  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
6939fi
6940
6941test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
6942{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
6943$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
6944if ${lt_cv_path_mainfest_tool+:} false; then :
6945  $as_echo_n "(cached) " >&6
6946else
6947  lt_cv_path_mainfest_tool=no
6948  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
6949  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
6950  cat conftest.err >&5
6951  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
6952    lt_cv_path_mainfest_tool=yes
6953  fi
6954  rm -f conftest*
6955fi
6956{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
6957$as_echo "$lt_cv_path_mainfest_tool" >&6; }
6958if test "x$lt_cv_path_mainfest_tool" != xyes; then
6959  MANIFEST_TOOL=:
6960fi
6961
6962
6963
6964
6965
6966
6967  case $host_os in
6968    rhapsody* | darwin*)
6969    if test -n "$ac_tool_prefix"; then
6970  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
6971set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
6972{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
6973$as_echo_n "checking for $ac_word... " >&6; }
6974if ${ac_cv_prog_DSYMUTIL+:} false; then :
6975  $as_echo_n "(cached) " >&6
6976else
6977  if test -n "$DSYMUTIL"; then
6978  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
6979else
6980as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6981for as_dir in $PATH
6982do
6983  IFS=$as_save_IFS
6984  test -z "$as_dir" && as_dir=.
6985    for ac_exec_ext in '' $ac_executable_extensions; do
6986  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
6987    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
6988    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
6989    break 2
6990  fi
6991done
6992  done
6993IFS=$as_save_IFS
6994
6995fi
6996fi
6997DSYMUTIL=$ac_cv_prog_DSYMUTIL
6998if test -n "$DSYMUTIL"; then
6999  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
7000$as_echo "$DSYMUTIL" >&6; }
7001else
7002  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7003$as_echo "no" >&6; }
7004fi
7005
7006
7007fi
7008if test -z "$ac_cv_prog_DSYMUTIL"; then
7009  ac_ct_DSYMUTIL=$DSYMUTIL
7010  # Extract the first word of "dsymutil", so it can be a program name with args.
7011set dummy dsymutil; ac_word=$2
7012{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7013$as_echo_n "checking for $ac_word... " >&6; }
7014if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
7015  $as_echo_n "(cached) " >&6
7016else
7017  if test -n "$ac_ct_DSYMUTIL"; then
7018  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
7019else
7020as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7021for as_dir in $PATH
7022do
7023  IFS=$as_save_IFS
7024  test -z "$as_dir" && as_dir=.
7025    for ac_exec_ext in '' $ac_executable_extensions; do
7026  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7027    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
7028    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7029    break 2
7030  fi
7031done
7032  done
7033IFS=$as_save_IFS
7034
7035fi
7036fi
7037ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
7038if test -n "$ac_ct_DSYMUTIL"; then
7039  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
7040$as_echo "$ac_ct_DSYMUTIL" >&6; }
7041else
7042  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7043$as_echo "no" >&6; }
7044fi
7045
7046  if test "x$ac_ct_DSYMUTIL" = x; then
7047    DSYMUTIL=":"
7048  else
7049    case $cross_compiling:$ac_tool_warned in
7050yes:)
7051{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7052$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7053ac_tool_warned=yes ;;
7054esac
7055    DSYMUTIL=$ac_ct_DSYMUTIL
7056  fi
7057else
7058  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
7059fi
7060
7061    if test -n "$ac_tool_prefix"; then
7062  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
7063set dummy ${ac_tool_prefix}nmedit; ac_word=$2
7064{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7065$as_echo_n "checking for $ac_word... " >&6; }
7066if ${ac_cv_prog_NMEDIT+:} false; then :
7067  $as_echo_n "(cached) " >&6
7068else
7069  if test -n "$NMEDIT"; then
7070  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
7071else
7072as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7073for as_dir in $PATH
7074do
7075  IFS=$as_save_IFS
7076  test -z "$as_dir" && as_dir=.
7077    for ac_exec_ext in '' $ac_executable_extensions; do
7078  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7079    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
7080    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7081    break 2
7082  fi
7083done
7084  done
7085IFS=$as_save_IFS
7086
7087fi
7088fi
7089NMEDIT=$ac_cv_prog_NMEDIT
7090if test -n "$NMEDIT"; then
7091  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
7092$as_echo "$NMEDIT" >&6; }
7093else
7094  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7095$as_echo "no" >&6; }
7096fi
7097
7098
7099fi
7100if test -z "$ac_cv_prog_NMEDIT"; then
7101  ac_ct_NMEDIT=$NMEDIT
7102  # Extract the first word of "nmedit", so it can be a program name with args.
7103set dummy nmedit; ac_word=$2
7104{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7105$as_echo_n "checking for $ac_word... " >&6; }
7106if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
7107  $as_echo_n "(cached) " >&6
7108else
7109  if test -n "$ac_ct_NMEDIT"; then
7110  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
7111else
7112as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7113for as_dir in $PATH
7114do
7115  IFS=$as_save_IFS
7116  test -z "$as_dir" && as_dir=.
7117    for ac_exec_ext in '' $ac_executable_extensions; do
7118  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7119    ac_cv_prog_ac_ct_NMEDIT="nmedit"
7120    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7121    break 2
7122  fi
7123done
7124  done
7125IFS=$as_save_IFS
7126
7127fi
7128fi
7129ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
7130if test -n "$ac_ct_NMEDIT"; then
7131  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
7132$as_echo "$ac_ct_NMEDIT" >&6; }
7133else
7134  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7135$as_echo "no" >&6; }
7136fi
7137
7138  if test "x$ac_ct_NMEDIT" = x; then
7139    NMEDIT=":"
7140  else
7141    case $cross_compiling:$ac_tool_warned in
7142yes:)
7143{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7144$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7145ac_tool_warned=yes ;;
7146esac
7147    NMEDIT=$ac_ct_NMEDIT
7148  fi
7149else
7150  NMEDIT="$ac_cv_prog_NMEDIT"
7151fi
7152
7153    if test -n "$ac_tool_prefix"; then
7154  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
7155set dummy ${ac_tool_prefix}lipo; ac_word=$2
7156{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7157$as_echo_n "checking for $ac_word... " >&6; }
7158if ${ac_cv_prog_LIPO+:} false; then :
7159  $as_echo_n "(cached) " >&6
7160else
7161  if test -n "$LIPO"; then
7162  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
7163else
7164as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7165for as_dir in $PATH
7166do
7167  IFS=$as_save_IFS
7168  test -z "$as_dir" && as_dir=.
7169    for ac_exec_ext in '' $ac_executable_extensions; do
7170  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7171    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
7172    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7173    break 2
7174  fi
7175done
7176  done
7177IFS=$as_save_IFS
7178
7179fi
7180fi
7181LIPO=$ac_cv_prog_LIPO
7182if test -n "$LIPO"; then
7183  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
7184$as_echo "$LIPO" >&6; }
7185else
7186  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7187$as_echo "no" >&6; }
7188fi
7189
7190
7191fi
7192if test -z "$ac_cv_prog_LIPO"; then
7193  ac_ct_LIPO=$LIPO
7194  # Extract the first word of "lipo", so it can be a program name with args.
7195set dummy lipo; ac_word=$2
7196{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7197$as_echo_n "checking for $ac_word... " >&6; }
7198if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
7199  $as_echo_n "(cached) " >&6
7200else
7201  if test -n "$ac_ct_LIPO"; then
7202  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
7203else
7204as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7205for as_dir in $PATH
7206do
7207  IFS=$as_save_IFS
7208  test -z "$as_dir" && as_dir=.
7209    for ac_exec_ext in '' $ac_executable_extensions; do
7210  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7211    ac_cv_prog_ac_ct_LIPO="lipo"
7212    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7213    break 2
7214  fi
7215done
7216  done
7217IFS=$as_save_IFS
7218
7219fi
7220fi
7221ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
7222if test -n "$ac_ct_LIPO"; then
7223  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
7224$as_echo "$ac_ct_LIPO" >&6; }
7225else
7226  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7227$as_echo "no" >&6; }
7228fi
7229
7230  if test "x$ac_ct_LIPO" = x; then
7231    LIPO=":"
7232  else
7233    case $cross_compiling:$ac_tool_warned in
7234yes:)
7235{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7236$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7237ac_tool_warned=yes ;;
7238esac
7239    LIPO=$ac_ct_LIPO
7240  fi
7241else
7242  LIPO="$ac_cv_prog_LIPO"
7243fi
7244
7245    if test -n "$ac_tool_prefix"; then
7246  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
7247set dummy ${ac_tool_prefix}otool; ac_word=$2
7248{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7249$as_echo_n "checking for $ac_word... " >&6; }
7250if ${ac_cv_prog_OTOOL+:} false; then :
7251  $as_echo_n "(cached) " >&6
7252else
7253  if test -n "$OTOOL"; then
7254  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
7255else
7256as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7257for as_dir in $PATH
7258do
7259  IFS=$as_save_IFS
7260  test -z "$as_dir" && as_dir=.
7261    for ac_exec_ext in '' $ac_executable_extensions; do
7262  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7263    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
7264    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7265    break 2
7266  fi
7267done
7268  done
7269IFS=$as_save_IFS
7270
7271fi
7272fi
7273OTOOL=$ac_cv_prog_OTOOL
7274if test -n "$OTOOL"; then
7275  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
7276$as_echo "$OTOOL" >&6; }
7277else
7278  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7279$as_echo "no" >&6; }
7280fi
7281
7282
7283fi
7284if test -z "$ac_cv_prog_OTOOL"; then
7285  ac_ct_OTOOL=$OTOOL
7286  # Extract the first word of "otool", so it can be a program name with args.
7287set dummy otool; ac_word=$2
7288{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7289$as_echo_n "checking for $ac_word... " >&6; }
7290if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
7291  $as_echo_n "(cached) " >&6
7292else
7293  if test -n "$ac_ct_OTOOL"; then
7294  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
7295else
7296as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7297for as_dir in $PATH
7298do
7299  IFS=$as_save_IFS
7300  test -z "$as_dir" && as_dir=.
7301    for ac_exec_ext in '' $ac_executable_extensions; do
7302  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7303    ac_cv_prog_ac_ct_OTOOL="otool"
7304    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7305    break 2
7306  fi
7307done
7308  done
7309IFS=$as_save_IFS
7310
7311fi
7312fi
7313ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
7314if test -n "$ac_ct_OTOOL"; then
7315  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
7316$as_echo "$ac_ct_OTOOL" >&6; }
7317else
7318  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7319$as_echo "no" >&6; }
7320fi
7321
7322  if test "x$ac_ct_OTOOL" = x; then
7323    OTOOL=":"
7324  else
7325    case $cross_compiling:$ac_tool_warned in
7326yes:)
7327{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7328$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7329ac_tool_warned=yes ;;
7330esac
7331    OTOOL=$ac_ct_OTOOL
7332  fi
7333else
7334  OTOOL="$ac_cv_prog_OTOOL"
7335fi
7336
7337    if test -n "$ac_tool_prefix"; then
7338  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
7339set dummy ${ac_tool_prefix}otool64; ac_word=$2
7340{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7341$as_echo_n "checking for $ac_word... " >&6; }
7342if ${ac_cv_prog_OTOOL64+:} false; then :
7343  $as_echo_n "(cached) " >&6
7344else
7345  if test -n "$OTOOL64"; then
7346  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
7347else
7348as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7349for as_dir in $PATH
7350do
7351  IFS=$as_save_IFS
7352  test -z "$as_dir" && as_dir=.
7353    for ac_exec_ext in '' $ac_executable_extensions; do
7354  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7355    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
7356    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7357    break 2
7358  fi
7359done
7360  done
7361IFS=$as_save_IFS
7362
7363fi
7364fi
7365OTOOL64=$ac_cv_prog_OTOOL64
7366if test -n "$OTOOL64"; then
7367  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
7368$as_echo "$OTOOL64" >&6; }
7369else
7370  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7371$as_echo "no" >&6; }
7372fi
7373
7374
7375fi
7376if test -z "$ac_cv_prog_OTOOL64"; then
7377  ac_ct_OTOOL64=$OTOOL64
7378  # Extract the first word of "otool64", so it can be a program name with args.
7379set dummy otool64; ac_word=$2
7380{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
7381$as_echo_n "checking for $ac_word... " >&6; }
7382if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
7383  $as_echo_n "(cached) " >&6
7384else
7385  if test -n "$ac_ct_OTOOL64"; then
7386  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
7387else
7388as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
7389for as_dir in $PATH
7390do
7391  IFS=$as_save_IFS
7392  test -z "$as_dir" && as_dir=.
7393    for ac_exec_ext in '' $ac_executable_extensions; do
7394  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
7395    ac_cv_prog_ac_ct_OTOOL64="otool64"
7396    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
7397    break 2
7398  fi
7399done
7400  done
7401IFS=$as_save_IFS
7402
7403fi
7404fi
7405ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
7406if test -n "$ac_ct_OTOOL64"; then
7407  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
7408$as_echo "$ac_ct_OTOOL64" >&6; }
7409else
7410  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
7411$as_echo "no" >&6; }
7412fi
7413
7414  if test "x$ac_ct_OTOOL64" = x; then
7415    OTOOL64=":"
7416  else
7417    case $cross_compiling:$ac_tool_warned in
7418yes:)
7419{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
7420$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
7421ac_tool_warned=yes ;;
7422esac
7423    OTOOL64=$ac_ct_OTOOL64
7424  fi
7425else
7426  OTOOL64="$ac_cv_prog_OTOOL64"
7427fi
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
7456$as_echo_n "checking for -single_module linker flag... " >&6; }
7457if ${lt_cv_apple_cc_single_mod+:} false; then :
7458  $as_echo_n "(cached) " >&6
7459else
7460  lt_cv_apple_cc_single_mod=no
7461      if test -z "${LT_MULTI_MODULE}"; then
7462	# By default we will add the -single_module flag. You can override
7463	# by either setting the environment variable LT_MULTI_MODULE
7464	# non-empty at configure time, or by adding -multi_module to the
7465	# link flags.
7466	rm -rf libconftest.dylib*
7467	echo "int foo(void){return 1;}" > conftest.c
7468	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7469-dynamiclib -Wl,-single_module conftest.c" >&5
7470	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
7471	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
7472        _lt_result=$?
7473	# If there is a non-empty error log, and "single_module"
7474	# appears in it, assume the flag caused a linker warning
7475        if test -s conftest.err && $GREP single_module conftest.err; then
7476	  cat conftest.err >&5
7477	# Otherwise, if the output was created with a 0 exit code from
7478	# the compiler, it worked.
7479	elif test -f libconftest.dylib && test $_lt_result -eq 0; then
7480	  lt_cv_apple_cc_single_mod=yes
7481	else
7482	  cat conftest.err >&5
7483	fi
7484	rm -rf libconftest.dylib*
7485	rm -f conftest.*
7486      fi
7487fi
7488{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
7489$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
7490
7491    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
7492$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
7493if ${lt_cv_ld_exported_symbols_list+:} false; then :
7494  $as_echo_n "(cached) " >&6
7495else
7496  lt_cv_ld_exported_symbols_list=no
7497      save_LDFLAGS=$LDFLAGS
7498      echo "_main" > conftest.sym
7499      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
7500      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7501/* end confdefs.h.  */
7502
7503int
7504main ()
7505{
7506
7507  ;
7508  return 0;
7509}
7510_ACEOF
7511if ac_fn_c_try_link "$LINENO"; then :
7512  lt_cv_ld_exported_symbols_list=yes
7513else
7514  lt_cv_ld_exported_symbols_list=no
7515fi
7516rm -f core conftest.err conftest.$ac_objext \
7517    conftest$ac_exeext conftest.$ac_ext
7518	LDFLAGS="$save_LDFLAGS"
7519
7520fi
7521{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
7522$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
7523
7524    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
7525$as_echo_n "checking for -force_load linker flag... " >&6; }
7526if ${lt_cv_ld_force_load+:} false; then :
7527  $as_echo_n "(cached) " >&6
7528else
7529  lt_cv_ld_force_load=no
7530      cat > conftest.c << _LT_EOF
7531int forced_loaded() { return 2;}
7532_LT_EOF
7533      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
7534      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
7535      echo "$AR cru libconftest.a conftest.o" >&5
7536      $AR cru libconftest.a conftest.o 2>&5
7537      echo "$RANLIB libconftest.a" >&5
7538      $RANLIB libconftest.a 2>&5
7539      cat > conftest.c << _LT_EOF
7540int main() { return 0;}
7541_LT_EOF
7542      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
7543      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
7544      _lt_result=$?
7545      if test -s conftest.err && $GREP force_load conftest.err; then
7546	cat conftest.err >&5
7547      elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
7548	lt_cv_ld_force_load=yes
7549      else
7550	cat conftest.err >&5
7551      fi
7552        rm -f conftest.err libconftest.a conftest conftest.c
7553        rm -rf conftest.dSYM
7554
7555fi
7556{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
7557$as_echo "$lt_cv_ld_force_load" >&6; }
7558    case $host_os in
7559    rhapsody* | darwin1.[012])
7560      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
7561    darwin1.*)
7562      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7563    darwin*) # darwin 5.x on
7564      # if running on 10.5 or later, the deployment target defaults
7565      # to the OS version, if on x86, and 10.4, the deployment
7566      # target defaults to 10.4. Don't you love it?
7567      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
7568	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
7569	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7570	10.[012]*)
7571	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
7572	10.*)
7573	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
7574      esac
7575    ;;
7576  esac
7577    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
7578      _lt_dar_single_mod='$single_module'
7579    fi
7580    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
7581      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
7582    else
7583      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
7584    fi
7585    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
7586      _lt_dsymutil='~$DSYMUTIL $lib || :'
7587    else
7588      _lt_dsymutil=
7589    fi
7590    ;;
7591  esac
7592
7593ac_ext=c
7594ac_cpp='$CPP $CPPFLAGS'
7595ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7596ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7597ac_compiler_gnu=$ac_cv_c_compiler_gnu
7598{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
7599$as_echo_n "checking how to run the C preprocessor... " >&6; }
7600# On Suns, sometimes $CPP names a directory.
7601if test -n "$CPP" && test -d "$CPP"; then
7602  CPP=
7603fi
7604if test -z "$CPP"; then
7605  if ${ac_cv_prog_CPP+:} false; then :
7606  $as_echo_n "(cached) " >&6
7607else
7608      # Double quotes because CPP needs to be expanded
7609    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
7610    do
7611      ac_preproc_ok=false
7612for ac_c_preproc_warn_flag in '' yes
7613do
7614  # Use a header file that comes with gcc, so configuring glibc
7615  # with a fresh cross-compiler works.
7616  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
7617  # <limits.h> exists even on freestanding compilers.
7618  # On the NeXT, cc -E runs the code through the compiler's parser,
7619  # not just through cpp. "Syntax error" is here to catch this case.
7620  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7621/* end confdefs.h.  */
7622#ifdef __STDC__
7623# include <limits.h>
7624#else
7625# include <assert.h>
7626#endif
7627		     Syntax error
7628_ACEOF
7629if ac_fn_c_try_cpp "$LINENO"; then :
7630
7631else
7632  # Broken: fails on valid input.
7633continue
7634fi
7635rm -f conftest.err conftest.i conftest.$ac_ext
7636
7637  # OK, works on sane cases.  Now check whether nonexistent headers
7638  # can be detected and how.
7639  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7640/* end confdefs.h.  */
7641#include <ac_nonexistent.h>
7642_ACEOF
7643if ac_fn_c_try_cpp "$LINENO"; then :
7644  # Broken: success on invalid input.
7645continue
7646else
7647  # Passes both tests.
7648ac_preproc_ok=:
7649break
7650fi
7651rm -f conftest.err conftest.i conftest.$ac_ext
7652
7653done
7654# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
7655rm -f conftest.i conftest.err conftest.$ac_ext
7656if $ac_preproc_ok; then :
7657  break
7658fi
7659
7660    done
7661    ac_cv_prog_CPP=$CPP
7662
7663fi
7664  CPP=$ac_cv_prog_CPP
7665else
7666  ac_cv_prog_CPP=$CPP
7667fi
7668{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
7669$as_echo "$CPP" >&6; }
7670ac_preproc_ok=false
7671for ac_c_preproc_warn_flag in '' yes
7672do
7673  # Use a header file that comes with gcc, so configuring glibc
7674  # with a fresh cross-compiler works.
7675  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
7676  # <limits.h> exists even on freestanding compilers.
7677  # On the NeXT, cc -E runs the code through the compiler's parser,
7678  # not just through cpp. "Syntax error" is here to catch this case.
7679  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7680/* end confdefs.h.  */
7681#ifdef __STDC__
7682# include <limits.h>
7683#else
7684# include <assert.h>
7685#endif
7686		     Syntax error
7687_ACEOF
7688if ac_fn_c_try_cpp "$LINENO"; then :
7689
7690else
7691  # Broken: fails on valid input.
7692continue
7693fi
7694rm -f conftest.err conftest.i conftest.$ac_ext
7695
7696  # OK, works on sane cases.  Now check whether nonexistent headers
7697  # can be detected and how.
7698  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7699/* end confdefs.h.  */
7700#include <ac_nonexistent.h>
7701_ACEOF
7702if ac_fn_c_try_cpp "$LINENO"; then :
7703  # Broken: success on invalid input.
7704continue
7705else
7706  # Passes both tests.
7707ac_preproc_ok=:
7708break
7709fi
7710rm -f conftest.err conftest.i conftest.$ac_ext
7711
7712done
7713# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
7714rm -f conftest.i conftest.err conftest.$ac_ext
7715if $ac_preproc_ok; then :
7716
7717else
7718  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
7719$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
7720as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
7721See \`config.log' for more details" "$LINENO" 5; }
7722fi
7723
7724ac_ext=c
7725ac_cpp='$CPP $CPPFLAGS'
7726ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7727ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7728ac_compiler_gnu=$ac_cv_c_compiler_gnu
7729
7730
7731{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
7732$as_echo_n "checking for ANSI C header files... " >&6; }
7733if ${ac_cv_header_stdc+:} false; then :
7734  $as_echo_n "(cached) " >&6
7735else
7736  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7737/* end confdefs.h.  */
7738#include <stdlib.h>
7739#include <stdarg.h>
7740#include <string.h>
7741#include <float.h>
7742
7743int
7744main ()
7745{
7746
7747  ;
7748  return 0;
7749}
7750_ACEOF
7751if ac_fn_c_try_compile "$LINENO"; then :
7752  ac_cv_header_stdc=yes
7753else
7754  ac_cv_header_stdc=no
7755fi
7756rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7757
7758if test $ac_cv_header_stdc = yes; then
7759  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7760  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7761/* end confdefs.h.  */
7762#include <string.h>
7763
7764_ACEOF
7765if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7766  $EGREP "memchr" >/dev/null 2>&1; then :
7767
7768else
7769  ac_cv_header_stdc=no
7770fi
7771rm -f conftest*
7772
7773fi
7774
7775if test $ac_cv_header_stdc = yes; then
7776  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7777  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7778/* end confdefs.h.  */
7779#include <stdlib.h>
7780
7781_ACEOF
7782if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7783  $EGREP "free" >/dev/null 2>&1; then :
7784
7785else
7786  ac_cv_header_stdc=no
7787fi
7788rm -f conftest*
7789
7790fi
7791
7792if test $ac_cv_header_stdc = yes; then
7793  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7794  if test "$cross_compiling" = yes; then :
7795  :
7796else
7797  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
7798/* end confdefs.h.  */
7799#include <ctype.h>
7800#include <stdlib.h>
7801#if ((' ' & 0x0FF) == 0x020)
7802# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7803# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7804#else
7805# define ISLOWER(c) \
7806		   (('a' <= (c) && (c) <= 'i') \
7807		     || ('j' <= (c) && (c) <= 'r') \
7808		     || ('s' <= (c) && (c) <= 'z'))
7809# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7810#endif
7811
7812#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7813int
7814main ()
7815{
7816  int i;
7817  for (i = 0; i < 256; i++)
7818    if (XOR (islower (i), ISLOWER (i))
7819	|| toupper (i) != TOUPPER (i))
7820      return 2;
7821  return 0;
7822}
7823_ACEOF
7824if ac_fn_c_try_run "$LINENO"; then :
7825
7826else
7827  ac_cv_header_stdc=no
7828fi
7829rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7830  conftest.$ac_objext conftest.beam conftest.$ac_ext
7831fi
7832
7833fi
7834fi
7835{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
7836$as_echo "$ac_cv_header_stdc" >&6; }
7837if test $ac_cv_header_stdc = yes; then
7838
7839$as_echo "#define STDC_HEADERS 1" >>confdefs.h
7840
7841fi
7842
7843# On IRIX 5.3, sys/types and inttypes.h are conflicting.
7844for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7845		  inttypes.h stdint.h unistd.h
7846do :
7847  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
7848ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
7849"
7850if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
7851  cat >>confdefs.h <<_ACEOF
7852#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
7853_ACEOF
7854
7855fi
7856
7857done
7858
7859
7860for ac_header in dlfcn.h
7861do :
7862  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
7863"
7864if test "x$ac_cv_header_dlfcn_h" = xyes; then :
7865  cat >>confdefs.h <<_ACEOF
7866#define HAVE_DLFCN_H 1
7867_ACEOF
7868
7869fi
7870
7871done
7872
7873
7874
7875
7876
7877# Set options
7878
7879
7880
7881        enable_dlopen=no
7882
7883
7884  enable_win32_dll=no
7885
7886
7887            # Check whether --enable-shared was given.
7888if test "${enable_shared+set}" = set; then :
7889  enableval=$enable_shared; p=${PACKAGE-default}
7890    case $enableval in
7891    yes) enable_shared=yes ;;
7892    no) enable_shared=no ;;
7893    *)
7894      enable_shared=no
7895      # Look at the argument we got.  We use all the common list separators.
7896      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7897      for pkg in $enableval; do
7898	IFS="$lt_save_ifs"
7899	if test "X$pkg" = "X$p"; then
7900	  enable_shared=yes
7901	fi
7902      done
7903      IFS="$lt_save_ifs"
7904      ;;
7905    esac
7906else
7907  enable_shared=yes
7908fi
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918  # Check whether --enable-static was given.
7919if test "${enable_static+set}" = set; then :
7920  enableval=$enable_static; p=${PACKAGE-default}
7921    case $enableval in
7922    yes) enable_static=yes ;;
7923    no) enable_static=no ;;
7924    *)
7925     enable_static=no
7926      # Look at the argument we got.  We use all the common list separators.
7927      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7928      for pkg in $enableval; do
7929	IFS="$lt_save_ifs"
7930	if test "X$pkg" = "X$p"; then
7931	  enable_static=yes
7932	fi
7933      done
7934      IFS="$lt_save_ifs"
7935      ;;
7936    esac
7937else
7938  enable_static=yes
7939fi
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950# Check whether --with-pic was given.
7951if test "${with_pic+set}" = set; then :
7952  withval=$with_pic; lt_p=${PACKAGE-default}
7953    case $withval in
7954    yes|no) pic_mode=$withval ;;
7955    *)
7956      pic_mode=default
7957      # Look at the argument we got.  We use all the common list separators.
7958      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7959      for lt_pkg in $withval; do
7960	IFS="$lt_save_ifs"
7961	if test "X$lt_pkg" = "X$lt_p"; then
7962	  pic_mode=yes
7963	fi
7964      done
7965      IFS="$lt_save_ifs"
7966      ;;
7967    esac
7968else
7969  pic_mode=default
7970fi
7971
7972
7973test -z "$pic_mode" && pic_mode=default
7974
7975
7976
7977
7978
7979
7980
7981  # Check whether --enable-fast-install was given.
7982if test "${enable_fast_install+set}" = set; then :
7983  enableval=$enable_fast_install; p=${PACKAGE-default}
7984    case $enableval in
7985    yes) enable_fast_install=yes ;;
7986    no) enable_fast_install=no ;;
7987    *)
7988      enable_fast_install=no
7989      # Look at the argument we got.  We use all the common list separators.
7990      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
7991      for pkg in $enableval; do
7992	IFS="$lt_save_ifs"
7993	if test "X$pkg" = "X$p"; then
7994	  enable_fast_install=yes
7995	fi
7996      done
7997      IFS="$lt_save_ifs"
7998      ;;
7999    esac
8000else
8001  enable_fast_install=yes
8002fi
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014# This can be used to rebuild libtool when needed
8015LIBTOOL_DEPS="$ltmain"
8016
8017# Always use our own libtool.
8018LIBTOOL='$(SHELL) $(top_builddir)/libtool'
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049test -z "$LN_S" && LN_S="ln -s"
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064if test -n "${ZSH_VERSION+set}" ; then
8065   setopt NO_GLOB_SUBST
8066fi
8067
8068{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
8069$as_echo_n "checking for objdir... " >&6; }
8070if ${lt_cv_objdir+:} false; then :
8071  $as_echo_n "(cached) " >&6
8072else
8073  rm -f .libs 2>/dev/null
8074mkdir .libs 2>/dev/null
8075if test -d .libs; then
8076  lt_cv_objdir=.libs
8077else
8078  # MS-DOS does not allow filenames that begin with a dot.
8079  lt_cv_objdir=_libs
8080fi
8081rmdir .libs 2>/dev/null
8082fi
8083{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
8084$as_echo "$lt_cv_objdir" >&6; }
8085objdir=$lt_cv_objdir
8086
8087
8088
8089
8090
8091cat >>confdefs.h <<_ACEOF
8092#define LT_OBJDIR "$lt_cv_objdir/"
8093_ACEOF
8094
8095
8096
8097
8098case $host_os in
8099aix3*)
8100  # AIX sometimes has problems with the GCC collect2 program.  For some
8101  # reason, if we set the COLLECT_NAMES environment variable, the problems
8102  # vanish in a puff of smoke.
8103  if test "X${COLLECT_NAMES+set}" != Xset; then
8104    COLLECT_NAMES=
8105    export COLLECT_NAMES
8106  fi
8107  ;;
8108esac
8109
8110# Global variables:
8111ofile=libtool
8112can_build_shared=yes
8113
8114# All known linkers require a `.a' archive for static linking (except MSVC,
8115# which needs '.lib').
8116libext=a
8117
8118with_gnu_ld="$lt_cv_prog_gnu_ld"
8119
8120old_CC="$CC"
8121old_CFLAGS="$CFLAGS"
8122
8123# Set sane defaults for various variables
8124test -z "$CC" && CC=cc
8125test -z "$LTCC" && LTCC=$CC
8126test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
8127test -z "$LD" && LD=ld
8128test -z "$ac_objext" && ac_objext=o
8129
8130for cc_temp in $compiler""; do
8131  case $cc_temp in
8132    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
8133    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
8134    \-*) ;;
8135    *) break;;
8136  esac
8137done
8138cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
8139
8140
8141# Only perform the check for file, if the check method requires it
8142test -z "$MAGIC_CMD" && MAGIC_CMD=file
8143case $deplibs_check_method in
8144file_magic*)
8145  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
8146    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
8147$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
8148if ${lt_cv_path_MAGIC_CMD+:} false; then :
8149  $as_echo_n "(cached) " >&6
8150else
8151  case $MAGIC_CMD in
8152[\\/*] |  ?:[\\/]*)
8153  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8154  ;;
8155*)
8156  lt_save_MAGIC_CMD="$MAGIC_CMD"
8157  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8158  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8159  for ac_dir in $ac_dummy; do
8160    IFS="$lt_save_ifs"
8161    test -z "$ac_dir" && ac_dir=.
8162    if test -f $ac_dir/${ac_tool_prefix}file; then
8163      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
8164      if test -n "$file_magic_test_file"; then
8165	case $deplibs_check_method in
8166	"file_magic "*)
8167	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8168	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8169	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8170	    $EGREP "$file_magic_regex" > /dev/null; then
8171	    :
8172	  else
8173	    cat <<_LT_EOF 1>&2
8174
8175*** Warning: the command libtool uses to detect shared libraries,
8176*** $file_magic_cmd, produces output that libtool cannot recognize.
8177*** The result is that libtool may fail to recognize shared libraries
8178*** as such.  This will affect the creation of libtool libraries that
8179*** depend on shared libraries, but programs linked with such libtool
8180*** libraries will work regardless of this problem.  Nevertheless, you
8181*** may want to report the problem to your system manager and/or to
8182*** bug-libtool@gnu.org
8183
8184_LT_EOF
8185	  fi ;;
8186	esac
8187      fi
8188      break
8189    fi
8190  done
8191  IFS="$lt_save_ifs"
8192  MAGIC_CMD="$lt_save_MAGIC_CMD"
8193  ;;
8194esac
8195fi
8196
8197MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8198if test -n "$MAGIC_CMD"; then
8199  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
8200$as_echo "$MAGIC_CMD" >&6; }
8201else
8202  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8203$as_echo "no" >&6; }
8204fi
8205
8206
8207
8208
8209
8210if test -z "$lt_cv_path_MAGIC_CMD"; then
8211  if test -n "$ac_tool_prefix"; then
8212    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
8213$as_echo_n "checking for file... " >&6; }
8214if ${lt_cv_path_MAGIC_CMD+:} false; then :
8215  $as_echo_n "(cached) " >&6
8216else
8217  case $MAGIC_CMD in
8218[\\/*] |  ?:[\\/]*)
8219  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
8220  ;;
8221*)
8222  lt_save_MAGIC_CMD="$MAGIC_CMD"
8223  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
8224  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
8225  for ac_dir in $ac_dummy; do
8226    IFS="$lt_save_ifs"
8227    test -z "$ac_dir" && ac_dir=.
8228    if test -f $ac_dir/file; then
8229      lt_cv_path_MAGIC_CMD="$ac_dir/file"
8230      if test -n "$file_magic_test_file"; then
8231	case $deplibs_check_method in
8232	"file_magic "*)
8233	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
8234	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8235	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
8236	    $EGREP "$file_magic_regex" > /dev/null; then
8237	    :
8238	  else
8239	    cat <<_LT_EOF 1>&2
8240
8241*** Warning: the command libtool uses to detect shared libraries,
8242*** $file_magic_cmd, produces output that libtool cannot recognize.
8243*** The result is that libtool may fail to recognize shared libraries
8244*** as such.  This will affect the creation of libtool libraries that
8245*** depend on shared libraries, but programs linked with such libtool
8246*** libraries will work regardless of this problem.  Nevertheless, you
8247*** may want to report the problem to your system manager and/or to
8248*** bug-libtool@gnu.org
8249
8250_LT_EOF
8251	  fi ;;
8252	esac
8253      fi
8254      break
8255    fi
8256  done
8257  IFS="$lt_save_ifs"
8258  MAGIC_CMD="$lt_save_MAGIC_CMD"
8259  ;;
8260esac
8261fi
8262
8263MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
8264if test -n "$MAGIC_CMD"; then
8265  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
8266$as_echo "$MAGIC_CMD" >&6; }
8267else
8268  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8269$as_echo "no" >&6; }
8270fi
8271
8272
8273  else
8274    MAGIC_CMD=:
8275  fi
8276fi
8277
8278  fi
8279  ;;
8280esac
8281
8282# Use C for the default configuration in the libtool script
8283
8284lt_save_CC="$CC"
8285ac_ext=c
8286ac_cpp='$CPP $CPPFLAGS'
8287ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
8288ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
8289ac_compiler_gnu=$ac_cv_c_compiler_gnu
8290
8291
8292# Source file extension for C test sources.
8293ac_ext=c
8294
8295# Object file extension for compiled C test sources.
8296objext=o
8297objext=$objext
8298
8299# Code to be used in simple compile tests
8300lt_simple_compile_test_code="int some_variable = 0;"
8301
8302# Code to be used in simple link tests
8303lt_simple_link_test_code='int main(){return(0);}'
8304
8305
8306
8307
8308
8309
8310
8311# If no C compiler was specified, use CC.
8312LTCC=${LTCC-"$CC"}
8313
8314# If no C compiler flags were specified, use CFLAGS.
8315LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
8316
8317# Allow CC to be a program name with arguments.
8318compiler=$CC
8319
8320# Save the default compiler, since it gets overwritten when the other
8321# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
8322compiler_DEFAULT=$CC
8323
8324# save warnings/boilerplate of simple test code
8325ac_outfile=conftest.$ac_objext
8326echo "$lt_simple_compile_test_code" >conftest.$ac_ext
8327eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8328_lt_compiler_boilerplate=`cat conftest.err`
8329$RM conftest*
8330
8331ac_outfile=conftest.$ac_objext
8332echo "$lt_simple_link_test_code" >conftest.$ac_ext
8333eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
8334_lt_linker_boilerplate=`cat conftest.err`
8335$RM -r conftest*
8336
8337
8338## CAVEAT EMPTOR:
8339## There is no encapsulation within the following macros, do not change
8340## the running order or otherwise move them around unless you know exactly
8341## what you are doing...
8342if test -n "$compiler"; then
8343
8344lt_prog_compiler_no_builtin_flag=
8345
8346if test "$GCC" = yes; then
8347  case $cc_basename in
8348  nvcc*)
8349    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
8350  *)
8351    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
8352  esac
8353
8354  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
8355$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
8356if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
8357  $as_echo_n "(cached) " >&6
8358else
8359  lt_cv_prog_compiler_rtti_exceptions=no
8360   ac_outfile=conftest.$ac_objext
8361   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8362   lt_compiler_flag="-fno-rtti -fno-exceptions"
8363   # Insert the option either (1) after the last *FLAGS variable, or
8364   # (2) before a word containing "conftest.", or (3) at the end.
8365   # Note that $ac_compile itself does not contain backslashes and begins
8366   # with a dollar sign (not a hyphen), so the echo should work correctly.
8367   # The option is referenced via a variable to avoid confusing sed.
8368   lt_compile=`echo "$ac_compile" | $SED \
8369   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8370   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8371   -e 's:$: $lt_compiler_flag:'`
8372   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8373   (eval "$lt_compile" 2>conftest.err)
8374   ac_status=$?
8375   cat conftest.err >&5
8376   echo "$as_me:$LINENO: \$? = $ac_status" >&5
8377   if (exit $ac_status) && test -s "$ac_outfile"; then
8378     # The compiler can only warn and ignore the option if not recognized
8379     # So say no if there are warnings other than the usual output.
8380     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
8381     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8382     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
8383       lt_cv_prog_compiler_rtti_exceptions=yes
8384     fi
8385   fi
8386   $RM conftest*
8387
8388fi
8389{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
8390$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
8391
8392if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
8393    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
8394else
8395    :
8396fi
8397
8398fi
8399
8400
8401
8402
8403
8404
8405  lt_prog_compiler_wl=
8406lt_prog_compiler_pic=
8407lt_prog_compiler_static=
8408
8409
8410  if test "$GCC" = yes; then
8411    lt_prog_compiler_wl='-Wl,'
8412    lt_prog_compiler_static='-static'
8413
8414    case $host_os in
8415      aix*)
8416      # All AIX code is PIC.
8417      if test "$host_cpu" = ia64; then
8418	# AIX 5 now supports IA64 processor
8419	lt_prog_compiler_static='-Bstatic'
8420      fi
8421      ;;
8422
8423    amigaos*)
8424      case $host_cpu in
8425      powerpc)
8426            # see comment about AmigaOS4 .so support
8427            lt_prog_compiler_pic='-fPIC'
8428        ;;
8429      m68k)
8430            # FIXME: we need at least 68020 code to build shared libraries, but
8431            # adding the `-m68020' flag to GCC prevents building anything better,
8432            # like `-m68040'.
8433            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
8434        ;;
8435      esac
8436      ;;
8437
8438    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
8439      # PIC is the default for these OSes.
8440      ;;
8441
8442    mingw* | cygwin* | pw32* | os2* | cegcc*)
8443      # This hack is so that the source file can tell whether it is being
8444      # built for inclusion in a dll (and should export symbols for example).
8445      # Although the cygwin gcc ignores -fPIC, still need this for old-style
8446      # (--disable-auto-import) libraries
8447      lt_prog_compiler_pic='-DDLL_EXPORT'
8448      ;;
8449
8450    darwin* | rhapsody*)
8451      # PIC is the default on this platform
8452      # Common symbols not allowed in MH_DYLIB files
8453      lt_prog_compiler_pic='-fno-common'
8454      ;;
8455
8456    haiku*)
8457      # PIC is the default for Haiku.
8458      # The "-static" flag exists, but is broken.
8459      lt_prog_compiler_static=
8460      ;;
8461
8462    hpux*)
8463      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
8464      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
8465      # sets the default TLS model and affects inlining.
8466      case $host_cpu in
8467      hppa*64*)
8468	# +Z the default
8469	;;
8470      *)
8471	lt_prog_compiler_pic='-fPIC'
8472	;;
8473      esac
8474      ;;
8475
8476    interix[3-9]*)
8477      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
8478      # Instead, we relocate shared libraries at runtime.
8479      ;;
8480
8481    msdosdjgpp*)
8482      # Just because we use GCC doesn't mean we suddenly get shared libraries
8483      # on systems that don't support them.
8484      lt_prog_compiler_can_build_shared=no
8485      enable_shared=no
8486      ;;
8487
8488    *nto* | *qnx*)
8489      # QNX uses GNU C++, but need to define -shared option too, otherwise
8490      # it will coredump.
8491      lt_prog_compiler_pic='-fPIC -shared'
8492      ;;
8493
8494    sysv4*MP*)
8495      if test -d /usr/nec; then
8496	lt_prog_compiler_pic=-Kconform_pic
8497      fi
8498      ;;
8499
8500    *)
8501      lt_prog_compiler_pic='-fPIC'
8502      ;;
8503    esac
8504
8505    case $cc_basename in
8506    nvcc*) # Cuda Compiler Driver 2.2
8507      lt_prog_compiler_wl='-Xlinker '
8508      if test -n "$lt_prog_compiler_pic"; then
8509        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
8510      fi
8511      ;;
8512    esac
8513  else
8514    # PORTME Check for flag to pass linker flags through the system compiler.
8515    case $host_os in
8516    aix*)
8517      lt_prog_compiler_wl='-Wl,'
8518      if test "$host_cpu" = ia64; then
8519	# AIX 5 now supports IA64 processor
8520	lt_prog_compiler_static='-Bstatic'
8521      else
8522	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
8523      fi
8524      ;;
8525
8526    mingw* | cygwin* | pw32* | os2* | cegcc*)
8527      # This hack is so that the source file can tell whether it is being
8528      # built for inclusion in a dll (and should export symbols for example).
8529      lt_prog_compiler_pic='-DDLL_EXPORT'
8530      ;;
8531
8532    hpux9* | hpux10* | hpux11*)
8533      lt_prog_compiler_wl='-Wl,'
8534      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
8535      # not for PA HP-UX.
8536      case $host_cpu in
8537      hppa*64*|ia64*)
8538	# +Z the default
8539	;;
8540      *)
8541	lt_prog_compiler_pic='+Z'
8542	;;
8543      esac
8544      # Is there a better lt_prog_compiler_static that works with the bundled CC?
8545      lt_prog_compiler_static='${wl}-a ${wl}archive'
8546      ;;
8547
8548    irix5* | irix6* | nonstopux*)
8549      lt_prog_compiler_wl='-Wl,'
8550      # PIC (with -KPIC) is the default.
8551      lt_prog_compiler_static='-non_shared'
8552      ;;
8553
8554    linux* | k*bsd*-gnu | kopensolaris*-gnu)
8555      case $cc_basename in
8556      # old Intel for x86_64 which still supported -KPIC.
8557      ecc*)
8558	lt_prog_compiler_wl='-Wl,'
8559	lt_prog_compiler_pic='-KPIC'
8560	lt_prog_compiler_static='-static'
8561        ;;
8562      # icc used to be incompatible with GCC.
8563      # ICC 10 doesn't accept -KPIC any more.
8564      icc* | ifort*)
8565	lt_prog_compiler_wl='-Wl,'
8566	lt_prog_compiler_pic='-fPIC'
8567	lt_prog_compiler_static='-static'
8568        ;;
8569      # Lahey Fortran 8.1.
8570      lf95*)
8571	lt_prog_compiler_wl='-Wl,'
8572	lt_prog_compiler_pic='--shared'
8573	lt_prog_compiler_static='--static'
8574	;;
8575      nagfor*)
8576	# NAG Fortran compiler
8577	lt_prog_compiler_wl='-Wl,-Wl,,'
8578	lt_prog_compiler_pic='-PIC'
8579	lt_prog_compiler_static='-Bstatic'
8580	;;
8581      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
8582        # Portland Group compilers (*not* the Pentium gcc compiler,
8583	# which looks to be a dead project)
8584	lt_prog_compiler_wl='-Wl,'
8585	lt_prog_compiler_pic='-fpic'
8586	lt_prog_compiler_static='-Bstatic'
8587        ;;
8588      ccc*)
8589        lt_prog_compiler_wl='-Wl,'
8590        # All Alpha code is PIC.
8591        lt_prog_compiler_static='-non_shared'
8592        ;;
8593      xl* | bgxl* | bgf* | mpixl*)
8594	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
8595	lt_prog_compiler_wl='-Wl,'
8596	lt_prog_compiler_pic='-qpic'
8597	lt_prog_compiler_static='-qstaticlink'
8598	;;
8599      *)
8600	case `$CC -V 2>&1 | sed 5q` in
8601	*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
8602	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
8603	  lt_prog_compiler_pic='-KPIC'
8604	  lt_prog_compiler_static='-Bstatic'
8605	  lt_prog_compiler_wl=''
8606	  ;;
8607	*Sun\ F* | *Sun*Fortran*)
8608	  lt_prog_compiler_pic='-KPIC'
8609	  lt_prog_compiler_static='-Bstatic'
8610	  lt_prog_compiler_wl='-Qoption ld '
8611	  ;;
8612	*Sun\ C*)
8613	  # Sun C 5.9
8614	  lt_prog_compiler_pic='-KPIC'
8615	  lt_prog_compiler_static='-Bstatic'
8616	  lt_prog_compiler_wl='-Wl,'
8617	  ;;
8618        *Intel*\ [CF]*Compiler*)
8619	  lt_prog_compiler_wl='-Wl,'
8620	  lt_prog_compiler_pic='-fPIC'
8621	  lt_prog_compiler_static='-static'
8622	  ;;
8623	*Portland\ Group*)
8624	  lt_prog_compiler_wl='-Wl,'
8625	  lt_prog_compiler_pic='-fpic'
8626	  lt_prog_compiler_static='-Bstatic'
8627	  ;;
8628	esac
8629	;;
8630      esac
8631      ;;
8632
8633    newsos6)
8634      lt_prog_compiler_pic='-KPIC'
8635      lt_prog_compiler_static='-Bstatic'
8636      ;;
8637
8638    *nto* | *qnx*)
8639      # QNX uses GNU C++, but need to define -shared option too, otherwise
8640      # it will coredump.
8641      lt_prog_compiler_pic='-fPIC -shared'
8642      ;;
8643
8644    osf3* | osf4* | osf5*)
8645      lt_prog_compiler_wl='-Wl,'
8646      # All OSF/1 code is PIC.
8647      lt_prog_compiler_static='-non_shared'
8648      ;;
8649
8650    rdos*)
8651      lt_prog_compiler_static='-non_shared'
8652      ;;
8653
8654    solaris*)
8655      lt_prog_compiler_pic='-KPIC'
8656      lt_prog_compiler_static='-Bstatic'
8657      case $cc_basename in
8658      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
8659	lt_prog_compiler_wl='-Qoption ld ';;
8660      *)
8661	lt_prog_compiler_wl='-Wl,';;
8662      esac
8663      ;;
8664
8665    sunos4*)
8666      lt_prog_compiler_wl='-Qoption ld '
8667      lt_prog_compiler_pic='-PIC'
8668      lt_prog_compiler_static='-Bstatic'
8669      ;;
8670
8671    sysv4 | sysv4.2uw2* | sysv4.3*)
8672      lt_prog_compiler_wl='-Wl,'
8673      lt_prog_compiler_pic='-KPIC'
8674      lt_prog_compiler_static='-Bstatic'
8675      ;;
8676
8677    sysv4*MP*)
8678      if test -d /usr/nec ;then
8679	lt_prog_compiler_pic='-Kconform_pic'
8680	lt_prog_compiler_static='-Bstatic'
8681      fi
8682      ;;
8683
8684    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
8685      lt_prog_compiler_wl='-Wl,'
8686      lt_prog_compiler_pic='-KPIC'
8687      lt_prog_compiler_static='-Bstatic'
8688      ;;
8689
8690    unicos*)
8691      lt_prog_compiler_wl='-Wl,'
8692      lt_prog_compiler_can_build_shared=no
8693      ;;
8694
8695    uts4*)
8696      lt_prog_compiler_pic='-pic'
8697      lt_prog_compiler_static='-Bstatic'
8698      ;;
8699
8700    *)
8701      lt_prog_compiler_can_build_shared=no
8702      ;;
8703    esac
8704  fi
8705
8706case $host_os in
8707  # For platforms which do not support PIC, -DPIC is meaningless:
8708  *djgpp*)
8709    lt_prog_compiler_pic=
8710    ;;
8711  *)
8712    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
8713    ;;
8714esac
8715
8716{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
8717$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
8718if ${lt_cv_prog_compiler_pic+:} false; then :
8719  $as_echo_n "(cached) " >&6
8720else
8721  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
8722fi
8723{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
8724$as_echo "$lt_cv_prog_compiler_pic" >&6; }
8725lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
8726
8727#
8728# Check to make sure the PIC flag actually works.
8729#
8730if test -n "$lt_prog_compiler_pic"; then
8731  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
8732$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
8733if ${lt_cv_prog_compiler_pic_works+:} false; then :
8734  $as_echo_n "(cached) " >&6
8735else
8736  lt_cv_prog_compiler_pic_works=no
8737   ac_outfile=conftest.$ac_objext
8738   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8739   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
8740   # Insert the option either (1) after the last *FLAGS variable, or
8741   # (2) before a word containing "conftest.", or (3) at the end.
8742   # Note that $ac_compile itself does not contain backslashes and begins
8743   # with a dollar sign (not a hyphen), so the echo should work correctly.
8744   # The option is referenced via a variable to avoid confusing sed.
8745   lt_compile=`echo "$ac_compile" | $SED \
8746   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8747   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8748   -e 's:$: $lt_compiler_flag:'`
8749   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8750   (eval "$lt_compile" 2>conftest.err)
8751   ac_status=$?
8752   cat conftest.err >&5
8753   echo "$as_me:$LINENO: \$? = $ac_status" >&5
8754   if (exit $ac_status) && test -s "$ac_outfile"; then
8755     # The compiler can only warn and ignore the option if not recognized
8756     # So say no if there are warnings other than the usual output.
8757     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
8758     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8759     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
8760       lt_cv_prog_compiler_pic_works=yes
8761     fi
8762   fi
8763   $RM conftest*
8764
8765fi
8766{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
8767$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
8768
8769if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
8770    case $lt_prog_compiler_pic in
8771     "" | " "*) ;;
8772     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
8773     esac
8774else
8775    lt_prog_compiler_pic=
8776     lt_prog_compiler_can_build_shared=no
8777fi
8778
8779fi
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791#
8792# Check to make sure the static flag actually works.
8793#
8794wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
8795{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
8796$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
8797if ${lt_cv_prog_compiler_static_works+:} false; then :
8798  $as_echo_n "(cached) " >&6
8799else
8800  lt_cv_prog_compiler_static_works=no
8801   save_LDFLAGS="$LDFLAGS"
8802   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
8803   echo "$lt_simple_link_test_code" > conftest.$ac_ext
8804   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
8805     # The linker can only warn and ignore the option if not recognized
8806     # So say no if there are warnings
8807     if test -s conftest.err; then
8808       # Append any errors to the config.log.
8809       cat conftest.err 1>&5
8810       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
8811       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
8812       if diff conftest.exp conftest.er2 >/dev/null; then
8813         lt_cv_prog_compiler_static_works=yes
8814       fi
8815     else
8816       lt_cv_prog_compiler_static_works=yes
8817     fi
8818   fi
8819   $RM -r conftest*
8820   LDFLAGS="$save_LDFLAGS"
8821
8822fi
8823{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
8824$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
8825
8826if test x"$lt_cv_prog_compiler_static_works" = xyes; then
8827    :
8828else
8829    lt_prog_compiler_static=
8830fi
8831
8832
8833
8834
8835
8836
8837
8838  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8839$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8840if ${lt_cv_prog_compiler_c_o+:} false; then :
8841  $as_echo_n "(cached) " >&6
8842else
8843  lt_cv_prog_compiler_c_o=no
8844   $RM -r conftest 2>/dev/null
8845   mkdir conftest
8846   cd conftest
8847   mkdir out
8848   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8849
8850   lt_compiler_flag="-o out/conftest2.$ac_objext"
8851   # Insert the option either (1) after the last *FLAGS variable, or
8852   # (2) before a word containing "conftest.", or (3) at the end.
8853   # Note that $ac_compile itself does not contain backslashes and begins
8854   # with a dollar sign (not a hyphen), so the echo should work correctly.
8855   lt_compile=`echo "$ac_compile" | $SED \
8856   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8857   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8858   -e 's:$: $lt_compiler_flag:'`
8859   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8860   (eval "$lt_compile" 2>out/conftest.err)
8861   ac_status=$?
8862   cat out/conftest.err >&5
8863   echo "$as_me:$LINENO: \$? = $ac_status" >&5
8864   if (exit $ac_status) && test -s out/conftest2.$ac_objext
8865   then
8866     # The compiler can only warn and ignore the option if not recognized
8867     # So say no if there are warnings
8868     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
8869     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8870     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8871       lt_cv_prog_compiler_c_o=yes
8872     fi
8873   fi
8874   chmod u+w . 2>&5
8875   $RM conftest*
8876   # SGI C++ compiler will create directory out/ii_files/ for
8877   # template instantiation
8878   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8879   $RM out/* && rmdir out
8880   cd ..
8881   $RM -r conftest
8882   $RM conftest*
8883
8884fi
8885{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8886$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8887
8888
8889
8890
8891
8892
8893  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
8894$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
8895if ${lt_cv_prog_compiler_c_o+:} false; then :
8896  $as_echo_n "(cached) " >&6
8897else
8898  lt_cv_prog_compiler_c_o=no
8899   $RM -r conftest 2>/dev/null
8900   mkdir conftest
8901   cd conftest
8902   mkdir out
8903   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
8904
8905   lt_compiler_flag="-o out/conftest2.$ac_objext"
8906   # Insert the option either (1) after the last *FLAGS variable, or
8907   # (2) before a word containing "conftest.", or (3) at the end.
8908   # Note that $ac_compile itself does not contain backslashes and begins
8909   # with a dollar sign (not a hyphen), so the echo should work correctly.
8910   lt_compile=`echo "$ac_compile" | $SED \
8911   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
8912   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
8913   -e 's:$: $lt_compiler_flag:'`
8914   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
8915   (eval "$lt_compile" 2>out/conftest.err)
8916   ac_status=$?
8917   cat out/conftest.err >&5
8918   echo "$as_me:$LINENO: \$? = $ac_status" >&5
8919   if (exit $ac_status) && test -s out/conftest2.$ac_objext
8920   then
8921     # The compiler can only warn and ignore the option if not recognized
8922     # So say no if there are warnings
8923     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
8924     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
8925     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
8926       lt_cv_prog_compiler_c_o=yes
8927     fi
8928   fi
8929   chmod u+w . 2>&5
8930   $RM conftest*
8931   # SGI C++ compiler will create directory out/ii_files/ for
8932   # template instantiation
8933   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
8934   $RM out/* && rmdir out
8935   cd ..
8936   $RM -r conftest
8937   $RM conftest*
8938
8939fi
8940{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
8941$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
8942
8943
8944
8945
8946hard_links="nottested"
8947if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
8948  # do not overwrite the value of need_locks provided by the user
8949  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
8950$as_echo_n "checking if we can lock with hard links... " >&6; }
8951  hard_links=yes
8952  $RM conftest*
8953  ln conftest.a conftest.b 2>/dev/null && hard_links=no
8954  touch conftest.a
8955  ln conftest.a conftest.b 2>&5 || hard_links=no
8956  ln conftest.a conftest.b 2>/dev/null && hard_links=no
8957  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
8958$as_echo "$hard_links" >&6; }
8959  if test "$hard_links" = no; then
8960    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
8961$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
8962    need_locks=warn
8963  fi
8964else
8965  need_locks=no
8966fi
8967
8968
8969
8970
8971
8972
8973  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
8974$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
8975
8976  runpath_var=
8977  allow_undefined_flag=
8978  always_export_symbols=no
8979  archive_cmds=
8980  archive_expsym_cmds=
8981  compiler_needs_object=no
8982  enable_shared_with_static_runtimes=no
8983  export_dynamic_flag_spec=
8984  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
8985  hardcode_automatic=no
8986  hardcode_direct=no
8987  hardcode_direct_absolute=no
8988  hardcode_libdir_flag_spec=
8989  hardcode_libdir_separator=
8990  hardcode_minus_L=no
8991  hardcode_shlibpath_var=unsupported
8992  inherit_rpath=no
8993  link_all_deplibs=unknown
8994  module_cmds=
8995  module_expsym_cmds=
8996  old_archive_from_new_cmds=
8997  old_archive_from_expsyms_cmds=
8998  thread_safe_flag_spec=
8999  whole_archive_flag_spec=
9000  # include_expsyms should be a list of space-separated symbols to be *always*
9001  # included in the symbol list
9002  include_expsyms=
9003  # exclude_expsyms can be an extended regexp of symbols to exclude
9004  # it will be wrapped by ` (' and `)$', so one must not match beginning or
9005  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
9006  # as well as any symbol that contains `d'.
9007  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
9008  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
9009  # platforms (ab)use it in PIC code, but their linkers get confused if
9010  # the symbol is explicitly referenced.  Since portable code cannot
9011  # rely on this symbol name, it's probably fine to never include it in
9012  # preloaded symbol tables.
9013  # Exclude shared library initialization/finalization symbols.
9014  extract_expsyms_cmds=
9015
9016  case $host_os in
9017  cygwin* | mingw* | pw32* | cegcc*)
9018    # FIXME: the MSVC++ port hasn't been tested in a loooong time
9019    # When not using gcc, we currently assume that we are using
9020    # Microsoft Visual C++.
9021    if test "$GCC" != yes; then
9022      with_gnu_ld=no
9023    fi
9024    ;;
9025  interix*)
9026    # we just hope/assume this is gcc and not c89 (= MSVC++)
9027    with_gnu_ld=yes
9028    ;;
9029  openbsd*)
9030    with_gnu_ld=no
9031    ;;
9032  esac
9033
9034  ld_shlibs=yes
9035
9036  # On some targets, GNU ld is compatible enough with the native linker
9037  # that we're better off using the native interface for both.
9038  lt_use_gnu_ld_interface=no
9039  if test "$with_gnu_ld" = yes; then
9040    case $host_os in
9041      aix*)
9042	# The AIX port of GNU ld has always aspired to compatibility
9043	# with the native linker.  However, as the warning in the GNU ld
9044	# block says, versions before 2.19.5* couldn't really create working
9045	# shared libraries, regardless of the interface used.
9046	case `$LD -v 2>&1` in
9047	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
9048	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
9049	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
9050	  *)
9051	    lt_use_gnu_ld_interface=yes
9052	    ;;
9053	esac
9054	;;
9055      *)
9056	lt_use_gnu_ld_interface=yes
9057	;;
9058    esac
9059  fi
9060
9061  if test "$lt_use_gnu_ld_interface" = yes; then
9062    # If archive_cmds runs LD, not CC, wlarc should be empty
9063    wlarc='${wl}'
9064
9065    # Set some defaults for GNU ld with shared library support. These
9066    # are reset later if shared libraries are not supported. Putting them
9067    # here allows them to be overridden if necessary.
9068    runpath_var=LD_RUN_PATH
9069    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9070    export_dynamic_flag_spec='${wl}--export-dynamic'
9071    # ancient GNU ld didn't support --whole-archive et. al.
9072    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
9073      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
9074    else
9075      whole_archive_flag_spec=
9076    fi
9077    supports_anon_versioning=no
9078    case `$LD -v 2>&1` in
9079      *GNU\ gold*) supports_anon_versioning=yes ;;
9080      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
9081      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
9082      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
9083      *\ 2.11.*) ;; # other 2.11 versions
9084      *) supports_anon_versioning=yes ;;
9085    esac
9086
9087    # See if GNU ld supports shared libraries.
9088    case $host_os in
9089    aix[3-9]*)
9090      # On AIX/PPC, the GNU linker is very broken
9091      if test "$host_cpu" != ia64; then
9092	ld_shlibs=no
9093	cat <<_LT_EOF 1>&2
9094
9095*** Warning: the GNU linker, at least up to release 2.19, is reported
9096*** to be unable to reliably create shared libraries on AIX.
9097*** Therefore, libtool is disabling shared libraries support.  If you
9098*** really care for shared libraries, you may want to install binutils
9099*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
9100*** You will then need to restart the configuration process.
9101
9102_LT_EOF
9103      fi
9104      ;;
9105
9106    amigaos*)
9107      case $host_cpu in
9108      powerpc)
9109            # see comment about AmigaOS4 .so support
9110            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9111            archive_expsym_cmds=''
9112        ;;
9113      m68k)
9114            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
9115            hardcode_libdir_flag_spec='-L$libdir'
9116            hardcode_minus_L=yes
9117        ;;
9118      esac
9119      ;;
9120
9121    beos*)
9122      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9123	allow_undefined_flag=unsupported
9124	# Joseph Beckenbach <jrb3@best.com> says some releases of gcc
9125	# support --undefined.  This deserves some investigation.  FIXME
9126	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9127      else
9128	ld_shlibs=no
9129      fi
9130      ;;
9131
9132    cygwin* | mingw* | pw32* | cegcc*)
9133      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
9134      # as there is no search path for DLLs.
9135      hardcode_libdir_flag_spec='-L$libdir'
9136      export_dynamic_flag_spec='${wl}--export-all-symbols'
9137      allow_undefined_flag=unsupported
9138      always_export_symbols=no
9139      enable_shared_with_static_runtimes=yes
9140      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
9141      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
9142
9143      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
9144        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9145	# If the export-symbols file already is a .def file (1st line
9146	# is EXPORTS), use it as is; otherwise, prepend...
9147	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9148	  cp $export_symbols $output_objdir/$soname.def;
9149	else
9150	  echo EXPORTS > $output_objdir/$soname.def;
9151	  cat $export_symbols >> $output_objdir/$soname.def;
9152	fi~
9153	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
9154      else
9155	ld_shlibs=no
9156      fi
9157      ;;
9158
9159    haiku*)
9160      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9161      link_all_deplibs=yes
9162      ;;
9163
9164    interix[3-9]*)
9165      hardcode_direct=no
9166      hardcode_shlibpath_var=no
9167      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9168      export_dynamic_flag_spec='${wl}-E'
9169      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
9170      # Instead, shared libraries are loaded at an image base (0x10000000 by
9171      # default) and relocated if they conflict, which is a slow very memory
9172      # consuming and fragmenting process.  To avoid this, we pick a random,
9173      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
9174      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
9175      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9176      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
9177      ;;
9178
9179    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
9180      tmp_diet=no
9181      if test "$host_os" = linux-dietlibc; then
9182	case $cc_basename in
9183	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
9184	esac
9185      fi
9186      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
9187	 && test "$tmp_diet" = no
9188      then
9189	tmp_addflag=' $pic_flag'
9190	tmp_sharedflag='-shared'
9191	case $cc_basename,$host_cpu in
9192        pgcc*)				# Portland Group C compiler
9193	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9194	  tmp_addflag=' $pic_flag'
9195	  ;;
9196	pgf77* | pgf90* | pgf95* | pgfortran*)
9197					# Portland Group f77 and f90 compilers
9198	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9199	  tmp_addflag=' $pic_flag -Mnomain' ;;
9200	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
9201	  tmp_addflag=' -i_dynamic' ;;
9202	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
9203	  tmp_addflag=' -i_dynamic -nofor_main' ;;
9204	ifc* | ifort*)			# Intel Fortran compiler
9205	  tmp_addflag=' -nofor_main' ;;
9206	lf95*)				# Lahey Fortran 8.1
9207	  whole_archive_flag_spec=
9208	  tmp_sharedflag='--shared' ;;
9209	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
9210	  tmp_sharedflag='-qmkshrobj'
9211	  tmp_addflag= ;;
9212	nvcc*)	# Cuda Compiler Driver 2.2
9213	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9214	  compiler_needs_object=yes
9215	  ;;
9216	esac
9217	case `$CC -V 2>&1 | sed 5q` in
9218	*Sun\ C*)			# Sun C 5.9
9219	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
9220	  compiler_needs_object=yes
9221	  tmp_sharedflag='-G' ;;
9222	*Sun\ F*)			# Sun Fortran 8.3
9223	  tmp_sharedflag='-G' ;;
9224	esac
9225	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9226
9227        if test "x$supports_anon_versioning" = xyes; then
9228          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9229	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9230	    echo "local: *; };" >> $output_objdir/$libname.ver~
9231	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
9232        fi
9233
9234	case $cc_basename in
9235	xlf* | bgf* | bgxlf* | mpixlf*)
9236	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
9237	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
9238	  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9239	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
9240	  if test "x$supports_anon_versioning" = xyes; then
9241	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
9242	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
9243	      echo "local: *; };" >> $output_objdir/$libname.ver~
9244	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
9245	  fi
9246	  ;;
9247	esac
9248      else
9249        ld_shlibs=no
9250      fi
9251      ;;
9252
9253    netbsd*)
9254      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9255	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
9256	wlarc=
9257      else
9258	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9259	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9260      fi
9261      ;;
9262
9263    solaris*)
9264      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
9265	ld_shlibs=no
9266	cat <<_LT_EOF 1>&2
9267
9268*** Warning: The releases 2.8.* of the GNU linker cannot reliably
9269*** create shared libraries on Solaris systems.  Therefore, libtool
9270*** is disabling shared libraries support.  We urge you to upgrade GNU
9271*** binutils to release 2.9.1 or newer.  Another option is to modify
9272*** your PATH or compiler configuration so that the native linker is
9273*** used, and then restart.
9274
9275_LT_EOF
9276      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9277	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9278	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9279      else
9280	ld_shlibs=no
9281      fi
9282      ;;
9283
9284    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
9285      case `$LD -v 2>&1` in
9286        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
9287	ld_shlibs=no
9288	cat <<_LT_EOF 1>&2
9289
9290*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
9291*** reliably create shared libraries on SCO systems.  Therefore, libtool
9292*** is disabling shared libraries support.  We urge you to upgrade GNU
9293*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
9294*** your PATH or compiler configuration so that the native linker is
9295*** used, and then restart.
9296
9297_LT_EOF
9298	;;
9299	*)
9300	  # For security reasons, it is highly recommended that you always
9301	  # use absolute paths for naming shared libraries, and exclude the
9302	  # DT_RUNPATH tag from executables and libraries.  But doing so
9303	  # requires that you compile everything twice, which is a pain.
9304	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9305	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9306	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9307	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9308	  else
9309	    ld_shlibs=no
9310	  fi
9311	;;
9312      esac
9313      ;;
9314
9315    sunos4*)
9316      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9317      wlarc=
9318      hardcode_direct=yes
9319      hardcode_shlibpath_var=no
9320      ;;
9321
9322    *)
9323      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
9324	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9325	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
9326      else
9327	ld_shlibs=no
9328      fi
9329      ;;
9330    esac
9331
9332    if test "$ld_shlibs" = no; then
9333      runpath_var=
9334      hardcode_libdir_flag_spec=
9335      export_dynamic_flag_spec=
9336      whole_archive_flag_spec=
9337    fi
9338  else
9339    # PORTME fill in a description of your system's linker (not GNU ld)
9340    case $host_os in
9341    aix3*)
9342      allow_undefined_flag=unsupported
9343      always_export_symbols=yes
9344      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
9345      # Note: this linker hardcodes the directories in LIBPATH if there
9346      # are no directories specified by -L.
9347      hardcode_minus_L=yes
9348      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
9349	# Neither direct hardcoding nor static linking is supported with a
9350	# broken collect2.
9351	hardcode_direct=unsupported
9352      fi
9353      ;;
9354
9355    aix[4-9]*)
9356      if test "$host_cpu" = ia64; then
9357	# On IA64, the linker does run time linking by default, so we don't
9358	# have to do anything special.
9359	aix_use_runtimelinking=no
9360	exp_sym_flag='-Bexport'
9361	no_entry_flag=""
9362      else
9363	# If we're using GNU nm, then we don't want the "-C" option.
9364	# -C means demangle to AIX nm, but means don't demangle with GNU nm
9365	# Also, AIX nm treats weak defined symbols like other global
9366	# defined symbols, whereas GNU nm marks them as "W".
9367	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
9368	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
9369	else
9370	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
9371	fi
9372	aix_use_runtimelinking=no
9373
9374	# Test if we are trying to use run time linking or normal
9375	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
9376	# need to do runtime linking.
9377	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
9378	  for ld_flag in $LDFLAGS; do
9379	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
9380	    aix_use_runtimelinking=yes
9381	    break
9382	  fi
9383	  done
9384	  ;;
9385	esac
9386
9387	exp_sym_flag='-bexport'
9388	no_entry_flag='-bnoentry'
9389      fi
9390
9391      # When large executables or shared objects are built, AIX ld can
9392      # have problems creating the table of contents.  If linking a library
9393      # or program results in "error TOC overflow" add -mminimal-toc to
9394      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
9395      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
9396
9397      archive_cmds=''
9398      hardcode_direct=yes
9399      hardcode_direct_absolute=yes
9400      hardcode_libdir_separator=':'
9401      link_all_deplibs=yes
9402      file_list_spec='${wl}-f,'
9403
9404      if test "$GCC" = yes; then
9405	case $host_os in aix4.[012]|aix4.[012].*)
9406	# We only want to do this on AIX 4.2 and lower, the check
9407	# below for broken collect2 doesn't work under 4.3+
9408	  collect2name=`${CC} -print-prog-name=collect2`
9409	  if test -f "$collect2name" &&
9410	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
9411	  then
9412	  # We have reworked collect2
9413	  :
9414	  else
9415	  # We have old collect2
9416	  hardcode_direct=unsupported
9417	  # It fails to find uninstalled libraries when the uninstalled
9418	  # path is not listed in the libpath.  Setting hardcode_minus_L
9419	  # to unsupported forces relinking
9420	  hardcode_minus_L=yes
9421	  hardcode_libdir_flag_spec='-L$libdir'
9422	  hardcode_libdir_separator=
9423	  fi
9424	  ;;
9425	esac
9426	shared_flag='-shared'
9427	if test "$aix_use_runtimelinking" = yes; then
9428	  shared_flag="$shared_flag "'${wl}-G'
9429	fi
9430      else
9431	# not using gcc
9432	if test "$host_cpu" = ia64; then
9433	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
9434	# chokes on -Wl,-G. The following line is correct:
9435	  shared_flag='-G'
9436	else
9437	  if test "$aix_use_runtimelinking" = yes; then
9438	    shared_flag='${wl}-G'
9439	  else
9440	    shared_flag='${wl}-bM:SRE'
9441	  fi
9442	fi
9443      fi
9444
9445      export_dynamic_flag_spec='${wl}-bexpall'
9446      # It seems that -bexpall does not export symbols beginning with
9447      # underscore (_), so it is better to generate a list of symbols to export.
9448      always_export_symbols=yes
9449      if test "$aix_use_runtimelinking" = yes; then
9450	# Warning - without using the other runtime loading flags (-brtl),
9451	# -berok will link without error, but may produce a broken library.
9452	allow_undefined_flag='-berok'
9453        # Determine the default libpath from the value encoded in an
9454        # empty executable.
9455        if test "${lt_cv_aix_libpath+set}" = set; then
9456  aix_libpath=$lt_cv_aix_libpath
9457else
9458  if ${lt_cv_aix_libpath_+:} false; then :
9459  $as_echo_n "(cached) " >&6
9460else
9461  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9462/* end confdefs.h.  */
9463
9464int
9465main ()
9466{
9467
9468  ;
9469  return 0;
9470}
9471_ACEOF
9472if ac_fn_c_try_link "$LINENO"; then :
9473
9474  lt_aix_libpath_sed='
9475      /Import File Strings/,/^$/ {
9476	  /^0/ {
9477	      s/^0  *\([^ ]*\) *$/\1/
9478	      p
9479	  }
9480      }'
9481  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9482  # Check for a 64-bit object if we didn't find anything.
9483  if test -z "$lt_cv_aix_libpath_"; then
9484    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9485  fi
9486fi
9487rm -f core conftest.err conftest.$ac_objext \
9488    conftest$ac_exeext conftest.$ac_ext
9489  if test -z "$lt_cv_aix_libpath_"; then
9490    lt_cv_aix_libpath_="/usr/lib:/lib"
9491  fi
9492
9493fi
9494
9495  aix_libpath=$lt_cv_aix_libpath_
9496fi
9497
9498        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
9499        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
9500      else
9501	if test "$host_cpu" = ia64; then
9502	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
9503	  allow_undefined_flag="-z nodefs"
9504	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
9505	else
9506	 # Determine the default libpath from the value encoded in an
9507	 # empty executable.
9508	 if test "${lt_cv_aix_libpath+set}" = set; then
9509  aix_libpath=$lt_cv_aix_libpath
9510else
9511  if ${lt_cv_aix_libpath_+:} false; then :
9512  $as_echo_n "(cached) " >&6
9513else
9514  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9515/* end confdefs.h.  */
9516
9517int
9518main ()
9519{
9520
9521  ;
9522  return 0;
9523}
9524_ACEOF
9525if ac_fn_c_try_link "$LINENO"; then :
9526
9527  lt_aix_libpath_sed='
9528      /Import File Strings/,/^$/ {
9529	  /^0/ {
9530	      s/^0  *\([^ ]*\) *$/\1/
9531	      p
9532	  }
9533      }'
9534  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9535  # Check for a 64-bit object if we didn't find anything.
9536  if test -z "$lt_cv_aix_libpath_"; then
9537    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
9538  fi
9539fi
9540rm -f core conftest.err conftest.$ac_objext \
9541    conftest$ac_exeext conftest.$ac_ext
9542  if test -z "$lt_cv_aix_libpath_"; then
9543    lt_cv_aix_libpath_="/usr/lib:/lib"
9544  fi
9545
9546fi
9547
9548  aix_libpath=$lt_cv_aix_libpath_
9549fi
9550
9551	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
9552	  # Warning - without using the other run time loading flags,
9553	  # -berok will link without error, but may produce a broken library.
9554	  no_undefined_flag=' ${wl}-bernotok'
9555	  allow_undefined_flag=' ${wl}-berok'
9556	  if test "$with_gnu_ld" = yes; then
9557	    # We only use this code for GNU lds that support --whole-archive.
9558	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
9559	  else
9560	    # Exported symbols can be pulled into shared objects from archives
9561	    whole_archive_flag_spec='$convenience'
9562	  fi
9563	  archive_cmds_need_lc=yes
9564	  # This is similar to how AIX traditionally builds its shared libraries.
9565	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
9566	fi
9567      fi
9568      ;;
9569
9570    amigaos*)
9571      case $host_cpu in
9572      powerpc)
9573            # see comment about AmigaOS4 .so support
9574            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
9575            archive_expsym_cmds=''
9576        ;;
9577      m68k)
9578            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
9579            hardcode_libdir_flag_spec='-L$libdir'
9580            hardcode_minus_L=yes
9581        ;;
9582      esac
9583      ;;
9584
9585    bsdi[45]*)
9586      export_dynamic_flag_spec=-rdynamic
9587      ;;
9588
9589    cygwin* | mingw* | pw32* | cegcc*)
9590      # When not using gcc, we currently assume that we are using
9591      # Microsoft Visual C++.
9592      # hardcode_libdir_flag_spec is actually meaningless, as there is
9593      # no search path for DLLs.
9594      case $cc_basename in
9595      cl*)
9596	# Native MSVC
9597	hardcode_libdir_flag_spec=' '
9598	allow_undefined_flag=unsupported
9599	always_export_symbols=yes
9600	file_list_spec='@'
9601	# Tell ltmain to make .lib files, not .a files.
9602	libext=lib
9603	# Tell ltmain to make .dll files, not .so files.
9604	shrext_cmds=".dll"
9605	# FIXME: Setting linknames here is a bad hack.
9606	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
9607	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
9608	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
9609	  else
9610	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
9611	  fi~
9612	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
9613	  linknames='
9614	# The linker will not automatically build a static lib if we build a DLL.
9615	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
9616	enable_shared_with_static_runtimes=yes
9617	exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
9618	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
9619	# Don't use ranlib
9620	old_postinstall_cmds='chmod 644 $oldlib'
9621	postlink_cmds='lt_outputfile="@OUTPUT@"~
9622	  lt_tool_outputfile="@TOOL_OUTPUT@"~
9623	  case $lt_outputfile in
9624	    *.exe|*.EXE) ;;
9625	    *)
9626	      lt_outputfile="$lt_outputfile.exe"
9627	      lt_tool_outputfile="$lt_tool_outputfile.exe"
9628	      ;;
9629	  esac~
9630	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
9631	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
9632	    $RM "$lt_outputfile.manifest";
9633	  fi'
9634	;;
9635      *)
9636	# Assume MSVC wrapper
9637	hardcode_libdir_flag_spec=' '
9638	allow_undefined_flag=unsupported
9639	# Tell ltmain to make .lib files, not .a files.
9640	libext=lib
9641	# Tell ltmain to make .dll files, not .so files.
9642	shrext_cmds=".dll"
9643	# FIXME: Setting linknames here is a bad hack.
9644	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
9645	# The linker will automatically build a .lib file if we build a DLL.
9646	old_archive_from_new_cmds='true'
9647	# FIXME: Should let the user specify the lib program.
9648	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
9649	enable_shared_with_static_runtimes=yes
9650	;;
9651      esac
9652      ;;
9653
9654    darwin* | rhapsody*)
9655
9656
9657  archive_cmds_need_lc=no
9658  hardcode_direct=no
9659  hardcode_automatic=yes
9660  hardcode_shlibpath_var=unsupported
9661  if test "$lt_cv_ld_force_load" = "yes"; then
9662    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
9663
9664  else
9665    whole_archive_flag_spec=''
9666  fi
9667  link_all_deplibs=yes
9668  allow_undefined_flag="$_lt_dar_allow_undefined"
9669  case $cc_basename in
9670     ifort*) _lt_dar_can_shared=yes ;;
9671     *) _lt_dar_can_shared=$GCC ;;
9672  esac
9673  if test "$_lt_dar_can_shared" = "yes"; then
9674    output_verbose_link_cmd=func_echo_all
9675    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
9676    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
9677    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
9678    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
9679
9680  else
9681  ld_shlibs=no
9682  fi
9683
9684      ;;
9685
9686    dgux*)
9687      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9688      hardcode_libdir_flag_spec='-L$libdir'
9689      hardcode_shlibpath_var=no
9690      ;;
9691
9692    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
9693    # support.  Future versions do this automatically, but an explicit c++rt0.o
9694    # does not break anything, and helps significantly (at the cost of a little
9695    # extra space).
9696    freebsd2.2*)
9697      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
9698      hardcode_libdir_flag_spec='-R$libdir'
9699      hardcode_direct=yes
9700      hardcode_shlibpath_var=no
9701      ;;
9702
9703    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
9704    freebsd2.*)
9705      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9706      hardcode_direct=yes
9707      hardcode_minus_L=yes
9708      hardcode_shlibpath_var=no
9709      ;;
9710
9711    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9712    freebsd* | dragonfly*)
9713      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9714      hardcode_libdir_flag_spec='-R$libdir'
9715      hardcode_direct=yes
9716      hardcode_shlibpath_var=no
9717      ;;
9718
9719    hpux9*)
9720      if test "$GCC" = yes; then
9721	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
9722      else
9723	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
9724      fi
9725      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
9726      hardcode_libdir_separator=:
9727      hardcode_direct=yes
9728
9729      # hardcode_minus_L: Not really in the search PATH,
9730      # but as the default location of the library.
9731      hardcode_minus_L=yes
9732      export_dynamic_flag_spec='${wl}-E'
9733      ;;
9734
9735    hpux10*)
9736      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
9737	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9738      else
9739	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9740      fi
9741      if test "$with_gnu_ld" = no; then
9742	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
9743	hardcode_libdir_separator=:
9744	hardcode_direct=yes
9745	hardcode_direct_absolute=yes
9746	export_dynamic_flag_spec='${wl}-E'
9747	# hardcode_minus_L: Not really in the search PATH,
9748	# but as the default location of the library.
9749	hardcode_minus_L=yes
9750      fi
9751      ;;
9752
9753    hpux11*)
9754      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
9755	case $host_cpu in
9756	hppa*64*)
9757	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9758	  ;;
9759	ia64*)
9760	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9761	  ;;
9762	*)
9763	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9764	  ;;
9765	esac
9766      else
9767	case $host_cpu in
9768	hppa*64*)
9769	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9770	  ;;
9771	ia64*)
9772	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
9773	  ;;
9774	*)
9775
9776	  # Older versions of the 11.00 compiler do not understand -b yet
9777	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
9778	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
9779$as_echo_n "checking if $CC understands -b... " >&6; }
9780if ${lt_cv_prog_compiler__b+:} false; then :
9781  $as_echo_n "(cached) " >&6
9782else
9783  lt_cv_prog_compiler__b=no
9784   save_LDFLAGS="$LDFLAGS"
9785   LDFLAGS="$LDFLAGS -b"
9786   echo "$lt_simple_link_test_code" > conftest.$ac_ext
9787   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
9788     # The linker can only warn and ignore the option if not recognized
9789     # So say no if there are warnings
9790     if test -s conftest.err; then
9791       # Append any errors to the config.log.
9792       cat conftest.err 1>&5
9793       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
9794       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
9795       if diff conftest.exp conftest.er2 >/dev/null; then
9796         lt_cv_prog_compiler__b=yes
9797       fi
9798     else
9799       lt_cv_prog_compiler__b=yes
9800     fi
9801   fi
9802   $RM -r conftest*
9803   LDFLAGS="$save_LDFLAGS"
9804
9805fi
9806{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
9807$as_echo "$lt_cv_prog_compiler__b" >&6; }
9808
9809if test x"$lt_cv_prog_compiler__b" = xyes; then
9810    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
9811else
9812    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
9813fi
9814
9815	  ;;
9816	esac
9817      fi
9818      if test "$with_gnu_ld" = no; then
9819	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
9820	hardcode_libdir_separator=:
9821
9822	case $host_cpu in
9823	hppa*64*|ia64*)
9824	  hardcode_direct=no
9825	  hardcode_shlibpath_var=no
9826	  ;;
9827	*)
9828	  hardcode_direct=yes
9829	  hardcode_direct_absolute=yes
9830	  export_dynamic_flag_spec='${wl}-E'
9831
9832	  # hardcode_minus_L: Not really in the search PATH,
9833	  # but as the default location of the library.
9834	  hardcode_minus_L=yes
9835	  ;;
9836	esac
9837      fi
9838      ;;
9839
9840    irix5* | irix6* | nonstopux*)
9841      if test "$GCC" = yes; then
9842	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
9843	# Try to use the -exported_symbol ld option, if it does not
9844	# work, assume that -exports_file does not work either and
9845	# implicitly export all symbols.
9846	# This should be the same for all languages, so no per-tag cache variable.
9847	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
9848$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
9849if ${lt_cv_irix_exported_symbol+:} false; then :
9850  $as_echo_n "(cached) " >&6
9851else
9852  save_LDFLAGS="$LDFLAGS"
9853	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
9854	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9855/* end confdefs.h.  */
9856int foo (void) { return 0; }
9857_ACEOF
9858if ac_fn_c_try_link "$LINENO"; then :
9859  lt_cv_irix_exported_symbol=yes
9860else
9861  lt_cv_irix_exported_symbol=no
9862fi
9863rm -f core conftest.err conftest.$ac_objext \
9864    conftest$ac_exeext conftest.$ac_ext
9865           LDFLAGS="$save_LDFLAGS"
9866fi
9867{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
9868$as_echo "$lt_cv_irix_exported_symbol" >&6; }
9869	if test "$lt_cv_irix_exported_symbol" = yes; then
9870          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
9871	fi
9872      else
9873	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
9874	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
9875      fi
9876      archive_cmds_need_lc='no'
9877      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9878      hardcode_libdir_separator=:
9879      inherit_rpath=yes
9880      link_all_deplibs=yes
9881      ;;
9882
9883    netbsd*)
9884      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
9885	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
9886      else
9887	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
9888      fi
9889      hardcode_libdir_flag_spec='-R$libdir'
9890      hardcode_direct=yes
9891      hardcode_shlibpath_var=no
9892      ;;
9893
9894    newsos6)
9895      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
9896      hardcode_direct=yes
9897      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9898      hardcode_libdir_separator=:
9899      hardcode_shlibpath_var=no
9900      ;;
9901
9902    *nto* | *qnx*)
9903      ;;
9904
9905    openbsd*)
9906      if test -f /usr/libexec/ld.so; then
9907	hardcode_direct=yes
9908	hardcode_shlibpath_var=no
9909	hardcode_direct_absolute=yes
9910	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
9911	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9912	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
9913	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9914	  export_dynamic_flag_spec='${wl}-E'
9915	else
9916	  case $host_os in
9917	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
9918	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
9919	     hardcode_libdir_flag_spec='-R$libdir'
9920	     ;;
9921	   *)
9922	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
9923	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
9924	     ;;
9925	  esac
9926	fi
9927      else
9928	ld_shlibs=no
9929      fi
9930      ;;
9931
9932    os2*)
9933      hardcode_libdir_flag_spec='-L$libdir'
9934      hardcode_minus_L=yes
9935      allow_undefined_flag=unsupported
9936      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
9937      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
9938      ;;
9939
9940    osf3*)
9941      if test "$GCC" = yes; then
9942	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
9943	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
9944      else
9945	allow_undefined_flag=' -expect_unresolved \*'
9946	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
9947      fi
9948      archive_cmds_need_lc='no'
9949      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9950      hardcode_libdir_separator=:
9951      ;;
9952
9953    osf4* | osf5*)	# as osf3* with the addition of -msym flag
9954      if test "$GCC" = yes; then
9955	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
9956	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
9957	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
9958      else
9959	allow_undefined_flag=' -expect_unresolved \*'
9960	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
9961	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
9962	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
9963
9964	# Both c and cxx compiler support -rpath directly
9965	hardcode_libdir_flag_spec='-rpath $libdir'
9966      fi
9967      archive_cmds_need_lc='no'
9968      hardcode_libdir_separator=:
9969      ;;
9970
9971    solaris*)
9972      no_undefined_flag=' -z defs'
9973      if test "$GCC" = yes; then
9974	wlarc='${wl}'
9975	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
9976	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9977	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9978      else
9979	case `$CC -V 2>&1` in
9980	*"Compilers 5.0"*)
9981	  wlarc=''
9982	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
9983	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9984	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
9985	  ;;
9986	*)
9987	  wlarc='${wl}'
9988	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
9989	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
9990	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
9991	  ;;
9992	esac
9993      fi
9994      hardcode_libdir_flag_spec='-R$libdir'
9995      hardcode_shlibpath_var=no
9996      case $host_os in
9997      solaris2.[0-5] | solaris2.[0-5].*) ;;
9998      *)
9999	# The compiler driver will combine and reorder linker options,
10000	# but understands `-z linker_flag'.  GCC discards it without `$wl',
10001	# but is careful enough not to reorder.
10002	# Supported since Solaris 2.6 (maybe 2.5.1?)
10003	if test "$GCC" = yes; then
10004	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
10005	else
10006	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
10007	fi
10008	;;
10009      esac
10010      link_all_deplibs=yes
10011      ;;
10012
10013    sunos4*)
10014      if test "x$host_vendor" = xsequent; then
10015	# Use $CC to link under sequent, because it throws in some extra .o
10016	# files that make .init and .fini sections work.
10017	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
10018      else
10019	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
10020      fi
10021      hardcode_libdir_flag_spec='-L$libdir'
10022      hardcode_direct=yes
10023      hardcode_minus_L=yes
10024      hardcode_shlibpath_var=no
10025      ;;
10026
10027    sysv4)
10028      case $host_vendor in
10029	sni)
10030	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10031	  hardcode_direct=yes # is this really true???
10032	;;
10033	siemens)
10034	  ## LD is ld it makes a PLAMLIB
10035	  ## CC just makes a GrossModule.
10036	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
10037	  reload_cmds='$CC -r -o $output$reload_objs'
10038	  hardcode_direct=no
10039        ;;
10040	motorola)
10041	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10042	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
10043	;;
10044      esac
10045      runpath_var='LD_RUN_PATH'
10046      hardcode_shlibpath_var=no
10047      ;;
10048
10049    sysv4.3*)
10050      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10051      hardcode_shlibpath_var=no
10052      export_dynamic_flag_spec='-Bexport'
10053      ;;
10054
10055    sysv4*MP*)
10056      if test -d /usr/nec; then
10057	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10058	hardcode_shlibpath_var=no
10059	runpath_var=LD_RUN_PATH
10060	hardcode_runpath_var=yes
10061	ld_shlibs=yes
10062      fi
10063      ;;
10064
10065    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
10066      no_undefined_flag='${wl}-z,text'
10067      archive_cmds_need_lc=no
10068      hardcode_shlibpath_var=no
10069      runpath_var='LD_RUN_PATH'
10070
10071      if test "$GCC" = yes; then
10072	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10073	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10074      else
10075	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10076	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10077      fi
10078      ;;
10079
10080    sysv5* | sco3.2v5* | sco5v6*)
10081      # Note: We can NOT use -z defs as we might desire, because we do not
10082      # link with -lc, and that would cause any symbols used from libc to
10083      # always be unresolved, which means just about no library would
10084      # ever link correctly.  If we're not using GNU ld we use -z text
10085      # though, which does catch some bad symbols but isn't as heavy-handed
10086      # as -z defs.
10087      no_undefined_flag='${wl}-z,text'
10088      allow_undefined_flag='${wl}-z,nodefs'
10089      archive_cmds_need_lc=no
10090      hardcode_shlibpath_var=no
10091      hardcode_libdir_flag_spec='${wl}-R,$libdir'
10092      hardcode_libdir_separator=':'
10093      link_all_deplibs=yes
10094      export_dynamic_flag_spec='${wl}-Bexport'
10095      runpath_var='LD_RUN_PATH'
10096
10097      if test "$GCC" = yes; then
10098	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10099	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10100      else
10101	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10102	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
10103      fi
10104      ;;
10105
10106    uts4*)
10107      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
10108      hardcode_libdir_flag_spec='-L$libdir'
10109      hardcode_shlibpath_var=no
10110      ;;
10111
10112    *)
10113      ld_shlibs=no
10114      ;;
10115    esac
10116
10117    if test x$host_vendor = xsni; then
10118      case $host in
10119      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
10120	export_dynamic_flag_spec='${wl}-Blargedynsym'
10121	;;
10122      esac
10123    fi
10124  fi
10125
10126{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
10127$as_echo "$ld_shlibs" >&6; }
10128test "$ld_shlibs" = no && can_build_shared=no
10129
10130with_gnu_ld=$with_gnu_ld
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146#
10147# Do we need to explicitly link libc?
10148#
10149case "x$archive_cmds_need_lc" in
10150x|xyes)
10151  # Assume -lc should be added
10152  archive_cmds_need_lc=yes
10153
10154  if test "$enable_shared" = yes && test "$GCC" = yes; then
10155    case $archive_cmds in
10156    *'~'*)
10157      # FIXME: we may have to deal with multi-command sequences.
10158      ;;
10159    '$CC '*)
10160      # Test whether the compiler implicitly links with -lc since on some
10161      # systems, -lgcc has to come before -lc. If gcc already passes -lc
10162      # to ld, don't add -lc before -lgcc.
10163      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
10164$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
10165if ${lt_cv_archive_cmds_need_lc+:} false; then :
10166  $as_echo_n "(cached) " >&6
10167else
10168  $RM conftest*
10169	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
10170
10171	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
10172  (eval $ac_compile) 2>&5
10173  ac_status=$?
10174  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10175  test $ac_status = 0; } 2>conftest.err; then
10176	  soname=conftest
10177	  lib=conftest
10178	  libobjs=conftest.$ac_objext
10179	  deplibs=
10180	  wl=$lt_prog_compiler_wl
10181	  pic_flag=$lt_prog_compiler_pic
10182	  compiler_flags=-v
10183	  linker_flags=-v
10184	  verstring=
10185	  output_objdir=.
10186	  libname=conftest
10187	  lt_save_allow_undefined_flag=$allow_undefined_flag
10188	  allow_undefined_flag=
10189	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
10190  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
10191  ac_status=$?
10192  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
10193  test $ac_status = 0; }
10194	  then
10195	    lt_cv_archive_cmds_need_lc=no
10196	  else
10197	    lt_cv_archive_cmds_need_lc=yes
10198	  fi
10199	  allow_undefined_flag=$lt_save_allow_undefined_flag
10200	else
10201	  cat conftest.err 1>&5
10202	fi
10203	$RM conftest*
10204
10205fi
10206{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
10207$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
10208      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
10209      ;;
10210    esac
10211  fi
10212  ;;
10213esac
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
10367$as_echo_n "checking dynamic linker characteristics... " >&6; }
10368
10369if test "$GCC" = yes; then
10370  case $host_os in
10371    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
10372    *) lt_awk_arg="/^libraries:/" ;;
10373  esac
10374  case $host_os in
10375    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
10376    *) lt_sed_strip_eq="s,=/,/,g" ;;
10377  esac
10378  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
10379  case $lt_search_path_spec in
10380  *\;*)
10381    # if the path contains ";" then we assume it to be the separator
10382    # otherwise default to the standard path separator (i.e. ":") - it is
10383    # assumed that no part of a normal pathname contains ";" but that should
10384    # okay in the real world where ";" in dirpaths is itself problematic.
10385    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
10386    ;;
10387  *)
10388    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
10389    ;;
10390  esac
10391  # Ok, now we have the path, separated by spaces, we can step through it
10392  # and add multilib dir if necessary.
10393  lt_tmp_lt_search_path_spec=
10394  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
10395  for lt_sys_path in $lt_search_path_spec; do
10396    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
10397      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
10398    else
10399      test -d "$lt_sys_path" && \
10400	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
10401    fi
10402  done
10403  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
10404BEGIN {RS=" "; FS="/|\n";} {
10405  lt_foo="";
10406  lt_count=0;
10407  for (lt_i = NF; lt_i > 0; lt_i--) {
10408    if ($lt_i != "" && $lt_i != ".") {
10409      if ($lt_i == "..") {
10410        lt_count++;
10411      } else {
10412        if (lt_count == 0) {
10413          lt_foo="/" $lt_i lt_foo;
10414        } else {
10415          lt_count--;
10416        }
10417      }
10418    }
10419  }
10420  if (lt_foo != "") { lt_freq[lt_foo]++; }
10421  if (lt_freq[lt_foo] == 1) { print lt_foo; }
10422}'`
10423  # AWK program above erroneously prepends '/' to C:/dos/paths
10424  # for these hosts.
10425  case $host_os in
10426    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
10427      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
10428  esac
10429  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
10430else
10431  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
10432fi
10433library_names_spec=
10434libname_spec='lib$name'
10435soname_spec=
10436shrext_cmds=".so"
10437postinstall_cmds=
10438postuninstall_cmds=
10439finish_cmds=
10440finish_eval=
10441shlibpath_var=
10442shlibpath_overrides_runpath=unknown
10443version_type=none
10444dynamic_linker="$host_os ld.so"
10445sys_lib_dlsearch_path_spec="/lib /usr/lib"
10446need_lib_prefix=unknown
10447hardcode_into_libs=no
10448
10449# when you set need_version to no, make sure it does not cause -set_version
10450# flags to be left without arguments
10451need_version=unknown
10452
10453case $host_os in
10454aix3*)
10455  version_type=linux # correct to gnu/linux during the next big refactor
10456  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
10457  shlibpath_var=LIBPATH
10458
10459  # AIX 3 has no versioning support, so we append a major version to the name.
10460  soname_spec='${libname}${release}${shared_ext}$major'
10461  ;;
10462
10463aix[4-9]*)
10464  version_type=linux # correct to gnu/linux during the next big refactor
10465  need_lib_prefix=no
10466  need_version=no
10467  hardcode_into_libs=yes
10468  if test "$host_cpu" = ia64; then
10469    # AIX 5 supports IA64
10470    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
10471    shlibpath_var=LD_LIBRARY_PATH
10472  else
10473    # With GCC up to 2.95.x, collect2 would create an import file
10474    # for dependence libraries.  The import file would start with
10475    # the line `#! .'.  This would cause the generated library to
10476    # depend on `.', always an invalid library.  This was fixed in
10477    # development snapshots of GCC prior to 3.0.
10478    case $host_os in
10479      aix4 | aix4.[01] | aix4.[01].*)
10480      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
10481	   echo ' yes '
10482	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
10483	:
10484      else
10485	can_build_shared=no
10486      fi
10487      ;;
10488    esac
10489    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
10490    # soname into executable. Probably we can add versioning support to
10491    # collect2, so additional links can be useful in future.
10492    if test "$aix_use_runtimelinking" = yes; then
10493      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
10494      # instead of lib<name>.a to let people know that these are not
10495      # typical AIX shared libraries.
10496      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10497    else
10498      # We preserve .a as extension for shared libraries through AIX4.2
10499      # and later when we are not doing run time linking.
10500      library_names_spec='${libname}${release}.a $libname.a'
10501      soname_spec='${libname}${release}${shared_ext}$major'
10502    fi
10503    shlibpath_var=LIBPATH
10504  fi
10505  ;;
10506
10507amigaos*)
10508  case $host_cpu in
10509  powerpc)
10510    # Since July 2007 AmigaOS4 officially supports .so libraries.
10511    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
10512    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10513    ;;
10514  m68k)
10515    library_names_spec='$libname.ixlibrary $libname.a'
10516    # Create ${libname}_ixlibrary.a entries in /sys/libs.
10517    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
10518    ;;
10519  esac
10520  ;;
10521
10522beos*)
10523  library_names_spec='${libname}${shared_ext}'
10524  dynamic_linker="$host_os ld.so"
10525  shlibpath_var=LIBRARY_PATH
10526  ;;
10527
10528bsdi[45]*)
10529  version_type=linux # correct to gnu/linux during the next big refactor
10530  need_version=no
10531  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10532  soname_spec='${libname}${release}${shared_ext}$major'
10533  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
10534  shlibpath_var=LD_LIBRARY_PATH
10535  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
10536  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
10537  # the default ld.so.conf also contains /usr/contrib/lib and
10538  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
10539  # libtool to hard-code these into programs
10540  ;;
10541
10542cygwin* | mingw* | pw32* | cegcc*)
10543  version_type=windows
10544  shrext_cmds=".dll"
10545  need_version=no
10546  need_lib_prefix=no
10547
10548  case $GCC,$cc_basename in
10549  yes,*)
10550    # gcc
10551    library_names_spec='$libname.dll.a'
10552    # DLL is installed to $(libdir)/../bin by postinstall_cmds
10553    postinstall_cmds='base_file=`basename \${file}`~
10554      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
10555      dldir=$destdir/`dirname \$dlpath`~
10556      test -d \$dldir || mkdir -p \$dldir~
10557      $install_prog $dir/$dlname \$dldir/$dlname~
10558      chmod a+x \$dldir/$dlname~
10559      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
10560        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
10561      fi'
10562    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10563      dlpath=$dir/\$dldll~
10564       $RM \$dlpath'
10565    shlibpath_overrides_runpath=yes
10566
10567    case $host_os in
10568    cygwin*)
10569      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
10570      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
10571
10572      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
10573      ;;
10574    mingw* | cegcc*)
10575      # MinGW DLLs use traditional 'lib' prefix
10576      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
10577      ;;
10578    pw32*)
10579      # pw32 DLLs use 'pw' prefix rather than 'lib'
10580      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
10581      ;;
10582    esac
10583    dynamic_linker='Win32 ld.exe'
10584    ;;
10585
10586  *,cl*)
10587    # Native MSVC
10588    libname_spec='$name'
10589    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
10590    library_names_spec='${libname}.dll.lib'
10591
10592    case $build_os in
10593    mingw*)
10594      sys_lib_search_path_spec=
10595      lt_save_ifs=$IFS
10596      IFS=';'
10597      for lt_path in $LIB
10598      do
10599        IFS=$lt_save_ifs
10600        # Let DOS variable expansion print the short 8.3 style file name.
10601        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
10602        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
10603      done
10604      IFS=$lt_save_ifs
10605      # Convert to MSYS style.
10606      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
10607      ;;
10608    cygwin*)
10609      # Convert to unix form, then to dos form, then back to unix form
10610      # but this time dos style (no spaces!) so that the unix form looks
10611      # like /cygdrive/c/PROGRA~1:/cygdr...
10612      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
10613      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
10614      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10615      ;;
10616    *)
10617      sys_lib_search_path_spec="$LIB"
10618      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
10619        # It is most probably a Windows format PATH.
10620        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
10621      else
10622        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
10623      fi
10624      # FIXME: find the short name or the path components, as spaces are
10625      # common. (e.g. "Program Files" -> "PROGRA~1")
10626      ;;
10627    esac
10628
10629    # DLL is installed to $(libdir)/../bin by postinstall_cmds
10630    postinstall_cmds='base_file=`basename \${file}`~
10631      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
10632      dldir=$destdir/`dirname \$dlpath`~
10633      test -d \$dldir || mkdir -p \$dldir~
10634      $install_prog $dir/$dlname \$dldir/$dlname'
10635    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
10636      dlpath=$dir/\$dldll~
10637       $RM \$dlpath'
10638    shlibpath_overrides_runpath=yes
10639    dynamic_linker='Win32 link.exe'
10640    ;;
10641
10642  *)
10643    # Assume MSVC wrapper
10644    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
10645    dynamic_linker='Win32 ld.exe'
10646    ;;
10647  esac
10648  # FIXME: first we should search . and the directory the executable is in
10649  shlibpath_var=PATH
10650  ;;
10651
10652darwin* | rhapsody*)
10653  dynamic_linker="$host_os dyld"
10654  version_type=darwin
10655  need_lib_prefix=no
10656  need_version=no
10657  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
10658  soname_spec='${libname}${release}${major}$shared_ext'
10659  shlibpath_overrides_runpath=yes
10660  shlibpath_var=DYLD_LIBRARY_PATH
10661  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
10662
10663  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
10664  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
10665  ;;
10666
10667dgux*)
10668  version_type=linux # correct to gnu/linux during the next big refactor
10669  need_lib_prefix=no
10670  need_version=no
10671  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
10672  soname_spec='${libname}${release}${shared_ext}$major'
10673  shlibpath_var=LD_LIBRARY_PATH
10674  ;;
10675
10676freebsd* | dragonfly*)
10677  # DragonFly does not have aout.  When/if they implement a new
10678  # versioning mechanism, adjust this.
10679  if test -x /usr/bin/objformat; then
10680    objformat=`/usr/bin/objformat`
10681  else
10682    case $host_os in
10683    freebsd[23].*) objformat=aout ;;
10684    *) objformat=elf ;;
10685    esac
10686  fi
10687  version_type=freebsd-$objformat
10688  case $version_type in
10689    freebsd-elf*)
10690      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
10691      need_version=no
10692      need_lib_prefix=no
10693      ;;
10694    freebsd-*)
10695      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
10696      need_version=yes
10697      ;;
10698  esac
10699  shlibpath_var=LD_LIBRARY_PATH
10700  case $host_os in
10701  freebsd2.*)
10702    shlibpath_overrides_runpath=yes
10703    ;;
10704  freebsd3.[01]* | freebsdelf3.[01]*)
10705    shlibpath_overrides_runpath=yes
10706    hardcode_into_libs=yes
10707    ;;
10708  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
10709  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
10710    shlibpath_overrides_runpath=no
10711    hardcode_into_libs=yes
10712    ;;
10713  *) # from 4.6 on, and DragonFly
10714    shlibpath_overrides_runpath=yes
10715    hardcode_into_libs=yes
10716    ;;
10717  esac
10718  ;;
10719
10720gnu*)
10721  version_type=linux # correct to gnu/linux during the next big refactor
10722  need_lib_prefix=no
10723  need_version=no
10724  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
10725  soname_spec='${libname}${release}${shared_ext}$major'
10726  shlibpath_var=LD_LIBRARY_PATH
10727  shlibpath_overrides_runpath=no
10728  hardcode_into_libs=yes
10729  ;;
10730
10731haiku*)
10732  version_type=linux # correct to gnu/linux during the next big refactor
10733  need_lib_prefix=no
10734  need_version=no
10735  dynamic_linker="$host_os runtime_loader"
10736  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
10737  soname_spec='${libname}${release}${shared_ext}$major'
10738  shlibpath_var=LIBRARY_PATH
10739  shlibpath_overrides_runpath=yes
10740  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
10741  hardcode_into_libs=yes
10742  ;;
10743
10744hpux9* | hpux10* | hpux11*)
10745  # Give a soname corresponding to the major version so that dld.sl refuses to
10746  # link against other versions.
10747  version_type=sunos
10748  need_lib_prefix=no
10749  need_version=no
10750  case $host_cpu in
10751  ia64*)
10752    shrext_cmds='.so'
10753    hardcode_into_libs=yes
10754    dynamic_linker="$host_os dld.so"
10755    shlibpath_var=LD_LIBRARY_PATH
10756    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10757    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10758    soname_spec='${libname}${release}${shared_ext}$major'
10759    if test "X$HPUX_IA64_MODE" = X32; then
10760      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
10761    else
10762      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
10763    fi
10764    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
10765    ;;
10766  hppa*64*)
10767    shrext_cmds='.sl'
10768    hardcode_into_libs=yes
10769    dynamic_linker="$host_os dld.sl"
10770    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
10771    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
10772    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10773    soname_spec='${libname}${release}${shared_ext}$major'
10774    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
10775    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
10776    ;;
10777  *)
10778    shrext_cmds='.sl'
10779    dynamic_linker="$host_os dld.sl"
10780    shlibpath_var=SHLIB_PATH
10781    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
10782    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10783    soname_spec='${libname}${release}${shared_ext}$major'
10784    ;;
10785  esac
10786  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
10787  postinstall_cmds='chmod 555 $lib'
10788  # or fails outright, so override atomically:
10789  install_override_mode=555
10790  ;;
10791
10792interix[3-9]*)
10793  version_type=linux # correct to gnu/linux during the next big refactor
10794  need_lib_prefix=no
10795  need_version=no
10796  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10797  soname_spec='${libname}${release}${shared_ext}$major'
10798  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
10799  shlibpath_var=LD_LIBRARY_PATH
10800  shlibpath_overrides_runpath=no
10801  hardcode_into_libs=yes
10802  ;;
10803
10804irix5* | irix6* | nonstopux*)
10805  case $host_os in
10806    nonstopux*) version_type=nonstopux ;;
10807    *)
10808	if test "$lt_cv_prog_gnu_ld" = yes; then
10809		version_type=linux # correct to gnu/linux during the next big refactor
10810	else
10811		version_type=irix
10812	fi ;;
10813  esac
10814  need_lib_prefix=no
10815  need_version=no
10816  soname_spec='${libname}${release}${shared_ext}$major'
10817  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
10818  case $host_os in
10819  irix5* | nonstopux*)
10820    libsuff= shlibsuff=
10821    ;;
10822  *)
10823    case $LD in # libtool.m4 will add one of these switches to LD
10824    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
10825      libsuff= shlibsuff= libmagic=32-bit;;
10826    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
10827      libsuff=32 shlibsuff=N32 libmagic=N32;;
10828    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
10829      libsuff=64 shlibsuff=64 libmagic=64-bit;;
10830    *) libsuff= shlibsuff= libmagic=never-match;;
10831    esac
10832    ;;
10833  esac
10834  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
10835  shlibpath_overrides_runpath=no
10836  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
10837  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
10838  hardcode_into_libs=yes
10839  ;;
10840
10841# No shared lib support for Linux oldld, aout, or coff.
10842linux*oldld* | linux*aout* | linux*coff*)
10843  dynamic_linker=no
10844  ;;
10845
10846# This must be glibc/ELF.
10847linux* | k*bsd*-gnu | kopensolaris*-gnu)
10848  version_type=linux # correct to gnu/linux during the next big refactor
10849  need_lib_prefix=no
10850  need_version=no
10851  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10852  soname_spec='${libname}${release}${shared_ext}$major'
10853  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
10854  shlibpath_var=LD_LIBRARY_PATH
10855  shlibpath_overrides_runpath=no
10856
10857  # Some binutils ld are patched to set DT_RUNPATH
10858  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
10859  $as_echo_n "(cached) " >&6
10860else
10861  lt_cv_shlibpath_overrides_runpath=no
10862    save_LDFLAGS=$LDFLAGS
10863    save_libdir=$libdir
10864    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
10865	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
10866    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
10867/* end confdefs.h.  */
10868
10869int
10870main ()
10871{
10872
10873  ;
10874  return 0;
10875}
10876_ACEOF
10877if ac_fn_c_try_link "$LINENO"; then :
10878  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
10879  lt_cv_shlibpath_overrides_runpath=yes
10880fi
10881fi
10882rm -f core conftest.err conftest.$ac_objext \
10883    conftest$ac_exeext conftest.$ac_ext
10884    LDFLAGS=$save_LDFLAGS
10885    libdir=$save_libdir
10886
10887fi
10888
10889  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
10890
10891  # This implies no fast_install, which is unacceptable.
10892  # Some rework will be needed to allow for fast_install
10893  # before this can be enabled.
10894  hardcode_into_libs=yes
10895
10896  # Append ld.so.conf contents to the search path
10897  if test -f /etc/ld.so.conf; then
10898    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
10899    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
10900  fi
10901
10902  # We used to test for /lib/ld.so.1 and disable shared libraries on
10903  # powerpc, because MkLinux only supported shared libraries with the
10904  # GNU dynamic linker.  Since this was broken with cross compilers,
10905  # most powerpc-linux boxes support dynamic linking these days and
10906  # people can always --disable-shared, the test was removed, and we
10907  # assume the GNU/Linux dynamic linker is in use.
10908  dynamic_linker='GNU/Linux ld.so'
10909  ;;
10910
10911netbsd*)
10912  version_type=sunos
10913  need_lib_prefix=no
10914  need_version=no
10915  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
10916    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
10917    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
10918    dynamic_linker='NetBSD (a.out) ld.so'
10919  else
10920    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
10921    soname_spec='${libname}${release}${shared_ext}$major'
10922    dynamic_linker='NetBSD ld.elf_so'
10923  fi
10924  shlibpath_var=LD_LIBRARY_PATH
10925  shlibpath_overrides_runpath=yes
10926  hardcode_into_libs=yes
10927  ;;
10928
10929newsos6)
10930  version_type=linux # correct to gnu/linux during the next big refactor
10931  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10932  shlibpath_var=LD_LIBRARY_PATH
10933  shlibpath_overrides_runpath=yes
10934  ;;
10935
10936*nto* | *qnx*)
10937  version_type=qnx
10938  need_lib_prefix=no
10939  need_version=no
10940  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10941  soname_spec='${libname}${release}${shared_ext}$major'
10942  shlibpath_var=LD_LIBRARY_PATH
10943  shlibpath_overrides_runpath=no
10944  hardcode_into_libs=yes
10945  dynamic_linker='ldqnx.so'
10946  ;;
10947
10948openbsd*)
10949  version_type=sunos
10950  sys_lib_dlsearch_path_spec="/usr/lib"
10951  need_lib_prefix=no
10952  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
10953  case $host_os in
10954    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
10955    *)				need_version=no  ;;
10956  esac
10957  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
10958  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
10959  shlibpath_var=LD_LIBRARY_PATH
10960  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
10961    case $host_os in
10962      openbsd2.[89] | openbsd2.[89].*)
10963	shlibpath_overrides_runpath=no
10964	;;
10965      *)
10966	shlibpath_overrides_runpath=yes
10967	;;
10968      esac
10969  else
10970    shlibpath_overrides_runpath=yes
10971  fi
10972  ;;
10973
10974os2*)
10975  libname_spec='$name'
10976  shrext_cmds=".dll"
10977  need_lib_prefix=no
10978  library_names_spec='$libname${shared_ext} $libname.a'
10979  dynamic_linker='OS/2 ld.exe'
10980  shlibpath_var=LIBPATH
10981  ;;
10982
10983osf3* | osf4* | osf5*)
10984  version_type=osf
10985  need_lib_prefix=no
10986  need_version=no
10987  soname_spec='${libname}${release}${shared_ext}$major'
10988  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
10989  shlibpath_var=LD_LIBRARY_PATH
10990  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
10991  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
10992  ;;
10993
10994rdos*)
10995  dynamic_linker=no
10996  ;;
10997
10998solaris*)
10999  version_type=linux # correct to gnu/linux during the next big refactor
11000  need_lib_prefix=no
11001  need_version=no
11002  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11003  soname_spec='${libname}${release}${shared_ext}$major'
11004  shlibpath_var=LD_LIBRARY_PATH
11005  shlibpath_overrides_runpath=yes
11006  hardcode_into_libs=yes
11007  # ldd complains unless libraries are executable
11008  postinstall_cmds='chmod +x $lib'
11009  ;;
11010
11011sunos4*)
11012  version_type=sunos
11013  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
11014  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
11015  shlibpath_var=LD_LIBRARY_PATH
11016  shlibpath_overrides_runpath=yes
11017  if test "$with_gnu_ld" = yes; then
11018    need_lib_prefix=no
11019  fi
11020  need_version=yes
11021  ;;
11022
11023sysv4 | sysv4.3*)
11024  version_type=linux # correct to gnu/linux during the next big refactor
11025  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11026  soname_spec='${libname}${release}${shared_ext}$major'
11027  shlibpath_var=LD_LIBRARY_PATH
11028  case $host_vendor in
11029    sni)
11030      shlibpath_overrides_runpath=no
11031      need_lib_prefix=no
11032      runpath_var=LD_RUN_PATH
11033      ;;
11034    siemens)
11035      need_lib_prefix=no
11036      ;;
11037    motorola)
11038      need_lib_prefix=no
11039      need_version=no
11040      shlibpath_overrides_runpath=no
11041      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
11042      ;;
11043  esac
11044  ;;
11045
11046sysv4*MP*)
11047  if test -d /usr/nec ;then
11048    version_type=linux # correct to gnu/linux during the next big refactor
11049    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
11050    soname_spec='$libname${shared_ext}.$major'
11051    shlibpath_var=LD_LIBRARY_PATH
11052  fi
11053  ;;
11054
11055sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
11056  version_type=freebsd-elf
11057  need_lib_prefix=no
11058  need_version=no
11059  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
11060  soname_spec='${libname}${release}${shared_ext}$major'
11061  shlibpath_var=LD_LIBRARY_PATH
11062  shlibpath_overrides_runpath=yes
11063  hardcode_into_libs=yes
11064  if test "$with_gnu_ld" = yes; then
11065    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
11066  else
11067    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
11068    case $host_os in
11069      sco3.2v5*)
11070        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
11071	;;
11072    esac
11073  fi
11074  sys_lib_dlsearch_path_spec='/usr/lib'
11075  ;;
11076
11077tpf*)
11078  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
11079  version_type=linux # correct to gnu/linux during the next big refactor
11080  need_lib_prefix=no
11081  need_version=no
11082  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11083  shlibpath_var=LD_LIBRARY_PATH
11084  shlibpath_overrides_runpath=no
11085  hardcode_into_libs=yes
11086  ;;
11087
11088uts4*)
11089  version_type=linux # correct to gnu/linux during the next big refactor
11090  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
11091  soname_spec='${libname}${release}${shared_ext}$major'
11092  shlibpath_var=LD_LIBRARY_PATH
11093  ;;
11094
11095*)
11096  dynamic_linker=no
11097  ;;
11098esac
11099{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
11100$as_echo "$dynamic_linker" >&6; }
11101test "$dynamic_linker" = no && can_build_shared=no
11102
11103variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
11104if test "$GCC" = yes; then
11105  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
11106fi
11107
11108if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
11109  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
11110fi
11111if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
11112  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
11113fi
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
11207$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
11208hardcode_action=
11209if test -n "$hardcode_libdir_flag_spec" ||
11210   test -n "$runpath_var" ||
11211   test "X$hardcode_automatic" = "Xyes" ; then
11212
11213  # We can hardcode non-existent directories.
11214  if test "$hardcode_direct" != no &&
11215     # If the only mechanism to avoid hardcoding is shlibpath_var, we
11216     # have to relink, otherwise we might link with an installed library
11217     # when we should be linking with a yet-to-be-installed one
11218     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
11219     test "$hardcode_minus_L" != no; then
11220    # Linking always hardcodes the temporary library directory.
11221    hardcode_action=relink
11222  else
11223    # We can link without hardcoding, and we can hardcode nonexisting dirs.
11224    hardcode_action=immediate
11225  fi
11226else
11227  # We cannot hardcode anything, or else we can only hardcode existing
11228  # directories.
11229  hardcode_action=unsupported
11230fi
11231{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
11232$as_echo "$hardcode_action" >&6; }
11233
11234if test "$hardcode_action" = relink ||
11235   test "$inherit_rpath" = yes; then
11236  # Fast installation is not supported
11237  enable_fast_install=no
11238elif test "$shlibpath_overrides_runpath" = yes ||
11239     test "$enable_shared" = no; then
11240  # Fast installation is not necessary
11241  enable_fast_install=needless
11242fi
11243
11244
11245
11246
11247
11248
11249  if test "x$enable_dlopen" != xyes; then
11250  enable_dlopen=unknown
11251  enable_dlopen_self=unknown
11252  enable_dlopen_self_static=unknown
11253else
11254  lt_cv_dlopen=no
11255  lt_cv_dlopen_libs=
11256
11257  case $host_os in
11258  beos*)
11259    lt_cv_dlopen="load_add_on"
11260    lt_cv_dlopen_libs=
11261    lt_cv_dlopen_self=yes
11262    ;;
11263
11264  mingw* | pw32* | cegcc*)
11265    lt_cv_dlopen="LoadLibrary"
11266    lt_cv_dlopen_libs=
11267    ;;
11268
11269  cygwin*)
11270    lt_cv_dlopen="dlopen"
11271    lt_cv_dlopen_libs=
11272    ;;
11273
11274  darwin*)
11275  # if libdl is installed we need to link against it
11276    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
11277$as_echo_n "checking for dlopen in -ldl... " >&6; }
11278if ${ac_cv_lib_dl_dlopen+:} false; then :
11279  $as_echo_n "(cached) " >&6
11280else
11281  ac_check_lib_save_LIBS=$LIBS
11282LIBS="-ldl  $LIBS"
11283cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11284/* end confdefs.h.  */
11285
11286/* Override any GCC internal prototype to avoid an error.
11287   Use char because int might match the return type of a GCC
11288   builtin and then its argument prototype would still apply.  */
11289#ifdef __cplusplus
11290extern "C"
11291#endif
11292char dlopen ();
11293int
11294main ()
11295{
11296return dlopen ();
11297  ;
11298  return 0;
11299}
11300_ACEOF
11301if ac_fn_c_try_link "$LINENO"; then :
11302  ac_cv_lib_dl_dlopen=yes
11303else
11304  ac_cv_lib_dl_dlopen=no
11305fi
11306rm -f core conftest.err conftest.$ac_objext \
11307    conftest$ac_exeext conftest.$ac_ext
11308LIBS=$ac_check_lib_save_LIBS
11309fi
11310{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
11311$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11312if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11313  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
11314else
11315
11316    lt_cv_dlopen="dyld"
11317    lt_cv_dlopen_libs=
11318    lt_cv_dlopen_self=yes
11319
11320fi
11321
11322    ;;
11323
11324  *)
11325    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
11326if test "x$ac_cv_func_shl_load" = xyes; then :
11327  lt_cv_dlopen="shl_load"
11328else
11329  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
11330$as_echo_n "checking for shl_load in -ldld... " >&6; }
11331if ${ac_cv_lib_dld_shl_load+:} false; then :
11332  $as_echo_n "(cached) " >&6
11333else
11334  ac_check_lib_save_LIBS=$LIBS
11335LIBS="-ldld  $LIBS"
11336cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11337/* end confdefs.h.  */
11338
11339/* Override any GCC internal prototype to avoid an error.
11340   Use char because int might match the return type of a GCC
11341   builtin and then its argument prototype would still apply.  */
11342#ifdef __cplusplus
11343extern "C"
11344#endif
11345char shl_load ();
11346int
11347main ()
11348{
11349return shl_load ();
11350  ;
11351  return 0;
11352}
11353_ACEOF
11354if ac_fn_c_try_link "$LINENO"; then :
11355  ac_cv_lib_dld_shl_load=yes
11356else
11357  ac_cv_lib_dld_shl_load=no
11358fi
11359rm -f core conftest.err conftest.$ac_objext \
11360    conftest$ac_exeext conftest.$ac_ext
11361LIBS=$ac_check_lib_save_LIBS
11362fi
11363{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
11364$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
11365if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
11366  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
11367else
11368  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
11369if test "x$ac_cv_func_dlopen" = xyes; then :
11370  lt_cv_dlopen="dlopen"
11371else
11372  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
11373$as_echo_n "checking for dlopen in -ldl... " >&6; }
11374if ${ac_cv_lib_dl_dlopen+:} false; then :
11375  $as_echo_n "(cached) " >&6
11376else
11377  ac_check_lib_save_LIBS=$LIBS
11378LIBS="-ldl  $LIBS"
11379cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11380/* end confdefs.h.  */
11381
11382/* Override any GCC internal prototype to avoid an error.
11383   Use char because int might match the return type of a GCC
11384   builtin and then its argument prototype would still apply.  */
11385#ifdef __cplusplus
11386extern "C"
11387#endif
11388char dlopen ();
11389int
11390main ()
11391{
11392return dlopen ();
11393  ;
11394  return 0;
11395}
11396_ACEOF
11397if ac_fn_c_try_link "$LINENO"; then :
11398  ac_cv_lib_dl_dlopen=yes
11399else
11400  ac_cv_lib_dl_dlopen=no
11401fi
11402rm -f core conftest.err conftest.$ac_objext \
11403    conftest$ac_exeext conftest.$ac_ext
11404LIBS=$ac_check_lib_save_LIBS
11405fi
11406{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
11407$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
11408if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
11409  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
11410else
11411  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
11412$as_echo_n "checking for dlopen in -lsvld... " >&6; }
11413if ${ac_cv_lib_svld_dlopen+:} false; then :
11414  $as_echo_n "(cached) " >&6
11415else
11416  ac_check_lib_save_LIBS=$LIBS
11417LIBS="-lsvld  $LIBS"
11418cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11419/* end confdefs.h.  */
11420
11421/* Override any GCC internal prototype to avoid an error.
11422   Use char because int might match the return type of a GCC
11423   builtin and then its argument prototype would still apply.  */
11424#ifdef __cplusplus
11425extern "C"
11426#endif
11427char dlopen ();
11428int
11429main ()
11430{
11431return dlopen ();
11432  ;
11433  return 0;
11434}
11435_ACEOF
11436if ac_fn_c_try_link "$LINENO"; then :
11437  ac_cv_lib_svld_dlopen=yes
11438else
11439  ac_cv_lib_svld_dlopen=no
11440fi
11441rm -f core conftest.err conftest.$ac_objext \
11442    conftest$ac_exeext conftest.$ac_ext
11443LIBS=$ac_check_lib_save_LIBS
11444fi
11445{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
11446$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
11447if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
11448  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
11449else
11450  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
11451$as_echo_n "checking for dld_link in -ldld... " >&6; }
11452if ${ac_cv_lib_dld_dld_link+:} false; then :
11453  $as_echo_n "(cached) " >&6
11454else
11455  ac_check_lib_save_LIBS=$LIBS
11456LIBS="-ldld  $LIBS"
11457cat confdefs.h - <<_ACEOF >conftest.$ac_ext
11458/* end confdefs.h.  */
11459
11460/* Override any GCC internal prototype to avoid an error.
11461   Use char because int might match the return type of a GCC
11462   builtin and then its argument prototype would still apply.  */
11463#ifdef __cplusplus
11464extern "C"
11465#endif
11466char dld_link ();
11467int
11468main ()
11469{
11470return dld_link ();
11471  ;
11472  return 0;
11473}
11474_ACEOF
11475if ac_fn_c_try_link "$LINENO"; then :
11476  ac_cv_lib_dld_dld_link=yes
11477else
11478  ac_cv_lib_dld_dld_link=no
11479fi
11480rm -f core conftest.err conftest.$ac_objext \
11481    conftest$ac_exeext conftest.$ac_ext
11482LIBS=$ac_check_lib_save_LIBS
11483fi
11484{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
11485$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
11486if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
11487  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
11488fi
11489
11490
11491fi
11492
11493
11494fi
11495
11496
11497fi
11498
11499
11500fi
11501
11502
11503fi
11504
11505    ;;
11506  esac
11507
11508  if test "x$lt_cv_dlopen" != xno; then
11509    enable_dlopen=yes
11510  else
11511    enable_dlopen=no
11512  fi
11513
11514  case $lt_cv_dlopen in
11515  dlopen)
11516    save_CPPFLAGS="$CPPFLAGS"
11517    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
11518
11519    save_LDFLAGS="$LDFLAGS"
11520    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
11521
11522    save_LIBS="$LIBS"
11523    LIBS="$lt_cv_dlopen_libs $LIBS"
11524
11525    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
11526$as_echo_n "checking whether a program can dlopen itself... " >&6; }
11527if ${lt_cv_dlopen_self+:} false; then :
11528  $as_echo_n "(cached) " >&6
11529else
11530  	  if test "$cross_compiling" = yes; then :
11531  lt_cv_dlopen_self=cross
11532else
11533  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11534  lt_status=$lt_dlunknown
11535  cat > conftest.$ac_ext <<_LT_EOF
11536#line $LINENO "configure"
11537#include "confdefs.h"
11538
11539#if HAVE_DLFCN_H
11540#include <dlfcn.h>
11541#endif
11542
11543#include <stdio.h>
11544
11545#ifdef RTLD_GLOBAL
11546#  define LT_DLGLOBAL		RTLD_GLOBAL
11547#else
11548#  ifdef DL_GLOBAL
11549#    define LT_DLGLOBAL		DL_GLOBAL
11550#  else
11551#    define LT_DLGLOBAL		0
11552#  endif
11553#endif
11554
11555/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11556   find out it does not work in some platform. */
11557#ifndef LT_DLLAZY_OR_NOW
11558#  ifdef RTLD_LAZY
11559#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
11560#  else
11561#    ifdef DL_LAZY
11562#      define LT_DLLAZY_OR_NOW		DL_LAZY
11563#    else
11564#      ifdef RTLD_NOW
11565#        define LT_DLLAZY_OR_NOW	RTLD_NOW
11566#      else
11567#        ifdef DL_NOW
11568#          define LT_DLLAZY_OR_NOW	DL_NOW
11569#        else
11570#          define LT_DLLAZY_OR_NOW	0
11571#        endif
11572#      endif
11573#    endif
11574#  endif
11575#endif
11576
11577/* When -fvisbility=hidden is used, assume the code has been annotated
11578   correspondingly for the symbols needed.  */
11579#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
11580int fnord () __attribute__((visibility("default")));
11581#endif
11582
11583int fnord () { return 42; }
11584int main ()
11585{
11586  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11587  int status = $lt_dlunknown;
11588
11589  if (self)
11590    {
11591      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
11592      else
11593        {
11594	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
11595          else puts (dlerror ());
11596	}
11597      /* dlclose (self); */
11598    }
11599  else
11600    puts (dlerror ());
11601
11602  return status;
11603}
11604_LT_EOF
11605  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11606  (eval $ac_link) 2>&5
11607  ac_status=$?
11608  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11609  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
11610    (./conftest; exit; ) >&5 2>/dev/null
11611    lt_status=$?
11612    case x$lt_status in
11613      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
11614      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
11615      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
11616    esac
11617  else :
11618    # compilation failed
11619    lt_cv_dlopen_self=no
11620  fi
11621fi
11622rm -fr conftest*
11623
11624
11625fi
11626{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
11627$as_echo "$lt_cv_dlopen_self" >&6; }
11628
11629    if test "x$lt_cv_dlopen_self" = xyes; then
11630      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
11631      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
11632$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
11633if ${lt_cv_dlopen_self_static+:} false; then :
11634  $as_echo_n "(cached) " >&6
11635else
11636  	  if test "$cross_compiling" = yes; then :
11637  lt_cv_dlopen_self_static=cross
11638else
11639  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
11640  lt_status=$lt_dlunknown
11641  cat > conftest.$ac_ext <<_LT_EOF
11642#line $LINENO "configure"
11643#include "confdefs.h"
11644
11645#if HAVE_DLFCN_H
11646#include <dlfcn.h>
11647#endif
11648
11649#include <stdio.h>
11650
11651#ifdef RTLD_GLOBAL
11652#  define LT_DLGLOBAL		RTLD_GLOBAL
11653#else
11654#  ifdef DL_GLOBAL
11655#    define LT_DLGLOBAL		DL_GLOBAL
11656#  else
11657#    define LT_DLGLOBAL		0
11658#  endif
11659#endif
11660
11661/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
11662   find out it does not work in some platform. */
11663#ifndef LT_DLLAZY_OR_NOW
11664#  ifdef RTLD_LAZY
11665#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
11666#  else
11667#    ifdef DL_LAZY
11668#      define LT_DLLAZY_OR_NOW		DL_LAZY
11669#    else
11670#      ifdef RTLD_NOW
11671#        define LT_DLLAZY_OR_NOW	RTLD_NOW
11672#      else
11673#        ifdef DL_NOW
11674#          define LT_DLLAZY_OR_NOW	DL_NOW
11675#        else
11676#          define LT_DLLAZY_OR_NOW	0
11677#        endif
11678#      endif
11679#    endif
11680#  endif
11681#endif
11682
11683/* When -fvisbility=hidden is used, assume the code has been annotated
11684   correspondingly for the symbols needed.  */
11685#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
11686int fnord () __attribute__((visibility("default")));
11687#endif
11688
11689int fnord () { return 42; }
11690int main ()
11691{
11692  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
11693  int status = $lt_dlunknown;
11694
11695  if (self)
11696    {
11697      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
11698      else
11699        {
11700	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
11701          else puts (dlerror ());
11702	}
11703      /* dlclose (self); */
11704    }
11705  else
11706    puts (dlerror ());
11707
11708  return status;
11709}
11710_LT_EOF
11711  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
11712  (eval $ac_link) 2>&5
11713  ac_status=$?
11714  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
11715  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
11716    (./conftest; exit; ) >&5 2>/dev/null
11717    lt_status=$?
11718    case x$lt_status in
11719      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
11720      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
11721      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
11722    esac
11723  else :
11724    # compilation failed
11725    lt_cv_dlopen_self_static=no
11726  fi
11727fi
11728rm -fr conftest*
11729
11730
11731fi
11732{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
11733$as_echo "$lt_cv_dlopen_self_static" >&6; }
11734    fi
11735
11736    CPPFLAGS="$save_CPPFLAGS"
11737    LDFLAGS="$save_LDFLAGS"
11738    LIBS="$save_LIBS"
11739    ;;
11740  esac
11741
11742  case $lt_cv_dlopen_self in
11743  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
11744  *) enable_dlopen_self=unknown ;;
11745  esac
11746
11747  case $lt_cv_dlopen_self_static in
11748  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
11749  *) enable_dlopen_self_static=unknown ;;
11750  esac
11751fi
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769striplib=
11770old_striplib=
11771{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
11772$as_echo_n "checking whether stripping libraries is possible... " >&6; }
11773if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
11774  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
11775  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
11776  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11777$as_echo "yes" >&6; }
11778else
11779# FIXME - insert some real tests, host_os isn't really good enough
11780  case $host_os in
11781  darwin*)
11782    if test -n "$STRIP" ; then
11783      striplib="$STRIP -x"
11784      old_striplib="$STRIP -S"
11785      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
11786$as_echo "yes" >&6; }
11787    else
11788      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11789$as_echo "no" >&6; }
11790    fi
11791    ;;
11792  *)
11793    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
11794$as_echo "no" >&6; }
11795    ;;
11796  esac
11797fi
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810  # Report which library types will actually be built
11811  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
11812$as_echo_n "checking if libtool supports shared libraries... " >&6; }
11813  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
11814$as_echo "$can_build_shared" >&6; }
11815
11816  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
11817$as_echo_n "checking whether to build shared libraries... " >&6; }
11818  test "$can_build_shared" = "no" && enable_shared=no
11819
11820  # On AIX, shared libraries and static libraries use the same namespace, and
11821  # are all built from PIC.
11822  case $host_os in
11823  aix3*)
11824    test "$enable_shared" = yes && enable_static=no
11825    if test -n "$RANLIB"; then
11826      archive_cmds="$archive_cmds~\$RANLIB \$lib"
11827      postinstall_cmds='$RANLIB $lib'
11828    fi
11829    ;;
11830
11831  aix[4-9]*)
11832    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
11833      test "$enable_shared" = yes && enable_static=no
11834    fi
11835    ;;
11836  esac
11837  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
11838$as_echo "$enable_shared" >&6; }
11839
11840  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
11841$as_echo_n "checking whether to build static libraries... " >&6; }
11842  # Make sure either enable_shared or enable_static is yes.
11843  test "$enable_shared" = yes || enable_static=yes
11844  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
11845$as_echo "$enable_static" >&6; }
11846
11847
11848
11849
11850fi
11851ac_ext=c
11852ac_cpp='$CPP $CPPFLAGS'
11853ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
11854ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
11855ac_compiler_gnu=$ac_cv_c_compiler_gnu
11856
11857CC="$lt_save_CC"
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873        ac_config_commands="$ac_config_commands libtool"
11874
11875
11876
11877
11878# Only expand once:
11879
11880
11881autoconf_compflags="$CFLAGS"
11882CFLAGS=$oCFLAGS
11883LDFLAGS="$oLDFLAGS"
11884
11885unset CONFVAR
11886
11887#compile silently, if possible
11888# Check whether --enable-silent-rules was given.
11889if test "${enable_silent_rules+set}" = set; then :
11890  enableval=$enable_silent_rules;
11891fi
11892
11893case $enable_silent_rules in # (((
11894  yes) AM_DEFAULT_VERBOSITY=0;;
11895   no) AM_DEFAULT_VERBOSITY=1;;
11896    *) AM_DEFAULT_VERBOSITY=0;;
11897esac
11898am_make=${MAKE-make}
11899{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
11900$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
11901if ${am_cv_make_support_nested_variables+:} false; then :
11902  $as_echo_n "(cached) " >&6
11903else
11904  if $as_echo 'TRUE=$(BAR$(V))
11905BAR0=false
11906BAR1=true
11907V=1
11908am__doit:
11909	@$(TRUE)
11910.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
11911  am_cv_make_support_nested_variables=yes
11912else
11913  am_cv_make_support_nested_variables=no
11914fi
11915fi
11916{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
11917$as_echo "$am_cv_make_support_nested_variables" >&6; }
11918if test $am_cv_make_support_nested_variables = yes; then
11919    AM_V='$(V)'
11920  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
11921else
11922  AM_V=$AM_DEFAULT_VERBOSITY
11923  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
11924fi
11925AM_BACKSLASH='\'
11926
11927
11928
11929$as_echo "#define BAREFOOTD 0" >>confdefs.h
11930
11931
11932$as_echo "#define COVENANT 0" >>confdefs.h
11933
11934
11935
11936
11937cat >>confdefs.h <<_ACEOF
11938#define PRODUCT "$UCAPP"
11939_ACEOF
11940
11941
11942cat >>confdefs.h <<_ACEOF
11943#define LCPRODUCT "$APP"
11944_ACEOF
11945
11946
11947# Check whether --enable-release was given.
11948if test "${enable_release+set}" = set; then :
11949  enableval=$enable_release; unset prerelease
11950fi
11951
11952
11953if test x"$prerelease" != x; then
11954
11955$as_echo "#define PRERELEASE 1" >>confdefs.h
11956
11957else
11958
11959$as_echo "#define PRERELEASE 0" >>confdefs.h
11960
11961fi
11962 if test x$prerelease != x; then
11963  PRERELEASE_TRUE=
11964  PRERELEASE_FALSE='#'
11965else
11966  PRERELEASE_TRUE='#'
11967  PRERELEASE_FALSE=
11968fi
11969
11970
11971#compiler related checks, updates CFLAGS and CPPFLAGS and sets
11972# 'warn' with flags for warnings
11973
11974for ac_prog in 'bison -y' byacc
11975do
11976  # Extract the first word of "$ac_prog", so it can be a program name with args.
11977set dummy $ac_prog; ac_word=$2
11978{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
11979$as_echo_n "checking for $ac_word... " >&6; }
11980if ${ac_cv_prog_YACC+:} false; then :
11981  $as_echo_n "(cached) " >&6
11982else
11983  if test -n "$YACC"; then
11984  ac_cv_prog_YACC="$YACC" # Let the user override the test.
11985else
11986as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11987for as_dir in $PATH
11988do
11989  IFS=$as_save_IFS
11990  test -z "$as_dir" && as_dir=.
11991    for ac_exec_ext in '' $ac_executable_extensions; do
11992  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
11993    ac_cv_prog_YACC="$ac_prog"
11994    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
11995    break 2
11996  fi
11997done
11998  done
11999IFS=$as_save_IFS
12000
12001fi
12002fi
12003YACC=$ac_cv_prog_YACC
12004if test -n "$YACC"; then
12005  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5
12006$as_echo "$YACC" >&6; }
12007else
12008  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12009$as_echo "no" >&6; }
12010fi
12011
12012
12013  test -n "$YACC" && break
12014done
12015test -n "$YACC" || YACC="yacc"
12016
12017for ac_prog in gawk mawk nawk awk
12018do
12019  # Extract the first word of "$ac_prog", so it can be a program name with args.
12020set dummy $ac_prog; ac_word=$2
12021{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12022$as_echo_n "checking for $ac_word... " >&6; }
12023if ${ac_cv_prog_AWK+:} false; then :
12024  $as_echo_n "(cached) " >&6
12025else
12026  if test -n "$AWK"; then
12027  ac_cv_prog_AWK="$AWK" # Let the user override the test.
12028else
12029as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12030for as_dir in $PATH
12031do
12032  IFS=$as_save_IFS
12033  test -z "$as_dir" && as_dir=.
12034    for ac_exec_ext in '' $ac_executable_extensions; do
12035  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12036    ac_cv_prog_AWK="$ac_prog"
12037    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12038    break 2
12039  fi
12040done
12041  done
12042IFS=$as_save_IFS
12043
12044fi
12045fi
12046AWK=$ac_cv_prog_AWK
12047if test -n "$AWK"; then
12048  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
12049$as_echo "$AWK" >&6; }
12050else
12051  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12052$as_echo "no" >&6; }
12053fi
12054
12055
12056  test -n "$AWK" && break
12057done
12058
12059for ac_prog in flex lex
12060do
12061  # Extract the first word of "$ac_prog", so it can be a program name with args.
12062set dummy $ac_prog; ac_word=$2
12063{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
12064$as_echo_n "checking for $ac_word... " >&6; }
12065if ${ac_cv_prog_LEX+:} false; then :
12066  $as_echo_n "(cached) " >&6
12067else
12068  if test -n "$LEX"; then
12069  ac_cv_prog_LEX="$LEX" # Let the user override the test.
12070else
12071as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
12072for as_dir in $PATH
12073do
12074  IFS=$as_save_IFS
12075  test -z "$as_dir" && as_dir=.
12076    for ac_exec_ext in '' $ac_executable_extensions; do
12077  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
12078    ac_cv_prog_LEX="$ac_prog"
12079    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
12080    break 2
12081  fi
12082done
12083  done
12084IFS=$as_save_IFS
12085
12086fi
12087fi
12088LEX=$ac_cv_prog_LEX
12089if test -n "$LEX"; then
12090  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5
12091$as_echo "$LEX" >&6; }
12092else
12093  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12094$as_echo "no" >&6; }
12095fi
12096
12097
12098  test -n "$LEX" && break
12099done
12100test -n "$LEX" || LEX=":"
12101
12102if test "x$LEX" != "x:"; then
12103  cat >conftest.l <<_ACEOF
12104%%
12105a { ECHO; }
12106b { REJECT; }
12107c { yymore (); }
12108d { yyless (1); }
12109e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument.  */
12110    yyless ((input () != 0)); }
12111f { unput (yytext[0]); }
12112. { BEGIN INITIAL; }
12113%%
12114#ifdef YYTEXT_POINTER
12115extern char *yytext;
12116#endif
12117int
12118main (void)
12119{
12120  return ! yylex () + ! yywrap ();
12121}
12122_ACEOF
12123{ { ac_try="$LEX conftest.l"
12124case "(($ac_try" in
12125  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12126  *) ac_try_echo=$ac_try;;
12127esac
12128eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
12129$as_echo "$ac_try_echo"; } >&5
12130  (eval "$LEX conftest.l") 2>&5
12131  ac_status=$?
12132  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
12133  test $ac_status = 0; }
12134{ $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5
12135$as_echo_n "checking lex output file root... " >&6; }
12136if ${ac_cv_prog_lex_root+:} false; then :
12137  $as_echo_n "(cached) " >&6
12138else
12139
12140if test -f lex.yy.c; then
12141  ac_cv_prog_lex_root=lex.yy
12142elif test -f lexyy.c; then
12143  ac_cv_prog_lex_root=lexyy
12144else
12145  as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5
12146fi
12147fi
12148{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5
12149$as_echo "$ac_cv_prog_lex_root" >&6; }
12150LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
12151
12152if test -z "${LEXLIB+set}"; then
12153  { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5
12154$as_echo_n "checking lex library... " >&6; }
12155if ${ac_cv_lib_lex+:} false; then :
12156  $as_echo_n "(cached) " >&6
12157else
12158
12159    ac_save_LIBS=$LIBS
12160    ac_cv_lib_lex='none needed'
12161    for ac_lib in '' -lfl -ll; do
12162      LIBS="$ac_lib $ac_save_LIBS"
12163      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12164/* end confdefs.h.  */
12165`cat $LEX_OUTPUT_ROOT.c`
12166_ACEOF
12167if ac_fn_c_try_link "$LINENO"; then :
12168  ac_cv_lib_lex=$ac_lib
12169fi
12170rm -f core conftest.err conftest.$ac_objext \
12171    conftest$ac_exeext conftest.$ac_ext
12172      test "$ac_cv_lib_lex" != 'none needed' && break
12173    done
12174    LIBS=$ac_save_LIBS
12175
12176fi
12177{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5
12178$as_echo "$ac_cv_lib_lex" >&6; }
12179  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
12180fi
12181
12182
12183{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5
12184$as_echo_n "checking whether yytext is a pointer... " >&6; }
12185if ${ac_cv_prog_lex_yytext_pointer+:} false; then :
12186  $as_echo_n "(cached) " >&6
12187else
12188  # POSIX says lex can declare yytext either as a pointer or an array; the
12189# default is implementation-dependent.  Figure out which it is, since
12190# not all implementations provide the %pointer and %array declarations.
12191ac_cv_prog_lex_yytext_pointer=no
12192ac_save_LIBS=$LIBS
12193LIBS="$LEXLIB $ac_save_LIBS"
12194cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12195/* end confdefs.h.  */
12196
12197  #define YYTEXT_POINTER 1
12198`cat $LEX_OUTPUT_ROOT.c`
12199_ACEOF
12200if ac_fn_c_try_link "$LINENO"; then :
12201  ac_cv_prog_lex_yytext_pointer=yes
12202fi
12203rm -f core conftest.err conftest.$ac_objext \
12204    conftest$ac_exeext conftest.$ac_ext
12205LIBS=$ac_save_LIBS
12206
12207fi
12208{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5
12209$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; }
12210if test $ac_cv_prog_lex_yytext_pointer = yes; then
12211
12212$as_echo "#define YYTEXT_POINTER 1" >>confdefs.h
12213
12214fi
12215rm -f conftest.l $LEX_OUTPUT_ROOT.c
12216
12217fi
12218if test "$LEX" = :; then
12219  LEX=${am_missing_run}flex
12220fi
12221ac_ext=c
12222ac_cpp='$CPP $CPPFLAGS'
12223ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12224ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12225ac_compiler_gnu=$ac_cv_c_compiler_gnu
12226{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
12227$as_echo_n "checking how to run the C preprocessor... " >&6; }
12228# On Suns, sometimes $CPP names a directory.
12229if test -n "$CPP" && test -d "$CPP"; then
12230  CPP=
12231fi
12232if test -z "$CPP"; then
12233  if ${ac_cv_prog_CPP+:} false; then :
12234  $as_echo_n "(cached) " >&6
12235else
12236      # Double quotes because CPP needs to be expanded
12237    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
12238    do
12239      ac_preproc_ok=false
12240for ac_c_preproc_warn_flag in '' yes
12241do
12242  # Use a header file that comes with gcc, so configuring glibc
12243  # with a fresh cross-compiler works.
12244  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
12245  # <limits.h> exists even on freestanding compilers.
12246  # On the NeXT, cc -E runs the code through the compiler's parser,
12247  # not just through cpp. "Syntax error" is here to catch this case.
12248  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12249/* end confdefs.h.  */
12250#ifdef __STDC__
12251# include <limits.h>
12252#else
12253# include <assert.h>
12254#endif
12255		     Syntax error
12256_ACEOF
12257if ac_fn_c_try_cpp "$LINENO"; then :
12258
12259else
12260  # Broken: fails on valid input.
12261continue
12262fi
12263rm -f conftest.err conftest.i conftest.$ac_ext
12264
12265  # OK, works on sane cases.  Now check whether nonexistent headers
12266  # can be detected and how.
12267  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12268/* end confdefs.h.  */
12269#include <ac_nonexistent.h>
12270_ACEOF
12271if ac_fn_c_try_cpp "$LINENO"; then :
12272  # Broken: success on invalid input.
12273continue
12274else
12275  # Passes both tests.
12276ac_preproc_ok=:
12277break
12278fi
12279rm -f conftest.err conftest.i conftest.$ac_ext
12280
12281done
12282# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
12283rm -f conftest.i conftest.err conftest.$ac_ext
12284if $ac_preproc_ok; then :
12285  break
12286fi
12287
12288    done
12289    ac_cv_prog_CPP=$CPP
12290
12291fi
12292  CPP=$ac_cv_prog_CPP
12293else
12294  ac_cv_prog_CPP=$CPP
12295fi
12296{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
12297$as_echo "$CPP" >&6; }
12298ac_preproc_ok=false
12299for ac_c_preproc_warn_flag in '' yes
12300do
12301  # Use a header file that comes with gcc, so configuring glibc
12302  # with a fresh cross-compiler works.
12303  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
12304  # <limits.h> exists even on freestanding compilers.
12305  # On the NeXT, cc -E runs the code through the compiler's parser,
12306  # not just through cpp. "Syntax error" is here to catch this case.
12307  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12308/* end confdefs.h.  */
12309#ifdef __STDC__
12310# include <limits.h>
12311#else
12312# include <assert.h>
12313#endif
12314		     Syntax error
12315_ACEOF
12316if ac_fn_c_try_cpp "$LINENO"; then :
12317
12318else
12319  # Broken: fails on valid input.
12320continue
12321fi
12322rm -f conftest.err conftest.i conftest.$ac_ext
12323
12324  # OK, works on sane cases.  Now check whether nonexistent headers
12325  # can be detected and how.
12326  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12327/* end confdefs.h.  */
12328#include <ac_nonexistent.h>
12329_ACEOF
12330if ac_fn_c_try_cpp "$LINENO"; then :
12331  # Broken: success on invalid input.
12332continue
12333else
12334  # Passes both tests.
12335ac_preproc_ok=:
12336break
12337fi
12338rm -f conftest.err conftest.i conftest.$ac_ext
12339
12340done
12341# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
12342rm -f conftest.i conftest.err conftest.$ac_ext
12343if $ac_preproc_ok; then :
12344
12345else
12346  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
12347$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
12348as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
12349See \`config.log' for more details" "$LINENO" 5; }
12350fi
12351
12352ac_ext=c
12353ac_cpp='$CPP $CPPFLAGS'
12354ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
12355ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
12356ac_compiler_gnu=$ac_cv_c_compiler_gnu
12357
12358if test $ac_cv_c_compiler_gnu = yes; then
12359    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
12360$as_echo_n "checking whether $CC needs -traditional... " >&6; }
12361if ${ac_cv_prog_gcc_traditional+:} false; then :
12362  $as_echo_n "(cached) " >&6
12363else
12364    ac_pattern="Autoconf.*'x'"
12365  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12366/* end confdefs.h.  */
12367#include <sgtty.h>
12368Autoconf TIOCGETP
12369_ACEOF
12370if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12371  $EGREP "$ac_pattern" >/dev/null 2>&1; then :
12372  ac_cv_prog_gcc_traditional=yes
12373else
12374  ac_cv_prog_gcc_traditional=no
12375fi
12376rm -f conftest*
12377
12378
12379  if test $ac_cv_prog_gcc_traditional = no; then
12380    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12381/* end confdefs.h.  */
12382#include <termio.h>
12383Autoconf TCGETA
12384_ACEOF
12385if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
12386  $EGREP "$ac_pattern" >/dev/null 2>&1; then :
12387  ac_cv_prog_gcc_traditional=yes
12388fi
12389rm -f conftest*
12390
12391  fi
12392fi
12393{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
12394$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
12395  if test $ac_cv_prog_gcc_traditional = yes; then
12396    CC="$CC -traditional"
12397  fi
12398fi
12399
12400
12401case $host in
12402    alpha*-dec-osf*)
12403	CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_XOPEN_SOURCE_EXTENDED -DBYTE_ORDER=LITTLE_ENDIAN -D_POSIX_SOURCE -D_POSIX_C_SOURCE=199309L -D_OSF_SOURCE"
12404	;;
12405
12406    *-*-hpux*)
12407	#HPUX needs _PROTOTYPES to include prototypes
12408	#for configure (for gcc and cc)
12409	CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_PROTOTYPES"
12410	;;
12411
12412    *-*-solaris*)
12413	#for msghdr msg_flags
12414	CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_XOPEN_SOURCE=600"
12415	CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D__EXTENSIONS__ -DBSD_COMP"
12416	;;
12417
12418    *-*-linux-*)
12419	CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED"
12420	CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_BSD_SOURCE -D_DEFAULT_SOURCE"
12421	;;
12422
12423    *-*-aix*)
12424
12425$as_echo "#define _ALL_SOURCE 1" >>confdefs.h
12426
12427	CPPFLAGS="${CPPFLAGS}${CPPFLAGS+ }-DXOPEN_SOURCE_EXTENDED=1"
12428	;;
12429esac
12430
12431#XXX cross compilation
12432case $host_alias in
12433    arm-linux-androideabi)
12434	LDFLAGS="$LDFLAGS${LDFLAGS:+ }-lgcc -ldl"
12435	;;
12436esac
12437
12438#XXX only needed for libraries
12439case $host in
12440    *-*-darwin*)
12441	if test x"${enable_dependency_tracking}" = xno; then
12442	    HW=`uname -m`
12443	    case $HW in
12444		ppc*)
12445		    CFLAGS="$CFLAGS${CFLAGS:+ }-arch ppc -arch ppc64"
12446		    LDFLAGS="$LDLAGS${LDLAGS:+ }-arch ppc -arch ppc64"
12447		    ;;
12448		*)
12449		    CFLAGS="$CFLAGS${CFLAGS:+ }-arch i386 -arch x86_64"
12450		    LDFLAGS="$LDLAGS${LDLAGS:+ }-arch i386 -arch x86_64"
12451		    ;;
12452	    esac
12453	fi
12454esac
12455
12456unset COMPTYPE
12457unset FAILWARN
12458{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler type" >&5
12459$as_echo_n "checking for compiler type... " >&6; }
12460if $CC -v 2>&1 | tail -1 | egrep '^gcc ' >/dev/null; then
12461    COMPTYPE=gcc
12462    FAILWARN="-Wall -Werror"
12463elif $CC -v 2>&1 | egrep '(^|^a-zA-Z+ )(clang|LLVM) ' >/dev/null; then
12464    COMPTYPE=clang
12465    FAILWARN="-Wall -Werror"
12466elif $CC -V 2>&1 | grep 'Sun C ' >/dev/null; then
12467    COMPTYPE=suncc
12468    FAILWARN="-v -errwarn=%all"
12469elif $CC -v 2>&1 | egrep '^pcc ' >/dev/null; then
12470    COMPTYPE=pcc
12471elif $CC -qversion 2>&1 | egrep '^IBM XL C' >/dev/null; then
12472    COMPTYPE=xlc
12473    FAILWARN="-qhalt=w"
12474else
12475    #XXX
12476    case $host in
12477	alphaev6-dec-osf*)
12478	    COMPTYPE="osfcc"
12479	    ;;
12480	alpha*-dec-osf*)
12481	    COMPTYPE="oldosfcc"
12482	    ;;
12483	*-*-irix*) #sgi cc
12484	    COMPTYPE="sgicc"
12485	    ;;
12486	*-*-hpux*)
12487	    COMPTYPE="hpuxcc"
12488	    ;;
12489	*)
12490	    #gcc compatible compiler?
12491	    if test x"$GCC" != x; then
12492		COMPTYPE="gcc"
12493	    fi
12494	    ;;
12495    esac
12496fi
12497if test x"$COMPTYPE" = x; then
12498    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
12499$as_echo "unknown" >&6; }
12500else
12501    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPTYPE" >&5
12502$as_echo "$COMPTYPE" >&6; }
12503fi
12504
12505{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for preprocessor flags" >&5
12506$as_echo_n "checking for preprocessor flags... " >&6; }
12507unset cpp_flags
12508case $ac_cv_prog_CPP in
12509    gcc*)
12510	#simplify parsing after cpp processing (for e.g. errno checks)
12511	cpp_flags="${cpp_flags}${cpp_flags:+ }-P"
12512
12513	if test x"`uname`" = xSunOS; then
12514	    cpp_flags="${cpp_flags}${cpp_flags:+ }-std=gnu99"
12515	fi
12516	;;
12517    suncc*)
12518	if test x"`uname`" = xSunOS; then
12519	    cpp_flags="${cpp_flags}${cpp_flags:+ }-xc99=all"
12520	fi
12521	;;
12522esac
12523if test x"$cpp_flags" != x; then
12524   CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$cpp_flags"
12525   { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cpp_flags" >&5
12526$as_echo "$cpp_flags" >&6; }
12527else
12528   { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
12529$as_echo "none" >&6; }
12530fi
12531
12532unset comp_flags
12533{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler flags" >&5
12534$as_echo_n "checking for compiler flags... " >&6; }
12535case $COMPTYPE in
12536    gcc)
12537	if test x"`uname`" = xSunOS; then
12538	    comp_flags="-std=gnu99"
12539	fi
12540	;;
12541
12542    suncc)
12543	#-xs provides easier debugging with gdb
12544	comp_flags="-Xa -xs"
12545	if test x"`uname`" = xSunOS; then
12546	    comp_flags="$comp_flags -xc99=all"
12547	fi
12548    ;;
12549
12550    osfcc)
12551	comp_flags="-std1"
12552    ;;
12553
12554    oldosfcc) #XXX is it possible to get it to work with -newc?
12555	if test x"$GCC" = x; then
12556	    comp_flags="-std1 -oldc"
12557	fi
12558    ;;
12559
12560    hpuxcc)
12561	if test x"$GCC" = x; then
12562	    CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_XOPEN_SOURCE"
12563	    #XXX when cc is used as CPP it needs -Ae to work
12564	    #    for L_SOCKPROTO; add -Ae to CPPFLAGS.
12565	    #    This won't work if CPP is specified by hand
12566	    #    and is something else than cc (when CC is hp cc)
12567#	    comp_flags="-Ae"
12568	    CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-Ae"
12569	fi
12570	;;
12571
12572    xlc)
12573	comp_flags=""
12574	;;
12575esac
12576#make sure compiling with compiler options works
12577if test x"$comp_flags" != x; then
12578    oCFLAGS="$CFLAGS"
12579    CFLAGS="$CFLAGS${CFLAGS:+ }$comp_flags"
12580    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12581/* end confdefs.h.  */
12582
12583int
12584main ()
12585{
12586
12587  ;
12588  return 0;
12589}
12590_ACEOF
12591if ac_fn_c_try_compile "$LINENO"; then :
12592  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $comp_flags" >&5
12593$as_echo "$comp_flags" >&6; }
12594else
12595  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
12596$as_echo "none" >&6; }
12597		    unset comp_flags
12598fi
12599rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12600    CFLAGS="$oCFLAGS"
12601else
12602    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
12603$as_echo "none" >&6; }
12604fi
12605
12606case $COMPTYPE in
12607    suncc)
12608	true #skip on this platform, gives warning but does not fail
12609	;;
12610    *)
12611	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for support for -pipe compiler flag" >&5
12612$as_echo_n "checking for support for -pipe compiler flag... " >&6; }
12613	oCFLAGS="$CFLAGS"
12614	CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN -pipe"
12615	if test "$cross_compiling" = yes; then :
12616  	     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12617$as_echo "no" >&6; }
12618else
12619  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12620/* end confdefs.h.  */
12621
12622int main()
12623{
12624	return 0;
12625	}
12626_ACEOF
12627if ac_fn_c_try_run "$LINENO"; then :
12628  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12629$as_echo "yes" >&6; }
12630	     comp_flags="${comp_flags}${comp_flags:+ }-pipe"
12631else
12632  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12633$as_echo "no" >&6; }
12634fi
12635rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12636  conftest.$ac_objext conftest.beam conftest.$ac_ext
12637fi
12638
12639	CFLAGS="$oCFLAGS"
12640	;;
12641esac
12642
12643{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for support for -Wbounded compiler flag" >&5
12644$as_echo_n "checking for support for -Wbounded compiler flag... " >&6; }
12645case $COMPTYPE in
12646    xlc)
12647	#use of -Wbounded does not result in an error even when
12648	#-qhalt=w is specified, resulting in a warning for each
12649	#compiled file, so disable check
12650	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabled for this compiler" >&5
12651$as_echo "no, disabled for this compiler" >&6; }
12652	;;
12653    *)
12654	oCFLAGS="$CFLAGS"
12655	CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN -Wbounded"
12656	if test "$cross_compiling" = yes; then :
12657  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12658$as_echo "no" >&6; } else
12659  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12660/* end confdefs.h.  */
12661
12662int main()
12663{
12664        return 0;
12665}
12666_ACEOF
12667if ac_fn_c_try_run "$LINENO"; then :
12668  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12669$as_echo "yes" >&6; }
12670	 comp_flags="${comp_flags}${comp_flags:+ }-Wbounded"
12671
12672$as_echo "#define HAVE_DECL_BOUNDED 1" >>confdefs.h
12673
12674else
12675  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12676$as_echo "no" >&6; }
12677fi
12678rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12679  conftest.$ac_objext conftest.beam conftest.$ac_ext
12680fi
12681
12682	CFLAGS="$oCFLAGS"
12683	;;
12684esac
12685
12686{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports _Pragma()" >&5
12687$as_echo_n "checking whether compiler supports _Pragma()... " >&6; }
12688oCFLAGS="$CFLAGS"
12689CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
12690cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12691/* end confdefs.h.  */
12692
12693#include <stdlib.h>
12694
12695#define foo(x)                                            \
12696do {                                                      \
12697 _Pragma("GCC diagnostic ignored \"-Waddress\"");         \
12698} while (x > 1)
12699
12700int
12701main ()
12702{
12703foo(0)
12704  ;
12705  return 0;
12706}
12707_ACEOF
12708if ac_fn_c_try_compile "$LINENO"; then :
12709  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12710$as_echo "yes" >&6; }
12711
12712$as_echo "#define HAVE_PRAGMA_SUPPORT 1" >>confdefs.h
12713
12714else
12715  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12716$as_echo "no" >&6; }
12717fi
12718rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
12719CFLAGS="$oCFLAGS"
12720
12721{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__ support" >&5
12722$as_echo_n "checking for __attribute__ support... " >&6; }
12723oCFLAGS="$CFLAGS"
12724CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
12725if test "$cross_compiling" = yes; then :
12726  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12727$as_echo "no" >&6; } else
12728  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12729/* end confdefs.h.  */
12730
12731#include <stdlib.h>
12732
12733void errfunc(void) __attribute__((noreturn));
12734
12735void errfunc(void)
12736{
12737    exit(0);
12738}
12739
12740int main()
12741{
12742    errfunc();
12743}
12744_ACEOF
12745if ac_fn_c_try_run "$LINENO"; then :
12746  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12747$as_echo "yes" >&6; }
12748
12749$as_echo "#define HAVE_DECL_ATTRIBUTE 1" >>confdefs.h
12750
12751else
12752  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12753$as_echo "no" >&6; }
12754fi
12755rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12756  conftest.$ac_objext conftest.beam conftest.$ac_ext
12757fi
12758
12759CFLAGS="$oCFLAGS"
12760
12761{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for constructor __attribute__ support" >&5
12762$as_echo_n "checking for constructor __attribute__ support... " >&6; }
12763oCFLAGS="$CFLAGS"
12764CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
12765if test "$cross_compiling" = yes; then :
12766  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12767$as_echo "no" >&6; } else
12768  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12769/* end confdefs.h.  */
12770
12771#include <stdlib.h>
12772
12773void errfunc(void) __attribute__((constructor));
12774
12775void errfunc(void)
12776{
12777    exit(0);
12778}
12779
12780int main()
12781{
12782    errfunc();
12783}
12784_ACEOF
12785if ac_fn_c_try_run "$LINENO"; then :
12786  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12787$as_echo "yes" >&6; }
12788
12789$as_echo "#define HAVE_DECL_CONSTRUCTOR 1" >>confdefs.h
12790
12791else
12792  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12793$as_echo "no" >&6; }
12794fi
12795rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12796  conftest.$ac_objext conftest.beam conftest.$ac_ext
12797fi
12798
12799CFLAGS="$oCFLAGS"
12800
12801{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__ nonnull support" >&5
12802$as_echo_n "checking for __attribute__ nonnull support... " >&6; }
12803oCFLAGS="$CFLAGS"
12804CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
12805if test "$cross_compiling" = yes; then :
12806  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12807$as_echo "no" >&6; } else
12808  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12809/* end confdefs.h.  */
12810
12811#include <stdlib.h>
12812
12813void func(char *) __attribute__((__nonnull__(1)));
12814
12815void func(char *f)
12816{
12817    char *d;
12818    d = f;
12819}
12820
12821int main()
12822{
12823    func(NULL);
12824}
12825_ACEOF
12826if ac_fn_c_try_run "$LINENO"; then :
12827  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12828$as_echo "yes" >&6; }
12829
12830$as_echo "#define HAVE_DECL_NONNULL 1" >>confdefs.h
12831
12832else
12833  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12834$as_echo "no" >&6; }
12835fi
12836rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12837  conftest.$ac_objext conftest.beam conftest.$ac_ext
12838fi
12839
12840CFLAGS="$oCFLAGS"
12841
12842{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __printf__ format attribute support" >&5
12843$as_echo_n "checking for __printf__ format attribute support... " >&6; }
12844oCFLAGS="$CFLAGS"
12845CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
12846if test "$cross_compiling" = yes; then :
12847  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12848$as_echo "no" >&6; } else
12849  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12850/* end confdefs.h.  */
12851
12852#include <stdlib.h>
12853
12854void func(const char *fmt, ...)
12855   __attribute__((format(__printf__, 1, 2)));
12856
12857void func(const char *fmt, ...) {
12858     (void)fmt;
12859     return;
12860}
12861
12862int main()
12863{
12864    func("foo");
12865    return 0;
12866}
12867_ACEOF
12868if ac_fn_c_try_run "$LINENO"; then :
12869  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12870$as_echo "yes" >&6; }
12871
12872$as_echo "#define HAVE_DECL_FORMAT 1" >>confdefs.h
12873
12874else
12875  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12876$as_echo "no" >&6; }
12877fi
12878rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
12879  conftest.$ac_objext conftest.beam conftest.$ac_ext
12880fi
12881
12882CFLAGS="$oCFLAGS"
12883
12884#check whether to enable debugging
12885unset NODEBUG
12886unset debug_enabled
12887{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compilation with debugging" >&5
12888$as_echo_n "checking for compilation with debugging... " >&6; }
12889# Check whether --enable-debug was given.
12890if test "${enable_debug+set}" = set; then :
12891  enableval=$enable_debug; if test x"$enableval" = xno; then
12892    NODEBUG="Disabled, using --disable-debug"
12893 fi
12894else
12895  #off by default for full release, enabled by default for prerelease
12896 if test x"$prerelease" = x; then
12897    NODEBUG="Disabled (default)"
12898 fi
12899fi
12900
12901if test x"$NODEBUG" != x; then
12902    { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
12903$as_echo "disabled" >&6; }
12904else
12905    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12906$as_echo "yes" >&6; }
12907    debug_enabled=t
12908    FEAT="$FEAT${FEAT:+ }debug"
12909fi
12910
12911#check whether to enable livedebug
12912unset NOLIVEDEBUG
12913{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for live debugging" >&5
12914$as_echo_n "checking for live debugging... " >&6; }
12915# Check whether --enable-livedebug was given.
12916if test "${enable_livedebug+set}" = set; then :
12917  enableval=$enable_livedebug; if test x"$enableval" = xno; then
12918    NOLIVEDEBUG="Disabled, using --disable-livedebug"
12919 fi
12920else
12921  #off by default for full release, enabled by default for prerelease
12922 if test x"$prerelease" = x; then
12923    NOLIVEDEBUG="Disabled (default)"
12924 fi
12925fi
12926
12927if test x"$NOLIVEDEBUG" != x; then
12928    { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
12929$as_echo "disabled" >&6; }
12930else
12931    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12932$as_echo "yes" >&6; }
12933    debug_enabled=t
12934    FEAT="$FEAT${FEAT:+ }livedebug"
12935
12936$as_echo "#define HAVE_COND_LIVEDEBUG 1" >>confdefs.h
12937
12938fi
12939
12940#check for problem with linker/gcc on AIX
12941unset aixldbug
12942case $COMPTYPE in
12943    gcc)
12944	oCFLAGS="$CFLAGS"
12945	CFLAGS="$CFLAGS${CFLAGS:+ }-g"
12946	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiling using -g works with gcc" >&5
12947$as_echo_n "checking whether compiling using -g works with gcc... " >&6; }
12948	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12949/* end confdefs.h.  */
12950int foo;
12951int
12952main ()
12953{
12954foo++;
12955  ;
12956  return 0;
12957}
12958_ACEOF
12959if ac_fn_c_try_link "$LINENO"; then :
12960  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12961$as_echo "yes" >&6; }
12962else
12963  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12964$as_echo "no" >&6; }
12965             { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: building with -g0" >&5
12966$as_echo "$as_me: WARNING: building with -g0" >&2;}
12967	     aixldbug=t
12968fi
12969rm -f core conftest.err conftest.$ac_objext \
12970    conftest$ac_exeext conftest.$ac_ext
12971        CFLAGS="$oCFLAGS"
12972        ;;
12973esac
12974
12975#enable -fstack-protector if debug enabled
12976#XXX disabled, can lead to build failure on some platforms
12977#if test x"${debug_enabled}" != x; then
12978#   AC_MSG_CHECKING([for support for -fstack-protector compiler flag])
12979#   oCFLAGS="$CFLAGS"
12980#   CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN -fstack-protector"
12981#   AC_TRY_RUN([
12982#int main()
12983#{
12984#        return 0;
12985#}], [AC_MSG_RESULT([yes])
12986#     comp_flags="${comp_flags}${comp_flags:+ }-fstack-protector"],
12987#    [AC_MSG_RESULT([no])],
12988#    [AC_MSG_RESULT([no]) dnl assume not supported when cross-compiling])
12989#   CFLAGS="$oCFLAGS"
12990#fi
12991
12992#set compilation debugging flags
12993if test x"${debug_enabled}" = xt; then
12994    #no optimization wanted
12995    if test x"${ac_cv_prog_cc_g}" = xyes; then
12996	case $COMPTYPE in
12997	    gcc)
12998		if test x"$aixldbug" != x; then
12999		    #disable debug info
13000		    CFLAGS="$CFLAGS${CFLAGS:+ }-g0"
13001		else
13002		    CFLAGS="$CFLAGS${CFLAGS:+ }-ggdb"
13003		fi
13004		;;
13005	    *)
13006		CFLAGS="$CFLAGS${CFLAGS:+ }-g"
13007		;;
13008	esac
13009    fi
13010    CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-DDEBUG=1"
13011else
13012    #autoconf_compflags is set to "-g -O2" with GCC
13013    #override CFLAGS when running configure to avoid this
13014    CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-DDEBUG=0"
13015    CFLAGS="$CFLAGS${CFLAGS:+ }$autoconf_compflags"
13016
13017    case $COMPTYPE in
13018	gcc)
13019	    if test x"$aixldbug" != x; then
13020	        #disable debug info
13021		if echo $CFLAGS | grep -- "-g " >/dev/null; then
13022		    CFLAGS="`echo $CFLAGS | sed -e 's/-g //g'`"
13023		fi
13024		CFLAGS="$CFLAGS${CFLAGS:+ }-g0"
13025	    else
13026		#use -ggdb also when not debugging
13027		if echo $CFLAGS | grep -- "-g " >/dev/null; then
13028		    CFLAGS="`echo $CFLAGS | sed -e 's/-g //g'`"
13029		fi
13030		CFLAGS="$CFLAGS${CFLAGS:+ }-ggdb"
13031	    fi
13032	    ;;
13033    esac
13034fi
13035
13036#check whether to compilation warnings
13037unset NOWARN
13038{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for warning flags" >&5
13039$as_echo_n "checking for warning flags... " >&6; }
13040# Check whether --enable-warnings was given.
13041if test "${enable_warnings+set}" = set; then :
13042  enableval=$enable_warnings; if test x"$enableval" = xno; then
13043    NOWARN="Disabled, using --disable-warnings"
13044 fi
13045else
13046  #off by default
13047 NOWARN="Disabled (default)"
13048fi
13049
13050
13051#place warning flags in $warn
13052if test x"$NOWARN" = x; then
13053    #try to enable compiler specific warning flags
13054    case $COMPTYPE in
13055	gcc)
13056	    warn="-Wall -Wformat -W -Wnested-externs -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wbad-function-cast -Wpointer-arith -Wundef"
13057	    #warn="$warn -Wold-style-cast -Winline -Waggregate-return -Wconversion -Wwrite-strings -Wtraditional -Wshadow"
13058	    ;;
13059
13060	hpuxcc)
13061	    warn="-v"
13062	    ;;
13063
13064	*osfcc) #osf cc
13065#	    warn="-w0 -check -portable -warnprotos"
13066	    true
13067	    ;;
13068
13069#	pcc)
13070#	    warn="-Wall --warn-common --warn-constructors --warn-multiple-gp --warn-once --warn-section-align --error-unresolved-symbols"
13071#	    ;;
13072
13073	sgicc) #sgi cc
13074	    warn="-fullwarn"
13075	    ;;
13076
13077	suncc)
13078	    warn="-v"
13079	    case $host in
13080		#XXX only available for some platforms
13081		sparc-*solaris*)
13082		    warn="$warn -xanalyze=code"
13083		    ;;
13084	    esac
13085	    ;;
13086
13087	xlc)
13088	    warn="-qinfo=all:noppt"
13089	    ;;
13090
13091	*) #try -Wall (gcc)
13092	    warn="-Wall"
13093	    ;;
13094    esac
13095
13096    oCFLAGS="$CFLAGS"
13097    CFLAGS="$CFLAGS${CFLAGS:+ }$warn"
13098    #make sure compilation is still possible
13099    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13100/* end confdefs.h.  */
13101
13102int
13103main ()
13104{
13105
13106  ;
13107  return 0;
13108}
13109_ACEOF
13110if ac_fn_c_try_compile "$LINENO"; then :
13111  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $warn" >&5
13112$as_echo "$warn" >&6; }
13113else
13114  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
13115$as_echo "none" >&6; }
13116		    unset warn
13117fi
13118rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13119    CFLAGS="$oCFLAGS"
13120else
13121    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
13122$as_echo "none" >&6; }
13123fi
13124
13125#check if compilation with FORTIFY_SOURCE gives error/warning
13126{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compilation with FORTIFY_SOURCE works" >&5
13127$as_echo_n "checking whether compilation with FORTIFY_SOURCE works... " >&6; }
13128oCFLAGS="$CFLAGS"
13129oCPPFLAGS="$CPPFLAGS"
13130CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
13131CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-D_FORTIFY_SOURCE=2"
13132cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13133/* end confdefs.h.  */
13134#include <stdio.h>
13135int
13136main ()
13137{
13138
13139  ;
13140  return 0;
13141}
13142_ACEOF
13143if ac_fn_c_try_compile "$LINENO"; then :
13144  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13145$as_echo "yes" >&6; }
13146else
13147  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13148$as_echo "no" >&6; }
13149		    CPPFLAGS="$oCPPFLAGS"
13150fi
13151rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13152CFLAGS="$oCFLAGS"
13153
13154#for Solaris, generate 64-bit binaries if running in 64-bit mode.
13155#building 32-bit binaries (the default) causes problems with
13156#LD_PRELOAD if running in a 64-bit environment.
13157#XXX more general solution would be to build and install both
13158unset sol64
13159case $host in
13160    *-*-solaris*)
13161	if test x`isainfo -b` = x64; then
13162	    ISA64DIR=`isainfo -n`
13163	    if test x"$ISA64DIR" != x; then
13164		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for support for -m64 compiler flag" >&5
13165$as_echo_n "checking for support for -m64 compiler flag... " >&6; }
13166		oCFLAGS="$CFLAGS"
13167		CFLAGS="$CFLAGS${CFLAGS:+ }-m64"
13168		if test "$cross_compiling" = yes; then :
13169  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13170$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13171as_fn_error $? "cannot run test program while cross compiling
13172See \`config.log' for more details" "$LINENO" 5; }
13173else
13174  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13175/* end confdefs.h.  */
13176
13177			int main() {
13178			    return 0;
13179		}
13180_ACEOF
13181if ac_fn_c_try_run "$LINENO"; then :
13182  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13183$as_echo "yes" >&6; }
13184		     sol64=t
13185
13186		     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: building for 64-bit addressing model" >&5
13187$as_echo "$as_me: WARNING: building for 64-bit addressing model" >&2;}
13188fi
13189rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13190  conftest.$ac_objext conftest.beam conftest.$ac_ext
13191fi
13192
13193		CFLAGS="$oCFLAGS"
13194	    fi
13195	fi
13196	;;
13197esac
13198
13199#NOTE: set warnings at the bottom; might interfere with tests
13200CFLAGS="$CFLAGS${CFLAGS:+ }$comp_flags"
13201
13202#check whether to compile with extra DIAGNOSTICS
13203unset NODIAG
13204{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compliation with DIAGNOSTIC" >&5
13205$as_echo_n "checking for compliation with DIAGNOSTIC... " >&6; }
13206
13207# Check whether --enable-diagnostic was given.
13208if test "${enable_diagnostic+set}" = set; then :
13209  enableval=$enable_diagnostic; if test x"$enableval" = xno; then
13210    NODIAG="Disabled, using --disable-diagnostics"
13211 fi
13212else
13213  #off by default for full release, enabled by default for prerelease
13214 if test x"$prerelease" = x; then
13215    NODIAG="Disabled (default)"
13216 fi
13217fi
13218
13219if test x"$NODIAG" = x; then
13220    FEAT="$FEAT${FEAT:+ }diagnostic"
13221    $as_echo "#define DIAGNOSTIC 1" >>confdefs.h
13222
13223    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13224$as_echo "yes" >&6; }
13225else
13226    $as_echo "#define DIAGNOSTIC 0" >>confdefs.h
13227
13228    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13229$as_echo "no" >&6; }
13230fi
13231
13232#check whether to build with profiling
13233unset NOPROFIL
13234for ac_func in moncontrol
13235do :
13236  ac_fn_c_check_func "$LINENO" "moncontrol" "ac_cv_func_moncontrol"
13237if test "x$ac_cv_func_moncontrol" = xyes; then :
13238  cat >>confdefs.h <<_ACEOF
13239#define HAVE_MONCONTROL 1
13240_ACEOF
13241
13242fi
13243done
13244
13245{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether profiled compilation requested" >&5
13246$as_echo_n "checking whether profiled compilation requested... " >&6; }
13247# Check whether --enable-profiling was given.
13248if test "${enable_profiling+set}" = set; then :
13249  enableval=$enable_profiling; if test x"$enableval" = xno; then
13250    NOPROFIL="Disabled, using --disable-profiling"
13251 fi
13252else
13253  #off by default
13254 NOPROFIL="Disabled (default)"
13255fi
13256
13257if test x"$NOPROFIL" = x; then
13258    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13259$as_echo "yes" >&6; }
13260
13261    oLDFLAGS="$LDFLAGS"
13262    oCFLAGS="$CFLAGS"
13263    LDFLAGS="$LDFLAGS${LDFLAGS:+ }-pg"
13264    CFLAGS="$CFLAGS${CFLAGS:+ }-pg -DPROFILING"
13265    if test "$cross_compiling" = yes; then :
13266  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13267$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13268as_fn_error $? "cannot run test program while cross compiling
13269See \`config.log' for more details" "$LINENO" 5; }
13270else
13271  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13272/* end confdefs.h.  */
13273
13274int main()
13275{
13276	return 0;
13277}
13278_ACEOF
13279if ac_fn_c_try_run "$LINENO"; then :
13280  FEAT="$FEAT${FEAT:+ }profiling"
13281
13282$as_echo "#define HAVE_PROFILING 1" >>confdefs.h
13283
13284
13285     case $host in
13286	 *-*-openbsd* | *-*-freebsd*)
13287	     #static linking, disable server preloading
13288	     no_preload_server=t
13289	     #OpenBSD and FreeBSD appear to be happier if -lc is included
13290	     #when profiling is enabled
13291	     LIBS="$LIBS${LIBS:+ }-lc"
13292	     ;;
13293     esac
13294else
13295  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: profiling requested, but compilation with profiling fails" >&5
13296$as_echo "$as_me: WARNING: profiling requested, but compilation with profiling fails" >&2;}
13297    NOPROFIL="Disabled, profiled compilation fails"
13298    CFLAGS="$oCFLAGS"
13299    LDFLAGS="$oLDFLAGS"
13300fi
13301rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13302  conftest.$ac_objext conftest.beam conftest.$ac_ext
13303fi
13304
13305else
13306    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13307$as_echo "no" >&6; }
13308fi
13309
13310#check whether to build with coverage
13311unset NOCOVERAGE
13312{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether coverage requested" >&5
13313$as_echo_n "checking whether coverage requested... " >&6; }
13314# Check whether --enable-coverage was given.
13315if test "${enable_coverage+set}" = set; then :
13316  enableval=$enable_coverage; if test x"$enableval" = xno; then
13317    NOCOVER="Disabled, using --disable-coverage"
13318 fi
13319else
13320  #disabled by default
13321 NOCOVER="Disabled (default)"
13322fi
13323
13324if test x"$NOCOVER" = x; then
13325    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13326$as_echo "yes" >&6; }
13327    oLDFLAGS="$LDFLAGS"
13328    oCFLAGS="$CFLAGS"
13329    LDFLAGS="$LDFLAGS${LDFLAGS:+ }--coverage"
13330    CFLAGS="$CFLAGS${CFLAGS:+ }--coverage"
13331    if test "$cross_compiling" = yes; then :
13332  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13333$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13334as_fn_error $? "cannot run test program while cross compiling
13335See \`config.log' for more details" "$LINENO" 5; }
13336else
13337  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13338/* end confdefs.h.  */
13339
13340#include <sys/types.h>
13341#include <sys/wait.h>
13342
13343#include <stdlib.h>
13344#include <unistd.h>
13345
13346int main()
13347{
13348	int res;
13349	/* look for darwin() fork problem */
13350	if ((res = fork()) == 0)
13351	    exit(0); /* child */
13352	else if (res == -1)
13353	    exit(1); /* err */
13354	else {
13355	    if (waitpid(res, NULL, 0) == res)
13356		exit(0);
13357	    else
13358		exit(1);
13359	}
13360}
13361_ACEOF
13362if ac_fn_c_try_run "$LINENO"; then :
13363  FEAT="$FEAT${FEAT:+ }coverage"
13364
13365$as_echo "#define HAVE_COVERAGE 1" >>confdefs.h
13366
13367else
13368  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: coverage requested, but compilation with --coverage fails" >&5
13369$as_echo "$as_me: WARNING: coverage requested, but compilation with --coverage fails" >&2;}
13370     NOCOVER="Disabled, --coverage compilation fails"
13371     CFLAGS="$oCFLAGS"
13372     LDFLAGS="$oLDFLAGS"
13373fi
13374rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
13375  conftest.$ac_objext conftest.beam conftest.$ac_ext
13376fi
13377
13378else
13379    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13380$as_echo "no" >&6; }
13381fi
13382
13383#check whether to run lint
13384unset NOLINT
13385{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linting requested" >&5
13386$as_echo_n "checking whether linting requested... " >&6; }
13387# Check whether --enable-linting was given.
13388if test "${enable_linting+set}" = set; then :
13389  enableval=$enable_linting; if test x"$enableval" = xno; then
13390    NOLINT="Disabled, using --disable-linting"
13391 fi
13392else
13393  #off by default
13394 NOLINT="Disabled (default)"
13395fi
13396
13397if test x"$NOLINT" = x; then
13398    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13399$as_echo "yes" >&6; }
13400
13401    # Extract the first word of "lint", so it can be a program name with args.
13402set dummy lint; ac_word=$2
13403{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
13404$as_echo_n "checking for $ac_word... " >&6; }
13405if ${ac_cv_prog_LINT+:} false; then :
13406  $as_echo_n "(cached) " >&6
13407else
13408  if test -n "$LINT"; then
13409  ac_cv_prog_LINT="$LINT" # Let the user override the test.
13410else
13411as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13412for as_dir in $PATH
13413do
13414  IFS=$as_save_IFS
13415  test -z "$as_dir" && as_dir=.
13416    for ac_exec_ext in '' $ac_executable_extensions; do
13417  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
13418    ac_cv_prog_LINT="lint"
13419    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
13420    break 2
13421  fi
13422done
13423  done
13424IFS=$as_save_IFS
13425
13426fi
13427fi
13428LINT=$ac_cv_prog_LINT
13429if test -n "$LINT"; then
13430  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINT" >&5
13431$as_echo "$LINT" >&6; }
13432else
13433  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13434$as_echo "no" >&6; }
13435fi
13436
13437
13438    if test x"$LINT" = x; then
13439	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linting requested, but lint not found" >&5
13440$as_echo "$as_me: WARNING: linting requested, but lint not found" >&2;}
13441	NOLINT="Disabled, lint not found"
13442    else
13443	s_linting=t
13444	case $host in
13445	    *-*-aix*)
13446		LINTFLAGS="-abcbpx -Nn8000 -Nd8000"
13447		LINTPASS1=""
13448		LINTPASS2=""
13449		LINTLIBOPT="-C"
13450		;;
13451	    *-*-openbsd* | *-*-freebsd*)
13452		LINTFLAGS="-abcebprxz"
13453		LINTPASS1="-i"
13454		LINTPASS2=""
13455		LINTLIBOPT="-C"
13456		;;
13457	    *-*-solaris*)
13458#		LINTFLAGS=-c -errchk=%all -errsecurity=extended -fd -Ncheck=%all -Nlevel=3 -p -s
13459#		SUPPRESS="-x -erroff=E_FUNC_DECL_VAR_ARG2"
13460		LINTLIBS="-lnsl -lsocket -lwrap"
13461		LINTWARN="-errsecurity=extended -errchk=%all -errhdr -Ncheck=%all -Nlevel=3"
13462		LINTFLAGS="-fd -s -errfmt=simple $SUPPRESS $LINTWARN"
13463		LINTPASS1="-c"
13464		LINTPASS2="$LINTFLAGS $LINTLIBS"
13465		LINTLIBOPT="-o"
13466		;;
13467	esac
13468    fi
13469else
13470    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13471$as_echo "no" >&6; }
13472fi
13473 if test x"$NOLINT" = x; then
13474  RUNLINT_TRUE=
13475  RUNLINT_FALSE='#'
13476else
13477  RUNLINT_TRUE='#'
13478  RUNLINT_FALSE=
13479fi
13480
13481
13482
13483
13484
13485
13486
13487
13488case $host in
13489    *-*-darwin*)
13490
13491$as_echo "#define HAVE_DARWIN 1" >>confdefs.h
13492
13493	;;
13494
13495    *-*-openbsd*)
13496
13497$as_echo "#define HAVE_OPENBSD_BUGS 1" >>confdefs.h
13498
13499	;;
13500
13501    *-*-solaris*)
13502
13503$as_echo "#define HAVE_SENDMSG_DEADLOCK 1" >>confdefs.h
13504
13505
13506$as_echo "#define HAVE_SOLARIS_BUGS 1" >>confdefs.h
13507
13508
13509$as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
13510
13511	;;
13512
13513    *-*-linux-*)
13514
13515$as_echo "#define HAVE_LINUX_BUGS 1" >>confdefs.h
13516
13517
13518$as_echo "#define SPT_TYPE SPT_REUSEARGV" >>confdefs.h
13519
13520	;;
13521
13522    *-*-aix*)
13523
13524$as_echo "#define HAVE_SYSTEM_XMSG_MAGIC 1" >>confdefs.h
13525
13526	;;
13527esac
13528
13529# The cast to long int works around a bug in the HP C Compiler
13530# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13531# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13532# This bug is HP SR number 8606223364.
13533{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5
13534$as_echo_n "checking size of char... " >&6; }
13535if ${ac_cv_sizeof_char+:} false; then :
13536  $as_echo_n "(cached) " >&6
13537else
13538  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char"        "$ac_includes_default"; then :
13539
13540else
13541  if test "$ac_cv_type_char" = yes; then
13542     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13543$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13544as_fn_error 77 "cannot compute sizeof (char)
13545See \`config.log' for more details" "$LINENO" 5; }
13546   else
13547     ac_cv_sizeof_char=0
13548   fi
13549fi
13550
13551fi
13552{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5
13553$as_echo "$ac_cv_sizeof_char" >&6; }
13554
13555
13556
13557cat >>confdefs.h <<_ACEOF
13558#define SIZEOF_CHAR $ac_cv_sizeof_char
13559_ACEOF
13560
13561
13562# The cast to long int works around a bug in the HP C Compiler
13563# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13564# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13565# This bug is HP SR number 8606223364.
13566{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5
13567$as_echo_n "checking size of short... " >&6; }
13568if ${ac_cv_sizeof_short+:} false; then :
13569  $as_echo_n "(cached) " >&6
13570else
13571  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short"        "$ac_includes_default"; then :
13572
13573else
13574  if test "$ac_cv_type_short" = yes; then
13575     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13576$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13577as_fn_error 77 "cannot compute sizeof (short)
13578See \`config.log' for more details" "$LINENO" 5; }
13579   else
13580     ac_cv_sizeof_short=0
13581   fi
13582fi
13583
13584fi
13585{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5
13586$as_echo "$ac_cv_sizeof_short" >&6; }
13587
13588
13589
13590cat >>confdefs.h <<_ACEOF
13591#define SIZEOF_SHORT $ac_cv_sizeof_short
13592_ACEOF
13593
13594
13595# The cast to long int works around a bug in the HP C Compiler
13596# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13597# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13598# This bug is HP SR number 8606223364.
13599{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5
13600$as_echo_n "checking size of int... " >&6; }
13601if ${ac_cv_sizeof_int+:} false; then :
13602  $as_echo_n "(cached) " >&6
13603else
13604  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int"        "$ac_includes_default"; then :
13605
13606else
13607  if test "$ac_cv_type_int" = yes; then
13608     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13609$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13610as_fn_error 77 "cannot compute sizeof (int)
13611See \`config.log' for more details" "$LINENO" 5; }
13612   else
13613     ac_cv_sizeof_int=0
13614   fi
13615fi
13616
13617fi
13618{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5
13619$as_echo "$ac_cv_sizeof_int" >&6; }
13620
13621
13622
13623cat >>confdefs.h <<_ACEOF
13624#define SIZEOF_INT $ac_cv_sizeof_int
13625_ACEOF
13626
13627
13628# The cast to long int works around a bug in the HP C Compiler
13629# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
13630# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
13631# This bug is HP SR number 8606223364.
13632{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5
13633$as_echo_n "checking size of long... " >&6; }
13634if ${ac_cv_sizeof_long+:} false; then :
13635  $as_echo_n "(cached) " >&6
13636else
13637  if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long"        "$ac_includes_default"; then :
13638
13639else
13640  if test "$ac_cv_type_long" = yes; then
13641     { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
13642$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
13643as_fn_error 77 "cannot compute sizeof (long)
13644See \`config.log' for more details" "$LINENO" 5; }
13645   else
13646     ac_cv_sizeof_long=0
13647   fi
13648fi
13649
13650fi
13651{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5
13652$as_echo "$ac_cv_sizeof_long" >&6; }
13653
13654
13655
13656cat >>confdefs.h <<_ACEOF
13657#define SIZEOF_LONG $ac_cv_sizeof_long
13658_ACEOF
13659
13660
13661
13662{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
13663$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; }
13664if ${ac_cv_header_sys_wait_h+:} false; then :
13665  $as_echo_n "(cached) " >&6
13666else
13667  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13668/* end confdefs.h.  */
13669#include <sys/types.h>
13670#include <sys/wait.h>
13671#ifndef WEXITSTATUS
13672# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
13673#endif
13674#ifndef WIFEXITED
13675# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
13676#endif
13677
13678int
13679main ()
13680{
13681  int s;
13682  wait (&s);
13683  s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
13684  ;
13685  return 0;
13686}
13687_ACEOF
13688if ac_fn_c_try_compile "$LINENO"; then :
13689  ac_cv_header_sys_wait_h=yes
13690else
13691  ac_cv_header_sys_wait_h=no
13692fi
13693rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13694fi
13695{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5
13696$as_echo "$ac_cv_header_sys_wait_h" >&6; }
13697if test $ac_cv_header_sys_wait_h = yes; then
13698
13699$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
13700
13701fi
13702
13703for ac_header in fcntl.h limits.h malloc.h paths.h strings.h syslog.h
13704do :
13705  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
13706ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
13707if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
13708  cat >>confdefs.h <<_ACEOF
13709#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
13710_ACEOF
13711
13712fi
13713
13714done
13715
13716for ac_header in unistd.h crypt.h stddef.h sys/file.h sys/ioctl.h sys/time.h
13717do :
13718  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
13719ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
13720if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
13721  cat >>confdefs.h <<_ACEOF
13722#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
13723_ACEOF
13724
13725fi
13726
13727done
13728
13729for ac_header in shadow.h ifaddrs.h sys/sem.h netinet/in.h rpc/rpc.h
13730do :
13731  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
13732ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
13733if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
13734  cat >>confdefs.h <<_ACEOF
13735#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
13736_ACEOF
13737
13738fi
13739
13740done
13741
13742for ac_header in sys/ipc.h arpa/nameser.h net/if_dl.h execinfo.h sys/pstat.h
13743do :
13744  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
13745ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
13746if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
13747  cat >>confdefs.h <<_ACEOF
13748#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
13749_ACEOF
13750
13751fi
13752
13753done
13754
13755for ac_header in sys/shm.h valgrind/valgrind.h netinet/tcp_fsm.h
13756do :
13757  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
13758ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
13759if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
13760  cat >>confdefs.h <<_ACEOF
13761#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
13762_ACEOF
13763
13764fi
13765
13766done
13767
13768
13769#some header dependencies for netinet/ip.h, use compilation test
13770{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for netinet/ip.h" >&5
13771$as_echo_n "checking for netinet/ip.h... " >&6; }
13772cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13773/* end confdefs.h.  */
13774
13775#include <sys/types.h>
13776#include <sys/socket.h>
13777
13778#include <netinet/in.h>
13779#include <netinet/in_systm.h>
13780#include <netinet/ip.h>
13781
13782int
13783main ()
13784{
13785
13786  ;
13787  return 0;
13788}
13789_ACEOF
13790if ac_fn_c_try_compile "$LINENO"; then :
13791  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13792$as_echo "yes" >&6; }
13793
13794$as_echo "#define HAVE_NETINET_IP_H 1" >>confdefs.h
13795
13796else
13797  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13798$as_echo "no" >&6; }
13799fi
13800rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13801
13802case $host in
13803    #XXX only check for priv.h support on Solaris for now
13804    *-*-solaris*)
13805	for ac_header in priv.h
13806do :
13807  ac_fn_c_check_header_mongrel "$LINENO" "priv.h" "ac_cv_header_priv_h" "$ac_includes_default"
13808if test "x$ac_cv_header_priv_h" = xyes; then :
13809  cat >>confdefs.h <<_ACEOF
13810#define HAVE_PRIV_H 1
13811_ACEOF
13812
13813$as_echo "#define HAVE_PRIVILEGES 1" >>confdefs.h
13814
13815
13816$as_echo "#define HAVE_SOLARIS_PRIVS 1" >>confdefs.h
13817
13818fi
13819
13820done
13821
13822	;;
13823esac
13824
13825for ac_header in netinet/ip_var.h
13826do :
13827  ac_fn_c_check_header_compile "$LINENO" "netinet/ip_var.h" "ac_cv_header_netinet_ip_var_h" "
13828#if HAVE_SYS_TYPES_H
13829#include <sys/types.h>
13830#endif
13831#if HAVE_NETINET_IN_H
13832#include <netinet/in.h>
13833#endif
13834
13835"
13836if test "x$ac_cv_header_netinet_ip_var_h" = xyes; then :
13837  cat >>confdefs.h <<_ACEOF
13838#define HAVE_NETINET_IP_VAR_H 1
13839_ACEOF
13840
13841fi
13842
13843done
13844
13845
13846for ac_header in resolv.h
13847do :
13848  ac_fn_c_check_header_compile "$LINENO" "resolv.h" "ac_cv_header_resolv_h" "
13849#if HAVE_SYS_TYPES_H
13850#include <sys/types.h>
13851#endif
13852#if HAVE_NETINET_IN_H
13853#include <netinet/in.h>
13854#endif
13855#if HAVE_ARPA_NAMESER_H
13856#include <arpa/nameser.h>
13857#endif
13858
13859"
13860if test "x$ac_cv_header_resolv_h" = xyes; then :
13861  cat >>confdefs.h <<_ACEOF
13862#define HAVE_RESOLV_H 1
13863_ACEOF
13864
13865fi
13866
13867done
13868
13869
13870ac_fn_c_check_header_mongrel "$LINENO" "sys/sockio.h" "ac_cv_header_sys_sockio_h" "$ac_includes_default"
13871if test "x$ac_cv_header_sys_sockio_h" = xyes; then :
13872
13873$as_echo "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h
13874
13875 have_sys_sockio_h=t
13876fi
13877
13878
13879
13880{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/types.h> defines const" >&5
13881$as_echo_n "checking whether <sys/types.h> defines const... " >&6; }
13882cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13883/* end confdefs.h.  */
13884
13885#include <sys/types.h>
13886#ifdef const
13887yes
13888#endif
13889
13890_ACEOF
13891if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13892  $EGREP "yes" >/dev/null 2>&1; then :
13893  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
13894$as_echo "yes" >&6; }
13895else
13896  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
13897$as_echo "no" >&6; }
13898    check_const="yes"
13899fi
13900rm -f conftest*
13901
13902if test x$check_const = xyes; then
13903    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
13904$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
13905if ${ac_cv_c_const+:} false; then :
13906  $as_echo_n "(cached) " >&6
13907else
13908  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13909/* end confdefs.h.  */
13910
13911int
13912main ()
13913{
13914
13915#ifndef __cplusplus
13916  /* Ultrix mips cc rejects this sort of thing.  */
13917  typedef int charset[2];
13918  const charset cs = { 0, 0 };
13919  /* SunOS 4.1.1 cc rejects this.  */
13920  char const *const *pcpcc;
13921  char **ppc;
13922  /* NEC SVR4.0.2 mips cc rejects this.  */
13923  struct point {int x, y;};
13924  static struct point const zero = {0,0};
13925  /* AIX XL C 1.02.0.0 rejects this.
13926     It does not let you subtract one const X* pointer from another in
13927     an arm of an if-expression whose if-part is not a constant
13928     expression */
13929  const char *g = "string";
13930  pcpcc = &g + (g ? g-g : 0);
13931  /* HPUX 7.0 cc rejects these. */
13932  ++pcpcc;
13933  ppc = (char**) pcpcc;
13934  pcpcc = (char const *const *) ppc;
13935  { /* SCO 3.2v4 cc rejects this sort of thing.  */
13936    char tx;
13937    char *t = &tx;
13938    char const *s = 0 ? (char *) 0 : (char const *) 0;
13939
13940    *t++ = 0;
13941    if (s) return 0;
13942  }
13943  { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
13944    int x[] = {25, 17};
13945    const int *foo = &x[0];
13946    ++foo;
13947  }
13948  { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
13949    typedef const int *iptr;
13950    iptr p = 0;
13951    ++p;
13952  }
13953  { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
13954       "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
13955    struct s { int j; const int *ap[3]; } bx;
13956    struct s *b = &bx; b->j = 5;
13957  }
13958  { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
13959    const int foo = 10;
13960    if (!foo) return 0;
13961  }
13962  return !cs[0] && !zero.x;
13963#endif
13964
13965  ;
13966  return 0;
13967}
13968_ACEOF
13969if ac_fn_c_try_compile "$LINENO"; then :
13970  ac_cv_c_const=yes
13971else
13972  ac_cv_c_const=no
13973fi
13974rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
13975fi
13976{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
13977$as_echo "$ac_cv_c_const" >&6; }
13978if test $ac_cv_c_const = no; then
13979
13980$as_echo "#define const /**/" >>confdefs.h
13981
13982fi
13983
13984fi
13985
13986#looks for Linux + systems with RTAX_GATEWAY defined in net/route.h
13987{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported routing socket communication" >&5
13988$as_echo_n "checking for supported routing socket communication... " >&6; }
13989
13990unset no_routeinfo
13991cat confdefs.h - <<_ACEOF >conftest.$ac_ext
13992/* end confdefs.h.  */
13993
13994#include <net/route.h>
13995#ifdef linux
13996yes
13997#endif /* linux */
13998
13999_ACEOF
14000if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14001  $EGREP "yes" >/dev/null 2>&1; then :
14002  $as_echo "#define HAVE_ROUTE_SOURCE 1" >>confdefs.h
14003
14004
14005$as_echo "#define HAVE_ROUTEINFO_LINUX 1" >>confdefs.h
14006
14007    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14008$as_echo "yes" >&6; }
14009else
14010  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14011/* end confdefs.h.  */
14012
14013#include <net/route.h>
14014#ifdef RTA_GATEWAY
14015yes
14016#endif /* RTA_GATEWAY */
14017
14018_ACEOF
14019if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14020  $EGREP "yes" >/dev/null 2>&1; then :
14021  $as_echo "#define HAVE_ROUTE_SOURCE 1" >>confdefs.h
14022
14023
14024$as_echo "#define HAVE_ROUTEINFO_BSD 1" >>confdefs.h
14025
14026     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14027$as_echo "yes" >&6; }
14028else
14029  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, might result in reduced functionality" >&5
14030$as_echo "no, might result in reduced functionality" >&6; }
14031      no_routeinfo=t
14032fi
14033rm -f conftest*
14034
14035fi
14036rm -f conftest*
14037
14038
14039#XXXsys/socket.h?
14040{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct ip_opts in <netinet/in.h>" >&5
14041$as_echo_n "checking for struct ip_opts in <netinet/in.h>... " >&6; }
14042cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14043/* end confdefs.h.  */
14044
14045#include <netinet/ip_var.h>
14046
14047_ACEOF
14048if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14049  $EGREP "struct.*ipoption" >/dev/null 2>&1; then :
14050
14051$as_echo "#define HAVE_STRUCT_IPOPTS 1" >>confdefs.h
14052
14053    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14054$as_echo "yes" >&6; }
14055else
14056  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14057$as_echo "no" >&6; }
14058fi
14059rm -f conftest*
14060
14061
14062{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct tcp_info in <netinet/tcp.h>" >&5
14063$as_echo_n "checking for struct tcp_info in <netinet/tcp.h>... " >&6; }
14064cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14065/* end confdefs.h.  */
14066
14067#include <netinet/tcp.h>
14068
14069_ACEOF
14070if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14071  $EGREP "struct.*tcp_info" >/dev/null 2>&1; then :
14072
14073$as_echo "#define HAVE_TCP_INFO 1" >>confdefs.h
14074
14075    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14076$as_echo "yes" >&6; }
14077
14078    # check which values are found in the tcp_info struct
14079    # (limitations in autoconf makes it necessary to list each name explicitly
14080    #  and not use a list stored in a variable)
14081
14082    #values not present on some older linux versions
14083    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_rcv_rtt" >&5
14084$as_echo_n "checking for tcp_info value tcpi_rcv_rtt... " >&6; }
14085  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14086/* end confdefs.h.  */
14087
14088#include <sys/types.h>
14089#include <sys/socket.h>
14090#include <netinet/in.h>
14091#include <netinet/tcp.h>
14092int
14093main ()
14094{
14095
14096
14097struct tcp_info tcp_info;
14098void *p;
14099
14100p = &tcp_info.tcpi_rcv_rtt;
14101  ;
14102  return 0;
14103}
14104_ACEOF
14105if ac_fn_c_try_compile "$LINENO"; then :
14106
14107$as_echo "#define HAVE_TCP_INFO_TCPI_RCV_RTT 1" >>confdefs.h
14108
14109  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14110$as_echo "yes" >&6; }
14111else
14112  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14113$as_echo "no" >&6; }
14114fi
14115rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14116    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_rcv_space" >&5
14117$as_echo_n "checking for tcp_info value tcpi_rcv_space... " >&6; }
14118  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14119/* end confdefs.h.  */
14120
14121#include <sys/types.h>
14122#include <sys/socket.h>
14123#include <netinet/in.h>
14124#include <netinet/tcp.h>
14125int
14126main ()
14127{
14128
14129
14130struct tcp_info tcp_info;
14131void *p;
14132
14133p = &tcp_info.tcpi_rcv_space;
14134  ;
14135  return 0;
14136}
14137_ACEOF
14138if ac_fn_c_try_compile "$LINENO"; then :
14139
14140$as_echo "#define HAVE_TCP_INFO_TCPI_RCV_SPACE 1" >>confdefs.h
14141
14142  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14143$as_echo "yes" >&6; }
14144else
14145  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14146$as_echo "no" >&6; }
14147fi
14148rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14149    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_total_retrans" >&5
14150$as_echo_n "checking for tcp_info value tcpi_total_retrans... " >&6; }
14151  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14152/* end confdefs.h.  */
14153
14154#include <sys/types.h>
14155#include <sys/socket.h>
14156#include <netinet/in.h>
14157#include <netinet/tcp.h>
14158int
14159main ()
14160{
14161
14162
14163struct tcp_info tcp_info;
14164void *p;
14165
14166p = &tcp_info.tcpi_total_retrans;
14167  ;
14168  return 0;
14169}
14170_ACEOF
14171if ac_fn_c_try_compile "$LINENO"; then :
14172
14173$as_echo "#define HAVE_TCP_INFO_TCPI_TOTAL_RETRANS 1" >>confdefs.h
14174
14175  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14176$as_echo "yes" >&6; }
14177else
14178  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14179$as_echo "no" >&6; }
14180fi
14181rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14182
14183    #values not present on freebsd
14184    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_advmss" >&5
14185$as_echo_n "checking for tcp_info value tcpi_advmss... " >&6; }
14186  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14187/* end confdefs.h.  */
14188
14189#include <sys/types.h>
14190#include <sys/socket.h>
14191#include <netinet/in.h>
14192#include <netinet/tcp.h>
14193int
14194main ()
14195{
14196
14197
14198struct tcp_info tcp_info;
14199void *p;
14200
14201p = &tcp_info.tcpi_advmss;
14202  ;
14203  return 0;
14204}
14205_ACEOF
14206if ac_fn_c_try_compile "$LINENO"; then :
14207
14208$as_echo "#define HAVE_TCP_INFO_TCPI_ADVMSS 1" >>confdefs.h
14209
14210  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14211$as_echo "yes" >&6; }
14212else
14213  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14214$as_echo "no" >&6; }
14215fi
14216rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14217    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_ato" >&5
14218$as_echo_n "checking for tcp_info value tcpi_ato... " >&6; }
14219  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14220/* end confdefs.h.  */
14221
14222#include <sys/types.h>
14223#include <sys/socket.h>
14224#include <netinet/in.h>
14225#include <netinet/tcp.h>
14226int
14227main ()
14228{
14229
14230
14231struct tcp_info tcp_info;
14232void *p;
14233
14234p = &tcp_info.tcpi_ato;
14235  ;
14236  return 0;
14237}
14238_ACEOF
14239if ac_fn_c_try_compile "$LINENO"; then :
14240
14241$as_echo "#define HAVE_TCP_INFO_TCPI_ATO 1" >>confdefs.h
14242
14243  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14244$as_echo "yes" >&6; }
14245else
14246  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14247$as_echo "no" >&6; }
14248fi
14249rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14250    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_backoff" >&5
14251$as_echo_n "checking for tcp_info value tcpi_backoff... " >&6; }
14252  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14253/* end confdefs.h.  */
14254
14255#include <sys/types.h>
14256#include <sys/socket.h>
14257#include <netinet/in.h>
14258#include <netinet/tcp.h>
14259int
14260main ()
14261{
14262
14263
14264struct tcp_info tcp_info;
14265void *p;
14266
14267p = &tcp_info.tcpi_backoff;
14268  ;
14269  return 0;
14270}
14271_ACEOF
14272if ac_fn_c_try_compile "$LINENO"; then :
14273
14274$as_echo "#define HAVE_TCP_INFO_TCPI_BACKOFF 1" >>confdefs.h
14275
14276  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14277$as_echo "yes" >&6; }
14278else
14279  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14280$as_echo "no" >&6; }
14281fi
14282rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14283    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_ca_state" >&5
14284$as_echo_n "checking for tcp_info value tcpi_ca_state... " >&6; }
14285  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14286/* end confdefs.h.  */
14287
14288#include <sys/types.h>
14289#include <sys/socket.h>
14290#include <netinet/in.h>
14291#include <netinet/tcp.h>
14292int
14293main ()
14294{
14295
14296
14297struct tcp_info tcp_info;
14298void *p;
14299
14300p = &tcp_info.tcpi_ca_state;
14301  ;
14302  return 0;
14303}
14304_ACEOF
14305if ac_fn_c_try_compile "$LINENO"; then :
14306
14307$as_echo "#define HAVE_TCP_INFO_TCPI_CA_STATE 1" >>confdefs.h
14308
14309  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14310$as_echo "yes" >&6; }
14311else
14312  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14313$as_echo "no" >&6; }
14314fi
14315rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14316    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_fackets" >&5
14317$as_echo_n "checking for tcp_info value tcpi_fackets... " >&6; }
14318  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14319/* end confdefs.h.  */
14320
14321#include <sys/types.h>
14322#include <sys/socket.h>
14323#include <netinet/in.h>
14324#include <netinet/tcp.h>
14325int
14326main ()
14327{
14328
14329
14330struct tcp_info tcp_info;
14331void *p;
14332
14333p = &tcp_info.tcpi_fackets;
14334  ;
14335  return 0;
14336}
14337_ACEOF
14338if ac_fn_c_try_compile "$LINENO"; then :
14339
14340$as_echo "#define HAVE_TCP_INFO_TCPI_FACKETS 1" >>confdefs.h
14341
14342  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14343$as_echo "yes" >&6; }
14344else
14345  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14346$as_echo "no" >&6; }
14347fi
14348rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14349    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_last_ack_recv" >&5
14350$as_echo_n "checking for tcp_info value tcpi_last_ack_recv... " >&6; }
14351  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14352/* end confdefs.h.  */
14353
14354#include <sys/types.h>
14355#include <sys/socket.h>
14356#include <netinet/in.h>
14357#include <netinet/tcp.h>
14358int
14359main ()
14360{
14361
14362
14363struct tcp_info tcp_info;
14364void *p;
14365
14366p = &tcp_info.tcpi_last_ack_recv;
14367  ;
14368  return 0;
14369}
14370_ACEOF
14371if ac_fn_c_try_compile "$LINENO"; then :
14372
14373$as_echo "#define HAVE_TCP_INFO_TCPI_LAST_ACK_RECV 1" >>confdefs.h
14374
14375  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14376$as_echo "yes" >&6; }
14377else
14378  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14379$as_echo "no" >&6; }
14380fi
14381rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14382    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_last_ack_sent" >&5
14383$as_echo_n "checking for tcp_info value tcpi_last_ack_sent... " >&6; }
14384  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14385/* end confdefs.h.  */
14386
14387#include <sys/types.h>
14388#include <sys/socket.h>
14389#include <netinet/in.h>
14390#include <netinet/tcp.h>
14391int
14392main ()
14393{
14394
14395
14396struct tcp_info tcp_info;
14397void *p;
14398
14399p = &tcp_info.tcpi_last_ack_sent;
14400  ;
14401  return 0;
14402}
14403_ACEOF
14404if ac_fn_c_try_compile "$LINENO"; then :
14405
14406$as_echo "#define HAVE_TCP_INFO_TCPI_LAST_ACK_SENT 1" >>confdefs.h
14407
14408  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14409$as_echo "yes" >&6; }
14410else
14411  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14412$as_echo "no" >&6; }
14413fi
14414rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14415    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_last_data_recv" >&5
14416$as_echo_n "checking for tcp_info value tcpi_last_data_recv... " >&6; }
14417  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14418/* end confdefs.h.  */
14419
14420#include <sys/types.h>
14421#include <sys/socket.h>
14422#include <netinet/in.h>
14423#include <netinet/tcp.h>
14424int
14425main ()
14426{
14427
14428
14429struct tcp_info tcp_info;
14430void *p;
14431
14432p = &tcp_info.tcpi_last_data_recv;
14433  ;
14434  return 0;
14435}
14436_ACEOF
14437if ac_fn_c_try_compile "$LINENO"; then :
14438
14439$as_echo "#define HAVE_TCP_INFO_TCPI_LAST_DATA_RECV 1" >>confdefs.h
14440
14441  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14442$as_echo "yes" >&6; }
14443else
14444  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14445$as_echo "no" >&6; }
14446fi
14447rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14448    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_last_data_sent" >&5
14449$as_echo_n "checking for tcp_info value tcpi_last_data_sent... " >&6; }
14450  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14451/* end confdefs.h.  */
14452
14453#include <sys/types.h>
14454#include <sys/socket.h>
14455#include <netinet/in.h>
14456#include <netinet/tcp.h>
14457int
14458main ()
14459{
14460
14461
14462struct tcp_info tcp_info;
14463void *p;
14464
14465p = &tcp_info.tcpi_last_data_sent;
14466  ;
14467  return 0;
14468}
14469_ACEOF
14470if ac_fn_c_try_compile "$LINENO"; then :
14471
14472$as_echo "#define HAVE_TCP_INFO_TCPI_LAST_DATA_SENT 1" >>confdefs.h
14473
14474  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14475$as_echo "yes" >&6; }
14476else
14477  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14478$as_echo "no" >&6; }
14479fi
14480rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14481    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_lost" >&5
14482$as_echo_n "checking for tcp_info value tcpi_lost... " >&6; }
14483  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14484/* end confdefs.h.  */
14485
14486#include <sys/types.h>
14487#include <sys/socket.h>
14488#include <netinet/in.h>
14489#include <netinet/tcp.h>
14490int
14491main ()
14492{
14493
14494
14495struct tcp_info tcp_info;
14496void *p;
14497
14498p = &tcp_info.tcpi_lost;
14499  ;
14500  return 0;
14501}
14502_ACEOF
14503if ac_fn_c_try_compile "$LINENO"; then :
14504
14505$as_echo "#define HAVE_TCP_INFO_TCPI_LOST 1" >>confdefs.h
14506
14507  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14508$as_echo "yes" >&6; }
14509else
14510  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14511$as_echo "no" >&6; }
14512fi
14513rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14514    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_pmtu" >&5
14515$as_echo_n "checking for tcp_info value tcpi_pmtu... " >&6; }
14516  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14517/* end confdefs.h.  */
14518
14519#include <sys/types.h>
14520#include <sys/socket.h>
14521#include <netinet/in.h>
14522#include <netinet/tcp.h>
14523int
14524main ()
14525{
14526
14527
14528struct tcp_info tcp_info;
14529void *p;
14530
14531p = &tcp_info.tcpi_pmtu;
14532  ;
14533  return 0;
14534}
14535_ACEOF
14536if ac_fn_c_try_compile "$LINENO"; then :
14537
14538$as_echo "#define HAVE_TCP_INFO_TCPI_PMTU 1" >>confdefs.h
14539
14540  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14541$as_echo "yes" >&6; }
14542else
14543  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14544$as_echo "no" >&6; }
14545fi
14546rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14547    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_probes" >&5
14548$as_echo_n "checking for tcp_info value tcpi_probes... " >&6; }
14549  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14550/* end confdefs.h.  */
14551
14552#include <sys/types.h>
14553#include <sys/socket.h>
14554#include <netinet/in.h>
14555#include <netinet/tcp.h>
14556int
14557main ()
14558{
14559
14560
14561struct tcp_info tcp_info;
14562void *p;
14563
14564p = &tcp_info.tcpi_probes;
14565  ;
14566  return 0;
14567}
14568_ACEOF
14569if ac_fn_c_try_compile "$LINENO"; then :
14570
14571$as_echo "#define HAVE_TCP_INFO_TCPI_PROBES 1" >>confdefs.h
14572
14573  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14574$as_echo "yes" >&6; }
14575else
14576  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14577$as_echo "no" >&6; }
14578fi
14579rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14580    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_rcv_rtt" >&5
14581$as_echo_n "checking for tcp_info value tcpi_rcv_rtt... " >&6; }
14582  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14583/* end confdefs.h.  */
14584
14585#include <sys/types.h>
14586#include <sys/socket.h>
14587#include <netinet/in.h>
14588#include <netinet/tcp.h>
14589int
14590main ()
14591{
14592
14593
14594struct tcp_info tcp_info;
14595void *p;
14596
14597p = &tcp_info.tcpi_rcv_rtt;
14598  ;
14599  return 0;
14600}
14601_ACEOF
14602if ac_fn_c_try_compile "$LINENO"; then :
14603
14604$as_echo "#define HAVE_TCP_INFO_TCPI_RCV_RTT 1" >>confdefs.h
14605
14606  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14607$as_echo "yes" >&6; }
14608else
14609  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14610$as_echo "no" >&6; }
14611fi
14612rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14613    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_rcv_ssthresh" >&5
14614$as_echo_n "checking for tcp_info value tcpi_rcv_ssthresh... " >&6; }
14615  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14616/* end confdefs.h.  */
14617
14618#include <sys/types.h>
14619#include <sys/socket.h>
14620#include <netinet/in.h>
14621#include <netinet/tcp.h>
14622int
14623main ()
14624{
14625
14626
14627struct tcp_info tcp_info;
14628void *p;
14629
14630p = &tcp_info.tcpi_rcv_ssthresh;
14631  ;
14632  return 0;
14633}
14634_ACEOF
14635if ac_fn_c_try_compile "$LINENO"; then :
14636
14637$as_echo "#define HAVE_TCP_INFO_TCPI_RCV_SSTHRESH 1" >>confdefs.h
14638
14639  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14640$as_echo "yes" >&6; }
14641else
14642  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14643$as_echo "no" >&6; }
14644fi
14645rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14646    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_reordering" >&5
14647$as_echo_n "checking for tcp_info value tcpi_reordering... " >&6; }
14648  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14649/* end confdefs.h.  */
14650
14651#include <sys/types.h>
14652#include <sys/socket.h>
14653#include <netinet/in.h>
14654#include <netinet/tcp.h>
14655int
14656main ()
14657{
14658
14659
14660struct tcp_info tcp_info;
14661void *p;
14662
14663p = &tcp_info.tcpi_reordering;
14664  ;
14665  return 0;
14666}
14667_ACEOF
14668if ac_fn_c_try_compile "$LINENO"; then :
14669
14670$as_echo "#define HAVE_TCP_INFO_TCPI_REORDERING 1" >>confdefs.h
14671
14672  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14673$as_echo "yes" >&6; }
14674else
14675  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14676$as_echo "no" >&6; }
14677fi
14678rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14679    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_retrans" >&5
14680$as_echo_n "checking for tcp_info value tcpi_retrans... " >&6; }
14681  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14682/* end confdefs.h.  */
14683
14684#include <sys/types.h>
14685#include <sys/socket.h>
14686#include <netinet/in.h>
14687#include <netinet/tcp.h>
14688int
14689main ()
14690{
14691
14692
14693struct tcp_info tcp_info;
14694void *p;
14695
14696p = &tcp_info.tcpi_retrans;
14697  ;
14698  return 0;
14699}
14700_ACEOF
14701if ac_fn_c_try_compile "$LINENO"; then :
14702
14703$as_echo "#define HAVE_TCP_INFO_TCPI_RETRANS 1" >>confdefs.h
14704
14705  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14706$as_echo "yes" >&6; }
14707else
14708  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14709$as_echo "no" >&6; }
14710fi
14711rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14712    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_retransmits" >&5
14713$as_echo_n "checking for tcp_info value tcpi_retransmits... " >&6; }
14714  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14715/* end confdefs.h.  */
14716
14717#include <sys/types.h>
14718#include <sys/socket.h>
14719#include <netinet/in.h>
14720#include <netinet/tcp.h>
14721int
14722main ()
14723{
14724
14725
14726struct tcp_info tcp_info;
14727void *p;
14728
14729p = &tcp_info.tcpi_retransmits;
14730  ;
14731  return 0;
14732}
14733_ACEOF
14734if ac_fn_c_try_compile "$LINENO"; then :
14735
14736$as_echo "#define HAVE_TCP_INFO_TCPI_RETRANSMITS 1" >>confdefs.h
14737
14738  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14739$as_echo "yes" >&6; }
14740else
14741  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14742$as_echo "no" >&6; }
14743fi
14744rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14745    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_sacked" >&5
14746$as_echo_n "checking for tcp_info value tcpi_sacked... " >&6; }
14747  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14748/* end confdefs.h.  */
14749
14750#include <sys/types.h>
14751#include <sys/socket.h>
14752#include <netinet/in.h>
14753#include <netinet/tcp.h>
14754int
14755main ()
14756{
14757
14758
14759struct tcp_info tcp_info;
14760void *p;
14761
14762p = &tcp_info.tcpi_sacked;
14763  ;
14764  return 0;
14765}
14766_ACEOF
14767if ac_fn_c_try_compile "$LINENO"; then :
14768
14769$as_echo "#define HAVE_TCP_INFO_TCPI_SACKED 1" >>confdefs.h
14770
14771  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14772$as_echo "yes" >&6; }
14773else
14774  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14775$as_echo "no" >&6; }
14776fi
14777rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14778    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tcp_info value tcpi_unacked" >&5
14779$as_echo_n "checking for tcp_info value tcpi_unacked... " >&6; }
14780  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14781/* end confdefs.h.  */
14782
14783#include <sys/types.h>
14784#include <sys/socket.h>
14785#include <netinet/in.h>
14786#include <netinet/tcp.h>
14787int
14788main ()
14789{
14790
14791
14792struct tcp_info tcp_info;
14793void *p;
14794
14795p = &tcp_info.tcpi_unacked;
14796  ;
14797  return 0;
14798}
14799_ACEOF
14800if ac_fn_c_try_compile "$LINENO"; then :
14801
14802$as_echo "#define HAVE_TCP_INFO_TCPI_UNACKED 1" >>confdefs.h
14803
14804  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14805$as_echo "yes" >&6; }
14806else
14807  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14808$as_echo "no" >&6; }
14809fi
14810rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14811else
14812  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14813$as_echo "no" >&6; }
14814fi
14815rm -f conftest*
14816
14817
14818{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/types.h> defines inline" >&5
14819$as_echo_n "checking whether <sys/types.h> defines inline... " >&6; }
14820cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14821/* end confdefs.h.  */
14822
14823#include <sys/types.h>
14824#ifdef inline
14825yes
14826#endif
14827
14828_ACEOF
14829if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14830  $EGREP "yes" >/dev/null 2>&1; then :
14831  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
14832$as_echo "yes" >&6; }
14833else
14834  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
14835$as_echo "no" >&6; }
14836    check_inline="yes"
14837fi
14838rm -f conftest*
14839
14840if test x"${check_inline}" = xyes; then
14841    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
14842$as_echo_n "checking for inline... " >&6; }
14843if ${ac_cv_c_inline+:} false; then :
14844  $as_echo_n "(cached) " >&6
14845else
14846  ac_cv_c_inline=no
14847for ac_kw in inline __inline__ __inline; do
14848  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14849/* end confdefs.h.  */
14850#ifndef __cplusplus
14851typedef int foo_t;
14852static $ac_kw foo_t static_foo () {return 0; }
14853$ac_kw foo_t foo () {return 0; }
14854#endif
14855
14856_ACEOF
14857if ac_fn_c_try_compile "$LINENO"; then :
14858  ac_cv_c_inline=$ac_kw
14859fi
14860rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14861  test "$ac_cv_c_inline" != no && break
14862done
14863
14864fi
14865{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
14866$as_echo "$ac_cv_c_inline" >&6; }
14867
14868case $ac_cv_c_inline in
14869  inline | yes) ;;
14870  *)
14871    case $ac_cv_c_inline in
14872      no) ac_val=;;
14873      *) ac_val=$ac_cv_c_inline;;
14874    esac
14875    cat >>confdefs.h <<_ACEOF
14876#ifndef __cplusplus
14877#define inline $ac_val
14878#endif
14879_ACEOF
14880    ;;
14881esac
14882
14883fi
14884
14885{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
14886$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
14887if ${ac_cv_type_uid_t+:} false; then :
14888  $as_echo_n "(cached) " >&6
14889else
14890  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14891/* end confdefs.h.  */
14892#include <sys/types.h>
14893
14894_ACEOF
14895if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14896  $EGREP "uid_t" >/dev/null 2>&1; then :
14897  ac_cv_type_uid_t=yes
14898else
14899  ac_cv_type_uid_t=no
14900fi
14901rm -f conftest*
14902
14903fi
14904{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
14905$as_echo "$ac_cv_type_uid_t" >&6; }
14906if test $ac_cv_type_uid_t = no; then
14907
14908$as_echo "#define uid_t int" >>confdefs.h
14909
14910
14911$as_echo "#define gid_t int" >>confdefs.h
14912
14913fi
14914
14915ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
14916if test "x$ac_cv_type_off_t" = xyes; then :
14917
14918else
14919
14920cat >>confdefs.h <<_ACEOF
14921#define off_t long int
14922_ACEOF
14923
14924fi
14925
14926ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
14927if test "x$ac_cv_type_pid_t" = xyes; then :
14928
14929else
14930
14931cat >>confdefs.h <<_ACEOF
14932#define pid_t int
14933_ACEOF
14934
14935fi
14936
14937ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
14938if test "x$ac_cv_type_size_t" = xyes; then :
14939
14940else
14941
14942cat >>confdefs.h <<_ACEOF
14943#define size_t unsigned int
14944_ACEOF
14945
14946fi
14947
14948{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
14949$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
14950if ${ac_cv_header_time+:} false; then :
14951  $as_echo_n "(cached) " >&6
14952else
14953  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
14954/* end confdefs.h.  */
14955#include <sys/types.h>
14956#include <sys/time.h>
14957#include <time.h>
14958
14959int
14960main ()
14961{
14962if ((struct tm *) 0)
14963return 0;
14964  ;
14965  return 0;
14966}
14967_ACEOF
14968if ac_fn_c_try_compile "$LINENO"; then :
14969  ac_cv_header_time=yes
14970else
14971  ac_cv_header_time=no
14972fi
14973rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
14974fi
14975{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5
14976$as_echo "$ac_cv_header_time" >&6; }
14977if test $ac_cv_header_time = yes; then
14978
14979$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h
14980
14981fi
14982
14983
14984# Check whether --enable-largefile was given.
14985if test "${enable_largefile+set}" = set; then :
14986  enableval=$enable_largefile;
14987fi
14988
14989if test "$enable_largefile" != no; then
14990
14991  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
14992$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
14993if ${ac_cv_sys_largefile_CC+:} false; then :
14994  $as_echo_n "(cached) " >&6
14995else
14996  ac_cv_sys_largefile_CC=no
14997     if test "$GCC" != yes; then
14998       ac_save_CC=$CC
14999       while :; do
15000	 # IRIX 6.2 and later do not support large files by default,
15001	 # so use the C compiler's -n32 option if that helps.
15002	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15003/* end confdefs.h.  */
15004#include <sys/types.h>
15005 /* Check that off_t can represent 2**63 - 1 correctly.
15006    We can't simply define LARGE_OFF_T to be 9223372036854775807,
15007    since some C++ compilers masquerading as C compilers
15008    incorrectly reject 9223372036854775807.  */
15009#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15010  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15011		       && LARGE_OFF_T % 2147483647 == 1)
15012		      ? 1 : -1];
15013int
15014main ()
15015{
15016
15017  ;
15018  return 0;
15019}
15020_ACEOF
15021	 if ac_fn_c_try_compile "$LINENO"; then :
15022  break
15023fi
15024rm -f core conftest.err conftest.$ac_objext
15025	 CC="$CC -n32"
15026	 if ac_fn_c_try_compile "$LINENO"; then :
15027  ac_cv_sys_largefile_CC=' -n32'; break
15028fi
15029rm -f core conftest.err conftest.$ac_objext
15030	 break
15031       done
15032       CC=$ac_save_CC
15033       rm -f conftest.$ac_ext
15034    fi
15035fi
15036{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
15037$as_echo "$ac_cv_sys_largefile_CC" >&6; }
15038  if test "$ac_cv_sys_largefile_CC" != no; then
15039    CC=$CC$ac_cv_sys_largefile_CC
15040  fi
15041
15042  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
15043$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
15044if ${ac_cv_sys_file_offset_bits+:} false; then :
15045  $as_echo_n "(cached) " >&6
15046else
15047  while :; do
15048  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15049/* end confdefs.h.  */
15050#include <sys/types.h>
15051 /* Check that off_t can represent 2**63 - 1 correctly.
15052    We can't simply define LARGE_OFF_T to be 9223372036854775807,
15053    since some C++ compilers masquerading as C compilers
15054    incorrectly reject 9223372036854775807.  */
15055#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15056  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15057		       && LARGE_OFF_T % 2147483647 == 1)
15058		      ? 1 : -1];
15059int
15060main ()
15061{
15062
15063  ;
15064  return 0;
15065}
15066_ACEOF
15067if ac_fn_c_try_compile "$LINENO"; then :
15068  ac_cv_sys_file_offset_bits=no; break
15069fi
15070rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15071  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15072/* end confdefs.h.  */
15073#define _FILE_OFFSET_BITS 64
15074#include <sys/types.h>
15075 /* Check that off_t can represent 2**63 - 1 correctly.
15076    We can't simply define LARGE_OFF_T to be 9223372036854775807,
15077    since some C++ compilers masquerading as C compilers
15078    incorrectly reject 9223372036854775807.  */
15079#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15080  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15081		       && LARGE_OFF_T % 2147483647 == 1)
15082		      ? 1 : -1];
15083int
15084main ()
15085{
15086
15087  ;
15088  return 0;
15089}
15090_ACEOF
15091if ac_fn_c_try_compile "$LINENO"; then :
15092  ac_cv_sys_file_offset_bits=64; break
15093fi
15094rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15095  ac_cv_sys_file_offset_bits=unknown
15096  break
15097done
15098fi
15099{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
15100$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
15101case $ac_cv_sys_file_offset_bits in #(
15102  no | unknown) ;;
15103  *)
15104cat >>confdefs.h <<_ACEOF
15105#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
15106_ACEOF
15107;;
15108esac
15109rm -rf conftest*
15110  if test $ac_cv_sys_file_offset_bits = unknown; then
15111    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
15112$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
15113if ${ac_cv_sys_large_files+:} false; then :
15114  $as_echo_n "(cached) " >&6
15115else
15116  while :; do
15117  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15118/* end confdefs.h.  */
15119#include <sys/types.h>
15120 /* Check that off_t can represent 2**63 - 1 correctly.
15121    We can't simply define LARGE_OFF_T to be 9223372036854775807,
15122    since some C++ compilers masquerading as C compilers
15123    incorrectly reject 9223372036854775807.  */
15124#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15125  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15126		       && LARGE_OFF_T % 2147483647 == 1)
15127		      ? 1 : -1];
15128int
15129main ()
15130{
15131
15132  ;
15133  return 0;
15134}
15135_ACEOF
15136if ac_fn_c_try_compile "$LINENO"; then :
15137  ac_cv_sys_large_files=no; break
15138fi
15139rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15140  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15141/* end confdefs.h.  */
15142#define _LARGE_FILES 1
15143#include <sys/types.h>
15144 /* Check that off_t can represent 2**63 - 1 correctly.
15145    We can't simply define LARGE_OFF_T to be 9223372036854775807,
15146    since some C++ compilers masquerading as C compilers
15147    incorrectly reject 9223372036854775807.  */
15148#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
15149  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
15150		       && LARGE_OFF_T % 2147483647 == 1)
15151		      ? 1 : -1];
15152int
15153main ()
15154{
15155
15156  ;
15157  return 0;
15158}
15159_ACEOF
15160if ac_fn_c_try_compile "$LINENO"; then :
15161  ac_cv_sys_large_files=1; break
15162fi
15163rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15164  ac_cv_sys_large_files=unknown
15165  break
15166done
15167fi
15168{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
15169$as_echo "$ac_cv_sys_large_files" >&6; }
15170case $ac_cv_sys_large_files in #(
15171  no | unknown) ;;
15172  *)
15173cat >>confdefs.h <<_ACEOF
15174#define _LARGE_FILES $ac_cv_sys_large_files
15175_ACEOF
15176;;
15177esac
15178rm -rf conftest*
15179  fi
15180
15181
15182fi
15183
15184
15185{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for in6_addr" >&5
15186$as_echo_n "checking for in6_addr... " >&6; }
15187cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15188/* end confdefs.h.  */
15189
15190#include <sys/types.h>
15191#include <sys/socket.h>
15192#include <netinet/in.h>
15193
15194int
15195main ()
15196{
15197
15198struct in6_addr sin6;
15199
15200  ;
15201  return 0;
15202}
15203_ACEOF
15204if ac_fn_c_try_compile "$LINENO"; then :
15205  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15206$as_echo "yes" >&6; }
15207
15208$as_echo "#define HAVE_IN6_ADDR 1" >>confdefs.h
15209
15210else
15211  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15212$as_echo "no" >&6; }
15213fi
15214rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15215
15216{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if openlog accepts LOG_PERROR" >&5
15217$as_echo_n "checking to see if openlog accepts LOG_PERROR... " >&6; }
15218cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15219/* end confdefs.h.  */
15220
15221#include <syslog.h>
15222#ifdef LOG_PERROR
15223yes
15224#endif
15225
15226_ACEOF
15227if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15228  $EGREP "yes" >/dev/null 2>&1; then :
15229
15230$as_echo "#define HAVE_OPENLOG_LOG_PERROR 1" >>confdefs.h
15231
15232    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15233$as_echo "yes" >&6; }
15234else
15235  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15236$as_echo "no" >&6; }
15237fi
15238rm -f conftest*
15239
15240
15241{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if stdlib.h defines EXIT_FAILURE" >&5
15242$as_echo_n "checking to see if stdlib.h defines EXIT_FAILURE... " >&6; }
15243cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15244/* end confdefs.h.  */
15245
15246#include <stdlib.h>
15247#ifdef EXIT_FAILURE
15248yes
15249#endif
15250
15251_ACEOF
15252if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15253  $EGREP "yes" >/dev/null 2>&1; then :
15254  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15255$as_echo "yes" >&6; }
15256else
15257
15258$as_echo "#define NEED_EXIT_FAILURE 1" >>confdefs.h
15259
15260    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15261$as_echo "no" >&6; }
15262fi
15263rm -f conftest*
15264
15265
15266#XXX actually checks if AF_UNIX should be used instead of AF_LOCAL
15267{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> uses AF_UNIX" >&5
15268$as_echo_n "checking whether <sys/socket.h> uses AF_UNIX... " >&6; }
15269cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15270/* end confdefs.h.  */
15271
15272#include <sys/types.h>
15273#include <sys/socket.h>
15274#ifdef AF_LOCAL
15275#else
15276#ifdef AF_UNIX
15277yes
15278#endif
15279#endif
15280
15281_ACEOF
15282if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15283  $EGREP "yes" >/dev/null 2>&1; then :
15284
15285$as_echo "#define NEED_AF_LOCAL 1" >>confdefs.h
15286
15287    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15288$as_echo "yes" >&6; }
15289else
15290  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15291$as_echo "no" >&6; }
15292fi
15293rm -f conftest*
15294
15295
15296{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGINFO" >&5
15297$as_echo_n "checking for SIGINFO... " >&6; }
15298cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15299/* end confdefs.h.  */
15300
15301#include <signal.h>
15302#ifdef SIGINFO
15303yes
15304#endif
15305
15306_ACEOF
15307if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15308  $EGREP "yes" >/dev/null 2>&1; then :
15309
15310$as_echo "#define HAVE_SIGNAL_SIGINFO 1" >>confdefs.h
15311
15312    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15313$as_echo "yes" >&6; }
15314else
15315  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15316$as_echo "no" >&6; }
15317fi
15318rm -f conftest*
15319
15320
15321{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if MSG_WAITALL exists" >&5
15322$as_echo_n "checking to see if MSG_WAITALL exists... " >&6; }
15323cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15324/* end confdefs.h.  */
15325
15326#include <sys/socket.h>
15327#ifdef MSG_WAITALL
15328yes
15329#endif
15330
15331_ACEOF
15332if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15333  $EGREP "yes" >/dev/null 2>&1; then :
15334
15335$as_echo "#define HAVE_MSG_WAITALL 1" >>confdefs.h
15336
15337    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15338$as_echo "yes" >&6; }
15339else
15340  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15341$as_echo "no" >&6; }
15342fi
15343rm -f conftest*
15344
15345
15346{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realloc with a NULL pointer calls malloc" >&5
15347$as_echo_n "checking whether realloc with a NULL pointer calls malloc... " >&6; }
15348if test "$cross_compiling" = yes; then :
15349
15350$as_echo "#define HAVE_NOMALLOC_REALLOC 1" >>confdefs.h
15351
15352     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15353$as_echo "no" >&6; }
15354else
15355  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15356/* end confdefs.h.  */
15357
15358#include <stdlib.h>
15359#ifndef NULL
15360#define NULL (char *)0
15361#endif
15362
15363int main()
15364{
15365	/* will assume this test doesn\'t fail because of lack of memory */
15366	if (realloc(NULL, 1) == NULL)
15367		return 1;
15368	else
15369		return 0;
15370}
15371_ACEOF
15372if ac_fn_c_try_run "$LINENO"; then :
15373  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15374$as_echo "yes" >&6; }
15375else
15376
15377$as_echo "#define HAVE_NOMALLOC_REALLOC 1" >>confdefs.h
15378
15379     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15380$as_echo "no" >&6; }
15381fi
15382rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
15383  conftest.$ac_objext conftest.beam conftest.$ac_ext
15384fi
15385
15386
15387# AC_MSG_CHECKING([whether free can be called with NULL])
15388# AC_TRY_RUN([
15389# #include <stdlib.h>
15390# #ifndef NULL
15391# #define NULL (char *)0
15392# #endif
15393
15394# int main()
15395# {
15396#	/* will assume core dump/seg fault if it doesn\'t work */
15397#	free(NULL);
15398#	return 0;
15399# }], [AC_MSG_RESULT(yes)],
15400#     [AC_DEFINE(HAVE_NONULL_FREE, 1, [free does not accept NULL parameter])
15401#      AC_MSG_RESULT(no)],
15402#     [dnl assume NULL is not accepted when cross-compiling
15403#      AC_DEFINE(HAVE_NONULL_FREE, 1, [free does not accept NULL parameter])
15404#      AC_MSG_RESULT(no)])
15405#XXX always set for now
15406
15407$as_echo "#define HAVE_NONULL_FREE 1" >>confdefs.h
15408
15409
15410{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getsockopt needs cast" >&5
15411$as_echo_n "checking if getsockopt needs cast... " >&6; }
15412cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15413/* end confdefs.h.  */
15414
15415#include <sys/types.h>
15416#include <sys/socket.h>
15417int getsockopt(int, int, int, char *, int *);
15418
15419int
15420main ()
15421{
15422 1
15423  ;
15424  return 0;
15425}
15426_ACEOF
15427if ac_fn_c_try_compile "$LINENO"; then :
15428
15429$as_echo "#define NEED_GETSOCKOPT_CAST 1" >>confdefs.h
15430
15431  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15432$as_echo "yes" >&6; }
15433else
15434  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15435$as_echo "no" >&6; }
15436fi
15437rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15438
15439#include both <sys/ioctl.h> and <sys/sockio.h>?
15440if test x$have_sys_sockio_h = xt; then
15441	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if <sys/sockio.h> should be included" >&5
15442$as_echo_n "checking to see if <sys/sockio.h> should be included... " >&6; }
15443	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15444/* end confdefs.h.  */
15445
15446#include <sys/ioctl.h>
15447#ifdef SIOCATMARK
15448#else
15449#include <sys/sockio.h>
15450#ifdef SIOCATMARK
15451yes
15452#endif
15453#endif
15454
15455_ACEOF
15456if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15457  $EGREP "yes" >/dev/null 2>&1; then :
15458
15459$as_echo "#define NEED_SYS_SOCKIO_H 1" >>confdefs.h
15460
15461    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15462$as_echo "yes" >&6; }
15463else
15464  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15465$as_echo "no" >&6; }
15466fi
15467rm -f conftest*
15468
15469fi
15470
15471#XXX should be more generic, check if nonexistent
15472#SV_INTERRUPT, but not SA_RESTART defined?
15473{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if SV_INTERRUPT should be used" >&5
15474$as_echo_n "checking to see if SV_INTERRUPT should be used... " >&6; }
15475cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15476/* end confdefs.h.  */
15477
15478#include <signal.h>
15479#ifdef SA_RESTART
15480#else
15481# ifdef SV_INTERRUPT
15482yes
15483# endif
15484#endif
15485
15486_ACEOF
15487if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15488  $EGREP "yes" >/dev/null 2>&1; then :
15489
15490$as_echo "#define NEED_SA_RESTART 1" >>confdefs.h
15491
15492    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15493$as_echo "yes" >&6; }
15494else
15495  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15496$as_echo "no" >&6; }
15497fi
15498rm -f conftest*
15499
15500
15501#XXX seems to be supported on Solaris2.6, but there might be some
15502#defines that need to be set (should _XOPEN_SOURCE be defined on all
15503#platforms?)
15504{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if cmsghdr exists in <sys/socket.h>" >&5
15505$as_echo_n "checking if cmsghdr exists in <sys/socket.h>... " >&6; }
15506case $host in
15507    *)
15508	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15509/* end confdefs.h.  */
15510
15511#include <sys/types.h>
15512#include <sys/socket.h>
15513
15514int
15515main ()
15516{
15517struct cmsghdr foo = {1,1,1};
15518 struct msghdr bar;
15519 foo.cmsg_len = 0;
15520 foo.cmsg_type = SCM_RIGHTS;
15521 foo.cmsg_level = SOL_SOCKET;
15522 bar.msg_controllen = 1;
15523
15524  ;
15525  return 0;
15526}
15527_ACEOF
15528if ac_fn_c_try_compile "$LINENO"; then :
15529
15530$as_echo "#define HAVE_CMSGHDR 1" >>confdefs.h
15531
15532    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15533$as_echo "yes" >&6; }
15534else
15535  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15536$as_echo "no" >&6; }
15537fi
15538rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15539	;;
15540esac
15541
15542{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CMSG_SPACE in sys/socket.h" >&5
15543$as_echo_n "checking for CMSG_SPACE in sys/socket.h... " >&6; }
15544cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15545/* end confdefs.h.  */
15546
15547#include <sys/types.h>
15548#include <sys/socket.h>
15549
15550int
15551main ()
15552{
15553int d = CMSG_SPACE(4);
15554   return 0;
15555
15556  ;
15557  return 0;
15558}
15559_ACEOF
15560if ac_fn_c_try_link "$LINENO"; then :
15561  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15562$as_echo "yes" >&6; }
15563
15564$as_echo "#define HAVE_CMSG_SPACE 1" >>confdefs.h
15565
15566else
15567  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15568$as_echo "no" >&6; }
15569fi
15570rm -f core conftest.err conftest.$ac_objext \
15571    conftest$ac_exeext conftest.$ac_ext
15572
15573{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CMSG_LEN in sys/socket.h" >&5
15574$as_echo_n "checking for CMSG_LEN in sys/socket.h... " >&6; }
15575cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15576/* end confdefs.h.  */
15577
15578#include <sys/types.h>
15579#include <sys/socket.h>
15580
15581int
15582main ()
15583{
15584int d = CMSG_LEN(4);
15585    return 0;
15586
15587  ;
15588  return 0;
15589}
15590_ACEOF
15591if ac_fn_c_try_link "$LINENO"; then :
15592  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15593$as_echo "yes" >&6; }
15594
15595$as_echo "#define HAVE_CMSG_LEN 1" >>confdefs.h
15596
15597else
15598  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15599$as_echo "no" >&6; }
15600fi
15601rm -f core conftest.err conftest.$ac_objext \
15602    conftest$ac_exeext conftest.$ac_ext
15603
15604unset have_sa_len
15605{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sa_len in sockaddr" >&5
15606$as_echo_n "checking for sa_len in sockaddr... " >&6; }
15607cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15608/* end confdefs.h.  */
15609
15610#include <sys/types.h>
15611#include <sys/socket.h>
15612
15613int
15614main ()
15615{
15616struct sockaddr sa;
15617sa.sa_len = 0;
15618
15619  ;
15620  return 0;
15621}
15622_ACEOF
15623if ac_fn_c_try_compile "$LINENO"; then :
15624
15625$as_echo "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
15626
15627    have_sa_len=t
15628    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15629$as_echo "yes" >&6; }
15630else
15631  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15632$as_echo "no" >&6; }
15633fi
15634rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15635
15636if test x"${have_sa_len}" != x; then
15637   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sa_len type" >&5
15638$as_echo_n "checking for sa_len type... " >&6; }
15639   oCFLAGS="$CFLAGS"
15640   CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
15641   unset sa_len_type_found
15642   for type in uint8_t "unsigned char"; do
15643       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15644/* end confdefs.h.  */
15645
15646#include <sys/types.h>
15647#include <sys/socket.h>
15648int
15649main ()
15650{
15651
15652struct sockaddr sa;
15653$type *sa_len_ptr;
15654sa_len_ptr = &sa.sa_len;
15655sa_len_ptr++; /* use to avoid warning/error */
15656  ;
15657  return 0;
15658}
15659_ACEOF
15660if ac_fn_c_try_compile "$LINENO"; then :
15661
15662cat >>confdefs.h <<_ACEOF
15663#define sa_len_type $type
15664_ACEOF
15665
15666        sa_len_type_found=t
15667        break
15668fi
15669rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15670   done
15671   CFLAGS="$oCFLAGS"
15672
15673   if test x"${sa_len_type_found}" != x; then
15674       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15675$as_echo "yes" >&6; }
15676   else
15677       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15678$as_echo "no" >&6; }
15679       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to obtain sa_len type, exiting" >&5
15680$as_echo "$as_me: WARNING: unable to obtain sa_len type, exiting" >&2;}
15681       exit 1
15682   fi
15683else
15684
15685$as_echo "#define sa_len_type socklen_t" >>confdefs.h
15686
15687fi
15688
15689unset have_ss_len
15690{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sockaddr_storage ss_len in sockaddr" >&5
15691$as_echo_n "checking for sockaddr_storage ss_len in sockaddr... " >&6; }
15692cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15693/* end confdefs.h.  */
15694
15695#include <sys/types.h>
15696#include <sys/socket.h>
15697
15698int
15699main ()
15700{
15701struct sockaddr_storage ss;
15702ss.ss_len = 0;
15703
15704  ;
15705  return 0;
15706}
15707_ACEOF
15708if ac_fn_c_try_compile "$LINENO"; then :
15709
15710$as_echo "#define HAVE_SOCKADDR_STORAGE_SS_LEN 1" >>confdefs.h
15711
15712    have_ss_len=t
15713    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15714$as_echo "yes" >&6; }
15715else
15716  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15717$as_echo "no" >&6; }
15718fi
15719rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15720
15721{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __res_state options type" >&5
15722$as_echo_n "checking for __res_state options type... " >&6; }
15723oCFLAGS="$CFLAGS"
15724CFLAGS="$CFLAGS${CFLAGS:+ }$FAILWARN"
15725unset res_options_type_found
15726for type in "unsigned int" u_long; do
15727    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15728/* end confdefs.h.  */
15729
15730#include <sys/types.h>
15731#include <netinet/in.h>
15732#include <arpa/nameser.h>
15733#include <resolv.h>
15734int
15735main ()
15736{
15737
15738struct __res_state res;
15739$type *res_options_ptr;
15740res_options_ptr = &res.options;
15741res_options_ptr++;
15742  ;
15743  return 0;
15744}
15745_ACEOF
15746if ac_fn_c_try_compile "$LINENO"; then :
15747
15748cat >>confdefs.h <<_ACEOF
15749#define res_options_type_t $type
15750_ACEOF
15751
15752     res_options_type_found=t
15753     break
15754fi
15755rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15756done
15757CFLAGS="$oCFLAGS"
15758if test x"${res_options_type_found}" != x; then
15759    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15760$as_echo "yes" >&6; }
15761else
15762    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15763$as_echo "no" >&6; }
15764    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to obtain __res_state options type, setting to unsigned long" >&5
15765$as_echo "$as_me: WARNING: unable to obtain __res_state options type, setting to unsigned long" >&2;}
15766
15767cat >>confdefs.h <<_ACEOF
15768#define res_options_type_t unsigned long
15769_ACEOF
15770
15771fi
15772
15773#AIX 6.1 needs sys/select.h, but can be problematic on other platforms
15774{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if sys/select.h is needed" >&5
15775$as_echo_n "checking if sys/select.h is needed... " >&6; }
15776cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15777/* end confdefs.h.  */
15778
15779#include <sys/types.h>
15780#include <sys/time.h>
15781#include <string.h>
15782#include <unistd.h>
15783
15784int
15785main ()
15786{
15787fd_set *fdp;
15788    size_t p;
15789    fdp = NULL;
15790    p = NFDBITS * sizeof(fd_mask);
15791
15792  ;
15793  return 0;
15794}
15795_ACEOF
15796if ac_fn_c_try_compile "$LINENO"; then :
15797  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15798$as_echo "no" >&6; }
15799else
15800      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15801/* end confdefs.h.  */
15802
15803#include <sys/types.h>
15804#include <sys/time.h>
15805#include <sys/select.h>
15806#include <string.h>
15807#include <unistd.h>
15808
15809int
15810main ()
15811{
15812fd_set *fdp;
15813    size_t p;
15814    fdp = NULL;
15815    p = NFDBITS * sizeof(fd_mask);
15816  ;
15817  return 0;
15818}
15819_ACEOF
15820if ac_fn_c_try_compile "$LINENO"; then :
15821
15822$as_echo "#define HAVE_SYS_SELECT_H 1" >>confdefs.h
15823
15824     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15825$as_echo "yes" >&6; }
15826else
15827  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15828$as_echo "no" >&6; }
15829fi
15830rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15831fi
15832rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15833
15834{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if malloc_options exists" >&5
15835$as_echo_n "checking to see if malloc_options exists... " >&6; }
15836cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15837/* end confdefs.h.  */
15838extern char *malloc_options;
15839int
15840main ()
15841{
15842 malloc_options = 0;
15843  ;
15844  return 0;
15845}
15846_ACEOF
15847if ac_fn_c_try_link "$LINENO"; then :
15848
15849$as_echo "#define HAVE_MALLOC_OPTIONS 1" >>confdefs.h
15850
15851 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15852$as_echo "yes" >&6; }
15853else
15854  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15855$as_echo "no" >&6; }
15856fi
15857rm -f core conftest.err conftest.$ac_objext \
15858    conftest$ac_exeext conftest.$ac_ext
15859
15860{ $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if __progname exists" >&5
15861$as_echo_n "checking to see if __progname exists... " >&6; }
15862cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15863/* end confdefs.h.  */
15864extern char *__progname;
15865int
15866main ()
15867{
15868 __progname = 0;
15869  ;
15870  return 0;
15871}
15872_ACEOF
15873if ac_fn_c_try_link "$LINENO"; then :
15874
15875$as_echo "#define HAVE_PROGNAME 1" >>confdefs.h
15876
15877 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
15878$as_echo "yes" >&6; }
15879else
15880  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15881$as_echo "no" >&6; }
15882fi
15883rm -f core conftest.err conftest.$ac_objext \
15884    conftest$ac_exeext conftest.$ac_ext
15885
15886{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing crypt" >&5
15887$as_echo_n "checking for library containing crypt... " >&6; }
15888if ${ac_cv_search_crypt+:} false; then :
15889  $as_echo_n "(cached) " >&6
15890else
15891  ac_func_search_save_LIBS=$LIBS
15892cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15893/* end confdefs.h.  */
15894
15895/* Override any GCC internal prototype to avoid an error.
15896   Use char because int might match the return type of a GCC
15897   builtin and then its argument prototype would still apply.  */
15898#ifdef __cplusplus
15899extern "C"
15900#endif
15901char crypt ();
15902int
15903main ()
15904{
15905return crypt ();
15906  ;
15907  return 0;
15908}
15909_ACEOF
15910for ac_lib in '' crypt; do
15911  if test -z "$ac_lib"; then
15912    ac_res="none required"
15913  else
15914    ac_res=-l$ac_lib
15915    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15916  fi
15917  if ac_fn_c_try_link "$LINENO"; then :
15918  ac_cv_search_crypt=$ac_res
15919fi
15920rm -f core conftest.err conftest.$ac_objext \
15921    conftest$ac_exeext
15922  if ${ac_cv_search_crypt+:} false; then :
15923  break
15924fi
15925done
15926if ${ac_cv_search_crypt+:} false; then :
15927
15928else
15929  ac_cv_search_crypt=no
15930fi
15931rm conftest.$ac_ext
15932LIBS=$ac_func_search_save_LIBS
15933fi
15934{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_crypt" >&5
15935$as_echo "$ac_cv_search_crypt" >&6; }
15936ac_res=$ac_cv_search_crypt
15937if test "$ac_res" != no; then :
15938  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15939
15940fi
15941
15942
15943#HP-UX 11.00
15944{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getspnam" >&5
15945$as_echo_n "checking for library containing getspnam... " >&6; }
15946if ${ac_cv_search_getspnam+:} false; then :
15947  $as_echo_n "(cached) " >&6
15948else
15949  ac_func_search_save_LIBS=$LIBS
15950cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15951/* end confdefs.h.  */
15952
15953/* Override any GCC internal prototype to avoid an error.
15954   Use char because int might match the return type of a GCC
15955   builtin and then its argument prototype would still apply.  */
15956#ifdef __cplusplus
15957extern "C"
15958#endif
15959char getspnam ();
15960int
15961main ()
15962{
15963return getspnam ();
15964  ;
15965  return 0;
15966}
15967_ACEOF
15968for ac_lib in '' sec; do
15969  if test -z "$ac_lib"; then
15970    ac_res="none required"
15971  else
15972    ac_res=-l$ac_lib
15973    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
15974  fi
15975  if ac_fn_c_try_link "$LINENO"; then :
15976  ac_cv_search_getspnam=$ac_res
15977fi
15978rm -f core conftest.err conftest.$ac_objext \
15979    conftest$ac_exeext
15980  if ${ac_cv_search_getspnam+:} false; then :
15981  break
15982fi
15983done
15984if ${ac_cv_search_getspnam+:} false; then :
15985
15986else
15987  ac_cv_search_getspnam=no
15988fi
15989rm conftest.$ac_ext
15990LIBS=$ac_func_search_save_LIBS
15991fi
15992{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getspnam" >&5
15993$as_echo "$ac_cv_search_getspnam" >&6; }
15994ac_res=$ac_cv_search_getspnam
15995if test "$ac_res" != no; then :
15996  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
15997
15998fi
15999
16000
16001#FreeBSD has setproctitle in -lutil
16002{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5
16003$as_echo_n "checking for library containing setproctitle... " >&6; }
16004if ${ac_cv_search_setproctitle+:} false; then :
16005  $as_echo_n "(cached) " >&6
16006else
16007  ac_func_search_save_LIBS=$LIBS
16008cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16009/* end confdefs.h.  */
16010
16011/* Override any GCC internal prototype to avoid an error.
16012   Use char because int might match the return type of a GCC
16013   builtin and then its argument prototype would still apply.  */
16014#ifdef __cplusplus
16015extern "C"
16016#endif
16017char setproctitle ();
16018int
16019main ()
16020{
16021return setproctitle ();
16022  ;
16023  return 0;
16024}
16025_ACEOF
16026for ac_lib in '' util; do
16027  if test -z "$ac_lib"; then
16028    ac_res="none required"
16029  else
16030    ac_res=-l$ac_lib
16031    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
16032  fi
16033  if ac_fn_c_try_link "$LINENO"; then :
16034  ac_cv_search_setproctitle=$ac_res
16035fi
16036rm -f core conftest.err conftest.$ac_objext \
16037    conftest$ac_exeext
16038  if ${ac_cv_search_setproctitle+:} false; then :
16039  break
16040fi
16041done
16042if ${ac_cv_search_setproctitle+:} false; then :
16043
16044else
16045  ac_cv_search_setproctitle=no
16046fi
16047rm conftest.$ac_ext
16048LIBS=$ac_func_search_save_LIBS
16049fi
16050{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5
16051$as_echo "$ac_cv_search_setproctitle" >&6; }
16052ac_res=$ac_cv_search_setproctitle
16053if test "$ac_res" != no; then :
16054  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16055
16056fi
16057
16058
16059#expected select behavior?
16060unset nb_select_err
16061{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for expected select behaviour" >&5
16062$as_echo_n "checking for expected select behaviour... " >&6; }
16063if test "$cross_compiling" = yes; then :
16064       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16065$as_echo "yes" >&6; }
16066
16067else
16068  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16069/* end confdefs.h.  */
16070
16071/*
16072 * ftp.inet.no:/pub/home/michaels/stuff/socket-select.c
16073 * $ cc socket-select.c && uname -a && ./a.out
16074 *
16075 * Thanks to Eric Anderson <anderse@hpl.hp.com>.
16076 *
16077*/
16078
16079#include <sys/types.h>
16080#include <sys/time.h>
16081#include <sys/socket.h>
16082#include <netinet/in.h>
16083#include <arpa/inet.h>
16084
16085#include <signal.h>
16086#include <stdio.h>
16087#include <stdlib.h>
16088#include <string.h>
16089#include <errno.h>
16090#include <unistd.h>
16091#include <fcntl.h>
16092
16093#define BLOCKING(b)	(b ? ("blocking") : ("non-blocking"))
16094
16095static int selectcheck(int s);
16096static int dotests(int s, int blocking);
16097
16098int
16099main(void)
16100{
16101	int s, p;
16102	struct sigaction sigact;
16103
16104	sigemptyset(&sigact.sa_mask);
16105	sigact.sa_handler = SIG_IGN;
16106	sigact.sa_flags	= 0;
16107	if (sigaction(SIGPIPE, &sigact, NULL) != 0) {
16108		perror("sigaction()");
16109		exit(1);
16110	}
16111
16112	if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
16113		perror("socket()");
16114		exit(1);
16115	}
16116
16117	if ((p = fcntl(s, F_GETFL, 0)) == -1
16118	|| fcntl(s, F_SETFL, p | O_NONBLOCK) == -1) {
16119		perror("fcntl()");
16120	   exit(1);
16121	}
16122
16123	p = dotests(s, 0);
16124	close(s);
16125
16126	return p;
16127}
16128
16129
16130static int
16131dotests(s, blocking)
16132	int s;
16133	int blocking;
16134{
16135	int p, rc;
16136	struct sockaddr_in addr;
16137
16138	fprintf(stderr, "testing with %s, bound, socket:\n", BLOCKING(blocking));
16139	bzero(&addr, sizeof(addr));
16140	addr.sin_family		= AF_INET;
16141	addr.sin_addr.s_addr = htonl(INADDR_ANY);
16142	addr.sin_port			= htons(0);
16143
16144	/* LINTED pointer casts may be troublesome */
16145	if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) != 0) {
16146		perror("running Linux? bind()");
16147		exit(1);
16148	}
16149
16150	fprintf(stderr, "\tselect() returned %d\n", selectcheck(s));
16151	p = read(s, NULL, 0);
16152	fprintf(stderr, "\tread() returned %d, errno = %d (%s)\n",
16153	p, errno, (strerror(errno)));
16154	p = write(s, &s, sizeof(s));
16155	fprintf(stderr, "\twrite() returned %d, errno = %d (%s)\n",
16156	p, errno, (strerror(errno)));
16157
16158	fprintf(stderr, "testing with %s, bound, listening, socket:\n", BLOCKING(blocking));
16159	if (listen(s, 1) != 0) {
16160		perror("listen()");
16161		exit(1);
16162	}
16163	fprintf(stderr, "\tselect() returned %d\n", rc = selectcheck(s));
16164	p = read(s, NULL, 0);
16165	fprintf(stderr, "\tread() returned %d, errno = %d (%s)\n",
16166	p, errno, (strerror(errno)));
16167	p = write(s, &s, sizeof(s));
16168	fprintf(stderr, "\twrite() returned %d, errno = %d (%s)\n",
16169	p, errno, (strerror(errno)));
16170
16171	return rc;
16172}
16173
16174static int
16175selectcheck(s)
16176	int s;
16177{
16178	fd_set rset, wset, xset;
16179	struct timeval timeout;
16180	int ret;
16181
16182	FD_ZERO(&rset);
16183	FD_SET(s, &rset);
16184	wset = xset = rset;
16185
16186	timeout.tv_sec		= 0;
16187	timeout.tv_usec	= 0;
16188
16189	errno = 0;
16190	ret = select(s + 1, &rset, &wset, &xset, &timeout);
16191
16192	if (FD_ISSET(s, &rset))
16193	    fprintf(stderr, "\tsocket is readable\n");
16194
16195	if (FD_ISSET(s, &wset))
16196	    fprintf(stderr, "\tsocket is writeable\n");
16197
16198	if (FD_ISSET(s, &xset))
16199	    fprintf(stderr, "\tsocket has an exception pending\n");
16200
16201	return ret;
16202}
16203_ACEOF
16204if ac_fn_c_try_run "$LINENO"; then :
16205  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16206$as_echo "yes" >&6; }
16207
16208else
16209  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16210$as_echo "no" >&6; }
16211     nb_select_err=t
16212fi
16213rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16214  conftest.$ac_objext conftest.beam conftest.$ac_ext
16215fi
16216
16217
16218if test x"${nb_select_err}" = xt; then
16219   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: socksify operations on nonblocking sockets might fail on this platform" >&5
16220$as_echo "$as_me: WARNING: socksify operations on nonblocking sockets might fail on this platform" >&2;}
16221fi
16222
16223#Linux (RedHat 5.2) defines socklen_t in <socketbits.h>, which is
16224#included by <sys/socket.h>.  check for this first.
16225{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socklen_t" >&5
16226$as_echo_n "checking for socklen_t... " >&6; }
16227cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16228/* end confdefs.h.  */
16229
16230#include <sys/types.h>
16231#include <sys/socket.h>
16232
16233int
16234main ()
16235{
16236socklen_t foo = 1;
16237  ;
16238  return 0;
16239}
16240_ACEOF
16241if ac_fn_c_try_compile "$LINENO"; then :
16242  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16243$as_echo "yes" >&6; }
16244    socklen_found=t
16245else
16246  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16247$as_echo "no" >&6; }
16248    socklen_found=""
16249fi
16250rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16251
16252
16253if test x"$socklen_found" = x; then
16254    case $host in
16255	alpha*-dec-osf* | *-*-aix*)
16256	    $as_echo "#define socklen_t size_t" >>confdefs.h
16257
16258	    ;;
16259
16260	*)
16261	    $as_echo "#define socklen_t int" >>confdefs.h
16262
16263	    ;;
16264    esac
16265fi
16266
16267#sig_atomic_t
16268{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sig_atomic_t in <signal.h>" >&5
16269$as_echo_n "checking for sig_atomic_t in <signal.h>... " >&6; }
16270cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16271/* end confdefs.h.  */
16272
16273#include <signal.h>
16274
16275_ACEOF
16276if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16277  $EGREP "sig_atomic_t" >/dev/null 2>&1; then :
16278
16279$as_echo "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h
16280
16281    case $host in
16282	*-*-aix*)
16283
16284$as_echo "#define HAVE_VOLATILE_SIG_ATOMIC_T 1" >>confdefs.h
16285
16286	;;
16287    esac
16288    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16289$as_echo "yes" >&6; }
16290else
16291  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16292$as_echo "no" >&6; }
16293fi
16294rm -f conftest*
16295
16296
16297#try to identify number of valid signal values
16298SIGDEFAULT=128
16299unset sigmax
16300{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for number of valid signal values" >&5
16301$as_echo_n "checking for number of valid signal values... " >&6; }
16302if test "$cross_compiling" = yes; then :
16303   sigmax=128
16304 { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling, setting to $sigmax" >&5
16305$as_echo "cross-compiling, setting to $sigmax" >&6; }
16306
16307else
16308  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16309/* end confdefs.h.  */
16310
16311#include <signal.h>
16312#include <stdio.h>
16313#include <stdlib.h>
16314
16315int main(int argc, char *argv[])
16316{
16317   FILE *fp;
16318   int minval = 0;
16319   int i;
16320
16321   for (i = 1; i < 1000; i++) {
16322      if (i == SIGKILL || i == SIGSTOP)
16323         continue;
16324      if (signal(i, SIG_DFL) == SIG_ERR) {
16325         perror("signal");
16326         break;
16327      }
16328   }
16329   minval = i;
16330   fprintf(stderr, "notice: signal() based value: %d\n", minval);
16331
16332#ifdef NSIG
16333   if (NSIG > minval) {
16334      minval = NSIG;
16335      fprintf(stderr, "notice: NSIG based value: %d\n", minval);
16336   }
16337#endif /* NSIG */
16338
16339#ifdef SIGRTMAX
16340   /* note: this value might be changed at runtime (e.g., Linux) */
16341   if (SIGRTMAX > minval) {
16342      minval = SIGRTMAX;
16343      fprintf(stderr, "notice: SIGRTMAX based value: %d\n", minval);
16344   }
16345#endif /* SIGRTMAX */
16346
16347   /* get base 2 value */
16348   for (i = 0; i < 10; i++) {
16349      int n = 1 << i;
16350      if (n > minval) {
16351         minval = n;
16352         fprintf(stderr, "notice: base 2 based increase: %d\n", minval);
16353	 break;
16354      }
16355   }
16356
16357   fprintf(stderr, "notice: setting signal max value to %d\n", minval);
16358   if ((fp = fopen("conftest.out", "w")) == NULL) {
16359      perror("fopen");
16360      exit(1);
16361   }
16362   /* write zero for no special handling needed */
16363   fprintf(fp, "%ld\n", minval);
16364   fclose(fp);
16365   exit(0);
16366
16367   return 0;
16368}
16369_ACEOF
16370if ac_fn_c_try_run "$LINENO"; then :
16371  sigmax=`test -s conftest.out && cat conftest.out`
16372fi
16373rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16374  conftest.$ac_objext conftest.beam conftest.$ac_ext
16375fi
16376
16377if test x"$sigmax" = x; then
16378   sigmax=$SIGDEFAULT
16379   { $as_echo "$as_me:${as_lineno-$LINENO}: result: got no value, setting to $sigmax" >&5
16380$as_echo "got no value, setting to $sigmax" >&6; }
16381else
16382   { $as_echo "$as_me:${as_lineno-$LINENO}: result: setting to $sigmax" >&5
16383$as_echo "setting to $sigmax" >&6; }
16384fi
16385
16386cat >>confdefs.h <<_ACEOF
16387#define SOCKS_NSIG $sigmax
16388_ACEOF
16389
16390
16391ac_fn_c_check_type "$LINENO" "int8_t" "ac_cv_type_int8_t" "
16392#include <sys/types.h>
16393#include <netinet/in.h>
16394
16395"
16396if test "x$ac_cv_type_int8_t" = xyes; then :
16397
16398cat >>confdefs.h <<_ACEOF
16399#define HAVE_INT8_T 1
16400_ACEOF
16401
16402
16403fi
16404ac_fn_c_check_type "$LINENO" "int16_t" "ac_cv_type_int16_t" "
16405#include <sys/types.h>
16406#include <netinet/in.h>
16407
16408"
16409if test "x$ac_cv_type_int16_t" = xyes; then :
16410
16411cat >>confdefs.h <<_ACEOF
16412#define HAVE_INT16_T 1
16413_ACEOF
16414
16415
16416fi
16417ac_fn_c_check_type "$LINENO" "int32_t" "ac_cv_type_int32_t" "
16418#include <sys/types.h>
16419#include <netinet/in.h>
16420
16421"
16422if test "x$ac_cv_type_int32_t" = xyes; then :
16423
16424cat >>confdefs.h <<_ACEOF
16425#define HAVE_INT32_T 1
16426_ACEOF
16427
16428
16429fi
16430ac_fn_c_check_type "$LINENO" "uint8_t" "ac_cv_type_uint8_t" "
16431#include <sys/types.h>
16432#include <netinet/in.h>
16433
16434"
16435if test "x$ac_cv_type_uint8_t" = xyes; then :
16436
16437cat >>confdefs.h <<_ACEOF
16438#define HAVE_UINT8_T 1
16439_ACEOF
16440
16441
16442fi
16443ac_fn_c_check_type "$LINENO" "uint16_t" "ac_cv_type_uint16_t" "
16444#include <sys/types.h>
16445#include <netinet/in.h>
16446
16447"
16448if test "x$ac_cv_type_uint16_t" = xyes; then :
16449
16450cat >>confdefs.h <<_ACEOF
16451#define HAVE_UINT16_T 1
16452_ACEOF
16453
16454
16455fi
16456ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "
16457#include <sys/types.h>
16458#include <netinet/in.h>
16459
16460"
16461if test "x$ac_cv_type_uint32_t" = xyes; then :
16462
16463cat >>confdefs.h <<_ACEOF
16464#define HAVE_UINT32_T 1
16465_ACEOF
16466
16467
16468fi
16469ac_fn_c_check_type "$LINENO" "in_port_t" "ac_cv_type_in_port_t" "
16470#include <sys/types.h>
16471#include <netinet/in.h>
16472
16473"
16474if test "x$ac_cv_type_in_port_t" = xyes; then :
16475
16476cat >>confdefs.h <<_ACEOF
16477#define HAVE_IN_PORT_T 1
16478_ACEOF
16479
16480
16481fi
16482ac_fn_c_check_type "$LINENO" "in_addr_t" "ac_cv_type_in_addr_t" "
16483#include <sys/types.h>
16484#include <netinet/in.h>
16485
16486"
16487if test "x$ac_cv_type_in_addr_t" = xyes; then :
16488
16489cat >>confdefs.h <<_ACEOF
16490#define HAVE_IN_ADDR_T 1
16491_ACEOF
16492
16493
16494fi
16495
16496ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
16497if test "x$ac_cv_type_ssize_t" = xyes; then :
16498
16499else
16500
16501cat >>confdefs.h <<_ACEOF
16502#define ssize_t int
16503_ACEOF
16504
16505fi
16506
16507
16508{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5
16509$as_echo_n "checking for working memcmp... " >&6; }
16510if ${ac_cv_func_memcmp_working+:} false; then :
16511  $as_echo_n "(cached) " >&6
16512else
16513  if test "$cross_compiling" = yes; then :
16514  ac_cv_func_memcmp_working=no
16515else
16516  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16517/* end confdefs.h.  */
16518$ac_includes_default
16519int
16520main ()
16521{
16522
16523  /* Some versions of memcmp are not 8-bit clean.  */
16524  char c0 = '\100', c1 = '\200', c2 = '\201';
16525  if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0)
16526    return 1;
16527
16528  /* The Next x86 OpenStep bug shows up only when comparing 16 bytes
16529     or more and with at least one buffer not starting on a 4-byte boundary.
16530     William Lewis provided this test program.   */
16531  {
16532    char foo[21];
16533    char bar[21];
16534    int i;
16535    for (i = 0; i < 4; i++)
16536      {
16537	char *a = foo + i;
16538	char *b = bar + i;
16539	strcpy (a, "--------01111111");
16540	strcpy (b, "--------10000000");
16541	if (memcmp (a, b, 16) >= 0)
16542	  return 1;
16543      }
16544    return 0;
16545  }
16546
16547  ;
16548  return 0;
16549}
16550_ACEOF
16551if ac_fn_c_try_run "$LINENO"; then :
16552  ac_cv_func_memcmp_working=yes
16553else
16554  ac_cv_func_memcmp_working=no
16555fi
16556rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16557  conftest.$ac_objext conftest.beam conftest.$ac_ext
16558fi
16559
16560fi
16561{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5
16562$as_echo "$ac_cv_func_memcmp_working" >&6; }
16563test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in
16564  *" memcmp.$ac_objext "* ) ;;
16565  *) LIBOBJS="$LIBOBJS memcmp.$ac_objext"
16566 ;;
16567esac
16568
16569
16570if ${ac_cv_func_setvbuf_reversed+:} false; then :
16571  $as_echo_n "(cached) " >&6
16572else
16573  ac_cv_func_setvbuf_reversed=no
16574fi
16575
16576
16577{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5
16578$as_echo_n "checking return type of signal handlers... " >&6; }
16579if ${ac_cv_type_signal+:} false; then :
16580  $as_echo_n "(cached) " >&6
16581else
16582  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16583/* end confdefs.h.  */
16584#include <sys/types.h>
16585#include <signal.h>
16586
16587int
16588main ()
16589{
16590return *(signal (0, 0)) (0) == 1;
16591  ;
16592  return 0;
16593}
16594_ACEOF
16595if ac_fn_c_try_compile "$LINENO"; then :
16596  ac_cv_type_signal=int
16597else
16598  ac_cv_type_signal=void
16599fi
16600rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16601fi
16602{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5
16603$as_echo "$ac_cv_type_signal" >&6; }
16604
16605cat >>confdefs.h <<_ACEOF
16606#define RETSIGTYPE $ac_cv_type_signal
16607_ACEOF
16608
16609
16610for ac_func in strftime
16611do :
16612  ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime"
16613if test "x$ac_cv_func_strftime" = xyes; then :
16614  cat >>confdefs.h <<_ACEOF
16615#define HAVE_STRFTIME 1
16616_ACEOF
16617
16618else
16619  # strftime is in -lintl on SCO UNIX.
16620{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5
16621$as_echo_n "checking for strftime in -lintl... " >&6; }
16622if ${ac_cv_lib_intl_strftime+:} false; then :
16623  $as_echo_n "(cached) " >&6
16624else
16625  ac_check_lib_save_LIBS=$LIBS
16626LIBS="-lintl  $LIBS"
16627cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16628/* end confdefs.h.  */
16629
16630/* Override any GCC internal prototype to avoid an error.
16631   Use char because int might match the return type of a GCC
16632   builtin and then its argument prototype would still apply.  */
16633#ifdef __cplusplus
16634extern "C"
16635#endif
16636char strftime ();
16637int
16638main ()
16639{
16640return strftime ();
16641  ;
16642  return 0;
16643}
16644_ACEOF
16645if ac_fn_c_try_link "$LINENO"; then :
16646  ac_cv_lib_intl_strftime=yes
16647else
16648  ac_cv_lib_intl_strftime=no
16649fi
16650rm -f core conftest.err conftest.$ac_objext \
16651    conftest$ac_exeext conftest.$ac_ext
16652LIBS=$ac_check_lib_save_LIBS
16653fi
16654{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5
16655$as_echo "$ac_cv_lib_intl_strftime" >&6; }
16656if test "x$ac_cv_lib_intl_strftime" = xyes; then :
16657  $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h
16658
16659LIBS="-lintl $LIBS"
16660fi
16661
16662fi
16663done
16664
16665
16666
16667
16668  for ac_header in $ac_header_list
16669do :
16670  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
16671ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
16672"
16673if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
16674  cat >>confdefs.h <<_ACEOF
16675#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
16676_ACEOF
16677
16678fi
16679
16680done
16681
16682
16683
16684
16685{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether utime accepts a null argument" >&5
16686$as_echo_n "checking whether utime accepts a null argument... " >&6; }
16687if ${ac_cv_func_utime_null+:} false; then :
16688  $as_echo_n "(cached) " >&6
16689else
16690  rm -f conftest.data; >conftest.data
16691# Sequent interprets utime(file, 0) to mean use start of epoch.  Wrong.
16692if test "$cross_compiling" = yes; then :
16693  ac_cv_func_utime_null='guessing yes'
16694else
16695  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16696/* end confdefs.h.  */
16697$ac_includes_default
16698	       #ifdef HAVE_UTIME_H
16699	       # include <utime.h>
16700	       #endif
16701int
16702main ()
16703{
16704struct stat s, t;
16705  return ! (stat ("conftest.data", &s) == 0
16706	    && utime ("conftest.data", 0) == 0
16707	    && stat ("conftest.data", &t) == 0
16708	    && t.st_mtime >= s.st_mtime
16709	    && t.st_mtime - s.st_mtime < 120);
16710  ;
16711  return 0;
16712}
16713_ACEOF
16714if ac_fn_c_try_run "$LINENO"; then :
16715  ac_cv_func_utime_null=yes
16716else
16717  ac_cv_func_utime_null=no
16718fi
16719rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
16720  conftest.$ac_objext conftest.beam conftest.$ac_ext
16721fi
16722
16723fi
16724{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_utime_null" >&5
16725$as_echo "$ac_cv_func_utime_null" >&6; }
16726if test "x$ac_cv_func_utime_null" != xno; then
16727  ac_cv_func_utime_null=yes
16728
16729$as_echo "#define HAVE_UTIME_NULL 1" >>confdefs.h
16730
16731fi
16732rm -f conftest.data
16733
16734for ac_func in vprintf
16735do :
16736  ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
16737if test "x$ac_cv_func_vprintf" = xyes; then :
16738  cat >>confdefs.h <<_ACEOF
16739#define HAVE_VPRINTF 1
16740_ACEOF
16741
16742ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
16743if test "x$ac_cv_func__doprnt" = xyes; then :
16744
16745$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
16746
16747fi
16748
16749fi
16750done
16751
16752
16753
16754#doesn't work if test links with -lsocket (Solaris)
16755{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_addr" >&5
16756$as_echo_n "checking for library containing inet_addr... " >&6; }
16757if ${ac_cv_search_inet_addr+:} false; then :
16758  $as_echo_n "(cached) " >&6
16759else
16760  ac_func_search_save_LIBS=$LIBS
16761cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16762/* end confdefs.h.  */
16763
16764/* Override any GCC internal prototype to avoid an error.
16765   Use char because int might match the return type of a GCC
16766   builtin and then its argument prototype would still apply.  */
16767#ifdef __cplusplus
16768extern "C"
16769#endif
16770char inet_addr ();
16771int
16772main ()
16773{
16774return inet_addr ();
16775  ;
16776  return 0;
16777}
16778_ACEOF
16779for ac_lib in '' nsl; do
16780  if test -z "$ac_lib"; then
16781    ac_res="none required"
16782  else
16783    ac_res=-l$ac_lib
16784    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
16785  fi
16786  if ac_fn_c_try_link "$LINENO"; then :
16787  ac_cv_search_inet_addr=$ac_res
16788fi
16789rm -f core conftest.err conftest.$ac_objext \
16790    conftest$ac_exeext
16791  if ${ac_cv_search_inet_addr+:} false; then :
16792  break
16793fi
16794done
16795if ${ac_cv_search_inet_addr+:} false; then :
16796
16797else
16798  ac_cv_search_inet_addr=no
16799fi
16800rm conftest.$ac_ext
16801LIBS=$ac_func_search_save_LIBS
16802fi
16803{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_addr" >&5
16804$as_echo "$ac_cv_search_inet_addr" >&6; }
16805ac_res=$ac_cv_search_inet_addr
16806if test "$ac_res" != no; then :
16807  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16808
16809fi
16810
16811
16812#NOTE: also test for -lsocket in preload.m4. not really needed there
16813#      as check is also done here (for checks such as L_PIPETYPE() that
16814#      might need to link with -lsocket, but also having test there makes
16815#      code in that file easier to read.
16816{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getsockopt" >&5
16817$as_echo_n "checking for library containing getsockopt... " >&6; }
16818if ${ac_cv_search_getsockopt+:} false; then :
16819  $as_echo_n "(cached) " >&6
16820else
16821  ac_func_search_save_LIBS=$LIBS
16822cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16823/* end confdefs.h.  */
16824
16825/* Override any GCC internal prototype to avoid an error.
16826   Use char because int might match the return type of a GCC
16827   builtin and then its argument prototype would still apply.  */
16828#ifdef __cplusplus
16829extern "C"
16830#endif
16831char getsockopt ();
16832int
16833main ()
16834{
16835return getsockopt ();
16836  ;
16837  return 0;
16838}
16839_ACEOF
16840for ac_lib in '' socket; do
16841  if test -z "$ac_lib"; then
16842    ac_res="none required"
16843  else
16844    ac_res=-l$ac_lib
16845    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
16846  fi
16847  if ac_fn_c_try_link "$LINENO"; then :
16848  ac_cv_search_getsockopt=$ac_res
16849fi
16850rm -f core conftest.err conftest.$ac_objext \
16851    conftest$ac_exeext
16852  if ${ac_cv_search_getsockopt+:} false; then :
16853  break
16854fi
16855done
16856if ${ac_cv_search_getsockopt+:} false; then :
16857
16858else
16859  ac_cv_search_getsockopt=no
16860fi
16861rm conftest.$ac_ext
16862LIBS=$ac_func_search_save_LIBS
16863fi
16864{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getsockopt" >&5
16865$as_echo "$ac_cv_search_getsockopt" >&6; }
16866ac_res=$ac_cv_search_getsockopt
16867if test "$ac_res" != no; then :
16868  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16869
16870fi
16871
16872
16873for ac_func in getprpwnam getspnam getpwnam_shadow bindresvport
16874do :
16875  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
16876ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
16877if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
16878  cat >>confdefs.h <<_ACEOF
16879#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
16880_ACEOF
16881
16882fi
16883done
16884
16885for ac_func in getpass
16886do :
16887  ac_fn_c_check_func "$LINENO" "getpass" "ac_cv_func_getpass"
16888if test "x$ac_cv_func_getpass" = xyes; then :
16889  cat >>confdefs.h <<_ACEOF
16890#define HAVE_GETPASS 1
16891_ACEOF
16892
16893fi
16894done
16895
16896
16897{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for system V getpwnam" >&5
16898$as_echo_n "checking for system V getpwnam... " >&6; }
16899unset getpwnam_alt
16900if test x"${ac_cv_func_getprpwnam}" = xyes; then
16901    getpwnam_alt=t
16902fi
16903
16904if test x"${ac_cv_func_getspnam}" = xyes; then
16905    getpwnam_alt=t
16906fi
16907
16908#XXX
16909if test x"${getpwnam_alt}" = x; then
16910
16911$as_echo "#define HAVE_WORKING_GETPWNAM 1" >>confdefs.h
16912
16913    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16914$as_echo "no" >&6; }
16915else
16916    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16917$as_echo "yes" >&6; }
16918fi
16919
16920#try to determine pipe buffer type
16921
16922unset pipeside
16923#Some systems seem to base how much can be written to the pipe based
16924#on the size of the socket receive buffer (read-side), while others
16925#on the size of the socket send buffer (send-side).
16926#
16927#This little hack tries to make an educated guess as to what is the
16928#case on this particular system.
16929{ $as_echo "$as_me:${as_lineno-$LINENO}: checking read/send-side pipe system" >&5
16930$as_echo_n "checking read/send-side pipe system... " >&6; }
16931if test "$cross_compiling" = yes; then :
16932      { $as_echo "$as_me:${as_lineno-$LINENO}: result: cross-compiling" >&5
16933$as_echo "cross-compiling" >&6; }
16934else
16935  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
16936/* end confdefs.h.  */
16937
16938#include <sys/types.h>
16939#include <sys/socket.h>
16940
16941#include <assert.h>
16942#include <stdio.h>
16943#include <stdlib.h>
16944#include <string.h>
16945#include <unistd.h>
16946#include <fcntl.h>
16947#include <errno.h>
16948
16949#ifndef MIN
16950#define MIN(a,b) ((a) < (b) ? (a) : (b))
16951#endif /* !MIN */
16952
16953#if NEED_AF_LOCAL
16954#define AF_LOCAL AF_UNIX
16955#endif /* NEED_AF_LOCAL */
16956
16957#define PACKETSIZE  (1024)
16958
16959#define PADBYTES    (sizeof(short) * (64))
16960/*
16961 * Just a wild guess.  Dante uses sizeof(long).
16962 */
16963
16964#define SEND_PIPE   (0)
16965#define RECV_PIPE   (1)
16966
16967#define EXIT_OK      (0) /* type successfully determined */
16968#define EXIT_UNKNOWN (1) /* error: unable to determine type */
16969
16970static void
16971setsockets(const int doreverse, const size_t packetsize,
16972           const int s, const int r,
16973           int *sndbuf, int *sndbuf_set,
16974           int *rcvbuf, int *rcvbuf_set);
16975
16976static size_t
16977sendtest(const int s, const char *buf, const size_t buflen);
16978
16979void
16980reswrite(const char *res);
16981
16982int
16983main(void)
16984{
16985   size_t sent, packetcount;
16986   int sndbuf, sndbuf_set, rcvbuf, rcvbuf_set;
16987   char buf[PACKETSIZE];
16988   int datapipev[2];
16989
16990   if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, datapipev) != 0) {
16991      perror("socketpair()");
16992      exit(EXIT_UNKNOWN);
16993   }
16994
16995   setsockets(0,
16996              PACKETSIZE,
16997              datapipev[SEND_PIPE],
16998              datapipev[RECV_PIPE],
16999              &sndbuf, &sndbuf_set,
17000              &rcvbuf, &rcvbuf_set);
17001
17002   packetcount = MIN(sndbuf, sndbuf_set) / (PACKETSIZE + PADBYTES);
17003
17004   fprintf(stderr,
17005           "Requested sndbuf to be %d, is %d.  "
17006           "Requested rcvbuf to be %d, is %d.\n"
17007           "Calculated packetcount is %lu\n",
17008           sndbuf, sndbuf_set,
17009           rcvbuf, rcvbuf_set,
17010           (unsigned long)packetcount);
17011
17012   sent = sendtest(datapipev[SEND_PIPE], buf, PACKETSIZE) / PACKETSIZE;
17013
17014   if (sent >= packetcount) {
17015      fprintf(stderr, "status determined by send-side\n");
17016      reswrite("sendbased");
17017      exit(EXIT_OK);
17018   }
17019
17020   /*
17021    * Try the reverse.  Perhaps this system wants a large rcvbuf rather than
17022    * a large sndbuf.
17023    */
17024   close(datapipev[SEND_PIPE]);
17025   close(datapipev[RECV_PIPE]);
17026
17027   if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, datapipev) != 0) {
17028      perror("socketpair()");
17029      exit(EXIT_UNKNOWN);
17030   }
17031
17032   setsockets(1,
17033              PACKETSIZE,
17034              datapipev[SEND_PIPE],
17035              datapipev[RECV_PIPE],
17036              &sndbuf, &sndbuf_set,
17037              &rcvbuf, &rcvbuf_set);
17038
17039   packetcount = MIN(rcvbuf, rcvbuf_set) / (PACKETSIZE + PADBYTES);
17040
17041   fprintf(stderr,
17042           "Requested sndbuf to be %d, is %d.  "
17043           "Requested rcvbuf to be %d, is %d.\n"
17044           "Calculated packetcount is %lu\n",
17045           sndbuf, sndbuf_set,
17046           rcvbuf, rcvbuf_set,
17047           (unsigned long)packetcount);
17048
17049   sent = sendtest(datapipev[SEND_PIPE], buf, PACKETSIZE) / PACKETSIZE;
17050
17051   if (sent >= packetcount) {
17052      fprintf(stderr, "status determined by read-side\n");
17053      reswrite("recvbased");
17054      exit(EXIT_OK);
17055   }
17056
17057   fprintf(stderr, "status is unknown\n");
17058   return EXIT_UNKNOWN;
17059}
17060
17061static void
17062setsockets(doreverse, packetsize, s, r, sndbuf, sndbuf_set, rcvbuf, rcvbuf_set)
17063   const int doreverse;
17064   const size_t packetsize;
17065   const int s;
17066   const int r;
17067   int *sndbuf, *sndbuf_set;
17068   int *rcvbuf, *rcvbuf_set;
17069{
17070   socklen_t len;
17071   int p;
17072
17073   if ((p = fcntl(s, F_GETFL, 0))        == -1
17074   ||  fcntl(s, F_SETFL, p | O_NONBLOCK) == -1
17075   ||  fcntl(r, F_SETFL, p | O_NONBLOCK) == -1) {
17076      perror("fcntl(F_SETFL/F_GETFL, O_NONBLOCK) failed");
17077      exit(EXIT_UNKNOWN);
17078   }
17079
17080   len = sizeof(*sndbuf_set);
17081
17082   if (doreverse) {
17083      *sndbuf = packetsize + PADBYTES;
17084
17085      if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf, sizeof(*sndbuf)) != 0) {
17086         perror("setsockopt(SO_SNDBUF)");
17087         exit(EXIT_UNKNOWN);
17088      }
17089
17090      if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf_set, &len) != 0) {
17091         perror("getsockopt(SO_SNDBUF)");
17092         exit(EXIT_UNKNOWN);
17093      }
17094
17095      *rcvbuf = *sndbuf_set * 10;
17096      if (setsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf, sizeof(*rcvbuf)) != 0) {
17097         perror("setsockopt(SO_RCVBUF)");
17098         exit(EXIT_UNKNOWN);
17099      }
17100   }
17101   else {
17102      *rcvbuf = packetsize + PADBYTES;
17103
17104      if (setsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf, sizeof(*rcvbuf)) != 0) {
17105         perror("setsockopt(SO_RCVBUF)");
17106         exit(EXIT_UNKNOWN);
17107      }
17108
17109      if (getsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf_set, &len) != 0) {
17110         perror("getsockopt(SO_RCVBUF)");
17111         exit(EXIT_UNKNOWN);
17112      }
17113
17114      *sndbuf = *rcvbuf_set * 10;
17115      if (setsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf, sizeof(*sndbuf)) != 0) {
17116         perror("setsockopt(SO_SNDBUF)");
17117         exit(EXIT_UNKNOWN);
17118      }
17119   }
17120
17121   if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, sndbuf_set, &len) != 0
17122   ||  getsockopt(r, SOL_SOCKET, SO_RCVBUF, rcvbuf_set, &len) != 0) {
17123      perror("getsockopt(SO_SNDBUF/SO_RCVBUF)");
17124      exit(EXIT_UNKNOWN);
17125   }
17126
17127   fprintf(stderr, "sndbuf is %lu, rcvbuf is %lu\n",
17128          (unsigned long)*sndbuf_set, (unsigned long)*rcvbuf_set);
17129
17130   if (doreverse) {
17131      if (*rcvbuf_set < *rcvbuf) {
17132         fprintf(stderr, "failed to set rcvbuf to %lu.  Is %lu\n",
17133                 (unsigned long)*rcvbuf, (unsigned long)*rcvbuf_set);
17134         exit(EXIT_UNKNOWN);
17135      }
17136   }
17137   else {
17138      if (*sndbuf_set < *sndbuf) {
17139         fprintf(stderr, "failed to set sndbuf to %lu (is %lu)\n",
17140                 (unsigned long)*sndbuf, (unsigned long)*sndbuf_set);
17141         exit(EXIT_UNKNOWN);
17142      }
17143   }
17144}
17145
17146static size_t
17147sendtest(s, buf, buflen)
17148   const int s;
17149   const char *buf;
17150   const size_t buflen;
17151{
17152   ssize_t rc;
17153   size_t sent;
17154   int i;
17155
17156   i        = 1;
17157   sent     = 0;
17158   errno    = 0;
17159
17160   while (1) {
17161      if ((rc = write(s, buf, buflen)) == -1)
17162         break;
17163      else {
17164         assert(rc == (ssize_t)buflen);
17165
17166         ++i;
17167         sent += rc;
17168      }
17169   }
17170
17171   fprintf(stderr,
17172          "failed sending packet #%d, sent %ld/%ld.  "
17173          "Total bytes sent: %lu.  Error on last packet: %s\n",
17174          i,
17175          (long)rc,
17176          (unsigned long)buflen,
17177          (unsigned long)sent,
17178          strerror(errno));
17179
17180   return sent;
17181}
17182
17183void
17184reswrite(res)
17185   const char *res;
17186{
17187   FILE *fp;
17188   if ((fp = fopen("conftest.out", "w")) == NULL) {
17189      perror("fopen");
17190      exit(1);
17191   }
17192   fprintf(fp, "%s\n", res);
17193   fclose(fp);
17194}
17195_ACEOF
17196if ac_fn_c_try_run "$LINENO"; then :
17197  pipeside=`cat conftest.out`
17198     { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pipeside" >&5
17199$as_echo "$pipeside" >&6; }
17200
17201else
17202  { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
17203$as_echo "unknown" >&6; }
17204fi
17205rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17206  conftest.$ac_objext conftest.beam conftest.$ac_ext
17207fi
17208
17209
17210case $pipeside in
17211    recvbased)
17212
17213$as_echo "#define HAVE_PIPEBUFFER_RECV_BASED 1" >>confdefs.h
17214
17215	;;
17216    sendbased)
17217
17218$as_echo "#define HAVE_PIPEBUFFER_SEND_BASED 1" >>confdefs.h
17219
17220	;;
17221    *)
17222
17223$as_echo "#define HAVE_PIPEBUFFER_UNKNOWN 1" >>confdefs.h
17224
17225        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to determine PIPEBUFFER type" >&5
17226$as_echo "$as_me: WARNING: unable to determine PIPEBUFFER type" >&2;}
17227	;;
17228esac
17229
17230#obtain highest valid select() timeout seconds value
17231DEFAULTMAX=33333333 #corresponds roughly to one year
17232 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for errorless select behavior with high timeouts" >&5
17233$as_echo_n "checking for errorless select behavior with high timeouts... " >&6; }
17234 if test "$cross_compiling" = yes; then :
17235         { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
17236$as_echo "unknown" >&6; }
17237       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to determine max select value, using default" >&5
17238$as_echo "$as_me: WARNING: unable to determine max select value, using default" >&2;}
17239
17240cat >>confdefs.h <<_ACEOF
17241#define HAVE_SELECT_MAXTIMEOUT $DEFAULTMAX
17242_ACEOF
17243else
17244  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17245/* end confdefs.h.  */
17246
17247#include <sys/types.h>
17248#include <sys/time.h>
17249
17250#include <errno.h>
17251#ifdef HAVE_LIMITS_H
17252#include <limits.h>
17253#endif /* HAVE_LIMITS_H */
17254#include <signal.h>
17255#include <stdlib.h>
17256#include <stdio.h>
17257#include <stdint.h>
17258#include <unistd.h>
17259
17260void sigalrm(int signal);
17261
17262#define MAXVAL LONG_MAX
17263
17264int resval = -1; /* -1: fail, 0: ok */
17265
17266int
17267main(void)
17268{
17269   if (checkval(MAXVAL) == 0) {
17270      fprintf(stderr, "notice: highest acceptable value equal to MAXVAL\n");
17271      FILE *fp;
17272      if ((fp = fopen("conftest.out", "w")) == NULL) {
17273         perror("fopen");
17274         exit(-1);
17275      }
17276      /* write zero for no special handling needed */
17277      fprintf(fp, "%ld\n", 0);
17278      fclose(fp);
17279      exit(0);
17280   }
17281
17282   binsearch(0, MAXVAL);
17283}
17284
17285binsearch(long startval, long endval)
17286{
17287   long midval = (endval - startval) / 2 + startval;
17288
17289/*   printf("binsearch: %ld - %ld (%ld)\n", startval, endval, midval);*/
17290
17291   if (midval == startval || midval == endval) {
17292      FILE *fp;
17293      if ((fp = fopen("conftest.out", "w")) == NULL) {
17294         perror("fopen");
17295         exit(-1);
17296      }
17297      fprintf(fp, "%ld\n", midval);
17298      fclose(fp);
17299      exit(0);
17300   }
17301
17302   if (checkval(midval) == -1)
17303      /* value failed, must lie below current value*/
17304      binsearch(startval, midval);
17305   else
17306      /* value succeeded, must lie above current value*/
17307      binsearch(midval, endval);
17308}
17309
17310int
17311checkval(long val)
17312{
17313   struct timeval timeout;
17314   int rc;
17315
17316   timeout.tv_sec  = val;
17317   timeout.tv_usec = 0;
17318
17319   if (signal(SIGALRM, sigalrm) == SIG_ERR) {
17320      perror("signal(SIGALRM)");
17321      exit(1);
17322   }
17323
17324   alarm(1);
17325
17326   resval = -1;
17327   if ((rc = select(0, NULL, NULL, NULL, &timeout)) == -1) {
17328      if (errno == EINTR)
17329         return resval;
17330      perror("select()");
17331      return -1;
17332   }
17333
17334   if (rc == 0)
17335      fprintf(stderr, "expected alarm to trigger, not select to timeout ...\n");
17336   else
17337      fprintf(stderr, "select(2) returned %d ...very unexpected\n", rc);
17338
17339   return resval;
17340}
17341
17342void
17343sigalrm(sig)
17344   int sig;
17345{
17346   resval = 0;
17347/*   printf("got sig, ok val\n");*/
17348}
17349
17350_ACEOF
17351if ac_fn_c_try_run "$LINENO"; then :
17352  MAXVAL=`cat conftest.out`
17353      if test x"$MAXVAL" = x; then
17354         { $as_echo "$as_me:${as_lineno-$LINENO}: result: test failure" >&5
17355$as_echo "test failure" >&6; }
17356         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to determine max select value, using default" >&5
17357$as_echo "$as_me: WARNING: unable to determine max select value, using default" >&2;}
17358
17359cat >>confdefs.h <<_ACEOF
17360#define HAVE_SELECT_MAXTIMEOUT $DEFAULTMAX
17361_ACEOF
17362      elif test $MAXVAL -eq 0; then
17363         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
17364$as_echo "yes" >&6; }
17365
17366cat >>confdefs.h <<_ACEOF
17367#define HAVE_SELECT_MAXTIMEOUT 0
17368_ACEOF
17369      elif test $MAXVAL -lt $DEFAULTMAX; then
17370         { $as_echo "$as_me:${as_lineno-$LINENO}: result: unexpected test result" >&5
17371$as_echo "unexpected test result" >&6; }
17372         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unexpectedly low max select value ... using default" >&5
17373$as_echo "$as_me: WARNING: unexpectedly low max select value ... using default" >&2;}
17374
17375cat >>confdefs.h <<_ACEOF
17376#define HAVE_SELECT_MAXTIMEOUT $DEFAULTMAX
17377_ACEOF
17378      else
17379         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using max $MAXVAL" >&5
17380$as_echo "no, using max $MAXVAL" >&6; }
17381
17382cat >>confdefs.h <<_ACEOF
17383#define HAVE_SELECT_MAXTIMEOUT $MAXVAL
17384_ACEOF
17385      fi
17386else
17387  { $as_echo "$as_me:${as_lineno-$LINENO}: result: unknown" >&5
17388$as_echo "unknown" >&6; }
17389       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to determine max select value, using default" >&5
17390$as_echo "$as_me: WARNING: unable to determine max select value, using default" >&2;}
17391
17392cat >>confdefs.h <<_ACEOF
17393#define HAVE_SELECT_MAXTIMEOUT $DEFAULTMAX
17394_ACEOF
17395fi
17396rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
17397  conftest.$ac_objext conftest.beam conftest.$ac_ext
17398fi
17399
17400
17401#generate list of errno values
17402ERRNOSRC="include/errorsymbols_gen.h"
17403cp /dev/null $ERRNOSRC
17404ERRVALFILE="errorvals.txt" #for counting unique (numeric) values
17405cp /dev/null $ERRVALFILE
17406unset ERRNOVALS
17407{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol E2BIG" >&5
17408$as_echo_n "checking for errno symbol E2BIG... " >&6; }
17409  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17410/* end confdefs.h.  */
17411#include <errno.h>
17412int
17413main ()
17414{
17415
17416#ifdef E2BIG
17417errnoval: E2BIG
17418#else
17419#error "errno value E2BIG not defined"
17420#endif
17421  ;
17422  return 0;
17423}
17424_ACEOF
17425if ac_fn_c_try_cpp "$LINENO"; then :
17426  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17427$as_echo "OK" >&6; }
17428        ERRNOVALS="$ERRNOVALS E2BIG"
17429        cat conftest.i | grep errnoval: >>$ERRVALFILE
17430else
17431  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17432$as_echo "no" >&6; }
17433fi
17434rm -f conftest.err conftest.i conftest.$ac_ext
17435{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EACCES" >&5
17436$as_echo_n "checking for errno symbol EACCES... " >&6; }
17437  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17438/* end confdefs.h.  */
17439#include <errno.h>
17440int
17441main ()
17442{
17443
17444#ifdef EACCES
17445errnoval: EACCES
17446#else
17447#error "errno value EACCES not defined"
17448#endif
17449  ;
17450  return 0;
17451}
17452_ACEOF
17453if ac_fn_c_try_cpp "$LINENO"; then :
17454  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17455$as_echo "OK" >&6; }
17456        ERRNOVALS="$ERRNOVALS EACCES"
17457        cat conftest.i | grep errnoval: >>$ERRVALFILE
17458else
17459  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17460$as_echo "no" >&6; }
17461fi
17462rm -f conftest.err conftest.i conftest.$ac_ext
17463{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EADDRINUSE" >&5
17464$as_echo_n "checking for errno symbol EADDRINUSE... " >&6; }
17465  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17466/* end confdefs.h.  */
17467#include <errno.h>
17468int
17469main ()
17470{
17471
17472#ifdef EADDRINUSE
17473errnoval: EADDRINUSE
17474#else
17475#error "errno value EADDRINUSE not defined"
17476#endif
17477  ;
17478  return 0;
17479}
17480_ACEOF
17481if ac_fn_c_try_cpp "$LINENO"; then :
17482  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17483$as_echo "OK" >&6; }
17484        ERRNOVALS="$ERRNOVALS EADDRINUSE"
17485        cat conftest.i | grep errnoval: >>$ERRVALFILE
17486else
17487  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17488$as_echo "no" >&6; }
17489fi
17490rm -f conftest.err conftest.i conftest.$ac_ext
17491{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EADDRNOTAVAIL" >&5
17492$as_echo_n "checking for errno symbol EADDRNOTAVAIL... " >&6; }
17493  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17494/* end confdefs.h.  */
17495#include <errno.h>
17496int
17497main ()
17498{
17499
17500#ifdef EADDRNOTAVAIL
17501errnoval: EADDRNOTAVAIL
17502#else
17503#error "errno value EADDRNOTAVAIL not defined"
17504#endif
17505  ;
17506  return 0;
17507}
17508_ACEOF
17509if ac_fn_c_try_cpp "$LINENO"; then :
17510  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17511$as_echo "OK" >&6; }
17512        ERRNOVALS="$ERRNOVALS EADDRNOTAVAIL"
17513        cat conftest.i | grep errnoval: >>$ERRVALFILE
17514else
17515  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17516$as_echo "no" >&6; }
17517fi
17518rm -f conftest.err conftest.i conftest.$ac_ext
17519{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EADV" >&5
17520$as_echo_n "checking for errno symbol EADV... " >&6; }
17521  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17522/* end confdefs.h.  */
17523#include <errno.h>
17524int
17525main ()
17526{
17527
17528#ifdef EADV
17529errnoval: EADV
17530#else
17531#error "errno value EADV not defined"
17532#endif
17533  ;
17534  return 0;
17535}
17536_ACEOF
17537if ac_fn_c_try_cpp "$LINENO"; then :
17538  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17539$as_echo "OK" >&6; }
17540        ERRNOVALS="$ERRNOVALS EADV"
17541        cat conftest.i | grep errnoval: >>$ERRVALFILE
17542else
17543  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17544$as_echo "no" >&6; }
17545fi
17546rm -f conftest.err conftest.i conftest.$ac_ext
17547{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EAFNOSUPPORT" >&5
17548$as_echo_n "checking for errno symbol EAFNOSUPPORT... " >&6; }
17549  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17550/* end confdefs.h.  */
17551#include <errno.h>
17552int
17553main ()
17554{
17555
17556#ifdef EAFNOSUPPORT
17557errnoval: EAFNOSUPPORT
17558#else
17559#error "errno value EAFNOSUPPORT not defined"
17560#endif
17561  ;
17562  return 0;
17563}
17564_ACEOF
17565if ac_fn_c_try_cpp "$LINENO"; then :
17566  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17567$as_echo "OK" >&6; }
17568        ERRNOVALS="$ERRNOVALS EAFNOSUPPORT"
17569        cat conftest.i | grep errnoval: >>$ERRVALFILE
17570else
17571  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17572$as_echo "no" >&6; }
17573fi
17574rm -f conftest.err conftest.i conftest.$ac_ext
17575{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EAGAIN" >&5
17576$as_echo_n "checking for errno symbol EAGAIN... " >&6; }
17577  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17578/* end confdefs.h.  */
17579#include <errno.h>
17580int
17581main ()
17582{
17583
17584#ifdef EAGAIN
17585errnoval: EAGAIN
17586#else
17587#error "errno value EAGAIN not defined"
17588#endif
17589  ;
17590  return 0;
17591}
17592_ACEOF
17593if ac_fn_c_try_cpp "$LINENO"; then :
17594  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17595$as_echo "OK" >&6; }
17596        ERRNOVALS="$ERRNOVALS EAGAIN"
17597        cat conftest.i | grep errnoval: >>$ERRVALFILE
17598else
17599  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17600$as_echo "no" >&6; }
17601fi
17602rm -f conftest.err conftest.i conftest.$ac_ext
17603{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EALREADY" >&5
17604$as_echo_n "checking for errno symbol EALREADY... " >&6; }
17605  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17606/* end confdefs.h.  */
17607#include <errno.h>
17608int
17609main ()
17610{
17611
17612#ifdef EALREADY
17613errnoval: EALREADY
17614#else
17615#error "errno value EALREADY not defined"
17616#endif
17617  ;
17618  return 0;
17619}
17620_ACEOF
17621if ac_fn_c_try_cpp "$LINENO"; then :
17622  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17623$as_echo "OK" >&6; }
17624        ERRNOVALS="$ERRNOVALS EALREADY"
17625        cat conftest.i | grep errnoval: >>$ERRVALFILE
17626else
17627  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17628$as_echo "no" >&6; }
17629fi
17630rm -f conftest.err conftest.i conftest.$ac_ext
17631{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EAUTH" >&5
17632$as_echo_n "checking for errno symbol EAUTH... " >&6; }
17633  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17634/* end confdefs.h.  */
17635#include <errno.h>
17636int
17637main ()
17638{
17639
17640#ifdef EAUTH
17641errnoval: EAUTH
17642#else
17643#error "errno value EAUTH not defined"
17644#endif
17645  ;
17646  return 0;
17647}
17648_ACEOF
17649if ac_fn_c_try_cpp "$LINENO"; then :
17650  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17651$as_echo "OK" >&6; }
17652        ERRNOVALS="$ERRNOVALS EAUTH"
17653        cat conftest.i | grep errnoval: >>$ERRVALFILE
17654else
17655  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17656$as_echo "no" >&6; }
17657fi
17658rm -f conftest.err conftest.i conftest.$ac_ext
17659{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADARCH" >&5
17660$as_echo_n "checking for errno symbol EBADARCH... " >&6; }
17661  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17662/* end confdefs.h.  */
17663#include <errno.h>
17664int
17665main ()
17666{
17667
17668#ifdef EBADARCH
17669errnoval: EBADARCH
17670#else
17671#error "errno value EBADARCH not defined"
17672#endif
17673  ;
17674  return 0;
17675}
17676_ACEOF
17677if ac_fn_c_try_cpp "$LINENO"; then :
17678  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17679$as_echo "OK" >&6; }
17680        ERRNOVALS="$ERRNOVALS EBADARCH"
17681        cat conftest.i | grep errnoval: >>$ERRVALFILE
17682else
17683  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17684$as_echo "no" >&6; }
17685fi
17686rm -f conftest.err conftest.i conftest.$ac_ext
17687{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADE" >&5
17688$as_echo_n "checking for errno symbol EBADE... " >&6; }
17689  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17690/* end confdefs.h.  */
17691#include <errno.h>
17692int
17693main ()
17694{
17695
17696#ifdef EBADE
17697errnoval: EBADE
17698#else
17699#error "errno value EBADE not defined"
17700#endif
17701  ;
17702  return 0;
17703}
17704_ACEOF
17705if ac_fn_c_try_cpp "$LINENO"; then :
17706  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17707$as_echo "OK" >&6; }
17708        ERRNOVALS="$ERRNOVALS EBADE"
17709        cat conftest.i | grep errnoval: >>$ERRVALFILE
17710else
17711  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17712$as_echo "no" >&6; }
17713fi
17714rm -f conftest.err conftest.i conftest.$ac_ext
17715{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADEXEC" >&5
17716$as_echo_n "checking for errno symbol EBADEXEC... " >&6; }
17717  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17718/* end confdefs.h.  */
17719#include <errno.h>
17720int
17721main ()
17722{
17723
17724#ifdef EBADEXEC
17725errnoval: EBADEXEC
17726#else
17727#error "errno value EBADEXEC not defined"
17728#endif
17729  ;
17730  return 0;
17731}
17732_ACEOF
17733if ac_fn_c_try_cpp "$LINENO"; then :
17734  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17735$as_echo "OK" >&6; }
17736        ERRNOVALS="$ERRNOVALS EBADEXEC"
17737        cat conftest.i | grep errnoval: >>$ERRVALFILE
17738else
17739  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17740$as_echo "no" >&6; }
17741fi
17742rm -f conftest.err conftest.i conftest.$ac_ext
17743{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADF" >&5
17744$as_echo_n "checking for errno symbol EBADF... " >&6; }
17745  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17746/* end confdefs.h.  */
17747#include <errno.h>
17748int
17749main ()
17750{
17751
17752#ifdef EBADF
17753errnoval: EBADF
17754#else
17755#error "errno value EBADF not defined"
17756#endif
17757  ;
17758  return 0;
17759}
17760_ACEOF
17761if ac_fn_c_try_cpp "$LINENO"; then :
17762  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17763$as_echo "OK" >&6; }
17764        ERRNOVALS="$ERRNOVALS EBADF"
17765        cat conftest.i | grep errnoval: >>$ERRVALFILE
17766else
17767  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17768$as_echo "no" >&6; }
17769fi
17770rm -f conftest.err conftest.i conftest.$ac_ext
17771{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADFD" >&5
17772$as_echo_n "checking for errno symbol EBADFD... " >&6; }
17773  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17774/* end confdefs.h.  */
17775#include <errno.h>
17776int
17777main ()
17778{
17779
17780#ifdef EBADFD
17781errnoval: EBADFD
17782#else
17783#error "errno value EBADFD not defined"
17784#endif
17785  ;
17786  return 0;
17787}
17788_ACEOF
17789if ac_fn_c_try_cpp "$LINENO"; then :
17790  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17791$as_echo "OK" >&6; }
17792        ERRNOVALS="$ERRNOVALS EBADFD"
17793        cat conftest.i | grep errnoval: >>$ERRVALFILE
17794else
17795  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17796$as_echo "no" >&6; }
17797fi
17798rm -f conftest.err conftest.i conftest.$ac_ext
17799{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADMACHO" >&5
17800$as_echo_n "checking for errno symbol EBADMACHO... " >&6; }
17801  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17802/* end confdefs.h.  */
17803#include <errno.h>
17804int
17805main ()
17806{
17807
17808#ifdef EBADMACHO
17809errnoval: EBADMACHO
17810#else
17811#error "errno value EBADMACHO not defined"
17812#endif
17813  ;
17814  return 0;
17815}
17816_ACEOF
17817if ac_fn_c_try_cpp "$LINENO"; then :
17818  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17819$as_echo "OK" >&6; }
17820        ERRNOVALS="$ERRNOVALS EBADMACHO"
17821        cat conftest.i | grep errnoval: >>$ERRVALFILE
17822else
17823  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17824$as_echo "no" >&6; }
17825fi
17826rm -f conftest.err conftest.i conftest.$ac_ext
17827{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADMSG" >&5
17828$as_echo_n "checking for errno symbol EBADMSG... " >&6; }
17829  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17830/* end confdefs.h.  */
17831#include <errno.h>
17832int
17833main ()
17834{
17835
17836#ifdef EBADMSG
17837errnoval: EBADMSG
17838#else
17839#error "errno value EBADMSG not defined"
17840#endif
17841  ;
17842  return 0;
17843}
17844_ACEOF
17845if ac_fn_c_try_cpp "$LINENO"; then :
17846  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17847$as_echo "OK" >&6; }
17848        ERRNOVALS="$ERRNOVALS EBADMSG"
17849        cat conftest.i | grep errnoval: >>$ERRVALFILE
17850else
17851  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17852$as_echo "no" >&6; }
17853fi
17854rm -f conftest.err conftest.i conftest.$ac_ext
17855{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADR" >&5
17856$as_echo_n "checking for errno symbol EBADR... " >&6; }
17857  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17858/* end confdefs.h.  */
17859#include <errno.h>
17860int
17861main ()
17862{
17863
17864#ifdef EBADR
17865errnoval: EBADR
17866#else
17867#error "errno value EBADR not defined"
17868#endif
17869  ;
17870  return 0;
17871}
17872_ACEOF
17873if ac_fn_c_try_cpp "$LINENO"; then :
17874  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17875$as_echo "OK" >&6; }
17876        ERRNOVALS="$ERRNOVALS EBADR"
17877        cat conftest.i | grep errnoval: >>$ERRVALFILE
17878else
17879  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17880$as_echo "no" >&6; }
17881fi
17882rm -f conftest.err conftest.i conftest.$ac_ext
17883{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADRPC" >&5
17884$as_echo_n "checking for errno symbol EBADRPC... " >&6; }
17885  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17886/* end confdefs.h.  */
17887#include <errno.h>
17888int
17889main ()
17890{
17891
17892#ifdef EBADRPC
17893errnoval: EBADRPC
17894#else
17895#error "errno value EBADRPC not defined"
17896#endif
17897  ;
17898  return 0;
17899}
17900_ACEOF
17901if ac_fn_c_try_cpp "$LINENO"; then :
17902  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17903$as_echo "OK" >&6; }
17904        ERRNOVALS="$ERRNOVALS EBADRPC"
17905        cat conftest.i | grep errnoval: >>$ERRVALFILE
17906else
17907  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17908$as_echo "no" >&6; }
17909fi
17910rm -f conftest.err conftest.i conftest.$ac_ext
17911{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADRQC" >&5
17912$as_echo_n "checking for errno symbol EBADRQC... " >&6; }
17913  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17914/* end confdefs.h.  */
17915#include <errno.h>
17916int
17917main ()
17918{
17919
17920#ifdef EBADRQC
17921errnoval: EBADRQC
17922#else
17923#error "errno value EBADRQC not defined"
17924#endif
17925  ;
17926  return 0;
17927}
17928_ACEOF
17929if ac_fn_c_try_cpp "$LINENO"; then :
17930  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17931$as_echo "OK" >&6; }
17932        ERRNOVALS="$ERRNOVALS EBADRQC"
17933        cat conftest.i | grep errnoval: >>$ERRVALFILE
17934else
17935  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17936$as_echo "no" >&6; }
17937fi
17938rm -f conftest.err conftest.i conftest.$ac_ext
17939{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBADSLT" >&5
17940$as_echo_n "checking for errno symbol EBADSLT... " >&6; }
17941  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17942/* end confdefs.h.  */
17943#include <errno.h>
17944int
17945main ()
17946{
17947
17948#ifdef EBADSLT
17949errnoval: EBADSLT
17950#else
17951#error "errno value EBADSLT not defined"
17952#endif
17953  ;
17954  return 0;
17955}
17956_ACEOF
17957if ac_fn_c_try_cpp "$LINENO"; then :
17958  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17959$as_echo "OK" >&6; }
17960        ERRNOVALS="$ERRNOVALS EBADSLT"
17961        cat conftest.i | grep errnoval: >>$ERRVALFILE
17962else
17963  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17964$as_echo "no" >&6; }
17965fi
17966rm -f conftest.err conftest.i conftest.$ac_ext
17967{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBFONT" >&5
17968$as_echo_n "checking for errno symbol EBFONT... " >&6; }
17969  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17970/* end confdefs.h.  */
17971#include <errno.h>
17972int
17973main ()
17974{
17975
17976#ifdef EBFONT
17977errnoval: EBFONT
17978#else
17979#error "errno value EBFONT not defined"
17980#endif
17981  ;
17982  return 0;
17983}
17984_ACEOF
17985if ac_fn_c_try_cpp "$LINENO"; then :
17986  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
17987$as_echo "OK" >&6; }
17988        ERRNOVALS="$ERRNOVALS EBFONT"
17989        cat conftest.i | grep errnoval: >>$ERRVALFILE
17990else
17991  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
17992$as_echo "no" >&6; }
17993fi
17994rm -f conftest.err conftest.i conftest.$ac_ext
17995{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EBUSY" >&5
17996$as_echo_n "checking for errno symbol EBUSY... " >&6; }
17997  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
17998/* end confdefs.h.  */
17999#include <errno.h>
18000int
18001main ()
18002{
18003
18004#ifdef EBUSY
18005errnoval: EBUSY
18006#else
18007#error "errno value EBUSY not defined"
18008#endif
18009  ;
18010  return 0;
18011}
18012_ACEOF
18013if ac_fn_c_try_cpp "$LINENO"; then :
18014  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18015$as_echo "OK" >&6; }
18016        ERRNOVALS="$ERRNOVALS EBUSY"
18017        cat conftest.i | grep errnoval: >>$ERRVALFILE
18018else
18019  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18020$as_echo "no" >&6; }
18021fi
18022rm -f conftest.err conftest.i conftest.$ac_ext
18023{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECANCELED" >&5
18024$as_echo_n "checking for errno symbol ECANCELED... " >&6; }
18025  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18026/* end confdefs.h.  */
18027#include <errno.h>
18028int
18029main ()
18030{
18031
18032#ifdef ECANCELED
18033errnoval: ECANCELED
18034#else
18035#error "errno value ECANCELED not defined"
18036#endif
18037  ;
18038  return 0;
18039}
18040_ACEOF
18041if ac_fn_c_try_cpp "$LINENO"; then :
18042  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18043$as_echo "OK" >&6; }
18044        ERRNOVALS="$ERRNOVALS ECANCELED"
18045        cat conftest.i | grep errnoval: >>$ERRVALFILE
18046else
18047  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18048$as_echo "no" >&6; }
18049fi
18050rm -f conftest.err conftest.i conftest.$ac_ext
18051{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECAPMODE" >&5
18052$as_echo_n "checking for errno symbol ECAPMODE... " >&6; }
18053  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18054/* end confdefs.h.  */
18055#include <errno.h>
18056int
18057main ()
18058{
18059
18060#ifdef ECAPMODE
18061errnoval: ECAPMODE
18062#else
18063#error "errno value ECAPMODE not defined"
18064#endif
18065  ;
18066  return 0;
18067}
18068_ACEOF
18069if ac_fn_c_try_cpp "$LINENO"; then :
18070  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18071$as_echo "OK" >&6; }
18072        ERRNOVALS="$ERRNOVALS ECAPMODE"
18073        cat conftest.i | grep errnoval: >>$ERRVALFILE
18074else
18075  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18076$as_echo "no" >&6; }
18077fi
18078rm -f conftest.err conftest.i conftest.$ac_ext
18079{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECHILD" >&5
18080$as_echo_n "checking for errno symbol ECHILD... " >&6; }
18081  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18082/* end confdefs.h.  */
18083#include <errno.h>
18084int
18085main ()
18086{
18087
18088#ifdef ECHILD
18089errnoval: ECHILD
18090#else
18091#error "errno value ECHILD not defined"
18092#endif
18093  ;
18094  return 0;
18095}
18096_ACEOF
18097if ac_fn_c_try_cpp "$LINENO"; then :
18098  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18099$as_echo "OK" >&6; }
18100        ERRNOVALS="$ERRNOVALS ECHILD"
18101        cat conftest.i | grep errnoval: >>$ERRVALFILE
18102else
18103  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18104$as_echo "no" >&6; }
18105fi
18106rm -f conftest.err conftest.i conftest.$ac_ext
18107{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECHRNG" >&5
18108$as_echo_n "checking for errno symbol ECHRNG... " >&6; }
18109  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18110/* end confdefs.h.  */
18111#include <errno.h>
18112int
18113main ()
18114{
18115
18116#ifdef ECHRNG
18117errnoval: ECHRNG
18118#else
18119#error "errno value ECHRNG not defined"
18120#endif
18121  ;
18122  return 0;
18123}
18124_ACEOF
18125if ac_fn_c_try_cpp "$LINENO"; then :
18126  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18127$as_echo "OK" >&6; }
18128        ERRNOVALS="$ERRNOVALS ECHRNG"
18129        cat conftest.i | grep errnoval: >>$ERRVALFILE
18130else
18131  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18132$as_echo "no" >&6; }
18133fi
18134rm -f conftest.err conftest.i conftest.$ac_ext
18135{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECOMM" >&5
18136$as_echo_n "checking for errno symbol ECOMM... " >&6; }
18137  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18138/* end confdefs.h.  */
18139#include <errno.h>
18140int
18141main ()
18142{
18143
18144#ifdef ECOMM
18145errnoval: ECOMM
18146#else
18147#error "errno value ECOMM not defined"
18148#endif
18149  ;
18150  return 0;
18151}
18152_ACEOF
18153if ac_fn_c_try_cpp "$LINENO"; then :
18154  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18155$as_echo "OK" >&6; }
18156        ERRNOVALS="$ERRNOVALS ECOMM"
18157        cat conftest.i | grep errnoval: >>$ERRVALFILE
18158else
18159  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18160$as_echo "no" >&6; }
18161fi
18162rm -f conftest.err conftest.i conftest.$ac_ext
18163{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECONNABORTED" >&5
18164$as_echo_n "checking for errno symbol ECONNABORTED... " >&6; }
18165  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18166/* end confdefs.h.  */
18167#include <errno.h>
18168int
18169main ()
18170{
18171
18172#ifdef ECONNABORTED
18173errnoval: ECONNABORTED
18174#else
18175#error "errno value ECONNABORTED not defined"
18176#endif
18177  ;
18178  return 0;
18179}
18180_ACEOF
18181if ac_fn_c_try_cpp "$LINENO"; then :
18182  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18183$as_echo "OK" >&6; }
18184        ERRNOVALS="$ERRNOVALS ECONNABORTED"
18185        cat conftest.i | grep errnoval: >>$ERRVALFILE
18186else
18187  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18188$as_echo "no" >&6; }
18189fi
18190rm -f conftest.err conftest.i conftest.$ac_ext
18191{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECONNREFUSED" >&5
18192$as_echo_n "checking for errno symbol ECONNREFUSED... " >&6; }
18193  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18194/* end confdefs.h.  */
18195#include <errno.h>
18196int
18197main ()
18198{
18199
18200#ifdef ECONNREFUSED
18201errnoval: ECONNREFUSED
18202#else
18203#error "errno value ECONNREFUSED not defined"
18204#endif
18205  ;
18206  return 0;
18207}
18208_ACEOF
18209if ac_fn_c_try_cpp "$LINENO"; then :
18210  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18211$as_echo "OK" >&6; }
18212        ERRNOVALS="$ERRNOVALS ECONNREFUSED"
18213        cat conftest.i | grep errnoval: >>$ERRVALFILE
18214else
18215  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18216$as_echo "no" >&6; }
18217fi
18218rm -f conftest.err conftest.i conftest.$ac_ext
18219{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECONNRESET" >&5
18220$as_echo_n "checking for errno symbol ECONNRESET... " >&6; }
18221  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18222/* end confdefs.h.  */
18223#include <errno.h>
18224int
18225main ()
18226{
18227
18228#ifdef ECONNRESET
18229errnoval: ECONNRESET
18230#else
18231#error "errno value ECONNRESET not defined"
18232#endif
18233  ;
18234  return 0;
18235}
18236_ACEOF
18237if ac_fn_c_try_cpp "$LINENO"; then :
18238  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18239$as_echo "OK" >&6; }
18240        ERRNOVALS="$ERRNOVALS ECONNRESET"
18241        cat conftest.i | grep errnoval: >>$ERRVALFILE
18242else
18243  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18244$as_echo "no" >&6; }
18245fi
18246rm -f conftest.err conftest.i conftest.$ac_ext
18247{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDEADLK" >&5
18248$as_echo_n "checking for errno symbol EDEADLK... " >&6; }
18249  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18250/* end confdefs.h.  */
18251#include <errno.h>
18252int
18253main ()
18254{
18255
18256#ifdef EDEADLK
18257errnoval: EDEADLK
18258#else
18259#error "errno value EDEADLK not defined"
18260#endif
18261  ;
18262  return 0;
18263}
18264_ACEOF
18265if ac_fn_c_try_cpp "$LINENO"; then :
18266  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18267$as_echo "OK" >&6; }
18268        ERRNOVALS="$ERRNOVALS EDEADLK"
18269        cat conftest.i | grep errnoval: >>$ERRVALFILE
18270else
18271  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18272$as_echo "no" >&6; }
18273fi
18274rm -f conftest.err conftest.i conftest.$ac_ext
18275{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDEADLOCK" >&5
18276$as_echo_n "checking for errno symbol EDEADLOCK... " >&6; }
18277  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18278/* end confdefs.h.  */
18279#include <errno.h>
18280int
18281main ()
18282{
18283
18284#ifdef EDEADLOCK
18285errnoval: EDEADLOCK
18286#else
18287#error "errno value EDEADLOCK not defined"
18288#endif
18289  ;
18290  return 0;
18291}
18292_ACEOF
18293if ac_fn_c_try_cpp "$LINENO"; then :
18294  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18295$as_echo "OK" >&6; }
18296        ERRNOVALS="$ERRNOVALS EDEADLOCK"
18297        cat conftest.i | grep errnoval: >>$ERRVALFILE
18298else
18299  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18300$as_echo "no" >&6; }
18301fi
18302rm -f conftest.err conftest.i conftest.$ac_ext
18303{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDESTADDRREQ" >&5
18304$as_echo_n "checking for errno symbol EDESTADDRREQ... " >&6; }
18305  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18306/* end confdefs.h.  */
18307#include <errno.h>
18308int
18309main ()
18310{
18311
18312#ifdef EDESTADDRREQ
18313errnoval: EDESTADDRREQ
18314#else
18315#error "errno value EDESTADDRREQ not defined"
18316#endif
18317  ;
18318  return 0;
18319}
18320_ACEOF
18321if ac_fn_c_try_cpp "$LINENO"; then :
18322  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18323$as_echo "OK" >&6; }
18324        ERRNOVALS="$ERRNOVALS EDESTADDRREQ"
18325        cat conftest.i | grep errnoval: >>$ERRVALFILE
18326else
18327  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18328$as_echo "no" >&6; }
18329fi
18330rm -f conftest.err conftest.i conftest.$ac_ext
18331{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDEVERR" >&5
18332$as_echo_n "checking for errno symbol EDEVERR... " >&6; }
18333  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18334/* end confdefs.h.  */
18335#include <errno.h>
18336int
18337main ()
18338{
18339
18340#ifdef EDEVERR
18341errnoval: EDEVERR
18342#else
18343#error "errno value EDEVERR not defined"
18344#endif
18345  ;
18346  return 0;
18347}
18348_ACEOF
18349if ac_fn_c_try_cpp "$LINENO"; then :
18350  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18351$as_echo "OK" >&6; }
18352        ERRNOVALS="$ERRNOVALS EDEVERR"
18353        cat conftest.i | grep errnoval: >>$ERRVALFILE
18354else
18355  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18356$as_echo "no" >&6; }
18357fi
18358rm -f conftest.err conftest.i conftest.$ac_ext
18359{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDIRIOCTL" >&5
18360$as_echo_n "checking for errno symbol EDIRIOCTL... " >&6; }
18361  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18362/* end confdefs.h.  */
18363#include <errno.h>
18364int
18365main ()
18366{
18367
18368#ifdef EDIRIOCTL
18369errnoval: EDIRIOCTL
18370#else
18371#error "errno value EDIRIOCTL not defined"
18372#endif
18373  ;
18374  return 0;
18375}
18376_ACEOF
18377if ac_fn_c_try_cpp "$LINENO"; then :
18378  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18379$as_echo "OK" >&6; }
18380        ERRNOVALS="$ERRNOVALS EDIRIOCTL"
18381        cat conftest.i | grep errnoval: >>$ERRVALFILE
18382else
18383  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18384$as_echo "no" >&6; }
18385fi
18386rm -f conftest.err conftest.i conftest.$ac_ext
18387{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDOM" >&5
18388$as_echo_n "checking for errno symbol EDOM... " >&6; }
18389  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18390/* end confdefs.h.  */
18391#include <errno.h>
18392int
18393main ()
18394{
18395
18396#ifdef EDOM
18397errnoval: EDOM
18398#else
18399#error "errno value EDOM not defined"
18400#endif
18401  ;
18402  return 0;
18403}
18404_ACEOF
18405if ac_fn_c_try_cpp "$LINENO"; then :
18406  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18407$as_echo "OK" >&6; }
18408        ERRNOVALS="$ERRNOVALS EDOM"
18409        cat conftest.i | grep errnoval: >>$ERRVALFILE
18410else
18411  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18412$as_echo "no" >&6; }
18413fi
18414rm -f conftest.err conftest.i conftest.$ac_ext
18415{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDOOFUS" >&5
18416$as_echo_n "checking for errno symbol EDOOFUS... " >&6; }
18417  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18418/* end confdefs.h.  */
18419#include <errno.h>
18420int
18421main ()
18422{
18423
18424#ifdef EDOOFUS
18425errnoval: EDOOFUS
18426#else
18427#error "errno value EDOOFUS not defined"
18428#endif
18429  ;
18430  return 0;
18431}
18432_ACEOF
18433if ac_fn_c_try_cpp "$LINENO"; then :
18434  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18435$as_echo "OK" >&6; }
18436        ERRNOVALS="$ERRNOVALS EDOOFUS"
18437        cat conftest.i | grep errnoval: >>$ERRVALFILE
18438else
18439  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18440$as_echo "no" >&6; }
18441fi
18442rm -f conftest.err conftest.i conftest.$ac_ext
18443{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDQUOT" >&5
18444$as_echo_n "checking for errno symbol EDQUOT... " >&6; }
18445  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18446/* end confdefs.h.  */
18447#include <errno.h>
18448int
18449main ()
18450{
18451
18452#ifdef EDQUOT
18453errnoval: EDQUOT
18454#else
18455#error "errno value EDQUOT not defined"
18456#endif
18457  ;
18458  return 0;
18459}
18460_ACEOF
18461if ac_fn_c_try_cpp "$LINENO"; then :
18462  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18463$as_echo "OK" >&6; }
18464        ERRNOVALS="$ERRNOVALS EDQUOT"
18465        cat conftest.i | grep errnoval: >>$ERRVALFILE
18466else
18467  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18468$as_echo "no" >&6; }
18469fi
18470rm -f conftest.err conftest.i conftest.$ac_ext
18471{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EEXIST" >&5
18472$as_echo_n "checking for errno symbol EEXIST... " >&6; }
18473  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18474/* end confdefs.h.  */
18475#include <errno.h>
18476int
18477main ()
18478{
18479
18480#ifdef EEXIST
18481errnoval: EEXIST
18482#else
18483#error "errno value EEXIST not defined"
18484#endif
18485  ;
18486  return 0;
18487}
18488_ACEOF
18489if ac_fn_c_try_cpp "$LINENO"; then :
18490  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18491$as_echo "OK" >&6; }
18492        ERRNOVALS="$ERRNOVALS EEXIST"
18493        cat conftest.i | grep errnoval: >>$ERRVALFILE
18494else
18495  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18496$as_echo "no" >&6; }
18497fi
18498rm -f conftest.err conftest.i conftest.$ac_ext
18499{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EFAULT" >&5
18500$as_echo_n "checking for errno symbol EFAULT... " >&6; }
18501  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18502/* end confdefs.h.  */
18503#include <errno.h>
18504int
18505main ()
18506{
18507
18508#ifdef EFAULT
18509errnoval: EFAULT
18510#else
18511#error "errno value EFAULT not defined"
18512#endif
18513  ;
18514  return 0;
18515}
18516_ACEOF
18517if ac_fn_c_try_cpp "$LINENO"; then :
18518  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18519$as_echo "OK" >&6; }
18520        ERRNOVALS="$ERRNOVALS EFAULT"
18521        cat conftest.i | grep errnoval: >>$ERRVALFILE
18522else
18523  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18524$as_echo "no" >&6; }
18525fi
18526rm -f conftest.err conftest.i conftest.$ac_ext
18527{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EFBIG" >&5
18528$as_echo_n "checking for errno symbol EFBIG... " >&6; }
18529  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18530/* end confdefs.h.  */
18531#include <errno.h>
18532int
18533main ()
18534{
18535
18536#ifdef EFBIG
18537errnoval: EFBIG
18538#else
18539#error "errno value EFBIG not defined"
18540#endif
18541  ;
18542  return 0;
18543}
18544_ACEOF
18545if ac_fn_c_try_cpp "$LINENO"; then :
18546  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18547$as_echo "OK" >&6; }
18548        ERRNOVALS="$ERRNOVALS EFBIG"
18549        cat conftest.i | grep errnoval: >>$ERRVALFILE
18550else
18551  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18552$as_echo "no" >&6; }
18553fi
18554rm -f conftest.err conftest.i conftest.$ac_ext
18555{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EFTYPE" >&5
18556$as_echo_n "checking for errno symbol EFTYPE... " >&6; }
18557  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18558/* end confdefs.h.  */
18559#include <errno.h>
18560int
18561main ()
18562{
18563
18564#ifdef EFTYPE
18565errnoval: EFTYPE
18566#else
18567#error "errno value EFTYPE not defined"
18568#endif
18569  ;
18570  return 0;
18571}
18572_ACEOF
18573if ac_fn_c_try_cpp "$LINENO"; then :
18574  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18575$as_echo "OK" >&6; }
18576        ERRNOVALS="$ERRNOVALS EFTYPE"
18577        cat conftest.i | grep errnoval: >>$ERRVALFILE
18578else
18579  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18580$as_echo "no" >&6; }
18581fi
18582rm -f conftest.err conftest.i conftest.$ac_ext
18583{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EHOSTDOWN" >&5
18584$as_echo_n "checking for errno symbol EHOSTDOWN... " >&6; }
18585  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18586/* end confdefs.h.  */
18587#include <errno.h>
18588int
18589main ()
18590{
18591
18592#ifdef EHOSTDOWN
18593errnoval: EHOSTDOWN
18594#else
18595#error "errno value EHOSTDOWN not defined"
18596#endif
18597  ;
18598  return 0;
18599}
18600_ACEOF
18601if ac_fn_c_try_cpp "$LINENO"; then :
18602  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18603$as_echo "OK" >&6; }
18604        ERRNOVALS="$ERRNOVALS EHOSTDOWN"
18605        cat conftest.i | grep errnoval: >>$ERRVALFILE
18606else
18607  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18608$as_echo "no" >&6; }
18609fi
18610rm -f conftest.err conftest.i conftest.$ac_ext
18611{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EHOSTUNREACH" >&5
18612$as_echo_n "checking for errno symbol EHOSTUNREACH... " >&6; }
18613  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18614/* end confdefs.h.  */
18615#include <errno.h>
18616int
18617main ()
18618{
18619
18620#ifdef EHOSTUNREACH
18621errnoval: EHOSTUNREACH
18622#else
18623#error "errno value EHOSTUNREACH not defined"
18624#endif
18625  ;
18626  return 0;
18627}
18628_ACEOF
18629if ac_fn_c_try_cpp "$LINENO"; then :
18630  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18631$as_echo "OK" >&6; }
18632        ERRNOVALS="$ERRNOVALS EHOSTUNREACH"
18633        cat conftest.i | grep errnoval: >>$ERRVALFILE
18634else
18635  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18636$as_echo "no" >&6; }
18637fi
18638rm -f conftest.err conftest.i conftest.$ac_ext
18639{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EIDRM" >&5
18640$as_echo_n "checking for errno symbol EIDRM... " >&6; }
18641  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18642/* end confdefs.h.  */
18643#include <errno.h>
18644int
18645main ()
18646{
18647
18648#ifdef EIDRM
18649errnoval: EIDRM
18650#else
18651#error "errno value EIDRM not defined"
18652#endif
18653  ;
18654  return 0;
18655}
18656_ACEOF
18657if ac_fn_c_try_cpp "$LINENO"; then :
18658  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18659$as_echo "OK" >&6; }
18660        ERRNOVALS="$ERRNOVALS EIDRM"
18661        cat conftest.i | grep errnoval: >>$ERRVALFILE
18662else
18663  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18664$as_echo "no" >&6; }
18665fi
18666rm -f conftest.err conftest.i conftest.$ac_ext
18667{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EILSEQ" >&5
18668$as_echo_n "checking for errno symbol EILSEQ... " >&6; }
18669  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18670/* end confdefs.h.  */
18671#include <errno.h>
18672int
18673main ()
18674{
18675
18676#ifdef EILSEQ
18677errnoval: EILSEQ
18678#else
18679#error "errno value EILSEQ not defined"
18680#endif
18681  ;
18682  return 0;
18683}
18684_ACEOF
18685if ac_fn_c_try_cpp "$LINENO"; then :
18686  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18687$as_echo "OK" >&6; }
18688        ERRNOVALS="$ERRNOVALS EILSEQ"
18689        cat conftest.i | grep errnoval: >>$ERRVALFILE
18690else
18691  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18692$as_echo "no" >&6; }
18693fi
18694rm -f conftest.err conftest.i conftest.$ac_ext
18695{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EINPROGRESS" >&5
18696$as_echo_n "checking for errno symbol EINPROGRESS... " >&6; }
18697  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18698/* end confdefs.h.  */
18699#include <errno.h>
18700int
18701main ()
18702{
18703
18704#ifdef EINPROGRESS
18705errnoval: EINPROGRESS
18706#else
18707#error "errno value EINPROGRESS not defined"
18708#endif
18709  ;
18710  return 0;
18711}
18712_ACEOF
18713if ac_fn_c_try_cpp "$LINENO"; then :
18714  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18715$as_echo "OK" >&6; }
18716        ERRNOVALS="$ERRNOVALS EINPROGRESS"
18717        cat conftest.i | grep errnoval: >>$ERRVALFILE
18718else
18719  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18720$as_echo "no" >&6; }
18721fi
18722rm -f conftest.err conftest.i conftest.$ac_ext
18723{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EINTR" >&5
18724$as_echo_n "checking for errno symbol EINTR... " >&6; }
18725  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18726/* end confdefs.h.  */
18727#include <errno.h>
18728int
18729main ()
18730{
18731
18732#ifdef EINTR
18733errnoval: EINTR
18734#else
18735#error "errno value EINTR not defined"
18736#endif
18737  ;
18738  return 0;
18739}
18740_ACEOF
18741if ac_fn_c_try_cpp "$LINENO"; then :
18742  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18743$as_echo "OK" >&6; }
18744        ERRNOVALS="$ERRNOVALS EINTR"
18745        cat conftest.i | grep errnoval: >>$ERRVALFILE
18746else
18747  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18748$as_echo "no" >&6; }
18749fi
18750rm -f conftest.err conftest.i conftest.$ac_ext
18751{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EINVAL" >&5
18752$as_echo_n "checking for errno symbol EINVAL... " >&6; }
18753  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18754/* end confdefs.h.  */
18755#include <errno.h>
18756int
18757main ()
18758{
18759
18760#ifdef EINVAL
18761errnoval: EINVAL
18762#else
18763#error "errno value EINVAL not defined"
18764#endif
18765  ;
18766  return 0;
18767}
18768_ACEOF
18769if ac_fn_c_try_cpp "$LINENO"; then :
18770  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18771$as_echo "OK" >&6; }
18772        ERRNOVALS="$ERRNOVALS EINVAL"
18773        cat conftest.i | grep errnoval: >>$ERRVALFILE
18774else
18775  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18776$as_echo "no" >&6; }
18777fi
18778rm -f conftest.err conftest.i conftest.$ac_ext
18779{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EIO" >&5
18780$as_echo_n "checking for errno symbol EIO... " >&6; }
18781  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18782/* end confdefs.h.  */
18783#include <errno.h>
18784int
18785main ()
18786{
18787
18788#ifdef EIO
18789errnoval: EIO
18790#else
18791#error "errno value EIO not defined"
18792#endif
18793  ;
18794  return 0;
18795}
18796_ACEOF
18797if ac_fn_c_try_cpp "$LINENO"; then :
18798  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18799$as_echo "OK" >&6; }
18800        ERRNOVALS="$ERRNOVALS EIO"
18801        cat conftest.i | grep errnoval: >>$ERRVALFILE
18802else
18803  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18804$as_echo "no" >&6; }
18805fi
18806rm -f conftest.err conftest.i conftest.$ac_ext
18807{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EIPSEC" >&5
18808$as_echo_n "checking for errno symbol EIPSEC... " >&6; }
18809  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18810/* end confdefs.h.  */
18811#include <errno.h>
18812int
18813main ()
18814{
18815
18816#ifdef EIPSEC
18817errnoval: EIPSEC
18818#else
18819#error "errno value EIPSEC not defined"
18820#endif
18821  ;
18822  return 0;
18823}
18824_ACEOF
18825if ac_fn_c_try_cpp "$LINENO"; then :
18826  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18827$as_echo "OK" >&6; }
18828        ERRNOVALS="$ERRNOVALS EIPSEC"
18829        cat conftest.i | grep errnoval: >>$ERRVALFILE
18830else
18831  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18832$as_echo "no" >&6; }
18833fi
18834rm -f conftest.err conftest.i conftest.$ac_ext
18835{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EISCONN" >&5
18836$as_echo_n "checking for errno symbol EISCONN... " >&6; }
18837  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18838/* end confdefs.h.  */
18839#include <errno.h>
18840int
18841main ()
18842{
18843
18844#ifdef EISCONN
18845errnoval: EISCONN
18846#else
18847#error "errno value EISCONN not defined"
18848#endif
18849  ;
18850  return 0;
18851}
18852_ACEOF
18853if ac_fn_c_try_cpp "$LINENO"; then :
18854  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18855$as_echo "OK" >&6; }
18856        ERRNOVALS="$ERRNOVALS EISCONN"
18857        cat conftest.i | grep errnoval: >>$ERRVALFILE
18858else
18859  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18860$as_echo "no" >&6; }
18861fi
18862rm -f conftest.err conftest.i conftest.$ac_ext
18863{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EISDIR" >&5
18864$as_echo_n "checking for errno symbol EISDIR... " >&6; }
18865  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18866/* end confdefs.h.  */
18867#include <errno.h>
18868int
18869main ()
18870{
18871
18872#ifdef EISDIR
18873errnoval: EISDIR
18874#else
18875#error "errno value EISDIR not defined"
18876#endif
18877  ;
18878  return 0;
18879}
18880_ACEOF
18881if ac_fn_c_try_cpp "$LINENO"; then :
18882  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18883$as_echo "OK" >&6; }
18884        ERRNOVALS="$ERRNOVALS EISDIR"
18885        cat conftest.i | grep errnoval: >>$ERRVALFILE
18886else
18887  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18888$as_echo "no" >&6; }
18889fi
18890rm -f conftest.err conftest.i conftest.$ac_ext
18891{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EJUSTRETURN" >&5
18892$as_echo_n "checking for errno symbol EJUSTRETURN... " >&6; }
18893  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18894/* end confdefs.h.  */
18895#include <errno.h>
18896int
18897main ()
18898{
18899
18900#ifdef EJUSTRETURN
18901errnoval: EJUSTRETURN
18902#else
18903#error "errno value EJUSTRETURN not defined"
18904#endif
18905  ;
18906  return 0;
18907}
18908_ACEOF
18909if ac_fn_c_try_cpp "$LINENO"; then :
18910  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18911$as_echo "OK" >&6; }
18912        ERRNOVALS="$ERRNOVALS EJUSTRETURN"
18913        cat conftest.i | grep errnoval: >>$ERRVALFILE
18914else
18915  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18916$as_echo "no" >&6; }
18917fi
18918rm -f conftest.err conftest.i conftest.$ac_ext
18919{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EL2HLT" >&5
18920$as_echo_n "checking for errno symbol EL2HLT... " >&6; }
18921  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18922/* end confdefs.h.  */
18923#include <errno.h>
18924int
18925main ()
18926{
18927
18928#ifdef EL2HLT
18929errnoval: EL2HLT
18930#else
18931#error "errno value EL2HLT not defined"
18932#endif
18933  ;
18934  return 0;
18935}
18936_ACEOF
18937if ac_fn_c_try_cpp "$LINENO"; then :
18938  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18939$as_echo "OK" >&6; }
18940        ERRNOVALS="$ERRNOVALS EL2HLT"
18941        cat conftest.i | grep errnoval: >>$ERRVALFILE
18942else
18943  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18944$as_echo "no" >&6; }
18945fi
18946rm -f conftest.err conftest.i conftest.$ac_ext
18947{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EL2NSYNC" >&5
18948$as_echo_n "checking for errno symbol EL2NSYNC... " >&6; }
18949  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18950/* end confdefs.h.  */
18951#include <errno.h>
18952int
18953main ()
18954{
18955
18956#ifdef EL2NSYNC
18957errnoval: EL2NSYNC
18958#else
18959#error "errno value EL2NSYNC not defined"
18960#endif
18961  ;
18962  return 0;
18963}
18964_ACEOF
18965if ac_fn_c_try_cpp "$LINENO"; then :
18966  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18967$as_echo "OK" >&6; }
18968        ERRNOVALS="$ERRNOVALS EL2NSYNC"
18969        cat conftest.i | grep errnoval: >>$ERRVALFILE
18970else
18971  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
18972$as_echo "no" >&6; }
18973fi
18974rm -f conftest.err conftest.i conftest.$ac_ext
18975{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EL3HLT" >&5
18976$as_echo_n "checking for errno symbol EL3HLT... " >&6; }
18977  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
18978/* end confdefs.h.  */
18979#include <errno.h>
18980int
18981main ()
18982{
18983
18984#ifdef EL3HLT
18985errnoval: EL3HLT
18986#else
18987#error "errno value EL3HLT not defined"
18988#endif
18989  ;
18990  return 0;
18991}
18992_ACEOF
18993if ac_fn_c_try_cpp "$LINENO"; then :
18994  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
18995$as_echo "OK" >&6; }
18996        ERRNOVALS="$ERRNOVALS EL3HLT"
18997        cat conftest.i | grep errnoval: >>$ERRVALFILE
18998else
18999  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19000$as_echo "no" >&6; }
19001fi
19002rm -f conftest.err conftest.i conftest.$ac_ext
19003{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EL3RST" >&5
19004$as_echo_n "checking for errno symbol EL3RST... " >&6; }
19005  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19006/* end confdefs.h.  */
19007#include <errno.h>
19008int
19009main ()
19010{
19011
19012#ifdef EL3RST
19013errnoval: EL3RST
19014#else
19015#error "errno value EL3RST not defined"
19016#endif
19017  ;
19018  return 0;
19019}
19020_ACEOF
19021if ac_fn_c_try_cpp "$LINENO"; then :
19022  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19023$as_echo "OK" >&6; }
19024        ERRNOVALS="$ERRNOVALS EL3RST"
19025        cat conftest.i | grep errnoval: >>$ERRVALFILE
19026else
19027  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19028$as_echo "no" >&6; }
19029fi
19030rm -f conftest.err conftest.i conftest.$ac_ext
19031{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELAST" >&5
19032$as_echo_n "checking for errno symbol ELAST... " >&6; }
19033  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19034/* end confdefs.h.  */
19035#include <errno.h>
19036int
19037main ()
19038{
19039
19040#ifdef ELAST
19041errnoval: ELAST
19042#else
19043#error "errno value ELAST not defined"
19044#endif
19045  ;
19046  return 0;
19047}
19048_ACEOF
19049if ac_fn_c_try_cpp "$LINENO"; then :
19050  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19051$as_echo "OK" >&6; }
19052        ERRNOVALS="$ERRNOVALS ELAST"
19053        cat conftest.i | grep errnoval: >>$ERRVALFILE
19054else
19055  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19056$as_echo "no" >&6; }
19057fi
19058rm -f conftest.err conftest.i conftest.$ac_ext
19059{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELIBACC" >&5
19060$as_echo_n "checking for errno symbol ELIBACC... " >&6; }
19061  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19062/* end confdefs.h.  */
19063#include <errno.h>
19064int
19065main ()
19066{
19067
19068#ifdef ELIBACC
19069errnoval: ELIBACC
19070#else
19071#error "errno value ELIBACC not defined"
19072#endif
19073  ;
19074  return 0;
19075}
19076_ACEOF
19077if ac_fn_c_try_cpp "$LINENO"; then :
19078  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19079$as_echo "OK" >&6; }
19080        ERRNOVALS="$ERRNOVALS ELIBACC"
19081        cat conftest.i | grep errnoval: >>$ERRVALFILE
19082else
19083  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19084$as_echo "no" >&6; }
19085fi
19086rm -f conftest.err conftest.i conftest.$ac_ext
19087{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELIBBAD" >&5
19088$as_echo_n "checking for errno symbol ELIBBAD... " >&6; }
19089  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19090/* end confdefs.h.  */
19091#include <errno.h>
19092int
19093main ()
19094{
19095
19096#ifdef ELIBBAD
19097errnoval: ELIBBAD
19098#else
19099#error "errno value ELIBBAD not defined"
19100#endif
19101  ;
19102  return 0;
19103}
19104_ACEOF
19105if ac_fn_c_try_cpp "$LINENO"; then :
19106  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19107$as_echo "OK" >&6; }
19108        ERRNOVALS="$ERRNOVALS ELIBBAD"
19109        cat conftest.i | grep errnoval: >>$ERRVALFILE
19110else
19111  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19112$as_echo "no" >&6; }
19113fi
19114rm -f conftest.err conftest.i conftest.$ac_ext
19115{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELIBEXEC" >&5
19116$as_echo_n "checking for errno symbol ELIBEXEC... " >&6; }
19117  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19118/* end confdefs.h.  */
19119#include <errno.h>
19120int
19121main ()
19122{
19123
19124#ifdef ELIBEXEC
19125errnoval: ELIBEXEC
19126#else
19127#error "errno value ELIBEXEC not defined"
19128#endif
19129  ;
19130  return 0;
19131}
19132_ACEOF
19133if ac_fn_c_try_cpp "$LINENO"; then :
19134  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19135$as_echo "OK" >&6; }
19136        ERRNOVALS="$ERRNOVALS ELIBEXEC"
19137        cat conftest.i | grep errnoval: >>$ERRVALFILE
19138else
19139  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19140$as_echo "no" >&6; }
19141fi
19142rm -f conftest.err conftest.i conftest.$ac_ext
19143{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELIBMAX" >&5
19144$as_echo_n "checking for errno symbol ELIBMAX... " >&6; }
19145  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19146/* end confdefs.h.  */
19147#include <errno.h>
19148int
19149main ()
19150{
19151
19152#ifdef ELIBMAX
19153errnoval: ELIBMAX
19154#else
19155#error "errno value ELIBMAX not defined"
19156#endif
19157  ;
19158  return 0;
19159}
19160_ACEOF
19161if ac_fn_c_try_cpp "$LINENO"; then :
19162  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19163$as_echo "OK" >&6; }
19164        ERRNOVALS="$ERRNOVALS ELIBMAX"
19165        cat conftest.i | grep errnoval: >>$ERRVALFILE
19166else
19167  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19168$as_echo "no" >&6; }
19169fi
19170rm -f conftest.err conftest.i conftest.$ac_ext
19171{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELIBSCN" >&5
19172$as_echo_n "checking for errno symbol ELIBSCN... " >&6; }
19173  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19174/* end confdefs.h.  */
19175#include <errno.h>
19176int
19177main ()
19178{
19179
19180#ifdef ELIBSCN
19181errnoval: ELIBSCN
19182#else
19183#error "errno value ELIBSCN not defined"
19184#endif
19185  ;
19186  return 0;
19187}
19188_ACEOF
19189if ac_fn_c_try_cpp "$LINENO"; then :
19190  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19191$as_echo "OK" >&6; }
19192        ERRNOVALS="$ERRNOVALS ELIBSCN"
19193        cat conftest.i | grep errnoval: >>$ERRVALFILE
19194else
19195  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19196$as_echo "no" >&6; }
19197fi
19198rm -f conftest.err conftest.i conftest.$ac_ext
19199{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELNRNG" >&5
19200$as_echo_n "checking for errno symbol ELNRNG... " >&6; }
19201  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19202/* end confdefs.h.  */
19203#include <errno.h>
19204int
19205main ()
19206{
19207
19208#ifdef ELNRNG
19209errnoval: ELNRNG
19210#else
19211#error "errno value ELNRNG not defined"
19212#endif
19213  ;
19214  return 0;
19215}
19216_ACEOF
19217if ac_fn_c_try_cpp "$LINENO"; then :
19218  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19219$as_echo "OK" >&6; }
19220        ERRNOVALS="$ERRNOVALS ELNRNG"
19221        cat conftest.i | grep errnoval: >>$ERRVALFILE
19222else
19223  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19224$as_echo "no" >&6; }
19225fi
19226rm -f conftest.err conftest.i conftest.$ac_ext
19227{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELOCKUNMAPPED" >&5
19228$as_echo_n "checking for errno symbol ELOCKUNMAPPED... " >&6; }
19229  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19230/* end confdefs.h.  */
19231#include <errno.h>
19232int
19233main ()
19234{
19235
19236#ifdef ELOCKUNMAPPED
19237errnoval: ELOCKUNMAPPED
19238#else
19239#error "errno value ELOCKUNMAPPED not defined"
19240#endif
19241  ;
19242  return 0;
19243}
19244_ACEOF
19245if ac_fn_c_try_cpp "$LINENO"; then :
19246  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19247$as_echo "OK" >&6; }
19248        ERRNOVALS="$ERRNOVALS ELOCKUNMAPPED"
19249        cat conftest.i | grep errnoval: >>$ERRVALFILE
19250else
19251  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19252$as_echo "no" >&6; }
19253fi
19254rm -f conftest.err conftest.i conftest.$ac_ext
19255{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ELOOP" >&5
19256$as_echo_n "checking for errno symbol ELOOP... " >&6; }
19257  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19258/* end confdefs.h.  */
19259#include <errno.h>
19260int
19261main ()
19262{
19263
19264#ifdef ELOOP
19265errnoval: ELOOP
19266#else
19267#error "errno value ELOOP not defined"
19268#endif
19269  ;
19270  return 0;
19271}
19272_ACEOF
19273if ac_fn_c_try_cpp "$LINENO"; then :
19274  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19275$as_echo "OK" >&6; }
19276        ERRNOVALS="$ERRNOVALS ELOOP"
19277        cat conftest.i | grep errnoval: >>$ERRVALFILE
19278else
19279  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19280$as_echo "no" >&6; }
19281fi
19282rm -f conftest.err conftest.i conftest.$ac_ext
19283{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EMEDIUMTYPE" >&5
19284$as_echo_n "checking for errno symbol EMEDIUMTYPE... " >&6; }
19285  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19286/* end confdefs.h.  */
19287#include <errno.h>
19288int
19289main ()
19290{
19291
19292#ifdef EMEDIUMTYPE
19293errnoval: EMEDIUMTYPE
19294#else
19295#error "errno value EMEDIUMTYPE not defined"
19296#endif
19297  ;
19298  return 0;
19299}
19300_ACEOF
19301if ac_fn_c_try_cpp "$LINENO"; then :
19302  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19303$as_echo "OK" >&6; }
19304        ERRNOVALS="$ERRNOVALS EMEDIUMTYPE"
19305        cat conftest.i | grep errnoval: >>$ERRVALFILE
19306else
19307  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19308$as_echo "no" >&6; }
19309fi
19310rm -f conftest.err conftest.i conftest.$ac_ext
19311{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EMFILE" >&5
19312$as_echo_n "checking for errno symbol EMFILE... " >&6; }
19313  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19314/* end confdefs.h.  */
19315#include <errno.h>
19316int
19317main ()
19318{
19319
19320#ifdef EMFILE
19321errnoval: EMFILE
19322#else
19323#error "errno value EMFILE not defined"
19324#endif
19325  ;
19326  return 0;
19327}
19328_ACEOF
19329if ac_fn_c_try_cpp "$LINENO"; then :
19330  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19331$as_echo "OK" >&6; }
19332        ERRNOVALS="$ERRNOVALS EMFILE"
19333        cat conftest.i | grep errnoval: >>$ERRVALFILE
19334else
19335  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19336$as_echo "no" >&6; }
19337fi
19338rm -f conftest.err conftest.i conftest.$ac_ext
19339{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EMLINK" >&5
19340$as_echo_n "checking for errno symbol EMLINK... " >&6; }
19341  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19342/* end confdefs.h.  */
19343#include <errno.h>
19344int
19345main ()
19346{
19347
19348#ifdef EMLINK
19349errnoval: EMLINK
19350#else
19351#error "errno value EMLINK not defined"
19352#endif
19353  ;
19354  return 0;
19355}
19356_ACEOF
19357if ac_fn_c_try_cpp "$LINENO"; then :
19358  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19359$as_echo "OK" >&6; }
19360        ERRNOVALS="$ERRNOVALS EMLINK"
19361        cat conftest.i | grep errnoval: >>$ERRVALFILE
19362else
19363  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19364$as_echo "no" >&6; }
19365fi
19366rm -f conftest.err conftest.i conftest.$ac_ext
19367{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EMSGSIZE" >&5
19368$as_echo_n "checking for errno symbol EMSGSIZE... " >&6; }
19369  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19370/* end confdefs.h.  */
19371#include <errno.h>
19372int
19373main ()
19374{
19375
19376#ifdef EMSGSIZE
19377errnoval: EMSGSIZE
19378#else
19379#error "errno value EMSGSIZE not defined"
19380#endif
19381  ;
19382  return 0;
19383}
19384_ACEOF
19385if ac_fn_c_try_cpp "$LINENO"; then :
19386  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19387$as_echo "OK" >&6; }
19388        ERRNOVALS="$ERRNOVALS EMSGSIZE"
19389        cat conftest.i | grep errnoval: >>$ERRVALFILE
19390else
19391  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19392$as_echo "no" >&6; }
19393fi
19394rm -f conftest.err conftest.i conftest.$ac_ext
19395{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EMULTIHOP" >&5
19396$as_echo_n "checking for errno symbol EMULTIHOP... " >&6; }
19397  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19398/* end confdefs.h.  */
19399#include <errno.h>
19400int
19401main ()
19402{
19403
19404#ifdef EMULTIHOP
19405errnoval: EMULTIHOP
19406#else
19407#error "errno value EMULTIHOP not defined"
19408#endif
19409  ;
19410  return 0;
19411}
19412_ACEOF
19413if ac_fn_c_try_cpp "$LINENO"; then :
19414  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19415$as_echo "OK" >&6; }
19416        ERRNOVALS="$ERRNOVALS EMULTIHOP"
19417        cat conftest.i | grep errnoval: >>$ERRVALFILE
19418else
19419  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19420$as_echo "no" >&6; }
19421fi
19422rm -f conftest.err conftest.i conftest.$ac_ext
19423{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENAMETOOLONG" >&5
19424$as_echo_n "checking for errno symbol ENAMETOOLONG... " >&6; }
19425  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19426/* end confdefs.h.  */
19427#include <errno.h>
19428int
19429main ()
19430{
19431
19432#ifdef ENAMETOOLONG
19433errnoval: ENAMETOOLONG
19434#else
19435#error "errno value ENAMETOOLONG not defined"
19436#endif
19437  ;
19438  return 0;
19439}
19440_ACEOF
19441if ac_fn_c_try_cpp "$LINENO"; then :
19442  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19443$as_echo "OK" >&6; }
19444        ERRNOVALS="$ERRNOVALS ENAMETOOLONG"
19445        cat conftest.i | grep errnoval: >>$ERRVALFILE
19446else
19447  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19448$as_echo "no" >&6; }
19449fi
19450rm -f conftest.err conftest.i conftest.$ac_ext
19451{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENEEDAUTH" >&5
19452$as_echo_n "checking for errno symbol ENEEDAUTH... " >&6; }
19453  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19454/* end confdefs.h.  */
19455#include <errno.h>
19456int
19457main ()
19458{
19459
19460#ifdef ENEEDAUTH
19461errnoval: ENEEDAUTH
19462#else
19463#error "errno value ENEEDAUTH not defined"
19464#endif
19465  ;
19466  return 0;
19467}
19468_ACEOF
19469if ac_fn_c_try_cpp "$LINENO"; then :
19470  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19471$as_echo "OK" >&6; }
19472        ERRNOVALS="$ERRNOVALS ENEEDAUTH"
19473        cat conftest.i | grep errnoval: >>$ERRVALFILE
19474else
19475  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19476$as_echo "no" >&6; }
19477fi
19478rm -f conftest.err conftest.i conftest.$ac_ext
19479{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENETDOWN" >&5
19480$as_echo_n "checking for errno symbol ENETDOWN... " >&6; }
19481  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19482/* end confdefs.h.  */
19483#include <errno.h>
19484int
19485main ()
19486{
19487
19488#ifdef ENETDOWN
19489errnoval: ENETDOWN
19490#else
19491#error "errno value ENETDOWN not defined"
19492#endif
19493  ;
19494  return 0;
19495}
19496_ACEOF
19497if ac_fn_c_try_cpp "$LINENO"; then :
19498  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19499$as_echo "OK" >&6; }
19500        ERRNOVALS="$ERRNOVALS ENETDOWN"
19501        cat conftest.i | grep errnoval: >>$ERRVALFILE
19502else
19503  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19504$as_echo "no" >&6; }
19505fi
19506rm -f conftest.err conftest.i conftest.$ac_ext
19507{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENETRESET" >&5
19508$as_echo_n "checking for errno symbol ENETRESET... " >&6; }
19509  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19510/* end confdefs.h.  */
19511#include <errno.h>
19512int
19513main ()
19514{
19515
19516#ifdef ENETRESET
19517errnoval: ENETRESET
19518#else
19519#error "errno value ENETRESET not defined"
19520#endif
19521  ;
19522  return 0;
19523}
19524_ACEOF
19525if ac_fn_c_try_cpp "$LINENO"; then :
19526  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19527$as_echo "OK" >&6; }
19528        ERRNOVALS="$ERRNOVALS ENETRESET"
19529        cat conftest.i | grep errnoval: >>$ERRVALFILE
19530else
19531  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19532$as_echo "no" >&6; }
19533fi
19534rm -f conftest.err conftest.i conftest.$ac_ext
19535{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENETUNREACH" >&5
19536$as_echo_n "checking for errno symbol ENETUNREACH... " >&6; }
19537  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19538/* end confdefs.h.  */
19539#include <errno.h>
19540int
19541main ()
19542{
19543
19544#ifdef ENETUNREACH
19545errnoval: ENETUNREACH
19546#else
19547#error "errno value ENETUNREACH not defined"
19548#endif
19549  ;
19550  return 0;
19551}
19552_ACEOF
19553if ac_fn_c_try_cpp "$LINENO"; then :
19554  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19555$as_echo "OK" >&6; }
19556        ERRNOVALS="$ERRNOVALS ENETUNREACH"
19557        cat conftest.i | grep errnoval: >>$ERRVALFILE
19558else
19559  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19560$as_echo "no" >&6; }
19561fi
19562rm -f conftest.err conftest.i conftest.$ac_ext
19563{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENFILE" >&5
19564$as_echo_n "checking for errno symbol ENFILE... " >&6; }
19565  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19566/* end confdefs.h.  */
19567#include <errno.h>
19568int
19569main ()
19570{
19571
19572#ifdef ENFILE
19573errnoval: ENFILE
19574#else
19575#error "errno value ENFILE not defined"
19576#endif
19577  ;
19578  return 0;
19579}
19580_ACEOF
19581if ac_fn_c_try_cpp "$LINENO"; then :
19582  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19583$as_echo "OK" >&6; }
19584        ERRNOVALS="$ERRNOVALS ENFILE"
19585        cat conftest.i | grep errnoval: >>$ERRVALFILE
19586else
19587  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19588$as_echo "no" >&6; }
19589fi
19590rm -f conftest.err conftest.i conftest.$ac_ext
19591{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOANO" >&5
19592$as_echo_n "checking for errno symbol ENOANO... " >&6; }
19593  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19594/* end confdefs.h.  */
19595#include <errno.h>
19596int
19597main ()
19598{
19599
19600#ifdef ENOANO
19601errnoval: ENOANO
19602#else
19603#error "errno value ENOANO not defined"
19604#endif
19605  ;
19606  return 0;
19607}
19608_ACEOF
19609if ac_fn_c_try_cpp "$LINENO"; then :
19610  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19611$as_echo "OK" >&6; }
19612        ERRNOVALS="$ERRNOVALS ENOANO"
19613        cat conftest.i | grep errnoval: >>$ERRVALFILE
19614else
19615  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19616$as_echo "no" >&6; }
19617fi
19618rm -f conftest.err conftest.i conftest.$ac_ext
19619{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOATTR" >&5
19620$as_echo_n "checking for errno symbol ENOATTR... " >&6; }
19621  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19622/* end confdefs.h.  */
19623#include <errno.h>
19624int
19625main ()
19626{
19627
19628#ifdef ENOATTR
19629errnoval: ENOATTR
19630#else
19631#error "errno value ENOATTR not defined"
19632#endif
19633  ;
19634  return 0;
19635}
19636_ACEOF
19637if ac_fn_c_try_cpp "$LINENO"; then :
19638  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19639$as_echo "OK" >&6; }
19640        ERRNOVALS="$ERRNOVALS ENOATTR"
19641        cat conftest.i | grep errnoval: >>$ERRVALFILE
19642else
19643  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19644$as_echo "no" >&6; }
19645fi
19646rm -f conftest.err conftest.i conftest.$ac_ext
19647{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOBUFS" >&5
19648$as_echo_n "checking for errno symbol ENOBUFS... " >&6; }
19649  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19650/* end confdefs.h.  */
19651#include <errno.h>
19652int
19653main ()
19654{
19655
19656#ifdef ENOBUFS
19657errnoval: ENOBUFS
19658#else
19659#error "errno value ENOBUFS not defined"
19660#endif
19661  ;
19662  return 0;
19663}
19664_ACEOF
19665if ac_fn_c_try_cpp "$LINENO"; then :
19666  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19667$as_echo "OK" >&6; }
19668        ERRNOVALS="$ERRNOVALS ENOBUFS"
19669        cat conftest.i | grep errnoval: >>$ERRVALFILE
19670else
19671  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19672$as_echo "no" >&6; }
19673fi
19674rm -f conftest.err conftest.i conftest.$ac_ext
19675{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOCSI" >&5
19676$as_echo_n "checking for errno symbol ENOCSI... " >&6; }
19677  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19678/* end confdefs.h.  */
19679#include <errno.h>
19680int
19681main ()
19682{
19683
19684#ifdef ENOCSI
19685errnoval: ENOCSI
19686#else
19687#error "errno value ENOCSI not defined"
19688#endif
19689  ;
19690  return 0;
19691}
19692_ACEOF
19693if ac_fn_c_try_cpp "$LINENO"; then :
19694  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19695$as_echo "OK" >&6; }
19696        ERRNOVALS="$ERRNOVALS ENOCSI"
19697        cat conftest.i | grep errnoval: >>$ERRVALFILE
19698else
19699  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19700$as_echo "no" >&6; }
19701fi
19702rm -f conftest.err conftest.i conftest.$ac_ext
19703{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENODATA" >&5
19704$as_echo_n "checking for errno symbol ENODATA... " >&6; }
19705  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19706/* end confdefs.h.  */
19707#include <errno.h>
19708int
19709main ()
19710{
19711
19712#ifdef ENODATA
19713errnoval: ENODATA
19714#else
19715#error "errno value ENODATA not defined"
19716#endif
19717  ;
19718  return 0;
19719}
19720_ACEOF
19721if ac_fn_c_try_cpp "$LINENO"; then :
19722  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19723$as_echo "OK" >&6; }
19724        ERRNOVALS="$ERRNOVALS ENODATA"
19725        cat conftest.i | grep errnoval: >>$ERRVALFILE
19726else
19727  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19728$as_echo "no" >&6; }
19729fi
19730rm -f conftest.err conftest.i conftest.$ac_ext
19731{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENODEV" >&5
19732$as_echo_n "checking for errno symbol ENODEV... " >&6; }
19733  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19734/* end confdefs.h.  */
19735#include <errno.h>
19736int
19737main ()
19738{
19739
19740#ifdef ENODEV
19741errnoval: ENODEV
19742#else
19743#error "errno value ENODEV not defined"
19744#endif
19745  ;
19746  return 0;
19747}
19748_ACEOF
19749if ac_fn_c_try_cpp "$LINENO"; then :
19750  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19751$as_echo "OK" >&6; }
19752        ERRNOVALS="$ERRNOVALS ENODEV"
19753        cat conftest.i | grep errnoval: >>$ERRVALFILE
19754else
19755  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19756$as_echo "no" >&6; }
19757fi
19758rm -f conftest.err conftest.i conftest.$ac_ext
19759{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOENT" >&5
19760$as_echo_n "checking for errno symbol ENOENT... " >&6; }
19761  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19762/* end confdefs.h.  */
19763#include <errno.h>
19764int
19765main ()
19766{
19767
19768#ifdef ENOENT
19769errnoval: ENOENT
19770#else
19771#error "errno value ENOENT not defined"
19772#endif
19773  ;
19774  return 0;
19775}
19776_ACEOF
19777if ac_fn_c_try_cpp "$LINENO"; then :
19778  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19779$as_echo "OK" >&6; }
19780        ERRNOVALS="$ERRNOVALS ENOENT"
19781        cat conftest.i | grep errnoval: >>$ERRVALFILE
19782else
19783  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19784$as_echo "no" >&6; }
19785fi
19786rm -f conftest.err conftest.i conftest.$ac_ext
19787{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOEXEC" >&5
19788$as_echo_n "checking for errno symbol ENOEXEC... " >&6; }
19789  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19790/* end confdefs.h.  */
19791#include <errno.h>
19792int
19793main ()
19794{
19795
19796#ifdef ENOEXEC
19797errnoval: ENOEXEC
19798#else
19799#error "errno value ENOEXEC not defined"
19800#endif
19801  ;
19802  return 0;
19803}
19804_ACEOF
19805if ac_fn_c_try_cpp "$LINENO"; then :
19806  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19807$as_echo "OK" >&6; }
19808        ERRNOVALS="$ERRNOVALS ENOEXEC"
19809        cat conftest.i | grep errnoval: >>$ERRVALFILE
19810else
19811  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19812$as_echo "no" >&6; }
19813fi
19814rm -f conftest.err conftest.i conftest.$ac_ext
19815{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOIOCTL" >&5
19816$as_echo_n "checking for errno symbol ENOIOCTL... " >&6; }
19817  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19818/* end confdefs.h.  */
19819#include <errno.h>
19820int
19821main ()
19822{
19823
19824#ifdef ENOIOCTL
19825errnoval: ENOIOCTL
19826#else
19827#error "errno value ENOIOCTL not defined"
19828#endif
19829  ;
19830  return 0;
19831}
19832_ACEOF
19833if ac_fn_c_try_cpp "$LINENO"; then :
19834  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19835$as_echo "OK" >&6; }
19836        ERRNOVALS="$ERRNOVALS ENOIOCTL"
19837        cat conftest.i | grep errnoval: >>$ERRVALFILE
19838else
19839  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19840$as_echo "no" >&6; }
19841fi
19842rm -f conftest.err conftest.i conftest.$ac_ext
19843{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOLCK" >&5
19844$as_echo_n "checking for errno symbol ENOLCK... " >&6; }
19845  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19846/* end confdefs.h.  */
19847#include <errno.h>
19848int
19849main ()
19850{
19851
19852#ifdef ENOLCK
19853errnoval: ENOLCK
19854#else
19855#error "errno value ENOLCK not defined"
19856#endif
19857  ;
19858  return 0;
19859}
19860_ACEOF
19861if ac_fn_c_try_cpp "$LINENO"; then :
19862  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19863$as_echo "OK" >&6; }
19864        ERRNOVALS="$ERRNOVALS ENOLCK"
19865        cat conftest.i | grep errnoval: >>$ERRVALFILE
19866else
19867  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19868$as_echo "no" >&6; }
19869fi
19870rm -f conftest.err conftest.i conftest.$ac_ext
19871{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOLINK" >&5
19872$as_echo_n "checking for errno symbol ENOLINK... " >&6; }
19873  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19874/* end confdefs.h.  */
19875#include <errno.h>
19876int
19877main ()
19878{
19879
19880#ifdef ENOLINK
19881errnoval: ENOLINK
19882#else
19883#error "errno value ENOLINK not defined"
19884#endif
19885  ;
19886  return 0;
19887}
19888_ACEOF
19889if ac_fn_c_try_cpp "$LINENO"; then :
19890  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19891$as_echo "OK" >&6; }
19892        ERRNOVALS="$ERRNOVALS ENOLINK"
19893        cat conftest.i | grep errnoval: >>$ERRVALFILE
19894else
19895  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19896$as_echo "no" >&6; }
19897fi
19898rm -f conftest.err conftest.i conftest.$ac_ext
19899{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOMEDIUM" >&5
19900$as_echo_n "checking for errno symbol ENOMEDIUM... " >&6; }
19901  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19902/* end confdefs.h.  */
19903#include <errno.h>
19904int
19905main ()
19906{
19907
19908#ifdef ENOMEDIUM
19909errnoval: ENOMEDIUM
19910#else
19911#error "errno value ENOMEDIUM not defined"
19912#endif
19913  ;
19914  return 0;
19915}
19916_ACEOF
19917if ac_fn_c_try_cpp "$LINENO"; then :
19918  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19919$as_echo "OK" >&6; }
19920        ERRNOVALS="$ERRNOVALS ENOMEDIUM"
19921        cat conftest.i | grep errnoval: >>$ERRVALFILE
19922else
19923  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19924$as_echo "no" >&6; }
19925fi
19926rm -f conftest.err conftest.i conftest.$ac_ext
19927{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOMEM" >&5
19928$as_echo_n "checking for errno symbol ENOMEM... " >&6; }
19929  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19930/* end confdefs.h.  */
19931#include <errno.h>
19932int
19933main ()
19934{
19935
19936#ifdef ENOMEM
19937errnoval: ENOMEM
19938#else
19939#error "errno value ENOMEM not defined"
19940#endif
19941  ;
19942  return 0;
19943}
19944_ACEOF
19945if ac_fn_c_try_cpp "$LINENO"; then :
19946  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19947$as_echo "OK" >&6; }
19948        ERRNOVALS="$ERRNOVALS ENOMEM"
19949        cat conftest.i | grep errnoval: >>$ERRVALFILE
19950else
19951  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19952$as_echo "no" >&6; }
19953fi
19954rm -f conftest.err conftest.i conftest.$ac_ext
19955{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOMSG" >&5
19956$as_echo_n "checking for errno symbol ENOMSG... " >&6; }
19957  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19958/* end confdefs.h.  */
19959#include <errno.h>
19960int
19961main ()
19962{
19963
19964#ifdef ENOMSG
19965errnoval: ENOMSG
19966#else
19967#error "errno value ENOMSG not defined"
19968#endif
19969  ;
19970  return 0;
19971}
19972_ACEOF
19973if ac_fn_c_try_cpp "$LINENO"; then :
19974  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
19975$as_echo "OK" >&6; }
19976        ERRNOVALS="$ERRNOVALS ENOMSG"
19977        cat conftest.i | grep errnoval: >>$ERRVALFILE
19978else
19979  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19980$as_echo "no" >&6; }
19981fi
19982rm -f conftest.err conftest.i conftest.$ac_ext
19983{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENONET" >&5
19984$as_echo_n "checking for errno symbol ENONET... " >&6; }
19985  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
19986/* end confdefs.h.  */
19987#include <errno.h>
19988int
19989main ()
19990{
19991
19992#ifdef ENONET
19993errnoval: ENONET
19994#else
19995#error "errno value ENONET not defined"
19996#endif
19997  ;
19998  return 0;
19999}
20000_ACEOF
20001if ac_fn_c_try_cpp "$LINENO"; then :
20002  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20003$as_echo "OK" >&6; }
20004        ERRNOVALS="$ERRNOVALS ENONET"
20005        cat conftest.i | grep errnoval: >>$ERRVALFILE
20006else
20007  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20008$as_echo "no" >&6; }
20009fi
20010rm -f conftest.err conftest.i conftest.$ac_ext
20011{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOPKG" >&5
20012$as_echo_n "checking for errno symbol ENOPKG... " >&6; }
20013  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20014/* end confdefs.h.  */
20015#include <errno.h>
20016int
20017main ()
20018{
20019
20020#ifdef ENOPKG
20021errnoval: ENOPKG
20022#else
20023#error "errno value ENOPKG not defined"
20024#endif
20025  ;
20026  return 0;
20027}
20028_ACEOF
20029if ac_fn_c_try_cpp "$LINENO"; then :
20030  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20031$as_echo "OK" >&6; }
20032        ERRNOVALS="$ERRNOVALS ENOPKG"
20033        cat conftest.i | grep errnoval: >>$ERRVALFILE
20034else
20035  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20036$as_echo "no" >&6; }
20037fi
20038rm -f conftest.err conftest.i conftest.$ac_ext
20039{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOPOLICY" >&5
20040$as_echo_n "checking for errno symbol ENOPOLICY... " >&6; }
20041  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20042/* end confdefs.h.  */
20043#include <errno.h>
20044int
20045main ()
20046{
20047
20048#ifdef ENOPOLICY
20049errnoval: ENOPOLICY
20050#else
20051#error "errno value ENOPOLICY not defined"
20052#endif
20053  ;
20054  return 0;
20055}
20056_ACEOF
20057if ac_fn_c_try_cpp "$LINENO"; then :
20058  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20059$as_echo "OK" >&6; }
20060        ERRNOVALS="$ERRNOVALS ENOPOLICY"
20061        cat conftest.i | grep errnoval: >>$ERRVALFILE
20062else
20063  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20064$as_echo "no" >&6; }
20065fi
20066rm -f conftest.err conftest.i conftest.$ac_ext
20067{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOPROTOOPT" >&5
20068$as_echo_n "checking for errno symbol ENOPROTOOPT... " >&6; }
20069  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20070/* end confdefs.h.  */
20071#include <errno.h>
20072int
20073main ()
20074{
20075
20076#ifdef ENOPROTOOPT
20077errnoval: ENOPROTOOPT
20078#else
20079#error "errno value ENOPROTOOPT not defined"
20080#endif
20081  ;
20082  return 0;
20083}
20084_ACEOF
20085if ac_fn_c_try_cpp "$LINENO"; then :
20086  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20087$as_echo "OK" >&6; }
20088        ERRNOVALS="$ERRNOVALS ENOPROTOOPT"
20089        cat conftest.i | grep errnoval: >>$ERRVALFILE
20090else
20091  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20092$as_echo "no" >&6; }
20093fi
20094rm -f conftest.err conftest.i conftest.$ac_ext
20095{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOSPC" >&5
20096$as_echo_n "checking for errno symbol ENOSPC... " >&6; }
20097  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20098/* end confdefs.h.  */
20099#include <errno.h>
20100int
20101main ()
20102{
20103
20104#ifdef ENOSPC
20105errnoval: ENOSPC
20106#else
20107#error "errno value ENOSPC not defined"
20108#endif
20109  ;
20110  return 0;
20111}
20112_ACEOF
20113if ac_fn_c_try_cpp "$LINENO"; then :
20114  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20115$as_echo "OK" >&6; }
20116        ERRNOVALS="$ERRNOVALS ENOSPC"
20117        cat conftest.i | grep errnoval: >>$ERRVALFILE
20118else
20119  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20120$as_echo "no" >&6; }
20121fi
20122rm -f conftest.err conftest.i conftest.$ac_ext
20123{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOSR" >&5
20124$as_echo_n "checking for errno symbol ENOSR... " >&6; }
20125  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20126/* end confdefs.h.  */
20127#include <errno.h>
20128int
20129main ()
20130{
20131
20132#ifdef ENOSR
20133errnoval: ENOSR
20134#else
20135#error "errno value ENOSR not defined"
20136#endif
20137  ;
20138  return 0;
20139}
20140_ACEOF
20141if ac_fn_c_try_cpp "$LINENO"; then :
20142  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20143$as_echo "OK" >&6; }
20144        ERRNOVALS="$ERRNOVALS ENOSR"
20145        cat conftest.i | grep errnoval: >>$ERRVALFILE
20146else
20147  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20148$as_echo "no" >&6; }
20149fi
20150rm -f conftest.err conftest.i conftest.$ac_ext
20151{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOSTR" >&5
20152$as_echo_n "checking for errno symbol ENOSTR... " >&6; }
20153  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20154/* end confdefs.h.  */
20155#include <errno.h>
20156int
20157main ()
20158{
20159
20160#ifdef ENOSTR
20161errnoval: ENOSTR
20162#else
20163#error "errno value ENOSTR not defined"
20164#endif
20165  ;
20166  return 0;
20167}
20168_ACEOF
20169if ac_fn_c_try_cpp "$LINENO"; then :
20170  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20171$as_echo "OK" >&6; }
20172        ERRNOVALS="$ERRNOVALS ENOSTR"
20173        cat conftest.i | grep errnoval: >>$ERRVALFILE
20174else
20175  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20176$as_echo "no" >&6; }
20177fi
20178rm -f conftest.err conftest.i conftest.$ac_ext
20179{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOSYS" >&5
20180$as_echo_n "checking for errno symbol ENOSYS... " >&6; }
20181  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20182/* end confdefs.h.  */
20183#include <errno.h>
20184int
20185main ()
20186{
20187
20188#ifdef ENOSYS
20189errnoval: ENOSYS
20190#else
20191#error "errno value ENOSYS not defined"
20192#endif
20193  ;
20194  return 0;
20195}
20196_ACEOF
20197if ac_fn_c_try_cpp "$LINENO"; then :
20198  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20199$as_echo "OK" >&6; }
20200        ERRNOVALS="$ERRNOVALS ENOSYS"
20201        cat conftest.i | grep errnoval: >>$ERRVALFILE
20202else
20203  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20204$as_echo "no" >&6; }
20205fi
20206rm -f conftest.err conftest.i conftest.$ac_ext
20207{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTACTIVE" >&5
20208$as_echo_n "checking for errno symbol ENOTACTIVE... " >&6; }
20209  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20210/* end confdefs.h.  */
20211#include <errno.h>
20212int
20213main ()
20214{
20215
20216#ifdef ENOTACTIVE
20217errnoval: ENOTACTIVE
20218#else
20219#error "errno value ENOTACTIVE not defined"
20220#endif
20221  ;
20222  return 0;
20223}
20224_ACEOF
20225if ac_fn_c_try_cpp "$LINENO"; then :
20226  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20227$as_echo "OK" >&6; }
20228        ERRNOVALS="$ERRNOVALS ENOTACTIVE"
20229        cat conftest.i | grep errnoval: >>$ERRVALFILE
20230else
20231  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20232$as_echo "no" >&6; }
20233fi
20234rm -f conftest.err conftest.i conftest.$ac_ext
20235{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTBLK" >&5
20236$as_echo_n "checking for errno symbol ENOTBLK... " >&6; }
20237  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20238/* end confdefs.h.  */
20239#include <errno.h>
20240int
20241main ()
20242{
20243
20244#ifdef ENOTBLK
20245errnoval: ENOTBLK
20246#else
20247#error "errno value ENOTBLK not defined"
20248#endif
20249  ;
20250  return 0;
20251}
20252_ACEOF
20253if ac_fn_c_try_cpp "$LINENO"; then :
20254  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20255$as_echo "OK" >&6; }
20256        ERRNOVALS="$ERRNOVALS ENOTBLK"
20257        cat conftest.i | grep errnoval: >>$ERRVALFILE
20258else
20259  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20260$as_echo "no" >&6; }
20261fi
20262rm -f conftest.err conftest.i conftest.$ac_ext
20263{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTCAPABLE" >&5
20264$as_echo_n "checking for errno symbol ENOTCAPABLE... " >&6; }
20265  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20266/* end confdefs.h.  */
20267#include <errno.h>
20268int
20269main ()
20270{
20271
20272#ifdef ENOTCAPABLE
20273errnoval: ENOTCAPABLE
20274#else
20275#error "errno value ENOTCAPABLE not defined"
20276#endif
20277  ;
20278  return 0;
20279}
20280_ACEOF
20281if ac_fn_c_try_cpp "$LINENO"; then :
20282  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20283$as_echo "OK" >&6; }
20284        ERRNOVALS="$ERRNOVALS ENOTCAPABLE"
20285        cat conftest.i | grep errnoval: >>$ERRVALFILE
20286else
20287  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20288$as_echo "no" >&6; }
20289fi
20290rm -f conftest.err conftest.i conftest.$ac_ext
20291{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTCONN" >&5
20292$as_echo_n "checking for errno symbol ENOTCONN... " >&6; }
20293  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20294/* end confdefs.h.  */
20295#include <errno.h>
20296int
20297main ()
20298{
20299
20300#ifdef ENOTCONN
20301errnoval: ENOTCONN
20302#else
20303#error "errno value ENOTCONN not defined"
20304#endif
20305  ;
20306  return 0;
20307}
20308_ACEOF
20309if ac_fn_c_try_cpp "$LINENO"; then :
20310  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20311$as_echo "OK" >&6; }
20312        ERRNOVALS="$ERRNOVALS ENOTCONN"
20313        cat conftest.i | grep errnoval: >>$ERRVALFILE
20314else
20315  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20316$as_echo "no" >&6; }
20317fi
20318rm -f conftest.err conftest.i conftest.$ac_ext
20319{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTDIR" >&5
20320$as_echo_n "checking for errno symbol ENOTDIR... " >&6; }
20321  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20322/* end confdefs.h.  */
20323#include <errno.h>
20324int
20325main ()
20326{
20327
20328#ifdef ENOTDIR
20329errnoval: ENOTDIR
20330#else
20331#error "errno value ENOTDIR not defined"
20332#endif
20333  ;
20334  return 0;
20335}
20336_ACEOF
20337if ac_fn_c_try_cpp "$LINENO"; then :
20338  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20339$as_echo "OK" >&6; }
20340        ERRNOVALS="$ERRNOVALS ENOTDIR"
20341        cat conftest.i | grep errnoval: >>$ERRVALFILE
20342else
20343  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20344$as_echo "no" >&6; }
20345fi
20346rm -f conftest.err conftest.i conftest.$ac_ext
20347{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTEMPTY" >&5
20348$as_echo_n "checking for errno symbol ENOTEMPTY... " >&6; }
20349  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20350/* end confdefs.h.  */
20351#include <errno.h>
20352int
20353main ()
20354{
20355
20356#ifdef ENOTEMPTY
20357errnoval: ENOTEMPTY
20358#else
20359#error "errno value ENOTEMPTY not defined"
20360#endif
20361  ;
20362  return 0;
20363}
20364_ACEOF
20365if ac_fn_c_try_cpp "$LINENO"; then :
20366  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20367$as_echo "OK" >&6; }
20368        ERRNOVALS="$ERRNOVALS ENOTEMPTY"
20369        cat conftest.i | grep errnoval: >>$ERRVALFILE
20370else
20371  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20372$as_echo "no" >&6; }
20373fi
20374rm -f conftest.err conftest.i conftest.$ac_ext
20375{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTRECOVERABLE" >&5
20376$as_echo_n "checking for errno symbol ENOTRECOVERABLE... " >&6; }
20377  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20378/* end confdefs.h.  */
20379#include <errno.h>
20380int
20381main ()
20382{
20383
20384#ifdef ENOTRECOVERABLE
20385errnoval: ENOTRECOVERABLE
20386#else
20387#error "errno value ENOTRECOVERABLE not defined"
20388#endif
20389  ;
20390  return 0;
20391}
20392_ACEOF
20393if ac_fn_c_try_cpp "$LINENO"; then :
20394  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20395$as_echo "OK" >&6; }
20396        ERRNOVALS="$ERRNOVALS ENOTRECOVERABLE"
20397        cat conftest.i | grep errnoval: >>$ERRVALFILE
20398else
20399  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20400$as_echo "no" >&6; }
20401fi
20402rm -f conftest.err conftest.i conftest.$ac_ext
20403{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTSOCK" >&5
20404$as_echo_n "checking for errno symbol ENOTSOCK... " >&6; }
20405  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20406/* end confdefs.h.  */
20407#include <errno.h>
20408int
20409main ()
20410{
20411
20412#ifdef ENOTSOCK
20413errnoval: ENOTSOCK
20414#else
20415#error "errno value ENOTSOCK not defined"
20416#endif
20417  ;
20418  return 0;
20419}
20420_ACEOF
20421if ac_fn_c_try_cpp "$LINENO"; then :
20422  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20423$as_echo "OK" >&6; }
20424        ERRNOVALS="$ERRNOVALS ENOTSOCK"
20425        cat conftest.i | grep errnoval: >>$ERRVALFILE
20426else
20427  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20428$as_echo "no" >&6; }
20429fi
20430rm -f conftest.err conftest.i conftest.$ac_ext
20431{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTSUP" >&5
20432$as_echo_n "checking for errno symbol ENOTSUP... " >&6; }
20433  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20434/* end confdefs.h.  */
20435#include <errno.h>
20436int
20437main ()
20438{
20439
20440#ifdef ENOTSUP
20441errnoval: ENOTSUP
20442#else
20443#error "errno value ENOTSUP not defined"
20444#endif
20445  ;
20446  return 0;
20447}
20448_ACEOF
20449if ac_fn_c_try_cpp "$LINENO"; then :
20450  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20451$as_echo "OK" >&6; }
20452        ERRNOVALS="$ERRNOVALS ENOTSUP"
20453        cat conftest.i | grep errnoval: >>$ERRVALFILE
20454else
20455  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20456$as_echo "no" >&6; }
20457fi
20458rm -f conftest.err conftest.i conftest.$ac_ext
20459{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTTY" >&5
20460$as_echo_n "checking for errno symbol ENOTTY... " >&6; }
20461  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20462/* end confdefs.h.  */
20463#include <errno.h>
20464int
20465main ()
20466{
20467
20468#ifdef ENOTTY
20469errnoval: ENOTTY
20470#else
20471#error "errno value ENOTTY not defined"
20472#endif
20473  ;
20474  return 0;
20475}
20476_ACEOF
20477if ac_fn_c_try_cpp "$LINENO"; then :
20478  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20479$as_echo "OK" >&6; }
20480        ERRNOVALS="$ERRNOVALS ENOTTY"
20481        cat conftest.i | grep errnoval: >>$ERRVALFILE
20482else
20483  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20484$as_echo "no" >&6; }
20485fi
20486rm -f conftest.err conftest.i conftest.$ac_ext
20487{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTUNIQ" >&5
20488$as_echo_n "checking for errno symbol ENOTUNIQ... " >&6; }
20489  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20490/* end confdefs.h.  */
20491#include <errno.h>
20492int
20493main ()
20494{
20495
20496#ifdef ENOTUNIQ
20497errnoval: ENOTUNIQ
20498#else
20499#error "errno value ENOTUNIQ not defined"
20500#endif
20501  ;
20502  return 0;
20503}
20504_ACEOF
20505if ac_fn_c_try_cpp "$LINENO"; then :
20506  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20507$as_echo "OK" >&6; }
20508        ERRNOVALS="$ERRNOVALS ENOTUNIQ"
20509        cat conftest.i | grep errnoval: >>$ERRVALFILE
20510else
20511  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20512$as_echo "no" >&6; }
20513fi
20514rm -f conftest.err conftest.i conftest.$ac_ext
20515{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENXIO" >&5
20516$as_echo_n "checking for errno symbol ENXIO... " >&6; }
20517  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20518/* end confdefs.h.  */
20519#include <errno.h>
20520int
20521main ()
20522{
20523
20524#ifdef ENXIO
20525errnoval: ENXIO
20526#else
20527#error "errno value ENXIO not defined"
20528#endif
20529  ;
20530  return 0;
20531}
20532_ACEOF
20533if ac_fn_c_try_cpp "$LINENO"; then :
20534  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20535$as_echo "OK" >&6; }
20536        ERRNOVALS="$ERRNOVALS ENXIO"
20537        cat conftest.i | grep errnoval: >>$ERRVALFILE
20538else
20539  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20540$as_echo "no" >&6; }
20541fi
20542rm -f conftest.err conftest.i conftest.$ac_ext
20543{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EOPNOTSUPP" >&5
20544$as_echo_n "checking for errno symbol EOPNOTSUPP... " >&6; }
20545  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20546/* end confdefs.h.  */
20547#include <errno.h>
20548int
20549main ()
20550{
20551
20552#ifdef EOPNOTSUPP
20553errnoval: EOPNOTSUPP
20554#else
20555#error "errno value EOPNOTSUPP not defined"
20556#endif
20557  ;
20558  return 0;
20559}
20560_ACEOF
20561if ac_fn_c_try_cpp "$LINENO"; then :
20562  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20563$as_echo "OK" >&6; }
20564        ERRNOVALS="$ERRNOVALS EOPNOTSUPP"
20565        cat conftest.i | grep errnoval: >>$ERRVALFILE
20566else
20567  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20568$as_echo "no" >&6; }
20569fi
20570rm -f conftest.err conftest.i conftest.$ac_ext
20571{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EOVERFLOW" >&5
20572$as_echo_n "checking for errno symbol EOVERFLOW... " >&6; }
20573  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20574/* end confdefs.h.  */
20575#include <errno.h>
20576int
20577main ()
20578{
20579
20580#ifdef EOVERFLOW
20581errnoval: EOVERFLOW
20582#else
20583#error "errno value EOVERFLOW not defined"
20584#endif
20585  ;
20586  return 0;
20587}
20588_ACEOF
20589if ac_fn_c_try_cpp "$LINENO"; then :
20590  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20591$as_echo "OK" >&6; }
20592        ERRNOVALS="$ERRNOVALS EOVERFLOW"
20593        cat conftest.i | grep errnoval: >>$ERRVALFILE
20594else
20595  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20596$as_echo "no" >&6; }
20597fi
20598rm -f conftest.err conftest.i conftest.$ac_ext
20599{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EOWNERDEAD" >&5
20600$as_echo_n "checking for errno symbol EOWNERDEAD... " >&6; }
20601  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20602/* end confdefs.h.  */
20603#include <errno.h>
20604int
20605main ()
20606{
20607
20608#ifdef EOWNERDEAD
20609errnoval: EOWNERDEAD
20610#else
20611#error "errno value EOWNERDEAD not defined"
20612#endif
20613  ;
20614  return 0;
20615}
20616_ACEOF
20617if ac_fn_c_try_cpp "$LINENO"; then :
20618  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20619$as_echo "OK" >&6; }
20620        ERRNOVALS="$ERRNOVALS EOWNERDEAD"
20621        cat conftest.i | grep errnoval: >>$ERRVALFILE
20622else
20623  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20624$as_echo "no" >&6; }
20625fi
20626rm -f conftest.err conftest.i conftest.$ac_ext
20627{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPERM" >&5
20628$as_echo_n "checking for errno symbol EPERM... " >&6; }
20629  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20630/* end confdefs.h.  */
20631#include <errno.h>
20632int
20633main ()
20634{
20635
20636#ifdef EPERM
20637errnoval: EPERM
20638#else
20639#error "errno value EPERM not defined"
20640#endif
20641  ;
20642  return 0;
20643}
20644_ACEOF
20645if ac_fn_c_try_cpp "$LINENO"; then :
20646  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20647$as_echo "OK" >&6; }
20648        ERRNOVALS="$ERRNOVALS EPERM"
20649        cat conftest.i | grep errnoval: >>$ERRVALFILE
20650else
20651  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20652$as_echo "no" >&6; }
20653fi
20654rm -f conftest.err conftest.i conftest.$ac_ext
20655{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPFNOSUPPORT" >&5
20656$as_echo_n "checking for errno symbol EPFNOSUPPORT... " >&6; }
20657  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20658/* end confdefs.h.  */
20659#include <errno.h>
20660int
20661main ()
20662{
20663
20664#ifdef EPFNOSUPPORT
20665errnoval: EPFNOSUPPORT
20666#else
20667#error "errno value EPFNOSUPPORT not defined"
20668#endif
20669  ;
20670  return 0;
20671}
20672_ACEOF
20673if ac_fn_c_try_cpp "$LINENO"; then :
20674  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20675$as_echo "OK" >&6; }
20676        ERRNOVALS="$ERRNOVALS EPFNOSUPPORT"
20677        cat conftest.i | grep errnoval: >>$ERRVALFILE
20678else
20679  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20680$as_echo "no" >&6; }
20681fi
20682rm -f conftest.err conftest.i conftest.$ac_ext
20683{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPIPE" >&5
20684$as_echo_n "checking for errno symbol EPIPE... " >&6; }
20685  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20686/* end confdefs.h.  */
20687#include <errno.h>
20688int
20689main ()
20690{
20691
20692#ifdef EPIPE
20693errnoval: EPIPE
20694#else
20695#error "errno value EPIPE not defined"
20696#endif
20697  ;
20698  return 0;
20699}
20700_ACEOF
20701if ac_fn_c_try_cpp "$LINENO"; then :
20702  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20703$as_echo "OK" >&6; }
20704        ERRNOVALS="$ERRNOVALS EPIPE"
20705        cat conftest.i | grep errnoval: >>$ERRVALFILE
20706else
20707  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20708$as_echo "no" >&6; }
20709fi
20710rm -f conftest.err conftest.i conftest.$ac_ext
20711{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROCLIM" >&5
20712$as_echo_n "checking for errno symbol EPROCLIM... " >&6; }
20713  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20714/* end confdefs.h.  */
20715#include <errno.h>
20716int
20717main ()
20718{
20719
20720#ifdef EPROCLIM
20721errnoval: EPROCLIM
20722#else
20723#error "errno value EPROCLIM not defined"
20724#endif
20725  ;
20726  return 0;
20727}
20728_ACEOF
20729if ac_fn_c_try_cpp "$LINENO"; then :
20730  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20731$as_echo "OK" >&6; }
20732        ERRNOVALS="$ERRNOVALS EPROCLIM"
20733        cat conftest.i | grep errnoval: >>$ERRVALFILE
20734else
20735  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20736$as_echo "no" >&6; }
20737fi
20738rm -f conftest.err conftest.i conftest.$ac_ext
20739{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROCUNAVAIL" >&5
20740$as_echo_n "checking for errno symbol EPROCUNAVAIL... " >&6; }
20741  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20742/* end confdefs.h.  */
20743#include <errno.h>
20744int
20745main ()
20746{
20747
20748#ifdef EPROCUNAVAIL
20749errnoval: EPROCUNAVAIL
20750#else
20751#error "errno value EPROCUNAVAIL not defined"
20752#endif
20753  ;
20754  return 0;
20755}
20756_ACEOF
20757if ac_fn_c_try_cpp "$LINENO"; then :
20758  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20759$as_echo "OK" >&6; }
20760        ERRNOVALS="$ERRNOVALS EPROCUNAVAIL"
20761        cat conftest.i | grep errnoval: >>$ERRVALFILE
20762else
20763  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20764$as_echo "no" >&6; }
20765fi
20766rm -f conftest.err conftest.i conftest.$ac_ext
20767{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROGMISMATCH" >&5
20768$as_echo_n "checking for errno symbol EPROGMISMATCH... " >&6; }
20769  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20770/* end confdefs.h.  */
20771#include <errno.h>
20772int
20773main ()
20774{
20775
20776#ifdef EPROGMISMATCH
20777errnoval: EPROGMISMATCH
20778#else
20779#error "errno value EPROGMISMATCH not defined"
20780#endif
20781  ;
20782  return 0;
20783}
20784_ACEOF
20785if ac_fn_c_try_cpp "$LINENO"; then :
20786  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20787$as_echo "OK" >&6; }
20788        ERRNOVALS="$ERRNOVALS EPROGMISMATCH"
20789        cat conftest.i | grep errnoval: >>$ERRVALFILE
20790else
20791  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20792$as_echo "no" >&6; }
20793fi
20794rm -f conftest.err conftest.i conftest.$ac_ext
20795{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROGUNAVAIL" >&5
20796$as_echo_n "checking for errno symbol EPROGUNAVAIL... " >&6; }
20797  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20798/* end confdefs.h.  */
20799#include <errno.h>
20800int
20801main ()
20802{
20803
20804#ifdef EPROGUNAVAIL
20805errnoval: EPROGUNAVAIL
20806#else
20807#error "errno value EPROGUNAVAIL not defined"
20808#endif
20809  ;
20810  return 0;
20811}
20812_ACEOF
20813if ac_fn_c_try_cpp "$LINENO"; then :
20814  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20815$as_echo "OK" >&6; }
20816        ERRNOVALS="$ERRNOVALS EPROGUNAVAIL"
20817        cat conftest.i | grep errnoval: >>$ERRVALFILE
20818else
20819  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20820$as_echo "no" >&6; }
20821fi
20822rm -f conftest.err conftest.i conftest.$ac_ext
20823{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROTO" >&5
20824$as_echo_n "checking for errno symbol EPROTO... " >&6; }
20825  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20826/* end confdefs.h.  */
20827#include <errno.h>
20828int
20829main ()
20830{
20831
20832#ifdef EPROTO
20833errnoval: EPROTO
20834#else
20835#error "errno value EPROTO not defined"
20836#endif
20837  ;
20838  return 0;
20839}
20840_ACEOF
20841if ac_fn_c_try_cpp "$LINENO"; then :
20842  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20843$as_echo "OK" >&6; }
20844        ERRNOVALS="$ERRNOVALS EPROTO"
20845        cat conftest.i | grep errnoval: >>$ERRVALFILE
20846else
20847  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20848$as_echo "no" >&6; }
20849fi
20850rm -f conftest.err conftest.i conftest.$ac_ext
20851{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROTONOSUPPORT" >&5
20852$as_echo_n "checking for errno symbol EPROTONOSUPPORT... " >&6; }
20853  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20854/* end confdefs.h.  */
20855#include <errno.h>
20856int
20857main ()
20858{
20859
20860#ifdef EPROTONOSUPPORT
20861errnoval: EPROTONOSUPPORT
20862#else
20863#error "errno value EPROTONOSUPPORT not defined"
20864#endif
20865  ;
20866  return 0;
20867}
20868_ACEOF
20869if ac_fn_c_try_cpp "$LINENO"; then :
20870  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20871$as_echo "OK" >&6; }
20872        ERRNOVALS="$ERRNOVALS EPROTONOSUPPORT"
20873        cat conftest.i | grep errnoval: >>$ERRVALFILE
20874else
20875  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20876$as_echo "no" >&6; }
20877fi
20878rm -f conftest.err conftest.i conftest.$ac_ext
20879{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPROTOTYPE" >&5
20880$as_echo_n "checking for errno symbol EPROTOTYPE... " >&6; }
20881  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20882/* end confdefs.h.  */
20883#include <errno.h>
20884int
20885main ()
20886{
20887
20888#ifdef EPROTOTYPE
20889errnoval: EPROTOTYPE
20890#else
20891#error "errno value EPROTOTYPE not defined"
20892#endif
20893  ;
20894  return 0;
20895}
20896_ACEOF
20897if ac_fn_c_try_cpp "$LINENO"; then :
20898  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20899$as_echo "OK" >&6; }
20900        ERRNOVALS="$ERRNOVALS EPROTOTYPE"
20901        cat conftest.i | grep errnoval: >>$ERRVALFILE
20902else
20903  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20904$as_echo "no" >&6; }
20905fi
20906rm -f conftest.err conftest.i conftest.$ac_ext
20907{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EPWROFF" >&5
20908$as_echo_n "checking for errno symbol EPWROFF... " >&6; }
20909  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20910/* end confdefs.h.  */
20911#include <errno.h>
20912int
20913main ()
20914{
20915
20916#ifdef EPWROFF
20917errnoval: EPWROFF
20918#else
20919#error "errno value EPWROFF not defined"
20920#endif
20921  ;
20922  return 0;
20923}
20924_ACEOF
20925if ac_fn_c_try_cpp "$LINENO"; then :
20926  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20927$as_echo "OK" >&6; }
20928        ERRNOVALS="$ERRNOVALS EPWROFF"
20929        cat conftest.i | grep errnoval: >>$ERRVALFILE
20930else
20931  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20932$as_echo "no" >&6; }
20933fi
20934rm -f conftest.err conftest.i conftest.$ac_ext
20935{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ERANGE" >&5
20936$as_echo_n "checking for errno symbol ERANGE... " >&6; }
20937  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20938/* end confdefs.h.  */
20939#include <errno.h>
20940int
20941main ()
20942{
20943
20944#ifdef ERANGE
20945errnoval: ERANGE
20946#else
20947#error "errno value ERANGE not defined"
20948#endif
20949  ;
20950  return 0;
20951}
20952_ACEOF
20953if ac_fn_c_try_cpp "$LINENO"; then :
20954  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20955$as_echo "OK" >&6; }
20956        ERRNOVALS="$ERRNOVALS ERANGE"
20957        cat conftest.i | grep errnoval: >>$ERRVALFILE
20958else
20959  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20960$as_echo "no" >&6; }
20961fi
20962rm -f conftest.err conftest.i conftest.$ac_ext
20963{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EREMCHG" >&5
20964$as_echo_n "checking for errno symbol EREMCHG... " >&6; }
20965  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20966/* end confdefs.h.  */
20967#include <errno.h>
20968int
20969main ()
20970{
20971
20972#ifdef EREMCHG
20973errnoval: EREMCHG
20974#else
20975#error "errno value EREMCHG not defined"
20976#endif
20977  ;
20978  return 0;
20979}
20980_ACEOF
20981if ac_fn_c_try_cpp "$LINENO"; then :
20982  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
20983$as_echo "OK" >&6; }
20984        ERRNOVALS="$ERRNOVALS EREMCHG"
20985        cat conftest.i | grep errnoval: >>$ERRVALFILE
20986else
20987  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
20988$as_echo "no" >&6; }
20989fi
20990rm -f conftest.err conftest.i conftest.$ac_ext
20991{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EREMOTE" >&5
20992$as_echo_n "checking for errno symbol EREMOTE... " >&6; }
20993  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
20994/* end confdefs.h.  */
20995#include <errno.h>
20996int
20997main ()
20998{
20999
21000#ifdef EREMOTE
21001errnoval: EREMOTE
21002#else
21003#error "errno value EREMOTE not defined"
21004#endif
21005  ;
21006  return 0;
21007}
21008_ACEOF
21009if ac_fn_c_try_cpp "$LINENO"; then :
21010  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21011$as_echo "OK" >&6; }
21012        ERRNOVALS="$ERRNOVALS EREMOTE"
21013        cat conftest.i | grep errnoval: >>$ERRVALFILE
21014else
21015  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21016$as_echo "no" >&6; }
21017fi
21018rm -f conftest.err conftest.i conftest.$ac_ext
21019{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ERESTART" >&5
21020$as_echo_n "checking for errno symbol ERESTART... " >&6; }
21021  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21022/* end confdefs.h.  */
21023#include <errno.h>
21024int
21025main ()
21026{
21027
21028#ifdef ERESTART
21029errnoval: ERESTART
21030#else
21031#error "errno value ERESTART not defined"
21032#endif
21033  ;
21034  return 0;
21035}
21036_ACEOF
21037if ac_fn_c_try_cpp "$LINENO"; then :
21038  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21039$as_echo "OK" >&6; }
21040        ERRNOVALS="$ERRNOVALS ERESTART"
21041        cat conftest.i | grep errnoval: >>$ERRVALFILE
21042else
21043  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21044$as_echo "no" >&6; }
21045fi
21046rm -f conftest.err conftest.i conftest.$ac_ext
21047{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EROFS" >&5
21048$as_echo_n "checking for errno symbol EROFS... " >&6; }
21049  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21050/* end confdefs.h.  */
21051#include <errno.h>
21052int
21053main ()
21054{
21055
21056#ifdef EROFS
21057errnoval: EROFS
21058#else
21059#error "errno value EROFS not defined"
21060#endif
21061  ;
21062  return 0;
21063}
21064_ACEOF
21065if ac_fn_c_try_cpp "$LINENO"; then :
21066  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21067$as_echo "OK" >&6; }
21068        ERRNOVALS="$ERRNOVALS EROFS"
21069        cat conftest.i | grep errnoval: >>$ERRVALFILE
21070else
21071  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21072$as_echo "no" >&6; }
21073fi
21074rm -f conftest.err conftest.i conftest.$ac_ext
21075{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ERPCMISMATCH" >&5
21076$as_echo_n "checking for errno symbol ERPCMISMATCH... " >&6; }
21077  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21078/* end confdefs.h.  */
21079#include <errno.h>
21080int
21081main ()
21082{
21083
21084#ifdef ERPCMISMATCH
21085errnoval: ERPCMISMATCH
21086#else
21087#error "errno value ERPCMISMATCH not defined"
21088#endif
21089  ;
21090  return 0;
21091}
21092_ACEOF
21093if ac_fn_c_try_cpp "$LINENO"; then :
21094  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21095$as_echo "OK" >&6; }
21096        ERRNOVALS="$ERRNOVALS ERPCMISMATCH"
21097        cat conftest.i | grep errnoval: >>$ERRVALFILE
21098else
21099  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21100$as_echo "no" >&6; }
21101fi
21102rm -f conftest.err conftest.i conftest.$ac_ext
21103{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESHLIBVERS" >&5
21104$as_echo_n "checking for errno symbol ESHLIBVERS... " >&6; }
21105  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21106/* end confdefs.h.  */
21107#include <errno.h>
21108int
21109main ()
21110{
21111
21112#ifdef ESHLIBVERS
21113errnoval: ESHLIBVERS
21114#else
21115#error "errno value ESHLIBVERS not defined"
21116#endif
21117  ;
21118  return 0;
21119}
21120_ACEOF
21121if ac_fn_c_try_cpp "$LINENO"; then :
21122  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21123$as_echo "OK" >&6; }
21124        ERRNOVALS="$ERRNOVALS ESHLIBVERS"
21125        cat conftest.i | grep errnoval: >>$ERRVALFILE
21126else
21127  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21128$as_echo "no" >&6; }
21129fi
21130rm -f conftest.err conftest.i conftest.$ac_ext
21131{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESHUTDOWN" >&5
21132$as_echo_n "checking for errno symbol ESHUTDOWN... " >&6; }
21133  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21134/* end confdefs.h.  */
21135#include <errno.h>
21136int
21137main ()
21138{
21139
21140#ifdef ESHUTDOWN
21141errnoval: ESHUTDOWN
21142#else
21143#error "errno value ESHUTDOWN not defined"
21144#endif
21145  ;
21146  return 0;
21147}
21148_ACEOF
21149if ac_fn_c_try_cpp "$LINENO"; then :
21150  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21151$as_echo "OK" >&6; }
21152        ERRNOVALS="$ERRNOVALS ESHUTDOWN"
21153        cat conftest.i | grep errnoval: >>$ERRVALFILE
21154else
21155  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21156$as_echo "no" >&6; }
21157fi
21158rm -f conftest.err conftest.i conftest.$ac_ext
21159{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESOCKTNOSUPPORT" >&5
21160$as_echo_n "checking for errno symbol ESOCKTNOSUPPORT... " >&6; }
21161  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21162/* end confdefs.h.  */
21163#include <errno.h>
21164int
21165main ()
21166{
21167
21168#ifdef ESOCKTNOSUPPORT
21169errnoval: ESOCKTNOSUPPORT
21170#else
21171#error "errno value ESOCKTNOSUPPORT not defined"
21172#endif
21173  ;
21174  return 0;
21175}
21176_ACEOF
21177if ac_fn_c_try_cpp "$LINENO"; then :
21178  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21179$as_echo "OK" >&6; }
21180        ERRNOVALS="$ERRNOVALS ESOCKTNOSUPPORT"
21181        cat conftest.i | grep errnoval: >>$ERRVALFILE
21182else
21183  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21184$as_echo "no" >&6; }
21185fi
21186rm -f conftest.err conftest.i conftest.$ac_ext
21187{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESPIPE" >&5
21188$as_echo_n "checking for errno symbol ESPIPE... " >&6; }
21189  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21190/* end confdefs.h.  */
21191#include <errno.h>
21192int
21193main ()
21194{
21195
21196#ifdef ESPIPE
21197errnoval: ESPIPE
21198#else
21199#error "errno value ESPIPE not defined"
21200#endif
21201  ;
21202  return 0;
21203}
21204_ACEOF
21205if ac_fn_c_try_cpp "$LINENO"; then :
21206  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21207$as_echo "OK" >&6; }
21208        ERRNOVALS="$ERRNOVALS ESPIPE"
21209        cat conftest.i | grep errnoval: >>$ERRVALFILE
21210else
21211  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21212$as_echo "no" >&6; }
21213fi
21214rm -f conftest.err conftest.i conftest.$ac_ext
21215{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESRCH" >&5
21216$as_echo_n "checking for errno symbol ESRCH... " >&6; }
21217  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21218/* end confdefs.h.  */
21219#include <errno.h>
21220int
21221main ()
21222{
21223
21224#ifdef ESRCH
21225errnoval: ESRCH
21226#else
21227#error "errno value ESRCH not defined"
21228#endif
21229  ;
21230  return 0;
21231}
21232_ACEOF
21233if ac_fn_c_try_cpp "$LINENO"; then :
21234  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21235$as_echo "OK" >&6; }
21236        ERRNOVALS="$ERRNOVALS ESRCH"
21237        cat conftest.i | grep errnoval: >>$ERRVALFILE
21238else
21239  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21240$as_echo "no" >&6; }
21241fi
21242rm -f conftest.err conftest.i conftest.$ac_ext
21243{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESRMNT" >&5
21244$as_echo_n "checking for errno symbol ESRMNT... " >&6; }
21245  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21246/* end confdefs.h.  */
21247#include <errno.h>
21248int
21249main ()
21250{
21251
21252#ifdef ESRMNT
21253errnoval: ESRMNT
21254#else
21255#error "errno value ESRMNT not defined"
21256#endif
21257  ;
21258  return 0;
21259}
21260_ACEOF
21261if ac_fn_c_try_cpp "$LINENO"; then :
21262  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21263$as_echo "OK" >&6; }
21264        ERRNOVALS="$ERRNOVALS ESRMNT"
21265        cat conftest.i | grep errnoval: >>$ERRVALFILE
21266else
21267  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21268$as_echo "no" >&6; }
21269fi
21270rm -f conftest.err conftest.i conftest.$ac_ext
21271{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESTALE" >&5
21272$as_echo_n "checking for errno symbol ESTALE... " >&6; }
21273  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21274/* end confdefs.h.  */
21275#include <errno.h>
21276int
21277main ()
21278{
21279
21280#ifdef ESTALE
21281errnoval: ESTALE
21282#else
21283#error "errno value ESTALE not defined"
21284#endif
21285  ;
21286  return 0;
21287}
21288_ACEOF
21289if ac_fn_c_try_cpp "$LINENO"; then :
21290  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21291$as_echo "OK" >&6; }
21292        ERRNOVALS="$ERRNOVALS ESTALE"
21293        cat conftest.i | grep errnoval: >>$ERRVALFILE
21294else
21295  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21296$as_echo "no" >&6; }
21297fi
21298rm -f conftest.err conftest.i conftest.$ac_ext
21299{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESTRPIPE" >&5
21300$as_echo_n "checking for errno symbol ESTRPIPE... " >&6; }
21301  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21302/* end confdefs.h.  */
21303#include <errno.h>
21304int
21305main ()
21306{
21307
21308#ifdef ESTRPIPE
21309errnoval: ESTRPIPE
21310#else
21311#error "errno value ESTRPIPE not defined"
21312#endif
21313  ;
21314  return 0;
21315}
21316_ACEOF
21317if ac_fn_c_try_cpp "$LINENO"; then :
21318  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21319$as_echo "OK" >&6; }
21320        ERRNOVALS="$ERRNOVALS ESTRPIPE"
21321        cat conftest.i | grep errnoval: >>$ERRVALFILE
21322else
21323  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21324$as_echo "no" >&6; }
21325fi
21326rm -f conftest.err conftest.i conftest.$ac_ext
21327{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ETIME" >&5
21328$as_echo_n "checking for errno symbol ETIME... " >&6; }
21329  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21330/* end confdefs.h.  */
21331#include <errno.h>
21332int
21333main ()
21334{
21335
21336#ifdef ETIME
21337errnoval: ETIME
21338#else
21339#error "errno value ETIME not defined"
21340#endif
21341  ;
21342  return 0;
21343}
21344_ACEOF
21345if ac_fn_c_try_cpp "$LINENO"; then :
21346  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21347$as_echo "OK" >&6; }
21348        ERRNOVALS="$ERRNOVALS ETIME"
21349        cat conftest.i | grep errnoval: >>$ERRVALFILE
21350else
21351  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21352$as_echo "no" >&6; }
21353fi
21354rm -f conftest.err conftest.i conftest.$ac_ext
21355{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ETIMEDOUT" >&5
21356$as_echo_n "checking for errno symbol ETIMEDOUT... " >&6; }
21357  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21358/* end confdefs.h.  */
21359#include <errno.h>
21360int
21361main ()
21362{
21363
21364#ifdef ETIMEDOUT
21365errnoval: ETIMEDOUT
21366#else
21367#error "errno value ETIMEDOUT not defined"
21368#endif
21369  ;
21370  return 0;
21371}
21372_ACEOF
21373if ac_fn_c_try_cpp "$LINENO"; then :
21374  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21375$as_echo "OK" >&6; }
21376        ERRNOVALS="$ERRNOVALS ETIMEDOUT"
21377        cat conftest.i | grep errnoval: >>$ERRVALFILE
21378else
21379  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21380$as_echo "no" >&6; }
21381fi
21382rm -f conftest.err conftest.i conftest.$ac_ext
21383{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ETOOMANYREFS" >&5
21384$as_echo_n "checking for errno symbol ETOOMANYREFS... " >&6; }
21385  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21386/* end confdefs.h.  */
21387#include <errno.h>
21388int
21389main ()
21390{
21391
21392#ifdef ETOOMANYREFS
21393errnoval: ETOOMANYREFS
21394#else
21395#error "errno value ETOOMANYREFS not defined"
21396#endif
21397  ;
21398  return 0;
21399}
21400_ACEOF
21401if ac_fn_c_try_cpp "$LINENO"; then :
21402  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21403$as_echo "OK" >&6; }
21404        ERRNOVALS="$ERRNOVALS ETOOMANYREFS"
21405        cat conftest.i | grep errnoval: >>$ERRVALFILE
21406else
21407  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21408$as_echo "no" >&6; }
21409fi
21410rm -f conftest.err conftest.i conftest.$ac_ext
21411{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ETXTBSY" >&5
21412$as_echo_n "checking for errno symbol ETXTBSY... " >&6; }
21413  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21414/* end confdefs.h.  */
21415#include <errno.h>
21416int
21417main ()
21418{
21419
21420#ifdef ETXTBSY
21421errnoval: ETXTBSY
21422#else
21423#error "errno value ETXTBSY not defined"
21424#endif
21425  ;
21426  return 0;
21427}
21428_ACEOF
21429if ac_fn_c_try_cpp "$LINENO"; then :
21430  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21431$as_echo "OK" >&6; }
21432        ERRNOVALS="$ERRNOVALS ETXTBSY"
21433        cat conftest.i | grep errnoval: >>$ERRVALFILE
21434else
21435  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21436$as_echo "no" >&6; }
21437fi
21438rm -f conftest.err conftest.i conftest.$ac_ext
21439{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EUNATCH" >&5
21440$as_echo_n "checking for errno symbol EUNATCH... " >&6; }
21441  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21442/* end confdefs.h.  */
21443#include <errno.h>
21444int
21445main ()
21446{
21447
21448#ifdef EUNATCH
21449errnoval: EUNATCH
21450#else
21451#error "errno value EUNATCH not defined"
21452#endif
21453  ;
21454  return 0;
21455}
21456_ACEOF
21457if ac_fn_c_try_cpp "$LINENO"; then :
21458  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21459$as_echo "OK" >&6; }
21460        ERRNOVALS="$ERRNOVALS EUNATCH"
21461        cat conftest.i | grep errnoval: >>$ERRVALFILE
21462else
21463  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21464$as_echo "no" >&6; }
21465fi
21466rm -f conftest.err conftest.i conftest.$ac_ext
21467{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EUSERS" >&5
21468$as_echo_n "checking for errno symbol EUSERS... " >&6; }
21469  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21470/* end confdefs.h.  */
21471#include <errno.h>
21472int
21473main ()
21474{
21475
21476#ifdef EUSERS
21477errnoval: EUSERS
21478#else
21479#error "errno value EUSERS not defined"
21480#endif
21481  ;
21482  return 0;
21483}
21484_ACEOF
21485if ac_fn_c_try_cpp "$LINENO"; then :
21486  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21487$as_echo "OK" >&6; }
21488        ERRNOVALS="$ERRNOVALS EUSERS"
21489        cat conftest.i | grep errnoval: >>$ERRVALFILE
21490else
21491  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21492$as_echo "no" >&6; }
21493fi
21494rm -f conftest.err conftest.i conftest.$ac_ext
21495{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EWOULDBLOCK" >&5
21496$as_echo_n "checking for errno symbol EWOULDBLOCK... " >&6; }
21497  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21498/* end confdefs.h.  */
21499#include <errno.h>
21500int
21501main ()
21502{
21503
21504#ifdef EWOULDBLOCK
21505errnoval: EWOULDBLOCK
21506#else
21507#error "errno value EWOULDBLOCK not defined"
21508#endif
21509  ;
21510  return 0;
21511}
21512_ACEOF
21513if ac_fn_c_try_cpp "$LINENO"; then :
21514  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21515$as_echo "OK" >&6; }
21516        ERRNOVALS="$ERRNOVALS EWOULDBLOCK"
21517        cat conftest.i | grep errnoval: >>$ERRVALFILE
21518else
21519  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21520$as_echo "no" >&6; }
21521fi
21522rm -f conftest.err conftest.i conftest.$ac_ext
21523{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EXDEV" >&5
21524$as_echo_n "checking for errno symbol EXDEV... " >&6; }
21525  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21526/* end confdefs.h.  */
21527#include <errno.h>
21528int
21529main ()
21530{
21531
21532#ifdef EXDEV
21533errnoval: EXDEV
21534#else
21535#error "errno value EXDEV not defined"
21536#endif
21537  ;
21538  return 0;
21539}
21540_ACEOF
21541if ac_fn_c_try_cpp "$LINENO"; then :
21542  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21543$as_echo "OK" >&6; }
21544        ERRNOVALS="$ERRNOVALS EXDEV"
21545        cat conftest.i | grep errnoval: >>$ERRVALFILE
21546else
21547  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21548$as_echo "no" >&6; }
21549fi
21550rm -f conftest.err conftest.i conftest.$ac_ext
21551{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EXFULL" >&5
21552$as_echo_n "checking for errno symbol EXFULL... " >&6; }
21553  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21554/* end confdefs.h.  */
21555#include <errno.h>
21556int
21557main ()
21558{
21559
21560#ifdef EXFULL
21561errnoval: EXFULL
21562#else
21563#error "errno value EXFULL not defined"
21564#endif
21565  ;
21566  return 0;
21567}
21568_ACEOF
21569if ac_fn_c_try_cpp "$LINENO"; then :
21570  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21571$as_echo "OK" >&6; }
21572        ERRNOVALS="$ERRNOVALS EXFULL"
21573        cat conftest.i | grep errnoval: >>$ERRVALFILE
21574else
21575  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21576$as_echo "no" >&6; }
21577fi
21578rm -f conftest.err conftest.i conftest.$ac_ext
21579{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECLONEME" >&5
21580$as_echo_n "checking for errno symbol ECLONEME... " >&6; }
21581  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21582/* end confdefs.h.  */
21583#include <errno.h>
21584int
21585main ()
21586{
21587
21588#ifdef ECLONEME
21589errnoval: ECLONEME
21590#else
21591#error "errno value ECLONEME not defined"
21592#endif
21593  ;
21594  return 0;
21595}
21596_ACEOF
21597if ac_fn_c_try_cpp "$LINENO"; then :
21598  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21599$as_echo "OK" >&6; }
21600        ERRNOVALS="$ERRNOVALS ECLONEME"
21601        cat conftest.i | grep errnoval: >>$ERRVALFILE
21602else
21603  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21604$as_echo "no" >&6; }
21605fi
21606rm -f conftest.err conftest.i conftest.$ac_ext
21607{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ECORRUPT" >&5
21608$as_echo_n "checking for errno symbol ECORRUPT... " >&6; }
21609  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21610/* end confdefs.h.  */
21611#include <errno.h>
21612int
21613main ()
21614{
21615
21616#ifdef ECORRUPT
21617errnoval: ECORRUPT
21618#else
21619#error "errno value ECORRUPT not defined"
21620#endif
21621  ;
21622  return 0;
21623}
21624_ACEOF
21625if ac_fn_c_try_cpp "$LINENO"; then :
21626  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21627$as_echo "OK" >&6; }
21628        ERRNOVALS="$ERRNOVALS ECORRUPT"
21629        cat conftest.i | grep errnoval: >>$ERRVALFILE
21630else
21631  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21632$as_echo "no" >&6; }
21633fi
21634rm -f conftest.err conftest.i conftest.$ac_ext
21635{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDESTADDREQ" >&5
21636$as_echo_n "checking for errno symbol EDESTADDREQ... " >&6; }
21637  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21638/* end confdefs.h.  */
21639#include <errno.h>
21640int
21641main ()
21642{
21643
21644#ifdef EDESTADDREQ
21645errnoval: EDESTADDREQ
21646#else
21647#error "errno value EDESTADDREQ not defined"
21648#endif
21649  ;
21650  return 0;
21651}
21652_ACEOF
21653if ac_fn_c_try_cpp "$LINENO"; then :
21654  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21655$as_echo "OK" >&6; }
21656        ERRNOVALS="$ERRNOVALS EDESTADDREQ"
21657        cat conftest.i | grep errnoval: >>$ERRVALFILE
21658else
21659  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21660$as_echo "no" >&6; }
21661fi
21662rm -f conftest.err conftest.i conftest.$ac_ext
21663{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EDIST" >&5
21664$as_echo_n "checking for errno symbol EDIST... " >&6; }
21665  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21666/* end confdefs.h.  */
21667#include <errno.h>
21668int
21669main ()
21670{
21671
21672#ifdef EDIST
21673errnoval: EDIST
21674#else
21675#error "errno value EDIST not defined"
21676#endif
21677  ;
21678  return 0;
21679}
21680_ACEOF
21681if ac_fn_c_try_cpp "$LINENO"; then :
21682  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21683$as_echo "OK" >&6; }
21684        ERRNOVALS="$ERRNOVALS EDIST"
21685        cat conftest.i | grep errnoval: >>$ERRVALFILE
21686else
21687  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21688$as_echo "no" >&6; }
21689fi
21690rm -f conftest.err conftest.i conftest.$ac_ext
21691{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EFORMAT" >&5
21692$as_echo_n "checking for errno symbol EFORMAT... " >&6; }
21693  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21694/* end confdefs.h.  */
21695#include <errno.h>
21696int
21697main ()
21698{
21699
21700#ifdef EFORMAT
21701errnoval: EFORMAT
21702#else
21703#error "errno value EFORMAT not defined"
21704#endif
21705  ;
21706  return 0;
21707}
21708_ACEOF
21709if ac_fn_c_try_cpp "$LINENO"; then :
21710  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21711$as_echo "OK" >&6; }
21712        ERRNOVALS="$ERRNOVALS EFORMAT"
21713        cat conftest.i | grep errnoval: >>$ERRVALFILE
21714else
21715  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21716$as_echo "no" >&6; }
21717fi
21718rm -f conftest.err conftest.i conftest.$ac_ext
21719{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EMEDIA" >&5
21720$as_echo_n "checking for errno symbol EMEDIA... " >&6; }
21721  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21722/* end confdefs.h.  */
21723#include <errno.h>
21724int
21725main ()
21726{
21727
21728#ifdef EMEDIA
21729errnoval: EMEDIA
21730#else
21731#error "errno value EMEDIA not defined"
21732#endif
21733  ;
21734  return 0;
21735}
21736_ACEOF
21737if ac_fn_c_try_cpp "$LINENO"; then :
21738  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21739$as_echo "OK" >&6; }
21740        ERRNOVALS="$ERRNOVALS EMEDIA"
21741        cat conftest.i | grep errnoval: >>$ERRVALFILE
21742else
21743  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21744$as_echo "no" >&6; }
21745fi
21746rm -f conftest.err conftest.i conftest.$ac_ext
21747{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOCONNECT" >&5
21748$as_echo_n "checking for errno symbol ENOCONNECT... " >&6; }
21749  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21750/* end confdefs.h.  */
21751#include <errno.h>
21752int
21753main ()
21754{
21755
21756#ifdef ENOCONNECT
21757errnoval: ENOCONNECT
21758#else
21759#error "errno value ENOCONNECT not defined"
21760#endif
21761  ;
21762  return 0;
21763}
21764_ACEOF
21765if ac_fn_c_try_cpp "$LINENO"; then :
21766  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21767$as_echo "OK" >&6; }
21768        ERRNOVALS="$ERRNOVALS ENOCONNECT"
21769        cat conftest.i | grep errnoval: >>$ERRVALFILE
21770else
21771  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21772$as_echo "no" >&6; }
21773fi
21774rm -f conftest.err conftest.i conftest.$ac_ext
21775{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTEMPTY" >&5
21776$as_echo_n "checking for errno symbol ENOTEMPTY... " >&6; }
21777  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21778/* end confdefs.h.  */
21779#include <errno.h>
21780int
21781main ()
21782{
21783
21784#ifdef ENOTEMPTY
21785errnoval: ENOTEMPTY
21786#else
21787#error "errno value ENOTEMPTY not defined"
21788#endif
21789  ;
21790  return 0;
21791}
21792_ACEOF
21793if ac_fn_c_try_cpp "$LINENO"; then :
21794  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21795$as_echo "OK" >&6; }
21796        ERRNOVALS="$ERRNOVALS ENOTEMPTY"
21797        cat conftest.i | grep errnoval: >>$ERRVALFILE
21798else
21799  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21800$as_echo "no" >&6; }
21801fi
21802rm -f conftest.err conftest.i conftest.$ac_ext
21803{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTREADY" >&5
21804$as_echo_n "checking for errno symbol ENOTREADY... " >&6; }
21805  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21806/* end confdefs.h.  */
21807#include <errno.h>
21808int
21809main ()
21810{
21811
21812#ifdef ENOTREADY
21813errnoval: ENOTREADY
21814#else
21815#error "errno value ENOTREADY not defined"
21816#endif
21817  ;
21818  return 0;
21819}
21820_ACEOF
21821if ac_fn_c_try_cpp "$LINENO"; then :
21822  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21823$as_echo "OK" >&6; }
21824        ERRNOVALS="$ERRNOVALS ENOTREADY"
21825        cat conftest.i | grep errnoval: >>$ERRVALFILE
21826else
21827  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21828$as_echo "no" >&6; }
21829fi
21830rm -f conftest.err conftest.i conftest.$ac_ext
21831{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ENOTRUST" >&5
21832$as_echo_n "checking for errno symbol ENOTRUST... " >&6; }
21833  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21834/* end confdefs.h.  */
21835#include <errno.h>
21836int
21837main ()
21838{
21839
21840#ifdef ENOTRUST
21841errnoval: ENOTRUST
21842#else
21843#error "errno value ENOTRUST not defined"
21844#endif
21845  ;
21846  return 0;
21847}
21848_ACEOF
21849if ac_fn_c_try_cpp "$LINENO"; then :
21850  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21851$as_echo "OK" >&6; }
21852        ERRNOVALS="$ERRNOVALS ENOTRUST"
21853        cat conftest.i | grep errnoval: >>$ERRVALFILE
21854else
21855  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21856$as_echo "no" >&6; }
21857fi
21858rm -f conftest.err conftest.i conftest.$ac_ext
21859{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESAD" >&5
21860$as_echo_n "checking for errno symbol ESAD... " >&6; }
21861  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21862/* end confdefs.h.  */
21863#include <errno.h>
21864int
21865main ()
21866{
21867
21868#ifdef ESAD
21869errnoval: ESAD
21870#else
21871#error "errno value ESAD not defined"
21872#endif
21873  ;
21874  return 0;
21875}
21876_ACEOF
21877if ac_fn_c_try_cpp "$LINENO"; then :
21878  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21879$as_echo "OK" >&6; }
21880        ERRNOVALS="$ERRNOVALS ESAD"
21881        cat conftest.i | grep errnoval: >>$ERRVALFILE
21882else
21883  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21884$as_echo "no" >&6; }
21885fi
21886rm -f conftest.err conftest.i conftest.$ac_ext
21887{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESOFT" >&5
21888$as_echo_n "checking for errno symbol ESOFT... " >&6; }
21889  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21890/* end confdefs.h.  */
21891#include <errno.h>
21892int
21893main ()
21894{
21895
21896#ifdef ESOFT
21897errnoval: ESOFT
21898#else
21899#error "errno value ESOFT not defined"
21900#endif
21901  ;
21902  return 0;
21903}
21904_ACEOF
21905if ac_fn_c_try_cpp "$LINENO"; then :
21906  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21907$as_echo "OK" >&6; }
21908        ERRNOVALS="$ERRNOVALS ESOFT"
21909        cat conftest.i | grep errnoval: >>$ERRVALFILE
21910else
21911  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21912$as_echo "no" >&6; }
21913fi
21914rm -f conftest.err conftest.i conftest.$ac_ext
21915{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol ESYSERROR" >&5
21916$as_echo_n "checking for errno symbol ESYSERROR... " >&6; }
21917  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21918/* end confdefs.h.  */
21919#include <errno.h>
21920int
21921main ()
21922{
21923
21924#ifdef ESYSERROR
21925errnoval: ESYSERROR
21926#else
21927#error "errno value ESYSERROR not defined"
21928#endif
21929  ;
21930  return 0;
21931}
21932_ACEOF
21933if ac_fn_c_try_cpp "$LINENO"; then :
21934  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21935$as_echo "OK" >&6; }
21936        ERRNOVALS="$ERRNOVALS ESYSERROR"
21937        cat conftest.i | grep errnoval: >>$ERRVALFILE
21938else
21939  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21940$as_echo "no" >&6; }
21941fi
21942rm -f conftest.err conftest.i conftest.$ac_ext
21943{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EWOULDBLOCK" >&5
21944$as_echo_n "checking for errno symbol EWOULDBLOCK... " >&6; }
21945  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21946/* end confdefs.h.  */
21947#include <errno.h>
21948int
21949main ()
21950{
21951
21952#ifdef EWOULDBLOCK
21953errnoval: EWOULDBLOCK
21954#else
21955#error "errno value EWOULDBLOCK not defined"
21956#endif
21957  ;
21958  return 0;
21959}
21960_ACEOF
21961if ac_fn_c_try_cpp "$LINENO"; then :
21962  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21963$as_echo "OK" >&6; }
21964        ERRNOVALS="$ERRNOVALS EWOULDBLOCK"
21965        cat conftest.i | grep errnoval: >>$ERRVALFILE
21966else
21967  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21968$as_echo "no" >&6; }
21969fi
21970rm -f conftest.err conftest.i conftest.$ac_ext
21971{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for errno symbol EWRPROTECT" >&5
21972$as_echo_n "checking for errno symbol EWRPROTECT... " >&6; }
21973  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
21974/* end confdefs.h.  */
21975#include <errno.h>
21976int
21977main ()
21978{
21979
21980#ifdef EWRPROTECT
21981errnoval: EWRPROTECT
21982#else
21983#error "errno value EWRPROTECT not defined"
21984#endif
21985  ;
21986  return 0;
21987}
21988_ACEOF
21989if ac_fn_c_try_cpp "$LINENO"; then :
21990  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
21991$as_echo "OK" >&6; }
21992        ERRNOVALS="$ERRNOVALS EWRPROTECT"
21993        cat conftest.i | grep errnoval: >>$ERRVALFILE
21994else
21995  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
21996$as_echo "no" >&6; }
21997fi
21998rm -f conftest.err conftest.i conftest.$ac_ext
21999
22000if test x"$ERRNOVALS" = x; then
22001    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22002$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22003as_fn_error $? "error: no errno symbols found
22004See \`config.log' for more details" "$LINENO" 5; }
22005fi
22006ERRNOCNT=`echo $ERRNOVALS | wc -w | awk '{ print $1 }'`
22007
22008{ $as_echo "$as_me:${as_lineno-$LINENO}: checking errno symbols" >&5
22009$as_echo_n "checking errno symbols... " >&6; }
22010unset UNIQUEVALS UNIQUESYMBOLS
22011if test -s $ERRVALFILE; then
22012    UNIQUEVALS=`sort $ERRVALFILE | uniq | wc -l | awk '{ print $1 }'`
22013    UNIQUESYMBOLS=`cat $ERRVALFILE | wc -l | awk '{ print $1 }'`
22014    if test $ERRNOCNT -ne $UNIQUESYMBOLS; then
22015	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22016$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22017as_fn_error $? "internal error: errno symbol count mismatch
22018See \`config.log' for more details" "$LINENO" 5; }
22019    fi
22020
22021cat >>confdefs.h <<_ACEOF
22022#define UNIQUE_ERRNO_VALUES $UNIQUEVALS
22023_ACEOF
22024
22025    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unique symbols: $UNIQUESYMBOLS, unique values: $UNIQUEVALS" >&5
22026$as_echo "unique symbols: $UNIQUESYMBOLS, unique values: $UNIQUEVALS" >&6; }
22027else
22028    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22029$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22030as_fn_error $? "error: unable to determine errno symbol values
22031See \`config.log' for more details" "$LINENO" 5; }
22032fi
22033
22034echo "/* NOTICE: $ERRNOSRC: Generated from by configure */" >>$ERRNOSRC
22035echo "" >>$ERRNOSRC
22036echo "static const errorsymboltable_t errnosymbolv[] = {" >>$ERRNOSRC
22037
22038#generic list
22039for errno in $ERRNOVALS; do
22040    echo "   { \"$errno\",	$errno	}," >>$ERRNOSRC
22041done
22042
22043#keyword alias list
22044maxaliaslen=0 #highest number of values for an alias
22045
22046#errno values that can match 'no-route' keyword (if found on platform)
22047ERRNO_NOROUTE="ENETUNREACH EHOSTUNREACH ENETDOWN ETIMEDOUT"
22048keyword="no-route"
22049keycnt=0
22050for keyval in ${ERRNO_NOROUTE}; do
22051    for errno in $ERRNOVALS; do
22052	if test x"$keyval" = x"$errno"; then
22053	    echo "   { \"$keyword\",	$errno	}," >>$ERRNOSRC
22054	    keycnt=`expr $keycnt + 1`
22055	fi
22056    done
22057done
22058
22059#any-error; alias for all values
22060keyword="system-any"
22061keycnt=0
22062for errno in $ERRNOVALS; do
22063    echo "   { \"$keyword\",	$errno	}," >>$ERRNOSRC
22064    keycnt=`expr $keycnt + 1`
22065done
22066
22067if test $keycnt -gt $maxaliaslen; then
22068    maxaliaslen=$keycnt
22069fi
22070
22071echo "};" >>$ERRNOSRC
22072
22073
22074cat >>confdefs.h <<_ACEOF
22075#define MAX_ERRNO_VALUES_FOR_SYMBOL $maxaliaslen
22076_ACEOF
22077
22078
22079
22080#generate list of getaddrinfo errors
22081cp /dev/null $ERRVALFILE
22082unset GAIERRVALS
22083{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_ADDRFAMILY" >&5
22084$as_echo_n "checking for getaddrinfo() error EAI_ADDRFAMILY... " >&6; }
22085  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22086/* end confdefs.h.  */
22087
22088#include <sys/types.h>
22089#include <sys/socket.h>
22090#include <netdb.h>
22091int
22092main ()
22093{
22094
22095#ifdef EAI_ADDRFAMILY
22096gaierrval: EAI_ADDRFAMILY
22097#else
22098#error "gai error value EAI_ADDRFAMILY not defined"
22099#endif
22100  ;
22101  return 0;
22102}
22103_ACEOF
22104if ac_fn_c_try_cpp "$LINENO"; then :
22105  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22106$as_echo "OK" >&6; }
22107        GAIERRVALS="$GAIERRVALS EAI_ADDRFAMILY"
22108
22109$as_echo "#define HAVE_ERR_EAI_ADDRFAMILY 1" >>confdefs.h
22110
22111        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22112else
22113  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22114$as_echo "no" >&6; }
22115fi
22116rm -f conftest.err conftest.i conftest.$ac_ext
22117{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_AGAIN" >&5
22118$as_echo_n "checking for getaddrinfo() error EAI_AGAIN... " >&6; }
22119  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22120/* end confdefs.h.  */
22121
22122#include <sys/types.h>
22123#include <sys/socket.h>
22124#include <netdb.h>
22125int
22126main ()
22127{
22128
22129#ifdef EAI_AGAIN
22130gaierrval: EAI_AGAIN
22131#else
22132#error "gai error value EAI_AGAIN not defined"
22133#endif
22134  ;
22135  return 0;
22136}
22137_ACEOF
22138if ac_fn_c_try_cpp "$LINENO"; then :
22139  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22140$as_echo "OK" >&6; }
22141        GAIERRVALS="$GAIERRVALS EAI_AGAIN"
22142
22143$as_echo "#define HAVE_ERR_EAI_AGAIN 1" >>confdefs.h
22144
22145        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22146else
22147  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22148$as_echo "no" >&6; }
22149fi
22150rm -f conftest.err conftest.i conftest.$ac_ext
22151{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_BADFLAGS" >&5
22152$as_echo_n "checking for getaddrinfo() error EAI_BADFLAGS... " >&6; }
22153  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22154/* end confdefs.h.  */
22155
22156#include <sys/types.h>
22157#include <sys/socket.h>
22158#include <netdb.h>
22159int
22160main ()
22161{
22162
22163#ifdef EAI_BADFLAGS
22164gaierrval: EAI_BADFLAGS
22165#else
22166#error "gai error value EAI_BADFLAGS not defined"
22167#endif
22168  ;
22169  return 0;
22170}
22171_ACEOF
22172if ac_fn_c_try_cpp "$LINENO"; then :
22173  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22174$as_echo "OK" >&6; }
22175        GAIERRVALS="$GAIERRVALS EAI_BADFLAGS"
22176
22177$as_echo "#define HAVE_ERR_EAI_BADFLAGS 1" >>confdefs.h
22178
22179        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22180else
22181  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22182$as_echo "no" >&6; }
22183fi
22184rm -f conftest.err conftest.i conftest.$ac_ext
22185{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_BADHINTS" >&5
22186$as_echo_n "checking for getaddrinfo() error EAI_BADHINTS... " >&6; }
22187  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22188/* end confdefs.h.  */
22189
22190#include <sys/types.h>
22191#include <sys/socket.h>
22192#include <netdb.h>
22193int
22194main ()
22195{
22196
22197#ifdef EAI_BADHINTS
22198gaierrval: EAI_BADHINTS
22199#else
22200#error "gai error value EAI_BADHINTS not defined"
22201#endif
22202  ;
22203  return 0;
22204}
22205_ACEOF
22206if ac_fn_c_try_cpp "$LINENO"; then :
22207  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22208$as_echo "OK" >&6; }
22209        GAIERRVALS="$GAIERRVALS EAI_BADHINTS"
22210
22211$as_echo "#define HAVE_ERR_EAI_BADHINTS 1" >>confdefs.h
22212
22213        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22214else
22215  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22216$as_echo "no" >&6; }
22217fi
22218rm -f conftest.err conftest.i conftest.$ac_ext
22219{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_FAIL" >&5
22220$as_echo_n "checking for getaddrinfo() error EAI_FAIL... " >&6; }
22221  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22222/* end confdefs.h.  */
22223
22224#include <sys/types.h>
22225#include <sys/socket.h>
22226#include <netdb.h>
22227int
22228main ()
22229{
22230
22231#ifdef EAI_FAIL
22232gaierrval: EAI_FAIL
22233#else
22234#error "gai error value EAI_FAIL not defined"
22235#endif
22236  ;
22237  return 0;
22238}
22239_ACEOF
22240if ac_fn_c_try_cpp "$LINENO"; then :
22241  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22242$as_echo "OK" >&6; }
22243        GAIERRVALS="$GAIERRVALS EAI_FAIL"
22244
22245$as_echo "#define HAVE_ERR_EAI_FAIL 1" >>confdefs.h
22246
22247        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22248else
22249  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22250$as_echo "no" >&6; }
22251fi
22252rm -f conftest.err conftest.i conftest.$ac_ext
22253{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_FAMILY" >&5
22254$as_echo_n "checking for getaddrinfo() error EAI_FAMILY... " >&6; }
22255  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22256/* end confdefs.h.  */
22257
22258#include <sys/types.h>
22259#include <sys/socket.h>
22260#include <netdb.h>
22261int
22262main ()
22263{
22264
22265#ifdef EAI_FAMILY
22266gaierrval: EAI_FAMILY
22267#else
22268#error "gai error value EAI_FAMILY not defined"
22269#endif
22270  ;
22271  return 0;
22272}
22273_ACEOF
22274if ac_fn_c_try_cpp "$LINENO"; then :
22275  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22276$as_echo "OK" >&6; }
22277        GAIERRVALS="$GAIERRVALS EAI_FAMILY"
22278
22279$as_echo "#define HAVE_ERR_EAI_FAMILY 1" >>confdefs.h
22280
22281        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22282else
22283  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22284$as_echo "no" >&6; }
22285fi
22286rm -f conftest.err conftest.i conftest.$ac_ext
22287{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_MEMORY" >&5
22288$as_echo_n "checking for getaddrinfo() error EAI_MEMORY... " >&6; }
22289  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22290/* end confdefs.h.  */
22291
22292#include <sys/types.h>
22293#include <sys/socket.h>
22294#include <netdb.h>
22295int
22296main ()
22297{
22298
22299#ifdef EAI_MEMORY
22300gaierrval: EAI_MEMORY
22301#else
22302#error "gai error value EAI_MEMORY not defined"
22303#endif
22304  ;
22305  return 0;
22306}
22307_ACEOF
22308if ac_fn_c_try_cpp "$LINENO"; then :
22309  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22310$as_echo "OK" >&6; }
22311        GAIERRVALS="$GAIERRVALS EAI_MEMORY"
22312
22313$as_echo "#define HAVE_ERR_EAI_MEMORY 1" >>confdefs.h
22314
22315        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22316else
22317  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22318$as_echo "no" >&6; }
22319fi
22320rm -f conftest.err conftest.i conftest.$ac_ext
22321{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_NODATA" >&5
22322$as_echo_n "checking for getaddrinfo() error EAI_NODATA... " >&6; }
22323  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22324/* end confdefs.h.  */
22325
22326#include <sys/types.h>
22327#include <sys/socket.h>
22328#include <netdb.h>
22329int
22330main ()
22331{
22332
22333#ifdef EAI_NODATA
22334gaierrval: EAI_NODATA
22335#else
22336#error "gai error value EAI_NODATA not defined"
22337#endif
22338  ;
22339  return 0;
22340}
22341_ACEOF
22342if ac_fn_c_try_cpp "$LINENO"; then :
22343  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22344$as_echo "OK" >&6; }
22345        GAIERRVALS="$GAIERRVALS EAI_NODATA"
22346
22347$as_echo "#define HAVE_ERR_EAI_NODATA 1" >>confdefs.h
22348
22349        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22350else
22351  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22352$as_echo "no" >&6; }
22353fi
22354rm -f conftest.err conftest.i conftest.$ac_ext
22355{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_NONAME" >&5
22356$as_echo_n "checking for getaddrinfo() error EAI_NONAME... " >&6; }
22357  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22358/* end confdefs.h.  */
22359
22360#include <sys/types.h>
22361#include <sys/socket.h>
22362#include <netdb.h>
22363int
22364main ()
22365{
22366
22367#ifdef EAI_NONAME
22368gaierrval: EAI_NONAME
22369#else
22370#error "gai error value EAI_NONAME not defined"
22371#endif
22372  ;
22373  return 0;
22374}
22375_ACEOF
22376if ac_fn_c_try_cpp "$LINENO"; then :
22377  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22378$as_echo "OK" >&6; }
22379        GAIERRVALS="$GAIERRVALS EAI_NONAME"
22380
22381$as_echo "#define HAVE_ERR_EAI_NONAME 1" >>confdefs.h
22382
22383        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22384else
22385  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22386$as_echo "no" >&6; }
22387fi
22388rm -f conftest.err conftest.i conftest.$ac_ext
22389{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_OVERFLOW" >&5
22390$as_echo_n "checking for getaddrinfo() error EAI_OVERFLOW... " >&6; }
22391  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22392/* end confdefs.h.  */
22393
22394#include <sys/types.h>
22395#include <sys/socket.h>
22396#include <netdb.h>
22397int
22398main ()
22399{
22400
22401#ifdef EAI_OVERFLOW
22402gaierrval: EAI_OVERFLOW
22403#else
22404#error "gai error value EAI_OVERFLOW not defined"
22405#endif
22406  ;
22407  return 0;
22408}
22409_ACEOF
22410if ac_fn_c_try_cpp "$LINENO"; then :
22411  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22412$as_echo "OK" >&6; }
22413        GAIERRVALS="$GAIERRVALS EAI_OVERFLOW"
22414
22415$as_echo "#define HAVE_ERR_EAI_OVERFLOW 1" >>confdefs.h
22416
22417        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22418else
22419  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22420$as_echo "no" >&6; }
22421fi
22422rm -f conftest.err conftest.i conftest.$ac_ext
22423{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_PROTOCOL" >&5
22424$as_echo_n "checking for getaddrinfo() error EAI_PROTOCOL... " >&6; }
22425  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22426/* end confdefs.h.  */
22427
22428#include <sys/types.h>
22429#include <sys/socket.h>
22430#include <netdb.h>
22431int
22432main ()
22433{
22434
22435#ifdef EAI_PROTOCOL
22436gaierrval: EAI_PROTOCOL
22437#else
22438#error "gai error value EAI_PROTOCOL not defined"
22439#endif
22440  ;
22441  return 0;
22442}
22443_ACEOF
22444if ac_fn_c_try_cpp "$LINENO"; then :
22445  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22446$as_echo "OK" >&6; }
22447        GAIERRVALS="$GAIERRVALS EAI_PROTOCOL"
22448
22449$as_echo "#define HAVE_ERR_EAI_PROTOCOL 1" >>confdefs.h
22450
22451        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22452else
22453  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22454$as_echo "no" >&6; }
22455fi
22456rm -f conftest.err conftest.i conftest.$ac_ext
22457{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_SERVICE" >&5
22458$as_echo_n "checking for getaddrinfo() error EAI_SERVICE... " >&6; }
22459  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22460/* end confdefs.h.  */
22461
22462#include <sys/types.h>
22463#include <sys/socket.h>
22464#include <netdb.h>
22465int
22466main ()
22467{
22468
22469#ifdef EAI_SERVICE
22470gaierrval: EAI_SERVICE
22471#else
22472#error "gai error value EAI_SERVICE not defined"
22473#endif
22474  ;
22475  return 0;
22476}
22477_ACEOF
22478if ac_fn_c_try_cpp "$LINENO"; then :
22479  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22480$as_echo "OK" >&6; }
22481        GAIERRVALS="$GAIERRVALS EAI_SERVICE"
22482
22483$as_echo "#define HAVE_ERR_EAI_SERVICE 1" >>confdefs.h
22484
22485        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22486else
22487  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22488$as_echo "no" >&6; }
22489fi
22490rm -f conftest.err conftest.i conftest.$ac_ext
22491{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_SOCKTYPE" >&5
22492$as_echo_n "checking for getaddrinfo() error EAI_SOCKTYPE... " >&6; }
22493  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22494/* end confdefs.h.  */
22495
22496#include <sys/types.h>
22497#include <sys/socket.h>
22498#include <netdb.h>
22499int
22500main ()
22501{
22502
22503#ifdef EAI_SOCKTYPE
22504gaierrval: EAI_SOCKTYPE
22505#else
22506#error "gai error value EAI_SOCKTYPE not defined"
22507#endif
22508  ;
22509  return 0;
22510}
22511_ACEOF
22512if ac_fn_c_try_cpp "$LINENO"; then :
22513  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22514$as_echo "OK" >&6; }
22515        GAIERRVALS="$GAIERRVALS EAI_SOCKTYPE"
22516
22517$as_echo "#define HAVE_ERR_EAI_SOCKTYPE 1" >>confdefs.h
22518
22519        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22520else
22521  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22522$as_echo "no" >&6; }
22523fi
22524rm -f conftest.err conftest.i conftest.$ac_ext
22525{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_SYSTEM" >&5
22526$as_echo_n "checking for getaddrinfo() error EAI_SYSTEM... " >&6; }
22527  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22528/* end confdefs.h.  */
22529
22530#include <sys/types.h>
22531#include <sys/socket.h>
22532#include <netdb.h>
22533int
22534main ()
22535{
22536
22537#ifdef EAI_SYSTEM
22538gaierrval: EAI_SYSTEM
22539#else
22540#error "gai error value EAI_SYSTEM not defined"
22541#endif
22542  ;
22543  return 0;
22544}
22545_ACEOF
22546if ac_fn_c_try_cpp "$LINENO"; then :
22547  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22548$as_echo "OK" >&6; }
22549        GAIERRVALS="$GAIERRVALS EAI_SYSTEM"
22550
22551$as_echo "#define HAVE_ERR_EAI_SYSTEM 1" >>confdefs.h
22552
22553        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22554else
22555  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22556$as_echo "no" >&6; }
22557fi
22558rm -f conftest.err conftest.i conftest.$ac_ext
22559
22560{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_ALLDONE" >&5
22561$as_echo_n "checking for getaddrinfo() error EAI_ALLDONE... " >&6; }
22562  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22563/* end confdefs.h.  */
22564
22565#include <sys/types.h>
22566#include <sys/socket.h>
22567#include <netdb.h>
22568int
22569main ()
22570{
22571
22572#ifdef EAI_ALLDONE
22573gaierrval: EAI_ALLDONE
22574#else
22575#error "gai error value EAI_ALLDONE not defined"
22576#endif
22577  ;
22578  return 0;
22579}
22580_ACEOF
22581if ac_fn_c_try_cpp "$LINENO"; then :
22582  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22583$as_echo "OK" >&6; }
22584        GAIERRVALS="$GAIERRVALS EAI_ALLDONE"
22585
22586$as_echo "#define HAVE_ERR_EAI_ALLDONE 1" >>confdefs.h
22587
22588        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22589else
22590  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22591$as_echo "no" >&6; }
22592fi
22593rm -f conftest.err conftest.i conftest.$ac_ext
22594{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_CANCELED" >&5
22595$as_echo_n "checking for getaddrinfo() error EAI_CANCELED... " >&6; }
22596  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22597/* end confdefs.h.  */
22598
22599#include <sys/types.h>
22600#include <sys/socket.h>
22601#include <netdb.h>
22602int
22603main ()
22604{
22605
22606#ifdef EAI_CANCELED
22607gaierrval: EAI_CANCELED
22608#else
22609#error "gai error value EAI_CANCELED not defined"
22610#endif
22611  ;
22612  return 0;
22613}
22614_ACEOF
22615if ac_fn_c_try_cpp "$LINENO"; then :
22616  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22617$as_echo "OK" >&6; }
22618        GAIERRVALS="$GAIERRVALS EAI_CANCELED"
22619
22620$as_echo "#define HAVE_ERR_EAI_CANCELED 1" >>confdefs.h
22621
22622        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22623else
22624  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22625$as_echo "no" >&6; }
22626fi
22627rm -f conftest.err conftest.i conftest.$ac_ext
22628{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_IDN_ENCODE" >&5
22629$as_echo_n "checking for getaddrinfo() error EAI_IDN_ENCODE... " >&6; }
22630  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22631/* end confdefs.h.  */
22632
22633#include <sys/types.h>
22634#include <sys/socket.h>
22635#include <netdb.h>
22636int
22637main ()
22638{
22639
22640#ifdef EAI_IDN_ENCODE
22641gaierrval: EAI_IDN_ENCODE
22642#else
22643#error "gai error value EAI_IDN_ENCODE not defined"
22644#endif
22645  ;
22646  return 0;
22647}
22648_ACEOF
22649if ac_fn_c_try_cpp "$LINENO"; then :
22650  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22651$as_echo "OK" >&6; }
22652        GAIERRVALS="$GAIERRVALS EAI_IDN_ENCODE"
22653
22654$as_echo "#define HAVE_ERR_EAI_IDN_ENCODE 1" >>confdefs.h
22655
22656        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22657else
22658  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22659$as_echo "no" >&6; }
22660fi
22661rm -f conftest.err conftest.i conftest.$ac_ext
22662{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_INPROGRESS" >&5
22663$as_echo_n "checking for getaddrinfo() error EAI_INPROGRESS... " >&6; }
22664  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22665/* end confdefs.h.  */
22666
22667#include <sys/types.h>
22668#include <sys/socket.h>
22669#include <netdb.h>
22670int
22671main ()
22672{
22673
22674#ifdef EAI_INPROGRESS
22675gaierrval: EAI_INPROGRESS
22676#else
22677#error "gai error value EAI_INPROGRESS not defined"
22678#endif
22679  ;
22680  return 0;
22681}
22682_ACEOF
22683if ac_fn_c_try_cpp "$LINENO"; then :
22684  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22685$as_echo "OK" >&6; }
22686        GAIERRVALS="$GAIERRVALS EAI_INPROGRESS"
22687
22688$as_echo "#define HAVE_ERR_EAI_INPROGRESS 1" >>confdefs.h
22689
22690        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22691else
22692  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22693$as_echo "no" >&6; }
22694fi
22695rm -f conftest.err conftest.i conftest.$ac_ext
22696{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_INTR" >&5
22697$as_echo_n "checking for getaddrinfo() error EAI_INTR... " >&6; }
22698  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22699/* end confdefs.h.  */
22700
22701#include <sys/types.h>
22702#include <sys/socket.h>
22703#include <netdb.h>
22704int
22705main ()
22706{
22707
22708#ifdef EAI_INTR
22709gaierrval: EAI_INTR
22710#else
22711#error "gai error value EAI_INTR not defined"
22712#endif
22713  ;
22714  return 0;
22715}
22716_ACEOF
22717if ac_fn_c_try_cpp "$LINENO"; then :
22718  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22719$as_echo "OK" >&6; }
22720        GAIERRVALS="$GAIERRVALS EAI_INTR"
22721
22722$as_echo "#define HAVE_ERR_EAI_INTR 1" >>confdefs.h
22723
22724        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22725else
22726  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22727$as_echo "no" >&6; }
22728fi
22729rm -f conftest.err conftest.i conftest.$ac_ext
22730{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_NOTCANCELED" >&5
22731$as_echo_n "checking for getaddrinfo() error EAI_NOTCANCELED... " >&6; }
22732  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22733/* end confdefs.h.  */
22734
22735#include <sys/types.h>
22736#include <sys/socket.h>
22737#include <netdb.h>
22738int
22739main ()
22740{
22741
22742#ifdef EAI_NOTCANCELED
22743gaierrval: EAI_NOTCANCELED
22744#else
22745#error "gai error value EAI_NOTCANCELED not defined"
22746#endif
22747  ;
22748  return 0;
22749}
22750_ACEOF
22751if ac_fn_c_try_cpp "$LINENO"; then :
22752  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22753$as_echo "OK" >&6; }
22754        GAIERRVALS="$GAIERRVALS EAI_NOTCANCELED"
22755
22756$as_echo "#define HAVE_ERR_EAI_NOTCANCELED 1" >>confdefs.h
22757
22758        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22759else
22760  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22761$as_echo "no" >&6; }
22762fi
22763rm -f conftest.err conftest.i conftest.$ac_ext
22764{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo() error EAI_BADEXTFLAGS" >&5
22765$as_echo_n "checking for getaddrinfo() error EAI_BADEXTFLAGS... " >&6; }
22766  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22767/* end confdefs.h.  */
22768
22769#include <sys/types.h>
22770#include <sys/socket.h>
22771#include <netdb.h>
22772int
22773main ()
22774{
22775
22776#ifdef EAI_BADEXTFLAGS
22777gaierrval: EAI_BADEXTFLAGS
22778#else
22779#error "gai error value EAI_BADEXTFLAGS not defined"
22780#endif
22781  ;
22782  return 0;
22783}
22784_ACEOF
22785if ac_fn_c_try_cpp "$LINENO"; then :
22786  { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5
22787$as_echo "OK" >&6; }
22788        GAIERRVALS="$GAIERRVALS EAI_BADEXTFLAGS"
22789
22790$as_echo "#define HAVE_ERR_EAI_BADEXTFLAGS 1" >>confdefs.h
22791
22792        cat conftest.i | grep gaierrval: >>$ERRVALFILE
22793else
22794  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22795$as_echo "no" >&6; }
22796fi
22797rm -f conftest.err conftest.i conftest.$ac_ext
22798
22799if test x"$GAIERRVALS" = x; then
22800    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22801$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22802as_fn_error $? "error: no getaddrinfo() error symbols found
22803See \`config.log' for more details" "$LINENO" 5; }
22804fi
22805ERRNOCNT=`echo $GAIERRVALS | wc -w | awk '{ print $1 }'`
22806
22807{ $as_echo "$as_me:${as_lineno-$LINENO}: checking getaddrinfo() error symbols" >&5
22808$as_echo_n "checking getaddrinfo() error symbols... " >&6; }
22809unset UNIQUEVALS UNIQUESYMBOLS
22810if test -s $ERRVALFILE; then
22811    UNIQUEVALS=`sort $ERRVALFILE | uniq | wc -l | awk '{ print $1 }'`
22812    if test $UNIQUEVALS -le 1; then
22813        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22814$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22815as_fn_error $? "error: getaddrinfo() error value count too low
22816See \`config.log' for more details" "$LINENO" 5; }
22817    fi
22818    UNIQUESYMBOLS=`cat $ERRVALFILE | wc -l | awk '{ print $1 }'`
22819    if test $UNIQUESYMBOLS -le 1; then
22820        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22821$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22822as_fn_error $? "error: getaddrinfo() error symbol count too low
22823See \`config.log' for more details" "$LINENO" 5; }
22824    fi
22825
22826    if test $ERRNOCNT -ne $UNIQUESYMBOLS; then
22827	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22828$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22829as_fn_error $? "internal error: errno symbol count mismatch
22830See \`config.log' for more details" "$LINENO" 5; }
22831    fi
22832
22833cat >>confdefs.h <<_ACEOF
22834#define UNIQUE_GAIERR_VALUES $UNIQUEVALS
22835_ACEOF
22836
22837    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unique symbols: $UNIQUESYMBOLS, unique values: $UNIQUEVALS" >&5
22838$as_echo "unique symbols: $UNIQUESYMBOLS, unique values: $UNIQUEVALS" >&6; }
22839else
22840    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
22841$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
22842as_fn_error $? "error: unable to determine getaddrinfo() error symbol values
22843See \`config.log' for more details" "$LINENO" 5; }
22844fi
22845
22846echo "" >>$ERRNOSRC
22847echo "static const errorsymboltable_t gaierrsymbolv[] = {" >>$ERRNOSRC
22848
22849#generic list
22850for errno in $GAIERRVALS; do
22851    echo "   { \"$errno\",	$errno	}," >>$ERRNOSRC
22852done
22853
22854#keyword alias list
22855maxaliaslen=0 #highest number of values for an alias
22856
22857#error values that can match 'foo' keyword (if found on platform)
22858ERRNO_foo="..."
22859keyword="foo"
22860keycnt=0
22861for keyval in ${ERRNO_foo}; do
22862    for errno in $GAIERRVALS; do
22863	if test x"$keyval" = x"$errno"; then
22864	    echo "   { \"$keyword\",	$errno	}," >>$ERRNOSRC
22865	    keycnt=`expr $keycnt + 1`
22866	fi
22867    done
22868done
22869
22870#any-error; alias for all values
22871keyword="dns-any"
22872keycnt=0
22873for errno in $GAIERRVALS; do
22874    echo "   { \"$keyword\",	$errno	}," >>$ERRNOSRC
22875    keycnt=`expr $keycnt + 1`
22876done
22877
22878if test $keycnt -gt $maxaliaslen; then
22879    maxaliaslen=$keycnt
22880fi
22881
22882echo "};" >>$ERRNOSRC
22883
22884
22885cat >>confdefs.h <<_ACEOF
22886#define MAX_GAIERR_VALUES_FOR_SYMBOL $maxaliaslen
22887_ACEOF
22888
22889rm -f $ERRVALFILE
22890
22891
22892unset COMPATFUNCS
22893
22894unset build_libscompat
22895#if test x"$prerelease" != x; then
22896#    #build libscompat for increased testing during prereleases, but
22897#    #only on platforms without complicated library systems
22898#    case $host in
22899#	 *-*-linux*)
22900#	    build_libscompat=t
22901#	    ;;
22902#    esac
22903#fi
22904
22905{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for timer macros" >&5
22906$as_echo_n "checking for timer macros... " >&6; }
22907cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22908/* end confdefs.h.  */
22909
22910#include <sys/time.h>
22911int
22912main ()
22913{
22914struct timeval tv, tv2, tv3;
22915
22916    tv.tv_sec = 0;
22917    tv.tv_usec = 0;
22918    tv2.tv_sec = 0;
22919    tv2.tv_usec = 0;
22920    tv3.tv_sec = 0;
22921    tv3.tv_usec = 0;
22922
22923    timeradd(&tv, &tv2, &tv3);
22924    timersub(&tv3, &tv2, &tv);
22925  ;
22926  return 0;
22927}
22928_ACEOF
22929if ac_fn_c_try_link "$LINENO"; then :
22930  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
22931$as_echo "yes" >&6; }
22932
22933$as_echo "#define HAVE_TIMER_MACROS 1" >>confdefs.h
22934
22935else
22936  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22937$as_echo "no" >&6; }
22938fi
22939rm -f core conftest.err conftest.$ac_objext \
22940    conftest$ac_exeext conftest.$ac_ext
22941
22942{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIOCGIFHWADDR" >&5
22943$as_echo_n "checking for SIOCGIFHWADDR... " >&6; }
22944cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22945/* end confdefs.h.  */
22946
22947#include <sys/types.h>
22948#include <sys/socket.h>
22949#include <stdio.h>
22950#include <sys/ioctl.h>
22951#include <net/if.h>
22952#ifndef SIOCGIFHWADDR
22953#error "SIOCGIFHWADDR not defined"
22954#endif
22955
22956int
22957main ()
22958{
22959
22960struct ifreq ifr;
22961unsigned char c;
22962
22963c = 0;
22964memcpy(c, ifr.ifr_hwaddr.sa_data, 1);
22965  ;
22966  return 0;
22967}
22968_ACEOF
22969if ac_fn_c_try_compile "$LINENO"; then :
22970  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
22971$as_echo "yes" >&6; }
22972
22973$as_echo "#define HAVE_SIOCGIFHWADDR 1" >>confdefs.h
22974
22975else
22976  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
22977$as_echo "no" >&6; }
22978
22979$as_echo "#define HAVE_SIOCGIFHWADDR 0" >>confdefs.h
22980
22981fi
22982rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
22983
22984{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fd_mask" >&5
22985$as_echo_n "checking for fd_mask... " >&6; }
22986cat confdefs.h - <<_ACEOF >conftest.$ac_ext
22987/* end confdefs.h.  */
22988
22989#if HAVE_SYS_SELECT_H
22990#include <sys/select.h>
22991#endif /* HAVE_SYS_SELECT_H */
22992#include <sys/types.h>
22993#include <sys/time.h>
22994#include <string.h>
22995#include <unistd.h>
22996
22997int
22998main ()
22999{
23000fd_mask foo;
23001  ;
23002  return 0;
23003}
23004_ACEOF
23005if ac_fn_c_try_compile "$LINENO"; then :
23006  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23007$as_echo "yes" >&6; }
23008
23009$as_echo "#define HAVE_FDMASK 1" >>confdefs.h
23010
23011else
23012  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23013$as_echo "no" >&6; }
23014
23015$as_echo "#define HAVE_FDMASK 0" >>confdefs.h
23016
23017fi
23018rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23019
23020{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CPU_EQUAL" >&5
23021$as_echo_n "checking for CPU_EQUAL... " >&6; }
23022cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23023/* end confdefs.h.  */
23024
23025#define _GNU_SOURCE
23026#include <sched.h>
23027int
23028main ()
23029{
23030   cpu_set_t set1, set2;
23031    if (CPU_EQUAL(&set1, &set2))
23032       return 0;
23033
23034  ;
23035  return 0;
23036}
23037_ACEOF
23038if ac_fn_c_try_link "$LINENO"; then :
23039  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23040$as_echo "yes" >&6; }
23041
23042$as_echo "#define HAVE_CPU_EQUAL 1" >>confdefs.h
23043
23044else
23045  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23046$as_echo "no" >&6; }
23047fi
23048rm -f core conftest.err conftest.$ac_objext \
23049    conftest$ac_exeext conftest.$ac_ext
23050
23051#no replacements for these
23052for ac_func in processor_bind
23053do :
23054  ac_fn_c_check_func "$LINENO" "processor_bind" "ac_cv_func_processor_bind"
23055if test "x$ac_cv_func_processor_bind" = xyes; then :
23056  cat >>confdefs.h <<_ACEOF
23057#define HAVE_PROCESSOR_BIND 1
23058_ACEOF
23059
23060fi
23061done
23062
23063
23064case $host in
23065#    *-*-freebsd[1-8]\.*)
23066    *-*-freebsd*) #XXX disable on all versions for now
23067	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling sched_setscheduler code on this platform" >&5
23068$as_echo "$as_me: WARNING: disabling sched_setscheduler code on this platform" >&2;}
23069	;;
23070    *-*-netbsd*) #XXX appears to have similar problem as freebsd
23071	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling sched_setscheduler code on this platform" >&5
23072$as_echo "$as_me: WARNING: disabling sched_setscheduler code on this platform" >&2;}
23073	;;
23074    *)
23075	for ac_func in sched_setscheduler
23076do :
23077  ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler"
23078if test "x$ac_cv_func_sched_setscheduler" = xyes; then :
23079  cat >>confdefs.h <<_ACEOF
23080#define HAVE_SCHED_SETSCHEDULER 1
23081_ACEOF
23082
23083fi
23084done
23085
23086	;;
23087esac
23088
23089for ac_header in sched.h
23090do :
23091  ac_fn_c_check_header_mongrel "$LINENO" "sched.h" "ac_cv_header_sched_h" "$ac_includes_default"
23092if test "x$ac_cv_header_sched_h" = xyes; then :
23093  cat >>confdefs.h <<_ACEOF
23094#define HAVE_SCHED_H 1
23095_ACEOF
23096
23097fi
23098
23099done
23100
23101
23102#getpassphrase() is not limited to 9 character passwords on SunOS
23103ac_fn_c_check_func "$LINENO" "getpassphrase" "ac_cv_func_getpassphrase"
23104if test "x$ac_cv_func_getpassphrase" = xyes; then :
23105
23106$as_echo "#define getpass(p) getpassphrase(p)" >>confdefs.h
23107
23108fi
23109
23110
23111{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sched_setaffinity" >&5
23112$as_echo_n "checking for sched_setaffinity... " >&6; }
23113cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23114/* end confdefs.h.  */
23115
23116#include <sched.h>
23117
23118int
23119main ()
23120{
23121   cpu_set_t set1;
23122    sched_getaffinity(0, 1, &set1);
23123    sched_setaffinity(0, 1, &set1);
23124
23125  ;
23126  return 0;
23127}
23128_ACEOF
23129if ac_fn_c_try_compile "$LINENO"; then :
23130  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23131$as_echo "yes" >&6; }
23132
23133$as_echo "#define HAVE_SCHED_SETAFFINITY 1" >>confdefs.h
23134
23135else
23136  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23137$as_echo "no" >&6; }
23138fi
23139rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23140
23141for ac_header in ifaddrs.h
23142do :
23143  ac_fn_c_check_header_mongrel "$LINENO" "ifaddrs.h" "ac_cv_header_ifaddrs_h" "$ac_includes_default"
23144if test "x$ac_cv_header_ifaddrs_h" = xyes; then :
23145  cat >>confdefs.h <<_ACEOF
23146#define HAVE_IFADDRS_H 1
23147_ACEOF
23148
23149fi
23150
23151done
23152
23153
23154for ac_func in daemon difftime getifaddrs freeifaddrs hstrerror
23155do :
23156  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
23157ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
23158if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
23159  cat >>confdefs.h <<_ACEOF
23160#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
23161_ACEOF
23162
23163fi
23164done
23165
23166for ac_func in inet_pton issetugid memmove seteuid setegid
23167do :
23168  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
23169ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
23170if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
23171  cat >>confdefs.h <<_ACEOF
23172#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
23173_ACEOF
23174
23175fi
23176done
23177
23178for ac_func in setproctitle strvis vsyslog bzero strlcpy backtrace
23179do :
23180  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
23181ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
23182if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
23183  cat >>confdefs.h <<_ACEOF
23184#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
23185_ACEOF
23186
23187fi
23188done
23189
23190#inet_ntoa - only checked for incorrect behavior
23191
23192#try to detect gcc bug (irix 64 problem, affects among others inet_ntoa)
23193{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for incorrect inet_ntoa behaviour" >&5
23194$as_echo_n "checking for incorrect inet_ntoa behaviour... " >&6; }
23195if test "$cross_compiling" = yes; then :
23196       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
23197$as_echo "assuming no" >&6; }
23198else
23199  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23200/* end confdefs.h.  */
23201
23202#include <sys/types.h>
23203#include <netinet/in.h>
23204#include <arpa/inet.h>
23205#include <sys/socket.h>
23206int main(void)
23207{
23208    struct sockaddr_in addr;
23209    char *a, *b = "195.195.195.195";
23210    addr.sin_addr.s_addr = inet_addr(b);
23211    a = inet_ntoa(addr.sin_addr);
23212    if (strcmp(a, b) == 0)
23213	return 1;
23214    else
23215	return 0;
23216}
23217
23218_ACEOF
23219if ac_fn_c_try_run "$LINENO"; then :
23220
23221$as_echo "#define HAVE_BROKEN_INET_NTOA 1" >>confdefs.h
23222
23223    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23224$as_echo "yes" >&6; }
23225    ac_cv_func_inet_ntoa=no
23226else
23227  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23228$as_echo "no" >&6; }
23229fi
23230rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23231  conftest.$ac_objext conftest.beam conftest.$ac_ext
23232fi
23233
23234
23235#AC_CHECK_FUNCS will add HAVE_foo define as long as function exists,
23236#check overselves as we only want define set if function is also working.
23237ac_cv_func_pselect=no
23238{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working pselect()" >&5
23239$as_echo_n "checking for working pselect()... " >&6; }
23240if test "$cross_compiling" = yes; then :
23241       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
23242$as_echo "assuming no" >&6; }
23243else
23244  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23245/* end confdefs.h.  */
23246
23247#include <sys/time.h>
23248#include <sys/types.h>
23249#include <errno.h>
23250#include <stdio.h>
23251#include <unistd.h>
23252
23253int
23254main(void)
23255{
23256   struct timespec ts = { 0, 0 };
23257
23258   errno = 0;
23259   if (pselect(0, NULL, NULL, NULL, &ts, NULL) == 0) {
23260      if (errno == ENOSYS) {
23261         fprintf(stderr, "pselect: error: returns 0 but errno set to ENOSYS\n");
23262         return -1;
23263      } else {
23264         fprintf(stderr, "pselect: working as expected: returns 0 and errno not ENOSYS (errno = %d)\n", errno);
23265         return 0;
23266      }
23267   } else {
23268      perror("pselect");
23269      return -1;
23270   }
23271}
23272_ACEOF
23273if ac_fn_c_try_run "$LINENO"; then :
23274  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23275$as_echo "yes" >&6; }
23276     ac_cv_func_pselect=yes
23277
23278$as_echo "#define HAVE_PSELECT 1" >>confdefs.h
23279
23280else
23281  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23282$as_echo "no" >&6; }
23283fi
23284rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23285  conftest.$ac_objext conftest.beam conftest.$ac_ext
23286fi
23287
23288
23289#AC_CHECK_FUNCS will add HAVE_foo define as long as function exists,
23290#check overselves as we only want define set if function is also working.
23291ac_cv_func_sockatmark=no
23292{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working sockatmark" >&5
23293$as_echo_n "checking for working sockatmark... " >&6; }
23294if test "$cross_compiling" = yes; then :
23295       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
23296$as_echo "assuming no" >&6; }
23297else
23298  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23299/* end confdefs.h.  */
23300
23301#include <sys/types.h>
23302#include <sys/socket.h>
23303
23304int
23305main()
23306{
23307    int s;
23308    int r;
23309
23310    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1)
23311	return 1;
23312    if ((r = sockatmark(s)) == -1)
23313	return 1;
23314    return 0;
23315}
23316_ACEOF
23317if ac_fn_c_try_run "$LINENO"; then :
23318  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23319$as_echo "yes" >&6; }
23320     ac_cv_func_sockatmark=yes
23321
23322$as_echo "#define HAVE_SOCKATMARK 1" >>confdefs.h
23323
23324else
23325  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23326$as_echo "no" >&6; }
23327fi
23328rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23329  conftest.$ac_objext conftest.beam conftest.$ac_ext
23330fi
23331
23332
23333#XXX
23334#if `uname` != OpenBSD; then
23335#   ac_cv_func_getifaddrs=no
23336#   AC_MSG_WARN([notice: using libscompat getifaddrs() function])
23337#fi
23338
23339#only compile files that are needed, client
23340unset LIBSCSRC LIBDSCSRC
23341CLIENTONLY="issetugid"
23342SERVERONLY="daemon seteuid sockatmark"
23343SHAREDFUNCS="getifaddrs hstrerror inet_ntoa inet_pton memmove pselect setproctitle strlcpy strvis vsyslog"
23344#XXXold?: difftime
23345for func in $CLIENTONLY $SHAREDFUNCS; do
23346    var=ac_cv_func_${func}
23347    if test ! -s "libscompat/${func}.c"; then
23348	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: error: libscompat file for $func missing" >&5
23349$as_echo "$as_me: WARNING: error: libscompat file for $func missing" >&2;}
23350	exit 1
23351    fi
23352    if eval "test x\"\$${var}\" = xno"; then
23353	LIBSCSRC="${LIBSCSRC}${LIBSCSRC:+ }${func}.lo"
23354	LIBDSCSRC="${LIBDSCSRC}${LIBDSCSRC:+ }libdsocks_la-${func}.lo"
23355	COMPATFUNCS="$COMPATFUNCS${COMPATFUNCS:+ }$func"
23356    fi
23357done
23358if test x"${build_libscompat}" != x; then
23359   unset LIBSCSRC LIBDSCSRC #link directly with libscompat i prerelease
23360fi
23361
23362
23363
23364#server
23365unset SOCKDCOMPAT
23366for func in $SERVERONLY $SHAREDFUNCS; do
23367    var=ac_cv_func_${func}
23368    if test ! -s "libscompat/${func}.c"; then
23369	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: error: libscompat file for $func missing" >&5
23370$as_echo "$as_me: WARNING: error: libscompat file for $func missing" >&2;}
23371	exit 1
23372    fi
23373    if eval "test x\"\$${var}\" = xno"; then
23374	SOCKDCOMPAT="${SOCKDCOMPAT}${SOCKDCOMPAT:+ }${func}.${OBJEXT}"
23375	COMPATFUNCS="$COMPATFUNCS${COMPATFUNCS:+ }$func"
23376    fi
23377done
23378if test x"${build_libscompat}" != x; then
23379   unset SOCKDCOMPAT #link directly with libscompat i prerelease
23380   COMPATFUNCS="$CLIENTONLY $SERVERONLY $SHAREDFUNCS"
23381fi
23382COMPATFUNCS=`echo $COMPATFUNCS | xargs -n1 | sort | uniq | xargs`
23383
23384
23385if test x"$LIBSCSRC" != x; then
23386   LINTSCCOMPATLIB="-lscompat"
23387fi
23388
23389
23390
23391
23392cat >>confdefs.h <<_ACEOF
23393#define DANTE_COMPATFILES "$COMPATFUNCS"
23394_ACEOF
23395
23396
23397if test x"${ac_cv_func_bzero}" = xno; then
23398
23399$as_echo "#define bzero(b, len) memset((b), 0, (len))" >>confdefs.h
23400
23401fi
23402
23403
23404#causes problems with packaging, allow test to be turned off
23405
23406# Check whether --with-glibc-secure was given.
23407if test "${with_glibc_secure+set}" = set; then :
23408  withval=$with_glibc_secure; GLIBCSEC=$withval
23409fi
23410
23411
23412if test "${GLIBCSEC}" != no; then
23413    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __libc_enable_secure" >&5
23414$as_echo_n "checking for __libc_enable_secure... " >&6; }
23415    if test "$cross_compiling" = yes; then :
23416      { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
23417$as_echo "assuming no" >&6; }
23418else
23419  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23420/* end confdefs.h.  */
23421
23422extern int __libc_enable_secure;
23423
23424int main()
23425{
23426    if (__libc_enable_secure == 0)
23427	return 0;
23428
23429	return 1;
23430}
23431_ACEOF
23432if ac_fn_c_try_run "$LINENO"; then :
23433  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23434$as_echo "yes" >&6; }
23435
23436$as_echo "#define HAVE_LIBC_ENABLE_SECURE 1" >>confdefs.h
23437
23438else
23439  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23440$as_echo "no" >&6; }
23441fi
23442rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23443  conftest.$ac_objext conftest.beam conftest.$ac_ext
23444fi
23445
23446fi
23447
23448if test x"$GLIBCSEC" = xno; then
23449
23450$as_echo "#define HAVE_LIBC_ENABLE_SECURE_DISABLED 1" >>confdefs.h
23451
23452fi
23453
23454{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIONREAD socket support" >&5
23455$as_echo_n "checking for FIONREAD socket support... " >&6; }
23456if test "$cross_compiling" = yes; then :
23457       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
23458$as_echo "assuming no" >&6; }
23459else
23460  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23461/* end confdefs.h.  */
23462
23463#include <sys/types.h>
23464#include <sys/ioctl.h>
23465#include <sys/socket.h>
23466
23467int
23468main(void)
23469{
23470	int bufdat, s;
23471
23472	if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
23473	   perror("socket");
23474	   return -1;
23475	}
23476
23477	if (ioctl(s, FIONREAD, &bufdat) == -1) {
23478	   perror("ioctl");
23479	   return -1;
23480	}
23481
23482	return 0;
23483}
23484_ACEOF
23485if ac_fn_c_try_run "$LINENO"; then :
23486  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23487$as_echo "yes" >&6; }
23488
23489$as_echo "#define HAVE_RECVBUF_IOCTL 1" >>confdefs.h
23490
23491
23492$as_echo "#define RECVBUF_IOCTLVAL FIONREAD" >>confdefs.h
23493
23494else
23495  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23496$as_echo "no" >&6; }
23497fi
23498rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23499  conftest.$ac_objext conftest.beam conftest.$ac_ext
23500fi
23501
23502
23503{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for FIONWRITE socket support" >&5
23504$as_echo_n "checking for FIONWRITE socket support... " >&6; }
23505if test "$cross_compiling" = yes; then :
23506       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23507$as_echo "no" >&6; }
23508else
23509  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23510/* end confdefs.h.  */
23511
23512#include <sys/types.h>
23513#include <sys/ioctl.h>
23514#include <sys/socket.h>
23515
23516int
23517main(void)
23518{
23519	int bufdat, s;
23520
23521	if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
23522	   perror("socket");
23523	   return -1;
23524	}
23525
23526	if (ioctl(s, FIONWRITE, &bufdat) == -1) {
23527	   perror("ioctl");
23528	   return -1;
23529	}
23530
23531	return 0;
23532}
23533_ACEOF
23534if ac_fn_c_try_run "$LINENO"; then :
23535  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23536$as_echo "yes" >&6; }
23537
23538$as_echo "#define HAVE_SENDBUF_IOCTL 1" >>confdefs.h
23539
23540
23541$as_echo "#define SENDBUF_IOCTLVAL FIONWRITE" >>confdefs.h
23542
23543else
23544  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23545$as_echo "no" >&6; }
23546
23547     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIOCOUTQ socket support" >&5
23548$as_echo_n "checking for TIOCOUTQ socket support... " >&6; }
23549     if test "$cross_compiling" = yes; then :
23550  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
23551$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
23552as_fn_error $? "cannot run test program while cross compiling
23553See \`config.log' for more details" "$LINENO" 5; }
23554else
23555  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23556/* end confdefs.h.  */
23557
23558#include <sys/types.h>
23559#include <sys/ioctl.h>
23560#include <sys/socket.h>
23561
23562int
23563main(void)
23564{
23565	int bufdat, s;
23566
23567	if ((s = socket(PF_INET, SOCK_STREAM, 0)) == -1) {
23568	   perror("socket");
23569	   return -1;
23570	}
23571
23572	if (ioctl(s, TIOCOUTQ, &bufdat) == -1) {
23573	   perror("ioctl");
23574	   return -1;
23575	}
23576
23577	return 0;
23578}
23579_ACEOF
23580if ac_fn_c_try_run "$LINENO"; then :
23581  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23582$as_echo "yes" >&6; }
23583
23584$as_echo "#define HAVE_SENDBUF_IOCTL TIOCOUTQ" >>confdefs.h
23585
23586
23587$as_echo "#define SENDBUF_IOCTLVAL TIOCOUTQ" >>confdefs.h
23588
23589else
23590  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23591$as_echo "no" >&6; }
23592fi
23593rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23594  conftest.$ac_objext conftest.beam conftest.$ac_ext
23595fi
23596
23597fi
23598rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23599  conftest.$ac_objext conftest.beam conftest.$ac_ext
23600fi
23601
23602
23603#set to a high value for systems where this is possible
23604case $host in
23605    *-*-linux-* | *-*-aix*)
23606	#nada
23607	;;
23608
23609    *)
23610	CPPFLAGS="$CPPFLAGS${CPPFLAGS:+ }-DFD_SETSIZE=65536"
23611	;;
23612esac
23613
23614#on most platforms FD_SETSIZE can be ignored
23615case $host in
23616    *-*-solaris*)
23617
23618$as_echo "#define FD_SETSIZE_LIMITS_SELECT 1" >>confdefs.h
23619
23620	;;
23621    *)
23622
23623$as_echo "#define FD_SETSIZE_LIMITS_SELECT 0" >>confdefs.h
23624
23625	;;
23626esac
23627
23628#lack of unified buffers result in less optimal shmem.c performance
23629{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sufficiently unified buffer cache" >&5
23630$as_echo_n "checking for sufficiently unified buffer cache... " >&6; }
23631 if test "$cross_compiling" = yes; then :
23632         { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23633$as_echo "no" >&6; }
23634       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: assuming buffercache not unified on this platform" >&5
23635$as_echo "$as_me: WARNING: assuming buffercache not unified on this platform" >&2;}
23636else
23637  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23638/* end confdefs.h.  */
23639
23640
23641#include <sys/types.h>
23642#include <sys/uio.h>
23643#include <sys/mman.h>
23644
23645#include <assert.h>
23646#include <unistd.h>
23647#include <stdio.h>
23648#include <stdlib.h>
23649#include <string.h>
23650#include <errno.h>
23651#include <fcntl.h>
23652
23653#ifndef MAP_FAILED
23654#define MAP_FAILED (-1)
23655#endif
23656
23657#define ELEMENTS(array) (sizeof(array) / sizeof(array[0]))
23658#define FILENAME        ".tmpfile"
23659#define TESTITERATIONS  (128)
23660
23661int
23662main(void)
23663{
23664   FILE *fp;
23665   size_t testi, i;
23666   int array[2];
23667
23668   assert(ELEMENTS(array) % 2 == 0);
23669
23670   if ((fp = fopen(FILENAME, "w+")) == NULL) {
23671      fprintf(stderr, "fopen(%s) failed: %s", FILENAME, strerror(errno));
23672      exit(1);
23673   }
23674
23675   if (ftruncate(fileno(fp), (off_t)sizeof(array)) == -1) {
23676      perror("ftruncate()");
23677      exit(1);
23678   }
23679
23680   fprintf(stderr, "created file %s of size %lu, mmap()'ing it  ...\n",
23681          FILENAME, (unsigned long)sizeof(array));
23682
23683   fclose(fp);
23684
23685   for (testi = 0; testi < TESTITERATIONS; ++testi) {
23686      /*
23687       * This test mmap(2)'s a file, moves some of the mmap(2)-ed memory
23688       * around, unmap(2)s, and then truncate(2)s the file to a smaller size.
23689       *
23690       * Afterwards it again mmap(2)'s the same file using the smaller
23691       * (truncated) size and checks that the contents, up to the smaller
23692       * truncated size, is correct and the same as it was before the unmap(2).
23693       *
23694       * On OpenBSD this for some reason fails and we end up with
23695       * old data from the previous iteration in the remapped array. :-/
23696       */
23697      off_t truncatedsize;
23698      int *map, beforeunmap[ELEMENTS(array)], afterremap[ELEMENTS(array)];
23699
23700      /* just to make sure user does not change one but not the other. */
23701      assert(sizeof(*map) == sizeof(*array));
23702
23703      for (i = 0; i < ELEMENTS(array); ++i)
23704         array[i] = (int)random();
23705
23706      if ((fp = fopen(FILENAME, "r+")) == NULL) {
23707         fprintf(stderr, "fopen(%s) failed: %s", FILENAME, strerror(errno));
23708         exit(1);
23709      }
23710
23711      if ((map = mmap(NULL,
23712                      sizeof(array),
23713                      PROT_READ | PROT_WRITE,
23714                      MAP_SHARED,
23715                      fileno(fp),
23716                      (off_t)0)) == MAP_FAILED) {
23717         perror("mmap()");
23718         exit(1);
23719      }
23720
23721      fclose(fp);
23722
23723      memcpy(map,         array, sizeof(array));
23724      memcpy(beforeunmap, map,   sizeof(array));
23725
23726      assert(memcmp(map,         array, sizeof(array)) == 0);
23727      assert(memcmp(beforeunmap, array, sizeof(array)) == 0);
23728
23729      array[0] = array[1]; /* 0xdeadbeef */
23730      map[0]   = array[1]; /* 0xdeadbeef */
23731
23732      memcpy(beforeunmap, map, sizeof(array));
23733
23734      assert(memcmp(map,         array, sizeof(array)) == 0);
23735      assert(memcmp(beforeunmap, array, sizeof(array)) == 0);
23736
23737      truncatedsize = (off_t)(sizeof(array) / 2);
23738      assert(memcmp(map,         array, (size_t)truncatedsize) == 0);
23739      assert(memcmp(beforeunmap, array, (size_t)truncatedsize) == 0);
23740
23741#if 0
23742      /*
23743       * with a unified buffercache the below msync(2) should not
23744       * be needed as the subsequent open(2) and mmap(2)-ed should
23745       * read from the buffercache if the data is still there, or
23746       * from file if already flushed from cache to disk.
23747       */
23748
23749      if (msync(map, truncatedsize, MS_ASYNC) == -1) {
23750         perror("msync(2)");
23751         exit(1);
23752      }
23753#endif
23754      if (munmap(map, sizeof(array)) == -1) {
23755         perror("munmap()");
23756         exit(1);
23757      }
23758
23759      if (truncate(FILENAME, truncatedsize) == -1) {
23760         perror("truncate()");
23761         exit(1);
23762      }
23763
23764      if ((fp = fopen(FILENAME, "r+")) == NULL) {
23765         fprintf(stderr, "fopen(%s) failed: %s", FILENAME, strerror(errno));
23766         exit(1);
23767      }
23768
23769      if ((map = mmap(NULL,
23770                      truncatedsize,
23771                      PROT_READ | PROT_WRITE,
23772                      MAP_SHARED,
23773                      fileno(fp),
23774                      (off_t)0)) == MAP_FAILED) {
23775         perror("mmap()");
23776         exit(1);
23777      }
23778
23779      fclose(fp);
23780
23781      bzero(afterremap, sizeof(afterremap));
23782      memcpy(afterremap, map, (size_t)truncatedsize);
23783
23784      if (beforeunmap[0] != afterremap[0]) {
23785         fprintf(stderr, "on iteration %lu re-mapped() array index 0 of size %lu "
23786                "does not match what we unmapped() previously\n",
23787                (unsigned long)testi + 1,
23788                (unsigned long)sizeof(beforeunmap[0]));
23789
23790         exit(1);
23791      }
23792
23793      if (memcmp(beforeunmap, afterremap, (size_t)truncatedsize) != 0) {
23794         fprintf(stderr, "on iteration %lu re-mapped() data of size %lu (%s) "
23795                "does not match what we unmapped() previously\n",
23796                (unsigned long)testi + 1,
23797                (unsigned long)truncatedsize,
23798                truncatedsize == sizeof(array) ? "not truncated" : "truncated");
23799
23800         exit(1);
23801      }
23802
23803      if (truncate(FILENAME, (size_t)sizeof(array)) == -1) {
23804         perror("truncate()");
23805         exit(1);
23806      }
23807   }
23808
23809   fprintf(stderr, "tested through %lu iterations, all ok\n", (unsigned long)testi);
23810
23811   if (unlink(FILENAME) != 0) {
23812      perror("unlink()");
23813      exit(1);
23814   }
23815
23816   return 0;
23817}
23818
23819_ACEOF
23820if ac_fn_c_try_run "$LINENO"; then :
23821  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23822$as_echo "yes" >&6; }
23823
23824$as_echo "#define HAVE_UNIFIED_BUFFERCACHE 1" >>confdefs.h
23825
23826else
23827  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23828$as_echo "no" >&6; }
23829       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: assuming buffercache not unified on this platform" >&5
23830$as_echo "$as_me: WARNING: assuming buffercache not unified on this platform" >&2;}
23831fi
23832rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23833  conftest.$ac_objext conftest.beam conftest.$ac_ext
23834fi
23835
23836
23837#XXX should be in osdep.m4
23838{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
23839$as_echo_n "checking for library containing clock_gettime... " >&6; }
23840if ${ac_cv_search_clock_gettime+:} false; then :
23841  $as_echo_n "(cached) " >&6
23842else
23843  ac_func_search_save_LIBS=$LIBS
23844cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23845/* end confdefs.h.  */
23846
23847/* Override any GCC internal prototype to avoid an error.
23848   Use char because int might match the return type of a GCC
23849   builtin and then its argument prototype would still apply.  */
23850#ifdef __cplusplus
23851extern "C"
23852#endif
23853char clock_gettime ();
23854int
23855main ()
23856{
23857return clock_gettime ();
23858  ;
23859  return 0;
23860}
23861_ACEOF
23862for ac_lib in '' rt; do
23863  if test -z "$ac_lib"; then
23864    ac_res="none required"
23865  else
23866    ac_res=-l$ac_lib
23867    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
23868  fi
23869  if ac_fn_c_try_link "$LINENO"; then :
23870  ac_cv_search_clock_gettime=$ac_res
23871fi
23872rm -f core conftest.err conftest.$ac_objext \
23873    conftest$ac_exeext
23874  if ${ac_cv_search_clock_gettime+:} false; then :
23875  break
23876fi
23877done
23878if ${ac_cv_search_clock_gettime+:} false; then :
23879
23880else
23881  ac_cv_search_clock_gettime=no
23882fi
23883rm conftest.$ac_ext
23884LIBS=$ac_func_search_save_LIBS
23885fi
23886{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
23887$as_echo "$ac_cv_search_clock_gettime" >&6; }
23888ac_res=$ac_cv_search_clock_gettime
23889if test "$ac_res" != no; then :
23890  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
23891
23892fi
23893
23894{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CLOCK_MONOTONIC clock_gettime() support" >&5
23895$as_echo_n "checking for CLOCK_MONOTONIC clock_gettime() support... " >&6; }
23896if test "$cross_compiling" = yes; then :
23897       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
23898$as_echo "assuming no" >&6; }
23899else
23900  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
23901/* end confdefs.h.  */
23902
23903#include <sys/time.h>
23904#include <time.h>
23905
23906int
23907main(void)
23908{
23909	struct timespec ts;
23910
23911	if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) {
23912	   perror("clock_gettime");
23913	   return -1;
23914	}
23915
23916	return 0;
23917}
23918_ACEOF
23919if ac_fn_c_try_run "$LINENO"; then :
23920  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23921$as_echo "yes" >&6; }
23922
23923$as_echo "#define HAVE_CLOCK_GETTIME_MONOTONIC 1" >>confdefs.h
23924
23925else
23926  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23927$as_echo "no" >&6; }
23928fi
23929rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
23930  conftest.$ac_objext conftest.beam conftest.$ac_ext
23931fi
23932
23933
23934
23935case $host in
23936    *-*-osf*)
23937	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: OSF support might be removed in the near future." >&5
23938$as_echo "$as_me: WARNING: OSF support might be removed in the near future." >&2;}
23939	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please contact dante-bugs@inet.no if you are using this platform." >&5
23940$as_echo "$as_me: WARNING: Please contact dante-bugs@inet.no if you are using this platform." >&2;}
23941	exit 1
23942	;;
23943esac
23944
23945#known keywords for --enable/disable-foo(=yes/no)?
23946LTINTERNAL="dlopen|dlopen_self|dlopen_self_static|fast_install|libtool_lock|win32_dll|shared_with_static_runtimes|shared_with_static_runtimes_CXX|shared_with_static_runtimes_F77|option_checking|silent_rules"
23947KNOWN_KEYWORDS="$LTINTERNAL|shared|static|debug|warnings|diagnostic|profiling|coverage|linting|libwrap|preload|serverdl|clientdl|internal|pidfile|drt_fallback|release|dependency_tracking|largefile|livedebug|clientbuild|serverbuild|client|server|libcfail"
23948for keyword in `set | egrep '^enable_' | sed -e 's/^enable_//' | \
23949                sed -e 's/=.*$//'`; do
23950    echo $keyword | egrep "^(${KNOWN_KEYWORDS})$" > /dev/null
23951    if test $? -ne 0; then
23952	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown --enable/disable keyword '$keyword'" >&5
23953$as_echo "$as_me: WARNING: unknown --enable/disable keyword '$keyword'" >&2;}
23954	#check is not entirely reliable, only exit in prerelease
23955	if test x"$prerelease" != x; then
23956	    exit 1
23957	fi
23958    fi
23959done
23960
23961#known keywords for --with/without-foo?
23962LTINTERNAL="gnu_ld|pic|tags|gnu_ldcxx|sysroot"
23963KNOWN_KEYWORDS="$LTINTERNAL|socks_conf|sockd_conf|pidfile|iomax|negmax|bufsize|libc|upnp|pam|bsdauth|full_env|gssapi_path|gssapi|krb5_config|krb5|krb5_path|pac|ldap|ldap_path|sasl|sasl_path|glibc_secure|libwrap"
23964for keyword in `set | egrep '^with_' | sed -e 's/^with_//' | \
23965                sed -e 's/=.*$//'`; do
23966    echo $keyword | egrep "^(${KNOWN_KEYWORDS})$" > /dev/null
23967    if test $? -ne 0; then
23968	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown --with/without keyword '$keyword'" >&5
23969$as_echo "$as_me: WARNING: unknown --with/without keyword '$keyword'" >&2;}
23970	#check is not entirely reliable, only exit in prerelease
23971	if test x"$prerelease" != x; then
23972	    exit 1
23973	fi
23974    fi
23975done
23976
23977
23978
23979unset NOCLIENT
23980{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether client compilation should be disabled" >&5
23981$as_echo_n "checking whether client compilation should be disabled... " >&6; }
23982# Check whether --enable-client was given.
23983if test "${enable_client+set}" = set; then :
23984  enableval=$enable_client; if test x"$enableval" = xno; then
23985    NOCLIENT="Disabled, using --disable-client"
23986 fi
23987fi
23988
23989if test x"$NOCLIENT" != x; then
23990    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
23991$as_echo "no" >&6; }
23992    CONFVAR="${CONFVAR}${CONFVAR:+ }noclient"
23993else
23994    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
23995$as_echo "yes" >&6; }
23996    CONFVAR="${CONFVAR}${CONFVAR:+ }client"
23997fi
23998
23999unset NOSERVER
24000{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether server compilation should be disabled" >&5
24001$as_echo_n "checking whether server compilation should be disabled... " >&6; }
24002# Check whether --enable-server was given.
24003if test "${enable_server+set}" = set; then :
24004  enableval=$enable_server; if test x"$enableval" = xno; then
24005    NOSERVER="Disabled, using --disable-server"
24006 fi
24007fi
24008
24009if test x"$NOSERVER" != x; then
24010    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24011$as_echo "no" >&6; }
24012    CONFVAR="${CONFVAR}${CONFVAR:+ }noserver"
24013else
24014    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24015$as_echo "yes" >&6; }
24016    CONFVAR="${CONFVAR}${CONFVAR:+ }server"
24017fi
24018
24019if test x"$NOCLIENT" != x -a x"$NOSERVER" != x; then
24020    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot disable both client and server compilation" >&5
24021$as_echo "$as_me: WARNING: cannot disable both client and server compilation" >&2;}
24022    exit 1
24023fi
24024
24025#allow default file locations to be overridden
24026unset SOCKSCONFPATH
24027{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for client configuration file location" >&5
24028$as_echo_n "checking for client configuration file location... " >&6; }
24029
24030# Check whether --with-socks-conf was given.
24031if test "${with_socks_conf+set}" = set; then :
24032  withval=$with_socks_conf; SOCKSCONFPATH="$withval"
24033else
24034  #set default socks.conf path
24035 SOCKSCONFPATH="/etc/socks.conf"
24036fi
24037
24038
24039cat >>confdefs.h <<_ACEOF
24040#define SOCKS_CONFIGFILE "$SOCKSCONFPATH"
24041_ACEOF
24042
24043{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOCKSCONFPATH" >&5
24044$as_echo "$SOCKSCONFPATH" >&6; }
24045
24046unset SOCKDCONFPATH
24047{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for server configuration file location" >&5
24048$as_echo_n "checking for server configuration file location... " >&6; }
24049
24050# Check whether --with-sockd-conf was given.
24051if test "${with_sockd_conf+set}" = set; then :
24052  withval=$with_sockd_conf; SOCKDCONFPATH="$withval"
24053else
24054  #set default sockd.conf path
24055 SOCKDCONFPATH="/etc/${SERVNAME}.conf"
24056fi
24057
24058
24059cat >>confdefs.h <<_ACEOF
24060#define SOCKD_CONFIGFILE "$SOCKDCONFPATH"
24061_ACEOF
24062
24063{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SOCKDCONFPATH" >&5
24064$as_echo "$SOCKDCONFPATH" >&6; }
24065
24066unset NOBSDAUTH
24067for ac_header in bsd_auth.h
24068do :
24069  ac_fn_c_check_header_mongrel "$LINENO" "bsd_auth.h" "ac_cv_header_bsd_auth_h" "$ac_includes_default"
24070if test "x$ac_cv_header_bsd_auth_h" = xyes; then :
24071  cat >>confdefs.h <<_ACEOF
24072#define HAVE_BSD_AUTH_H 1
24073_ACEOF
24074
24075fi
24076
24077done
24078
24079ac_fn_c_check_func "$LINENO" "auth_userokay" "ac_cv_func_auth_userokay"
24080if test "x$ac_cv_func_auth_userokay" = xyes; then :
24081
24082fi
24083
24084{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for bsd authentication" >&5
24085$as_echo_n "checking for bsd authentication... " >&6; }
24086
24087# Check whether --with-bsdauth was given.
24088if test "${with_bsdauth+set}" = set; then :
24089  withval=$with_bsdauth; if test x"$withval" = xno; then
24090    NOBSDAUTH="Disabled, using --without-bsdauth"
24091 fi
24092fi
24093
24094
24095if test x"$NOBSDAUTH" != x; then
24096    { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
24097$as_echo "disabled" >&6; }
24098else
24099    #look for bsd authentication support
24100    if test x"${ac_cv_header_bsd_auth_h}" = xno; then
24101	NOBSDAUTH="Disabled, usable bsd_auth.h not found"
24102	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, usable bsd_auth.h not found" >&5
24103$as_echo "no, usable bsd_auth.h not found" >&6; }
24104    else
24105	if test x"${ac_cv_func_auth_userokay}" = xno; then
24106	    NOBSDAUTH="Disabled, auth_userokay function not found"
24107	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, auth_userokay function not found" >&5
24108$as_echo "no, auth_userokay function not found" >&6; }
24109	else
24110
24111$as_echo "#define HAVE_BSDAUTH 1" >>confdefs.h
24112
24113	    FEAT="$FEAT${FEAT:+ }bsdauth"
24114	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24115$as_echo "yes" >&6; }
24116	fi
24117    fi
24118fi
24119
24120#only relevant for platforms lacking issetugid()
24121{ $as_echo "$as_me:${as_lineno-$LINENO}: checking full environment usage" >&5
24122$as_echo_n "checking full environment usage... " >&6; }
24123
24124# Check whether --with-full-env was given.
24125if test "${with_full_env+set}" = set; then :
24126  withval=$with_full_env; CONFENV=$withval
24127fi
24128
24129if test x"$CONFENV" = xno; then
24130    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24131$as_echo "no" >&6; }
24132
24133$as_echo "#define HAVE_CONFENV_DISABLE 1" >>confdefs.h
24134
24135else
24136    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24137$as_echo "yes" >&6; }
24138fi
24139
24140{ $as_echo "$as_me:${as_lineno-$LINENO}: checking direct route fallback in client enabled" >&5
24141$as_echo_n "checking direct route fallback in client enabled... " >&6; }
24142# Check whether --enable-drt-fallback was given.
24143if test "${enable_drt_fallback+set}" = set; then :
24144  enableval=$enable_drt_fallback;
24145else
24146  #disable fallback by default
24147 enable_drt_fallback=no
24148fi
24149
24150if test x"${enable_drt_fallback}" = xyes; then
24151
24152$as_echo "#define SOCKS_DIRECTROUTE_FALLBACK 1" >>confdefs.h
24153
24154    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24155$as_echo "yes" >&6; }
24156else
24157
24158$as_echo "#define SOCKS_DIRECTROUTE_FALLBACK 0" >>confdefs.h
24159
24160    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24161$as_echo "no" >&6; }
24162fi
24163
24164#library checks for preloading code
24165
24166#A good time to save the cache (preload code might fail)
24167cat >confcache <<\_ACEOF
24168# This file is a shell script that caches the results of configure
24169# tests run on this system so they can be shared between configure
24170# scripts and configure runs, see configure's option --config-cache.
24171# It is not useful on other systems.  If it contains results you don't
24172# want to keep, you may remove or edit it.
24173#
24174# config.status only pays attention to the cache file if you give it
24175# the --recheck option to rerun configure.
24176#
24177# `ac_cv_env_foo' variables (set or unset) will be overridden when
24178# loading this file, other *unset* `ac_cv_foo' will be assigned the
24179# following values.
24180
24181_ACEOF
24182
24183# The following way of writing the cache mishandles newlines in values,
24184# but we know of no workaround that is simple, portable, and efficient.
24185# So, we kill variables containing newlines.
24186# Ultrix sh set writes to stderr and can't be redirected directly,
24187# and sets the high bit in the cache file unless we assign to the vars.
24188(
24189  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
24190    eval ac_val=\$$ac_var
24191    case $ac_val in #(
24192    *${as_nl}*)
24193      case $ac_var in #(
24194      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
24195$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
24196      esac
24197      case $ac_var in #(
24198      _ | IFS | as_nl) ;; #(
24199      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
24200      *) { eval $ac_var=; unset $ac_var;} ;;
24201      esac ;;
24202    esac
24203  done
24204
24205  (set) 2>&1 |
24206    case $as_nl`(ac_space=' '; set) 2>&1` in #(
24207    *${as_nl}ac_space=\ *)
24208      # `set' does not quote correctly, so add quotes: double-quote
24209      # substitution turns \\\\ into \\, and sed turns \\ into \.
24210      sed -n \
24211	"s/'/'\\\\''/g;
24212	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
24213      ;; #(
24214    *)
24215      # `set' quotes correctly as required by POSIX, so do not add quotes.
24216      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
24217      ;;
24218    esac |
24219    sort
24220) |
24221  sed '
24222     /^ac_cv_env_/b end
24223     t clear
24224     :clear
24225     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
24226     t end
24227     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
24228     :end' >>confcache
24229if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
24230  if test -w "$cache_file"; then
24231    if test "x$cache_file" != "x/dev/null"; then
24232      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
24233$as_echo "$as_me: updating cache $cache_file" >&6;}
24234      if test ! -f "$cache_file" || test -h "$cache_file"; then
24235	cat confcache >"$cache_file"
24236      else
24237        case $cache_file in #(
24238        */* | ?:*)
24239	  mv -f confcache "$cache_file"$$ &&
24240	  mv -f "$cache_file"$$ "$cache_file" ;; #(
24241        *)
24242	  mv -f confcache "$cache_file" ;;
24243	esac
24244      fi
24245    fi
24246  else
24247    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
24248$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
24249  fi
24250fi
24251rm -f confcache
24252
24253SOLIB_POSTFIX=so
24254unset SOFULLPATH
24255
24256case $host in
24257    *-*-aix*)
24258	PRELOAD="LDR"
24259	SOLIB_POSTFIX="a(shr.o)"
24260	#XXX final part might vary, LDR_PRELOAD64 shr_64.o?
24261	#XXX libdsocks_64.so or similar for 64 bit
24262	#XXX extra variable for last part (not part of file name)
24263	SOFULLPATH=t
24264	;;
24265
24266    alpha*-dec-osf*)
24267
24268$as_echo "#define HAVE_DEC_PROTO 1" >>confdefs.h
24269
24270
24271$as_echo "#define HAVE_EXTRA_OSF_SYMBOLS 1" >>confdefs.h
24272
24273	PRELOAD="RLD"
24274	;;
24275
24276    *-*-hpux*)
24277	SOLIB_POSTFIX=sl
24278	;;
24279
24280    *-*-darwin*)
24281	SOLIB_POSTFIX=dylib
24282	PRELOAD="DYLD"
24283	SOFULLPATH=t
24284	;;
24285
24286    *-*-irix*)
24287	PRELOAD="RLD"
24288	;;
24289
24290    *-*-cygwin)
24291	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling preloading" >&5
24292$as_echo "$as_me: WARNING: disabling preloading" >&2;}
24293	no_preload_client=t
24294	no_preload_server=t
24295	no_preload=t
24296
24297$as_echo "#define HAVE_NO_RESOLVESTUFF 1" >>confdefs.h
24298
24299	;;
24300esac
24301
24302
24303
24304case $PRELOAD in
24305    DYLD)
24306	PRELOAD_SEPERATOR=":"
24307	PRELOAD_VARIABLE="DYLD_INSERT_LIBRARIES"
24308	PRELOAD_POSTFIX=""
24309	;;
24310
24311    RLD)
24312	PRELOAD_SEPERATOR=":"
24313	PRELOAD_VARIABLE="_RLD_LIST"
24314	PRELOAD_POSTFIX="DEFAULT"
24315	;;
24316
24317    LDR)
24318	PRELOAD_SEPERATOR=":"
24319	PRELOAD_VARIABLE="LDR_PRELOAD"
24320	PRELOAD_POSTFIX=""
24321	;;
24322
24323    *)
24324	PRELOAD_SEPERATOR=" "
24325	PRELOAD_VARIABLE="LD_PRELOAD"
24326	PRELOAD_POSTFIX=""
24327	;;
24328esac
24329
24330
24331
24332
24333
24334## preload related tests
24335#build without support for preloading?
24336
24337{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RES_INIT in resolv.h" >&5
24338$as_echo_n "checking for RES_INIT in resolv.h... " >&6; }
24339cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24340/* end confdefs.h.  */
24341
24342#include <sys/types.h>
24343#include <netinet/in.h>
24344#include <arpa/nameser.h>
24345#include <resolv.h>
24346
24347int
24348main ()
24349{
24350
24351#ifndef RES_INIT
24352#error "no RES_INIT"
24353#endif
24354  ;
24355  return 0;
24356}
24357_ACEOF
24358if ac_fn_c_try_compile "$LINENO"; then :
24359  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24360$as_echo "yes" >&6; }
24361else
24362  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24363$as_echo "no" >&6; }
24364
24365$as_echo "#define HAVE_NO_RESOLVESTUFF 1" >>confdefs.h
24366
24367fi
24368rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24369
24370# HAVE_DLFCN_H only determines if the include file exists
24371ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default"
24372if test "x$ac_cv_header_dlfcn_h" = xyes; then :
24373
24374$as_echo "#define HAVE_DLFCN_H 1" >>confdefs.h
24375
24376 have_dlfcn_h=t
24377else
24378  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dlfcn.h missing, preloading disabled" >&5
24379$as_echo "$as_me: WARNING: dlfcn.h missing, preloading disabled" >&2;}
24380 no_preload_client=t
24381 no_preload_server=t
24382 no_preload=t
24383fi
24384
24385
24386
24387if test x"${no_preload}" = x; then
24388    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether all interposition usage should be disabled" >&5
24389$as_echo_n "checking whether all interposition usage should be disabled... " >&6; }
24390    # Check whether --enable-preload was given.
24391if test "${enable_preload+set}" = set; then :
24392  enableval=$enable_preload; if test x"$enableval" = xno; then
24393	     no_preload_client=t
24394	     no_preload_server=t
24395	     no_preload=t
24396	     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24397$as_echo "yes" >&6; }
24398	 else
24399	     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24400$as_echo "no" >&6; }
24401	 fi
24402else
24403  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24404$as_echo "no" >&6; }
24405fi
24406
24407fi
24408
24409if test x"${no_preload}" = x; then
24410    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether interposition in the client should be disabled" >&5
24411$as_echo_n "checking whether interposition in the client should be disabled... " >&6; }
24412    # Check whether --enable-clientdl was given.
24413if test "${enable_clientdl+set}" = set; then :
24414  enableval=$enable_clientdl; if test x"$enableval" = xno; then
24415             no_preload_client=t
24416	     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24417$as_echo "yes" >&6; }
24418         else
24419             { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24420$as_echo "no" >&6; }
24421	 fi
24422else
24423  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24424$as_echo "no" >&6; }
24425fi
24426
24427
24428    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether interposition in the server should be disabled" >&5
24429$as_echo_n "checking whether interposition in the server should be disabled... " >&6; }
24430    # Check whether --enable-serverdl was given.
24431if test "${enable_serverdl+set}" = set; then :
24432  enableval=$enable_serverdl; if test x"$enableval" = xno; then
24433             no_preload_server=t
24434	     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24435$as_echo "yes" >&6; }
24436         else
24437             if test x"$enableval" = xyes; then
24438		 serverdl_always_on=t
24439	     fi
24440	     { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24441$as_echo "no" >&6; }
24442	 fi
24443else
24444  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24445$as_echo "no" >&6; }
24446fi
24447
24448fi
24449
24450 if test x"$no_preload_server" = x; then
24451  SERVER_INTERPOSITION_TRUE=
24452  SERVER_INTERPOSITION_FALSE='#'
24453else
24454  SERVER_INTERPOSITION_TRUE='#'
24455  SERVER_INTERPOSITION_FALSE=
24456fi
24457
24458 if test x"$serverdl_always_on" = xt; then
24459  SERVER_INTERPOSITION_ALWAYS_TRUE=
24460  SERVER_INTERPOSITION_ALWAYS_FALSE='#'
24461else
24462  SERVER_INTERPOSITION_ALWAYS_TRUE='#'
24463  SERVER_INTERPOSITION_ALWAYS_FALSE=
24464fi
24465
24466
24467if test x"${no_preload_client}" = xt -a x"${no_preload_server}" = xt; then
24468    unset preload_enabled
24469else
24470    preload_enabled=t
24471fi
24472
24473unset have_dlflag
24474{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DL_LAZY" >&5
24475$as_echo_n "checking for DL_LAZY... " >&6; }
24476cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24477/* end confdefs.h.  */
24478
24479#include <dlfcn.h>
24480#ifdef DL_LAZY
24481yes
24482#endif
24483
24484_ACEOF
24485if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24486  $EGREP "yes" >/dev/null 2>&1; then :
24487  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24488$as_echo "yes" >&6; }
24489    have_dlflag=t
24490else
24491  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24492$as_echo "no" >&6; }
24493fi
24494rm -f conftest*
24495
24496
24497if test x"${have_dlflag}" = x; then
24498    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RTLD_MEMBER" >&5
24499$as_echo_n "checking for RTLD_MEMBER... " >&6; }
24500    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24501/* end confdefs.h.  */
24502
24503#include <dlfcn.h>
24504#ifdef RTLD_MEMBER
24505# ifdef RTLD_LAZY
24506yes
24507# endif
24508#endif
24509
24510_ACEOF
24511if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24512  $EGREP "yes" >/dev/null 2>&1; then :
24513
24514$as_echo "#define DL_LAZY RTLD_LAZY|RTLD_MEMBER" >>confdefs.h
24515
24516	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24517$as_echo "yes" >&6; }
24518	have_dlflag=t
24519else
24520  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24521$as_echo "no" >&6; }
24522fi
24523rm -f conftest*
24524
24525fi
24526
24527if test x"${have_dlflag}" = x; then
24528    { $as_echo "$as_me:${as_lineno-$LINENO}: checking to see if dlopen param has DL_ and not RTLD_ prefix" >&5
24529$as_echo_n "checking to see if dlopen param has DL_ and not RTLD_ prefix... " >&6; }
24530    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24531/* end confdefs.h.  */
24532
24533#include <dlfcn.h>
24534#ifdef DL_LAZY
24535#else
24536# ifdef RTLD_LAZY
24537yes
24538# endif
24539#endif
24540
24541_ACEOF
24542if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
24543  $EGREP "yes" >/dev/null 2>&1; then :
24544
24545$as_echo "#define DL_LAZY RTLD_LAZY" >>confdefs.h
24546
24547	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
24548$as_echo "yes" >&6; }
24549	have_dlflag=t
24550else
24551  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
24552$as_echo "no" >&6; }
24553fi
24554rm -f conftest*
24555
24556fi
24557
24558for ac_func in __fprintf_chk __vfprintf_chk __read_chk
24559do :
24560  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
24561ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
24562if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
24563  cat >>confdefs.h <<_ACEOF
24564#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
24565_ACEOF
24566
24567fi
24568done
24569
24570
24571for ac_func in _IO_getc _IO_putc
24572do :
24573  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
24574ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
24575if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
24576  cat >>confdefs.h <<_ACEOF
24577#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
24578_ACEOF
24579
24580fi
24581done
24582
24583
24584{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5
24585$as_echo_n "checking for library containing getaddrinfo... " >&6; }
24586if ${ac_cv_search_getaddrinfo+:} false; then :
24587  $as_echo_n "(cached) " >&6
24588else
24589  ac_func_search_save_LIBS=$LIBS
24590cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24591/* end confdefs.h.  */
24592
24593/* Override any GCC internal prototype to avoid an error.
24594   Use char because int might match the return type of a GCC
24595   builtin and then its argument prototype would still apply.  */
24596#ifdef __cplusplus
24597extern "C"
24598#endif
24599char getaddrinfo ();
24600int
24601main ()
24602{
24603return getaddrinfo ();
24604  ;
24605  return 0;
24606}
24607_ACEOF
24608for ac_lib in '' socket; do
24609  if test -z "$ac_lib"; then
24610    ac_res="none required"
24611  else
24612    ac_res=-l$ac_lib
24613    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
24614  fi
24615  if ac_fn_c_try_link "$LINENO"; then :
24616  ac_cv_search_getaddrinfo=$ac_res
24617fi
24618rm -f core conftest.err conftest.$ac_objext \
24619    conftest$ac_exeext
24620  if ${ac_cv_search_getaddrinfo+:} false; then :
24621  break
24622fi
24623done
24624if ${ac_cv_search_getaddrinfo+:} false; then :
24625
24626else
24627  ac_cv_search_getaddrinfo=no
24628fi
24629rm conftest.$ac_ext
24630LIBS=$ac_func_search_save_LIBS
24631fi
24632{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5
24633$as_echo "$ac_cv_search_getaddrinfo" >&6; }
24634ac_res=$ac_cv_search_getaddrinfo
24635if test "$ac_res" != no; then :
24636  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
24637
24638fi
24639
24640{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getnameinfo" >&5
24641$as_echo_n "checking for library containing getnameinfo... " >&6; }
24642if ${ac_cv_search_getnameinfo+:} false; then :
24643  $as_echo_n "(cached) " >&6
24644else
24645  ac_func_search_save_LIBS=$LIBS
24646cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24647/* end confdefs.h.  */
24648
24649/* Override any GCC internal prototype to avoid an error.
24650   Use char because int might match the return type of a GCC
24651   builtin and then its argument prototype would still apply.  */
24652#ifdef __cplusplus
24653extern "C"
24654#endif
24655char getnameinfo ();
24656int
24657main ()
24658{
24659return getnameinfo ();
24660  ;
24661  return 0;
24662}
24663_ACEOF
24664for ac_lib in '' socket; do
24665  if test -z "$ac_lib"; then
24666    ac_res="none required"
24667  else
24668    ac_res=-l$ac_lib
24669    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
24670  fi
24671  if ac_fn_c_try_link "$LINENO"; then :
24672  ac_cv_search_getnameinfo=$ac_res
24673fi
24674rm -f core conftest.err conftest.$ac_objext \
24675    conftest$ac_exeext
24676  if ${ac_cv_search_getnameinfo+:} false; then :
24677  break
24678fi
24679done
24680if ${ac_cv_search_getnameinfo+:} false; then :
24681
24682else
24683  ac_cv_search_getnameinfo=no
24684fi
24685rm conftest.$ac_ext
24686LIBS=$ac_func_search_save_LIBS
24687fi
24688{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getnameinfo" >&5
24689$as_echo "$ac_cv_search_getnameinfo" >&6; }
24690ac_res=$ac_cv_search_getnameinfo
24691if test "$ac_res" != no; then :
24692  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
24693
24694fi
24695
24696for ac_func in gethostbyname2 getaddrinfo getnameinfo freeaddrinfo
24697do :
24698  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
24699ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
24700if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
24701  cat >>confdefs.h <<_ACEOF
24702#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
24703_ACEOF
24704
24705fi
24706done
24707
24708for ac_func in getipnodebyname
24709do :
24710  ac_fn_c_check_func "$LINENO" "getipnodebyname" "ac_cv_func_getipnodebyname"
24711if test "x$ac_cv_func_getipnodebyname" = xyes; then :
24712  cat >>confdefs.h <<_ACEOF
24713#define HAVE_GETIPNODEBYNAME 1
24714_ACEOF
24715
24716fi
24717done
24718
24719
24720#find prototypes from dlib/interposition.c
24721if test x"${preload_enabled}" = xt; then
24722
24723    unset failproto
24724    preprotoCFLAGS="$CFLAGS"
24725#   CFLAGS="$CFLAGS -Werror"
24726
24727    #prototypes; return value first, then parameters
24728    #
24729    # Example (accept from OpenBSD manual page):
24730    #
24731    # int accept(int s, struct sockaddr *addr, socklen_t *addrlen);
24732    #
24733    # Remove variable names and the result is:
24734    # int, int, struct sockaddr *, socklen_t *
24735    # This is quoted and added to the L_NSOCKPROTO call below.
24736
24737
24738{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for accept" >&5
24739$as_echo_n "checking prototypes for accept... " >&6; }
24740cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24741/* end confdefs.h.  */
24742
24743
24744#include <sys/types.h>
24745#include <sys/socket.h>
24746#include <sys/uio.h>
24747#include <netdb.h>
24748#include <unistd.h>
24749
24750int
24751accept( int, struct sockaddr *, socklen_t *
24752);
24753int
24754main ()
24755{
24756
24757  ;
24758  return 0;
24759}
24760_ACEOF
24761if ac_fn_c_try_compile "$LINENO"; then :
24762
24763cat >>confdefs.h <<_ACEOF
24764#define HAVE_PROT_ACCEPT_0 int
24765_ACEOF
24766
24767cat >>confdefs.h <<_ACEOF
24768#define HAVE_PROT_ACCEPT_1 int
24769_ACEOF
24770
24771cat >>confdefs.h <<_ACEOF
24772#define HAVE_PROT_ACCEPT_2 struct sockaddr *
24773_ACEOF
24774
24775cat >>confdefs.h <<_ACEOF
24776#define HAVE_PROT_ACCEPT_3 socklen_t *
24777_ACEOF
24778
24779  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
24780$as_echo "ok" >&6; }
24781else
24782  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24783/* end confdefs.h.  */
24784
24785
24786#include <sys/types.h>
24787#include <sys/socket.h>
24788#include <sys/uio.h>
24789#include <netdb.h>
24790#include <unistd.h>
24791
24792int
24793accept( int, struct sockaddr *, Psocklen_t
24794);
24795int
24796main ()
24797{
24798
24799  ;
24800  return 0;
24801}
24802_ACEOF
24803if ac_fn_c_try_compile "$LINENO"; then :
24804
24805cat >>confdefs.h <<_ACEOF
24806#define HAVE_PROT_ACCEPT_0 int
24807_ACEOF
24808
24809cat >>confdefs.h <<_ACEOF
24810#define HAVE_PROT_ACCEPT_1 int
24811_ACEOF
24812
24813cat >>confdefs.h <<_ACEOF
24814#define HAVE_PROT_ACCEPT_2 struct sockaddr *
24815_ACEOF
24816
24817cat >>confdefs.h <<_ACEOF
24818#define HAVE_PROT_ACCEPT_3 Psocklen_t
24819_ACEOF
24820
24821  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
24822$as_echo "ok" >&6; }
24823else
24824  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
24825$as_echo "failure" >&6; }
24826   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for accept" >&5
24827$as_echo "$as_me: WARNING: missing prototype for accept" >&2;}
24828  failproto=t
24829fi
24830rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24831fi
24832rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24833
24834
24835{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for bind" >&5
24836$as_echo_n "checking prototypes for bind... " >&6; }
24837cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24838/* end confdefs.h.  */
24839
24840
24841#include <sys/types.h>
24842#include <sys/socket.h>
24843#include <sys/uio.h>
24844#include <netdb.h>
24845#include <unistd.h>
24846
24847int
24848bind( int, const struct sockaddr *, socklen_t
24849);
24850int
24851main ()
24852{
24853
24854  ;
24855  return 0;
24856}
24857_ACEOF
24858if ac_fn_c_try_compile "$LINENO"; then :
24859
24860cat >>confdefs.h <<_ACEOF
24861#define HAVE_PROT_BIND_0 int
24862_ACEOF
24863
24864cat >>confdefs.h <<_ACEOF
24865#define HAVE_PROT_BIND_1 int
24866_ACEOF
24867
24868cat >>confdefs.h <<_ACEOF
24869#define HAVE_PROT_BIND_2 const struct sockaddr *
24870_ACEOF
24871
24872cat >>confdefs.h <<_ACEOF
24873#define HAVE_PROT_BIND_3 socklen_t
24874_ACEOF
24875
24876  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
24877$as_echo "ok" >&6; }
24878else
24879  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
24880$as_echo "failure" >&6; }
24881   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for bind" >&5
24882$as_echo "$as_me: WARNING: missing prototype for bind" >&2;}
24883  failproto=t
24884fi
24885rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24886
24887
24888{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for connect" >&5
24889$as_echo_n "checking prototypes for connect... " >&6; }
24890cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24891/* end confdefs.h.  */
24892
24893
24894#include <sys/types.h>
24895#include <sys/socket.h>
24896#include <sys/uio.h>
24897#include <netdb.h>
24898#include <unistd.h>
24899
24900int
24901connect( int, const struct sockaddr *, socklen_t
24902);
24903int
24904main ()
24905{
24906
24907  ;
24908  return 0;
24909}
24910_ACEOF
24911if ac_fn_c_try_compile "$LINENO"; then :
24912
24913cat >>confdefs.h <<_ACEOF
24914#define HAVE_PROT_CONNECT_0 int
24915_ACEOF
24916
24917cat >>confdefs.h <<_ACEOF
24918#define HAVE_PROT_CONNECT_1 int
24919_ACEOF
24920
24921cat >>confdefs.h <<_ACEOF
24922#define HAVE_PROT_CONNECT_2 const struct sockaddr *
24923_ACEOF
24924
24925cat >>confdefs.h <<_ACEOF
24926#define HAVE_PROT_CONNECT_3 socklen_t
24927_ACEOF
24928
24929  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
24930$as_echo "ok" >&6; }
24931else
24932  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
24933$as_echo "failure" >&6; }
24934   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for connect" >&5
24935$as_echo "$as_me: WARNING: missing prototype for connect" >&2;}
24936  failproto=t
24937fi
24938rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
24939
24940
24941{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for gethostbyaddr" >&5
24942$as_echo_n "checking prototypes for gethostbyaddr... " >&6; }
24943cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24944/* end confdefs.h.  */
24945
24946
24947#include <sys/types.h>
24948#include <sys/socket.h>
24949#include <sys/uio.h>
24950#include <netdb.h>
24951#include <unistd.h>
24952
24953struct hostent *
24954gethostbyaddr( const char *, int, int
24955);
24956int
24957main ()
24958{
24959
24960  ;
24961  return 0;
24962}
24963_ACEOF
24964if ac_fn_c_try_compile "$LINENO"; then :
24965
24966cat >>confdefs.h <<_ACEOF
24967#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
24968_ACEOF
24969
24970cat >>confdefs.h <<_ACEOF
24971#define HAVE_PROT_GETHOSTBYADDR_1 const char *
24972_ACEOF
24973
24974cat >>confdefs.h <<_ACEOF
24975#define HAVE_PROT_GETHOSTBYADDR_2 int
24976_ACEOF
24977
24978cat >>confdefs.h <<_ACEOF
24979#define HAVE_PROT_GETHOSTBYADDR_3 int
24980_ACEOF
24981
24982  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
24983$as_echo "ok" >&6; }
24984else
24985  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
24986/* end confdefs.h.  */
24987
24988
24989#include <sys/types.h>
24990#include <sys/socket.h>
24991#include <sys/uio.h>
24992#include <netdb.h>
24993#include <unistd.h>
24994
24995struct hostent *
24996gethostbyaddr( const char *, socklen_t, int
24997);
24998int
24999main ()
25000{
25001
25002  ;
25003  return 0;
25004}
25005_ACEOF
25006if ac_fn_c_try_compile "$LINENO"; then :
25007
25008cat >>confdefs.h <<_ACEOF
25009#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
25010_ACEOF
25011
25012cat >>confdefs.h <<_ACEOF
25013#define HAVE_PROT_GETHOSTBYADDR_1 const char *
25014_ACEOF
25015
25016cat >>confdefs.h <<_ACEOF
25017#define HAVE_PROT_GETHOSTBYADDR_2 socklen_t
25018_ACEOF
25019
25020cat >>confdefs.h <<_ACEOF
25021#define HAVE_PROT_GETHOSTBYADDR_3 int
25022_ACEOF
25023
25024  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25025$as_echo "ok" >&6; }
25026else
25027  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25028/* end confdefs.h.  */
25029
25030
25031#include <sys/types.h>
25032#include <sys/socket.h>
25033#include <sys/uio.h>
25034#include <netdb.h>
25035#include <unistd.h>
25036
25037struct hostent *
25038gethostbyaddr( const void *, socklen_t, int
25039);
25040int
25041main ()
25042{
25043
25044  ;
25045  return 0;
25046}
25047_ACEOF
25048if ac_fn_c_try_compile "$LINENO"; then :
25049
25050cat >>confdefs.h <<_ACEOF
25051#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
25052_ACEOF
25053
25054cat >>confdefs.h <<_ACEOF
25055#define HAVE_PROT_GETHOSTBYADDR_1 const void *
25056_ACEOF
25057
25058cat >>confdefs.h <<_ACEOF
25059#define HAVE_PROT_GETHOSTBYADDR_2 socklen_t
25060_ACEOF
25061
25062cat >>confdefs.h <<_ACEOF
25063#define HAVE_PROT_GETHOSTBYADDR_3 int
25064_ACEOF
25065
25066  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25067$as_echo "ok" >&6; }
25068else
25069  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25070/* end confdefs.h.  */
25071
25072
25073#include <sys/types.h>
25074#include <sys/socket.h>
25075#include <sys/uio.h>
25076#include <netdb.h>
25077#include <unistd.h>
25078
25079struct hostent *
25080gethostbyaddr( const void *, int, int
25081);
25082int
25083main ()
25084{
25085
25086  ;
25087  return 0;
25088}
25089_ACEOF
25090if ac_fn_c_try_compile "$LINENO"; then :
25091
25092cat >>confdefs.h <<_ACEOF
25093#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
25094_ACEOF
25095
25096cat >>confdefs.h <<_ACEOF
25097#define HAVE_PROT_GETHOSTBYADDR_1 const void *
25098_ACEOF
25099
25100cat >>confdefs.h <<_ACEOF
25101#define HAVE_PROT_GETHOSTBYADDR_2 int
25102_ACEOF
25103
25104cat >>confdefs.h <<_ACEOF
25105#define HAVE_PROT_GETHOSTBYADDR_3 int
25106_ACEOF
25107
25108  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25109$as_echo "ok" >&6; }
25110else
25111  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25112/* end confdefs.h.  */
25113
25114
25115#include <sys/types.h>
25116#include <sys/socket.h>
25117#include <sys/uio.h>
25118#include <netdb.h>
25119#include <unistd.h>
25120
25121struct hostent *
25122gethostbyaddr( const void *, size_t, int
25123);
25124int
25125main ()
25126{
25127
25128  ;
25129  return 0;
25130}
25131_ACEOF
25132if ac_fn_c_try_compile "$LINENO"; then :
25133
25134cat >>confdefs.h <<_ACEOF
25135#define HAVE_PROT_GETHOSTBYADDR_0 struct hostent *
25136_ACEOF
25137
25138cat >>confdefs.h <<_ACEOF
25139#define HAVE_PROT_GETHOSTBYADDR_1 const void *
25140_ACEOF
25141
25142cat >>confdefs.h <<_ACEOF
25143#define HAVE_PROT_GETHOSTBYADDR_2 size_t
25144_ACEOF
25145
25146cat >>confdefs.h <<_ACEOF
25147#define HAVE_PROT_GETHOSTBYADDR_3 int
25148_ACEOF
25149
25150  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25151$as_echo "ok" >&6; }
25152else
25153  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25154$as_echo "failure" >&6; }
25155   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for gethostbyaddr" >&5
25156$as_echo "$as_me: WARNING: missing prototype for gethostbyaddr" >&2;}
25157  failproto=t
25158fi
25159rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25160fi
25161rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25162fi
25163rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25164fi
25165rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25166fi
25167rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25168
25169
25170{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for getnameinfo" >&5
25171$as_echo_n "checking prototypes for getnameinfo... " >&6; }
25172cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25173/* end confdefs.h.  */
25174
25175
25176#include <sys/types.h>
25177#include <sys/socket.h>
25178#include <sys/uio.h>
25179#include <netdb.h>
25180#include <unistd.h>
25181
25182int
25183getnameinfo( const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t, int
25184);
25185int
25186main ()
25187{
25188
25189  ;
25190  return 0;
25191}
25192_ACEOF
25193if ac_fn_c_try_compile "$LINENO"; then :
25194
25195cat >>confdefs.h <<_ACEOF
25196#define HAVE_PROT_GETNAMEINFO_0 int
25197_ACEOF
25198
25199cat >>confdefs.h <<_ACEOF
25200#define HAVE_PROT_GETNAMEINFO_1 const struct sockaddr *
25201_ACEOF
25202
25203cat >>confdefs.h <<_ACEOF
25204#define HAVE_PROT_GETNAMEINFO_2 socklen_t
25205_ACEOF
25206
25207cat >>confdefs.h <<_ACEOF
25208#define HAVE_PROT_GETNAMEINFO_3 char *
25209_ACEOF
25210
25211cat >>confdefs.h <<_ACEOF
25212#define HAVE_PROT_GETNAMEINFO_4 socklen_t
25213_ACEOF
25214
25215cat >>confdefs.h <<_ACEOF
25216#define HAVE_PROT_GETNAMEINFO_5 char *
25217_ACEOF
25218
25219cat >>confdefs.h <<_ACEOF
25220#define HAVE_PROT_GETNAMEINFO_6 socklen_t
25221_ACEOF
25222
25223cat >>confdefs.h <<_ACEOF
25224#define HAVE_PROT_GETNAMEINFO_7 int
25225_ACEOF
25226
25227  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25228$as_echo "ok" >&6; }
25229else
25230  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25231/* end confdefs.h.  */
25232
25233
25234#include <sys/types.h>
25235#include <sys/socket.h>
25236#include <sys/uio.h>
25237#include <netdb.h>
25238#include <unistd.h>
25239
25240int
25241getnameinfo( const struct sockaddr *, socklen_t, char *, socklen_t, char *, socklen_t,  unsigned int
25242);
25243int
25244main ()
25245{
25246
25247  ;
25248  return 0;
25249}
25250_ACEOF
25251if ac_fn_c_try_compile "$LINENO"; then :
25252
25253cat >>confdefs.h <<_ACEOF
25254#define HAVE_PROT_GETNAMEINFO_0 int
25255_ACEOF
25256
25257cat >>confdefs.h <<_ACEOF
25258#define HAVE_PROT_GETNAMEINFO_1 const struct sockaddr *
25259_ACEOF
25260
25261cat >>confdefs.h <<_ACEOF
25262#define HAVE_PROT_GETNAMEINFO_2 socklen_t
25263_ACEOF
25264
25265cat >>confdefs.h <<_ACEOF
25266#define HAVE_PROT_GETNAMEINFO_3 char *
25267_ACEOF
25268
25269cat >>confdefs.h <<_ACEOF
25270#define HAVE_PROT_GETNAMEINFO_4 socklen_t
25271_ACEOF
25272
25273cat >>confdefs.h <<_ACEOF
25274#define HAVE_PROT_GETNAMEINFO_5 char *
25275_ACEOF
25276
25277cat >>confdefs.h <<_ACEOF
25278#define HAVE_PROT_GETNAMEINFO_6 socklen_t
25279_ACEOF
25280
25281cat >>confdefs.h <<_ACEOF
25282#define HAVE_PROT_GETNAMEINFO_7 unsigned int
25283_ACEOF
25284
25285  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25286$as_echo "ok" >&6; }
25287else
25288  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25289/* end confdefs.h.  */
25290
25291
25292#include <sys/types.h>
25293#include <sys/socket.h>
25294#include <sys/uio.h>
25295#include <netdb.h>
25296#include <unistd.h>
25297
25298int
25299getnameinfo( const struct sockaddr *, socklen_t, char *, size_t, char *, size_t,    int
25300);
25301int
25302main ()
25303{
25304
25305  ;
25306  return 0;
25307}
25308_ACEOF
25309if ac_fn_c_try_compile "$LINENO"; then :
25310
25311cat >>confdefs.h <<_ACEOF
25312#define HAVE_PROT_GETNAMEINFO_0 int
25313_ACEOF
25314
25315cat >>confdefs.h <<_ACEOF
25316#define HAVE_PROT_GETNAMEINFO_1 const struct sockaddr *
25317_ACEOF
25318
25319cat >>confdefs.h <<_ACEOF
25320#define HAVE_PROT_GETNAMEINFO_2 socklen_t
25321_ACEOF
25322
25323cat >>confdefs.h <<_ACEOF
25324#define HAVE_PROT_GETNAMEINFO_3 char *
25325_ACEOF
25326
25327cat >>confdefs.h <<_ACEOF
25328#define HAVE_PROT_GETNAMEINFO_4 size_t
25329_ACEOF
25330
25331cat >>confdefs.h <<_ACEOF
25332#define HAVE_PROT_GETNAMEINFO_5 char *
25333_ACEOF
25334
25335cat >>confdefs.h <<_ACEOF
25336#define HAVE_PROT_GETNAMEINFO_6 size_t
25337_ACEOF
25338
25339cat >>confdefs.h <<_ACEOF
25340#define HAVE_PROT_GETNAMEINFO_7 int
25341_ACEOF
25342
25343  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25344$as_echo "ok" >&6; }
25345else
25346  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25347$as_echo "failure" >&6; }
25348   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for getnameinfo" >&5
25349$as_echo "$as_me: WARNING: missing prototype for getnameinfo" >&2;}
25350  failproto=t
25351fi
25352rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25353fi
25354rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25355fi
25356rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25357
25358
25359{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for getpeername" >&5
25360$as_echo_n "checking prototypes for getpeername... " >&6; }
25361cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25362/* end confdefs.h.  */
25363
25364
25365#include <sys/types.h>
25366#include <sys/socket.h>
25367#include <sys/uio.h>
25368#include <netdb.h>
25369#include <unistd.h>
25370
25371int
25372getpeername( int, struct sockaddr *, socklen_t *
25373);
25374int
25375main ()
25376{
25377
25378  ;
25379  return 0;
25380}
25381_ACEOF
25382if ac_fn_c_try_compile "$LINENO"; then :
25383
25384cat >>confdefs.h <<_ACEOF
25385#define HAVE_PROT_GETPEERNAME_0 int
25386_ACEOF
25387
25388cat >>confdefs.h <<_ACEOF
25389#define HAVE_PROT_GETPEERNAME_1 int
25390_ACEOF
25391
25392cat >>confdefs.h <<_ACEOF
25393#define HAVE_PROT_GETPEERNAME_2 struct sockaddr *
25394_ACEOF
25395
25396cat >>confdefs.h <<_ACEOF
25397#define HAVE_PROT_GETPEERNAME_3 socklen_t *
25398_ACEOF
25399
25400  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25401$as_echo "ok" >&6; }
25402else
25403  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25404/* end confdefs.h.  */
25405
25406
25407#include <sys/types.h>
25408#include <sys/socket.h>
25409#include <sys/uio.h>
25410#include <netdb.h>
25411#include <unistd.h>
25412
25413int
25414getpeername( int, struct sockaddr *, Psocklen_t
25415);
25416int
25417main ()
25418{
25419
25420  ;
25421  return 0;
25422}
25423_ACEOF
25424if ac_fn_c_try_compile "$LINENO"; then :
25425
25426cat >>confdefs.h <<_ACEOF
25427#define HAVE_PROT_GETPEERNAME_0 int
25428_ACEOF
25429
25430cat >>confdefs.h <<_ACEOF
25431#define HAVE_PROT_GETPEERNAME_1 int
25432_ACEOF
25433
25434cat >>confdefs.h <<_ACEOF
25435#define HAVE_PROT_GETPEERNAME_2 struct sockaddr *
25436_ACEOF
25437
25438cat >>confdefs.h <<_ACEOF
25439#define HAVE_PROT_GETPEERNAME_3 Psocklen_t
25440_ACEOF
25441
25442  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25443$as_echo "ok" >&6; }
25444else
25445  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25446$as_echo "failure" >&6; }
25447   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for getpeername" >&5
25448$as_echo "$as_me: WARNING: missing prototype for getpeername" >&2;}
25449  failproto=t
25450fi
25451rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25452fi
25453rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25454
25455
25456{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for getsockname" >&5
25457$as_echo_n "checking prototypes for getsockname... " >&6; }
25458cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25459/* end confdefs.h.  */
25460
25461
25462#include <sys/types.h>
25463#include <sys/socket.h>
25464#include <sys/uio.h>
25465#include <netdb.h>
25466#include <unistd.h>
25467
25468int
25469getsockname( int, struct sockaddr *, socklen_t *
25470);
25471int
25472main ()
25473{
25474
25475  ;
25476  return 0;
25477}
25478_ACEOF
25479if ac_fn_c_try_compile "$LINENO"; then :
25480
25481cat >>confdefs.h <<_ACEOF
25482#define HAVE_PROT_GETSOCKNAME_0 int
25483_ACEOF
25484
25485cat >>confdefs.h <<_ACEOF
25486#define HAVE_PROT_GETSOCKNAME_1 int
25487_ACEOF
25488
25489cat >>confdefs.h <<_ACEOF
25490#define HAVE_PROT_GETSOCKNAME_2 struct sockaddr *
25491_ACEOF
25492
25493cat >>confdefs.h <<_ACEOF
25494#define HAVE_PROT_GETSOCKNAME_3 socklen_t *
25495_ACEOF
25496
25497  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25498$as_echo "ok" >&6; }
25499else
25500  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25501/* end confdefs.h.  */
25502
25503
25504#include <sys/types.h>
25505#include <sys/socket.h>
25506#include <sys/uio.h>
25507#include <netdb.h>
25508#include <unistd.h>
25509
25510int
25511getsockname( int, struct sockaddr *, Psocklen_t
25512);
25513int
25514main ()
25515{
25516
25517  ;
25518  return 0;
25519}
25520_ACEOF
25521if ac_fn_c_try_compile "$LINENO"; then :
25522
25523cat >>confdefs.h <<_ACEOF
25524#define HAVE_PROT_GETSOCKNAME_0 int
25525_ACEOF
25526
25527cat >>confdefs.h <<_ACEOF
25528#define HAVE_PROT_GETSOCKNAME_1 int
25529_ACEOF
25530
25531cat >>confdefs.h <<_ACEOF
25532#define HAVE_PROT_GETSOCKNAME_2 struct sockaddr *
25533_ACEOF
25534
25535cat >>confdefs.h <<_ACEOF
25536#define HAVE_PROT_GETSOCKNAME_3 Psocklen_t
25537_ACEOF
25538
25539  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25540$as_echo "ok" >&6; }
25541else
25542  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25543$as_echo "failure" >&6; }
25544   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for getsockname" >&5
25545$as_echo "$as_me: WARNING: missing prototype for getsockname" >&2;}
25546  failproto=t
25547fi
25548rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25549fi
25550rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25551
25552
25553{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for getsockopt" >&5
25554$as_echo_n "checking prototypes for getsockopt... " >&6; }
25555cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25556/* end confdefs.h.  */
25557
25558
25559#include <sys/types.h>
25560#include <sys/socket.h>
25561#include <sys/uio.h>
25562#include <netdb.h>
25563#include <unistd.h>
25564
25565int
25566getsockopt( int, int, int, void *, socklen_t *
25567);
25568int
25569main ()
25570{
25571
25572  ;
25573  return 0;
25574}
25575_ACEOF
25576if ac_fn_c_try_compile "$LINENO"; then :
25577
25578cat >>confdefs.h <<_ACEOF
25579#define HAVE_PROT_GETSOCKOPT_0 int
25580_ACEOF
25581
25582cat >>confdefs.h <<_ACEOF
25583#define HAVE_PROT_GETSOCKOPT_1 int
25584_ACEOF
25585
25586cat >>confdefs.h <<_ACEOF
25587#define HAVE_PROT_GETSOCKOPT_2 int
25588_ACEOF
25589
25590cat >>confdefs.h <<_ACEOF
25591#define HAVE_PROT_GETSOCKOPT_3 int
25592_ACEOF
25593
25594cat >>confdefs.h <<_ACEOF
25595#define HAVE_PROT_GETSOCKOPT_4 void *
25596_ACEOF
25597
25598cat >>confdefs.h <<_ACEOF
25599#define HAVE_PROT_GETSOCKOPT_5 socklen_t *
25600_ACEOF
25601
25602  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25603$as_echo "ok" >&6; }
25604else
25605  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25606/* end confdefs.h.  */
25607
25608
25609#include <sys/types.h>
25610#include <sys/socket.h>
25611#include <sys/uio.h>
25612#include <netdb.h>
25613#include <unistd.h>
25614
25615int
25616getsockopt( int, int, int, void *, Psocklen_t
25617);
25618int
25619main ()
25620{
25621
25622  ;
25623  return 0;
25624}
25625_ACEOF
25626if ac_fn_c_try_compile "$LINENO"; then :
25627
25628cat >>confdefs.h <<_ACEOF
25629#define HAVE_PROT_GETSOCKOPT_0 int
25630_ACEOF
25631
25632cat >>confdefs.h <<_ACEOF
25633#define HAVE_PROT_GETSOCKOPT_1 int
25634_ACEOF
25635
25636cat >>confdefs.h <<_ACEOF
25637#define HAVE_PROT_GETSOCKOPT_2 int
25638_ACEOF
25639
25640cat >>confdefs.h <<_ACEOF
25641#define HAVE_PROT_GETSOCKOPT_3 int
25642_ACEOF
25643
25644cat >>confdefs.h <<_ACEOF
25645#define HAVE_PROT_GETSOCKOPT_4 void *
25646_ACEOF
25647
25648cat >>confdefs.h <<_ACEOF
25649#define HAVE_PROT_GETSOCKOPT_5 Psocklen_t
25650_ACEOF
25651
25652  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25653$as_echo "ok" >&6; }
25654else
25655  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25656/* end confdefs.h.  */
25657
25658
25659#include <sys/types.h>
25660#include <sys/socket.h>
25661#include <sys/uio.h>
25662#include <netdb.h>
25663#include <unistd.h>
25664
25665int
25666getsockopt( int, int, int, char *, int *
25667);
25668int
25669main ()
25670{
25671
25672  ;
25673  return 0;
25674}
25675_ACEOF
25676if ac_fn_c_try_compile "$LINENO"; then :
25677
25678cat >>confdefs.h <<_ACEOF
25679#define HAVE_PROT_GETSOCKOPT_0 int
25680_ACEOF
25681
25682cat >>confdefs.h <<_ACEOF
25683#define HAVE_PROT_GETSOCKOPT_1 int
25684_ACEOF
25685
25686cat >>confdefs.h <<_ACEOF
25687#define HAVE_PROT_GETSOCKOPT_2 int
25688_ACEOF
25689
25690cat >>confdefs.h <<_ACEOF
25691#define HAVE_PROT_GETSOCKOPT_3 int
25692_ACEOF
25693
25694cat >>confdefs.h <<_ACEOF
25695#define HAVE_PROT_GETSOCKOPT_4 char *
25696_ACEOF
25697
25698cat >>confdefs.h <<_ACEOF
25699#define HAVE_PROT_GETSOCKOPT_5 int *
25700_ACEOF
25701
25702  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25703$as_echo "ok" >&6; }
25704else
25705  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25706$as_echo "failure" >&6; }
25707   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for getsockopt" >&5
25708$as_echo "$as_me: WARNING: missing prototype for getsockopt" >&2;}
25709  failproto=t
25710fi
25711rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25712fi
25713rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25714fi
25715rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25716
25717
25718{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for listen" >&5
25719$as_echo_n "checking prototypes for listen... " >&6; }
25720cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25721/* end confdefs.h.  */
25722
25723
25724#include <sys/types.h>
25725#include <sys/socket.h>
25726#include <sys/uio.h>
25727#include <netdb.h>
25728#include <unistd.h>
25729
25730int
25731listen( int, int
25732);
25733int
25734main ()
25735{
25736
25737  ;
25738  return 0;
25739}
25740_ACEOF
25741if ac_fn_c_try_compile "$LINENO"; then :
25742
25743cat >>confdefs.h <<_ACEOF
25744#define HAVE_PROT_LISTEN_0 int
25745_ACEOF
25746
25747cat >>confdefs.h <<_ACEOF
25748#define HAVE_PROT_LISTEN_1 int
25749_ACEOF
25750
25751cat >>confdefs.h <<_ACEOF
25752#define HAVE_PROT_LISTEN_2 int
25753_ACEOF
25754
25755  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25756$as_echo "ok" >&6; }
25757else
25758  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25759$as_echo "failure" >&6; }
25760   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for listen" >&5
25761$as_echo "$as_me: WARNING: missing prototype for listen" >&2;}
25762  failproto=t
25763fi
25764rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25765
25766
25767{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for read" >&5
25768$as_echo_n "checking prototypes for read... " >&6; }
25769cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25770/* end confdefs.h.  */
25771
25772
25773#include <sys/types.h>
25774#include <sys/socket.h>
25775#include <sys/uio.h>
25776#include <netdb.h>
25777#include <unistd.h>
25778
25779ssize_t
25780read( int, void *, size_t
25781);
25782int
25783main ()
25784{
25785
25786  ;
25787  return 0;
25788}
25789_ACEOF
25790if ac_fn_c_try_compile "$LINENO"; then :
25791
25792cat >>confdefs.h <<_ACEOF
25793#define HAVE_PROT_READ_0 ssize_t
25794_ACEOF
25795
25796cat >>confdefs.h <<_ACEOF
25797#define HAVE_PROT_READ_1 int
25798_ACEOF
25799
25800cat >>confdefs.h <<_ACEOF
25801#define HAVE_PROT_READ_2 void *
25802_ACEOF
25803
25804cat >>confdefs.h <<_ACEOF
25805#define HAVE_PROT_READ_3 size_t
25806_ACEOF
25807
25808  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25809$as_echo "ok" >&6; }
25810else
25811  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25812$as_echo "failure" >&6; }
25813   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for read" >&5
25814$as_echo "$as_me: WARNING: missing prototype for read" >&2;}
25815  failproto=t
25816fi
25817rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25818
25819
25820{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for readv" >&5
25821$as_echo_n "checking prototypes for readv... " >&6; }
25822cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25823/* end confdefs.h.  */
25824
25825
25826#include <sys/types.h>
25827#include <sys/socket.h>
25828#include <sys/uio.h>
25829#include <netdb.h>
25830#include <unistd.h>
25831
25832ssize_t
25833readv( int, const struct iovec *, int
25834);
25835int
25836main ()
25837{
25838
25839  ;
25840  return 0;
25841}
25842_ACEOF
25843if ac_fn_c_try_compile "$LINENO"; then :
25844
25845cat >>confdefs.h <<_ACEOF
25846#define HAVE_PROT_READV_0 ssize_t
25847_ACEOF
25848
25849cat >>confdefs.h <<_ACEOF
25850#define HAVE_PROT_READV_1 int
25851_ACEOF
25852
25853cat >>confdefs.h <<_ACEOF
25854#define HAVE_PROT_READV_2 const struct iovec *
25855_ACEOF
25856
25857cat >>confdefs.h <<_ACEOF
25858#define HAVE_PROT_READV_3 int
25859_ACEOF
25860
25861  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25862$as_echo "ok" >&6; }
25863else
25864  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25865/* end confdefs.h.  */
25866
25867
25868#include <sys/types.h>
25869#include <sys/socket.h>
25870#include <sys/uio.h>
25871#include <netdb.h>
25872#include <unistd.h>
25873
25874int
25875readv( int, const struct iovec *, int
25876);
25877int
25878main ()
25879{
25880
25881  ;
25882  return 0;
25883}
25884_ACEOF
25885if ac_fn_c_try_compile "$LINENO"; then :
25886
25887cat >>confdefs.h <<_ACEOF
25888#define HAVE_PROT_READV_0 int
25889_ACEOF
25890
25891cat >>confdefs.h <<_ACEOF
25892#define HAVE_PROT_READV_1 int
25893_ACEOF
25894
25895cat >>confdefs.h <<_ACEOF
25896#define HAVE_PROT_READV_2 const struct iovec *
25897_ACEOF
25898
25899cat >>confdefs.h <<_ACEOF
25900#define HAVE_PROT_READV_3 int
25901_ACEOF
25902
25903  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25904$as_echo "ok" >&6; }
25905else
25906  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
25907$as_echo "failure" >&6; }
25908   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for readv" >&5
25909$as_echo "$as_me: WARNING: missing prototype for readv" >&2;}
25910  failproto=t
25911fi
25912rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25913fi
25914rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
25915
25916
25917{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for recv" >&5
25918$as_echo_n "checking prototypes for recv... " >&6; }
25919cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25920/* end confdefs.h.  */
25921
25922
25923#include <sys/types.h>
25924#include <sys/socket.h>
25925#include <sys/uio.h>
25926#include <netdb.h>
25927#include <unistd.h>
25928
25929ssize_t
25930recv( int, void *, size_t, int
25931);
25932int
25933main ()
25934{
25935
25936  ;
25937  return 0;
25938}
25939_ACEOF
25940if ac_fn_c_try_compile "$LINENO"; then :
25941
25942cat >>confdefs.h <<_ACEOF
25943#define HAVE_PROT_RECV_0 ssize_t
25944_ACEOF
25945
25946cat >>confdefs.h <<_ACEOF
25947#define HAVE_PROT_RECV_1 int
25948_ACEOF
25949
25950cat >>confdefs.h <<_ACEOF
25951#define HAVE_PROT_RECV_2 void *
25952_ACEOF
25953
25954cat >>confdefs.h <<_ACEOF
25955#define HAVE_PROT_RECV_3 size_t
25956_ACEOF
25957
25958cat >>confdefs.h <<_ACEOF
25959#define HAVE_PROT_RECV_4 int
25960_ACEOF
25961
25962  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
25963$as_echo "ok" >&6; }
25964else
25965  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
25966/* end confdefs.h.  */
25967
25968
25969#include <sys/types.h>
25970#include <sys/socket.h>
25971#include <sys/uio.h>
25972#include <netdb.h>
25973#include <unistd.h>
25974
25975ssize_t
25976recv( int, void *, size_t, unsigned int
25977);
25978int
25979main ()
25980{
25981
25982  ;
25983  return 0;
25984}
25985_ACEOF
25986if ac_fn_c_try_compile "$LINENO"; then :
25987
25988cat >>confdefs.h <<_ACEOF
25989#define HAVE_PROT_RECV_0 ssize_t
25990_ACEOF
25991
25992cat >>confdefs.h <<_ACEOF
25993#define HAVE_PROT_RECV_1 int
25994_ACEOF
25995
25996cat >>confdefs.h <<_ACEOF
25997#define HAVE_PROT_RECV_2 void *
25998_ACEOF
25999
26000cat >>confdefs.h <<_ACEOF
26001#define HAVE_PROT_RECV_3 size_t
26002_ACEOF
26003
26004cat >>confdefs.h <<_ACEOF
26005#define HAVE_PROT_RECV_4 unsigned int
26006_ACEOF
26007
26008  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26009$as_echo "ok" >&6; }
26010else
26011  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26012$as_echo "failure" >&6; }
26013   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for recv" >&5
26014$as_echo "$as_me: WARNING: missing prototype for recv" >&2;}
26015  failproto=t
26016fi
26017rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26018fi
26019rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26020
26021
26022{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for recvfrom" >&5
26023$as_echo_n "checking prototypes for recvfrom... " >&6; }
26024cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26025/* end confdefs.h.  */
26026
26027
26028#include <sys/types.h>
26029#include <sys/socket.h>
26030#include <sys/uio.h>
26031#include <netdb.h>
26032#include <unistd.h>
26033
26034ssize_t
26035recvfrom( int, void *, size_t, int, struct sockaddr *, socklen_t *
26036);
26037int
26038main ()
26039{
26040
26041  ;
26042  return 0;
26043}
26044_ACEOF
26045if ac_fn_c_try_compile "$LINENO"; then :
26046
26047cat >>confdefs.h <<_ACEOF
26048#define HAVE_PROT_RECVFROM_0 ssize_t
26049_ACEOF
26050
26051cat >>confdefs.h <<_ACEOF
26052#define HAVE_PROT_RECVFROM_1 int
26053_ACEOF
26054
26055cat >>confdefs.h <<_ACEOF
26056#define HAVE_PROT_RECVFROM_2 void *
26057_ACEOF
26058
26059cat >>confdefs.h <<_ACEOF
26060#define HAVE_PROT_RECVFROM_3 size_t
26061_ACEOF
26062
26063cat >>confdefs.h <<_ACEOF
26064#define HAVE_PROT_RECVFROM_4 int
26065_ACEOF
26066
26067cat >>confdefs.h <<_ACEOF
26068#define HAVE_PROT_RECVFROM_5 struct sockaddr *
26069_ACEOF
26070
26071cat >>confdefs.h <<_ACEOF
26072#define HAVE_PROT_RECVFROM_6 socklen_t *
26073_ACEOF
26074
26075  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26076$as_echo "ok" >&6; }
26077else
26078  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26079/* end confdefs.h.  */
26080
26081
26082#include <sys/types.h>
26083#include <sys/socket.h>
26084#include <sys/uio.h>
26085#include <netdb.h>
26086#include <unistd.h>
26087
26088ssize_t
26089recvfrom( int, void *, size_t, int, struct sockaddr *, Psocklen_t
26090);
26091int
26092main ()
26093{
26094
26095  ;
26096  return 0;
26097}
26098_ACEOF
26099if ac_fn_c_try_compile "$LINENO"; then :
26100
26101cat >>confdefs.h <<_ACEOF
26102#define HAVE_PROT_RECVFROM_0 ssize_t
26103_ACEOF
26104
26105cat >>confdefs.h <<_ACEOF
26106#define HAVE_PROT_RECVFROM_1 int
26107_ACEOF
26108
26109cat >>confdefs.h <<_ACEOF
26110#define HAVE_PROT_RECVFROM_2 void *
26111_ACEOF
26112
26113cat >>confdefs.h <<_ACEOF
26114#define HAVE_PROT_RECVFROM_3 size_t
26115_ACEOF
26116
26117cat >>confdefs.h <<_ACEOF
26118#define HAVE_PROT_RECVFROM_4 int
26119_ACEOF
26120
26121cat >>confdefs.h <<_ACEOF
26122#define HAVE_PROT_RECVFROM_5 struct sockaddr *
26123_ACEOF
26124
26125cat >>confdefs.h <<_ACEOF
26126#define HAVE_PROT_RECVFROM_6 Psocklen_t
26127_ACEOF
26128
26129  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26130$as_echo "ok" >&6; }
26131else
26132  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26133/* end confdefs.h.  */
26134
26135
26136#include <sys/types.h>
26137#include <sys/socket.h>
26138#include <sys/uio.h>
26139#include <netdb.h>
26140#include <unistd.h>
26141
26142ssize_t
26143recvfrom( int, void *, size_t, unsigned int, const struct sockaddr *, socklen_t *
26144);
26145int
26146main ()
26147{
26148
26149  ;
26150  return 0;
26151}
26152_ACEOF
26153if ac_fn_c_try_compile "$LINENO"; then :
26154
26155cat >>confdefs.h <<_ACEOF
26156#define HAVE_PROT_RECVFROM_0 ssize_t
26157_ACEOF
26158
26159cat >>confdefs.h <<_ACEOF
26160#define HAVE_PROT_RECVFROM_1 int
26161_ACEOF
26162
26163cat >>confdefs.h <<_ACEOF
26164#define HAVE_PROT_RECVFROM_2 void *
26165_ACEOF
26166
26167cat >>confdefs.h <<_ACEOF
26168#define HAVE_PROT_RECVFROM_3 size_t
26169_ACEOF
26170
26171cat >>confdefs.h <<_ACEOF
26172#define HAVE_PROT_RECVFROM_4 unsigned int
26173_ACEOF
26174
26175cat >>confdefs.h <<_ACEOF
26176#define HAVE_PROT_RECVFROM_5 const struct sockaddr *
26177_ACEOF
26178
26179cat >>confdefs.h <<_ACEOF
26180#define HAVE_PROT_RECVFROM_6 socklen_t *
26181_ACEOF
26182
26183  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26184$as_echo "ok" >&6; }
26185else
26186  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26187$as_echo "failure" >&6; }
26188   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for recvfrom" >&5
26189$as_echo "$as_me: WARNING: missing prototype for recvfrom" >&2;}
26190  failproto=t
26191fi
26192rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26193fi
26194rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26195fi
26196rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26197
26198
26199{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for recvmsg" >&5
26200$as_echo_n "checking prototypes for recvmsg... " >&6; }
26201cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26202/* end confdefs.h.  */
26203
26204
26205#include <sys/types.h>
26206#include <sys/socket.h>
26207#include <sys/uio.h>
26208#include <netdb.h>
26209#include <unistd.h>
26210
26211ssize_t
26212recvmsg( int, struct msghdr *, int
26213);
26214int
26215main ()
26216{
26217
26218  ;
26219  return 0;
26220}
26221_ACEOF
26222if ac_fn_c_try_compile "$LINENO"; then :
26223
26224cat >>confdefs.h <<_ACEOF
26225#define HAVE_PROT_RECVMSG_0 ssize_t
26226_ACEOF
26227
26228cat >>confdefs.h <<_ACEOF
26229#define HAVE_PROT_RECVMSG_1 int
26230_ACEOF
26231
26232cat >>confdefs.h <<_ACEOF
26233#define HAVE_PROT_RECVMSG_2 struct msghdr *
26234_ACEOF
26235
26236cat >>confdefs.h <<_ACEOF
26237#define HAVE_PROT_RECVMSG_3 int
26238_ACEOF
26239
26240  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26241$as_echo "ok" >&6; }
26242else
26243  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26244/* end confdefs.h.  */
26245
26246
26247#include <sys/types.h>
26248#include <sys/socket.h>
26249#include <sys/uio.h>
26250#include <netdb.h>
26251#include <unistd.h>
26252
26253int
26254recvmsg( int, struct msghdr *, unsigned int
26255);
26256int
26257main ()
26258{
26259
26260  ;
26261  return 0;
26262}
26263_ACEOF
26264if ac_fn_c_try_compile "$LINENO"; then :
26265
26266cat >>confdefs.h <<_ACEOF
26267#define HAVE_PROT_RECVMSG_0 int
26268_ACEOF
26269
26270cat >>confdefs.h <<_ACEOF
26271#define HAVE_PROT_RECVMSG_1 int
26272_ACEOF
26273
26274cat >>confdefs.h <<_ACEOF
26275#define HAVE_PROT_RECVMSG_2 struct msghdr *
26276_ACEOF
26277
26278cat >>confdefs.h <<_ACEOF
26279#define HAVE_PROT_RECVMSG_3 unsigned int
26280_ACEOF
26281
26282  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26283$as_echo "ok" >&6; }
26284else
26285  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26286$as_echo "failure" >&6; }
26287   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for recvmsg" >&5
26288$as_echo "$as_me: WARNING: missing prototype for recvmsg" >&2;}
26289  failproto=t
26290fi
26291rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26292fi
26293rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26294
26295
26296{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for send" >&5
26297$as_echo_n "checking prototypes for send... " >&6; }
26298cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26299/* end confdefs.h.  */
26300
26301
26302#include <sys/types.h>
26303#include <sys/socket.h>
26304#include <sys/uio.h>
26305#include <netdb.h>
26306#include <unistd.h>
26307
26308ssize_t
26309send( int, const void *, size_t, int
26310);
26311int
26312main ()
26313{
26314
26315  ;
26316  return 0;
26317}
26318_ACEOF
26319if ac_fn_c_try_compile "$LINENO"; then :
26320
26321cat >>confdefs.h <<_ACEOF
26322#define HAVE_PROT_SEND_0 ssize_t
26323_ACEOF
26324
26325cat >>confdefs.h <<_ACEOF
26326#define HAVE_PROT_SEND_1 int
26327_ACEOF
26328
26329cat >>confdefs.h <<_ACEOF
26330#define HAVE_PROT_SEND_2 const void *
26331_ACEOF
26332
26333cat >>confdefs.h <<_ACEOF
26334#define HAVE_PROT_SEND_3 size_t
26335_ACEOF
26336
26337cat >>confdefs.h <<_ACEOF
26338#define HAVE_PROT_SEND_4 int
26339_ACEOF
26340
26341  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26342$as_echo "ok" >&6; }
26343else
26344  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26345/* end confdefs.h.  */
26346
26347
26348#include <sys/types.h>
26349#include <sys/socket.h>
26350#include <sys/uio.h>
26351#include <netdb.h>
26352#include <unistd.h>
26353
26354ssize_t
26355send( int, const void *, size_t, unsigned int
26356);
26357int
26358main ()
26359{
26360
26361  ;
26362  return 0;
26363}
26364_ACEOF
26365if ac_fn_c_try_compile "$LINENO"; then :
26366
26367cat >>confdefs.h <<_ACEOF
26368#define HAVE_PROT_SEND_0 ssize_t
26369_ACEOF
26370
26371cat >>confdefs.h <<_ACEOF
26372#define HAVE_PROT_SEND_1 int
26373_ACEOF
26374
26375cat >>confdefs.h <<_ACEOF
26376#define HAVE_PROT_SEND_2 const void *
26377_ACEOF
26378
26379cat >>confdefs.h <<_ACEOF
26380#define HAVE_PROT_SEND_3 size_t
26381_ACEOF
26382
26383cat >>confdefs.h <<_ACEOF
26384#define HAVE_PROT_SEND_4 unsigned int
26385_ACEOF
26386
26387  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26388$as_echo "ok" >&6; }
26389else
26390  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26391$as_echo "failure" >&6; }
26392   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for send" >&5
26393$as_echo "$as_me: WARNING: missing prototype for send" >&2;}
26394  failproto=t
26395fi
26396rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26397fi
26398rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26399
26400
26401{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for sendmsg" >&5
26402$as_echo_n "checking prototypes for sendmsg... " >&6; }
26403cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26404/* end confdefs.h.  */
26405
26406
26407#include <sys/types.h>
26408#include <sys/socket.h>
26409#include <sys/uio.h>
26410#include <netdb.h>
26411#include <unistd.h>
26412
26413ssize_t
26414sendmsg( int, const struct msghdr *, int
26415);
26416int
26417main ()
26418{
26419
26420  ;
26421  return 0;
26422}
26423_ACEOF
26424if ac_fn_c_try_compile "$LINENO"; then :
26425
26426cat >>confdefs.h <<_ACEOF
26427#define HAVE_PROT_SENDMSG_0 ssize_t
26428_ACEOF
26429
26430cat >>confdefs.h <<_ACEOF
26431#define HAVE_PROT_SENDMSG_1 int
26432_ACEOF
26433
26434cat >>confdefs.h <<_ACEOF
26435#define HAVE_PROT_SENDMSG_2 const struct msghdr *
26436_ACEOF
26437
26438cat >>confdefs.h <<_ACEOF
26439#define HAVE_PROT_SENDMSG_3 int
26440_ACEOF
26441
26442  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26443$as_echo "ok" >&6; }
26444else
26445  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26446/* end confdefs.h.  */
26447
26448
26449#include <sys/types.h>
26450#include <sys/socket.h>
26451#include <sys/uio.h>
26452#include <netdb.h>
26453#include <unistd.h>
26454
26455int
26456sendmsg( int, const struct msghdr *, unsigned int
26457);
26458int
26459main ()
26460{
26461
26462  ;
26463  return 0;
26464}
26465_ACEOF
26466if ac_fn_c_try_compile "$LINENO"; then :
26467
26468cat >>confdefs.h <<_ACEOF
26469#define HAVE_PROT_SENDMSG_0 int
26470_ACEOF
26471
26472cat >>confdefs.h <<_ACEOF
26473#define HAVE_PROT_SENDMSG_1 int
26474_ACEOF
26475
26476cat >>confdefs.h <<_ACEOF
26477#define HAVE_PROT_SENDMSG_2 const struct msghdr *
26478_ACEOF
26479
26480cat >>confdefs.h <<_ACEOF
26481#define HAVE_PROT_SENDMSG_3 unsigned int
26482_ACEOF
26483
26484  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26485$as_echo "ok" >&6; }
26486else
26487  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26488$as_echo "failure" >&6; }
26489   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for sendmsg" >&5
26490$as_echo "$as_me: WARNING: missing prototype for sendmsg" >&2;}
26491  failproto=t
26492fi
26493rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26494fi
26495rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26496
26497
26498{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for sendto" >&5
26499$as_echo_n "checking prototypes for sendto... " >&6; }
26500cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26501/* end confdefs.h.  */
26502
26503
26504#include <sys/types.h>
26505#include <sys/socket.h>
26506#include <sys/uio.h>
26507#include <netdb.h>
26508#include <unistd.h>
26509
26510ssize_t
26511sendto( int, const void *, size_t, int, const struct sockaddr *, socklen_t
26512);
26513int
26514main ()
26515{
26516
26517  ;
26518  return 0;
26519}
26520_ACEOF
26521if ac_fn_c_try_compile "$LINENO"; then :
26522
26523cat >>confdefs.h <<_ACEOF
26524#define HAVE_PROT_SENDTO_0 ssize_t
26525_ACEOF
26526
26527cat >>confdefs.h <<_ACEOF
26528#define HAVE_PROT_SENDTO_1 int
26529_ACEOF
26530
26531cat >>confdefs.h <<_ACEOF
26532#define HAVE_PROT_SENDTO_2 const void *
26533_ACEOF
26534
26535cat >>confdefs.h <<_ACEOF
26536#define HAVE_PROT_SENDTO_3 size_t
26537_ACEOF
26538
26539cat >>confdefs.h <<_ACEOF
26540#define HAVE_PROT_SENDTO_4 int
26541_ACEOF
26542
26543cat >>confdefs.h <<_ACEOF
26544#define HAVE_PROT_SENDTO_5 const struct sockaddr *
26545_ACEOF
26546
26547cat >>confdefs.h <<_ACEOF
26548#define HAVE_PROT_SENDTO_6 socklen_t
26549_ACEOF
26550
26551  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26552$as_echo "ok" >&6; }
26553else
26554  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26555$as_echo "failure" >&6; }
26556   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for sendto" >&5
26557$as_echo "$as_me: WARNING: missing prototype for sendto" >&2;}
26558  failproto=t
26559fi
26560rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26561
26562
26563{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for write" >&5
26564$as_echo_n "checking prototypes for write... " >&6; }
26565cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26566/* end confdefs.h.  */
26567
26568
26569#include <sys/types.h>
26570#include <sys/socket.h>
26571#include <sys/uio.h>
26572#include <netdb.h>
26573#include <unistd.h>
26574
26575ssize_t
26576write( int, const void *, size_t
26577);
26578int
26579main ()
26580{
26581
26582  ;
26583  return 0;
26584}
26585_ACEOF
26586if ac_fn_c_try_compile "$LINENO"; then :
26587
26588cat >>confdefs.h <<_ACEOF
26589#define HAVE_PROT_WRITE_0 ssize_t
26590_ACEOF
26591
26592cat >>confdefs.h <<_ACEOF
26593#define HAVE_PROT_WRITE_1 int
26594_ACEOF
26595
26596cat >>confdefs.h <<_ACEOF
26597#define HAVE_PROT_WRITE_2 const void *
26598_ACEOF
26599
26600cat >>confdefs.h <<_ACEOF
26601#define HAVE_PROT_WRITE_3 size_t
26602_ACEOF
26603
26604  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26605$as_echo "ok" >&6; }
26606else
26607  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26608$as_echo "failure" >&6; }
26609   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for write" >&5
26610$as_echo "$as_me: WARNING: missing prototype for write" >&2;}
26611  failproto=t
26612fi
26613rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26614
26615
26616{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for writev" >&5
26617$as_echo_n "checking prototypes for writev... " >&6; }
26618cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26619/* end confdefs.h.  */
26620
26621
26622#include <sys/types.h>
26623#include <sys/socket.h>
26624#include <sys/uio.h>
26625#include <netdb.h>
26626#include <unistd.h>
26627
26628ssize_t
26629writev( int, const struct iovec *, int
26630);
26631int
26632main ()
26633{
26634
26635  ;
26636  return 0;
26637}
26638_ACEOF
26639if ac_fn_c_try_compile "$LINENO"; then :
26640
26641cat >>confdefs.h <<_ACEOF
26642#define HAVE_PROT_WRITEV_0 ssize_t
26643_ACEOF
26644
26645cat >>confdefs.h <<_ACEOF
26646#define HAVE_PROT_WRITEV_1 int
26647_ACEOF
26648
26649cat >>confdefs.h <<_ACEOF
26650#define HAVE_PROT_WRITEV_2 const struct iovec *
26651_ACEOF
26652
26653cat >>confdefs.h <<_ACEOF
26654#define HAVE_PROT_WRITEV_3 int
26655_ACEOF
26656
26657  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26658$as_echo "ok" >&6; }
26659else
26660  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26661/* end confdefs.h.  */
26662
26663
26664#include <sys/types.h>
26665#include <sys/socket.h>
26666#include <sys/uio.h>
26667#include <netdb.h>
26668#include <unistd.h>
26669
26670int
26671writev( int, const struct iovec *, int
26672);
26673int
26674main ()
26675{
26676
26677  ;
26678  return 0;
26679}
26680_ACEOF
26681if ac_fn_c_try_compile "$LINENO"; then :
26682
26683cat >>confdefs.h <<_ACEOF
26684#define HAVE_PROT_WRITEV_0 int
26685_ACEOF
26686
26687cat >>confdefs.h <<_ACEOF
26688#define HAVE_PROT_WRITEV_1 int
26689_ACEOF
26690
26691cat >>confdefs.h <<_ACEOF
26692#define HAVE_PROT_WRITEV_2 const struct iovec *
26693_ACEOF
26694
26695cat >>confdefs.h <<_ACEOF
26696#define HAVE_PROT_WRITEV_3 int
26697_ACEOF
26698
26699  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26700$as_echo "ok" >&6; }
26701else
26702  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26703$as_echo "failure" >&6; }
26704   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for writev" >&5
26705$as_echo "$as_me: WARNING: missing prototype for writev" >&2;}
26706  failproto=t
26707fi
26708rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26709fi
26710rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26711
26712    #XXX stdio related functions
26713
26714{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for getc" >&5
26715$as_echo_n "checking prototypes for getc... " >&6; }
26716cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26717/* end confdefs.h.  */
26718
26719
26720#include <stdio.h>
26721#include <stdarg.h>
26722#include <unistd.h>
26723#ifdef getc
26724#undef getc
26725#endif
26726
26727int
26728getc( FILE *
26729);
26730int
26731main ()
26732{
26733
26734  ;
26735  return 0;
26736}
26737_ACEOF
26738if ac_fn_c_try_compile "$LINENO"; then :
26739
26740cat >>confdefs.h <<_ACEOF
26741#define HAVE_PROT_GETC_0 int
26742_ACEOF
26743
26744cat >>confdefs.h <<_ACEOF
26745#define HAVE_PROT_GETC_1 FILE *
26746_ACEOF
26747
26748  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26749$as_echo "ok" >&6; }
26750else
26751  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26752$as_echo "failure" >&6; }
26753   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for getc" >&5
26754$as_echo "$as_me: WARNING: missing prototype for getc" >&2;}
26755  failproto=t
26756fi
26757rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26758
26759
26760{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fgetc" >&5
26761$as_echo_n "checking prototypes for fgetc... " >&6; }
26762cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26763/* end confdefs.h.  */
26764
26765
26766#include <stdio.h>
26767#include <stdarg.h>
26768#include <unistd.h>
26769#ifdef fgetc
26770#undef fgetc
26771#endif
26772
26773int
26774fgetc( FILE *
26775);
26776int
26777main ()
26778{
26779
26780  ;
26781  return 0;
26782}
26783_ACEOF
26784if ac_fn_c_try_compile "$LINENO"; then :
26785
26786cat >>confdefs.h <<_ACEOF
26787#define HAVE_PROT_FGETC_0 int
26788_ACEOF
26789
26790cat >>confdefs.h <<_ACEOF
26791#define HAVE_PROT_FGETC_1 FILE *
26792_ACEOF
26793
26794  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26795$as_echo "ok" >&6; }
26796else
26797  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26798$as_echo "failure" >&6; }
26799   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fgetc" >&5
26800$as_echo "$as_me: WARNING: missing prototype for fgetc" >&2;}
26801  failproto=t
26802fi
26803rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26804
26805
26806{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for gets" >&5
26807$as_echo_n "checking prototypes for gets... " >&6; }
26808cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26809/* end confdefs.h.  */
26810
26811
26812#include <stdio.h>
26813#include <stdarg.h>
26814#include <unistd.h>
26815#ifdef gets
26816#undef gets
26817#endif
26818
26819char *
26820gets( char *
26821);
26822int
26823main ()
26824{
26825
26826  ;
26827  return 0;
26828}
26829_ACEOF
26830if ac_fn_c_try_compile "$LINENO"; then :
26831
26832cat >>confdefs.h <<_ACEOF
26833#define HAVE_PROT_GETS_0 char *
26834_ACEOF
26835
26836cat >>confdefs.h <<_ACEOF
26837#define HAVE_PROT_GETS_1 char *
26838_ACEOF
26839
26840  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26841$as_echo "ok" >&6; }
26842else
26843  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26844$as_echo "failure" >&6; }
26845   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for gets" >&5
26846$as_echo "$as_me: WARNING: missing prototype for gets" >&2;}
26847  failproto=t
26848fi
26849rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26850
26851
26852{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fgets" >&5
26853$as_echo_n "checking prototypes for fgets... " >&6; }
26854cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26855/* end confdefs.h.  */
26856
26857
26858#include <stdio.h>
26859#include <stdarg.h>
26860#include <unistd.h>
26861#ifdef fgets
26862#undef fgets
26863#endif
26864
26865char *
26866fgets( char *, int, FILE *
26867);
26868int
26869main ()
26870{
26871
26872  ;
26873  return 0;
26874}
26875_ACEOF
26876if ac_fn_c_try_compile "$LINENO"; then :
26877
26878cat >>confdefs.h <<_ACEOF
26879#define HAVE_PROT_FGETS_0 char *
26880_ACEOF
26881
26882cat >>confdefs.h <<_ACEOF
26883#define HAVE_PROT_FGETS_1 char *
26884_ACEOF
26885
26886cat >>confdefs.h <<_ACEOF
26887#define HAVE_PROT_FGETS_2 int
26888_ACEOF
26889
26890cat >>confdefs.h <<_ACEOF
26891#define HAVE_PROT_FGETS_3 FILE *
26892_ACEOF
26893
26894  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26895$as_echo "ok" >&6; }
26896else
26897  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26898$as_echo "failure" >&6; }
26899   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fgets" >&5
26900$as_echo "$as_me: WARNING: missing prototype for fgets" >&2;}
26901  failproto=t
26902fi
26903rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26904
26905
26906{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for putc" >&5
26907$as_echo_n "checking prototypes for putc... " >&6; }
26908cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26909/* end confdefs.h.  */
26910
26911
26912#include <stdio.h>
26913#include <stdarg.h>
26914#include <unistd.h>
26915#ifdef putc
26916#undef putc
26917#endif
26918
26919int
26920putc( int, FILE *
26921);
26922int
26923main ()
26924{
26925
26926  ;
26927  return 0;
26928}
26929_ACEOF
26930if ac_fn_c_try_compile "$LINENO"; then :
26931
26932cat >>confdefs.h <<_ACEOF
26933#define HAVE_PROT_PUTC_0 int
26934_ACEOF
26935
26936cat >>confdefs.h <<_ACEOF
26937#define HAVE_PROT_PUTC_1 int
26938_ACEOF
26939
26940cat >>confdefs.h <<_ACEOF
26941#define HAVE_PROT_PUTC_2 FILE *
26942_ACEOF
26943
26944  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26945$as_echo "ok" >&6; }
26946else
26947  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26948$as_echo "failure" >&6; }
26949   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for putc" >&5
26950$as_echo "$as_me: WARNING: missing prototype for putc" >&2;}
26951  failproto=t
26952fi
26953rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
26954
26955
26956{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fputc" >&5
26957$as_echo_n "checking prototypes for fputc... " >&6; }
26958cat confdefs.h - <<_ACEOF >conftest.$ac_ext
26959/* end confdefs.h.  */
26960
26961
26962#include <stdio.h>
26963#include <stdarg.h>
26964#include <unistd.h>
26965#ifdef fputc
26966#undef fputc
26967#endif
26968
26969int
26970fputc( int, FILE *
26971);
26972int
26973main ()
26974{
26975
26976  ;
26977  return 0;
26978}
26979_ACEOF
26980if ac_fn_c_try_compile "$LINENO"; then :
26981
26982cat >>confdefs.h <<_ACEOF
26983#define HAVE_PROT_FPUTC_0 int
26984_ACEOF
26985
26986cat >>confdefs.h <<_ACEOF
26987#define HAVE_PROT_FPUTC_1 int
26988_ACEOF
26989
26990cat >>confdefs.h <<_ACEOF
26991#define HAVE_PROT_FPUTC_2 FILE *
26992_ACEOF
26993
26994  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
26995$as_echo "ok" >&6; }
26996else
26997  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
26998$as_echo "failure" >&6; }
26999   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fputc" >&5
27000$as_echo "$as_me: WARNING: missing prototype for fputc" >&2;}
27001  failproto=t
27002fi
27003rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27004
27005
27006{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for puts" >&5
27007$as_echo_n "checking prototypes for puts... " >&6; }
27008cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27009/* end confdefs.h.  */
27010
27011
27012#include <stdio.h>
27013#include <stdarg.h>
27014#include <unistd.h>
27015#ifdef puts
27016#undef puts
27017#endif
27018
27019int
27020puts( const char *
27021);
27022int
27023main ()
27024{
27025
27026  ;
27027  return 0;
27028}
27029_ACEOF
27030if ac_fn_c_try_compile "$LINENO"; then :
27031
27032cat >>confdefs.h <<_ACEOF
27033#define HAVE_PROT_PUTS_0 int
27034_ACEOF
27035
27036cat >>confdefs.h <<_ACEOF
27037#define HAVE_PROT_PUTS_1 const char *
27038_ACEOF
27039
27040  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27041$as_echo "ok" >&6; }
27042else
27043  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27044$as_echo "failure" >&6; }
27045   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for puts" >&5
27046$as_echo "$as_me: WARNING: missing prototype for puts" >&2;}
27047  failproto=t
27048fi
27049rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27050
27051
27052{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fputs" >&5
27053$as_echo_n "checking prototypes for fputs... " >&6; }
27054cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27055/* end confdefs.h.  */
27056
27057
27058#include <stdio.h>
27059#include <stdarg.h>
27060#include <unistd.h>
27061#ifdef fputs
27062#undef fputs
27063#endif
27064
27065int
27066fputs( const char *, FILE *
27067);
27068int
27069main ()
27070{
27071
27072  ;
27073  return 0;
27074}
27075_ACEOF
27076if ac_fn_c_try_compile "$LINENO"; then :
27077
27078cat >>confdefs.h <<_ACEOF
27079#define HAVE_PROT_FPUTS_0 int
27080_ACEOF
27081
27082cat >>confdefs.h <<_ACEOF
27083#define HAVE_PROT_FPUTS_1 const char *
27084_ACEOF
27085
27086cat >>confdefs.h <<_ACEOF
27087#define HAVE_PROT_FPUTS_2 FILE *
27088_ACEOF
27089
27090  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27091$as_echo "ok" >&6; }
27092else
27093  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27094$as_echo "failure" >&6; }
27095   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fputs" >&5
27096$as_echo "$as_me: WARNING: missing prototype for fputs" >&2;}
27097  failproto=t
27098fi
27099rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27100
27101
27102{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fflush" >&5
27103$as_echo_n "checking prototypes for fflush... " >&6; }
27104cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27105/* end confdefs.h.  */
27106
27107
27108#include <stdio.h>
27109#include <stdarg.h>
27110#include <unistd.h>
27111#ifdef fflush
27112#undef fflush
27113#endif
27114
27115int
27116fflush( FILE *
27117);
27118int
27119main ()
27120{
27121
27122  ;
27123  return 0;
27124}
27125_ACEOF
27126if ac_fn_c_try_compile "$LINENO"; then :
27127
27128cat >>confdefs.h <<_ACEOF
27129#define HAVE_PROT_FFLUSH_0 int
27130_ACEOF
27131
27132cat >>confdefs.h <<_ACEOF
27133#define HAVE_PROT_FFLUSH_1 FILE *
27134_ACEOF
27135
27136  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27137$as_echo "ok" >&6; }
27138else
27139  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27140$as_echo "failure" >&6; }
27141   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fflush" >&5
27142$as_echo "$as_me: WARNING: missing prototype for fflush" >&2;}
27143  failproto=t
27144fi
27145rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27146
27147
27148{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fclose" >&5
27149$as_echo_n "checking prototypes for fclose... " >&6; }
27150cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27151/* end confdefs.h.  */
27152
27153
27154#include <stdio.h>
27155#include <stdarg.h>
27156#include <unistd.h>
27157#ifdef fclose
27158#undef fclose
27159#endif
27160
27161int
27162fclose( FILE *
27163);
27164int
27165main ()
27166{
27167
27168  ;
27169  return 0;
27170}
27171_ACEOF
27172if ac_fn_c_try_compile "$LINENO"; then :
27173
27174cat >>confdefs.h <<_ACEOF
27175#define HAVE_PROT_FCLOSE_0 int
27176_ACEOF
27177
27178cat >>confdefs.h <<_ACEOF
27179#define HAVE_PROT_FCLOSE_1 FILE *
27180_ACEOF
27181
27182  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27183$as_echo "ok" >&6; }
27184else
27185  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27186$as_echo "failure" >&6; }
27187   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fclose" >&5
27188$as_echo "$as_me: WARNING: missing prototype for fclose" >&2;}
27189  failproto=t
27190fi
27191rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27192
27193
27194{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fprintf" >&5
27195$as_echo_n "checking prototypes for fprintf... " >&6; }
27196cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27197/* end confdefs.h.  */
27198
27199
27200#include <stdio.h>
27201#include <stdarg.h>
27202#include <unistd.h>
27203#ifdef fprintf
27204#undef fprintf
27205#endif
27206
27207int
27208fprintf( FILE *, const char *, ...
27209);
27210int
27211main ()
27212{
27213
27214  ;
27215  return 0;
27216}
27217_ACEOF
27218if ac_fn_c_try_compile "$LINENO"; then :
27219
27220cat >>confdefs.h <<_ACEOF
27221#define HAVE_PROT_FPRINTF_0 int
27222_ACEOF
27223
27224cat >>confdefs.h <<_ACEOF
27225#define HAVE_PROT_FPRINTF_1 FILE *
27226_ACEOF
27227
27228cat >>confdefs.h <<_ACEOF
27229#define HAVE_PROT_FPRINTF_2 const char *
27230_ACEOF
27231
27232cat >>confdefs.h <<_ACEOF
27233#define HAVE_PROT_FPRINTF_3 ...
27234_ACEOF
27235
27236  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27237$as_echo "ok" >&6; }
27238else
27239  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27240$as_echo "failure" >&6; }
27241   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fprintf" >&5
27242$as_echo "$as_me: WARNING: missing prototype for fprintf" >&2;}
27243  failproto=t
27244fi
27245rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27246
27247
27248{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for vfprintf" >&5
27249$as_echo_n "checking prototypes for vfprintf... " >&6; }
27250cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27251/* end confdefs.h.  */
27252
27253
27254#include <stdio.h>
27255#include <stdarg.h>
27256#include <unistd.h>
27257#ifdef vfprintf
27258#undef vfprintf
27259#endif
27260
27261int
27262vfprintf( FILE *, const char *, va_list
27263);
27264int
27265main ()
27266{
27267
27268  ;
27269  return 0;
27270}
27271_ACEOF
27272if ac_fn_c_try_compile "$LINENO"; then :
27273
27274cat >>confdefs.h <<_ACEOF
27275#define HAVE_PROT_VFPRINTF_0 int
27276_ACEOF
27277
27278cat >>confdefs.h <<_ACEOF
27279#define HAVE_PROT_VFPRINTF_1 FILE *
27280_ACEOF
27281
27282cat >>confdefs.h <<_ACEOF
27283#define HAVE_PROT_VFPRINTF_2 const char *
27284_ACEOF
27285
27286cat >>confdefs.h <<_ACEOF
27287#define HAVE_PROT_VFPRINTF_3 va_list
27288_ACEOF
27289
27290  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27291$as_echo "ok" >&6; }
27292else
27293  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27294$as_echo "failure" >&6; }
27295   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for vfprintf" >&5
27296$as_echo "$as_me: WARNING: missing prototype for vfprintf" >&2;}
27297  failproto=t
27298fi
27299rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27300
27301
27302{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for printf" >&5
27303$as_echo_n "checking prototypes for printf... " >&6; }
27304cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27305/* end confdefs.h.  */
27306
27307
27308#include <stdio.h>
27309#include <stdarg.h>
27310#include <unistd.h>
27311#ifdef printf
27312#undef printf
27313#endif
27314
27315int
27316printf( const char *, ...
27317);
27318int
27319main ()
27320{
27321
27322  ;
27323  return 0;
27324}
27325_ACEOF
27326if ac_fn_c_try_compile "$LINENO"; then :
27327
27328cat >>confdefs.h <<_ACEOF
27329#define HAVE_PROT_PRINTF_0 int
27330_ACEOF
27331
27332cat >>confdefs.h <<_ACEOF
27333#define HAVE_PROT_PRINTF_1 const char *
27334_ACEOF
27335
27336cat >>confdefs.h <<_ACEOF
27337#define HAVE_PROT_PRINTF_2 ...
27338_ACEOF
27339
27340  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27341$as_echo "ok" >&6; }
27342else
27343  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27344$as_echo "failure" >&6; }
27345   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for printf" >&5
27346$as_echo "$as_me: WARNING: missing prototype for printf" >&2;}
27347  failproto=t
27348fi
27349rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27350
27351
27352{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for vprintf" >&5
27353$as_echo_n "checking prototypes for vprintf... " >&6; }
27354cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27355/* end confdefs.h.  */
27356
27357
27358#include <stdio.h>
27359#include <stdarg.h>
27360#include <unistd.h>
27361#ifdef vprintf
27362#undef vprintf
27363#endif
27364
27365int
27366vprintf( const char *, va_list
27367);
27368int
27369main ()
27370{
27371
27372  ;
27373  return 0;
27374}
27375_ACEOF
27376if ac_fn_c_try_compile "$LINENO"; then :
27377
27378cat >>confdefs.h <<_ACEOF
27379#define HAVE_PROT_VPRINTF_0 int
27380_ACEOF
27381
27382cat >>confdefs.h <<_ACEOF
27383#define HAVE_PROT_VPRINTF_1 const char *
27384_ACEOF
27385
27386cat >>confdefs.h <<_ACEOF
27387#define HAVE_PROT_VPRINTF_2 va_list
27388_ACEOF
27389
27390  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27391$as_echo "ok" >&6; }
27392else
27393  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27394$as_echo "failure" >&6; }
27395   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for vprintf" >&5
27396$as_echo "$as_me: WARNING: missing prototype for vprintf" >&2;}
27397  failproto=t
27398fi
27399rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27400
27401
27402{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fwrite" >&5
27403$as_echo_n "checking prototypes for fwrite... " >&6; }
27404cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27405/* end confdefs.h.  */
27406
27407
27408#include <stdio.h>
27409#include <stdarg.h>
27410#include <unistd.h>
27411#ifdef fwrite
27412#undef fwrite
27413#endif
27414
27415size_t
27416fwrite( const void *, size_t, size_t, FILE *
27417);
27418int
27419main ()
27420{
27421
27422  ;
27423  return 0;
27424}
27425_ACEOF
27426if ac_fn_c_try_compile "$LINENO"; then :
27427
27428cat >>confdefs.h <<_ACEOF
27429#define HAVE_PROT_FWRITE_0 size_t
27430_ACEOF
27431
27432cat >>confdefs.h <<_ACEOF
27433#define HAVE_PROT_FWRITE_1 const void *
27434_ACEOF
27435
27436cat >>confdefs.h <<_ACEOF
27437#define HAVE_PROT_FWRITE_2 size_t
27438_ACEOF
27439
27440cat >>confdefs.h <<_ACEOF
27441#define HAVE_PROT_FWRITE_3 size_t
27442_ACEOF
27443
27444cat >>confdefs.h <<_ACEOF
27445#define HAVE_PROT_FWRITE_4 FILE *
27446_ACEOF
27447
27448  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27449$as_echo "ok" >&6; }
27450else
27451  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27452$as_echo "failure" >&6; }
27453   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fwrite" >&5
27454$as_echo "$as_me: WARNING: missing prototype for fwrite" >&2;}
27455  failproto=t
27456fi
27457rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27458
27459
27460{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for fread" >&5
27461$as_echo_n "checking prototypes for fread... " >&6; }
27462cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27463/* end confdefs.h.  */
27464
27465
27466#include <stdio.h>
27467#include <stdarg.h>
27468#include <unistd.h>
27469#ifdef fread
27470#undef fread
27471#endif
27472
27473size_t
27474fread( void *, size_t, size_t, FILE *
27475);
27476int
27477main ()
27478{
27479
27480  ;
27481  return 0;
27482}
27483_ACEOF
27484if ac_fn_c_try_compile "$LINENO"; then :
27485
27486cat >>confdefs.h <<_ACEOF
27487#define HAVE_PROT_FREAD_0 size_t
27488_ACEOF
27489
27490cat >>confdefs.h <<_ACEOF
27491#define HAVE_PROT_FREAD_1 void *
27492_ACEOF
27493
27494cat >>confdefs.h <<_ACEOF
27495#define HAVE_PROT_FREAD_2 size_t
27496_ACEOF
27497
27498cat >>confdefs.h <<_ACEOF
27499#define HAVE_PROT_FREAD_3 size_t
27500_ACEOF
27501
27502cat >>confdefs.h <<_ACEOF
27503#define HAVE_PROT_FREAD_4 FILE *
27504_ACEOF
27505
27506  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27507$as_echo "ok" >&6; }
27508else
27509  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27510$as_echo "failure" >&6; }
27511   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for fread" >&5
27512$as_echo "$as_me: WARNING: missing prototype for fread" >&2;}
27513  failproto=t
27514fi
27515rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27516
27517    if test x"${ac_cv_func__IO_getc}" = xyes; then
27518
27519{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for _IO_getc" >&5
27520$as_echo_n "checking prototypes for _IO_getc... " >&6; }
27521cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27522/* end confdefs.h.  */
27523
27524
27525#include <stdio.h>
27526#include <stdarg.h>
27527#include <unistd.h>
27528#ifdef _IO_getc
27529#undef _IO_getc
27530#endif
27531
27532int
27533_IO_getc( FILE *
27534);
27535int
27536main ()
27537{
27538
27539  ;
27540  return 0;
27541}
27542_ACEOF
27543if ac_fn_c_try_compile "$LINENO"; then :
27544
27545cat >>confdefs.h <<_ACEOF
27546#define HAVE_PROT__IO_GETC_0 int
27547_ACEOF
27548
27549cat >>confdefs.h <<_ACEOF
27550#define HAVE_PROT__IO_GETC_1 FILE *
27551_ACEOF
27552
27553  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27554$as_echo "ok" >&6; }
27555else
27556  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27557$as_echo "failure" >&6; }
27558   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for _IO_getc" >&5
27559$as_echo "$as_me: WARNING: missing prototype for _IO_getc" >&2;}
27560  failproto=t
27561fi
27562rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27563    fi
27564
27565    if test x"${ac_cv_func__IO_putc}" = xyes; then
27566
27567{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for _IO_putc" >&5
27568$as_echo_n "checking prototypes for _IO_putc... " >&6; }
27569cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27570/* end confdefs.h.  */
27571
27572
27573#include <stdio.h>
27574#include <stdarg.h>
27575#include <unistd.h>
27576#ifdef _IO_putc
27577#undef _IO_putc
27578#endif
27579
27580int
27581_IO_putc( int, FILE *
27582);
27583int
27584main ()
27585{
27586
27587  ;
27588  return 0;
27589}
27590_ACEOF
27591if ac_fn_c_try_compile "$LINENO"; then :
27592
27593cat >>confdefs.h <<_ACEOF
27594#define HAVE_PROT__IO_PUTC_0 int
27595_ACEOF
27596
27597cat >>confdefs.h <<_ACEOF
27598#define HAVE_PROT__IO_PUTC_1 int
27599_ACEOF
27600
27601cat >>confdefs.h <<_ACEOF
27602#define HAVE_PROT__IO_PUTC_2 FILE *
27603_ACEOF
27604
27605  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27606$as_echo "ok" >&6; }
27607else
27608  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27609$as_echo "failure" >&6; }
27610   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for _IO_putc" >&5
27611$as_echo "$as_me: WARNING: missing prototype for _IO_putc" >&2;}
27612  failproto=t
27613fi
27614rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27615    fi
27616
27617    if test x"${ac_cv_func___read_chk}" = xyes; then
27618
27619{ $as_echo "$as_me:${as_lineno-$LINENO}: checking prototypes for _read_chk" >&5
27620$as_echo_n "checking prototypes for _read_chk... " >&6; }
27621cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27622/* end confdefs.h.  */
27623
27624
27625#include <stdio.h>
27626#include <stdarg.h>
27627#include <unistd.h>
27628#ifdef _read_chk
27629#undef _read_chk
27630#endif
27631
27632ssize_t
27633_read_chk( int, void *, size_t, size_t
27634);
27635int
27636main ()
27637{
27638
27639  ;
27640  return 0;
27641}
27642_ACEOF
27643if ac_fn_c_try_compile "$LINENO"; then :
27644
27645cat >>confdefs.h <<_ACEOF
27646#define HAVE_PROT__READ_CHK_0 ssize_t
27647_ACEOF
27648
27649cat >>confdefs.h <<_ACEOF
27650#define HAVE_PROT__READ_CHK_1 int
27651_ACEOF
27652
27653cat >>confdefs.h <<_ACEOF
27654#define HAVE_PROT__READ_CHK_2 void *
27655_ACEOF
27656
27657cat >>confdefs.h <<_ACEOF
27658#define HAVE_PROT__READ_CHK_3 size_t
27659_ACEOF
27660
27661cat >>confdefs.h <<_ACEOF
27662#define HAVE_PROT__READ_CHK_4 size_t
27663_ACEOF
27664
27665  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
27666$as_echo "ok" >&6; }
27667else
27668  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failure" >&5
27669$as_echo "failure" >&6; }
27670   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing prototype for _read_chk" >&5
27671$as_echo "$as_me: WARNING: missing prototype for _read_chk" >&2;}
27672  failproto=t
27673fi
27674rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
27675    fi
27676
27677    #XXX add vprintf_chk/fprintf_chk?
27678
27679    if test x"$failproto" != x; then
27680	{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: attempt to determine function prototypes
27681failed, and will probably mean that building of libdsocks, which
27682allows on-the-fly socksification of dynamic binaries, will not work.
27683
27684      You have several options:
27685
27686      1. If you do not need libdsocks, run configure with the
27687         option --disable-preload.
27688      2. Submit a bugreport.
27689      3. Find the prototypes used on your platform for the
27690         failed functions, and add them to the configure.ac
27691         file. Then use autoconf, which must be installed,
27692         to regenerate the configure script.
27693         Function prototype definitions can usually be found
27694         in the manual page for the function or the system
27695         include files (usually found under /usr/include)." >&5
27696$as_echo "$as_me: WARNING: attempt to determine function prototypes
27697failed, and will probably mean that building of libdsocks, which
27698allows on-the-fly socksification of dynamic binaries, will not work.
27699
27700      You have several options:
27701
27702      1. If you do not need libdsocks, run configure with the
27703         option --disable-preload.
27704      2. Submit a bugreport.
27705      3. Find the prototypes used on your platform for the
27706         failed functions, and add them to the configure.ac
27707         file. Then use autoconf, which must be installed,
27708         to regenerate the configure script.
27709         Function prototype definitions can usually be found
27710         in the manual page for the function or the system
27711         include files (usually found under /usr/include)." >&2;}
27712	exit 1
27713    fi
27714
27715    CFLAGS="$preprotoCFLAGS"
27716fi
27717
27718#Look for functions needed for socksify located in other places than libc
27719SOCKSIFY_PRELOAD_LIBS=""
27720oLIBS=$LIBS
27721
27722#clock_gettime()
27723if test x"${ac_cv_search_clock_gettime}" = x"-lrt"; then
27724    SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}librt.${SOLIB_POSTFIX}"
27725fi
27726
27727#HP-UX 11.00
27728LIBS=""
27729{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing bindresvport" >&5
27730$as_echo_n "checking for library containing bindresvport... " >&6; }
27731if ${ac_cv_search_bindresvport+:} false; then :
27732  $as_echo_n "(cached) " >&6
27733else
27734  ac_func_search_save_LIBS=$LIBS
27735cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27736/* end confdefs.h.  */
27737
27738/* Override any GCC internal prototype to avoid an error.
27739   Use char because int might match the return type of a GCC
27740   builtin and then its argument prototype would still apply.  */
27741#ifdef __cplusplus
27742extern "C"
27743#endif
27744char bindresvport ();
27745int
27746main ()
27747{
27748return bindresvport ();
27749  ;
27750  return 0;
27751}
27752_ACEOF
27753for ac_lib in '' rpcsoc; do
27754  if test -z "$ac_lib"; then
27755    ac_res="none required"
27756  else
27757    ac_res=-l$ac_lib
27758    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
27759  fi
27760  if ac_fn_c_try_link "$LINENO"; then :
27761  ac_cv_search_bindresvport=$ac_res
27762fi
27763rm -f core conftest.err conftest.$ac_objext \
27764    conftest$ac_exeext
27765  if ${ac_cv_search_bindresvport+:} false; then :
27766  break
27767fi
27768done
27769if ${ac_cv_search_bindresvport+:} false; then :
27770
27771else
27772  ac_cv_search_bindresvport=no
27773fi
27774rm conftest.$ac_ext
27775LIBS=$ac_func_search_save_LIBS
27776fi
27777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_bindresvport" >&5
27778$as_echo "$ac_cv_search_bindresvport" >&6; }
27779ac_res=$ac_cv_search_bindresvport
27780if test "$ac_res" != no; then :
27781  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
27782
27783fi
27784
27785
27786NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
27787LIBS=""
27788
27789#ignore when preloading is disabled (only the AC_SEARCH_LIBS test is needed)
27790if test x"${preload_enabled}" = xt -a x"${ac_cv_search_bindresvport}" = x"-lrpcsoc"; then
27791
27792cat >>confdefs.h <<_ACEOF
27793#define LIBRARY_LIBRPCSOC "${base_library_path}librpcsoc.sl"
27794_ACEOF
27795
27796    SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}librpcsoc.sl"
27797
27798
27799$as_echo "#define LIBRARY_BINDRESVPORT LIBRARY_LIBRPCSOC" >>confdefs.h
27800
27801fi
27802
27803unset use_threads
27804unset have_ptread_h
27805ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
27806if test "x$ac_cv_header_pthread_h" = xyes; then :
27807
27808$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h
27809
27810     have_pthread_h=t
27811fi
27812
27813
27814if test x"${have_pthread_h}" = xt; then
27815    #do not wish to link directly with libpthreads, included only if needed
27816    tLIBS=$LIBS
27817    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutexattr_init" >&5
27818$as_echo_n "checking for library containing pthread_mutexattr_init... " >&6; }
27819if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
27820  $as_echo_n "(cached) " >&6
27821else
27822  ac_func_search_save_LIBS=$LIBS
27823cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27824/* end confdefs.h.  */
27825
27826/* Override any GCC internal prototype to avoid an error.
27827   Use char because int might match the return type of a GCC
27828   builtin and then its argument prototype would still apply.  */
27829#ifdef __cplusplus
27830extern "C"
27831#endif
27832char pthread_mutexattr_init ();
27833int
27834main ()
27835{
27836return pthread_mutexattr_init ();
27837  ;
27838  return 0;
27839}
27840_ACEOF
27841for ac_lib in '' pthread; do
27842  if test -z "$ac_lib"; then
27843    ac_res="none required"
27844  else
27845    ac_res=-l$ac_lib
27846    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
27847  fi
27848  if ac_fn_c_try_link "$LINENO"; then :
27849  ac_cv_search_pthread_mutexattr_init=$ac_res
27850fi
27851rm -f core conftest.err conftest.$ac_objext \
27852    conftest$ac_exeext
27853  if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
27854  break
27855fi
27856done
27857if ${ac_cv_search_pthread_mutexattr_init+:} false; then :
27858
27859else
27860  ac_cv_search_pthread_mutexattr_init=no
27861fi
27862rm conftest.$ac_ext
27863LIBS=$ac_func_search_save_LIBS
27864fi
27865{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutexattr_init" >&5
27866$as_echo "$ac_cv_search_pthread_mutexattr_init" >&6; }
27867ac_res=$ac_cv_search_pthread_mutexattr_init
27868if test "$ac_res" != no; then :
27869  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
27870
27871fi
27872
27873
27874    #try compiling
27875    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compilation with pthread.h works" >&5
27876$as_echo_n "checking whether compilation with pthread.h works... " >&6; }
27877    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27878/* end confdefs.h.  */
27879
27880#include <pthread.h>
27881int
27882main ()
27883{
27884
27885pthread_mutexattr_t attr;
27886if (pthread_mutexattr_init(&attr) == 0)
27887    return 0;
27888else
27889    return 1;
27890  ;
27891  return 0;
27892}
27893_ACEOF
27894if ac_fn_c_try_link "$LINENO"; then :
27895  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
27896$as_echo "yes" >&6; }
27897	 use_threads=t
27898else
27899  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
27900$as_echo "no" >&6; }
27901fi
27902rm -f core conftest.err conftest.$ac_objext \
27903    conftest$ac_exeext conftest.$ac_ext
27904    LIBS=$tLIBS
27905fi
27906if test x"$use_threads" = xt; then
27907
27908$as_echo "#define HAVE_PTHREAD_H 1" >>confdefs.h
27909
27910    if test x"${ac_cv_search_pthread_mutexattr_init}" = x"-lpthread"; then
27911        case $host in
27912	    *-*-linux-*)
27913	        #XXX attempt to find latest pthread library
27914		PATH=$PATH:/sbin
27915		export PATH
27916		unset LIBPT_ALTS
27917		for file in `ldconfig -p | grep /libpthread.so| xargs -n 1 echo | grep /libpthread.so`; do
27918		    test -s "$file" && LIBPT_ALTS="${LIBPT_ALTS}${LIBPT_ALTS:+ }$file"
27919		done
27920		LIBPT_NAME=`echo ${LIBPT_ALTS} | sed -e 's/.*\///' | sort -nr | head -n 1`
27921		if test x"${LIBPT_NAME}" = x; then
27922		    #nothing found, set something anyway
27923		    LIBPT_NAME="${base_library_path}libpthread.so"
27924		fi
27925		;;
27926
27927	    *)
27928		LIBPT_NAME="libpthread.${SOLIB_POSTFIX}"
27929		;;
27930        esac
27931
27932cat >>confdefs.h <<_ACEOF
27933#define LIBRARY_PTHREAD "${base_library_path}$LIBPT_NAME"
27934_ACEOF
27935
27936    fi
27937fi
27938
27939LIBS=""
27940{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing connect" >&5
27941$as_echo_n "checking for library containing connect... " >&6; }
27942if ${ac_cv_search_connect+:} false; then :
27943  $as_echo_n "(cached) " >&6
27944else
27945  ac_func_search_save_LIBS=$LIBS
27946cat confdefs.h - <<_ACEOF >conftest.$ac_ext
27947/* end confdefs.h.  */
27948
27949/* Override any GCC internal prototype to avoid an error.
27950   Use char because int might match the return type of a GCC
27951   builtin and then its argument prototype would still apply.  */
27952#ifdef __cplusplus
27953extern "C"
27954#endif
27955char connect ();
27956int
27957main ()
27958{
27959return connect ();
27960  ;
27961  return 0;
27962}
27963_ACEOF
27964for ac_lib in '' socket; do
27965  if test -z "$ac_lib"; then
27966    ac_res="none required"
27967  else
27968    ac_res=-l$ac_lib
27969    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
27970  fi
27971  if ac_fn_c_try_link "$LINENO"; then :
27972  ac_cv_search_connect=$ac_res
27973fi
27974rm -f core conftest.err conftest.$ac_objext \
27975    conftest$ac_exeext
27976  if ${ac_cv_search_connect+:} false; then :
27977  break
27978fi
27979done
27980if ${ac_cv_search_connect+:} false; then :
27981
27982else
27983  ac_cv_search_connect=no
27984fi
27985rm conftest.$ac_ext
27986LIBS=$ac_func_search_save_LIBS
27987fi
27988{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_connect" >&5
27989$as_echo "$ac_cv_search_connect" >&6; }
27990ac_res=$ac_cv_search_connect
27991if test "$ac_res" != no; then :
27992  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
27993
27994fi
27995
27996#ignore when preloading is disabled (only the AC_SEARCH_LIBS test is needed)
27997if test x"$preload_enabled" = xt -a x"${ac_cv_search_connect}" = x"-lsocket"; then
27998
27999cat >>confdefs.h <<_ACEOF
28000#define LIBRARY_LIBSOCKET "${base_library_path}libsocket.${SOLIB_POSTFIX}"
28001_ACEOF
28002
28003    SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}libsocket.${SOLIB_POSTFIX}"
28004
28005
28006$as_echo "#define LIBRARY_CONNECT LIBRARY_LIBSOCKET" >>confdefs.h
28007
28008
28009    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for accept in -lsocket" >&5
28010$as_echo_n "checking for accept in -lsocket... " >&6; }
28011if ${ac_cv_lib_socket_accept+:} false; then :
28012  $as_echo_n "(cached) " >&6
28013else
28014  ac_check_lib_save_LIBS=$LIBS
28015LIBS="-lsocket  $LIBS"
28016cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28017/* end confdefs.h.  */
28018
28019/* Override any GCC internal prototype to avoid an error.
28020   Use char because int might match the return type of a GCC
28021   builtin and then its argument prototype would still apply.  */
28022#ifdef __cplusplus
28023extern "C"
28024#endif
28025char accept ();
28026int
28027main ()
28028{
28029return accept ();
28030  ;
28031  return 0;
28032}
28033_ACEOF
28034if ac_fn_c_try_link "$LINENO"; then :
28035  ac_cv_lib_socket_accept=yes
28036else
28037  ac_cv_lib_socket_accept=no
28038fi
28039rm -f core conftest.err conftest.$ac_objext \
28040    conftest$ac_exeext conftest.$ac_ext
28041LIBS=$ac_check_lib_save_LIBS
28042fi
28043{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_accept" >&5
28044$as_echo "$ac_cv_lib_socket_accept" >&6; }
28045if test "x$ac_cv_lib_socket_accept" = xyes; then :
28046
28047$as_echo "#define LIBRARY_ACCEPT LIBRARY_LIBSOCKET" >>confdefs.h
28048
28049fi
28050
28051    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bind in -lsocket" >&5
28052$as_echo_n "checking for bind in -lsocket... " >&6; }
28053if ${ac_cv_lib_socket_bind+:} false; then :
28054  $as_echo_n "(cached) " >&6
28055else
28056  ac_check_lib_save_LIBS=$LIBS
28057LIBS="-lsocket  $LIBS"
28058cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28059/* end confdefs.h.  */
28060
28061/* Override any GCC internal prototype to avoid an error.
28062   Use char because int might match the return type of a GCC
28063   builtin and then its argument prototype would still apply.  */
28064#ifdef __cplusplus
28065extern "C"
28066#endif
28067char bind ();
28068int
28069main ()
28070{
28071return bind ();
28072  ;
28073  return 0;
28074}
28075_ACEOF
28076if ac_fn_c_try_link "$LINENO"; then :
28077  ac_cv_lib_socket_bind=yes
28078else
28079  ac_cv_lib_socket_bind=no
28080fi
28081rm -f core conftest.err conftest.$ac_objext \
28082    conftest$ac_exeext conftest.$ac_ext
28083LIBS=$ac_check_lib_save_LIBS
28084fi
28085{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_bind" >&5
28086$as_echo "$ac_cv_lib_socket_bind" >&6; }
28087if test "x$ac_cv_lib_socket_bind" = xyes; then :
28088
28089$as_echo "#define LIBRARY_BIND LIBRARY_LIBSOCKET" >>confdefs.h
28090
28091fi
28092
28093    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bindresvport in -lsocket" >&5
28094$as_echo_n "checking for bindresvport in -lsocket... " >&6; }
28095if ${ac_cv_lib_socket_bindresvport+:} false; then :
28096  $as_echo_n "(cached) " >&6
28097else
28098  ac_check_lib_save_LIBS=$LIBS
28099LIBS="-lsocket  $LIBS"
28100cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28101/* end confdefs.h.  */
28102
28103/* Override any GCC internal prototype to avoid an error.
28104   Use char because int might match the return type of a GCC
28105   builtin and then its argument prototype would still apply.  */
28106#ifdef __cplusplus
28107extern "C"
28108#endif
28109char bindresvport ();
28110int
28111main ()
28112{
28113return bindresvport ();
28114  ;
28115  return 0;
28116}
28117_ACEOF
28118if ac_fn_c_try_link "$LINENO"; then :
28119  ac_cv_lib_socket_bindresvport=yes
28120else
28121  ac_cv_lib_socket_bindresvport=no
28122fi
28123rm -f core conftest.err conftest.$ac_objext \
28124    conftest$ac_exeext conftest.$ac_ext
28125LIBS=$ac_check_lib_save_LIBS
28126fi
28127{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_bindresvport" >&5
28128$as_echo "$ac_cv_lib_socket_bindresvport" >&6; }
28129if test "x$ac_cv_lib_socket_bindresvport" = xyes; then :
28130
28131$as_echo "#define LIBRARY_BINDRESVPORT LIBRARY_LIBSOCKET" >>confdefs.h
28132
28133fi
28134
28135    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getpeername in -lsocket" >&5
28136$as_echo_n "checking for getpeername in -lsocket... " >&6; }
28137if ${ac_cv_lib_socket_getpeername+:} false; then :
28138  $as_echo_n "(cached) " >&6
28139else
28140  ac_check_lib_save_LIBS=$LIBS
28141LIBS="-lsocket  $LIBS"
28142cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28143/* end confdefs.h.  */
28144
28145/* Override any GCC internal prototype to avoid an error.
28146   Use char because int might match the return type of a GCC
28147   builtin and then its argument prototype would still apply.  */
28148#ifdef __cplusplus
28149extern "C"
28150#endif
28151char getpeername ();
28152int
28153main ()
28154{
28155return getpeername ();
28156  ;
28157  return 0;
28158}
28159_ACEOF
28160if ac_fn_c_try_link "$LINENO"; then :
28161  ac_cv_lib_socket_getpeername=yes
28162else
28163  ac_cv_lib_socket_getpeername=no
28164fi
28165rm -f core conftest.err conftest.$ac_objext \
28166    conftest$ac_exeext conftest.$ac_ext
28167LIBS=$ac_check_lib_save_LIBS
28168fi
28169{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getpeername" >&5
28170$as_echo "$ac_cv_lib_socket_getpeername" >&6; }
28171if test "x$ac_cv_lib_socket_getpeername" = xyes; then :
28172
28173$as_echo "#define LIBRARY_GETPEERNAME LIBRARY_LIBSOCKET" >>confdefs.h
28174
28175fi
28176
28177    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lsocket" >&5
28178$as_echo_n "checking for getsockname in -lsocket... " >&6; }
28179if ${ac_cv_lib_socket_getsockname+:} false; then :
28180  $as_echo_n "(cached) " >&6
28181else
28182  ac_check_lib_save_LIBS=$LIBS
28183LIBS="-lsocket  $LIBS"
28184cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28185/* end confdefs.h.  */
28186
28187/* Override any GCC internal prototype to avoid an error.
28188   Use char because int might match the return type of a GCC
28189   builtin and then its argument prototype would still apply.  */
28190#ifdef __cplusplus
28191extern "C"
28192#endif
28193char getsockname ();
28194int
28195main ()
28196{
28197return getsockname ();
28198  ;
28199  return 0;
28200}
28201_ACEOF
28202if ac_fn_c_try_link "$LINENO"; then :
28203  ac_cv_lib_socket_getsockname=yes
28204else
28205  ac_cv_lib_socket_getsockname=no
28206fi
28207rm -f core conftest.err conftest.$ac_objext \
28208    conftest$ac_exeext conftest.$ac_ext
28209LIBS=$ac_check_lib_save_LIBS
28210fi
28211{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getsockname" >&5
28212$as_echo "$ac_cv_lib_socket_getsockname" >&6; }
28213if test "x$ac_cv_lib_socket_getsockname" = xyes; then :
28214
28215$as_echo "#define LIBRARY_GETSOCKNAME LIBRARY_LIBSOCKET" >>confdefs.h
28216
28217fi
28218
28219    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for listen in -lsocket" >&5
28220$as_echo_n "checking for listen in -lsocket... " >&6; }
28221if ${ac_cv_lib_socket_listen+:} false; then :
28222  $as_echo_n "(cached) " >&6
28223else
28224  ac_check_lib_save_LIBS=$LIBS
28225LIBS="-lsocket  $LIBS"
28226cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28227/* end confdefs.h.  */
28228
28229/* Override any GCC internal prototype to avoid an error.
28230   Use char because int might match the return type of a GCC
28231   builtin and then its argument prototype would still apply.  */
28232#ifdef __cplusplus
28233extern "C"
28234#endif
28235char listen ();
28236int
28237main ()
28238{
28239return listen ();
28240  ;
28241  return 0;
28242}
28243_ACEOF
28244if ac_fn_c_try_link "$LINENO"; then :
28245  ac_cv_lib_socket_listen=yes
28246else
28247  ac_cv_lib_socket_listen=no
28248fi
28249rm -f core conftest.err conftest.$ac_objext \
28250    conftest$ac_exeext conftest.$ac_ext
28251LIBS=$ac_check_lib_save_LIBS
28252fi
28253{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_listen" >&5
28254$as_echo "$ac_cv_lib_socket_listen" >&6; }
28255if test "x$ac_cv_lib_socket_listen" = xyes; then :
28256
28257$as_echo "#define LIBRARY_LISTEN LIBRARY_LIBSOCKET" >>confdefs.h
28258
28259fi
28260
28261    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getaddrinfo in -lsocket" >&5
28262$as_echo_n "checking for getaddrinfo in -lsocket... " >&6; }
28263if ${ac_cv_lib_socket_getaddrinfo+:} false; then :
28264  $as_echo_n "(cached) " >&6
28265else
28266  ac_check_lib_save_LIBS=$LIBS
28267LIBS="-lsocket  $LIBS"
28268cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28269/* end confdefs.h.  */
28270
28271/* Override any GCC internal prototype to avoid an error.
28272   Use char because int might match the return type of a GCC
28273   builtin and then its argument prototype would still apply.  */
28274#ifdef __cplusplus
28275extern "C"
28276#endif
28277char getaddrinfo ();
28278int
28279main ()
28280{
28281return getaddrinfo ();
28282  ;
28283  return 0;
28284}
28285_ACEOF
28286if ac_fn_c_try_link "$LINENO"; then :
28287  ac_cv_lib_socket_getaddrinfo=yes
28288else
28289  ac_cv_lib_socket_getaddrinfo=no
28290fi
28291rm -f core conftest.err conftest.$ac_objext \
28292    conftest$ac_exeext conftest.$ac_ext
28293LIBS=$ac_check_lib_save_LIBS
28294fi
28295{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getaddrinfo" >&5
28296$as_echo "$ac_cv_lib_socket_getaddrinfo" >&6; }
28297if test "x$ac_cv_lib_socket_getaddrinfo" = xyes; then :
28298
28299$as_echo "#define LIBRARY_GETADDRINFO LIBRARY_LIBSOCKET" >>confdefs.h
28300
28301fi
28302
28303    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getnameinfo in -lsocket" >&5
28304$as_echo_n "checking for getnameinfo in -lsocket... " >&6; }
28305if ${ac_cv_lib_socket_getnameinfo+:} false; then :
28306  $as_echo_n "(cached) " >&6
28307else
28308  ac_check_lib_save_LIBS=$LIBS
28309LIBS="-lsocket  $LIBS"
28310cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28311/* end confdefs.h.  */
28312
28313/* Override any GCC internal prototype to avoid an error.
28314   Use char because int might match the return type of a GCC
28315   builtin and then its argument prototype would still apply.  */
28316#ifdef __cplusplus
28317extern "C"
28318#endif
28319char getnameinfo ();
28320int
28321main ()
28322{
28323return getnameinfo ();
28324  ;
28325  return 0;
28326}
28327_ACEOF
28328if ac_fn_c_try_link "$LINENO"; then :
28329  ac_cv_lib_socket_getnameinfo=yes
28330else
28331  ac_cv_lib_socket_getnameinfo=no
28332fi
28333rm -f core conftest.err conftest.$ac_objext \
28334    conftest$ac_exeext conftest.$ac_ext
28335LIBS=$ac_check_lib_save_LIBS
28336fi
28337{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_getnameinfo" >&5
28338$as_echo "$ac_cv_lib_socket_getnameinfo" >&6; }
28339if test "x$ac_cv_lib_socket_getnameinfo" = xyes; then :
28340
28341$as_echo "#define LIBRARY_GETNAMEINFO LIBRARY_LIBSOCKET" >>confdefs.h
28342
28343fi
28344
28345    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freeaddrinfo in -lsocket" >&5
28346$as_echo_n "checking for freeaddrinfo in -lsocket... " >&6; }
28347if ${ac_cv_lib_socket_freeaddrinfo+:} false; then :
28348  $as_echo_n "(cached) " >&6
28349else
28350  ac_check_lib_save_LIBS=$LIBS
28351LIBS="-lsocket  $LIBS"
28352cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28353/* end confdefs.h.  */
28354
28355/* Override any GCC internal prototype to avoid an error.
28356   Use char because int might match the return type of a GCC
28357   builtin and then its argument prototype would still apply.  */
28358#ifdef __cplusplus
28359extern "C"
28360#endif
28361char freeaddrinfo ();
28362int
28363main ()
28364{
28365return freeaddrinfo ();
28366  ;
28367  return 0;
28368}
28369_ACEOF
28370if ac_fn_c_try_link "$LINENO"; then :
28371  ac_cv_lib_socket_freeaddrinfo=yes
28372else
28373  ac_cv_lib_socket_freeaddrinfo=no
28374fi
28375rm -f core conftest.err conftest.$ac_objext \
28376    conftest$ac_exeext conftest.$ac_ext
28377LIBS=$ac_check_lib_save_LIBS
28378fi
28379{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_freeaddrinfo" >&5
28380$as_echo "$ac_cv_lib_socket_freeaddrinfo" >&6; }
28381if test "x$ac_cv_lib_socket_freeaddrinfo" = xyes; then :
28382
28383$as_echo "#define LIBRARY_FREEADDRINFO LIBRARY_LIBSOCKET" >>confdefs.h
28384
28385fi
28386
28387    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freehostent in -lsocket" >&5
28388$as_echo_n "checking for freehostent in -lsocket... " >&6; }
28389if ${ac_cv_lib_socket_freehostent+:} false; then :
28390  $as_echo_n "(cached) " >&6
28391else
28392  ac_check_lib_save_LIBS=$LIBS
28393LIBS="-lsocket  $LIBS"
28394cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28395/* end confdefs.h.  */
28396
28397/* Override any GCC internal prototype to avoid an error.
28398   Use char because int might match the return type of a GCC
28399   builtin and then its argument prototype would still apply.  */
28400#ifdef __cplusplus
28401extern "C"
28402#endif
28403char freehostent ();
28404int
28405main ()
28406{
28407return freehostent ();
28408  ;
28409  return 0;
28410}
28411_ACEOF
28412if ac_fn_c_try_link "$LINENO"; then :
28413  ac_cv_lib_socket_freehostent=yes
28414else
28415  ac_cv_lib_socket_freehostent=no
28416fi
28417rm -f core conftest.err conftest.$ac_objext \
28418    conftest$ac_exeext conftest.$ac_ext
28419LIBS=$ac_check_lib_save_LIBS
28420fi
28421{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_freehostent" >&5
28422$as_echo "$ac_cv_lib_socket_freehostent" >&6; }
28423if test "x$ac_cv_lib_socket_freehostent" = xyes; then :
28424
28425$as_echo "#define LIBRARY_FREEHOSTENT LIBRARY_LIBSOCKET" >>confdefs.h
28426
28427fi
28428
28429    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recvfrom in -lsocket" >&5
28430$as_echo_n "checking for recvfrom in -lsocket... " >&6; }
28431if ${ac_cv_lib_socket_recvfrom+:} false; then :
28432  $as_echo_n "(cached) " >&6
28433else
28434  ac_check_lib_save_LIBS=$LIBS
28435LIBS="-lsocket  $LIBS"
28436cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28437/* end confdefs.h.  */
28438
28439/* Override any GCC internal prototype to avoid an error.
28440   Use char because int might match the return type of a GCC
28441   builtin and then its argument prototype would still apply.  */
28442#ifdef __cplusplus
28443extern "C"
28444#endif
28445char recvfrom ();
28446int
28447main ()
28448{
28449return recvfrom ();
28450  ;
28451  return 0;
28452}
28453_ACEOF
28454if ac_fn_c_try_link "$LINENO"; then :
28455  ac_cv_lib_socket_recvfrom=yes
28456else
28457  ac_cv_lib_socket_recvfrom=no
28458fi
28459rm -f core conftest.err conftest.$ac_objext \
28460    conftest$ac_exeext conftest.$ac_ext
28461LIBS=$ac_check_lib_save_LIBS
28462fi
28463{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_recvfrom" >&5
28464$as_echo "$ac_cv_lib_socket_recvfrom" >&6; }
28465if test "x$ac_cv_lib_socket_recvfrom" = xyes; then :
28466
28467$as_echo "#define LIBRARY_RECVFROM LIBRARY_LIBSOCKET" >>confdefs.h
28468
28469fi
28470
28471    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rresvport in -lsocket" >&5
28472$as_echo_n "checking for rresvport in -lsocket... " >&6; }
28473if ${ac_cv_lib_socket_rresvport+:} false; then :
28474  $as_echo_n "(cached) " >&6
28475else
28476  ac_check_lib_save_LIBS=$LIBS
28477LIBS="-lsocket  $LIBS"
28478cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28479/* end confdefs.h.  */
28480
28481/* Override any GCC internal prototype to avoid an error.
28482   Use char because int might match the return type of a GCC
28483   builtin and then its argument prototype would still apply.  */
28484#ifdef __cplusplus
28485extern "C"
28486#endif
28487char rresvport ();
28488int
28489main ()
28490{
28491return rresvport ();
28492  ;
28493  return 0;
28494}
28495_ACEOF
28496if ac_fn_c_try_link "$LINENO"; then :
28497  ac_cv_lib_socket_rresvport=yes
28498else
28499  ac_cv_lib_socket_rresvport=no
28500fi
28501rm -f core conftest.err conftest.$ac_objext \
28502    conftest$ac_exeext conftest.$ac_ext
28503LIBS=$ac_check_lib_save_LIBS
28504fi
28505{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_rresvport" >&5
28506$as_echo "$ac_cv_lib_socket_rresvport" >&6; }
28507if test "x$ac_cv_lib_socket_rresvport" = xyes; then :
28508
28509$as_echo "#define LIBRARY_RRESVPORT LIBRARY_LIBSOCKET" >>confdefs.h
28510
28511fi
28512
28513    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recvmsg in -lsocket" >&5
28514$as_echo_n "checking for recvmsg in -lsocket... " >&6; }
28515if ${ac_cv_lib_socket_recvmsg+:} false; then :
28516  $as_echo_n "(cached) " >&6
28517else
28518  ac_check_lib_save_LIBS=$LIBS
28519LIBS="-lsocket  $LIBS"
28520cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28521/* end confdefs.h.  */
28522
28523/* Override any GCC internal prototype to avoid an error.
28524   Use char because int might match the return type of a GCC
28525   builtin and then its argument prototype would still apply.  */
28526#ifdef __cplusplus
28527extern "C"
28528#endif
28529char recvmsg ();
28530int
28531main ()
28532{
28533return recvmsg ();
28534  ;
28535  return 0;
28536}
28537_ACEOF
28538if ac_fn_c_try_link "$LINENO"; then :
28539  ac_cv_lib_socket_recvmsg=yes
28540else
28541  ac_cv_lib_socket_recvmsg=no
28542fi
28543rm -f core conftest.err conftest.$ac_objext \
28544    conftest$ac_exeext conftest.$ac_ext
28545LIBS=$ac_check_lib_save_LIBS
28546fi
28547{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_recvmsg" >&5
28548$as_echo "$ac_cv_lib_socket_recvmsg" >&6; }
28549if test "x$ac_cv_lib_socket_recvmsg" = xyes; then :
28550
28551$as_echo "#define LIBRARY_RECVMSG LIBRARY_LIBSOCKET" >>confdefs.h
28552
28553fi
28554
28555    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sendmsg in -lsocket" >&5
28556$as_echo_n "checking for sendmsg in -lsocket... " >&6; }
28557if ${ac_cv_lib_socket_sendmsg+:} false; then :
28558  $as_echo_n "(cached) " >&6
28559else
28560  ac_check_lib_save_LIBS=$LIBS
28561LIBS="-lsocket  $LIBS"
28562cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28563/* end confdefs.h.  */
28564
28565/* Override any GCC internal prototype to avoid an error.
28566   Use char because int might match the return type of a GCC
28567   builtin and then its argument prototype would still apply.  */
28568#ifdef __cplusplus
28569extern "C"
28570#endif
28571char sendmsg ();
28572int
28573main ()
28574{
28575return sendmsg ();
28576  ;
28577  return 0;
28578}
28579_ACEOF
28580if ac_fn_c_try_link "$LINENO"; then :
28581  ac_cv_lib_socket_sendmsg=yes
28582else
28583  ac_cv_lib_socket_sendmsg=no
28584fi
28585rm -f core conftest.err conftest.$ac_objext \
28586    conftest$ac_exeext conftest.$ac_ext
28587LIBS=$ac_check_lib_save_LIBS
28588fi
28589{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_sendmsg" >&5
28590$as_echo "$ac_cv_lib_socket_sendmsg" >&6; }
28591if test "x$ac_cv_lib_socket_sendmsg" = xyes; then :
28592
28593$as_echo "#define LIBRARY_SENDMSG LIBRARY_LIBSOCKET" >>confdefs.h
28594
28595fi
28596
28597    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for send in -lsocket" >&5
28598$as_echo_n "checking for send in -lsocket... " >&6; }
28599if ${ac_cv_lib_socket_send+:} false; then :
28600  $as_echo_n "(cached) " >&6
28601else
28602  ac_check_lib_save_LIBS=$LIBS
28603LIBS="-lsocket  $LIBS"
28604cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28605/* end confdefs.h.  */
28606
28607/* Override any GCC internal prototype to avoid an error.
28608   Use char because int might match the return type of a GCC
28609   builtin and then its argument prototype would still apply.  */
28610#ifdef __cplusplus
28611extern "C"
28612#endif
28613char send ();
28614int
28615main ()
28616{
28617return send ();
28618  ;
28619  return 0;
28620}
28621_ACEOF
28622if ac_fn_c_try_link "$LINENO"; then :
28623  ac_cv_lib_socket_send=yes
28624else
28625  ac_cv_lib_socket_send=no
28626fi
28627rm -f core conftest.err conftest.$ac_objext \
28628    conftest$ac_exeext conftest.$ac_ext
28629LIBS=$ac_check_lib_save_LIBS
28630fi
28631{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_send" >&5
28632$as_echo "$ac_cv_lib_socket_send" >&6; }
28633if test "x$ac_cv_lib_socket_send" = xyes; then :
28634
28635$as_echo "#define LIBRARY_SEND LIBRARY_LIBSOCKET" >>confdefs.h
28636
28637fi
28638
28639    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for recv in -lsocket" >&5
28640$as_echo_n "checking for recv in -lsocket... " >&6; }
28641if ${ac_cv_lib_socket_recv+:} false; then :
28642  $as_echo_n "(cached) " >&6
28643else
28644  ac_check_lib_save_LIBS=$LIBS
28645LIBS="-lsocket  $LIBS"
28646cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28647/* end confdefs.h.  */
28648
28649/* Override any GCC internal prototype to avoid an error.
28650   Use char because int might match the return type of a GCC
28651   builtin and then its argument prototype would still apply.  */
28652#ifdef __cplusplus
28653extern "C"
28654#endif
28655char recv ();
28656int
28657main ()
28658{
28659return recv ();
28660  ;
28661  return 0;
28662}
28663_ACEOF
28664if ac_fn_c_try_link "$LINENO"; then :
28665  ac_cv_lib_socket_recv=yes
28666else
28667  ac_cv_lib_socket_recv=no
28668fi
28669rm -f core conftest.err conftest.$ac_objext \
28670    conftest$ac_exeext conftest.$ac_ext
28671LIBS=$ac_check_lib_save_LIBS
28672fi
28673{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_recv" >&5
28674$as_echo "$ac_cv_lib_socket_recv" >&6; }
28675if test "x$ac_cv_lib_socket_recv" = xyes; then :
28676
28677$as_echo "#define LIBRARY_RECV LIBRARY_LIBSOCKET" >>confdefs.h
28678
28679fi
28680
28681    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sendto in -lsocket" >&5
28682$as_echo_n "checking for sendto in -lsocket... " >&6; }
28683if ${ac_cv_lib_socket_sendto+:} false; then :
28684  $as_echo_n "(cached) " >&6
28685else
28686  ac_check_lib_save_LIBS=$LIBS
28687LIBS="-lsocket  $LIBS"
28688cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28689/* end confdefs.h.  */
28690
28691/* Override any GCC internal prototype to avoid an error.
28692   Use char because int might match the return type of a GCC
28693   builtin and then its argument prototype would still apply.  */
28694#ifdef __cplusplus
28695extern "C"
28696#endif
28697char sendto ();
28698int
28699main ()
28700{
28701return sendto ();
28702  ;
28703  return 0;
28704}
28705_ACEOF
28706if ac_fn_c_try_link "$LINENO"; then :
28707  ac_cv_lib_socket_sendto=yes
28708else
28709  ac_cv_lib_socket_sendto=no
28710fi
28711rm -f core conftest.err conftest.$ac_objext \
28712    conftest$ac_exeext conftest.$ac_ext
28713LIBS=$ac_check_lib_save_LIBS
28714fi
28715{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_sendto" >&5
28716$as_echo "$ac_cv_lib_socket_sendto" >&6; }
28717if test "x$ac_cv_lib_socket_sendto" = xyes; then :
28718
28719$as_echo "#define LIBRARY_SENDTO LIBRARY_LIBSOCKET" >>confdefs.h
28720
28721fi
28722
28723fi
28724
28725NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
28726LIBS=""
28727
28728if test x"$preload_enabled" = xt -a x"${ac_cv_search_inet_addr}" = x"-lnsl"; then
28729
28730cat >>confdefs.h <<_ACEOF
28731#define LIBRARY_LIBNSL "${base_library_path}libnsl.${SOLIB_POSTFIX}"
28732_ACEOF
28733
28734
28735    SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}libnsl.${SOLIB_POSTFIX}"
28736
28737    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
28738$as_echo_n "checking for gethostbyname in -lnsl... " >&6; }
28739if ${ac_cv_lib_nsl_gethostbyname+:} false; then :
28740  $as_echo_n "(cached) " >&6
28741else
28742  ac_check_lib_save_LIBS=$LIBS
28743LIBS="-lnsl  $LIBS"
28744cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28745/* end confdefs.h.  */
28746
28747/* Override any GCC internal prototype to avoid an error.
28748   Use char because int might match the return type of a GCC
28749   builtin and then its argument prototype would still apply.  */
28750#ifdef __cplusplus
28751extern "C"
28752#endif
28753char gethostbyname ();
28754int
28755main ()
28756{
28757return gethostbyname ();
28758  ;
28759  return 0;
28760}
28761_ACEOF
28762if ac_fn_c_try_link "$LINENO"; then :
28763  ac_cv_lib_nsl_gethostbyname=yes
28764else
28765  ac_cv_lib_nsl_gethostbyname=no
28766fi
28767rm -f core conftest.err conftest.$ac_objext \
28768    conftest$ac_exeext conftest.$ac_ext
28769LIBS=$ac_check_lib_save_LIBS
28770fi
28771{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
28772$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; }
28773if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then :
28774
28775$as_echo "#define LIBRARY_GETHOSTBYNAME LIBRARY_LIBNSL" >>confdefs.h
28776
28777fi
28778
28779    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyaddr in -lnsl" >&5
28780$as_echo_n "checking for gethostbyaddr in -lnsl... " >&6; }
28781if ${ac_cv_lib_nsl_gethostbyaddr+:} false; then :
28782  $as_echo_n "(cached) " >&6
28783else
28784  ac_check_lib_save_LIBS=$LIBS
28785LIBS="-lnsl  $LIBS"
28786cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28787/* end confdefs.h.  */
28788
28789/* Override any GCC internal prototype to avoid an error.
28790   Use char because int might match the return type of a GCC
28791   builtin and then its argument prototype would still apply.  */
28792#ifdef __cplusplus
28793extern "C"
28794#endif
28795char gethostbyaddr ();
28796int
28797main ()
28798{
28799return gethostbyaddr ();
28800  ;
28801  return 0;
28802}
28803_ACEOF
28804if ac_fn_c_try_link "$LINENO"; then :
28805  ac_cv_lib_nsl_gethostbyaddr=yes
28806else
28807  ac_cv_lib_nsl_gethostbyaddr=no
28808fi
28809rm -f core conftest.err conftest.$ac_objext \
28810    conftest$ac_exeext conftest.$ac_ext
28811LIBS=$ac_check_lib_save_LIBS
28812fi
28813{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyaddr" >&5
28814$as_echo "$ac_cv_lib_nsl_gethostbyaddr" >&6; }
28815if test "x$ac_cv_lib_nsl_gethostbyaddr" = xyes; then :
28816
28817$as_echo "#define LIBRARY_GETHOSTBYADDR LIBRARY_LIBNSL" >>confdefs.h
28818
28819fi
28820
28821    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freehostent in -lnsl" >&5
28822$as_echo_n "checking for freehostent in -lnsl... " >&6; }
28823if ${ac_cv_lib_nsl_freehostent+:} false; then :
28824  $as_echo_n "(cached) " >&6
28825else
28826  ac_check_lib_save_LIBS=$LIBS
28827LIBS="-lnsl  $LIBS"
28828cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28829/* end confdefs.h.  */
28830
28831/* Override any GCC internal prototype to avoid an error.
28832   Use char because int might match the return type of a GCC
28833   builtin and then its argument prototype would still apply.  */
28834#ifdef __cplusplus
28835extern "C"
28836#endif
28837char freehostent ();
28838int
28839main ()
28840{
28841return freehostent ();
28842  ;
28843  return 0;
28844}
28845_ACEOF
28846if ac_fn_c_try_link "$LINENO"; then :
28847  ac_cv_lib_nsl_freehostent=yes
28848else
28849  ac_cv_lib_nsl_freehostent=no
28850fi
28851rm -f core conftest.err conftest.$ac_objext \
28852    conftest$ac_exeext conftest.$ac_ext
28853LIBS=$ac_check_lib_save_LIBS
28854fi
28855{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_freehostent" >&5
28856$as_echo "$ac_cv_lib_nsl_freehostent" >&6; }
28857if test "x$ac_cv_lib_nsl_freehostent" = xyes; then :
28858
28859$as_echo "#define LIBRARY_FREEHOSTENT LIBRARY_LIBNSL" >>confdefs.h
28860
28861fi
28862
28863    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getipnodebyname in -lnsl" >&5
28864$as_echo_n "checking for getipnodebyname in -lnsl... " >&6; }
28865if ${ac_cv_lib_nsl_getipnodebyname+:} false; then :
28866  $as_echo_n "(cached) " >&6
28867else
28868  ac_check_lib_save_LIBS=$LIBS
28869LIBS="-lnsl  $LIBS"
28870cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28871/* end confdefs.h.  */
28872
28873/* Override any GCC internal prototype to avoid an error.
28874   Use char because int might match the return type of a GCC
28875   builtin and then its argument prototype would still apply.  */
28876#ifdef __cplusplus
28877extern "C"
28878#endif
28879char getipnodebyname ();
28880int
28881main ()
28882{
28883return getipnodebyname ();
28884  ;
28885  return 0;
28886}
28887_ACEOF
28888if ac_fn_c_try_link "$LINENO"; then :
28889  ac_cv_lib_nsl_getipnodebyname=yes
28890else
28891  ac_cv_lib_nsl_getipnodebyname=no
28892fi
28893rm -f core conftest.err conftest.$ac_objext \
28894    conftest$ac_exeext conftest.$ac_ext
28895LIBS=$ac_check_lib_save_LIBS
28896fi
28897{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_getipnodebyname" >&5
28898$as_echo "$ac_cv_lib_nsl_getipnodebyname" >&6; }
28899if test "x$ac_cv_lib_nsl_getipnodebyname" = xyes; then :
28900
28901$as_echo "#define LIBRARY_GETIPNODEBYNAME LIBRARY_LIBNSL" >>confdefs.h
28902
28903fi
28904
28905fi
28906
28907#linking with -lresolv results in error unless -shared is included
28908#since no static version exists for libresolv on SunOS
28909{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_aton" >&5
28910$as_echo_n "checking for library containing inet_aton... " >&6; }
28911if ${ac_cv_search_inet_aton+:} false; then :
28912  $as_echo_n "(cached) " >&6
28913else
28914  ac_func_search_save_LIBS=$LIBS
28915cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28916/* end confdefs.h.  */
28917
28918/* Override any GCC internal prototype to avoid an error.
28919   Use char because int might match the return type of a GCC
28920   builtin and then its argument prototype would still apply.  */
28921#ifdef __cplusplus
28922extern "C"
28923#endif
28924char inet_aton ();
28925int
28926main ()
28927{
28928return inet_aton ();
28929  ;
28930  return 0;
28931}
28932_ACEOF
28933for ac_lib in '' resolv; do
28934  if test -z "$ac_lib"; then
28935    ac_res="none required"
28936  else
28937    ac_res=-l$ac_lib
28938    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
28939  fi
28940  if ac_fn_c_try_link "$LINENO"; then :
28941  ac_cv_search_inet_aton=$ac_res
28942fi
28943rm -f core conftest.err conftest.$ac_objext \
28944    conftest$ac_exeext
28945  if ${ac_cv_search_inet_aton+:} false; then :
28946  break
28947fi
28948done
28949if ${ac_cv_search_inet_aton+:} false; then :
28950
28951else
28952  ac_cv_search_inet_aton=no
28953fi
28954rm conftest.$ac_ext
28955LIBS=$ac_func_search_save_LIBS
28956fi
28957{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_aton" >&5
28958$as_echo "$ac_cv_search_inet_aton" >&6; }
28959ac_res=$ac_cv_search_inet_aton
28960if test "$ac_res" != no; then :
28961  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
28962
28963fi
28964
28965
28966{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing res_9_init" >&5
28967$as_echo_n "checking for library containing res_9_init... " >&6; }
28968if ${ac_cv_search_res_9_init+:} false; then :
28969  $as_echo_n "(cached) " >&6
28970else
28971  ac_func_search_save_LIBS=$LIBS
28972cat confdefs.h - <<_ACEOF >conftest.$ac_ext
28973/* end confdefs.h.  */
28974
28975/* Override any GCC internal prototype to avoid an error.
28976   Use char because int might match the return type of a GCC
28977   builtin and then its argument prototype would still apply.  */
28978#ifdef __cplusplus
28979extern "C"
28980#endif
28981char res_9_init ();
28982int
28983main ()
28984{
28985return res_9_init ();
28986  ;
28987  return 0;
28988}
28989_ACEOF
28990for ac_lib in '' resolv; do
28991  if test -z "$ac_lib"; then
28992    ac_res="none required"
28993  else
28994    ac_res=-l$ac_lib
28995    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
28996  fi
28997  if ac_fn_c_try_link "$LINENO"; then :
28998  ac_cv_search_res_9_init=$ac_res
28999fi
29000rm -f core conftest.err conftest.$ac_objext \
29001    conftest$ac_exeext
29002  if ${ac_cv_search_res_9_init+:} false; then :
29003  break
29004fi
29005done
29006if ${ac_cv_search_res_9_init+:} false; then :
29007
29008else
29009  ac_cv_search_res_9_init=no
29010fi
29011rm conftest.$ac_ext
29012LIBS=$ac_func_search_save_LIBS
29013fi
29014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_res_9_init" >&5
29015$as_echo "$ac_cv_search_res_9_init" >&6; }
29016ac_res=$ac_cv_search_res_9_init
29017if test "$ac_res" != no; then :
29018  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
29019
29020fi
29021
29022
29023NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
29024LIBS=""
29025
29026if test x"${preload_enabled}" = xt -a x"${ac_cv_search_inet_aton}" = x"-lresolv"; then
29027
29028cat >>confdefs.h <<_ACEOF
29029#define LIBRARY_LIBRESOLV "${base_library_path}libresolv.${SOLIB_POSTFIX}"
29030_ACEOF
29031
29032
29033    SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${SOCKSIFY_PRELOAD_LIBS:+${PRELOAD_SEPERATOR}}${base_library_path}libresolv.${SOLIB_POSTFIX}"
29034
29035    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname2 in -lresolv" >&5
29036$as_echo_n "checking for gethostbyname2 in -lresolv... " >&6; }
29037if ${ac_cv_lib_resolv_gethostbyname2+:} false; then :
29038  $as_echo_n "(cached) " >&6
29039else
29040  ac_check_lib_save_LIBS=$LIBS
29041LIBS="-lresolv  $LIBS"
29042cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29043/* end confdefs.h.  */
29044
29045/* Override any GCC internal prototype to avoid an error.
29046   Use char because int might match the return type of a GCC
29047   builtin and then its argument prototype would still apply.  */
29048#ifdef __cplusplus
29049extern "C"
29050#endif
29051char gethostbyname2 ();
29052int
29053main ()
29054{
29055return gethostbyname2 ();
29056  ;
29057  return 0;
29058}
29059_ACEOF
29060if ac_fn_c_try_link "$LINENO"; then :
29061  ac_cv_lib_resolv_gethostbyname2=yes
29062else
29063  ac_cv_lib_resolv_gethostbyname2=no
29064fi
29065rm -f core conftest.err conftest.$ac_objext \
29066    conftest$ac_exeext conftest.$ac_ext
29067LIBS=$ac_check_lib_save_LIBS
29068fi
29069{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_gethostbyname2" >&5
29070$as_echo "$ac_cv_lib_resolv_gethostbyname2" >&6; }
29071if test "x$ac_cv_lib_resolv_gethostbyname2" = xyes; then :
29072
29073$as_echo "#define LIBRARY_GETHOSTBYNAME2 LIBRARY_LIBRESOLV" >>confdefs.h
29074
29075fi
29076
29077fi
29078
29079#XXX gcc on Solaris (using gnu ld) doesn't seems to implicitly link
29080#with libdl in this test, which means that libdl will not be included
29081#in socksify.
29082
29083if test x"${preload_enabled}" = xt; then
29084    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5
29085$as_echo_n "checking for library containing dlopen... " >&6; }
29086if ${ac_cv_search_dlopen+:} false; then :
29087  $as_echo_n "(cached) " >&6
29088else
29089  ac_func_search_save_LIBS=$LIBS
29090cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29091/* end confdefs.h.  */
29092
29093/* Override any GCC internal prototype to avoid an error.
29094   Use char because int might match the return type of a GCC
29095   builtin and then its argument prototype would still apply.  */
29096#ifdef __cplusplus
29097extern "C"
29098#endif
29099char dlopen ();
29100int
29101main ()
29102{
29103return dlopen ();
29104  ;
29105  return 0;
29106}
29107_ACEOF
29108for ac_lib in '' dl; do
29109  if test -z "$ac_lib"; then
29110    ac_res="none required"
29111  else
29112    ac_res=-l$ac_lib
29113    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
29114  fi
29115  if ac_fn_c_try_link "$LINENO"; then :
29116  ac_cv_search_dlopen=$ac_res
29117fi
29118rm -f core conftest.err conftest.$ac_objext \
29119    conftest$ac_exeext
29120  if ${ac_cv_search_dlopen+:} false; then :
29121  break
29122fi
29123done
29124if ${ac_cv_search_dlopen+:} false; then :
29125
29126else
29127  ac_cv_search_dlopen=no
29128fi
29129rm conftest.$ac_ext
29130LIBS=$ac_func_search_save_LIBS
29131fi
29132{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_dlopen" >&5
29133$as_echo "$ac_cv_search_dlopen" >&6; }
29134ac_res=$ac_cv_search_dlopen
29135if test "$ac_res" != no; then :
29136  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
29137
29138fi
29139
29140
29141    NLIBS="${NLIBS}${NLIBS:+ }$LIBS"
29142    LIBS=""
29143    if test x"${ac_cv_search_dlopen}" = x"-ldl"; then
29144	case $host in
29145	    *-*-sunos4*) #XXX attempt to get libdl name
29146		libdl=`ls ${base_library_path}libdl.${SOLIB_POSTFIX}* | sed -e 's/.*\///' | sort -nr | head -n 1`
29147		if test x"$libdl" = x; then
29148		    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unable to locate libdl" >&5
29149$as_echo "$as_me: WARNING: unable to locate libdl" >&2;}
29150		else
29151		    LIBRARY_DLOPEN=${base_library_path}${libdl}
29152		    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: hardcoding libdl to $LIBRARY_DLOPEN" >&5
29153$as_echo "$as_me: WARNING: hardcoding libdl to $LIBRARY_DLOPEN" >&2;}
29154		fi
29155		;;
29156
29157	    *)
29158		LIBRARY_DLOPEN="${base_library_path}libdl.${SOLIB_POSTFIX}"
29159		;;
29160	esac
29161	SOCKSIFY_PRELOAD_LIBS="${SOCKSIFY_PRELOAD_LIBS}${LIBRARY_DLOPEN:+${PRELOAD_SEPERATOR}}${LIBRARY_DLOPEN}"
29162    fi
29163fi
29164LIBS="$oLIBS $NLIBS"
29165
29166
29167
29168for ac_func in rresvport
29169do :
29170  ac_fn_c_check_func "$LINENO" "rresvport" "ac_cv_func_rresvport"
29171if test "x$ac_cv_func_rresvport" = xyes; then :
29172  cat >>confdefs.h <<_ACEOF
29173#define HAVE_RRESVPORT 1
29174_ACEOF
29175
29176fi
29177done
29178 #not found on android
29179
29180#specify location of the socks library in socksify too
29181#NOTE: exec_prefix and prefix have the value NONE here if they are unset
29182o_exec_prefix=${exec_prefix}
29183o_prefix=${prefix}
29184if test x"${prefix}" = xNONE; then
29185    prefix=$ac_default_prefix
29186fi
29187if test x"${exec_prefix}" = xNONE; then
29188    exec_prefix=$prefix
29189fi
29190LIBRARY_PREFIX=`eval echo \$libdir`
29191LIBRARY_PREFIX=`eval echo \$LIBRARY_PREFIX`
29192exec_prefix=${o_exec_prefix}
29193prefix=${o_prefix}
29194
29195
29196#allow user to specify libc name, use default value otherwise
29197{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libc name" >&5
29198$as_echo_n "checking for libc name... " >&6; }
29199
29200# Check whether --with-libc was given.
29201if test "${with_libc+set}" = set; then :
29202  withval=$with_libc; LIBC_NAME=$withval
29203fi
29204
29205
29206#set default?
29207if test x"${LIBC_NAME}" = x; then
29208    case $host in
29209	*-*-freebsd*)
29210	    #XXX
29211	    #can't set it to libc.so directly, might be ld script
29212	    unset LIBC_ALTS
29213	    for file in `ldconfig -r | grep /libc.so| awk '{ print $3 }'`; do
29214		test -s "$file" && LIBC_ALTS="${LIBC_ALTS}${LIBC_ALTS:+ }$file"
29215	    done
29216	    LIBC_NAME=`echo ${LIBC_ALTS} | sed -e 's/.*\///' | sort -nr | head -n 1`
29217	    if test x"${LIBC_NAME}" = x; then
29218		#nothing found, set libc.so anyway
29219		LIBC_NAME="${base_library_path}libc.${SOLIB_POSTFIX}"
29220	    fi
29221	    ;;
29222
29223	*-*-linux-*)
29224	    #XXX
29225	    #can't set it to libc.so directly, might be ld script
29226	    unset LIBC_ALTS
29227	    for file in `ldconfig -p | grep /libc.so| xargs -n 1 echo | grep /libc.so`; do
29228		test -s "$file" && LIBC_ALTS="${LIBC_ALTS}${LIBC_ALTS:+ }$file"
29229	    done
29230	    LIBC_NAME=`echo ${LIBC_ALTS} | sed -e 's/.*\///' | sort -nr | head -n 1`
29231	    if test x"${LIBC_NAME}" = x; then
29232		#nothing found, set libc.so anyway
29233		LIBC_NAME="${base_library_path}libc.so"
29234	    fi
29235	    ;;
29236
29237	*)
29238	    LIBC_NAME="${base_library_path}libc.${SOLIB_POSTFIX}"
29239	    ;;
29240    esac
29241fi
29242
29243{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${LIBC_NAME}" >&5
29244$as_echo "${LIBC_NAME}" >&6; }
29245if test x"${LIBC_NAME}" = xNULL; then
29246
29247$as_echo "#define LIBRARY_LIBC NULL" >>confdefs.h
29248
29249else
29250
29251cat >>confdefs.h <<_ACEOF
29252#define LIBRARY_LIBC "${LIBC_NAME}"
29253_ACEOF
29254
29255fi
29256
29257{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for symbol lookup without underscore" >&5
29258$as_echo_n "checking for symbol lookup without underscore... " >&6; }
29259if test "$cross_compiling" = yes; then :
29260  	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29261$as_echo "yes" >&6; }
29262
29263$as_echo "#define HAVE_NO_SYMBOL_UNDERSCORE 1" >>confdefs.h
29264
29265else
29266  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29267/* end confdefs.h.  */
29268
29269#include <dlfcn.h>
29270#include <stdio.h>
29271
29272#include "include/symbols.h"
29273
29274int main()
29275{
29276    void *lib;
29277    void *sym;
29278
29279    if ((lib = dlopen(LIBRARY_CONNECT, DL_LAZY)) == NULL) {
29280	    fprintf(stderr, "dlopen: %s\n", dlerror());
29281	    return 1;
29282    }
29283    (void)dlerror();
29284    if ((sym = dlsym(lib, "connect")) == NULL) {
29285	    fprintf(stderr, "dlsym: %s\n", dlerror());
29286	    return 1;
29287    }
29288    return 0;
29289}
29290_ACEOF
29291if ac_fn_c_try_run "$LINENO"; then :
29292  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29293$as_echo "yes" >&6; }
29294
29295$as_echo "#define HAVE_NO_SYMBOL_UNDERSCORE 1" >>confdefs.h
29296
29297else
29298  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29299$as_echo "no" >&6; }
29300fi
29301rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29302  conftest.$ac_objext conftest.beam conftest.$ac_ext
29303fi
29304
29305
29306{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working dlsym" >&5
29307$as_echo_n "checking for working dlsym... " >&6; }
29308if test "$cross_compiling" = yes; then :
29309       { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming yes" >&5
29310$as_echo "assuming yes" >&6; }
29311else
29312  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29313/* end confdefs.h.  */
29314
29315#include <dlfcn.h>
29316#include <stdio.h>
29317
29318#include "include/symbols.h"
29319
29320int main()
29321{
29322    void *lib;
29323    void *sym;
29324
29325    if ((lib = dlopen(LIBRARY_CONNECT, DL_LAZY)) == NULL) {
29326	    fprintf(stderr, "dlopen: %s\n", dlerror());
29327	    return 1;
29328    }
29329    (void)dlerror();
29330    if ((sym = dlsym(lib, SYMBOL_CONNECT)) == NULL) {
29331	    fprintf(stderr, "dlsym: %s\n", dlerror());
29332	    return 1;
29333    }
29334    return 0;
29335}
29336_ACEOF
29337if ac_fn_c_try_run "$LINENO"; then :
29338  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29339$as_echo "yes" >&6; }
29340else
29341  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29342$as_echo "no" >&6; }
29343     no_preload_client=t
29344     no_preload_server=t
29345     no_preload=t
29346fi
29347rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29348  conftest.$ac_objext conftest.beam conftest.$ac_ext
29349fi
29350
29351
29352{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working RTLD_NEXT" >&5
29353$as_echo_n "checking for working RTLD_NEXT... " >&6; }
29354if test "$cross_compiling" = yes; then :
29355       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29356$as_echo "yes" >&6; }
29357
29358$as_echo "#define HAVE_RTLD_NEXT 1" >>confdefs.h
29359
29360else
29361  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29362/* end confdefs.h.  */
29363
29364#define _GNU_SOURCE
29365#include <dlfcn.h>
29366#include <stdio.h>
29367
29368#include "include/symbols.h"
29369
29370int main()
29371{
29372    void *sym;
29373
29374    if ((sym = dlsym(RTLD_NEXT, SYMBOL_READ)) == NULL) {
29375	    fprintf(stderr, "dlsym: %s\n", dlerror());
29376	    return 1;
29377    }
29378    return 0;
29379}
29380_ACEOF
29381if ac_fn_c_try_run "$LINENO"; then :
29382  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29383$as_echo "yes" >&6; }
29384
29385$as_echo "#define HAVE_RTLD_NEXT 1" >>confdefs.h
29386
29387else
29388  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29389$as_echo "no" >&6; }
29390
29391$as_echo "#define HAVE_RTLD_NEXT 0" >>confdefs.h
29392
29393fi
29394rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29395  conftest.$ac_objext conftest.beam conftest.$ac_ext
29396fi
29397
29398
29399if test x"${preload_enabled}" = xt; then
29400    #Solaris might block preloading
29401    { $as_echo "$as_me:${as_lineno-$LINENO}: checking libc preload blocking" >&5
29402$as_echo_n "checking libc preload blocking... " >&6; }
29403    if test "$cross_compiling" = yes; then :
29404      { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
29405$as_echo "assuming no" >&6; }
29406else
29407  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29408/* end confdefs.h.  */
29409
29410#include <stdlib.h>
29411#include <string.h>
29412#include <unistd.h>
29413int
29414main(int argc, char *argv[])
29415{
29416   char buf[1024];
29417
29418   strcpy(buf, "lari -V ");
29419   strcat(buf, argv[0]);
29420   strcat(buf, " | grep read | grep protected > /dev/null");
29421
29422   /*
29423    * return error if 'protected'
29424    * (ignore errors, not indicative of blocking) */
29425   if (system(buf) == 0)
29426      return 1;
29427   else
29428      return 0;
29429}
29430
29431ssize_t
29432read(d, buf, nbytes)
29433   int d;
29434   void *buf;
29435   size_t nbytes;
29436{
29437   return 0;
29438}
29439
29440_ACEOF
29441if ac_fn_c_try_run "$LINENO"; then :
29442  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29443$as_echo "no" >&6; }
29444else
29445  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
29446$as_echo "yes" >&6; }
29447    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: this platform blocks preloading of libraries" >&5
29448$as_echo "$as_me: WARNING: this platform blocks preloading of libraries" >&2;}
29449    blocked_preload=t
29450fi
29451rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
29452  conftest.$ac_objext conftest.beam conftest.$ac_ext
29453fi
29454
29455fi
29456
29457unset NOPRELOAD
29458if test x"${no_preload}" != x -o x"${no_preload_client}" != x; then
29459   NOPRELOAD=t
29460   FEAT="$FEAT${FEAT:+ }nopreload"
29461else
29462
29463$as_echo "#define HAVE_PRELOAD 1" >>confdefs.h
29464
29465fi
29466
29467
29468
29469
29470ac_config_files="$ac_config_files bin/socksify"
29471
29472
29473#look for missing prototypes
29474if test x"${ac_cv_func__IO_getc}" = xyes; then
29475   ac_fn_c_check_decl "$LINENO" "_IO_getc" "ac_cv_have_decl__IO_getc" "$ac_includes_default"
29476if test "x$ac_cv_have_decl__IO_getc" = xyes; then :
29477  ac_have_decl=1
29478else
29479  ac_have_decl=0
29480fi
29481
29482cat >>confdefs.h <<_ACEOF
29483#define HAVE_DECL__IO_GETC $ac_have_decl
29484_ACEOF
29485ac_fn_c_check_decl "$LINENO" "_IO_putc" "ac_cv_have_decl__IO_putc" "$ac_includes_default"
29486if test "x$ac_cv_have_decl__IO_putc" = xyes; then :
29487  ac_have_decl=1
29488else
29489  ac_have_decl=0
29490fi
29491
29492cat >>confdefs.h <<_ACEOF
29493#define HAVE_DECL__IO_PUTC $ac_have_decl
29494_ACEOF
29495
29496fi
29497ac_fn_c_check_decl "$LINENO" "gets" "ac_cv_have_decl_gets" "$ac_includes_default"
29498if test "x$ac_cv_have_decl_gets" = xyes; then :
29499  ac_have_decl=1
29500else
29501  ac_have_decl=0
29502fi
29503
29504cat >>confdefs.h <<_ACEOF
29505#define HAVE_DECL_GETS $ac_have_decl
29506_ACEOF
29507
29508
29509
29510no_gssapi=t
29511no_krb5=t
29512no_ldap=t
29513no_sasl=t
29514no_pac=t
29515
29516unset noldap nopac
29517unset LDAPLIBS
29518
29519nogssDLIBDEPS=$DLIBDEPS
29520nogssSOCKDDEPS=$SOCKDDEPS
29521nogssCPPFLAGS=$CPPFLAGS
29522nogssLDFLAGS=$LDFLAGS
29523nogssCFLAGS=$CFLAGS
29524nogssLIBS=$LIBS
29525
29526unset gssdir
29527unset krb5confpath
29528
29529unset gssapi_default
29530case $host in
29531    #openbsd libthread is buggy; disable gssapi by default (needs pthreads)
29532    *-*-openbsd*)
29533	gssapi_default=no
29534
29535$as_echo "#define HAVE_THREADS_EINTR_PROBLEMS 1" >>confdefs.h
29536
29537	;;
29538esac
29539
29540unset GSSAPI
29541
29542# Check whether --with-gssapi-path was given.
29543if test "${with_gssapi_path+set}" = set; then :
29544  withval=$with_gssapi_path; if test -e "$withval"; then
29545     gssdir=$withval
29546     #act as if --with-gssapi is specified if path is given
29547     GSSAPI="yes"
29548 else
29549     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid gssapi-path: $withval" >&5
29550$as_echo "$as_me: WARNING: invalid gssapi-path: $withval" >&2;}
29551 fi
29552fi
29553
29554
29555
29556# Check whether --with-gssapi was given.
29557if test "${with_gssapi+set}" = set; then :
29558  withval=$with_gssapi; GSSAPI=$withval
29559else
29560  if test x"${gssapi_default}" = xno -a x"$GSSAPI" != xyes; then
29561     GSSAPI="no"
29562     { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: gssapi disabled by default on this platform" >&5
29563$as_echo "$as_me: WARNING: gssapi disabled by default on this platform" >&2;}
29564 fi
29565fi
29566
29567
29568
29569# Check whether --with-krb5-config was given.
29570if test "${with_krb5_config+set}" = set; then :
29571  withval=$with_krb5_config; if test x"$withval" != xno; then
29572     krb5confpath=$withval
29573 fi
29574fi
29575
29576
29577if test x"$GSSAPI" != xno; then
29578   #attempt to create build environment based on prefix
29579   if test x"$gssdir" != x; then
29580      if test x"$krb5confpath" = x -a -x "$gssdir/bin/krb5-config"; then
29581            krb5confpath=$gssdir/bin/krb5-config
29582      fi
29583   else
29584      #set /usr as default gssdir
29585      case $host in
29586          *-*-aix*)
29587	      gssdir=/usr/krb5
29588	      ;;
29589	  *)
29590	      gssdir=/usr
29591	      ;;
29592      esac
29593   fi
29594
29595   unset krb5fail
29596   if test x"$krb5confpath" != xno; then
29597       if test x"$krb5confpath" != x; then
29598           if ! test -x "$krb5confpath"; then
29599	       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: krb5-config '$krb5confpath' not executable, ignoring" >&5
29600$as_echo "$as_me: WARNING: krb5-config '$krb5confpath' not executable, ignoring" >&2;}
29601           else
29602               ac_gssapi_cflags=`$krb5confpath --cflags gssapi 2>/dev/null`
29603	       if test $? != 0; then
29604		   krb5fail=t
29605	       fi
29606	       ac_gssapi_libs=`$krb5confpath --libs gssapi 2>/dev/null`
29607	       if test $? != 0; then
29608		   krb5fail=t
29609	       fi
29610           fi
29611       else
29612           # Extract the first word of "krb5-config", so it can be a program name with args.
29613set dummy krb5-config; ac_word=$2
29614{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
29615$as_echo_n "checking for $ac_word... " >&6; }
29616if ${ac_cv_prog_ac_krb5_config+:} false; then :
29617  $as_echo_n "(cached) " >&6
29618else
29619  if test -n "$ac_krb5_config"; then
29620  ac_cv_prog_ac_krb5_config="$ac_krb5_config" # Let the user override the test.
29621else
29622as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
29623for as_dir in $PATH
29624do
29625  IFS=$as_save_IFS
29626  test -z "$as_dir" && as_dir=.
29627    for ac_exec_ext in '' $ac_executable_extensions; do
29628  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
29629    ac_cv_prog_ac_krb5_config="yes"
29630    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
29631    break 2
29632  fi
29633done
29634  done
29635IFS=$as_save_IFS
29636
29637  test -z "$ac_cv_prog_ac_krb5_config" && ac_cv_prog_ac_krb5_config="no"
29638fi
29639fi
29640ac_krb5_config=$ac_cv_prog_ac_krb5_config
29641if test -n "$ac_krb5_config"; then
29642  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_krb5_config" >&5
29643$as_echo "$ac_krb5_config" >&6; }
29644else
29645  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
29646$as_echo "no" >&6; }
29647fi
29648
29649
29650           if test x"${ac_krb5_config}" = xyes; then
29651	       ac_gssapi_cflags=`krb5-config --cflags gssapi 2>/dev/null`
29652	       if test $? != 0; then
29653		   krb5fail=t
29654	       fi
29655	       ac_gssapi_libs=`krb5-config --libs gssapi 2>/dev/null`
29656	       if test $? != 0; then
29657		   krb5fail=t
29658	       fi
29659           fi
29660       fi
29661   fi
29662      if test x"$krb5fail" = xt; then
29663       ac_gssapi_cflags=
29664       ac_gssapi_libs=
29665   fi
29666
29667      if test x"${ac_gssapi_cflags}" = x -a x"${ac_gssapi_libs}" = x -a \
29668           x"$gssdir" != x; then
29669              case $host in
29670           *-*-aix*)
29671	       CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I/usr/include"
29672	       ;;
29673	   *)
29674	       CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$gssdir/include"
29675	       ;;
29676       esac
29677
29678       LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$gssdir/lib"
29679       #includes under kerberosV dir on OpenBSD
29680       if test -d "$gssdir/include/kerberosV"; then
29681		  CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I${gssdir}/include/kerberosV"
29682       fi
29683   fi
29684
29685      if test x"${ac_gssapi_cflags}" != x; then
29686       CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$ac_gssapi_cflags"
29687   fi
29688
29689      if test x"${ac_gssapi_libs}" != x; then
29690              SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$ac_gssapi_libs"
29691
29692       #need to use -lpthread rather than -pthread for dlib because
29693       #the first will not cause -lpthread to be linked in
29694       #(and the application might not be linked with -lphread).
29695       #applications should use -pthread so keep this for SOCKDDEPS
29696       NDEPS=`echo $ac_gssapi_libs | sed -e 's/-pthread/-lpthread/g'`
29697              DLIBDEPS="${DLIBDEPS}${DLIBDEPS:+ }$NDEPS"
29698   fi
29699
29700      for ac_header in gssapi.h gssapi/gssapi.h gssapi/gssapi_ext.h
29701do :
29702  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
29703ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
29704if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
29705  cat >>confdefs.h <<_ACEOF
29706#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
29707_ACEOF
29708
29709fi
29710
29711done
29712
29713      for ac_header in gssapi/gssapi_krb5.h
29714do :
29715  ac_fn_c_check_header_compile "$LINENO" "gssapi/gssapi_krb5.h" "ac_cv_header_gssapi_gssapi_krb5_h" "
29716#if HAVE_GSSAPI_H
29717#include <gssapi.h>
29718#elif HAVE_GSSAPI_GSSAPI_H
29719#include <gssapi/gssapi.h>
29720#endif /* HAVE_GSSAPI_H */
29721
29722"
29723if test "x$ac_cv_header_gssapi_gssapi_krb5_h" = xyes; then :
29724  cat >>confdefs.h <<_ACEOF
29725#define HAVE_GSSAPI_GSSAPI_KRB5_H 1
29726_ACEOF
29727
29728fi
29729
29730done
29731
29732   for ac_header in gssapi/gssapi_generic.h
29733do :
29734  ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi_generic.h" "ac_cv_header_gssapi_gssapi_generic_h" "$ac_includes_default"
29735if test "x$ac_cv_header_gssapi_gssapi_generic_h" = xyes; then :
29736  cat >>confdefs.h <<_ACEOF
29737#define HAVE_GSSAPI_GSSAPI_GENERIC_H 1
29738_ACEOF
29739
29740fi
29741
29742done
29743
29744
29745      if test x"${ac_gssapi_libs}" != x; then
29746       _libsonly=`echo $ac_gssapi_libs | xargs -n1 | egrep '^-l' | xargs echo`
29747       _optsonly=`echo $ac_gssapi_libs | xargs -n1 | egrep -v '^-l' | xargs echo`
29748       LIBS="${LIBS}${LIBS:+ }${_libsonly}"
29749       LDFLAGS="${LDFLAGS}${LDFLAGS:+ }${_optsonly}"
29750
29751       case $host in
29752	   *-*-freebsd7*)
29753	          #skip check, causes problems
29754	       ;;
29755	   *)
29756	       #wanted in case of Heimdal on FreeBSD, if the function
29757	       #is missing in libgssapi. not wanted if not needed for
29758	       #heimdal (potentially causes linking problems if
29759	       #multiple kerberos implementations are installed on a
29760	       #machine).
29761	       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gsskrb5_register_acceptor_identity" >&5
29762$as_echo_n "checking for library containing gsskrb5_register_acceptor_identity... " >&6; }
29763if ${ac_cv_search_gsskrb5_register_acceptor_identity+:} false; then :
29764  $as_echo_n "(cached) " >&6
29765else
29766  ac_func_search_save_LIBS=$LIBS
29767cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29768/* end confdefs.h.  */
29769
29770/* Override any GCC internal prototype to avoid an error.
29771   Use char because int might match the return type of a GCC
29772   builtin and then its argument prototype would still apply.  */
29773#ifdef __cplusplus
29774extern "C"
29775#endif
29776char gsskrb5_register_acceptor_identity ();
29777int
29778main ()
29779{
29780return gsskrb5_register_acceptor_identity ();
29781  ;
29782  return 0;
29783}
29784_ACEOF
29785for ac_lib in '' gssapi gssapi_krb5; do
29786  if test -z "$ac_lib"; then
29787    ac_res="none required"
29788  else
29789    ac_res=-l$ac_lib
29790    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
29791  fi
29792  if ac_fn_c_try_link "$LINENO"; then :
29793  ac_cv_search_gsskrb5_register_acceptor_identity=$ac_res
29794fi
29795rm -f core conftest.err conftest.$ac_objext \
29796    conftest$ac_exeext
29797  if ${ac_cv_search_gsskrb5_register_acceptor_identity+:} false; then :
29798  break
29799fi
29800done
29801if ${ac_cv_search_gsskrb5_register_acceptor_identity+:} false; then :
29802
29803else
29804  ac_cv_search_gsskrb5_register_acceptor_identity=no
29805fi
29806rm conftest.$ac_ext
29807LIBS=$ac_func_search_save_LIBS
29808fi
29809{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gsskrb5_register_acceptor_identity" >&5
29810$as_echo "$ac_cv_search_gsskrb5_register_acceptor_identity" >&6; }
29811ac_res=$ac_cv_search_gsskrb5_register_acceptor_identity
29812if test "$ac_res" != no; then :
29813  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
29814
29815fi
29816
29817	       ;;
29818       esac
29819   else
29820       oLIBS=$LIBS
29821       LIBS=""
29822
29823       #AC_CHECK_LIB(crypto, main) #XXX only very old mit kerberos
29824       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldes" >&5
29825$as_echo_n "checking for main in -ldes... " >&6; }
29826if ${ac_cv_lib_des_main+:} false; then :
29827  $as_echo_n "(cached) " >&6
29828else
29829  ac_check_lib_save_LIBS=$LIBS
29830LIBS="-ldes  $LIBS"
29831cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29832/* end confdefs.h.  */
29833
29834
29835int
29836main ()
29837{
29838return main ();
29839  ;
29840  return 0;
29841}
29842_ACEOF
29843if ac_fn_c_try_link "$LINENO"; then :
29844  ac_cv_lib_des_main=yes
29845else
29846  ac_cv_lib_des_main=no
29847fi
29848rm -f core conftest.err conftest.$ac_objext \
29849    conftest$ac_exeext conftest.$ac_ext
29850LIBS=$ac_check_lib_save_LIBS
29851fi
29852{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_main" >&5
29853$as_echo "$ac_cv_lib_des_main" >&6; }
29854if test "x$ac_cv_lib_des_main" = xyes; then :
29855  cat >>confdefs.h <<_ACEOF
29856#define HAVE_LIBDES 1
29857_ACEOF
29858
29859  LIBS="-ldes $LIBS"
29860
29861fi
29862
29863       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypt" >&5
29864$as_echo_n "checking for main in -lcrypt... " >&6; }
29865if ${ac_cv_lib_crypt_main+:} false; then :
29866  $as_echo_n "(cached) " >&6
29867else
29868  ac_check_lib_save_LIBS=$LIBS
29869LIBS="-lcrypt  $LIBS"
29870cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29871/* end confdefs.h.  */
29872
29873
29874int
29875main ()
29876{
29877return main ();
29878  ;
29879  return 0;
29880}
29881_ACEOF
29882if ac_fn_c_try_link "$LINENO"; then :
29883  ac_cv_lib_crypt_main=yes
29884else
29885  ac_cv_lib_crypt_main=no
29886fi
29887rm -f core conftest.err conftest.$ac_objext \
29888    conftest$ac_exeext conftest.$ac_ext
29889LIBS=$ac_check_lib_save_LIBS
29890fi
29891{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_main" >&5
29892$as_echo "$ac_cv_lib_crypt_main" >&6; }
29893if test "x$ac_cv_lib_crypt_main" = xyes; then :
29894  cat >>confdefs.h <<_ACEOF
29895#define HAVE_LIBCRYPT 1
29896_ACEOF
29897
29898  LIBS="-lcrypt $LIBS"
29899
29900fi
29901
29902       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lroken" >&5
29903$as_echo_n "checking for main in -lroken... " >&6; }
29904if ${ac_cv_lib_roken_main+:} false; then :
29905  $as_echo_n "(cached) " >&6
29906else
29907  ac_check_lib_save_LIBS=$LIBS
29908LIBS="-lroken  $LIBS"
29909cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29910/* end confdefs.h.  */
29911
29912
29913int
29914main ()
29915{
29916return main ();
29917  ;
29918  return 0;
29919}
29920_ACEOF
29921if ac_fn_c_try_link "$LINENO"; then :
29922  ac_cv_lib_roken_main=yes
29923else
29924  ac_cv_lib_roken_main=no
29925fi
29926rm -f core conftest.err conftest.$ac_objext \
29927    conftest$ac_exeext conftest.$ac_ext
29928LIBS=$ac_check_lib_save_LIBS
29929fi
29930{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_roken_main" >&5
29931$as_echo "$ac_cv_lib_roken_main" >&6; }
29932if test "x$ac_cv_lib_roken_main" = xyes; then :
29933  cat >>confdefs.h <<_ACEOF
29934#define HAVE_LIBROKEN 1
29935_ACEOF
29936
29937  LIBS="-lroken $LIBS"
29938
29939fi
29940
29941
29942       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcom_err" >&5
29943$as_echo_n "checking for main in -lcom_err... " >&6; }
29944if ${ac_cv_lib_com_err_main+:} false; then :
29945  $as_echo_n "(cached) " >&6
29946else
29947  ac_check_lib_save_LIBS=$LIBS
29948LIBS="-lcom_err  $LIBS"
29949cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29950/* end confdefs.h.  */
29951
29952
29953int
29954main ()
29955{
29956return main ();
29957  ;
29958  return 0;
29959}
29960_ACEOF
29961if ac_fn_c_try_link "$LINENO"; then :
29962  ac_cv_lib_com_err_main=yes
29963else
29964  ac_cv_lib_com_err_main=no
29965fi
29966rm -f core conftest.err conftest.$ac_objext \
29967    conftest$ac_exeext conftest.$ac_ext
29968LIBS=$ac_check_lib_save_LIBS
29969fi
29970{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_main" >&5
29971$as_echo "$ac_cv_lib_com_err_main" >&6; }
29972if test "x$ac_cv_lib_com_err_main" = xyes; then :
29973  cat >>confdefs.h <<_ACEOF
29974#define HAVE_LIBCOM_ERR 1
29975_ACEOF
29976
29977  LIBS="-lcom_err $LIBS"
29978
29979fi
29980
29981       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldes425" >&5
29982$as_echo_n "checking for main in -ldes425... " >&6; }
29983if ${ac_cv_lib_des425_main+:} false; then :
29984  $as_echo_n "(cached) " >&6
29985else
29986  ac_check_lib_save_LIBS=$LIBS
29987LIBS="-ldes425  $LIBS"
29988cat confdefs.h - <<_ACEOF >conftest.$ac_ext
29989/* end confdefs.h.  */
29990
29991
29992int
29993main ()
29994{
29995return main ();
29996  ;
29997  return 0;
29998}
29999_ACEOF
30000if ac_fn_c_try_link "$LINENO"; then :
30001  ac_cv_lib_des425_main=yes
30002else
30003  ac_cv_lib_des425_main=no
30004fi
30005rm -f core conftest.err conftest.$ac_objext \
30006    conftest$ac_exeext conftest.$ac_ext
30007LIBS=$ac_check_lib_save_LIBS
30008fi
30009{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des425_main" >&5
30010$as_echo "$ac_cv_lib_des425_main" >&6; }
30011if test "x$ac_cv_lib_des425_main" = xyes; then :
30012  cat >>confdefs.h <<_ACEOF
30013#define HAVE_LIBDES425 1
30014_ACEOF
30015
30016  LIBS="-ldes425 $LIBS"
30017
30018fi
30019
30020       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lk5crypto" >&5
30021$as_echo_n "checking for main in -lk5crypto... " >&6; }
30022if ${ac_cv_lib_k5crypto_main+:} false; then :
30023  $as_echo_n "(cached) " >&6
30024else
30025  ac_check_lib_save_LIBS=$LIBS
30026LIBS="-lk5crypto  $LIBS"
30027cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30028/* end confdefs.h.  */
30029
30030
30031int
30032main ()
30033{
30034return main ();
30035  ;
30036  return 0;
30037}
30038_ACEOF
30039if ac_fn_c_try_link "$LINENO"; then :
30040  ac_cv_lib_k5crypto_main=yes
30041else
30042  ac_cv_lib_k5crypto_main=no
30043fi
30044rm -f core conftest.err conftest.$ac_objext \
30045    conftest$ac_exeext conftest.$ac_ext
30046LIBS=$ac_check_lib_save_LIBS
30047fi
30048{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_main" >&5
30049$as_echo "$ac_cv_lib_k5crypto_main" >&6; }
30050if test "x$ac_cv_lib_k5crypto_main" = xyes; then :
30051  cat >>confdefs.h <<_ACEOF
30052#define HAVE_LIBK5CRYPTO 1
30053_ACEOF
30054
30055  LIBS="-lk5crypto $LIBS"
30056
30057fi
30058
30059
30060       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
30061$as_echo_n "checking for main in -lpthread... " >&6; }
30062if ${ac_cv_lib_pthread_main+:} false; then :
30063  $as_echo_n "(cached) " >&6
30064else
30065  ac_check_lib_save_LIBS=$LIBS
30066LIBS="-lpthread  $LIBS"
30067cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30068/* end confdefs.h.  */
30069
30070
30071int
30072main ()
30073{
30074return main ();
30075  ;
30076  return 0;
30077}
30078_ACEOF
30079if ac_fn_c_try_link "$LINENO"; then :
30080  ac_cv_lib_pthread_main=yes
30081else
30082  ac_cv_lib_pthread_main=no
30083fi
30084rm -f core conftest.err conftest.$ac_objext \
30085    conftest$ac_exeext conftest.$ac_ext
30086LIBS=$ac_check_lib_save_LIBS
30087fi
30088{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
30089$as_echo "$ac_cv_lib_pthread_main" >&6; }
30090if test "x$ac_cv_lib_pthread_main" = xyes; then :
30091  cat >>confdefs.h <<_ACEOF
30092#define HAVE_LIBPTHREAD 1
30093_ACEOF
30094
30095  LIBS="-lpthread $LIBS"
30096
30097fi
30098
30099
30100       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lasn1" >&5
30101$as_echo_n "checking for main in -lasn1... " >&6; }
30102if ${ac_cv_lib_asn1_main+:} false; then :
30103  $as_echo_n "(cached) " >&6
30104else
30105  ac_check_lib_save_LIBS=$LIBS
30106LIBS="-lasn1  $LIBS"
30107cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30108/* end confdefs.h.  */
30109
30110
30111int
30112main ()
30113{
30114return main ();
30115  ;
30116  return 0;
30117}
30118_ACEOF
30119if ac_fn_c_try_link "$LINENO"; then :
30120  ac_cv_lib_asn1_main=yes
30121else
30122  ac_cv_lib_asn1_main=no
30123fi
30124rm -f core conftest.err conftest.$ac_objext \
30125    conftest$ac_exeext conftest.$ac_ext
30126LIBS=$ac_check_lib_save_LIBS
30127fi
30128{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asn1_main" >&5
30129$as_echo "$ac_cv_lib_asn1_main" >&6; }
30130if test "x$ac_cv_lib_asn1_main" = xyes; then :
30131  cat >>confdefs.h <<_ACEOF
30132#define HAVE_LIBASN1 1
30133_ACEOF
30134
30135  LIBS="-lasn1 $LIBS"
30136
30137fi
30138
30139       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkrb5" >&5
30140$as_echo_n "checking for main in -lkrb5... " >&6; }
30141if ${ac_cv_lib_krb5_main+:} false; then :
30142  $as_echo_n "(cached) " >&6
30143else
30144  ac_check_lib_save_LIBS=$LIBS
30145LIBS="-lkrb5  $LIBS"
30146cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30147/* end confdefs.h.  */
30148
30149
30150int
30151main ()
30152{
30153return main ();
30154  ;
30155  return 0;
30156}
30157_ACEOF
30158if ac_fn_c_try_link "$LINENO"; then :
30159  ac_cv_lib_krb5_main=yes
30160else
30161  ac_cv_lib_krb5_main=no
30162fi
30163rm -f core conftest.err conftest.$ac_objext \
30164    conftest$ac_exeext conftest.$ac_ext
30165LIBS=$ac_check_lib_save_LIBS
30166fi
30167{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_main" >&5
30168$as_echo "$ac_cv_lib_krb5_main" >&6; }
30169if test "x$ac_cv_lib_krb5_main" = xyes; then :
30170  cat >>confdefs.h <<_ACEOF
30171#define HAVE_LIBKRB5 1
30172_ACEOF
30173
30174  LIBS="-lkrb5 $LIBS"
30175
30176fi
30177
30178       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgssapi_krb5" >&5
30179$as_echo_n "checking for main in -lgssapi_krb5... " >&6; }
30180if ${ac_cv_lib_gssapi_krb5_main+:} false; then :
30181  $as_echo_n "(cached) " >&6
30182else
30183  ac_check_lib_save_LIBS=$LIBS
30184LIBS="-lgssapi_krb5  $LIBS"
30185cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30186/* end confdefs.h.  */
30187
30188
30189int
30190main ()
30191{
30192return main ();
30193  ;
30194  return 0;
30195}
30196_ACEOF
30197if ac_fn_c_try_link "$LINENO"; then :
30198  ac_cv_lib_gssapi_krb5_main=yes
30199else
30200  ac_cv_lib_gssapi_krb5_main=no
30201fi
30202rm -f core conftest.err conftest.$ac_objext \
30203    conftest$ac_exeext conftest.$ac_ext
30204LIBS=$ac_check_lib_save_LIBS
30205fi
30206{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_krb5_main" >&5
30207$as_echo "$ac_cv_lib_gssapi_krb5_main" >&6; }
30208if test "x$ac_cv_lib_gssapi_krb5_main" = xyes; then :
30209  cat >>confdefs.h <<_ACEOF
30210#define HAVE_LIBGSSAPI_KRB5 1
30211_ACEOF
30212
30213  LIBS="-lgssapi_krb5 $LIBS"
30214
30215fi
30216
30217
30218       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgssapi" >&5
30219$as_echo_n "checking for main in -lgssapi... " >&6; }
30220if ${ac_cv_lib_gssapi_main+:} false; then :
30221  $as_echo_n "(cached) " >&6
30222else
30223  ac_check_lib_save_LIBS=$LIBS
30224LIBS="-lgssapi  $LIBS"
30225cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30226/* end confdefs.h.  */
30227
30228
30229int
30230main ()
30231{
30232return main ();
30233  ;
30234  return 0;
30235}
30236_ACEOF
30237if ac_fn_c_try_link "$LINENO"; then :
30238  ac_cv_lib_gssapi_main=yes
30239else
30240  ac_cv_lib_gssapi_main=no
30241fi
30242rm -f core conftest.err conftest.$ac_objext \
30243    conftest$ac_exeext conftest.$ac_ext
30244LIBS=$ac_check_lib_save_LIBS
30245fi
30246{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gssapi_main" >&5
30247$as_echo "$ac_cv_lib_gssapi_main" >&6; }
30248if test "x$ac_cv_lib_gssapi_main" = xyes; then :
30249  cat >>confdefs.h <<_ACEOF
30250#define HAVE_LIBGSSAPI 1
30251_ACEOF
30252
30253  LIBS="-lgssapi $LIBS"
30254
30255fi
30256
30257
30258       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgss" >&5
30259$as_echo_n "checking for main in -lgss... " >&6; }
30260if ${ac_cv_lib_gss_main+:} false; then :
30261  $as_echo_n "(cached) " >&6
30262else
30263  ac_check_lib_save_LIBS=$LIBS
30264LIBS="-lgss  $LIBS"
30265cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30266/* end confdefs.h.  */
30267
30268
30269int
30270main ()
30271{
30272return main ();
30273  ;
30274  return 0;
30275}
30276_ACEOF
30277if ac_fn_c_try_link "$LINENO"; then :
30278  ac_cv_lib_gss_main=yes
30279else
30280  ac_cv_lib_gss_main=no
30281fi
30282rm -f core conftest.err conftest.$ac_objext \
30283    conftest$ac_exeext conftest.$ac_ext
30284LIBS=$ac_check_lib_save_LIBS
30285fi
30286{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gss_main" >&5
30287$as_echo "$ac_cv_lib_gss_main" >&6; }
30288if test "x$ac_cv_lib_gss_main" = xyes; then :
30289  cat >>confdefs.h <<_ACEOF
30290#define HAVE_LIBGSS 1
30291_ACEOF
30292
30293  LIBS="-lgss $LIBS"
30294
30295fi
30296
30297
30298       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lksvc" >&5
30299$as_echo_n "checking for main in -lksvc... " >&6; }
30300if ${ac_cv_lib_ksvc_main+:} false; then :
30301  $as_echo_n "(cached) " >&6
30302else
30303  ac_check_lib_save_LIBS=$LIBS
30304LIBS="-lksvc  $LIBS"
30305cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30306/* end confdefs.h.  */
30307
30308
30309int
30310main ()
30311{
30312return main ();
30313  ;
30314  return 0;
30315}
30316_ACEOF
30317if ac_fn_c_try_link "$LINENO"; then :
30318  ac_cv_lib_ksvc_main=yes
30319else
30320  ac_cv_lib_ksvc_main=no
30321fi
30322rm -f core conftest.err conftest.$ac_objext \
30323    conftest$ac_exeext conftest.$ac_ext
30324LIBS=$ac_check_lib_save_LIBS
30325fi
30326{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ksvc_main" >&5
30327$as_echo "$ac_cv_lib_ksvc_main" >&6; }
30328if test "x$ac_cv_lib_ksvc_main" = xyes; then :
30329  cat >>confdefs.h <<_ACEOF
30330#define HAVE_LIBKSVC 1
30331_ACEOF
30332
30333  LIBS="-lksvc $LIBS"
30334
30335fi
30336
30337
30338              if test x"${LIBS}" != x; then
30339	   DLIBDEPS="${DLIBDEPS}${DLIBDEPS:+ }$LIBS"
30340	   SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$LIBS"
30341       fi
30342       LIBS="${oLIBS}${oLIBS:+ }$LIBS"
30343   fi
30344
30345
30346   for ac_func in gss_map_name_to_any
30347do :
30348  ac_fn_c_check_func "$LINENO" "gss_map_name_to_any" "ac_cv_func_gss_map_name_to_any"
30349if test "x$ac_cv_func_gss_map_name_to_any" = xyes; then :
30350  cat >>confdefs.h <<_ACEOF
30351#define HAVE_GSS_MAP_NAME_TO_ANY 1
30352_ACEOF
30353
30354$as_echo "#define HAVE_GSS_MAP_ANY_TO_ANY 1" >>confdefs.h
30355
30356fi
30357done
30358
30359   for ac_func in gsskrb5_extract_authz_data_from_sec_context
30360do :
30361  ac_fn_c_check_func "$LINENO" "gsskrb5_extract_authz_data_from_sec_context" "ac_cv_func_gsskrb5_extract_authz_data_from_sec_context"
30362if test "x$ac_cv_func_gsskrb5_extract_authz_data_from_sec_context" = xyes; then :
30363  cat >>confdefs.h <<_ACEOF
30364#define HAVE_GSSKRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT 1
30365_ACEOF
30366
30367$as_echo "#define HAVE_GSSKRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT 1" >>confdefs.h
30368
30369fi
30370done
30371
30372
30373   unset have_heimdal
30374   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for heimdal" >&5
30375$as_echo_n "checking for heimdal... " >&6; }
30376   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30377/* end confdefs.h.  */
30378#include "krb5.h"
30379int
30380main ()
30381{
30382printf("%s\n", heimdal_version);
30383  ;
30384  return 0;
30385}
30386_ACEOF
30387if ac_fn_c_try_link "$LINENO"; then :
30388
30389$as_echo "#define HAVE_HEIMDAL_KERBEROS 1" >>confdefs.h
30390
30391    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30392$as_echo "yes" >&6; }
30393    have_heimdal=t
30394else
30395  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30396$as_echo "no" >&6; }
30397fi
30398rm -f core conftest.err conftest.$ac_objext \
30399    conftest$ac_exeext conftest.$ac_ext
30400
30401      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working gssapi" >&5
30402$as_echo_n "checking for working gssapi... " >&6; }
30403   if test "$cross_compiling" = yes; then :
30404      { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5
30405$as_echo "assuming no" >&6; }
30406else
30407  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30408/* end confdefs.h.  */
30409
30410#if HAVE_GSSAPI_H
30411#include <gssapi.h>
30412#elif HAVE_GSSAPI_GSSAPI_H
30413#include <gssapi/gssapi.h>
30414#endif /* HAVE_GSSAPI_H */
30415
30416#if !HAVE_HEIMDAL_KERBEROS
30417#if HAVE_GSSAPI_GSSAPI_EXT_H
30418#include <gssapi/gssapi_ext.h>
30419#endif /* HAVE_GSSAPI_GSSAPI_EXT_H */
30420#if HAVE_GSSAPI_GSSAPI_KRB5_H
30421#include <gssapi/gssapi_krb5.h>
30422#endif /* HAVE_GSSAPI_GSSAPI_KRB5_H */
30423#if HAVE_GSSAPI_GSSAPI_GENERIC_H
30424#include <gssapi/gssapi_generic.h>
30425#endif /* HAVE_GSSAPI_GSSAPI_GENERIC_H */
30426#endif /* HAVE_HEIMDAL_KERBEROS */
30427
30428int
30429main(void)
30430{
30431    OM_uint32 val;
30432    gss_OID_set set;
30433
30434    gss_create_empty_oid_set(&val, &set);
30435
30436    return 0;
30437}
30438
30439_ACEOF
30440if ac_fn_c_try_run "$LINENO"; then :
30441  unset no_gssapi
30442    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
30443$as_echo "yes" >&6; }
30444else
30445  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
30446$as_echo "no" >&6; }
30447fi
30448rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
30449  conftest.$ac_objext conftest.beam conftest.$ac_ext
30450fi
30451
30452
30453   for file in gssapi.h gssapi/gssapi.h gssapi/gssapi_generic.h; do
30454       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30455/* end confdefs.h.  */
30456#include <$file>
30457
30458_ACEOF
30459if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
30460  $EGREP "gss_nt_service_name" >/dev/null 2>&1; then :
30461  break
30462else
30463  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30464/* end confdefs.h.  */
30465#include <$file>
30466
30467_ACEOF
30468if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
30469  $EGREP "gss_nt_service_name" >/dev/null 2>&1; then :
30470  GSS_C_NT_HOSTBASED_SERVICE
30471else
30472
30473$as_echo "#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE" >>confdefs.h
30474
30475                              break;
30476fi
30477rm -f conftest*
30478
30479fi
30480rm -f conftest*
30481
30482   done
30483fi
30484
30485#restore build environment if not using gssapi
30486if test x"${no_gssapi}" = xt; then
30487    DLIBDEPS=$nogssDLIBDEPS
30488    SOCKDDEPS=$nogssSOCKDDEPS
30489    CPPFLAGS=$nogssCPPFLAGS
30490    LDFLAGS=$nogssLDFLAGS
30491    CFLAGS=$nogssCFLAGS
30492    LIBS=$nogssLIBS
30493else
30494    #include libs as dependencies as needed in subdirs
30495    LIBS="${LIBS}${LIBS:+ }$nogssLIBS"
30496
30497
30498$as_echo "#define HAVE_GSSAPI 1" >>confdefs.h
30499
30500fi
30501
30502if test x"${no_gssapi}" = xt; then
30503   noldap="working GSSAPI installation required"
30504   nopac="working GSSAPI installation required"
30505else
30506   FEAT="$FEAT${FEAT:+ }gssapi"
30507
30508   LIBScpy="$LIBS"
30509
30510#AC_ARG_WITH(krb5,
30511# [  --without-krb5          disable kerberos 5 support [default=detect]],
30512# [KRB5="$withval"])
30513KRB5=yes
30514
30515
30516if test x"$KRB5" != xno; then
30517   unset krb5fail
30518   if test x"$krb5confpath" != x; then
30519      ac_krb5_cflags=`$krb5confpath --cflags krb5 2>/dev/null`
30520      if test $? != 0; then
30521         krb5fail=t
30522      fi
30523      ac_krb5_libs=`$krb5confpath --libs krb5 2>/dev/null`
30524      if test $? != 0; then
30525         krb5fail=t
30526      fi
30527      ac_krb5_heimdal="`$krb5confpath --version 2>/dev/null | grep -i heimdal`"
30528   fi
30529      if test x"$krb5confpath" = x -o x"$krb5fail" = xt; then
30530      ac_krb5_cflags=
30531      ac_krb5_libs=
30532   fi
30533
30534   unset PAC
30535
30536# Check whether --with-pac was given.
30537if test "${with_pac+set}" = set; then :
30538  withval=$with_pac; PAC="$withval"
30539else
30540  PAC="yes" #default
30541fi
30542
30543
30544   if test x"$PAC" != xyes; then
30545      PAC="no"
30546      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: PAC disabled with --without-pac" >&5
30547$as_echo "$as_me: WARNING: PAC disabled with --without-pac" >&2;}
30548   fi
30549
30550      if test x"${ac_krb5_cflags}" != x; then
30551      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$ac_krb5_cflags"
30552   fi
30553
30554      for ac_header in krb5.h kerberosv5/krb5.h com_err.h et/com_err.h kerberosv5/com_err.h
30555do :
30556  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
30557ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
30558if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
30559  cat >>confdefs.h <<_ACEOF
30560#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
30561_ACEOF
30562
30563fi
30564
30565done
30566
30567
30568   ac_com_error_message=no
30569   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30570/* end confdefs.h.  */
30571#include <krb5.h>
30572
30573_ACEOF
30574if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
30575  $EGREP "com_err.h" >/dev/null 2>&1; then :
30576  ac_com_err_krb5=yes
30577fi
30578rm -f conftest*
30579
30580   if test x"${ac_com_err_krb5}" = xyes; then
30581
30582$as_echo "#define HAVE_COM_ERR_IN_KRB5 1" >>confdefs.h
30583
30584   fi
30585   if test x"${ac_cv_header_com_err_h}" = xyes; then
30586      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30587/* end confdefs.h.  */
30588#include <com_err.h>
30589
30590_ACEOF
30591if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
30592  $EGREP "error_message" >/dev/null 2>&1; then :
30593  ac_com_error_message=yes
30594fi
30595rm -f conftest*
30596
30597   elif test x"${ac_cv_header_et_com_err_h}" = xyes; then
30598      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30599/* end confdefs.h.  */
30600#include <et/com_err.h>
30601
30602_ACEOF
30603if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
30604  $EGREP "error_message" >/dev/null 2>&1; then :
30605  ac_com_error_message=yes
30606fi
30607rm -f conftest*
30608
30609   elif test x"${ac_cv_header_kerberosv5_com_err_h}" = xyes; then
30610      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30611/* end confdefs.h.  */
30612#include <kerberosv5/com_err.h>
30613
30614_ACEOF
30615if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
30616  $EGREP "error_message" >/dev/null 2>&1; then :
30617  ac_com_error_message=yes
30618fi
30619rm -f conftest*
30620
30621   fi
30622
30623      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
30624$as_echo_n "checking for main in -lpthread... " >&6; }
30625if ${ac_cv_lib_pthread_main+:} false; then :
30626  $as_echo_n "(cached) " >&6
30627else
30628  ac_check_lib_save_LIBS=$LIBS
30629LIBS="-lpthread  $LIBS"
30630cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30631/* end confdefs.h.  */
30632
30633
30634int
30635main ()
30636{
30637return main ();
30638  ;
30639  return 0;
30640}
30641_ACEOF
30642if ac_fn_c_try_link "$LINENO"; then :
30643  ac_cv_lib_pthread_main=yes
30644else
30645  ac_cv_lib_pthread_main=no
30646fi
30647rm -f core conftest.err conftest.$ac_objext \
30648    conftest$ac_exeext conftest.$ac_ext
30649LIBS=$ac_check_lib_save_LIBS
30650fi
30651{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
30652$as_echo "$ac_cv_lib_pthread_main" >&6; }
30653if test "x$ac_cv_lib_pthread_main" = xyes; then :
30654  cat >>confdefs.h <<_ACEOF
30655#define HAVE_LIBPTHREAD 1
30656_ACEOF
30657
30658  LIBS="-lpthread $LIBS"
30659
30660fi
30661
30662
30663      if test x"${ac_krb5_libs}" != x; then
30664      _libsonly=`echo $ac_krb5_libs | xargs -n1 | egrep '^-l' | xargs echo`
30665      _optsonly=`echo $ac_krb5_libs | xargs -n1 | egrep -v '^-l' | xargs echo`
30666
30667      LIBS="${LIBS}${LIBS:+ }${_libsonly}"
30668      LDFLAGS="${LDFLAGS}${LDFLAGS:+ }${_optsonly}"
30669   else
30670      #AC_CHECK_LIB(crypto, main) #XXX only very old mit kerberos
30671      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldes" >&5
30672$as_echo_n "checking for main in -ldes... " >&6; }
30673if ${ac_cv_lib_des_main+:} false; then :
30674  $as_echo_n "(cached) " >&6
30675else
30676  ac_check_lib_save_LIBS=$LIBS
30677LIBS="-ldes  $LIBS"
30678cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30679/* end confdefs.h.  */
30680
30681
30682int
30683main ()
30684{
30685return main ();
30686  ;
30687  return 0;
30688}
30689_ACEOF
30690if ac_fn_c_try_link "$LINENO"; then :
30691  ac_cv_lib_des_main=yes
30692else
30693  ac_cv_lib_des_main=no
30694fi
30695rm -f core conftest.err conftest.$ac_objext \
30696    conftest$ac_exeext conftest.$ac_ext
30697LIBS=$ac_check_lib_save_LIBS
30698fi
30699{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des_main" >&5
30700$as_echo "$ac_cv_lib_des_main" >&6; }
30701if test "x$ac_cv_lib_des_main" = xyes; then :
30702  cat >>confdefs.h <<_ACEOF
30703#define HAVE_LIBDES 1
30704_ACEOF
30705
30706  LIBS="-ldes $LIBS"
30707
30708fi
30709
30710      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypt" >&5
30711$as_echo_n "checking for main in -lcrypt... " >&6; }
30712if ${ac_cv_lib_crypt_main+:} false; then :
30713  $as_echo_n "(cached) " >&6
30714else
30715  ac_check_lib_save_LIBS=$LIBS
30716LIBS="-lcrypt  $LIBS"
30717cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30718/* end confdefs.h.  */
30719
30720
30721int
30722main ()
30723{
30724return main ();
30725  ;
30726  return 0;
30727}
30728_ACEOF
30729if ac_fn_c_try_link "$LINENO"; then :
30730  ac_cv_lib_crypt_main=yes
30731else
30732  ac_cv_lib_crypt_main=no
30733fi
30734rm -f core conftest.err conftest.$ac_objext \
30735    conftest$ac_exeext conftest.$ac_ext
30736LIBS=$ac_check_lib_save_LIBS
30737fi
30738{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_main" >&5
30739$as_echo "$ac_cv_lib_crypt_main" >&6; }
30740if test "x$ac_cv_lib_crypt_main" = xyes; then :
30741  cat >>confdefs.h <<_ACEOF
30742#define HAVE_LIBCRYPT 1
30743_ACEOF
30744
30745  LIBS="-lcrypt $LIBS"
30746
30747fi
30748
30749      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lroken" >&5
30750$as_echo_n "checking for main in -lroken... " >&6; }
30751if ${ac_cv_lib_roken_main+:} false; then :
30752  $as_echo_n "(cached) " >&6
30753else
30754  ac_check_lib_save_LIBS=$LIBS
30755LIBS="-lroken  $LIBS"
30756cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30757/* end confdefs.h.  */
30758
30759
30760int
30761main ()
30762{
30763return main ();
30764  ;
30765  return 0;
30766}
30767_ACEOF
30768if ac_fn_c_try_link "$LINENO"; then :
30769  ac_cv_lib_roken_main=yes
30770else
30771  ac_cv_lib_roken_main=no
30772fi
30773rm -f core conftest.err conftest.$ac_objext \
30774    conftest$ac_exeext conftest.$ac_ext
30775LIBS=$ac_check_lib_save_LIBS
30776fi
30777{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_roken_main" >&5
30778$as_echo "$ac_cv_lib_roken_main" >&6; }
30779if test "x$ac_cv_lib_roken_main" = xyes; then :
30780  cat >>confdefs.h <<_ACEOF
30781#define HAVE_LIBROKEN 1
30782_ACEOF
30783
30784  LIBS="-lroken $LIBS"
30785
30786fi
30787
30788
30789      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcom_err" >&5
30790$as_echo_n "checking for main in -lcom_err... " >&6; }
30791if ${ac_cv_lib_com_err_main+:} false; then :
30792  $as_echo_n "(cached) " >&6
30793else
30794  ac_check_lib_save_LIBS=$LIBS
30795LIBS="-lcom_err  $LIBS"
30796cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30797/* end confdefs.h.  */
30798
30799
30800int
30801main ()
30802{
30803return main ();
30804  ;
30805  return 0;
30806}
30807_ACEOF
30808if ac_fn_c_try_link "$LINENO"; then :
30809  ac_cv_lib_com_err_main=yes
30810else
30811  ac_cv_lib_com_err_main=no
30812fi
30813rm -f core conftest.err conftest.$ac_objext \
30814    conftest$ac_exeext conftest.$ac_ext
30815LIBS=$ac_check_lib_save_LIBS
30816fi
30817{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_main" >&5
30818$as_echo "$ac_cv_lib_com_err_main" >&6; }
30819if test "x$ac_cv_lib_com_err_main" = xyes; then :
30820  cat >>confdefs.h <<_ACEOF
30821#define HAVE_LIBCOM_ERR 1
30822_ACEOF
30823
30824  LIBS="-lcom_err $LIBS"
30825
30826fi
30827
30828      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldes425" >&5
30829$as_echo_n "checking for main in -ldes425... " >&6; }
30830if ${ac_cv_lib_des425_main+:} false; then :
30831  $as_echo_n "(cached) " >&6
30832else
30833  ac_check_lib_save_LIBS=$LIBS
30834LIBS="-ldes425  $LIBS"
30835cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30836/* end confdefs.h.  */
30837
30838
30839int
30840main ()
30841{
30842return main ();
30843  ;
30844  return 0;
30845}
30846_ACEOF
30847if ac_fn_c_try_link "$LINENO"; then :
30848  ac_cv_lib_des425_main=yes
30849else
30850  ac_cv_lib_des425_main=no
30851fi
30852rm -f core conftest.err conftest.$ac_objext \
30853    conftest$ac_exeext conftest.$ac_ext
30854LIBS=$ac_check_lib_save_LIBS
30855fi
30856{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_des425_main" >&5
30857$as_echo "$ac_cv_lib_des425_main" >&6; }
30858if test "x$ac_cv_lib_des425_main" = xyes; then :
30859  cat >>confdefs.h <<_ACEOF
30860#define HAVE_LIBDES425 1
30861_ACEOF
30862
30863  LIBS="-ldes425 $LIBS"
30864
30865fi
30866
30867      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lk5crypto" >&5
30868$as_echo_n "checking for main in -lk5crypto... " >&6; }
30869if ${ac_cv_lib_k5crypto_main+:} false; then :
30870  $as_echo_n "(cached) " >&6
30871else
30872  ac_check_lib_save_LIBS=$LIBS
30873LIBS="-lk5crypto  $LIBS"
30874cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30875/* end confdefs.h.  */
30876
30877
30878int
30879main ()
30880{
30881return main ();
30882  ;
30883  return 0;
30884}
30885_ACEOF
30886if ac_fn_c_try_link "$LINENO"; then :
30887  ac_cv_lib_k5crypto_main=yes
30888else
30889  ac_cv_lib_k5crypto_main=no
30890fi
30891rm -f core conftest.err conftest.$ac_objext \
30892    conftest$ac_exeext conftest.$ac_ext
30893LIBS=$ac_check_lib_save_LIBS
30894fi
30895{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_k5crypto_main" >&5
30896$as_echo "$ac_cv_lib_k5crypto_main" >&6; }
30897if test "x$ac_cv_lib_k5crypto_main" = xyes; then :
30898  cat >>confdefs.h <<_ACEOF
30899#define HAVE_LIBK5CRYPTO 1
30900_ACEOF
30901
30902  LIBS="-lk5crypto $LIBS"
30903
30904fi
30905
30906
30907      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lasn1" >&5
30908$as_echo_n "checking for main in -lasn1... " >&6; }
30909if ${ac_cv_lib_asn1_main+:} false; then :
30910  $as_echo_n "(cached) " >&6
30911else
30912  ac_check_lib_save_LIBS=$LIBS
30913LIBS="-lasn1  $LIBS"
30914cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30915/* end confdefs.h.  */
30916
30917
30918int
30919main ()
30920{
30921return main ();
30922  ;
30923  return 0;
30924}
30925_ACEOF
30926if ac_fn_c_try_link "$LINENO"; then :
30927  ac_cv_lib_asn1_main=yes
30928else
30929  ac_cv_lib_asn1_main=no
30930fi
30931rm -f core conftest.err conftest.$ac_objext \
30932    conftest$ac_exeext conftest.$ac_ext
30933LIBS=$ac_check_lib_save_LIBS
30934fi
30935{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_asn1_main" >&5
30936$as_echo "$ac_cv_lib_asn1_main" >&6; }
30937if test "x$ac_cv_lib_asn1_main" = xyes; then :
30938  cat >>confdefs.h <<_ACEOF
30939#define HAVE_LIBASN1 1
30940_ACEOF
30941
30942  LIBS="-lasn1 $LIBS"
30943
30944fi
30945
30946      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkrb5" >&5
30947$as_echo_n "checking for main in -lkrb5... " >&6; }
30948if ${ac_cv_lib_krb5_main+:} false; then :
30949  $as_echo_n "(cached) " >&6
30950else
30951  ac_check_lib_save_LIBS=$LIBS
30952LIBS="-lkrb5  $LIBS"
30953cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30954/* end confdefs.h.  */
30955
30956
30957int
30958main ()
30959{
30960return main ();
30961  ;
30962  return 0;
30963}
30964_ACEOF
30965if ac_fn_c_try_link "$LINENO"; then :
30966  ac_cv_lib_krb5_main=yes
30967else
30968  ac_cv_lib_krb5_main=no
30969fi
30970rm -f core conftest.err conftest.$ac_objext \
30971    conftest$ac_exeext conftest.$ac_ext
30972LIBS=$ac_check_lib_save_LIBS
30973fi
30974{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_main" >&5
30975$as_echo "$ac_cv_lib_krb5_main" >&6; }
30976if test "x$ac_cv_lib_krb5_main" = xyes; then :
30977  cat >>confdefs.h <<_ACEOF
30978#define HAVE_LIBKRB5 1
30979_ACEOF
30980
30981  LIBS="-lkrb5 $LIBS"
30982
30983fi
30984
30985
30986      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lksvc" >&5
30987$as_echo_n "checking for main in -lksvc... " >&6; }
30988if ${ac_cv_lib_ksvc_main+:} false; then :
30989  $as_echo_n "(cached) " >&6
30990else
30991  ac_check_lib_save_LIBS=$LIBS
30992LIBS="-lksvc  $LIBS"
30993cat confdefs.h - <<_ACEOF >conftest.$ac_ext
30994/* end confdefs.h.  */
30995
30996
30997int
30998main ()
30999{
31000return main ();
31001  ;
31002  return 0;
31003}
31004_ACEOF
31005if ac_fn_c_try_link "$LINENO"; then :
31006  ac_cv_lib_ksvc_main=yes
31007else
31008  ac_cv_lib_ksvc_main=no
31009fi
31010rm -f core conftest.err conftest.$ac_objext \
31011    conftest$ac_exeext conftest.$ac_ext
31012LIBS=$ac_check_lib_save_LIBS
31013fi
31014{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ksvc_main" >&5
31015$as_echo "$ac_cv_lib_ksvc_main" >&6; }
31016if test "x$ac_cv_lib_ksvc_main" = xyes; then :
31017  cat >>confdefs.h <<_ACEOF
31018#define HAVE_LIBKSVC 1
31019_ACEOF
31020
31021  LIBS="-lksvc $LIBS"
31022
31023fi
31024
31025   fi
31026
31027   if test `echo $LIBS | grep -c com_err` -ne 0 -a x"$ac_com_error_message" = xyes; then
31028      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_message in -lcom_err" >&5
31029$as_echo_n "checking for error_message in -lcom_err... " >&6; }
31030if ${ac_cv_lib_com_err_error_message+:} false; then :
31031  $as_echo_n "(cached) " >&6
31032else
31033  ac_check_lib_save_LIBS=$LIBS
31034LIBS="-lcom_err  $LIBS"
31035cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31036/* end confdefs.h.  */
31037
31038/* Override any GCC internal prototype to avoid an error.
31039   Use char because int might match the return type of a GCC
31040   builtin and then its argument prototype would still apply.  */
31041#ifdef __cplusplus
31042extern "C"
31043#endif
31044char error_message ();
31045int
31046main ()
31047{
31048return error_message ();
31049  ;
31050  return 0;
31051}
31052_ACEOF
31053if ac_fn_c_try_link "$LINENO"; then :
31054  ac_cv_lib_com_err_error_message=yes
31055else
31056  ac_cv_lib_com_err_error_message=no
31057fi
31058rm -f core conftest.err conftest.$ac_objext \
31059    conftest$ac_exeext conftest.$ac_ext
31060LIBS=$ac_check_lib_save_LIBS
31061fi
31062{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_com_err_error_message" >&5
31063$as_echo "$ac_cv_lib_com_err_error_message" >&6; }
31064if test "x$ac_cv_lib_com_err_error_message" = xyes; then :
31065
31066$as_echo "#define HAVE_ERROR_MESSAGE 1" >>confdefs.h
31067
31068fi
31069
31070   elif test x"${ac_com_error_message}" = xyes; then
31071      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_message in -lkrb5" >&5
31072$as_echo_n "checking for error_message in -lkrb5... " >&6; }
31073if ${ac_cv_lib_krb5_error_message+:} false; then :
31074  $as_echo_n "(cached) " >&6
31075else
31076  ac_check_lib_save_LIBS=$LIBS
31077LIBS="-lkrb5  $LIBS"
31078cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31079/* end confdefs.h.  */
31080
31081/* Override any GCC internal prototype to avoid an error.
31082   Use char because int might match the return type of a GCC
31083   builtin and then its argument prototype would still apply.  */
31084#ifdef __cplusplus
31085extern "C"
31086#endif
31087char error_message ();
31088int
31089main ()
31090{
31091return error_message ();
31092  ;
31093  return 0;
31094}
31095_ACEOF
31096if ac_fn_c_try_link "$LINENO"; then :
31097  ac_cv_lib_krb5_error_message=yes
31098else
31099  ac_cv_lib_krb5_error_message=no
31100fi
31101rm -f core conftest.err conftest.$ac_objext \
31102    conftest$ac_exeext conftest.$ac_ext
31103LIBS=$ac_check_lib_save_LIBS
31104fi
31105{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_error_message" >&5
31106$as_echo "$ac_cv_lib_krb5_error_message" >&6; }
31107if test "x$ac_cv_lib_krb5_error_message" = xyes; then :
31108
31109$as_echo "#define HAVE_ERROR_MESSAGE 1" >>confdefs.h
31110
31111fi
31112
31113   fi
31114
31115   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_err_text in -lkrb5" >&5
31116$as_echo_n "checking for krb5_get_err_text in -lkrb5... " >&6; }
31117if ${ac_cv_lib_krb5_krb5_get_err_text+:} false; then :
31118  $as_echo_n "(cached) " >&6
31119else
31120  ac_check_lib_save_LIBS=$LIBS
31121LIBS="-lkrb5  $LIBS"
31122cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31123/* end confdefs.h.  */
31124
31125/* Override any GCC internal prototype to avoid an error.
31126   Use char because int might match the return type of a GCC
31127   builtin and then its argument prototype would still apply.  */
31128#ifdef __cplusplus
31129extern "C"
31130#endif
31131char krb5_get_err_text ();
31132int
31133main ()
31134{
31135return krb5_get_err_text ();
31136  ;
31137  return 0;
31138}
31139_ACEOF
31140if ac_fn_c_try_link "$LINENO"; then :
31141  ac_cv_lib_krb5_krb5_get_err_text=yes
31142else
31143  ac_cv_lib_krb5_krb5_get_err_text=no
31144fi
31145rm -f core conftest.err conftest.$ac_objext \
31146    conftest$ac_exeext conftest.$ac_ext
31147LIBS=$ac_check_lib_save_LIBS
31148fi
31149{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_get_err_text" >&5
31150$as_echo "$ac_cv_lib_krb5_krb5_get_err_text" >&6; }
31151if test "x$ac_cv_lib_krb5_krb5_get_err_text" = xyes; then :
31152
31153$as_echo "#define HAVE_KRB5_GET_ERR_TEXT 1" >>confdefs.h
31154
31155fi
31156
31157   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_error_message in -lkrb5" >&5
31158$as_echo_n "checking for krb5_get_error_message in -lkrb5... " >&6; }
31159if ${ac_cv_lib_krb5_krb5_get_error_message+:} false; then :
31160  $as_echo_n "(cached) " >&6
31161else
31162  ac_check_lib_save_LIBS=$LIBS
31163LIBS="-lkrb5  $LIBS"
31164cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31165/* end confdefs.h.  */
31166
31167/* Override any GCC internal prototype to avoid an error.
31168   Use char because int might match the return type of a GCC
31169   builtin and then its argument prototype would still apply.  */
31170#ifdef __cplusplus
31171extern "C"
31172#endif
31173char krb5_get_error_message ();
31174int
31175main ()
31176{
31177return krb5_get_error_message ();
31178  ;
31179  return 0;
31180}
31181_ACEOF
31182if ac_fn_c_try_link "$LINENO"; then :
31183  ac_cv_lib_krb5_krb5_get_error_message=yes
31184else
31185  ac_cv_lib_krb5_krb5_get_error_message=no
31186fi
31187rm -f core conftest.err conftest.$ac_objext \
31188    conftest$ac_exeext conftest.$ac_ext
31189LIBS=$ac_check_lib_save_LIBS
31190fi
31191{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_get_error_message" >&5
31192$as_echo "$ac_cv_lib_krb5_krb5_get_error_message" >&6; }
31193if test "x$ac_cv_lib_krb5_krb5_get_error_message" = xyes; then :
31194
31195$as_echo "#define HAVE_KRB5_GET_ERROR_MESSAGE 1" >>confdefs.h
31196
31197fi
31198
31199
31200  if test x"$PAC" != xno; then
31201     ac_fn_c_check_type "$LINENO" "krb5_pac" "ac_cv_type_krb5_pac" "
31202#if HAVE_KRB5_H
31203#include <krb5.h>
31204#elif HAVE_KERBEROSV5_KRB5_H
31205#include <kerberosv5/krb5.h>
31206#endif /* HAVE_KERBEROSV5_KRB5_H */
31207
31208"
31209if test "x$ac_cv_type_krb5_pac" = xyes; then :
31210
31211$as_echo "#define HAVE_KRB5_PAC 1" >>confdefs.h
31212
31213fi
31214
31215
31216     #relies on gssapi.m4 having being run
31217     { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environment is usable for pac" >&5
31218$as_echo_n "checking if environment is usable for pac... " >&6; }
31219     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31220/* end confdefs.h.  */
31221
31222#include <sys/types.h>
31223#if HAVE_GSSKRB5_EXTRACT_AUTHZ_DATA_FROM_SEC_CONTEXT && HAVE_HEIMDAL_KERBEROS && HAVE_KRB5_PAC
31224yes
31225#elif HAVE_GSS_MAP_NAME_TO_ANY && !HAVE_HEIMDAL_KERBEROS && HAVE_KRB5_PAC
31226yes
31227#endif /* HAVE_GSS_MAP_NAME_TO_ANY && !HAVE_HEIMDAL_KERBEROS && HAVE_KRB5_PAC */
31228
31229_ACEOF
31230if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
31231  $EGREP "yes" >/dev/null 2>&1; then :
31232  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31233$as_echo "yes" >&6; }
31234       unset no_pac
31235else
31236  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31237$as_echo "no" >&6; }
31238fi
31239rm -f conftest*
31240
31241   else
31242      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, disabled" >&5
31243$as_echo "no, disabled" >&6; }
31244   fi
31245
31246      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working krb5" >&5
31247$as_echo_n "checking for working krb5... " >&6; }
31248   if test "$cross_compiling" = yes; then :
31249      unset no_krb5
31250
31251$as_echo "#define HAVE_KRB5 1" >>confdefs.h
31252
31253    { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming yes" >&5
31254$as_echo "assuming yes" >&6; }
31255else
31256  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31257/* end confdefs.h.  */
31258
31259#if HAVE_KRB5_H
31260#include <krb5.h>
31261#elif HAVE_KERBEROSV5_KRB5_H
31262#include <kerberosv5/krb5.h>
31263#endif /* HAVE_KERBEROSV5_KRB5_H */
31264
31265int
31266main(void)
31267{
31268        krb5_context context;
31269
31270        krb5_init_context(&context);
31271
31272       return 0;
31273}
31274
31275_ACEOF
31276if ac_fn_c_try_run "$LINENO"; then :
31277  unset no_krb5
31278
31279$as_echo "#define HAVE_KRB5 1" >>confdefs.h
31280
31281    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31282$as_echo "yes" >&6; }
31283else
31284  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31285$as_echo "no" >&6; }
31286fi
31287rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31288  conftest.$ac_objext conftest.beam conftest.$ac_ext
31289fi
31290
31291
31292   ac_fn_c_check_decl "$LINENO" "krb5_kt_free_entry" "ac_cv_have_decl_krb5_kt_free_entry" "
31293#if HAVE_KRB5_H
31294#include <krb5.h>
31295#elif HAVE_KERBEROSV5_KRB5_H
31296#include <kerberosv5/krb5.h>
31297#endif /* HAVE_KERBEROSV5_KRB5_H */
31298
31299"
31300if test "x$ac_cv_have_decl_krb5_kt_free_entry" = xyes; then :
31301  ac_have_decl=1
31302else
31303  ac_have_decl=0
31304fi
31305
31306cat >>confdefs.h <<_ACEOF
31307#define HAVE_DECL_KRB5_KT_FREE_ENTRY $ac_have_decl
31308_ACEOF
31309
31310   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_kt_free_entry in -lkrb5" >&5
31311$as_echo_n "checking for krb5_kt_free_entry in -lkrb5... " >&6; }
31312if ${ac_cv_lib_krb5_krb5_kt_free_entry+:} false; then :
31313  $as_echo_n "(cached) " >&6
31314else
31315  ac_check_lib_save_LIBS=$LIBS
31316LIBS="-lkrb5  $LIBS"
31317cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31318/* end confdefs.h.  */
31319
31320/* Override any GCC internal prototype to avoid an error.
31321   Use char because int might match the return type of a GCC
31322   builtin and then its argument prototype would still apply.  */
31323#ifdef __cplusplus
31324extern "C"
31325#endif
31326char krb5_kt_free_entry ();
31327int
31328main ()
31329{
31330return krb5_kt_free_entry ();
31331  ;
31332  return 0;
31333}
31334_ACEOF
31335if ac_fn_c_try_link "$LINENO"; then :
31336  ac_cv_lib_krb5_krb5_kt_free_entry=yes
31337else
31338  ac_cv_lib_krb5_krb5_kt_free_entry=no
31339fi
31340rm -f core conftest.err conftest.$ac_objext \
31341    conftest$ac_exeext conftest.$ac_ext
31342LIBS=$ac_check_lib_save_LIBS
31343fi
31344{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_kt_free_entry" >&5
31345$as_echo "$ac_cv_lib_krb5_krb5_kt_free_entry" >&6; }
31346if test "x$ac_cv_lib_krb5_krb5_kt_free_entry" = xyes; then :
31347
31348$as_echo "#define HAVE_KRB5_KT_FREE_ENTRY 1" >>confdefs.h
31349
31350fi
31351
31352   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_keytab in -lkrb5" >&5
31353$as_echo_n "checking for krb5_get_init_creds_keytab in -lkrb5... " >&6; }
31354if ${ac_cv_lib_krb5_krb5_get_init_creds_keytab+:} false; then :
31355  $as_echo_n "(cached) " >&6
31356else
31357  ac_check_lib_save_LIBS=$LIBS
31358LIBS="-lkrb5  $LIBS"
31359cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31360/* end confdefs.h.  */
31361
31362/* Override any GCC internal prototype to avoid an error.
31363   Use char because int might match the return type of a GCC
31364   builtin and then its argument prototype would still apply.  */
31365#ifdef __cplusplus
31366extern "C"
31367#endif
31368char krb5_get_init_creds_keytab ();
31369int
31370main ()
31371{
31372return krb5_get_init_creds_keytab ();
31373  ;
31374  return 0;
31375}
31376_ACEOF
31377if ac_fn_c_try_link "$LINENO"; then :
31378  ac_cv_lib_krb5_krb5_get_init_creds_keytab=yes
31379else
31380  ac_cv_lib_krb5_krb5_get_init_creds_keytab=no
31381fi
31382rm -f core conftest.err conftest.$ac_objext \
31383    conftest$ac_exeext conftest.$ac_ext
31384LIBS=$ac_check_lib_save_LIBS
31385fi
31386{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_get_init_creds_keytab" >&5
31387$as_echo "$ac_cv_lib_krb5_krb5_get_init_creds_keytab" >&6; }
31388if test "x$ac_cv_lib_krb5_krb5_get_init_creds_keytab" = xyes; then :
31389
31390$as_echo "#define HAVE_GET_INIT_CREDS_KEYTAB 1" >>confdefs.h
31391
31392fi
31393
31394   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_opt_alloc in -lkrb5" >&5
31395$as_echo_n "checking for krb5_get_init_creds_opt_alloc in -lkrb5... " >&6; }
31396if ${ac_cv_lib_krb5_krb5_get_init_creds_opt_alloc+:} false; then :
31397  $as_echo_n "(cached) " >&6
31398else
31399  ac_check_lib_save_LIBS=$LIBS
31400LIBS="-lkrb5  $LIBS"
31401cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31402/* end confdefs.h.  */
31403
31404/* Override any GCC internal prototype to avoid an error.
31405   Use char because int might match the return type of a GCC
31406   builtin and then its argument prototype would still apply.  */
31407#ifdef __cplusplus
31408extern "C"
31409#endif
31410char krb5_get_init_creds_opt_alloc ();
31411int
31412main ()
31413{
31414return krb5_get_init_creds_opt_alloc ();
31415  ;
31416  return 0;
31417}
31418_ACEOF
31419if ac_fn_c_try_link "$LINENO"; then :
31420  ac_cv_lib_krb5_krb5_get_init_creds_opt_alloc=yes
31421else
31422  ac_cv_lib_krb5_krb5_get_init_creds_opt_alloc=no
31423fi
31424rm -f core conftest.err conftest.$ac_objext \
31425    conftest$ac_exeext conftest.$ac_ext
31426LIBS=$ac_check_lib_save_LIBS
31427fi
31428{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_krb5_krb5_get_init_creds_opt_alloc" >&5
31429$as_echo "$ac_cv_lib_krb5_krb5_get_init_creds_opt_alloc" >&6; }
31430if test "x$ac_cv_lib_krb5_krb5_get_init_creds_opt_alloc" = xyes; then :
31431
31432$as_echo "#define HAVE_GET_INIT_CREDS_OPT_ALLOC 1" >>confdefs.h
31433
31434fi
31435
31436
31437   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for krb5_get_init_creds_opt_free with krb5 context " >&5
31438$as_echo_n "checking for krb5_get_init_creds_opt_free with krb5 context ... " >&6; }
31439cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31440/* end confdefs.h.  */
31441
31442#if HAVE_KRB5_H
31443#include <krb5.h>
31444#elif HAVE_KERBEROSV5_KRB5_H
31445#include <kerberosv5/krb5.h>
31446#endif /* HAVE_KERBEROSV5_KRB5_H */
31447
31448int
31449main ()
31450{
31451
31452krb5_context context;
31453krb5_get_init_creds_opt options;
31454krb5_get_init_creds_opt_free(context, &options);
31455
31456  ;
31457  return 0;
31458}
31459_ACEOF
31460if ac_fn_c_try_compile "$LINENO"; then :
31461  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31462$as_echo "yes" >&6; }
31463
31464$as_echo "#define HAVE_GET_INIT_CREDS_OPT_FREE_CTX 1" >>confdefs.h
31465
31466else
31467  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31468$as_echo "no" >&6; }
31469fi
31470rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
31471
31472   case $host in
31473    *-*-solaris*)
31474              { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: disabling Kerberos memory cache on this platform" >&5
31475$as_echo "$as_me: WARNING: disabling Kerberos memory cache on this platform" >&2;}
31476       ;;
31477    *)
31478       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MEMORY cache" >&5
31479$as_echo_n "checking for MEMORY cache... " >&6; }
31480       if test "$cross_compiling" = yes; then :
31481  	 true
31482else
31483  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31484/* end confdefs.h.  */
31485
31486#if HAVE_KRB5_H
31487#include <krb5.h>
31488#elif HAVE_KERBEROSV5_KRB5_H
31489#include <kerberosv5/krb5.h>
31490#endif /* HAVE_KERBEROSV5_KRB5_H */
31491
31492main()
31493{
31494    krb5_context context;
31495    krb5_ccache cc;
31496
31497    krb5_init_context(&context);
31498    return krb5_cc_resolve(context, "MEMORY:test_cache", &cc);
31499}
31500_ACEOF
31501if ac_fn_c_try_run "$LINENO"; then :
31502
31503$as_echo "#define HAVE_KRB5_MEMORY_CACHE 1" >>confdefs.h
31504
31505         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31506$as_echo "yes" >&6; }
31507else
31508  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31509$as_echo "no" >&6; }
31510fi
31511rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31512  conftest.$ac_objext conftest.beam conftest.$ac_ext
31513fi
31514
31515	;;
31516   esac
31517
31518   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MEMORY keytab" >&5
31519$as_echo_n "checking for MEMORY keytab... " >&6; }
31520   if test "$cross_compiling" = yes; then :
31521     true
31522else
31523  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31524/* end confdefs.h.  */
31525
31526#if HAVE_KRB5_H
31527#include <krb5.h>
31528#elif HAVE_KERBEROSV5_KRB5_H
31529#include <kerberosv5/krb5.h>
31530#endif /* HAVE_KERBEROSV5_KRB5_H */
31531
31532main()
31533{
31534    krb5_context context;
31535    krb5_keytab kt;
31536
31537    krb5_init_context(&context);
31538    return krb5_kt_resolve(context, "MEMORY:test_keytab", &kt);
31539}
31540_ACEOF
31541if ac_fn_c_try_run "$LINENO"; then :
31542
31543$as_echo "#define HAVE_KRB5_MEMORY_KEYTAB 1" >>confdefs.h
31544
31545    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
31546$as_echo "yes" >&6; }
31547else
31548  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
31549$as_echo "no" >&6; }
31550fi
31551rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
31552  conftest.$ac_objext conftest.beam conftest.$ac_ext
31553fi
31554
31555fi
31556
31557   if test x"${no_krb5}" = xt; then
31558       noldap="KerberosV installation required"
31559       nopac="KerberosV installation required"
31560   else
31561       if test x"${no_pac}" = xt; then
31562          nopac="PAC support needed"
31563       fi
31564
31565
31566sasldir=/usr
31567
31568# Check whether --with-sasl was given.
31569if test "${with_sasl+set}" = set; then :
31570  withval=$with_sasl; SASL=$withval
31571fi
31572
31573
31574
31575# Check whether --with-sasl-path was given.
31576if test "${with_sasl_path+set}" = set; then :
31577  withval=$with_sasl_path; sasldir=$withval
31578fi
31579
31580
31581if test x"$SASL" != xno; then
31582   unset saslfail
31583
31584   if test x"$sasldir" != xno; then
31585      ac_sasl_cflags=-I$sasldir/include
31586      ac_sasl_libs=-L$sasldir/lib
31587   else
31588      ac_sasl_cflags=
31589      ac_sasl_libs=
31590   fi
31591
31592      if test x"${ac_sasl_cflags}" != x; then
31593      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$ac_sasl_cflags"
31594   fi
31595
31596      if test x"${ac_sasl_libs}" != x; then
31597      NPATH=`echo $ac_sasl_libs | xargs -n1 | egrep '^-L' | xargs echo`
31598      LDFLAGS="${LDFLAGS}${LDFLAGS:+ }$NPATH"
31599   fi
31600
31601      for ac_header in sasl.h sasl/sasl.h
31602do :
31603  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
31604ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
31605if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
31606  cat >>confdefs.h <<_ACEOF
31607#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
31608_ACEOF
31609
31610fi
31611
31612done
31613
31614
31615   case `uname` in
31616      Darwin) ac_lib_sav="$LIBS"
31617              { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lsasl2" >&5
31618$as_echo_n "checking for main in -lsasl2... " >&6; }
31619if ${ac_cv_lib_sasl2_main+:} false; then :
31620  $as_echo_n "(cached) " >&6
31621else
31622  ac_check_lib_save_LIBS=$LIBS
31623LIBS="-lsasl2  $LIBS"
31624cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31625/* end confdefs.h.  */
31626
31627
31628int
31629main ()
31630{
31631return main ();
31632  ;
31633  return 0;
31634}
31635_ACEOF
31636if ac_fn_c_try_link "$LINENO"; then :
31637  ac_cv_lib_sasl2_main=yes
31638else
31639  ac_cv_lib_sasl2_main=no
31640fi
31641rm -f core conftest.err conftest.$ac_objext \
31642    conftest$ac_exeext conftest.$ac_ext
31643LIBS=$ac_check_lib_save_LIBS
31644fi
31645{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sasl2_main" >&5
31646$as_echo "$ac_cv_lib_sasl2_main" >&6; }
31647if test "x$ac_cv_lib_sasl2_main" = xyes; then :
31648  cat >>confdefs.h <<_ACEOF
31649#define HAVE_LIBSASL2 1
31650_ACEOF
31651
31652  LIBS="-lsasl2 $LIBS"
31653
31654fi
31655
31656	      if test x"$LIBS" != x; then
31657                 LIBS="$ac_lib_sav"
31658              fi
31659              if test x"${ac_cv_lib_sasl2_main}" = yes; then
31660
31661$as_echo "#define HAVE_SASL_DARWIN 1" >>confdefs.h
31662
31663              fi
31664              ;;
31665   esac
31666
31667   if test x"${ac_cv_header_sasl_h}" = xyes ||
31668      test x"${ac_cv_header_sasl_sasl_h}" = xyes ||
31669      test x"${ac_cv_lib_sasl2_main}" = xyes; then
31670      unset no_sasl
31671
31672$as_echo "#define HAVE_SASL 1" >>confdefs.h
31673
31674   fi
31675fi
31676
31677       if test x"${no_sasl}" = xt; then
31678           noldap="SASL installation required"
31679       else
31680
31681ldapdir=/usr
31682
31683# Check whether --with-ldap was given.
31684if test "${with_ldap+set}" = set; then :
31685  withval=$with_ldap; LDAP=$withval
31686fi
31687
31688
31689
31690# Check whether --with-ldap-path was given.
31691if test "${with_ldap_path+set}" = set; then :
31692  withval=$with_ldap_path; ldapdir=$withval
31693fi
31694
31695
31696if test x"$LDAP" != xno; then
31697   unset ldapfail
31698
31699   if test x"$ldapdir" != xno; then
31700      ac_ldap_cflags=-I$ldapdir/include
31701      ac_ldap_libs=-L$ldapdir/lib
31702   else
31703      ac_ldap_cflags=
31704      ac_ldap_libs=
31705   fi
31706
31707      if test x"${ac_ldap_cflags}" != x; then
31708      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$ac_ldap_cflags"
31709   fi
31710
31711      if test x"${ac_ldap_libs}" != x; then
31712      NPATH=`echo $ac_ldap_libs | xargs -n1 | egrep '^-L' | xargs echo`
31713      LDFLAGS="${LDFLAGS}${LDFLAGS:+ }$NPATH"
31714   fi
31715
31716      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lresolv" >&5
31717$as_echo_n "checking for main in -lresolv... " >&6; }
31718if ${ac_cv_lib_resolv_main+:} false; then :
31719  $as_echo_n "(cached) " >&6
31720else
31721  ac_check_lib_save_LIBS=$LIBS
31722LIBS="-lresolv  $LIBS"
31723cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31724/* end confdefs.h.  */
31725
31726
31727int
31728main ()
31729{
31730return main ();
31731  ;
31732  return 0;
31733}
31734_ACEOF
31735if ac_fn_c_try_link "$LINENO"; then :
31736  ac_cv_lib_resolv_main=yes
31737else
31738  ac_cv_lib_resolv_main=no
31739fi
31740rm -f core conftest.err conftest.$ac_objext \
31741    conftest$ac_exeext conftest.$ac_ext
31742LIBS=$ac_check_lib_save_LIBS
31743fi
31744{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_main" >&5
31745$as_echo "$ac_cv_lib_resolv_main" >&6; }
31746if test "x$ac_cv_lib_resolv_main" = xyes; then :
31747  cat >>confdefs.h <<_ACEOF
31748#define HAVE_LIBRESOLV 1
31749_ACEOF
31750
31751  LIBS="-lresolv $LIBS"
31752
31753fi
31754
31755
31756      for ac_header in ldap.h
31757do :
31758  ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default"
31759if test "x$ac_cv_header_ldap_h" = xyes; then :
31760  cat >>confdefs.h <<_ACEOF
31761#define HAVE_LDAP_H 1
31762_ACEOF
31763
31764fi
31765
31766done
31767
31768   for ac_header in mozldap/ldap.h
31769do :
31770  ac_fn_c_check_header_mongrel "$LINENO" "mozldap/ldap.h" "ac_cv_header_mozldap_ldap_h" "$ac_includes_default"
31771if test "x$ac_cv_header_mozldap_ldap_h" = xyes; then :
31772  cat >>confdefs.h <<_ACEOF
31773#define HAVE_MOZLDAP_LDAP_H 1
31774_ACEOF
31775
31776fi
31777
31778done
31779
31780
31781   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lldap" >&5
31782$as_echo_n "checking for main in -lldap... " >&6; }
31783if ${ac_cv_lib_ldap_main+:} false; then :
31784  $as_echo_n "(cached) " >&6
31785else
31786  ac_check_lib_save_LIBS=$LIBS
31787LIBS="-lldap  $LIBS"
31788cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31789/* end confdefs.h.  */
31790
31791
31792int
31793main ()
31794{
31795return main ();
31796  ;
31797  return 0;
31798}
31799_ACEOF
31800if ac_fn_c_try_link "$LINENO"; then :
31801  ac_cv_lib_ldap_main=yes
31802else
31803  ac_cv_lib_ldap_main=no
31804fi
31805rm -f core conftest.err conftest.$ac_objext \
31806    conftest$ac_exeext conftest.$ac_ext
31807LIBS=$ac_check_lib_save_LIBS
31808fi
31809{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_main" >&5
31810$as_echo "$ac_cv_lib_ldap_main" >&6; }
31811if test "x$ac_cv_lib_ldap_main" = xyes; then :
31812  cat >>confdefs.h <<_ACEOF
31813#define HAVE_LIBLDAP 1
31814_ACEOF
31815
31816  LIBS="-lldap $LIBS"
31817
31818fi
31819
31820   if test x"${ac_cv_lib_ldap_main}" != xyes; then
31821     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpthread" >&5
31822$as_echo_n "checking for main in -lpthread... " >&6; }
31823if ${ac_cv_lib_pthread_main+:} false; then :
31824  $as_echo_n "(cached) " >&6
31825else
31826  ac_check_lib_save_LIBS=$LIBS
31827LIBS="-lpthread  $LIBS"
31828cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31829/* end confdefs.h.  */
31830
31831
31832int
31833main ()
31834{
31835return main ();
31836  ;
31837  return 0;
31838}
31839_ACEOF
31840if ac_fn_c_try_link "$LINENO"; then :
31841  ac_cv_lib_pthread_main=yes
31842else
31843  ac_cv_lib_pthread_main=no
31844fi
31845rm -f core conftest.err conftest.$ac_objext \
31846    conftest$ac_exeext conftest.$ac_ext
31847LIBS=$ac_check_lib_save_LIBS
31848fi
31849{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_main" >&5
31850$as_echo "$ac_cv_lib_pthread_main" >&6; }
31851if test "x$ac_cv_lib_pthread_main" = xyes; then :
31852  cat >>confdefs.h <<_ACEOF
31853#define HAVE_LIBPTHREAD 1
31854_ACEOF
31855
31856  LIBS="-lpthread $LIBS"
31857
31858fi
31859
31860     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lldap60" >&5
31861$as_echo_n "checking for main in -lldap60... " >&6; }
31862if ${ac_cv_lib_ldap60_main+:} false; then :
31863  $as_echo_n "(cached) " >&6
31864else
31865  ac_check_lib_save_LIBS=$LIBS
31866LIBS="-lldap60  $LIBS"
31867cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31868/* end confdefs.h.  */
31869
31870
31871int
31872main ()
31873{
31874return main ();
31875  ;
31876  return 0;
31877}
31878_ACEOF
31879if ac_fn_c_try_link "$LINENO"; then :
31880  ac_cv_lib_ldap60_main=yes
31881else
31882  ac_cv_lib_ldap60_main=no
31883fi
31884rm -f core conftest.err conftest.$ac_objext \
31885    conftest$ac_exeext conftest.$ac_ext
31886LIBS=$ac_check_lib_save_LIBS
31887fi
31888{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap60_main" >&5
31889$as_echo "$ac_cv_lib_ldap60_main" >&6; }
31890if test "x$ac_cv_lib_ldap60_main" = xyes; then :
31891  cat >>confdefs.h <<_ACEOF
31892#define HAVE_LIBLDAP60 1
31893_ACEOF
31894
31895  LIBS="-lldap60 $LIBS"
31896
31897fi
31898
31899     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lprldap60" >&5
31900$as_echo_n "checking for main in -lprldap60... " >&6; }
31901if ${ac_cv_lib_prldap60_main+:} false; then :
31902  $as_echo_n "(cached) " >&6
31903else
31904  ac_check_lib_save_LIBS=$LIBS
31905LIBS="-lprldap60  $LIBS"
31906cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31907/* end confdefs.h.  */
31908
31909
31910int
31911main ()
31912{
31913return main ();
31914  ;
31915  return 0;
31916}
31917_ACEOF
31918if ac_fn_c_try_link "$LINENO"; then :
31919  ac_cv_lib_prldap60_main=yes
31920else
31921  ac_cv_lib_prldap60_main=no
31922fi
31923rm -f core conftest.err conftest.$ac_objext \
31924    conftest$ac_exeext conftest.$ac_ext
31925LIBS=$ac_check_lib_save_LIBS
31926fi
31927{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_prldap60_main" >&5
31928$as_echo "$ac_cv_lib_prldap60_main" >&6; }
31929if test "x$ac_cv_lib_prldap60_main" = xyes; then :
31930  cat >>confdefs.h <<_ACEOF
31931#define HAVE_LIBPRLDAP60 1
31932_ACEOF
31933
31934  LIBS="-lprldap60 $LIBS"
31935
31936fi
31937
31938     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lssldap60" >&5
31939$as_echo_n "checking for main in -lssldap60... " >&6; }
31940if ${ac_cv_lib_ssldap60_main+:} false; then :
31941  $as_echo_n "(cached) " >&6
31942else
31943  ac_check_lib_save_LIBS=$LIBS
31944LIBS="-lssldap60  $LIBS"
31945cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31946/* end confdefs.h.  */
31947
31948
31949int
31950main ()
31951{
31952return main ();
31953  ;
31954  return 0;
31955}
31956_ACEOF
31957if ac_fn_c_try_link "$LINENO"; then :
31958  ac_cv_lib_ssldap60_main=yes
31959else
31960  ac_cv_lib_ssldap60_main=no
31961fi
31962rm -f core conftest.err conftest.$ac_objext \
31963    conftest$ac_exeext conftest.$ac_ext
31964LIBS=$ac_check_lib_save_LIBS
31965fi
31966{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssldap60_main" >&5
31967$as_echo "$ac_cv_lib_ssldap60_main" >&6; }
31968if test "x$ac_cv_lib_ssldap60_main" = xyes; then :
31969  cat >>confdefs.h <<_ACEOF
31970#define HAVE_LIBSSLDAP60 1
31971_ACEOF
31972
31973  LIBS="-lssldap60 $LIBS"
31974
31975fi
31976
31977   fi
31978
31979      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ldap" >&5
31980$as_echo_n "checking for working ldap... " >&6; }
31981   if test "$cross_compiling" = yes; then :
31982  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
31983$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
31984as_fn_error $? "cannot run test program while cross compiling
31985See \`config.log' for more details" "$LINENO" 5; }
31986else
31987  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
31988/* end confdefs.h.  */
31989
31990#if HAVE_LDAP_H
31991#include <ldap.h>
31992#elif HAVE_MOZLDAP_LDAP_H
31993#include <mozldap/ldap.h>
31994#endif
31995
31996int
31997main(void)
31998{
31999       char *host="";
32000       int port;
32001
32002       ldap_init(host, port);
32003
32004       return 0;
32005}
32006_ACEOF
32007if ac_fn_c_try_run "$LINENO"; then :
32008  unset no_ldap
32009   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32010$as_echo "yes" >&6; }
32011else
32012  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32013$as_echo "no" >&6; }
32014fi
32015rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32016  conftest.$ac_objext conftest.beam conftest.$ac_ext
32017fi
32018
32019
32020   unset ldap_openldap
32021   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenLDAP" >&5
32022$as_echo_n "checking for OpenLDAP... " >&6; }
32023   if test "$cross_compiling" = yes; then :
32024  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
32025$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
32026as_fn_error $? "cannot run test program while cross compiling
32027See \`config.log' for more details" "$LINENO" 5; }
32028else
32029  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32030/* end confdefs.h.  */
32031
32032#if HAVE_LDAP_H
32033#include <ldap.h>
32034#endif
32035#include <string.h>
32036
32037int
32038main(void)
32039{
32040   return strcmp(LDAP_VENDOR_NAME, "OpenLDAP");
32041}
32042
32043_ACEOF
32044if ac_fn_c_try_run "$LINENO"; then :
32045
32046$as_echo "#define HAVE_OPENLDAP 1" >>confdefs.h
32047
32048   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32049$as_echo "yes" >&6; }
32050   ldap_openldap=t
32051else
32052  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32053$as_echo "no" >&6; }
32054fi
32055rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32056  conftest.$ac_objext conftest.beam conftest.$ac_ext
32057fi
32058
32059
32060   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Sun LDAP SDK" >&5
32061$as_echo_n "checking for Sun LDAP SDK... " >&6; }
32062   if test "$cross_compiling" = yes; then :
32063  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
32064$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
32065as_fn_error $? "cannot run test program while cross compiling
32066See \`config.log' for more details" "$LINENO" 5; }
32067else
32068  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32069/* end confdefs.h.  */
32070
32071#if HAVE_LDAP_H
32072#include <ldap.h>
32073#endif
32074#include <string.h>
32075
32076int
32077main(void)
32078{
32079   return strcmp(LDAP_VENDOR_NAME, "Sun Microsystems Inc.");
32080}
32081_ACEOF
32082if ac_fn_c_try_run "$LINENO"; then :
32083
32084$as_echo "#define HAVE_SUN_LDAP_SDK 1" >>confdefs.h
32085
32086   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32087$as_echo "yes" >&6; }
32088else
32089  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32090$as_echo "no" >&6; }
32091fi
32092rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32093  conftest.$ac_objext conftest.beam conftest.$ac_ext
32094fi
32095
32096
32097   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mozilla LDAP SDK" >&5
32098$as_echo_n "checking for Mozilla LDAP SDK... " >&6; }
32099   if test "$cross_compiling" = yes; then :
32100  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
32101$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
32102as_fn_error $? "cannot run test program while cross compiling
32103See \`config.log' for more details" "$LINENO" 5; }
32104else
32105  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32106/* end confdefs.h.  */
32107
32108#if HAVE_LDAP_H
32109#include <ldap.h>
32110#elif HAVE_MOZLDAP_LDAP_H
32111#include <mozldap/ldap.h>
32112#endif
32113#include <string.h>
32114
32115int
32116main(void)
32117{
32118   return strcmp(LDAP_VENDOR_NAME, "mozilla.org");
32119}
32120_ACEOF
32121if ac_fn_c_try_run "$LINENO"; then :
32122
32123$as_echo "#define HAVE_MOZILLA_LDAP_SDK 1" >>confdefs.h
32124
32125   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32126$as_echo "yes" >&6; }
32127else
32128  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32129$as_echo "no" >&6; }
32130fi
32131rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32132  conftest.$ac_objext conftest.beam conftest.$ac_ext
32133fi
32134
32135
32136   if test x"${ldap_openldap}" != x; then
32137      for ac_header in lber.h
32138do :
32139  ac_fn_c_check_header_mongrel "$LINENO" "lber.h" "ac_cv_header_lber_h" "$ac_includes_default"
32140if test "x$ac_cv_header_lber_h" = xyes; then :
32141  cat >>confdefs.h <<_ACEOF
32142#define HAVE_LBER_H 1
32143_ACEOF
32144
32145fi
32146
32147done
32148
32149      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -llber" >&5
32150$as_echo_n "checking for main in -llber... " >&6; }
32151if ${ac_cv_lib_lber_main+:} false; then :
32152  $as_echo_n "(cached) " >&6
32153else
32154  ac_check_lib_save_LIBS=$LIBS
32155LIBS="-llber  $LIBS"
32156cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32157/* end confdefs.h.  */
32158
32159
32160int
32161main ()
32162{
32163return main ();
32164  ;
32165  return 0;
32166}
32167_ACEOF
32168if ac_fn_c_try_link "$LINENO"; then :
32169  ac_cv_lib_lber_main=yes
32170else
32171  ac_cv_lib_lber_main=no
32172fi
32173rm -f core conftest.err conftest.$ac_objext \
32174    conftest$ac_exeext conftest.$ac_ext
32175LIBS=$ac_check_lib_save_LIBS
32176fi
32177{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lber_main" >&5
32178$as_echo "$ac_cv_lib_lber_main" >&6; }
32179if test "x$ac_cv_lib_lber_main" = xyes; then :
32180  cat >>confdefs.h <<_ACEOF
32181#define HAVE_LIBLBER 1
32182_ACEOF
32183
32184  LIBS="-llber $LIBS"
32185
32186fi
32187
32188   fi
32189
32190   if test x"${ac_cv_header_ldap_h}" = xyes; then
32191      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32192/* end confdefs.h.  */
32193#include <ldap.h>
32194
32195_ACEOF
32196if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
32197  $EGREP "LDAP_REBINDPROC_CALLBACK" >/dev/null 2>&1; then :
32198
32199$as_echo "#define HAVE_LDAP_REBINDPROC_CALLBACK 1" >>confdefs.h
32200
32201fi
32202rm -f conftest*
32203
32204   elif test x"${ac_cv_header_mozldap_ldap_h}" = xyes; then
32205      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32206/* end confdefs.h.  */
32207#include <mozldap/ldap.h>
32208
32209_ACEOF
32210if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
32211  $EGREP "LDAP_REBINDPROC_CALLBACK" >/dev/null 2>&1; then :
32212
32213$as_echo "#define HAVE_LDAP_REBINDPROC_CALLBACK 1" >>confdefs.h
32214
32215fi
32216rm -f conftest*
32217
32218   else
32219      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDAP_REBINDPROC_CALLBACK" >&5
32220$as_echo_n "checking for LDAP_REBINDPROC_CALLBACK... " >&6; }
32221
32222$as_echo "#define HAVE_LDAP_REBINDPROC_CALLBACK 0" >>confdefs.h
32223
32224      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32225$as_echo "no" >&6; }
32226   fi
32227   if test x"${ac_cv_header_ldap_h}" = xyes; then
32228      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32229/* end confdefs.h.  */
32230#include <ldap.h>
32231
32232_ACEOF
32233if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
32234  $EGREP "LDAP_REBIND_PROC" >/dev/null 2>&1; then :
32235
32236$as_echo "#define HAVE_LDAP_REBIND_PROC 1" >>confdefs.h
32237
32238fi
32239rm -f conftest*
32240
32241   elif test x"${ac_cv_header_mozldap_ldap_h}" = xyes; then
32242      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32243/* end confdefs.h.  */
32244#include <mozldap/ldap.h>
32245
32246_ACEOF
32247if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
32248  $EGREP "LDAP_REBIND_PROC" >/dev/null 2>&1; then :
32249
32250$as_echo "#define HAVE_LDAP_REBIND_PROC 1" >>confdefs.h
32251
32252fi
32253rm -f conftest*
32254
32255   else
32256      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDAP_REBIND_PROC" >&5
32257$as_echo_n "checking for LDAP_REBIND_PROC... " >&6; }
32258
32259$as_echo "#define HAVE_LDAP_REBIND_PROC 0" >>confdefs.h
32260
32261      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32262$as_echo "no" >&6; }
32263   fi
32264   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32265/* end confdefs.h.  */
32266#define LDAP_REFERRALS
32267#if HAVE_LDAP_H
32268#include <ldap.h>
32269#elif HAVE_MOZLDAP_LDAP_H
32270#include <mozldap/ldap.h>
32271#endif
32272
32273_ACEOF
32274if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
32275  $EGREP "LDAP_REBIND_FUNCTION" >/dev/null 2>&1; then :
32276
32277$as_echo "#define HAVE_LDAP_REBIND_FUNCTION 1" >>confdefs.h
32278
32279fi
32280rm -f conftest*
32281
32282
32283   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LDAP_SCOPE_DEFAULT" >&5
32284$as_echo_n "checking for LDAP_SCOPE_DEFAULT... " >&6; }
32285   if test "$cross_compiling" = yes; then :
32286  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
32287$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
32288as_fn_error $? "cannot run test program while cross compiling
32289See \`config.log' for more details" "$LINENO" 5; }
32290else
32291  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32292/* end confdefs.h.  */
32293
32294#if HAVE_LDAP_H
32295#include <ldap.h>
32296#elif HAVE_MOZLDAP_LDAP_H
32297#include <mozldap/ldap.h>
32298#endif
32299
32300int
32301main(void)
32302{
32303#ifdef LDAP_SCOPE_DEFAULT
32304        return 0;
32305#else
32306        return 1;
32307#endif
32308}
32309_ACEOF
32310if ac_fn_c_try_run "$LINENO"; then :
32311
32312$as_echo "#define HAVE_LDAP_SCOPE_DEFAULT 1" >>confdefs.h
32313
32314   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32315$as_echo "yes" >&6; }
32316else
32317  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32318$as_echo "no" >&6; }
32319fi
32320rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
32321  conftest.$ac_objext conftest.beam conftest.$ac_ext
32322fi
32323
32324
32325   ac_fn_c_check_member "$LINENO" "struct ldap_url_desc" "lud_scheme" "ac_cv_member_struct_ldap_url_desc_lud_scheme" "#if HAVE_LDAP_H
32326#include <ldap.h>
32327#elif HAVE_MOZLDAP_LDAP_H
32328#include <mozldap/ldap.h>
32329#endif
32330
32331"
32332if test "x$ac_cv_member_struct_ldap_url_desc_lud_scheme" = xyes; then :
32333
32334$as_echo "#define HAVE_LDAP_URL_LUD_SCHEME 1" >>confdefs.h
32335
32336fi
32337
32338
32339   if test x"${ac_cv_lib_ldap_main}" = xyes; then
32340      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -lldap" >&5
32341$as_echo_n "checking for ldapssl_client_init in -lldap... " >&6; }
32342if ${ac_cv_lib_ldap_ldapssl_client_init+:} false; then :
32343  $as_echo_n "(cached) " >&6
32344else
32345  ac_check_lib_save_LIBS=$LIBS
32346LIBS="-lldap  $LIBS"
32347cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32348/* end confdefs.h.  */
32349
32350/* Override any GCC internal prototype to avoid an error.
32351   Use char because int might match the return type of a GCC
32352   builtin and then its argument prototype would still apply.  */
32353#ifdef __cplusplus
32354extern "C"
32355#endif
32356char ldapssl_client_init ();
32357int
32358main ()
32359{
32360return ldapssl_client_init ();
32361  ;
32362  return 0;
32363}
32364_ACEOF
32365if ac_fn_c_try_link "$LINENO"; then :
32366  ac_cv_lib_ldap_ldapssl_client_init=yes
32367else
32368  ac_cv_lib_ldap_ldapssl_client_init=no
32369fi
32370rm -f core conftest.err conftest.$ac_objext \
32371    conftest$ac_exeext conftest.$ac_ext
32372LIBS=$ac_check_lib_save_LIBS
32373fi
32374{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldapssl_client_init" >&5
32375$as_echo "$ac_cv_lib_ldap_ldapssl_client_init" >&6; }
32376if test "x$ac_cv_lib_ldap_ldapssl_client_init" = xyes; then :
32377
32378$as_echo "#define HAVE_LDAPSSL_CLIENT_INIT 1" >>confdefs.h
32379
32380fi
32381
32382   elif test x"${ac_cv_lib_ssldap60_main}" = xyes; then
32383      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init in -lssldap60" >&5
32384$as_echo_n "checking for ldapssl_client_init in -lssldap60... " >&6; }
32385if ${ac_cv_lib_ssldap60_ldapssl_client_init+:} false; then :
32386  $as_echo_n "(cached) " >&6
32387else
32388  ac_check_lib_save_LIBS=$LIBS
32389LIBS="-lssldap60  $LIBS"
32390cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32391/* end confdefs.h.  */
32392
32393/* Override any GCC internal prototype to avoid an error.
32394   Use char because int might match the return type of a GCC
32395   builtin and then its argument prototype would still apply.  */
32396#ifdef __cplusplus
32397extern "C"
32398#endif
32399char ldapssl_client_init ();
32400int
32401main ()
32402{
32403return ldapssl_client_init ();
32404  ;
32405  return 0;
32406}
32407_ACEOF
32408if ac_fn_c_try_link "$LINENO"; then :
32409  ac_cv_lib_ssldap60_ldapssl_client_init=yes
32410else
32411  ac_cv_lib_ssldap60_ldapssl_client_init=no
32412fi
32413rm -f core conftest.err conftest.$ac_objext \
32414    conftest$ac_exeext conftest.$ac_ext
32415LIBS=$ac_check_lib_save_LIBS
32416fi
32417{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssldap60_ldapssl_client_init" >&5
32418$as_echo "$ac_cv_lib_ssldap60_ldapssl_client_init" >&6; }
32419if test "x$ac_cv_lib_ssldap60_ldapssl_client_init" = xyes; then :
32420
32421$as_echo "#define HAVE_LDAPSSL_CLIENT_INIT 1" >>confdefs.h
32422
32423fi
32424
32425   else
32426      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldapssl_client_init" >&5
32427$as_echo_n "checking for ldapssl_client_init... " >&6; }
32428
32429$as_echo "#define HAVE_LDAPSSL_CLIENT_INIT 0" >>confdefs.h
32430
32431      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32432$as_echo "no" >&6; }
32433   fi
32434   if test x"${ac_cv_lib_ldap_main}" = xyes; then
32435      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_url_desc2str in -lldap" >&5
32436$as_echo_n "checking for ldap_url_desc2str in -lldap... " >&6; }
32437if ${ac_cv_lib_ldap_ldap_url_desc2str+:} false; then :
32438  $as_echo_n "(cached) " >&6
32439else
32440  ac_check_lib_save_LIBS=$LIBS
32441LIBS="-lldap  $LIBS"
32442cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32443/* end confdefs.h.  */
32444
32445/* Override any GCC internal prototype to avoid an error.
32446   Use char because int might match the return type of a GCC
32447   builtin and then its argument prototype would still apply.  */
32448#ifdef __cplusplus
32449extern "C"
32450#endif
32451char ldap_url_desc2str ();
32452int
32453main ()
32454{
32455return ldap_url_desc2str ();
32456  ;
32457  return 0;
32458}
32459_ACEOF
32460if ac_fn_c_try_link "$LINENO"; then :
32461  ac_cv_lib_ldap_ldap_url_desc2str=yes
32462else
32463  ac_cv_lib_ldap_ldap_url_desc2str=no
32464fi
32465rm -f core conftest.err conftest.$ac_objext \
32466    conftest$ac_exeext conftest.$ac_ext
32467LIBS=$ac_check_lib_save_LIBS
32468fi
32469{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_url_desc2str" >&5
32470$as_echo "$ac_cv_lib_ldap_ldap_url_desc2str" >&6; }
32471if test "x$ac_cv_lib_ldap_ldap_url_desc2str" = xyes; then :
32472
32473$as_echo "#define HAVE_LDAP_URL_DESC2STR 1" >>confdefs.h
32474
32475fi
32476
32477   elif test x"${ac_cv_lib_ldap60_main}" = xyes; then
32478      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_url_desc2str in -lldap60" >&5
32479$as_echo_n "checking for ldap_url_desc2str in -lldap60... " >&6; }
32480if ${ac_cv_lib_ldap60_ldap_url_desc2str+:} false; then :
32481  $as_echo_n "(cached) " >&6
32482else
32483  ac_check_lib_save_LIBS=$LIBS
32484LIBS="-lldap60  $LIBS"
32485cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32486/* end confdefs.h.  */
32487
32488/* Override any GCC internal prototype to avoid an error.
32489   Use char because int might match the return type of a GCC
32490   builtin and then its argument prototype would still apply.  */
32491#ifdef __cplusplus
32492extern "C"
32493#endif
32494char ldap_url_desc2str ();
32495int
32496main ()
32497{
32498return ldap_url_desc2str ();
32499  ;
32500  return 0;
32501}
32502_ACEOF
32503if ac_fn_c_try_link "$LINENO"; then :
32504  ac_cv_lib_ldap60_ldap_url_desc2str=yes
32505else
32506  ac_cv_lib_ldap60_ldap_url_desc2str=no
32507fi
32508rm -f core conftest.err conftest.$ac_objext \
32509    conftest$ac_exeext conftest.$ac_ext
32510LIBS=$ac_check_lib_save_LIBS
32511fi
32512{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap60_ldap_url_desc2str" >&5
32513$as_echo "$ac_cv_lib_ldap60_ldap_url_desc2str" >&6; }
32514if test "x$ac_cv_lib_ldap60_ldap_url_desc2str" = xyes; then :
32515
32516$as_echo "#define HAVE_LDAP_URL_DESC2STR 1" >>confdefs.h
32517
32518fi
32519
32520   else
32521      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_url_desc2str" >&5
32522$as_echo_n "checking for ldap_url_desc2str... " >&6; }
32523
32524$as_echo "#define HAVE_LDAP_URL_DESC2STR 0" >>confdefs.h
32525
32526      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32527$as_echo "no" >&6; }
32528   fi
32529
32530   if test x"${ac_cv_lib_ldap_main}" = xyes; then
32531      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_url_parse in -lldap" >&5
32532$as_echo_n "checking for ldap_url_parse in -lldap... " >&6; }
32533if ${ac_cv_lib_ldap_ldap_url_parse+:} false; then :
32534  $as_echo_n "(cached) " >&6
32535else
32536  ac_check_lib_save_LIBS=$LIBS
32537LIBS="-lldap  $LIBS"
32538cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32539/* end confdefs.h.  */
32540
32541/* Override any GCC internal prototype to avoid an error.
32542   Use char because int might match the return type of a GCC
32543   builtin and then its argument prototype would still apply.  */
32544#ifdef __cplusplus
32545extern "C"
32546#endif
32547char ldap_url_parse ();
32548int
32549main ()
32550{
32551return ldap_url_parse ();
32552  ;
32553  return 0;
32554}
32555_ACEOF
32556if ac_fn_c_try_link "$LINENO"; then :
32557  ac_cv_lib_ldap_ldap_url_parse=yes
32558else
32559  ac_cv_lib_ldap_ldap_url_parse=no
32560fi
32561rm -f core conftest.err conftest.$ac_objext \
32562    conftest$ac_exeext conftest.$ac_ext
32563LIBS=$ac_check_lib_save_LIBS
32564fi
32565{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_url_parse" >&5
32566$as_echo "$ac_cv_lib_ldap_ldap_url_parse" >&6; }
32567if test "x$ac_cv_lib_ldap_ldap_url_parse" = xyes; then :
32568
32569$as_echo "#define HAVE_LDAP_URL_PARSE 1" >>confdefs.h
32570
32571fi
32572
32573   elif test x"${ac_cv_lib_ldap60_main}" = xyes; then
32574      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_url_parse in -lldap60" >&5
32575$as_echo_n "checking for ldap_url_parse in -lldap60... " >&6; }
32576if ${ac_cv_lib_ldap60_ldap_url_parse+:} false; then :
32577  $as_echo_n "(cached) " >&6
32578else
32579  ac_check_lib_save_LIBS=$LIBS
32580LIBS="-lldap60  $LIBS"
32581cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32582/* end confdefs.h.  */
32583
32584/* Override any GCC internal prototype to avoid an error.
32585   Use char because int might match the return type of a GCC
32586   builtin and then its argument prototype would still apply.  */
32587#ifdef __cplusplus
32588extern "C"
32589#endif
32590char ldap_url_parse ();
32591int
32592main ()
32593{
32594return ldap_url_parse ();
32595  ;
32596  return 0;
32597}
32598_ACEOF
32599if ac_fn_c_try_link "$LINENO"; then :
32600  ac_cv_lib_ldap60_ldap_url_parse=yes
32601else
32602  ac_cv_lib_ldap60_ldap_url_parse=no
32603fi
32604rm -f core conftest.err conftest.$ac_objext \
32605    conftest$ac_exeext conftest.$ac_ext
32606LIBS=$ac_check_lib_save_LIBS
32607fi
32608{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap60_ldap_url_parse" >&5
32609$as_echo "$ac_cv_lib_ldap60_ldap_url_parse" >&6; }
32610if test "x$ac_cv_lib_ldap60_ldap_url_parse" = xyes; then :
32611
32612$as_echo "#define HAVE_LDAP_URL_PARSE 1" >>confdefs.h
32613
32614fi
32615
32616   else
32617      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_url_parse" >&5
32618$as_echo_n "checking for ldap_url_parse... " >&6; }
32619
32620$as_echo "#define HAVE_LDAP_URL_PARSE 0" >>confdefs.h
32621
32622      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32623$as_echo "no" >&6; }
32624   fi
32625fi
32626
32627           if test x"${no_ldap}" = xt; then
32628               noldap="LDAP installation required"
32629           else
32630               if test x"$LIBS" != x; then
32631                   LDAPLIBS=${LIBS##$LIBScpy} #ensure only new libraries are added
32632               fi
32633           fi
32634       fi
32635   fi
32636   if test x"$LIBScpy" != x; then
32637      LIBS="$LIBScpy"
32638   fi
32639fi
32640if test x"$noldap" != x; then
32641   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ldap disabled: $noldap" >&5
32642$as_echo "$as_me: WARNING: ldap disabled: $noldap" >&2;}
32643fi
32644
32645unset stdio_preload
32646case $host in
32647    *-*-linux-* | *-*-solaris*)
32648	#only do preloading if gssapi is defined
32649	if test x"${no_gssapi}" != xt; then
32650	    stdio_preload=t
32651	fi
32652	;;
32653esac
32654
32655ac_config_files="$ac_config_files capi/socks.h"
32656
32657if test x"${stdio_preload}" = xt; then
32658
32659$as_echo "#define HAVE_LINUX_GLIBC_WORKAROUND 1" >>confdefs.h
32660
32661    #append contents for stdio preloading
32662    cat capi/socks_glibc.h >> capi/socks.h
32663fi
32664
32665unset MAPOPT
32666
32667MAPFILE=socks.sym
32668
32669STDDIRS="lib/" #socks shared/dynamic libraries (Rfoo functions)
32670for symdir in $STDDIRS; do
32671    cp /dev/null $symdir/$MAPFILE
32672    cat include/symbols_common.txt >> $symdir/$MAPFILE
32673done
32674
32675PLDDIRS="dlib/" #preloading (standard, non-Rfoo functions)
32676if test x"$sol64" = xt; then
32677   PLDDIRS="$PLDDIRS dlib64/"
32678fi
32679for symdir in $PLDDIRS; do
32680    cat include/symbols_preload.txt >> $symdir/$MAPFILE
32681
32682    #platform dependent symbols
32683    case $host in
32684	*-*-darwin*)
32685	    cat include/symbols_darwin.txt >> $symdir/$MAPFILE
32686	    ;;
32687
32688	*-*-linux-*)
32689	    if test x"${stdio_preload}" = xt; then
32690		cat include/symbols_glibc.txt >> $symdir/$MAPFILE
32691	    fi
32692	    ;;
32693
32694       *-*-solaris*)
32695	    cat include/symbols_osol.txt >> $symdir/$MAPFILE
32696	    if test x"${stdio_preload}" = xt; then
32697		cat include/symbols_osol_stdio.txt >> $symdir/$MAPFILE
32698	    fi
32699	    ;;
32700
32701	*-*-freebsd*)
32702	    cat include/symbols_freebsd.txt >> $symdir/$MAPFILE
32703	    ;;
32704    esac
32705done
32706
32707MAPOPT="-export-symbols socks.sym"
32708
32709
32710
32711#miniupnpc tests
32712#miniupnpc
32713
32714# Check whether --with-upnp was given.
32715if test "${with_upnp+set}" = set; then :
32716  withval=$with_upnp; UPNP=$withval
32717fi
32718
32719
32720no_upnp=t
32721if test x"${UPNP}" != xno; then
32722    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for miniupnpc headers" >&5
32723$as_echo_n "checking for miniupnpc headers... " >&6; }
32724    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32725/* end confdefs.h.  */
32726#include <miniupnpc/miniupnpc.h>
32727int
32728main ()
32729{
32730struct UPNPDev upnpdev;
32731  ;
32732  return 0;
32733}
32734_ACEOF
32735if ac_fn_c_try_compile "$LINENO"; then :
32736  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32737$as_echo "yes" >&6; }
32738         upnphdr=t
32739else
32740  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32741$as_echo "no" >&6; }
32742         unset upnphdr
32743fi
32744rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
32745
32746    if test "x$upnphdr" = "xt"; then
32747	oLIBS=$LIBS
32748        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing UPNP_GetValidIGD" >&5
32749$as_echo_n "checking for library containing UPNP_GetValidIGD... " >&6; }
32750if ${ac_cv_search_UPNP_GetValidIGD+:} false; then :
32751  $as_echo_n "(cached) " >&6
32752else
32753  ac_func_search_save_LIBS=$LIBS
32754cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32755/* end confdefs.h.  */
32756
32757/* Override any GCC internal prototype to avoid an error.
32758   Use char because int might match the return type of a GCC
32759   builtin and then its argument prototype would still apply.  */
32760#ifdef __cplusplus
32761extern "C"
32762#endif
32763char UPNP_GetValidIGD ();
32764int
32765main ()
32766{
32767return UPNP_GetValidIGD ();
32768  ;
32769  return 0;
32770}
32771_ACEOF
32772for ac_lib in '' miniupnpc; do
32773  if test -z "$ac_lib"; then
32774    ac_res="none required"
32775  else
32776    ac_res=-l$ac_lib
32777    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
32778  fi
32779  if ac_fn_c_try_link "$LINENO"; then :
32780  ac_cv_search_UPNP_GetValidIGD=$ac_res
32781fi
32782rm -f core conftest.err conftest.$ac_objext \
32783    conftest$ac_exeext
32784  if ${ac_cv_search_UPNP_GetValidIGD+:} false; then :
32785  break
32786fi
32787done
32788if ${ac_cv_search_UPNP_GetValidIGD+:} false; then :
32789
32790else
32791  ac_cv_search_UPNP_GetValidIGD=no
32792fi
32793rm conftest.$ac_ext
32794LIBS=$ac_func_search_save_LIBS
32795fi
32796{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_UPNP_GetValidIGD" >&5
32797$as_echo "$ac_cv_search_UPNP_GetValidIGD" >&6; }
32798ac_res=$ac_cv_search_UPNP_GetValidIGD
32799if test "$ac_res" != no; then :
32800  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
32801  have_libminiupnp=t
32802fi
32803
32804	UPNPLIB=$LIBS
32805	LIBS=$oLIBS
32806    fi
32807    if test x"${have_libminiupnp}" = xt; then
32808        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for miniupnpc version >= 1.7" >&5
32809$as_echo_n "checking for miniupnpc version >= 1.7... " >&6; }
32810	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32811/* end confdefs.h.  */
32812
32813            #include <stdio.h>
32814            #include <miniupnpc/miniupnpc.h>
32815            #include <miniupnpc/upnpcommands.h>
32816            #include <miniupnpc/upnperrors.h>
32817int
32818main ()
32819{
32820
32821
32822            #ifndef MINIUPNPC_API_VERSION
32823	    #error "no api version define"
32824            #else
32825            # if MINIUPNPC_API_VERSION < 8
32826            #error "api version too low"
32827            # endif
32828            #endif
32829  ;
32830  return 0;
32831}
32832_ACEOF
32833if ac_fn_c_try_compile "$LINENO"; then :
32834  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32835$as_echo "yes" >&6; }
32836
32837$as_echo "#define HAVE_LIBMINIUPNP 1" >>confdefs.h
32838
32839
32840$as_echo "#define HAVE_LIBMINIUPNP17 1" >>confdefs.h
32841
32842          unset no_upnp
32843	  SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$UPNPLIB"
32844	  DLIBDEPS="${DLIBDEPS}${DLIBDEPS:+ }$UPNPLIB"
32845else
32846  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32847$as_echo "no" >&6; }
32848fi
32849rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
32850
32851        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for miniupnpc version >= 1.4" >&5
32852$as_echo_n "checking for miniupnpc version >= 1.4... " >&6; }
32853	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32854/* end confdefs.h.  */
32855
32856            #include <stdio.h>
32857            #include <miniupnpc/miniupnpc.h>
32858            #include <miniupnpc/upnpcommands.h>
32859            #include <miniupnpc/upnperrors.h>
32860int
32861main ()
32862{
32863
32864
32865            char *str = NULL;
32866            struct UPNPDev *UPNPDev;
32867            struct UPNPUrls *UPNPUrls = NULL;
32868            struct IGDdatas *IGDdatas = NULL;
32869
32870	    (void)sizeof(IGDdatas->CIF.servicetype);
32871
32872            (void)UPNP_GetIGDFromUrl(str, UPNPUrls, IGDdatas, str, 0);
32873            (void)UPNP_GetValidIGD(UPNPDev, UPNPUrls, IGDdatas, str, 0);
32874            (void)UPNP_GetExternalIPAddress(str, str, str);
32875            (void)UPNP_AddPortMapping(str, str, str, str, str, str, str, str);
32876            (void)UPNP_DeletePortMapping(str, str, str, str, str);
32877  ;
32878  return 0;
32879}
32880_ACEOF
32881if ac_fn_c_try_compile "$LINENO"; then :
32882  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32883$as_echo "yes" >&6; }
32884
32885$as_echo "#define HAVE_LIBMINIUPNP 1" >>confdefs.h
32886
32887
32888$as_echo "#define HAVE_LIBMINIUPNP14 1" >>confdefs.h
32889
32890          unset no_upnp
32891	  SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$UPNPLIB"
32892	  DLIBDEPS="${DLIBDEPS}${DLIBDEPS:+ }$UPNPLIB"
32893else
32894  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32895$as_echo "no" >&6; }
32896fi
32897rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
32898
32899	 if test x"${no_upnp}" != x; then
32900	         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for miniupnpc version 1.3" >&5
32901$as_echo_n "checking for miniupnpc version 1.3... " >&6; }
32902		 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
32903/* end confdefs.h.  */
32904
32905                    #include <stdio.h>
32906                    #include <miniupnpc/miniupnpc.h>
32907                    #include <miniupnpc/upnpcommands.h>
32908                    #include <miniupnpc/upnperrors.h>
32909int
32910main ()
32911{
32912
32913
32914			 char *str = NULL;
32915			 struct UPNPDev *UPNPDev;
32916			 struct UPNPUrls *UPNPUrls = NULL;
32917			 struct IGDdatas *IGDdatas = NULL;
32918
32919			 (void)strlen(IGDdatas->servicetype);
32920
32921			 (void)UPNP_GetIGDFromUrl(str, UPNPUrls, IGDdatas, str, 0);
32922			 (void)UPNP_GetValidIGD(UPNPDev, UPNPUrls, IGDdatas, str, 0);
32923			 (void)UPNP_GetExternalIPAddress(str, str, str);
32924			 (void)UPNP_AddPortMapping(str, str, str, str, str, str, str, str);
32925			 (void)UPNP_DeletePortMapping(str, str, str, str, str);
32926  ;
32927  return 0;
32928}
32929_ACEOF
32930if ac_fn_c_try_compile "$LINENO"; then :
32931  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32932$as_echo "yes" >&6; }
32933
32934$as_echo "#define HAVE_LIBMINIUPNP 1" >>confdefs.h
32935
32936
32937$as_echo "#define HAVE_LIBMINIUPNP13 1" >>confdefs.h
32938
32939		  unset no_upnp
32940		  SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$UPNPLIB"
32941		  DLIBDEPS="${DLIBDEPS}${DLIBDEPS:+ }$UPNPLIB"
32942else
32943  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32944$as_echo "no" >&6; }
32945fi
32946rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
32947	 fi
32948    fi
32949fi
32950
32951if test x"${no_upnp}" = x; then
32952    FEAT="$FEAT${FEAT:+ }upnp"
32953fi
32954
32955
32956unset have_libcfail
32957#check whether to use and where to place pidfile
32958unset NOPIDFILE
32959{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use server pidfile" >&5
32960$as_echo_n "checking whether to use server pidfile... " >&6; }
32961# Check whether --enable-pidfile was given.
32962if test "${enable_pidfile+set}" = set; then :
32963  enableval=$enable_pidfile; if test x"$enableval" = xno; then
32964    NOPIDFILE="Disabled, using --disable-pidfile"
32965 fi
32966fi
32967
32968if test x"$NOPIDFILE" = x; then
32969   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
32970$as_echo "yes" >&6; }
32971
32972$as_echo "#define HAVE_ENABLED_PIDFILE 1" >>confdefs.h
32973
32974else
32975   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
32976$as_echo "no" >&6; }
32977fi
32978
32979unset PIDFILEPATH
32980{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pid file location" >&5
32981$as_echo_n "checking for pid file location... " >&6; }
32982
32983# Check whether --with-pidfile was given.
32984if test "${with_pidfile+set}" = set; then :
32985  withval=$with_pidfile; PIDFILEPATH="$withval"
32986else
32987  #default per-platform pidfile locations
32988 case $host in
32989     *-*-aix*)
32990	 PIDFILEPATH="/etc/${SERVNAME}.pid"
32991	 ;;
32992     *)
32993	 PIDFILEPATH="/var/run/${SERVNAME}.pid"
32994	 ;;
32995 esac
32996fi
32997
32998{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PIDFILEPATH" >&5
32999$as_echo "$PIDFILEPATH" >&6; }
33000
33001cat >>confdefs.h <<_ACEOF
33002#define SOCKD_PIDFILE "$PIDFILEPATH"
33003_ACEOF
33004
33005
33006#SOCKD_IOMAX/NEGOTIATEMAX override?
33007{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOCKD_IOMAX value" >&5
33008$as_echo_n "checking for SOCKD_IOMAX value... " >&6; }
33009
33010# Check whether --with-iomax was given.
33011if test "${with_iomax+set}" = set; then :
33012  withval=$with_iomax; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
33013$as_echo "$withval" >&6; }
33014 FEAT="$FEAT${FEAT:+ }iomax-$withval"
33015 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-DSOCKD_IOMAX=$withval"
33016else
33017  { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5
33018$as_echo "default" >&6; }
33019fi
33020
33021
33022{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOCKD_NEGOTIATEMAX value" >&5
33023$as_echo_n "checking for SOCKD_NEGOTIATEMAX value... " >&6; }
33024
33025# Check whether --with-negmax was given.
33026if test "${with_negmax+set}" = set; then :
33027  withval=$with_negmax; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
33028$as_echo "$withval" >&6; }
33029 FEAT="$FEAT${FEAT:+ }negmax-$withval"
33030 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-DSOCKD_NEGOTIATEMAX=$withval"
33031else
33032  { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5
33033$as_echo "default" >&6; }
33034fi
33035
33036
33037{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOCKD_BUFSIZE value" >&5
33038$as_echo_n "checking for SOCKD_BUFSIZE value... " >&6; }
33039
33040# Check whether --with-bufsize was given.
33041if test "${with_bufsize+set}" = set; then :
33042  withval=$with_bufsize; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $withval" >&5
33043$as_echo "$withval" >&6; }
33044 FEAT="$FEAT${FEAT:+ }bufsize-$withval"
33045 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-DSOCKD_BUFSIZE=$withval"
33046else
33047  { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5
33048$as_echo "default" >&6; }
33049fi
33050
33051
33052#math library used in server
33053{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lround in -lm" >&5
33054$as_echo_n "checking for lround in -lm... " >&6; }
33055if ${ac_cv_lib_m_lround+:} false; then :
33056  $as_echo_n "(cached) " >&6
33057else
33058  ac_check_lib_save_LIBS=$LIBS
33059LIBS="-lm  $LIBS"
33060cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33061/* end confdefs.h.  */
33062
33063/* Override any GCC internal prototype to avoid an error.
33064   Use char because int might match the return type of a GCC
33065   builtin and then its argument prototype would still apply.  */
33066#ifdef __cplusplus
33067extern "C"
33068#endif
33069char lround ();
33070int
33071main ()
33072{
33073return lround ();
33074  ;
33075  return 0;
33076}
33077_ACEOF
33078if ac_fn_c_try_link "$LINENO"; then :
33079  ac_cv_lib_m_lround=yes
33080else
33081  ac_cv_lib_m_lround=no
33082fi
33083rm -f core conftest.err conftest.$ac_objext \
33084    conftest$ac_exeext conftest.$ac_ext
33085LIBS=$ac_check_lib_save_LIBS
33086fi
33087{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_lround" >&5
33088$as_echo "$ac_cv_lib_m_lround" >&6; }
33089if test "x$ac_cv_lib_m_lround" = xyes; then :
33090  SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }-lm"
33091fi
33092
33093
33094#XXX for backwards compatibility
33095unset NOLIBWRAP
33096
33097# Check whether --with-libwrap was given.
33098if test "${with_libwrap+set}" = set; then :
33099  withval=$with_libwrap; if test x"$withval" = xno; then
33100    NOLIBWRAP="Disabled, using --without-libwrap"
33101 fi
33102fi
33103
33104
33105# Check whether --enable-libwrap was given.
33106if test "${enable_libwrap+set}" = set; then :
33107  enableval=$enable_libwrap; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --disable/enable-libwrap is deprecated" >&5
33108$as_echo "$as_me: WARNING: --disable/enable-libwrap is deprecated" >&2;}
33109 if test x"$NOLIBWRAP" != x; then
33110    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot specify both --without-libwrap and --disable-libwrap" >&5
33111$as_echo "$as_me: WARNING: cannot specify both --without-libwrap and --disable-libwrap" >&2;}
33112    exit 1
33113 fi
33114 if test x"$enableval" = xno; then
33115    NOLIBWRAP="Disabled, using --disable-libwrap"
33116 fi
33117fi
33118
33119
33120if test x"$NOLIBWRAP" != x; then
33121    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwrap" >&5
33122$as_echo_n "checking for libwrap... " >&6; }
33123    { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
33124$as_echo "disabled" >&6; }
33125else
33126    for ac_header in tcpd.h
33127do :
33128  ac_fn_c_check_header_mongrel "$LINENO" "tcpd.h" "ac_cv_header_tcpd_h" "$ac_includes_default"
33129if test "x$ac_cv_header_tcpd_h" = xyes; then :
33130  cat >>confdefs.h <<_ACEOF
33131#define HAVE_TCPD_H 1
33132_ACEOF
33133
33134fi
33135
33136done
33137
33138    if test x"${ac_cv_header_tcpd_h}" != xyes; then
33139	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwrap" >&5
33140$as_echo_n "checking for libwrap... " >&6; }
33141	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, usable tcpd.h not found" >&5
33142$as_echo "no, usable tcpd.h not found" >&6; }
33143	NOLIBWRAP="Disabled, tcpd.h missing"
33144    else
33145	case $host in
33146	    *-*-linux-*)
33147	        #XXX needed on at least RedHat
33148		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yp_get_default_domain" >&5
33149$as_echo_n "checking for library containing yp_get_default_domain... " >&6; }
33150if ${ac_cv_search_yp_get_default_domain+:} false; then :
33151  $as_echo_n "(cached) " >&6
33152else
33153  ac_func_search_save_LIBS=$LIBS
33154cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33155/* end confdefs.h.  */
33156
33157/* Override any GCC internal prototype to avoid an error.
33158   Use char because int might match the return type of a GCC
33159   builtin and then its argument prototype would still apply.  */
33160#ifdef __cplusplus
33161extern "C"
33162#endif
33163char yp_get_default_domain ();
33164int
33165main ()
33166{
33167return yp_get_default_domain ();
33168  ;
33169  return 0;
33170}
33171_ACEOF
33172for ac_lib in '' nsl; do
33173  if test -z "$ac_lib"; then
33174    ac_res="none required"
33175  else
33176    ac_res=-l$ac_lib
33177    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
33178  fi
33179  if ac_fn_c_try_link "$LINENO"; then :
33180  ac_cv_search_yp_get_default_domain=$ac_res
33181fi
33182rm -f core conftest.err conftest.$ac_objext \
33183    conftest$ac_exeext
33184  if ${ac_cv_search_yp_get_default_domain+:} false; then :
33185  break
33186fi
33187done
33188if ${ac_cv_search_yp_get_default_domain+:} false; then :
33189
33190else
33191  ac_cv_search_yp_get_default_domain=no
33192fi
33193rm conftest.$ac_ext
33194LIBS=$ac_func_search_save_LIBS
33195fi
33196{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yp_get_default_domain" >&5
33197$as_echo "$ac_cv_search_yp_get_default_domain" >&6; }
33198ac_res=$ac_cv_search_yp_get_default_domain
33199if test "$ac_res" != no; then :
33200  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
33201
33202fi
33203
33204		;;
33205	esac
33206	oLIBS=$LIBS
33207	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwrap" >&5
33208$as_echo_n "checking for libwrap... " >&6; }
33209	#normal library testing does not work for libwrap (will not link
33210	#without allow/deny_severity)
33211	#XXX include header in compilation test?
33212	LIBS="$LIBS -lwrap"
33213	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33214/* end confdefs.h.  */
33215
33216int allow_severity;
33217int deny_severity;
33218
33219int
33220main ()
33221{
33222hosts_access(0);
33223  ;
33224  return 0;
33225}
33226_ACEOF
33227if ac_fn_c_try_link "$LINENO"; then :
33228  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
33229$as_echo "yes" >&6; }
33230	 SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }-lwrap"
33231
33232$as_echo "#define HAVE_COND_LIBWRAP 1" >>confdefs.h
33233
33234         FEAT="$FEAT${FEAT:+ }libwrap"
33235else
33236  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
33237$as_echo "no" >&6; }
33238         NOLIBWRAP="Disabled, -lwrap not found"
33239fi
33240rm -f core conftest.err conftest.$ac_objext \
33241    conftest$ac_exeext conftest.$ac_ext
33242        LIBS="$oLIBS"
33243    fi
33244fi
33245
33246unset NOPAM
33247for ac_header in security/pam_appl.h
33248do :
33249  ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default"
33250if test "x$ac_cv_header_security_pam_appl_h" = xyes; then :
33251  cat >>confdefs.h <<_ACEOF
33252#define HAVE_SECURITY_PAM_APPL_H 1
33253_ACEOF
33254
33255fi
33256
33257done
33258
33259{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pam_start" >&5
33260$as_echo_n "checking for library containing pam_start... " >&6; }
33261if ${ac_cv_search_pam_start+:} false; then :
33262  $as_echo_n "(cached) " >&6
33263else
33264  ac_func_search_save_LIBS=$LIBS
33265cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33266/* end confdefs.h.  */
33267
33268/* Override any GCC internal prototype to avoid an error.
33269   Use char because int might match the return type of a GCC
33270   builtin and then its argument prototype would still apply.  */
33271#ifdef __cplusplus
33272extern "C"
33273#endif
33274char pam_start ();
33275int
33276main ()
33277{
33278return pam_start ();
33279  ;
33280  return 0;
33281}
33282_ACEOF
33283for ac_lib in '' pam; do
33284  if test -z "$ac_lib"; then
33285    ac_res="none required"
33286  else
33287    ac_res=-l$ac_lib
33288    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
33289  fi
33290  if ac_fn_c_try_link "$LINENO"; then :
33291  ac_cv_search_pam_start=$ac_res
33292fi
33293rm -f core conftest.err conftest.$ac_objext \
33294    conftest$ac_exeext
33295  if ${ac_cv_search_pam_start+:} false; then :
33296  break
33297fi
33298done
33299if ${ac_cv_search_pam_start+:} false; then :
33300
33301else
33302  ac_cv_search_pam_start=no
33303fi
33304rm conftest.$ac_ext
33305LIBS=$ac_func_search_save_LIBS
33306fi
33307{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pam_start" >&5
33308$as_echo "$ac_cv_search_pam_start" >&6; }
33309ac_res=$ac_cv_search_pam_start
33310if test "$ac_res" != no; then :
33311  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
33312
33313fi
33314
33315{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam" >&5
33316$as_echo_n "checking for pam... " >&6; }
33317
33318# Check whether --with-pam was given.
33319if test "${with_pam+set}" = set; then :
33320  withval=$with_pam; if test x"$withval" = xno; then
33321    NOPAM="Disabled, using --without-pam"
33322 fi
33323fi
33324
33325
33326if test x"$NOPAM" != x; then
33327    { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5
33328$as_echo "disabled" >&6; }
33329else
33330    #look for PAM header and lib
33331    if test x"${ac_cv_header_security_pam_appl_h}" = xno; then
33332	NOPAM="Disabled, security/pam_appl.h missing"
33333	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no, usable security/pam_appl.h not found" >&5
33334$as_echo "no, usable security/pam_appl.h not found" >&6; }
33335    else
33336        if test x"${ac_cv_search_pam_start}" = xno; then
33337	    NOPAM="Disabled, pam library not found"
33338	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, pam library not found" >&5
33339$as_echo "no, pam library not found" >&6; }
33340	else
33341
33342$as_echo "#define HAVE_COND_PAM 1" >>confdefs.h
33343
33344	    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
33345$as_echo "yes" >&6; }
33346	    FEAT="$FEAT${FEAT:+ }pam"
33347	fi
33348    fi
33349fi
33350
33351{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libcfail should be enabled" >&5
33352$as_echo_n "checking whether libcfail should be enabled... " >&6; }
33353# Check whether --enable-libcfail was given.
33354if test "${enable_libcfail+set}" = set; then :
33355  enableval=$enable_libcfail;
33356fi
33357
33358if test x"${enable_libcfail}" = xyes; then
33359    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
33360$as_echo "yes" >&6; }
33361
33362$as_echo "#define HAVE_LIBCFAIL 1" >>confdefs.h
33363
33364    have_libcfail=t
33365    FEAT="$FEAT${FEAT:+ }libcfail"
33366else
33367    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
33368$as_echo "no" >&6; }
33369fi
33370
33371
33372
33373unset ALLSOCKOPTS
33374unset SOCKOPTS
33375#socket level
33376unset _compileok
33377  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_BINDANY" >&5
33378$as_echo_n "checking for SOL_SOCKET socket option SO_BINDANY... " >&6; }
33379  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33380/* end confdefs.h.  */
33381
33382#include <sys/types.h>
33383#include <sys/socket.h>
33384#include <netinet/in.h>
33385#include <netinet/tcp.h>
33386#include <netinet/udp.h>
33387
33388#include <stdio.h>
33389#include <stdlib.h>
33390#include <unistd.h>
33391
33392int
33393main ()
33394{
33395
33396   socklen_t optlen;
33397   int optval;
33398   int stype;
33399   int ptype;
33400   int s;
33401
33402   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33403      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33404      ptype = IPPROTO_TCP;
33405   } else if (SOL_SOCKET == IPPROTO_IP) {
33406      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33407      ptype = IPPROTO_IP;
33408   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33409      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33410      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33411   } else if (SOL_SOCKET == IPPROTO_UDP) {
33412      stype = SOCK_DGRAM;
33413      ptype = IPPROTO_UDP;
33414   } else {
33415       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33416       exit(1);
33417   }
33418
33419   if((s = socket(PF_INET, stype, ptype)) < 0) {
33420      perror("socket");
33421      exit(1);
33422   }
33423
33424   optval = 1;
33425   optlen = sizeof(optval);
33426   if(setsockopt(s, SOL_SOCKET, SO_BINDANY, &optval, optlen) < 0) {
33427      perror("setsockopt: SOL_SOCKET SO_BINDANY");
33428      close(s);
33429      exit(1);
33430   }
33431  ;
33432  return 0;
33433}
33434_ACEOF
33435if ac_fn_c_try_compile "$LINENO"; then :
33436  _compileok=1
33437fi
33438rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33439
33440  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33441/* end confdefs.h.  */
33442
33443#include <sys/types.h>
33444#include <sys/socket.h>
33445#include <netinet/in.h>
33446#include <netinet/tcp.h>
33447#include <netinet/udp.h>
33448
33449#include <stdio.h>
33450#include <stdlib.h>
33451#include <unistd.h>
33452
33453int
33454main ()
33455{
33456
33457   socklen_t optlen;
33458   int optval;
33459   int stype;
33460   int ptype;
33461   int s;
33462
33463   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33464      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33465      ptype = IPPROTO_TCP;
33466   } else if (SOL_SOCKET == IPPROTO_IP) {
33467      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33468      ptype = IPPROTO_IP;
33469   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33470      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33471      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33472   } else if (SOL_SOCKET == IPPROTO_UDP) {
33473      stype = SOCK_DGRAM;
33474      ptype = IPPROTO_UDP;
33475   } else {
33476       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33477       exit(1);
33478   }
33479
33480   if((s = socket(PF_INET6, stype, ptype)) < 0) {
33481      perror("socket");
33482      exit(1);
33483   }
33484
33485   optval = 1;
33486   optlen = sizeof(optval);
33487   if(setsockopt(s, SOL_SOCKET, SO_BINDANY, &optval, optlen) < 0) {
33488      perror("setsockopt: SOL_SOCKET SO_BINDANY");
33489      close(s);
33490      exit(1);
33491   }
33492  ;
33493  return 0;
33494}
33495_ACEOF
33496if ac_fn_c_try_compile "$LINENO"; then :
33497  _compileok=1
33498fi
33499rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33500
33501  if test x"${_compileok}" != x; then
33502    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
33503$as_echo "yes" >&6; }
33504
33505cat >>confdefs.h <<_ACEOF
33506#define HAVE_SO_BINDANY 1
33507_ACEOF
33508
33509cat >>confdefs.h <<_ACEOF
33510#define SOCKS_SO_BINDANY_LVL SOL_SOCKET
33511_ACEOF
33512
33513cat >>confdefs.h <<_ACEOF
33514#define SOCKS_SO_BINDANY_NAME "so_bindany"
33515_ACEOF
33516    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
33517       #ipv4-only
33518
33519cat >>confdefs.h <<_ACEOF
33520#define SOCKS_SO_BINDANY_IPV4 1
33521_ACEOF
33522
33523cat >>confdefs.h <<_ACEOF
33524#define SOCKS_SO_BINDANY_IPV6 0
33525_ACEOF
33526    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
33527       #ipv6-only
33528
33529cat >>confdefs.h <<_ACEOF
33530#define SOCKS_SO_BINDANY_IPV4 0
33531_ACEOF
33532
33533cat >>confdefs.h <<_ACEOF
33534#define SOCKS_SO_BINDANY_IPV6 1
33535_ACEOF
33536    else
33537       #both ipv4 and ipv6
33538
33539cat >>confdefs.h <<_ACEOF
33540#define SOCKS_SO_BINDANY_IPV4 1
33541_ACEOF
33542
33543cat >>confdefs.h <<_ACEOF
33544#define SOCKS_SO_BINDANY_IPV6 1
33545_ACEOF
33546    fi
33547    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_BINDANY"
33548  else
33549    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
33550$as_echo "no" >&6; }
33551  fi #test requires root
33552unset _compileok
33553  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_BROADCAST" >&5
33554$as_echo_n "checking for SOL_SOCKET socket option SO_BROADCAST... " >&6; }
33555  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33556/* end confdefs.h.  */
33557
33558#include <sys/types.h>
33559#include <sys/socket.h>
33560#include <netinet/in.h>
33561#include <netinet/tcp.h>
33562#include <netinet/udp.h>
33563
33564#include <stdio.h>
33565#include <stdlib.h>
33566#include <unistd.h>
33567
33568int
33569main ()
33570{
33571
33572   socklen_t optlen;
33573   int optval;
33574   int stype;
33575   int ptype;
33576   int s;
33577
33578   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33579      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33580      ptype = IPPROTO_TCP;
33581   } else if (SOL_SOCKET == IPPROTO_IP) {
33582      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33583      ptype = IPPROTO_IP;
33584   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33585      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33586      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33587   } else if (SOL_SOCKET == IPPROTO_UDP) {
33588      stype = SOCK_DGRAM;
33589      ptype = IPPROTO_UDP;
33590   } else {
33591       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33592       exit(1);
33593   }
33594
33595   if((s = socket(PF_INET, stype, ptype)) < 0) {
33596      perror("socket");
33597      exit(1);
33598   }
33599
33600   optval = 1;
33601   optlen = sizeof(optval);
33602   if(setsockopt(s, SOL_SOCKET, SO_BROADCAST, &optval, optlen) < 0) {
33603      perror("setsockopt: SOL_SOCKET SO_BROADCAST");
33604      close(s);
33605      exit(1);
33606   }
33607  ;
33608  return 0;
33609}
33610_ACEOF
33611if ac_fn_c_try_compile "$LINENO"; then :
33612  _compileok=1
33613fi
33614rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33615
33616  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33617/* end confdefs.h.  */
33618
33619#include <sys/types.h>
33620#include <sys/socket.h>
33621#include <netinet/in.h>
33622#include <netinet/tcp.h>
33623#include <netinet/udp.h>
33624
33625#include <stdio.h>
33626#include <stdlib.h>
33627#include <unistd.h>
33628
33629int
33630main ()
33631{
33632
33633   socklen_t optlen;
33634   int optval;
33635   int stype;
33636   int ptype;
33637   int s;
33638
33639   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33640      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33641      ptype = IPPROTO_TCP;
33642   } else if (SOL_SOCKET == IPPROTO_IP) {
33643      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33644      ptype = IPPROTO_IP;
33645   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33646      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33647      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33648   } else if (SOL_SOCKET == IPPROTO_UDP) {
33649      stype = SOCK_DGRAM;
33650      ptype = IPPROTO_UDP;
33651   } else {
33652       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33653       exit(1);
33654   }
33655
33656   if((s = socket(PF_INET6, stype, ptype)) < 0) {
33657      perror("socket");
33658      exit(1);
33659   }
33660
33661   optval = 1;
33662   optlen = sizeof(optval);
33663   if(setsockopt(s, SOL_SOCKET, SO_BROADCAST, &optval, optlen) < 0) {
33664      perror("setsockopt: SOL_SOCKET SO_BROADCAST");
33665      close(s);
33666      exit(1);
33667   }
33668  ;
33669  return 0;
33670}
33671_ACEOF
33672if ac_fn_c_try_compile "$LINENO"; then :
33673  _compileok=1
33674fi
33675rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33676
33677  if test x"${_compileok}" != x; then
33678    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
33679$as_echo "yes" >&6; }
33680
33681cat >>confdefs.h <<_ACEOF
33682#define HAVE_SO_BROADCAST 1
33683_ACEOF
33684
33685cat >>confdefs.h <<_ACEOF
33686#define SOCKS_SO_BROADCAST_LVL SOL_SOCKET
33687_ACEOF
33688
33689cat >>confdefs.h <<_ACEOF
33690#define SOCKS_SO_BROADCAST_NAME "so_broadcast"
33691_ACEOF
33692    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
33693       #ipv4-only
33694
33695cat >>confdefs.h <<_ACEOF
33696#define SOCKS_SO_BROADCAST_IPV4 1
33697_ACEOF
33698
33699cat >>confdefs.h <<_ACEOF
33700#define SOCKS_SO_BROADCAST_IPV6 0
33701_ACEOF
33702    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
33703       #ipv6-only
33704
33705cat >>confdefs.h <<_ACEOF
33706#define SOCKS_SO_BROADCAST_IPV4 0
33707_ACEOF
33708
33709cat >>confdefs.h <<_ACEOF
33710#define SOCKS_SO_BROADCAST_IPV6 1
33711_ACEOF
33712    else
33713       #both ipv4 and ipv6
33714
33715cat >>confdefs.h <<_ACEOF
33716#define SOCKS_SO_BROADCAST_IPV4 1
33717_ACEOF
33718
33719cat >>confdefs.h <<_ACEOF
33720#define SOCKS_SO_BROADCAST_IPV6 1
33721_ACEOF
33722    fi
33723    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_BROADCAST"
33724  else
33725    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
33726$as_echo "no" >&6; }
33727  fi
33728unset _compileok
33729  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_DEBUG" >&5
33730$as_echo_n "checking for SOL_SOCKET socket option SO_DEBUG... " >&6; }
33731  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33732/* end confdefs.h.  */
33733
33734#include <sys/types.h>
33735#include <sys/socket.h>
33736#include <netinet/in.h>
33737#include <netinet/tcp.h>
33738#include <netinet/udp.h>
33739
33740#include <stdio.h>
33741#include <stdlib.h>
33742#include <unistd.h>
33743
33744int
33745main ()
33746{
33747
33748   socklen_t optlen;
33749   int optval;
33750   int stype;
33751   int ptype;
33752   int s;
33753
33754   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33755      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33756      ptype = IPPROTO_TCP;
33757   } else if (SOL_SOCKET == IPPROTO_IP) {
33758      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33759      ptype = IPPROTO_IP;
33760   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33761      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33762      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33763   } else if (SOL_SOCKET == IPPROTO_UDP) {
33764      stype = SOCK_DGRAM;
33765      ptype = IPPROTO_UDP;
33766   } else {
33767       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33768       exit(1);
33769   }
33770
33771   if((s = socket(PF_INET, stype, ptype)) < 0) {
33772      perror("socket");
33773      exit(1);
33774   }
33775
33776   optval = 1;
33777   optlen = sizeof(optval);
33778   if(setsockopt(s, SOL_SOCKET, SO_DEBUG, &optval, optlen) < 0) {
33779      perror("setsockopt: SOL_SOCKET SO_DEBUG");
33780      close(s);
33781      exit(1);
33782   }
33783  ;
33784  return 0;
33785}
33786_ACEOF
33787if ac_fn_c_try_compile "$LINENO"; then :
33788  _compileok=1
33789fi
33790rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33791
33792  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33793/* end confdefs.h.  */
33794
33795#include <sys/types.h>
33796#include <sys/socket.h>
33797#include <netinet/in.h>
33798#include <netinet/tcp.h>
33799#include <netinet/udp.h>
33800
33801#include <stdio.h>
33802#include <stdlib.h>
33803#include <unistd.h>
33804
33805int
33806main ()
33807{
33808
33809   socklen_t optlen;
33810   int optval;
33811   int stype;
33812   int ptype;
33813   int s;
33814
33815   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33816      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33817      ptype = IPPROTO_TCP;
33818   } else if (SOL_SOCKET == IPPROTO_IP) {
33819      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33820      ptype = IPPROTO_IP;
33821   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33822      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33823      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33824   } else if (SOL_SOCKET == IPPROTO_UDP) {
33825      stype = SOCK_DGRAM;
33826      ptype = IPPROTO_UDP;
33827   } else {
33828       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33829       exit(1);
33830   }
33831
33832   if((s = socket(PF_INET6, stype, ptype)) < 0) {
33833      perror("socket");
33834      exit(1);
33835   }
33836
33837   optval = 1;
33838   optlen = sizeof(optval);
33839   if(setsockopt(s, SOL_SOCKET, SO_DEBUG, &optval, optlen) < 0) {
33840      perror("setsockopt: SOL_SOCKET SO_DEBUG");
33841      close(s);
33842      exit(1);
33843   }
33844  ;
33845  return 0;
33846}
33847_ACEOF
33848if ac_fn_c_try_compile "$LINENO"; then :
33849  _compileok=1
33850fi
33851rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33852
33853  if test x"${_compileok}" != x; then
33854    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
33855$as_echo "yes" >&6; }
33856
33857cat >>confdefs.h <<_ACEOF
33858#define HAVE_SO_DEBUG 1
33859_ACEOF
33860
33861cat >>confdefs.h <<_ACEOF
33862#define SOCKS_SO_DEBUG_LVL SOL_SOCKET
33863_ACEOF
33864
33865cat >>confdefs.h <<_ACEOF
33866#define SOCKS_SO_DEBUG_NAME "so_debug"
33867_ACEOF
33868    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
33869       #ipv4-only
33870
33871cat >>confdefs.h <<_ACEOF
33872#define SOCKS_SO_DEBUG_IPV4 1
33873_ACEOF
33874
33875cat >>confdefs.h <<_ACEOF
33876#define SOCKS_SO_DEBUG_IPV6 0
33877_ACEOF
33878    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
33879       #ipv6-only
33880
33881cat >>confdefs.h <<_ACEOF
33882#define SOCKS_SO_DEBUG_IPV4 0
33883_ACEOF
33884
33885cat >>confdefs.h <<_ACEOF
33886#define SOCKS_SO_DEBUG_IPV6 1
33887_ACEOF
33888    else
33889       #both ipv4 and ipv6
33890
33891cat >>confdefs.h <<_ACEOF
33892#define SOCKS_SO_DEBUG_IPV4 1
33893_ACEOF
33894
33895cat >>confdefs.h <<_ACEOF
33896#define SOCKS_SO_DEBUG_IPV6 1
33897_ACEOF
33898    fi
33899    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_DEBUG"
33900  else
33901    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
33902$as_echo "no" >&6; }
33903  fi
33904unset _compileok
33905  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_DONTROUTE" >&5
33906$as_echo_n "checking for SOL_SOCKET socket option SO_DONTROUTE... " >&6; }
33907  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33908/* end confdefs.h.  */
33909
33910#include <sys/types.h>
33911#include <sys/socket.h>
33912#include <netinet/in.h>
33913#include <netinet/tcp.h>
33914#include <netinet/udp.h>
33915
33916#include <stdio.h>
33917#include <stdlib.h>
33918#include <unistd.h>
33919
33920int
33921main ()
33922{
33923
33924   socklen_t optlen;
33925   int optval;
33926   int stype;
33927   int ptype;
33928   int s;
33929
33930   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33931      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33932      ptype = IPPROTO_TCP;
33933   } else if (SOL_SOCKET == IPPROTO_IP) {
33934      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33935      ptype = IPPROTO_IP;
33936   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33937      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33938      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
33939   } else if (SOL_SOCKET == IPPROTO_UDP) {
33940      stype = SOCK_DGRAM;
33941      ptype = IPPROTO_UDP;
33942   } else {
33943       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
33944       exit(1);
33945   }
33946
33947   if((s = socket(PF_INET, stype, ptype)) < 0) {
33948      perror("socket");
33949      exit(1);
33950   }
33951
33952   optval = 1;
33953   optlen = sizeof(optval);
33954   if(setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &optval, optlen) < 0) {
33955      perror("setsockopt: SOL_SOCKET SO_DONTROUTE");
33956      close(s);
33957      exit(1);
33958   }
33959  ;
33960  return 0;
33961}
33962_ACEOF
33963if ac_fn_c_try_compile "$LINENO"; then :
33964  _compileok=1
33965fi
33966rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
33967
33968  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
33969/* end confdefs.h.  */
33970
33971#include <sys/types.h>
33972#include <sys/socket.h>
33973#include <netinet/in.h>
33974#include <netinet/tcp.h>
33975#include <netinet/udp.h>
33976
33977#include <stdio.h>
33978#include <stdlib.h>
33979#include <unistd.h>
33980
33981int
33982main ()
33983{
33984
33985   socklen_t optlen;
33986   int optval;
33987   int stype;
33988   int ptype;
33989   int s;
33990
33991   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
33992      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
33993      ptype = IPPROTO_TCP;
33994   } else if (SOL_SOCKET == IPPROTO_IP) {
33995      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
33996      ptype = IPPROTO_IP;
33997   } else if (SOL_SOCKET == IPPROTO_IPV6) {
33998      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
33999      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34000   } else if (SOL_SOCKET == IPPROTO_UDP) {
34001      stype = SOCK_DGRAM;
34002      ptype = IPPROTO_UDP;
34003   } else {
34004       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34005       exit(1);
34006   }
34007
34008   if((s = socket(PF_INET6, stype, ptype)) < 0) {
34009      perror("socket");
34010      exit(1);
34011   }
34012
34013   optval = 1;
34014   optlen = sizeof(optval);
34015   if(setsockopt(s, SOL_SOCKET, SO_DONTROUTE, &optval, optlen) < 0) {
34016      perror("setsockopt: SOL_SOCKET SO_DONTROUTE");
34017      close(s);
34018      exit(1);
34019   }
34020  ;
34021  return 0;
34022}
34023_ACEOF
34024if ac_fn_c_try_compile "$LINENO"; then :
34025  _compileok=1
34026fi
34027rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34028
34029  if test x"${_compileok}" != x; then
34030    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
34031$as_echo "yes" >&6; }
34032
34033cat >>confdefs.h <<_ACEOF
34034#define HAVE_SO_DONTROUTE 1
34035_ACEOF
34036
34037cat >>confdefs.h <<_ACEOF
34038#define SOCKS_SO_DONTROUTE_LVL SOL_SOCKET
34039_ACEOF
34040
34041cat >>confdefs.h <<_ACEOF
34042#define SOCKS_SO_DONTROUTE_NAME "so_dontroute"
34043_ACEOF
34044    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
34045       #ipv4-only
34046
34047cat >>confdefs.h <<_ACEOF
34048#define SOCKS_SO_DONTROUTE_IPV4 1
34049_ACEOF
34050
34051cat >>confdefs.h <<_ACEOF
34052#define SOCKS_SO_DONTROUTE_IPV6 0
34053_ACEOF
34054    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
34055       #ipv6-only
34056
34057cat >>confdefs.h <<_ACEOF
34058#define SOCKS_SO_DONTROUTE_IPV4 0
34059_ACEOF
34060
34061cat >>confdefs.h <<_ACEOF
34062#define SOCKS_SO_DONTROUTE_IPV6 1
34063_ACEOF
34064    else
34065       #both ipv4 and ipv6
34066
34067cat >>confdefs.h <<_ACEOF
34068#define SOCKS_SO_DONTROUTE_IPV4 1
34069_ACEOF
34070
34071cat >>confdefs.h <<_ACEOF
34072#define SOCKS_SO_DONTROUTE_IPV6 1
34073_ACEOF
34074    fi
34075    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_DONTROUTE"
34076  else
34077    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
34078$as_echo "no" >&6; }
34079  fi
34080unset _compileok
34081  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_JUMBO" >&5
34082$as_echo_n "checking for SOL_SOCKET socket option SO_JUMBO... " >&6; }
34083  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34084/* end confdefs.h.  */
34085
34086#include <sys/types.h>
34087#include <sys/socket.h>
34088#include <netinet/in.h>
34089#include <netinet/tcp.h>
34090#include <netinet/udp.h>
34091
34092#include <stdio.h>
34093#include <stdlib.h>
34094#include <unistd.h>
34095
34096int
34097main ()
34098{
34099
34100   socklen_t optlen;
34101   int optval;
34102   int stype;
34103   int ptype;
34104   int s;
34105
34106   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34107      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34108      ptype = IPPROTO_TCP;
34109   } else if (SOL_SOCKET == IPPROTO_IP) {
34110      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34111      ptype = IPPROTO_IP;
34112   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34113      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34114      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34115   } else if (SOL_SOCKET == IPPROTO_UDP) {
34116      stype = SOCK_DGRAM;
34117      ptype = IPPROTO_UDP;
34118   } else {
34119       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34120       exit(1);
34121   }
34122
34123   if((s = socket(PF_INET, stype, ptype)) < 0) {
34124      perror("socket");
34125      exit(1);
34126   }
34127
34128   optval = 1;
34129   optlen = sizeof(optval);
34130   if(setsockopt(s, SOL_SOCKET, SO_JUMBO, &optval, optlen) < 0) {
34131      perror("setsockopt: SOL_SOCKET SO_JUMBO");
34132      close(s);
34133      exit(1);
34134   }
34135  ;
34136  return 0;
34137}
34138_ACEOF
34139if ac_fn_c_try_compile "$LINENO"; then :
34140  _compileok=1
34141fi
34142rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34143
34144  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34145/* end confdefs.h.  */
34146
34147#include <sys/types.h>
34148#include <sys/socket.h>
34149#include <netinet/in.h>
34150#include <netinet/tcp.h>
34151#include <netinet/udp.h>
34152
34153#include <stdio.h>
34154#include <stdlib.h>
34155#include <unistd.h>
34156
34157int
34158main ()
34159{
34160
34161   socklen_t optlen;
34162   int optval;
34163   int stype;
34164   int ptype;
34165   int s;
34166
34167   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34168      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34169      ptype = IPPROTO_TCP;
34170   } else if (SOL_SOCKET == IPPROTO_IP) {
34171      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34172      ptype = IPPROTO_IP;
34173   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34174      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34175      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34176   } else if (SOL_SOCKET == IPPROTO_UDP) {
34177      stype = SOCK_DGRAM;
34178      ptype = IPPROTO_UDP;
34179   } else {
34180       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34181       exit(1);
34182   }
34183
34184   if((s = socket(PF_INET6, stype, ptype)) < 0) {
34185      perror("socket");
34186      exit(1);
34187   }
34188
34189   optval = 1;
34190   optlen = sizeof(optval);
34191   if(setsockopt(s, SOL_SOCKET, SO_JUMBO, &optval, optlen) < 0) {
34192      perror("setsockopt: SOL_SOCKET SO_JUMBO");
34193      close(s);
34194      exit(1);
34195   }
34196  ;
34197  return 0;
34198}
34199_ACEOF
34200if ac_fn_c_try_compile "$LINENO"; then :
34201  _compileok=1
34202fi
34203rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34204
34205  if test x"${_compileok}" != x; then
34206    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
34207$as_echo "yes" >&6; }
34208
34209cat >>confdefs.h <<_ACEOF
34210#define HAVE_SO_JUMBO 1
34211_ACEOF
34212
34213cat >>confdefs.h <<_ACEOF
34214#define SOCKS_SO_JUMBO_LVL SOL_SOCKET
34215_ACEOF
34216
34217cat >>confdefs.h <<_ACEOF
34218#define SOCKS_SO_JUMBO_NAME "so_jumbo"
34219_ACEOF
34220    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
34221       #ipv4-only
34222
34223cat >>confdefs.h <<_ACEOF
34224#define SOCKS_SO_JUMBO_IPV4 1
34225_ACEOF
34226
34227cat >>confdefs.h <<_ACEOF
34228#define SOCKS_SO_JUMBO_IPV6 0
34229_ACEOF
34230    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
34231       #ipv6-only
34232
34233cat >>confdefs.h <<_ACEOF
34234#define SOCKS_SO_JUMBO_IPV4 0
34235_ACEOF
34236
34237cat >>confdefs.h <<_ACEOF
34238#define SOCKS_SO_JUMBO_IPV6 1
34239_ACEOF
34240    else
34241       #both ipv4 and ipv6
34242
34243cat >>confdefs.h <<_ACEOF
34244#define SOCKS_SO_JUMBO_IPV4 1
34245_ACEOF
34246
34247cat >>confdefs.h <<_ACEOF
34248#define SOCKS_SO_JUMBO_IPV6 1
34249_ACEOF
34250    fi
34251    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_JUMBO"
34252  else
34253    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
34254$as_echo "no" >&6; }
34255  fi
34256unset _compileok
34257  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_KEEPALIVE" >&5
34258$as_echo_n "checking for SOL_SOCKET socket option SO_KEEPALIVE... " >&6; }
34259  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34260/* end confdefs.h.  */
34261
34262#include <sys/types.h>
34263#include <sys/socket.h>
34264#include <netinet/in.h>
34265#include <netinet/tcp.h>
34266#include <netinet/udp.h>
34267
34268#include <stdio.h>
34269#include <stdlib.h>
34270#include <unistd.h>
34271
34272int
34273main ()
34274{
34275
34276   socklen_t optlen;
34277   int optval;
34278   int stype;
34279   int ptype;
34280   int s;
34281
34282   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34283      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34284      ptype = IPPROTO_TCP;
34285   } else if (SOL_SOCKET == IPPROTO_IP) {
34286      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34287      ptype = IPPROTO_IP;
34288   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34289      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34290      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34291   } else if (SOL_SOCKET == IPPROTO_UDP) {
34292      stype = SOCK_DGRAM;
34293      ptype = IPPROTO_UDP;
34294   } else {
34295       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34296       exit(1);
34297   }
34298
34299   if((s = socket(PF_INET, stype, ptype)) < 0) {
34300      perror("socket");
34301      exit(1);
34302   }
34303
34304   optval = 1;
34305   optlen = sizeof(optval);
34306   if(setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) {
34307      perror("setsockopt: SOL_SOCKET SO_KEEPALIVE");
34308      close(s);
34309      exit(1);
34310   }
34311  ;
34312  return 0;
34313}
34314_ACEOF
34315if ac_fn_c_try_compile "$LINENO"; then :
34316  _compileok=1
34317fi
34318rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34319
34320  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34321/* end confdefs.h.  */
34322
34323#include <sys/types.h>
34324#include <sys/socket.h>
34325#include <netinet/in.h>
34326#include <netinet/tcp.h>
34327#include <netinet/udp.h>
34328
34329#include <stdio.h>
34330#include <stdlib.h>
34331#include <unistd.h>
34332
34333int
34334main ()
34335{
34336
34337   socklen_t optlen;
34338   int optval;
34339   int stype;
34340   int ptype;
34341   int s;
34342
34343   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34344      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34345      ptype = IPPROTO_TCP;
34346   } else if (SOL_SOCKET == IPPROTO_IP) {
34347      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34348      ptype = IPPROTO_IP;
34349   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34350      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34351      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34352   } else if (SOL_SOCKET == IPPROTO_UDP) {
34353      stype = SOCK_DGRAM;
34354      ptype = IPPROTO_UDP;
34355   } else {
34356       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34357       exit(1);
34358   }
34359
34360   if((s = socket(PF_INET6, stype, ptype)) < 0) {
34361      perror("socket");
34362      exit(1);
34363   }
34364
34365   optval = 1;
34366   optlen = sizeof(optval);
34367   if(setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, &optval, optlen) < 0) {
34368      perror("setsockopt: SOL_SOCKET SO_KEEPALIVE");
34369      close(s);
34370      exit(1);
34371   }
34372  ;
34373  return 0;
34374}
34375_ACEOF
34376if ac_fn_c_try_compile "$LINENO"; then :
34377  _compileok=1
34378fi
34379rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34380
34381  if test x"${_compileok}" != x; then
34382    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
34383$as_echo "yes" >&6; }
34384
34385cat >>confdefs.h <<_ACEOF
34386#define HAVE_SO_KEEPALIVE 1
34387_ACEOF
34388
34389cat >>confdefs.h <<_ACEOF
34390#define SOCKS_SO_KEEPALIVE_LVL SOL_SOCKET
34391_ACEOF
34392
34393cat >>confdefs.h <<_ACEOF
34394#define SOCKS_SO_KEEPALIVE_NAME "so_keepalive"
34395_ACEOF
34396    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
34397       #ipv4-only
34398
34399cat >>confdefs.h <<_ACEOF
34400#define SOCKS_SO_KEEPALIVE_IPV4 1
34401_ACEOF
34402
34403cat >>confdefs.h <<_ACEOF
34404#define SOCKS_SO_KEEPALIVE_IPV6 0
34405_ACEOF
34406    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
34407       #ipv6-only
34408
34409cat >>confdefs.h <<_ACEOF
34410#define SOCKS_SO_KEEPALIVE_IPV4 0
34411_ACEOF
34412
34413cat >>confdefs.h <<_ACEOF
34414#define SOCKS_SO_KEEPALIVE_IPV6 1
34415_ACEOF
34416    else
34417       #both ipv4 and ipv6
34418
34419cat >>confdefs.h <<_ACEOF
34420#define SOCKS_SO_KEEPALIVE_IPV4 1
34421_ACEOF
34422
34423cat >>confdefs.h <<_ACEOF
34424#define SOCKS_SO_KEEPALIVE_IPV6 1
34425_ACEOF
34426    fi
34427    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_KEEPALIVE"
34428  else
34429    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
34430$as_echo "no" >&6; }
34431  fi
34432unset _compileok
34433  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_LINGER" >&5
34434$as_echo_n "checking for SOL_SOCKET socket option SO_LINGER... " >&6; }
34435  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34436/* end confdefs.h.  */
34437
34438#include <sys/types.h>
34439#include <sys/socket.h>
34440#include <netinet/in.h>
34441#include <netinet/tcp.h>
34442#include <netinet/udp.h>
34443
34444#include <stdio.h>
34445#include <stdlib.h>
34446#include <unistd.h>
34447
34448int
34449main ()
34450{
34451
34452   socklen_t optlen;
34453   int optval;
34454   int stype;
34455   int ptype;
34456   int s;
34457
34458   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34459      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34460      ptype = IPPROTO_TCP;
34461   } else if (SOL_SOCKET == IPPROTO_IP) {
34462      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34463      ptype = IPPROTO_IP;
34464   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34465      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34466      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34467   } else if (SOL_SOCKET == IPPROTO_UDP) {
34468      stype = SOCK_DGRAM;
34469      ptype = IPPROTO_UDP;
34470   } else {
34471       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34472       exit(1);
34473   }
34474
34475   if((s = socket(PF_INET, stype, ptype)) < 0) {
34476      perror("socket");
34477      exit(1);
34478   }
34479
34480   optval = 1;
34481   optlen = sizeof(optval);
34482   if(setsockopt(s, SOL_SOCKET, SO_LINGER, &optval, optlen) < 0) {
34483      perror("setsockopt: SOL_SOCKET SO_LINGER");
34484      close(s);
34485      exit(1);
34486   }
34487  ;
34488  return 0;
34489}
34490_ACEOF
34491if ac_fn_c_try_compile "$LINENO"; then :
34492  _compileok=1
34493fi
34494rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34495
34496  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34497/* end confdefs.h.  */
34498
34499#include <sys/types.h>
34500#include <sys/socket.h>
34501#include <netinet/in.h>
34502#include <netinet/tcp.h>
34503#include <netinet/udp.h>
34504
34505#include <stdio.h>
34506#include <stdlib.h>
34507#include <unistd.h>
34508
34509int
34510main ()
34511{
34512
34513   socklen_t optlen;
34514   int optval;
34515   int stype;
34516   int ptype;
34517   int s;
34518
34519   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34520      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34521      ptype = IPPROTO_TCP;
34522   } else if (SOL_SOCKET == IPPROTO_IP) {
34523      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34524      ptype = IPPROTO_IP;
34525   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34526      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34527      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34528   } else if (SOL_SOCKET == IPPROTO_UDP) {
34529      stype = SOCK_DGRAM;
34530      ptype = IPPROTO_UDP;
34531   } else {
34532       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34533       exit(1);
34534   }
34535
34536   if((s = socket(PF_INET6, stype, ptype)) < 0) {
34537      perror("socket");
34538      exit(1);
34539   }
34540
34541   optval = 1;
34542   optlen = sizeof(optval);
34543   if(setsockopt(s, SOL_SOCKET, SO_LINGER, &optval, optlen) < 0) {
34544      perror("setsockopt: SOL_SOCKET SO_LINGER");
34545      close(s);
34546      exit(1);
34547   }
34548  ;
34549  return 0;
34550}
34551_ACEOF
34552if ac_fn_c_try_compile "$LINENO"; then :
34553  _compileok=1
34554fi
34555rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34556
34557  if test x"${_compileok}" != x; then
34558    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
34559$as_echo "yes" >&6; }
34560
34561cat >>confdefs.h <<_ACEOF
34562#define HAVE_SO_LINGER 1
34563_ACEOF
34564
34565cat >>confdefs.h <<_ACEOF
34566#define SOCKS_SO_LINGER_LVL SOL_SOCKET
34567_ACEOF
34568
34569cat >>confdefs.h <<_ACEOF
34570#define SOCKS_SO_LINGER_NAME "so_linger"
34571_ACEOF
34572    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
34573       #ipv4-only
34574
34575cat >>confdefs.h <<_ACEOF
34576#define SOCKS_SO_LINGER_IPV4 1
34577_ACEOF
34578
34579cat >>confdefs.h <<_ACEOF
34580#define SOCKS_SO_LINGER_IPV6 0
34581_ACEOF
34582    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
34583       #ipv6-only
34584
34585cat >>confdefs.h <<_ACEOF
34586#define SOCKS_SO_LINGER_IPV4 0
34587_ACEOF
34588
34589cat >>confdefs.h <<_ACEOF
34590#define SOCKS_SO_LINGER_IPV6 1
34591_ACEOF
34592    else
34593       #both ipv4 and ipv6
34594
34595cat >>confdefs.h <<_ACEOF
34596#define SOCKS_SO_LINGER_IPV4 1
34597_ACEOF
34598
34599cat >>confdefs.h <<_ACEOF
34600#define SOCKS_SO_LINGER_IPV6 1
34601_ACEOF
34602    fi
34603    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_LINGER"
34604  else
34605    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
34606$as_echo "no" >&6; }
34607  fi   #linger arg
34608unset _compileok
34609  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_OOBINLINE" >&5
34610$as_echo_n "checking for SOL_SOCKET socket option SO_OOBINLINE... " >&6; }
34611  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34612/* end confdefs.h.  */
34613
34614#include <sys/types.h>
34615#include <sys/socket.h>
34616#include <netinet/in.h>
34617#include <netinet/tcp.h>
34618#include <netinet/udp.h>
34619
34620#include <stdio.h>
34621#include <stdlib.h>
34622#include <unistd.h>
34623
34624int
34625main ()
34626{
34627
34628   socklen_t optlen;
34629   int optval;
34630   int stype;
34631   int ptype;
34632   int s;
34633
34634   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34635      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34636      ptype = IPPROTO_TCP;
34637   } else if (SOL_SOCKET == IPPROTO_IP) {
34638      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34639      ptype = IPPROTO_IP;
34640   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34641      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34642      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34643   } else if (SOL_SOCKET == IPPROTO_UDP) {
34644      stype = SOCK_DGRAM;
34645      ptype = IPPROTO_UDP;
34646   } else {
34647       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34648       exit(1);
34649   }
34650
34651   if((s = socket(PF_INET, stype, ptype)) < 0) {
34652      perror("socket");
34653      exit(1);
34654   }
34655
34656   optval = 1;
34657   optlen = sizeof(optval);
34658   if(setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &optval, optlen) < 0) {
34659      perror("setsockopt: SOL_SOCKET SO_OOBINLINE");
34660      close(s);
34661      exit(1);
34662   }
34663  ;
34664  return 0;
34665}
34666_ACEOF
34667if ac_fn_c_try_compile "$LINENO"; then :
34668  _compileok=1
34669fi
34670rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34671
34672  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34673/* end confdefs.h.  */
34674
34675#include <sys/types.h>
34676#include <sys/socket.h>
34677#include <netinet/in.h>
34678#include <netinet/tcp.h>
34679#include <netinet/udp.h>
34680
34681#include <stdio.h>
34682#include <stdlib.h>
34683#include <unistd.h>
34684
34685int
34686main ()
34687{
34688
34689   socklen_t optlen;
34690   int optval;
34691   int stype;
34692   int ptype;
34693   int s;
34694
34695   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34696      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34697      ptype = IPPROTO_TCP;
34698   } else if (SOL_SOCKET == IPPROTO_IP) {
34699      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34700      ptype = IPPROTO_IP;
34701   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34702      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34703      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34704   } else if (SOL_SOCKET == IPPROTO_UDP) {
34705      stype = SOCK_DGRAM;
34706      ptype = IPPROTO_UDP;
34707   } else {
34708       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34709       exit(1);
34710   }
34711
34712   if((s = socket(PF_INET6, stype, ptype)) < 0) {
34713      perror("socket");
34714      exit(1);
34715   }
34716
34717   optval = 1;
34718   optlen = sizeof(optval);
34719   if(setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &optval, optlen) < 0) {
34720      perror("setsockopt: SOL_SOCKET SO_OOBINLINE");
34721      close(s);
34722      exit(1);
34723   }
34724  ;
34725  return 0;
34726}
34727_ACEOF
34728if ac_fn_c_try_compile "$LINENO"; then :
34729  _compileok=1
34730fi
34731rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34732
34733  if test x"${_compileok}" != x; then
34734    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
34735$as_echo "yes" >&6; }
34736
34737cat >>confdefs.h <<_ACEOF
34738#define HAVE_SO_OOBINLINE 1
34739_ACEOF
34740
34741cat >>confdefs.h <<_ACEOF
34742#define SOCKS_SO_OOBINLINE_LVL SOL_SOCKET
34743_ACEOF
34744
34745cat >>confdefs.h <<_ACEOF
34746#define SOCKS_SO_OOBINLINE_NAME "so_oobinline"
34747_ACEOF
34748    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
34749       #ipv4-only
34750
34751cat >>confdefs.h <<_ACEOF
34752#define SOCKS_SO_OOBINLINE_IPV4 1
34753_ACEOF
34754
34755cat >>confdefs.h <<_ACEOF
34756#define SOCKS_SO_OOBINLINE_IPV6 0
34757_ACEOF
34758    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
34759       #ipv6-only
34760
34761cat >>confdefs.h <<_ACEOF
34762#define SOCKS_SO_OOBINLINE_IPV4 0
34763_ACEOF
34764
34765cat >>confdefs.h <<_ACEOF
34766#define SOCKS_SO_OOBINLINE_IPV6 1
34767_ACEOF
34768    else
34769       #both ipv4 and ipv6
34770
34771cat >>confdefs.h <<_ACEOF
34772#define SOCKS_SO_OOBINLINE_IPV4 1
34773_ACEOF
34774
34775cat >>confdefs.h <<_ACEOF
34776#define SOCKS_SO_OOBINLINE_IPV6 1
34777_ACEOF
34778    fi
34779    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_OOBINLINE"
34780  else
34781    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
34782$as_echo "no" >&6; }
34783  fi
34784unset _compileok
34785  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_PRIORITY" >&5
34786$as_echo_n "checking for SOL_SOCKET socket option SO_PRIORITY... " >&6; }
34787  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34788/* end confdefs.h.  */
34789
34790#include <sys/types.h>
34791#include <sys/socket.h>
34792#include <netinet/in.h>
34793#include <netinet/tcp.h>
34794#include <netinet/udp.h>
34795
34796#include <stdio.h>
34797#include <stdlib.h>
34798#include <unistd.h>
34799
34800int
34801main ()
34802{
34803
34804   socklen_t optlen;
34805   int optval;
34806   int stype;
34807   int ptype;
34808   int s;
34809
34810   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34811      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34812      ptype = IPPROTO_TCP;
34813   } else if (SOL_SOCKET == IPPROTO_IP) {
34814      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34815      ptype = IPPROTO_IP;
34816   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34817      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34818      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34819   } else if (SOL_SOCKET == IPPROTO_UDP) {
34820      stype = SOCK_DGRAM;
34821      ptype = IPPROTO_UDP;
34822   } else {
34823       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34824       exit(1);
34825   }
34826
34827   if((s = socket(PF_INET, stype, ptype)) < 0) {
34828      perror("socket");
34829      exit(1);
34830   }
34831
34832   optval = 1;
34833   optlen = sizeof(optval);
34834   if(setsockopt(s, SOL_SOCKET, SO_PRIORITY, &optval, optlen) < 0) {
34835      perror("setsockopt: SOL_SOCKET SO_PRIORITY");
34836      close(s);
34837      exit(1);
34838   }
34839  ;
34840  return 0;
34841}
34842_ACEOF
34843if ac_fn_c_try_compile "$LINENO"; then :
34844  _compileok=1
34845fi
34846rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34847
34848  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34849/* end confdefs.h.  */
34850
34851#include <sys/types.h>
34852#include <sys/socket.h>
34853#include <netinet/in.h>
34854#include <netinet/tcp.h>
34855#include <netinet/udp.h>
34856
34857#include <stdio.h>
34858#include <stdlib.h>
34859#include <unistd.h>
34860
34861int
34862main ()
34863{
34864
34865   socklen_t optlen;
34866   int optval;
34867   int stype;
34868   int ptype;
34869   int s;
34870
34871   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34872      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34873      ptype = IPPROTO_TCP;
34874   } else if (SOL_SOCKET == IPPROTO_IP) {
34875      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34876      ptype = IPPROTO_IP;
34877   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34878      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34879      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34880   } else if (SOL_SOCKET == IPPROTO_UDP) {
34881      stype = SOCK_DGRAM;
34882      ptype = IPPROTO_UDP;
34883   } else {
34884       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
34885       exit(1);
34886   }
34887
34888   if((s = socket(PF_INET6, stype, ptype)) < 0) {
34889      perror("socket");
34890      exit(1);
34891   }
34892
34893   optval = 1;
34894   optlen = sizeof(optval);
34895   if(setsockopt(s, SOL_SOCKET, SO_PRIORITY, &optval, optlen) < 0) {
34896      perror("setsockopt: SOL_SOCKET SO_PRIORITY");
34897      close(s);
34898      exit(1);
34899   }
34900  ;
34901  return 0;
34902}
34903_ACEOF
34904if ac_fn_c_try_compile "$LINENO"; then :
34905  _compileok=1
34906fi
34907rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
34908
34909  if test x"${_compileok}" != x; then
34910    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
34911$as_echo "yes" >&6; }
34912
34913cat >>confdefs.h <<_ACEOF
34914#define HAVE_SO_PRIORITY 1
34915_ACEOF
34916
34917cat >>confdefs.h <<_ACEOF
34918#define SOCKS_SO_PRIORITY_LVL SOL_SOCKET
34919_ACEOF
34920
34921cat >>confdefs.h <<_ACEOF
34922#define SOCKS_SO_PRIORITY_NAME "so_priority"
34923_ACEOF
34924    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
34925       #ipv4-only
34926
34927cat >>confdefs.h <<_ACEOF
34928#define SOCKS_SO_PRIORITY_IPV4 1
34929_ACEOF
34930
34931cat >>confdefs.h <<_ACEOF
34932#define SOCKS_SO_PRIORITY_IPV6 0
34933_ACEOF
34934    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
34935       #ipv6-only
34936
34937cat >>confdefs.h <<_ACEOF
34938#define SOCKS_SO_PRIORITY_IPV4 0
34939_ACEOF
34940
34941cat >>confdefs.h <<_ACEOF
34942#define SOCKS_SO_PRIORITY_IPV6 1
34943_ACEOF
34944    else
34945       #both ipv4 and ipv6
34946
34947cat >>confdefs.h <<_ACEOF
34948#define SOCKS_SO_PRIORITY_IPV4 1
34949_ACEOF
34950
34951cat >>confdefs.h <<_ACEOF
34952#define SOCKS_SO_PRIORITY_IPV6 1
34953_ACEOF
34954    fi
34955    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_PRIORITY"
34956  else
34957    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
34958$as_echo "no" >&6; }
34959  fi
34960unset _compileok
34961  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_RCVBUF" >&5
34962$as_echo_n "checking for SOL_SOCKET socket option SO_RCVBUF... " >&6; }
34963  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
34964/* end confdefs.h.  */
34965
34966#include <sys/types.h>
34967#include <sys/socket.h>
34968#include <netinet/in.h>
34969#include <netinet/tcp.h>
34970#include <netinet/udp.h>
34971
34972#include <stdio.h>
34973#include <stdlib.h>
34974#include <unistd.h>
34975
34976int
34977main ()
34978{
34979
34980   socklen_t optlen;
34981   int optval;
34982   int stype;
34983   int ptype;
34984   int s;
34985
34986   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
34987      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
34988      ptype = IPPROTO_TCP;
34989   } else if (SOL_SOCKET == IPPROTO_IP) {
34990      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
34991      ptype = IPPROTO_IP;
34992   } else if (SOL_SOCKET == IPPROTO_IPV6) {
34993      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
34994      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
34995   } else if (SOL_SOCKET == IPPROTO_UDP) {
34996      stype = SOCK_DGRAM;
34997      ptype = IPPROTO_UDP;
34998   } else {
34999       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35000       exit(1);
35001   }
35002
35003   if((s = socket(PF_INET, stype, ptype)) < 0) {
35004      perror("socket");
35005      exit(1);
35006   }
35007
35008   optval = 1;
35009   optlen = sizeof(optval);
35010   if(setsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, optlen) < 0) {
35011      perror("setsockopt: SOL_SOCKET SO_RCVBUF");
35012      close(s);
35013      exit(1);
35014   }
35015  ;
35016  return 0;
35017}
35018_ACEOF
35019if ac_fn_c_try_compile "$LINENO"; then :
35020  _compileok=1
35021fi
35022rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35023
35024  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35025/* end confdefs.h.  */
35026
35027#include <sys/types.h>
35028#include <sys/socket.h>
35029#include <netinet/in.h>
35030#include <netinet/tcp.h>
35031#include <netinet/udp.h>
35032
35033#include <stdio.h>
35034#include <stdlib.h>
35035#include <unistd.h>
35036
35037int
35038main ()
35039{
35040
35041   socklen_t optlen;
35042   int optval;
35043   int stype;
35044   int ptype;
35045   int s;
35046
35047   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35048      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35049      ptype = IPPROTO_TCP;
35050   } else if (SOL_SOCKET == IPPROTO_IP) {
35051      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35052      ptype = IPPROTO_IP;
35053   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35054      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35055      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35056   } else if (SOL_SOCKET == IPPROTO_UDP) {
35057      stype = SOCK_DGRAM;
35058      ptype = IPPROTO_UDP;
35059   } else {
35060       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35061       exit(1);
35062   }
35063
35064   if((s = socket(PF_INET6, stype, ptype)) < 0) {
35065      perror("socket");
35066      exit(1);
35067   }
35068
35069   optval = 1;
35070   optlen = sizeof(optval);
35071   if(setsockopt(s, SOL_SOCKET, SO_RCVBUF, &optval, optlen) < 0) {
35072      perror("setsockopt: SOL_SOCKET SO_RCVBUF");
35073      close(s);
35074      exit(1);
35075   }
35076  ;
35077  return 0;
35078}
35079_ACEOF
35080if ac_fn_c_try_compile "$LINENO"; then :
35081  _compileok=1
35082fi
35083rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35084
35085  if test x"${_compileok}" != x; then
35086    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
35087$as_echo "yes" >&6; }
35088
35089cat >>confdefs.h <<_ACEOF
35090#define HAVE_SO_RCVBUF 1
35091_ACEOF
35092
35093cat >>confdefs.h <<_ACEOF
35094#define SOCKS_SO_RCVBUF_LVL SOL_SOCKET
35095_ACEOF
35096
35097cat >>confdefs.h <<_ACEOF
35098#define SOCKS_SO_RCVBUF_NAME "so_rcvbuf"
35099_ACEOF
35100    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
35101       #ipv4-only
35102
35103cat >>confdefs.h <<_ACEOF
35104#define SOCKS_SO_RCVBUF_IPV4 1
35105_ACEOF
35106
35107cat >>confdefs.h <<_ACEOF
35108#define SOCKS_SO_RCVBUF_IPV6 0
35109_ACEOF
35110    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
35111       #ipv6-only
35112
35113cat >>confdefs.h <<_ACEOF
35114#define SOCKS_SO_RCVBUF_IPV4 0
35115_ACEOF
35116
35117cat >>confdefs.h <<_ACEOF
35118#define SOCKS_SO_RCVBUF_IPV6 1
35119_ACEOF
35120    else
35121       #both ipv4 and ipv6
35122
35123cat >>confdefs.h <<_ACEOF
35124#define SOCKS_SO_RCVBUF_IPV4 1
35125_ACEOF
35126
35127cat >>confdefs.h <<_ACEOF
35128#define SOCKS_SO_RCVBUF_IPV6 1
35129_ACEOF
35130    fi
35131    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_RCVBUF"
35132  else
35133    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
35134$as_echo "no" >&6; }
35135  fi
35136unset _compileok
35137  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_RCVBUFFORCE" >&5
35138$as_echo_n "checking for SOL_SOCKET socket option SO_RCVBUFFORCE... " >&6; }
35139  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35140/* end confdefs.h.  */
35141
35142#include <sys/types.h>
35143#include <sys/socket.h>
35144#include <netinet/in.h>
35145#include <netinet/tcp.h>
35146#include <netinet/udp.h>
35147
35148#include <stdio.h>
35149#include <stdlib.h>
35150#include <unistd.h>
35151
35152int
35153main ()
35154{
35155
35156   socklen_t optlen;
35157   int optval;
35158   int stype;
35159   int ptype;
35160   int s;
35161
35162   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35163      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35164      ptype = IPPROTO_TCP;
35165   } else if (SOL_SOCKET == IPPROTO_IP) {
35166      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35167      ptype = IPPROTO_IP;
35168   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35169      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35170      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35171   } else if (SOL_SOCKET == IPPROTO_UDP) {
35172      stype = SOCK_DGRAM;
35173      ptype = IPPROTO_UDP;
35174   } else {
35175       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35176       exit(1);
35177   }
35178
35179   if((s = socket(PF_INET, stype, ptype)) < 0) {
35180      perror("socket");
35181      exit(1);
35182   }
35183
35184   optval = 1;
35185   optlen = sizeof(optval);
35186   if(setsockopt(s, SOL_SOCKET, SO_RCVBUFFORCE, &optval, optlen) < 0) {
35187      perror("setsockopt: SOL_SOCKET SO_RCVBUFFORCE");
35188      close(s);
35189      exit(1);
35190   }
35191  ;
35192  return 0;
35193}
35194_ACEOF
35195if ac_fn_c_try_compile "$LINENO"; then :
35196  _compileok=1
35197fi
35198rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35199
35200  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35201/* end confdefs.h.  */
35202
35203#include <sys/types.h>
35204#include <sys/socket.h>
35205#include <netinet/in.h>
35206#include <netinet/tcp.h>
35207#include <netinet/udp.h>
35208
35209#include <stdio.h>
35210#include <stdlib.h>
35211#include <unistd.h>
35212
35213int
35214main ()
35215{
35216
35217   socklen_t optlen;
35218   int optval;
35219   int stype;
35220   int ptype;
35221   int s;
35222
35223   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35224      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35225      ptype = IPPROTO_TCP;
35226   } else if (SOL_SOCKET == IPPROTO_IP) {
35227      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35228      ptype = IPPROTO_IP;
35229   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35230      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35231      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35232   } else if (SOL_SOCKET == IPPROTO_UDP) {
35233      stype = SOCK_DGRAM;
35234      ptype = IPPROTO_UDP;
35235   } else {
35236       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35237       exit(1);
35238   }
35239
35240   if((s = socket(PF_INET6, stype, ptype)) < 0) {
35241      perror("socket");
35242      exit(1);
35243   }
35244
35245   optval = 1;
35246   optlen = sizeof(optval);
35247   if(setsockopt(s, SOL_SOCKET, SO_RCVBUFFORCE, &optval, optlen) < 0) {
35248      perror("setsockopt: SOL_SOCKET SO_RCVBUFFORCE");
35249      close(s);
35250      exit(1);
35251   }
35252  ;
35253  return 0;
35254}
35255_ACEOF
35256if ac_fn_c_try_compile "$LINENO"; then :
35257  _compileok=1
35258fi
35259rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35260
35261  if test x"${_compileok}" != x; then
35262    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
35263$as_echo "yes" >&6; }
35264
35265cat >>confdefs.h <<_ACEOF
35266#define HAVE_SO_RCVBUFFORCE 1
35267_ACEOF
35268
35269cat >>confdefs.h <<_ACEOF
35270#define SOCKS_SO_RCVBUFFORCE_LVL SOL_SOCKET
35271_ACEOF
35272
35273cat >>confdefs.h <<_ACEOF
35274#define SOCKS_SO_RCVBUFFORCE_NAME "so_rcvbufforce"
35275_ACEOF
35276    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
35277       #ipv4-only
35278
35279cat >>confdefs.h <<_ACEOF
35280#define SOCKS_SO_RCVBUFFORCE_IPV4 1
35281_ACEOF
35282
35283cat >>confdefs.h <<_ACEOF
35284#define SOCKS_SO_RCVBUFFORCE_IPV6 0
35285_ACEOF
35286    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
35287       #ipv6-only
35288
35289cat >>confdefs.h <<_ACEOF
35290#define SOCKS_SO_RCVBUFFORCE_IPV4 0
35291_ACEOF
35292
35293cat >>confdefs.h <<_ACEOF
35294#define SOCKS_SO_RCVBUFFORCE_IPV6 1
35295_ACEOF
35296    else
35297       #both ipv4 and ipv6
35298
35299cat >>confdefs.h <<_ACEOF
35300#define SOCKS_SO_RCVBUFFORCE_IPV4 1
35301_ACEOF
35302
35303cat >>confdefs.h <<_ACEOF
35304#define SOCKS_SO_RCVBUFFORCE_IPV6 1
35305_ACEOF
35306    fi
35307    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_RCVBUFFORCE"
35308  else
35309    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
35310$as_echo "no" >&6; }
35311  fi
35312unset _compileok
35313  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_RCVLOWAT" >&5
35314$as_echo_n "checking for SOL_SOCKET socket option SO_RCVLOWAT... " >&6; }
35315  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35316/* end confdefs.h.  */
35317
35318#include <sys/types.h>
35319#include <sys/socket.h>
35320#include <netinet/in.h>
35321#include <netinet/tcp.h>
35322#include <netinet/udp.h>
35323
35324#include <stdio.h>
35325#include <stdlib.h>
35326#include <unistd.h>
35327
35328int
35329main ()
35330{
35331
35332   socklen_t optlen;
35333   int optval;
35334   int stype;
35335   int ptype;
35336   int s;
35337
35338   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35339      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35340      ptype = IPPROTO_TCP;
35341   } else if (SOL_SOCKET == IPPROTO_IP) {
35342      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35343      ptype = IPPROTO_IP;
35344   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35345      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35346      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35347   } else if (SOL_SOCKET == IPPROTO_UDP) {
35348      stype = SOCK_DGRAM;
35349      ptype = IPPROTO_UDP;
35350   } else {
35351       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35352       exit(1);
35353   }
35354
35355   if((s = socket(PF_INET, stype, ptype)) < 0) {
35356      perror("socket");
35357      exit(1);
35358   }
35359
35360   optval = 1;
35361   optlen = sizeof(optval);
35362   if(setsockopt(s, SOL_SOCKET, SO_RCVLOWAT, &optval, optlen) < 0) {
35363      perror("setsockopt: SOL_SOCKET SO_RCVLOWAT");
35364      close(s);
35365      exit(1);
35366   }
35367  ;
35368  return 0;
35369}
35370_ACEOF
35371if ac_fn_c_try_compile "$LINENO"; then :
35372  _compileok=1
35373fi
35374rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35375
35376  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35377/* end confdefs.h.  */
35378
35379#include <sys/types.h>
35380#include <sys/socket.h>
35381#include <netinet/in.h>
35382#include <netinet/tcp.h>
35383#include <netinet/udp.h>
35384
35385#include <stdio.h>
35386#include <stdlib.h>
35387#include <unistd.h>
35388
35389int
35390main ()
35391{
35392
35393   socklen_t optlen;
35394   int optval;
35395   int stype;
35396   int ptype;
35397   int s;
35398
35399   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35400      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35401      ptype = IPPROTO_TCP;
35402   } else if (SOL_SOCKET == IPPROTO_IP) {
35403      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35404      ptype = IPPROTO_IP;
35405   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35406      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35407      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35408   } else if (SOL_SOCKET == IPPROTO_UDP) {
35409      stype = SOCK_DGRAM;
35410      ptype = IPPROTO_UDP;
35411   } else {
35412       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35413       exit(1);
35414   }
35415
35416   if((s = socket(PF_INET6, stype, ptype)) < 0) {
35417      perror("socket");
35418      exit(1);
35419   }
35420
35421   optval = 1;
35422   optlen = sizeof(optval);
35423   if(setsockopt(s, SOL_SOCKET, SO_RCVLOWAT, &optval, optlen) < 0) {
35424      perror("setsockopt: SOL_SOCKET SO_RCVLOWAT");
35425      close(s);
35426      exit(1);
35427   }
35428  ;
35429  return 0;
35430}
35431_ACEOF
35432if ac_fn_c_try_compile "$LINENO"; then :
35433  _compileok=1
35434fi
35435rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35436
35437  if test x"${_compileok}" != x; then
35438    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
35439$as_echo "yes" >&6; }
35440
35441cat >>confdefs.h <<_ACEOF
35442#define HAVE_SO_RCVLOWAT 1
35443_ACEOF
35444
35445cat >>confdefs.h <<_ACEOF
35446#define SOCKS_SO_RCVLOWAT_LVL SOL_SOCKET
35447_ACEOF
35448
35449cat >>confdefs.h <<_ACEOF
35450#define SOCKS_SO_RCVLOWAT_NAME "so_rcvlowat"
35451_ACEOF
35452    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
35453       #ipv4-only
35454
35455cat >>confdefs.h <<_ACEOF
35456#define SOCKS_SO_RCVLOWAT_IPV4 1
35457_ACEOF
35458
35459cat >>confdefs.h <<_ACEOF
35460#define SOCKS_SO_RCVLOWAT_IPV6 0
35461_ACEOF
35462    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
35463       #ipv6-only
35464
35465cat >>confdefs.h <<_ACEOF
35466#define SOCKS_SO_RCVLOWAT_IPV4 0
35467_ACEOF
35468
35469cat >>confdefs.h <<_ACEOF
35470#define SOCKS_SO_RCVLOWAT_IPV6 1
35471_ACEOF
35472    else
35473       #both ipv4 and ipv6
35474
35475cat >>confdefs.h <<_ACEOF
35476#define SOCKS_SO_RCVLOWAT_IPV4 1
35477_ACEOF
35478
35479cat >>confdefs.h <<_ACEOF
35480#define SOCKS_SO_RCVLOWAT_IPV6 1
35481_ACEOF
35482    fi
35483    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_RCVLOWAT"
35484  else
35485    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
35486$as_echo "no" >&6; }
35487  fi
35488unset _compileok
35489  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_RCVTIMEO" >&5
35490$as_echo_n "checking for SOL_SOCKET socket option SO_RCVTIMEO... " >&6; }
35491  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35492/* end confdefs.h.  */
35493
35494#include <sys/types.h>
35495#include <sys/socket.h>
35496#include <netinet/in.h>
35497#include <netinet/tcp.h>
35498#include <netinet/udp.h>
35499
35500#include <stdio.h>
35501#include <stdlib.h>
35502#include <unistd.h>
35503
35504int
35505main ()
35506{
35507
35508   socklen_t optlen;
35509   int optval;
35510   int stype;
35511   int ptype;
35512   int s;
35513
35514   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35515      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35516      ptype = IPPROTO_TCP;
35517   } else if (SOL_SOCKET == IPPROTO_IP) {
35518      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35519      ptype = IPPROTO_IP;
35520   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35521      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35522      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35523   } else if (SOL_SOCKET == IPPROTO_UDP) {
35524      stype = SOCK_DGRAM;
35525      ptype = IPPROTO_UDP;
35526   } else {
35527       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35528       exit(1);
35529   }
35530
35531   if((s = socket(PF_INET, stype, ptype)) < 0) {
35532      perror("socket");
35533      exit(1);
35534   }
35535
35536   optval = 1;
35537   optlen = sizeof(optval);
35538   if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &optval, optlen) < 0) {
35539      perror("setsockopt: SOL_SOCKET SO_RCVTIMEO");
35540      close(s);
35541      exit(1);
35542   }
35543  ;
35544  return 0;
35545}
35546_ACEOF
35547if ac_fn_c_try_compile "$LINENO"; then :
35548  _compileok=1
35549fi
35550rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35551
35552  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35553/* end confdefs.h.  */
35554
35555#include <sys/types.h>
35556#include <sys/socket.h>
35557#include <netinet/in.h>
35558#include <netinet/tcp.h>
35559#include <netinet/udp.h>
35560
35561#include <stdio.h>
35562#include <stdlib.h>
35563#include <unistd.h>
35564
35565int
35566main ()
35567{
35568
35569   socklen_t optlen;
35570   int optval;
35571   int stype;
35572   int ptype;
35573   int s;
35574
35575   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35576      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35577      ptype = IPPROTO_TCP;
35578   } else if (SOL_SOCKET == IPPROTO_IP) {
35579      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35580      ptype = IPPROTO_IP;
35581   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35582      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35583      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35584   } else if (SOL_SOCKET == IPPROTO_UDP) {
35585      stype = SOCK_DGRAM;
35586      ptype = IPPROTO_UDP;
35587   } else {
35588       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35589       exit(1);
35590   }
35591
35592   if((s = socket(PF_INET6, stype, ptype)) < 0) {
35593      perror("socket");
35594      exit(1);
35595   }
35596
35597   optval = 1;
35598   optlen = sizeof(optval);
35599   if(setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &optval, optlen) < 0) {
35600      perror("setsockopt: SOL_SOCKET SO_RCVTIMEO");
35601      close(s);
35602      exit(1);
35603   }
35604  ;
35605  return 0;
35606}
35607_ACEOF
35608if ac_fn_c_try_compile "$LINENO"; then :
35609  _compileok=1
35610fi
35611rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35612
35613  if test x"${_compileok}" != x; then
35614    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
35615$as_echo "yes" >&6; }
35616
35617cat >>confdefs.h <<_ACEOF
35618#define HAVE_SO_RCVTIMEO 1
35619_ACEOF
35620
35621cat >>confdefs.h <<_ACEOF
35622#define SOCKS_SO_RCVTIMEO_LVL SOL_SOCKET
35623_ACEOF
35624
35625cat >>confdefs.h <<_ACEOF
35626#define SOCKS_SO_RCVTIMEO_NAME "so_rcvtimeo"
35627_ACEOF
35628    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
35629       #ipv4-only
35630
35631cat >>confdefs.h <<_ACEOF
35632#define SOCKS_SO_RCVTIMEO_IPV4 1
35633_ACEOF
35634
35635cat >>confdefs.h <<_ACEOF
35636#define SOCKS_SO_RCVTIMEO_IPV6 0
35637_ACEOF
35638    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
35639       #ipv6-only
35640
35641cat >>confdefs.h <<_ACEOF
35642#define SOCKS_SO_RCVTIMEO_IPV4 0
35643_ACEOF
35644
35645cat >>confdefs.h <<_ACEOF
35646#define SOCKS_SO_RCVTIMEO_IPV6 1
35647_ACEOF
35648    else
35649       #both ipv4 and ipv6
35650
35651cat >>confdefs.h <<_ACEOF
35652#define SOCKS_SO_RCVTIMEO_IPV4 1
35653_ACEOF
35654
35655cat >>confdefs.h <<_ACEOF
35656#define SOCKS_SO_RCVTIMEO_IPV6 1
35657_ACEOF
35658    fi
35659    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_RCVTIMEO"
35660  else
35661    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
35662$as_echo "no" >&6; }
35663  fi #timeval arg
35664unset _compileok
35665  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_SNDBUF" >&5
35666$as_echo_n "checking for SOL_SOCKET socket option SO_SNDBUF... " >&6; }
35667  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35668/* end confdefs.h.  */
35669
35670#include <sys/types.h>
35671#include <sys/socket.h>
35672#include <netinet/in.h>
35673#include <netinet/tcp.h>
35674#include <netinet/udp.h>
35675
35676#include <stdio.h>
35677#include <stdlib.h>
35678#include <unistd.h>
35679
35680int
35681main ()
35682{
35683
35684   socklen_t optlen;
35685   int optval;
35686   int stype;
35687   int ptype;
35688   int s;
35689
35690   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35691      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35692      ptype = IPPROTO_TCP;
35693   } else if (SOL_SOCKET == IPPROTO_IP) {
35694      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35695      ptype = IPPROTO_IP;
35696   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35697      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35698      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35699   } else if (SOL_SOCKET == IPPROTO_UDP) {
35700      stype = SOCK_DGRAM;
35701      ptype = IPPROTO_UDP;
35702   } else {
35703       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35704       exit(1);
35705   }
35706
35707   if((s = socket(PF_INET, stype, ptype)) < 0) {
35708      perror("socket");
35709      exit(1);
35710   }
35711
35712   optval = 1;
35713   optlen = sizeof(optval);
35714   if(setsockopt(s, SOL_SOCKET, SO_SNDBUF, &optval, optlen) < 0) {
35715      perror("setsockopt: SOL_SOCKET SO_SNDBUF");
35716      close(s);
35717      exit(1);
35718   }
35719  ;
35720  return 0;
35721}
35722_ACEOF
35723if ac_fn_c_try_compile "$LINENO"; then :
35724  _compileok=1
35725fi
35726rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35727
35728  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35729/* end confdefs.h.  */
35730
35731#include <sys/types.h>
35732#include <sys/socket.h>
35733#include <netinet/in.h>
35734#include <netinet/tcp.h>
35735#include <netinet/udp.h>
35736
35737#include <stdio.h>
35738#include <stdlib.h>
35739#include <unistd.h>
35740
35741int
35742main ()
35743{
35744
35745   socklen_t optlen;
35746   int optval;
35747   int stype;
35748   int ptype;
35749   int s;
35750
35751   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35752      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35753      ptype = IPPROTO_TCP;
35754   } else if (SOL_SOCKET == IPPROTO_IP) {
35755      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35756      ptype = IPPROTO_IP;
35757   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35758      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35759      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35760   } else if (SOL_SOCKET == IPPROTO_UDP) {
35761      stype = SOCK_DGRAM;
35762      ptype = IPPROTO_UDP;
35763   } else {
35764       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35765       exit(1);
35766   }
35767
35768   if((s = socket(PF_INET6, stype, ptype)) < 0) {
35769      perror("socket");
35770      exit(1);
35771   }
35772
35773   optval = 1;
35774   optlen = sizeof(optval);
35775   if(setsockopt(s, SOL_SOCKET, SO_SNDBUF, &optval, optlen) < 0) {
35776      perror("setsockopt: SOL_SOCKET SO_SNDBUF");
35777      close(s);
35778      exit(1);
35779   }
35780  ;
35781  return 0;
35782}
35783_ACEOF
35784if ac_fn_c_try_compile "$LINENO"; then :
35785  _compileok=1
35786fi
35787rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35788
35789  if test x"${_compileok}" != x; then
35790    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
35791$as_echo "yes" >&6; }
35792
35793cat >>confdefs.h <<_ACEOF
35794#define HAVE_SO_SNDBUF 1
35795_ACEOF
35796
35797cat >>confdefs.h <<_ACEOF
35798#define SOCKS_SO_SNDBUF_LVL SOL_SOCKET
35799_ACEOF
35800
35801cat >>confdefs.h <<_ACEOF
35802#define SOCKS_SO_SNDBUF_NAME "so_sndbuf"
35803_ACEOF
35804    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
35805       #ipv4-only
35806
35807cat >>confdefs.h <<_ACEOF
35808#define SOCKS_SO_SNDBUF_IPV4 1
35809_ACEOF
35810
35811cat >>confdefs.h <<_ACEOF
35812#define SOCKS_SO_SNDBUF_IPV6 0
35813_ACEOF
35814    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
35815       #ipv6-only
35816
35817cat >>confdefs.h <<_ACEOF
35818#define SOCKS_SO_SNDBUF_IPV4 0
35819_ACEOF
35820
35821cat >>confdefs.h <<_ACEOF
35822#define SOCKS_SO_SNDBUF_IPV6 1
35823_ACEOF
35824    else
35825       #both ipv4 and ipv6
35826
35827cat >>confdefs.h <<_ACEOF
35828#define SOCKS_SO_SNDBUF_IPV4 1
35829_ACEOF
35830
35831cat >>confdefs.h <<_ACEOF
35832#define SOCKS_SO_SNDBUF_IPV6 1
35833_ACEOF
35834    fi
35835    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_SNDBUF"
35836  else
35837    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
35838$as_echo "no" >&6; }
35839  fi
35840unset _compileok
35841  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_SNDBUFFORCE" >&5
35842$as_echo_n "checking for SOL_SOCKET socket option SO_SNDBUFFORCE... " >&6; }
35843  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35844/* end confdefs.h.  */
35845
35846#include <sys/types.h>
35847#include <sys/socket.h>
35848#include <netinet/in.h>
35849#include <netinet/tcp.h>
35850#include <netinet/udp.h>
35851
35852#include <stdio.h>
35853#include <stdlib.h>
35854#include <unistd.h>
35855
35856int
35857main ()
35858{
35859
35860   socklen_t optlen;
35861   int optval;
35862   int stype;
35863   int ptype;
35864   int s;
35865
35866   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35867      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35868      ptype = IPPROTO_TCP;
35869   } else if (SOL_SOCKET == IPPROTO_IP) {
35870      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35871      ptype = IPPROTO_IP;
35872   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35873      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35874      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35875   } else if (SOL_SOCKET == IPPROTO_UDP) {
35876      stype = SOCK_DGRAM;
35877      ptype = IPPROTO_UDP;
35878   } else {
35879       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35880       exit(1);
35881   }
35882
35883   if((s = socket(PF_INET, stype, ptype)) < 0) {
35884      perror("socket");
35885      exit(1);
35886   }
35887
35888   optval = 1;
35889   optlen = sizeof(optval);
35890   if(setsockopt(s, SOL_SOCKET, SO_SNDBUFFORCE, &optval, optlen) < 0) {
35891      perror("setsockopt: SOL_SOCKET SO_SNDBUFFORCE");
35892      close(s);
35893      exit(1);
35894   }
35895  ;
35896  return 0;
35897}
35898_ACEOF
35899if ac_fn_c_try_compile "$LINENO"; then :
35900  _compileok=1
35901fi
35902rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35903
35904  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
35905/* end confdefs.h.  */
35906
35907#include <sys/types.h>
35908#include <sys/socket.h>
35909#include <netinet/in.h>
35910#include <netinet/tcp.h>
35911#include <netinet/udp.h>
35912
35913#include <stdio.h>
35914#include <stdlib.h>
35915#include <unistd.h>
35916
35917int
35918main ()
35919{
35920
35921   socklen_t optlen;
35922   int optval;
35923   int stype;
35924   int ptype;
35925   int s;
35926
35927   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
35928      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
35929      ptype = IPPROTO_TCP;
35930   } else if (SOL_SOCKET == IPPROTO_IP) {
35931      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
35932      ptype = IPPROTO_IP;
35933   } else if (SOL_SOCKET == IPPROTO_IPV6) {
35934      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
35935      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
35936   } else if (SOL_SOCKET == IPPROTO_UDP) {
35937      stype = SOCK_DGRAM;
35938      ptype = IPPROTO_UDP;
35939   } else {
35940       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
35941       exit(1);
35942   }
35943
35944   if((s = socket(PF_INET6, stype, ptype)) < 0) {
35945      perror("socket");
35946      exit(1);
35947   }
35948
35949   optval = 1;
35950   optlen = sizeof(optval);
35951   if(setsockopt(s, SOL_SOCKET, SO_SNDBUFFORCE, &optval, optlen) < 0) {
35952      perror("setsockopt: SOL_SOCKET SO_SNDBUFFORCE");
35953      close(s);
35954      exit(1);
35955   }
35956  ;
35957  return 0;
35958}
35959_ACEOF
35960if ac_fn_c_try_compile "$LINENO"; then :
35961  _compileok=1
35962fi
35963rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
35964
35965  if test x"${_compileok}" != x; then
35966    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
35967$as_echo "yes" >&6; }
35968
35969cat >>confdefs.h <<_ACEOF
35970#define HAVE_SO_SNDBUFFORCE 1
35971_ACEOF
35972
35973cat >>confdefs.h <<_ACEOF
35974#define SOCKS_SO_SNDBUFFORCE_LVL SOL_SOCKET
35975_ACEOF
35976
35977cat >>confdefs.h <<_ACEOF
35978#define SOCKS_SO_SNDBUFFORCE_NAME "so_sndbufforce"
35979_ACEOF
35980    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
35981       #ipv4-only
35982
35983cat >>confdefs.h <<_ACEOF
35984#define SOCKS_SO_SNDBUFFORCE_IPV4 1
35985_ACEOF
35986
35987cat >>confdefs.h <<_ACEOF
35988#define SOCKS_SO_SNDBUFFORCE_IPV6 0
35989_ACEOF
35990    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
35991       #ipv6-only
35992
35993cat >>confdefs.h <<_ACEOF
35994#define SOCKS_SO_SNDBUFFORCE_IPV4 0
35995_ACEOF
35996
35997cat >>confdefs.h <<_ACEOF
35998#define SOCKS_SO_SNDBUFFORCE_IPV6 1
35999_ACEOF
36000    else
36001       #both ipv4 and ipv6
36002
36003cat >>confdefs.h <<_ACEOF
36004#define SOCKS_SO_SNDBUFFORCE_IPV4 1
36005_ACEOF
36006
36007cat >>confdefs.h <<_ACEOF
36008#define SOCKS_SO_SNDBUFFORCE_IPV6 1
36009_ACEOF
36010    fi
36011    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_SNDBUFFORCE"
36012  else
36013    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
36014$as_echo "no" >&6; }
36015  fi
36016unset _compileok
36017  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_SNDLOWAT" >&5
36018$as_echo_n "checking for SOL_SOCKET socket option SO_SNDLOWAT... " >&6; }
36019  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36020/* end confdefs.h.  */
36021
36022#include <sys/types.h>
36023#include <sys/socket.h>
36024#include <netinet/in.h>
36025#include <netinet/tcp.h>
36026#include <netinet/udp.h>
36027
36028#include <stdio.h>
36029#include <stdlib.h>
36030#include <unistd.h>
36031
36032int
36033main ()
36034{
36035
36036   socklen_t optlen;
36037   int optval;
36038   int stype;
36039   int ptype;
36040   int s;
36041
36042   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36043      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36044      ptype = IPPROTO_TCP;
36045   } else if (SOL_SOCKET == IPPROTO_IP) {
36046      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36047      ptype = IPPROTO_IP;
36048   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36049      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36050      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36051   } else if (SOL_SOCKET == IPPROTO_UDP) {
36052      stype = SOCK_DGRAM;
36053      ptype = IPPROTO_UDP;
36054   } else {
36055       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36056       exit(1);
36057   }
36058
36059   if((s = socket(PF_INET, stype, ptype)) < 0) {
36060      perror("socket");
36061      exit(1);
36062   }
36063
36064   optval = 1;
36065   optlen = sizeof(optval);
36066   if(setsockopt(s, SOL_SOCKET, SO_SNDLOWAT, &optval, optlen) < 0) {
36067      perror("setsockopt: SOL_SOCKET SO_SNDLOWAT");
36068      close(s);
36069      exit(1);
36070   }
36071  ;
36072  return 0;
36073}
36074_ACEOF
36075if ac_fn_c_try_compile "$LINENO"; then :
36076  _compileok=1
36077fi
36078rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36079
36080  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36081/* end confdefs.h.  */
36082
36083#include <sys/types.h>
36084#include <sys/socket.h>
36085#include <netinet/in.h>
36086#include <netinet/tcp.h>
36087#include <netinet/udp.h>
36088
36089#include <stdio.h>
36090#include <stdlib.h>
36091#include <unistd.h>
36092
36093int
36094main ()
36095{
36096
36097   socklen_t optlen;
36098   int optval;
36099   int stype;
36100   int ptype;
36101   int s;
36102
36103   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36104      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36105      ptype = IPPROTO_TCP;
36106   } else if (SOL_SOCKET == IPPROTO_IP) {
36107      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36108      ptype = IPPROTO_IP;
36109   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36110      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36111      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36112   } else if (SOL_SOCKET == IPPROTO_UDP) {
36113      stype = SOCK_DGRAM;
36114      ptype = IPPROTO_UDP;
36115   } else {
36116       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36117       exit(1);
36118   }
36119
36120   if((s = socket(PF_INET6, stype, ptype)) < 0) {
36121      perror("socket");
36122      exit(1);
36123   }
36124
36125   optval = 1;
36126   optlen = sizeof(optval);
36127   if(setsockopt(s, SOL_SOCKET, SO_SNDLOWAT, &optval, optlen) < 0) {
36128      perror("setsockopt: SOL_SOCKET SO_SNDLOWAT");
36129      close(s);
36130      exit(1);
36131   }
36132  ;
36133  return 0;
36134}
36135_ACEOF
36136if ac_fn_c_try_compile "$LINENO"; then :
36137  _compileok=1
36138fi
36139rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36140
36141  if test x"${_compileok}" != x; then
36142    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
36143$as_echo "yes" >&6; }
36144
36145cat >>confdefs.h <<_ACEOF
36146#define HAVE_SO_SNDLOWAT 1
36147_ACEOF
36148
36149cat >>confdefs.h <<_ACEOF
36150#define SOCKS_SO_SNDLOWAT_LVL SOL_SOCKET
36151_ACEOF
36152
36153cat >>confdefs.h <<_ACEOF
36154#define SOCKS_SO_SNDLOWAT_NAME "so_sndlowat"
36155_ACEOF
36156    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
36157       #ipv4-only
36158
36159cat >>confdefs.h <<_ACEOF
36160#define SOCKS_SO_SNDLOWAT_IPV4 1
36161_ACEOF
36162
36163cat >>confdefs.h <<_ACEOF
36164#define SOCKS_SO_SNDLOWAT_IPV6 0
36165_ACEOF
36166    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
36167       #ipv6-only
36168
36169cat >>confdefs.h <<_ACEOF
36170#define SOCKS_SO_SNDLOWAT_IPV4 0
36171_ACEOF
36172
36173cat >>confdefs.h <<_ACEOF
36174#define SOCKS_SO_SNDLOWAT_IPV6 1
36175_ACEOF
36176    else
36177       #both ipv4 and ipv6
36178
36179cat >>confdefs.h <<_ACEOF
36180#define SOCKS_SO_SNDLOWAT_IPV4 1
36181_ACEOF
36182
36183cat >>confdefs.h <<_ACEOF
36184#define SOCKS_SO_SNDLOWAT_IPV6 1
36185_ACEOF
36186    fi
36187    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_SNDLOWAT"
36188  else
36189    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
36190$as_echo "no" >&6; }
36191  fi
36192unset _compileok
36193  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_SNDTIMEO" >&5
36194$as_echo_n "checking for SOL_SOCKET socket option SO_SNDTIMEO... " >&6; }
36195  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36196/* end confdefs.h.  */
36197
36198#include <sys/types.h>
36199#include <sys/socket.h>
36200#include <netinet/in.h>
36201#include <netinet/tcp.h>
36202#include <netinet/udp.h>
36203
36204#include <stdio.h>
36205#include <stdlib.h>
36206#include <unistd.h>
36207
36208int
36209main ()
36210{
36211
36212   socklen_t optlen;
36213   int optval;
36214   int stype;
36215   int ptype;
36216   int s;
36217
36218   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36219      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36220      ptype = IPPROTO_TCP;
36221   } else if (SOL_SOCKET == IPPROTO_IP) {
36222      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36223      ptype = IPPROTO_IP;
36224   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36225      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36226      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36227   } else if (SOL_SOCKET == IPPROTO_UDP) {
36228      stype = SOCK_DGRAM;
36229      ptype = IPPROTO_UDP;
36230   } else {
36231       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36232       exit(1);
36233   }
36234
36235   if((s = socket(PF_INET, stype, ptype)) < 0) {
36236      perror("socket");
36237      exit(1);
36238   }
36239
36240   optval = 1;
36241   optlen = sizeof(optval);
36242   if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &optval, optlen) < 0) {
36243      perror("setsockopt: SOL_SOCKET SO_SNDTIMEO");
36244      close(s);
36245      exit(1);
36246   }
36247  ;
36248  return 0;
36249}
36250_ACEOF
36251if ac_fn_c_try_compile "$LINENO"; then :
36252  _compileok=1
36253fi
36254rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36255
36256  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36257/* end confdefs.h.  */
36258
36259#include <sys/types.h>
36260#include <sys/socket.h>
36261#include <netinet/in.h>
36262#include <netinet/tcp.h>
36263#include <netinet/udp.h>
36264
36265#include <stdio.h>
36266#include <stdlib.h>
36267#include <unistd.h>
36268
36269int
36270main ()
36271{
36272
36273   socklen_t optlen;
36274   int optval;
36275   int stype;
36276   int ptype;
36277   int s;
36278
36279   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36280      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36281      ptype = IPPROTO_TCP;
36282   } else if (SOL_SOCKET == IPPROTO_IP) {
36283      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36284      ptype = IPPROTO_IP;
36285   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36286      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36287      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36288   } else if (SOL_SOCKET == IPPROTO_UDP) {
36289      stype = SOCK_DGRAM;
36290      ptype = IPPROTO_UDP;
36291   } else {
36292       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36293       exit(1);
36294   }
36295
36296   if((s = socket(PF_INET6, stype, ptype)) < 0) {
36297      perror("socket");
36298      exit(1);
36299   }
36300
36301   optval = 1;
36302   optlen = sizeof(optval);
36303   if(setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &optval, optlen) < 0) {
36304      perror("setsockopt: SOL_SOCKET SO_SNDTIMEO");
36305      close(s);
36306      exit(1);
36307   }
36308  ;
36309  return 0;
36310}
36311_ACEOF
36312if ac_fn_c_try_compile "$LINENO"; then :
36313  _compileok=1
36314fi
36315rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36316
36317  if test x"${_compileok}" != x; then
36318    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
36319$as_echo "yes" >&6; }
36320
36321cat >>confdefs.h <<_ACEOF
36322#define HAVE_SO_SNDTIMEO 1
36323_ACEOF
36324
36325cat >>confdefs.h <<_ACEOF
36326#define SOCKS_SO_SNDTIMEO_LVL SOL_SOCKET
36327_ACEOF
36328
36329cat >>confdefs.h <<_ACEOF
36330#define SOCKS_SO_SNDTIMEO_NAME "so_sndtimeo"
36331_ACEOF
36332    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
36333       #ipv4-only
36334
36335cat >>confdefs.h <<_ACEOF
36336#define SOCKS_SO_SNDTIMEO_IPV4 1
36337_ACEOF
36338
36339cat >>confdefs.h <<_ACEOF
36340#define SOCKS_SO_SNDTIMEO_IPV6 0
36341_ACEOF
36342    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
36343       #ipv6-only
36344
36345cat >>confdefs.h <<_ACEOF
36346#define SOCKS_SO_SNDTIMEO_IPV4 0
36347_ACEOF
36348
36349cat >>confdefs.h <<_ACEOF
36350#define SOCKS_SO_SNDTIMEO_IPV6 1
36351_ACEOF
36352    else
36353       #both ipv4 and ipv6
36354
36355cat >>confdefs.h <<_ACEOF
36356#define SOCKS_SO_SNDTIMEO_IPV4 1
36357_ACEOF
36358
36359cat >>confdefs.h <<_ACEOF
36360#define SOCKS_SO_SNDTIMEO_IPV6 1
36361_ACEOF
36362    fi
36363    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_SNDTIMEO"
36364  else
36365    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
36366$as_echo "no" >&6; }
36367  fi #timeval arg
36368unset _compileok
36369  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_TIMESTAMP" >&5
36370$as_echo_n "checking for SOL_SOCKET socket option SO_TIMESTAMP... " >&6; }
36371  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36372/* end confdefs.h.  */
36373
36374#include <sys/types.h>
36375#include <sys/socket.h>
36376#include <netinet/in.h>
36377#include <netinet/tcp.h>
36378#include <netinet/udp.h>
36379
36380#include <stdio.h>
36381#include <stdlib.h>
36382#include <unistd.h>
36383
36384int
36385main ()
36386{
36387
36388   socklen_t optlen;
36389   int optval;
36390   int stype;
36391   int ptype;
36392   int s;
36393
36394   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36395      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36396      ptype = IPPROTO_TCP;
36397   } else if (SOL_SOCKET == IPPROTO_IP) {
36398      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36399      ptype = IPPROTO_IP;
36400   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36401      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36402      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36403   } else if (SOL_SOCKET == IPPROTO_UDP) {
36404      stype = SOCK_DGRAM;
36405      ptype = IPPROTO_UDP;
36406   } else {
36407       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36408       exit(1);
36409   }
36410
36411   if((s = socket(PF_INET, stype, ptype)) < 0) {
36412      perror("socket");
36413      exit(1);
36414   }
36415
36416   optval = 1;
36417   optlen = sizeof(optval);
36418   if(setsockopt(s, SOL_SOCKET, SO_TIMESTAMP, &optval, optlen) < 0) {
36419      perror("setsockopt: SOL_SOCKET SO_TIMESTAMP");
36420      close(s);
36421      exit(1);
36422   }
36423  ;
36424  return 0;
36425}
36426_ACEOF
36427if ac_fn_c_try_compile "$LINENO"; then :
36428  _compileok=1
36429fi
36430rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36431
36432  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36433/* end confdefs.h.  */
36434
36435#include <sys/types.h>
36436#include <sys/socket.h>
36437#include <netinet/in.h>
36438#include <netinet/tcp.h>
36439#include <netinet/udp.h>
36440
36441#include <stdio.h>
36442#include <stdlib.h>
36443#include <unistd.h>
36444
36445int
36446main ()
36447{
36448
36449   socklen_t optlen;
36450   int optval;
36451   int stype;
36452   int ptype;
36453   int s;
36454
36455   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36456      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36457      ptype = IPPROTO_TCP;
36458   } else if (SOL_SOCKET == IPPROTO_IP) {
36459      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36460      ptype = IPPROTO_IP;
36461   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36462      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36463      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36464   } else if (SOL_SOCKET == IPPROTO_UDP) {
36465      stype = SOCK_DGRAM;
36466      ptype = IPPROTO_UDP;
36467   } else {
36468       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36469       exit(1);
36470   }
36471
36472   if((s = socket(PF_INET6, stype, ptype)) < 0) {
36473      perror("socket");
36474      exit(1);
36475   }
36476
36477   optval = 1;
36478   optlen = sizeof(optval);
36479   if(setsockopt(s, SOL_SOCKET, SO_TIMESTAMP, &optval, optlen) < 0) {
36480      perror("setsockopt: SOL_SOCKET SO_TIMESTAMP");
36481      close(s);
36482      exit(1);
36483   }
36484  ;
36485  return 0;
36486}
36487_ACEOF
36488if ac_fn_c_try_compile "$LINENO"; then :
36489  _compileok=1
36490fi
36491rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36492
36493  if test x"${_compileok}" != x; then
36494    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
36495$as_echo "yes" >&6; }
36496
36497cat >>confdefs.h <<_ACEOF
36498#define HAVE_SO_TIMESTAMP 1
36499_ACEOF
36500
36501cat >>confdefs.h <<_ACEOF
36502#define SOCKS_SO_TIMESTAMP_LVL SOL_SOCKET
36503_ACEOF
36504
36505cat >>confdefs.h <<_ACEOF
36506#define SOCKS_SO_TIMESTAMP_NAME "so_timestamp"
36507_ACEOF
36508    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
36509       #ipv4-only
36510
36511cat >>confdefs.h <<_ACEOF
36512#define SOCKS_SO_TIMESTAMP_IPV4 1
36513_ACEOF
36514
36515cat >>confdefs.h <<_ACEOF
36516#define SOCKS_SO_TIMESTAMP_IPV6 0
36517_ACEOF
36518    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
36519       #ipv6-only
36520
36521cat >>confdefs.h <<_ACEOF
36522#define SOCKS_SO_TIMESTAMP_IPV4 0
36523_ACEOF
36524
36525cat >>confdefs.h <<_ACEOF
36526#define SOCKS_SO_TIMESTAMP_IPV6 1
36527_ACEOF
36528    else
36529       #both ipv4 and ipv6
36530
36531cat >>confdefs.h <<_ACEOF
36532#define SOCKS_SO_TIMESTAMP_IPV4 1
36533_ACEOF
36534
36535cat >>confdefs.h <<_ACEOF
36536#define SOCKS_SO_TIMESTAMP_IPV6 1
36537_ACEOF
36538    fi
36539    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_TIMESTAMP"
36540  else
36541    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
36542$as_echo "no" >&6; }
36543  fi #XXX requires additional code
36544unset _compileok
36545  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_USELOOPBACK" >&5
36546$as_echo_n "checking for SOL_SOCKET socket option SO_USELOOPBACK... " >&6; }
36547  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36548/* end confdefs.h.  */
36549
36550#include <sys/types.h>
36551#include <sys/socket.h>
36552#include <netinet/in.h>
36553#include <netinet/tcp.h>
36554#include <netinet/udp.h>
36555
36556#include <stdio.h>
36557#include <stdlib.h>
36558#include <unistd.h>
36559
36560int
36561main ()
36562{
36563
36564   socklen_t optlen;
36565   int optval;
36566   int stype;
36567   int ptype;
36568   int s;
36569
36570   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36571      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36572      ptype = IPPROTO_TCP;
36573   } else if (SOL_SOCKET == IPPROTO_IP) {
36574      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36575      ptype = IPPROTO_IP;
36576   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36577      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36578      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36579   } else if (SOL_SOCKET == IPPROTO_UDP) {
36580      stype = SOCK_DGRAM;
36581      ptype = IPPROTO_UDP;
36582   } else {
36583       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36584       exit(1);
36585   }
36586
36587   if((s = socket(PF_INET, stype, ptype)) < 0) {
36588      perror("socket");
36589      exit(1);
36590   }
36591
36592   optval = 1;
36593   optlen = sizeof(optval);
36594   if(setsockopt(s, SOL_SOCKET, SO_USELOOPBACK, &optval, optlen) < 0) {
36595      perror("setsockopt: SOL_SOCKET SO_USELOOPBACK");
36596      close(s);
36597      exit(1);
36598   }
36599  ;
36600  return 0;
36601}
36602_ACEOF
36603if ac_fn_c_try_compile "$LINENO"; then :
36604  _compileok=1
36605fi
36606rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36607
36608  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36609/* end confdefs.h.  */
36610
36611#include <sys/types.h>
36612#include <sys/socket.h>
36613#include <netinet/in.h>
36614#include <netinet/tcp.h>
36615#include <netinet/udp.h>
36616
36617#include <stdio.h>
36618#include <stdlib.h>
36619#include <unistd.h>
36620
36621int
36622main ()
36623{
36624
36625   socklen_t optlen;
36626   int optval;
36627   int stype;
36628   int ptype;
36629   int s;
36630
36631   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36632      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36633      ptype = IPPROTO_TCP;
36634   } else if (SOL_SOCKET == IPPROTO_IP) {
36635      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36636      ptype = IPPROTO_IP;
36637   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36638      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36639      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36640   } else if (SOL_SOCKET == IPPROTO_UDP) {
36641      stype = SOCK_DGRAM;
36642      ptype = IPPROTO_UDP;
36643   } else {
36644       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36645       exit(1);
36646   }
36647
36648   if((s = socket(PF_INET6, stype, ptype)) < 0) {
36649      perror("socket");
36650      exit(1);
36651   }
36652
36653   optval = 1;
36654   optlen = sizeof(optval);
36655   if(setsockopt(s, SOL_SOCKET, SO_USELOOPBACK, &optval, optlen) < 0) {
36656      perror("setsockopt: SOL_SOCKET SO_USELOOPBACK");
36657      close(s);
36658      exit(1);
36659   }
36660  ;
36661  return 0;
36662}
36663_ACEOF
36664if ac_fn_c_try_compile "$LINENO"; then :
36665  _compileok=1
36666fi
36667rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36668
36669  if test x"${_compileok}" != x; then
36670    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
36671$as_echo "yes" >&6; }
36672
36673cat >>confdefs.h <<_ACEOF
36674#define HAVE_SO_USELOOPBACK 1
36675_ACEOF
36676
36677cat >>confdefs.h <<_ACEOF
36678#define SOCKS_SO_USELOOPBACK_LVL SOL_SOCKET
36679_ACEOF
36680
36681cat >>confdefs.h <<_ACEOF
36682#define SOCKS_SO_USELOOPBACK_NAME "so_useloopback"
36683_ACEOF
36684    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
36685       #ipv4-only
36686
36687cat >>confdefs.h <<_ACEOF
36688#define SOCKS_SO_USELOOPBACK_IPV4 1
36689_ACEOF
36690
36691cat >>confdefs.h <<_ACEOF
36692#define SOCKS_SO_USELOOPBACK_IPV6 0
36693_ACEOF
36694    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
36695       #ipv6-only
36696
36697cat >>confdefs.h <<_ACEOF
36698#define SOCKS_SO_USELOOPBACK_IPV4 0
36699_ACEOF
36700
36701cat >>confdefs.h <<_ACEOF
36702#define SOCKS_SO_USELOOPBACK_IPV6 1
36703_ACEOF
36704    else
36705       #both ipv4 and ipv6
36706
36707cat >>confdefs.h <<_ACEOF
36708#define SOCKS_SO_USELOOPBACK_IPV4 1
36709_ACEOF
36710
36711cat >>confdefs.h <<_ACEOF
36712#define SOCKS_SO_USELOOPBACK_IPV6 1
36713_ACEOF
36714    fi
36715    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_USELOOPBACK"
36716  else
36717    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
36718$as_echo "no" >&6; }
36719  fi
36720unset _compileok
36721  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_AUDIT" >&5
36722$as_echo_n "checking for SOL_SOCKET socket option SO_AUDIT... " >&6; }
36723  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36724/* end confdefs.h.  */
36725
36726#include <sys/types.h>
36727#include <sys/socket.h>
36728#include <netinet/in.h>
36729#include <netinet/tcp.h>
36730#include <netinet/udp.h>
36731
36732#include <stdio.h>
36733#include <stdlib.h>
36734#include <unistd.h>
36735
36736int
36737main ()
36738{
36739
36740   socklen_t optlen;
36741   int optval;
36742   int stype;
36743   int ptype;
36744   int s;
36745
36746   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36747      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36748      ptype = IPPROTO_TCP;
36749   } else if (SOL_SOCKET == IPPROTO_IP) {
36750      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36751      ptype = IPPROTO_IP;
36752   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36753      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36754      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36755   } else if (SOL_SOCKET == IPPROTO_UDP) {
36756      stype = SOCK_DGRAM;
36757      ptype = IPPROTO_UDP;
36758   } else {
36759       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36760       exit(1);
36761   }
36762
36763   if((s = socket(PF_INET, stype, ptype)) < 0) {
36764      perror("socket");
36765      exit(1);
36766   }
36767
36768   optval = 1;
36769   optlen = sizeof(optval);
36770   if(setsockopt(s, SOL_SOCKET, SO_AUDIT, &optval, optlen) < 0) {
36771      perror("setsockopt: SOL_SOCKET SO_AUDIT");
36772      close(s);
36773      exit(1);
36774   }
36775  ;
36776  return 0;
36777}
36778_ACEOF
36779if ac_fn_c_try_compile "$LINENO"; then :
36780  _compileok=1
36781fi
36782rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36783
36784  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36785/* end confdefs.h.  */
36786
36787#include <sys/types.h>
36788#include <sys/socket.h>
36789#include <netinet/in.h>
36790#include <netinet/tcp.h>
36791#include <netinet/udp.h>
36792
36793#include <stdio.h>
36794#include <stdlib.h>
36795#include <unistd.h>
36796
36797int
36798main ()
36799{
36800
36801   socklen_t optlen;
36802   int optval;
36803   int stype;
36804   int ptype;
36805   int s;
36806
36807   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36808      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36809      ptype = IPPROTO_TCP;
36810   } else if (SOL_SOCKET == IPPROTO_IP) {
36811      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36812      ptype = IPPROTO_IP;
36813   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36814      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36815      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36816   } else if (SOL_SOCKET == IPPROTO_UDP) {
36817      stype = SOCK_DGRAM;
36818      ptype = IPPROTO_UDP;
36819   } else {
36820       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36821       exit(1);
36822   }
36823
36824   if((s = socket(PF_INET6, stype, ptype)) < 0) {
36825      perror("socket");
36826      exit(1);
36827   }
36828
36829   optval = 1;
36830   optlen = sizeof(optval);
36831   if(setsockopt(s, SOL_SOCKET, SO_AUDIT, &optval, optlen) < 0) {
36832      perror("setsockopt: SOL_SOCKET SO_AUDIT");
36833      close(s);
36834      exit(1);
36835   }
36836  ;
36837  return 0;
36838}
36839_ACEOF
36840if ac_fn_c_try_compile "$LINENO"; then :
36841  _compileok=1
36842fi
36843rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36844
36845  if test x"${_compileok}" != x; then
36846    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
36847$as_echo "yes" >&6; }
36848
36849cat >>confdefs.h <<_ACEOF
36850#define HAVE_SO_AUDIT 1
36851_ACEOF
36852
36853cat >>confdefs.h <<_ACEOF
36854#define SOCKS_SO_AUDIT_LVL SOL_SOCKET
36855_ACEOF
36856
36857cat >>confdefs.h <<_ACEOF
36858#define SOCKS_SO_AUDIT_NAME "so_audit"
36859_ACEOF
36860    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
36861       #ipv4-only
36862
36863cat >>confdefs.h <<_ACEOF
36864#define SOCKS_SO_AUDIT_IPV4 1
36865_ACEOF
36866
36867cat >>confdefs.h <<_ACEOF
36868#define SOCKS_SO_AUDIT_IPV6 0
36869_ACEOF
36870    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
36871       #ipv6-only
36872
36873cat >>confdefs.h <<_ACEOF
36874#define SOCKS_SO_AUDIT_IPV4 0
36875_ACEOF
36876
36877cat >>confdefs.h <<_ACEOF
36878#define SOCKS_SO_AUDIT_IPV6 1
36879_ACEOF
36880    else
36881       #both ipv4 and ipv6
36882
36883cat >>confdefs.h <<_ACEOF
36884#define SOCKS_SO_AUDIT_IPV4 1
36885_ACEOF
36886
36887cat >>confdefs.h <<_ACEOF
36888#define SOCKS_SO_AUDIT_IPV6 1
36889_ACEOF
36890    fi
36891    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_AUDIT"
36892  else
36893    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
36894$as_echo "no" >&6; }
36895  fi
36896unset _compileok
36897  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_CKSUMRECV" >&5
36898$as_echo_n "checking for SOL_SOCKET socket option SO_CKSUMRECV... " >&6; }
36899  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36900/* end confdefs.h.  */
36901
36902#include <sys/types.h>
36903#include <sys/socket.h>
36904#include <netinet/in.h>
36905#include <netinet/tcp.h>
36906#include <netinet/udp.h>
36907
36908#include <stdio.h>
36909#include <stdlib.h>
36910#include <unistd.h>
36911
36912int
36913main ()
36914{
36915
36916   socklen_t optlen;
36917   int optval;
36918   int stype;
36919   int ptype;
36920   int s;
36921
36922   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36923      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36924      ptype = IPPROTO_TCP;
36925   } else if (SOL_SOCKET == IPPROTO_IP) {
36926      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36927      ptype = IPPROTO_IP;
36928   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36929      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36930      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36931   } else if (SOL_SOCKET == IPPROTO_UDP) {
36932      stype = SOCK_DGRAM;
36933      ptype = IPPROTO_UDP;
36934   } else {
36935       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36936       exit(1);
36937   }
36938
36939   if((s = socket(PF_INET, stype, ptype)) < 0) {
36940      perror("socket");
36941      exit(1);
36942   }
36943
36944   optval = 1;
36945   optlen = sizeof(optval);
36946   if(setsockopt(s, SOL_SOCKET, SO_CKSUMRECV, &optval, optlen) < 0) {
36947      perror("setsockopt: SOL_SOCKET SO_CKSUMRECV");
36948      close(s);
36949      exit(1);
36950   }
36951  ;
36952  return 0;
36953}
36954_ACEOF
36955if ac_fn_c_try_compile "$LINENO"; then :
36956  _compileok=1
36957fi
36958rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36959
36960  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
36961/* end confdefs.h.  */
36962
36963#include <sys/types.h>
36964#include <sys/socket.h>
36965#include <netinet/in.h>
36966#include <netinet/tcp.h>
36967#include <netinet/udp.h>
36968
36969#include <stdio.h>
36970#include <stdlib.h>
36971#include <unistd.h>
36972
36973int
36974main ()
36975{
36976
36977   socklen_t optlen;
36978   int optval;
36979   int stype;
36980   int ptype;
36981   int s;
36982
36983   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
36984      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
36985      ptype = IPPROTO_TCP;
36986   } else if (SOL_SOCKET == IPPROTO_IP) {
36987      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
36988      ptype = IPPROTO_IP;
36989   } else if (SOL_SOCKET == IPPROTO_IPV6) {
36990      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
36991      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
36992   } else if (SOL_SOCKET == IPPROTO_UDP) {
36993      stype = SOCK_DGRAM;
36994      ptype = IPPROTO_UDP;
36995   } else {
36996       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
36997       exit(1);
36998   }
36999
37000   if((s = socket(PF_INET6, stype, ptype)) < 0) {
37001      perror("socket");
37002      exit(1);
37003   }
37004
37005   optval = 1;
37006   optlen = sizeof(optval);
37007   if(setsockopt(s, SOL_SOCKET, SO_CKSUMRECV, &optval, optlen) < 0) {
37008      perror("setsockopt: SOL_SOCKET SO_CKSUMRECV");
37009      close(s);
37010      exit(1);
37011   }
37012  ;
37013  return 0;
37014}
37015_ACEOF
37016if ac_fn_c_try_compile "$LINENO"; then :
37017  _compileok=1
37018fi
37019rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37020
37021  if test x"${_compileok}" != x; then
37022    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
37023$as_echo "yes" >&6; }
37024
37025cat >>confdefs.h <<_ACEOF
37026#define HAVE_SO_CKSUMRECV 1
37027_ACEOF
37028
37029cat >>confdefs.h <<_ACEOF
37030#define SOCKS_SO_CKSUMRECV_LVL SOL_SOCKET
37031_ACEOF
37032
37033cat >>confdefs.h <<_ACEOF
37034#define SOCKS_SO_CKSUMRECV_NAME "so_cksumrecv"
37035_ACEOF
37036    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
37037       #ipv4-only
37038
37039cat >>confdefs.h <<_ACEOF
37040#define SOCKS_SO_CKSUMRECV_IPV4 1
37041_ACEOF
37042
37043cat >>confdefs.h <<_ACEOF
37044#define SOCKS_SO_CKSUMRECV_IPV6 0
37045_ACEOF
37046    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
37047       #ipv6-only
37048
37049cat >>confdefs.h <<_ACEOF
37050#define SOCKS_SO_CKSUMRECV_IPV4 0
37051_ACEOF
37052
37053cat >>confdefs.h <<_ACEOF
37054#define SOCKS_SO_CKSUMRECV_IPV6 1
37055_ACEOF
37056    else
37057       #both ipv4 and ipv6
37058
37059cat >>confdefs.h <<_ACEOF
37060#define SOCKS_SO_CKSUMRECV_IPV4 1
37061_ACEOF
37062
37063cat >>confdefs.h <<_ACEOF
37064#define SOCKS_SO_CKSUMRECV_IPV6 1
37065_ACEOF
37066    fi
37067    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_CKSUMRECV"
37068  else
37069    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
37070$as_echo "no" >&6; }
37071  fi
37072unset _compileok
37073  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_NOMULTIPATH" >&5
37074$as_echo_n "checking for SOL_SOCKET socket option SO_NOMULTIPATH... " >&6; }
37075  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37076/* end confdefs.h.  */
37077
37078#include <sys/types.h>
37079#include <sys/socket.h>
37080#include <netinet/in.h>
37081#include <netinet/tcp.h>
37082#include <netinet/udp.h>
37083
37084#include <stdio.h>
37085#include <stdlib.h>
37086#include <unistd.h>
37087
37088int
37089main ()
37090{
37091
37092   socklen_t optlen;
37093   int optval;
37094   int stype;
37095   int ptype;
37096   int s;
37097
37098   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
37099      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37100      ptype = IPPROTO_TCP;
37101   } else if (SOL_SOCKET == IPPROTO_IP) {
37102      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37103      ptype = IPPROTO_IP;
37104   } else if (SOL_SOCKET == IPPROTO_IPV6) {
37105      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37106      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37107   } else if (SOL_SOCKET == IPPROTO_UDP) {
37108      stype = SOCK_DGRAM;
37109      ptype = IPPROTO_UDP;
37110   } else {
37111       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
37112       exit(1);
37113   }
37114
37115   if((s = socket(PF_INET, stype, ptype)) < 0) {
37116      perror("socket");
37117      exit(1);
37118   }
37119
37120   optval = 1;
37121   optlen = sizeof(optval);
37122   if(setsockopt(s, SOL_SOCKET, SO_NOMULTIPATH, &optval, optlen) < 0) {
37123      perror("setsockopt: SOL_SOCKET SO_NOMULTIPATH");
37124      close(s);
37125      exit(1);
37126   }
37127  ;
37128  return 0;
37129}
37130_ACEOF
37131if ac_fn_c_try_compile "$LINENO"; then :
37132  _compileok=1
37133fi
37134rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37135
37136  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37137/* end confdefs.h.  */
37138
37139#include <sys/types.h>
37140#include <sys/socket.h>
37141#include <netinet/in.h>
37142#include <netinet/tcp.h>
37143#include <netinet/udp.h>
37144
37145#include <stdio.h>
37146#include <stdlib.h>
37147#include <unistd.h>
37148
37149int
37150main ()
37151{
37152
37153   socklen_t optlen;
37154   int optval;
37155   int stype;
37156   int ptype;
37157   int s;
37158
37159   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
37160      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37161      ptype = IPPROTO_TCP;
37162   } else if (SOL_SOCKET == IPPROTO_IP) {
37163      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37164      ptype = IPPROTO_IP;
37165   } else if (SOL_SOCKET == IPPROTO_IPV6) {
37166      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37167      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37168   } else if (SOL_SOCKET == IPPROTO_UDP) {
37169      stype = SOCK_DGRAM;
37170      ptype = IPPROTO_UDP;
37171   } else {
37172       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
37173       exit(1);
37174   }
37175
37176   if((s = socket(PF_INET6, stype, ptype)) < 0) {
37177      perror("socket");
37178      exit(1);
37179   }
37180
37181   optval = 1;
37182   optlen = sizeof(optval);
37183   if(setsockopt(s, SOL_SOCKET, SO_NOMULTIPATH, &optval, optlen) < 0) {
37184      perror("setsockopt: SOL_SOCKET SO_NOMULTIPATH");
37185      close(s);
37186      exit(1);
37187   }
37188  ;
37189  return 0;
37190}
37191_ACEOF
37192if ac_fn_c_try_compile "$LINENO"; then :
37193  _compileok=1
37194fi
37195rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37196
37197  if test x"${_compileok}" != x; then
37198    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
37199$as_echo "yes" >&6; }
37200
37201cat >>confdefs.h <<_ACEOF
37202#define HAVE_SO_NOMULTIPATH 1
37203_ACEOF
37204
37205cat >>confdefs.h <<_ACEOF
37206#define SOCKS_SO_NOMULTIPATH_LVL SOL_SOCKET
37207_ACEOF
37208
37209cat >>confdefs.h <<_ACEOF
37210#define SOCKS_SO_NOMULTIPATH_NAME "so_nomultipath"
37211_ACEOF
37212    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
37213       #ipv4-only
37214
37215cat >>confdefs.h <<_ACEOF
37216#define SOCKS_SO_NOMULTIPATH_IPV4 1
37217_ACEOF
37218
37219cat >>confdefs.h <<_ACEOF
37220#define SOCKS_SO_NOMULTIPATH_IPV6 0
37221_ACEOF
37222    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
37223       #ipv6-only
37224
37225cat >>confdefs.h <<_ACEOF
37226#define SOCKS_SO_NOMULTIPATH_IPV4 0
37227_ACEOF
37228
37229cat >>confdefs.h <<_ACEOF
37230#define SOCKS_SO_NOMULTIPATH_IPV6 1
37231_ACEOF
37232    else
37233       #both ipv4 and ipv6
37234
37235cat >>confdefs.h <<_ACEOF
37236#define SOCKS_SO_NOMULTIPATH_IPV4 1
37237_ACEOF
37238
37239cat >>confdefs.h <<_ACEOF
37240#define SOCKS_SO_NOMULTIPATH_IPV6 1
37241_ACEOF
37242    fi
37243    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_NOMULTIPATH"
37244  else
37245    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
37246$as_echo "no" >&6; }
37247  fi
37248unset _compileok
37249  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_NOREUSEADDR" >&5
37250$as_echo_n "checking for SOL_SOCKET socket option SO_NOREUSEADDR... " >&6; }
37251  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37252/* end confdefs.h.  */
37253
37254#include <sys/types.h>
37255#include <sys/socket.h>
37256#include <netinet/in.h>
37257#include <netinet/tcp.h>
37258#include <netinet/udp.h>
37259
37260#include <stdio.h>
37261#include <stdlib.h>
37262#include <unistd.h>
37263
37264int
37265main ()
37266{
37267
37268   socklen_t optlen;
37269   int optval;
37270   int stype;
37271   int ptype;
37272   int s;
37273
37274   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
37275      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37276      ptype = IPPROTO_TCP;
37277   } else if (SOL_SOCKET == IPPROTO_IP) {
37278      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37279      ptype = IPPROTO_IP;
37280   } else if (SOL_SOCKET == IPPROTO_IPV6) {
37281      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37282      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37283   } else if (SOL_SOCKET == IPPROTO_UDP) {
37284      stype = SOCK_DGRAM;
37285      ptype = IPPROTO_UDP;
37286   } else {
37287       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
37288       exit(1);
37289   }
37290
37291   if((s = socket(PF_INET, stype, ptype)) < 0) {
37292      perror("socket");
37293      exit(1);
37294   }
37295
37296   optval = 1;
37297   optlen = sizeof(optval);
37298   if(setsockopt(s, SOL_SOCKET, SO_NOREUSEADDR, &optval, optlen) < 0) {
37299      perror("setsockopt: SOL_SOCKET SO_NOREUSEADDR");
37300      close(s);
37301      exit(1);
37302   }
37303  ;
37304  return 0;
37305}
37306_ACEOF
37307if ac_fn_c_try_compile "$LINENO"; then :
37308  _compileok=1
37309fi
37310rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37311
37312  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37313/* end confdefs.h.  */
37314
37315#include <sys/types.h>
37316#include <sys/socket.h>
37317#include <netinet/in.h>
37318#include <netinet/tcp.h>
37319#include <netinet/udp.h>
37320
37321#include <stdio.h>
37322#include <stdlib.h>
37323#include <unistd.h>
37324
37325int
37326main ()
37327{
37328
37329   socklen_t optlen;
37330   int optval;
37331   int stype;
37332   int ptype;
37333   int s;
37334
37335   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
37336      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37337      ptype = IPPROTO_TCP;
37338   } else if (SOL_SOCKET == IPPROTO_IP) {
37339      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37340      ptype = IPPROTO_IP;
37341   } else if (SOL_SOCKET == IPPROTO_IPV6) {
37342      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37343      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37344   } else if (SOL_SOCKET == IPPROTO_UDP) {
37345      stype = SOCK_DGRAM;
37346      ptype = IPPROTO_UDP;
37347   } else {
37348       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
37349       exit(1);
37350   }
37351
37352   if((s = socket(PF_INET6, stype, ptype)) < 0) {
37353      perror("socket");
37354      exit(1);
37355   }
37356
37357   optval = 1;
37358   optlen = sizeof(optval);
37359   if(setsockopt(s, SOL_SOCKET, SO_NOREUSEADDR, &optval, optlen) < 0) {
37360      perror("setsockopt: SOL_SOCKET SO_NOREUSEADDR");
37361      close(s);
37362      exit(1);
37363   }
37364  ;
37365  return 0;
37366}
37367_ACEOF
37368if ac_fn_c_try_compile "$LINENO"; then :
37369  _compileok=1
37370fi
37371rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37372
37373  if test x"${_compileok}" != x; then
37374    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
37375$as_echo "yes" >&6; }
37376
37377cat >>confdefs.h <<_ACEOF
37378#define HAVE_SO_NOREUSEADDR 1
37379_ACEOF
37380
37381cat >>confdefs.h <<_ACEOF
37382#define SOCKS_SO_NOREUSEADDR_LVL SOL_SOCKET
37383_ACEOF
37384
37385cat >>confdefs.h <<_ACEOF
37386#define SOCKS_SO_NOREUSEADDR_NAME "so_noreuseaddr"
37387_ACEOF
37388    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
37389       #ipv4-only
37390
37391cat >>confdefs.h <<_ACEOF
37392#define SOCKS_SO_NOREUSEADDR_IPV4 1
37393_ACEOF
37394
37395cat >>confdefs.h <<_ACEOF
37396#define SOCKS_SO_NOREUSEADDR_IPV6 0
37397_ACEOF
37398    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
37399       #ipv6-only
37400
37401cat >>confdefs.h <<_ACEOF
37402#define SOCKS_SO_NOREUSEADDR_IPV4 0
37403_ACEOF
37404
37405cat >>confdefs.h <<_ACEOF
37406#define SOCKS_SO_NOREUSEADDR_IPV6 1
37407_ACEOF
37408    else
37409       #both ipv4 and ipv6
37410
37411cat >>confdefs.h <<_ACEOF
37412#define SOCKS_SO_NOREUSEADDR_IPV4 1
37413_ACEOF
37414
37415cat >>confdefs.h <<_ACEOF
37416#define SOCKS_SO_NOREUSEADDR_IPV6 1
37417_ACEOF
37418    fi
37419    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_NOREUSEADDR"
37420  else
37421    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
37422$as_echo "no" >&6; }
37423  fi #XXX usable?
37424
37425#tcp level
37426unset _compileok
37427  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_CORK" >&5
37428$as_echo_n "checking for IPPROTO_TCP socket option TCP_CORK... " >&6; }
37429  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37430/* end confdefs.h.  */
37431
37432#include <sys/types.h>
37433#include <sys/socket.h>
37434#include <netinet/in.h>
37435#include <netinet/tcp.h>
37436#include <netinet/udp.h>
37437
37438#include <stdio.h>
37439#include <stdlib.h>
37440#include <unistd.h>
37441
37442int
37443main ()
37444{
37445
37446   socklen_t optlen;
37447   int optval;
37448   int stype;
37449   int ptype;
37450   int s;
37451
37452   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37453      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37454      ptype = IPPROTO_TCP;
37455   } else if (IPPROTO_TCP == IPPROTO_IP) {
37456      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37457      ptype = IPPROTO_IP;
37458   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37459      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37460      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37461   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37462      stype = SOCK_DGRAM;
37463      ptype = IPPROTO_UDP;
37464   } else {
37465       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37466       exit(1);
37467   }
37468
37469   if((s = socket(PF_INET, stype, ptype)) < 0) {
37470      perror("socket");
37471      exit(1);
37472   }
37473
37474   optval = 1;
37475   optlen = sizeof(optval);
37476   if(setsockopt(s, IPPROTO_TCP, TCP_CORK, &optval, optlen) < 0) {
37477      perror("setsockopt: IPPROTO_TCP TCP_CORK");
37478      close(s);
37479      exit(1);
37480   }
37481  ;
37482  return 0;
37483}
37484_ACEOF
37485if ac_fn_c_try_compile "$LINENO"; then :
37486  _compileok=1
37487fi
37488rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37489
37490  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37491/* end confdefs.h.  */
37492
37493#include <sys/types.h>
37494#include <sys/socket.h>
37495#include <netinet/in.h>
37496#include <netinet/tcp.h>
37497#include <netinet/udp.h>
37498
37499#include <stdio.h>
37500#include <stdlib.h>
37501#include <unistd.h>
37502
37503int
37504main ()
37505{
37506
37507   socklen_t optlen;
37508   int optval;
37509   int stype;
37510   int ptype;
37511   int s;
37512
37513   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37514      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37515      ptype = IPPROTO_TCP;
37516   } else if (IPPROTO_TCP == IPPROTO_IP) {
37517      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37518      ptype = IPPROTO_IP;
37519   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37520      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37521      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37522   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37523      stype = SOCK_DGRAM;
37524      ptype = IPPROTO_UDP;
37525   } else {
37526       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37527       exit(1);
37528   }
37529
37530   if((s = socket(PF_INET6, stype, ptype)) < 0) {
37531      perror("socket");
37532      exit(1);
37533   }
37534
37535   optval = 1;
37536   optlen = sizeof(optval);
37537   if(setsockopt(s, IPPROTO_TCP, TCP_CORK, &optval, optlen) < 0) {
37538      perror("setsockopt: IPPROTO_TCP TCP_CORK");
37539      close(s);
37540      exit(1);
37541   }
37542  ;
37543  return 0;
37544}
37545_ACEOF
37546if ac_fn_c_try_compile "$LINENO"; then :
37547  _compileok=1
37548fi
37549rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37550
37551  if test x"${_compileok}" != x; then
37552    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
37553$as_echo "yes" >&6; }
37554
37555cat >>confdefs.h <<_ACEOF
37556#define HAVE_TCP_CORK 1
37557_ACEOF
37558
37559cat >>confdefs.h <<_ACEOF
37560#define SOCKS_TCP_CORK_LVL IPPROTO_TCP
37561_ACEOF
37562
37563cat >>confdefs.h <<_ACEOF
37564#define SOCKS_TCP_CORK_NAME "tcp_cork"
37565_ACEOF
37566    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
37567       #ipv4-only
37568
37569cat >>confdefs.h <<_ACEOF
37570#define SOCKS_TCP_CORK_IPV4 1
37571_ACEOF
37572
37573cat >>confdefs.h <<_ACEOF
37574#define SOCKS_TCP_CORK_IPV6 0
37575_ACEOF
37576    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
37577       #ipv6-only
37578
37579cat >>confdefs.h <<_ACEOF
37580#define SOCKS_TCP_CORK_IPV4 0
37581_ACEOF
37582
37583cat >>confdefs.h <<_ACEOF
37584#define SOCKS_TCP_CORK_IPV6 1
37585_ACEOF
37586    else
37587       #both ipv4 and ipv6
37588
37589cat >>confdefs.h <<_ACEOF
37590#define SOCKS_TCP_CORK_IPV4 1
37591_ACEOF
37592
37593cat >>confdefs.h <<_ACEOF
37594#define SOCKS_TCP_CORK_IPV6 1
37595_ACEOF
37596    fi
37597    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_CORK"
37598  else
37599    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
37600$as_echo "no" >&6; }
37601  fi
37602unset _compileok
37603  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_CWND" >&5
37604$as_echo_n "checking for IPPROTO_TCP socket option TCP_CWND... " >&6; }
37605  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37606/* end confdefs.h.  */
37607
37608#include <sys/types.h>
37609#include <sys/socket.h>
37610#include <netinet/in.h>
37611#include <netinet/tcp.h>
37612#include <netinet/udp.h>
37613
37614#include <stdio.h>
37615#include <stdlib.h>
37616#include <unistd.h>
37617
37618int
37619main ()
37620{
37621
37622   socklen_t optlen;
37623   int optval;
37624   int stype;
37625   int ptype;
37626   int s;
37627
37628   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37629      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37630      ptype = IPPROTO_TCP;
37631   } else if (IPPROTO_TCP == IPPROTO_IP) {
37632      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37633      ptype = IPPROTO_IP;
37634   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37635      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37636      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37637   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37638      stype = SOCK_DGRAM;
37639      ptype = IPPROTO_UDP;
37640   } else {
37641       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37642       exit(1);
37643   }
37644
37645   if((s = socket(PF_INET, stype, ptype)) < 0) {
37646      perror("socket");
37647      exit(1);
37648   }
37649
37650   optval = 1;
37651   optlen = sizeof(optval);
37652   if(setsockopt(s, IPPROTO_TCP, TCP_CWND, &optval, optlen) < 0) {
37653      perror("setsockopt: IPPROTO_TCP TCP_CWND");
37654      close(s);
37655      exit(1);
37656   }
37657  ;
37658  return 0;
37659}
37660_ACEOF
37661if ac_fn_c_try_compile "$LINENO"; then :
37662  _compileok=1
37663fi
37664rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37665
37666  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37667/* end confdefs.h.  */
37668
37669#include <sys/types.h>
37670#include <sys/socket.h>
37671#include <netinet/in.h>
37672#include <netinet/tcp.h>
37673#include <netinet/udp.h>
37674
37675#include <stdio.h>
37676#include <stdlib.h>
37677#include <unistd.h>
37678
37679int
37680main ()
37681{
37682
37683   socklen_t optlen;
37684   int optval;
37685   int stype;
37686   int ptype;
37687   int s;
37688
37689   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37690      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37691      ptype = IPPROTO_TCP;
37692   } else if (IPPROTO_TCP == IPPROTO_IP) {
37693      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37694      ptype = IPPROTO_IP;
37695   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37696      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37697      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37698   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37699      stype = SOCK_DGRAM;
37700      ptype = IPPROTO_UDP;
37701   } else {
37702       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37703       exit(1);
37704   }
37705
37706   if((s = socket(PF_INET6, stype, ptype)) < 0) {
37707      perror("socket");
37708      exit(1);
37709   }
37710
37711   optval = 1;
37712   optlen = sizeof(optval);
37713   if(setsockopt(s, IPPROTO_TCP, TCP_CWND, &optval, optlen) < 0) {
37714      perror("setsockopt: IPPROTO_TCP TCP_CWND");
37715      close(s);
37716      exit(1);
37717   }
37718  ;
37719  return 0;
37720}
37721_ACEOF
37722if ac_fn_c_try_compile "$LINENO"; then :
37723  _compileok=1
37724fi
37725rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37726
37727  if test x"${_compileok}" != x; then
37728    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
37729$as_echo "yes" >&6; }
37730
37731cat >>confdefs.h <<_ACEOF
37732#define HAVE_TCP_CWND 1
37733_ACEOF
37734
37735cat >>confdefs.h <<_ACEOF
37736#define SOCKS_TCP_CWND_LVL IPPROTO_TCP
37737_ACEOF
37738
37739cat >>confdefs.h <<_ACEOF
37740#define SOCKS_TCP_CWND_NAME "tcp_cwnd"
37741_ACEOF
37742    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
37743       #ipv4-only
37744
37745cat >>confdefs.h <<_ACEOF
37746#define SOCKS_TCP_CWND_IPV4 1
37747_ACEOF
37748
37749cat >>confdefs.h <<_ACEOF
37750#define SOCKS_TCP_CWND_IPV6 0
37751_ACEOF
37752    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
37753       #ipv6-only
37754
37755cat >>confdefs.h <<_ACEOF
37756#define SOCKS_TCP_CWND_IPV4 0
37757_ACEOF
37758
37759cat >>confdefs.h <<_ACEOF
37760#define SOCKS_TCP_CWND_IPV6 1
37761_ACEOF
37762    else
37763       #both ipv4 and ipv6
37764
37765cat >>confdefs.h <<_ACEOF
37766#define SOCKS_TCP_CWND_IPV4 1
37767_ACEOF
37768
37769cat >>confdefs.h <<_ACEOF
37770#define SOCKS_TCP_CWND_IPV6 1
37771_ACEOF
37772    fi
37773    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_CWND"
37774  else
37775    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
37776$as_echo "no" >&6; }
37777  fi      #Google patch
37778unset _compileok
37779  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_INIT_CWND" >&5
37780$as_echo_n "checking for IPPROTO_TCP socket option TCP_INIT_CWND... " >&6; }
37781  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37782/* end confdefs.h.  */
37783
37784#include <sys/types.h>
37785#include <sys/socket.h>
37786#include <netinet/in.h>
37787#include <netinet/tcp.h>
37788#include <netinet/udp.h>
37789
37790#include <stdio.h>
37791#include <stdlib.h>
37792#include <unistd.h>
37793
37794int
37795main ()
37796{
37797
37798   socklen_t optlen;
37799   int optval;
37800   int stype;
37801   int ptype;
37802   int s;
37803
37804   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37805      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37806      ptype = IPPROTO_TCP;
37807   } else if (IPPROTO_TCP == IPPROTO_IP) {
37808      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37809      ptype = IPPROTO_IP;
37810   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37811      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37812      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37813   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37814      stype = SOCK_DGRAM;
37815      ptype = IPPROTO_UDP;
37816   } else {
37817       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37818       exit(1);
37819   }
37820
37821   if((s = socket(PF_INET, stype, ptype)) < 0) {
37822      perror("socket");
37823      exit(1);
37824   }
37825
37826   optval = 1;
37827   optlen = sizeof(optval);
37828   if(setsockopt(s, IPPROTO_TCP, TCP_INIT_CWND, &optval, optlen) < 0) {
37829      perror("setsockopt: IPPROTO_TCP TCP_INIT_CWND");
37830      close(s);
37831      exit(1);
37832   }
37833  ;
37834  return 0;
37835}
37836_ACEOF
37837if ac_fn_c_try_compile "$LINENO"; then :
37838  _compileok=1
37839fi
37840rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37841
37842  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37843/* end confdefs.h.  */
37844
37845#include <sys/types.h>
37846#include <sys/socket.h>
37847#include <netinet/in.h>
37848#include <netinet/tcp.h>
37849#include <netinet/udp.h>
37850
37851#include <stdio.h>
37852#include <stdlib.h>
37853#include <unistd.h>
37854
37855int
37856main ()
37857{
37858
37859   socklen_t optlen;
37860   int optval;
37861   int stype;
37862   int ptype;
37863   int s;
37864
37865   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37866      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37867      ptype = IPPROTO_TCP;
37868   } else if (IPPROTO_TCP == IPPROTO_IP) {
37869      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37870      ptype = IPPROTO_IP;
37871   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37872      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37873      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37874   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37875      stype = SOCK_DGRAM;
37876      ptype = IPPROTO_UDP;
37877   } else {
37878       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37879       exit(1);
37880   }
37881
37882   if((s = socket(PF_INET6, stype, ptype)) < 0) {
37883      perror("socket");
37884      exit(1);
37885   }
37886
37887   optval = 1;
37888   optlen = sizeof(optval);
37889   if(setsockopt(s, IPPROTO_TCP, TCP_INIT_CWND, &optval, optlen) < 0) {
37890      perror("setsockopt: IPPROTO_TCP TCP_INIT_CWND");
37891      close(s);
37892      exit(1);
37893   }
37894  ;
37895  return 0;
37896}
37897_ACEOF
37898if ac_fn_c_try_compile "$LINENO"; then :
37899  _compileok=1
37900fi
37901rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
37902
37903  if test x"${_compileok}" != x; then
37904    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
37905$as_echo "yes" >&6; }
37906
37907cat >>confdefs.h <<_ACEOF
37908#define HAVE_TCP_INIT_CWND 1
37909_ACEOF
37910
37911cat >>confdefs.h <<_ACEOF
37912#define SOCKS_TCP_INIT_CWND_LVL IPPROTO_TCP
37913_ACEOF
37914
37915cat >>confdefs.h <<_ACEOF
37916#define SOCKS_TCP_INIT_CWND_NAME "tcp_init_cwnd"
37917_ACEOF
37918    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
37919       #ipv4-only
37920
37921cat >>confdefs.h <<_ACEOF
37922#define SOCKS_TCP_INIT_CWND_IPV4 1
37923_ACEOF
37924
37925cat >>confdefs.h <<_ACEOF
37926#define SOCKS_TCP_INIT_CWND_IPV6 0
37927_ACEOF
37928    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
37929       #ipv6-only
37930
37931cat >>confdefs.h <<_ACEOF
37932#define SOCKS_TCP_INIT_CWND_IPV4 0
37933_ACEOF
37934
37935cat >>confdefs.h <<_ACEOF
37936#define SOCKS_TCP_INIT_CWND_IPV6 1
37937_ACEOF
37938    else
37939       #both ipv4 and ipv6
37940
37941cat >>confdefs.h <<_ACEOF
37942#define SOCKS_TCP_INIT_CWND_IPV4 1
37943_ACEOF
37944
37945cat >>confdefs.h <<_ACEOF
37946#define SOCKS_TCP_INIT_CWND_IPV6 1
37947_ACEOF
37948    fi
37949    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_INIT_CWND"
37950  else
37951    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
37952$as_echo "no" >&6; }
37953  fi #Solaris
37954unset _compileok
37955  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_KEEPCNT" >&5
37956$as_echo_n "checking for IPPROTO_TCP socket option TCP_KEEPCNT... " >&6; }
37957  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
37958/* end confdefs.h.  */
37959
37960#include <sys/types.h>
37961#include <sys/socket.h>
37962#include <netinet/in.h>
37963#include <netinet/tcp.h>
37964#include <netinet/udp.h>
37965
37966#include <stdio.h>
37967#include <stdlib.h>
37968#include <unistd.h>
37969
37970int
37971main ()
37972{
37973
37974   socklen_t optlen;
37975   int optval;
37976   int stype;
37977   int ptype;
37978   int s;
37979
37980   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
37981      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
37982      ptype = IPPROTO_TCP;
37983   } else if (IPPROTO_TCP == IPPROTO_IP) {
37984      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
37985      ptype = IPPROTO_IP;
37986   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
37987      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
37988      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
37989   } else if (IPPROTO_TCP == IPPROTO_UDP) {
37990      stype = SOCK_DGRAM;
37991      ptype = IPPROTO_UDP;
37992   } else {
37993       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
37994       exit(1);
37995   }
37996
37997   if((s = socket(PF_INET, stype, ptype)) < 0) {
37998      perror("socket");
37999      exit(1);
38000   }
38001
38002   optval = 1;
38003   optlen = sizeof(optval);
38004   if(setsockopt(s, IPPROTO_TCP, TCP_KEEPCNT, &optval, optlen) < 0) {
38005      perror("setsockopt: IPPROTO_TCP TCP_KEEPCNT");
38006      close(s);
38007      exit(1);
38008   }
38009  ;
38010  return 0;
38011}
38012_ACEOF
38013if ac_fn_c_try_compile "$LINENO"; then :
38014  _compileok=1
38015fi
38016rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38017
38018  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38019/* end confdefs.h.  */
38020
38021#include <sys/types.h>
38022#include <sys/socket.h>
38023#include <netinet/in.h>
38024#include <netinet/tcp.h>
38025#include <netinet/udp.h>
38026
38027#include <stdio.h>
38028#include <stdlib.h>
38029#include <unistd.h>
38030
38031int
38032main ()
38033{
38034
38035   socklen_t optlen;
38036   int optval;
38037   int stype;
38038   int ptype;
38039   int s;
38040
38041   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38042      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38043      ptype = IPPROTO_TCP;
38044   } else if (IPPROTO_TCP == IPPROTO_IP) {
38045      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38046      ptype = IPPROTO_IP;
38047   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38048      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38049      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38050   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38051      stype = SOCK_DGRAM;
38052      ptype = IPPROTO_UDP;
38053   } else {
38054       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38055       exit(1);
38056   }
38057
38058   if((s = socket(PF_INET6, stype, ptype)) < 0) {
38059      perror("socket");
38060      exit(1);
38061   }
38062
38063   optval = 1;
38064   optlen = sizeof(optval);
38065   if(setsockopt(s, IPPROTO_TCP, TCP_KEEPCNT, &optval, optlen) < 0) {
38066      perror("setsockopt: IPPROTO_TCP TCP_KEEPCNT");
38067      close(s);
38068      exit(1);
38069   }
38070  ;
38071  return 0;
38072}
38073_ACEOF
38074if ac_fn_c_try_compile "$LINENO"; then :
38075  _compileok=1
38076fi
38077rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38078
38079  if test x"${_compileok}" != x; then
38080    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
38081$as_echo "yes" >&6; }
38082
38083cat >>confdefs.h <<_ACEOF
38084#define HAVE_TCP_KEEPCNT 1
38085_ACEOF
38086
38087cat >>confdefs.h <<_ACEOF
38088#define SOCKS_TCP_KEEPCNT_LVL IPPROTO_TCP
38089_ACEOF
38090
38091cat >>confdefs.h <<_ACEOF
38092#define SOCKS_TCP_KEEPCNT_NAME "tcp_keepcnt"
38093_ACEOF
38094    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
38095       #ipv4-only
38096
38097cat >>confdefs.h <<_ACEOF
38098#define SOCKS_TCP_KEEPCNT_IPV4 1
38099_ACEOF
38100
38101cat >>confdefs.h <<_ACEOF
38102#define SOCKS_TCP_KEEPCNT_IPV6 0
38103_ACEOF
38104    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
38105       #ipv6-only
38106
38107cat >>confdefs.h <<_ACEOF
38108#define SOCKS_TCP_KEEPCNT_IPV4 0
38109_ACEOF
38110
38111cat >>confdefs.h <<_ACEOF
38112#define SOCKS_TCP_KEEPCNT_IPV6 1
38113_ACEOF
38114    else
38115       #both ipv4 and ipv6
38116
38117cat >>confdefs.h <<_ACEOF
38118#define SOCKS_TCP_KEEPCNT_IPV4 1
38119_ACEOF
38120
38121cat >>confdefs.h <<_ACEOF
38122#define SOCKS_TCP_KEEPCNT_IPV6 1
38123_ACEOF
38124    fi
38125    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_KEEPCNT"
38126  else
38127    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
38128$as_echo "no" >&6; }
38129  fi
38130unset _compileok
38131  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_KEEPIDLE" >&5
38132$as_echo_n "checking for IPPROTO_TCP socket option TCP_KEEPIDLE... " >&6; }
38133  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38134/* end confdefs.h.  */
38135
38136#include <sys/types.h>
38137#include <sys/socket.h>
38138#include <netinet/in.h>
38139#include <netinet/tcp.h>
38140#include <netinet/udp.h>
38141
38142#include <stdio.h>
38143#include <stdlib.h>
38144#include <unistd.h>
38145
38146int
38147main ()
38148{
38149
38150   socklen_t optlen;
38151   int optval;
38152   int stype;
38153   int ptype;
38154   int s;
38155
38156   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38157      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38158      ptype = IPPROTO_TCP;
38159   } else if (IPPROTO_TCP == IPPROTO_IP) {
38160      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38161      ptype = IPPROTO_IP;
38162   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38163      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38164      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38165   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38166      stype = SOCK_DGRAM;
38167      ptype = IPPROTO_UDP;
38168   } else {
38169       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38170       exit(1);
38171   }
38172
38173   if((s = socket(PF_INET, stype, ptype)) < 0) {
38174      perror("socket");
38175      exit(1);
38176   }
38177
38178   optval = 1;
38179   optlen = sizeof(optval);
38180   if(setsockopt(s, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
38181      perror("setsockopt: IPPROTO_TCP TCP_KEEPIDLE");
38182      close(s);
38183      exit(1);
38184   }
38185  ;
38186  return 0;
38187}
38188_ACEOF
38189if ac_fn_c_try_compile "$LINENO"; then :
38190  _compileok=1
38191fi
38192rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38193
38194  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38195/* end confdefs.h.  */
38196
38197#include <sys/types.h>
38198#include <sys/socket.h>
38199#include <netinet/in.h>
38200#include <netinet/tcp.h>
38201#include <netinet/udp.h>
38202
38203#include <stdio.h>
38204#include <stdlib.h>
38205#include <unistd.h>
38206
38207int
38208main ()
38209{
38210
38211   socklen_t optlen;
38212   int optval;
38213   int stype;
38214   int ptype;
38215   int s;
38216
38217   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38218      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38219      ptype = IPPROTO_TCP;
38220   } else if (IPPROTO_TCP == IPPROTO_IP) {
38221      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38222      ptype = IPPROTO_IP;
38223   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38224      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38225      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38226   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38227      stype = SOCK_DGRAM;
38228      ptype = IPPROTO_UDP;
38229   } else {
38230       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38231       exit(1);
38232   }
38233
38234   if((s = socket(PF_INET6, stype, ptype)) < 0) {
38235      perror("socket");
38236      exit(1);
38237   }
38238
38239   optval = 1;
38240   optlen = sizeof(optval);
38241   if(setsockopt(s, IPPROTO_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
38242      perror("setsockopt: IPPROTO_TCP TCP_KEEPIDLE");
38243      close(s);
38244      exit(1);
38245   }
38246  ;
38247  return 0;
38248}
38249_ACEOF
38250if ac_fn_c_try_compile "$LINENO"; then :
38251  _compileok=1
38252fi
38253rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38254
38255  if test x"${_compileok}" != x; then
38256    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
38257$as_echo "yes" >&6; }
38258
38259cat >>confdefs.h <<_ACEOF
38260#define HAVE_TCP_KEEPIDLE 1
38261_ACEOF
38262
38263cat >>confdefs.h <<_ACEOF
38264#define SOCKS_TCP_KEEPIDLE_LVL IPPROTO_TCP
38265_ACEOF
38266
38267cat >>confdefs.h <<_ACEOF
38268#define SOCKS_TCP_KEEPIDLE_NAME "tcp_keepidle"
38269_ACEOF
38270    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
38271       #ipv4-only
38272
38273cat >>confdefs.h <<_ACEOF
38274#define SOCKS_TCP_KEEPIDLE_IPV4 1
38275_ACEOF
38276
38277cat >>confdefs.h <<_ACEOF
38278#define SOCKS_TCP_KEEPIDLE_IPV6 0
38279_ACEOF
38280    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
38281       #ipv6-only
38282
38283cat >>confdefs.h <<_ACEOF
38284#define SOCKS_TCP_KEEPIDLE_IPV4 0
38285_ACEOF
38286
38287cat >>confdefs.h <<_ACEOF
38288#define SOCKS_TCP_KEEPIDLE_IPV6 1
38289_ACEOF
38290    else
38291       #both ipv4 and ipv6
38292
38293cat >>confdefs.h <<_ACEOF
38294#define SOCKS_TCP_KEEPIDLE_IPV4 1
38295_ACEOF
38296
38297cat >>confdefs.h <<_ACEOF
38298#define SOCKS_TCP_KEEPIDLE_IPV6 1
38299_ACEOF
38300    fi
38301    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_KEEPIDLE"
38302  else
38303    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
38304$as_echo "no" >&6; }
38305  fi
38306unset _compileok
38307  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_KEEPINTVL" >&5
38308$as_echo_n "checking for IPPROTO_TCP socket option TCP_KEEPINTVL... " >&6; }
38309  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38310/* end confdefs.h.  */
38311
38312#include <sys/types.h>
38313#include <sys/socket.h>
38314#include <netinet/in.h>
38315#include <netinet/tcp.h>
38316#include <netinet/udp.h>
38317
38318#include <stdio.h>
38319#include <stdlib.h>
38320#include <unistd.h>
38321
38322int
38323main ()
38324{
38325
38326   socklen_t optlen;
38327   int optval;
38328   int stype;
38329   int ptype;
38330   int s;
38331
38332   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38333      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38334      ptype = IPPROTO_TCP;
38335   } else if (IPPROTO_TCP == IPPROTO_IP) {
38336      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38337      ptype = IPPROTO_IP;
38338   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38339      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38340      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38341   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38342      stype = SOCK_DGRAM;
38343      ptype = IPPROTO_UDP;
38344   } else {
38345       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38346       exit(1);
38347   }
38348
38349   if((s = socket(PF_INET, stype, ptype)) < 0) {
38350      perror("socket");
38351      exit(1);
38352   }
38353
38354   optval = 1;
38355   optlen = sizeof(optval);
38356   if(setsockopt(s, IPPROTO_TCP, TCP_KEEPINTVL, &optval, optlen) < 0) {
38357      perror("setsockopt: IPPROTO_TCP TCP_KEEPINTVL");
38358      close(s);
38359      exit(1);
38360   }
38361  ;
38362  return 0;
38363}
38364_ACEOF
38365if ac_fn_c_try_compile "$LINENO"; then :
38366  _compileok=1
38367fi
38368rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38369
38370  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38371/* end confdefs.h.  */
38372
38373#include <sys/types.h>
38374#include <sys/socket.h>
38375#include <netinet/in.h>
38376#include <netinet/tcp.h>
38377#include <netinet/udp.h>
38378
38379#include <stdio.h>
38380#include <stdlib.h>
38381#include <unistd.h>
38382
38383int
38384main ()
38385{
38386
38387   socklen_t optlen;
38388   int optval;
38389   int stype;
38390   int ptype;
38391   int s;
38392
38393   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38394      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38395      ptype = IPPROTO_TCP;
38396   } else if (IPPROTO_TCP == IPPROTO_IP) {
38397      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38398      ptype = IPPROTO_IP;
38399   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38400      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38401      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38402   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38403      stype = SOCK_DGRAM;
38404      ptype = IPPROTO_UDP;
38405   } else {
38406       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38407       exit(1);
38408   }
38409
38410   if((s = socket(PF_INET6, stype, ptype)) < 0) {
38411      perror("socket");
38412      exit(1);
38413   }
38414
38415   optval = 1;
38416   optlen = sizeof(optval);
38417   if(setsockopt(s, IPPROTO_TCP, TCP_KEEPINTVL, &optval, optlen) < 0) {
38418      perror("setsockopt: IPPROTO_TCP TCP_KEEPINTVL");
38419      close(s);
38420      exit(1);
38421   }
38422  ;
38423  return 0;
38424}
38425_ACEOF
38426if ac_fn_c_try_compile "$LINENO"; then :
38427  _compileok=1
38428fi
38429rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38430
38431  if test x"${_compileok}" != x; then
38432    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
38433$as_echo "yes" >&6; }
38434
38435cat >>confdefs.h <<_ACEOF
38436#define HAVE_TCP_KEEPINTVL 1
38437_ACEOF
38438
38439cat >>confdefs.h <<_ACEOF
38440#define SOCKS_TCP_KEEPINTVL_LVL IPPROTO_TCP
38441_ACEOF
38442
38443cat >>confdefs.h <<_ACEOF
38444#define SOCKS_TCP_KEEPINTVL_NAME "tcp_keepintvl"
38445_ACEOF
38446    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
38447       #ipv4-only
38448
38449cat >>confdefs.h <<_ACEOF
38450#define SOCKS_TCP_KEEPINTVL_IPV4 1
38451_ACEOF
38452
38453cat >>confdefs.h <<_ACEOF
38454#define SOCKS_TCP_KEEPINTVL_IPV6 0
38455_ACEOF
38456    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
38457       #ipv6-only
38458
38459cat >>confdefs.h <<_ACEOF
38460#define SOCKS_TCP_KEEPINTVL_IPV4 0
38461_ACEOF
38462
38463cat >>confdefs.h <<_ACEOF
38464#define SOCKS_TCP_KEEPINTVL_IPV6 1
38465_ACEOF
38466    else
38467       #both ipv4 and ipv6
38468
38469cat >>confdefs.h <<_ACEOF
38470#define SOCKS_TCP_KEEPINTVL_IPV4 1
38471_ACEOF
38472
38473cat >>confdefs.h <<_ACEOF
38474#define SOCKS_TCP_KEEPINTVL_IPV6 1
38475_ACEOF
38476    fi
38477    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_KEEPINTVL"
38478  else
38479    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
38480$as_echo "no" >&6; }
38481  fi
38482unset _compileok
38483  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_LINGER2" >&5
38484$as_echo_n "checking for IPPROTO_TCP socket option TCP_LINGER2... " >&6; }
38485  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38486/* end confdefs.h.  */
38487
38488#include <sys/types.h>
38489#include <sys/socket.h>
38490#include <netinet/in.h>
38491#include <netinet/tcp.h>
38492#include <netinet/udp.h>
38493
38494#include <stdio.h>
38495#include <stdlib.h>
38496#include <unistd.h>
38497
38498int
38499main ()
38500{
38501
38502   socklen_t optlen;
38503   int optval;
38504   int stype;
38505   int ptype;
38506   int s;
38507
38508   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38509      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38510      ptype = IPPROTO_TCP;
38511   } else if (IPPROTO_TCP == IPPROTO_IP) {
38512      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38513      ptype = IPPROTO_IP;
38514   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38515      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38516      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38517   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38518      stype = SOCK_DGRAM;
38519      ptype = IPPROTO_UDP;
38520   } else {
38521       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38522       exit(1);
38523   }
38524
38525   if((s = socket(PF_INET, stype, ptype)) < 0) {
38526      perror("socket");
38527      exit(1);
38528   }
38529
38530   optval = 1;
38531   optlen = sizeof(optval);
38532   if(setsockopt(s, IPPROTO_TCP, TCP_LINGER2, &optval, optlen) < 0) {
38533      perror("setsockopt: IPPROTO_TCP TCP_LINGER2");
38534      close(s);
38535      exit(1);
38536   }
38537  ;
38538  return 0;
38539}
38540_ACEOF
38541if ac_fn_c_try_compile "$LINENO"; then :
38542  _compileok=1
38543fi
38544rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38545
38546  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38547/* end confdefs.h.  */
38548
38549#include <sys/types.h>
38550#include <sys/socket.h>
38551#include <netinet/in.h>
38552#include <netinet/tcp.h>
38553#include <netinet/udp.h>
38554
38555#include <stdio.h>
38556#include <stdlib.h>
38557#include <unistd.h>
38558
38559int
38560main ()
38561{
38562
38563   socklen_t optlen;
38564   int optval;
38565   int stype;
38566   int ptype;
38567   int s;
38568
38569   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38570      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38571      ptype = IPPROTO_TCP;
38572   } else if (IPPROTO_TCP == IPPROTO_IP) {
38573      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38574      ptype = IPPROTO_IP;
38575   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38576      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38577      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38578   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38579      stype = SOCK_DGRAM;
38580      ptype = IPPROTO_UDP;
38581   } else {
38582       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38583       exit(1);
38584   }
38585
38586   if((s = socket(PF_INET6, stype, ptype)) < 0) {
38587      perror("socket");
38588      exit(1);
38589   }
38590
38591   optval = 1;
38592   optlen = sizeof(optval);
38593   if(setsockopt(s, IPPROTO_TCP, TCP_LINGER2, &optval, optlen) < 0) {
38594      perror("setsockopt: IPPROTO_TCP TCP_LINGER2");
38595      close(s);
38596      exit(1);
38597   }
38598  ;
38599  return 0;
38600}
38601_ACEOF
38602if ac_fn_c_try_compile "$LINENO"; then :
38603  _compileok=1
38604fi
38605rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38606
38607  if test x"${_compileok}" != x; then
38608    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
38609$as_echo "yes" >&6; }
38610
38611cat >>confdefs.h <<_ACEOF
38612#define HAVE_TCP_LINGER2 1
38613_ACEOF
38614
38615cat >>confdefs.h <<_ACEOF
38616#define SOCKS_TCP_LINGER2_LVL IPPROTO_TCP
38617_ACEOF
38618
38619cat >>confdefs.h <<_ACEOF
38620#define SOCKS_TCP_LINGER2_NAME "tcp_linger2"
38621_ACEOF
38622    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
38623       #ipv4-only
38624
38625cat >>confdefs.h <<_ACEOF
38626#define SOCKS_TCP_LINGER2_IPV4 1
38627_ACEOF
38628
38629cat >>confdefs.h <<_ACEOF
38630#define SOCKS_TCP_LINGER2_IPV6 0
38631_ACEOF
38632    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
38633       #ipv6-only
38634
38635cat >>confdefs.h <<_ACEOF
38636#define SOCKS_TCP_LINGER2_IPV4 0
38637_ACEOF
38638
38639cat >>confdefs.h <<_ACEOF
38640#define SOCKS_TCP_LINGER2_IPV6 1
38641_ACEOF
38642    else
38643       #both ipv4 and ipv6
38644
38645cat >>confdefs.h <<_ACEOF
38646#define SOCKS_TCP_LINGER2_IPV4 1
38647_ACEOF
38648
38649cat >>confdefs.h <<_ACEOF
38650#define SOCKS_TCP_LINGER2_IPV6 1
38651_ACEOF
38652    fi
38653    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_LINGER2"
38654  else
38655    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
38656$as_echo "no" >&6; }
38657  fi
38658unset _compileok
38659  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_MAXRT" >&5
38660$as_echo_n "checking for IPPROTO_TCP socket option TCP_MAXRT... " >&6; }
38661  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38662/* end confdefs.h.  */
38663
38664#include <sys/types.h>
38665#include <sys/socket.h>
38666#include <netinet/in.h>
38667#include <netinet/tcp.h>
38668#include <netinet/udp.h>
38669
38670#include <stdio.h>
38671#include <stdlib.h>
38672#include <unistd.h>
38673
38674int
38675main ()
38676{
38677
38678   socklen_t optlen;
38679   int optval;
38680   int stype;
38681   int ptype;
38682   int s;
38683
38684   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38685      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38686      ptype = IPPROTO_TCP;
38687   } else if (IPPROTO_TCP == IPPROTO_IP) {
38688      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38689      ptype = IPPROTO_IP;
38690   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38691      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38692      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38693   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38694      stype = SOCK_DGRAM;
38695      ptype = IPPROTO_UDP;
38696   } else {
38697       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38698       exit(1);
38699   }
38700
38701   if((s = socket(PF_INET, stype, ptype)) < 0) {
38702      perror("socket");
38703      exit(1);
38704   }
38705
38706   optval = 1;
38707   optlen = sizeof(optval);
38708   if(setsockopt(s, IPPROTO_TCP, TCP_MAXRT, &optval, optlen) < 0) {
38709      perror("setsockopt: IPPROTO_TCP TCP_MAXRT");
38710      close(s);
38711      exit(1);
38712   }
38713  ;
38714  return 0;
38715}
38716_ACEOF
38717if ac_fn_c_try_compile "$LINENO"; then :
38718  _compileok=1
38719fi
38720rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38721
38722  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38723/* end confdefs.h.  */
38724
38725#include <sys/types.h>
38726#include <sys/socket.h>
38727#include <netinet/in.h>
38728#include <netinet/tcp.h>
38729#include <netinet/udp.h>
38730
38731#include <stdio.h>
38732#include <stdlib.h>
38733#include <unistd.h>
38734
38735int
38736main ()
38737{
38738
38739   socklen_t optlen;
38740   int optval;
38741   int stype;
38742   int ptype;
38743   int s;
38744
38745   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38746      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38747      ptype = IPPROTO_TCP;
38748   } else if (IPPROTO_TCP == IPPROTO_IP) {
38749      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38750      ptype = IPPROTO_IP;
38751   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38752      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38753      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38754   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38755      stype = SOCK_DGRAM;
38756      ptype = IPPROTO_UDP;
38757   } else {
38758       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38759       exit(1);
38760   }
38761
38762   if((s = socket(PF_INET6, stype, ptype)) < 0) {
38763      perror("socket");
38764      exit(1);
38765   }
38766
38767   optval = 1;
38768   optlen = sizeof(optval);
38769   if(setsockopt(s, IPPROTO_TCP, TCP_MAXRT, &optval, optlen) < 0) {
38770      perror("setsockopt: IPPROTO_TCP TCP_MAXRT");
38771      close(s);
38772      exit(1);
38773   }
38774  ;
38775  return 0;
38776}
38777_ACEOF
38778if ac_fn_c_try_compile "$LINENO"; then :
38779  _compileok=1
38780fi
38781rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38782
38783  if test x"${_compileok}" != x; then
38784    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
38785$as_echo "yes" >&6; }
38786
38787cat >>confdefs.h <<_ACEOF
38788#define HAVE_TCP_MAXRT 1
38789_ACEOF
38790
38791cat >>confdefs.h <<_ACEOF
38792#define SOCKS_TCP_MAXRT_LVL IPPROTO_TCP
38793_ACEOF
38794
38795cat >>confdefs.h <<_ACEOF
38796#define SOCKS_TCP_MAXRT_NAME "tcp_maxrt"
38797_ACEOF
38798    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
38799       #ipv4-only
38800
38801cat >>confdefs.h <<_ACEOF
38802#define SOCKS_TCP_MAXRT_IPV4 1
38803_ACEOF
38804
38805cat >>confdefs.h <<_ACEOF
38806#define SOCKS_TCP_MAXRT_IPV6 0
38807_ACEOF
38808    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
38809       #ipv6-only
38810
38811cat >>confdefs.h <<_ACEOF
38812#define SOCKS_TCP_MAXRT_IPV4 0
38813_ACEOF
38814
38815cat >>confdefs.h <<_ACEOF
38816#define SOCKS_TCP_MAXRT_IPV6 1
38817_ACEOF
38818    else
38819       #both ipv4 and ipv6
38820
38821cat >>confdefs.h <<_ACEOF
38822#define SOCKS_TCP_MAXRT_IPV4 1
38823_ACEOF
38824
38825cat >>confdefs.h <<_ACEOF
38826#define SOCKS_TCP_MAXRT_IPV6 1
38827_ACEOF
38828    fi
38829    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_MAXRT"
38830  else
38831    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
38832$as_echo "no" >&6; }
38833  fi
38834unset _compileok
38835  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_MAXSEG" >&5
38836$as_echo_n "checking for IPPROTO_TCP socket option TCP_MAXSEG... " >&6; }
38837  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38838/* end confdefs.h.  */
38839
38840#include <sys/types.h>
38841#include <sys/socket.h>
38842#include <netinet/in.h>
38843#include <netinet/tcp.h>
38844#include <netinet/udp.h>
38845
38846#include <stdio.h>
38847#include <stdlib.h>
38848#include <unistd.h>
38849
38850int
38851main ()
38852{
38853
38854   socklen_t optlen;
38855   int optval;
38856   int stype;
38857   int ptype;
38858   int s;
38859
38860   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38861      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38862      ptype = IPPROTO_TCP;
38863   } else if (IPPROTO_TCP == IPPROTO_IP) {
38864      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38865      ptype = IPPROTO_IP;
38866   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38867      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38868      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38869   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38870      stype = SOCK_DGRAM;
38871      ptype = IPPROTO_UDP;
38872   } else {
38873       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38874       exit(1);
38875   }
38876
38877   if((s = socket(PF_INET, stype, ptype)) < 0) {
38878      perror("socket");
38879      exit(1);
38880   }
38881
38882   optval = 1;
38883   optlen = sizeof(optval);
38884   if(setsockopt(s, IPPROTO_TCP, TCP_MAXSEG, &optval, optlen) < 0) {
38885      perror("setsockopt: IPPROTO_TCP TCP_MAXSEG");
38886      close(s);
38887      exit(1);
38888   }
38889  ;
38890  return 0;
38891}
38892_ACEOF
38893if ac_fn_c_try_compile "$LINENO"; then :
38894  _compileok=1
38895fi
38896rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38897
38898  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
38899/* end confdefs.h.  */
38900
38901#include <sys/types.h>
38902#include <sys/socket.h>
38903#include <netinet/in.h>
38904#include <netinet/tcp.h>
38905#include <netinet/udp.h>
38906
38907#include <stdio.h>
38908#include <stdlib.h>
38909#include <unistd.h>
38910
38911int
38912main ()
38913{
38914
38915   socklen_t optlen;
38916   int optval;
38917   int stype;
38918   int ptype;
38919   int s;
38920
38921   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
38922      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
38923      ptype = IPPROTO_TCP;
38924   } else if (IPPROTO_TCP == IPPROTO_IP) {
38925      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
38926      ptype = IPPROTO_IP;
38927   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
38928      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
38929      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
38930   } else if (IPPROTO_TCP == IPPROTO_UDP) {
38931      stype = SOCK_DGRAM;
38932      ptype = IPPROTO_UDP;
38933   } else {
38934       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
38935       exit(1);
38936   }
38937
38938   if((s = socket(PF_INET6, stype, ptype)) < 0) {
38939      perror("socket");
38940      exit(1);
38941   }
38942
38943   optval = 1;
38944   optlen = sizeof(optval);
38945   if(setsockopt(s, IPPROTO_TCP, TCP_MAXSEG, &optval, optlen) < 0) {
38946      perror("setsockopt: IPPROTO_TCP TCP_MAXSEG");
38947      close(s);
38948      exit(1);
38949   }
38950  ;
38951  return 0;
38952}
38953_ACEOF
38954if ac_fn_c_try_compile "$LINENO"; then :
38955  _compileok=1
38956fi
38957rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
38958
38959  if test x"${_compileok}" != x; then
38960    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
38961$as_echo "yes" >&6; }
38962
38963cat >>confdefs.h <<_ACEOF
38964#define HAVE_TCP_MAXSEG 1
38965_ACEOF
38966
38967cat >>confdefs.h <<_ACEOF
38968#define SOCKS_TCP_MAXSEG_LVL IPPROTO_TCP
38969_ACEOF
38970
38971cat >>confdefs.h <<_ACEOF
38972#define SOCKS_TCP_MAXSEG_NAME "tcp_maxseg"
38973_ACEOF
38974    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
38975       #ipv4-only
38976
38977cat >>confdefs.h <<_ACEOF
38978#define SOCKS_TCP_MAXSEG_IPV4 1
38979_ACEOF
38980
38981cat >>confdefs.h <<_ACEOF
38982#define SOCKS_TCP_MAXSEG_IPV6 0
38983_ACEOF
38984    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
38985       #ipv6-only
38986
38987cat >>confdefs.h <<_ACEOF
38988#define SOCKS_TCP_MAXSEG_IPV4 0
38989_ACEOF
38990
38991cat >>confdefs.h <<_ACEOF
38992#define SOCKS_TCP_MAXSEG_IPV6 1
38993_ACEOF
38994    else
38995       #both ipv4 and ipv6
38996
38997cat >>confdefs.h <<_ACEOF
38998#define SOCKS_TCP_MAXSEG_IPV4 1
38999_ACEOF
39000
39001cat >>confdefs.h <<_ACEOF
39002#define SOCKS_TCP_MAXSEG_IPV6 1
39003_ACEOF
39004    fi
39005    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_MAXSEG"
39006  else
39007    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
39008$as_echo "no" >&6; }
39009  fi
39010unset _compileok
39011  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_MD5SIG" >&5
39012$as_echo_n "checking for IPPROTO_TCP socket option TCP_MD5SIG... " >&6; }
39013  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39014/* end confdefs.h.  */
39015
39016#include <sys/types.h>
39017#include <sys/socket.h>
39018#include <netinet/in.h>
39019#include <netinet/tcp.h>
39020#include <netinet/udp.h>
39021
39022#include <stdio.h>
39023#include <stdlib.h>
39024#include <unistd.h>
39025
39026int
39027main ()
39028{
39029
39030   socklen_t optlen;
39031   int optval;
39032   int stype;
39033   int ptype;
39034   int s;
39035
39036   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39037      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39038      ptype = IPPROTO_TCP;
39039   } else if (IPPROTO_TCP == IPPROTO_IP) {
39040      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39041      ptype = IPPROTO_IP;
39042   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39043      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39044      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39045   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39046      stype = SOCK_DGRAM;
39047      ptype = IPPROTO_UDP;
39048   } else {
39049       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39050       exit(1);
39051   }
39052
39053   if((s = socket(PF_INET, stype, ptype)) < 0) {
39054      perror("socket");
39055      exit(1);
39056   }
39057
39058   optval = 1;
39059   optlen = sizeof(optval);
39060   if(setsockopt(s, IPPROTO_TCP, TCP_MD5SIG, &optval, optlen) < 0) {
39061      perror("setsockopt: IPPROTO_TCP TCP_MD5SIG");
39062      close(s);
39063      exit(1);
39064   }
39065  ;
39066  return 0;
39067}
39068_ACEOF
39069if ac_fn_c_try_compile "$LINENO"; then :
39070  _compileok=1
39071fi
39072rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39073
39074  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39075/* end confdefs.h.  */
39076
39077#include <sys/types.h>
39078#include <sys/socket.h>
39079#include <netinet/in.h>
39080#include <netinet/tcp.h>
39081#include <netinet/udp.h>
39082
39083#include <stdio.h>
39084#include <stdlib.h>
39085#include <unistd.h>
39086
39087int
39088main ()
39089{
39090
39091   socklen_t optlen;
39092   int optval;
39093   int stype;
39094   int ptype;
39095   int s;
39096
39097   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39098      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39099      ptype = IPPROTO_TCP;
39100   } else if (IPPROTO_TCP == IPPROTO_IP) {
39101      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39102      ptype = IPPROTO_IP;
39103   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39104      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39105      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39106   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39107      stype = SOCK_DGRAM;
39108      ptype = IPPROTO_UDP;
39109   } else {
39110       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39111       exit(1);
39112   }
39113
39114   if((s = socket(PF_INET6, stype, ptype)) < 0) {
39115      perror("socket");
39116      exit(1);
39117   }
39118
39119   optval = 1;
39120   optlen = sizeof(optval);
39121   if(setsockopt(s, IPPROTO_TCP, TCP_MD5SIG, &optval, optlen) < 0) {
39122      perror("setsockopt: IPPROTO_TCP TCP_MD5SIG");
39123      close(s);
39124      exit(1);
39125   }
39126  ;
39127  return 0;
39128}
39129_ACEOF
39130if ac_fn_c_try_compile "$LINENO"; then :
39131  _compileok=1
39132fi
39133rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39134
39135  if test x"${_compileok}" != x; then
39136    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
39137$as_echo "yes" >&6; }
39138
39139cat >>confdefs.h <<_ACEOF
39140#define HAVE_TCP_MD5SIG 1
39141_ACEOF
39142
39143cat >>confdefs.h <<_ACEOF
39144#define SOCKS_TCP_MD5SIG_LVL IPPROTO_TCP
39145_ACEOF
39146
39147cat >>confdefs.h <<_ACEOF
39148#define SOCKS_TCP_MD5SIG_NAME "tcp_md5sig"
39149_ACEOF
39150    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
39151       #ipv4-only
39152
39153cat >>confdefs.h <<_ACEOF
39154#define SOCKS_TCP_MD5SIG_IPV4 1
39155_ACEOF
39156
39157cat >>confdefs.h <<_ACEOF
39158#define SOCKS_TCP_MD5SIG_IPV6 0
39159_ACEOF
39160    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
39161       #ipv6-only
39162
39163cat >>confdefs.h <<_ACEOF
39164#define SOCKS_TCP_MD5SIG_IPV4 0
39165_ACEOF
39166
39167cat >>confdefs.h <<_ACEOF
39168#define SOCKS_TCP_MD5SIG_IPV6 1
39169_ACEOF
39170    else
39171       #both ipv4 and ipv6
39172
39173cat >>confdefs.h <<_ACEOF
39174#define SOCKS_TCP_MD5SIG_IPV4 1
39175_ACEOF
39176
39177cat >>confdefs.h <<_ACEOF
39178#define SOCKS_TCP_MD5SIG_IPV6 1
39179_ACEOF
39180    fi
39181    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_MD5SIG"
39182  else
39183    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
39184$as_echo "no" >&6; }
39185  fi
39186unset _compileok
39187  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NODELAY" >&5
39188$as_echo_n "checking for IPPROTO_TCP socket option TCP_NODELAY... " >&6; }
39189  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39190/* end confdefs.h.  */
39191
39192#include <sys/types.h>
39193#include <sys/socket.h>
39194#include <netinet/in.h>
39195#include <netinet/tcp.h>
39196#include <netinet/udp.h>
39197
39198#include <stdio.h>
39199#include <stdlib.h>
39200#include <unistd.h>
39201
39202int
39203main ()
39204{
39205
39206   socklen_t optlen;
39207   int optval;
39208   int stype;
39209   int ptype;
39210   int s;
39211
39212   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39213      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39214      ptype = IPPROTO_TCP;
39215   } else if (IPPROTO_TCP == IPPROTO_IP) {
39216      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39217      ptype = IPPROTO_IP;
39218   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39219      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39220      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39221   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39222      stype = SOCK_DGRAM;
39223      ptype = IPPROTO_UDP;
39224   } else {
39225       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39226       exit(1);
39227   }
39228
39229   if((s = socket(PF_INET, stype, ptype)) < 0) {
39230      perror("socket");
39231      exit(1);
39232   }
39233
39234   optval = 1;
39235   optlen = sizeof(optval);
39236   if(setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &optval, optlen) < 0) {
39237      perror("setsockopt: IPPROTO_TCP TCP_NODELAY");
39238      close(s);
39239      exit(1);
39240   }
39241  ;
39242  return 0;
39243}
39244_ACEOF
39245if ac_fn_c_try_compile "$LINENO"; then :
39246  _compileok=1
39247fi
39248rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39249
39250  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39251/* end confdefs.h.  */
39252
39253#include <sys/types.h>
39254#include <sys/socket.h>
39255#include <netinet/in.h>
39256#include <netinet/tcp.h>
39257#include <netinet/udp.h>
39258
39259#include <stdio.h>
39260#include <stdlib.h>
39261#include <unistd.h>
39262
39263int
39264main ()
39265{
39266
39267   socklen_t optlen;
39268   int optval;
39269   int stype;
39270   int ptype;
39271   int s;
39272
39273   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39274      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39275      ptype = IPPROTO_TCP;
39276   } else if (IPPROTO_TCP == IPPROTO_IP) {
39277      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39278      ptype = IPPROTO_IP;
39279   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39280      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39281      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39282   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39283      stype = SOCK_DGRAM;
39284      ptype = IPPROTO_UDP;
39285   } else {
39286       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39287       exit(1);
39288   }
39289
39290   if((s = socket(PF_INET6, stype, ptype)) < 0) {
39291      perror("socket");
39292      exit(1);
39293   }
39294
39295   optval = 1;
39296   optlen = sizeof(optval);
39297   if(setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &optval, optlen) < 0) {
39298      perror("setsockopt: IPPROTO_TCP TCP_NODELAY");
39299      close(s);
39300      exit(1);
39301   }
39302  ;
39303  return 0;
39304}
39305_ACEOF
39306if ac_fn_c_try_compile "$LINENO"; then :
39307  _compileok=1
39308fi
39309rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39310
39311  if test x"${_compileok}" != x; then
39312    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
39313$as_echo "yes" >&6; }
39314
39315cat >>confdefs.h <<_ACEOF
39316#define HAVE_TCP_NODELAY 1
39317_ACEOF
39318
39319cat >>confdefs.h <<_ACEOF
39320#define SOCKS_TCP_NODELAY_LVL IPPROTO_TCP
39321_ACEOF
39322
39323cat >>confdefs.h <<_ACEOF
39324#define SOCKS_TCP_NODELAY_NAME "tcp_nodelay"
39325_ACEOF
39326    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
39327       #ipv4-only
39328
39329cat >>confdefs.h <<_ACEOF
39330#define SOCKS_TCP_NODELAY_IPV4 1
39331_ACEOF
39332
39333cat >>confdefs.h <<_ACEOF
39334#define SOCKS_TCP_NODELAY_IPV6 0
39335_ACEOF
39336    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
39337       #ipv6-only
39338
39339cat >>confdefs.h <<_ACEOF
39340#define SOCKS_TCP_NODELAY_IPV4 0
39341_ACEOF
39342
39343cat >>confdefs.h <<_ACEOF
39344#define SOCKS_TCP_NODELAY_IPV6 1
39345_ACEOF
39346    else
39347       #both ipv4 and ipv6
39348
39349cat >>confdefs.h <<_ACEOF
39350#define SOCKS_TCP_NODELAY_IPV4 1
39351_ACEOF
39352
39353cat >>confdefs.h <<_ACEOF
39354#define SOCKS_TCP_NODELAY_IPV6 1
39355_ACEOF
39356    fi
39357    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NODELAY"
39358  else
39359    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
39360$as_echo "no" >&6; }
39361  fi
39362unset _compileok
39363  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NOOPT" >&5
39364$as_echo_n "checking for IPPROTO_TCP socket option TCP_NOOPT... " >&6; }
39365  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39366/* end confdefs.h.  */
39367
39368#include <sys/types.h>
39369#include <sys/socket.h>
39370#include <netinet/in.h>
39371#include <netinet/tcp.h>
39372#include <netinet/udp.h>
39373
39374#include <stdio.h>
39375#include <stdlib.h>
39376#include <unistd.h>
39377
39378int
39379main ()
39380{
39381
39382   socklen_t optlen;
39383   int optval;
39384   int stype;
39385   int ptype;
39386   int s;
39387
39388   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39389      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39390      ptype = IPPROTO_TCP;
39391   } else if (IPPROTO_TCP == IPPROTO_IP) {
39392      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39393      ptype = IPPROTO_IP;
39394   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39395      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39396      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39397   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39398      stype = SOCK_DGRAM;
39399      ptype = IPPROTO_UDP;
39400   } else {
39401       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39402       exit(1);
39403   }
39404
39405   if((s = socket(PF_INET, stype, ptype)) < 0) {
39406      perror("socket");
39407      exit(1);
39408   }
39409
39410   optval = 1;
39411   optlen = sizeof(optval);
39412   if(setsockopt(s, IPPROTO_TCP, TCP_NOOPT, &optval, optlen) < 0) {
39413      perror("setsockopt: IPPROTO_TCP TCP_NOOPT");
39414      close(s);
39415      exit(1);
39416   }
39417  ;
39418  return 0;
39419}
39420_ACEOF
39421if ac_fn_c_try_compile "$LINENO"; then :
39422  _compileok=1
39423fi
39424rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39425
39426  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39427/* end confdefs.h.  */
39428
39429#include <sys/types.h>
39430#include <sys/socket.h>
39431#include <netinet/in.h>
39432#include <netinet/tcp.h>
39433#include <netinet/udp.h>
39434
39435#include <stdio.h>
39436#include <stdlib.h>
39437#include <unistd.h>
39438
39439int
39440main ()
39441{
39442
39443   socklen_t optlen;
39444   int optval;
39445   int stype;
39446   int ptype;
39447   int s;
39448
39449   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39450      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39451      ptype = IPPROTO_TCP;
39452   } else if (IPPROTO_TCP == IPPROTO_IP) {
39453      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39454      ptype = IPPROTO_IP;
39455   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39456      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39457      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39458   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39459      stype = SOCK_DGRAM;
39460      ptype = IPPROTO_UDP;
39461   } else {
39462       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39463       exit(1);
39464   }
39465
39466   if((s = socket(PF_INET6, stype, ptype)) < 0) {
39467      perror("socket");
39468      exit(1);
39469   }
39470
39471   optval = 1;
39472   optlen = sizeof(optval);
39473   if(setsockopt(s, IPPROTO_TCP, TCP_NOOPT, &optval, optlen) < 0) {
39474      perror("setsockopt: IPPROTO_TCP TCP_NOOPT");
39475      close(s);
39476      exit(1);
39477   }
39478  ;
39479  return 0;
39480}
39481_ACEOF
39482if ac_fn_c_try_compile "$LINENO"; then :
39483  _compileok=1
39484fi
39485rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39486
39487  if test x"${_compileok}" != x; then
39488    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
39489$as_echo "yes" >&6; }
39490
39491cat >>confdefs.h <<_ACEOF
39492#define HAVE_TCP_NOOPT 1
39493_ACEOF
39494
39495cat >>confdefs.h <<_ACEOF
39496#define SOCKS_TCP_NOOPT_LVL IPPROTO_TCP
39497_ACEOF
39498
39499cat >>confdefs.h <<_ACEOF
39500#define SOCKS_TCP_NOOPT_NAME "tcp_noopt"
39501_ACEOF
39502    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
39503       #ipv4-only
39504
39505cat >>confdefs.h <<_ACEOF
39506#define SOCKS_TCP_NOOPT_IPV4 1
39507_ACEOF
39508
39509cat >>confdefs.h <<_ACEOF
39510#define SOCKS_TCP_NOOPT_IPV6 0
39511_ACEOF
39512    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
39513       #ipv6-only
39514
39515cat >>confdefs.h <<_ACEOF
39516#define SOCKS_TCP_NOOPT_IPV4 0
39517_ACEOF
39518
39519cat >>confdefs.h <<_ACEOF
39520#define SOCKS_TCP_NOOPT_IPV6 1
39521_ACEOF
39522    else
39523       #both ipv4 and ipv6
39524
39525cat >>confdefs.h <<_ACEOF
39526#define SOCKS_TCP_NOOPT_IPV4 1
39527_ACEOF
39528
39529cat >>confdefs.h <<_ACEOF
39530#define SOCKS_TCP_NOOPT_IPV6 1
39531_ACEOF
39532    fi
39533    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NOOPT"
39534  else
39535    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
39536$as_echo "no" >&6; }
39537  fi
39538unset _compileok
39539  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NOPUSH" >&5
39540$as_echo_n "checking for IPPROTO_TCP socket option TCP_NOPUSH... " >&6; }
39541  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39542/* end confdefs.h.  */
39543
39544#include <sys/types.h>
39545#include <sys/socket.h>
39546#include <netinet/in.h>
39547#include <netinet/tcp.h>
39548#include <netinet/udp.h>
39549
39550#include <stdio.h>
39551#include <stdlib.h>
39552#include <unistd.h>
39553
39554int
39555main ()
39556{
39557
39558   socklen_t optlen;
39559   int optval;
39560   int stype;
39561   int ptype;
39562   int s;
39563
39564   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39565      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39566      ptype = IPPROTO_TCP;
39567   } else if (IPPROTO_TCP == IPPROTO_IP) {
39568      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39569      ptype = IPPROTO_IP;
39570   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39571      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39572      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39573   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39574      stype = SOCK_DGRAM;
39575      ptype = IPPROTO_UDP;
39576   } else {
39577       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39578       exit(1);
39579   }
39580
39581   if((s = socket(PF_INET, stype, ptype)) < 0) {
39582      perror("socket");
39583      exit(1);
39584   }
39585
39586   optval = 1;
39587   optlen = sizeof(optval);
39588   if(setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, &optval, optlen) < 0) {
39589      perror("setsockopt: IPPROTO_TCP TCP_NOPUSH");
39590      close(s);
39591      exit(1);
39592   }
39593  ;
39594  return 0;
39595}
39596_ACEOF
39597if ac_fn_c_try_compile "$LINENO"; then :
39598  _compileok=1
39599fi
39600rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39601
39602  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39603/* end confdefs.h.  */
39604
39605#include <sys/types.h>
39606#include <sys/socket.h>
39607#include <netinet/in.h>
39608#include <netinet/tcp.h>
39609#include <netinet/udp.h>
39610
39611#include <stdio.h>
39612#include <stdlib.h>
39613#include <unistd.h>
39614
39615int
39616main ()
39617{
39618
39619   socklen_t optlen;
39620   int optval;
39621   int stype;
39622   int ptype;
39623   int s;
39624
39625   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39626      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39627      ptype = IPPROTO_TCP;
39628   } else if (IPPROTO_TCP == IPPROTO_IP) {
39629      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39630      ptype = IPPROTO_IP;
39631   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39632      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39633      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39634   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39635      stype = SOCK_DGRAM;
39636      ptype = IPPROTO_UDP;
39637   } else {
39638       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39639       exit(1);
39640   }
39641
39642   if((s = socket(PF_INET6, stype, ptype)) < 0) {
39643      perror("socket");
39644      exit(1);
39645   }
39646
39647   optval = 1;
39648   optlen = sizeof(optval);
39649   if(setsockopt(s, IPPROTO_TCP, TCP_NOPUSH, &optval, optlen) < 0) {
39650      perror("setsockopt: IPPROTO_TCP TCP_NOPUSH");
39651      close(s);
39652      exit(1);
39653   }
39654  ;
39655  return 0;
39656}
39657_ACEOF
39658if ac_fn_c_try_compile "$LINENO"; then :
39659  _compileok=1
39660fi
39661rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39662
39663  if test x"${_compileok}" != x; then
39664    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
39665$as_echo "yes" >&6; }
39666
39667cat >>confdefs.h <<_ACEOF
39668#define HAVE_TCP_NOPUSH 1
39669_ACEOF
39670
39671cat >>confdefs.h <<_ACEOF
39672#define SOCKS_TCP_NOPUSH_LVL IPPROTO_TCP
39673_ACEOF
39674
39675cat >>confdefs.h <<_ACEOF
39676#define SOCKS_TCP_NOPUSH_NAME "tcp_nopush"
39677_ACEOF
39678    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
39679       #ipv4-only
39680
39681cat >>confdefs.h <<_ACEOF
39682#define SOCKS_TCP_NOPUSH_IPV4 1
39683_ACEOF
39684
39685cat >>confdefs.h <<_ACEOF
39686#define SOCKS_TCP_NOPUSH_IPV6 0
39687_ACEOF
39688    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
39689       #ipv6-only
39690
39691cat >>confdefs.h <<_ACEOF
39692#define SOCKS_TCP_NOPUSH_IPV4 0
39693_ACEOF
39694
39695cat >>confdefs.h <<_ACEOF
39696#define SOCKS_TCP_NOPUSH_IPV6 1
39697_ACEOF
39698    else
39699       #both ipv4 and ipv6
39700
39701cat >>confdefs.h <<_ACEOF
39702#define SOCKS_TCP_NOPUSH_IPV4 1
39703_ACEOF
39704
39705cat >>confdefs.h <<_ACEOF
39706#define SOCKS_TCP_NOPUSH_IPV6 1
39707_ACEOF
39708    fi
39709    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NOPUSH"
39710  else
39711    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
39712$as_echo "no" >&6; }
39713  fi
39714#L_CHECKSOCKOPT(IPPROTO_TCP, TCP_QUICKACK) #only transient?
39715unset _compileok
39716  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_SACK_ENABLE" >&5
39717$as_echo_n "checking for IPPROTO_TCP socket option TCP_SACK_ENABLE... " >&6; }
39718  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39719/* end confdefs.h.  */
39720
39721#include <sys/types.h>
39722#include <sys/socket.h>
39723#include <netinet/in.h>
39724#include <netinet/tcp.h>
39725#include <netinet/udp.h>
39726
39727#include <stdio.h>
39728#include <stdlib.h>
39729#include <unistd.h>
39730
39731int
39732main ()
39733{
39734
39735   socklen_t optlen;
39736   int optval;
39737   int stype;
39738   int ptype;
39739   int s;
39740
39741   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39742      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39743      ptype = IPPROTO_TCP;
39744   } else if (IPPROTO_TCP == IPPROTO_IP) {
39745      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39746      ptype = IPPROTO_IP;
39747   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39748      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39749      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39750   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39751      stype = SOCK_DGRAM;
39752      ptype = IPPROTO_UDP;
39753   } else {
39754       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39755       exit(1);
39756   }
39757
39758   if((s = socket(PF_INET, stype, ptype)) < 0) {
39759      perror("socket");
39760      exit(1);
39761   }
39762
39763   optval = 1;
39764   optlen = sizeof(optval);
39765   if(setsockopt(s, IPPROTO_TCP, TCP_SACK_ENABLE, &optval, optlen) < 0) {
39766      perror("setsockopt: IPPROTO_TCP TCP_SACK_ENABLE");
39767      close(s);
39768      exit(1);
39769   }
39770  ;
39771  return 0;
39772}
39773_ACEOF
39774if ac_fn_c_try_compile "$LINENO"; then :
39775  _compileok=1
39776fi
39777rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39778
39779  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39780/* end confdefs.h.  */
39781
39782#include <sys/types.h>
39783#include <sys/socket.h>
39784#include <netinet/in.h>
39785#include <netinet/tcp.h>
39786#include <netinet/udp.h>
39787
39788#include <stdio.h>
39789#include <stdlib.h>
39790#include <unistd.h>
39791
39792int
39793main ()
39794{
39795
39796   socklen_t optlen;
39797   int optval;
39798   int stype;
39799   int ptype;
39800   int s;
39801
39802   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39803      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39804      ptype = IPPROTO_TCP;
39805   } else if (IPPROTO_TCP == IPPROTO_IP) {
39806      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39807      ptype = IPPROTO_IP;
39808   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39809      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39810      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39811   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39812      stype = SOCK_DGRAM;
39813      ptype = IPPROTO_UDP;
39814   } else {
39815       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39816       exit(1);
39817   }
39818
39819   if((s = socket(PF_INET6, stype, ptype)) < 0) {
39820      perror("socket");
39821      exit(1);
39822   }
39823
39824   optval = 1;
39825   optlen = sizeof(optval);
39826   if(setsockopt(s, IPPROTO_TCP, TCP_SACK_ENABLE, &optval, optlen) < 0) {
39827      perror("setsockopt: IPPROTO_TCP TCP_SACK_ENABLE");
39828      close(s);
39829      exit(1);
39830   }
39831  ;
39832  return 0;
39833}
39834_ACEOF
39835if ac_fn_c_try_compile "$LINENO"; then :
39836  _compileok=1
39837fi
39838rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39839
39840  if test x"${_compileok}" != x; then
39841    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
39842$as_echo "yes" >&6; }
39843
39844cat >>confdefs.h <<_ACEOF
39845#define HAVE_TCP_SACK_ENABLE 1
39846_ACEOF
39847
39848cat >>confdefs.h <<_ACEOF
39849#define SOCKS_TCP_SACK_ENABLE_LVL IPPROTO_TCP
39850_ACEOF
39851
39852cat >>confdefs.h <<_ACEOF
39853#define SOCKS_TCP_SACK_ENABLE_NAME "tcp_sack_enable"
39854_ACEOF
39855    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
39856       #ipv4-only
39857
39858cat >>confdefs.h <<_ACEOF
39859#define SOCKS_TCP_SACK_ENABLE_IPV4 1
39860_ACEOF
39861
39862cat >>confdefs.h <<_ACEOF
39863#define SOCKS_TCP_SACK_ENABLE_IPV6 0
39864_ACEOF
39865    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
39866       #ipv6-only
39867
39868cat >>confdefs.h <<_ACEOF
39869#define SOCKS_TCP_SACK_ENABLE_IPV4 0
39870_ACEOF
39871
39872cat >>confdefs.h <<_ACEOF
39873#define SOCKS_TCP_SACK_ENABLE_IPV6 1
39874_ACEOF
39875    else
39876       #both ipv4 and ipv6
39877
39878cat >>confdefs.h <<_ACEOF
39879#define SOCKS_TCP_SACK_ENABLE_IPV4 1
39880_ACEOF
39881
39882cat >>confdefs.h <<_ACEOF
39883#define SOCKS_TCP_SACK_ENABLE_IPV6 1
39884_ACEOF
39885    fi
39886    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_SACK_ENABLE"
39887  else
39888    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
39889$as_echo "no" >&6; }
39890  fi
39891unset _compileok
39892  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_STDURG" >&5
39893$as_echo_n "checking for IPPROTO_TCP socket option TCP_STDURG... " >&6; }
39894  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39895/* end confdefs.h.  */
39896
39897#include <sys/types.h>
39898#include <sys/socket.h>
39899#include <netinet/in.h>
39900#include <netinet/tcp.h>
39901#include <netinet/udp.h>
39902
39903#include <stdio.h>
39904#include <stdlib.h>
39905#include <unistd.h>
39906
39907int
39908main ()
39909{
39910
39911   socklen_t optlen;
39912   int optval;
39913   int stype;
39914   int ptype;
39915   int s;
39916
39917   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39918      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39919      ptype = IPPROTO_TCP;
39920   } else if (IPPROTO_TCP == IPPROTO_IP) {
39921      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39922      ptype = IPPROTO_IP;
39923   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39924      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39925      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39926   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39927      stype = SOCK_DGRAM;
39928      ptype = IPPROTO_UDP;
39929   } else {
39930       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39931       exit(1);
39932   }
39933
39934   if((s = socket(PF_INET, stype, ptype)) < 0) {
39935      perror("socket");
39936      exit(1);
39937   }
39938
39939   optval = 1;
39940   optlen = sizeof(optval);
39941   if(setsockopt(s, IPPROTO_TCP, TCP_STDURG, &optval, optlen) < 0) {
39942      perror("setsockopt: IPPROTO_TCP TCP_STDURG");
39943      close(s);
39944      exit(1);
39945   }
39946  ;
39947  return 0;
39948}
39949_ACEOF
39950if ac_fn_c_try_compile "$LINENO"; then :
39951  _compileok=1
39952fi
39953rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
39954
39955  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
39956/* end confdefs.h.  */
39957
39958#include <sys/types.h>
39959#include <sys/socket.h>
39960#include <netinet/in.h>
39961#include <netinet/tcp.h>
39962#include <netinet/udp.h>
39963
39964#include <stdio.h>
39965#include <stdlib.h>
39966#include <unistd.h>
39967
39968int
39969main ()
39970{
39971
39972   socklen_t optlen;
39973   int optval;
39974   int stype;
39975   int ptype;
39976   int s;
39977
39978   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
39979      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
39980      ptype = IPPROTO_TCP;
39981   } else if (IPPROTO_TCP == IPPROTO_IP) {
39982      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
39983      ptype = IPPROTO_IP;
39984   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
39985      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
39986      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
39987   } else if (IPPROTO_TCP == IPPROTO_UDP) {
39988      stype = SOCK_DGRAM;
39989      ptype = IPPROTO_UDP;
39990   } else {
39991       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
39992       exit(1);
39993   }
39994
39995   if((s = socket(PF_INET6, stype, ptype)) < 0) {
39996      perror("socket");
39997      exit(1);
39998   }
39999
40000   optval = 1;
40001   optlen = sizeof(optval);
40002   if(setsockopt(s, IPPROTO_TCP, TCP_STDURG, &optval, optlen) < 0) {
40003      perror("setsockopt: IPPROTO_TCP TCP_STDURG");
40004      close(s);
40005      exit(1);
40006   }
40007  ;
40008  return 0;
40009}
40010_ACEOF
40011if ac_fn_c_try_compile "$LINENO"; then :
40012  _compileok=1
40013fi
40014rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40015
40016  if test x"${_compileok}" != x; then
40017    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
40018$as_echo "yes" >&6; }
40019
40020cat >>confdefs.h <<_ACEOF
40021#define HAVE_TCP_STDURG 1
40022_ACEOF
40023
40024cat >>confdefs.h <<_ACEOF
40025#define SOCKS_TCP_STDURG_LVL IPPROTO_TCP
40026_ACEOF
40027
40028cat >>confdefs.h <<_ACEOF
40029#define SOCKS_TCP_STDURG_NAME "tcp_stdurg"
40030_ACEOF
40031    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
40032       #ipv4-only
40033
40034cat >>confdefs.h <<_ACEOF
40035#define SOCKS_TCP_STDURG_IPV4 1
40036_ACEOF
40037
40038cat >>confdefs.h <<_ACEOF
40039#define SOCKS_TCP_STDURG_IPV6 0
40040_ACEOF
40041    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
40042       #ipv6-only
40043
40044cat >>confdefs.h <<_ACEOF
40045#define SOCKS_TCP_STDURG_IPV4 0
40046_ACEOF
40047
40048cat >>confdefs.h <<_ACEOF
40049#define SOCKS_TCP_STDURG_IPV6 1
40050_ACEOF
40051    else
40052       #both ipv4 and ipv6
40053
40054cat >>confdefs.h <<_ACEOF
40055#define SOCKS_TCP_STDURG_IPV4 1
40056_ACEOF
40057
40058cat >>confdefs.h <<_ACEOF
40059#define SOCKS_TCP_STDURG_IPV6 1
40060_ACEOF
40061    fi
40062    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_STDURG"
40063  else
40064    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40065$as_echo "no" >&6; }
40066  fi
40067unset _compileok
40068  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_SYNCNT" >&5
40069$as_echo_n "checking for IPPROTO_TCP socket option TCP_SYNCNT... " >&6; }
40070  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40071/* end confdefs.h.  */
40072
40073#include <sys/types.h>
40074#include <sys/socket.h>
40075#include <netinet/in.h>
40076#include <netinet/tcp.h>
40077#include <netinet/udp.h>
40078
40079#include <stdio.h>
40080#include <stdlib.h>
40081#include <unistd.h>
40082
40083int
40084main ()
40085{
40086
40087   socklen_t optlen;
40088   int optval;
40089   int stype;
40090   int ptype;
40091   int s;
40092
40093   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40094      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40095      ptype = IPPROTO_TCP;
40096   } else if (IPPROTO_TCP == IPPROTO_IP) {
40097      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40098      ptype = IPPROTO_IP;
40099   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40100      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40101      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40102   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40103      stype = SOCK_DGRAM;
40104      ptype = IPPROTO_UDP;
40105   } else {
40106       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40107       exit(1);
40108   }
40109
40110   if((s = socket(PF_INET, stype, ptype)) < 0) {
40111      perror("socket");
40112      exit(1);
40113   }
40114
40115   optval = 1;
40116   optlen = sizeof(optval);
40117   if(setsockopt(s, IPPROTO_TCP, TCP_SYNCNT, &optval, optlen) < 0) {
40118      perror("setsockopt: IPPROTO_TCP TCP_SYNCNT");
40119      close(s);
40120      exit(1);
40121   }
40122  ;
40123  return 0;
40124}
40125_ACEOF
40126if ac_fn_c_try_compile "$LINENO"; then :
40127  _compileok=1
40128fi
40129rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40130
40131  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40132/* end confdefs.h.  */
40133
40134#include <sys/types.h>
40135#include <sys/socket.h>
40136#include <netinet/in.h>
40137#include <netinet/tcp.h>
40138#include <netinet/udp.h>
40139
40140#include <stdio.h>
40141#include <stdlib.h>
40142#include <unistd.h>
40143
40144int
40145main ()
40146{
40147
40148   socklen_t optlen;
40149   int optval;
40150   int stype;
40151   int ptype;
40152   int s;
40153
40154   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40155      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40156      ptype = IPPROTO_TCP;
40157   } else if (IPPROTO_TCP == IPPROTO_IP) {
40158      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40159      ptype = IPPROTO_IP;
40160   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40161      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40162      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40163   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40164      stype = SOCK_DGRAM;
40165      ptype = IPPROTO_UDP;
40166   } else {
40167       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40168       exit(1);
40169   }
40170
40171   if((s = socket(PF_INET6, stype, ptype)) < 0) {
40172      perror("socket");
40173      exit(1);
40174   }
40175
40176   optval = 1;
40177   optlen = sizeof(optval);
40178   if(setsockopt(s, IPPROTO_TCP, TCP_SYNCNT, &optval, optlen) < 0) {
40179      perror("setsockopt: IPPROTO_TCP TCP_SYNCNT");
40180      close(s);
40181      exit(1);
40182   }
40183  ;
40184  return 0;
40185}
40186_ACEOF
40187if ac_fn_c_try_compile "$LINENO"; then :
40188  _compileok=1
40189fi
40190rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40191
40192  if test x"${_compileok}" != x; then
40193    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
40194$as_echo "yes" >&6; }
40195
40196cat >>confdefs.h <<_ACEOF
40197#define HAVE_TCP_SYNCNT 1
40198_ACEOF
40199
40200cat >>confdefs.h <<_ACEOF
40201#define SOCKS_TCP_SYNCNT_LVL IPPROTO_TCP
40202_ACEOF
40203
40204cat >>confdefs.h <<_ACEOF
40205#define SOCKS_TCP_SYNCNT_NAME "tcp_syncnt"
40206_ACEOF
40207    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
40208       #ipv4-only
40209
40210cat >>confdefs.h <<_ACEOF
40211#define SOCKS_TCP_SYNCNT_IPV4 1
40212_ACEOF
40213
40214cat >>confdefs.h <<_ACEOF
40215#define SOCKS_TCP_SYNCNT_IPV6 0
40216_ACEOF
40217    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
40218       #ipv6-only
40219
40220cat >>confdefs.h <<_ACEOF
40221#define SOCKS_TCP_SYNCNT_IPV4 0
40222_ACEOF
40223
40224cat >>confdefs.h <<_ACEOF
40225#define SOCKS_TCP_SYNCNT_IPV6 1
40226_ACEOF
40227    else
40228       #both ipv4 and ipv6
40229
40230cat >>confdefs.h <<_ACEOF
40231#define SOCKS_TCP_SYNCNT_IPV4 1
40232_ACEOF
40233
40234cat >>confdefs.h <<_ACEOF
40235#define SOCKS_TCP_SYNCNT_IPV6 1
40236_ACEOF
40237    fi
40238    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_SYNCNT"
40239  else
40240    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40241$as_echo "no" >&6; }
40242  fi
40243unset _compileok
40244  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_WINDOW_CLAMP" >&5
40245$as_echo_n "checking for IPPROTO_TCP socket option TCP_WINDOW_CLAMP... " >&6; }
40246  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40247/* end confdefs.h.  */
40248
40249#include <sys/types.h>
40250#include <sys/socket.h>
40251#include <netinet/in.h>
40252#include <netinet/tcp.h>
40253#include <netinet/udp.h>
40254
40255#include <stdio.h>
40256#include <stdlib.h>
40257#include <unistd.h>
40258
40259int
40260main ()
40261{
40262
40263   socklen_t optlen;
40264   int optval;
40265   int stype;
40266   int ptype;
40267   int s;
40268
40269   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40270      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40271      ptype = IPPROTO_TCP;
40272   } else if (IPPROTO_TCP == IPPROTO_IP) {
40273      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40274      ptype = IPPROTO_IP;
40275   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40276      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40277      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40278   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40279      stype = SOCK_DGRAM;
40280      ptype = IPPROTO_UDP;
40281   } else {
40282       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40283       exit(1);
40284   }
40285
40286   if((s = socket(PF_INET, stype, ptype)) < 0) {
40287      perror("socket");
40288      exit(1);
40289   }
40290
40291   optval = 1;
40292   optlen = sizeof(optval);
40293   if(setsockopt(s, IPPROTO_TCP, TCP_WINDOW_CLAMP, &optval, optlen) < 0) {
40294      perror("setsockopt: IPPROTO_TCP TCP_WINDOW_CLAMP");
40295      close(s);
40296      exit(1);
40297   }
40298  ;
40299  return 0;
40300}
40301_ACEOF
40302if ac_fn_c_try_compile "$LINENO"; then :
40303  _compileok=1
40304fi
40305rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40306
40307  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40308/* end confdefs.h.  */
40309
40310#include <sys/types.h>
40311#include <sys/socket.h>
40312#include <netinet/in.h>
40313#include <netinet/tcp.h>
40314#include <netinet/udp.h>
40315
40316#include <stdio.h>
40317#include <stdlib.h>
40318#include <unistd.h>
40319
40320int
40321main ()
40322{
40323
40324   socklen_t optlen;
40325   int optval;
40326   int stype;
40327   int ptype;
40328   int s;
40329
40330   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40331      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40332      ptype = IPPROTO_TCP;
40333   } else if (IPPROTO_TCP == IPPROTO_IP) {
40334      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40335      ptype = IPPROTO_IP;
40336   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40337      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40338      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40339   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40340      stype = SOCK_DGRAM;
40341      ptype = IPPROTO_UDP;
40342   } else {
40343       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40344       exit(1);
40345   }
40346
40347   if((s = socket(PF_INET6, stype, ptype)) < 0) {
40348      perror("socket");
40349      exit(1);
40350   }
40351
40352   optval = 1;
40353   optlen = sizeof(optval);
40354   if(setsockopt(s, IPPROTO_TCP, TCP_WINDOW_CLAMP, &optval, optlen) < 0) {
40355      perror("setsockopt: IPPROTO_TCP TCP_WINDOW_CLAMP");
40356      close(s);
40357      exit(1);
40358   }
40359  ;
40360  return 0;
40361}
40362_ACEOF
40363if ac_fn_c_try_compile "$LINENO"; then :
40364  _compileok=1
40365fi
40366rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40367
40368  if test x"${_compileok}" != x; then
40369    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
40370$as_echo "yes" >&6; }
40371
40372cat >>confdefs.h <<_ACEOF
40373#define HAVE_TCP_WINDOW_CLAMP 1
40374_ACEOF
40375
40376cat >>confdefs.h <<_ACEOF
40377#define SOCKS_TCP_WINDOW_CLAMP_LVL IPPROTO_TCP
40378_ACEOF
40379
40380cat >>confdefs.h <<_ACEOF
40381#define SOCKS_TCP_WINDOW_CLAMP_NAME "tcp_window_clamp"
40382_ACEOF
40383    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
40384       #ipv4-only
40385
40386cat >>confdefs.h <<_ACEOF
40387#define SOCKS_TCP_WINDOW_CLAMP_IPV4 1
40388_ACEOF
40389
40390cat >>confdefs.h <<_ACEOF
40391#define SOCKS_TCP_WINDOW_CLAMP_IPV6 0
40392_ACEOF
40393    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
40394       #ipv6-only
40395
40396cat >>confdefs.h <<_ACEOF
40397#define SOCKS_TCP_WINDOW_CLAMP_IPV4 0
40398_ACEOF
40399
40400cat >>confdefs.h <<_ACEOF
40401#define SOCKS_TCP_WINDOW_CLAMP_IPV6 1
40402_ACEOF
40403    else
40404       #both ipv4 and ipv6
40405
40406cat >>confdefs.h <<_ACEOF
40407#define SOCKS_TCP_WINDOW_CLAMP_IPV4 1
40408_ACEOF
40409
40410cat >>confdefs.h <<_ACEOF
40411#define SOCKS_TCP_WINDOW_CLAMP_IPV6 1
40412_ACEOF
40413    fi
40414    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_WINDOW_CLAMP"
40415  else
40416    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40417$as_echo "no" >&6; }
40418  fi
40419unset _compileok
40420  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_RFC1323" >&5
40421$as_echo_n "checking for IPPROTO_TCP socket option TCP_RFC1323... " >&6; }
40422  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40423/* end confdefs.h.  */
40424
40425#include <sys/types.h>
40426#include <sys/socket.h>
40427#include <netinet/in.h>
40428#include <netinet/tcp.h>
40429#include <netinet/udp.h>
40430
40431#include <stdio.h>
40432#include <stdlib.h>
40433#include <unistd.h>
40434
40435int
40436main ()
40437{
40438
40439   socklen_t optlen;
40440   int optval;
40441   int stype;
40442   int ptype;
40443   int s;
40444
40445   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40446      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40447      ptype = IPPROTO_TCP;
40448   } else if (IPPROTO_TCP == IPPROTO_IP) {
40449      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40450      ptype = IPPROTO_IP;
40451   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40452      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40453      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40454   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40455      stype = SOCK_DGRAM;
40456      ptype = IPPROTO_UDP;
40457   } else {
40458       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40459       exit(1);
40460   }
40461
40462   if((s = socket(PF_INET, stype, ptype)) < 0) {
40463      perror("socket");
40464      exit(1);
40465   }
40466
40467   optval = 1;
40468   optlen = sizeof(optval);
40469   if(setsockopt(s, IPPROTO_TCP, TCP_RFC1323, &optval, optlen) < 0) {
40470      perror("setsockopt: IPPROTO_TCP TCP_RFC1323");
40471      close(s);
40472      exit(1);
40473   }
40474  ;
40475  return 0;
40476}
40477_ACEOF
40478if ac_fn_c_try_compile "$LINENO"; then :
40479  _compileok=1
40480fi
40481rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40482
40483  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40484/* end confdefs.h.  */
40485
40486#include <sys/types.h>
40487#include <sys/socket.h>
40488#include <netinet/in.h>
40489#include <netinet/tcp.h>
40490#include <netinet/udp.h>
40491
40492#include <stdio.h>
40493#include <stdlib.h>
40494#include <unistd.h>
40495
40496int
40497main ()
40498{
40499
40500   socklen_t optlen;
40501   int optval;
40502   int stype;
40503   int ptype;
40504   int s;
40505
40506   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40507      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40508      ptype = IPPROTO_TCP;
40509   } else if (IPPROTO_TCP == IPPROTO_IP) {
40510      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40511      ptype = IPPROTO_IP;
40512   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40513      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40514      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40515   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40516      stype = SOCK_DGRAM;
40517      ptype = IPPROTO_UDP;
40518   } else {
40519       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40520       exit(1);
40521   }
40522
40523   if((s = socket(PF_INET6, stype, ptype)) < 0) {
40524      perror("socket");
40525      exit(1);
40526   }
40527
40528   optval = 1;
40529   optlen = sizeof(optval);
40530   if(setsockopt(s, IPPROTO_TCP, TCP_RFC1323, &optval, optlen) < 0) {
40531      perror("setsockopt: IPPROTO_TCP TCP_RFC1323");
40532      close(s);
40533      exit(1);
40534   }
40535  ;
40536  return 0;
40537}
40538_ACEOF
40539if ac_fn_c_try_compile "$LINENO"; then :
40540  _compileok=1
40541fi
40542rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40543
40544  if test x"${_compileok}" != x; then
40545    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
40546$as_echo "yes" >&6; }
40547
40548cat >>confdefs.h <<_ACEOF
40549#define HAVE_TCP_RFC1323 1
40550_ACEOF
40551
40552cat >>confdefs.h <<_ACEOF
40553#define SOCKS_TCP_RFC1323_LVL IPPROTO_TCP
40554_ACEOF
40555
40556cat >>confdefs.h <<_ACEOF
40557#define SOCKS_TCP_RFC1323_NAME "tcp_rfc1323"
40558_ACEOF
40559    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
40560       #ipv4-only
40561
40562cat >>confdefs.h <<_ACEOF
40563#define SOCKS_TCP_RFC1323_IPV4 1
40564_ACEOF
40565
40566cat >>confdefs.h <<_ACEOF
40567#define SOCKS_TCP_RFC1323_IPV6 0
40568_ACEOF
40569    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
40570       #ipv6-only
40571
40572cat >>confdefs.h <<_ACEOF
40573#define SOCKS_TCP_RFC1323_IPV4 0
40574_ACEOF
40575
40576cat >>confdefs.h <<_ACEOF
40577#define SOCKS_TCP_RFC1323_IPV6 1
40578_ACEOF
40579    else
40580       #both ipv4 and ipv6
40581
40582cat >>confdefs.h <<_ACEOF
40583#define SOCKS_TCP_RFC1323_IPV4 1
40584_ACEOF
40585
40586cat >>confdefs.h <<_ACEOF
40587#define SOCKS_TCP_RFC1323_IPV6 1
40588_ACEOF
40589    fi
40590    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_RFC1323"
40591  else
40592    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40593$as_echo "no" >&6; }
40594  fi
40595unset _compileok
40596  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NODELAYACK" >&5
40597$as_echo_n "checking for IPPROTO_TCP socket option TCP_NODELAYACK... " >&6; }
40598  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40599/* end confdefs.h.  */
40600
40601#include <sys/types.h>
40602#include <sys/socket.h>
40603#include <netinet/in.h>
40604#include <netinet/tcp.h>
40605#include <netinet/udp.h>
40606
40607#include <stdio.h>
40608#include <stdlib.h>
40609#include <unistd.h>
40610
40611int
40612main ()
40613{
40614
40615   socklen_t optlen;
40616   int optval;
40617   int stype;
40618   int ptype;
40619   int s;
40620
40621   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40622      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40623      ptype = IPPROTO_TCP;
40624   } else if (IPPROTO_TCP == IPPROTO_IP) {
40625      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40626      ptype = IPPROTO_IP;
40627   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40628      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40629      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40630   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40631      stype = SOCK_DGRAM;
40632      ptype = IPPROTO_UDP;
40633   } else {
40634       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40635       exit(1);
40636   }
40637
40638   if((s = socket(PF_INET, stype, ptype)) < 0) {
40639      perror("socket");
40640      exit(1);
40641   }
40642
40643   optval = 1;
40644   optlen = sizeof(optval);
40645   if(setsockopt(s, IPPROTO_TCP, TCP_NODELAYACK, &optval, optlen) < 0) {
40646      perror("setsockopt: IPPROTO_TCP TCP_NODELAYACK");
40647      close(s);
40648      exit(1);
40649   }
40650  ;
40651  return 0;
40652}
40653_ACEOF
40654if ac_fn_c_try_compile "$LINENO"; then :
40655  _compileok=1
40656fi
40657rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40658
40659  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40660/* end confdefs.h.  */
40661
40662#include <sys/types.h>
40663#include <sys/socket.h>
40664#include <netinet/in.h>
40665#include <netinet/tcp.h>
40666#include <netinet/udp.h>
40667
40668#include <stdio.h>
40669#include <stdlib.h>
40670#include <unistd.h>
40671
40672int
40673main ()
40674{
40675
40676   socklen_t optlen;
40677   int optval;
40678   int stype;
40679   int ptype;
40680   int s;
40681
40682   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40683      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40684      ptype = IPPROTO_TCP;
40685   } else if (IPPROTO_TCP == IPPROTO_IP) {
40686      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40687      ptype = IPPROTO_IP;
40688   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40689      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40690      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40691   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40692      stype = SOCK_DGRAM;
40693      ptype = IPPROTO_UDP;
40694   } else {
40695       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40696       exit(1);
40697   }
40698
40699   if((s = socket(PF_INET6, stype, ptype)) < 0) {
40700      perror("socket");
40701      exit(1);
40702   }
40703
40704   optval = 1;
40705   optlen = sizeof(optval);
40706   if(setsockopt(s, IPPROTO_TCP, TCP_NODELAYACK, &optval, optlen) < 0) {
40707      perror("setsockopt: IPPROTO_TCP TCP_NODELAYACK");
40708      close(s);
40709      exit(1);
40710   }
40711  ;
40712  return 0;
40713}
40714_ACEOF
40715if ac_fn_c_try_compile "$LINENO"; then :
40716  _compileok=1
40717fi
40718rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40719
40720  if test x"${_compileok}" != x; then
40721    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
40722$as_echo "yes" >&6; }
40723
40724cat >>confdefs.h <<_ACEOF
40725#define HAVE_TCP_NODELAYACK 1
40726_ACEOF
40727
40728cat >>confdefs.h <<_ACEOF
40729#define SOCKS_TCP_NODELAYACK_LVL IPPROTO_TCP
40730_ACEOF
40731
40732cat >>confdefs.h <<_ACEOF
40733#define SOCKS_TCP_NODELAYACK_NAME "tcp_nodelayack"
40734_ACEOF
40735    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
40736       #ipv4-only
40737
40738cat >>confdefs.h <<_ACEOF
40739#define SOCKS_TCP_NODELAYACK_IPV4 1
40740_ACEOF
40741
40742cat >>confdefs.h <<_ACEOF
40743#define SOCKS_TCP_NODELAYACK_IPV6 0
40744_ACEOF
40745    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
40746       #ipv6-only
40747
40748cat >>confdefs.h <<_ACEOF
40749#define SOCKS_TCP_NODELAYACK_IPV4 0
40750_ACEOF
40751
40752cat >>confdefs.h <<_ACEOF
40753#define SOCKS_TCP_NODELAYACK_IPV6 1
40754_ACEOF
40755    else
40756       #both ipv4 and ipv6
40757
40758cat >>confdefs.h <<_ACEOF
40759#define SOCKS_TCP_NODELAYACK_IPV4 1
40760_ACEOF
40761
40762cat >>confdefs.h <<_ACEOF
40763#define SOCKS_TCP_NODELAYACK_IPV6 1
40764_ACEOF
40765    fi
40766    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NODELAYACK"
40767  else
40768    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40769$as_echo "no" >&6; }
40770  fi
40771unset _compileok
40772  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_CWND_IF" >&5
40773$as_echo_n "checking for IPPROTO_TCP socket option TCP_CWND_IF... " >&6; }
40774  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40775/* end confdefs.h.  */
40776
40777#include <sys/types.h>
40778#include <sys/socket.h>
40779#include <netinet/in.h>
40780#include <netinet/tcp.h>
40781#include <netinet/udp.h>
40782
40783#include <stdio.h>
40784#include <stdlib.h>
40785#include <unistd.h>
40786
40787int
40788main ()
40789{
40790
40791   socklen_t optlen;
40792   int optval;
40793   int stype;
40794   int ptype;
40795   int s;
40796
40797   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40798      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40799      ptype = IPPROTO_TCP;
40800   } else if (IPPROTO_TCP == IPPROTO_IP) {
40801      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40802      ptype = IPPROTO_IP;
40803   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40804      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40805      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40806   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40807      stype = SOCK_DGRAM;
40808      ptype = IPPROTO_UDP;
40809   } else {
40810       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40811       exit(1);
40812   }
40813
40814   if((s = socket(PF_INET, stype, ptype)) < 0) {
40815      perror("socket");
40816      exit(1);
40817   }
40818
40819   optval = 1;
40820   optlen = sizeof(optval);
40821   if(setsockopt(s, IPPROTO_TCP, TCP_CWND_IF, &optval, optlen) < 0) {
40822      perror("setsockopt: IPPROTO_TCP TCP_CWND_IF");
40823      close(s);
40824      exit(1);
40825   }
40826  ;
40827  return 0;
40828}
40829_ACEOF
40830if ac_fn_c_try_compile "$LINENO"; then :
40831  _compileok=1
40832fi
40833rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40834
40835  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40836/* end confdefs.h.  */
40837
40838#include <sys/types.h>
40839#include <sys/socket.h>
40840#include <netinet/in.h>
40841#include <netinet/tcp.h>
40842#include <netinet/udp.h>
40843
40844#include <stdio.h>
40845#include <stdlib.h>
40846#include <unistd.h>
40847
40848int
40849main ()
40850{
40851
40852   socklen_t optlen;
40853   int optval;
40854   int stype;
40855   int ptype;
40856   int s;
40857
40858   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40859      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40860      ptype = IPPROTO_TCP;
40861   } else if (IPPROTO_TCP == IPPROTO_IP) {
40862      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40863      ptype = IPPROTO_IP;
40864   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40865      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40866      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40867   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40868      stype = SOCK_DGRAM;
40869      ptype = IPPROTO_UDP;
40870   } else {
40871       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40872       exit(1);
40873   }
40874
40875   if((s = socket(PF_INET6, stype, ptype)) < 0) {
40876      perror("socket");
40877      exit(1);
40878   }
40879
40880   optval = 1;
40881   optlen = sizeof(optval);
40882   if(setsockopt(s, IPPROTO_TCP, TCP_CWND_IF, &optval, optlen) < 0) {
40883      perror("setsockopt: IPPROTO_TCP TCP_CWND_IF");
40884      close(s);
40885      exit(1);
40886   }
40887  ;
40888  return 0;
40889}
40890_ACEOF
40891if ac_fn_c_try_compile "$LINENO"; then :
40892  _compileok=1
40893fi
40894rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
40895
40896  if test x"${_compileok}" != x; then
40897    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
40898$as_echo "yes" >&6; }
40899
40900cat >>confdefs.h <<_ACEOF
40901#define HAVE_TCP_CWND_IF 1
40902_ACEOF
40903
40904cat >>confdefs.h <<_ACEOF
40905#define SOCKS_TCP_CWND_IF_LVL IPPROTO_TCP
40906_ACEOF
40907
40908cat >>confdefs.h <<_ACEOF
40909#define SOCKS_TCP_CWND_IF_NAME "tcp_cwnd_if"
40910_ACEOF
40911    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
40912       #ipv4-only
40913
40914cat >>confdefs.h <<_ACEOF
40915#define SOCKS_TCP_CWND_IF_IPV4 1
40916_ACEOF
40917
40918cat >>confdefs.h <<_ACEOF
40919#define SOCKS_TCP_CWND_IF_IPV6 0
40920_ACEOF
40921    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
40922       #ipv6-only
40923
40924cat >>confdefs.h <<_ACEOF
40925#define SOCKS_TCP_CWND_IF_IPV4 0
40926_ACEOF
40927
40928cat >>confdefs.h <<_ACEOF
40929#define SOCKS_TCP_CWND_IF_IPV6 1
40930_ACEOF
40931    else
40932       #both ipv4 and ipv6
40933
40934cat >>confdefs.h <<_ACEOF
40935#define SOCKS_TCP_CWND_IF_IPV4 1
40936_ACEOF
40937
40938cat >>confdefs.h <<_ACEOF
40939#define SOCKS_TCP_CWND_IF_IPV6 1
40940_ACEOF
40941    fi
40942    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_CWND_IF"
40943  else
40944    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
40945$as_echo "no" >&6; }
40946  fi
40947unset _compileok
40948  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_CWND_DF" >&5
40949$as_echo_n "checking for IPPROTO_TCP socket option TCP_CWND_DF... " >&6; }
40950  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
40951/* end confdefs.h.  */
40952
40953#include <sys/types.h>
40954#include <sys/socket.h>
40955#include <netinet/in.h>
40956#include <netinet/tcp.h>
40957#include <netinet/udp.h>
40958
40959#include <stdio.h>
40960#include <stdlib.h>
40961#include <unistd.h>
40962
40963int
40964main ()
40965{
40966
40967   socklen_t optlen;
40968   int optval;
40969   int stype;
40970   int ptype;
40971   int s;
40972
40973   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
40974      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
40975      ptype = IPPROTO_TCP;
40976   } else if (IPPROTO_TCP == IPPROTO_IP) {
40977      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
40978      ptype = IPPROTO_IP;
40979   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
40980      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
40981      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
40982   } else if (IPPROTO_TCP == IPPROTO_UDP) {
40983      stype = SOCK_DGRAM;
40984      ptype = IPPROTO_UDP;
40985   } else {
40986       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
40987       exit(1);
40988   }
40989
40990   if((s = socket(PF_INET, stype, ptype)) < 0) {
40991      perror("socket");
40992      exit(1);
40993   }
40994
40995   optval = 1;
40996   optlen = sizeof(optval);
40997   if(setsockopt(s, IPPROTO_TCP, TCP_CWND_DF, &optval, optlen) < 0) {
40998      perror("setsockopt: IPPROTO_TCP TCP_CWND_DF");
40999      close(s);
41000      exit(1);
41001   }
41002  ;
41003  return 0;
41004}
41005_ACEOF
41006if ac_fn_c_try_compile "$LINENO"; then :
41007  _compileok=1
41008fi
41009rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41010
41011  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41012/* end confdefs.h.  */
41013
41014#include <sys/types.h>
41015#include <sys/socket.h>
41016#include <netinet/in.h>
41017#include <netinet/tcp.h>
41018#include <netinet/udp.h>
41019
41020#include <stdio.h>
41021#include <stdlib.h>
41022#include <unistd.h>
41023
41024int
41025main ()
41026{
41027
41028   socklen_t optlen;
41029   int optval;
41030   int stype;
41031   int ptype;
41032   int s;
41033
41034   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41035      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41036      ptype = IPPROTO_TCP;
41037   } else if (IPPROTO_TCP == IPPROTO_IP) {
41038      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41039      ptype = IPPROTO_IP;
41040   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41041      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41042      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41043   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41044      stype = SOCK_DGRAM;
41045      ptype = IPPROTO_UDP;
41046   } else {
41047       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41048       exit(1);
41049   }
41050
41051   if((s = socket(PF_INET6, stype, ptype)) < 0) {
41052      perror("socket");
41053      exit(1);
41054   }
41055
41056   optval = 1;
41057   optlen = sizeof(optval);
41058   if(setsockopt(s, IPPROTO_TCP, TCP_CWND_DF, &optval, optlen) < 0) {
41059      perror("setsockopt: IPPROTO_TCP TCP_CWND_DF");
41060      close(s);
41061      exit(1);
41062   }
41063  ;
41064  return 0;
41065}
41066_ACEOF
41067if ac_fn_c_try_compile "$LINENO"; then :
41068  _compileok=1
41069fi
41070rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41071
41072  if test x"${_compileok}" != x; then
41073    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
41074$as_echo "yes" >&6; }
41075
41076cat >>confdefs.h <<_ACEOF
41077#define HAVE_TCP_CWND_DF 1
41078_ACEOF
41079
41080cat >>confdefs.h <<_ACEOF
41081#define SOCKS_TCP_CWND_DF_LVL IPPROTO_TCP
41082_ACEOF
41083
41084cat >>confdefs.h <<_ACEOF
41085#define SOCKS_TCP_CWND_DF_NAME "tcp_cwnd_df"
41086_ACEOF
41087    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
41088       #ipv4-only
41089
41090cat >>confdefs.h <<_ACEOF
41091#define SOCKS_TCP_CWND_DF_IPV4 1
41092_ACEOF
41093
41094cat >>confdefs.h <<_ACEOF
41095#define SOCKS_TCP_CWND_DF_IPV6 0
41096_ACEOF
41097    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
41098       #ipv6-only
41099
41100cat >>confdefs.h <<_ACEOF
41101#define SOCKS_TCP_CWND_DF_IPV4 0
41102_ACEOF
41103
41104cat >>confdefs.h <<_ACEOF
41105#define SOCKS_TCP_CWND_DF_IPV6 1
41106_ACEOF
41107    else
41108       #both ipv4 and ipv6
41109
41110cat >>confdefs.h <<_ACEOF
41111#define SOCKS_TCP_CWND_DF_IPV4 1
41112_ACEOF
41113
41114cat >>confdefs.h <<_ACEOF
41115#define SOCKS_TCP_CWND_DF_IPV6 1
41116_ACEOF
41117    fi
41118    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_CWND_DF"
41119  else
41120    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
41121$as_echo "no" >&6; }
41122  fi
41123unset _compileok
41124  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NOTENTER_SSTART" >&5
41125$as_echo_n "checking for IPPROTO_TCP socket option TCP_NOTENTER_SSTART... " >&6; }
41126  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41127/* end confdefs.h.  */
41128
41129#include <sys/types.h>
41130#include <sys/socket.h>
41131#include <netinet/in.h>
41132#include <netinet/tcp.h>
41133#include <netinet/udp.h>
41134
41135#include <stdio.h>
41136#include <stdlib.h>
41137#include <unistd.h>
41138
41139int
41140main ()
41141{
41142
41143   socklen_t optlen;
41144   int optval;
41145   int stype;
41146   int ptype;
41147   int s;
41148
41149   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41150      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41151      ptype = IPPROTO_TCP;
41152   } else if (IPPROTO_TCP == IPPROTO_IP) {
41153      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41154      ptype = IPPROTO_IP;
41155   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41156      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41157      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41158   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41159      stype = SOCK_DGRAM;
41160      ptype = IPPROTO_UDP;
41161   } else {
41162       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41163       exit(1);
41164   }
41165
41166   if((s = socket(PF_INET, stype, ptype)) < 0) {
41167      perror("socket");
41168      exit(1);
41169   }
41170
41171   optval = 1;
41172   optlen = sizeof(optval);
41173   if(setsockopt(s, IPPROTO_TCP, TCP_NOTENTER_SSTART, &optval, optlen) < 0) {
41174      perror("setsockopt: IPPROTO_TCP TCP_NOTENTER_SSTART");
41175      close(s);
41176      exit(1);
41177   }
41178  ;
41179  return 0;
41180}
41181_ACEOF
41182if ac_fn_c_try_compile "$LINENO"; then :
41183  _compileok=1
41184fi
41185rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41186
41187  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41188/* end confdefs.h.  */
41189
41190#include <sys/types.h>
41191#include <sys/socket.h>
41192#include <netinet/in.h>
41193#include <netinet/tcp.h>
41194#include <netinet/udp.h>
41195
41196#include <stdio.h>
41197#include <stdlib.h>
41198#include <unistd.h>
41199
41200int
41201main ()
41202{
41203
41204   socklen_t optlen;
41205   int optval;
41206   int stype;
41207   int ptype;
41208   int s;
41209
41210   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41211      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41212      ptype = IPPROTO_TCP;
41213   } else if (IPPROTO_TCP == IPPROTO_IP) {
41214      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41215      ptype = IPPROTO_IP;
41216   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41217      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41218      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41219   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41220      stype = SOCK_DGRAM;
41221      ptype = IPPROTO_UDP;
41222   } else {
41223       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41224       exit(1);
41225   }
41226
41227   if((s = socket(PF_INET6, stype, ptype)) < 0) {
41228      perror("socket");
41229      exit(1);
41230   }
41231
41232   optval = 1;
41233   optlen = sizeof(optval);
41234   if(setsockopt(s, IPPROTO_TCP, TCP_NOTENTER_SSTART, &optval, optlen) < 0) {
41235      perror("setsockopt: IPPROTO_TCP TCP_NOTENTER_SSTART");
41236      close(s);
41237      exit(1);
41238   }
41239  ;
41240  return 0;
41241}
41242_ACEOF
41243if ac_fn_c_try_compile "$LINENO"; then :
41244  _compileok=1
41245fi
41246rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41247
41248  if test x"${_compileok}" != x; then
41249    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
41250$as_echo "yes" >&6; }
41251
41252cat >>confdefs.h <<_ACEOF
41253#define HAVE_TCP_NOTENTER_SSTART 1
41254_ACEOF
41255
41256cat >>confdefs.h <<_ACEOF
41257#define SOCKS_TCP_NOTENTER_SSTART_LVL IPPROTO_TCP
41258_ACEOF
41259
41260cat >>confdefs.h <<_ACEOF
41261#define SOCKS_TCP_NOTENTER_SSTART_NAME "tcp_notenter_sstart"
41262_ACEOF
41263    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
41264       #ipv4-only
41265
41266cat >>confdefs.h <<_ACEOF
41267#define SOCKS_TCP_NOTENTER_SSTART_IPV4 1
41268_ACEOF
41269
41270cat >>confdefs.h <<_ACEOF
41271#define SOCKS_TCP_NOTENTER_SSTART_IPV6 0
41272_ACEOF
41273    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
41274       #ipv6-only
41275
41276cat >>confdefs.h <<_ACEOF
41277#define SOCKS_TCP_NOTENTER_SSTART_IPV4 0
41278_ACEOF
41279
41280cat >>confdefs.h <<_ACEOF
41281#define SOCKS_TCP_NOTENTER_SSTART_IPV6 1
41282_ACEOF
41283    else
41284       #both ipv4 and ipv6
41285
41286cat >>confdefs.h <<_ACEOF
41287#define SOCKS_TCP_NOTENTER_SSTART_IPV4 1
41288_ACEOF
41289
41290cat >>confdefs.h <<_ACEOF
41291#define SOCKS_TCP_NOTENTER_SSTART_IPV6 1
41292_ACEOF
41293    fi
41294    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NOTENTER_SSTART"
41295  else
41296    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
41297$as_echo "no" >&6; }
41298  fi
41299unset _compileok
41300  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NOREDUCE_CWND_IN_FRXMT" >&5
41301$as_echo_n "checking for IPPROTO_TCP socket option TCP_NOREDUCE_CWND_IN_FRXMT... " >&6; }
41302  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41303/* end confdefs.h.  */
41304
41305#include <sys/types.h>
41306#include <sys/socket.h>
41307#include <netinet/in.h>
41308#include <netinet/tcp.h>
41309#include <netinet/udp.h>
41310
41311#include <stdio.h>
41312#include <stdlib.h>
41313#include <unistd.h>
41314
41315int
41316main ()
41317{
41318
41319   socklen_t optlen;
41320   int optval;
41321   int stype;
41322   int ptype;
41323   int s;
41324
41325   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41326      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41327      ptype = IPPROTO_TCP;
41328   } else if (IPPROTO_TCP == IPPROTO_IP) {
41329      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41330      ptype = IPPROTO_IP;
41331   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41332      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41333      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41334   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41335      stype = SOCK_DGRAM;
41336      ptype = IPPROTO_UDP;
41337   } else {
41338       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41339       exit(1);
41340   }
41341
41342   if((s = socket(PF_INET, stype, ptype)) < 0) {
41343      perror("socket");
41344      exit(1);
41345   }
41346
41347   optval = 1;
41348   optlen = sizeof(optval);
41349   if(setsockopt(s, IPPROTO_TCP, TCP_NOREDUCE_CWND_IN_FRXMT, &optval, optlen) < 0) {
41350      perror("setsockopt: IPPROTO_TCP TCP_NOREDUCE_CWND_IN_FRXMT");
41351      close(s);
41352      exit(1);
41353   }
41354  ;
41355  return 0;
41356}
41357_ACEOF
41358if ac_fn_c_try_compile "$LINENO"; then :
41359  _compileok=1
41360fi
41361rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41362
41363  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41364/* end confdefs.h.  */
41365
41366#include <sys/types.h>
41367#include <sys/socket.h>
41368#include <netinet/in.h>
41369#include <netinet/tcp.h>
41370#include <netinet/udp.h>
41371
41372#include <stdio.h>
41373#include <stdlib.h>
41374#include <unistd.h>
41375
41376int
41377main ()
41378{
41379
41380   socklen_t optlen;
41381   int optval;
41382   int stype;
41383   int ptype;
41384   int s;
41385
41386   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41387      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41388      ptype = IPPROTO_TCP;
41389   } else if (IPPROTO_TCP == IPPROTO_IP) {
41390      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41391      ptype = IPPROTO_IP;
41392   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41393      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41394      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41395   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41396      stype = SOCK_DGRAM;
41397      ptype = IPPROTO_UDP;
41398   } else {
41399       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41400       exit(1);
41401   }
41402
41403   if((s = socket(PF_INET6, stype, ptype)) < 0) {
41404      perror("socket");
41405      exit(1);
41406   }
41407
41408   optval = 1;
41409   optlen = sizeof(optval);
41410   if(setsockopt(s, IPPROTO_TCP, TCP_NOREDUCE_CWND_IN_FRXMT, &optval, optlen) < 0) {
41411      perror("setsockopt: IPPROTO_TCP TCP_NOREDUCE_CWND_IN_FRXMT");
41412      close(s);
41413      exit(1);
41414   }
41415  ;
41416  return 0;
41417}
41418_ACEOF
41419if ac_fn_c_try_compile "$LINENO"; then :
41420  _compileok=1
41421fi
41422rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41423
41424  if test x"${_compileok}" != x; then
41425    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
41426$as_echo "yes" >&6; }
41427
41428cat >>confdefs.h <<_ACEOF
41429#define HAVE_TCP_NOREDUCE_CWND_IN_FRXMT 1
41430_ACEOF
41431
41432cat >>confdefs.h <<_ACEOF
41433#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_LVL IPPROTO_TCP
41434_ACEOF
41435
41436cat >>confdefs.h <<_ACEOF
41437#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_NAME "tcp_noreduce_cwnd_in_frxmt"
41438_ACEOF
41439    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
41440       #ipv4-only
41441
41442cat >>confdefs.h <<_ACEOF
41443#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_IPV4 1
41444_ACEOF
41445
41446cat >>confdefs.h <<_ACEOF
41447#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_IPV6 0
41448_ACEOF
41449    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
41450       #ipv6-only
41451
41452cat >>confdefs.h <<_ACEOF
41453#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_IPV4 0
41454_ACEOF
41455
41456cat >>confdefs.h <<_ACEOF
41457#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_IPV6 1
41458_ACEOF
41459    else
41460       #both ipv4 and ipv6
41461
41462cat >>confdefs.h <<_ACEOF
41463#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_IPV4 1
41464_ACEOF
41465
41466cat >>confdefs.h <<_ACEOF
41467#define SOCKS_TCP_NOREDUCE_CWND_IN_FRXMT_IPV6 1
41468_ACEOF
41469    fi
41470    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NOREDUCE_CWND_IN_FRXMT"
41471  else
41472    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
41473$as_echo "no" >&6; }
41474  fi
41475unset _compileok
41476  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_TCP socket option TCP_NOREDUCE_CWND_EXIT_FRXMT" >&5
41477$as_echo_n "checking for IPPROTO_TCP socket option TCP_NOREDUCE_CWND_EXIT_FRXMT... " >&6; }
41478  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41479/* end confdefs.h.  */
41480
41481#include <sys/types.h>
41482#include <sys/socket.h>
41483#include <netinet/in.h>
41484#include <netinet/tcp.h>
41485#include <netinet/udp.h>
41486
41487#include <stdio.h>
41488#include <stdlib.h>
41489#include <unistd.h>
41490
41491int
41492main ()
41493{
41494
41495   socklen_t optlen;
41496   int optval;
41497   int stype;
41498   int ptype;
41499   int s;
41500
41501   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41502      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41503      ptype = IPPROTO_TCP;
41504   } else if (IPPROTO_TCP == IPPROTO_IP) {
41505      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41506      ptype = IPPROTO_IP;
41507   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41508      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41509      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41510   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41511      stype = SOCK_DGRAM;
41512      ptype = IPPROTO_UDP;
41513   } else {
41514       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41515       exit(1);
41516   }
41517
41518   if((s = socket(PF_INET, stype, ptype)) < 0) {
41519      perror("socket");
41520      exit(1);
41521   }
41522
41523   optval = 1;
41524   optlen = sizeof(optval);
41525   if(setsockopt(s, IPPROTO_TCP, TCP_NOREDUCE_CWND_EXIT_FRXMT, &optval, optlen) < 0) {
41526      perror("setsockopt: IPPROTO_TCP TCP_NOREDUCE_CWND_EXIT_FRXMT");
41527      close(s);
41528      exit(1);
41529   }
41530  ;
41531  return 0;
41532}
41533_ACEOF
41534if ac_fn_c_try_compile "$LINENO"; then :
41535  _compileok=1
41536fi
41537rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41538
41539  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41540/* end confdefs.h.  */
41541
41542#include <sys/types.h>
41543#include <sys/socket.h>
41544#include <netinet/in.h>
41545#include <netinet/tcp.h>
41546#include <netinet/udp.h>
41547
41548#include <stdio.h>
41549#include <stdlib.h>
41550#include <unistd.h>
41551
41552int
41553main ()
41554{
41555
41556   socklen_t optlen;
41557   int optval;
41558   int stype;
41559   int ptype;
41560   int s;
41561
41562   if (IPPROTO_TCP == SOL_SOCKET || IPPROTO_TCP == IPPROTO_TCP) {
41563      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41564      ptype = IPPROTO_TCP;
41565   } else if (IPPROTO_TCP == IPPROTO_IP) {
41566      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41567      ptype = IPPROTO_IP;
41568   } else if (IPPROTO_TCP == IPPROTO_IPV6) {
41569      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41570      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41571   } else if (IPPROTO_TCP == IPPROTO_UDP) {
41572      stype = SOCK_DGRAM;
41573      ptype = IPPROTO_UDP;
41574   } else {
41575       fprintf(stderr, "error: unexpected socket type: IPPROTO_TCP");
41576       exit(1);
41577   }
41578
41579   if((s = socket(PF_INET6, stype, ptype)) < 0) {
41580      perror("socket");
41581      exit(1);
41582   }
41583
41584   optval = 1;
41585   optlen = sizeof(optval);
41586   if(setsockopt(s, IPPROTO_TCP, TCP_NOREDUCE_CWND_EXIT_FRXMT, &optval, optlen) < 0) {
41587      perror("setsockopt: IPPROTO_TCP TCP_NOREDUCE_CWND_EXIT_FRXMT");
41588      close(s);
41589      exit(1);
41590   }
41591  ;
41592  return 0;
41593}
41594_ACEOF
41595if ac_fn_c_try_compile "$LINENO"; then :
41596  _compileok=1
41597fi
41598rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41599
41600  if test x"${_compileok}" != x; then
41601    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
41602$as_echo "yes" >&6; }
41603
41604cat >>confdefs.h <<_ACEOF
41605#define HAVE_TCP_NOREDUCE_CWND_EXIT_FRXMT 1
41606_ACEOF
41607
41608cat >>confdefs.h <<_ACEOF
41609#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_LVL IPPROTO_TCP
41610_ACEOF
41611
41612cat >>confdefs.h <<_ACEOF
41613#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_NAME "tcp_noreduce_cwnd_exit_frxmt"
41614_ACEOF
41615    if test x"IPPROTO_TCP" = x"IPPROTO_IP"; then
41616       #ipv4-only
41617
41618cat >>confdefs.h <<_ACEOF
41619#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_IPV4 1
41620_ACEOF
41621
41622cat >>confdefs.h <<_ACEOF
41623#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_IPV6 0
41624_ACEOF
41625    elif test x"IPPROTO_TCP" = x"IPPROTO_IPV6"; then
41626       #ipv6-only
41627
41628cat >>confdefs.h <<_ACEOF
41629#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_IPV4 0
41630_ACEOF
41631
41632cat >>confdefs.h <<_ACEOF
41633#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_IPV6 1
41634_ACEOF
41635    else
41636       #both ipv4 and ipv6
41637
41638cat >>confdefs.h <<_ACEOF
41639#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_IPV4 1
41640_ACEOF
41641
41642cat >>confdefs.h <<_ACEOF
41643#define SOCKS_TCP_NOREDUCE_CWND_EXIT_FRXMT_IPV6 1
41644_ACEOF
41645    fi
41646    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }TCP_NOREDUCE_CWND_EXIT_FRXMT"
41647  else
41648    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
41649$as_echo "no" >&6; }
41650  fi
41651
41652#udp level
41653unset _compileok
41654  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_UDP socket option UDP_CORK" >&5
41655$as_echo_n "checking for IPPROTO_UDP socket option UDP_CORK... " >&6; }
41656  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41657/* end confdefs.h.  */
41658
41659#include <sys/types.h>
41660#include <sys/socket.h>
41661#include <netinet/in.h>
41662#include <netinet/tcp.h>
41663#include <netinet/udp.h>
41664
41665#include <stdio.h>
41666#include <stdlib.h>
41667#include <unistd.h>
41668
41669int
41670main ()
41671{
41672
41673   socklen_t optlen;
41674   int optval;
41675   int stype;
41676   int ptype;
41677   int s;
41678
41679   if (IPPROTO_UDP == SOL_SOCKET || IPPROTO_UDP == IPPROTO_TCP) {
41680      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41681      ptype = IPPROTO_TCP;
41682   } else if (IPPROTO_UDP == IPPROTO_IP) {
41683      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41684      ptype = IPPROTO_IP;
41685   } else if (IPPROTO_UDP == IPPROTO_IPV6) {
41686      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41687      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41688   } else if (IPPROTO_UDP == IPPROTO_UDP) {
41689      stype = SOCK_DGRAM;
41690      ptype = IPPROTO_UDP;
41691   } else {
41692       fprintf(stderr, "error: unexpected socket type: IPPROTO_UDP");
41693       exit(1);
41694   }
41695
41696   if((s = socket(PF_INET, stype, ptype)) < 0) {
41697      perror("socket");
41698      exit(1);
41699   }
41700
41701   optval = 1;
41702   optlen = sizeof(optval);
41703   if(setsockopt(s, IPPROTO_UDP, UDP_CORK, &optval, optlen) < 0) {
41704      perror("setsockopt: IPPROTO_UDP UDP_CORK");
41705      close(s);
41706      exit(1);
41707   }
41708  ;
41709  return 0;
41710}
41711_ACEOF
41712if ac_fn_c_try_compile "$LINENO"; then :
41713  _compileok=1
41714fi
41715rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41716
41717  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41718/* end confdefs.h.  */
41719
41720#include <sys/types.h>
41721#include <sys/socket.h>
41722#include <netinet/in.h>
41723#include <netinet/tcp.h>
41724#include <netinet/udp.h>
41725
41726#include <stdio.h>
41727#include <stdlib.h>
41728#include <unistd.h>
41729
41730int
41731main ()
41732{
41733
41734   socklen_t optlen;
41735   int optval;
41736   int stype;
41737   int ptype;
41738   int s;
41739
41740   if (IPPROTO_UDP == SOL_SOCKET || IPPROTO_UDP == IPPROTO_TCP) {
41741      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41742      ptype = IPPROTO_TCP;
41743   } else if (IPPROTO_UDP == IPPROTO_IP) {
41744      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41745      ptype = IPPROTO_IP;
41746   } else if (IPPROTO_UDP == IPPROTO_IPV6) {
41747      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41748      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41749   } else if (IPPROTO_UDP == IPPROTO_UDP) {
41750      stype = SOCK_DGRAM;
41751      ptype = IPPROTO_UDP;
41752   } else {
41753       fprintf(stderr, "error: unexpected socket type: IPPROTO_UDP");
41754       exit(1);
41755   }
41756
41757   if((s = socket(PF_INET6, stype, ptype)) < 0) {
41758      perror("socket");
41759      exit(1);
41760   }
41761
41762   optval = 1;
41763   optlen = sizeof(optval);
41764   if(setsockopt(s, IPPROTO_UDP, UDP_CORK, &optval, optlen) < 0) {
41765      perror("setsockopt: IPPROTO_UDP UDP_CORK");
41766      close(s);
41767      exit(1);
41768   }
41769  ;
41770  return 0;
41771}
41772_ACEOF
41773if ac_fn_c_try_compile "$LINENO"; then :
41774  _compileok=1
41775fi
41776rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41777
41778  if test x"${_compileok}" != x; then
41779    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
41780$as_echo "yes" >&6; }
41781
41782cat >>confdefs.h <<_ACEOF
41783#define HAVE_UDP_CORK 1
41784_ACEOF
41785
41786cat >>confdefs.h <<_ACEOF
41787#define SOCKS_UDP_CORK_LVL IPPROTO_UDP
41788_ACEOF
41789
41790cat >>confdefs.h <<_ACEOF
41791#define SOCKS_UDP_CORK_NAME "udp_cork"
41792_ACEOF
41793    if test x"IPPROTO_UDP" = x"IPPROTO_IP"; then
41794       #ipv4-only
41795
41796cat >>confdefs.h <<_ACEOF
41797#define SOCKS_UDP_CORK_IPV4 1
41798_ACEOF
41799
41800cat >>confdefs.h <<_ACEOF
41801#define SOCKS_UDP_CORK_IPV6 0
41802_ACEOF
41803    elif test x"IPPROTO_UDP" = x"IPPROTO_IPV6"; then
41804       #ipv6-only
41805
41806cat >>confdefs.h <<_ACEOF
41807#define SOCKS_UDP_CORK_IPV4 0
41808_ACEOF
41809
41810cat >>confdefs.h <<_ACEOF
41811#define SOCKS_UDP_CORK_IPV6 1
41812_ACEOF
41813    else
41814       #both ipv4 and ipv6
41815
41816cat >>confdefs.h <<_ACEOF
41817#define SOCKS_UDP_CORK_IPV4 1
41818_ACEOF
41819
41820cat >>confdefs.h <<_ACEOF
41821#define SOCKS_UDP_CORK_IPV6 1
41822_ACEOF
41823    fi
41824    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }UDP_CORK"
41825  else
41826    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
41827$as_echo "no" >&6; }
41828  fi
41829
41830#ipv4 level
41831unset _compileok
41832  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_AUTH_LEVEL" >&5
41833$as_echo_n "checking for IPPROTO_IP socket option IP_AUTH_LEVEL... " >&6; }
41834  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41835/* end confdefs.h.  */
41836
41837#include <sys/types.h>
41838#include <sys/socket.h>
41839#include <netinet/in.h>
41840#include <netinet/tcp.h>
41841#include <netinet/udp.h>
41842
41843#include <stdio.h>
41844#include <stdlib.h>
41845#include <unistd.h>
41846
41847int
41848main ()
41849{
41850
41851   socklen_t optlen;
41852   int optval;
41853   int stype;
41854   int ptype;
41855   int s;
41856
41857   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
41858      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41859      ptype = IPPROTO_TCP;
41860   } else if (IPPROTO_IP == IPPROTO_IP) {
41861      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41862      ptype = IPPROTO_IP;
41863   } else if (IPPROTO_IP == IPPROTO_IPV6) {
41864      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41865      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41866   } else if (IPPROTO_IP == IPPROTO_UDP) {
41867      stype = SOCK_DGRAM;
41868      ptype = IPPROTO_UDP;
41869   } else {
41870       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
41871       exit(1);
41872   }
41873
41874   if((s = socket(PF_INET, stype, ptype)) < 0) {
41875      perror("socket");
41876      exit(1);
41877   }
41878
41879   optval = 1;
41880   optlen = sizeof(optval);
41881   if(setsockopt(s, IPPROTO_IP, IP_AUTH_LEVEL, &optval, optlen) < 0) {
41882      perror("setsockopt: IPPROTO_IP IP_AUTH_LEVEL");
41883      close(s);
41884      exit(1);
41885   }
41886  ;
41887  return 0;
41888}
41889_ACEOF
41890if ac_fn_c_try_compile "$LINENO"; then :
41891  _compileok=1
41892fi
41893rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41894
41895  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
41896/* end confdefs.h.  */
41897
41898#include <sys/types.h>
41899#include <sys/socket.h>
41900#include <netinet/in.h>
41901#include <netinet/tcp.h>
41902#include <netinet/udp.h>
41903
41904#include <stdio.h>
41905#include <stdlib.h>
41906#include <unistd.h>
41907
41908int
41909main ()
41910{
41911
41912   socklen_t optlen;
41913   int optval;
41914   int stype;
41915   int ptype;
41916   int s;
41917
41918   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
41919      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
41920      ptype = IPPROTO_TCP;
41921   } else if (IPPROTO_IP == IPPROTO_IP) {
41922      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
41923      ptype = IPPROTO_IP;
41924   } else if (IPPROTO_IP == IPPROTO_IPV6) {
41925      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
41926      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
41927   } else if (IPPROTO_IP == IPPROTO_UDP) {
41928      stype = SOCK_DGRAM;
41929      ptype = IPPROTO_UDP;
41930   } else {
41931       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
41932       exit(1);
41933   }
41934
41935   if((s = socket(PF_INET6, stype, ptype)) < 0) {
41936      perror("socket");
41937      exit(1);
41938   }
41939
41940   optval = 1;
41941   optlen = sizeof(optval);
41942   if(setsockopt(s, IPPROTO_IP, IP_AUTH_LEVEL, &optval, optlen) < 0) {
41943      perror("setsockopt: IPPROTO_IP IP_AUTH_LEVEL");
41944      close(s);
41945      exit(1);
41946   }
41947  ;
41948  return 0;
41949}
41950_ACEOF
41951if ac_fn_c_try_compile "$LINENO"; then :
41952  _compileok=1
41953fi
41954rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41955
41956  if test x"${_compileok}" != x; then
41957    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
41958$as_echo "yes" >&6; }
41959
41960cat >>confdefs.h <<_ACEOF
41961#define HAVE_IP_AUTH_LEVEL 1
41962_ACEOF
41963
41964cat >>confdefs.h <<_ACEOF
41965#define SOCKS_IP_AUTH_LEVEL_LVL IPPROTO_IP
41966_ACEOF
41967
41968cat >>confdefs.h <<_ACEOF
41969#define SOCKS_IP_AUTH_LEVEL_NAME "ip_auth_level"
41970_ACEOF
41971    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
41972       #ipv4-only
41973
41974cat >>confdefs.h <<_ACEOF
41975#define SOCKS_IP_AUTH_LEVEL_IPV4 1
41976_ACEOF
41977
41978cat >>confdefs.h <<_ACEOF
41979#define SOCKS_IP_AUTH_LEVEL_IPV6 0
41980_ACEOF
41981    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
41982       #ipv6-only
41983
41984cat >>confdefs.h <<_ACEOF
41985#define SOCKS_IP_AUTH_LEVEL_IPV4 0
41986_ACEOF
41987
41988cat >>confdefs.h <<_ACEOF
41989#define SOCKS_IP_AUTH_LEVEL_IPV6 1
41990_ACEOF
41991    else
41992       #both ipv4 and ipv6
41993
41994cat >>confdefs.h <<_ACEOF
41995#define SOCKS_IP_AUTH_LEVEL_IPV4 1
41996_ACEOF
41997
41998cat >>confdefs.h <<_ACEOF
41999#define SOCKS_IP_AUTH_LEVEL_IPV6 1
42000_ACEOF
42001    fi
42002    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_AUTH_LEVEL"
42003  else
42004    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
42005$as_echo "no" >&6; }
42006  fi
42007unset _compileok
42008  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_DONTFRAG" >&5
42009$as_echo_n "checking for IPPROTO_IP socket option IP_DONTFRAG... " >&6; }
42010  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42011/* end confdefs.h.  */
42012
42013#include <sys/types.h>
42014#include <sys/socket.h>
42015#include <netinet/in.h>
42016#include <netinet/tcp.h>
42017#include <netinet/udp.h>
42018
42019#include <stdio.h>
42020#include <stdlib.h>
42021#include <unistd.h>
42022
42023int
42024main ()
42025{
42026
42027   socklen_t optlen;
42028   int optval;
42029   int stype;
42030   int ptype;
42031   int s;
42032
42033   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42034      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42035      ptype = IPPROTO_TCP;
42036   } else if (IPPROTO_IP == IPPROTO_IP) {
42037      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42038      ptype = IPPROTO_IP;
42039   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42040      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42041      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42042   } else if (IPPROTO_IP == IPPROTO_UDP) {
42043      stype = SOCK_DGRAM;
42044      ptype = IPPROTO_UDP;
42045   } else {
42046       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42047       exit(1);
42048   }
42049
42050   if((s = socket(PF_INET, stype, ptype)) < 0) {
42051      perror("socket");
42052      exit(1);
42053   }
42054
42055   optval = 1;
42056   optlen = sizeof(optval);
42057   if(setsockopt(s, IPPROTO_IP, IP_DONTFRAG, &optval, optlen) < 0) {
42058      perror("setsockopt: IPPROTO_IP IP_DONTFRAG");
42059      close(s);
42060      exit(1);
42061   }
42062  ;
42063  return 0;
42064}
42065_ACEOF
42066if ac_fn_c_try_compile "$LINENO"; then :
42067  _compileok=1
42068fi
42069rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42070
42071  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42072/* end confdefs.h.  */
42073
42074#include <sys/types.h>
42075#include <sys/socket.h>
42076#include <netinet/in.h>
42077#include <netinet/tcp.h>
42078#include <netinet/udp.h>
42079
42080#include <stdio.h>
42081#include <stdlib.h>
42082#include <unistd.h>
42083
42084int
42085main ()
42086{
42087
42088   socklen_t optlen;
42089   int optval;
42090   int stype;
42091   int ptype;
42092   int s;
42093
42094   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42095      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42096      ptype = IPPROTO_TCP;
42097   } else if (IPPROTO_IP == IPPROTO_IP) {
42098      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42099      ptype = IPPROTO_IP;
42100   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42101      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42102      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42103   } else if (IPPROTO_IP == IPPROTO_UDP) {
42104      stype = SOCK_DGRAM;
42105      ptype = IPPROTO_UDP;
42106   } else {
42107       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42108       exit(1);
42109   }
42110
42111   if((s = socket(PF_INET6, stype, ptype)) < 0) {
42112      perror("socket");
42113      exit(1);
42114   }
42115
42116   optval = 1;
42117   optlen = sizeof(optval);
42118   if(setsockopt(s, IPPROTO_IP, IP_DONTFRAG, &optval, optlen) < 0) {
42119      perror("setsockopt: IPPROTO_IP IP_DONTFRAG");
42120      close(s);
42121      exit(1);
42122   }
42123  ;
42124  return 0;
42125}
42126_ACEOF
42127if ac_fn_c_try_compile "$LINENO"; then :
42128  _compileok=1
42129fi
42130rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42131
42132  if test x"${_compileok}" != x; then
42133    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
42134$as_echo "yes" >&6; }
42135
42136cat >>confdefs.h <<_ACEOF
42137#define HAVE_IP_DONTFRAG 1
42138_ACEOF
42139
42140cat >>confdefs.h <<_ACEOF
42141#define SOCKS_IP_DONTFRAG_LVL IPPROTO_IP
42142_ACEOF
42143
42144cat >>confdefs.h <<_ACEOF
42145#define SOCKS_IP_DONTFRAG_NAME "ip_dontfrag"
42146_ACEOF
42147    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
42148       #ipv4-only
42149
42150cat >>confdefs.h <<_ACEOF
42151#define SOCKS_IP_DONTFRAG_IPV4 1
42152_ACEOF
42153
42154cat >>confdefs.h <<_ACEOF
42155#define SOCKS_IP_DONTFRAG_IPV6 0
42156_ACEOF
42157    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
42158       #ipv6-only
42159
42160cat >>confdefs.h <<_ACEOF
42161#define SOCKS_IP_DONTFRAG_IPV4 0
42162_ACEOF
42163
42164cat >>confdefs.h <<_ACEOF
42165#define SOCKS_IP_DONTFRAG_IPV6 1
42166_ACEOF
42167    else
42168       #both ipv4 and ipv6
42169
42170cat >>confdefs.h <<_ACEOF
42171#define SOCKS_IP_DONTFRAG_IPV4 1
42172_ACEOF
42173
42174cat >>confdefs.h <<_ACEOF
42175#define SOCKS_IP_DONTFRAG_IPV6 1
42176_ACEOF
42177    fi
42178    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_DONTFRAG"
42179  else
42180    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
42181$as_echo "no" >&6; }
42182  fi
42183unset _compileok
42184  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_ESP_NETWORK_LEVEL" >&5
42185$as_echo_n "checking for IPPROTO_IP socket option IP_ESP_NETWORK_LEVEL... " >&6; }
42186  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42187/* end confdefs.h.  */
42188
42189#include <sys/types.h>
42190#include <sys/socket.h>
42191#include <netinet/in.h>
42192#include <netinet/tcp.h>
42193#include <netinet/udp.h>
42194
42195#include <stdio.h>
42196#include <stdlib.h>
42197#include <unistd.h>
42198
42199int
42200main ()
42201{
42202
42203   socklen_t optlen;
42204   int optval;
42205   int stype;
42206   int ptype;
42207   int s;
42208
42209   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42210      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42211      ptype = IPPROTO_TCP;
42212   } else if (IPPROTO_IP == IPPROTO_IP) {
42213      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42214      ptype = IPPROTO_IP;
42215   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42216      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42217      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42218   } else if (IPPROTO_IP == IPPROTO_UDP) {
42219      stype = SOCK_DGRAM;
42220      ptype = IPPROTO_UDP;
42221   } else {
42222       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42223       exit(1);
42224   }
42225
42226   if((s = socket(PF_INET, stype, ptype)) < 0) {
42227      perror("socket");
42228      exit(1);
42229   }
42230
42231   optval = 1;
42232   optlen = sizeof(optval);
42233   if(setsockopt(s, IPPROTO_IP, IP_ESP_NETWORK_LEVEL, &optval, optlen) < 0) {
42234      perror("setsockopt: IPPROTO_IP IP_ESP_NETWORK_LEVEL");
42235      close(s);
42236      exit(1);
42237   }
42238  ;
42239  return 0;
42240}
42241_ACEOF
42242if ac_fn_c_try_compile "$LINENO"; then :
42243  _compileok=1
42244fi
42245rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42246
42247  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42248/* end confdefs.h.  */
42249
42250#include <sys/types.h>
42251#include <sys/socket.h>
42252#include <netinet/in.h>
42253#include <netinet/tcp.h>
42254#include <netinet/udp.h>
42255
42256#include <stdio.h>
42257#include <stdlib.h>
42258#include <unistd.h>
42259
42260int
42261main ()
42262{
42263
42264   socklen_t optlen;
42265   int optval;
42266   int stype;
42267   int ptype;
42268   int s;
42269
42270   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42271      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42272      ptype = IPPROTO_TCP;
42273   } else if (IPPROTO_IP == IPPROTO_IP) {
42274      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42275      ptype = IPPROTO_IP;
42276   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42277      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42278      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42279   } else if (IPPROTO_IP == IPPROTO_UDP) {
42280      stype = SOCK_DGRAM;
42281      ptype = IPPROTO_UDP;
42282   } else {
42283       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42284       exit(1);
42285   }
42286
42287   if((s = socket(PF_INET6, stype, ptype)) < 0) {
42288      perror("socket");
42289      exit(1);
42290   }
42291
42292   optval = 1;
42293   optlen = sizeof(optval);
42294   if(setsockopt(s, IPPROTO_IP, IP_ESP_NETWORK_LEVEL, &optval, optlen) < 0) {
42295      perror("setsockopt: IPPROTO_IP IP_ESP_NETWORK_LEVEL");
42296      close(s);
42297      exit(1);
42298   }
42299  ;
42300  return 0;
42301}
42302_ACEOF
42303if ac_fn_c_try_compile "$LINENO"; then :
42304  _compileok=1
42305fi
42306rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42307
42308  if test x"${_compileok}" != x; then
42309    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
42310$as_echo "yes" >&6; }
42311
42312cat >>confdefs.h <<_ACEOF
42313#define HAVE_IP_ESP_NETWORK_LEVEL 1
42314_ACEOF
42315
42316cat >>confdefs.h <<_ACEOF
42317#define SOCKS_IP_ESP_NETWORK_LEVEL_LVL IPPROTO_IP
42318_ACEOF
42319
42320cat >>confdefs.h <<_ACEOF
42321#define SOCKS_IP_ESP_NETWORK_LEVEL_NAME "ip_esp_network_level"
42322_ACEOF
42323    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
42324       #ipv4-only
42325
42326cat >>confdefs.h <<_ACEOF
42327#define SOCKS_IP_ESP_NETWORK_LEVEL_IPV4 1
42328_ACEOF
42329
42330cat >>confdefs.h <<_ACEOF
42331#define SOCKS_IP_ESP_NETWORK_LEVEL_IPV6 0
42332_ACEOF
42333    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
42334       #ipv6-only
42335
42336cat >>confdefs.h <<_ACEOF
42337#define SOCKS_IP_ESP_NETWORK_LEVEL_IPV4 0
42338_ACEOF
42339
42340cat >>confdefs.h <<_ACEOF
42341#define SOCKS_IP_ESP_NETWORK_LEVEL_IPV6 1
42342_ACEOF
42343    else
42344       #both ipv4 and ipv6
42345
42346cat >>confdefs.h <<_ACEOF
42347#define SOCKS_IP_ESP_NETWORK_LEVEL_IPV4 1
42348_ACEOF
42349
42350cat >>confdefs.h <<_ACEOF
42351#define SOCKS_IP_ESP_NETWORK_LEVEL_IPV6 1
42352_ACEOF
42353    fi
42354    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_ESP_NETWORK_LEVEL"
42355  else
42356    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
42357$as_echo "no" >&6; }
42358  fi
42359unset _compileok
42360  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_ESP_TRANS_LEVEL" >&5
42361$as_echo_n "checking for IPPROTO_IP socket option IP_ESP_TRANS_LEVEL... " >&6; }
42362  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42363/* end confdefs.h.  */
42364
42365#include <sys/types.h>
42366#include <sys/socket.h>
42367#include <netinet/in.h>
42368#include <netinet/tcp.h>
42369#include <netinet/udp.h>
42370
42371#include <stdio.h>
42372#include <stdlib.h>
42373#include <unistd.h>
42374
42375int
42376main ()
42377{
42378
42379   socklen_t optlen;
42380   int optval;
42381   int stype;
42382   int ptype;
42383   int s;
42384
42385   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42386      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42387      ptype = IPPROTO_TCP;
42388   } else if (IPPROTO_IP == IPPROTO_IP) {
42389      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42390      ptype = IPPROTO_IP;
42391   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42392      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42393      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42394   } else if (IPPROTO_IP == IPPROTO_UDP) {
42395      stype = SOCK_DGRAM;
42396      ptype = IPPROTO_UDP;
42397   } else {
42398       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42399       exit(1);
42400   }
42401
42402   if((s = socket(PF_INET, stype, ptype)) < 0) {
42403      perror("socket");
42404      exit(1);
42405   }
42406
42407   optval = 1;
42408   optlen = sizeof(optval);
42409   if(setsockopt(s, IPPROTO_IP, IP_ESP_TRANS_LEVEL, &optval, optlen) < 0) {
42410      perror("setsockopt: IPPROTO_IP IP_ESP_TRANS_LEVEL");
42411      close(s);
42412      exit(1);
42413   }
42414  ;
42415  return 0;
42416}
42417_ACEOF
42418if ac_fn_c_try_compile "$LINENO"; then :
42419  _compileok=1
42420fi
42421rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42422
42423  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42424/* end confdefs.h.  */
42425
42426#include <sys/types.h>
42427#include <sys/socket.h>
42428#include <netinet/in.h>
42429#include <netinet/tcp.h>
42430#include <netinet/udp.h>
42431
42432#include <stdio.h>
42433#include <stdlib.h>
42434#include <unistd.h>
42435
42436int
42437main ()
42438{
42439
42440   socklen_t optlen;
42441   int optval;
42442   int stype;
42443   int ptype;
42444   int s;
42445
42446   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42447      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42448      ptype = IPPROTO_TCP;
42449   } else if (IPPROTO_IP == IPPROTO_IP) {
42450      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42451      ptype = IPPROTO_IP;
42452   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42453      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42454      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42455   } else if (IPPROTO_IP == IPPROTO_UDP) {
42456      stype = SOCK_DGRAM;
42457      ptype = IPPROTO_UDP;
42458   } else {
42459       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42460       exit(1);
42461   }
42462
42463   if((s = socket(PF_INET6, stype, ptype)) < 0) {
42464      perror("socket");
42465      exit(1);
42466   }
42467
42468   optval = 1;
42469   optlen = sizeof(optval);
42470   if(setsockopt(s, IPPROTO_IP, IP_ESP_TRANS_LEVEL, &optval, optlen) < 0) {
42471      perror("setsockopt: IPPROTO_IP IP_ESP_TRANS_LEVEL");
42472      close(s);
42473      exit(1);
42474   }
42475  ;
42476  return 0;
42477}
42478_ACEOF
42479if ac_fn_c_try_compile "$LINENO"; then :
42480  _compileok=1
42481fi
42482rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42483
42484  if test x"${_compileok}" != x; then
42485    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
42486$as_echo "yes" >&6; }
42487
42488cat >>confdefs.h <<_ACEOF
42489#define HAVE_IP_ESP_TRANS_LEVEL 1
42490_ACEOF
42491
42492cat >>confdefs.h <<_ACEOF
42493#define SOCKS_IP_ESP_TRANS_LEVEL_LVL IPPROTO_IP
42494_ACEOF
42495
42496cat >>confdefs.h <<_ACEOF
42497#define SOCKS_IP_ESP_TRANS_LEVEL_NAME "ip_esp_trans_level"
42498_ACEOF
42499    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
42500       #ipv4-only
42501
42502cat >>confdefs.h <<_ACEOF
42503#define SOCKS_IP_ESP_TRANS_LEVEL_IPV4 1
42504_ACEOF
42505
42506cat >>confdefs.h <<_ACEOF
42507#define SOCKS_IP_ESP_TRANS_LEVEL_IPV6 0
42508_ACEOF
42509    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
42510       #ipv6-only
42511
42512cat >>confdefs.h <<_ACEOF
42513#define SOCKS_IP_ESP_TRANS_LEVEL_IPV4 0
42514_ACEOF
42515
42516cat >>confdefs.h <<_ACEOF
42517#define SOCKS_IP_ESP_TRANS_LEVEL_IPV6 1
42518_ACEOF
42519    else
42520       #both ipv4 and ipv6
42521
42522cat >>confdefs.h <<_ACEOF
42523#define SOCKS_IP_ESP_TRANS_LEVEL_IPV4 1
42524_ACEOF
42525
42526cat >>confdefs.h <<_ACEOF
42527#define SOCKS_IP_ESP_TRANS_LEVEL_IPV6 1
42528_ACEOF
42529    fi
42530    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_ESP_TRANS_LEVEL"
42531  else
42532    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
42533$as_echo "no" >&6; }
42534  fi
42535unset _compileok
42536  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_FREEBIND" >&5
42537$as_echo_n "checking for IPPROTO_IP socket option IP_FREEBIND... " >&6; }
42538  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42539/* end confdefs.h.  */
42540
42541#include <sys/types.h>
42542#include <sys/socket.h>
42543#include <netinet/in.h>
42544#include <netinet/tcp.h>
42545#include <netinet/udp.h>
42546
42547#include <stdio.h>
42548#include <stdlib.h>
42549#include <unistd.h>
42550
42551int
42552main ()
42553{
42554
42555   socklen_t optlen;
42556   int optval;
42557   int stype;
42558   int ptype;
42559   int s;
42560
42561   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42562      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42563      ptype = IPPROTO_TCP;
42564   } else if (IPPROTO_IP == IPPROTO_IP) {
42565      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42566      ptype = IPPROTO_IP;
42567   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42568      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42569      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42570   } else if (IPPROTO_IP == IPPROTO_UDP) {
42571      stype = SOCK_DGRAM;
42572      ptype = IPPROTO_UDP;
42573   } else {
42574       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42575       exit(1);
42576   }
42577
42578   if((s = socket(PF_INET, stype, ptype)) < 0) {
42579      perror("socket");
42580      exit(1);
42581   }
42582
42583   optval = 1;
42584   optlen = sizeof(optval);
42585   if(setsockopt(s, IPPROTO_IP, IP_FREEBIND, &optval, optlen) < 0) {
42586      perror("setsockopt: IPPROTO_IP IP_FREEBIND");
42587      close(s);
42588      exit(1);
42589   }
42590  ;
42591  return 0;
42592}
42593_ACEOF
42594if ac_fn_c_try_compile "$LINENO"; then :
42595  _compileok=1
42596fi
42597rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42598
42599  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42600/* end confdefs.h.  */
42601
42602#include <sys/types.h>
42603#include <sys/socket.h>
42604#include <netinet/in.h>
42605#include <netinet/tcp.h>
42606#include <netinet/udp.h>
42607
42608#include <stdio.h>
42609#include <stdlib.h>
42610#include <unistd.h>
42611
42612int
42613main ()
42614{
42615
42616   socklen_t optlen;
42617   int optval;
42618   int stype;
42619   int ptype;
42620   int s;
42621
42622   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42623      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42624      ptype = IPPROTO_TCP;
42625   } else if (IPPROTO_IP == IPPROTO_IP) {
42626      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42627      ptype = IPPROTO_IP;
42628   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42629      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42630      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42631   } else if (IPPROTO_IP == IPPROTO_UDP) {
42632      stype = SOCK_DGRAM;
42633      ptype = IPPROTO_UDP;
42634   } else {
42635       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42636       exit(1);
42637   }
42638
42639   if((s = socket(PF_INET6, stype, ptype)) < 0) {
42640      perror("socket");
42641      exit(1);
42642   }
42643
42644   optval = 1;
42645   optlen = sizeof(optval);
42646   if(setsockopt(s, IPPROTO_IP, IP_FREEBIND, &optval, optlen) < 0) {
42647      perror("setsockopt: IPPROTO_IP IP_FREEBIND");
42648      close(s);
42649      exit(1);
42650   }
42651  ;
42652  return 0;
42653}
42654_ACEOF
42655if ac_fn_c_try_compile "$LINENO"; then :
42656  _compileok=1
42657fi
42658rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42659
42660  if test x"${_compileok}" != x; then
42661    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
42662$as_echo "yes" >&6; }
42663
42664cat >>confdefs.h <<_ACEOF
42665#define HAVE_IP_FREEBIND 1
42666_ACEOF
42667
42668cat >>confdefs.h <<_ACEOF
42669#define SOCKS_IP_FREEBIND_LVL IPPROTO_IP
42670_ACEOF
42671
42672cat >>confdefs.h <<_ACEOF
42673#define SOCKS_IP_FREEBIND_NAME "ip_freebind"
42674_ACEOF
42675    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
42676       #ipv4-only
42677
42678cat >>confdefs.h <<_ACEOF
42679#define SOCKS_IP_FREEBIND_IPV4 1
42680_ACEOF
42681
42682cat >>confdefs.h <<_ACEOF
42683#define SOCKS_IP_FREEBIND_IPV6 0
42684_ACEOF
42685    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
42686       #ipv6-only
42687
42688cat >>confdefs.h <<_ACEOF
42689#define SOCKS_IP_FREEBIND_IPV4 0
42690_ACEOF
42691
42692cat >>confdefs.h <<_ACEOF
42693#define SOCKS_IP_FREEBIND_IPV6 1
42694_ACEOF
42695    else
42696       #both ipv4 and ipv6
42697
42698cat >>confdefs.h <<_ACEOF
42699#define SOCKS_IP_FREEBIND_IPV4 1
42700_ACEOF
42701
42702cat >>confdefs.h <<_ACEOF
42703#define SOCKS_IP_FREEBIND_IPV6 1
42704_ACEOF
42705    fi
42706    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_FREEBIND"
42707  else
42708    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
42709$as_echo "no" >&6; }
42710  fi
42711unset _compileok
42712  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_IPCOMP_LEVEL" >&5
42713$as_echo_n "checking for IPPROTO_IP socket option IP_IPCOMP_LEVEL... " >&6; }
42714  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42715/* end confdefs.h.  */
42716
42717#include <sys/types.h>
42718#include <sys/socket.h>
42719#include <netinet/in.h>
42720#include <netinet/tcp.h>
42721#include <netinet/udp.h>
42722
42723#include <stdio.h>
42724#include <stdlib.h>
42725#include <unistd.h>
42726
42727int
42728main ()
42729{
42730
42731   socklen_t optlen;
42732   int optval;
42733   int stype;
42734   int ptype;
42735   int s;
42736
42737   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42738      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42739      ptype = IPPROTO_TCP;
42740   } else if (IPPROTO_IP == IPPROTO_IP) {
42741      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42742      ptype = IPPROTO_IP;
42743   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42744      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42745      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42746   } else if (IPPROTO_IP == IPPROTO_UDP) {
42747      stype = SOCK_DGRAM;
42748      ptype = IPPROTO_UDP;
42749   } else {
42750       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42751       exit(1);
42752   }
42753
42754   if((s = socket(PF_INET, stype, ptype)) < 0) {
42755      perror("socket");
42756      exit(1);
42757   }
42758
42759   optval = 1;
42760   optlen = sizeof(optval);
42761   if(setsockopt(s, IPPROTO_IP, IP_IPCOMP_LEVEL, &optval, optlen) < 0) {
42762      perror("setsockopt: IPPROTO_IP IP_IPCOMP_LEVEL");
42763      close(s);
42764      exit(1);
42765   }
42766  ;
42767  return 0;
42768}
42769_ACEOF
42770if ac_fn_c_try_compile "$LINENO"; then :
42771  _compileok=1
42772fi
42773rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42774
42775  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42776/* end confdefs.h.  */
42777
42778#include <sys/types.h>
42779#include <sys/socket.h>
42780#include <netinet/in.h>
42781#include <netinet/tcp.h>
42782#include <netinet/udp.h>
42783
42784#include <stdio.h>
42785#include <stdlib.h>
42786#include <unistd.h>
42787
42788int
42789main ()
42790{
42791
42792   socklen_t optlen;
42793   int optval;
42794   int stype;
42795   int ptype;
42796   int s;
42797
42798   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42799      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42800      ptype = IPPROTO_TCP;
42801   } else if (IPPROTO_IP == IPPROTO_IP) {
42802      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42803      ptype = IPPROTO_IP;
42804   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42805      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42806      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42807   } else if (IPPROTO_IP == IPPROTO_UDP) {
42808      stype = SOCK_DGRAM;
42809      ptype = IPPROTO_UDP;
42810   } else {
42811       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42812       exit(1);
42813   }
42814
42815   if((s = socket(PF_INET6, stype, ptype)) < 0) {
42816      perror("socket");
42817      exit(1);
42818   }
42819
42820   optval = 1;
42821   optlen = sizeof(optval);
42822   if(setsockopt(s, IPPROTO_IP, IP_IPCOMP_LEVEL, &optval, optlen) < 0) {
42823      perror("setsockopt: IPPROTO_IP IP_IPCOMP_LEVEL");
42824      close(s);
42825      exit(1);
42826   }
42827  ;
42828  return 0;
42829}
42830_ACEOF
42831if ac_fn_c_try_compile "$LINENO"; then :
42832  _compileok=1
42833fi
42834rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42835
42836  if test x"${_compileok}" != x; then
42837    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
42838$as_echo "yes" >&6; }
42839
42840cat >>confdefs.h <<_ACEOF
42841#define HAVE_IP_IPCOMP_LEVEL 1
42842_ACEOF
42843
42844cat >>confdefs.h <<_ACEOF
42845#define SOCKS_IP_IPCOMP_LEVEL_LVL IPPROTO_IP
42846_ACEOF
42847
42848cat >>confdefs.h <<_ACEOF
42849#define SOCKS_IP_IPCOMP_LEVEL_NAME "ip_ipcomp_level"
42850_ACEOF
42851    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
42852       #ipv4-only
42853
42854cat >>confdefs.h <<_ACEOF
42855#define SOCKS_IP_IPCOMP_LEVEL_IPV4 1
42856_ACEOF
42857
42858cat >>confdefs.h <<_ACEOF
42859#define SOCKS_IP_IPCOMP_LEVEL_IPV6 0
42860_ACEOF
42861    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
42862       #ipv6-only
42863
42864cat >>confdefs.h <<_ACEOF
42865#define SOCKS_IP_IPCOMP_LEVEL_IPV4 0
42866_ACEOF
42867
42868cat >>confdefs.h <<_ACEOF
42869#define SOCKS_IP_IPCOMP_LEVEL_IPV6 1
42870_ACEOF
42871    else
42872       #both ipv4 and ipv6
42873
42874cat >>confdefs.h <<_ACEOF
42875#define SOCKS_IP_IPCOMP_LEVEL_IPV4 1
42876_ACEOF
42877
42878cat >>confdefs.h <<_ACEOF
42879#define SOCKS_IP_IPCOMP_LEVEL_IPV6 1
42880_ACEOF
42881    fi
42882    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_IPCOMP_LEVEL"
42883  else
42884    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
42885$as_echo "no" >&6; }
42886  fi
42887unset _compileok
42888  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_MINTTL" >&5
42889$as_echo_n "checking for IPPROTO_IP socket option IP_MINTTL... " >&6; }
42890  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42891/* end confdefs.h.  */
42892
42893#include <sys/types.h>
42894#include <sys/socket.h>
42895#include <netinet/in.h>
42896#include <netinet/tcp.h>
42897#include <netinet/udp.h>
42898
42899#include <stdio.h>
42900#include <stdlib.h>
42901#include <unistd.h>
42902
42903int
42904main ()
42905{
42906
42907   socklen_t optlen;
42908   int optval;
42909   int stype;
42910   int ptype;
42911   int s;
42912
42913   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42914      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42915      ptype = IPPROTO_TCP;
42916   } else if (IPPROTO_IP == IPPROTO_IP) {
42917      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42918      ptype = IPPROTO_IP;
42919   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42920      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42921      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42922   } else if (IPPROTO_IP == IPPROTO_UDP) {
42923      stype = SOCK_DGRAM;
42924      ptype = IPPROTO_UDP;
42925   } else {
42926       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42927       exit(1);
42928   }
42929
42930   if((s = socket(PF_INET, stype, ptype)) < 0) {
42931      perror("socket");
42932      exit(1);
42933   }
42934
42935   optval = 1;
42936   optlen = sizeof(optval);
42937   if(setsockopt(s, IPPROTO_IP, IP_MINTTL, &optval, optlen) < 0) {
42938      perror("setsockopt: IPPROTO_IP IP_MINTTL");
42939      close(s);
42940      exit(1);
42941   }
42942  ;
42943  return 0;
42944}
42945_ACEOF
42946if ac_fn_c_try_compile "$LINENO"; then :
42947  _compileok=1
42948fi
42949rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
42950
42951  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
42952/* end confdefs.h.  */
42953
42954#include <sys/types.h>
42955#include <sys/socket.h>
42956#include <netinet/in.h>
42957#include <netinet/tcp.h>
42958#include <netinet/udp.h>
42959
42960#include <stdio.h>
42961#include <stdlib.h>
42962#include <unistd.h>
42963
42964int
42965main ()
42966{
42967
42968   socklen_t optlen;
42969   int optval;
42970   int stype;
42971   int ptype;
42972   int s;
42973
42974   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
42975      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
42976      ptype = IPPROTO_TCP;
42977   } else if (IPPROTO_IP == IPPROTO_IP) {
42978      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
42979      ptype = IPPROTO_IP;
42980   } else if (IPPROTO_IP == IPPROTO_IPV6) {
42981      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
42982      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
42983   } else if (IPPROTO_IP == IPPROTO_UDP) {
42984      stype = SOCK_DGRAM;
42985      ptype = IPPROTO_UDP;
42986   } else {
42987       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
42988       exit(1);
42989   }
42990
42991   if((s = socket(PF_INET6, stype, ptype)) < 0) {
42992      perror("socket");
42993      exit(1);
42994   }
42995
42996   optval = 1;
42997   optlen = sizeof(optval);
42998   if(setsockopt(s, IPPROTO_IP, IP_MINTTL, &optval, optlen) < 0) {
42999      perror("setsockopt: IPPROTO_IP IP_MINTTL");
43000      close(s);
43001      exit(1);
43002   }
43003  ;
43004  return 0;
43005}
43006_ACEOF
43007if ac_fn_c_try_compile "$LINENO"; then :
43008  _compileok=1
43009fi
43010rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43011
43012  if test x"${_compileok}" != x; then
43013    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
43014$as_echo "yes" >&6; }
43015
43016cat >>confdefs.h <<_ACEOF
43017#define HAVE_IP_MINTTL 1
43018_ACEOF
43019
43020cat >>confdefs.h <<_ACEOF
43021#define SOCKS_IP_MINTTL_LVL IPPROTO_IP
43022_ACEOF
43023
43024cat >>confdefs.h <<_ACEOF
43025#define SOCKS_IP_MINTTL_NAME "ip_minttl"
43026_ACEOF
43027    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
43028       #ipv4-only
43029
43030cat >>confdefs.h <<_ACEOF
43031#define SOCKS_IP_MINTTL_IPV4 1
43032_ACEOF
43033
43034cat >>confdefs.h <<_ACEOF
43035#define SOCKS_IP_MINTTL_IPV6 0
43036_ACEOF
43037    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
43038       #ipv6-only
43039
43040cat >>confdefs.h <<_ACEOF
43041#define SOCKS_IP_MINTTL_IPV4 0
43042_ACEOF
43043
43044cat >>confdefs.h <<_ACEOF
43045#define SOCKS_IP_MINTTL_IPV6 1
43046_ACEOF
43047    else
43048       #both ipv4 and ipv6
43049
43050cat >>confdefs.h <<_ACEOF
43051#define SOCKS_IP_MINTTL_IPV4 1
43052_ACEOF
43053
43054cat >>confdefs.h <<_ACEOF
43055#define SOCKS_IP_MINTTL_IPV6 1
43056_ACEOF
43057    fi
43058    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_MINTTL"
43059  else
43060    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
43061$as_echo "no" >&6; }
43062  fi
43063unset _compileok
43064  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_MTU_DISCOVER" >&5
43065$as_echo_n "checking for IPPROTO_IP socket option IP_MTU_DISCOVER... " >&6; }
43066  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43067/* end confdefs.h.  */
43068
43069#include <sys/types.h>
43070#include <sys/socket.h>
43071#include <netinet/in.h>
43072#include <netinet/tcp.h>
43073#include <netinet/udp.h>
43074
43075#include <stdio.h>
43076#include <stdlib.h>
43077#include <unistd.h>
43078
43079int
43080main ()
43081{
43082
43083   socklen_t optlen;
43084   int optval;
43085   int stype;
43086   int ptype;
43087   int s;
43088
43089   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43090      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43091      ptype = IPPROTO_TCP;
43092   } else if (IPPROTO_IP == IPPROTO_IP) {
43093      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43094      ptype = IPPROTO_IP;
43095   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43096      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43097      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43098   } else if (IPPROTO_IP == IPPROTO_UDP) {
43099      stype = SOCK_DGRAM;
43100      ptype = IPPROTO_UDP;
43101   } else {
43102       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43103       exit(1);
43104   }
43105
43106   if((s = socket(PF_INET, stype, ptype)) < 0) {
43107      perror("socket");
43108      exit(1);
43109   }
43110
43111   optval = 1;
43112   optlen = sizeof(optval);
43113   if(setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &optval, optlen) < 0) {
43114      perror("setsockopt: IPPROTO_IP IP_MTU_DISCOVER");
43115      close(s);
43116      exit(1);
43117   }
43118  ;
43119  return 0;
43120}
43121_ACEOF
43122if ac_fn_c_try_compile "$LINENO"; then :
43123  _compileok=1
43124fi
43125rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43126
43127  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43128/* end confdefs.h.  */
43129
43130#include <sys/types.h>
43131#include <sys/socket.h>
43132#include <netinet/in.h>
43133#include <netinet/tcp.h>
43134#include <netinet/udp.h>
43135
43136#include <stdio.h>
43137#include <stdlib.h>
43138#include <unistd.h>
43139
43140int
43141main ()
43142{
43143
43144   socklen_t optlen;
43145   int optval;
43146   int stype;
43147   int ptype;
43148   int s;
43149
43150   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43151      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43152      ptype = IPPROTO_TCP;
43153   } else if (IPPROTO_IP == IPPROTO_IP) {
43154      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43155      ptype = IPPROTO_IP;
43156   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43157      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43158      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43159   } else if (IPPROTO_IP == IPPROTO_UDP) {
43160      stype = SOCK_DGRAM;
43161      ptype = IPPROTO_UDP;
43162   } else {
43163       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43164       exit(1);
43165   }
43166
43167   if((s = socket(PF_INET6, stype, ptype)) < 0) {
43168      perror("socket");
43169      exit(1);
43170   }
43171
43172   optval = 1;
43173   optlen = sizeof(optval);
43174   if(setsockopt(s, IPPROTO_IP, IP_MTU_DISCOVER, &optval, optlen) < 0) {
43175      perror("setsockopt: IPPROTO_IP IP_MTU_DISCOVER");
43176      close(s);
43177      exit(1);
43178   }
43179  ;
43180  return 0;
43181}
43182_ACEOF
43183if ac_fn_c_try_compile "$LINENO"; then :
43184  _compileok=1
43185fi
43186rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43187
43188  if test x"${_compileok}" != x; then
43189    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
43190$as_echo "yes" >&6; }
43191
43192cat >>confdefs.h <<_ACEOF
43193#define HAVE_IP_MTU_DISCOVER 1
43194_ACEOF
43195
43196cat >>confdefs.h <<_ACEOF
43197#define SOCKS_IP_MTU_DISCOVER_LVL IPPROTO_IP
43198_ACEOF
43199
43200cat >>confdefs.h <<_ACEOF
43201#define SOCKS_IP_MTU_DISCOVER_NAME "ip_mtu_discover"
43202_ACEOF
43203    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
43204       #ipv4-only
43205
43206cat >>confdefs.h <<_ACEOF
43207#define SOCKS_IP_MTU_DISCOVER_IPV4 1
43208_ACEOF
43209
43210cat >>confdefs.h <<_ACEOF
43211#define SOCKS_IP_MTU_DISCOVER_IPV6 0
43212_ACEOF
43213    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
43214       #ipv6-only
43215
43216cat >>confdefs.h <<_ACEOF
43217#define SOCKS_IP_MTU_DISCOVER_IPV4 0
43218_ACEOF
43219
43220cat >>confdefs.h <<_ACEOF
43221#define SOCKS_IP_MTU_DISCOVER_IPV6 1
43222_ACEOF
43223    else
43224       #both ipv4 and ipv6
43225
43226cat >>confdefs.h <<_ACEOF
43227#define SOCKS_IP_MTU_DISCOVER_IPV4 1
43228_ACEOF
43229
43230cat >>confdefs.h <<_ACEOF
43231#define SOCKS_IP_MTU_DISCOVER_IPV6 1
43232_ACEOF
43233    fi
43234    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_MTU_DISCOVER"
43235  else
43236    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
43237$as_echo "no" >&6; }
43238  fi
43239unset _compileok
43240  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_PORTRANGE" >&5
43241$as_echo_n "checking for IPPROTO_IP socket option IP_PORTRANGE... " >&6; }
43242  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43243/* end confdefs.h.  */
43244
43245#include <sys/types.h>
43246#include <sys/socket.h>
43247#include <netinet/in.h>
43248#include <netinet/tcp.h>
43249#include <netinet/udp.h>
43250
43251#include <stdio.h>
43252#include <stdlib.h>
43253#include <unistd.h>
43254
43255int
43256main ()
43257{
43258
43259   socklen_t optlen;
43260   int optval;
43261   int stype;
43262   int ptype;
43263   int s;
43264
43265   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43266      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43267      ptype = IPPROTO_TCP;
43268   } else if (IPPROTO_IP == IPPROTO_IP) {
43269      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43270      ptype = IPPROTO_IP;
43271   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43272      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43273      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43274   } else if (IPPROTO_IP == IPPROTO_UDP) {
43275      stype = SOCK_DGRAM;
43276      ptype = IPPROTO_UDP;
43277   } else {
43278       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43279       exit(1);
43280   }
43281
43282   if((s = socket(PF_INET, stype, ptype)) < 0) {
43283      perror("socket");
43284      exit(1);
43285   }
43286
43287   optval = 1;
43288   optlen = sizeof(optval);
43289   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
43290      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
43291      close(s);
43292      exit(1);
43293   }
43294  ;
43295  return 0;
43296}
43297_ACEOF
43298if ac_fn_c_try_compile "$LINENO"; then :
43299  _compileok=1
43300fi
43301rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43302
43303  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43304/* end confdefs.h.  */
43305
43306#include <sys/types.h>
43307#include <sys/socket.h>
43308#include <netinet/in.h>
43309#include <netinet/tcp.h>
43310#include <netinet/udp.h>
43311
43312#include <stdio.h>
43313#include <stdlib.h>
43314#include <unistd.h>
43315
43316int
43317main ()
43318{
43319
43320   socklen_t optlen;
43321   int optval;
43322   int stype;
43323   int ptype;
43324   int s;
43325
43326   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43327      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43328      ptype = IPPROTO_TCP;
43329   } else if (IPPROTO_IP == IPPROTO_IP) {
43330      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43331      ptype = IPPROTO_IP;
43332   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43333      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43334      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43335   } else if (IPPROTO_IP == IPPROTO_UDP) {
43336      stype = SOCK_DGRAM;
43337      ptype = IPPROTO_UDP;
43338   } else {
43339       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43340       exit(1);
43341   }
43342
43343   if((s = socket(PF_INET6, stype, ptype)) < 0) {
43344      perror("socket");
43345      exit(1);
43346   }
43347
43348   optval = 1;
43349   optlen = sizeof(optval);
43350   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
43351      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
43352      close(s);
43353      exit(1);
43354   }
43355  ;
43356  return 0;
43357}
43358_ACEOF
43359if ac_fn_c_try_compile "$LINENO"; then :
43360  _compileok=1
43361fi
43362rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43363
43364  if test x"${_compileok}" != x; then
43365    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
43366$as_echo "yes" >&6; }
43367
43368cat >>confdefs.h <<_ACEOF
43369#define HAVE_IP_PORTRANGE 1
43370_ACEOF
43371
43372cat >>confdefs.h <<_ACEOF
43373#define SOCKS_IP_PORTRANGE_LVL IPPROTO_IP
43374_ACEOF
43375
43376cat >>confdefs.h <<_ACEOF
43377#define SOCKS_IP_PORTRANGE_NAME "ip_portrange"
43378_ACEOF
43379    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
43380       #ipv4-only
43381
43382cat >>confdefs.h <<_ACEOF
43383#define SOCKS_IP_PORTRANGE_IPV4 1
43384_ACEOF
43385
43386cat >>confdefs.h <<_ACEOF
43387#define SOCKS_IP_PORTRANGE_IPV6 0
43388_ACEOF
43389    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
43390       #ipv6-only
43391
43392cat >>confdefs.h <<_ACEOF
43393#define SOCKS_IP_PORTRANGE_IPV4 0
43394_ACEOF
43395
43396cat >>confdefs.h <<_ACEOF
43397#define SOCKS_IP_PORTRANGE_IPV6 1
43398_ACEOF
43399    else
43400       #both ipv4 and ipv6
43401
43402cat >>confdefs.h <<_ACEOF
43403#define SOCKS_IP_PORTRANGE_IPV4 1
43404_ACEOF
43405
43406cat >>confdefs.h <<_ACEOF
43407#define SOCKS_IP_PORTRANGE_IPV6 1
43408_ACEOF
43409    fi
43410    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_PORTRANGE"
43411  else
43412    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
43413$as_echo "no" >&6; }
43414  fi
43415unset _compileok
43416  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_TOS" >&5
43417$as_echo_n "checking for IPPROTO_IP socket option IP_TOS... " >&6; }
43418  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43419/* end confdefs.h.  */
43420
43421#include <sys/types.h>
43422#include <sys/socket.h>
43423#include <netinet/in.h>
43424#include <netinet/tcp.h>
43425#include <netinet/udp.h>
43426
43427#include <stdio.h>
43428#include <stdlib.h>
43429#include <unistd.h>
43430
43431int
43432main ()
43433{
43434
43435   socklen_t optlen;
43436   int optval;
43437   int stype;
43438   int ptype;
43439   int s;
43440
43441   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43442      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43443      ptype = IPPROTO_TCP;
43444   } else if (IPPROTO_IP == IPPROTO_IP) {
43445      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43446      ptype = IPPROTO_IP;
43447   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43448      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43449      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43450   } else if (IPPROTO_IP == IPPROTO_UDP) {
43451      stype = SOCK_DGRAM;
43452      ptype = IPPROTO_UDP;
43453   } else {
43454       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43455       exit(1);
43456   }
43457
43458   if((s = socket(PF_INET, stype, ptype)) < 0) {
43459      perror("socket");
43460      exit(1);
43461   }
43462
43463   optval = 1;
43464   optlen = sizeof(optval);
43465   if(setsockopt(s, IPPROTO_IP, IP_TOS, &optval, optlen) < 0) {
43466      perror("setsockopt: IPPROTO_IP IP_TOS");
43467      close(s);
43468      exit(1);
43469   }
43470  ;
43471  return 0;
43472}
43473_ACEOF
43474if ac_fn_c_try_compile "$LINENO"; then :
43475  _compileok=1
43476fi
43477rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43478
43479  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43480/* end confdefs.h.  */
43481
43482#include <sys/types.h>
43483#include <sys/socket.h>
43484#include <netinet/in.h>
43485#include <netinet/tcp.h>
43486#include <netinet/udp.h>
43487
43488#include <stdio.h>
43489#include <stdlib.h>
43490#include <unistd.h>
43491
43492int
43493main ()
43494{
43495
43496   socklen_t optlen;
43497   int optval;
43498   int stype;
43499   int ptype;
43500   int s;
43501
43502   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43503      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43504      ptype = IPPROTO_TCP;
43505   } else if (IPPROTO_IP == IPPROTO_IP) {
43506      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43507      ptype = IPPROTO_IP;
43508   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43509      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43510      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43511   } else if (IPPROTO_IP == IPPROTO_UDP) {
43512      stype = SOCK_DGRAM;
43513      ptype = IPPROTO_UDP;
43514   } else {
43515       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43516       exit(1);
43517   }
43518
43519   if((s = socket(PF_INET6, stype, ptype)) < 0) {
43520      perror("socket");
43521      exit(1);
43522   }
43523
43524   optval = 1;
43525   optlen = sizeof(optval);
43526   if(setsockopt(s, IPPROTO_IP, IP_TOS, &optval, optlen) < 0) {
43527      perror("setsockopt: IPPROTO_IP IP_TOS");
43528      close(s);
43529      exit(1);
43530   }
43531  ;
43532  return 0;
43533}
43534_ACEOF
43535if ac_fn_c_try_compile "$LINENO"; then :
43536  _compileok=1
43537fi
43538rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43539
43540  if test x"${_compileok}" != x; then
43541    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
43542$as_echo "yes" >&6; }
43543
43544cat >>confdefs.h <<_ACEOF
43545#define HAVE_IP_TOS 1
43546_ACEOF
43547
43548cat >>confdefs.h <<_ACEOF
43549#define SOCKS_IP_TOS_LVL IPPROTO_IP
43550_ACEOF
43551
43552cat >>confdefs.h <<_ACEOF
43553#define SOCKS_IP_TOS_NAME "ip_tos"
43554_ACEOF
43555    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
43556       #ipv4-only
43557
43558cat >>confdefs.h <<_ACEOF
43559#define SOCKS_IP_TOS_IPV4 1
43560_ACEOF
43561
43562cat >>confdefs.h <<_ACEOF
43563#define SOCKS_IP_TOS_IPV6 0
43564_ACEOF
43565    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
43566       #ipv6-only
43567
43568cat >>confdefs.h <<_ACEOF
43569#define SOCKS_IP_TOS_IPV4 0
43570_ACEOF
43571
43572cat >>confdefs.h <<_ACEOF
43573#define SOCKS_IP_TOS_IPV6 1
43574_ACEOF
43575    else
43576       #both ipv4 and ipv6
43577
43578cat >>confdefs.h <<_ACEOF
43579#define SOCKS_IP_TOS_IPV4 1
43580_ACEOF
43581
43582cat >>confdefs.h <<_ACEOF
43583#define SOCKS_IP_TOS_IPV6 1
43584_ACEOF
43585    fi
43586    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_TOS"
43587  else
43588    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
43589$as_echo "no" >&6; }
43590  fi
43591unset _compileok
43592  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_TTL" >&5
43593$as_echo_n "checking for IPPROTO_IP socket option IP_TTL... " >&6; }
43594  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43595/* end confdefs.h.  */
43596
43597#include <sys/types.h>
43598#include <sys/socket.h>
43599#include <netinet/in.h>
43600#include <netinet/tcp.h>
43601#include <netinet/udp.h>
43602
43603#include <stdio.h>
43604#include <stdlib.h>
43605#include <unistd.h>
43606
43607int
43608main ()
43609{
43610
43611   socklen_t optlen;
43612   int optval;
43613   int stype;
43614   int ptype;
43615   int s;
43616
43617   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43618      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43619      ptype = IPPROTO_TCP;
43620   } else if (IPPROTO_IP == IPPROTO_IP) {
43621      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43622      ptype = IPPROTO_IP;
43623   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43624      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43625      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43626   } else if (IPPROTO_IP == IPPROTO_UDP) {
43627      stype = SOCK_DGRAM;
43628      ptype = IPPROTO_UDP;
43629   } else {
43630       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43631       exit(1);
43632   }
43633
43634   if((s = socket(PF_INET, stype, ptype)) < 0) {
43635      perror("socket");
43636      exit(1);
43637   }
43638
43639   optval = 1;
43640   optlen = sizeof(optval);
43641   if(setsockopt(s, IPPROTO_IP, IP_TTL, &optval, optlen) < 0) {
43642      perror("setsockopt: IPPROTO_IP IP_TTL");
43643      close(s);
43644      exit(1);
43645   }
43646  ;
43647  return 0;
43648}
43649_ACEOF
43650if ac_fn_c_try_compile "$LINENO"; then :
43651  _compileok=1
43652fi
43653rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43654
43655  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43656/* end confdefs.h.  */
43657
43658#include <sys/types.h>
43659#include <sys/socket.h>
43660#include <netinet/in.h>
43661#include <netinet/tcp.h>
43662#include <netinet/udp.h>
43663
43664#include <stdio.h>
43665#include <stdlib.h>
43666#include <unistd.h>
43667
43668int
43669main ()
43670{
43671
43672   socklen_t optlen;
43673   int optval;
43674   int stype;
43675   int ptype;
43676   int s;
43677
43678   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43679      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43680      ptype = IPPROTO_TCP;
43681   } else if (IPPROTO_IP == IPPROTO_IP) {
43682      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43683      ptype = IPPROTO_IP;
43684   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43685      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43686      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43687   } else if (IPPROTO_IP == IPPROTO_UDP) {
43688      stype = SOCK_DGRAM;
43689      ptype = IPPROTO_UDP;
43690   } else {
43691       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43692       exit(1);
43693   }
43694
43695   if((s = socket(PF_INET6, stype, ptype)) < 0) {
43696      perror("socket");
43697      exit(1);
43698   }
43699
43700   optval = 1;
43701   optlen = sizeof(optval);
43702   if(setsockopt(s, IPPROTO_IP, IP_TTL, &optval, optlen) < 0) {
43703      perror("setsockopt: IPPROTO_IP IP_TTL");
43704      close(s);
43705      exit(1);
43706   }
43707  ;
43708  return 0;
43709}
43710_ACEOF
43711if ac_fn_c_try_compile "$LINENO"; then :
43712  _compileok=1
43713fi
43714rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43715
43716  if test x"${_compileok}" != x; then
43717    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
43718$as_echo "yes" >&6; }
43719
43720cat >>confdefs.h <<_ACEOF
43721#define HAVE_IP_TTL 1
43722_ACEOF
43723
43724cat >>confdefs.h <<_ACEOF
43725#define SOCKS_IP_TTL_LVL IPPROTO_IP
43726_ACEOF
43727
43728cat >>confdefs.h <<_ACEOF
43729#define SOCKS_IP_TTL_NAME "ip_ttl"
43730_ACEOF
43731    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
43732       #ipv4-only
43733
43734cat >>confdefs.h <<_ACEOF
43735#define SOCKS_IP_TTL_IPV4 1
43736_ACEOF
43737
43738cat >>confdefs.h <<_ACEOF
43739#define SOCKS_IP_TTL_IPV6 0
43740_ACEOF
43741    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
43742       #ipv6-only
43743
43744cat >>confdefs.h <<_ACEOF
43745#define SOCKS_IP_TTL_IPV4 0
43746_ACEOF
43747
43748cat >>confdefs.h <<_ACEOF
43749#define SOCKS_IP_TTL_IPV6 1
43750_ACEOF
43751    else
43752       #both ipv4 and ipv6
43753
43754cat >>confdefs.h <<_ACEOF
43755#define SOCKS_IP_TTL_IPV4 1
43756_ACEOF
43757
43758cat >>confdefs.h <<_ACEOF
43759#define SOCKS_IP_TTL_IPV6 1
43760_ACEOF
43761    fi
43762    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_TTL"
43763  else
43764    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
43765$as_echo "no" >&6; }
43766  fi
43767unset _compileok
43768  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_TRANSPARENT" >&5
43769$as_echo_n "checking for IPPROTO_IP socket option IP_TRANSPARENT... " >&6; }
43770  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43771/* end confdefs.h.  */
43772
43773#include <sys/types.h>
43774#include <sys/socket.h>
43775#include <netinet/in.h>
43776#include <netinet/tcp.h>
43777#include <netinet/udp.h>
43778
43779#include <stdio.h>
43780#include <stdlib.h>
43781#include <unistd.h>
43782
43783int
43784main ()
43785{
43786
43787   socklen_t optlen;
43788   int optval;
43789   int stype;
43790   int ptype;
43791   int s;
43792
43793   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43794      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43795      ptype = IPPROTO_TCP;
43796   } else if (IPPROTO_IP == IPPROTO_IP) {
43797      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43798      ptype = IPPROTO_IP;
43799   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43800      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43801      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43802   } else if (IPPROTO_IP == IPPROTO_UDP) {
43803      stype = SOCK_DGRAM;
43804      ptype = IPPROTO_UDP;
43805   } else {
43806       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43807       exit(1);
43808   }
43809
43810   if((s = socket(PF_INET, stype, ptype)) < 0) {
43811      perror("socket");
43812      exit(1);
43813   }
43814
43815   optval = 1;
43816   optlen = sizeof(optval);
43817   if(setsockopt(s, IPPROTO_IP, IP_TRANSPARENT, &optval, optlen) < 0) {
43818      perror("setsockopt: IPPROTO_IP IP_TRANSPARENT");
43819      close(s);
43820      exit(1);
43821   }
43822  ;
43823  return 0;
43824}
43825_ACEOF
43826if ac_fn_c_try_compile "$LINENO"; then :
43827  _compileok=1
43828fi
43829rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43830
43831  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43832/* end confdefs.h.  */
43833
43834#include <sys/types.h>
43835#include <sys/socket.h>
43836#include <netinet/in.h>
43837#include <netinet/tcp.h>
43838#include <netinet/udp.h>
43839
43840#include <stdio.h>
43841#include <stdlib.h>
43842#include <unistd.h>
43843
43844int
43845main ()
43846{
43847
43848   socklen_t optlen;
43849   int optval;
43850   int stype;
43851   int ptype;
43852   int s;
43853
43854   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43855      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43856      ptype = IPPROTO_TCP;
43857   } else if (IPPROTO_IP == IPPROTO_IP) {
43858      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43859      ptype = IPPROTO_IP;
43860   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43861      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43862      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43863   } else if (IPPROTO_IP == IPPROTO_UDP) {
43864      stype = SOCK_DGRAM;
43865      ptype = IPPROTO_UDP;
43866   } else {
43867       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43868       exit(1);
43869   }
43870
43871   if((s = socket(PF_INET6, stype, ptype)) < 0) {
43872      perror("socket");
43873      exit(1);
43874   }
43875
43876   optval = 1;
43877   optlen = sizeof(optval);
43878   if(setsockopt(s, IPPROTO_IP, IP_TRANSPARENT, &optval, optlen) < 0) {
43879      perror("setsockopt: IPPROTO_IP IP_TRANSPARENT");
43880      close(s);
43881      exit(1);
43882   }
43883  ;
43884  return 0;
43885}
43886_ACEOF
43887if ac_fn_c_try_compile "$LINENO"; then :
43888  _compileok=1
43889fi
43890rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
43891
43892  if test x"${_compileok}" != x; then
43893    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
43894$as_echo "yes" >&6; }
43895
43896cat >>confdefs.h <<_ACEOF
43897#define HAVE_IP_TRANSPARENT 1
43898_ACEOF
43899
43900cat >>confdefs.h <<_ACEOF
43901#define SOCKS_IP_TRANSPARENT_LVL IPPROTO_IP
43902_ACEOF
43903
43904cat >>confdefs.h <<_ACEOF
43905#define SOCKS_IP_TRANSPARENT_NAME "ip_transparent"
43906_ACEOF
43907    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
43908       #ipv4-only
43909
43910cat >>confdefs.h <<_ACEOF
43911#define SOCKS_IP_TRANSPARENT_IPV4 1
43912_ACEOF
43913
43914cat >>confdefs.h <<_ACEOF
43915#define SOCKS_IP_TRANSPARENT_IPV6 0
43916_ACEOF
43917    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
43918       #ipv6-only
43919
43920cat >>confdefs.h <<_ACEOF
43921#define SOCKS_IP_TRANSPARENT_IPV4 0
43922_ACEOF
43923
43924cat >>confdefs.h <<_ACEOF
43925#define SOCKS_IP_TRANSPARENT_IPV6 1
43926_ACEOF
43927    else
43928       #both ipv4 and ipv6
43929
43930cat >>confdefs.h <<_ACEOF
43931#define SOCKS_IP_TRANSPARENT_IPV4 1
43932_ACEOF
43933
43934cat >>confdefs.h <<_ACEOF
43935#define SOCKS_IP_TRANSPARENT_IPV6 1
43936_ACEOF
43937    fi
43938    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_TRANSPARENT"
43939  else
43940    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
43941$as_echo "no" >&6; }
43942  fi
43943unset _compileok
43944  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_UNICAST_HOPS" >&5
43945$as_echo_n "checking for IPPROTO_IP socket option IP_UNICAST_HOPS... " >&6; }
43946  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
43947/* end confdefs.h.  */
43948
43949#include <sys/types.h>
43950#include <sys/socket.h>
43951#include <netinet/in.h>
43952#include <netinet/tcp.h>
43953#include <netinet/udp.h>
43954
43955#include <stdio.h>
43956#include <stdlib.h>
43957#include <unistd.h>
43958
43959int
43960main ()
43961{
43962
43963   socklen_t optlen;
43964   int optval;
43965   int stype;
43966   int ptype;
43967   int s;
43968
43969   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
43970      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
43971      ptype = IPPROTO_TCP;
43972   } else if (IPPROTO_IP == IPPROTO_IP) {
43973      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
43974      ptype = IPPROTO_IP;
43975   } else if (IPPROTO_IP == IPPROTO_IPV6) {
43976      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
43977      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
43978   } else if (IPPROTO_IP == IPPROTO_UDP) {
43979      stype = SOCK_DGRAM;
43980      ptype = IPPROTO_UDP;
43981   } else {
43982       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
43983       exit(1);
43984   }
43985
43986   if((s = socket(PF_INET, stype, ptype)) < 0) {
43987      perror("socket");
43988      exit(1);
43989   }
43990
43991   optval = 1;
43992   optlen = sizeof(optval);
43993   if(setsockopt(s, IPPROTO_IP, IP_UNICAST_HOPS, &optval, optlen) < 0) {
43994      perror("setsockopt: IPPROTO_IP IP_UNICAST_HOPS");
43995      close(s);
43996      exit(1);
43997   }
43998  ;
43999  return 0;
44000}
44001_ACEOF
44002if ac_fn_c_try_compile "$LINENO"; then :
44003  _compileok=1
44004fi
44005rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44006
44007  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44008/* end confdefs.h.  */
44009
44010#include <sys/types.h>
44011#include <sys/socket.h>
44012#include <netinet/in.h>
44013#include <netinet/tcp.h>
44014#include <netinet/udp.h>
44015
44016#include <stdio.h>
44017#include <stdlib.h>
44018#include <unistd.h>
44019
44020int
44021main ()
44022{
44023
44024   socklen_t optlen;
44025   int optval;
44026   int stype;
44027   int ptype;
44028   int s;
44029
44030   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
44031      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44032      ptype = IPPROTO_TCP;
44033   } else if (IPPROTO_IP == IPPROTO_IP) {
44034      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44035      ptype = IPPROTO_IP;
44036   } else if (IPPROTO_IP == IPPROTO_IPV6) {
44037      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44038      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44039   } else if (IPPROTO_IP == IPPROTO_UDP) {
44040      stype = SOCK_DGRAM;
44041      ptype = IPPROTO_UDP;
44042   } else {
44043       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
44044       exit(1);
44045   }
44046
44047   if((s = socket(PF_INET6, stype, ptype)) < 0) {
44048      perror("socket");
44049      exit(1);
44050   }
44051
44052   optval = 1;
44053   optlen = sizeof(optval);
44054   if(setsockopt(s, IPPROTO_IP, IP_UNICAST_HOPS, &optval, optlen) < 0) {
44055      perror("setsockopt: IPPROTO_IP IP_UNICAST_HOPS");
44056      close(s);
44057      exit(1);
44058   }
44059  ;
44060  return 0;
44061}
44062_ACEOF
44063if ac_fn_c_try_compile "$LINENO"; then :
44064  _compileok=1
44065fi
44066rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44067
44068  if test x"${_compileok}" != x; then
44069    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44070$as_echo "yes" >&6; }
44071
44072cat >>confdefs.h <<_ACEOF
44073#define HAVE_IP_UNICAST_HOPS 1
44074_ACEOF
44075
44076cat >>confdefs.h <<_ACEOF
44077#define SOCKS_IP_UNICAST_HOPS_LVL IPPROTO_IP
44078_ACEOF
44079
44080cat >>confdefs.h <<_ACEOF
44081#define SOCKS_IP_UNICAST_HOPS_NAME "ip_unicast_hops"
44082_ACEOF
44083    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
44084       #ipv4-only
44085
44086cat >>confdefs.h <<_ACEOF
44087#define SOCKS_IP_UNICAST_HOPS_IPV4 1
44088_ACEOF
44089
44090cat >>confdefs.h <<_ACEOF
44091#define SOCKS_IP_UNICAST_HOPS_IPV6 0
44092_ACEOF
44093    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
44094       #ipv6-only
44095
44096cat >>confdefs.h <<_ACEOF
44097#define SOCKS_IP_UNICAST_HOPS_IPV4 0
44098_ACEOF
44099
44100cat >>confdefs.h <<_ACEOF
44101#define SOCKS_IP_UNICAST_HOPS_IPV6 1
44102_ACEOF
44103    else
44104       #both ipv4 and ipv6
44105
44106cat >>confdefs.h <<_ACEOF
44107#define SOCKS_IP_UNICAST_HOPS_IPV4 1
44108_ACEOF
44109
44110cat >>confdefs.h <<_ACEOF
44111#define SOCKS_IP_UNICAST_HOPS_IPV6 1
44112_ACEOF
44113    fi
44114    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_UNICAST_HOPS"
44115  else
44116    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
44117$as_echo "no" >&6; }
44118  fi
44119unset _compileok
44120  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_BROADCAST_IF" >&5
44121$as_echo_n "checking for IPPROTO_IP socket option IP_BROADCAST_IF... " >&6; }
44122  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44123/* end confdefs.h.  */
44124
44125#include <sys/types.h>
44126#include <sys/socket.h>
44127#include <netinet/in.h>
44128#include <netinet/tcp.h>
44129#include <netinet/udp.h>
44130
44131#include <stdio.h>
44132#include <stdlib.h>
44133#include <unistd.h>
44134
44135int
44136main ()
44137{
44138
44139   socklen_t optlen;
44140   int optval;
44141   int stype;
44142   int ptype;
44143   int s;
44144
44145   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
44146      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44147      ptype = IPPROTO_TCP;
44148   } else if (IPPROTO_IP == IPPROTO_IP) {
44149      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44150      ptype = IPPROTO_IP;
44151   } else if (IPPROTO_IP == IPPROTO_IPV6) {
44152      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44153      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44154   } else if (IPPROTO_IP == IPPROTO_UDP) {
44155      stype = SOCK_DGRAM;
44156      ptype = IPPROTO_UDP;
44157   } else {
44158       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
44159       exit(1);
44160   }
44161
44162   if((s = socket(PF_INET, stype, ptype)) < 0) {
44163      perror("socket");
44164      exit(1);
44165   }
44166
44167   optval = 1;
44168   optlen = sizeof(optval);
44169   if(setsockopt(s, IPPROTO_IP, IP_BROADCAST_IF, &optval, optlen) < 0) {
44170      perror("setsockopt: IPPROTO_IP IP_BROADCAST_IF");
44171      close(s);
44172      exit(1);
44173   }
44174  ;
44175  return 0;
44176}
44177_ACEOF
44178if ac_fn_c_try_compile "$LINENO"; then :
44179  _compileok=1
44180fi
44181rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44182
44183  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44184/* end confdefs.h.  */
44185
44186#include <sys/types.h>
44187#include <sys/socket.h>
44188#include <netinet/in.h>
44189#include <netinet/tcp.h>
44190#include <netinet/udp.h>
44191
44192#include <stdio.h>
44193#include <stdlib.h>
44194#include <unistd.h>
44195
44196int
44197main ()
44198{
44199
44200   socklen_t optlen;
44201   int optval;
44202   int stype;
44203   int ptype;
44204   int s;
44205
44206   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
44207      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44208      ptype = IPPROTO_TCP;
44209   } else if (IPPROTO_IP == IPPROTO_IP) {
44210      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44211      ptype = IPPROTO_IP;
44212   } else if (IPPROTO_IP == IPPROTO_IPV6) {
44213      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44214      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44215   } else if (IPPROTO_IP == IPPROTO_UDP) {
44216      stype = SOCK_DGRAM;
44217      ptype = IPPROTO_UDP;
44218   } else {
44219       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
44220       exit(1);
44221   }
44222
44223   if((s = socket(PF_INET6, stype, ptype)) < 0) {
44224      perror("socket");
44225      exit(1);
44226   }
44227
44228   optval = 1;
44229   optlen = sizeof(optval);
44230   if(setsockopt(s, IPPROTO_IP, IP_BROADCAST_IF, &optval, optlen) < 0) {
44231      perror("setsockopt: IPPROTO_IP IP_BROADCAST_IF");
44232      close(s);
44233      exit(1);
44234   }
44235  ;
44236  return 0;
44237}
44238_ACEOF
44239if ac_fn_c_try_compile "$LINENO"; then :
44240  _compileok=1
44241fi
44242rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44243
44244  if test x"${_compileok}" != x; then
44245    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44246$as_echo "yes" >&6; }
44247
44248cat >>confdefs.h <<_ACEOF
44249#define HAVE_IP_BROADCAST_IF 1
44250_ACEOF
44251
44252cat >>confdefs.h <<_ACEOF
44253#define SOCKS_IP_BROADCAST_IF_LVL IPPROTO_IP
44254_ACEOF
44255
44256cat >>confdefs.h <<_ACEOF
44257#define SOCKS_IP_BROADCAST_IF_NAME "ip_broadcast_if"
44258_ACEOF
44259    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
44260       #ipv4-only
44261
44262cat >>confdefs.h <<_ACEOF
44263#define SOCKS_IP_BROADCAST_IF_IPV4 1
44264_ACEOF
44265
44266cat >>confdefs.h <<_ACEOF
44267#define SOCKS_IP_BROADCAST_IF_IPV6 0
44268_ACEOF
44269    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
44270       #ipv6-only
44271
44272cat >>confdefs.h <<_ACEOF
44273#define SOCKS_IP_BROADCAST_IF_IPV4 0
44274_ACEOF
44275
44276cat >>confdefs.h <<_ACEOF
44277#define SOCKS_IP_BROADCAST_IF_IPV6 1
44278_ACEOF
44279    else
44280       #both ipv4 and ipv6
44281
44282cat >>confdefs.h <<_ACEOF
44283#define SOCKS_IP_BROADCAST_IF_IPV4 1
44284_ACEOF
44285
44286cat >>confdefs.h <<_ACEOF
44287#define SOCKS_IP_BROADCAST_IF_IPV6 1
44288_ACEOF
44289    fi
44290    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_BROADCAST_IF"
44291  else
44292    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
44293$as_echo "no" >&6; }
44294  fi
44295
44296#ipv6 level
44297unset _compileok
44298  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ADDRFORM" >&5
44299$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ADDRFORM... " >&6; }
44300  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44301/* end confdefs.h.  */
44302
44303#include <sys/types.h>
44304#include <sys/socket.h>
44305#include <netinet/in.h>
44306#include <netinet/tcp.h>
44307#include <netinet/udp.h>
44308
44309#include <stdio.h>
44310#include <stdlib.h>
44311#include <unistd.h>
44312
44313int
44314main ()
44315{
44316
44317   socklen_t optlen;
44318   int optval;
44319   int stype;
44320   int ptype;
44321   int s;
44322
44323   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44324      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44325      ptype = IPPROTO_TCP;
44326   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44327      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44328      ptype = IPPROTO_IP;
44329   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44330      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44331      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44332   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44333      stype = SOCK_DGRAM;
44334      ptype = IPPROTO_UDP;
44335   } else {
44336       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44337       exit(1);
44338   }
44339
44340   if((s = socket(PF_INET, stype, ptype)) < 0) {
44341      perror("socket");
44342      exit(1);
44343   }
44344
44345   optval = 1;
44346   optlen = sizeof(optval);
44347   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADDRFORM, &optval, optlen) < 0) {
44348      perror("setsockopt: IPPROTO_IPV6 IPV6_ADDRFORM");
44349      close(s);
44350      exit(1);
44351   }
44352  ;
44353  return 0;
44354}
44355_ACEOF
44356if ac_fn_c_try_compile "$LINENO"; then :
44357  _compileok=1
44358fi
44359rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44360
44361  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44362/* end confdefs.h.  */
44363
44364#include <sys/types.h>
44365#include <sys/socket.h>
44366#include <netinet/in.h>
44367#include <netinet/tcp.h>
44368#include <netinet/udp.h>
44369
44370#include <stdio.h>
44371#include <stdlib.h>
44372#include <unistd.h>
44373
44374int
44375main ()
44376{
44377
44378   socklen_t optlen;
44379   int optval;
44380   int stype;
44381   int ptype;
44382   int s;
44383
44384   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44385      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44386      ptype = IPPROTO_TCP;
44387   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44388      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44389      ptype = IPPROTO_IP;
44390   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44391      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44392      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44393   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44394      stype = SOCK_DGRAM;
44395      ptype = IPPROTO_UDP;
44396   } else {
44397       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44398       exit(1);
44399   }
44400
44401   if((s = socket(PF_INET6, stype, ptype)) < 0) {
44402      perror("socket");
44403      exit(1);
44404   }
44405
44406   optval = 1;
44407   optlen = sizeof(optval);
44408   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADDRFORM, &optval, optlen) < 0) {
44409      perror("setsockopt: IPPROTO_IPV6 IPV6_ADDRFORM");
44410      close(s);
44411      exit(1);
44412   }
44413  ;
44414  return 0;
44415}
44416_ACEOF
44417if ac_fn_c_try_compile "$LINENO"; then :
44418  _compileok=1
44419fi
44420rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44421
44422  if test x"${_compileok}" != x; then
44423    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44424$as_echo "yes" >&6; }
44425
44426cat >>confdefs.h <<_ACEOF
44427#define HAVE_IPV6_ADDRFORM 1
44428_ACEOF
44429
44430cat >>confdefs.h <<_ACEOF
44431#define SOCKS_IPV6_ADDRFORM_LVL IPPROTO_IPV6
44432_ACEOF
44433
44434cat >>confdefs.h <<_ACEOF
44435#define SOCKS_IPV6_ADDRFORM_NAME "ipv6_addrform"
44436_ACEOF
44437    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
44438       #ipv4-only
44439
44440cat >>confdefs.h <<_ACEOF
44441#define SOCKS_IPV6_ADDRFORM_IPV4 1
44442_ACEOF
44443
44444cat >>confdefs.h <<_ACEOF
44445#define SOCKS_IPV6_ADDRFORM_IPV6 0
44446_ACEOF
44447    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
44448       #ipv6-only
44449
44450cat >>confdefs.h <<_ACEOF
44451#define SOCKS_IPV6_ADDRFORM_IPV4 0
44452_ACEOF
44453
44454cat >>confdefs.h <<_ACEOF
44455#define SOCKS_IPV6_ADDRFORM_IPV6 1
44456_ACEOF
44457    else
44458       #both ipv4 and ipv6
44459
44460cat >>confdefs.h <<_ACEOF
44461#define SOCKS_IPV6_ADDRFORM_IPV4 1
44462_ACEOF
44463
44464cat >>confdefs.h <<_ACEOF
44465#define SOCKS_IPV6_ADDRFORM_IPV6 1
44466_ACEOF
44467    fi
44468    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ADDRFORM"
44469  else
44470    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
44471$as_echo "no" >&6; }
44472  fi
44473unset _compileok
44474  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_UNICAST_HOPS" >&5
44475$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_UNICAST_HOPS... " >&6; }
44476  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44477/* end confdefs.h.  */
44478
44479#include <sys/types.h>
44480#include <sys/socket.h>
44481#include <netinet/in.h>
44482#include <netinet/tcp.h>
44483#include <netinet/udp.h>
44484
44485#include <stdio.h>
44486#include <stdlib.h>
44487#include <unistd.h>
44488
44489int
44490main ()
44491{
44492
44493   socklen_t optlen;
44494   int optval;
44495   int stype;
44496   int ptype;
44497   int s;
44498
44499   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44500      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44501      ptype = IPPROTO_TCP;
44502   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44503      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44504      ptype = IPPROTO_IP;
44505   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44506      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44507      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44508   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44509      stype = SOCK_DGRAM;
44510      ptype = IPPROTO_UDP;
44511   } else {
44512       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44513       exit(1);
44514   }
44515
44516   if((s = socket(PF_INET, stype, ptype)) < 0) {
44517      perror("socket");
44518      exit(1);
44519   }
44520
44521   optval = 1;
44522   optlen = sizeof(optval);
44523   if(setsockopt(s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &optval, optlen) < 0) {
44524      perror("setsockopt: IPPROTO_IPV6 IPV6_UNICAST_HOPS");
44525      close(s);
44526      exit(1);
44527   }
44528  ;
44529  return 0;
44530}
44531_ACEOF
44532if ac_fn_c_try_compile "$LINENO"; then :
44533  _compileok=1
44534fi
44535rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44536
44537  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44538/* end confdefs.h.  */
44539
44540#include <sys/types.h>
44541#include <sys/socket.h>
44542#include <netinet/in.h>
44543#include <netinet/tcp.h>
44544#include <netinet/udp.h>
44545
44546#include <stdio.h>
44547#include <stdlib.h>
44548#include <unistd.h>
44549
44550int
44551main ()
44552{
44553
44554   socklen_t optlen;
44555   int optval;
44556   int stype;
44557   int ptype;
44558   int s;
44559
44560   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44561      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44562      ptype = IPPROTO_TCP;
44563   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44564      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44565      ptype = IPPROTO_IP;
44566   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44567      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44568      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44569   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44570      stype = SOCK_DGRAM;
44571      ptype = IPPROTO_UDP;
44572   } else {
44573       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44574       exit(1);
44575   }
44576
44577   if((s = socket(PF_INET6, stype, ptype)) < 0) {
44578      perror("socket");
44579      exit(1);
44580   }
44581
44582   optval = 1;
44583   optlen = sizeof(optval);
44584   if(setsockopt(s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &optval, optlen) < 0) {
44585      perror("setsockopt: IPPROTO_IPV6 IPV6_UNICAST_HOPS");
44586      close(s);
44587      exit(1);
44588   }
44589  ;
44590  return 0;
44591}
44592_ACEOF
44593if ac_fn_c_try_compile "$LINENO"; then :
44594  _compileok=1
44595fi
44596rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44597
44598  if test x"${_compileok}" != x; then
44599    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44600$as_echo "yes" >&6; }
44601
44602cat >>confdefs.h <<_ACEOF
44603#define HAVE_IPV6_UNICAST_HOPS 1
44604_ACEOF
44605
44606cat >>confdefs.h <<_ACEOF
44607#define SOCKS_IPV6_UNICAST_HOPS_LVL IPPROTO_IPV6
44608_ACEOF
44609
44610cat >>confdefs.h <<_ACEOF
44611#define SOCKS_IPV6_UNICAST_HOPS_NAME "ipv6_unicast_hops"
44612_ACEOF
44613    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
44614       #ipv4-only
44615
44616cat >>confdefs.h <<_ACEOF
44617#define SOCKS_IPV6_UNICAST_HOPS_IPV4 1
44618_ACEOF
44619
44620cat >>confdefs.h <<_ACEOF
44621#define SOCKS_IPV6_UNICAST_HOPS_IPV6 0
44622_ACEOF
44623    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
44624       #ipv6-only
44625
44626cat >>confdefs.h <<_ACEOF
44627#define SOCKS_IPV6_UNICAST_HOPS_IPV4 0
44628_ACEOF
44629
44630cat >>confdefs.h <<_ACEOF
44631#define SOCKS_IPV6_UNICAST_HOPS_IPV6 1
44632_ACEOF
44633    else
44634       #both ipv4 and ipv6
44635
44636cat >>confdefs.h <<_ACEOF
44637#define SOCKS_IPV6_UNICAST_HOPS_IPV4 1
44638_ACEOF
44639
44640cat >>confdefs.h <<_ACEOF
44641#define SOCKS_IPV6_UNICAST_HOPS_IPV6 1
44642_ACEOF
44643    fi
44644    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_UNICAST_HOPS"
44645  else
44646    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
44647$as_echo "no" >&6; }
44648  fi
44649unset _compileok
44650  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_2292DSTOPTS" >&5
44651$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_2292DSTOPTS... " >&6; }
44652  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44653/* end confdefs.h.  */
44654
44655#include <sys/types.h>
44656#include <sys/socket.h>
44657#include <netinet/in.h>
44658#include <netinet/tcp.h>
44659#include <netinet/udp.h>
44660
44661#include <stdio.h>
44662#include <stdlib.h>
44663#include <unistd.h>
44664
44665int
44666main ()
44667{
44668
44669   socklen_t optlen;
44670   int optval;
44671   int stype;
44672   int ptype;
44673   int s;
44674
44675   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44676      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44677      ptype = IPPROTO_TCP;
44678   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44679      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44680      ptype = IPPROTO_IP;
44681   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44682      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44683      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44684   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44685      stype = SOCK_DGRAM;
44686      ptype = IPPROTO_UDP;
44687   } else {
44688       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44689       exit(1);
44690   }
44691
44692   if((s = socket(PF_INET, stype, ptype)) < 0) {
44693      perror("socket");
44694      exit(1);
44695   }
44696
44697   optval = 1;
44698   optlen = sizeof(optval);
44699   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292DSTOPTS, &optval, optlen) < 0) {
44700      perror("setsockopt: IPPROTO_IPV6 IPV6_2292DSTOPTS");
44701      close(s);
44702      exit(1);
44703   }
44704  ;
44705  return 0;
44706}
44707_ACEOF
44708if ac_fn_c_try_compile "$LINENO"; then :
44709  _compileok=1
44710fi
44711rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44712
44713  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44714/* end confdefs.h.  */
44715
44716#include <sys/types.h>
44717#include <sys/socket.h>
44718#include <netinet/in.h>
44719#include <netinet/tcp.h>
44720#include <netinet/udp.h>
44721
44722#include <stdio.h>
44723#include <stdlib.h>
44724#include <unistd.h>
44725
44726int
44727main ()
44728{
44729
44730   socklen_t optlen;
44731   int optval;
44732   int stype;
44733   int ptype;
44734   int s;
44735
44736   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44737      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44738      ptype = IPPROTO_TCP;
44739   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44740      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44741      ptype = IPPROTO_IP;
44742   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44743      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44744      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44745   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44746      stype = SOCK_DGRAM;
44747      ptype = IPPROTO_UDP;
44748   } else {
44749       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44750       exit(1);
44751   }
44752
44753   if((s = socket(PF_INET6, stype, ptype)) < 0) {
44754      perror("socket");
44755      exit(1);
44756   }
44757
44758   optval = 1;
44759   optlen = sizeof(optval);
44760   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292DSTOPTS, &optval, optlen) < 0) {
44761      perror("setsockopt: IPPROTO_IPV6 IPV6_2292DSTOPTS");
44762      close(s);
44763      exit(1);
44764   }
44765  ;
44766  return 0;
44767}
44768_ACEOF
44769if ac_fn_c_try_compile "$LINENO"; then :
44770  _compileok=1
44771fi
44772rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44773
44774  if test x"${_compileok}" != x; then
44775    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44776$as_echo "yes" >&6; }
44777
44778cat >>confdefs.h <<_ACEOF
44779#define HAVE_IPV6_2292DSTOPTS 1
44780_ACEOF
44781
44782cat >>confdefs.h <<_ACEOF
44783#define SOCKS_IPV6_2292DSTOPTS_LVL IPPROTO_IPV6
44784_ACEOF
44785
44786cat >>confdefs.h <<_ACEOF
44787#define SOCKS_IPV6_2292DSTOPTS_NAME "ipv6_2292dstopts"
44788_ACEOF
44789    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
44790       #ipv4-only
44791
44792cat >>confdefs.h <<_ACEOF
44793#define SOCKS_IPV6_2292DSTOPTS_IPV4 1
44794_ACEOF
44795
44796cat >>confdefs.h <<_ACEOF
44797#define SOCKS_IPV6_2292DSTOPTS_IPV6 0
44798_ACEOF
44799    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
44800       #ipv6-only
44801
44802cat >>confdefs.h <<_ACEOF
44803#define SOCKS_IPV6_2292DSTOPTS_IPV4 0
44804_ACEOF
44805
44806cat >>confdefs.h <<_ACEOF
44807#define SOCKS_IPV6_2292DSTOPTS_IPV6 1
44808_ACEOF
44809    else
44810       #both ipv4 and ipv6
44811
44812cat >>confdefs.h <<_ACEOF
44813#define SOCKS_IPV6_2292DSTOPTS_IPV4 1
44814_ACEOF
44815
44816cat >>confdefs.h <<_ACEOF
44817#define SOCKS_IPV6_2292DSTOPTS_IPV6 1
44818_ACEOF
44819    fi
44820    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_2292DSTOPTS"
44821  else
44822    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
44823$as_echo "no" >&6; }
44824  fi
44825unset _compileok
44826  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_2292HOPLIMIT" >&5
44827$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_2292HOPLIMIT... " >&6; }
44828  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44829/* end confdefs.h.  */
44830
44831#include <sys/types.h>
44832#include <sys/socket.h>
44833#include <netinet/in.h>
44834#include <netinet/tcp.h>
44835#include <netinet/udp.h>
44836
44837#include <stdio.h>
44838#include <stdlib.h>
44839#include <unistd.h>
44840
44841int
44842main ()
44843{
44844
44845   socklen_t optlen;
44846   int optval;
44847   int stype;
44848   int ptype;
44849   int s;
44850
44851   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44852      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44853      ptype = IPPROTO_TCP;
44854   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44855      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44856      ptype = IPPROTO_IP;
44857   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44858      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44859      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44860   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44861      stype = SOCK_DGRAM;
44862      ptype = IPPROTO_UDP;
44863   } else {
44864       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44865       exit(1);
44866   }
44867
44868   if((s = socket(PF_INET, stype, ptype)) < 0) {
44869      perror("socket");
44870      exit(1);
44871   }
44872
44873   optval = 1;
44874   optlen = sizeof(optval);
44875   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292HOPLIMIT, &optval, optlen) < 0) {
44876      perror("setsockopt: IPPROTO_IPV6 IPV6_2292HOPLIMIT");
44877      close(s);
44878      exit(1);
44879   }
44880  ;
44881  return 0;
44882}
44883_ACEOF
44884if ac_fn_c_try_compile "$LINENO"; then :
44885  _compileok=1
44886fi
44887rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44888
44889  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
44890/* end confdefs.h.  */
44891
44892#include <sys/types.h>
44893#include <sys/socket.h>
44894#include <netinet/in.h>
44895#include <netinet/tcp.h>
44896#include <netinet/udp.h>
44897
44898#include <stdio.h>
44899#include <stdlib.h>
44900#include <unistd.h>
44901
44902int
44903main ()
44904{
44905
44906   socklen_t optlen;
44907   int optval;
44908   int stype;
44909   int ptype;
44910   int s;
44911
44912   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
44913      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
44914      ptype = IPPROTO_TCP;
44915   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
44916      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
44917      ptype = IPPROTO_IP;
44918   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
44919      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
44920      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
44921   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
44922      stype = SOCK_DGRAM;
44923      ptype = IPPROTO_UDP;
44924   } else {
44925       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
44926       exit(1);
44927   }
44928
44929   if((s = socket(PF_INET6, stype, ptype)) < 0) {
44930      perror("socket");
44931      exit(1);
44932   }
44933
44934   optval = 1;
44935   optlen = sizeof(optval);
44936   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292HOPLIMIT, &optval, optlen) < 0) {
44937      perror("setsockopt: IPPROTO_IPV6 IPV6_2292HOPLIMIT");
44938      close(s);
44939      exit(1);
44940   }
44941  ;
44942  return 0;
44943}
44944_ACEOF
44945if ac_fn_c_try_compile "$LINENO"; then :
44946  _compileok=1
44947fi
44948rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
44949
44950  if test x"${_compileok}" != x; then
44951    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
44952$as_echo "yes" >&6; }
44953
44954cat >>confdefs.h <<_ACEOF
44955#define HAVE_IPV6_2292HOPLIMIT 1
44956_ACEOF
44957
44958cat >>confdefs.h <<_ACEOF
44959#define SOCKS_IPV6_2292HOPLIMIT_LVL IPPROTO_IPV6
44960_ACEOF
44961
44962cat >>confdefs.h <<_ACEOF
44963#define SOCKS_IPV6_2292HOPLIMIT_NAME "ipv6_2292hoplimit"
44964_ACEOF
44965    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
44966       #ipv4-only
44967
44968cat >>confdefs.h <<_ACEOF
44969#define SOCKS_IPV6_2292HOPLIMIT_IPV4 1
44970_ACEOF
44971
44972cat >>confdefs.h <<_ACEOF
44973#define SOCKS_IPV6_2292HOPLIMIT_IPV6 0
44974_ACEOF
44975    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
44976       #ipv6-only
44977
44978cat >>confdefs.h <<_ACEOF
44979#define SOCKS_IPV6_2292HOPLIMIT_IPV4 0
44980_ACEOF
44981
44982cat >>confdefs.h <<_ACEOF
44983#define SOCKS_IPV6_2292HOPLIMIT_IPV6 1
44984_ACEOF
44985    else
44986       #both ipv4 and ipv6
44987
44988cat >>confdefs.h <<_ACEOF
44989#define SOCKS_IPV6_2292HOPLIMIT_IPV4 1
44990_ACEOF
44991
44992cat >>confdefs.h <<_ACEOF
44993#define SOCKS_IPV6_2292HOPLIMIT_IPV6 1
44994_ACEOF
44995    fi
44996    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_2292HOPLIMIT"
44997  else
44998    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
44999$as_echo "no" >&6; }
45000  fi
45001unset _compileok
45002  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_2292HOPOPTS" >&5
45003$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_2292HOPOPTS... " >&6; }
45004  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45005/* end confdefs.h.  */
45006
45007#include <sys/types.h>
45008#include <sys/socket.h>
45009#include <netinet/in.h>
45010#include <netinet/tcp.h>
45011#include <netinet/udp.h>
45012
45013#include <stdio.h>
45014#include <stdlib.h>
45015#include <unistd.h>
45016
45017int
45018main ()
45019{
45020
45021   socklen_t optlen;
45022   int optval;
45023   int stype;
45024   int ptype;
45025   int s;
45026
45027   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45028      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45029      ptype = IPPROTO_TCP;
45030   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45031      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45032      ptype = IPPROTO_IP;
45033   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45034      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45035      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45036   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45037      stype = SOCK_DGRAM;
45038      ptype = IPPROTO_UDP;
45039   } else {
45040       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45041       exit(1);
45042   }
45043
45044   if((s = socket(PF_INET, stype, ptype)) < 0) {
45045      perror("socket");
45046      exit(1);
45047   }
45048
45049   optval = 1;
45050   optlen = sizeof(optval);
45051   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292HOPOPTS, &optval, optlen) < 0) {
45052      perror("setsockopt: IPPROTO_IPV6 IPV6_2292HOPOPTS");
45053      close(s);
45054      exit(1);
45055   }
45056  ;
45057  return 0;
45058}
45059_ACEOF
45060if ac_fn_c_try_compile "$LINENO"; then :
45061  _compileok=1
45062fi
45063rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45064
45065  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45066/* end confdefs.h.  */
45067
45068#include <sys/types.h>
45069#include <sys/socket.h>
45070#include <netinet/in.h>
45071#include <netinet/tcp.h>
45072#include <netinet/udp.h>
45073
45074#include <stdio.h>
45075#include <stdlib.h>
45076#include <unistd.h>
45077
45078int
45079main ()
45080{
45081
45082   socklen_t optlen;
45083   int optval;
45084   int stype;
45085   int ptype;
45086   int s;
45087
45088   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45089      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45090      ptype = IPPROTO_TCP;
45091   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45092      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45093      ptype = IPPROTO_IP;
45094   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45095      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45096      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45097   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45098      stype = SOCK_DGRAM;
45099      ptype = IPPROTO_UDP;
45100   } else {
45101       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45102       exit(1);
45103   }
45104
45105   if((s = socket(PF_INET6, stype, ptype)) < 0) {
45106      perror("socket");
45107      exit(1);
45108   }
45109
45110   optval = 1;
45111   optlen = sizeof(optval);
45112   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292HOPOPTS, &optval, optlen) < 0) {
45113      perror("setsockopt: IPPROTO_IPV6 IPV6_2292HOPOPTS");
45114      close(s);
45115      exit(1);
45116   }
45117  ;
45118  return 0;
45119}
45120_ACEOF
45121if ac_fn_c_try_compile "$LINENO"; then :
45122  _compileok=1
45123fi
45124rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45125
45126  if test x"${_compileok}" != x; then
45127    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45128$as_echo "yes" >&6; }
45129
45130cat >>confdefs.h <<_ACEOF
45131#define HAVE_IPV6_2292HOPOPTS 1
45132_ACEOF
45133
45134cat >>confdefs.h <<_ACEOF
45135#define SOCKS_IPV6_2292HOPOPTS_LVL IPPROTO_IPV6
45136_ACEOF
45137
45138cat >>confdefs.h <<_ACEOF
45139#define SOCKS_IPV6_2292HOPOPTS_NAME "ipv6_2292hopopts"
45140_ACEOF
45141    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
45142       #ipv4-only
45143
45144cat >>confdefs.h <<_ACEOF
45145#define SOCKS_IPV6_2292HOPOPTS_IPV4 1
45146_ACEOF
45147
45148cat >>confdefs.h <<_ACEOF
45149#define SOCKS_IPV6_2292HOPOPTS_IPV6 0
45150_ACEOF
45151    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
45152       #ipv6-only
45153
45154cat >>confdefs.h <<_ACEOF
45155#define SOCKS_IPV6_2292HOPOPTS_IPV4 0
45156_ACEOF
45157
45158cat >>confdefs.h <<_ACEOF
45159#define SOCKS_IPV6_2292HOPOPTS_IPV6 1
45160_ACEOF
45161    else
45162       #both ipv4 and ipv6
45163
45164cat >>confdefs.h <<_ACEOF
45165#define SOCKS_IPV6_2292HOPOPTS_IPV4 1
45166_ACEOF
45167
45168cat >>confdefs.h <<_ACEOF
45169#define SOCKS_IPV6_2292HOPOPTS_IPV6 1
45170_ACEOF
45171    fi
45172    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_2292HOPOPTS"
45173  else
45174    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45175$as_echo "no" >&6; }
45176  fi
45177unset _compileok
45178  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_2292PKTINFO" >&5
45179$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_2292PKTINFO... " >&6; }
45180  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45181/* end confdefs.h.  */
45182
45183#include <sys/types.h>
45184#include <sys/socket.h>
45185#include <netinet/in.h>
45186#include <netinet/tcp.h>
45187#include <netinet/udp.h>
45188
45189#include <stdio.h>
45190#include <stdlib.h>
45191#include <unistd.h>
45192
45193int
45194main ()
45195{
45196
45197   socklen_t optlen;
45198   int optval;
45199   int stype;
45200   int ptype;
45201   int s;
45202
45203   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45204      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45205      ptype = IPPROTO_TCP;
45206   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45207      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45208      ptype = IPPROTO_IP;
45209   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45210      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45211      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45212   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45213      stype = SOCK_DGRAM;
45214      ptype = IPPROTO_UDP;
45215   } else {
45216       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45217       exit(1);
45218   }
45219
45220   if((s = socket(PF_INET, stype, ptype)) < 0) {
45221      perror("socket");
45222      exit(1);
45223   }
45224
45225   optval = 1;
45226   optlen = sizeof(optval);
45227   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292PKTINFO, &optval, optlen) < 0) {
45228      perror("setsockopt: IPPROTO_IPV6 IPV6_2292PKTINFO");
45229      close(s);
45230      exit(1);
45231   }
45232  ;
45233  return 0;
45234}
45235_ACEOF
45236if ac_fn_c_try_compile "$LINENO"; then :
45237  _compileok=1
45238fi
45239rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45240
45241  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45242/* end confdefs.h.  */
45243
45244#include <sys/types.h>
45245#include <sys/socket.h>
45246#include <netinet/in.h>
45247#include <netinet/tcp.h>
45248#include <netinet/udp.h>
45249
45250#include <stdio.h>
45251#include <stdlib.h>
45252#include <unistd.h>
45253
45254int
45255main ()
45256{
45257
45258   socklen_t optlen;
45259   int optval;
45260   int stype;
45261   int ptype;
45262   int s;
45263
45264   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45265      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45266      ptype = IPPROTO_TCP;
45267   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45268      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45269      ptype = IPPROTO_IP;
45270   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45271      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45272      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45273   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45274      stype = SOCK_DGRAM;
45275      ptype = IPPROTO_UDP;
45276   } else {
45277       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45278       exit(1);
45279   }
45280
45281   if((s = socket(PF_INET6, stype, ptype)) < 0) {
45282      perror("socket");
45283      exit(1);
45284   }
45285
45286   optval = 1;
45287   optlen = sizeof(optval);
45288   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292PKTINFO, &optval, optlen) < 0) {
45289      perror("setsockopt: IPPROTO_IPV6 IPV6_2292PKTINFO");
45290      close(s);
45291      exit(1);
45292   }
45293  ;
45294  return 0;
45295}
45296_ACEOF
45297if ac_fn_c_try_compile "$LINENO"; then :
45298  _compileok=1
45299fi
45300rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45301
45302  if test x"${_compileok}" != x; then
45303    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45304$as_echo "yes" >&6; }
45305
45306cat >>confdefs.h <<_ACEOF
45307#define HAVE_IPV6_2292PKTINFO 1
45308_ACEOF
45309
45310cat >>confdefs.h <<_ACEOF
45311#define SOCKS_IPV6_2292PKTINFO_LVL IPPROTO_IPV6
45312_ACEOF
45313
45314cat >>confdefs.h <<_ACEOF
45315#define SOCKS_IPV6_2292PKTINFO_NAME "ipv6_2292pktinfo"
45316_ACEOF
45317    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
45318       #ipv4-only
45319
45320cat >>confdefs.h <<_ACEOF
45321#define SOCKS_IPV6_2292PKTINFO_IPV4 1
45322_ACEOF
45323
45324cat >>confdefs.h <<_ACEOF
45325#define SOCKS_IPV6_2292PKTINFO_IPV6 0
45326_ACEOF
45327    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
45328       #ipv6-only
45329
45330cat >>confdefs.h <<_ACEOF
45331#define SOCKS_IPV6_2292PKTINFO_IPV4 0
45332_ACEOF
45333
45334cat >>confdefs.h <<_ACEOF
45335#define SOCKS_IPV6_2292PKTINFO_IPV6 1
45336_ACEOF
45337    else
45338       #both ipv4 and ipv6
45339
45340cat >>confdefs.h <<_ACEOF
45341#define SOCKS_IPV6_2292PKTINFO_IPV4 1
45342_ACEOF
45343
45344cat >>confdefs.h <<_ACEOF
45345#define SOCKS_IPV6_2292PKTINFO_IPV6 1
45346_ACEOF
45347    fi
45348    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_2292PKTINFO"
45349  else
45350    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45351$as_echo "no" >&6; }
45352  fi
45353unset _compileok
45354  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_2292PKTOPTIONS" >&5
45355$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_2292PKTOPTIONS... " >&6; }
45356  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45357/* end confdefs.h.  */
45358
45359#include <sys/types.h>
45360#include <sys/socket.h>
45361#include <netinet/in.h>
45362#include <netinet/tcp.h>
45363#include <netinet/udp.h>
45364
45365#include <stdio.h>
45366#include <stdlib.h>
45367#include <unistd.h>
45368
45369int
45370main ()
45371{
45372
45373   socklen_t optlen;
45374   int optval;
45375   int stype;
45376   int ptype;
45377   int s;
45378
45379   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45380      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45381      ptype = IPPROTO_TCP;
45382   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45383      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45384      ptype = IPPROTO_IP;
45385   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45386      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45387      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45388   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45389      stype = SOCK_DGRAM;
45390      ptype = IPPROTO_UDP;
45391   } else {
45392       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45393       exit(1);
45394   }
45395
45396   if((s = socket(PF_INET, stype, ptype)) < 0) {
45397      perror("socket");
45398      exit(1);
45399   }
45400
45401   optval = 1;
45402   optlen = sizeof(optval);
45403   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292PKTOPTIONS, &optval, optlen) < 0) {
45404      perror("setsockopt: IPPROTO_IPV6 IPV6_2292PKTOPTIONS");
45405      close(s);
45406      exit(1);
45407   }
45408  ;
45409  return 0;
45410}
45411_ACEOF
45412if ac_fn_c_try_compile "$LINENO"; then :
45413  _compileok=1
45414fi
45415rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45416
45417  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45418/* end confdefs.h.  */
45419
45420#include <sys/types.h>
45421#include <sys/socket.h>
45422#include <netinet/in.h>
45423#include <netinet/tcp.h>
45424#include <netinet/udp.h>
45425
45426#include <stdio.h>
45427#include <stdlib.h>
45428#include <unistd.h>
45429
45430int
45431main ()
45432{
45433
45434   socklen_t optlen;
45435   int optval;
45436   int stype;
45437   int ptype;
45438   int s;
45439
45440   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45441      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45442      ptype = IPPROTO_TCP;
45443   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45444      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45445      ptype = IPPROTO_IP;
45446   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45447      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45448      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45449   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45450      stype = SOCK_DGRAM;
45451      ptype = IPPROTO_UDP;
45452   } else {
45453       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45454       exit(1);
45455   }
45456
45457   if((s = socket(PF_INET6, stype, ptype)) < 0) {
45458      perror("socket");
45459      exit(1);
45460   }
45461
45462   optval = 1;
45463   optlen = sizeof(optval);
45464   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292PKTOPTIONS, &optval, optlen) < 0) {
45465      perror("setsockopt: IPPROTO_IPV6 IPV6_2292PKTOPTIONS");
45466      close(s);
45467      exit(1);
45468   }
45469  ;
45470  return 0;
45471}
45472_ACEOF
45473if ac_fn_c_try_compile "$LINENO"; then :
45474  _compileok=1
45475fi
45476rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45477
45478  if test x"${_compileok}" != x; then
45479    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45480$as_echo "yes" >&6; }
45481
45482cat >>confdefs.h <<_ACEOF
45483#define HAVE_IPV6_2292PKTOPTIONS 1
45484_ACEOF
45485
45486cat >>confdefs.h <<_ACEOF
45487#define SOCKS_IPV6_2292PKTOPTIONS_LVL IPPROTO_IPV6
45488_ACEOF
45489
45490cat >>confdefs.h <<_ACEOF
45491#define SOCKS_IPV6_2292PKTOPTIONS_NAME "ipv6_2292pktoptions"
45492_ACEOF
45493    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
45494       #ipv4-only
45495
45496cat >>confdefs.h <<_ACEOF
45497#define SOCKS_IPV6_2292PKTOPTIONS_IPV4 1
45498_ACEOF
45499
45500cat >>confdefs.h <<_ACEOF
45501#define SOCKS_IPV6_2292PKTOPTIONS_IPV6 0
45502_ACEOF
45503    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
45504       #ipv6-only
45505
45506cat >>confdefs.h <<_ACEOF
45507#define SOCKS_IPV6_2292PKTOPTIONS_IPV4 0
45508_ACEOF
45509
45510cat >>confdefs.h <<_ACEOF
45511#define SOCKS_IPV6_2292PKTOPTIONS_IPV6 1
45512_ACEOF
45513    else
45514       #both ipv4 and ipv6
45515
45516cat >>confdefs.h <<_ACEOF
45517#define SOCKS_IPV6_2292PKTOPTIONS_IPV4 1
45518_ACEOF
45519
45520cat >>confdefs.h <<_ACEOF
45521#define SOCKS_IPV6_2292PKTOPTIONS_IPV6 1
45522_ACEOF
45523    fi
45524    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_2292PKTOPTIONS"
45525  else
45526    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45527$as_echo "no" >&6; }
45528  fi
45529unset _compileok
45530  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_2292RTHDR" >&5
45531$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_2292RTHDR... " >&6; }
45532  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45533/* end confdefs.h.  */
45534
45535#include <sys/types.h>
45536#include <sys/socket.h>
45537#include <netinet/in.h>
45538#include <netinet/tcp.h>
45539#include <netinet/udp.h>
45540
45541#include <stdio.h>
45542#include <stdlib.h>
45543#include <unistd.h>
45544
45545int
45546main ()
45547{
45548
45549   socklen_t optlen;
45550   int optval;
45551   int stype;
45552   int ptype;
45553   int s;
45554
45555   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45556      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45557      ptype = IPPROTO_TCP;
45558   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45559      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45560      ptype = IPPROTO_IP;
45561   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45562      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45563      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45564   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45565      stype = SOCK_DGRAM;
45566      ptype = IPPROTO_UDP;
45567   } else {
45568       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45569       exit(1);
45570   }
45571
45572   if((s = socket(PF_INET, stype, ptype)) < 0) {
45573      perror("socket");
45574      exit(1);
45575   }
45576
45577   optval = 1;
45578   optlen = sizeof(optval);
45579   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292RTHDR, &optval, optlen) < 0) {
45580      perror("setsockopt: IPPROTO_IPV6 IPV6_2292RTHDR");
45581      close(s);
45582      exit(1);
45583   }
45584  ;
45585  return 0;
45586}
45587_ACEOF
45588if ac_fn_c_try_compile "$LINENO"; then :
45589  _compileok=1
45590fi
45591rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45592
45593  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45594/* end confdefs.h.  */
45595
45596#include <sys/types.h>
45597#include <sys/socket.h>
45598#include <netinet/in.h>
45599#include <netinet/tcp.h>
45600#include <netinet/udp.h>
45601
45602#include <stdio.h>
45603#include <stdlib.h>
45604#include <unistd.h>
45605
45606int
45607main ()
45608{
45609
45610   socklen_t optlen;
45611   int optval;
45612   int stype;
45613   int ptype;
45614   int s;
45615
45616   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45617      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45618      ptype = IPPROTO_TCP;
45619   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45620      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45621      ptype = IPPROTO_IP;
45622   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45623      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45624      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45625   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45626      stype = SOCK_DGRAM;
45627      ptype = IPPROTO_UDP;
45628   } else {
45629       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45630       exit(1);
45631   }
45632
45633   if((s = socket(PF_INET6, stype, ptype)) < 0) {
45634      perror("socket");
45635      exit(1);
45636   }
45637
45638   optval = 1;
45639   optlen = sizeof(optval);
45640   if(setsockopt(s, IPPROTO_IPV6, IPV6_2292RTHDR, &optval, optlen) < 0) {
45641      perror("setsockopt: IPPROTO_IPV6 IPV6_2292RTHDR");
45642      close(s);
45643      exit(1);
45644   }
45645  ;
45646  return 0;
45647}
45648_ACEOF
45649if ac_fn_c_try_compile "$LINENO"; then :
45650  _compileok=1
45651fi
45652rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45653
45654  if test x"${_compileok}" != x; then
45655    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45656$as_echo "yes" >&6; }
45657
45658cat >>confdefs.h <<_ACEOF
45659#define HAVE_IPV6_2292RTHDR 1
45660_ACEOF
45661
45662cat >>confdefs.h <<_ACEOF
45663#define SOCKS_IPV6_2292RTHDR_LVL IPPROTO_IPV6
45664_ACEOF
45665
45666cat >>confdefs.h <<_ACEOF
45667#define SOCKS_IPV6_2292RTHDR_NAME "ipv6_2292rthdr"
45668_ACEOF
45669    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
45670       #ipv4-only
45671
45672cat >>confdefs.h <<_ACEOF
45673#define SOCKS_IPV6_2292RTHDR_IPV4 1
45674_ACEOF
45675
45676cat >>confdefs.h <<_ACEOF
45677#define SOCKS_IPV6_2292RTHDR_IPV6 0
45678_ACEOF
45679    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
45680       #ipv6-only
45681
45682cat >>confdefs.h <<_ACEOF
45683#define SOCKS_IPV6_2292RTHDR_IPV4 0
45684_ACEOF
45685
45686cat >>confdefs.h <<_ACEOF
45687#define SOCKS_IPV6_2292RTHDR_IPV6 1
45688_ACEOF
45689    else
45690       #both ipv4 and ipv6
45691
45692cat >>confdefs.h <<_ACEOF
45693#define SOCKS_IPV6_2292RTHDR_IPV4 1
45694_ACEOF
45695
45696cat >>confdefs.h <<_ACEOF
45697#define SOCKS_IPV6_2292RTHDR_IPV6 1
45698_ACEOF
45699    fi
45700    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_2292RTHDR"
45701  else
45702    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45703$as_echo "no" >&6; }
45704  fi
45705unset _compileok
45706  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ADDRFORM" >&5
45707$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ADDRFORM... " >&6; }
45708  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45709/* end confdefs.h.  */
45710
45711#include <sys/types.h>
45712#include <sys/socket.h>
45713#include <netinet/in.h>
45714#include <netinet/tcp.h>
45715#include <netinet/udp.h>
45716
45717#include <stdio.h>
45718#include <stdlib.h>
45719#include <unistd.h>
45720
45721int
45722main ()
45723{
45724
45725   socklen_t optlen;
45726   int optval;
45727   int stype;
45728   int ptype;
45729   int s;
45730
45731   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45732      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45733      ptype = IPPROTO_TCP;
45734   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45735      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45736      ptype = IPPROTO_IP;
45737   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45738      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45739      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45740   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45741      stype = SOCK_DGRAM;
45742      ptype = IPPROTO_UDP;
45743   } else {
45744       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45745       exit(1);
45746   }
45747
45748   if((s = socket(PF_INET, stype, ptype)) < 0) {
45749      perror("socket");
45750      exit(1);
45751   }
45752
45753   optval = 1;
45754   optlen = sizeof(optval);
45755   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADDRFORM, &optval, optlen) < 0) {
45756      perror("setsockopt: IPPROTO_IPV6 IPV6_ADDRFORM");
45757      close(s);
45758      exit(1);
45759   }
45760  ;
45761  return 0;
45762}
45763_ACEOF
45764if ac_fn_c_try_compile "$LINENO"; then :
45765  _compileok=1
45766fi
45767rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45768
45769  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45770/* end confdefs.h.  */
45771
45772#include <sys/types.h>
45773#include <sys/socket.h>
45774#include <netinet/in.h>
45775#include <netinet/tcp.h>
45776#include <netinet/udp.h>
45777
45778#include <stdio.h>
45779#include <stdlib.h>
45780#include <unistd.h>
45781
45782int
45783main ()
45784{
45785
45786   socklen_t optlen;
45787   int optval;
45788   int stype;
45789   int ptype;
45790   int s;
45791
45792   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45793      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45794      ptype = IPPROTO_TCP;
45795   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45796      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45797      ptype = IPPROTO_IP;
45798   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45799      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45800      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45801   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45802      stype = SOCK_DGRAM;
45803      ptype = IPPROTO_UDP;
45804   } else {
45805       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45806       exit(1);
45807   }
45808
45809   if((s = socket(PF_INET6, stype, ptype)) < 0) {
45810      perror("socket");
45811      exit(1);
45812   }
45813
45814   optval = 1;
45815   optlen = sizeof(optval);
45816   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADDRFORM, &optval, optlen) < 0) {
45817      perror("setsockopt: IPPROTO_IPV6 IPV6_ADDRFORM");
45818      close(s);
45819      exit(1);
45820   }
45821  ;
45822  return 0;
45823}
45824_ACEOF
45825if ac_fn_c_try_compile "$LINENO"; then :
45826  _compileok=1
45827fi
45828rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45829
45830  if test x"${_compileok}" != x; then
45831    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
45832$as_echo "yes" >&6; }
45833
45834cat >>confdefs.h <<_ACEOF
45835#define HAVE_IPV6_ADDRFORM 1
45836_ACEOF
45837
45838cat >>confdefs.h <<_ACEOF
45839#define SOCKS_IPV6_ADDRFORM_LVL IPPROTO_IPV6
45840_ACEOF
45841
45842cat >>confdefs.h <<_ACEOF
45843#define SOCKS_IPV6_ADDRFORM_NAME "ipv6_addrform"
45844_ACEOF
45845    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
45846       #ipv4-only
45847
45848cat >>confdefs.h <<_ACEOF
45849#define SOCKS_IPV6_ADDRFORM_IPV4 1
45850_ACEOF
45851
45852cat >>confdefs.h <<_ACEOF
45853#define SOCKS_IPV6_ADDRFORM_IPV6 0
45854_ACEOF
45855    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
45856       #ipv6-only
45857
45858cat >>confdefs.h <<_ACEOF
45859#define SOCKS_IPV6_ADDRFORM_IPV4 0
45860_ACEOF
45861
45862cat >>confdefs.h <<_ACEOF
45863#define SOCKS_IPV6_ADDRFORM_IPV6 1
45864_ACEOF
45865    else
45866       #both ipv4 and ipv6
45867
45868cat >>confdefs.h <<_ACEOF
45869#define SOCKS_IPV6_ADDRFORM_IPV4 1
45870_ACEOF
45871
45872cat >>confdefs.h <<_ACEOF
45873#define SOCKS_IPV6_ADDRFORM_IPV6 1
45874_ACEOF
45875    fi
45876    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ADDRFORM"
45877  else
45878    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
45879$as_echo "no" >&6; }
45880  fi
45881unset _compileok
45882  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ADDR_PREFERENCES" >&5
45883$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ADDR_PREFERENCES... " >&6; }
45884  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45885/* end confdefs.h.  */
45886
45887#include <sys/types.h>
45888#include <sys/socket.h>
45889#include <netinet/in.h>
45890#include <netinet/tcp.h>
45891#include <netinet/udp.h>
45892
45893#include <stdio.h>
45894#include <stdlib.h>
45895#include <unistd.h>
45896
45897int
45898main ()
45899{
45900
45901   socklen_t optlen;
45902   int optval;
45903   int stype;
45904   int ptype;
45905   int s;
45906
45907   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45908      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45909      ptype = IPPROTO_TCP;
45910   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45911      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45912      ptype = IPPROTO_IP;
45913   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45914      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45915      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45916   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45917      stype = SOCK_DGRAM;
45918      ptype = IPPROTO_UDP;
45919   } else {
45920       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45921       exit(1);
45922   }
45923
45924   if((s = socket(PF_INET, stype, ptype)) < 0) {
45925      perror("socket");
45926      exit(1);
45927   }
45928
45929   optval = 1;
45930   optlen = sizeof(optval);
45931   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADDR_PREFERENCES, &optval, optlen) < 0) {
45932      perror("setsockopt: IPPROTO_IPV6 IPV6_ADDR_PREFERENCES");
45933      close(s);
45934      exit(1);
45935   }
45936  ;
45937  return 0;
45938}
45939_ACEOF
45940if ac_fn_c_try_compile "$LINENO"; then :
45941  _compileok=1
45942fi
45943rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
45944
45945  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
45946/* end confdefs.h.  */
45947
45948#include <sys/types.h>
45949#include <sys/socket.h>
45950#include <netinet/in.h>
45951#include <netinet/tcp.h>
45952#include <netinet/udp.h>
45953
45954#include <stdio.h>
45955#include <stdlib.h>
45956#include <unistd.h>
45957
45958int
45959main ()
45960{
45961
45962   socklen_t optlen;
45963   int optval;
45964   int stype;
45965   int ptype;
45966   int s;
45967
45968   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
45969      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
45970      ptype = IPPROTO_TCP;
45971   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
45972      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
45973      ptype = IPPROTO_IP;
45974   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
45975      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
45976      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
45977   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
45978      stype = SOCK_DGRAM;
45979      ptype = IPPROTO_UDP;
45980   } else {
45981       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
45982       exit(1);
45983   }
45984
45985   if((s = socket(PF_INET6, stype, ptype)) < 0) {
45986      perror("socket");
45987      exit(1);
45988   }
45989
45990   optval = 1;
45991   optlen = sizeof(optval);
45992   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADDR_PREFERENCES, &optval, optlen) < 0) {
45993      perror("setsockopt: IPPROTO_IPV6 IPV6_ADDR_PREFERENCES");
45994      close(s);
45995      exit(1);
45996   }
45997  ;
45998  return 0;
45999}
46000_ACEOF
46001if ac_fn_c_try_compile "$LINENO"; then :
46002  _compileok=1
46003fi
46004rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46005
46006  if test x"${_compileok}" != x; then
46007    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46008$as_echo "yes" >&6; }
46009
46010cat >>confdefs.h <<_ACEOF
46011#define HAVE_IPV6_ADDR_PREFERENCES 1
46012_ACEOF
46013
46014cat >>confdefs.h <<_ACEOF
46015#define SOCKS_IPV6_ADDR_PREFERENCES_LVL IPPROTO_IPV6
46016_ACEOF
46017
46018cat >>confdefs.h <<_ACEOF
46019#define SOCKS_IPV6_ADDR_PREFERENCES_NAME "ipv6_addr_preferences"
46020_ACEOF
46021    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
46022       #ipv4-only
46023
46024cat >>confdefs.h <<_ACEOF
46025#define SOCKS_IPV6_ADDR_PREFERENCES_IPV4 1
46026_ACEOF
46027
46028cat >>confdefs.h <<_ACEOF
46029#define SOCKS_IPV6_ADDR_PREFERENCES_IPV6 0
46030_ACEOF
46031    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
46032       #ipv6-only
46033
46034cat >>confdefs.h <<_ACEOF
46035#define SOCKS_IPV6_ADDR_PREFERENCES_IPV4 0
46036_ACEOF
46037
46038cat >>confdefs.h <<_ACEOF
46039#define SOCKS_IPV6_ADDR_PREFERENCES_IPV6 1
46040_ACEOF
46041    else
46042       #both ipv4 and ipv6
46043
46044cat >>confdefs.h <<_ACEOF
46045#define SOCKS_IPV6_ADDR_PREFERENCES_IPV4 1
46046_ACEOF
46047
46048cat >>confdefs.h <<_ACEOF
46049#define SOCKS_IPV6_ADDR_PREFERENCES_IPV6 1
46050_ACEOF
46051    fi
46052    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ADDR_PREFERENCES"
46053  else
46054    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
46055$as_echo "no" >&6; }
46056  fi
46057unset _compileok
46058  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_AUTHHDR" >&5
46059$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_AUTHHDR... " >&6; }
46060  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46061/* end confdefs.h.  */
46062
46063#include <sys/types.h>
46064#include <sys/socket.h>
46065#include <netinet/in.h>
46066#include <netinet/tcp.h>
46067#include <netinet/udp.h>
46068
46069#include <stdio.h>
46070#include <stdlib.h>
46071#include <unistd.h>
46072
46073int
46074main ()
46075{
46076
46077   socklen_t optlen;
46078   int optval;
46079   int stype;
46080   int ptype;
46081   int s;
46082
46083   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46084      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46085      ptype = IPPROTO_TCP;
46086   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46087      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46088      ptype = IPPROTO_IP;
46089   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46090      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46091      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46092   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46093      stype = SOCK_DGRAM;
46094      ptype = IPPROTO_UDP;
46095   } else {
46096       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46097       exit(1);
46098   }
46099
46100   if((s = socket(PF_INET, stype, ptype)) < 0) {
46101      perror("socket");
46102      exit(1);
46103   }
46104
46105   optval = 1;
46106   optlen = sizeof(optval);
46107   if(setsockopt(s, IPPROTO_IPV6, IPV6_AUTHHDR, &optval, optlen) < 0) {
46108      perror("setsockopt: IPPROTO_IPV6 IPV6_AUTHHDR");
46109      close(s);
46110      exit(1);
46111   }
46112  ;
46113  return 0;
46114}
46115_ACEOF
46116if ac_fn_c_try_compile "$LINENO"; then :
46117  _compileok=1
46118fi
46119rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46120
46121  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46122/* end confdefs.h.  */
46123
46124#include <sys/types.h>
46125#include <sys/socket.h>
46126#include <netinet/in.h>
46127#include <netinet/tcp.h>
46128#include <netinet/udp.h>
46129
46130#include <stdio.h>
46131#include <stdlib.h>
46132#include <unistd.h>
46133
46134int
46135main ()
46136{
46137
46138   socklen_t optlen;
46139   int optval;
46140   int stype;
46141   int ptype;
46142   int s;
46143
46144   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46145      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46146      ptype = IPPROTO_TCP;
46147   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46148      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46149      ptype = IPPROTO_IP;
46150   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46151      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46152      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46153   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46154      stype = SOCK_DGRAM;
46155      ptype = IPPROTO_UDP;
46156   } else {
46157       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46158       exit(1);
46159   }
46160
46161   if((s = socket(PF_INET6, stype, ptype)) < 0) {
46162      perror("socket");
46163      exit(1);
46164   }
46165
46166   optval = 1;
46167   optlen = sizeof(optval);
46168   if(setsockopt(s, IPPROTO_IPV6, IPV6_AUTHHDR, &optval, optlen) < 0) {
46169      perror("setsockopt: IPPROTO_IPV6 IPV6_AUTHHDR");
46170      close(s);
46171      exit(1);
46172   }
46173  ;
46174  return 0;
46175}
46176_ACEOF
46177if ac_fn_c_try_compile "$LINENO"; then :
46178  _compileok=1
46179fi
46180rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46181
46182  if test x"${_compileok}" != x; then
46183    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46184$as_echo "yes" >&6; }
46185
46186cat >>confdefs.h <<_ACEOF
46187#define HAVE_IPV6_AUTHHDR 1
46188_ACEOF
46189
46190cat >>confdefs.h <<_ACEOF
46191#define SOCKS_IPV6_AUTHHDR_LVL IPPROTO_IPV6
46192_ACEOF
46193
46194cat >>confdefs.h <<_ACEOF
46195#define SOCKS_IPV6_AUTHHDR_NAME "ipv6_authhdr"
46196_ACEOF
46197    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
46198       #ipv4-only
46199
46200cat >>confdefs.h <<_ACEOF
46201#define SOCKS_IPV6_AUTHHDR_IPV4 1
46202_ACEOF
46203
46204cat >>confdefs.h <<_ACEOF
46205#define SOCKS_IPV6_AUTHHDR_IPV6 0
46206_ACEOF
46207    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
46208       #ipv6-only
46209
46210cat >>confdefs.h <<_ACEOF
46211#define SOCKS_IPV6_AUTHHDR_IPV4 0
46212_ACEOF
46213
46214cat >>confdefs.h <<_ACEOF
46215#define SOCKS_IPV6_AUTHHDR_IPV6 1
46216_ACEOF
46217    else
46218       #both ipv4 and ipv6
46219
46220cat >>confdefs.h <<_ACEOF
46221#define SOCKS_IPV6_AUTHHDR_IPV4 1
46222_ACEOF
46223
46224cat >>confdefs.h <<_ACEOF
46225#define SOCKS_IPV6_AUTHHDR_IPV6 1
46226_ACEOF
46227    fi
46228    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_AUTHHDR"
46229  else
46230    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
46231$as_echo "no" >&6; }
46232  fi
46233unset _compileok
46234  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_AUTH_LEVEL" >&5
46235$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_AUTH_LEVEL... " >&6; }
46236  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46237/* end confdefs.h.  */
46238
46239#include <sys/types.h>
46240#include <sys/socket.h>
46241#include <netinet/in.h>
46242#include <netinet/tcp.h>
46243#include <netinet/udp.h>
46244
46245#include <stdio.h>
46246#include <stdlib.h>
46247#include <unistd.h>
46248
46249int
46250main ()
46251{
46252
46253   socklen_t optlen;
46254   int optval;
46255   int stype;
46256   int ptype;
46257   int s;
46258
46259   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46260      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46261      ptype = IPPROTO_TCP;
46262   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46263      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46264      ptype = IPPROTO_IP;
46265   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46266      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46267      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46268   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46269      stype = SOCK_DGRAM;
46270      ptype = IPPROTO_UDP;
46271   } else {
46272       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46273       exit(1);
46274   }
46275
46276   if((s = socket(PF_INET, stype, ptype)) < 0) {
46277      perror("socket");
46278      exit(1);
46279   }
46280
46281   optval = 1;
46282   optlen = sizeof(optval);
46283   if(setsockopt(s, IPPROTO_IPV6, IPV6_AUTH_LEVEL, &optval, optlen) < 0) {
46284      perror("setsockopt: IPPROTO_IPV6 IPV6_AUTH_LEVEL");
46285      close(s);
46286      exit(1);
46287   }
46288  ;
46289  return 0;
46290}
46291_ACEOF
46292if ac_fn_c_try_compile "$LINENO"; then :
46293  _compileok=1
46294fi
46295rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46296
46297  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46298/* end confdefs.h.  */
46299
46300#include <sys/types.h>
46301#include <sys/socket.h>
46302#include <netinet/in.h>
46303#include <netinet/tcp.h>
46304#include <netinet/udp.h>
46305
46306#include <stdio.h>
46307#include <stdlib.h>
46308#include <unistd.h>
46309
46310int
46311main ()
46312{
46313
46314   socklen_t optlen;
46315   int optval;
46316   int stype;
46317   int ptype;
46318   int s;
46319
46320   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46321      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46322      ptype = IPPROTO_TCP;
46323   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46324      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46325      ptype = IPPROTO_IP;
46326   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46327      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46328      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46329   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46330      stype = SOCK_DGRAM;
46331      ptype = IPPROTO_UDP;
46332   } else {
46333       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46334       exit(1);
46335   }
46336
46337   if((s = socket(PF_INET6, stype, ptype)) < 0) {
46338      perror("socket");
46339      exit(1);
46340   }
46341
46342   optval = 1;
46343   optlen = sizeof(optval);
46344   if(setsockopt(s, IPPROTO_IPV6, IPV6_AUTH_LEVEL, &optval, optlen) < 0) {
46345      perror("setsockopt: IPPROTO_IPV6 IPV6_AUTH_LEVEL");
46346      close(s);
46347      exit(1);
46348   }
46349  ;
46350  return 0;
46351}
46352_ACEOF
46353if ac_fn_c_try_compile "$LINENO"; then :
46354  _compileok=1
46355fi
46356rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46357
46358  if test x"${_compileok}" != x; then
46359    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46360$as_echo "yes" >&6; }
46361
46362cat >>confdefs.h <<_ACEOF
46363#define HAVE_IPV6_AUTH_LEVEL 1
46364_ACEOF
46365
46366cat >>confdefs.h <<_ACEOF
46367#define SOCKS_IPV6_AUTH_LEVEL_LVL IPPROTO_IPV6
46368_ACEOF
46369
46370cat >>confdefs.h <<_ACEOF
46371#define SOCKS_IPV6_AUTH_LEVEL_NAME "ipv6_auth_level"
46372_ACEOF
46373    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
46374       #ipv4-only
46375
46376cat >>confdefs.h <<_ACEOF
46377#define SOCKS_IPV6_AUTH_LEVEL_IPV4 1
46378_ACEOF
46379
46380cat >>confdefs.h <<_ACEOF
46381#define SOCKS_IPV6_AUTH_LEVEL_IPV6 0
46382_ACEOF
46383    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
46384       #ipv6-only
46385
46386cat >>confdefs.h <<_ACEOF
46387#define SOCKS_IPV6_AUTH_LEVEL_IPV4 0
46388_ACEOF
46389
46390cat >>confdefs.h <<_ACEOF
46391#define SOCKS_IPV6_AUTH_LEVEL_IPV6 1
46392_ACEOF
46393    else
46394       #both ipv4 and ipv6
46395
46396cat >>confdefs.h <<_ACEOF
46397#define SOCKS_IPV6_AUTH_LEVEL_IPV4 1
46398_ACEOF
46399
46400cat >>confdefs.h <<_ACEOF
46401#define SOCKS_IPV6_AUTH_LEVEL_IPV6 1
46402_ACEOF
46403    fi
46404    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_AUTH_LEVEL"
46405  else
46406    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
46407$as_echo "no" >&6; }
46408  fi
46409unset _compileok
46410  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_AUTOFLOWLABEL" >&5
46411$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_AUTOFLOWLABEL... " >&6; }
46412  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46413/* end confdefs.h.  */
46414
46415#include <sys/types.h>
46416#include <sys/socket.h>
46417#include <netinet/in.h>
46418#include <netinet/tcp.h>
46419#include <netinet/udp.h>
46420
46421#include <stdio.h>
46422#include <stdlib.h>
46423#include <unistd.h>
46424
46425int
46426main ()
46427{
46428
46429   socklen_t optlen;
46430   int optval;
46431   int stype;
46432   int ptype;
46433   int s;
46434
46435   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46436      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46437      ptype = IPPROTO_TCP;
46438   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46439      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46440      ptype = IPPROTO_IP;
46441   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46442      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46443      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46444   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46445      stype = SOCK_DGRAM;
46446      ptype = IPPROTO_UDP;
46447   } else {
46448       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46449       exit(1);
46450   }
46451
46452   if((s = socket(PF_INET, stype, ptype)) < 0) {
46453      perror("socket");
46454      exit(1);
46455   }
46456
46457   optval = 1;
46458   optlen = sizeof(optval);
46459   if(setsockopt(s, IPPROTO_IPV6, IPV6_AUTOFLOWLABEL, &optval, optlen) < 0) {
46460      perror("setsockopt: IPPROTO_IPV6 IPV6_AUTOFLOWLABEL");
46461      close(s);
46462      exit(1);
46463   }
46464  ;
46465  return 0;
46466}
46467_ACEOF
46468if ac_fn_c_try_compile "$LINENO"; then :
46469  _compileok=1
46470fi
46471rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46472
46473  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46474/* end confdefs.h.  */
46475
46476#include <sys/types.h>
46477#include <sys/socket.h>
46478#include <netinet/in.h>
46479#include <netinet/tcp.h>
46480#include <netinet/udp.h>
46481
46482#include <stdio.h>
46483#include <stdlib.h>
46484#include <unistd.h>
46485
46486int
46487main ()
46488{
46489
46490   socklen_t optlen;
46491   int optval;
46492   int stype;
46493   int ptype;
46494   int s;
46495
46496   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46497      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46498      ptype = IPPROTO_TCP;
46499   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46500      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46501      ptype = IPPROTO_IP;
46502   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46503      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46504      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46505   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46506      stype = SOCK_DGRAM;
46507      ptype = IPPROTO_UDP;
46508   } else {
46509       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46510       exit(1);
46511   }
46512
46513   if((s = socket(PF_INET6, stype, ptype)) < 0) {
46514      perror("socket");
46515      exit(1);
46516   }
46517
46518   optval = 1;
46519   optlen = sizeof(optval);
46520   if(setsockopt(s, IPPROTO_IPV6, IPV6_AUTOFLOWLABEL, &optval, optlen) < 0) {
46521      perror("setsockopt: IPPROTO_IPV6 IPV6_AUTOFLOWLABEL");
46522      close(s);
46523      exit(1);
46524   }
46525  ;
46526  return 0;
46527}
46528_ACEOF
46529if ac_fn_c_try_compile "$LINENO"; then :
46530  _compileok=1
46531fi
46532rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46533
46534  if test x"${_compileok}" != x; then
46535    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46536$as_echo "yes" >&6; }
46537
46538cat >>confdefs.h <<_ACEOF
46539#define HAVE_IPV6_AUTOFLOWLABEL 1
46540_ACEOF
46541
46542cat >>confdefs.h <<_ACEOF
46543#define SOCKS_IPV6_AUTOFLOWLABEL_LVL IPPROTO_IPV6
46544_ACEOF
46545
46546cat >>confdefs.h <<_ACEOF
46547#define SOCKS_IPV6_AUTOFLOWLABEL_NAME "ipv6_autoflowlabel"
46548_ACEOF
46549    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
46550       #ipv4-only
46551
46552cat >>confdefs.h <<_ACEOF
46553#define SOCKS_IPV6_AUTOFLOWLABEL_IPV4 1
46554_ACEOF
46555
46556cat >>confdefs.h <<_ACEOF
46557#define SOCKS_IPV6_AUTOFLOWLABEL_IPV6 0
46558_ACEOF
46559    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
46560       #ipv6-only
46561
46562cat >>confdefs.h <<_ACEOF
46563#define SOCKS_IPV6_AUTOFLOWLABEL_IPV4 0
46564_ACEOF
46565
46566cat >>confdefs.h <<_ACEOF
46567#define SOCKS_IPV6_AUTOFLOWLABEL_IPV6 1
46568_ACEOF
46569    else
46570       #both ipv4 and ipv6
46571
46572cat >>confdefs.h <<_ACEOF
46573#define SOCKS_IPV6_AUTOFLOWLABEL_IPV4 1
46574_ACEOF
46575
46576cat >>confdefs.h <<_ACEOF
46577#define SOCKS_IPV6_AUTOFLOWLABEL_IPV6 1
46578_ACEOF
46579    fi
46580    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_AUTOFLOWLABEL"
46581  else
46582    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
46583$as_echo "no" >&6; }
46584  fi
46585unset _compileok
46586  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_CHECKSUM" >&5
46587$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_CHECKSUM... " >&6; }
46588  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46589/* end confdefs.h.  */
46590
46591#include <sys/types.h>
46592#include <sys/socket.h>
46593#include <netinet/in.h>
46594#include <netinet/tcp.h>
46595#include <netinet/udp.h>
46596
46597#include <stdio.h>
46598#include <stdlib.h>
46599#include <unistd.h>
46600
46601int
46602main ()
46603{
46604
46605   socklen_t optlen;
46606   int optval;
46607   int stype;
46608   int ptype;
46609   int s;
46610
46611   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46612      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46613      ptype = IPPROTO_TCP;
46614   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46615      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46616      ptype = IPPROTO_IP;
46617   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46618      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46619      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46620   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46621      stype = SOCK_DGRAM;
46622      ptype = IPPROTO_UDP;
46623   } else {
46624       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46625       exit(1);
46626   }
46627
46628   if((s = socket(PF_INET, stype, ptype)) < 0) {
46629      perror("socket");
46630      exit(1);
46631   }
46632
46633   optval = 1;
46634   optlen = sizeof(optval);
46635   if(setsockopt(s, IPPROTO_IPV6, IPV6_CHECKSUM, &optval, optlen) < 0) {
46636      perror("setsockopt: IPPROTO_IPV6 IPV6_CHECKSUM");
46637      close(s);
46638      exit(1);
46639   }
46640  ;
46641  return 0;
46642}
46643_ACEOF
46644if ac_fn_c_try_compile "$LINENO"; then :
46645  _compileok=1
46646fi
46647rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46648
46649  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46650/* end confdefs.h.  */
46651
46652#include <sys/types.h>
46653#include <sys/socket.h>
46654#include <netinet/in.h>
46655#include <netinet/tcp.h>
46656#include <netinet/udp.h>
46657
46658#include <stdio.h>
46659#include <stdlib.h>
46660#include <unistd.h>
46661
46662int
46663main ()
46664{
46665
46666   socklen_t optlen;
46667   int optval;
46668   int stype;
46669   int ptype;
46670   int s;
46671
46672   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46673      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46674      ptype = IPPROTO_TCP;
46675   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46676      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46677      ptype = IPPROTO_IP;
46678   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46679      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46680      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46681   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46682      stype = SOCK_DGRAM;
46683      ptype = IPPROTO_UDP;
46684   } else {
46685       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46686       exit(1);
46687   }
46688
46689   if((s = socket(PF_INET6, stype, ptype)) < 0) {
46690      perror("socket");
46691      exit(1);
46692   }
46693
46694   optval = 1;
46695   optlen = sizeof(optval);
46696   if(setsockopt(s, IPPROTO_IPV6, IPV6_CHECKSUM, &optval, optlen) < 0) {
46697      perror("setsockopt: IPPROTO_IPV6 IPV6_CHECKSUM");
46698      close(s);
46699      exit(1);
46700   }
46701  ;
46702  return 0;
46703}
46704_ACEOF
46705if ac_fn_c_try_compile "$LINENO"; then :
46706  _compileok=1
46707fi
46708rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46709
46710  if test x"${_compileok}" != x; then
46711    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46712$as_echo "yes" >&6; }
46713
46714cat >>confdefs.h <<_ACEOF
46715#define HAVE_IPV6_CHECKSUM 1
46716_ACEOF
46717
46718cat >>confdefs.h <<_ACEOF
46719#define SOCKS_IPV6_CHECKSUM_LVL IPPROTO_IPV6
46720_ACEOF
46721
46722cat >>confdefs.h <<_ACEOF
46723#define SOCKS_IPV6_CHECKSUM_NAME "ipv6_checksum"
46724_ACEOF
46725    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
46726       #ipv4-only
46727
46728cat >>confdefs.h <<_ACEOF
46729#define SOCKS_IPV6_CHECKSUM_IPV4 1
46730_ACEOF
46731
46732cat >>confdefs.h <<_ACEOF
46733#define SOCKS_IPV6_CHECKSUM_IPV6 0
46734_ACEOF
46735    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
46736       #ipv6-only
46737
46738cat >>confdefs.h <<_ACEOF
46739#define SOCKS_IPV6_CHECKSUM_IPV4 0
46740_ACEOF
46741
46742cat >>confdefs.h <<_ACEOF
46743#define SOCKS_IPV6_CHECKSUM_IPV6 1
46744_ACEOF
46745    else
46746       #both ipv4 and ipv6
46747
46748cat >>confdefs.h <<_ACEOF
46749#define SOCKS_IPV6_CHECKSUM_IPV4 1
46750_ACEOF
46751
46752cat >>confdefs.h <<_ACEOF
46753#define SOCKS_IPV6_CHECKSUM_IPV6 1
46754_ACEOF
46755    fi
46756    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_CHECKSUM"
46757  else
46758    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
46759$as_echo "no" >&6; }
46760  fi
46761unset _compileok
46762  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_DONTFRAG" >&5
46763$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_DONTFRAG... " >&6; }
46764  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46765/* end confdefs.h.  */
46766
46767#include <sys/types.h>
46768#include <sys/socket.h>
46769#include <netinet/in.h>
46770#include <netinet/tcp.h>
46771#include <netinet/udp.h>
46772
46773#include <stdio.h>
46774#include <stdlib.h>
46775#include <unistd.h>
46776
46777int
46778main ()
46779{
46780
46781   socklen_t optlen;
46782   int optval;
46783   int stype;
46784   int ptype;
46785   int s;
46786
46787   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46788      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46789      ptype = IPPROTO_TCP;
46790   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46791      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46792      ptype = IPPROTO_IP;
46793   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46794      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46795      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46796   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46797      stype = SOCK_DGRAM;
46798      ptype = IPPROTO_UDP;
46799   } else {
46800       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46801       exit(1);
46802   }
46803
46804   if((s = socket(PF_INET, stype, ptype)) < 0) {
46805      perror("socket");
46806      exit(1);
46807   }
46808
46809   optval = 1;
46810   optlen = sizeof(optval);
46811   if(setsockopt(s, IPPROTO_IPV6, IPV6_DONTFRAG, &optval, optlen) < 0) {
46812      perror("setsockopt: IPPROTO_IPV6 IPV6_DONTFRAG");
46813      close(s);
46814      exit(1);
46815   }
46816  ;
46817  return 0;
46818}
46819_ACEOF
46820if ac_fn_c_try_compile "$LINENO"; then :
46821  _compileok=1
46822fi
46823rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46824
46825  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46826/* end confdefs.h.  */
46827
46828#include <sys/types.h>
46829#include <sys/socket.h>
46830#include <netinet/in.h>
46831#include <netinet/tcp.h>
46832#include <netinet/udp.h>
46833
46834#include <stdio.h>
46835#include <stdlib.h>
46836#include <unistd.h>
46837
46838int
46839main ()
46840{
46841
46842   socklen_t optlen;
46843   int optval;
46844   int stype;
46845   int ptype;
46846   int s;
46847
46848   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46849      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46850      ptype = IPPROTO_TCP;
46851   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46852      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46853      ptype = IPPROTO_IP;
46854   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46855      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46856      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46857   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46858      stype = SOCK_DGRAM;
46859      ptype = IPPROTO_UDP;
46860   } else {
46861       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46862       exit(1);
46863   }
46864
46865   if((s = socket(PF_INET6, stype, ptype)) < 0) {
46866      perror("socket");
46867      exit(1);
46868   }
46869
46870   optval = 1;
46871   optlen = sizeof(optval);
46872   if(setsockopt(s, IPPROTO_IPV6, IPV6_DONTFRAG, &optval, optlen) < 0) {
46873      perror("setsockopt: IPPROTO_IPV6 IPV6_DONTFRAG");
46874      close(s);
46875      exit(1);
46876   }
46877  ;
46878  return 0;
46879}
46880_ACEOF
46881if ac_fn_c_try_compile "$LINENO"; then :
46882  _compileok=1
46883fi
46884rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
46885
46886  if test x"${_compileok}" != x; then
46887    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46888$as_echo "yes" >&6; }
46889
46890cat >>confdefs.h <<_ACEOF
46891#define HAVE_IPV6_DONTFRAG 1
46892_ACEOF
46893
46894cat >>confdefs.h <<_ACEOF
46895#define SOCKS_IPV6_DONTFRAG_LVL IPPROTO_IPV6
46896_ACEOF
46897
46898cat >>confdefs.h <<_ACEOF
46899#define SOCKS_IPV6_DONTFRAG_NAME "ipv6_dontfrag"
46900_ACEOF
46901    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
46902       #ipv4-only
46903
46904cat >>confdefs.h <<_ACEOF
46905#define SOCKS_IPV6_DONTFRAG_IPV4 1
46906_ACEOF
46907
46908cat >>confdefs.h <<_ACEOF
46909#define SOCKS_IPV6_DONTFRAG_IPV6 0
46910_ACEOF
46911    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
46912       #ipv6-only
46913
46914cat >>confdefs.h <<_ACEOF
46915#define SOCKS_IPV6_DONTFRAG_IPV4 0
46916_ACEOF
46917
46918cat >>confdefs.h <<_ACEOF
46919#define SOCKS_IPV6_DONTFRAG_IPV6 1
46920_ACEOF
46921    else
46922       #both ipv4 and ipv6
46923
46924cat >>confdefs.h <<_ACEOF
46925#define SOCKS_IPV6_DONTFRAG_IPV4 1
46926_ACEOF
46927
46928cat >>confdefs.h <<_ACEOF
46929#define SOCKS_IPV6_DONTFRAG_IPV6 1
46930_ACEOF
46931    fi
46932    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_DONTFRAG"
46933  else
46934    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
46935$as_echo "no" >&6; }
46936  fi
46937unset _compileok
46938  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_DSTOPTS" >&5
46939$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_DSTOPTS... " >&6; }
46940  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46941/* end confdefs.h.  */
46942
46943#include <sys/types.h>
46944#include <sys/socket.h>
46945#include <netinet/in.h>
46946#include <netinet/tcp.h>
46947#include <netinet/udp.h>
46948
46949#include <stdio.h>
46950#include <stdlib.h>
46951#include <unistd.h>
46952
46953int
46954main ()
46955{
46956
46957   socklen_t optlen;
46958   int optval;
46959   int stype;
46960   int ptype;
46961   int s;
46962
46963   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
46964      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
46965      ptype = IPPROTO_TCP;
46966   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
46967      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
46968      ptype = IPPROTO_IP;
46969   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
46970      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
46971      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
46972   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
46973      stype = SOCK_DGRAM;
46974      ptype = IPPROTO_UDP;
46975   } else {
46976       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
46977       exit(1);
46978   }
46979
46980   if((s = socket(PF_INET, stype, ptype)) < 0) {
46981      perror("socket");
46982      exit(1);
46983   }
46984
46985   optval = 1;
46986   optlen = sizeof(optval);
46987   if(setsockopt(s, IPPROTO_IPV6, IPV6_DSTOPTS, &optval, optlen) < 0) {
46988      perror("setsockopt: IPPROTO_IPV6 IPV6_DSTOPTS");
46989      close(s);
46990      exit(1);
46991   }
46992  ;
46993  return 0;
46994}
46995_ACEOF
46996if ac_fn_c_try_compile "$LINENO"; then :
46997  _compileok=1
46998fi
46999rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47000
47001  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47002/* end confdefs.h.  */
47003
47004#include <sys/types.h>
47005#include <sys/socket.h>
47006#include <netinet/in.h>
47007#include <netinet/tcp.h>
47008#include <netinet/udp.h>
47009
47010#include <stdio.h>
47011#include <stdlib.h>
47012#include <unistd.h>
47013
47014int
47015main ()
47016{
47017
47018   socklen_t optlen;
47019   int optval;
47020   int stype;
47021   int ptype;
47022   int s;
47023
47024   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47025      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47026      ptype = IPPROTO_TCP;
47027   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47028      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47029      ptype = IPPROTO_IP;
47030   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47031      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47032      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47033   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47034      stype = SOCK_DGRAM;
47035      ptype = IPPROTO_UDP;
47036   } else {
47037       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47038       exit(1);
47039   }
47040
47041   if((s = socket(PF_INET6, stype, ptype)) < 0) {
47042      perror("socket");
47043      exit(1);
47044   }
47045
47046   optval = 1;
47047   optlen = sizeof(optval);
47048   if(setsockopt(s, IPPROTO_IPV6, IPV6_DSTOPTS, &optval, optlen) < 0) {
47049      perror("setsockopt: IPPROTO_IPV6 IPV6_DSTOPTS");
47050      close(s);
47051      exit(1);
47052   }
47053  ;
47054  return 0;
47055}
47056_ACEOF
47057if ac_fn_c_try_compile "$LINENO"; then :
47058  _compileok=1
47059fi
47060rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47061
47062  if test x"${_compileok}" != x; then
47063    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47064$as_echo "yes" >&6; }
47065
47066cat >>confdefs.h <<_ACEOF
47067#define HAVE_IPV6_DSTOPTS 1
47068_ACEOF
47069
47070cat >>confdefs.h <<_ACEOF
47071#define SOCKS_IPV6_DSTOPTS_LVL IPPROTO_IPV6
47072_ACEOF
47073
47074cat >>confdefs.h <<_ACEOF
47075#define SOCKS_IPV6_DSTOPTS_NAME "ipv6_dstopts"
47076_ACEOF
47077    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
47078       #ipv4-only
47079
47080cat >>confdefs.h <<_ACEOF
47081#define SOCKS_IPV6_DSTOPTS_IPV4 1
47082_ACEOF
47083
47084cat >>confdefs.h <<_ACEOF
47085#define SOCKS_IPV6_DSTOPTS_IPV6 0
47086_ACEOF
47087    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
47088       #ipv6-only
47089
47090cat >>confdefs.h <<_ACEOF
47091#define SOCKS_IPV6_DSTOPTS_IPV4 0
47092_ACEOF
47093
47094cat >>confdefs.h <<_ACEOF
47095#define SOCKS_IPV6_DSTOPTS_IPV6 1
47096_ACEOF
47097    else
47098       #both ipv4 and ipv6
47099
47100cat >>confdefs.h <<_ACEOF
47101#define SOCKS_IPV6_DSTOPTS_IPV4 1
47102_ACEOF
47103
47104cat >>confdefs.h <<_ACEOF
47105#define SOCKS_IPV6_DSTOPTS_IPV6 1
47106_ACEOF
47107    fi
47108    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_DSTOPTS"
47109  else
47110    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47111$as_echo "no" >&6; }
47112  fi
47113unset _compileok
47114  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_DSTOPTS" >&5
47115$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_DSTOPTS... " >&6; }
47116  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47117/* end confdefs.h.  */
47118
47119#include <sys/types.h>
47120#include <sys/socket.h>
47121#include <netinet/in.h>
47122#include <netinet/tcp.h>
47123#include <netinet/udp.h>
47124
47125#include <stdio.h>
47126#include <stdlib.h>
47127#include <unistd.h>
47128
47129int
47130main ()
47131{
47132
47133   socklen_t optlen;
47134   int optval;
47135   int stype;
47136   int ptype;
47137   int s;
47138
47139   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47140      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47141      ptype = IPPROTO_TCP;
47142   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47143      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47144      ptype = IPPROTO_IP;
47145   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47146      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47147      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47148   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47149      stype = SOCK_DGRAM;
47150      ptype = IPPROTO_UDP;
47151   } else {
47152       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47153       exit(1);
47154   }
47155
47156   if((s = socket(PF_INET, stype, ptype)) < 0) {
47157      perror("socket");
47158      exit(1);
47159   }
47160
47161   optval = 1;
47162   optlen = sizeof(optval);
47163   if(setsockopt(s, IPPROTO_IPV6, IPV6_DSTOPTS, &optval, optlen) < 0) {
47164      perror("setsockopt: IPPROTO_IPV6 IPV6_DSTOPTS");
47165      close(s);
47166      exit(1);
47167   }
47168  ;
47169  return 0;
47170}
47171_ACEOF
47172if ac_fn_c_try_compile "$LINENO"; then :
47173  _compileok=1
47174fi
47175rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47176
47177  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47178/* end confdefs.h.  */
47179
47180#include <sys/types.h>
47181#include <sys/socket.h>
47182#include <netinet/in.h>
47183#include <netinet/tcp.h>
47184#include <netinet/udp.h>
47185
47186#include <stdio.h>
47187#include <stdlib.h>
47188#include <unistd.h>
47189
47190int
47191main ()
47192{
47193
47194   socklen_t optlen;
47195   int optval;
47196   int stype;
47197   int ptype;
47198   int s;
47199
47200   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47201      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47202      ptype = IPPROTO_TCP;
47203   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47204      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47205      ptype = IPPROTO_IP;
47206   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47207      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47208      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47209   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47210      stype = SOCK_DGRAM;
47211      ptype = IPPROTO_UDP;
47212   } else {
47213       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47214       exit(1);
47215   }
47216
47217   if((s = socket(PF_INET6, stype, ptype)) < 0) {
47218      perror("socket");
47219      exit(1);
47220   }
47221
47222   optval = 1;
47223   optlen = sizeof(optval);
47224   if(setsockopt(s, IPPROTO_IPV6, IPV6_DSTOPTS, &optval, optlen) < 0) {
47225      perror("setsockopt: IPPROTO_IPV6 IPV6_DSTOPTS");
47226      close(s);
47227      exit(1);
47228   }
47229  ;
47230  return 0;
47231}
47232_ACEOF
47233if ac_fn_c_try_compile "$LINENO"; then :
47234  _compileok=1
47235fi
47236rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47237
47238  if test x"${_compileok}" != x; then
47239    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47240$as_echo "yes" >&6; }
47241
47242cat >>confdefs.h <<_ACEOF
47243#define HAVE_IPV6_DSTOPTS 1
47244_ACEOF
47245
47246cat >>confdefs.h <<_ACEOF
47247#define SOCKS_IPV6_DSTOPTS_LVL IPPROTO_IPV6
47248_ACEOF
47249
47250cat >>confdefs.h <<_ACEOF
47251#define SOCKS_IPV6_DSTOPTS_NAME "ipv6_dstopts"
47252_ACEOF
47253    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
47254       #ipv4-only
47255
47256cat >>confdefs.h <<_ACEOF
47257#define SOCKS_IPV6_DSTOPTS_IPV4 1
47258_ACEOF
47259
47260cat >>confdefs.h <<_ACEOF
47261#define SOCKS_IPV6_DSTOPTS_IPV6 0
47262_ACEOF
47263    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
47264       #ipv6-only
47265
47266cat >>confdefs.h <<_ACEOF
47267#define SOCKS_IPV6_DSTOPTS_IPV4 0
47268_ACEOF
47269
47270cat >>confdefs.h <<_ACEOF
47271#define SOCKS_IPV6_DSTOPTS_IPV6 1
47272_ACEOF
47273    else
47274       #both ipv4 and ipv6
47275
47276cat >>confdefs.h <<_ACEOF
47277#define SOCKS_IPV6_DSTOPTS_IPV4 1
47278_ACEOF
47279
47280cat >>confdefs.h <<_ACEOF
47281#define SOCKS_IPV6_DSTOPTS_IPV6 1
47282_ACEOF
47283    fi
47284    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_DSTOPTS"
47285  else
47286    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47287$as_echo "no" >&6; }
47288  fi
47289unset _compileok
47290  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ESP_NETWORK_LEVEL" >&5
47291$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ESP_NETWORK_LEVEL... " >&6; }
47292  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47293/* end confdefs.h.  */
47294
47295#include <sys/types.h>
47296#include <sys/socket.h>
47297#include <netinet/in.h>
47298#include <netinet/tcp.h>
47299#include <netinet/udp.h>
47300
47301#include <stdio.h>
47302#include <stdlib.h>
47303#include <unistd.h>
47304
47305int
47306main ()
47307{
47308
47309   socklen_t optlen;
47310   int optval;
47311   int stype;
47312   int ptype;
47313   int s;
47314
47315   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47316      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47317      ptype = IPPROTO_TCP;
47318   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47319      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47320      ptype = IPPROTO_IP;
47321   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47322      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47323      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47324   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47325      stype = SOCK_DGRAM;
47326      ptype = IPPROTO_UDP;
47327   } else {
47328       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47329       exit(1);
47330   }
47331
47332   if((s = socket(PF_INET, stype, ptype)) < 0) {
47333      perror("socket");
47334      exit(1);
47335   }
47336
47337   optval = 1;
47338   optlen = sizeof(optval);
47339   if(setsockopt(s, IPPROTO_IPV6, IPV6_ESP_NETWORK_LEVEL, &optval, optlen) < 0) {
47340      perror("setsockopt: IPPROTO_IPV6 IPV6_ESP_NETWORK_LEVEL");
47341      close(s);
47342      exit(1);
47343   }
47344  ;
47345  return 0;
47346}
47347_ACEOF
47348if ac_fn_c_try_compile "$LINENO"; then :
47349  _compileok=1
47350fi
47351rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47352
47353  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47354/* end confdefs.h.  */
47355
47356#include <sys/types.h>
47357#include <sys/socket.h>
47358#include <netinet/in.h>
47359#include <netinet/tcp.h>
47360#include <netinet/udp.h>
47361
47362#include <stdio.h>
47363#include <stdlib.h>
47364#include <unistd.h>
47365
47366int
47367main ()
47368{
47369
47370   socklen_t optlen;
47371   int optval;
47372   int stype;
47373   int ptype;
47374   int s;
47375
47376   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47377      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47378      ptype = IPPROTO_TCP;
47379   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47380      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47381      ptype = IPPROTO_IP;
47382   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47383      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47384      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47385   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47386      stype = SOCK_DGRAM;
47387      ptype = IPPROTO_UDP;
47388   } else {
47389       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47390       exit(1);
47391   }
47392
47393   if((s = socket(PF_INET6, stype, ptype)) < 0) {
47394      perror("socket");
47395      exit(1);
47396   }
47397
47398   optval = 1;
47399   optlen = sizeof(optval);
47400   if(setsockopt(s, IPPROTO_IPV6, IPV6_ESP_NETWORK_LEVEL, &optval, optlen) < 0) {
47401      perror("setsockopt: IPPROTO_IPV6 IPV6_ESP_NETWORK_LEVEL");
47402      close(s);
47403      exit(1);
47404   }
47405  ;
47406  return 0;
47407}
47408_ACEOF
47409if ac_fn_c_try_compile "$LINENO"; then :
47410  _compileok=1
47411fi
47412rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47413
47414  if test x"${_compileok}" != x; then
47415    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47416$as_echo "yes" >&6; }
47417
47418cat >>confdefs.h <<_ACEOF
47419#define HAVE_IPV6_ESP_NETWORK_LEVEL 1
47420_ACEOF
47421
47422cat >>confdefs.h <<_ACEOF
47423#define SOCKS_IPV6_ESP_NETWORK_LEVEL_LVL IPPROTO_IPV6
47424_ACEOF
47425
47426cat >>confdefs.h <<_ACEOF
47427#define SOCKS_IPV6_ESP_NETWORK_LEVEL_NAME "ipv6_esp_network_level"
47428_ACEOF
47429    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
47430       #ipv4-only
47431
47432cat >>confdefs.h <<_ACEOF
47433#define SOCKS_IPV6_ESP_NETWORK_LEVEL_IPV4 1
47434_ACEOF
47435
47436cat >>confdefs.h <<_ACEOF
47437#define SOCKS_IPV6_ESP_NETWORK_LEVEL_IPV6 0
47438_ACEOF
47439    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
47440       #ipv6-only
47441
47442cat >>confdefs.h <<_ACEOF
47443#define SOCKS_IPV6_ESP_NETWORK_LEVEL_IPV4 0
47444_ACEOF
47445
47446cat >>confdefs.h <<_ACEOF
47447#define SOCKS_IPV6_ESP_NETWORK_LEVEL_IPV6 1
47448_ACEOF
47449    else
47450       #both ipv4 and ipv6
47451
47452cat >>confdefs.h <<_ACEOF
47453#define SOCKS_IPV6_ESP_NETWORK_LEVEL_IPV4 1
47454_ACEOF
47455
47456cat >>confdefs.h <<_ACEOF
47457#define SOCKS_IPV6_ESP_NETWORK_LEVEL_IPV6 1
47458_ACEOF
47459    fi
47460    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ESP_NETWORK_LEVEL"
47461  else
47462    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47463$as_echo "no" >&6; }
47464  fi
47465unset _compileok
47466  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ESP_TRANS_LEVEL" >&5
47467$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ESP_TRANS_LEVEL... " >&6; }
47468  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47469/* end confdefs.h.  */
47470
47471#include <sys/types.h>
47472#include <sys/socket.h>
47473#include <netinet/in.h>
47474#include <netinet/tcp.h>
47475#include <netinet/udp.h>
47476
47477#include <stdio.h>
47478#include <stdlib.h>
47479#include <unistd.h>
47480
47481int
47482main ()
47483{
47484
47485   socklen_t optlen;
47486   int optval;
47487   int stype;
47488   int ptype;
47489   int s;
47490
47491   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47492      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47493      ptype = IPPROTO_TCP;
47494   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47495      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47496      ptype = IPPROTO_IP;
47497   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47498      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47499      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47500   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47501      stype = SOCK_DGRAM;
47502      ptype = IPPROTO_UDP;
47503   } else {
47504       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47505       exit(1);
47506   }
47507
47508   if((s = socket(PF_INET, stype, ptype)) < 0) {
47509      perror("socket");
47510      exit(1);
47511   }
47512
47513   optval = 1;
47514   optlen = sizeof(optval);
47515   if(setsockopt(s, IPPROTO_IPV6, IPV6_ESP_TRANS_LEVEL, &optval, optlen) < 0) {
47516      perror("setsockopt: IPPROTO_IPV6 IPV6_ESP_TRANS_LEVEL");
47517      close(s);
47518      exit(1);
47519   }
47520  ;
47521  return 0;
47522}
47523_ACEOF
47524if ac_fn_c_try_compile "$LINENO"; then :
47525  _compileok=1
47526fi
47527rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47528
47529  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47530/* end confdefs.h.  */
47531
47532#include <sys/types.h>
47533#include <sys/socket.h>
47534#include <netinet/in.h>
47535#include <netinet/tcp.h>
47536#include <netinet/udp.h>
47537
47538#include <stdio.h>
47539#include <stdlib.h>
47540#include <unistd.h>
47541
47542int
47543main ()
47544{
47545
47546   socklen_t optlen;
47547   int optval;
47548   int stype;
47549   int ptype;
47550   int s;
47551
47552   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47553      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47554      ptype = IPPROTO_TCP;
47555   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47556      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47557      ptype = IPPROTO_IP;
47558   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47559      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47560      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47561   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47562      stype = SOCK_DGRAM;
47563      ptype = IPPROTO_UDP;
47564   } else {
47565       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47566       exit(1);
47567   }
47568
47569   if((s = socket(PF_INET6, stype, ptype)) < 0) {
47570      perror("socket");
47571      exit(1);
47572   }
47573
47574   optval = 1;
47575   optlen = sizeof(optval);
47576   if(setsockopt(s, IPPROTO_IPV6, IPV6_ESP_TRANS_LEVEL, &optval, optlen) < 0) {
47577      perror("setsockopt: IPPROTO_IPV6 IPV6_ESP_TRANS_LEVEL");
47578      close(s);
47579      exit(1);
47580   }
47581  ;
47582  return 0;
47583}
47584_ACEOF
47585if ac_fn_c_try_compile "$LINENO"; then :
47586  _compileok=1
47587fi
47588rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47589
47590  if test x"${_compileok}" != x; then
47591    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47592$as_echo "yes" >&6; }
47593
47594cat >>confdefs.h <<_ACEOF
47595#define HAVE_IPV6_ESP_TRANS_LEVEL 1
47596_ACEOF
47597
47598cat >>confdefs.h <<_ACEOF
47599#define SOCKS_IPV6_ESP_TRANS_LEVEL_LVL IPPROTO_IPV6
47600_ACEOF
47601
47602cat >>confdefs.h <<_ACEOF
47603#define SOCKS_IPV6_ESP_TRANS_LEVEL_NAME "ipv6_esp_trans_level"
47604_ACEOF
47605    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
47606       #ipv4-only
47607
47608cat >>confdefs.h <<_ACEOF
47609#define SOCKS_IPV6_ESP_TRANS_LEVEL_IPV4 1
47610_ACEOF
47611
47612cat >>confdefs.h <<_ACEOF
47613#define SOCKS_IPV6_ESP_TRANS_LEVEL_IPV6 0
47614_ACEOF
47615    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
47616       #ipv6-only
47617
47618cat >>confdefs.h <<_ACEOF
47619#define SOCKS_IPV6_ESP_TRANS_LEVEL_IPV4 0
47620_ACEOF
47621
47622cat >>confdefs.h <<_ACEOF
47623#define SOCKS_IPV6_ESP_TRANS_LEVEL_IPV6 1
47624_ACEOF
47625    else
47626       #both ipv4 and ipv6
47627
47628cat >>confdefs.h <<_ACEOF
47629#define SOCKS_IPV6_ESP_TRANS_LEVEL_IPV4 1
47630_ACEOF
47631
47632cat >>confdefs.h <<_ACEOF
47633#define SOCKS_IPV6_ESP_TRANS_LEVEL_IPV6 1
47634_ACEOF
47635    fi
47636    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ESP_TRANS_LEVEL"
47637  else
47638    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47639$as_echo "no" >&6; }
47640  fi
47641unset _compileok
47642  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_FLOWINFO" >&5
47643$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_FLOWINFO... " >&6; }
47644  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47645/* end confdefs.h.  */
47646
47647#include <sys/types.h>
47648#include <sys/socket.h>
47649#include <netinet/in.h>
47650#include <netinet/tcp.h>
47651#include <netinet/udp.h>
47652
47653#include <stdio.h>
47654#include <stdlib.h>
47655#include <unistd.h>
47656
47657int
47658main ()
47659{
47660
47661   socklen_t optlen;
47662   int optval;
47663   int stype;
47664   int ptype;
47665   int s;
47666
47667   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47668      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47669      ptype = IPPROTO_TCP;
47670   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47671      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47672      ptype = IPPROTO_IP;
47673   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47674      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47675      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47676   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47677      stype = SOCK_DGRAM;
47678      ptype = IPPROTO_UDP;
47679   } else {
47680       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47681       exit(1);
47682   }
47683
47684   if((s = socket(PF_INET, stype, ptype)) < 0) {
47685      perror("socket");
47686      exit(1);
47687   }
47688
47689   optval = 1;
47690   optlen = sizeof(optval);
47691   if(setsockopt(s, IPPROTO_IPV6, IPV6_FLOWINFO, &optval, optlen) < 0) {
47692      perror("setsockopt: IPPROTO_IPV6 IPV6_FLOWINFO");
47693      close(s);
47694      exit(1);
47695   }
47696  ;
47697  return 0;
47698}
47699_ACEOF
47700if ac_fn_c_try_compile "$LINENO"; then :
47701  _compileok=1
47702fi
47703rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47704
47705  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47706/* end confdefs.h.  */
47707
47708#include <sys/types.h>
47709#include <sys/socket.h>
47710#include <netinet/in.h>
47711#include <netinet/tcp.h>
47712#include <netinet/udp.h>
47713
47714#include <stdio.h>
47715#include <stdlib.h>
47716#include <unistd.h>
47717
47718int
47719main ()
47720{
47721
47722   socklen_t optlen;
47723   int optval;
47724   int stype;
47725   int ptype;
47726   int s;
47727
47728   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47729      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47730      ptype = IPPROTO_TCP;
47731   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47732      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47733      ptype = IPPROTO_IP;
47734   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47735      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47736      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47737   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47738      stype = SOCK_DGRAM;
47739      ptype = IPPROTO_UDP;
47740   } else {
47741       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47742       exit(1);
47743   }
47744
47745   if((s = socket(PF_INET6, stype, ptype)) < 0) {
47746      perror("socket");
47747      exit(1);
47748   }
47749
47750   optval = 1;
47751   optlen = sizeof(optval);
47752   if(setsockopt(s, IPPROTO_IPV6, IPV6_FLOWINFO, &optval, optlen) < 0) {
47753      perror("setsockopt: IPPROTO_IPV6 IPV6_FLOWINFO");
47754      close(s);
47755      exit(1);
47756   }
47757  ;
47758  return 0;
47759}
47760_ACEOF
47761if ac_fn_c_try_compile "$LINENO"; then :
47762  _compileok=1
47763fi
47764rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47765
47766  if test x"${_compileok}" != x; then
47767    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47768$as_echo "yes" >&6; }
47769
47770cat >>confdefs.h <<_ACEOF
47771#define HAVE_IPV6_FLOWINFO 1
47772_ACEOF
47773
47774cat >>confdefs.h <<_ACEOF
47775#define SOCKS_IPV6_FLOWINFO_LVL IPPROTO_IPV6
47776_ACEOF
47777
47778cat >>confdefs.h <<_ACEOF
47779#define SOCKS_IPV6_FLOWINFO_NAME "ipv6_flowinfo"
47780_ACEOF
47781    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
47782       #ipv4-only
47783
47784cat >>confdefs.h <<_ACEOF
47785#define SOCKS_IPV6_FLOWINFO_IPV4 1
47786_ACEOF
47787
47788cat >>confdefs.h <<_ACEOF
47789#define SOCKS_IPV6_FLOWINFO_IPV6 0
47790_ACEOF
47791    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
47792       #ipv6-only
47793
47794cat >>confdefs.h <<_ACEOF
47795#define SOCKS_IPV6_FLOWINFO_IPV4 0
47796_ACEOF
47797
47798cat >>confdefs.h <<_ACEOF
47799#define SOCKS_IPV6_FLOWINFO_IPV6 1
47800_ACEOF
47801    else
47802       #both ipv4 and ipv6
47803
47804cat >>confdefs.h <<_ACEOF
47805#define SOCKS_IPV6_FLOWINFO_IPV4 1
47806_ACEOF
47807
47808cat >>confdefs.h <<_ACEOF
47809#define SOCKS_IPV6_FLOWINFO_IPV6 1
47810_ACEOF
47811    fi
47812    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_FLOWINFO"
47813  else
47814    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47815$as_echo "no" >&6; }
47816  fi
47817unset _compileok
47818  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_FLOWINFO_SEND" >&5
47819$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_FLOWINFO_SEND... " >&6; }
47820  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47821/* end confdefs.h.  */
47822
47823#include <sys/types.h>
47824#include <sys/socket.h>
47825#include <netinet/in.h>
47826#include <netinet/tcp.h>
47827#include <netinet/udp.h>
47828
47829#include <stdio.h>
47830#include <stdlib.h>
47831#include <unistd.h>
47832
47833int
47834main ()
47835{
47836
47837   socklen_t optlen;
47838   int optval;
47839   int stype;
47840   int ptype;
47841   int s;
47842
47843   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47844      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47845      ptype = IPPROTO_TCP;
47846   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47847      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47848      ptype = IPPROTO_IP;
47849   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47850      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47851      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47852   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47853      stype = SOCK_DGRAM;
47854      ptype = IPPROTO_UDP;
47855   } else {
47856       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47857       exit(1);
47858   }
47859
47860   if((s = socket(PF_INET, stype, ptype)) < 0) {
47861      perror("socket");
47862      exit(1);
47863   }
47864
47865   optval = 1;
47866   optlen = sizeof(optval);
47867   if(setsockopt(s, IPPROTO_IPV6, IPV6_FLOWINFO_SEND, &optval, optlen) < 0) {
47868      perror("setsockopt: IPPROTO_IPV6 IPV6_FLOWINFO_SEND");
47869      close(s);
47870      exit(1);
47871   }
47872  ;
47873  return 0;
47874}
47875_ACEOF
47876if ac_fn_c_try_compile "$LINENO"; then :
47877  _compileok=1
47878fi
47879rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47880
47881  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47882/* end confdefs.h.  */
47883
47884#include <sys/types.h>
47885#include <sys/socket.h>
47886#include <netinet/in.h>
47887#include <netinet/tcp.h>
47888#include <netinet/udp.h>
47889
47890#include <stdio.h>
47891#include <stdlib.h>
47892#include <unistd.h>
47893
47894int
47895main ()
47896{
47897
47898   socklen_t optlen;
47899   int optval;
47900   int stype;
47901   int ptype;
47902   int s;
47903
47904   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
47905      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
47906      ptype = IPPROTO_TCP;
47907   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
47908      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
47909      ptype = IPPROTO_IP;
47910   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
47911      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
47912      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
47913   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
47914      stype = SOCK_DGRAM;
47915      ptype = IPPROTO_UDP;
47916   } else {
47917       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
47918       exit(1);
47919   }
47920
47921   if((s = socket(PF_INET6, stype, ptype)) < 0) {
47922      perror("socket");
47923      exit(1);
47924   }
47925
47926   optval = 1;
47927   optlen = sizeof(optval);
47928   if(setsockopt(s, IPPROTO_IPV6, IPV6_FLOWINFO_SEND, &optval, optlen) < 0) {
47929      perror("setsockopt: IPPROTO_IPV6 IPV6_FLOWINFO_SEND");
47930      close(s);
47931      exit(1);
47932   }
47933  ;
47934  return 0;
47935}
47936_ACEOF
47937if ac_fn_c_try_compile "$LINENO"; then :
47938  _compileok=1
47939fi
47940rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
47941
47942  if test x"${_compileok}" != x; then
47943    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
47944$as_echo "yes" >&6; }
47945
47946cat >>confdefs.h <<_ACEOF
47947#define HAVE_IPV6_FLOWINFO_SEND 1
47948_ACEOF
47949
47950cat >>confdefs.h <<_ACEOF
47951#define SOCKS_IPV6_FLOWINFO_SEND_LVL IPPROTO_IPV6
47952_ACEOF
47953
47954cat >>confdefs.h <<_ACEOF
47955#define SOCKS_IPV6_FLOWINFO_SEND_NAME "ipv6_flowinfo_send"
47956_ACEOF
47957    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
47958       #ipv4-only
47959
47960cat >>confdefs.h <<_ACEOF
47961#define SOCKS_IPV6_FLOWINFO_SEND_IPV4 1
47962_ACEOF
47963
47964cat >>confdefs.h <<_ACEOF
47965#define SOCKS_IPV6_FLOWINFO_SEND_IPV6 0
47966_ACEOF
47967    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
47968       #ipv6-only
47969
47970cat >>confdefs.h <<_ACEOF
47971#define SOCKS_IPV6_FLOWINFO_SEND_IPV4 0
47972_ACEOF
47973
47974cat >>confdefs.h <<_ACEOF
47975#define SOCKS_IPV6_FLOWINFO_SEND_IPV6 1
47976_ACEOF
47977    else
47978       #both ipv4 and ipv6
47979
47980cat >>confdefs.h <<_ACEOF
47981#define SOCKS_IPV6_FLOWINFO_SEND_IPV4 1
47982_ACEOF
47983
47984cat >>confdefs.h <<_ACEOF
47985#define SOCKS_IPV6_FLOWINFO_SEND_IPV6 1
47986_ACEOF
47987    fi
47988    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_FLOWINFO_SEND"
47989  else
47990    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
47991$as_echo "no" >&6; }
47992  fi
47993unset _compileok
47994  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_FLOWLABEL_MGR" >&5
47995$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_FLOWLABEL_MGR... " >&6; }
47996  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
47997/* end confdefs.h.  */
47998
47999#include <sys/types.h>
48000#include <sys/socket.h>
48001#include <netinet/in.h>
48002#include <netinet/tcp.h>
48003#include <netinet/udp.h>
48004
48005#include <stdio.h>
48006#include <stdlib.h>
48007#include <unistd.h>
48008
48009int
48010main ()
48011{
48012
48013   socklen_t optlen;
48014   int optval;
48015   int stype;
48016   int ptype;
48017   int s;
48018
48019   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48020      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48021      ptype = IPPROTO_TCP;
48022   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48023      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48024      ptype = IPPROTO_IP;
48025   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48026      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48027      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48028   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48029      stype = SOCK_DGRAM;
48030      ptype = IPPROTO_UDP;
48031   } else {
48032       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48033       exit(1);
48034   }
48035
48036   if((s = socket(PF_INET, stype, ptype)) < 0) {
48037      perror("socket");
48038      exit(1);
48039   }
48040
48041   optval = 1;
48042   optlen = sizeof(optval);
48043   if(setsockopt(s, IPPROTO_IPV6, IPV6_FLOWLABEL_MGR, &optval, optlen) < 0) {
48044      perror("setsockopt: IPPROTO_IPV6 IPV6_FLOWLABEL_MGR");
48045      close(s);
48046      exit(1);
48047   }
48048  ;
48049  return 0;
48050}
48051_ACEOF
48052if ac_fn_c_try_compile "$LINENO"; then :
48053  _compileok=1
48054fi
48055rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48056
48057  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48058/* end confdefs.h.  */
48059
48060#include <sys/types.h>
48061#include <sys/socket.h>
48062#include <netinet/in.h>
48063#include <netinet/tcp.h>
48064#include <netinet/udp.h>
48065
48066#include <stdio.h>
48067#include <stdlib.h>
48068#include <unistd.h>
48069
48070int
48071main ()
48072{
48073
48074   socklen_t optlen;
48075   int optval;
48076   int stype;
48077   int ptype;
48078   int s;
48079
48080   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48081      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48082      ptype = IPPROTO_TCP;
48083   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48084      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48085      ptype = IPPROTO_IP;
48086   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48087      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48088      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48089   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48090      stype = SOCK_DGRAM;
48091      ptype = IPPROTO_UDP;
48092   } else {
48093       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48094       exit(1);
48095   }
48096
48097   if((s = socket(PF_INET6, stype, ptype)) < 0) {
48098      perror("socket");
48099      exit(1);
48100   }
48101
48102   optval = 1;
48103   optlen = sizeof(optval);
48104   if(setsockopt(s, IPPROTO_IPV6, IPV6_FLOWLABEL_MGR, &optval, optlen) < 0) {
48105      perror("setsockopt: IPPROTO_IPV6 IPV6_FLOWLABEL_MGR");
48106      close(s);
48107      exit(1);
48108   }
48109  ;
48110  return 0;
48111}
48112_ACEOF
48113if ac_fn_c_try_compile "$LINENO"; then :
48114  _compileok=1
48115fi
48116rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48117
48118  if test x"${_compileok}" != x; then
48119    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
48120$as_echo "yes" >&6; }
48121
48122cat >>confdefs.h <<_ACEOF
48123#define HAVE_IPV6_FLOWLABEL_MGR 1
48124_ACEOF
48125
48126cat >>confdefs.h <<_ACEOF
48127#define SOCKS_IPV6_FLOWLABEL_MGR_LVL IPPROTO_IPV6
48128_ACEOF
48129
48130cat >>confdefs.h <<_ACEOF
48131#define SOCKS_IPV6_FLOWLABEL_MGR_NAME "ipv6_flowlabel_mgr"
48132_ACEOF
48133    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
48134       #ipv4-only
48135
48136cat >>confdefs.h <<_ACEOF
48137#define SOCKS_IPV6_FLOWLABEL_MGR_IPV4 1
48138_ACEOF
48139
48140cat >>confdefs.h <<_ACEOF
48141#define SOCKS_IPV6_FLOWLABEL_MGR_IPV6 0
48142_ACEOF
48143    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
48144       #ipv6-only
48145
48146cat >>confdefs.h <<_ACEOF
48147#define SOCKS_IPV6_FLOWLABEL_MGR_IPV4 0
48148_ACEOF
48149
48150cat >>confdefs.h <<_ACEOF
48151#define SOCKS_IPV6_FLOWLABEL_MGR_IPV6 1
48152_ACEOF
48153    else
48154       #both ipv4 and ipv6
48155
48156cat >>confdefs.h <<_ACEOF
48157#define SOCKS_IPV6_FLOWLABEL_MGR_IPV4 1
48158_ACEOF
48159
48160cat >>confdefs.h <<_ACEOF
48161#define SOCKS_IPV6_FLOWLABEL_MGR_IPV6 1
48162_ACEOF
48163    fi
48164    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_FLOWLABEL_MGR"
48165  else
48166    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
48167$as_echo "no" >&6; }
48168  fi
48169unset _compileok
48170  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_HOPLIMIT" >&5
48171$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_HOPLIMIT... " >&6; }
48172  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48173/* end confdefs.h.  */
48174
48175#include <sys/types.h>
48176#include <sys/socket.h>
48177#include <netinet/in.h>
48178#include <netinet/tcp.h>
48179#include <netinet/udp.h>
48180
48181#include <stdio.h>
48182#include <stdlib.h>
48183#include <unistd.h>
48184
48185int
48186main ()
48187{
48188
48189   socklen_t optlen;
48190   int optval;
48191   int stype;
48192   int ptype;
48193   int s;
48194
48195   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48196      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48197      ptype = IPPROTO_TCP;
48198   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48199      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48200      ptype = IPPROTO_IP;
48201   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48202      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48203      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48204   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48205      stype = SOCK_DGRAM;
48206      ptype = IPPROTO_UDP;
48207   } else {
48208       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48209       exit(1);
48210   }
48211
48212   if((s = socket(PF_INET, stype, ptype)) < 0) {
48213      perror("socket");
48214      exit(1);
48215   }
48216
48217   optval = 1;
48218   optlen = sizeof(optval);
48219   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval, optlen) < 0) {
48220      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPLIMIT");
48221      close(s);
48222      exit(1);
48223   }
48224  ;
48225  return 0;
48226}
48227_ACEOF
48228if ac_fn_c_try_compile "$LINENO"; then :
48229  _compileok=1
48230fi
48231rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48232
48233  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48234/* end confdefs.h.  */
48235
48236#include <sys/types.h>
48237#include <sys/socket.h>
48238#include <netinet/in.h>
48239#include <netinet/tcp.h>
48240#include <netinet/udp.h>
48241
48242#include <stdio.h>
48243#include <stdlib.h>
48244#include <unistd.h>
48245
48246int
48247main ()
48248{
48249
48250   socklen_t optlen;
48251   int optval;
48252   int stype;
48253   int ptype;
48254   int s;
48255
48256   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48257      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48258      ptype = IPPROTO_TCP;
48259   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48260      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48261      ptype = IPPROTO_IP;
48262   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48263      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48264      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48265   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48266      stype = SOCK_DGRAM;
48267      ptype = IPPROTO_UDP;
48268   } else {
48269       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48270       exit(1);
48271   }
48272
48273   if((s = socket(PF_INET6, stype, ptype)) < 0) {
48274      perror("socket");
48275      exit(1);
48276   }
48277
48278   optval = 1;
48279   optlen = sizeof(optval);
48280   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval, optlen) < 0) {
48281      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPLIMIT");
48282      close(s);
48283      exit(1);
48284   }
48285  ;
48286  return 0;
48287}
48288_ACEOF
48289if ac_fn_c_try_compile "$LINENO"; then :
48290  _compileok=1
48291fi
48292rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48293
48294  if test x"${_compileok}" != x; then
48295    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
48296$as_echo "yes" >&6; }
48297
48298cat >>confdefs.h <<_ACEOF
48299#define HAVE_IPV6_HOPLIMIT 1
48300_ACEOF
48301
48302cat >>confdefs.h <<_ACEOF
48303#define SOCKS_IPV6_HOPLIMIT_LVL IPPROTO_IPV6
48304_ACEOF
48305
48306cat >>confdefs.h <<_ACEOF
48307#define SOCKS_IPV6_HOPLIMIT_NAME "ipv6_hoplimit"
48308_ACEOF
48309    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
48310       #ipv4-only
48311
48312cat >>confdefs.h <<_ACEOF
48313#define SOCKS_IPV6_HOPLIMIT_IPV4 1
48314_ACEOF
48315
48316cat >>confdefs.h <<_ACEOF
48317#define SOCKS_IPV6_HOPLIMIT_IPV6 0
48318_ACEOF
48319    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
48320       #ipv6-only
48321
48322cat >>confdefs.h <<_ACEOF
48323#define SOCKS_IPV6_HOPLIMIT_IPV4 0
48324_ACEOF
48325
48326cat >>confdefs.h <<_ACEOF
48327#define SOCKS_IPV6_HOPLIMIT_IPV6 1
48328_ACEOF
48329    else
48330       #both ipv4 and ipv6
48331
48332cat >>confdefs.h <<_ACEOF
48333#define SOCKS_IPV6_HOPLIMIT_IPV4 1
48334_ACEOF
48335
48336cat >>confdefs.h <<_ACEOF
48337#define SOCKS_IPV6_HOPLIMIT_IPV6 1
48338_ACEOF
48339    fi
48340    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_HOPLIMIT"
48341  else
48342    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
48343$as_echo "no" >&6; }
48344  fi
48345unset _compileok
48346  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_HOPLIMIT" >&5
48347$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_HOPLIMIT... " >&6; }
48348  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48349/* end confdefs.h.  */
48350
48351#include <sys/types.h>
48352#include <sys/socket.h>
48353#include <netinet/in.h>
48354#include <netinet/tcp.h>
48355#include <netinet/udp.h>
48356
48357#include <stdio.h>
48358#include <stdlib.h>
48359#include <unistd.h>
48360
48361int
48362main ()
48363{
48364
48365   socklen_t optlen;
48366   int optval;
48367   int stype;
48368   int ptype;
48369   int s;
48370
48371   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48372      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48373      ptype = IPPROTO_TCP;
48374   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48375      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48376      ptype = IPPROTO_IP;
48377   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48378      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48379      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48380   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48381      stype = SOCK_DGRAM;
48382      ptype = IPPROTO_UDP;
48383   } else {
48384       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48385       exit(1);
48386   }
48387
48388   if((s = socket(PF_INET, stype, ptype)) < 0) {
48389      perror("socket");
48390      exit(1);
48391   }
48392
48393   optval = 1;
48394   optlen = sizeof(optval);
48395   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval, optlen) < 0) {
48396      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPLIMIT");
48397      close(s);
48398      exit(1);
48399   }
48400  ;
48401  return 0;
48402}
48403_ACEOF
48404if ac_fn_c_try_compile "$LINENO"; then :
48405  _compileok=1
48406fi
48407rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48408
48409  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48410/* end confdefs.h.  */
48411
48412#include <sys/types.h>
48413#include <sys/socket.h>
48414#include <netinet/in.h>
48415#include <netinet/tcp.h>
48416#include <netinet/udp.h>
48417
48418#include <stdio.h>
48419#include <stdlib.h>
48420#include <unistd.h>
48421
48422int
48423main ()
48424{
48425
48426   socklen_t optlen;
48427   int optval;
48428   int stype;
48429   int ptype;
48430   int s;
48431
48432   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48433      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48434      ptype = IPPROTO_TCP;
48435   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48436      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48437      ptype = IPPROTO_IP;
48438   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48439      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48440      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48441   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48442      stype = SOCK_DGRAM;
48443      ptype = IPPROTO_UDP;
48444   } else {
48445       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48446       exit(1);
48447   }
48448
48449   if((s = socket(PF_INET6, stype, ptype)) < 0) {
48450      perror("socket");
48451      exit(1);
48452   }
48453
48454   optval = 1;
48455   optlen = sizeof(optval);
48456   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPLIMIT, &optval, optlen) < 0) {
48457      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPLIMIT");
48458      close(s);
48459      exit(1);
48460   }
48461  ;
48462  return 0;
48463}
48464_ACEOF
48465if ac_fn_c_try_compile "$LINENO"; then :
48466  _compileok=1
48467fi
48468rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48469
48470  if test x"${_compileok}" != x; then
48471    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
48472$as_echo "yes" >&6; }
48473
48474cat >>confdefs.h <<_ACEOF
48475#define HAVE_IPV6_HOPLIMIT 1
48476_ACEOF
48477
48478cat >>confdefs.h <<_ACEOF
48479#define SOCKS_IPV6_HOPLIMIT_LVL IPPROTO_IPV6
48480_ACEOF
48481
48482cat >>confdefs.h <<_ACEOF
48483#define SOCKS_IPV6_HOPLIMIT_NAME "ipv6_hoplimit"
48484_ACEOF
48485    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
48486       #ipv4-only
48487
48488cat >>confdefs.h <<_ACEOF
48489#define SOCKS_IPV6_HOPLIMIT_IPV4 1
48490_ACEOF
48491
48492cat >>confdefs.h <<_ACEOF
48493#define SOCKS_IPV6_HOPLIMIT_IPV6 0
48494_ACEOF
48495    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
48496       #ipv6-only
48497
48498cat >>confdefs.h <<_ACEOF
48499#define SOCKS_IPV6_HOPLIMIT_IPV4 0
48500_ACEOF
48501
48502cat >>confdefs.h <<_ACEOF
48503#define SOCKS_IPV6_HOPLIMIT_IPV6 1
48504_ACEOF
48505    else
48506       #both ipv4 and ipv6
48507
48508cat >>confdefs.h <<_ACEOF
48509#define SOCKS_IPV6_HOPLIMIT_IPV4 1
48510_ACEOF
48511
48512cat >>confdefs.h <<_ACEOF
48513#define SOCKS_IPV6_HOPLIMIT_IPV6 1
48514_ACEOF
48515    fi
48516    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_HOPLIMIT"
48517  else
48518    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
48519$as_echo "no" >&6; }
48520  fi
48521unset _compileok
48522  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_HOPOPTS" >&5
48523$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_HOPOPTS... " >&6; }
48524  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48525/* end confdefs.h.  */
48526
48527#include <sys/types.h>
48528#include <sys/socket.h>
48529#include <netinet/in.h>
48530#include <netinet/tcp.h>
48531#include <netinet/udp.h>
48532
48533#include <stdio.h>
48534#include <stdlib.h>
48535#include <unistd.h>
48536
48537int
48538main ()
48539{
48540
48541   socklen_t optlen;
48542   int optval;
48543   int stype;
48544   int ptype;
48545   int s;
48546
48547   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48548      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48549      ptype = IPPROTO_TCP;
48550   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48551      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48552      ptype = IPPROTO_IP;
48553   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48554      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48555      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48556   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48557      stype = SOCK_DGRAM;
48558      ptype = IPPROTO_UDP;
48559   } else {
48560       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48561       exit(1);
48562   }
48563
48564   if((s = socket(PF_INET, stype, ptype)) < 0) {
48565      perror("socket");
48566      exit(1);
48567   }
48568
48569   optval = 1;
48570   optlen = sizeof(optval);
48571   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPOPTS, &optval, optlen) < 0) {
48572      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPOPTS");
48573      close(s);
48574      exit(1);
48575   }
48576  ;
48577  return 0;
48578}
48579_ACEOF
48580if ac_fn_c_try_compile "$LINENO"; then :
48581  _compileok=1
48582fi
48583rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48584
48585  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48586/* end confdefs.h.  */
48587
48588#include <sys/types.h>
48589#include <sys/socket.h>
48590#include <netinet/in.h>
48591#include <netinet/tcp.h>
48592#include <netinet/udp.h>
48593
48594#include <stdio.h>
48595#include <stdlib.h>
48596#include <unistd.h>
48597
48598int
48599main ()
48600{
48601
48602   socklen_t optlen;
48603   int optval;
48604   int stype;
48605   int ptype;
48606   int s;
48607
48608   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48609      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48610      ptype = IPPROTO_TCP;
48611   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48612      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48613      ptype = IPPROTO_IP;
48614   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48615      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48616      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48617   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48618      stype = SOCK_DGRAM;
48619      ptype = IPPROTO_UDP;
48620   } else {
48621       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48622       exit(1);
48623   }
48624
48625   if((s = socket(PF_INET6, stype, ptype)) < 0) {
48626      perror("socket");
48627      exit(1);
48628   }
48629
48630   optval = 1;
48631   optlen = sizeof(optval);
48632   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPOPTS, &optval, optlen) < 0) {
48633      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPOPTS");
48634      close(s);
48635      exit(1);
48636   }
48637  ;
48638  return 0;
48639}
48640_ACEOF
48641if ac_fn_c_try_compile "$LINENO"; then :
48642  _compileok=1
48643fi
48644rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48645
48646  if test x"${_compileok}" != x; then
48647    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
48648$as_echo "yes" >&6; }
48649
48650cat >>confdefs.h <<_ACEOF
48651#define HAVE_IPV6_HOPOPTS 1
48652_ACEOF
48653
48654cat >>confdefs.h <<_ACEOF
48655#define SOCKS_IPV6_HOPOPTS_LVL IPPROTO_IPV6
48656_ACEOF
48657
48658cat >>confdefs.h <<_ACEOF
48659#define SOCKS_IPV6_HOPOPTS_NAME "ipv6_hopopts"
48660_ACEOF
48661    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
48662       #ipv4-only
48663
48664cat >>confdefs.h <<_ACEOF
48665#define SOCKS_IPV6_HOPOPTS_IPV4 1
48666_ACEOF
48667
48668cat >>confdefs.h <<_ACEOF
48669#define SOCKS_IPV6_HOPOPTS_IPV6 0
48670_ACEOF
48671    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
48672       #ipv6-only
48673
48674cat >>confdefs.h <<_ACEOF
48675#define SOCKS_IPV6_HOPOPTS_IPV4 0
48676_ACEOF
48677
48678cat >>confdefs.h <<_ACEOF
48679#define SOCKS_IPV6_HOPOPTS_IPV6 1
48680_ACEOF
48681    else
48682       #both ipv4 and ipv6
48683
48684cat >>confdefs.h <<_ACEOF
48685#define SOCKS_IPV6_HOPOPTS_IPV4 1
48686_ACEOF
48687
48688cat >>confdefs.h <<_ACEOF
48689#define SOCKS_IPV6_HOPOPTS_IPV6 1
48690_ACEOF
48691    fi
48692    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_HOPOPTS"
48693  else
48694    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
48695$as_echo "no" >&6; }
48696  fi
48697unset _compileok
48698  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_HOPOPTS" >&5
48699$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_HOPOPTS... " >&6; }
48700  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48701/* end confdefs.h.  */
48702
48703#include <sys/types.h>
48704#include <sys/socket.h>
48705#include <netinet/in.h>
48706#include <netinet/tcp.h>
48707#include <netinet/udp.h>
48708
48709#include <stdio.h>
48710#include <stdlib.h>
48711#include <unistd.h>
48712
48713int
48714main ()
48715{
48716
48717   socklen_t optlen;
48718   int optval;
48719   int stype;
48720   int ptype;
48721   int s;
48722
48723   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48724      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48725      ptype = IPPROTO_TCP;
48726   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48727      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48728      ptype = IPPROTO_IP;
48729   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48730      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48731      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48732   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48733      stype = SOCK_DGRAM;
48734      ptype = IPPROTO_UDP;
48735   } else {
48736       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48737       exit(1);
48738   }
48739
48740   if((s = socket(PF_INET, stype, ptype)) < 0) {
48741      perror("socket");
48742      exit(1);
48743   }
48744
48745   optval = 1;
48746   optlen = sizeof(optval);
48747   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPOPTS, &optval, optlen) < 0) {
48748      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPOPTS");
48749      close(s);
48750      exit(1);
48751   }
48752  ;
48753  return 0;
48754}
48755_ACEOF
48756if ac_fn_c_try_compile "$LINENO"; then :
48757  _compileok=1
48758fi
48759rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48760
48761  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48762/* end confdefs.h.  */
48763
48764#include <sys/types.h>
48765#include <sys/socket.h>
48766#include <netinet/in.h>
48767#include <netinet/tcp.h>
48768#include <netinet/udp.h>
48769
48770#include <stdio.h>
48771#include <stdlib.h>
48772#include <unistd.h>
48773
48774int
48775main ()
48776{
48777
48778   socklen_t optlen;
48779   int optval;
48780   int stype;
48781   int ptype;
48782   int s;
48783
48784   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48785      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48786      ptype = IPPROTO_TCP;
48787   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48788      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48789      ptype = IPPROTO_IP;
48790   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48791      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48792      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48793   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48794      stype = SOCK_DGRAM;
48795      ptype = IPPROTO_UDP;
48796   } else {
48797       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48798       exit(1);
48799   }
48800
48801   if((s = socket(PF_INET6, stype, ptype)) < 0) {
48802      perror("socket");
48803      exit(1);
48804   }
48805
48806   optval = 1;
48807   optlen = sizeof(optval);
48808   if(setsockopt(s, IPPROTO_IPV6, IPV6_HOPOPTS, &optval, optlen) < 0) {
48809      perror("setsockopt: IPPROTO_IPV6 IPV6_HOPOPTS");
48810      close(s);
48811      exit(1);
48812   }
48813  ;
48814  return 0;
48815}
48816_ACEOF
48817if ac_fn_c_try_compile "$LINENO"; then :
48818  _compileok=1
48819fi
48820rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48821
48822  if test x"${_compileok}" != x; then
48823    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
48824$as_echo "yes" >&6; }
48825
48826cat >>confdefs.h <<_ACEOF
48827#define HAVE_IPV6_HOPOPTS 1
48828_ACEOF
48829
48830cat >>confdefs.h <<_ACEOF
48831#define SOCKS_IPV6_HOPOPTS_LVL IPPROTO_IPV6
48832_ACEOF
48833
48834cat >>confdefs.h <<_ACEOF
48835#define SOCKS_IPV6_HOPOPTS_NAME "ipv6_hopopts"
48836_ACEOF
48837    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
48838       #ipv4-only
48839
48840cat >>confdefs.h <<_ACEOF
48841#define SOCKS_IPV6_HOPOPTS_IPV4 1
48842_ACEOF
48843
48844cat >>confdefs.h <<_ACEOF
48845#define SOCKS_IPV6_HOPOPTS_IPV6 0
48846_ACEOF
48847    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
48848       #ipv6-only
48849
48850cat >>confdefs.h <<_ACEOF
48851#define SOCKS_IPV6_HOPOPTS_IPV4 0
48852_ACEOF
48853
48854cat >>confdefs.h <<_ACEOF
48855#define SOCKS_IPV6_HOPOPTS_IPV6 1
48856_ACEOF
48857    else
48858       #both ipv4 and ipv6
48859
48860cat >>confdefs.h <<_ACEOF
48861#define SOCKS_IPV6_HOPOPTS_IPV4 1
48862_ACEOF
48863
48864cat >>confdefs.h <<_ACEOF
48865#define SOCKS_IPV6_HOPOPTS_IPV6 1
48866_ACEOF
48867    fi
48868    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_HOPOPTS"
48869  else
48870    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
48871$as_echo "no" >&6; }
48872  fi
48873unset _compileok
48874  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_IPCOMP_LEVEL" >&5
48875$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_IPCOMP_LEVEL... " >&6; }
48876  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48877/* end confdefs.h.  */
48878
48879#include <sys/types.h>
48880#include <sys/socket.h>
48881#include <netinet/in.h>
48882#include <netinet/tcp.h>
48883#include <netinet/udp.h>
48884
48885#include <stdio.h>
48886#include <stdlib.h>
48887#include <unistd.h>
48888
48889int
48890main ()
48891{
48892
48893   socklen_t optlen;
48894   int optval;
48895   int stype;
48896   int ptype;
48897   int s;
48898
48899   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48900      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48901      ptype = IPPROTO_TCP;
48902   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48903      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48904      ptype = IPPROTO_IP;
48905   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48906      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48907      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48908   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48909      stype = SOCK_DGRAM;
48910      ptype = IPPROTO_UDP;
48911   } else {
48912       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48913       exit(1);
48914   }
48915
48916   if((s = socket(PF_INET, stype, ptype)) < 0) {
48917      perror("socket");
48918      exit(1);
48919   }
48920
48921   optval = 1;
48922   optlen = sizeof(optval);
48923   if(setsockopt(s, IPPROTO_IPV6, IPV6_IPCOMP_LEVEL, &optval, optlen) < 0) {
48924      perror("setsockopt: IPPROTO_IPV6 IPV6_IPCOMP_LEVEL");
48925      close(s);
48926      exit(1);
48927   }
48928  ;
48929  return 0;
48930}
48931_ACEOF
48932if ac_fn_c_try_compile "$LINENO"; then :
48933  _compileok=1
48934fi
48935rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48936
48937  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
48938/* end confdefs.h.  */
48939
48940#include <sys/types.h>
48941#include <sys/socket.h>
48942#include <netinet/in.h>
48943#include <netinet/tcp.h>
48944#include <netinet/udp.h>
48945
48946#include <stdio.h>
48947#include <stdlib.h>
48948#include <unistd.h>
48949
48950int
48951main ()
48952{
48953
48954   socklen_t optlen;
48955   int optval;
48956   int stype;
48957   int ptype;
48958   int s;
48959
48960   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
48961      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
48962      ptype = IPPROTO_TCP;
48963   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
48964      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
48965      ptype = IPPROTO_IP;
48966   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
48967      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
48968      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
48969   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
48970      stype = SOCK_DGRAM;
48971      ptype = IPPROTO_UDP;
48972   } else {
48973       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
48974       exit(1);
48975   }
48976
48977   if((s = socket(PF_INET6, stype, ptype)) < 0) {
48978      perror("socket");
48979      exit(1);
48980   }
48981
48982   optval = 1;
48983   optlen = sizeof(optval);
48984   if(setsockopt(s, IPPROTO_IPV6, IPV6_IPCOMP_LEVEL, &optval, optlen) < 0) {
48985      perror("setsockopt: IPPROTO_IPV6 IPV6_IPCOMP_LEVEL");
48986      close(s);
48987      exit(1);
48988   }
48989  ;
48990  return 0;
48991}
48992_ACEOF
48993if ac_fn_c_try_compile "$LINENO"; then :
48994  _compileok=1
48995fi
48996rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
48997
48998  if test x"${_compileok}" != x; then
48999    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
49000$as_echo "yes" >&6; }
49001
49002cat >>confdefs.h <<_ACEOF
49003#define HAVE_IPV6_IPCOMP_LEVEL 1
49004_ACEOF
49005
49006cat >>confdefs.h <<_ACEOF
49007#define SOCKS_IPV6_IPCOMP_LEVEL_LVL IPPROTO_IPV6
49008_ACEOF
49009
49010cat >>confdefs.h <<_ACEOF
49011#define SOCKS_IPV6_IPCOMP_LEVEL_NAME "ipv6_ipcomp_level"
49012_ACEOF
49013    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
49014       #ipv4-only
49015
49016cat >>confdefs.h <<_ACEOF
49017#define SOCKS_IPV6_IPCOMP_LEVEL_IPV4 1
49018_ACEOF
49019
49020cat >>confdefs.h <<_ACEOF
49021#define SOCKS_IPV6_IPCOMP_LEVEL_IPV6 0
49022_ACEOF
49023    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
49024       #ipv6-only
49025
49026cat >>confdefs.h <<_ACEOF
49027#define SOCKS_IPV6_IPCOMP_LEVEL_IPV4 0
49028_ACEOF
49029
49030cat >>confdefs.h <<_ACEOF
49031#define SOCKS_IPV6_IPCOMP_LEVEL_IPV6 1
49032_ACEOF
49033    else
49034       #both ipv4 and ipv6
49035
49036cat >>confdefs.h <<_ACEOF
49037#define SOCKS_IPV6_IPCOMP_LEVEL_IPV4 1
49038_ACEOF
49039
49040cat >>confdefs.h <<_ACEOF
49041#define SOCKS_IPV6_IPCOMP_LEVEL_IPV6 1
49042_ACEOF
49043    fi
49044    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_IPCOMP_LEVEL"
49045  else
49046    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49047$as_echo "no" >&6; }
49048  fi
49049unset _compileok
49050  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_IPSEC_POLICY" >&5
49051$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_IPSEC_POLICY... " >&6; }
49052  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49053/* end confdefs.h.  */
49054
49055#include <sys/types.h>
49056#include <sys/socket.h>
49057#include <netinet/in.h>
49058#include <netinet/tcp.h>
49059#include <netinet/udp.h>
49060
49061#include <stdio.h>
49062#include <stdlib.h>
49063#include <unistd.h>
49064
49065int
49066main ()
49067{
49068
49069   socklen_t optlen;
49070   int optval;
49071   int stype;
49072   int ptype;
49073   int s;
49074
49075   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49076      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49077      ptype = IPPROTO_TCP;
49078   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49079      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49080      ptype = IPPROTO_IP;
49081   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49082      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49083      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49084   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49085      stype = SOCK_DGRAM;
49086      ptype = IPPROTO_UDP;
49087   } else {
49088       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49089       exit(1);
49090   }
49091
49092   if((s = socket(PF_INET, stype, ptype)) < 0) {
49093      perror("socket");
49094      exit(1);
49095   }
49096
49097   optval = 1;
49098   optlen = sizeof(optval);
49099   if(setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY, &optval, optlen) < 0) {
49100      perror("setsockopt: IPPROTO_IPV6 IPV6_IPSEC_POLICY");
49101      close(s);
49102      exit(1);
49103   }
49104  ;
49105  return 0;
49106}
49107_ACEOF
49108if ac_fn_c_try_compile "$LINENO"; then :
49109  _compileok=1
49110fi
49111rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49112
49113  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49114/* end confdefs.h.  */
49115
49116#include <sys/types.h>
49117#include <sys/socket.h>
49118#include <netinet/in.h>
49119#include <netinet/tcp.h>
49120#include <netinet/udp.h>
49121
49122#include <stdio.h>
49123#include <stdlib.h>
49124#include <unistd.h>
49125
49126int
49127main ()
49128{
49129
49130   socklen_t optlen;
49131   int optval;
49132   int stype;
49133   int ptype;
49134   int s;
49135
49136   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49137      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49138      ptype = IPPROTO_TCP;
49139   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49140      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49141      ptype = IPPROTO_IP;
49142   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49143      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49144      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49145   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49146      stype = SOCK_DGRAM;
49147      ptype = IPPROTO_UDP;
49148   } else {
49149       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49150       exit(1);
49151   }
49152
49153   if((s = socket(PF_INET6, stype, ptype)) < 0) {
49154      perror("socket");
49155      exit(1);
49156   }
49157
49158   optval = 1;
49159   optlen = sizeof(optval);
49160   if(setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY, &optval, optlen) < 0) {
49161      perror("setsockopt: IPPROTO_IPV6 IPV6_IPSEC_POLICY");
49162      close(s);
49163      exit(1);
49164   }
49165  ;
49166  return 0;
49167}
49168_ACEOF
49169if ac_fn_c_try_compile "$LINENO"; then :
49170  _compileok=1
49171fi
49172rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49173
49174  if test x"${_compileok}" != x; then
49175    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
49176$as_echo "yes" >&6; }
49177
49178cat >>confdefs.h <<_ACEOF
49179#define HAVE_IPV6_IPSEC_POLICY 1
49180_ACEOF
49181
49182cat >>confdefs.h <<_ACEOF
49183#define SOCKS_IPV6_IPSEC_POLICY_LVL IPPROTO_IPV6
49184_ACEOF
49185
49186cat >>confdefs.h <<_ACEOF
49187#define SOCKS_IPV6_IPSEC_POLICY_NAME "ipv6_ipsec_policy"
49188_ACEOF
49189    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
49190       #ipv4-only
49191
49192cat >>confdefs.h <<_ACEOF
49193#define SOCKS_IPV6_IPSEC_POLICY_IPV4 1
49194_ACEOF
49195
49196cat >>confdefs.h <<_ACEOF
49197#define SOCKS_IPV6_IPSEC_POLICY_IPV6 0
49198_ACEOF
49199    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
49200       #ipv6-only
49201
49202cat >>confdefs.h <<_ACEOF
49203#define SOCKS_IPV6_IPSEC_POLICY_IPV4 0
49204_ACEOF
49205
49206cat >>confdefs.h <<_ACEOF
49207#define SOCKS_IPV6_IPSEC_POLICY_IPV6 1
49208_ACEOF
49209    else
49210       #both ipv4 and ipv6
49211
49212cat >>confdefs.h <<_ACEOF
49213#define SOCKS_IPV6_IPSEC_POLICY_IPV4 1
49214_ACEOF
49215
49216cat >>confdefs.h <<_ACEOF
49217#define SOCKS_IPV6_IPSEC_POLICY_IPV6 1
49218_ACEOF
49219    fi
49220    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_IPSEC_POLICY"
49221  else
49222    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49223$as_echo "no" >&6; }
49224  fi
49225unset _compileok
49226  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_JOIN_ANYCAST" >&5
49227$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_JOIN_ANYCAST... " >&6; }
49228  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49229/* end confdefs.h.  */
49230
49231#include <sys/types.h>
49232#include <sys/socket.h>
49233#include <netinet/in.h>
49234#include <netinet/tcp.h>
49235#include <netinet/udp.h>
49236
49237#include <stdio.h>
49238#include <stdlib.h>
49239#include <unistd.h>
49240
49241int
49242main ()
49243{
49244
49245   socklen_t optlen;
49246   int optval;
49247   int stype;
49248   int ptype;
49249   int s;
49250
49251   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49252      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49253      ptype = IPPROTO_TCP;
49254   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49255      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49256      ptype = IPPROTO_IP;
49257   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49258      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49259      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49260   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49261      stype = SOCK_DGRAM;
49262      ptype = IPPROTO_UDP;
49263   } else {
49264       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49265       exit(1);
49266   }
49267
49268   if((s = socket(PF_INET, stype, ptype)) < 0) {
49269      perror("socket");
49270      exit(1);
49271   }
49272
49273   optval = 1;
49274   optlen = sizeof(optval);
49275   if(setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_ANYCAST, &optval, optlen) < 0) {
49276      perror("setsockopt: IPPROTO_IPV6 IPV6_JOIN_ANYCAST");
49277      close(s);
49278      exit(1);
49279   }
49280  ;
49281  return 0;
49282}
49283_ACEOF
49284if ac_fn_c_try_compile "$LINENO"; then :
49285  _compileok=1
49286fi
49287rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49288
49289  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49290/* end confdefs.h.  */
49291
49292#include <sys/types.h>
49293#include <sys/socket.h>
49294#include <netinet/in.h>
49295#include <netinet/tcp.h>
49296#include <netinet/udp.h>
49297
49298#include <stdio.h>
49299#include <stdlib.h>
49300#include <unistd.h>
49301
49302int
49303main ()
49304{
49305
49306   socklen_t optlen;
49307   int optval;
49308   int stype;
49309   int ptype;
49310   int s;
49311
49312   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49313      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49314      ptype = IPPROTO_TCP;
49315   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49316      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49317      ptype = IPPROTO_IP;
49318   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49319      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49320      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49321   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49322      stype = SOCK_DGRAM;
49323      ptype = IPPROTO_UDP;
49324   } else {
49325       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49326       exit(1);
49327   }
49328
49329   if((s = socket(PF_INET6, stype, ptype)) < 0) {
49330      perror("socket");
49331      exit(1);
49332   }
49333
49334   optval = 1;
49335   optlen = sizeof(optval);
49336   if(setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_ANYCAST, &optval, optlen) < 0) {
49337      perror("setsockopt: IPPROTO_IPV6 IPV6_JOIN_ANYCAST");
49338      close(s);
49339      exit(1);
49340   }
49341  ;
49342  return 0;
49343}
49344_ACEOF
49345if ac_fn_c_try_compile "$LINENO"; then :
49346  _compileok=1
49347fi
49348rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49349
49350  if test x"${_compileok}" != x; then
49351    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
49352$as_echo "yes" >&6; }
49353
49354cat >>confdefs.h <<_ACEOF
49355#define HAVE_IPV6_JOIN_ANYCAST 1
49356_ACEOF
49357
49358cat >>confdefs.h <<_ACEOF
49359#define SOCKS_IPV6_JOIN_ANYCAST_LVL IPPROTO_IPV6
49360_ACEOF
49361
49362cat >>confdefs.h <<_ACEOF
49363#define SOCKS_IPV6_JOIN_ANYCAST_NAME "ipv6_join_anycast"
49364_ACEOF
49365    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
49366       #ipv4-only
49367
49368cat >>confdefs.h <<_ACEOF
49369#define SOCKS_IPV6_JOIN_ANYCAST_IPV4 1
49370_ACEOF
49371
49372cat >>confdefs.h <<_ACEOF
49373#define SOCKS_IPV6_JOIN_ANYCAST_IPV6 0
49374_ACEOF
49375    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
49376       #ipv6-only
49377
49378cat >>confdefs.h <<_ACEOF
49379#define SOCKS_IPV6_JOIN_ANYCAST_IPV4 0
49380_ACEOF
49381
49382cat >>confdefs.h <<_ACEOF
49383#define SOCKS_IPV6_JOIN_ANYCAST_IPV6 1
49384_ACEOF
49385    else
49386       #both ipv4 and ipv6
49387
49388cat >>confdefs.h <<_ACEOF
49389#define SOCKS_IPV6_JOIN_ANYCAST_IPV4 1
49390_ACEOF
49391
49392cat >>confdefs.h <<_ACEOF
49393#define SOCKS_IPV6_JOIN_ANYCAST_IPV6 1
49394_ACEOF
49395    fi
49396    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_JOIN_ANYCAST"
49397  else
49398    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49399$as_echo "no" >&6; }
49400  fi
49401unset _compileok
49402  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_JOIN_GROUP" >&5
49403$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_JOIN_GROUP... " >&6; }
49404  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49405/* end confdefs.h.  */
49406
49407#include <sys/types.h>
49408#include <sys/socket.h>
49409#include <netinet/in.h>
49410#include <netinet/tcp.h>
49411#include <netinet/udp.h>
49412
49413#include <stdio.h>
49414#include <stdlib.h>
49415#include <unistd.h>
49416
49417int
49418main ()
49419{
49420
49421   socklen_t optlen;
49422   int optval;
49423   int stype;
49424   int ptype;
49425   int s;
49426
49427   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49428      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49429      ptype = IPPROTO_TCP;
49430   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49431      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49432      ptype = IPPROTO_IP;
49433   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49434      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49435      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49436   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49437      stype = SOCK_DGRAM;
49438      ptype = IPPROTO_UDP;
49439   } else {
49440       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49441       exit(1);
49442   }
49443
49444   if((s = socket(PF_INET, stype, ptype)) < 0) {
49445      perror("socket");
49446      exit(1);
49447   }
49448
49449   optval = 1;
49450   optlen = sizeof(optval);
49451   if(setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, &optval, optlen) < 0) {
49452      perror("setsockopt: IPPROTO_IPV6 IPV6_JOIN_GROUP");
49453      close(s);
49454      exit(1);
49455   }
49456  ;
49457  return 0;
49458}
49459_ACEOF
49460if ac_fn_c_try_compile "$LINENO"; then :
49461  _compileok=1
49462fi
49463rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49464
49465  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49466/* end confdefs.h.  */
49467
49468#include <sys/types.h>
49469#include <sys/socket.h>
49470#include <netinet/in.h>
49471#include <netinet/tcp.h>
49472#include <netinet/udp.h>
49473
49474#include <stdio.h>
49475#include <stdlib.h>
49476#include <unistd.h>
49477
49478int
49479main ()
49480{
49481
49482   socklen_t optlen;
49483   int optval;
49484   int stype;
49485   int ptype;
49486   int s;
49487
49488   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49489      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49490      ptype = IPPROTO_TCP;
49491   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49492      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49493      ptype = IPPROTO_IP;
49494   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49495      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49496      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49497   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49498      stype = SOCK_DGRAM;
49499      ptype = IPPROTO_UDP;
49500   } else {
49501       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49502       exit(1);
49503   }
49504
49505   if((s = socket(PF_INET6, stype, ptype)) < 0) {
49506      perror("socket");
49507      exit(1);
49508   }
49509
49510   optval = 1;
49511   optlen = sizeof(optval);
49512   if(setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, &optval, optlen) < 0) {
49513      perror("setsockopt: IPPROTO_IPV6 IPV6_JOIN_GROUP");
49514      close(s);
49515      exit(1);
49516   }
49517  ;
49518  return 0;
49519}
49520_ACEOF
49521if ac_fn_c_try_compile "$LINENO"; then :
49522  _compileok=1
49523fi
49524rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49525
49526  if test x"${_compileok}" != x; then
49527    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
49528$as_echo "yes" >&6; }
49529
49530cat >>confdefs.h <<_ACEOF
49531#define HAVE_IPV6_JOIN_GROUP 1
49532_ACEOF
49533
49534cat >>confdefs.h <<_ACEOF
49535#define SOCKS_IPV6_JOIN_GROUP_LVL IPPROTO_IPV6
49536_ACEOF
49537
49538cat >>confdefs.h <<_ACEOF
49539#define SOCKS_IPV6_JOIN_GROUP_NAME "ipv6_join_group"
49540_ACEOF
49541    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
49542       #ipv4-only
49543
49544cat >>confdefs.h <<_ACEOF
49545#define SOCKS_IPV6_JOIN_GROUP_IPV4 1
49546_ACEOF
49547
49548cat >>confdefs.h <<_ACEOF
49549#define SOCKS_IPV6_JOIN_GROUP_IPV6 0
49550_ACEOF
49551    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
49552       #ipv6-only
49553
49554cat >>confdefs.h <<_ACEOF
49555#define SOCKS_IPV6_JOIN_GROUP_IPV4 0
49556_ACEOF
49557
49558cat >>confdefs.h <<_ACEOF
49559#define SOCKS_IPV6_JOIN_GROUP_IPV6 1
49560_ACEOF
49561    else
49562       #both ipv4 and ipv6
49563
49564cat >>confdefs.h <<_ACEOF
49565#define SOCKS_IPV6_JOIN_GROUP_IPV4 1
49566_ACEOF
49567
49568cat >>confdefs.h <<_ACEOF
49569#define SOCKS_IPV6_JOIN_GROUP_IPV6 1
49570_ACEOF
49571    fi
49572    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_JOIN_GROUP"
49573  else
49574    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49575$as_echo "no" >&6; }
49576  fi
49577unset _compileok
49578  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_LEAVE_ANYCAST" >&5
49579$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_LEAVE_ANYCAST... " >&6; }
49580  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49581/* end confdefs.h.  */
49582
49583#include <sys/types.h>
49584#include <sys/socket.h>
49585#include <netinet/in.h>
49586#include <netinet/tcp.h>
49587#include <netinet/udp.h>
49588
49589#include <stdio.h>
49590#include <stdlib.h>
49591#include <unistd.h>
49592
49593int
49594main ()
49595{
49596
49597   socklen_t optlen;
49598   int optval;
49599   int stype;
49600   int ptype;
49601   int s;
49602
49603   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49604      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49605      ptype = IPPROTO_TCP;
49606   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49607      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49608      ptype = IPPROTO_IP;
49609   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49610      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49611      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49612   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49613      stype = SOCK_DGRAM;
49614      ptype = IPPROTO_UDP;
49615   } else {
49616       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49617       exit(1);
49618   }
49619
49620   if((s = socket(PF_INET, stype, ptype)) < 0) {
49621      perror("socket");
49622      exit(1);
49623   }
49624
49625   optval = 1;
49626   optlen = sizeof(optval);
49627   if(setsockopt(s, IPPROTO_IPV6, IPV6_LEAVE_ANYCAST, &optval, optlen) < 0) {
49628      perror("setsockopt: IPPROTO_IPV6 IPV6_LEAVE_ANYCAST");
49629      close(s);
49630      exit(1);
49631   }
49632  ;
49633  return 0;
49634}
49635_ACEOF
49636if ac_fn_c_try_compile "$LINENO"; then :
49637  _compileok=1
49638fi
49639rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49640
49641  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49642/* end confdefs.h.  */
49643
49644#include <sys/types.h>
49645#include <sys/socket.h>
49646#include <netinet/in.h>
49647#include <netinet/tcp.h>
49648#include <netinet/udp.h>
49649
49650#include <stdio.h>
49651#include <stdlib.h>
49652#include <unistd.h>
49653
49654int
49655main ()
49656{
49657
49658   socklen_t optlen;
49659   int optval;
49660   int stype;
49661   int ptype;
49662   int s;
49663
49664   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49665      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49666      ptype = IPPROTO_TCP;
49667   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49668      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49669      ptype = IPPROTO_IP;
49670   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49671      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49672      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49673   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49674      stype = SOCK_DGRAM;
49675      ptype = IPPROTO_UDP;
49676   } else {
49677       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49678       exit(1);
49679   }
49680
49681   if((s = socket(PF_INET6, stype, ptype)) < 0) {
49682      perror("socket");
49683      exit(1);
49684   }
49685
49686   optval = 1;
49687   optlen = sizeof(optval);
49688   if(setsockopt(s, IPPROTO_IPV6, IPV6_LEAVE_ANYCAST, &optval, optlen) < 0) {
49689      perror("setsockopt: IPPROTO_IPV6 IPV6_LEAVE_ANYCAST");
49690      close(s);
49691      exit(1);
49692   }
49693  ;
49694  return 0;
49695}
49696_ACEOF
49697if ac_fn_c_try_compile "$LINENO"; then :
49698  _compileok=1
49699fi
49700rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49701
49702  if test x"${_compileok}" != x; then
49703    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
49704$as_echo "yes" >&6; }
49705
49706cat >>confdefs.h <<_ACEOF
49707#define HAVE_IPV6_LEAVE_ANYCAST 1
49708_ACEOF
49709
49710cat >>confdefs.h <<_ACEOF
49711#define SOCKS_IPV6_LEAVE_ANYCAST_LVL IPPROTO_IPV6
49712_ACEOF
49713
49714cat >>confdefs.h <<_ACEOF
49715#define SOCKS_IPV6_LEAVE_ANYCAST_NAME "ipv6_leave_anycast"
49716_ACEOF
49717    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
49718       #ipv4-only
49719
49720cat >>confdefs.h <<_ACEOF
49721#define SOCKS_IPV6_LEAVE_ANYCAST_IPV4 1
49722_ACEOF
49723
49724cat >>confdefs.h <<_ACEOF
49725#define SOCKS_IPV6_LEAVE_ANYCAST_IPV6 0
49726_ACEOF
49727    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
49728       #ipv6-only
49729
49730cat >>confdefs.h <<_ACEOF
49731#define SOCKS_IPV6_LEAVE_ANYCAST_IPV4 0
49732_ACEOF
49733
49734cat >>confdefs.h <<_ACEOF
49735#define SOCKS_IPV6_LEAVE_ANYCAST_IPV6 1
49736_ACEOF
49737    else
49738       #both ipv4 and ipv6
49739
49740cat >>confdefs.h <<_ACEOF
49741#define SOCKS_IPV6_LEAVE_ANYCAST_IPV4 1
49742_ACEOF
49743
49744cat >>confdefs.h <<_ACEOF
49745#define SOCKS_IPV6_LEAVE_ANYCAST_IPV6 1
49746_ACEOF
49747    fi
49748    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_LEAVE_ANYCAST"
49749  else
49750    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49751$as_echo "no" >&6; }
49752  fi
49753unset _compileok
49754  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_LEAVE_GROUP" >&5
49755$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_LEAVE_GROUP... " >&6; }
49756  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49757/* end confdefs.h.  */
49758
49759#include <sys/types.h>
49760#include <sys/socket.h>
49761#include <netinet/in.h>
49762#include <netinet/tcp.h>
49763#include <netinet/udp.h>
49764
49765#include <stdio.h>
49766#include <stdlib.h>
49767#include <unistd.h>
49768
49769int
49770main ()
49771{
49772
49773   socklen_t optlen;
49774   int optval;
49775   int stype;
49776   int ptype;
49777   int s;
49778
49779   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49780      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49781      ptype = IPPROTO_TCP;
49782   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49783      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49784      ptype = IPPROTO_IP;
49785   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49786      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49787      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49788   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49789      stype = SOCK_DGRAM;
49790      ptype = IPPROTO_UDP;
49791   } else {
49792       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49793       exit(1);
49794   }
49795
49796   if((s = socket(PF_INET, stype, ptype)) < 0) {
49797      perror("socket");
49798      exit(1);
49799   }
49800
49801   optval = 1;
49802   optlen = sizeof(optval);
49803   if(setsockopt(s, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &optval, optlen) < 0) {
49804      perror("setsockopt: IPPROTO_IPV6 IPV6_LEAVE_GROUP");
49805      close(s);
49806      exit(1);
49807   }
49808  ;
49809  return 0;
49810}
49811_ACEOF
49812if ac_fn_c_try_compile "$LINENO"; then :
49813  _compileok=1
49814fi
49815rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49816
49817  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49818/* end confdefs.h.  */
49819
49820#include <sys/types.h>
49821#include <sys/socket.h>
49822#include <netinet/in.h>
49823#include <netinet/tcp.h>
49824#include <netinet/udp.h>
49825
49826#include <stdio.h>
49827#include <stdlib.h>
49828#include <unistd.h>
49829
49830int
49831main ()
49832{
49833
49834   socklen_t optlen;
49835   int optval;
49836   int stype;
49837   int ptype;
49838   int s;
49839
49840   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49841      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49842      ptype = IPPROTO_TCP;
49843   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49844      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49845      ptype = IPPROTO_IP;
49846   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49847      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49848      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49849   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49850      stype = SOCK_DGRAM;
49851      ptype = IPPROTO_UDP;
49852   } else {
49853       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49854       exit(1);
49855   }
49856
49857   if((s = socket(PF_INET6, stype, ptype)) < 0) {
49858      perror("socket");
49859      exit(1);
49860   }
49861
49862   optval = 1;
49863   optlen = sizeof(optval);
49864   if(setsockopt(s, IPPROTO_IPV6, IPV6_LEAVE_GROUP, &optval, optlen) < 0) {
49865      perror("setsockopt: IPPROTO_IPV6 IPV6_LEAVE_GROUP");
49866      close(s);
49867      exit(1);
49868   }
49869  ;
49870  return 0;
49871}
49872_ACEOF
49873if ac_fn_c_try_compile "$LINENO"; then :
49874  _compileok=1
49875fi
49876rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49877
49878  if test x"${_compileok}" != x; then
49879    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
49880$as_echo "yes" >&6; }
49881
49882cat >>confdefs.h <<_ACEOF
49883#define HAVE_IPV6_LEAVE_GROUP 1
49884_ACEOF
49885
49886cat >>confdefs.h <<_ACEOF
49887#define SOCKS_IPV6_LEAVE_GROUP_LVL IPPROTO_IPV6
49888_ACEOF
49889
49890cat >>confdefs.h <<_ACEOF
49891#define SOCKS_IPV6_LEAVE_GROUP_NAME "ipv6_leave_group"
49892_ACEOF
49893    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
49894       #ipv4-only
49895
49896cat >>confdefs.h <<_ACEOF
49897#define SOCKS_IPV6_LEAVE_GROUP_IPV4 1
49898_ACEOF
49899
49900cat >>confdefs.h <<_ACEOF
49901#define SOCKS_IPV6_LEAVE_GROUP_IPV6 0
49902_ACEOF
49903    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
49904       #ipv6-only
49905
49906cat >>confdefs.h <<_ACEOF
49907#define SOCKS_IPV6_LEAVE_GROUP_IPV4 0
49908_ACEOF
49909
49910cat >>confdefs.h <<_ACEOF
49911#define SOCKS_IPV6_LEAVE_GROUP_IPV6 1
49912_ACEOF
49913    else
49914       #both ipv4 and ipv6
49915
49916cat >>confdefs.h <<_ACEOF
49917#define SOCKS_IPV6_LEAVE_GROUP_IPV4 1
49918_ACEOF
49919
49920cat >>confdefs.h <<_ACEOF
49921#define SOCKS_IPV6_LEAVE_GROUP_IPV6 1
49922_ACEOF
49923    fi
49924    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_LEAVE_GROUP"
49925  else
49926    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
49927$as_echo "no" >&6; }
49928  fi
49929unset _compileok
49930  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MINHOPCOUNT" >&5
49931$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MINHOPCOUNT... " >&6; }
49932  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49933/* end confdefs.h.  */
49934
49935#include <sys/types.h>
49936#include <sys/socket.h>
49937#include <netinet/in.h>
49938#include <netinet/tcp.h>
49939#include <netinet/udp.h>
49940
49941#include <stdio.h>
49942#include <stdlib.h>
49943#include <unistd.h>
49944
49945int
49946main ()
49947{
49948
49949   socklen_t optlen;
49950   int optval;
49951   int stype;
49952   int ptype;
49953   int s;
49954
49955   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
49956      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
49957      ptype = IPPROTO_TCP;
49958   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
49959      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
49960      ptype = IPPROTO_IP;
49961   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
49962      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
49963      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
49964   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
49965      stype = SOCK_DGRAM;
49966      ptype = IPPROTO_UDP;
49967   } else {
49968       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
49969       exit(1);
49970   }
49971
49972   if((s = socket(PF_INET, stype, ptype)) < 0) {
49973      perror("socket");
49974      exit(1);
49975   }
49976
49977   optval = 1;
49978   optlen = sizeof(optval);
49979   if(setsockopt(s, IPPROTO_IPV6, IPV6_MINHOPCOUNT, &optval, optlen) < 0) {
49980      perror("setsockopt: IPPROTO_IPV6 IPV6_MINHOPCOUNT");
49981      close(s);
49982      exit(1);
49983   }
49984  ;
49985  return 0;
49986}
49987_ACEOF
49988if ac_fn_c_try_compile "$LINENO"; then :
49989  _compileok=1
49990fi
49991rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
49992
49993  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
49994/* end confdefs.h.  */
49995
49996#include <sys/types.h>
49997#include <sys/socket.h>
49998#include <netinet/in.h>
49999#include <netinet/tcp.h>
50000#include <netinet/udp.h>
50001
50002#include <stdio.h>
50003#include <stdlib.h>
50004#include <unistd.h>
50005
50006int
50007main ()
50008{
50009
50010   socklen_t optlen;
50011   int optval;
50012   int stype;
50013   int ptype;
50014   int s;
50015
50016   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50017      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50018      ptype = IPPROTO_TCP;
50019   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50020      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50021      ptype = IPPROTO_IP;
50022   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50023      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50024      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50025   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50026      stype = SOCK_DGRAM;
50027      ptype = IPPROTO_UDP;
50028   } else {
50029       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50030       exit(1);
50031   }
50032
50033   if((s = socket(PF_INET6, stype, ptype)) < 0) {
50034      perror("socket");
50035      exit(1);
50036   }
50037
50038   optval = 1;
50039   optlen = sizeof(optval);
50040   if(setsockopt(s, IPPROTO_IPV6, IPV6_MINHOPCOUNT, &optval, optlen) < 0) {
50041      perror("setsockopt: IPPROTO_IPV6 IPV6_MINHOPCOUNT");
50042      close(s);
50043      exit(1);
50044   }
50045  ;
50046  return 0;
50047}
50048_ACEOF
50049if ac_fn_c_try_compile "$LINENO"; then :
50050  _compileok=1
50051fi
50052rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50053
50054  if test x"${_compileok}" != x; then
50055    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
50056$as_echo "yes" >&6; }
50057
50058cat >>confdefs.h <<_ACEOF
50059#define HAVE_IPV6_MINHOPCOUNT 1
50060_ACEOF
50061
50062cat >>confdefs.h <<_ACEOF
50063#define SOCKS_IPV6_MINHOPCOUNT_LVL IPPROTO_IPV6
50064_ACEOF
50065
50066cat >>confdefs.h <<_ACEOF
50067#define SOCKS_IPV6_MINHOPCOUNT_NAME "ipv6_minhopcount"
50068_ACEOF
50069    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
50070       #ipv4-only
50071
50072cat >>confdefs.h <<_ACEOF
50073#define SOCKS_IPV6_MINHOPCOUNT_IPV4 1
50074_ACEOF
50075
50076cat >>confdefs.h <<_ACEOF
50077#define SOCKS_IPV6_MINHOPCOUNT_IPV6 0
50078_ACEOF
50079    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
50080       #ipv6-only
50081
50082cat >>confdefs.h <<_ACEOF
50083#define SOCKS_IPV6_MINHOPCOUNT_IPV4 0
50084_ACEOF
50085
50086cat >>confdefs.h <<_ACEOF
50087#define SOCKS_IPV6_MINHOPCOUNT_IPV6 1
50088_ACEOF
50089    else
50090       #both ipv4 and ipv6
50091
50092cat >>confdefs.h <<_ACEOF
50093#define SOCKS_IPV6_MINHOPCOUNT_IPV4 1
50094_ACEOF
50095
50096cat >>confdefs.h <<_ACEOF
50097#define SOCKS_IPV6_MINHOPCOUNT_IPV6 1
50098_ACEOF
50099    fi
50100    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MINHOPCOUNT"
50101  else
50102    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
50103$as_echo "no" >&6; }
50104  fi
50105unset _compileok
50106  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MTU" >&5
50107$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MTU... " >&6; }
50108  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50109/* end confdefs.h.  */
50110
50111#include <sys/types.h>
50112#include <sys/socket.h>
50113#include <netinet/in.h>
50114#include <netinet/tcp.h>
50115#include <netinet/udp.h>
50116
50117#include <stdio.h>
50118#include <stdlib.h>
50119#include <unistd.h>
50120
50121int
50122main ()
50123{
50124
50125   socklen_t optlen;
50126   int optval;
50127   int stype;
50128   int ptype;
50129   int s;
50130
50131   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50132      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50133      ptype = IPPROTO_TCP;
50134   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50135      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50136      ptype = IPPROTO_IP;
50137   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50138      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50139      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50140   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50141      stype = SOCK_DGRAM;
50142      ptype = IPPROTO_UDP;
50143   } else {
50144       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50145       exit(1);
50146   }
50147
50148   if((s = socket(PF_INET, stype, ptype)) < 0) {
50149      perror("socket");
50150      exit(1);
50151   }
50152
50153   optval = 1;
50154   optlen = sizeof(optval);
50155   if(setsockopt(s, IPPROTO_IPV6, IPV6_MTU, &optval, optlen) < 0) {
50156      perror("setsockopt: IPPROTO_IPV6 IPV6_MTU");
50157      close(s);
50158      exit(1);
50159   }
50160  ;
50161  return 0;
50162}
50163_ACEOF
50164if ac_fn_c_try_compile "$LINENO"; then :
50165  _compileok=1
50166fi
50167rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50168
50169  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50170/* end confdefs.h.  */
50171
50172#include <sys/types.h>
50173#include <sys/socket.h>
50174#include <netinet/in.h>
50175#include <netinet/tcp.h>
50176#include <netinet/udp.h>
50177
50178#include <stdio.h>
50179#include <stdlib.h>
50180#include <unistd.h>
50181
50182int
50183main ()
50184{
50185
50186   socklen_t optlen;
50187   int optval;
50188   int stype;
50189   int ptype;
50190   int s;
50191
50192   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50193      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50194      ptype = IPPROTO_TCP;
50195   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50196      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50197      ptype = IPPROTO_IP;
50198   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50199      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50200      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50201   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50202      stype = SOCK_DGRAM;
50203      ptype = IPPROTO_UDP;
50204   } else {
50205       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50206       exit(1);
50207   }
50208
50209   if((s = socket(PF_INET6, stype, ptype)) < 0) {
50210      perror("socket");
50211      exit(1);
50212   }
50213
50214   optval = 1;
50215   optlen = sizeof(optval);
50216   if(setsockopt(s, IPPROTO_IPV6, IPV6_MTU, &optval, optlen) < 0) {
50217      perror("setsockopt: IPPROTO_IPV6 IPV6_MTU");
50218      close(s);
50219      exit(1);
50220   }
50221  ;
50222  return 0;
50223}
50224_ACEOF
50225if ac_fn_c_try_compile "$LINENO"; then :
50226  _compileok=1
50227fi
50228rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50229
50230  if test x"${_compileok}" != x; then
50231    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
50232$as_echo "yes" >&6; }
50233
50234cat >>confdefs.h <<_ACEOF
50235#define HAVE_IPV6_MTU 1
50236_ACEOF
50237
50238cat >>confdefs.h <<_ACEOF
50239#define SOCKS_IPV6_MTU_LVL IPPROTO_IPV6
50240_ACEOF
50241
50242cat >>confdefs.h <<_ACEOF
50243#define SOCKS_IPV6_MTU_NAME "ipv6_mtu"
50244_ACEOF
50245    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
50246       #ipv4-only
50247
50248cat >>confdefs.h <<_ACEOF
50249#define SOCKS_IPV6_MTU_IPV4 1
50250_ACEOF
50251
50252cat >>confdefs.h <<_ACEOF
50253#define SOCKS_IPV6_MTU_IPV6 0
50254_ACEOF
50255    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
50256       #ipv6-only
50257
50258cat >>confdefs.h <<_ACEOF
50259#define SOCKS_IPV6_MTU_IPV4 0
50260_ACEOF
50261
50262cat >>confdefs.h <<_ACEOF
50263#define SOCKS_IPV6_MTU_IPV6 1
50264_ACEOF
50265    else
50266       #both ipv4 and ipv6
50267
50268cat >>confdefs.h <<_ACEOF
50269#define SOCKS_IPV6_MTU_IPV4 1
50270_ACEOF
50271
50272cat >>confdefs.h <<_ACEOF
50273#define SOCKS_IPV6_MTU_IPV6 1
50274_ACEOF
50275    fi
50276    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MTU"
50277  else
50278    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
50279$as_echo "no" >&6; }
50280  fi
50281unset _compileok
50282  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MTU_DISCOVER" >&5
50283$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MTU_DISCOVER... " >&6; }
50284  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50285/* end confdefs.h.  */
50286
50287#include <sys/types.h>
50288#include <sys/socket.h>
50289#include <netinet/in.h>
50290#include <netinet/tcp.h>
50291#include <netinet/udp.h>
50292
50293#include <stdio.h>
50294#include <stdlib.h>
50295#include <unistd.h>
50296
50297int
50298main ()
50299{
50300
50301   socklen_t optlen;
50302   int optval;
50303   int stype;
50304   int ptype;
50305   int s;
50306
50307   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50308      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50309      ptype = IPPROTO_TCP;
50310   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50311      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50312      ptype = IPPROTO_IP;
50313   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50314      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50315      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50316   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50317      stype = SOCK_DGRAM;
50318      ptype = IPPROTO_UDP;
50319   } else {
50320       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50321       exit(1);
50322   }
50323
50324   if((s = socket(PF_INET, stype, ptype)) < 0) {
50325      perror("socket");
50326      exit(1);
50327   }
50328
50329   optval = 1;
50330   optlen = sizeof(optval);
50331   if(setsockopt(s, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &optval, optlen) < 0) {
50332      perror("setsockopt: IPPROTO_IPV6 IPV6_MTU_DISCOVER");
50333      close(s);
50334      exit(1);
50335   }
50336  ;
50337  return 0;
50338}
50339_ACEOF
50340if ac_fn_c_try_compile "$LINENO"; then :
50341  _compileok=1
50342fi
50343rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50344
50345  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50346/* end confdefs.h.  */
50347
50348#include <sys/types.h>
50349#include <sys/socket.h>
50350#include <netinet/in.h>
50351#include <netinet/tcp.h>
50352#include <netinet/udp.h>
50353
50354#include <stdio.h>
50355#include <stdlib.h>
50356#include <unistd.h>
50357
50358int
50359main ()
50360{
50361
50362   socklen_t optlen;
50363   int optval;
50364   int stype;
50365   int ptype;
50366   int s;
50367
50368   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50369      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50370      ptype = IPPROTO_TCP;
50371   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50372      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50373      ptype = IPPROTO_IP;
50374   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50375      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50376      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50377   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50378      stype = SOCK_DGRAM;
50379      ptype = IPPROTO_UDP;
50380   } else {
50381       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50382       exit(1);
50383   }
50384
50385   if((s = socket(PF_INET6, stype, ptype)) < 0) {
50386      perror("socket");
50387      exit(1);
50388   }
50389
50390   optval = 1;
50391   optlen = sizeof(optval);
50392   if(setsockopt(s, IPPROTO_IPV6, IPV6_MTU_DISCOVER, &optval, optlen) < 0) {
50393      perror("setsockopt: IPPROTO_IPV6 IPV6_MTU_DISCOVER");
50394      close(s);
50395      exit(1);
50396   }
50397  ;
50398  return 0;
50399}
50400_ACEOF
50401if ac_fn_c_try_compile "$LINENO"; then :
50402  _compileok=1
50403fi
50404rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50405
50406  if test x"${_compileok}" != x; then
50407    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
50408$as_echo "yes" >&6; }
50409
50410cat >>confdefs.h <<_ACEOF
50411#define HAVE_IPV6_MTU_DISCOVER 1
50412_ACEOF
50413
50414cat >>confdefs.h <<_ACEOF
50415#define SOCKS_IPV6_MTU_DISCOVER_LVL IPPROTO_IPV6
50416_ACEOF
50417
50418cat >>confdefs.h <<_ACEOF
50419#define SOCKS_IPV6_MTU_DISCOVER_NAME "ipv6_mtu_discover"
50420_ACEOF
50421    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
50422       #ipv4-only
50423
50424cat >>confdefs.h <<_ACEOF
50425#define SOCKS_IPV6_MTU_DISCOVER_IPV4 1
50426_ACEOF
50427
50428cat >>confdefs.h <<_ACEOF
50429#define SOCKS_IPV6_MTU_DISCOVER_IPV6 0
50430_ACEOF
50431    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
50432       #ipv6-only
50433
50434cat >>confdefs.h <<_ACEOF
50435#define SOCKS_IPV6_MTU_DISCOVER_IPV4 0
50436_ACEOF
50437
50438cat >>confdefs.h <<_ACEOF
50439#define SOCKS_IPV6_MTU_DISCOVER_IPV6 1
50440_ACEOF
50441    else
50442       #both ipv4 and ipv6
50443
50444cat >>confdefs.h <<_ACEOF
50445#define SOCKS_IPV6_MTU_DISCOVER_IPV4 1
50446_ACEOF
50447
50448cat >>confdefs.h <<_ACEOF
50449#define SOCKS_IPV6_MTU_DISCOVER_IPV6 1
50450_ACEOF
50451    fi
50452    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MTU_DISCOVER"
50453  else
50454    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
50455$as_echo "no" >&6; }
50456  fi
50457unset _compileok
50458  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_NEXTHOP" >&5
50459$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_NEXTHOP... " >&6; }
50460  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50461/* end confdefs.h.  */
50462
50463#include <sys/types.h>
50464#include <sys/socket.h>
50465#include <netinet/in.h>
50466#include <netinet/tcp.h>
50467#include <netinet/udp.h>
50468
50469#include <stdio.h>
50470#include <stdlib.h>
50471#include <unistd.h>
50472
50473int
50474main ()
50475{
50476
50477   socklen_t optlen;
50478   int optval;
50479   int stype;
50480   int ptype;
50481   int s;
50482
50483   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50484      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50485      ptype = IPPROTO_TCP;
50486   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50487      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50488      ptype = IPPROTO_IP;
50489   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50490      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50491      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50492   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50493      stype = SOCK_DGRAM;
50494      ptype = IPPROTO_UDP;
50495   } else {
50496       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50497       exit(1);
50498   }
50499
50500   if((s = socket(PF_INET, stype, ptype)) < 0) {
50501      perror("socket");
50502      exit(1);
50503   }
50504
50505   optval = 1;
50506   optlen = sizeof(optval);
50507   if(setsockopt(s, IPPROTO_IPV6, IPV6_NEXTHOP, &optval, optlen) < 0) {
50508      perror("setsockopt: IPPROTO_IPV6 IPV6_NEXTHOP");
50509      close(s);
50510      exit(1);
50511   }
50512  ;
50513  return 0;
50514}
50515_ACEOF
50516if ac_fn_c_try_compile "$LINENO"; then :
50517  _compileok=1
50518fi
50519rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50520
50521  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50522/* end confdefs.h.  */
50523
50524#include <sys/types.h>
50525#include <sys/socket.h>
50526#include <netinet/in.h>
50527#include <netinet/tcp.h>
50528#include <netinet/udp.h>
50529
50530#include <stdio.h>
50531#include <stdlib.h>
50532#include <unistd.h>
50533
50534int
50535main ()
50536{
50537
50538   socklen_t optlen;
50539   int optval;
50540   int stype;
50541   int ptype;
50542   int s;
50543
50544   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50545      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50546      ptype = IPPROTO_TCP;
50547   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50548      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50549      ptype = IPPROTO_IP;
50550   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50551      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50552      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50553   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50554      stype = SOCK_DGRAM;
50555      ptype = IPPROTO_UDP;
50556   } else {
50557       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50558       exit(1);
50559   }
50560
50561   if((s = socket(PF_INET6, stype, ptype)) < 0) {
50562      perror("socket");
50563      exit(1);
50564   }
50565
50566   optval = 1;
50567   optlen = sizeof(optval);
50568   if(setsockopt(s, IPPROTO_IPV6, IPV6_NEXTHOP, &optval, optlen) < 0) {
50569      perror("setsockopt: IPPROTO_IPV6 IPV6_NEXTHOP");
50570      close(s);
50571      exit(1);
50572   }
50573  ;
50574  return 0;
50575}
50576_ACEOF
50577if ac_fn_c_try_compile "$LINENO"; then :
50578  _compileok=1
50579fi
50580rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50581
50582  if test x"${_compileok}" != x; then
50583    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
50584$as_echo "yes" >&6; }
50585
50586cat >>confdefs.h <<_ACEOF
50587#define HAVE_IPV6_NEXTHOP 1
50588_ACEOF
50589
50590cat >>confdefs.h <<_ACEOF
50591#define SOCKS_IPV6_NEXTHOP_LVL IPPROTO_IPV6
50592_ACEOF
50593
50594cat >>confdefs.h <<_ACEOF
50595#define SOCKS_IPV6_NEXTHOP_NAME "ipv6_nexthop"
50596_ACEOF
50597    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
50598       #ipv4-only
50599
50600cat >>confdefs.h <<_ACEOF
50601#define SOCKS_IPV6_NEXTHOP_IPV4 1
50602_ACEOF
50603
50604cat >>confdefs.h <<_ACEOF
50605#define SOCKS_IPV6_NEXTHOP_IPV6 0
50606_ACEOF
50607    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
50608       #ipv6-only
50609
50610cat >>confdefs.h <<_ACEOF
50611#define SOCKS_IPV6_NEXTHOP_IPV4 0
50612_ACEOF
50613
50614cat >>confdefs.h <<_ACEOF
50615#define SOCKS_IPV6_NEXTHOP_IPV6 1
50616_ACEOF
50617    else
50618       #both ipv4 and ipv6
50619
50620cat >>confdefs.h <<_ACEOF
50621#define SOCKS_IPV6_NEXTHOP_IPV4 1
50622_ACEOF
50623
50624cat >>confdefs.h <<_ACEOF
50625#define SOCKS_IPV6_NEXTHOP_IPV6 1
50626_ACEOF
50627    fi
50628    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_NEXTHOP"
50629  else
50630    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
50631$as_echo "no" >&6; }
50632  fi
50633unset _compileok
50634  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ORIGDSTADDR" >&5
50635$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ORIGDSTADDR... " >&6; }
50636  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50637/* end confdefs.h.  */
50638
50639#include <sys/types.h>
50640#include <sys/socket.h>
50641#include <netinet/in.h>
50642#include <netinet/tcp.h>
50643#include <netinet/udp.h>
50644
50645#include <stdio.h>
50646#include <stdlib.h>
50647#include <unistd.h>
50648
50649int
50650main ()
50651{
50652
50653   socklen_t optlen;
50654   int optval;
50655   int stype;
50656   int ptype;
50657   int s;
50658
50659   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50660      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50661      ptype = IPPROTO_TCP;
50662   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50663      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50664      ptype = IPPROTO_IP;
50665   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50666      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50667      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50668   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50669      stype = SOCK_DGRAM;
50670      ptype = IPPROTO_UDP;
50671   } else {
50672       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50673       exit(1);
50674   }
50675
50676   if((s = socket(PF_INET, stype, ptype)) < 0) {
50677      perror("socket");
50678      exit(1);
50679   }
50680
50681   optval = 1;
50682   optlen = sizeof(optval);
50683   if(setsockopt(s, IPPROTO_IPV6, IPV6_ORIGDSTADDR, &optval, optlen) < 0) {
50684      perror("setsockopt: IPPROTO_IPV6 IPV6_ORIGDSTADDR");
50685      close(s);
50686      exit(1);
50687   }
50688  ;
50689  return 0;
50690}
50691_ACEOF
50692if ac_fn_c_try_compile "$LINENO"; then :
50693  _compileok=1
50694fi
50695rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50696
50697  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50698/* end confdefs.h.  */
50699
50700#include <sys/types.h>
50701#include <sys/socket.h>
50702#include <netinet/in.h>
50703#include <netinet/tcp.h>
50704#include <netinet/udp.h>
50705
50706#include <stdio.h>
50707#include <stdlib.h>
50708#include <unistd.h>
50709
50710int
50711main ()
50712{
50713
50714   socklen_t optlen;
50715   int optval;
50716   int stype;
50717   int ptype;
50718   int s;
50719
50720   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50721      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50722      ptype = IPPROTO_TCP;
50723   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50724      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50725      ptype = IPPROTO_IP;
50726   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50727      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50728      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50729   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50730      stype = SOCK_DGRAM;
50731      ptype = IPPROTO_UDP;
50732   } else {
50733       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50734       exit(1);
50735   }
50736
50737   if((s = socket(PF_INET6, stype, ptype)) < 0) {
50738      perror("socket");
50739      exit(1);
50740   }
50741
50742   optval = 1;
50743   optlen = sizeof(optval);
50744   if(setsockopt(s, IPPROTO_IPV6, IPV6_ORIGDSTADDR, &optval, optlen) < 0) {
50745      perror("setsockopt: IPPROTO_IPV6 IPV6_ORIGDSTADDR");
50746      close(s);
50747      exit(1);
50748   }
50749  ;
50750  return 0;
50751}
50752_ACEOF
50753if ac_fn_c_try_compile "$LINENO"; then :
50754  _compileok=1
50755fi
50756rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50757
50758  if test x"${_compileok}" != x; then
50759    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
50760$as_echo "yes" >&6; }
50761
50762cat >>confdefs.h <<_ACEOF
50763#define HAVE_IPV6_ORIGDSTADDR 1
50764_ACEOF
50765
50766cat >>confdefs.h <<_ACEOF
50767#define SOCKS_IPV6_ORIGDSTADDR_LVL IPPROTO_IPV6
50768_ACEOF
50769
50770cat >>confdefs.h <<_ACEOF
50771#define SOCKS_IPV6_ORIGDSTADDR_NAME "ipv6_origdstaddr"
50772_ACEOF
50773    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
50774       #ipv4-only
50775
50776cat >>confdefs.h <<_ACEOF
50777#define SOCKS_IPV6_ORIGDSTADDR_IPV4 1
50778_ACEOF
50779
50780cat >>confdefs.h <<_ACEOF
50781#define SOCKS_IPV6_ORIGDSTADDR_IPV6 0
50782_ACEOF
50783    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
50784       #ipv6-only
50785
50786cat >>confdefs.h <<_ACEOF
50787#define SOCKS_IPV6_ORIGDSTADDR_IPV4 0
50788_ACEOF
50789
50790cat >>confdefs.h <<_ACEOF
50791#define SOCKS_IPV6_ORIGDSTADDR_IPV6 1
50792_ACEOF
50793    else
50794       #both ipv4 and ipv6
50795
50796cat >>confdefs.h <<_ACEOF
50797#define SOCKS_IPV6_ORIGDSTADDR_IPV4 1
50798_ACEOF
50799
50800cat >>confdefs.h <<_ACEOF
50801#define SOCKS_IPV6_ORIGDSTADDR_IPV6 1
50802_ACEOF
50803    fi
50804    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ORIGDSTADDR"
50805  else
50806    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
50807$as_echo "no" >&6; }
50808  fi
50809unset _compileok
50810  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_PATHMTU" >&5
50811$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_PATHMTU... " >&6; }
50812  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50813/* end confdefs.h.  */
50814
50815#include <sys/types.h>
50816#include <sys/socket.h>
50817#include <netinet/in.h>
50818#include <netinet/tcp.h>
50819#include <netinet/udp.h>
50820
50821#include <stdio.h>
50822#include <stdlib.h>
50823#include <unistd.h>
50824
50825int
50826main ()
50827{
50828
50829   socklen_t optlen;
50830   int optval;
50831   int stype;
50832   int ptype;
50833   int s;
50834
50835   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50836      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50837      ptype = IPPROTO_TCP;
50838   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50839      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50840      ptype = IPPROTO_IP;
50841   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50842      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50843      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50844   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50845      stype = SOCK_DGRAM;
50846      ptype = IPPROTO_UDP;
50847   } else {
50848       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50849       exit(1);
50850   }
50851
50852   if((s = socket(PF_INET, stype, ptype)) < 0) {
50853      perror("socket");
50854      exit(1);
50855   }
50856
50857   optval = 1;
50858   optlen = sizeof(optval);
50859   if(setsockopt(s, IPPROTO_IPV6, IPV6_PATHMTU, &optval, optlen) < 0) {
50860      perror("setsockopt: IPPROTO_IPV6 IPV6_PATHMTU");
50861      close(s);
50862      exit(1);
50863   }
50864  ;
50865  return 0;
50866}
50867_ACEOF
50868if ac_fn_c_try_compile "$LINENO"; then :
50869  _compileok=1
50870fi
50871rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50872
50873  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50874/* end confdefs.h.  */
50875
50876#include <sys/types.h>
50877#include <sys/socket.h>
50878#include <netinet/in.h>
50879#include <netinet/tcp.h>
50880#include <netinet/udp.h>
50881
50882#include <stdio.h>
50883#include <stdlib.h>
50884#include <unistd.h>
50885
50886int
50887main ()
50888{
50889
50890   socklen_t optlen;
50891   int optval;
50892   int stype;
50893   int ptype;
50894   int s;
50895
50896   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
50897      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
50898      ptype = IPPROTO_TCP;
50899   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
50900      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
50901      ptype = IPPROTO_IP;
50902   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
50903      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
50904      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
50905   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
50906      stype = SOCK_DGRAM;
50907      ptype = IPPROTO_UDP;
50908   } else {
50909       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
50910       exit(1);
50911   }
50912
50913   if((s = socket(PF_INET6, stype, ptype)) < 0) {
50914      perror("socket");
50915      exit(1);
50916   }
50917
50918   optval = 1;
50919   optlen = sizeof(optval);
50920   if(setsockopt(s, IPPROTO_IPV6, IPV6_PATHMTU, &optval, optlen) < 0) {
50921      perror("setsockopt: IPPROTO_IPV6 IPV6_PATHMTU");
50922      close(s);
50923      exit(1);
50924   }
50925  ;
50926  return 0;
50927}
50928_ACEOF
50929if ac_fn_c_try_compile "$LINENO"; then :
50930  _compileok=1
50931fi
50932rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
50933
50934  if test x"${_compileok}" != x; then
50935    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
50936$as_echo "yes" >&6; }
50937
50938cat >>confdefs.h <<_ACEOF
50939#define HAVE_IPV6_PATHMTU 1
50940_ACEOF
50941
50942cat >>confdefs.h <<_ACEOF
50943#define SOCKS_IPV6_PATHMTU_LVL IPPROTO_IPV6
50944_ACEOF
50945
50946cat >>confdefs.h <<_ACEOF
50947#define SOCKS_IPV6_PATHMTU_NAME "ipv6_pathmtu"
50948_ACEOF
50949    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
50950       #ipv4-only
50951
50952cat >>confdefs.h <<_ACEOF
50953#define SOCKS_IPV6_PATHMTU_IPV4 1
50954_ACEOF
50955
50956cat >>confdefs.h <<_ACEOF
50957#define SOCKS_IPV6_PATHMTU_IPV6 0
50958_ACEOF
50959    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
50960       #ipv6-only
50961
50962cat >>confdefs.h <<_ACEOF
50963#define SOCKS_IPV6_PATHMTU_IPV4 0
50964_ACEOF
50965
50966cat >>confdefs.h <<_ACEOF
50967#define SOCKS_IPV6_PATHMTU_IPV6 1
50968_ACEOF
50969    else
50970       #both ipv4 and ipv6
50971
50972cat >>confdefs.h <<_ACEOF
50973#define SOCKS_IPV6_PATHMTU_IPV4 1
50974_ACEOF
50975
50976cat >>confdefs.h <<_ACEOF
50977#define SOCKS_IPV6_PATHMTU_IPV6 1
50978_ACEOF
50979    fi
50980    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_PATHMTU"
50981  else
50982    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
50983$as_echo "no" >&6; }
50984  fi
50985unset _compileok
50986  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_PIPEX" >&5
50987$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_PIPEX... " >&6; }
50988  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
50989/* end confdefs.h.  */
50990
50991#include <sys/types.h>
50992#include <sys/socket.h>
50993#include <netinet/in.h>
50994#include <netinet/tcp.h>
50995#include <netinet/udp.h>
50996
50997#include <stdio.h>
50998#include <stdlib.h>
50999#include <unistd.h>
51000
51001int
51002main ()
51003{
51004
51005   socklen_t optlen;
51006   int optval;
51007   int stype;
51008   int ptype;
51009   int s;
51010
51011   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51012      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51013      ptype = IPPROTO_TCP;
51014   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51015      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51016      ptype = IPPROTO_IP;
51017   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51018      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51019      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51020   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51021      stype = SOCK_DGRAM;
51022      ptype = IPPROTO_UDP;
51023   } else {
51024       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51025       exit(1);
51026   }
51027
51028   if((s = socket(PF_INET, stype, ptype)) < 0) {
51029      perror("socket");
51030      exit(1);
51031   }
51032
51033   optval = 1;
51034   optlen = sizeof(optval);
51035   if(setsockopt(s, IPPROTO_IPV6, IPV6_PIPEX, &optval, optlen) < 0) {
51036      perror("setsockopt: IPPROTO_IPV6 IPV6_PIPEX");
51037      close(s);
51038      exit(1);
51039   }
51040  ;
51041  return 0;
51042}
51043_ACEOF
51044if ac_fn_c_try_compile "$LINENO"; then :
51045  _compileok=1
51046fi
51047rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51048
51049  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51050/* end confdefs.h.  */
51051
51052#include <sys/types.h>
51053#include <sys/socket.h>
51054#include <netinet/in.h>
51055#include <netinet/tcp.h>
51056#include <netinet/udp.h>
51057
51058#include <stdio.h>
51059#include <stdlib.h>
51060#include <unistd.h>
51061
51062int
51063main ()
51064{
51065
51066   socklen_t optlen;
51067   int optval;
51068   int stype;
51069   int ptype;
51070   int s;
51071
51072   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51073      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51074      ptype = IPPROTO_TCP;
51075   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51076      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51077      ptype = IPPROTO_IP;
51078   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51079      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51080      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51081   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51082      stype = SOCK_DGRAM;
51083      ptype = IPPROTO_UDP;
51084   } else {
51085       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51086       exit(1);
51087   }
51088
51089   if((s = socket(PF_INET6, stype, ptype)) < 0) {
51090      perror("socket");
51091      exit(1);
51092   }
51093
51094   optval = 1;
51095   optlen = sizeof(optval);
51096   if(setsockopt(s, IPPROTO_IPV6, IPV6_PIPEX, &optval, optlen) < 0) {
51097      perror("setsockopt: IPPROTO_IPV6 IPV6_PIPEX");
51098      close(s);
51099      exit(1);
51100   }
51101  ;
51102  return 0;
51103}
51104_ACEOF
51105if ac_fn_c_try_compile "$LINENO"; then :
51106  _compileok=1
51107fi
51108rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51109
51110  if test x"${_compileok}" != x; then
51111    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
51112$as_echo "yes" >&6; }
51113
51114cat >>confdefs.h <<_ACEOF
51115#define HAVE_IPV6_PIPEX 1
51116_ACEOF
51117
51118cat >>confdefs.h <<_ACEOF
51119#define SOCKS_IPV6_PIPEX_LVL IPPROTO_IPV6
51120_ACEOF
51121
51122cat >>confdefs.h <<_ACEOF
51123#define SOCKS_IPV6_PIPEX_NAME "ipv6_pipex"
51124_ACEOF
51125    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
51126       #ipv4-only
51127
51128cat >>confdefs.h <<_ACEOF
51129#define SOCKS_IPV6_PIPEX_IPV4 1
51130_ACEOF
51131
51132cat >>confdefs.h <<_ACEOF
51133#define SOCKS_IPV6_PIPEX_IPV6 0
51134_ACEOF
51135    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
51136       #ipv6-only
51137
51138cat >>confdefs.h <<_ACEOF
51139#define SOCKS_IPV6_PIPEX_IPV4 0
51140_ACEOF
51141
51142cat >>confdefs.h <<_ACEOF
51143#define SOCKS_IPV6_PIPEX_IPV6 1
51144_ACEOF
51145    else
51146       #both ipv4 and ipv6
51147
51148cat >>confdefs.h <<_ACEOF
51149#define SOCKS_IPV6_PIPEX_IPV4 1
51150_ACEOF
51151
51152cat >>confdefs.h <<_ACEOF
51153#define SOCKS_IPV6_PIPEX_IPV6 1
51154_ACEOF
51155    fi
51156    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_PIPEX"
51157  else
51158    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
51159$as_echo "no" >&6; }
51160  fi
51161unset _compileok
51162  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_PKTINFO" >&5
51163$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_PKTINFO... " >&6; }
51164  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51165/* end confdefs.h.  */
51166
51167#include <sys/types.h>
51168#include <sys/socket.h>
51169#include <netinet/in.h>
51170#include <netinet/tcp.h>
51171#include <netinet/udp.h>
51172
51173#include <stdio.h>
51174#include <stdlib.h>
51175#include <unistd.h>
51176
51177int
51178main ()
51179{
51180
51181   socklen_t optlen;
51182   int optval;
51183   int stype;
51184   int ptype;
51185   int s;
51186
51187   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51188      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51189      ptype = IPPROTO_TCP;
51190   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51191      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51192      ptype = IPPROTO_IP;
51193   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51194      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51195      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51196   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51197      stype = SOCK_DGRAM;
51198      ptype = IPPROTO_UDP;
51199   } else {
51200       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51201       exit(1);
51202   }
51203
51204   if((s = socket(PF_INET, stype, ptype)) < 0) {
51205      perror("socket");
51206      exit(1);
51207   }
51208
51209   optval = 1;
51210   optlen = sizeof(optval);
51211   if(setsockopt(s, IPPROTO_IPV6, IPV6_PKTINFO, &optval, optlen) < 0) {
51212      perror("setsockopt: IPPROTO_IPV6 IPV6_PKTINFO");
51213      close(s);
51214      exit(1);
51215   }
51216  ;
51217  return 0;
51218}
51219_ACEOF
51220if ac_fn_c_try_compile "$LINENO"; then :
51221  _compileok=1
51222fi
51223rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51224
51225  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51226/* end confdefs.h.  */
51227
51228#include <sys/types.h>
51229#include <sys/socket.h>
51230#include <netinet/in.h>
51231#include <netinet/tcp.h>
51232#include <netinet/udp.h>
51233
51234#include <stdio.h>
51235#include <stdlib.h>
51236#include <unistd.h>
51237
51238int
51239main ()
51240{
51241
51242   socklen_t optlen;
51243   int optval;
51244   int stype;
51245   int ptype;
51246   int s;
51247
51248   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51249      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51250      ptype = IPPROTO_TCP;
51251   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51252      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51253      ptype = IPPROTO_IP;
51254   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51255      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51256      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51257   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51258      stype = SOCK_DGRAM;
51259      ptype = IPPROTO_UDP;
51260   } else {
51261       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51262       exit(1);
51263   }
51264
51265   if((s = socket(PF_INET6, stype, ptype)) < 0) {
51266      perror("socket");
51267      exit(1);
51268   }
51269
51270   optval = 1;
51271   optlen = sizeof(optval);
51272   if(setsockopt(s, IPPROTO_IPV6, IPV6_PKTINFO, &optval, optlen) < 0) {
51273      perror("setsockopt: IPPROTO_IPV6 IPV6_PKTINFO");
51274      close(s);
51275      exit(1);
51276   }
51277  ;
51278  return 0;
51279}
51280_ACEOF
51281if ac_fn_c_try_compile "$LINENO"; then :
51282  _compileok=1
51283fi
51284rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51285
51286  if test x"${_compileok}" != x; then
51287    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
51288$as_echo "yes" >&6; }
51289
51290cat >>confdefs.h <<_ACEOF
51291#define HAVE_IPV6_PKTINFO 1
51292_ACEOF
51293
51294cat >>confdefs.h <<_ACEOF
51295#define SOCKS_IPV6_PKTINFO_LVL IPPROTO_IPV6
51296_ACEOF
51297
51298cat >>confdefs.h <<_ACEOF
51299#define SOCKS_IPV6_PKTINFO_NAME "ipv6_pktinfo"
51300_ACEOF
51301    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
51302       #ipv4-only
51303
51304cat >>confdefs.h <<_ACEOF
51305#define SOCKS_IPV6_PKTINFO_IPV4 1
51306_ACEOF
51307
51308cat >>confdefs.h <<_ACEOF
51309#define SOCKS_IPV6_PKTINFO_IPV6 0
51310_ACEOF
51311    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
51312       #ipv6-only
51313
51314cat >>confdefs.h <<_ACEOF
51315#define SOCKS_IPV6_PKTINFO_IPV4 0
51316_ACEOF
51317
51318cat >>confdefs.h <<_ACEOF
51319#define SOCKS_IPV6_PKTINFO_IPV6 1
51320_ACEOF
51321    else
51322       #both ipv4 and ipv6
51323
51324cat >>confdefs.h <<_ACEOF
51325#define SOCKS_IPV6_PKTINFO_IPV4 1
51326_ACEOF
51327
51328cat >>confdefs.h <<_ACEOF
51329#define SOCKS_IPV6_PKTINFO_IPV6 1
51330_ACEOF
51331    fi
51332    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_PKTINFO"
51333  else
51334    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
51335$as_echo "no" >&6; }
51336  fi
51337unset _compileok
51338  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_PORTRANGE" >&5
51339$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_PORTRANGE... " >&6; }
51340  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51341/* end confdefs.h.  */
51342
51343#include <sys/types.h>
51344#include <sys/socket.h>
51345#include <netinet/in.h>
51346#include <netinet/tcp.h>
51347#include <netinet/udp.h>
51348
51349#include <stdio.h>
51350#include <stdlib.h>
51351#include <unistd.h>
51352
51353int
51354main ()
51355{
51356
51357   socklen_t optlen;
51358   int optval;
51359   int stype;
51360   int ptype;
51361   int s;
51362
51363   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51364      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51365      ptype = IPPROTO_TCP;
51366   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51367      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51368      ptype = IPPROTO_IP;
51369   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51370      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51371      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51372   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51373      stype = SOCK_DGRAM;
51374      ptype = IPPROTO_UDP;
51375   } else {
51376       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51377       exit(1);
51378   }
51379
51380   if((s = socket(PF_INET, stype, ptype)) < 0) {
51381      perror("socket");
51382      exit(1);
51383   }
51384
51385   optval = 1;
51386   optlen = sizeof(optval);
51387   if(setsockopt(s, IPPROTO_IPV6, IPV6_PORTRANGE, &optval, optlen) < 0) {
51388      perror("setsockopt: IPPROTO_IPV6 IPV6_PORTRANGE");
51389      close(s);
51390      exit(1);
51391   }
51392  ;
51393  return 0;
51394}
51395_ACEOF
51396if ac_fn_c_try_compile "$LINENO"; then :
51397  _compileok=1
51398fi
51399rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51400
51401  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51402/* end confdefs.h.  */
51403
51404#include <sys/types.h>
51405#include <sys/socket.h>
51406#include <netinet/in.h>
51407#include <netinet/tcp.h>
51408#include <netinet/udp.h>
51409
51410#include <stdio.h>
51411#include <stdlib.h>
51412#include <unistd.h>
51413
51414int
51415main ()
51416{
51417
51418   socklen_t optlen;
51419   int optval;
51420   int stype;
51421   int ptype;
51422   int s;
51423
51424   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51425      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51426      ptype = IPPROTO_TCP;
51427   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51428      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51429      ptype = IPPROTO_IP;
51430   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51431      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51432      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51433   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51434      stype = SOCK_DGRAM;
51435      ptype = IPPROTO_UDP;
51436   } else {
51437       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51438       exit(1);
51439   }
51440
51441   if((s = socket(PF_INET6, stype, ptype)) < 0) {
51442      perror("socket");
51443      exit(1);
51444   }
51445
51446   optval = 1;
51447   optlen = sizeof(optval);
51448   if(setsockopt(s, IPPROTO_IPV6, IPV6_PORTRANGE, &optval, optlen) < 0) {
51449      perror("setsockopt: IPPROTO_IPV6 IPV6_PORTRANGE");
51450      close(s);
51451      exit(1);
51452   }
51453  ;
51454  return 0;
51455}
51456_ACEOF
51457if ac_fn_c_try_compile "$LINENO"; then :
51458  _compileok=1
51459fi
51460rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51461
51462  if test x"${_compileok}" != x; then
51463    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
51464$as_echo "yes" >&6; }
51465
51466cat >>confdefs.h <<_ACEOF
51467#define HAVE_IPV6_PORTRANGE 1
51468_ACEOF
51469
51470cat >>confdefs.h <<_ACEOF
51471#define SOCKS_IPV6_PORTRANGE_LVL IPPROTO_IPV6
51472_ACEOF
51473
51474cat >>confdefs.h <<_ACEOF
51475#define SOCKS_IPV6_PORTRANGE_NAME "ipv6_portrange"
51476_ACEOF
51477    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
51478       #ipv4-only
51479
51480cat >>confdefs.h <<_ACEOF
51481#define SOCKS_IPV6_PORTRANGE_IPV4 1
51482_ACEOF
51483
51484cat >>confdefs.h <<_ACEOF
51485#define SOCKS_IPV6_PORTRANGE_IPV6 0
51486_ACEOF
51487    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
51488       #ipv6-only
51489
51490cat >>confdefs.h <<_ACEOF
51491#define SOCKS_IPV6_PORTRANGE_IPV4 0
51492_ACEOF
51493
51494cat >>confdefs.h <<_ACEOF
51495#define SOCKS_IPV6_PORTRANGE_IPV6 1
51496_ACEOF
51497    else
51498       #both ipv4 and ipv6
51499
51500cat >>confdefs.h <<_ACEOF
51501#define SOCKS_IPV6_PORTRANGE_IPV4 1
51502_ACEOF
51503
51504cat >>confdefs.h <<_ACEOF
51505#define SOCKS_IPV6_PORTRANGE_IPV6 1
51506_ACEOF
51507    fi
51508    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_PORTRANGE"
51509  else
51510    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
51511$as_echo "no" >&6; }
51512  fi
51513unset _compileok
51514  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RETOPTS" >&5
51515$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RETOPTS... " >&6; }
51516  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51517/* end confdefs.h.  */
51518
51519#include <sys/types.h>
51520#include <sys/socket.h>
51521#include <netinet/in.h>
51522#include <netinet/tcp.h>
51523#include <netinet/udp.h>
51524
51525#include <stdio.h>
51526#include <stdlib.h>
51527#include <unistd.h>
51528
51529int
51530main ()
51531{
51532
51533   socklen_t optlen;
51534   int optval;
51535   int stype;
51536   int ptype;
51537   int s;
51538
51539   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51540      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51541      ptype = IPPROTO_TCP;
51542   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51543      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51544      ptype = IPPROTO_IP;
51545   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51546      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51547      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51548   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51549      stype = SOCK_DGRAM;
51550      ptype = IPPROTO_UDP;
51551   } else {
51552       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51553       exit(1);
51554   }
51555
51556   if((s = socket(PF_INET, stype, ptype)) < 0) {
51557      perror("socket");
51558      exit(1);
51559   }
51560
51561   optval = 1;
51562   optlen = sizeof(optval);
51563   if(setsockopt(s, IPPROTO_IPV6, IPV6_RETOPTS, &optval, optlen) < 0) {
51564      perror("setsockopt: IPPROTO_IPV6 IPV6_RETOPTS");
51565      close(s);
51566      exit(1);
51567   }
51568  ;
51569  return 0;
51570}
51571_ACEOF
51572if ac_fn_c_try_compile "$LINENO"; then :
51573  _compileok=1
51574fi
51575rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51576
51577  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51578/* end confdefs.h.  */
51579
51580#include <sys/types.h>
51581#include <sys/socket.h>
51582#include <netinet/in.h>
51583#include <netinet/tcp.h>
51584#include <netinet/udp.h>
51585
51586#include <stdio.h>
51587#include <stdlib.h>
51588#include <unistd.h>
51589
51590int
51591main ()
51592{
51593
51594   socklen_t optlen;
51595   int optval;
51596   int stype;
51597   int ptype;
51598   int s;
51599
51600   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51601      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51602      ptype = IPPROTO_TCP;
51603   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51604      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51605      ptype = IPPROTO_IP;
51606   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51607      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51608      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51609   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51610      stype = SOCK_DGRAM;
51611      ptype = IPPROTO_UDP;
51612   } else {
51613       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51614       exit(1);
51615   }
51616
51617   if((s = socket(PF_INET6, stype, ptype)) < 0) {
51618      perror("socket");
51619      exit(1);
51620   }
51621
51622   optval = 1;
51623   optlen = sizeof(optval);
51624   if(setsockopt(s, IPPROTO_IPV6, IPV6_RETOPTS, &optval, optlen) < 0) {
51625      perror("setsockopt: IPPROTO_IPV6 IPV6_RETOPTS");
51626      close(s);
51627      exit(1);
51628   }
51629  ;
51630  return 0;
51631}
51632_ACEOF
51633if ac_fn_c_try_compile "$LINENO"; then :
51634  _compileok=1
51635fi
51636rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51637
51638  if test x"${_compileok}" != x; then
51639    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
51640$as_echo "yes" >&6; }
51641
51642cat >>confdefs.h <<_ACEOF
51643#define HAVE_IPV6_RETOPTS 1
51644_ACEOF
51645
51646cat >>confdefs.h <<_ACEOF
51647#define SOCKS_IPV6_RETOPTS_LVL IPPROTO_IPV6
51648_ACEOF
51649
51650cat >>confdefs.h <<_ACEOF
51651#define SOCKS_IPV6_RETOPTS_NAME "ipv6_retopts"
51652_ACEOF
51653    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
51654       #ipv4-only
51655
51656cat >>confdefs.h <<_ACEOF
51657#define SOCKS_IPV6_RETOPTS_IPV4 1
51658_ACEOF
51659
51660cat >>confdefs.h <<_ACEOF
51661#define SOCKS_IPV6_RETOPTS_IPV6 0
51662_ACEOF
51663    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
51664       #ipv6-only
51665
51666cat >>confdefs.h <<_ACEOF
51667#define SOCKS_IPV6_RETOPTS_IPV4 0
51668_ACEOF
51669
51670cat >>confdefs.h <<_ACEOF
51671#define SOCKS_IPV6_RETOPTS_IPV6 1
51672_ACEOF
51673    else
51674       #both ipv4 and ipv6
51675
51676cat >>confdefs.h <<_ACEOF
51677#define SOCKS_IPV6_RETOPTS_IPV4 1
51678_ACEOF
51679
51680cat >>confdefs.h <<_ACEOF
51681#define SOCKS_IPV6_RETOPTS_IPV6 1
51682_ACEOF
51683    fi
51684    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RETOPTS"
51685  else
51686    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
51687$as_echo "no" >&6; }
51688  fi
51689unset _compileok
51690  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ROUTER_ALERT" >&5
51691$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ROUTER_ALERT... " >&6; }
51692  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51693/* end confdefs.h.  */
51694
51695#include <sys/types.h>
51696#include <sys/socket.h>
51697#include <netinet/in.h>
51698#include <netinet/tcp.h>
51699#include <netinet/udp.h>
51700
51701#include <stdio.h>
51702#include <stdlib.h>
51703#include <unistd.h>
51704
51705int
51706main ()
51707{
51708
51709   socklen_t optlen;
51710   int optval;
51711   int stype;
51712   int ptype;
51713   int s;
51714
51715   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51716      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51717      ptype = IPPROTO_TCP;
51718   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51719      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51720      ptype = IPPROTO_IP;
51721   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51722      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51723      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51724   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51725      stype = SOCK_DGRAM;
51726      ptype = IPPROTO_UDP;
51727   } else {
51728       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51729       exit(1);
51730   }
51731
51732   if((s = socket(PF_INET, stype, ptype)) < 0) {
51733      perror("socket");
51734      exit(1);
51735   }
51736
51737   optval = 1;
51738   optlen = sizeof(optval);
51739   if(setsockopt(s, IPPROTO_IPV6, IPV6_ROUTER_ALERT, &optval, optlen) < 0) {
51740      perror("setsockopt: IPPROTO_IPV6 IPV6_ROUTER_ALERT");
51741      close(s);
51742      exit(1);
51743   }
51744  ;
51745  return 0;
51746}
51747_ACEOF
51748if ac_fn_c_try_compile "$LINENO"; then :
51749  _compileok=1
51750fi
51751rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51752
51753  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51754/* end confdefs.h.  */
51755
51756#include <sys/types.h>
51757#include <sys/socket.h>
51758#include <netinet/in.h>
51759#include <netinet/tcp.h>
51760#include <netinet/udp.h>
51761
51762#include <stdio.h>
51763#include <stdlib.h>
51764#include <unistd.h>
51765
51766int
51767main ()
51768{
51769
51770   socklen_t optlen;
51771   int optval;
51772   int stype;
51773   int ptype;
51774   int s;
51775
51776   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51777      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51778      ptype = IPPROTO_TCP;
51779   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51780      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51781      ptype = IPPROTO_IP;
51782   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51783      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51784      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51785   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51786      stype = SOCK_DGRAM;
51787      ptype = IPPROTO_UDP;
51788   } else {
51789       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51790       exit(1);
51791   }
51792
51793   if((s = socket(PF_INET6, stype, ptype)) < 0) {
51794      perror("socket");
51795      exit(1);
51796   }
51797
51798   optval = 1;
51799   optlen = sizeof(optval);
51800   if(setsockopt(s, IPPROTO_IPV6, IPV6_ROUTER_ALERT, &optval, optlen) < 0) {
51801      perror("setsockopt: IPPROTO_IPV6 IPV6_ROUTER_ALERT");
51802      close(s);
51803      exit(1);
51804   }
51805  ;
51806  return 0;
51807}
51808_ACEOF
51809if ac_fn_c_try_compile "$LINENO"; then :
51810  _compileok=1
51811fi
51812rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51813
51814  if test x"${_compileok}" != x; then
51815    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
51816$as_echo "yes" >&6; }
51817
51818cat >>confdefs.h <<_ACEOF
51819#define HAVE_IPV6_ROUTER_ALERT 1
51820_ACEOF
51821
51822cat >>confdefs.h <<_ACEOF
51823#define SOCKS_IPV6_ROUTER_ALERT_LVL IPPROTO_IPV6
51824_ACEOF
51825
51826cat >>confdefs.h <<_ACEOF
51827#define SOCKS_IPV6_ROUTER_ALERT_NAME "ipv6_router_alert"
51828_ACEOF
51829    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
51830       #ipv4-only
51831
51832cat >>confdefs.h <<_ACEOF
51833#define SOCKS_IPV6_ROUTER_ALERT_IPV4 1
51834_ACEOF
51835
51836cat >>confdefs.h <<_ACEOF
51837#define SOCKS_IPV6_ROUTER_ALERT_IPV6 0
51838_ACEOF
51839    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
51840       #ipv6-only
51841
51842cat >>confdefs.h <<_ACEOF
51843#define SOCKS_IPV6_ROUTER_ALERT_IPV4 0
51844_ACEOF
51845
51846cat >>confdefs.h <<_ACEOF
51847#define SOCKS_IPV6_ROUTER_ALERT_IPV6 1
51848_ACEOF
51849    else
51850       #both ipv4 and ipv6
51851
51852cat >>confdefs.h <<_ACEOF
51853#define SOCKS_IPV6_ROUTER_ALERT_IPV4 1
51854_ACEOF
51855
51856cat >>confdefs.h <<_ACEOF
51857#define SOCKS_IPV6_ROUTER_ALERT_IPV6 1
51858_ACEOF
51859    fi
51860    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ROUTER_ALERT"
51861  else
51862    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
51863$as_echo "no" >&6; }
51864  fi
51865unset _compileok
51866  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RTHDR" >&5
51867$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RTHDR... " >&6; }
51868  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51869/* end confdefs.h.  */
51870
51871#include <sys/types.h>
51872#include <sys/socket.h>
51873#include <netinet/in.h>
51874#include <netinet/tcp.h>
51875#include <netinet/udp.h>
51876
51877#include <stdio.h>
51878#include <stdlib.h>
51879#include <unistd.h>
51880
51881int
51882main ()
51883{
51884
51885   socklen_t optlen;
51886   int optval;
51887   int stype;
51888   int ptype;
51889   int s;
51890
51891   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51892      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51893      ptype = IPPROTO_TCP;
51894   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51895      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51896      ptype = IPPROTO_IP;
51897   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51898      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51899      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51900   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51901      stype = SOCK_DGRAM;
51902      ptype = IPPROTO_UDP;
51903   } else {
51904       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51905       exit(1);
51906   }
51907
51908   if((s = socket(PF_INET, stype, ptype)) < 0) {
51909      perror("socket");
51910      exit(1);
51911   }
51912
51913   optval = 1;
51914   optlen = sizeof(optval);
51915   if(setsockopt(s, IPPROTO_IPV6, IPV6_RTHDR, &optval, optlen) < 0) {
51916      perror("setsockopt: IPPROTO_IPV6 IPV6_RTHDR");
51917      close(s);
51918      exit(1);
51919   }
51920  ;
51921  return 0;
51922}
51923_ACEOF
51924if ac_fn_c_try_compile "$LINENO"; then :
51925  _compileok=1
51926fi
51927rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51928
51929  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
51930/* end confdefs.h.  */
51931
51932#include <sys/types.h>
51933#include <sys/socket.h>
51934#include <netinet/in.h>
51935#include <netinet/tcp.h>
51936#include <netinet/udp.h>
51937
51938#include <stdio.h>
51939#include <stdlib.h>
51940#include <unistd.h>
51941
51942int
51943main ()
51944{
51945
51946   socklen_t optlen;
51947   int optval;
51948   int stype;
51949   int ptype;
51950   int s;
51951
51952   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
51953      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
51954      ptype = IPPROTO_TCP;
51955   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
51956      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
51957      ptype = IPPROTO_IP;
51958   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
51959      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
51960      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
51961   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
51962      stype = SOCK_DGRAM;
51963      ptype = IPPROTO_UDP;
51964   } else {
51965       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
51966       exit(1);
51967   }
51968
51969   if((s = socket(PF_INET6, stype, ptype)) < 0) {
51970      perror("socket");
51971      exit(1);
51972   }
51973
51974   optval = 1;
51975   optlen = sizeof(optval);
51976   if(setsockopt(s, IPPROTO_IPV6, IPV6_RTHDR, &optval, optlen) < 0) {
51977      perror("setsockopt: IPPROTO_IPV6 IPV6_RTHDR");
51978      close(s);
51979      exit(1);
51980   }
51981  ;
51982  return 0;
51983}
51984_ACEOF
51985if ac_fn_c_try_compile "$LINENO"; then :
51986  _compileok=1
51987fi
51988rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
51989
51990  if test x"${_compileok}" != x; then
51991    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
51992$as_echo "yes" >&6; }
51993
51994cat >>confdefs.h <<_ACEOF
51995#define HAVE_IPV6_RTHDR 1
51996_ACEOF
51997
51998cat >>confdefs.h <<_ACEOF
51999#define SOCKS_IPV6_RTHDR_LVL IPPROTO_IPV6
52000_ACEOF
52001
52002cat >>confdefs.h <<_ACEOF
52003#define SOCKS_IPV6_RTHDR_NAME "ipv6_rthdr"
52004_ACEOF
52005    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
52006       #ipv4-only
52007
52008cat >>confdefs.h <<_ACEOF
52009#define SOCKS_IPV6_RTHDR_IPV4 1
52010_ACEOF
52011
52012cat >>confdefs.h <<_ACEOF
52013#define SOCKS_IPV6_RTHDR_IPV6 0
52014_ACEOF
52015    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
52016       #ipv6-only
52017
52018cat >>confdefs.h <<_ACEOF
52019#define SOCKS_IPV6_RTHDR_IPV4 0
52020_ACEOF
52021
52022cat >>confdefs.h <<_ACEOF
52023#define SOCKS_IPV6_RTHDR_IPV6 1
52024_ACEOF
52025    else
52026       #both ipv4 and ipv6
52027
52028cat >>confdefs.h <<_ACEOF
52029#define SOCKS_IPV6_RTHDR_IPV4 1
52030_ACEOF
52031
52032cat >>confdefs.h <<_ACEOF
52033#define SOCKS_IPV6_RTHDR_IPV6 1
52034_ACEOF
52035    fi
52036    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RTHDR"
52037  else
52038    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
52039$as_echo "no" >&6; }
52040  fi
52041unset _compileok
52042  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RTHDRDSTOPTS" >&5
52043$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RTHDRDSTOPTS... " >&6; }
52044  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52045/* end confdefs.h.  */
52046
52047#include <sys/types.h>
52048#include <sys/socket.h>
52049#include <netinet/in.h>
52050#include <netinet/tcp.h>
52051#include <netinet/udp.h>
52052
52053#include <stdio.h>
52054#include <stdlib.h>
52055#include <unistd.h>
52056
52057int
52058main ()
52059{
52060
52061   socklen_t optlen;
52062   int optval;
52063   int stype;
52064   int ptype;
52065   int s;
52066
52067   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52068      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52069      ptype = IPPROTO_TCP;
52070   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52071      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52072      ptype = IPPROTO_IP;
52073   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52074      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52075      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52076   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52077      stype = SOCK_DGRAM;
52078      ptype = IPPROTO_UDP;
52079   } else {
52080       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52081       exit(1);
52082   }
52083
52084   if((s = socket(PF_INET, stype, ptype)) < 0) {
52085      perror("socket");
52086      exit(1);
52087   }
52088
52089   optval = 1;
52090   optlen = sizeof(optval);
52091   if(setsockopt(s, IPPROTO_IPV6, IPV6_RTHDRDSTOPTS, &optval, optlen) < 0) {
52092      perror("setsockopt: IPPROTO_IPV6 IPV6_RTHDRDSTOPTS");
52093      close(s);
52094      exit(1);
52095   }
52096  ;
52097  return 0;
52098}
52099_ACEOF
52100if ac_fn_c_try_compile "$LINENO"; then :
52101  _compileok=1
52102fi
52103rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52104
52105  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52106/* end confdefs.h.  */
52107
52108#include <sys/types.h>
52109#include <sys/socket.h>
52110#include <netinet/in.h>
52111#include <netinet/tcp.h>
52112#include <netinet/udp.h>
52113
52114#include <stdio.h>
52115#include <stdlib.h>
52116#include <unistd.h>
52117
52118int
52119main ()
52120{
52121
52122   socklen_t optlen;
52123   int optval;
52124   int stype;
52125   int ptype;
52126   int s;
52127
52128   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52129      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52130      ptype = IPPROTO_TCP;
52131   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52132      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52133      ptype = IPPROTO_IP;
52134   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52135      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52136      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52137   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52138      stype = SOCK_DGRAM;
52139      ptype = IPPROTO_UDP;
52140   } else {
52141       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52142       exit(1);
52143   }
52144
52145   if((s = socket(PF_INET6, stype, ptype)) < 0) {
52146      perror("socket");
52147      exit(1);
52148   }
52149
52150   optval = 1;
52151   optlen = sizeof(optval);
52152   if(setsockopt(s, IPPROTO_IPV6, IPV6_RTHDRDSTOPTS, &optval, optlen) < 0) {
52153      perror("setsockopt: IPPROTO_IPV6 IPV6_RTHDRDSTOPTS");
52154      close(s);
52155      exit(1);
52156   }
52157  ;
52158  return 0;
52159}
52160_ACEOF
52161if ac_fn_c_try_compile "$LINENO"; then :
52162  _compileok=1
52163fi
52164rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52165
52166  if test x"${_compileok}" != x; then
52167    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
52168$as_echo "yes" >&6; }
52169
52170cat >>confdefs.h <<_ACEOF
52171#define HAVE_IPV6_RTHDRDSTOPTS 1
52172_ACEOF
52173
52174cat >>confdefs.h <<_ACEOF
52175#define SOCKS_IPV6_RTHDRDSTOPTS_LVL IPPROTO_IPV6
52176_ACEOF
52177
52178cat >>confdefs.h <<_ACEOF
52179#define SOCKS_IPV6_RTHDRDSTOPTS_NAME "ipv6_rthdrdstopts"
52180_ACEOF
52181    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
52182       #ipv4-only
52183
52184cat >>confdefs.h <<_ACEOF
52185#define SOCKS_IPV6_RTHDRDSTOPTS_IPV4 1
52186_ACEOF
52187
52188cat >>confdefs.h <<_ACEOF
52189#define SOCKS_IPV6_RTHDRDSTOPTS_IPV6 0
52190_ACEOF
52191    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
52192       #ipv6-only
52193
52194cat >>confdefs.h <<_ACEOF
52195#define SOCKS_IPV6_RTHDRDSTOPTS_IPV4 0
52196_ACEOF
52197
52198cat >>confdefs.h <<_ACEOF
52199#define SOCKS_IPV6_RTHDRDSTOPTS_IPV6 1
52200_ACEOF
52201    else
52202       #both ipv4 and ipv6
52203
52204cat >>confdefs.h <<_ACEOF
52205#define SOCKS_IPV6_RTHDRDSTOPTS_IPV4 1
52206_ACEOF
52207
52208cat >>confdefs.h <<_ACEOF
52209#define SOCKS_IPV6_RTHDRDSTOPTS_IPV6 1
52210_ACEOF
52211    fi
52212    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RTHDRDSTOPTS"
52213  else
52214    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
52215$as_echo "no" >&6; }
52216  fi
52217unset _compileok
52218  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_TCLASS" >&5
52219$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_TCLASS... " >&6; }
52220  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52221/* end confdefs.h.  */
52222
52223#include <sys/types.h>
52224#include <sys/socket.h>
52225#include <netinet/in.h>
52226#include <netinet/tcp.h>
52227#include <netinet/udp.h>
52228
52229#include <stdio.h>
52230#include <stdlib.h>
52231#include <unistd.h>
52232
52233int
52234main ()
52235{
52236
52237   socklen_t optlen;
52238   int optval;
52239   int stype;
52240   int ptype;
52241   int s;
52242
52243   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52244      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52245      ptype = IPPROTO_TCP;
52246   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52247      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52248      ptype = IPPROTO_IP;
52249   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52250      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52251      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52252   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52253      stype = SOCK_DGRAM;
52254      ptype = IPPROTO_UDP;
52255   } else {
52256       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52257       exit(1);
52258   }
52259
52260   if((s = socket(PF_INET, stype, ptype)) < 0) {
52261      perror("socket");
52262      exit(1);
52263   }
52264
52265   optval = 1;
52266   optlen = sizeof(optval);
52267   if(setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &optval, optlen) < 0) {
52268      perror("setsockopt: IPPROTO_IPV6 IPV6_TCLASS");
52269      close(s);
52270      exit(1);
52271   }
52272  ;
52273  return 0;
52274}
52275_ACEOF
52276if ac_fn_c_try_compile "$LINENO"; then :
52277  _compileok=1
52278fi
52279rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52280
52281  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52282/* end confdefs.h.  */
52283
52284#include <sys/types.h>
52285#include <sys/socket.h>
52286#include <netinet/in.h>
52287#include <netinet/tcp.h>
52288#include <netinet/udp.h>
52289
52290#include <stdio.h>
52291#include <stdlib.h>
52292#include <unistd.h>
52293
52294int
52295main ()
52296{
52297
52298   socklen_t optlen;
52299   int optval;
52300   int stype;
52301   int ptype;
52302   int s;
52303
52304   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52305      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52306      ptype = IPPROTO_TCP;
52307   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52308      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52309      ptype = IPPROTO_IP;
52310   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52311      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52312      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52313   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52314      stype = SOCK_DGRAM;
52315      ptype = IPPROTO_UDP;
52316   } else {
52317       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52318       exit(1);
52319   }
52320
52321   if((s = socket(PF_INET6, stype, ptype)) < 0) {
52322      perror("socket");
52323      exit(1);
52324   }
52325
52326   optval = 1;
52327   optlen = sizeof(optval);
52328   if(setsockopt(s, IPPROTO_IPV6, IPV6_TCLASS, &optval, optlen) < 0) {
52329      perror("setsockopt: IPPROTO_IPV6 IPV6_TCLASS");
52330      close(s);
52331      exit(1);
52332   }
52333  ;
52334  return 0;
52335}
52336_ACEOF
52337if ac_fn_c_try_compile "$LINENO"; then :
52338  _compileok=1
52339fi
52340rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52341
52342  if test x"${_compileok}" != x; then
52343    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
52344$as_echo "yes" >&6; }
52345
52346cat >>confdefs.h <<_ACEOF
52347#define HAVE_IPV6_TCLASS 1
52348_ACEOF
52349
52350cat >>confdefs.h <<_ACEOF
52351#define SOCKS_IPV6_TCLASS_LVL IPPROTO_IPV6
52352_ACEOF
52353
52354cat >>confdefs.h <<_ACEOF
52355#define SOCKS_IPV6_TCLASS_NAME "ipv6_tclass"
52356_ACEOF
52357    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
52358       #ipv4-only
52359
52360cat >>confdefs.h <<_ACEOF
52361#define SOCKS_IPV6_TCLASS_IPV4 1
52362_ACEOF
52363
52364cat >>confdefs.h <<_ACEOF
52365#define SOCKS_IPV6_TCLASS_IPV6 0
52366_ACEOF
52367    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
52368       #ipv6-only
52369
52370cat >>confdefs.h <<_ACEOF
52371#define SOCKS_IPV6_TCLASS_IPV4 0
52372_ACEOF
52373
52374cat >>confdefs.h <<_ACEOF
52375#define SOCKS_IPV6_TCLASS_IPV6 1
52376_ACEOF
52377    else
52378       #both ipv4 and ipv6
52379
52380cat >>confdefs.h <<_ACEOF
52381#define SOCKS_IPV6_TCLASS_IPV4 1
52382_ACEOF
52383
52384cat >>confdefs.h <<_ACEOF
52385#define SOCKS_IPV6_TCLASS_IPV6 1
52386_ACEOF
52387    fi
52388    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_TCLASS"
52389  else
52390    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
52391$as_echo "no" >&6; }
52392  fi
52393unset _compileok
52394  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_TRANSPARENT" >&5
52395$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_TRANSPARENT... " >&6; }
52396  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52397/* end confdefs.h.  */
52398
52399#include <sys/types.h>
52400#include <sys/socket.h>
52401#include <netinet/in.h>
52402#include <netinet/tcp.h>
52403#include <netinet/udp.h>
52404
52405#include <stdio.h>
52406#include <stdlib.h>
52407#include <unistd.h>
52408
52409int
52410main ()
52411{
52412
52413   socklen_t optlen;
52414   int optval;
52415   int stype;
52416   int ptype;
52417   int s;
52418
52419   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52420      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52421      ptype = IPPROTO_TCP;
52422   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52423      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52424      ptype = IPPROTO_IP;
52425   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52426      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52427      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52428   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52429      stype = SOCK_DGRAM;
52430      ptype = IPPROTO_UDP;
52431   } else {
52432       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52433       exit(1);
52434   }
52435
52436   if((s = socket(PF_INET, stype, ptype)) < 0) {
52437      perror("socket");
52438      exit(1);
52439   }
52440
52441   optval = 1;
52442   optlen = sizeof(optval);
52443   if(setsockopt(s, IPPROTO_IPV6, IPV6_TRANSPARENT, &optval, optlen) < 0) {
52444      perror("setsockopt: IPPROTO_IPV6 IPV6_TRANSPARENT");
52445      close(s);
52446      exit(1);
52447   }
52448  ;
52449  return 0;
52450}
52451_ACEOF
52452if ac_fn_c_try_compile "$LINENO"; then :
52453  _compileok=1
52454fi
52455rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52456
52457  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52458/* end confdefs.h.  */
52459
52460#include <sys/types.h>
52461#include <sys/socket.h>
52462#include <netinet/in.h>
52463#include <netinet/tcp.h>
52464#include <netinet/udp.h>
52465
52466#include <stdio.h>
52467#include <stdlib.h>
52468#include <unistd.h>
52469
52470int
52471main ()
52472{
52473
52474   socklen_t optlen;
52475   int optval;
52476   int stype;
52477   int ptype;
52478   int s;
52479
52480   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52481      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52482      ptype = IPPROTO_TCP;
52483   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52484      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52485      ptype = IPPROTO_IP;
52486   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52487      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52488      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52489   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52490      stype = SOCK_DGRAM;
52491      ptype = IPPROTO_UDP;
52492   } else {
52493       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52494       exit(1);
52495   }
52496
52497   if((s = socket(PF_INET6, stype, ptype)) < 0) {
52498      perror("socket");
52499      exit(1);
52500   }
52501
52502   optval = 1;
52503   optlen = sizeof(optval);
52504   if(setsockopt(s, IPPROTO_IPV6, IPV6_TRANSPARENT, &optval, optlen) < 0) {
52505      perror("setsockopt: IPPROTO_IPV6 IPV6_TRANSPARENT");
52506      close(s);
52507      exit(1);
52508   }
52509  ;
52510  return 0;
52511}
52512_ACEOF
52513if ac_fn_c_try_compile "$LINENO"; then :
52514  _compileok=1
52515fi
52516rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52517
52518  if test x"${_compileok}" != x; then
52519    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
52520$as_echo "yes" >&6; }
52521
52522cat >>confdefs.h <<_ACEOF
52523#define HAVE_IPV6_TRANSPARENT 1
52524_ACEOF
52525
52526cat >>confdefs.h <<_ACEOF
52527#define SOCKS_IPV6_TRANSPARENT_LVL IPPROTO_IPV6
52528_ACEOF
52529
52530cat >>confdefs.h <<_ACEOF
52531#define SOCKS_IPV6_TRANSPARENT_NAME "ipv6_transparent"
52532_ACEOF
52533    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
52534       #ipv4-only
52535
52536cat >>confdefs.h <<_ACEOF
52537#define SOCKS_IPV6_TRANSPARENT_IPV4 1
52538_ACEOF
52539
52540cat >>confdefs.h <<_ACEOF
52541#define SOCKS_IPV6_TRANSPARENT_IPV6 0
52542_ACEOF
52543    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
52544       #ipv6-only
52545
52546cat >>confdefs.h <<_ACEOF
52547#define SOCKS_IPV6_TRANSPARENT_IPV4 0
52548_ACEOF
52549
52550cat >>confdefs.h <<_ACEOF
52551#define SOCKS_IPV6_TRANSPARENT_IPV6 1
52552_ACEOF
52553    else
52554       #both ipv4 and ipv6
52555
52556cat >>confdefs.h <<_ACEOF
52557#define SOCKS_IPV6_TRANSPARENT_IPV4 1
52558_ACEOF
52559
52560cat >>confdefs.h <<_ACEOF
52561#define SOCKS_IPV6_TRANSPARENT_IPV6 1
52562_ACEOF
52563    fi
52564    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_TRANSPARENT"
52565  else
52566    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
52567$as_echo "no" >&6; }
52568  fi
52569unset _compileok
52570  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_UNICAST_HOPS" >&5
52571$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_UNICAST_HOPS... " >&6; }
52572  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52573/* end confdefs.h.  */
52574
52575#include <sys/types.h>
52576#include <sys/socket.h>
52577#include <netinet/in.h>
52578#include <netinet/tcp.h>
52579#include <netinet/udp.h>
52580
52581#include <stdio.h>
52582#include <stdlib.h>
52583#include <unistd.h>
52584
52585int
52586main ()
52587{
52588
52589   socklen_t optlen;
52590   int optval;
52591   int stype;
52592   int ptype;
52593   int s;
52594
52595   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52596      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52597      ptype = IPPROTO_TCP;
52598   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52599      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52600      ptype = IPPROTO_IP;
52601   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52602      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52603      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52604   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52605      stype = SOCK_DGRAM;
52606      ptype = IPPROTO_UDP;
52607   } else {
52608       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52609       exit(1);
52610   }
52611
52612   if((s = socket(PF_INET, stype, ptype)) < 0) {
52613      perror("socket");
52614      exit(1);
52615   }
52616
52617   optval = 1;
52618   optlen = sizeof(optval);
52619   if(setsockopt(s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &optval, optlen) < 0) {
52620      perror("setsockopt: IPPROTO_IPV6 IPV6_UNICAST_HOPS");
52621      close(s);
52622      exit(1);
52623   }
52624  ;
52625  return 0;
52626}
52627_ACEOF
52628if ac_fn_c_try_compile "$LINENO"; then :
52629  _compileok=1
52630fi
52631rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52632
52633  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52634/* end confdefs.h.  */
52635
52636#include <sys/types.h>
52637#include <sys/socket.h>
52638#include <netinet/in.h>
52639#include <netinet/tcp.h>
52640#include <netinet/udp.h>
52641
52642#include <stdio.h>
52643#include <stdlib.h>
52644#include <unistd.h>
52645
52646int
52647main ()
52648{
52649
52650   socklen_t optlen;
52651   int optval;
52652   int stype;
52653   int ptype;
52654   int s;
52655
52656   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52657      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52658      ptype = IPPROTO_TCP;
52659   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52660      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52661      ptype = IPPROTO_IP;
52662   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52663      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52664      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52665   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52666      stype = SOCK_DGRAM;
52667      ptype = IPPROTO_UDP;
52668   } else {
52669       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52670       exit(1);
52671   }
52672
52673   if((s = socket(PF_INET6, stype, ptype)) < 0) {
52674      perror("socket");
52675      exit(1);
52676   }
52677
52678   optval = 1;
52679   optlen = sizeof(optval);
52680   if(setsockopt(s, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &optval, optlen) < 0) {
52681      perror("setsockopt: IPPROTO_IPV6 IPV6_UNICAST_HOPS");
52682      close(s);
52683      exit(1);
52684   }
52685  ;
52686  return 0;
52687}
52688_ACEOF
52689if ac_fn_c_try_compile "$LINENO"; then :
52690  _compileok=1
52691fi
52692rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52693
52694  if test x"${_compileok}" != x; then
52695    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
52696$as_echo "yes" >&6; }
52697
52698cat >>confdefs.h <<_ACEOF
52699#define HAVE_IPV6_UNICAST_HOPS 1
52700_ACEOF
52701
52702cat >>confdefs.h <<_ACEOF
52703#define SOCKS_IPV6_UNICAST_HOPS_LVL IPPROTO_IPV6
52704_ACEOF
52705
52706cat >>confdefs.h <<_ACEOF
52707#define SOCKS_IPV6_UNICAST_HOPS_NAME "ipv6_unicast_hops"
52708_ACEOF
52709    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
52710       #ipv4-only
52711
52712cat >>confdefs.h <<_ACEOF
52713#define SOCKS_IPV6_UNICAST_HOPS_IPV4 1
52714_ACEOF
52715
52716cat >>confdefs.h <<_ACEOF
52717#define SOCKS_IPV6_UNICAST_HOPS_IPV6 0
52718_ACEOF
52719    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
52720       #ipv6-only
52721
52722cat >>confdefs.h <<_ACEOF
52723#define SOCKS_IPV6_UNICAST_HOPS_IPV4 0
52724_ACEOF
52725
52726cat >>confdefs.h <<_ACEOF
52727#define SOCKS_IPV6_UNICAST_HOPS_IPV6 1
52728_ACEOF
52729    else
52730       #both ipv4 and ipv6
52731
52732cat >>confdefs.h <<_ACEOF
52733#define SOCKS_IPV6_UNICAST_HOPS_IPV4 1
52734_ACEOF
52735
52736cat >>confdefs.h <<_ACEOF
52737#define SOCKS_IPV6_UNICAST_HOPS_IPV6 1
52738_ACEOF
52739    fi
52740    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_UNICAST_HOPS"
52741  else
52742    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
52743$as_echo "no" >&6; }
52744  fi
52745unset _compileok
52746  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_USE_MIN_MTU" >&5
52747$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_USE_MIN_MTU... " >&6; }
52748  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52749/* end confdefs.h.  */
52750
52751#include <sys/types.h>
52752#include <sys/socket.h>
52753#include <netinet/in.h>
52754#include <netinet/tcp.h>
52755#include <netinet/udp.h>
52756
52757#include <stdio.h>
52758#include <stdlib.h>
52759#include <unistd.h>
52760
52761int
52762main ()
52763{
52764
52765   socklen_t optlen;
52766   int optval;
52767   int stype;
52768   int ptype;
52769   int s;
52770
52771   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52772      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52773      ptype = IPPROTO_TCP;
52774   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52775      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52776      ptype = IPPROTO_IP;
52777   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52778      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52779      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52780   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52781      stype = SOCK_DGRAM;
52782      ptype = IPPROTO_UDP;
52783   } else {
52784       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52785       exit(1);
52786   }
52787
52788   if((s = socket(PF_INET, stype, ptype)) < 0) {
52789      perror("socket");
52790      exit(1);
52791   }
52792
52793   optval = 1;
52794   optlen = sizeof(optval);
52795   if(setsockopt(s, IPPROTO_IPV6, IPV6_USE_MIN_MTU, &optval, optlen) < 0) {
52796      perror("setsockopt: IPPROTO_IPV6 IPV6_USE_MIN_MTU");
52797      close(s);
52798      exit(1);
52799   }
52800  ;
52801  return 0;
52802}
52803_ACEOF
52804if ac_fn_c_try_compile "$LINENO"; then :
52805  _compileok=1
52806fi
52807rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52808
52809  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52810/* end confdefs.h.  */
52811
52812#include <sys/types.h>
52813#include <sys/socket.h>
52814#include <netinet/in.h>
52815#include <netinet/tcp.h>
52816#include <netinet/udp.h>
52817
52818#include <stdio.h>
52819#include <stdlib.h>
52820#include <unistd.h>
52821
52822int
52823main ()
52824{
52825
52826   socklen_t optlen;
52827   int optval;
52828   int stype;
52829   int ptype;
52830   int s;
52831
52832   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52833      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52834      ptype = IPPROTO_TCP;
52835   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52836      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52837      ptype = IPPROTO_IP;
52838   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52839      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52840      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52841   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52842      stype = SOCK_DGRAM;
52843      ptype = IPPROTO_UDP;
52844   } else {
52845       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52846       exit(1);
52847   }
52848
52849   if((s = socket(PF_INET6, stype, ptype)) < 0) {
52850      perror("socket");
52851      exit(1);
52852   }
52853
52854   optval = 1;
52855   optlen = sizeof(optval);
52856   if(setsockopt(s, IPPROTO_IPV6, IPV6_USE_MIN_MTU, &optval, optlen) < 0) {
52857      perror("setsockopt: IPPROTO_IPV6 IPV6_USE_MIN_MTU");
52858      close(s);
52859      exit(1);
52860   }
52861  ;
52862  return 0;
52863}
52864_ACEOF
52865if ac_fn_c_try_compile "$LINENO"; then :
52866  _compileok=1
52867fi
52868rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52869
52870  if test x"${_compileok}" != x; then
52871    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
52872$as_echo "yes" >&6; }
52873
52874cat >>confdefs.h <<_ACEOF
52875#define HAVE_IPV6_USE_MIN_MTU 1
52876_ACEOF
52877
52878cat >>confdefs.h <<_ACEOF
52879#define SOCKS_IPV6_USE_MIN_MTU_LVL IPPROTO_IPV6
52880_ACEOF
52881
52882cat >>confdefs.h <<_ACEOF
52883#define SOCKS_IPV6_USE_MIN_MTU_NAME "ipv6_use_min_mtu"
52884_ACEOF
52885    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
52886       #ipv4-only
52887
52888cat >>confdefs.h <<_ACEOF
52889#define SOCKS_IPV6_USE_MIN_MTU_IPV4 1
52890_ACEOF
52891
52892cat >>confdefs.h <<_ACEOF
52893#define SOCKS_IPV6_USE_MIN_MTU_IPV6 0
52894_ACEOF
52895    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
52896       #ipv6-only
52897
52898cat >>confdefs.h <<_ACEOF
52899#define SOCKS_IPV6_USE_MIN_MTU_IPV4 0
52900_ACEOF
52901
52902cat >>confdefs.h <<_ACEOF
52903#define SOCKS_IPV6_USE_MIN_MTU_IPV6 1
52904_ACEOF
52905    else
52906       #both ipv4 and ipv6
52907
52908cat >>confdefs.h <<_ACEOF
52909#define SOCKS_IPV6_USE_MIN_MTU_IPV4 1
52910_ACEOF
52911
52912cat >>confdefs.h <<_ACEOF
52913#define SOCKS_IPV6_USE_MIN_MTU_IPV6 1
52914_ACEOF
52915    fi
52916    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_USE_MIN_MTU"
52917  else
52918    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
52919$as_echo "no" >&6; }
52920  fi
52921unset _compileok
52922  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_V6ONLY" >&5
52923$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_V6ONLY... " >&6; }
52924  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52925/* end confdefs.h.  */
52926
52927#include <sys/types.h>
52928#include <sys/socket.h>
52929#include <netinet/in.h>
52930#include <netinet/tcp.h>
52931#include <netinet/udp.h>
52932
52933#include <stdio.h>
52934#include <stdlib.h>
52935#include <unistd.h>
52936
52937int
52938main ()
52939{
52940
52941   socklen_t optlen;
52942   int optval;
52943   int stype;
52944   int ptype;
52945   int s;
52946
52947   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
52948      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
52949      ptype = IPPROTO_TCP;
52950   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
52951      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
52952      ptype = IPPROTO_IP;
52953   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
52954      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
52955      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
52956   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
52957      stype = SOCK_DGRAM;
52958      ptype = IPPROTO_UDP;
52959   } else {
52960       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
52961       exit(1);
52962   }
52963
52964   if((s = socket(PF_INET, stype, ptype)) < 0) {
52965      perror("socket");
52966      exit(1);
52967   }
52968
52969   optval = 1;
52970   optlen = sizeof(optval);
52971   if(setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &optval, optlen) < 0) {
52972      perror("setsockopt: IPPROTO_IPV6 IPV6_V6ONLY");
52973      close(s);
52974      exit(1);
52975   }
52976  ;
52977  return 0;
52978}
52979_ACEOF
52980if ac_fn_c_try_compile "$LINENO"; then :
52981  _compileok=1
52982fi
52983rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
52984
52985  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
52986/* end confdefs.h.  */
52987
52988#include <sys/types.h>
52989#include <sys/socket.h>
52990#include <netinet/in.h>
52991#include <netinet/tcp.h>
52992#include <netinet/udp.h>
52993
52994#include <stdio.h>
52995#include <stdlib.h>
52996#include <unistd.h>
52997
52998int
52999main ()
53000{
53001
53002   socklen_t optlen;
53003   int optval;
53004   int stype;
53005   int ptype;
53006   int s;
53007
53008   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53009      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53010      ptype = IPPROTO_TCP;
53011   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53012      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53013      ptype = IPPROTO_IP;
53014   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53015      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53016      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53017   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53018      stype = SOCK_DGRAM;
53019      ptype = IPPROTO_UDP;
53020   } else {
53021       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53022       exit(1);
53023   }
53024
53025   if((s = socket(PF_INET6, stype, ptype)) < 0) {
53026      perror("socket");
53027      exit(1);
53028   }
53029
53030   optval = 1;
53031   optlen = sizeof(optval);
53032   if(setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &optval, optlen) < 0) {
53033      perror("setsockopt: IPPROTO_IPV6 IPV6_V6ONLY");
53034      close(s);
53035      exit(1);
53036   }
53037  ;
53038  return 0;
53039}
53040_ACEOF
53041if ac_fn_c_try_compile "$LINENO"; then :
53042  _compileok=1
53043fi
53044rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53045
53046  if test x"${_compileok}" != x; then
53047    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53048$as_echo "yes" >&6; }
53049
53050cat >>confdefs.h <<_ACEOF
53051#define HAVE_IPV6_V6ONLY 1
53052_ACEOF
53053
53054cat >>confdefs.h <<_ACEOF
53055#define SOCKS_IPV6_V6ONLY_LVL IPPROTO_IPV6
53056_ACEOF
53057
53058cat >>confdefs.h <<_ACEOF
53059#define SOCKS_IPV6_V6ONLY_NAME "ipv6_v6only"
53060_ACEOF
53061    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
53062       #ipv4-only
53063
53064cat >>confdefs.h <<_ACEOF
53065#define SOCKS_IPV6_V6ONLY_IPV4 1
53066_ACEOF
53067
53068cat >>confdefs.h <<_ACEOF
53069#define SOCKS_IPV6_V6ONLY_IPV6 0
53070_ACEOF
53071    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
53072       #ipv6-only
53073
53074cat >>confdefs.h <<_ACEOF
53075#define SOCKS_IPV6_V6ONLY_IPV4 0
53076_ACEOF
53077
53078cat >>confdefs.h <<_ACEOF
53079#define SOCKS_IPV6_V6ONLY_IPV6 1
53080_ACEOF
53081    else
53082       #both ipv4 and ipv6
53083
53084cat >>confdefs.h <<_ACEOF
53085#define SOCKS_IPV6_V6ONLY_IPV4 1
53086_ACEOF
53087
53088cat >>confdefs.h <<_ACEOF
53089#define SOCKS_IPV6_V6ONLY_IPV6 1
53090_ACEOF
53091    fi
53092    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_V6ONLY"
53093  else
53094    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53095$as_echo "no" >&6; }
53096  fi
53097unset _compileok
53098  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_XFRM_POLICY" >&5
53099$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_XFRM_POLICY... " >&6; }
53100  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53101/* end confdefs.h.  */
53102
53103#include <sys/types.h>
53104#include <sys/socket.h>
53105#include <netinet/in.h>
53106#include <netinet/tcp.h>
53107#include <netinet/udp.h>
53108
53109#include <stdio.h>
53110#include <stdlib.h>
53111#include <unistd.h>
53112
53113int
53114main ()
53115{
53116
53117   socklen_t optlen;
53118   int optval;
53119   int stype;
53120   int ptype;
53121   int s;
53122
53123   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53124      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53125      ptype = IPPROTO_TCP;
53126   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53127      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53128      ptype = IPPROTO_IP;
53129   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53130      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53131      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53132   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53133      stype = SOCK_DGRAM;
53134      ptype = IPPROTO_UDP;
53135   } else {
53136       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53137       exit(1);
53138   }
53139
53140   if((s = socket(PF_INET, stype, ptype)) < 0) {
53141      perror("socket");
53142      exit(1);
53143   }
53144
53145   optval = 1;
53146   optlen = sizeof(optval);
53147   if(setsockopt(s, IPPROTO_IPV6, IPV6_XFRM_POLICY, &optval, optlen) < 0) {
53148      perror("setsockopt: IPPROTO_IPV6 IPV6_XFRM_POLICY");
53149      close(s);
53150      exit(1);
53151   }
53152  ;
53153  return 0;
53154}
53155_ACEOF
53156if ac_fn_c_try_compile "$LINENO"; then :
53157  _compileok=1
53158fi
53159rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53160
53161  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53162/* end confdefs.h.  */
53163
53164#include <sys/types.h>
53165#include <sys/socket.h>
53166#include <netinet/in.h>
53167#include <netinet/tcp.h>
53168#include <netinet/udp.h>
53169
53170#include <stdio.h>
53171#include <stdlib.h>
53172#include <unistd.h>
53173
53174int
53175main ()
53176{
53177
53178   socklen_t optlen;
53179   int optval;
53180   int stype;
53181   int ptype;
53182   int s;
53183
53184   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53185      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53186      ptype = IPPROTO_TCP;
53187   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53188      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53189      ptype = IPPROTO_IP;
53190   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53191      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53192      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53193   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53194      stype = SOCK_DGRAM;
53195      ptype = IPPROTO_UDP;
53196   } else {
53197       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53198       exit(1);
53199   }
53200
53201   if((s = socket(PF_INET6, stype, ptype)) < 0) {
53202      perror("socket");
53203      exit(1);
53204   }
53205
53206   optval = 1;
53207   optlen = sizeof(optval);
53208   if(setsockopt(s, IPPROTO_IPV6, IPV6_XFRM_POLICY, &optval, optlen) < 0) {
53209      perror("setsockopt: IPPROTO_IPV6 IPV6_XFRM_POLICY");
53210      close(s);
53211      exit(1);
53212   }
53213  ;
53214  return 0;
53215}
53216_ACEOF
53217if ac_fn_c_try_compile "$LINENO"; then :
53218  _compileok=1
53219fi
53220rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53221
53222  if test x"${_compileok}" != x; then
53223    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53224$as_echo "yes" >&6; }
53225
53226cat >>confdefs.h <<_ACEOF
53227#define HAVE_IPV6_XFRM_POLICY 1
53228_ACEOF
53229
53230cat >>confdefs.h <<_ACEOF
53231#define SOCKS_IPV6_XFRM_POLICY_LVL IPPROTO_IPV6
53232_ACEOF
53233
53234cat >>confdefs.h <<_ACEOF
53235#define SOCKS_IPV6_XFRM_POLICY_NAME "ipv6_xfrm_policy"
53236_ACEOF
53237    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
53238       #ipv4-only
53239
53240cat >>confdefs.h <<_ACEOF
53241#define SOCKS_IPV6_XFRM_POLICY_IPV4 1
53242_ACEOF
53243
53244cat >>confdefs.h <<_ACEOF
53245#define SOCKS_IPV6_XFRM_POLICY_IPV6 0
53246_ACEOF
53247    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
53248       #ipv6-only
53249
53250cat >>confdefs.h <<_ACEOF
53251#define SOCKS_IPV6_XFRM_POLICY_IPV4 0
53252_ACEOF
53253
53254cat >>confdefs.h <<_ACEOF
53255#define SOCKS_IPV6_XFRM_POLICY_IPV6 1
53256_ACEOF
53257    else
53258       #both ipv4 and ipv6
53259
53260cat >>confdefs.h <<_ACEOF
53261#define SOCKS_IPV6_XFRM_POLICY_IPV4 1
53262_ACEOF
53263
53264cat >>confdefs.h <<_ACEOF
53265#define SOCKS_IPV6_XFRM_POLICY_IPV6 1
53266_ACEOF
53267    fi
53268    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_XFRM_POLICY"
53269  else
53270    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53271$as_echo "no" >&6; }
53272  fi
53273unset _compileok
53274  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MIPDSTOPTS" >&5
53275$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MIPDSTOPTS... " >&6; }
53276  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53277/* end confdefs.h.  */
53278
53279#include <sys/types.h>
53280#include <sys/socket.h>
53281#include <netinet/in.h>
53282#include <netinet/tcp.h>
53283#include <netinet/udp.h>
53284
53285#include <stdio.h>
53286#include <stdlib.h>
53287#include <unistd.h>
53288
53289int
53290main ()
53291{
53292
53293   socklen_t optlen;
53294   int optval;
53295   int stype;
53296   int ptype;
53297   int s;
53298
53299   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53300      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53301      ptype = IPPROTO_TCP;
53302   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53303      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53304      ptype = IPPROTO_IP;
53305   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53306      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53307      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53308   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53309      stype = SOCK_DGRAM;
53310      ptype = IPPROTO_UDP;
53311   } else {
53312       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53313       exit(1);
53314   }
53315
53316   if((s = socket(PF_INET, stype, ptype)) < 0) {
53317      perror("socket");
53318      exit(1);
53319   }
53320
53321   optval = 1;
53322   optlen = sizeof(optval);
53323   if(setsockopt(s, IPPROTO_IPV6, IPV6_MIPDSTOPTS, &optval, optlen) < 0) {
53324      perror("setsockopt: IPPROTO_IPV6 IPV6_MIPDSTOPTS");
53325      close(s);
53326      exit(1);
53327   }
53328  ;
53329  return 0;
53330}
53331_ACEOF
53332if ac_fn_c_try_compile "$LINENO"; then :
53333  _compileok=1
53334fi
53335rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53336
53337  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53338/* end confdefs.h.  */
53339
53340#include <sys/types.h>
53341#include <sys/socket.h>
53342#include <netinet/in.h>
53343#include <netinet/tcp.h>
53344#include <netinet/udp.h>
53345
53346#include <stdio.h>
53347#include <stdlib.h>
53348#include <unistd.h>
53349
53350int
53351main ()
53352{
53353
53354   socklen_t optlen;
53355   int optval;
53356   int stype;
53357   int ptype;
53358   int s;
53359
53360   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53361      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53362      ptype = IPPROTO_TCP;
53363   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53364      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53365      ptype = IPPROTO_IP;
53366   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53367      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53368      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53369   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53370      stype = SOCK_DGRAM;
53371      ptype = IPPROTO_UDP;
53372   } else {
53373       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53374       exit(1);
53375   }
53376
53377   if((s = socket(PF_INET6, stype, ptype)) < 0) {
53378      perror("socket");
53379      exit(1);
53380   }
53381
53382   optval = 1;
53383   optlen = sizeof(optval);
53384   if(setsockopt(s, IPPROTO_IPV6, IPV6_MIPDSTOPTS, &optval, optlen) < 0) {
53385      perror("setsockopt: IPPROTO_IPV6 IPV6_MIPDSTOPTS");
53386      close(s);
53387      exit(1);
53388   }
53389  ;
53390  return 0;
53391}
53392_ACEOF
53393if ac_fn_c_try_compile "$LINENO"; then :
53394  _compileok=1
53395fi
53396rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53397
53398  if test x"${_compileok}" != x; then
53399    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53400$as_echo "yes" >&6; }
53401
53402cat >>confdefs.h <<_ACEOF
53403#define HAVE_IPV6_MIPDSTOPTS 1
53404_ACEOF
53405
53406cat >>confdefs.h <<_ACEOF
53407#define SOCKS_IPV6_MIPDSTOPTS_LVL IPPROTO_IPV6
53408_ACEOF
53409
53410cat >>confdefs.h <<_ACEOF
53411#define SOCKS_IPV6_MIPDSTOPTS_NAME "ipv6_mipdstopts"
53412_ACEOF
53413    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
53414       #ipv4-only
53415
53416cat >>confdefs.h <<_ACEOF
53417#define SOCKS_IPV6_MIPDSTOPTS_IPV4 1
53418_ACEOF
53419
53420cat >>confdefs.h <<_ACEOF
53421#define SOCKS_IPV6_MIPDSTOPTS_IPV6 0
53422_ACEOF
53423    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
53424       #ipv6-only
53425
53426cat >>confdefs.h <<_ACEOF
53427#define SOCKS_IPV6_MIPDSTOPTS_IPV4 0
53428_ACEOF
53429
53430cat >>confdefs.h <<_ACEOF
53431#define SOCKS_IPV6_MIPDSTOPTS_IPV6 1
53432_ACEOF
53433    else
53434       #both ipv4 and ipv6
53435
53436cat >>confdefs.h <<_ACEOF
53437#define SOCKS_IPV6_MIPDSTOPTS_IPV4 1
53438_ACEOF
53439
53440cat >>confdefs.h <<_ACEOF
53441#define SOCKS_IPV6_MIPDSTOPTS_IPV6 1
53442_ACEOF
53443    fi
53444    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MIPDSTOPTS"
53445  else
53446    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53447$as_echo "no" >&6; }
53448  fi
53449unset _compileok
53450  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_AIXRAWSOCKET" >&5
53451$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_AIXRAWSOCKET... " >&6; }
53452  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53453/* end confdefs.h.  */
53454
53455#include <sys/types.h>
53456#include <sys/socket.h>
53457#include <netinet/in.h>
53458#include <netinet/tcp.h>
53459#include <netinet/udp.h>
53460
53461#include <stdio.h>
53462#include <stdlib.h>
53463#include <unistd.h>
53464
53465int
53466main ()
53467{
53468
53469   socklen_t optlen;
53470   int optval;
53471   int stype;
53472   int ptype;
53473   int s;
53474
53475   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53476      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53477      ptype = IPPROTO_TCP;
53478   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53479      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53480      ptype = IPPROTO_IP;
53481   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53482      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53483      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53484   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53485      stype = SOCK_DGRAM;
53486      ptype = IPPROTO_UDP;
53487   } else {
53488       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53489       exit(1);
53490   }
53491
53492   if((s = socket(PF_INET, stype, ptype)) < 0) {
53493      perror("socket");
53494      exit(1);
53495   }
53496
53497   optval = 1;
53498   optlen = sizeof(optval);
53499   if(setsockopt(s, IPPROTO_IPV6, IPV6_AIXRAWSOCKET, &optval, optlen) < 0) {
53500      perror("setsockopt: IPPROTO_IPV6 IPV6_AIXRAWSOCKET");
53501      close(s);
53502      exit(1);
53503   }
53504  ;
53505  return 0;
53506}
53507_ACEOF
53508if ac_fn_c_try_compile "$LINENO"; then :
53509  _compileok=1
53510fi
53511rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53512
53513  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53514/* end confdefs.h.  */
53515
53516#include <sys/types.h>
53517#include <sys/socket.h>
53518#include <netinet/in.h>
53519#include <netinet/tcp.h>
53520#include <netinet/udp.h>
53521
53522#include <stdio.h>
53523#include <stdlib.h>
53524#include <unistd.h>
53525
53526int
53527main ()
53528{
53529
53530   socklen_t optlen;
53531   int optval;
53532   int stype;
53533   int ptype;
53534   int s;
53535
53536   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
53537      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53538      ptype = IPPROTO_TCP;
53539   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
53540      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53541      ptype = IPPROTO_IP;
53542   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
53543      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53544      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53545   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
53546      stype = SOCK_DGRAM;
53547      ptype = IPPROTO_UDP;
53548   } else {
53549       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
53550       exit(1);
53551   }
53552
53553   if((s = socket(PF_INET6, stype, ptype)) < 0) {
53554      perror("socket");
53555      exit(1);
53556   }
53557
53558   optval = 1;
53559   optlen = sizeof(optval);
53560   if(setsockopt(s, IPPROTO_IPV6, IPV6_AIXRAWSOCKET, &optval, optlen) < 0) {
53561      perror("setsockopt: IPPROTO_IPV6 IPV6_AIXRAWSOCKET");
53562      close(s);
53563      exit(1);
53564   }
53565  ;
53566  return 0;
53567}
53568_ACEOF
53569if ac_fn_c_try_compile "$LINENO"; then :
53570  _compileok=1
53571fi
53572rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53573
53574  if test x"${_compileok}" != x; then
53575    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53576$as_echo "yes" >&6; }
53577
53578cat >>confdefs.h <<_ACEOF
53579#define HAVE_IPV6_AIXRAWSOCKET 1
53580_ACEOF
53581
53582cat >>confdefs.h <<_ACEOF
53583#define SOCKS_IPV6_AIXRAWSOCKET_LVL IPPROTO_IPV6
53584_ACEOF
53585
53586cat >>confdefs.h <<_ACEOF
53587#define SOCKS_IPV6_AIXRAWSOCKET_NAME "ipv6_aixrawsocket"
53588_ACEOF
53589    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
53590       #ipv4-only
53591
53592cat >>confdefs.h <<_ACEOF
53593#define SOCKS_IPV6_AIXRAWSOCKET_IPV4 1
53594_ACEOF
53595
53596cat >>confdefs.h <<_ACEOF
53597#define SOCKS_IPV6_AIXRAWSOCKET_IPV6 0
53598_ACEOF
53599    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
53600       #ipv6-only
53601
53602cat >>confdefs.h <<_ACEOF
53603#define SOCKS_IPV6_AIXRAWSOCKET_IPV4 0
53604_ACEOF
53605
53606cat >>confdefs.h <<_ACEOF
53607#define SOCKS_IPV6_AIXRAWSOCKET_IPV6 1
53608_ACEOF
53609    else
53610       #both ipv4 and ipv6
53611
53612cat >>confdefs.h <<_ACEOF
53613#define SOCKS_IPV6_AIXRAWSOCKET_IPV4 1
53614_ACEOF
53615
53616cat >>confdefs.h <<_ACEOF
53617#define SOCKS_IPV6_AIXRAWSOCKET_IPV6 1
53618_ACEOF
53619    fi
53620    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_AIXRAWSOCKET"
53621  else
53622    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53623$as_echo "no" >&6; }
53624  fi
53625
53626OKSOCKOPTS="$SOCKOPTS" #user-settable socket options
53627
53628ALLSOCKOPTS="$SOCKOPTS"
53629
53630unset SOCKOPTS #default to no TCP_IPA support
53631ac_fn_c_check_header_mongrel "$LINENO" "linux/bbkernel.h" "ac_cv_header_linux_bbkernel_h" "$ac_includes_default"
53632if test "x$ac_cv_header_linux_bbkernel_h" = xyes; then :
53633  #found TCP_IPA header, cannot include headers during build
53634 #so determine values of expected defines.
53635 SOCKOPTS="TCP_IPA"
53636
53637   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPA_VERSION value" >&5
53638$as_echo_n "checking for IPA_VERSION value... " >&6; }
53639   if test "$cross_compiling" = yes; then :
53640  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
53641$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
53642as_fn_error $? "cannot run test program while cross compiling
53643See \`config.log' for more details" "$LINENO" 5; }
53644else
53645  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53646/* end confdefs.h.  */
53647
53648
53649#include <linux/bbkernel.h>
53650
53651
53652#include <stdio.h>
53653
53654int
53655main(void)
53656{
53657   FILE *fp;
53658   int val;
53659
53660   val = IPA_VERSION;
53661
53662   if ((fp = fopen("conftest.out", "w")) == NULL) {
53663      perror("fopen");
53664      exit(-1);
53665   }
53666   fprintf(fp, "%ld\n", val);
53667   fclose(fp);
53668
53669   return 0;
53670}
53671_ACEOF
53672if ac_fn_c_try_run "$LINENO"; then :
53673  ac_cv_definedint=$(cat conftest.out)
53674     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53675$as_echo "yes" >&6; }
53676
53677cat >>confdefs.h <<_ACEOF
53678#define SOCKS_HOSTID_VERSION $ac_cv_definedint
53679_ACEOF
53680
53681else
53682  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53683$as_echo "no" >&6; }
53684fi
53685rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53686  conftest.$ac_objext conftest.beam conftest.$ac_ext
53687fi
53688
53689
53690   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAX_IPA value" >&5
53691$as_echo_n "checking for MAX_IPA value... " >&6; }
53692   if test "$cross_compiling" = yes; then :
53693  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
53694$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
53695as_fn_error $? "cannot run test program while cross compiling
53696See \`config.log' for more details" "$LINENO" 5; }
53697else
53698  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53699/* end confdefs.h.  */
53700
53701
53702#include <linux/bbkernel.h>
53703
53704
53705#include <stdio.h>
53706
53707int
53708main(void)
53709{
53710   FILE *fp;
53711   int val;
53712
53713   val = MAX_IPA;
53714
53715   if ((fp = fopen("conftest.out", "w")) == NULL) {
53716      perror("fopen");
53717      exit(-1);
53718   }
53719   fprintf(fp, "%ld\n", val);
53720   fclose(fp);
53721
53722   return 0;
53723}
53724_ACEOF
53725if ac_fn_c_try_run "$LINENO"; then :
53726  ac_cv_definedint=$(cat conftest.out)
53727     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53728$as_echo "yes" >&6; }
53729
53730cat >>confdefs.h <<_ACEOF
53731#define HAVE_MAX_HOSTIDS $ac_cv_definedint
53732_ACEOF
53733
53734else
53735  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53736$as_echo "no" >&6; }
53737fi
53738rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53739  conftest.$ac_objext conftest.beam conftest.$ac_ext
53740fi
53741
53742
53743   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TCP_IPA value" >&5
53744$as_echo_n "checking for TCP_IPA value... " >&6; }
53745   if test "$cross_compiling" = yes; then :
53746  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
53747$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
53748as_fn_error $? "cannot run test program while cross compiling
53749See \`config.log' for more details" "$LINENO" 5; }
53750else
53751  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53752/* end confdefs.h.  */
53753
53754
53755#include <linux/tcp.h>
53756
53757
53758#include <stdio.h>
53759
53760int
53761main(void)
53762{
53763   FILE *fp;
53764   int val;
53765
53766   val = TCP_IPA;
53767
53768   if ((fp = fopen("conftest.out", "w")) == NULL) {
53769      perror("fopen");
53770      exit(-1);
53771   }
53772   fprintf(fp, "%ld\n", val);
53773   fclose(fp);
53774
53775   return 0;
53776}
53777_ACEOF
53778if ac_fn_c_try_run "$LINENO"; then :
53779  ac_cv_definedint=$(cat conftest.out)
53780     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53781$as_echo "yes" >&6; }
53782
53783cat >>confdefs.h <<_ACEOF
53784#define TCP_IPA $ac_cv_definedint
53785_ACEOF
53786
53787else
53788  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53789$as_echo "no" >&6; }
53790fi
53791rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
53792  conftest.$ac_objext conftest.beam conftest.$ac_ext
53793fi
53794
53795
53796$as_echo "#define HAVE_TCP_IPA 1" >>confdefs.h
53797
53798$as_echo "#define SOCKS_TCP_IPA_LVL IPPROTO_TCP" >>confdefs.h
53799
53800$as_echo "#define SOCKS_TCP_IPA_NAME \"tcp_ipa\"" >>confdefs.h
53801
53802$as_echo "#define SOCKS_TCP_IPA_IPV4 1" >>confdefs.h
53803
53804$as_echo "#define SOCKS_TCP_IPA_IPV6 0" >>confdefs.h
53805
53806fi
53807
53808
53809
53810HOSTIDSOCKOPTS="$SOCKOPTS"
53811
53812ALLSOCKOPTS="$ALLSOCKOPTS $SOCKOPTS"
53813
53814#options that are not settable by users
53815unset SOCKOPTS
53816#socket level
53817unset _compileok
53818  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_ERROR" >&5
53819$as_echo_n "checking for SOL_SOCKET socket option SO_ERROR... " >&6; }
53820  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53821/* end confdefs.h.  */
53822
53823#include <sys/types.h>
53824#include <sys/socket.h>
53825#include <netinet/in.h>
53826#include <netinet/tcp.h>
53827#include <netinet/udp.h>
53828
53829#include <stdio.h>
53830#include <stdlib.h>
53831#include <unistd.h>
53832
53833int
53834main ()
53835{
53836
53837   socklen_t optlen;
53838   int optval;
53839   int stype;
53840   int ptype;
53841   int s;
53842
53843   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
53844      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53845      ptype = IPPROTO_TCP;
53846   } else if (SOL_SOCKET == IPPROTO_IP) {
53847      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53848      ptype = IPPROTO_IP;
53849   } else if (SOL_SOCKET == IPPROTO_IPV6) {
53850      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53851      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53852   } else if (SOL_SOCKET == IPPROTO_UDP) {
53853      stype = SOCK_DGRAM;
53854      ptype = IPPROTO_UDP;
53855   } else {
53856       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
53857       exit(1);
53858   }
53859
53860   if((s = socket(PF_INET, stype, ptype)) < 0) {
53861      perror("socket");
53862      exit(1);
53863   }
53864
53865   optval = 1;
53866   optlen = sizeof(optval);
53867   if(setsockopt(s, SOL_SOCKET, SO_ERROR, &optval, optlen) < 0) {
53868      perror("setsockopt: SOL_SOCKET SO_ERROR");
53869      close(s);
53870      exit(1);
53871   }
53872  ;
53873  return 0;
53874}
53875_ACEOF
53876if ac_fn_c_try_compile "$LINENO"; then :
53877  _compileok=1
53878fi
53879rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53880
53881  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53882/* end confdefs.h.  */
53883
53884#include <sys/types.h>
53885#include <sys/socket.h>
53886#include <netinet/in.h>
53887#include <netinet/tcp.h>
53888#include <netinet/udp.h>
53889
53890#include <stdio.h>
53891#include <stdlib.h>
53892#include <unistd.h>
53893
53894int
53895main ()
53896{
53897
53898   socklen_t optlen;
53899   int optval;
53900   int stype;
53901   int ptype;
53902   int s;
53903
53904   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
53905      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
53906      ptype = IPPROTO_TCP;
53907   } else if (SOL_SOCKET == IPPROTO_IP) {
53908      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
53909      ptype = IPPROTO_IP;
53910   } else if (SOL_SOCKET == IPPROTO_IPV6) {
53911      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
53912      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
53913   } else if (SOL_SOCKET == IPPROTO_UDP) {
53914      stype = SOCK_DGRAM;
53915      ptype = IPPROTO_UDP;
53916   } else {
53917       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
53918       exit(1);
53919   }
53920
53921   if((s = socket(PF_INET6, stype, ptype)) < 0) {
53922      perror("socket");
53923      exit(1);
53924   }
53925
53926   optval = 1;
53927   optlen = sizeof(optval);
53928   if(setsockopt(s, SOL_SOCKET, SO_ERROR, &optval, optlen) < 0) {
53929      perror("setsockopt: SOL_SOCKET SO_ERROR");
53930      close(s);
53931      exit(1);
53932   }
53933  ;
53934  return 0;
53935}
53936_ACEOF
53937if ac_fn_c_try_compile "$LINENO"; then :
53938  _compileok=1
53939fi
53940rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
53941
53942  if test x"${_compileok}" != x; then
53943    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
53944$as_echo "yes" >&6; }
53945
53946cat >>confdefs.h <<_ACEOF
53947#define HAVE_SO_ERROR 1
53948_ACEOF
53949
53950cat >>confdefs.h <<_ACEOF
53951#define SOCKS_SO_ERROR_LVL SOL_SOCKET
53952_ACEOF
53953
53954cat >>confdefs.h <<_ACEOF
53955#define SOCKS_SO_ERROR_NAME "so_error"
53956_ACEOF
53957    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
53958       #ipv4-only
53959
53960cat >>confdefs.h <<_ACEOF
53961#define SOCKS_SO_ERROR_IPV4 1
53962_ACEOF
53963
53964cat >>confdefs.h <<_ACEOF
53965#define SOCKS_SO_ERROR_IPV6 0
53966_ACEOF
53967    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
53968       #ipv6-only
53969
53970cat >>confdefs.h <<_ACEOF
53971#define SOCKS_SO_ERROR_IPV4 0
53972_ACEOF
53973
53974cat >>confdefs.h <<_ACEOF
53975#define SOCKS_SO_ERROR_IPV6 1
53976_ACEOF
53977    else
53978       #both ipv4 and ipv6
53979
53980cat >>confdefs.h <<_ACEOF
53981#define SOCKS_SO_ERROR_IPV4 1
53982_ACEOF
53983
53984cat >>confdefs.h <<_ACEOF
53985#define SOCKS_SO_ERROR_IPV6 1
53986_ACEOF
53987    fi
53988    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_ERROR"
53989  else
53990    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
53991$as_echo "no" >&6; }
53992  fi #not usable
53993unset _compileok
53994  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_REUSEADDR" >&5
53995$as_echo_n "checking for SOL_SOCKET socket option SO_REUSEADDR... " >&6; }
53996  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
53997/* end confdefs.h.  */
53998
53999#include <sys/types.h>
54000#include <sys/socket.h>
54001#include <netinet/in.h>
54002#include <netinet/tcp.h>
54003#include <netinet/udp.h>
54004
54005#include <stdio.h>
54006#include <stdlib.h>
54007#include <unistd.h>
54008
54009int
54010main ()
54011{
54012
54013   socklen_t optlen;
54014   int optval;
54015   int stype;
54016   int ptype;
54017   int s;
54018
54019   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54020      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54021      ptype = IPPROTO_TCP;
54022   } else if (SOL_SOCKET == IPPROTO_IP) {
54023      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54024      ptype = IPPROTO_IP;
54025   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54026      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54027      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54028   } else if (SOL_SOCKET == IPPROTO_UDP) {
54029      stype = SOCK_DGRAM;
54030      ptype = IPPROTO_UDP;
54031   } else {
54032       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54033       exit(1);
54034   }
54035
54036   if((s = socket(PF_INET, stype, ptype)) < 0) {
54037      perror("socket");
54038      exit(1);
54039   }
54040
54041   optval = 1;
54042   optlen = sizeof(optval);
54043   if(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, optlen) < 0) {
54044      perror("setsockopt: SOL_SOCKET SO_REUSEADDR");
54045      close(s);
54046      exit(1);
54047   }
54048  ;
54049  return 0;
54050}
54051_ACEOF
54052if ac_fn_c_try_compile "$LINENO"; then :
54053  _compileok=1
54054fi
54055rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54056
54057  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54058/* end confdefs.h.  */
54059
54060#include <sys/types.h>
54061#include <sys/socket.h>
54062#include <netinet/in.h>
54063#include <netinet/tcp.h>
54064#include <netinet/udp.h>
54065
54066#include <stdio.h>
54067#include <stdlib.h>
54068#include <unistd.h>
54069
54070int
54071main ()
54072{
54073
54074   socklen_t optlen;
54075   int optval;
54076   int stype;
54077   int ptype;
54078   int s;
54079
54080   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54081      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54082      ptype = IPPROTO_TCP;
54083   } else if (SOL_SOCKET == IPPROTO_IP) {
54084      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54085      ptype = IPPROTO_IP;
54086   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54087      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54088      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54089   } else if (SOL_SOCKET == IPPROTO_UDP) {
54090      stype = SOCK_DGRAM;
54091      ptype = IPPROTO_UDP;
54092   } else {
54093       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54094       exit(1);
54095   }
54096
54097   if((s = socket(PF_INET6, stype, ptype)) < 0) {
54098      perror("socket");
54099      exit(1);
54100   }
54101
54102   optval = 1;
54103   optlen = sizeof(optval);
54104   if(setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &optval, optlen) < 0) {
54105      perror("setsockopt: SOL_SOCKET SO_REUSEADDR");
54106      close(s);
54107      exit(1);
54108   }
54109  ;
54110  return 0;
54111}
54112_ACEOF
54113if ac_fn_c_try_compile "$LINENO"; then :
54114  _compileok=1
54115fi
54116rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54117
54118  if test x"${_compileok}" != x; then
54119    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
54120$as_echo "yes" >&6; }
54121
54122cat >>confdefs.h <<_ACEOF
54123#define HAVE_SO_REUSEADDR 1
54124_ACEOF
54125
54126cat >>confdefs.h <<_ACEOF
54127#define SOCKS_SO_REUSEADDR_LVL SOL_SOCKET
54128_ACEOF
54129
54130cat >>confdefs.h <<_ACEOF
54131#define SOCKS_SO_REUSEADDR_NAME "so_reuseaddr"
54132_ACEOF
54133    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
54134       #ipv4-only
54135
54136cat >>confdefs.h <<_ACEOF
54137#define SOCKS_SO_REUSEADDR_IPV4 1
54138_ACEOF
54139
54140cat >>confdefs.h <<_ACEOF
54141#define SOCKS_SO_REUSEADDR_IPV6 0
54142_ACEOF
54143    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
54144       #ipv6-only
54145
54146cat >>confdefs.h <<_ACEOF
54147#define SOCKS_SO_REUSEADDR_IPV4 0
54148_ACEOF
54149
54150cat >>confdefs.h <<_ACEOF
54151#define SOCKS_SO_REUSEADDR_IPV6 1
54152_ACEOF
54153    else
54154       #both ipv4 and ipv6
54155
54156cat >>confdefs.h <<_ACEOF
54157#define SOCKS_SO_REUSEADDR_IPV4 1
54158_ACEOF
54159
54160cat >>confdefs.h <<_ACEOF
54161#define SOCKS_SO_REUSEADDR_IPV6 1
54162_ACEOF
54163    fi
54164    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_REUSEADDR"
54165  else
54166    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
54167$as_echo "no" >&6; }
54168  fi #not usable
54169unset _compileok
54170  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_REUSEPORT" >&5
54171$as_echo_n "checking for SOL_SOCKET socket option SO_REUSEPORT... " >&6; }
54172  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54173/* end confdefs.h.  */
54174
54175#include <sys/types.h>
54176#include <sys/socket.h>
54177#include <netinet/in.h>
54178#include <netinet/tcp.h>
54179#include <netinet/udp.h>
54180
54181#include <stdio.h>
54182#include <stdlib.h>
54183#include <unistd.h>
54184
54185int
54186main ()
54187{
54188
54189   socklen_t optlen;
54190   int optval;
54191   int stype;
54192   int ptype;
54193   int s;
54194
54195   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54196      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54197      ptype = IPPROTO_TCP;
54198   } else if (SOL_SOCKET == IPPROTO_IP) {
54199      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54200      ptype = IPPROTO_IP;
54201   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54202      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54203      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54204   } else if (SOL_SOCKET == IPPROTO_UDP) {
54205      stype = SOCK_DGRAM;
54206      ptype = IPPROTO_UDP;
54207   } else {
54208       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54209       exit(1);
54210   }
54211
54212   if((s = socket(PF_INET, stype, ptype)) < 0) {
54213      perror("socket");
54214      exit(1);
54215   }
54216
54217   optval = 1;
54218   optlen = sizeof(optval);
54219   if(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &optval, optlen) < 0) {
54220      perror("setsockopt: SOL_SOCKET SO_REUSEPORT");
54221      close(s);
54222      exit(1);
54223   }
54224  ;
54225  return 0;
54226}
54227_ACEOF
54228if ac_fn_c_try_compile "$LINENO"; then :
54229  _compileok=1
54230fi
54231rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54232
54233  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54234/* end confdefs.h.  */
54235
54236#include <sys/types.h>
54237#include <sys/socket.h>
54238#include <netinet/in.h>
54239#include <netinet/tcp.h>
54240#include <netinet/udp.h>
54241
54242#include <stdio.h>
54243#include <stdlib.h>
54244#include <unistd.h>
54245
54246int
54247main ()
54248{
54249
54250   socklen_t optlen;
54251   int optval;
54252   int stype;
54253   int ptype;
54254   int s;
54255
54256   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54257      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54258      ptype = IPPROTO_TCP;
54259   } else if (SOL_SOCKET == IPPROTO_IP) {
54260      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54261      ptype = IPPROTO_IP;
54262   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54263      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54264      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54265   } else if (SOL_SOCKET == IPPROTO_UDP) {
54266      stype = SOCK_DGRAM;
54267      ptype = IPPROTO_UDP;
54268   } else {
54269       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54270       exit(1);
54271   }
54272
54273   if((s = socket(PF_INET6, stype, ptype)) < 0) {
54274      perror("socket");
54275      exit(1);
54276   }
54277
54278   optval = 1;
54279   optlen = sizeof(optval);
54280   if(setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &optval, optlen) < 0) {
54281      perror("setsockopt: SOL_SOCKET SO_REUSEPORT");
54282      close(s);
54283      exit(1);
54284   }
54285  ;
54286  return 0;
54287}
54288_ACEOF
54289if ac_fn_c_try_compile "$LINENO"; then :
54290  _compileok=1
54291fi
54292rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54293
54294  if test x"${_compileok}" != x; then
54295    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
54296$as_echo "yes" >&6; }
54297
54298cat >>confdefs.h <<_ACEOF
54299#define HAVE_SO_REUSEPORT 1
54300_ACEOF
54301
54302cat >>confdefs.h <<_ACEOF
54303#define SOCKS_SO_REUSEPORT_LVL SOL_SOCKET
54304_ACEOF
54305
54306cat >>confdefs.h <<_ACEOF
54307#define SOCKS_SO_REUSEPORT_NAME "so_reuseport"
54308_ACEOF
54309    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
54310       #ipv4-only
54311
54312cat >>confdefs.h <<_ACEOF
54313#define SOCKS_SO_REUSEPORT_IPV4 1
54314_ACEOF
54315
54316cat >>confdefs.h <<_ACEOF
54317#define SOCKS_SO_REUSEPORT_IPV6 0
54318_ACEOF
54319    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
54320       #ipv6-only
54321
54322cat >>confdefs.h <<_ACEOF
54323#define SOCKS_SO_REUSEPORT_IPV4 0
54324_ACEOF
54325
54326cat >>confdefs.h <<_ACEOF
54327#define SOCKS_SO_REUSEPORT_IPV6 1
54328_ACEOF
54329    else
54330       #both ipv4 and ipv6
54331
54332cat >>confdefs.h <<_ACEOF
54333#define SOCKS_SO_REUSEPORT_IPV4 1
54334_ACEOF
54335
54336cat >>confdefs.h <<_ACEOF
54337#define SOCKS_SO_REUSEPORT_IPV6 1
54338_ACEOF
54339    fi
54340    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_REUSEPORT"
54341  else
54342    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
54343$as_echo "no" >&6; }
54344  fi #not usable
54345unset _compileok
54346  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_ACCEPTCONN" >&5
54347$as_echo_n "checking for SOL_SOCKET socket option SO_ACCEPTCONN... " >&6; }
54348  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54349/* end confdefs.h.  */
54350
54351#include <sys/types.h>
54352#include <sys/socket.h>
54353#include <netinet/in.h>
54354#include <netinet/tcp.h>
54355#include <netinet/udp.h>
54356
54357#include <stdio.h>
54358#include <stdlib.h>
54359#include <unistd.h>
54360
54361int
54362main ()
54363{
54364
54365   socklen_t optlen;
54366   int optval;
54367   int stype;
54368   int ptype;
54369   int s;
54370
54371   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54372      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54373      ptype = IPPROTO_TCP;
54374   } else if (SOL_SOCKET == IPPROTO_IP) {
54375      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54376      ptype = IPPROTO_IP;
54377   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54378      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54379      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54380   } else if (SOL_SOCKET == IPPROTO_UDP) {
54381      stype = SOCK_DGRAM;
54382      ptype = IPPROTO_UDP;
54383   } else {
54384       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54385       exit(1);
54386   }
54387
54388   if((s = socket(PF_INET, stype, ptype)) < 0) {
54389      perror("socket");
54390      exit(1);
54391   }
54392
54393   optval = 1;
54394   optlen = sizeof(optval);
54395   if(setsockopt(s, SOL_SOCKET, SO_ACCEPTCONN, &optval, optlen) < 0) {
54396      perror("setsockopt: SOL_SOCKET SO_ACCEPTCONN");
54397      close(s);
54398      exit(1);
54399   }
54400  ;
54401  return 0;
54402}
54403_ACEOF
54404if ac_fn_c_try_compile "$LINENO"; then :
54405  _compileok=1
54406fi
54407rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54408
54409  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54410/* end confdefs.h.  */
54411
54412#include <sys/types.h>
54413#include <sys/socket.h>
54414#include <netinet/in.h>
54415#include <netinet/tcp.h>
54416#include <netinet/udp.h>
54417
54418#include <stdio.h>
54419#include <stdlib.h>
54420#include <unistd.h>
54421
54422int
54423main ()
54424{
54425
54426   socklen_t optlen;
54427   int optval;
54428   int stype;
54429   int ptype;
54430   int s;
54431
54432   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54433      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54434      ptype = IPPROTO_TCP;
54435   } else if (SOL_SOCKET == IPPROTO_IP) {
54436      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54437      ptype = IPPROTO_IP;
54438   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54439      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54440      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54441   } else if (SOL_SOCKET == IPPROTO_UDP) {
54442      stype = SOCK_DGRAM;
54443      ptype = IPPROTO_UDP;
54444   } else {
54445       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54446       exit(1);
54447   }
54448
54449   if((s = socket(PF_INET6, stype, ptype)) < 0) {
54450      perror("socket");
54451      exit(1);
54452   }
54453
54454   optval = 1;
54455   optlen = sizeof(optval);
54456   if(setsockopt(s, SOL_SOCKET, SO_ACCEPTCONN, &optval, optlen) < 0) {
54457      perror("setsockopt: SOL_SOCKET SO_ACCEPTCONN");
54458      close(s);
54459      exit(1);
54460   }
54461  ;
54462  return 0;
54463}
54464_ACEOF
54465if ac_fn_c_try_compile "$LINENO"; then :
54466  _compileok=1
54467fi
54468rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54469
54470  if test x"${_compileok}" != x; then
54471    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
54472$as_echo "yes" >&6; }
54473
54474cat >>confdefs.h <<_ACEOF
54475#define HAVE_SO_ACCEPTCONN 1
54476_ACEOF
54477
54478cat >>confdefs.h <<_ACEOF
54479#define SOCKS_SO_ACCEPTCONN_LVL SOL_SOCKET
54480_ACEOF
54481
54482cat >>confdefs.h <<_ACEOF
54483#define SOCKS_SO_ACCEPTCONN_NAME "so_acceptconn"
54484_ACEOF
54485    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
54486       #ipv4-only
54487
54488cat >>confdefs.h <<_ACEOF
54489#define SOCKS_SO_ACCEPTCONN_IPV4 1
54490_ACEOF
54491
54492cat >>confdefs.h <<_ACEOF
54493#define SOCKS_SO_ACCEPTCONN_IPV6 0
54494_ACEOF
54495    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
54496       #ipv6-only
54497
54498cat >>confdefs.h <<_ACEOF
54499#define SOCKS_SO_ACCEPTCONN_IPV4 0
54500_ACEOF
54501
54502cat >>confdefs.h <<_ACEOF
54503#define SOCKS_SO_ACCEPTCONN_IPV6 1
54504_ACEOF
54505    else
54506       #both ipv4 and ipv6
54507
54508cat >>confdefs.h <<_ACEOF
54509#define SOCKS_SO_ACCEPTCONN_IPV4 1
54510_ACEOF
54511
54512cat >>confdefs.h <<_ACEOF
54513#define SOCKS_SO_ACCEPTCONN_IPV6 1
54514_ACEOF
54515    fi
54516    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_ACCEPTCONN"
54517  else
54518    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
54519$as_echo "no" >&6; }
54520  fi #not usable
54521unset _compileok
54522  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_KERNACCEPT" >&5
54523$as_echo_n "checking for SOL_SOCKET socket option SO_KERNACCEPT... " >&6; }
54524  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54525/* end confdefs.h.  */
54526
54527#include <sys/types.h>
54528#include <sys/socket.h>
54529#include <netinet/in.h>
54530#include <netinet/tcp.h>
54531#include <netinet/udp.h>
54532
54533#include <stdio.h>
54534#include <stdlib.h>
54535#include <unistd.h>
54536
54537int
54538main ()
54539{
54540
54541   socklen_t optlen;
54542   int optval;
54543   int stype;
54544   int ptype;
54545   int s;
54546
54547   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54548      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54549      ptype = IPPROTO_TCP;
54550   } else if (SOL_SOCKET == IPPROTO_IP) {
54551      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54552      ptype = IPPROTO_IP;
54553   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54554      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54555      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54556   } else if (SOL_SOCKET == IPPROTO_UDP) {
54557      stype = SOCK_DGRAM;
54558      ptype = IPPROTO_UDP;
54559   } else {
54560       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54561       exit(1);
54562   }
54563
54564   if((s = socket(PF_INET, stype, ptype)) < 0) {
54565      perror("socket");
54566      exit(1);
54567   }
54568
54569   optval = 1;
54570   optlen = sizeof(optval);
54571   if(setsockopt(s, SOL_SOCKET, SO_KERNACCEPT, &optval, optlen) < 0) {
54572      perror("setsockopt: SOL_SOCKET SO_KERNACCEPT");
54573      close(s);
54574      exit(1);
54575   }
54576  ;
54577  return 0;
54578}
54579_ACEOF
54580if ac_fn_c_try_compile "$LINENO"; then :
54581  _compileok=1
54582fi
54583rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54584
54585  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54586/* end confdefs.h.  */
54587
54588#include <sys/types.h>
54589#include <sys/socket.h>
54590#include <netinet/in.h>
54591#include <netinet/tcp.h>
54592#include <netinet/udp.h>
54593
54594#include <stdio.h>
54595#include <stdlib.h>
54596#include <unistd.h>
54597
54598int
54599main ()
54600{
54601
54602   socklen_t optlen;
54603   int optval;
54604   int stype;
54605   int ptype;
54606   int s;
54607
54608   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54609      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54610      ptype = IPPROTO_TCP;
54611   } else if (SOL_SOCKET == IPPROTO_IP) {
54612      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54613      ptype = IPPROTO_IP;
54614   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54615      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54616      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54617   } else if (SOL_SOCKET == IPPROTO_UDP) {
54618      stype = SOCK_DGRAM;
54619      ptype = IPPROTO_UDP;
54620   } else {
54621       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54622       exit(1);
54623   }
54624
54625   if((s = socket(PF_INET6, stype, ptype)) < 0) {
54626      perror("socket");
54627      exit(1);
54628   }
54629
54630   optval = 1;
54631   optlen = sizeof(optval);
54632   if(setsockopt(s, SOL_SOCKET, SO_KERNACCEPT, &optval, optlen) < 0) {
54633      perror("setsockopt: SOL_SOCKET SO_KERNACCEPT");
54634      close(s);
54635      exit(1);
54636   }
54637  ;
54638  return 0;
54639}
54640_ACEOF
54641if ac_fn_c_try_compile "$LINENO"; then :
54642  _compileok=1
54643fi
54644rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54645
54646  if test x"${_compileok}" != x; then
54647    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
54648$as_echo "yes" >&6; }
54649
54650cat >>confdefs.h <<_ACEOF
54651#define HAVE_SO_KERNACCEPT 1
54652_ACEOF
54653
54654cat >>confdefs.h <<_ACEOF
54655#define SOCKS_SO_KERNACCEPT_LVL SOL_SOCKET
54656_ACEOF
54657
54658cat >>confdefs.h <<_ACEOF
54659#define SOCKS_SO_KERNACCEPT_NAME "so_kernaccept"
54660_ACEOF
54661    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
54662       #ipv4-only
54663
54664cat >>confdefs.h <<_ACEOF
54665#define SOCKS_SO_KERNACCEPT_IPV4 1
54666_ACEOF
54667
54668cat >>confdefs.h <<_ACEOF
54669#define SOCKS_SO_KERNACCEPT_IPV6 0
54670_ACEOF
54671    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
54672       #ipv6-only
54673
54674cat >>confdefs.h <<_ACEOF
54675#define SOCKS_SO_KERNACCEPT_IPV4 0
54676_ACEOF
54677
54678cat >>confdefs.h <<_ACEOF
54679#define SOCKS_SO_KERNACCEPT_IPV6 1
54680_ACEOF
54681    else
54682       #both ipv4 and ipv6
54683
54684cat >>confdefs.h <<_ACEOF
54685#define SOCKS_SO_KERNACCEPT_IPV4 1
54686_ACEOF
54687
54688cat >>confdefs.h <<_ACEOF
54689#define SOCKS_SO_KERNACCEPT_IPV6 1
54690_ACEOF
54691    fi
54692    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_KERNACCEPT"
54693  else
54694    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
54695$as_echo "no" >&6; }
54696  fi #likely not usable
54697unset _compileok
54698  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_PEERID" >&5
54699$as_echo_n "checking for SOL_SOCKET socket option SO_PEERID... " >&6; }
54700  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54701/* end confdefs.h.  */
54702
54703#include <sys/types.h>
54704#include <sys/socket.h>
54705#include <netinet/in.h>
54706#include <netinet/tcp.h>
54707#include <netinet/udp.h>
54708
54709#include <stdio.h>
54710#include <stdlib.h>
54711#include <unistd.h>
54712
54713int
54714main ()
54715{
54716
54717   socklen_t optlen;
54718   int optval;
54719   int stype;
54720   int ptype;
54721   int s;
54722
54723   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54724      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54725      ptype = IPPROTO_TCP;
54726   } else if (SOL_SOCKET == IPPROTO_IP) {
54727      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54728      ptype = IPPROTO_IP;
54729   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54730      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54731      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54732   } else if (SOL_SOCKET == IPPROTO_UDP) {
54733      stype = SOCK_DGRAM;
54734      ptype = IPPROTO_UDP;
54735   } else {
54736       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54737       exit(1);
54738   }
54739
54740   if((s = socket(PF_INET, stype, ptype)) < 0) {
54741      perror("socket");
54742      exit(1);
54743   }
54744
54745   optval = 1;
54746   optlen = sizeof(optval);
54747   if(setsockopt(s, SOL_SOCKET, SO_PEERID, &optval, optlen) < 0) {
54748      perror("setsockopt: SOL_SOCKET SO_PEERID");
54749      close(s);
54750      exit(1);
54751   }
54752  ;
54753  return 0;
54754}
54755_ACEOF
54756if ac_fn_c_try_compile "$LINENO"; then :
54757  _compileok=1
54758fi
54759rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54760
54761  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54762/* end confdefs.h.  */
54763
54764#include <sys/types.h>
54765#include <sys/socket.h>
54766#include <netinet/in.h>
54767#include <netinet/tcp.h>
54768#include <netinet/udp.h>
54769
54770#include <stdio.h>
54771#include <stdlib.h>
54772#include <unistd.h>
54773
54774int
54775main ()
54776{
54777
54778   socklen_t optlen;
54779   int optval;
54780   int stype;
54781   int ptype;
54782   int s;
54783
54784   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54785      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54786      ptype = IPPROTO_TCP;
54787   } else if (SOL_SOCKET == IPPROTO_IP) {
54788      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54789      ptype = IPPROTO_IP;
54790   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54791      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54792      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54793   } else if (SOL_SOCKET == IPPROTO_UDP) {
54794      stype = SOCK_DGRAM;
54795      ptype = IPPROTO_UDP;
54796   } else {
54797       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54798       exit(1);
54799   }
54800
54801   if((s = socket(PF_INET6, stype, ptype)) < 0) {
54802      perror("socket");
54803      exit(1);
54804   }
54805
54806   optval = 1;
54807   optlen = sizeof(optval);
54808   if(setsockopt(s, SOL_SOCKET, SO_PEERID, &optval, optlen) < 0) {
54809      perror("setsockopt: SOL_SOCKET SO_PEERID");
54810      close(s);
54811      exit(1);
54812   }
54813  ;
54814  return 0;
54815}
54816_ACEOF
54817if ac_fn_c_try_compile "$LINENO"; then :
54818  _compileok=1
54819fi
54820rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54821
54822  if test x"${_compileok}" != x; then
54823    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
54824$as_echo "yes" >&6; }
54825
54826cat >>confdefs.h <<_ACEOF
54827#define HAVE_SO_PEERID 1
54828_ACEOF
54829
54830cat >>confdefs.h <<_ACEOF
54831#define SOCKS_SO_PEERID_LVL SOL_SOCKET
54832_ACEOF
54833
54834cat >>confdefs.h <<_ACEOF
54835#define SOCKS_SO_PEERID_NAME "so_peerid"
54836_ACEOF
54837    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
54838       #ipv4-only
54839
54840cat >>confdefs.h <<_ACEOF
54841#define SOCKS_SO_PEERID_IPV4 1
54842_ACEOF
54843
54844cat >>confdefs.h <<_ACEOF
54845#define SOCKS_SO_PEERID_IPV6 0
54846_ACEOF
54847    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
54848       #ipv6-only
54849
54850cat >>confdefs.h <<_ACEOF
54851#define SOCKS_SO_PEERID_IPV4 0
54852_ACEOF
54853
54854cat >>confdefs.h <<_ACEOF
54855#define SOCKS_SO_PEERID_IPV6 1
54856_ACEOF
54857    else
54858       #both ipv4 and ipv6
54859
54860cat >>confdefs.h <<_ACEOF
54861#define SOCKS_SO_PEERID_IPV4 1
54862_ACEOF
54863
54864cat >>confdefs.h <<_ACEOF
54865#define SOCKS_SO_PEERID_IPV6 1
54866_ACEOF
54867    fi
54868    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_PEERID"
54869  else
54870    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
54871$as_echo "no" >&6; }
54872  fi #likely not usable
54873unset _compileok
54874  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_TYPE" >&5
54875$as_echo_n "checking for SOL_SOCKET socket option SO_TYPE... " >&6; }
54876  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54877/* end confdefs.h.  */
54878
54879#include <sys/types.h>
54880#include <sys/socket.h>
54881#include <netinet/in.h>
54882#include <netinet/tcp.h>
54883#include <netinet/udp.h>
54884
54885#include <stdio.h>
54886#include <stdlib.h>
54887#include <unistd.h>
54888
54889int
54890main ()
54891{
54892
54893   socklen_t optlen;
54894   int optval;
54895   int stype;
54896   int ptype;
54897   int s;
54898
54899   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54900      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54901      ptype = IPPROTO_TCP;
54902   } else if (SOL_SOCKET == IPPROTO_IP) {
54903      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54904      ptype = IPPROTO_IP;
54905   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54906      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54907      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54908   } else if (SOL_SOCKET == IPPROTO_UDP) {
54909      stype = SOCK_DGRAM;
54910      ptype = IPPROTO_UDP;
54911   } else {
54912       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54913       exit(1);
54914   }
54915
54916   if((s = socket(PF_INET, stype, ptype)) < 0) {
54917      perror("socket");
54918      exit(1);
54919   }
54920
54921   optval = 1;
54922   optlen = sizeof(optval);
54923   if(setsockopt(s, SOL_SOCKET, SO_TYPE, &optval, optlen) < 0) {
54924      perror("setsockopt: SOL_SOCKET SO_TYPE");
54925      close(s);
54926      exit(1);
54927   }
54928  ;
54929  return 0;
54930}
54931_ACEOF
54932if ac_fn_c_try_compile "$LINENO"; then :
54933  _compileok=1
54934fi
54935rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54936
54937  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
54938/* end confdefs.h.  */
54939
54940#include <sys/types.h>
54941#include <sys/socket.h>
54942#include <netinet/in.h>
54943#include <netinet/tcp.h>
54944#include <netinet/udp.h>
54945
54946#include <stdio.h>
54947#include <stdlib.h>
54948#include <unistd.h>
54949
54950int
54951main ()
54952{
54953
54954   socklen_t optlen;
54955   int optval;
54956   int stype;
54957   int ptype;
54958   int s;
54959
54960   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
54961      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
54962      ptype = IPPROTO_TCP;
54963   } else if (SOL_SOCKET == IPPROTO_IP) {
54964      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
54965      ptype = IPPROTO_IP;
54966   } else if (SOL_SOCKET == IPPROTO_IPV6) {
54967      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
54968      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
54969   } else if (SOL_SOCKET == IPPROTO_UDP) {
54970      stype = SOCK_DGRAM;
54971      ptype = IPPROTO_UDP;
54972   } else {
54973       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
54974       exit(1);
54975   }
54976
54977   if((s = socket(PF_INET6, stype, ptype)) < 0) {
54978      perror("socket");
54979      exit(1);
54980   }
54981
54982   optval = 1;
54983   optlen = sizeof(optval);
54984   if(setsockopt(s, SOL_SOCKET, SO_TYPE, &optval, optlen) < 0) {
54985      perror("setsockopt: SOL_SOCKET SO_TYPE");
54986      close(s);
54987      exit(1);
54988   }
54989  ;
54990  return 0;
54991}
54992_ACEOF
54993if ac_fn_c_try_compile "$LINENO"; then :
54994  _compileok=1
54995fi
54996rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
54997
54998  if test x"${_compileok}" != x; then
54999    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
55000$as_echo "yes" >&6; }
55001
55002cat >>confdefs.h <<_ACEOF
55003#define HAVE_SO_TYPE 1
55004_ACEOF
55005
55006cat >>confdefs.h <<_ACEOF
55007#define SOCKS_SO_TYPE_LVL SOL_SOCKET
55008_ACEOF
55009
55010cat >>confdefs.h <<_ACEOF
55011#define SOCKS_SO_TYPE_NAME "so_type"
55012_ACEOF
55013    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
55014       #ipv4-only
55015
55016cat >>confdefs.h <<_ACEOF
55017#define SOCKS_SO_TYPE_IPV4 1
55018_ACEOF
55019
55020cat >>confdefs.h <<_ACEOF
55021#define SOCKS_SO_TYPE_IPV6 0
55022_ACEOF
55023    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
55024       #ipv6-only
55025
55026cat >>confdefs.h <<_ACEOF
55027#define SOCKS_SO_TYPE_IPV4 0
55028_ACEOF
55029
55030cat >>confdefs.h <<_ACEOF
55031#define SOCKS_SO_TYPE_IPV6 1
55032_ACEOF
55033    else
55034       #both ipv4 and ipv6
55035
55036cat >>confdefs.h <<_ACEOF
55037#define SOCKS_SO_TYPE_IPV4 1
55038_ACEOF
55039
55040cat >>confdefs.h <<_ACEOF
55041#define SOCKS_SO_TYPE_IPV6 1
55042_ACEOF
55043    fi
55044    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_TYPE"
55045  else
55046    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
55047$as_echo "no" >&6; }
55048  fi #likely not usable
55049unset _compileok
55050  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SOL_SOCKET socket option SO_USE_IFBUFS" >&5
55051$as_echo_n "checking for SOL_SOCKET socket option SO_USE_IFBUFS... " >&6; }
55052  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55053/* end confdefs.h.  */
55054
55055#include <sys/types.h>
55056#include <sys/socket.h>
55057#include <netinet/in.h>
55058#include <netinet/tcp.h>
55059#include <netinet/udp.h>
55060
55061#include <stdio.h>
55062#include <stdlib.h>
55063#include <unistd.h>
55064
55065int
55066main ()
55067{
55068
55069   socklen_t optlen;
55070   int optval;
55071   int stype;
55072   int ptype;
55073   int s;
55074
55075   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
55076      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55077      ptype = IPPROTO_TCP;
55078   } else if (SOL_SOCKET == IPPROTO_IP) {
55079      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55080      ptype = IPPROTO_IP;
55081   } else if (SOL_SOCKET == IPPROTO_IPV6) {
55082      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55083      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55084   } else if (SOL_SOCKET == IPPROTO_UDP) {
55085      stype = SOCK_DGRAM;
55086      ptype = IPPROTO_UDP;
55087   } else {
55088       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
55089       exit(1);
55090   }
55091
55092   if((s = socket(PF_INET, stype, ptype)) < 0) {
55093      perror("socket");
55094      exit(1);
55095   }
55096
55097   optval = 1;
55098   optlen = sizeof(optval);
55099   if(setsockopt(s, SOL_SOCKET, SO_USE_IFBUFS, &optval, optlen) < 0) {
55100      perror("setsockopt: SOL_SOCKET SO_USE_IFBUFS");
55101      close(s);
55102      exit(1);
55103   }
55104  ;
55105  return 0;
55106}
55107_ACEOF
55108if ac_fn_c_try_compile "$LINENO"; then :
55109  _compileok=1
55110fi
55111rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55112
55113  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55114/* end confdefs.h.  */
55115
55116#include <sys/types.h>
55117#include <sys/socket.h>
55118#include <netinet/in.h>
55119#include <netinet/tcp.h>
55120#include <netinet/udp.h>
55121
55122#include <stdio.h>
55123#include <stdlib.h>
55124#include <unistd.h>
55125
55126int
55127main ()
55128{
55129
55130   socklen_t optlen;
55131   int optval;
55132   int stype;
55133   int ptype;
55134   int s;
55135
55136   if (SOL_SOCKET == SOL_SOCKET || SOL_SOCKET == IPPROTO_TCP) {
55137      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55138      ptype = IPPROTO_TCP;
55139   } else if (SOL_SOCKET == IPPROTO_IP) {
55140      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55141      ptype = IPPROTO_IP;
55142   } else if (SOL_SOCKET == IPPROTO_IPV6) {
55143      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55144      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55145   } else if (SOL_SOCKET == IPPROTO_UDP) {
55146      stype = SOCK_DGRAM;
55147      ptype = IPPROTO_UDP;
55148   } else {
55149       fprintf(stderr, "error: unexpected socket type: SOL_SOCKET");
55150       exit(1);
55151   }
55152
55153   if((s = socket(PF_INET6, stype, ptype)) < 0) {
55154      perror("socket");
55155      exit(1);
55156   }
55157
55158   optval = 1;
55159   optlen = sizeof(optval);
55160   if(setsockopt(s, SOL_SOCKET, SO_USE_IFBUFS, &optval, optlen) < 0) {
55161      perror("setsockopt: SOL_SOCKET SO_USE_IFBUFS");
55162      close(s);
55163      exit(1);
55164   }
55165  ;
55166  return 0;
55167}
55168_ACEOF
55169if ac_fn_c_try_compile "$LINENO"; then :
55170  _compileok=1
55171fi
55172rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55173
55174  if test x"${_compileok}" != x; then
55175    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
55176$as_echo "yes" >&6; }
55177
55178cat >>confdefs.h <<_ACEOF
55179#define HAVE_SO_USE_IFBUFS 1
55180_ACEOF
55181
55182cat >>confdefs.h <<_ACEOF
55183#define SOCKS_SO_USE_IFBUFS_LVL SOL_SOCKET
55184_ACEOF
55185
55186cat >>confdefs.h <<_ACEOF
55187#define SOCKS_SO_USE_IFBUFS_NAME "so_use_ifbufs"
55188_ACEOF
55189    if test x"SOL_SOCKET" = x"IPPROTO_IP"; then
55190       #ipv4-only
55191
55192cat >>confdefs.h <<_ACEOF
55193#define SOCKS_SO_USE_IFBUFS_IPV4 1
55194_ACEOF
55195
55196cat >>confdefs.h <<_ACEOF
55197#define SOCKS_SO_USE_IFBUFS_IPV6 0
55198_ACEOF
55199    elif test x"SOL_SOCKET" = x"IPPROTO_IPV6"; then
55200       #ipv6-only
55201
55202cat >>confdefs.h <<_ACEOF
55203#define SOCKS_SO_USE_IFBUFS_IPV4 0
55204_ACEOF
55205
55206cat >>confdefs.h <<_ACEOF
55207#define SOCKS_SO_USE_IFBUFS_IPV6 1
55208_ACEOF
55209    else
55210       #both ipv4 and ipv6
55211
55212cat >>confdefs.h <<_ACEOF
55213#define SOCKS_SO_USE_IFBUFS_IPV4 1
55214_ACEOF
55215
55216cat >>confdefs.h <<_ACEOF
55217#define SOCKS_SO_USE_IFBUFS_IPV6 1
55218_ACEOF
55219    fi
55220    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }SO_USE_IFBUFS"
55221  else
55222    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
55223$as_echo "no" >&6; }
55224  fi #likely not usable
55225
55226#ipv4 level
55227unset _compileok
55228  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_ADDRFORM" >&5
55229$as_echo_n "checking for IPPROTO_IP socket option IP_ADDRFORM... " >&6; }
55230  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55231/* end confdefs.h.  */
55232
55233#include <sys/types.h>
55234#include <sys/socket.h>
55235#include <netinet/in.h>
55236#include <netinet/tcp.h>
55237#include <netinet/udp.h>
55238
55239#include <stdio.h>
55240#include <stdlib.h>
55241#include <unistd.h>
55242
55243int
55244main ()
55245{
55246
55247   socklen_t optlen;
55248   int optval;
55249   int stype;
55250   int ptype;
55251   int s;
55252
55253   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55254      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55255      ptype = IPPROTO_TCP;
55256   } else if (IPPROTO_IP == IPPROTO_IP) {
55257      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55258      ptype = IPPROTO_IP;
55259   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55260      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55261      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55262   } else if (IPPROTO_IP == IPPROTO_UDP) {
55263      stype = SOCK_DGRAM;
55264      ptype = IPPROTO_UDP;
55265   } else {
55266       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55267       exit(1);
55268   }
55269
55270   if((s = socket(PF_INET, stype, ptype)) < 0) {
55271      perror("socket");
55272      exit(1);
55273   }
55274
55275   optval = 1;
55276   optlen = sizeof(optval);
55277   if(setsockopt(s, IPPROTO_IP, IP_ADDRFORM, &optval, optlen) < 0) {
55278      perror("setsockopt: IPPROTO_IP IP_ADDRFORM");
55279      close(s);
55280      exit(1);
55281   }
55282  ;
55283  return 0;
55284}
55285_ACEOF
55286if ac_fn_c_try_compile "$LINENO"; then :
55287  _compileok=1
55288fi
55289rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55290
55291  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55292/* end confdefs.h.  */
55293
55294#include <sys/types.h>
55295#include <sys/socket.h>
55296#include <netinet/in.h>
55297#include <netinet/tcp.h>
55298#include <netinet/udp.h>
55299
55300#include <stdio.h>
55301#include <stdlib.h>
55302#include <unistd.h>
55303
55304int
55305main ()
55306{
55307
55308   socklen_t optlen;
55309   int optval;
55310   int stype;
55311   int ptype;
55312   int s;
55313
55314   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55315      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55316      ptype = IPPROTO_TCP;
55317   } else if (IPPROTO_IP == IPPROTO_IP) {
55318      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55319      ptype = IPPROTO_IP;
55320   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55321      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55322      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55323   } else if (IPPROTO_IP == IPPROTO_UDP) {
55324      stype = SOCK_DGRAM;
55325      ptype = IPPROTO_UDP;
55326   } else {
55327       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55328       exit(1);
55329   }
55330
55331   if((s = socket(PF_INET6, stype, ptype)) < 0) {
55332      perror("socket");
55333      exit(1);
55334   }
55335
55336   optval = 1;
55337   optlen = sizeof(optval);
55338   if(setsockopt(s, IPPROTO_IP, IP_ADDRFORM, &optval, optlen) < 0) {
55339      perror("setsockopt: IPPROTO_IP IP_ADDRFORM");
55340      close(s);
55341      exit(1);
55342   }
55343  ;
55344  return 0;
55345}
55346_ACEOF
55347if ac_fn_c_try_compile "$LINENO"; then :
55348  _compileok=1
55349fi
55350rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55351
55352  if test x"${_compileok}" != x; then
55353    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
55354$as_echo "yes" >&6; }
55355
55356cat >>confdefs.h <<_ACEOF
55357#define HAVE_IP_ADDRFORM 1
55358_ACEOF
55359
55360cat >>confdefs.h <<_ACEOF
55361#define SOCKS_IP_ADDRFORM_LVL IPPROTO_IP
55362_ACEOF
55363
55364cat >>confdefs.h <<_ACEOF
55365#define SOCKS_IP_ADDRFORM_NAME "ip_addrform"
55366_ACEOF
55367    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
55368       #ipv4-only
55369
55370cat >>confdefs.h <<_ACEOF
55371#define SOCKS_IP_ADDRFORM_IPV4 1
55372_ACEOF
55373
55374cat >>confdefs.h <<_ACEOF
55375#define SOCKS_IP_ADDRFORM_IPV6 0
55376_ACEOF
55377    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
55378       #ipv6-only
55379
55380cat >>confdefs.h <<_ACEOF
55381#define SOCKS_IP_ADDRFORM_IPV4 0
55382_ACEOF
55383
55384cat >>confdefs.h <<_ACEOF
55385#define SOCKS_IP_ADDRFORM_IPV6 1
55386_ACEOF
55387    else
55388       #both ipv4 and ipv6
55389
55390cat >>confdefs.h <<_ACEOF
55391#define SOCKS_IP_ADDRFORM_IPV4 1
55392_ACEOF
55393
55394cat >>confdefs.h <<_ACEOF
55395#define SOCKS_IP_ADDRFORM_IPV6 1
55396_ACEOF
55397    fi
55398    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_ADDRFORM"
55399  else
55400    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
55401$as_echo "no" >&6; }
55402  fi #not usable
55403unset _compileok
55404  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_ADD_MEMBERSHIP" >&5
55405$as_echo_n "checking for IPPROTO_IP socket option IP_ADD_MEMBERSHIP... " >&6; }
55406  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55407/* end confdefs.h.  */
55408
55409#include <sys/types.h>
55410#include <sys/socket.h>
55411#include <netinet/in.h>
55412#include <netinet/tcp.h>
55413#include <netinet/udp.h>
55414
55415#include <stdio.h>
55416#include <stdlib.h>
55417#include <unistd.h>
55418
55419int
55420main ()
55421{
55422
55423   socklen_t optlen;
55424   int optval;
55425   int stype;
55426   int ptype;
55427   int s;
55428
55429   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55430      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55431      ptype = IPPROTO_TCP;
55432   } else if (IPPROTO_IP == IPPROTO_IP) {
55433      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55434      ptype = IPPROTO_IP;
55435   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55436      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55437      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55438   } else if (IPPROTO_IP == IPPROTO_UDP) {
55439      stype = SOCK_DGRAM;
55440      ptype = IPPROTO_UDP;
55441   } else {
55442       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55443       exit(1);
55444   }
55445
55446   if((s = socket(PF_INET, stype, ptype)) < 0) {
55447      perror("socket");
55448      exit(1);
55449   }
55450
55451   optval = 1;
55452   optlen = sizeof(optval);
55453   if(setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &optval, optlen) < 0) {
55454      perror("setsockopt: IPPROTO_IP IP_ADD_MEMBERSHIP");
55455      close(s);
55456      exit(1);
55457   }
55458  ;
55459  return 0;
55460}
55461_ACEOF
55462if ac_fn_c_try_compile "$LINENO"; then :
55463  _compileok=1
55464fi
55465rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55466
55467  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55468/* end confdefs.h.  */
55469
55470#include <sys/types.h>
55471#include <sys/socket.h>
55472#include <netinet/in.h>
55473#include <netinet/tcp.h>
55474#include <netinet/udp.h>
55475
55476#include <stdio.h>
55477#include <stdlib.h>
55478#include <unistd.h>
55479
55480int
55481main ()
55482{
55483
55484   socklen_t optlen;
55485   int optval;
55486   int stype;
55487   int ptype;
55488   int s;
55489
55490   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55491      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55492      ptype = IPPROTO_TCP;
55493   } else if (IPPROTO_IP == IPPROTO_IP) {
55494      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55495      ptype = IPPROTO_IP;
55496   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55497      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55498      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55499   } else if (IPPROTO_IP == IPPROTO_UDP) {
55500      stype = SOCK_DGRAM;
55501      ptype = IPPROTO_UDP;
55502   } else {
55503       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55504       exit(1);
55505   }
55506
55507   if((s = socket(PF_INET6, stype, ptype)) < 0) {
55508      perror("socket");
55509      exit(1);
55510   }
55511
55512   optval = 1;
55513   optlen = sizeof(optval);
55514   if(setsockopt(s, IPPROTO_IP, IP_ADD_MEMBERSHIP, &optval, optlen) < 0) {
55515      perror("setsockopt: IPPROTO_IP IP_ADD_MEMBERSHIP");
55516      close(s);
55517      exit(1);
55518   }
55519  ;
55520  return 0;
55521}
55522_ACEOF
55523if ac_fn_c_try_compile "$LINENO"; then :
55524  _compileok=1
55525fi
55526rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55527
55528  if test x"${_compileok}" != x; then
55529    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
55530$as_echo "yes" >&6; }
55531
55532cat >>confdefs.h <<_ACEOF
55533#define HAVE_IP_ADD_MEMBERSHIP 1
55534_ACEOF
55535
55536cat >>confdefs.h <<_ACEOF
55537#define SOCKS_IP_ADD_MEMBERSHIP_LVL IPPROTO_IP
55538_ACEOF
55539
55540cat >>confdefs.h <<_ACEOF
55541#define SOCKS_IP_ADD_MEMBERSHIP_NAME "ip_add_membership"
55542_ACEOF
55543    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
55544       #ipv4-only
55545
55546cat >>confdefs.h <<_ACEOF
55547#define SOCKS_IP_ADD_MEMBERSHIP_IPV4 1
55548_ACEOF
55549
55550cat >>confdefs.h <<_ACEOF
55551#define SOCKS_IP_ADD_MEMBERSHIP_IPV6 0
55552_ACEOF
55553    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
55554       #ipv6-only
55555
55556cat >>confdefs.h <<_ACEOF
55557#define SOCKS_IP_ADD_MEMBERSHIP_IPV4 0
55558_ACEOF
55559
55560cat >>confdefs.h <<_ACEOF
55561#define SOCKS_IP_ADD_MEMBERSHIP_IPV6 1
55562_ACEOF
55563    else
55564       #both ipv4 and ipv6
55565
55566cat >>confdefs.h <<_ACEOF
55567#define SOCKS_IP_ADD_MEMBERSHIP_IPV4 1
55568_ACEOF
55569
55570cat >>confdefs.h <<_ACEOF
55571#define SOCKS_IP_ADD_MEMBERSHIP_IPV6 1
55572_ACEOF
55573    fi
55574    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_ADD_MEMBERSHIP"
55575  else
55576    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
55577$as_echo "no" >&6; }
55578  fi #likely not usable
55579unset _compileok
55580  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_ADD_SOURCE_MEMBERSHIP" >&5
55581$as_echo_n "checking for IPPROTO_IP socket option IP_ADD_SOURCE_MEMBERSHIP... " >&6; }
55582  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55583/* end confdefs.h.  */
55584
55585#include <sys/types.h>
55586#include <sys/socket.h>
55587#include <netinet/in.h>
55588#include <netinet/tcp.h>
55589#include <netinet/udp.h>
55590
55591#include <stdio.h>
55592#include <stdlib.h>
55593#include <unistd.h>
55594
55595int
55596main ()
55597{
55598
55599   socklen_t optlen;
55600   int optval;
55601   int stype;
55602   int ptype;
55603   int s;
55604
55605   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55606      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55607      ptype = IPPROTO_TCP;
55608   } else if (IPPROTO_IP == IPPROTO_IP) {
55609      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55610      ptype = IPPROTO_IP;
55611   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55612      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55613      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55614   } else if (IPPROTO_IP == IPPROTO_UDP) {
55615      stype = SOCK_DGRAM;
55616      ptype = IPPROTO_UDP;
55617   } else {
55618       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55619       exit(1);
55620   }
55621
55622   if((s = socket(PF_INET, stype, ptype)) < 0) {
55623      perror("socket");
55624      exit(1);
55625   }
55626
55627   optval = 1;
55628   optlen = sizeof(optval);
55629   if(setsockopt(s, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, &optval, optlen) < 0) {
55630      perror("setsockopt: IPPROTO_IP IP_ADD_SOURCE_MEMBERSHIP");
55631      close(s);
55632      exit(1);
55633   }
55634  ;
55635  return 0;
55636}
55637_ACEOF
55638if ac_fn_c_try_compile "$LINENO"; then :
55639  _compileok=1
55640fi
55641rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55642
55643  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55644/* end confdefs.h.  */
55645
55646#include <sys/types.h>
55647#include <sys/socket.h>
55648#include <netinet/in.h>
55649#include <netinet/tcp.h>
55650#include <netinet/udp.h>
55651
55652#include <stdio.h>
55653#include <stdlib.h>
55654#include <unistd.h>
55655
55656int
55657main ()
55658{
55659
55660   socklen_t optlen;
55661   int optval;
55662   int stype;
55663   int ptype;
55664   int s;
55665
55666   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55667      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55668      ptype = IPPROTO_TCP;
55669   } else if (IPPROTO_IP == IPPROTO_IP) {
55670      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55671      ptype = IPPROTO_IP;
55672   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55673      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55674      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55675   } else if (IPPROTO_IP == IPPROTO_UDP) {
55676      stype = SOCK_DGRAM;
55677      ptype = IPPROTO_UDP;
55678   } else {
55679       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55680       exit(1);
55681   }
55682
55683   if((s = socket(PF_INET6, stype, ptype)) < 0) {
55684      perror("socket");
55685      exit(1);
55686   }
55687
55688   optval = 1;
55689   optlen = sizeof(optval);
55690   if(setsockopt(s, IPPROTO_IP, IP_ADD_SOURCE_MEMBERSHIP, &optval, optlen) < 0) {
55691      perror("setsockopt: IPPROTO_IP IP_ADD_SOURCE_MEMBERSHIP");
55692      close(s);
55693      exit(1);
55694   }
55695  ;
55696  return 0;
55697}
55698_ACEOF
55699if ac_fn_c_try_compile "$LINENO"; then :
55700  _compileok=1
55701fi
55702rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55703
55704  if test x"${_compileok}" != x; then
55705    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
55706$as_echo "yes" >&6; }
55707
55708cat >>confdefs.h <<_ACEOF
55709#define HAVE_IP_ADD_SOURCE_MEMBERSHIP 1
55710_ACEOF
55711
55712cat >>confdefs.h <<_ACEOF
55713#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_LVL IPPROTO_IP
55714_ACEOF
55715
55716cat >>confdefs.h <<_ACEOF
55717#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_NAME "ip_add_source_membership"
55718_ACEOF
55719    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
55720       #ipv4-only
55721
55722cat >>confdefs.h <<_ACEOF
55723#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_IPV4 1
55724_ACEOF
55725
55726cat >>confdefs.h <<_ACEOF
55727#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_IPV6 0
55728_ACEOF
55729    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
55730       #ipv6-only
55731
55732cat >>confdefs.h <<_ACEOF
55733#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_IPV4 0
55734_ACEOF
55735
55736cat >>confdefs.h <<_ACEOF
55737#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_IPV6 1
55738_ACEOF
55739    else
55740       #both ipv4 and ipv6
55741
55742cat >>confdefs.h <<_ACEOF
55743#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_IPV4 1
55744_ACEOF
55745
55746cat >>confdefs.h <<_ACEOF
55747#define SOCKS_IP_ADD_SOURCE_MEMBERSHIP_IPV6 1
55748_ACEOF
55749    fi
55750    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_ADD_SOURCE_MEMBERSHIP"
55751  else
55752    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
55753$as_echo "no" >&6; }
55754  fi #not usable
55755unset _compileok
55756  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_BLOCK_SOURCE" >&5
55757$as_echo_n "checking for IPPROTO_IP socket option IP_BLOCK_SOURCE... " >&6; }
55758  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55759/* end confdefs.h.  */
55760
55761#include <sys/types.h>
55762#include <sys/socket.h>
55763#include <netinet/in.h>
55764#include <netinet/tcp.h>
55765#include <netinet/udp.h>
55766
55767#include <stdio.h>
55768#include <stdlib.h>
55769#include <unistd.h>
55770
55771int
55772main ()
55773{
55774
55775   socklen_t optlen;
55776   int optval;
55777   int stype;
55778   int ptype;
55779   int s;
55780
55781   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55782      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55783      ptype = IPPROTO_TCP;
55784   } else if (IPPROTO_IP == IPPROTO_IP) {
55785      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55786      ptype = IPPROTO_IP;
55787   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55788      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55789      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55790   } else if (IPPROTO_IP == IPPROTO_UDP) {
55791      stype = SOCK_DGRAM;
55792      ptype = IPPROTO_UDP;
55793   } else {
55794       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55795       exit(1);
55796   }
55797
55798   if((s = socket(PF_INET, stype, ptype)) < 0) {
55799      perror("socket");
55800      exit(1);
55801   }
55802
55803   optval = 1;
55804   optlen = sizeof(optval);
55805   if(setsockopt(s, IPPROTO_IP, IP_BLOCK_SOURCE, &optval, optlen) < 0) {
55806      perror("setsockopt: IPPROTO_IP IP_BLOCK_SOURCE");
55807      close(s);
55808      exit(1);
55809   }
55810  ;
55811  return 0;
55812}
55813_ACEOF
55814if ac_fn_c_try_compile "$LINENO"; then :
55815  _compileok=1
55816fi
55817rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55818
55819  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55820/* end confdefs.h.  */
55821
55822#include <sys/types.h>
55823#include <sys/socket.h>
55824#include <netinet/in.h>
55825#include <netinet/tcp.h>
55826#include <netinet/udp.h>
55827
55828#include <stdio.h>
55829#include <stdlib.h>
55830#include <unistd.h>
55831
55832int
55833main ()
55834{
55835
55836   socklen_t optlen;
55837   int optval;
55838   int stype;
55839   int ptype;
55840   int s;
55841
55842   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55843      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55844      ptype = IPPROTO_TCP;
55845   } else if (IPPROTO_IP == IPPROTO_IP) {
55846      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55847      ptype = IPPROTO_IP;
55848   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55849      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55850      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55851   } else if (IPPROTO_IP == IPPROTO_UDP) {
55852      stype = SOCK_DGRAM;
55853      ptype = IPPROTO_UDP;
55854   } else {
55855       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55856       exit(1);
55857   }
55858
55859   if((s = socket(PF_INET6, stype, ptype)) < 0) {
55860      perror("socket");
55861      exit(1);
55862   }
55863
55864   optval = 1;
55865   optlen = sizeof(optval);
55866   if(setsockopt(s, IPPROTO_IP, IP_BLOCK_SOURCE, &optval, optlen) < 0) {
55867      perror("setsockopt: IPPROTO_IP IP_BLOCK_SOURCE");
55868      close(s);
55869      exit(1);
55870   }
55871  ;
55872  return 0;
55873}
55874_ACEOF
55875if ac_fn_c_try_compile "$LINENO"; then :
55876  _compileok=1
55877fi
55878rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55879
55880  if test x"${_compileok}" != x; then
55881    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
55882$as_echo "yes" >&6; }
55883
55884cat >>confdefs.h <<_ACEOF
55885#define HAVE_IP_BLOCK_SOURCE 1
55886_ACEOF
55887
55888cat >>confdefs.h <<_ACEOF
55889#define SOCKS_IP_BLOCK_SOURCE_LVL IPPROTO_IP
55890_ACEOF
55891
55892cat >>confdefs.h <<_ACEOF
55893#define SOCKS_IP_BLOCK_SOURCE_NAME "ip_block_source"
55894_ACEOF
55895    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
55896       #ipv4-only
55897
55898cat >>confdefs.h <<_ACEOF
55899#define SOCKS_IP_BLOCK_SOURCE_IPV4 1
55900_ACEOF
55901
55902cat >>confdefs.h <<_ACEOF
55903#define SOCKS_IP_BLOCK_SOURCE_IPV6 0
55904_ACEOF
55905    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
55906       #ipv6-only
55907
55908cat >>confdefs.h <<_ACEOF
55909#define SOCKS_IP_BLOCK_SOURCE_IPV4 0
55910_ACEOF
55911
55912cat >>confdefs.h <<_ACEOF
55913#define SOCKS_IP_BLOCK_SOURCE_IPV6 1
55914_ACEOF
55915    else
55916       #both ipv4 and ipv6
55917
55918cat >>confdefs.h <<_ACEOF
55919#define SOCKS_IP_BLOCK_SOURCE_IPV4 1
55920_ACEOF
55921
55922cat >>confdefs.h <<_ACEOF
55923#define SOCKS_IP_BLOCK_SOURCE_IPV6 1
55924_ACEOF
55925    fi
55926    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_BLOCK_SOURCE"
55927  else
55928    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
55929$as_echo "no" >&6; }
55930  fi #not usable
55931unset _compileok
55932  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_DHCPMODE" >&5
55933$as_echo_n "checking for IPPROTO_IP socket option IP_DHCPMODE... " >&6; }
55934  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55935/* end confdefs.h.  */
55936
55937#include <sys/types.h>
55938#include <sys/socket.h>
55939#include <netinet/in.h>
55940#include <netinet/tcp.h>
55941#include <netinet/udp.h>
55942
55943#include <stdio.h>
55944#include <stdlib.h>
55945#include <unistd.h>
55946
55947int
55948main ()
55949{
55950
55951   socklen_t optlen;
55952   int optval;
55953   int stype;
55954   int ptype;
55955   int s;
55956
55957   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
55958      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
55959      ptype = IPPROTO_TCP;
55960   } else if (IPPROTO_IP == IPPROTO_IP) {
55961      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
55962      ptype = IPPROTO_IP;
55963   } else if (IPPROTO_IP == IPPROTO_IPV6) {
55964      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
55965      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
55966   } else if (IPPROTO_IP == IPPROTO_UDP) {
55967      stype = SOCK_DGRAM;
55968      ptype = IPPROTO_UDP;
55969   } else {
55970       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
55971       exit(1);
55972   }
55973
55974   if((s = socket(PF_INET, stype, ptype)) < 0) {
55975      perror("socket");
55976      exit(1);
55977   }
55978
55979   optval = 1;
55980   optlen = sizeof(optval);
55981   if(setsockopt(s, IPPROTO_IP, IP_DHCPMODE, &optval, optlen) < 0) {
55982      perror("setsockopt: IPPROTO_IP IP_DHCPMODE");
55983      close(s);
55984      exit(1);
55985   }
55986  ;
55987  return 0;
55988}
55989_ACEOF
55990if ac_fn_c_try_compile "$LINENO"; then :
55991  _compileok=1
55992fi
55993rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
55994
55995  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
55996/* end confdefs.h.  */
55997
55998#include <sys/types.h>
55999#include <sys/socket.h>
56000#include <netinet/in.h>
56001#include <netinet/tcp.h>
56002#include <netinet/udp.h>
56003
56004#include <stdio.h>
56005#include <stdlib.h>
56006#include <unistd.h>
56007
56008int
56009main ()
56010{
56011
56012   socklen_t optlen;
56013   int optval;
56014   int stype;
56015   int ptype;
56016   int s;
56017
56018   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56019      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56020      ptype = IPPROTO_TCP;
56021   } else if (IPPROTO_IP == IPPROTO_IP) {
56022      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56023      ptype = IPPROTO_IP;
56024   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56025      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56026      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56027   } else if (IPPROTO_IP == IPPROTO_UDP) {
56028      stype = SOCK_DGRAM;
56029      ptype = IPPROTO_UDP;
56030   } else {
56031       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56032       exit(1);
56033   }
56034
56035   if((s = socket(PF_INET6, stype, ptype)) < 0) {
56036      perror("socket");
56037      exit(1);
56038   }
56039
56040   optval = 1;
56041   optlen = sizeof(optval);
56042   if(setsockopt(s, IPPROTO_IP, IP_DHCPMODE, &optval, optlen) < 0) {
56043      perror("setsockopt: IPPROTO_IP IP_DHCPMODE");
56044      close(s);
56045      exit(1);
56046   }
56047  ;
56048  return 0;
56049}
56050_ACEOF
56051if ac_fn_c_try_compile "$LINENO"; then :
56052  _compileok=1
56053fi
56054rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56055
56056  if test x"${_compileok}" != x; then
56057    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
56058$as_echo "yes" >&6; }
56059
56060cat >>confdefs.h <<_ACEOF
56061#define HAVE_IP_DHCPMODE 1
56062_ACEOF
56063
56064cat >>confdefs.h <<_ACEOF
56065#define SOCKS_IP_DHCPMODE_LVL IPPROTO_IP
56066_ACEOF
56067
56068cat >>confdefs.h <<_ACEOF
56069#define SOCKS_IP_DHCPMODE_NAME "ip_dhcpmode"
56070_ACEOF
56071    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
56072       #ipv4-only
56073
56074cat >>confdefs.h <<_ACEOF
56075#define SOCKS_IP_DHCPMODE_IPV4 1
56076_ACEOF
56077
56078cat >>confdefs.h <<_ACEOF
56079#define SOCKS_IP_DHCPMODE_IPV6 0
56080_ACEOF
56081    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
56082       #ipv6-only
56083
56084cat >>confdefs.h <<_ACEOF
56085#define SOCKS_IP_DHCPMODE_IPV4 0
56086_ACEOF
56087
56088cat >>confdefs.h <<_ACEOF
56089#define SOCKS_IP_DHCPMODE_IPV6 1
56090_ACEOF
56091    else
56092       #both ipv4 and ipv6
56093
56094cat >>confdefs.h <<_ACEOF
56095#define SOCKS_IP_DHCPMODE_IPV4 1
56096_ACEOF
56097
56098cat >>confdefs.h <<_ACEOF
56099#define SOCKS_IP_DHCPMODE_IPV6 1
56100_ACEOF
56101    fi
56102    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_DHCPMODE"
56103  else
56104    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
56105$as_echo "no" >&6; }
56106  fi #likely not usable
56107unset _compileok
56108  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_DROP_MEMBERSHIP" >&5
56109$as_echo_n "checking for IPPROTO_IP socket option IP_DROP_MEMBERSHIP... " >&6; }
56110  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56111/* end confdefs.h.  */
56112
56113#include <sys/types.h>
56114#include <sys/socket.h>
56115#include <netinet/in.h>
56116#include <netinet/tcp.h>
56117#include <netinet/udp.h>
56118
56119#include <stdio.h>
56120#include <stdlib.h>
56121#include <unistd.h>
56122
56123int
56124main ()
56125{
56126
56127   socklen_t optlen;
56128   int optval;
56129   int stype;
56130   int ptype;
56131   int s;
56132
56133   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56134      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56135      ptype = IPPROTO_TCP;
56136   } else if (IPPROTO_IP == IPPROTO_IP) {
56137      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56138      ptype = IPPROTO_IP;
56139   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56140      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56141      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56142   } else if (IPPROTO_IP == IPPROTO_UDP) {
56143      stype = SOCK_DGRAM;
56144      ptype = IPPROTO_UDP;
56145   } else {
56146       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56147       exit(1);
56148   }
56149
56150   if((s = socket(PF_INET, stype, ptype)) < 0) {
56151      perror("socket");
56152      exit(1);
56153   }
56154
56155   optval = 1;
56156   optlen = sizeof(optval);
56157   if(setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, &optval, optlen) < 0) {
56158      perror("setsockopt: IPPROTO_IP IP_DROP_MEMBERSHIP");
56159      close(s);
56160      exit(1);
56161   }
56162  ;
56163  return 0;
56164}
56165_ACEOF
56166if ac_fn_c_try_compile "$LINENO"; then :
56167  _compileok=1
56168fi
56169rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56170
56171  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56172/* end confdefs.h.  */
56173
56174#include <sys/types.h>
56175#include <sys/socket.h>
56176#include <netinet/in.h>
56177#include <netinet/tcp.h>
56178#include <netinet/udp.h>
56179
56180#include <stdio.h>
56181#include <stdlib.h>
56182#include <unistd.h>
56183
56184int
56185main ()
56186{
56187
56188   socklen_t optlen;
56189   int optval;
56190   int stype;
56191   int ptype;
56192   int s;
56193
56194   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56195      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56196      ptype = IPPROTO_TCP;
56197   } else if (IPPROTO_IP == IPPROTO_IP) {
56198      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56199      ptype = IPPROTO_IP;
56200   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56201      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56202      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56203   } else if (IPPROTO_IP == IPPROTO_UDP) {
56204      stype = SOCK_DGRAM;
56205      ptype = IPPROTO_UDP;
56206   } else {
56207       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56208       exit(1);
56209   }
56210
56211   if((s = socket(PF_INET6, stype, ptype)) < 0) {
56212      perror("socket");
56213      exit(1);
56214   }
56215
56216   optval = 1;
56217   optlen = sizeof(optval);
56218   if(setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, &optval, optlen) < 0) {
56219      perror("setsockopt: IPPROTO_IP IP_DROP_MEMBERSHIP");
56220      close(s);
56221      exit(1);
56222   }
56223  ;
56224  return 0;
56225}
56226_ACEOF
56227if ac_fn_c_try_compile "$LINENO"; then :
56228  _compileok=1
56229fi
56230rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56231
56232  if test x"${_compileok}" != x; then
56233    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
56234$as_echo "yes" >&6; }
56235
56236cat >>confdefs.h <<_ACEOF
56237#define HAVE_IP_DROP_MEMBERSHIP 1
56238_ACEOF
56239
56240cat >>confdefs.h <<_ACEOF
56241#define SOCKS_IP_DROP_MEMBERSHIP_LVL IPPROTO_IP
56242_ACEOF
56243
56244cat >>confdefs.h <<_ACEOF
56245#define SOCKS_IP_DROP_MEMBERSHIP_NAME "ip_drop_membership"
56246_ACEOF
56247    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
56248       #ipv4-only
56249
56250cat >>confdefs.h <<_ACEOF
56251#define SOCKS_IP_DROP_MEMBERSHIP_IPV4 1
56252_ACEOF
56253
56254cat >>confdefs.h <<_ACEOF
56255#define SOCKS_IP_DROP_MEMBERSHIP_IPV6 0
56256_ACEOF
56257    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
56258       #ipv6-only
56259
56260cat >>confdefs.h <<_ACEOF
56261#define SOCKS_IP_DROP_MEMBERSHIP_IPV4 0
56262_ACEOF
56263
56264cat >>confdefs.h <<_ACEOF
56265#define SOCKS_IP_DROP_MEMBERSHIP_IPV6 1
56266_ACEOF
56267    else
56268       #both ipv4 and ipv6
56269
56270cat >>confdefs.h <<_ACEOF
56271#define SOCKS_IP_DROP_MEMBERSHIP_IPV4 1
56272_ACEOF
56273
56274cat >>confdefs.h <<_ACEOF
56275#define SOCKS_IP_DROP_MEMBERSHIP_IPV6 1
56276_ACEOF
56277    fi
56278    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_DROP_MEMBERSHIP"
56279  else
56280    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
56281$as_echo "no" >&6; }
56282  fi #likely not usable
56283unset _compileok
56284  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_DROP_MEMBERSHIP" >&5
56285$as_echo_n "checking for IPPROTO_IP socket option IP_DROP_MEMBERSHIP... " >&6; }
56286  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56287/* end confdefs.h.  */
56288
56289#include <sys/types.h>
56290#include <sys/socket.h>
56291#include <netinet/in.h>
56292#include <netinet/tcp.h>
56293#include <netinet/udp.h>
56294
56295#include <stdio.h>
56296#include <stdlib.h>
56297#include <unistd.h>
56298
56299int
56300main ()
56301{
56302
56303   socklen_t optlen;
56304   int optval;
56305   int stype;
56306   int ptype;
56307   int s;
56308
56309   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56310      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56311      ptype = IPPROTO_TCP;
56312   } else if (IPPROTO_IP == IPPROTO_IP) {
56313      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56314      ptype = IPPROTO_IP;
56315   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56316      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56317      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56318   } else if (IPPROTO_IP == IPPROTO_UDP) {
56319      stype = SOCK_DGRAM;
56320      ptype = IPPROTO_UDP;
56321   } else {
56322       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56323       exit(1);
56324   }
56325
56326   if((s = socket(PF_INET, stype, ptype)) < 0) {
56327      perror("socket");
56328      exit(1);
56329   }
56330
56331   optval = 1;
56332   optlen = sizeof(optval);
56333   if(setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, &optval, optlen) < 0) {
56334      perror("setsockopt: IPPROTO_IP IP_DROP_MEMBERSHIP");
56335      close(s);
56336      exit(1);
56337   }
56338  ;
56339  return 0;
56340}
56341_ACEOF
56342if ac_fn_c_try_compile "$LINENO"; then :
56343  _compileok=1
56344fi
56345rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56346
56347  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56348/* end confdefs.h.  */
56349
56350#include <sys/types.h>
56351#include <sys/socket.h>
56352#include <netinet/in.h>
56353#include <netinet/tcp.h>
56354#include <netinet/udp.h>
56355
56356#include <stdio.h>
56357#include <stdlib.h>
56358#include <unistd.h>
56359
56360int
56361main ()
56362{
56363
56364   socklen_t optlen;
56365   int optval;
56366   int stype;
56367   int ptype;
56368   int s;
56369
56370   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56371      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56372      ptype = IPPROTO_TCP;
56373   } else if (IPPROTO_IP == IPPROTO_IP) {
56374      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56375      ptype = IPPROTO_IP;
56376   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56377      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56378      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56379   } else if (IPPROTO_IP == IPPROTO_UDP) {
56380      stype = SOCK_DGRAM;
56381      ptype = IPPROTO_UDP;
56382   } else {
56383       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56384       exit(1);
56385   }
56386
56387   if((s = socket(PF_INET6, stype, ptype)) < 0) {
56388      perror("socket");
56389      exit(1);
56390   }
56391
56392   optval = 1;
56393   optlen = sizeof(optval);
56394   if(setsockopt(s, IPPROTO_IP, IP_DROP_MEMBERSHIP, &optval, optlen) < 0) {
56395      perror("setsockopt: IPPROTO_IP IP_DROP_MEMBERSHIP");
56396      close(s);
56397      exit(1);
56398   }
56399  ;
56400  return 0;
56401}
56402_ACEOF
56403if ac_fn_c_try_compile "$LINENO"; then :
56404  _compileok=1
56405fi
56406rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56407
56408  if test x"${_compileok}" != x; then
56409    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
56410$as_echo "yes" >&6; }
56411
56412cat >>confdefs.h <<_ACEOF
56413#define HAVE_IP_DROP_MEMBERSHIP 1
56414_ACEOF
56415
56416cat >>confdefs.h <<_ACEOF
56417#define SOCKS_IP_DROP_MEMBERSHIP_LVL IPPROTO_IP
56418_ACEOF
56419
56420cat >>confdefs.h <<_ACEOF
56421#define SOCKS_IP_DROP_MEMBERSHIP_NAME "ip_drop_membership"
56422_ACEOF
56423    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
56424       #ipv4-only
56425
56426cat >>confdefs.h <<_ACEOF
56427#define SOCKS_IP_DROP_MEMBERSHIP_IPV4 1
56428_ACEOF
56429
56430cat >>confdefs.h <<_ACEOF
56431#define SOCKS_IP_DROP_MEMBERSHIP_IPV6 0
56432_ACEOF
56433    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
56434       #ipv6-only
56435
56436cat >>confdefs.h <<_ACEOF
56437#define SOCKS_IP_DROP_MEMBERSHIP_IPV4 0
56438_ACEOF
56439
56440cat >>confdefs.h <<_ACEOF
56441#define SOCKS_IP_DROP_MEMBERSHIP_IPV6 1
56442_ACEOF
56443    else
56444       #both ipv4 and ipv6
56445
56446cat >>confdefs.h <<_ACEOF
56447#define SOCKS_IP_DROP_MEMBERSHIP_IPV4 1
56448_ACEOF
56449
56450cat >>confdefs.h <<_ACEOF
56451#define SOCKS_IP_DROP_MEMBERSHIP_IPV6 1
56452_ACEOF
56453    fi
56454    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_DROP_MEMBERSHIP"
56455  else
56456    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
56457$as_echo "no" >&6; }
56458  fi #not usable
56459unset _compileok
56460  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_DROP_SOURCE_MEMBERSHIP" >&5
56461$as_echo_n "checking for IPPROTO_IP socket option IP_DROP_SOURCE_MEMBERSHIP... " >&6; }
56462  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56463/* end confdefs.h.  */
56464
56465#include <sys/types.h>
56466#include <sys/socket.h>
56467#include <netinet/in.h>
56468#include <netinet/tcp.h>
56469#include <netinet/udp.h>
56470
56471#include <stdio.h>
56472#include <stdlib.h>
56473#include <unistd.h>
56474
56475int
56476main ()
56477{
56478
56479   socklen_t optlen;
56480   int optval;
56481   int stype;
56482   int ptype;
56483   int s;
56484
56485   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56486      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56487      ptype = IPPROTO_TCP;
56488   } else if (IPPROTO_IP == IPPROTO_IP) {
56489      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56490      ptype = IPPROTO_IP;
56491   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56492      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56493      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56494   } else if (IPPROTO_IP == IPPROTO_UDP) {
56495      stype = SOCK_DGRAM;
56496      ptype = IPPROTO_UDP;
56497   } else {
56498       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56499       exit(1);
56500   }
56501
56502   if((s = socket(PF_INET, stype, ptype)) < 0) {
56503      perror("socket");
56504      exit(1);
56505   }
56506
56507   optval = 1;
56508   optlen = sizeof(optval);
56509   if(setsockopt(s, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, &optval, optlen) < 0) {
56510      perror("setsockopt: IPPROTO_IP IP_DROP_SOURCE_MEMBERSHIP");
56511      close(s);
56512      exit(1);
56513   }
56514  ;
56515  return 0;
56516}
56517_ACEOF
56518if ac_fn_c_try_compile "$LINENO"; then :
56519  _compileok=1
56520fi
56521rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56522
56523  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56524/* end confdefs.h.  */
56525
56526#include <sys/types.h>
56527#include <sys/socket.h>
56528#include <netinet/in.h>
56529#include <netinet/tcp.h>
56530#include <netinet/udp.h>
56531
56532#include <stdio.h>
56533#include <stdlib.h>
56534#include <unistd.h>
56535
56536int
56537main ()
56538{
56539
56540   socklen_t optlen;
56541   int optval;
56542   int stype;
56543   int ptype;
56544   int s;
56545
56546   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56547      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56548      ptype = IPPROTO_TCP;
56549   } else if (IPPROTO_IP == IPPROTO_IP) {
56550      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56551      ptype = IPPROTO_IP;
56552   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56553      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56554      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56555   } else if (IPPROTO_IP == IPPROTO_UDP) {
56556      stype = SOCK_DGRAM;
56557      ptype = IPPROTO_UDP;
56558   } else {
56559       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56560       exit(1);
56561   }
56562
56563   if((s = socket(PF_INET6, stype, ptype)) < 0) {
56564      perror("socket");
56565      exit(1);
56566   }
56567
56568   optval = 1;
56569   optlen = sizeof(optval);
56570   if(setsockopt(s, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, &optval, optlen) < 0) {
56571      perror("setsockopt: IPPROTO_IP IP_DROP_SOURCE_MEMBERSHIP");
56572      close(s);
56573      exit(1);
56574   }
56575  ;
56576  return 0;
56577}
56578_ACEOF
56579if ac_fn_c_try_compile "$LINENO"; then :
56580  _compileok=1
56581fi
56582rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56583
56584  if test x"${_compileok}" != x; then
56585    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
56586$as_echo "yes" >&6; }
56587
56588cat >>confdefs.h <<_ACEOF
56589#define HAVE_IP_DROP_SOURCE_MEMBERSHIP 1
56590_ACEOF
56591
56592cat >>confdefs.h <<_ACEOF
56593#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_LVL IPPROTO_IP
56594_ACEOF
56595
56596cat >>confdefs.h <<_ACEOF
56597#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_NAME "ip_drop_source_membership"
56598_ACEOF
56599    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
56600       #ipv4-only
56601
56602cat >>confdefs.h <<_ACEOF
56603#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV4 1
56604_ACEOF
56605
56606cat >>confdefs.h <<_ACEOF
56607#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV6 0
56608_ACEOF
56609    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
56610       #ipv6-only
56611
56612cat >>confdefs.h <<_ACEOF
56613#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV4 0
56614_ACEOF
56615
56616cat >>confdefs.h <<_ACEOF
56617#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV6 1
56618_ACEOF
56619    else
56620       #both ipv4 and ipv6
56621
56622cat >>confdefs.h <<_ACEOF
56623#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV4 1
56624_ACEOF
56625
56626cat >>confdefs.h <<_ACEOF
56627#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV6 1
56628_ACEOF
56629    fi
56630    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_DROP_SOURCE_MEMBERSHIP"
56631  else
56632    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
56633$as_echo "no" >&6; }
56634  fi #not usable
56635unset _compileok
56636  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_DROP_SOURCE_MEMBERSHIP" >&5
56637$as_echo_n "checking for IPPROTO_IP socket option IP_DROP_SOURCE_MEMBERSHIP... " >&6; }
56638  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56639/* end confdefs.h.  */
56640
56641#include <sys/types.h>
56642#include <sys/socket.h>
56643#include <netinet/in.h>
56644#include <netinet/tcp.h>
56645#include <netinet/udp.h>
56646
56647#include <stdio.h>
56648#include <stdlib.h>
56649#include <unistd.h>
56650
56651int
56652main ()
56653{
56654
56655   socklen_t optlen;
56656   int optval;
56657   int stype;
56658   int ptype;
56659   int s;
56660
56661   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56662      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56663      ptype = IPPROTO_TCP;
56664   } else if (IPPROTO_IP == IPPROTO_IP) {
56665      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56666      ptype = IPPROTO_IP;
56667   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56668      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56669      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56670   } else if (IPPROTO_IP == IPPROTO_UDP) {
56671      stype = SOCK_DGRAM;
56672      ptype = IPPROTO_UDP;
56673   } else {
56674       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56675       exit(1);
56676   }
56677
56678   if((s = socket(PF_INET, stype, ptype)) < 0) {
56679      perror("socket");
56680      exit(1);
56681   }
56682
56683   optval = 1;
56684   optlen = sizeof(optval);
56685   if(setsockopt(s, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, &optval, optlen) < 0) {
56686      perror("setsockopt: IPPROTO_IP IP_DROP_SOURCE_MEMBERSHIP");
56687      close(s);
56688      exit(1);
56689   }
56690  ;
56691  return 0;
56692}
56693_ACEOF
56694if ac_fn_c_try_compile "$LINENO"; then :
56695  _compileok=1
56696fi
56697rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56698
56699  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56700/* end confdefs.h.  */
56701
56702#include <sys/types.h>
56703#include <sys/socket.h>
56704#include <netinet/in.h>
56705#include <netinet/tcp.h>
56706#include <netinet/udp.h>
56707
56708#include <stdio.h>
56709#include <stdlib.h>
56710#include <unistd.h>
56711
56712int
56713main ()
56714{
56715
56716   socklen_t optlen;
56717   int optval;
56718   int stype;
56719   int ptype;
56720   int s;
56721
56722   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56723      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56724      ptype = IPPROTO_TCP;
56725   } else if (IPPROTO_IP == IPPROTO_IP) {
56726      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56727      ptype = IPPROTO_IP;
56728   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56729      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56730      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56731   } else if (IPPROTO_IP == IPPROTO_UDP) {
56732      stype = SOCK_DGRAM;
56733      ptype = IPPROTO_UDP;
56734   } else {
56735       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56736       exit(1);
56737   }
56738
56739   if((s = socket(PF_INET6, stype, ptype)) < 0) {
56740      perror("socket");
56741      exit(1);
56742   }
56743
56744   optval = 1;
56745   optlen = sizeof(optval);
56746   if(setsockopt(s, IPPROTO_IP, IP_DROP_SOURCE_MEMBERSHIP, &optval, optlen) < 0) {
56747      perror("setsockopt: IPPROTO_IP IP_DROP_SOURCE_MEMBERSHIP");
56748      close(s);
56749      exit(1);
56750   }
56751  ;
56752  return 0;
56753}
56754_ACEOF
56755if ac_fn_c_try_compile "$LINENO"; then :
56756  _compileok=1
56757fi
56758rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56759
56760  if test x"${_compileok}" != x; then
56761    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
56762$as_echo "yes" >&6; }
56763
56764cat >>confdefs.h <<_ACEOF
56765#define HAVE_IP_DROP_SOURCE_MEMBERSHIP 1
56766_ACEOF
56767
56768cat >>confdefs.h <<_ACEOF
56769#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_LVL IPPROTO_IP
56770_ACEOF
56771
56772cat >>confdefs.h <<_ACEOF
56773#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_NAME "ip_drop_source_membership"
56774_ACEOF
56775    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
56776       #ipv4-only
56777
56778cat >>confdefs.h <<_ACEOF
56779#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV4 1
56780_ACEOF
56781
56782cat >>confdefs.h <<_ACEOF
56783#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV6 0
56784_ACEOF
56785    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
56786       #ipv6-only
56787
56788cat >>confdefs.h <<_ACEOF
56789#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV4 0
56790_ACEOF
56791
56792cat >>confdefs.h <<_ACEOF
56793#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV6 1
56794_ACEOF
56795    else
56796       #both ipv4 and ipv6
56797
56798cat >>confdefs.h <<_ACEOF
56799#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV4 1
56800_ACEOF
56801
56802cat >>confdefs.h <<_ACEOF
56803#define SOCKS_IP_DROP_SOURCE_MEMBERSHIP_IPV6 1
56804_ACEOF
56805    fi
56806    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_DROP_SOURCE_MEMBERSHIP"
56807  else
56808    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
56809$as_echo "no" >&6; }
56810  fi #not usable
56811unset _compileok
56812  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_FINDPMTU" >&5
56813$as_echo_n "checking for IPPROTO_IP socket option IP_FINDPMTU... " >&6; }
56814  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56815/* end confdefs.h.  */
56816
56817#include <sys/types.h>
56818#include <sys/socket.h>
56819#include <netinet/in.h>
56820#include <netinet/tcp.h>
56821#include <netinet/udp.h>
56822
56823#include <stdio.h>
56824#include <stdlib.h>
56825#include <unistd.h>
56826
56827int
56828main ()
56829{
56830
56831   socklen_t optlen;
56832   int optval;
56833   int stype;
56834   int ptype;
56835   int s;
56836
56837   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56838      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56839      ptype = IPPROTO_TCP;
56840   } else if (IPPROTO_IP == IPPROTO_IP) {
56841      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56842      ptype = IPPROTO_IP;
56843   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56844      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56845      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56846   } else if (IPPROTO_IP == IPPROTO_UDP) {
56847      stype = SOCK_DGRAM;
56848      ptype = IPPROTO_UDP;
56849   } else {
56850       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56851       exit(1);
56852   }
56853
56854   if((s = socket(PF_INET, stype, ptype)) < 0) {
56855      perror("socket");
56856      exit(1);
56857   }
56858
56859   optval = 1;
56860   optlen = sizeof(optval);
56861   if(setsockopt(s, IPPROTO_IP, IP_FINDPMTU, &optval, optlen) < 0) {
56862      perror("setsockopt: IPPROTO_IP IP_FINDPMTU");
56863      close(s);
56864      exit(1);
56865   }
56866  ;
56867  return 0;
56868}
56869_ACEOF
56870if ac_fn_c_try_compile "$LINENO"; then :
56871  _compileok=1
56872fi
56873rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56874
56875  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56876/* end confdefs.h.  */
56877
56878#include <sys/types.h>
56879#include <sys/socket.h>
56880#include <netinet/in.h>
56881#include <netinet/tcp.h>
56882#include <netinet/udp.h>
56883
56884#include <stdio.h>
56885#include <stdlib.h>
56886#include <unistd.h>
56887
56888int
56889main ()
56890{
56891
56892   socklen_t optlen;
56893   int optval;
56894   int stype;
56895   int ptype;
56896   int s;
56897
56898   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
56899      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
56900      ptype = IPPROTO_TCP;
56901   } else if (IPPROTO_IP == IPPROTO_IP) {
56902      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
56903      ptype = IPPROTO_IP;
56904   } else if (IPPROTO_IP == IPPROTO_IPV6) {
56905      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
56906      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
56907   } else if (IPPROTO_IP == IPPROTO_UDP) {
56908      stype = SOCK_DGRAM;
56909      ptype = IPPROTO_UDP;
56910   } else {
56911       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
56912       exit(1);
56913   }
56914
56915   if((s = socket(PF_INET6, stype, ptype)) < 0) {
56916      perror("socket");
56917      exit(1);
56918   }
56919
56920   optval = 1;
56921   optlen = sizeof(optval);
56922   if(setsockopt(s, IPPROTO_IP, IP_FINDPMTU, &optval, optlen) < 0) {
56923      perror("setsockopt: IPPROTO_IP IP_FINDPMTU");
56924      close(s);
56925      exit(1);
56926   }
56927  ;
56928  return 0;
56929}
56930_ACEOF
56931if ac_fn_c_try_compile "$LINENO"; then :
56932  _compileok=1
56933fi
56934rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
56935
56936  if test x"${_compileok}" != x; then
56937    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
56938$as_echo "yes" >&6; }
56939
56940cat >>confdefs.h <<_ACEOF
56941#define HAVE_IP_FINDPMTU 1
56942_ACEOF
56943
56944cat >>confdefs.h <<_ACEOF
56945#define SOCKS_IP_FINDPMTU_LVL IPPROTO_IP
56946_ACEOF
56947
56948cat >>confdefs.h <<_ACEOF
56949#define SOCKS_IP_FINDPMTU_NAME "ip_findpmtu"
56950_ACEOF
56951    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
56952       #ipv4-only
56953
56954cat >>confdefs.h <<_ACEOF
56955#define SOCKS_IP_FINDPMTU_IPV4 1
56956_ACEOF
56957
56958cat >>confdefs.h <<_ACEOF
56959#define SOCKS_IP_FINDPMTU_IPV6 0
56960_ACEOF
56961    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
56962       #ipv6-only
56963
56964cat >>confdefs.h <<_ACEOF
56965#define SOCKS_IP_FINDPMTU_IPV4 0
56966_ACEOF
56967
56968cat >>confdefs.h <<_ACEOF
56969#define SOCKS_IP_FINDPMTU_IPV6 1
56970_ACEOF
56971    else
56972       #both ipv4 and ipv6
56973
56974cat >>confdefs.h <<_ACEOF
56975#define SOCKS_IP_FINDPMTU_IPV4 1
56976_ACEOF
56977
56978cat >>confdefs.h <<_ACEOF
56979#define SOCKS_IP_FINDPMTU_IPV6 1
56980_ACEOF
56981    fi
56982    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_FINDPMTU"
56983  else
56984    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
56985$as_echo "no" >&6; }
56986  fi #likely not usable
56987unset _compileok
56988  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_HDRINCL" >&5
56989$as_echo_n "checking for IPPROTO_IP socket option IP_HDRINCL... " >&6; }
56990  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
56991/* end confdefs.h.  */
56992
56993#include <sys/types.h>
56994#include <sys/socket.h>
56995#include <netinet/in.h>
56996#include <netinet/tcp.h>
56997#include <netinet/udp.h>
56998
56999#include <stdio.h>
57000#include <stdlib.h>
57001#include <unistd.h>
57002
57003int
57004main ()
57005{
57006
57007   socklen_t optlen;
57008   int optval;
57009   int stype;
57010   int ptype;
57011   int s;
57012
57013   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57014      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57015      ptype = IPPROTO_TCP;
57016   } else if (IPPROTO_IP == IPPROTO_IP) {
57017      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57018      ptype = IPPROTO_IP;
57019   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57020      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57021      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57022   } else if (IPPROTO_IP == IPPROTO_UDP) {
57023      stype = SOCK_DGRAM;
57024      ptype = IPPROTO_UDP;
57025   } else {
57026       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57027       exit(1);
57028   }
57029
57030   if((s = socket(PF_INET, stype, ptype)) < 0) {
57031      perror("socket");
57032      exit(1);
57033   }
57034
57035   optval = 1;
57036   optlen = sizeof(optval);
57037   if(setsockopt(s, IPPROTO_IP, IP_HDRINCL, &optval, optlen) < 0) {
57038      perror("setsockopt: IPPROTO_IP IP_HDRINCL");
57039      close(s);
57040      exit(1);
57041   }
57042  ;
57043  return 0;
57044}
57045_ACEOF
57046if ac_fn_c_try_compile "$LINENO"; then :
57047  _compileok=1
57048fi
57049rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57050
57051  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57052/* end confdefs.h.  */
57053
57054#include <sys/types.h>
57055#include <sys/socket.h>
57056#include <netinet/in.h>
57057#include <netinet/tcp.h>
57058#include <netinet/udp.h>
57059
57060#include <stdio.h>
57061#include <stdlib.h>
57062#include <unistd.h>
57063
57064int
57065main ()
57066{
57067
57068   socklen_t optlen;
57069   int optval;
57070   int stype;
57071   int ptype;
57072   int s;
57073
57074   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57075      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57076      ptype = IPPROTO_TCP;
57077   } else if (IPPROTO_IP == IPPROTO_IP) {
57078      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57079      ptype = IPPROTO_IP;
57080   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57081      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57082      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57083   } else if (IPPROTO_IP == IPPROTO_UDP) {
57084      stype = SOCK_DGRAM;
57085      ptype = IPPROTO_UDP;
57086   } else {
57087       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57088       exit(1);
57089   }
57090
57091   if((s = socket(PF_INET6, stype, ptype)) < 0) {
57092      perror("socket");
57093      exit(1);
57094   }
57095
57096   optval = 1;
57097   optlen = sizeof(optval);
57098   if(setsockopt(s, IPPROTO_IP, IP_HDRINCL, &optval, optlen) < 0) {
57099      perror("setsockopt: IPPROTO_IP IP_HDRINCL");
57100      close(s);
57101      exit(1);
57102   }
57103  ;
57104  return 0;
57105}
57106_ACEOF
57107if ac_fn_c_try_compile "$LINENO"; then :
57108  _compileok=1
57109fi
57110rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57111
57112  if test x"${_compileok}" != x; then
57113    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
57114$as_echo "yes" >&6; }
57115
57116cat >>confdefs.h <<_ACEOF
57117#define HAVE_IP_HDRINCL 1
57118_ACEOF
57119
57120cat >>confdefs.h <<_ACEOF
57121#define SOCKS_IP_HDRINCL_LVL IPPROTO_IP
57122_ACEOF
57123
57124cat >>confdefs.h <<_ACEOF
57125#define SOCKS_IP_HDRINCL_NAME "ip_hdrincl"
57126_ACEOF
57127    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
57128       #ipv4-only
57129
57130cat >>confdefs.h <<_ACEOF
57131#define SOCKS_IP_HDRINCL_IPV4 1
57132_ACEOF
57133
57134cat >>confdefs.h <<_ACEOF
57135#define SOCKS_IP_HDRINCL_IPV6 0
57136_ACEOF
57137    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
57138       #ipv6-only
57139
57140cat >>confdefs.h <<_ACEOF
57141#define SOCKS_IP_HDRINCL_IPV4 0
57142_ACEOF
57143
57144cat >>confdefs.h <<_ACEOF
57145#define SOCKS_IP_HDRINCL_IPV6 1
57146_ACEOF
57147    else
57148       #both ipv4 and ipv6
57149
57150cat >>confdefs.h <<_ACEOF
57151#define SOCKS_IP_HDRINCL_IPV4 1
57152_ACEOF
57153
57154cat >>confdefs.h <<_ACEOF
57155#define SOCKS_IP_HDRINCL_IPV6 1
57156_ACEOF
57157    fi
57158    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_HDRINCL"
57159  else
57160    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
57161$as_echo "no" >&6; }
57162  fi #not usable
57163unset _compileok
57164  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_HDRINCL" >&5
57165$as_echo_n "checking for IPPROTO_IP socket option IP_HDRINCL... " >&6; }
57166  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57167/* end confdefs.h.  */
57168
57169#include <sys/types.h>
57170#include <sys/socket.h>
57171#include <netinet/in.h>
57172#include <netinet/tcp.h>
57173#include <netinet/udp.h>
57174
57175#include <stdio.h>
57176#include <stdlib.h>
57177#include <unistd.h>
57178
57179int
57180main ()
57181{
57182
57183   socklen_t optlen;
57184   int optval;
57185   int stype;
57186   int ptype;
57187   int s;
57188
57189   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57190      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57191      ptype = IPPROTO_TCP;
57192   } else if (IPPROTO_IP == IPPROTO_IP) {
57193      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57194      ptype = IPPROTO_IP;
57195   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57196      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57197      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57198   } else if (IPPROTO_IP == IPPROTO_UDP) {
57199      stype = SOCK_DGRAM;
57200      ptype = IPPROTO_UDP;
57201   } else {
57202       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57203       exit(1);
57204   }
57205
57206   if((s = socket(PF_INET, stype, ptype)) < 0) {
57207      perror("socket");
57208      exit(1);
57209   }
57210
57211   optval = 1;
57212   optlen = sizeof(optval);
57213   if(setsockopt(s, IPPROTO_IP, IP_HDRINCL, &optval, optlen) < 0) {
57214      perror("setsockopt: IPPROTO_IP IP_HDRINCL");
57215      close(s);
57216      exit(1);
57217   }
57218  ;
57219  return 0;
57220}
57221_ACEOF
57222if ac_fn_c_try_compile "$LINENO"; then :
57223  _compileok=1
57224fi
57225rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57226
57227  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57228/* end confdefs.h.  */
57229
57230#include <sys/types.h>
57231#include <sys/socket.h>
57232#include <netinet/in.h>
57233#include <netinet/tcp.h>
57234#include <netinet/udp.h>
57235
57236#include <stdio.h>
57237#include <stdlib.h>
57238#include <unistd.h>
57239
57240int
57241main ()
57242{
57243
57244   socklen_t optlen;
57245   int optval;
57246   int stype;
57247   int ptype;
57248   int s;
57249
57250   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57251      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57252      ptype = IPPROTO_TCP;
57253   } else if (IPPROTO_IP == IPPROTO_IP) {
57254      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57255      ptype = IPPROTO_IP;
57256   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57257      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57258      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57259   } else if (IPPROTO_IP == IPPROTO_UDP) {
57260      stype = SOCK_DGRAM;
57261      ptype = IPPROTO_UDP;
57262   } else {
57263       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57264       exit(1);
57265   }
57266
57267   if((s = socket(PF_INET6, stype, ptype)) < 0) {
57268      perror("socket");
57269      exit(1);
57270   }
57271
57272   optval = 1;
57273   optlen = sizeof(optval);
57274   if(setsockopt(s, IPPROTO_IP, IP_HDRINCL, &optval, optlen) < 0) {
57275      perror("setsockopt: IPPROTO_IP IP_HDRINCL");
57276      close(s);
57277      exit(1);
57278   }
57279  ;
57280  return 0;
57281}
57282_ACEOF
57283if ac_fn_c_try_compile "$LINENO"; then :
57284  _compileok=1
57285fi
57286rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57287
57288  if test x"${_compileok}" != x; then
57289    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
57290$as_echo "yes" >&6; }
57291
57292cat >>confdefs.h <<_ACEOF
57293#define HAVE_IP_HDRINCL 1
57294_ACEOF
57295
57296cat >>confdefs.h <<_ACEOF
57297#define SOCKS_IP_HDRINCL_LVL IPPROTO_IP
57298_ACEOF
57299
57300cat >>confdefs.h <<_ACEOF
57301#define SOCKS_IP_HDRINCL_NAME "ip_hdrincl"
57302_ACEOF
57303    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
57304       #ipv4-only
57305
57306cat >>confdefs.h <<_ACEOF
57307#define SOCKS_IP_HDRINCL_IPV4 1
57308_ACEOF
57309
57310cat >>confdefs.h <<_ACEOF
57311#define SOCKS_IP_HDRINCL_IPV6 0
57312_ACEOF
57313    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
57314       #ipv6-only
57315
57316cat >>confdefs.h <<_ACEOF
57317#define SOCKS_IP_HDRINCL_IPV4 0
57318_ACEOF
57319
57320cat >>confdefs.h <<_ACEOF
57321#define SOCKS_IP_HDRINCL_IPV6 1
57322_ACEOF
57323    else
57324       #both ipv4 and ipv6
57325
57326cat >>confdefs.h <<_ACEOF
57327#define SOCKS_IP_HDRINCL_IPV4 1
57328_ACEOF
57329
57330cat >>confdefs.h <<_ACEOF
57331#define SOCKS_IP_HDRINCL_IPV6 1
57332_ACEOF
57333    fi
57334    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_HDRINCL"
57335  else
57336    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
57337$as_echo "no" >&6; }
57338  fi #not usable
57339unset _compileok
57340  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_MULTICAST_HOPS" >&5
57341$as_echo_n "checking for IPPROTO_IP socket option IP_MULTICAST_HOPS... " >&6; }
57342  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57343/* end confdefs.h.  */
57344
57345#include <sys/types.h>
57346#include <sys/socket.h>
57347#include <netinet/in.h>
57348#include <netinet/tcp.h>
57349#include <netinet/udp.h>
57350
57351#include <stdio.h>
57352#include <stdlib.h>
57353#include <unistd.h>
57354
57355int
57356main ()
57357{
57358
57359   socklen_t optlen;
57360   int optval;
57361   int stype;
57362   int ptype;
57363   int s;
57364
57365   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57366      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57367      ptype = IPPROTO_TCP;
57368   } else if (IPPROTO_IP == IPPROTO_IP) {
57369      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57370      ptype = IPPROTO_IP;
57371   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57372      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57373      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57374   } else if (IPPROTO_IP == IPPROTO_UDP) {
57375      stype = SOCK_DGRAM;
57376      ptype = IPPROTO_UDP;
57377   } else {
57378       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57379       exit(1);
57380   }
57381
57382   if((s = socket(PF_INET, stype, ptype)) < 0) {
57383      perror("socket");
57384      exit(1);
57385   }
57386
57387   optval = 1;
57388   optlen = sizeof(optval);
57389   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_HOPS, &optval, optlen) < 0) {
57390      perror("setsockopt: IPPROTO_IP IP_MULTICAST_HOPS");
57391      close(s);
57392      exit(1);
57393   }
57394  ;
57395  return 0;
57396}
57397_ACEOF
57398if ac_fn_c_try_compile "$LINENO"; then :
57399  _compileok=1
57400fi
57401rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57402
57403  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57404/* end confdefs.h.  */
57405
57406#include <sys/types.h>
57407#include <sys/socket.h>
57408#include <netinet/in.h>
57409#include <netinet/tcp.h>
57410#include <netinet/udp.h>
57411
57412#include <stdio.h>
57413#include <stdlib.h>
57414#include <unistd.h>
57415
57416int
57417main ()
57418{
57419
57420   socklen_t optlen;
57421   int optval;
57422   int stype;
57423   int ptype;
57424   int s;
57425
57426   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57427      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57428      ptype = IPPROTO_TCP;
57429   } else if (IPPROTO_IP == IPPROTO_IP) {
57430      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57431      ptype = IPPROTO_IP;
57432   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57433      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57434      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57435   } else if (IPPROTO_IP == IPPROTO_UDP) {
57436      stype = SOCK_DGRAM;
57437      ptype = IPPROTO_UDP;
57438   } else {
57439       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57440       exit(1);
57441   }
57442
57443   if((s = socket(PF_INET6, stype, ptype)) < 0) {
57444      perror("socket");
57445      exit(1);
57446   }
57447
57448   optval = 1;
57449   optlen = sizeof(optval);
57450   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_HOPS, &optval, optlen) < 0) {
57451      perror("setsockopt: IPPROTO_IP IP_MULTICAST_HOPS");
57452      close(s);
57453      exit(1);
57454   }
57455  ;
57456  return 0;
57457}
57458_ACEOF
57459if ac_fn_c_try_compile "$LINENO"; then :
57460  _compileok=1
57461fi
57462rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57463
57464  if test x"${_compileok}" != x; then
57465    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
57466$as_echo "yes" >&6; }
57467
57468cat >>confdefs.h <<_ACEOF
57469#define HAVE_IP_MULTICAST_HOPS 1
57470_ACEOF
57471
57472cat >>confdefs.h <<_ACEOF
57473#define SOCKS_IP_MULTICAST_HOPS_LVL IPPROTO_IP
57474_ACEOF
57475
57476cat >>confdefs.h <<_ACEOF
57477#define SOCKS_IP_MULTICAST_HOPS_NAME "ip_multicast_hops"
57478_ACEOF
57479    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
57480       #ipv4-only
57481
57482cat >>confdefs.h <<_ACEOF
57483#define SOCKS_IP_MULTICAST_HOPS_IPV4 1
57484_ACEOF
57485
57486cat >>confdefs.h <<_ACEOF
57487#define SOCKS_IP_MULTICAST_HOPS_IPV6 0
57488_ACEOF
57489    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
57490       #ipv6-only
57491
57492cat >>confdefs.h <<_ACEOF
57493#define SOCKS_IP_MULTICAST_HOPS_IPV4 0
57494_ACEOF
57495
57496cat >>confdefs.h <<_ACEOF
57497#define SOCKS_IP_MULTICAST_HOPS_IPV6 1
57498_ACEOF
57499    else
57500       #both ipv4 and ipv6
57501
57502cat >>confdefs.h <<_ACEOF
57503#define SOCKS_IP_MULTICAST_HOPS_IPV4 1
57504_ACEOF
57505
57506cat >>confdefs.h <<_ACEOF
57507#define SOCKS_IP_MULTICAST_HOPS_IPV6 1
57508_ACEOF
57509    fi
57510    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_MULTICAST_HOPS"
57511  else
57512    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
57513$as_echo "no" >&6; }
57514  fi #not usable
57515unset _compileok
57516  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_MULTICAST_IF" >&5
57517$as_echo_n "checking for IPPROTO_IP socket option IP_MULTICAST_IF... " >&6; }
57518  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57519/* end confdefs.h.  */
57520
57521#include <sys/types.h>
57522#include <sys/socket.h>
57523#include <netinet/in.h>
57524#include <netinet/tcp.h>
57525#include <netinet/udp.h>
57526
57527#include <stdio.h>
57528#include <stdlib.h>
57529#include <unistd.h>
57530
57531int
57532main ()
57533{
57534
57535   socklen_t optlen;
57536   int optval;
57537   int stype;
57538   int ptype;
57539   int s;
57540
57541   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57542      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57543      ptype = IPPROTO_TCP;
57544   } else if (IPPROTO_IP == IPPROTO_IP) {
57545      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57546      ptype = IPPROTO_IP;
57547   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57548      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57549      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57550   } else if (IPPROTO_IP == IPPROTO_UDP) {
57551      stype = SOCK_DGRAM;
57552      ptype = IPPROTO_UDP;
57553   } else {
57554       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57555       exit(1);
57556   }
57557
57558   if((s = socket(PF_INET, stype, ptype)) < 0) {
57559      perror("socket");
57560      exit(1);
57561   }
57562
57563   optval = 1;
57564   optlen = sizeof(optval);
57565   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &optval, optlen) < 0) {
57566      perror("setsockopt: IPPROTO_IP IP_MULTICAST_IF");
57567      close(s);
57568      exit(1);
57569   }
57570  ;
57571  return 0;
57572}
57573_ACEOF
57574if ac_fn_c_try_compile "$LINENO"; then :
57575  _compileok=1
57576fi
57577rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57578
57579  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57580/* end confdefs.h.  */
57581
57582#include <sys/types.h>
57583#include <sys/socket.h>
57584#include <netinet/in.h>
57585#include <netinet/tcp.h>
57586#include <netinet/udp.h>
57587
57588#include <stdio.h>
57589#include <stdlib.h>
57590#include <unistd.h>
57591
57592int
57593main ()
57594{
57595
57596   socklen_t optlen;
57597   int optval;
57598   int stype;
57599   int ptype;
57600   int s;
57601
57602   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57603      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57604      ptype = IPPROTO_TCP;
57605   } else if (IPPROTO_IP == IPPROTO_IP) {
57606      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57607      ptype = IPPROTO_IP;
57608   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57609      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57610      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57611   } else if (IPPROTO_IP == IPPROTO_UDP) {
57612      stype = SOCK_DGRAM;
57613      ptype = IPPROTO_UDP;
57614   } else {
57615       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57616       exit(1);
57617   }
57618
57619   if((s = socket(PF_INET6, stype, ptype)) < 0) {
57620      perror("socket");
57621      exit(1);
57622   }
57623
57624   optval = 1;
57625   optlen = sizeof(optval);
57626   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &optval, optlen) < 0) {
57627      perror("setsockopt: IPPROTO_IP IP_MULTICAST_IF");
57628      close(s);
57629      exit(1);
57630   }
57631  ;
57632  return 0;
57633}
57634_ACEOF
57635if ac_fn_c_try_compile "$LINENO"; then :
57636  _compileok=1
57637fi
57638rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57639
57640  if test x"${_compileok}" != x; then
57641    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
57642$as_echo "yes" >&6; }
57643
57644cat >>confdefs.h <<_ACEOF
57645#define HAVE_IP_MULTICAST_IF 1
57646_ACEOF
57647
57648cat >>confdefs.h <<_ACEOF
57649#define SOCKS_IP_MULTICAST_IF_LVL IPPROTO_IP
57650_ACEOF
57651
57652cat >>confdefs.h <<_ACEOF
57653#define SOCKS_IP_MULTICAST_IF_NAME "ip_multicast_if"
57654_ACEOF
57655    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
57656       #ipv4-only
57657
57658cat >>confdefs.h <<_ACEOF
57659#define SOCKS_IP_MULTICAST_IF_IPV4 1
57660_ACEOF
57661
57662cat >>confdefs.h <<_ACEOF
57663#define SOCKS_IP_MULTICAST_IF_IPV6 0
57664_ACEOF
57665    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
57666       #ipv6-only
57667
57668cat >>confdefs.h <<_ACEOF
57669#define SOCKS_IP_MULTICAST_IF_IPV4 0
57670_ACEOF
57671
57672cat >>confdefs.h <<_ACEOF
57673#define SOCKS_IP_MULTICAST_IF_IPV6 1
57674_ACEOF
57675    else
57676       #both ipv4 and ipv6
57677
57678cat >>confdefs.h <<_ACEOF
57679#define SOCKS_IP_MULTICAST_IF_IPV4 1
57680_ACEOF
57681
57682cat >>confdefs.h <<_ACEOF
57683#define SOCKS_IP_MULTICAST_IF_IPV6 1
57684_ACEOF
57685    fi
57686    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_MULTICAST_IF"
57687  else
57688    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
57689$as_echo "no" >&6; }
57690  fi #not usable
57691unset _compileok
57692  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_MULTICAST_LOOP" >&5
57693$as_echo_n "checking for IPPROTO_IP socket option IP_MULTICAST_LOOP... " >&6; }
57694  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57695/* end confdefs.h.  */
57696
57697#include <sys/types.h>
57698#include <sys/socket.h>
57699#include <netinet/in.h>
57700#include <netinet/tcp.h>
57701#include <netinet/udp.h>
57702
57703#include <stdio.h>
57704#include <stdlib.h>
57705#include <unistd.h>
57706
57707int
57708main ()
57709{
57710
57711   socklen_t optlen;
57712   int optval;
57713   int stype;
57714   int ptype;
57715   int s;
57716
57717   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57718      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57719      ptype = IPPROTO_TCP;
57720   } else if (IPPROTO_IP == IPPROTO_IP) {
57721      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57722      ptype = IPPROTO_IP;
57723   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57724      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57725      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57726   } else if (IPPROTO_IP == IPPROTO_UDP) {
57727      stype = SOCK_DGRAM;
57728      ptype = IPPROTO_UDP;
57729   } else {
57730       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57731       exit(1);
57732   }
57733
57734   if((s = socket(PF_INET, stype, ptype)) < 0) {
57735      perror("socket");
57736      exit(1);
57737   }
57738
57739   optval = 1;
57740   optlen = sizeof(optval);
57741   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &optval, optlen) < 0) {
57742      perror("setsockopt: IPPROTO_IP IP_MULTICAST_LOOP");
57743      close(s);
57744      exit(1);
57745   }
57746  ;
57747  return 0;
57748}
57749_ACEOF
57750if ac_fn_c_try_compile "$LINENO"; then :
57751  _compileok=1
57752fi
57753rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57754
57755  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57756/* end confdefs.h.  */
57757
57758#include <sys/types.h>
57759#include <sys/socket.h>
57760#include <netinet/in.h>
57761#include <netinet/tcp.h>
57762#include <netinet/udp.h>
57763
57764#include <stdio.h>
57765#include <stdlib.h>
57766#include <unistd.h>
57767
57768int
57769main ()
57770{
57771
57772   socklen_t optlen;
57773   int optval;
57774   int stype;
57775   int ptype;
57776   int s;
57777
57778   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57779      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57780      ptype = IPPROTO_TCP;
57781   } else if (IPPROTO_IP == IPPROTO_IP) {
57782      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57783      ptype = IPPROTO_IP;
57784   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57785      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57786      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57787   } else if (IPPROTO_IP == IPPROTO_UDP) {
57788      stype = SOCK_DGRAM;
57789      ptype = IPPROTO_UDP;
57790   } else {
57791       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57792       exit(1);
57793   }
57794
57795   if((s = socket(PF_INET6, stype, ptype)) < 0) {
57796      perror("socket");
57797      exit(1);
57798   }
57799
57800   optval = 1;
57801   optlen = sizeof(optval);
57802   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_LOOP, &optval, optlen) < 0) {
57803      perror("setsockopt: IPPROTO_IP IP_MULTICAST_LOOP");
57804      close(s);
57805      exit(1);
57806   }
57807  ;
57808  return 0;
57809}
57810_ACEOF
57811if ac_fn_c_try_compile "$LINENO"; then :
57812  _compileok=1
57813fi
57814rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57815
57816  if test x"${_compileok}" != x; then
57817    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
57818$as_echo "yes" >&6; }
57819
57820cat >>confdefs.h <<_ACEOF
57821#define HAVE_IP_MULTICAST_LOOP 1
57822_ACEOF
57823
57824cat >>confdefs.h <<_ACEOF
57825#define SOCKS_IP_MULTICAST_LOOP_LVL IPPROTO_IP
57826_ACEOF
57827
57828cat >>confdefs.h <<_ACEOF
57829#define SOCKS_IP_MULTICAST_LOOP_NAME "ip_multicast_loop"
57830_ACEOF
57831    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
57832       #ipv4-only
57833
57834cat >>confdefs.h <<_ACEOF
57835#define SOCKS_IP_MULTICAST_LOOP_IPV4 1
57836_ACEOF
57837
57838cat >>confdefs.h <<_ACEOF
57839#define SOCKS_IP_MULTICAST_LOOP_IPV6 0
57840_ACEOF
57841    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
57842       #ipv6-only
57843
57844cat >>confdefs.h <<_ACEOF
57845#define SOCKS_IP_MULTICAST_LOOP_IPV4 0
57846_ACEOF
57847
57848cat >>confdefs.h <<_ACEOF
57849#define SOCKS_IP_MULTICAST_LOOP_IPV6 1
57850_ACEOF
57851    else
57852       #both ipv4 and ipv6
57853
57854cat >>confdefs.h <<_ACEOF
57855#define SOCKS_IP_MULTICAST_LOOP_IPV4 1
57856_ACEOF
57857
57858cat >>confdefs.h <<_ACEOF
57859#define SOCKS_IP_MULTICAST_LOOP_IPV6 1
57860_ACEOF
57861    fi
57862    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_MULTICAST_LOOP"
57863  else
57864    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
57865$as_echo "no" >&6; }
57866  fi #not usable
57867unset _compileok
57868  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_MULTICAST_TTL" >&5
57869$as_echo_n "checking for IPPROTO_IP socket option IP_MULTICAST_TTL... " >&6; }
57870  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57871/* end confdefs.h.  */
57872
57873#include <sys/types.h>
57874#include <sys/socket.h>
57875#include <netinet/in.h>
57876#include <netinet/tcp.h>
57877#include <netinet/udp.h>
57878
57879#include <stdio.h>
57880#include <stdlib.h>
57881#include <unistd.h>
57882
57883int
57884main ()
57885{
57886
57887   socklen_t optlen;
57888   int optval;
57889   int stype;
57890   int ptype;
57891   int s;
57892
57893   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57894      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57895      ptype = IPPROTO_TCP;
57896   } else if (IPPROTO_IP == IPPROTO_IP) {
57897      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57898      ptype = IPPROTO_IP;
57899   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57900      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57901      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57902   } else if (IPPROTO_IP == IPPROTO_UDP) {
57903      stype = SOCK_DGRAM;
57904      ptype = IPPROTO_UDP;
57905   } else {
57906       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57907       exit(1);
57908   }
57909
57910   if((s = socket(PF_INET, stype, ptype)) < 0) {
57911      perror("socket");
57912      exit(1);
57913   }
57914
57915   optval = 1;
57916   optlen = sizeof(optval);
57917   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, &optval, optlen) < 0) {
57918      perror("setsockopt: IPPROTO_IP IP_MULTICAST_TTL");
57919      close(s);
57920      exit(1);
57921   }
57922  ;
57923  return 0;
57924}
57925_ACEOF
57926if ac_fn_c_try_compile "$LINENO"; then :
57927  _compileok=1
57928fi
57929rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57930
57931  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
57932/* end confdefs.h.  */
57933
57934#include <sys/types.h>
57935#include <sys/socket.h>
57936#include <netinet/in.h>
57937#include <netinet/tcp.h>
57938#include <netinet/udp.h>
57939
57940#include <stdio.h>
57941#include <stdlib.h>
57942#include <unistd.h>
57943
57944int
57945main ()
57946{
57947
57948   socklen_t optlen;
57949   int optval;
57950   int stype;
57951   int ptype;
57952   int s;
57953
57954   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
57955      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
57956      ptype = IPPROTO_TCP;
57957   } else if (IPPROTO_IP == IPPROTO_IP) {
57958      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
57959      ptype = IPPROTO_IP;
57960   } else if (IPPROTO_IP == IPPROTO_IPV6) {
57961      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
57962      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
57963   } else if (IPPROTO_IP == IPPROTO_UDP) {
57964      stype = SOCK_DGRAM;
57965      ptype = IPPROTO_UDP;
57966   } else {
57967       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
57968       exit(1);
57969   }
57970
57971   if((s = socket(PF_INET6, stype, ptype)) < 0) {
57972      perror("socket");
57973      exit(1);
57974   }
57975
57976   optval = 1;
57977   optlen = sizeof(optval);
57978   if(setsockopt(s, IPPROTO_IP, IP_MULTICAST_TTL, &optval, optlen) < 0) {
57979      perror("setsockopt: IPPROTO_IP IP_MULTICAST_TTL");
57980      close(s);
57981      exit(1);
57982   }
57983  ;
57984  return 0;
57985}
57986_ACEOF
57987if ac_fn_c_try_compile "$LINENO"; then :
57988  _compileok=1
57989fi
57990rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
57991
57992  if test x"${_compileok}" != x; then
57993    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
57994$as_echo "yes" >&6; }
57995
57996cat >>confdefs.h <<_ACEOF
57997#define HAVE_IP_MULTICAST_TTL 1
57998_ACEOF
57999
58000cat >>confdefs.h <<_ACEOF
58001#define SOCKS_IP_MULTICAST_TTL_LVL IPPROTO_IP
58002_ACEOF
58003
58004cat >>confdefs.h <<_ACEOF
58005#define SOCKS_IP_MULTICAST_TTL_NAME "ip_multicast_ttl"
58006_ACEOF
58007    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
58008       #ipv4-only
58009
58010cat >>confdefs.h <<_ACEOF
58011#define SOCKS_IP_MULTICAST_TTL_IPV4 1
58012_ACEOF
58013
58014cat >>confdefs.h <<_ACEOF
58015#define SOCKS_IP_MULTICAST_TTL_IPV6 0
58016_ACEOF
58017    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
58018       #ipv6-only
58019
58020cat >>confdefs.h <<_ACEOF
58021#define SOCKS_IP_MULTICAST_TTL_IPV4 0
58022_ACEOF
58023
58024cat >>confdefs.h <<_ACEOF
58025#define SOCKS_IP_MULTICAST_TTL_IPV6 1
58026_ACEOF
58027    else
58028       #both ipv4 and ipv6
58029
58030cat >>confdefs.h <<_ACEOF
58031#define SOCKS_IP_MULTICAST_TTL_IPV4 1
58032_ACEOF
58033
58034cat >>confdefs.h <<_ACEOF
58035#define SOCKS_IP_MULTICAST_TTL_IPV6 1
58036_ACEOF
58037    fi
58038    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_MULTICAST_TTL"
58039  else
58040    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
58041$as_echo "no" >&6; }
58042  fi #not usable
58043unset _compileok
58044  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_OPTIONS" >&5
58045$as_echo_n "checking for IPPROTO_IP socket option IP_OPTIONS... " >&6; }
58046  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58047/* end confdefs.h.  */
58048
58049#include <sys/types.h>
58050#include <sys/socket.h>
58051#include <netinet/in.h>
58052#include <netinet/tcp.h>
58053#include <netinet/udp.h>
58054
58055#include <stdio.h>
58056#include <stdlib.h>
58057#include <unistd.h>
58058
58059int
58060main ()
58061{
58062
58063   socklen_t optlen;
58064   int optval;
58065   int stype;
58066   int ptype;
58067   int s;
58068
58069   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58070      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58071      ptype = IPPROTO_TCP;
58072   } else if (IPPROTO_IP == IPPROTO_IP) {
58073      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58074      ptype = IPPROTO_IP;
58075   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58076      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58077      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58078   } else if (IPPROTO_IP == IPPROTO_UDP) {
58079      stype = SOCK_DGRAM;
58080      ptype = IPPROTO_UDP;
58081   } else {
58082       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58083       exit(1);
58084   }
58085
58086   if((s = socket(PF_INET, stype, ptype)) < 0) {
58087      perror("socket");
58088      exit(1);
58089   }
58090
58091   optval = 1;
58092   optlen = sizeof(optval);
58093   if(setsockopt(s, IPPROTO_IP, IP_OPTIONS, &optval, optlen) < 0) {
58094      perror("setsockopt: IPPROTO_IP IP_OPTIONS");
58095      close(s);
58096      exit(1);
58097   }
58098  ;
58099  return 0;
58100}
58101_ACEOF
58102if ac_fn_c_try_compile "$LINENO"; then :
58103  _compileok=1
58104fi
58105rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58106
58107  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58108/* end confdefs.h.  */
58109
58110#include <sys/types.h>
58111#include <sys/socket.h>
58112#include <netinet/in.h>
58113#include <netinet/tcp.h>
58114#include <netinet/udp.h>
58115
58116#include <stdio.h>
58117#include <stdlib.h>
58118#include <unistd.h>
58119
58120int
58121main ()
58122{
58123
58124   socklen_t optlen;
58125   int optval;
58126   int stype;
58127   int ptype;
58128   int s;
58129
58130   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58131      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58132      ptype = IPPROTO_TCP;
58133   } else if (IPPROTO_IP == IPPROTO_IP) {
58134      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58135      ptype = IPPROTO_IP;
58136   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58137      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58138      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58139   } else if (IPPROTO_IP == IPPROTO_UDP) {
58140      stype = SOCK_DGRAM;
58141      ptype = IPPROTO_UDP;
58142   } else {
58143       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58144       exit(1);
58145   }
58146
58147   if((s = socket(PF_INET6, stype, ptype)) < 0) {
58148      perror("socket");
58149      exit(1);
58150   }
58151
58152   optval = 1;
58153   optlen = sizeof(optval);
58154   if(setsockopt(s, IPPROTO_IP, IP_OPTIONS, &optval, optlen) < 0) {
58155      perror("setsockopt: IPPROTO_IP IP_OPTIONS");
58156      close(s);
58157      exit(1);
58158   }
58159  ;
58160  return 0;
58161}
58162_ACEOF
58163if ac_fn_c_try_compile "$LINENO"; then :
58164  _compileok=1
58165fi
58166rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58167
58168  if test x"${_compileok}" != x; then
58169    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
58170$as_echo "yes" >&6; }
58171
58172cat >>confdefs.h <<_ACEOF
58173#define HAVE_IP_OPTIONS 1
58174_ACEOF
58175
58176cat >>confdefs.h <<_ACEOF
58177#define SOCKS_IP_OPTIONS_LVL IPPROTO_IP
58178_ACEOF
58179
58180cat >>confdefs.h <<_ACEOF
58181#define SOCKS_IP_OPTIONS_NAME "ip_options"
58182_ACEOF
58183    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
58184       #ipv4-only
58185
58186cat >>confdefs.h <<_ACEOF
58187#define SOCKS_IP_OPTIONS_IPV4 1
58188_ACEOF
58189
58190cat >>confdefs.h <<_ACEOF
58191#define SOCKS_IP_OPTIONS_IPV6 0
58192_ACEOF
58193    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
58194       #ipv6-only
58195
58196cat >>confdefs.h <<_ACEOF
58197#define SOCKS_IP_OPTIONS_IPV4 0
58198_ACEOF
58199
58200cat >>confdefs.h <<_ACEOF
58201#define SOCKS_IP_OPTIONS_IPV6 1
58202_ACEOF
58203    else
58204       #both ipv4 and ipv6
58205
58206cat >>confdefs.h <<_ACEOF
58207#define SOCKS_IP_OPTIONS_IPV4 1
58208_ACEOF
58209
58210cat >>confdefs.h <<_ACEOF
58211#define SOCKS_IP_OPTIONS_IPV6 1
58212_ACEOF
58213    fi
58214    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_OPTIONS"
58215  else
58216    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
58217$as_echo "no" >&6; }
58218  fi #likely not usable/unsupported type
58219unset _compileok
58220  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_PMTUAGE" >&5
58221$as_echo_n "checking for IPPROTO_IP socket option IP_PMTUAGE... " >&6; }
58222  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58223/* end confdefs.h.  */
58224
58225#include <sys/types.h>
58226#include <sys/socket.h>
58227#include <netinet/in.h>
58228#include <netinet/tcp.h>
58229#include <netinet/udp.h>
58230
58231#include <stdio.h>
58232#include <stdlib.h>
58233#include <unistd.h>
58234
58235int
58236main ()
58237{
58238
58239   socklen_t optlen;
58240   int optval;
58241   int stype;
58242   int ptype;
58243   int s;
58244
58245   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58246      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58247      ptype = IPPROTO_TCP;
58248   } else if (IPPROTO_IP == IPPROTO_IP) {
58249      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58250      ptype = IPPROTO_IP;
58251   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58252      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58253      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58254   } else if (IPPROTO_IP == IPPROTO_UDP) {
58255      stype = SOCK_DGRAM;
58256      ptype = IPPROTO_UDP;
58257   } else {
58258       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58259       exit(1);
58260   }
58261
58262   if((s = socket(PF_INET, stype, ptype)) < 0) {
58263      perror("socket");
58264      exit(1);
58265   }
58266
58267   optval = 1;
58268   optlen = sizeof(optval);
58269   if(setsockopt(s, IPPROTO_IP, IP_PMTUAGE, &optval, optlen) < 0) {
58270      perror("setsockopt: IPPROTO_IP IP_PMTUAGE");
58271      close(s);
58272      exit(1);
58273   }
58274  ;
58275  return 0;
58276}
58277_ACEOF
58278if ac_fn_c_try_compile "$LINENO"; then :
58279  _compileok=1
58280fi
58281rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58282
58283  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58284/* end confdefs.h.  */
58285
58286#include <sys/types.h>
58287#include <sys/socket.h>
58288#include <netinet/in.h>
58289#include <netinet/tcp.h>
58290#include <netinet/udp.h>
58291
58292#include <stdio.h>
58293#include <stdlib.h>
58294#include <unistd.h>
58295
58296int
58297main ()
58298{
58299
58300   socklen_t optlen;
58301   int optval;
58302   int stype;
58303   int ptype;
58304   int s;
58305
58306   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58307      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58308      ptype = IPPROTO_TCP;
58309   } else if (IPPROTO_IP == IPPROTO_IP) {
58310      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58311      ptype = IPPROTO_IP;
58312   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58313      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58314      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58315   } else if (IPPROTO_IP == IPPROTO_UDP) {
58316      stype = SOCK_DGRAM;
58317      ptype = IPPROTO_UDP;
58318   } else {
58319       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58320       exit(1);
58321   }
58322
58323   if((s = socket(PF_INET6, stype, ptype)) < 0) {
58324      perror("socket");
58325      exit(1);
58326   }
58327
58328   optval = 1;
58329   optlen = sizeof(optval);
58330   if(setsockopt(s, IPPROTO_IP, IP_PMTUAGE, &optval, optlen) < 0) {
58331      perror("setsockopt: IPPROTO_IP IP_PMTUAGE");
58332      close(s);
58333      exit(1);
58334   }
58335  ;
58336  return 0;
58337}
58338_ACEOF
58339if ac_fn_c_try_compile "$LINENO"; then :
58340  _compileok=1
58341fi
58342rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58343
58344  if test x"${_compileok}" != x; then
58345    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
58346$as_echo "yes" >&6; }
58347
58348cat >>confdefs.h <<_ACEOF
58349#define HAVE_IP_PMTUAGE 1
58350_ACEOF
58351
58352cat >>confdefs.h <<_ACEOF
58353#define SOCKS_IP_PMTUAGE_LVL IPPROTO_IP
58354_ACEOF
58355
58356cat >>confdefs.h <<_ACEOF
58357#define SOCKS_IP_PMTUAGE_NAME "ip_pmtuage"
58358_ACEOF
58359    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
58360       #ipv4-only
58361
58362cat >>confdefs.h <<_ACEOF
58363#define SOCKS_IP_PMTUAGE_IPV4 1
58364_ACEOF
58365
58366cat >>confdefs.h <<_ACEOF
58367#define SOCKS_IP_PMTUAGE_IPV6 0
58368_ACEOF
58369    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
58370       #ipv6-only
58371
58372cat >>confdefs.h <<_ACEOF
58373#define SOCKS_IP_PMTUAGE_IPV4 0
58374_ACEOF
58375
58376cat >>confdefs.h <<_ACEOF
58377#define SOCKS_IP_PMTUAGE_IPV6 1
58378_ACEOF
58379    else
58380       #both ipv4 and ipv6
58381
58382cat >>confdefs.h <<_ACEOF
58383#define SOCKS_IP_PMTUAGE_IPV4 1
58384_ACEOF
58385
58386cat >>confdefs.h <<_ACEOF
58387#define SOCKS_IP_PMTUAGE_IPV6 1
58388_ACEOF
58389    fi
58390    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_PMTUAGE"
58391  else
58392    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
58393$as_echo "no" >&6; }
58394  fi #likely not usable
58395unset _compileok
58396  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVDSTADDR" >&5
58397$as_echo_n "checking for IPPROTO_IP socket option IP_RECVDSTADDR... " >&6; }
58398  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58399/* end confdefs.h.  */
58400
58401#include <sys/types.h>
58402#include <sys/socket.h>
58403#include <netinet/in.h>
58404#include <netinet/tcp.h>
58405#include <netinet/udp.h>
58406
58407#include <stdio.h>
58408#include <stdlib.h>
58409#include <unistd.h>
58410
58411int
58412main ()
58413{
58414
58415   socklen_t optlen;
58416   int optval;
58417   int stype;
58418   int ptype;
58419   int s;
58420
58421   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58422      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58423      ptype = IPPROTO_TCP;
58424   } else if (IPPROTO_IP == IPPROTO_IP) {
58425      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58426      ptype = IPPROTO_IP;
58427   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58428      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58429      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58430   } else if (IPPROTO_IP == IPPROTO_UDP) {
58431      stype = SOCK_DGRAM;
58432      ptype = IPPROTO_UDP;
58433   } else {
58434       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58435       exit(1);
58436   }
58437
58438   if((s = socket(PF_INET, stype, ptype)) < 0) {
58439      perror("socket");
58440      exit(1);
58441   }
58442
58443   optval = 1;
58444   optlen = sizeof(optval);
58445   if(setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &optval, optlen) < 0) {
58446      perror("setsockopt: IPPROTO_IP IP_RECVDSTADDR");
58447      close(s);
58448      exit(1);
58449   }
58450  ;
58451  return 0;
58452}
58453_ACEOF
58454if ac_fn_c_try_compile "$LINENO"; then :
58455  _compileok=1
58456fi
58457rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58458
58459  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58460/* end confdefs.h.  */
58461
58462#include <sys/types.h>
58463#include <sys/socket.h>
58464#include <netinet/in.h>
58465#include <netinet/tcp.h>
58466#include <netinet/udp.h>
58467
58468#include <stdio.h>
58469#include <stdlib.h>
58470#include <unistd.h>
58471
58472int
58473main ()
58474{
58475
58476   socklen_t optlen;
58477   int optval;
58478   int stype;
58479   int ptype;
58480   int s;
58481
58482   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58483      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58484      ptype = IPPROTO_TCP;
58485   } else if (IPPROTO_IP == IPPROTO_IP) {
58486      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58487      ptype = IPPROTO_IP;
58488   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58489      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58490      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58491   } else if (IPPROTO_IP == IPPROTO_UDP) {
58492      stype = SOCK_DGRAM;
58493      ptype = IPPROTO_UDP;
58494   } else {
58495       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58496       exit(1);
58497   }
58498
58499   if((s = socket(PF_INET6, stype, ptype)) < 0) {
58500      perror("socket");
58501      exit(1);
58502   }
58503
58504   optval = 1;
58505   optlen = sizeof(optval);
58506   if(setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &optval, optlen) < 0) {
58507      perror("setsockopt: IPPROTO_IP IP_RECVDSTADDR");
58508      close(s);
58509      exit(1);
58510   }
58511  ;
58512  return 0;
58513}
58514_ACEOF
58515if ac_fn_c_try_compile "$LINENO"; then :
58516  _compileok=1
58517fi
58518rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58519
58520  if test x"${_compileok}" != x; then
58521    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
58522$as_echo "yes" >&6; }
58523
58524cat >>confdefs.h <<_ACEOF
58525#define HAVE_IP_RECVDSTADDR 1
58526_ACEOF
58527
58528cat >>confdefs.h <<_ACEOF
58529#define SOCKS_IP_RECVDSTADDR_LVL IPPROTO_IP
58530_ACEOF
58531
58532cat >>confdefs.h <<_ACEOF
58533#define SOCKS_IP_RECVDSTADDR_NAME "ip_recvdstaddr"
58534_ACEOF
58535    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
58536       #ipv4-only
58537
58538cat >>confdefs.h <<_ACEOF
58539#define SOCKS_IP_RECVDSTADDR_IPV4 1
58540_ACEOF
58541
58542cat >>confdefs.h <<_ACEOF
58543#define SOCKS_IP_RECVDSTADDR_IPV6 0
58544_ACEOF
58545    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
58546       #ipv6-only
58547
58548cat >>confdefs.h <<_ACEOF
58549#define SOCKS_IP_RECVDSTADDR_IPV4 0
58550_ACEOF
58551
58552cat >>confdefs.h <<_ACEOF
58553#define SOCKS_IP_RECVDSTADDR_IPV6 1
58554_ACEOF
58555    else
58556       #both ipv4 and ipv6
58557
58558cat >>confdefs.h <<_ACEOF
58559#define SOCKS_IP_RECVDSTADDR_IPV4 1
58560_ACEOF
58561
58562cat >>confdefs.h <<_ACEOF
58563#define SOCKS_IP_RECVDSTADDR_IPV6 1
58564_ACEOF
58565    fi
58566    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVDSTADDR"
58567  else
58568    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
58569$as_echo "no" >&6; }
58570  fi #not usable
58571unset _compileok
58572  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVIF" >&5
58573$as_echo_n "checking for IPPROTO_IP socket option IP_RECVIF... " >&6; }
58574  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58575/* end confdefs.h.  */
58576
58577#include <sys/types.h>
58578#include <sys/socket.h>
58579#include <netinet/in.h>
58580#include <netinet/tcp.h>
58581#include <netinet/udp.h>
58582
58583#include <stdio.h>
58584#include <stdlib.h>
58585#include <unistd.h>
58586
58587int
58588main ()
58589{
58590
58591   socklen_t optlen;
58592   int optval;
58593   int stype;
58594   int ptype;
58595   int s;
58596
58597   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58598      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58599      ptype = IPPROTO_TCP;
58600   } else if (IPPROTO_IP == IPPROTO_IP) {
58601      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58602      ptype = IPPROTO_IP;
58603   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58604      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58605      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58606   } else if (IPPROTO_IP == IPPROTO_UDP) {
58607      stype = SOCK_DGRAM;
58608      ptype = IPPROTO_UDP;
58609   } else {
58610       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58611       exit(1);
58612   }
58613
58614   if((s = socket(PF_INET, stype, ptype)) < 0) {
58615      perror("socket");
58616      exit(1);
58617   }
58618
58619   optval = 1;
58620   optlen = sizeof(optval);
58621   if(setsockopt(s, IPPROTO_IP, IP_RECVIF, &optval, optlen) < 0) {
58622      perror("setsockopt: IPPROTO_IP IP_RECVIF");
58623      close(s);
58624      exit(1);
58625   }
58626  ;
58627  return 0;
58628}
58629_ACEOF
58630if ac_fn_c_try_compile "$LINENO"; then :
58631  _compileok=1
58632fi
58633rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58634
58635  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58636/* end confdefs.h.  */
58637
58638#include <sys/types.h>
58639#include <sys/socket.h>
58640#include <netinet/in.h>
58641#include <netinet/tcp.h>
58642#include <netinet/udp.h>
58643
58644#include <stdio.h>
58645#include <stdlib.h>
58646#include <unistd.h>
58647
58648int
58649main ()
58650{
58651
58652   socklen_t optlen;
58653   int optval;
58654   int stype;
58655   int ptype;
58656   int s;
58657
58658   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58659      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58660      ptype = IPPROTO_TCP;
58661   } else if (IPPROTO_IP == IPPROTO_IP) {
58662      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58663      ptype = IPPROTO_IP;
58664   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58665      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58666      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58667   } else if (IPPROTO_IP == IPPROTO_UDP) {
58668      stype = SOCK_DGRAM;
58669      ptype = IPPROTO_UDP;
58670   } else {
58671       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58672       exit(1);
58673   }
58674
58675   if((s = socket(PF_INET6, stype, ptype)) < 0) {
58676      perror("socket");
58677      exit(1);
58678   }
58679
58680   optval = 1;
58681   optlen = sizeof(optval);
58682   if(setsockopt(s, IPPROTO_IP, IP_RECVIF, &optval, optlen) < 0) {
58683      perror("setsockopt: IPPROTO_IP IP_RECVIF");
58684      close(s);
58685      exit(1);
58686   }
58687  ;
58688  return 0;
58689}
58690_ACEOF
58691if ac_fn_c_try_compile "$LINENO"; then :
58692  _compileok=1
58693fi
58694rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58695
58696  if test x"${_compileok}" != x; then
58697    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
58698$as_echo "yes" >&6; }
58699
58700cat >>confdefs.h <<_ACEOF
58701#define HAVE_IP_RECVIF 1
58702_ACEOF
58703
58704cat >>confdefs.h <<_ACEOF
58705#define SOCKS_IP_RECVIF_LVL IPPROTO_IP
58706_ACEOF
58707
58708cat >>confdefs.h <<_ACEOF
58709#define SOCKS_IP_RECVIF_NAME "ip_recvif"
58710_ACEOF
58711    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
58712       #ipv4-only
58713
58714cat >>confdefs.h <<_ACEOF
58715#define SOCKS_IP_RECVIF_IPV4 1
58716_ACEOF
58717
58718cat >>confdefs.h <<_ACEOF
58719#define SOCKS_IP_RECVIF_IPV6 0
58720_ACEOF
58721    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
58722       #ipv6-only
58723
58724cat >>confdefs.h <<_ACEOF
58725#define SOCKS_IP_RECVIF_IPV4 0
58726_ACEOF
58727
58728cat >>confdefs.h <<_ACEOF
58729#define SOCKS_IP_RECVIF_IPV6 1
58730_ACEOF
58731    else
58732       #both ipv4 and ipv6
58733
58734cat >>confdefs.h <<_ACEOF
58735#define SOCKS_IP_RECVIF_IPV4 1
58736_ACEOF
58737
58738cat >>confdefs.h <<_ACEOF
58739#define SOCKS_IP_RECVIF_IPV6 1
58740_ACEOF
58741    fi
58742    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVIF"
58743  else
58744    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
58745$as_echo "no" >&6; }
58746  fi #not usable
58747unset _compileok
58748  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVIFINFO" >&5
58749$as_echo_n "checking for IPPROTO_IP socket option IP_RECVIFINFO... " >&6; }
58750  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58751/* end confdefs.h.  */
58752
58753#include <sys/types.h>
58754#include <sys/socket.h>
58755#include <netinet/in.h>
58756#include <netinet/tcp.h>
58757#include <netinet/udp.h>
58758
58759#include <stdio.h>
58760#include <stdlib.h>
58761#include <unistd.h>
58762
58763int
58764main ()
58765{
58766
58767   socklen_t optlen;
58768   int optval;
58769   int stype;
58770   int ptype;
58771   int s;
58772
58773   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58774      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58775      ptype = IPPROTO_TCP;
58776   } else if (IPPROTO_IP == IPPROTO_IP) {
58777      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58778      ptype = IPPROTO_IP;
58779   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58780      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58781      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58782   } else if (IPPROTO_IP == IPPROTO_UDP) {
58783      stype = SOCK_DGRAM;
58784      ptype = IPPROTO_UDP;
58785   } else {
58786       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58787       exit(1);
58788   }
58789
58790   if((s = socket(PF_INET, stype, ptype)) < 0) {
58791      perror("socket");
58792      exit(1);
58793   }
58794
58795   optval = 1;
58796   optlen = sizeof(optval);
58797   if(setsockopt(s, IPPROTO_IP, IP_RECVIFINFO, &optval, optlen) < 0) {
58798      perror("setsockopt: IPPROTO_IP IP_RECVIFINFO");
58799      close(s);
58800      exit(1);
58801   }
58802  ;
58803  return 0;
58804}
58805_ACEOF
58806if ac_fn_c_try_compile "$LINENO"; then :
58807  _compileok=1
58808fi
58809rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58810
58811  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58812/* end confdefs.h.  */
58813
58814#include <sys/types.h>
58815#include <sys/socket.h>
58816#include <netinet/in.h>
58817#include <netinet/tcp.h>
58818#include <netinet/udp.h>
58819
58820#include <stdio.h>
58821#include <stdlib.h>
58822#include <unistd.h>
58823
58824int
58825main ()
58826{
58827
58828   socklen_t optlen;
58829   int optval;
58830   int stype;
58831   int ptype;
58832   int s;
58833
58834   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58835      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58836      ptype = IPPROTO_TCP;
58837   } else if (IPPROTO_IP == IPPROTO_IP) {
58838      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58839      ptype = IPPROTO_IP;
58840   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58841      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58842      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58843   } else if (IPPROTO_IP == IPPROTO_UDP) {
58844      stype = SOCK_DGRAM;
58845      ptype = IPPROTO_UDP;
58846   } else {
58847       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58848       exit(1);
58849   }
58850
58851   if((s = socket(PF_INET6, stype, ptype)) < 0) {
58852      perror("socket");
58853      exit(1);
58854   }
58855
58856   optval = 1;
58857   optlen = sizeof(optval);
58858   if(setsockopt(s, IPPROTO_IP, IP_RECVIFINFO, &optval, optlen) < 0) {
58859      perror("setsockopt: IPPROTO_IP IP_RECVIFINFO");
58860      close(s);
58861      exit(1);
58862   }
58863  ;
58864  return 0;
58865}
58866_ACEOF
58867if ac_fn_c_try_compile "$LINENO"; then :
58868  _compileok=1
58869fi
58870rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58871
58872  if test x"${_compileok}" != x; then
58873    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
58874$as_echo "yes" >&6; }
58875
58876cat >>confdefs.h <<_ACEOF
58877#define HAVE_IP_RECVIFINFO 1
58878_ACEOF
58879
58880cat >>confdefs.h <<_ACEOF
58881#define SOCKS_IP_RECVIFINFO_LVL IPPROTO_IP
58882_ACEOF
58883
58884cat >>confdefs.h <<_ACEOF
58885#define SOCKS_IP_RECVIFINFO_NAME "ip_recvifinfo"
58886_ACEOF
58887    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
58888       #ipv4-only
58889
58890cat >>confdefs.h <<_ACEOF
58891#define SOCKS_IP_RECVIFINFO_IPV4 1
58892_ACEOF
58893
58894cat >>confdefs.h <<_ACEOF
58895#define SOCKS_IP_RECVIFINFO_IPV6 0
58896_ACEOF
58897    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
58898       #ipv6-only
58899
58900cat >>confdefs.h <<_ACEOF
58901#define SOCKS_IP_RECVIFINFO_IPV4 0
58902_ACEOF
58903
58904cat >>confdefs.h <<_ACEOF
58905#define SOCKS_IP_RECVIFINFO_IPV6 1
58906_ACEOF
58907    else
58908       #both ipv4 and ipv6
58909
58910cat >>confdefs.h <<_ACEOF
58911#define SOCKS_IP_RECVIFINFO_IPV4 1
58912_ACEOF
58913
58914cat >>confdefs.h <<_ACEOF
58915#define SOCKS_IP_RECVIFINFO_IPV6 1
58916_ACEOF
58917    fi
58918    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVIFINFO"
58919  else
58920    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
58921$as_echo "no" >&6; }
58922  fi #not usable
58923unset _compileok
58924  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVINTERFACE" >&5
58925$as_echo_n "checking for IPPROTO_IP socket option IP_RECVINTERFACE... " >&6; }
58926  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58927/* end confdefs.h.  */
58928
58929#include <sys/types.h>
58930#include <sys/socket.h>
58931#include <netinet/in.h>
58932#include <netinet/tcp.h>
58933#include <netinet/udp.h>
58934
58935#include <stdio.h>
58936#include <stdlib.h>
58937#include <unistd.h>
58938
58939int
58940main ()
58941{
58942
58943   socklen_t optlen;
58944   int optval;
58945   int stype;
58946   int ptype;
58947   int s;
58948
58949   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
58950      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
58951      ptype = IPPROTO_TCP;
58952   } else if (IPPROTO_IP == IPPROTO_IP) {
58953      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
58954      ptype = IPPROTO_IP;
58955   } else if (IPPROTO_IP == IPPROTO_IPV6) {
58956      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
58957      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
58958   } else if (IPPROTO_IP == IPPROTO_UDP) {
58959      stype = SOCK_DGRAM;
58960      ptype = IPPROTO_UDP;
58961   } else {
58962       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
58963       exit(1);
58964   }
58965
58966   if((s = socket(PF_INET, stype, ptype)) < 0) {
58967      perror("socket");
58968      exit(1);
58969   }
58970
58971   optval = 1;
58972   optlen = sizeof(optval);
58973   if(setsockopt(s, IPPROTO_IP, IP_RECVINTERFACE, &optval, optlen) < 0) {
58974      perror("setsockopt: IPPROTO_IP IP_RECVINTERFACE");
58975      close(s);
58976      exit(1);
58977   }
58978  ;
58979  return 0;
58980}
58981_ACEOF
58982if ac_fn_c_try_compile "$LINENO"; then :
58983  _compileok=1
58984fi
58985rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
58986
58987  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
58988/* end confdefs.h.  */
58989
58990#include <sys/types.h>
58991#include <sys/socket.h>
58992#include <netinet/in.h>
58993#include <netinet/tcp.h>
58994#include <netinet/udp.h>
58995
58996#include <stdio.h>
58997#include <stdlib.h>
58998#include <unistd.h>
58999
59000int
59001main ()
59002{
59003
59004   socklen_t optlen;
59005   int optval;
59006   int stype;
59007   int ptype;
59008   int s;
59009
59010   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59011      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59012      ptype = IPPROTO_TCP;
59013   } else if (IPPROTO_IP == IPPROTO_IP) {
59014      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59015      ptype = IPPROTO_IP;
59016   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59017      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59018      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59019   } else if (IPPROTO_IP == IPPROTO_UDP) {
59020      stype = SOCK_DGRAM;
59021      ptype = IPPROTO_UDP;
59022   } else {
59023       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59024       exit(1);
59025   }
59026
59027   if((s = socket(PF_INET6, stype, ptype)) < 0) {
59028      perror("socket");
59029      exit(1);
59030   }
59031
59032   optval = 1;
59033   optlen = sizeof(optval);
59034   if(setsockopt(s, IPPROTO_IP, IP_RECVINTERFACE, &optval, optlen) < 0) {
59035      perror("setsockopt: IPPROTO_IP IP_RECVINTERFACE");
59036      close(s);
59037      exit(1);
59038   }
59039  ;
59040  return 0;
59041}
59042_ACEOF
59043if ac_fn_c_try_compile "$LINENO"; then :
59044  _compileok=1
59045fi
59046rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59047
59048  if test x"${_compileok}" != x; then
59049    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
59050$as_echo "yes" >&6; }
59051
59052cat >>confdefs.h <<_ACEOF
59053#define HAVE_IP_RECVINTERFACE 1
59054_ACEOF
59055
59056cat >>confdefs.h <<_ACEOF
59057#define SOCKS_IP_RECVINTERFACE_LVL IPPROTO_IP
59058_ACEOF
59059
59060cat >>confdefs.h <<_ACEOF
59061#define SOCKS_IP_RECVINTERFACE_NAME "ip_recvinterface"
59062_ACEOF
59063    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
59064       #ipv4-only
59065
59066cat >>confdefs.h <<_ACEOF
59067#define SOCKS_IP_RECVINTERFACE_IPV4 1
59068_ACEOF
59069
59070cat >>confdefs.h <<_ACEOF
59071#define SOCKS_IP_RECVINTERFACE_IPV6 0
59072_ACEOF
59073    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
59074       #ipv6-only
59075
59076cat >>confdefs.h <<_ACEOF
59077#define SOCKS_IP_RECVINTERFACE_IPV4 0
59078_ACEOF
59079
59080cat >>confdefs.h <<_ACEOF
59081#define SOCKS_IP_RECVINTERFACE_IPV6 1
59082_ACEOF
59083    else
59084       #both ipv4 and ipv6
59085
59086cat >>confdefs.h <<_ACEOF
59087#define SOCKS_IP_RECVINTERFACE_IPV4 1
59088_ACEOF
59089
59090cat >>confdefs.h <<_ACEOF
59091#define SOCKS_IP_RECVINTERFACE_IPV6 1
59092_ACEOF
59093    fi
59094    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVINTERFACE"
59095  else
59096    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
59097$as_echo "no" >&6; }
59098  fi #likely not usable
59099unset _compileok
59100  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVMACHDR" >&5
59101$as_echo_n "checking for IPPROTO_IP socket option IP_RECVMACHDR... " >&6; }
59102  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59103/* end confdefs.h.  */
59104
59105#include <sys/types.h>
59106#include <sys/socket.h>
59107#include <netinet/in.h>
59108#include <netinet/tcp.h>
59109#include <netinet/udp.h>
59110
59111#include <stdio.h>
59112#include <stdlib.h>
59113#include <unistd.h>
59114
59115int
59116main ()
59117{
59118
59119   socklen_t optlen;
59120   int optval;
59121   int stype;
59122   int ptype;
59123   int s;
59124
59125   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59126      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59127      ptype = IPPROTO_TCP;
59128   } else if (IPPROTO_IP == IPPROTO_IP) {
59129      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59130      ptype = IPPROTO_IP;
59131   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59132      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59133      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59134   } else if (IPPROTO_IP == IPPROTO_UDP) {
59135      stype = SOCK_DGRAM;
59136      ptype = IPPROTO_UDP;
59137   } else {
59138       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59139       exit(1);
59140   }
59141
59142   if((s = socket(PF_INET, stype, ptype)) < 0) {
59143      perror("socket");
59144      exit(1);
59145   }
59146
59147   optval = 1;
59148   optlen = sizeof(optval);
59149   if(setsockopt(s, IPPROTO_IP, IP_RECVMACHDR, &optval, optlen) < 0) {
59150      perror("setsockopt: IPPROTO_IP IP_RECVMACHDR");
59151      close(s);
59152      exit(1);
59153   }
59154  ;
59155  return 0;
59156}
59157_ACEOF
59158if ac_fn_c_try_compile "$LINENO"; then :
59159  _compileok=1
59160fi
59161rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59162
59163  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59164/* end confdefs.h.  */
59165
59166#include <sys/types.h>
59167#include <sys/socket.h>
59168#include <netinet/in.h>
59169#include <netinet/tcp.h>
59170#include <netinet/udp.h>
59171
59172#include <stdio.h>
59173#include <stdlib.h>
59174#include <unistd.h>
59175
59176int
59177main ()
59178{
59179
59180   socklen_t optlen;
59181   int optval;
59182   int stype;
59183   int ptype;
59184   int s;
59185
59186   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59187      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59188      ptype = IPPROTO_TCP;
59189   } else if (IPPROTO_IP == IPPROTO_IP) {
59190      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59191      ptype = IPPROTO_IP;
59192   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59193      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59194      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59195   } else if (IPPROTO_IP == IPPROTO_UDP) {
59196      stype = SOCK_DGRAM;
59197      ptype = IPPROTO_UDP;
59198   } else {
59199       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59200       exit(1);
59201   }
59202
59203   if((s = socket(PF_INET6, stype, ptype)) < 0) {
59204      perror("socket");
59205      exit(1);
59206   }
59207
59208   optval = 1;
59209   optlen = sizeof(optval);
59210   if(setsockopt(s, IPPROTO_IP, IP_RECVMACHDR, &optval, optlen) < 0) {
59211      perror("setsockopt: IPPROTO_IP IP_RECVMACHDR");
59212      close(s);
59213      exit(1);
59214   }
59215  ;
59216  return 0;
59217}
59218_ACEOF
59219if ac_fn_c_try_compile "$LINENO"; then :
59220  _compileok=1
59221fi
59222rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59223
59224  if test x"${_compileok}" != x; then
59225    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
59226$as_echo "yes" >&6; }
59227
59228cat >>confdefs.h <<_ACEOF
59229#define HAVE_IP_RECVMACHDR 1
59230_ACEOF
59231
59232cat >>confdefs.h <<_ACEOF
59233#define SOCKS_IP_RECVMACHDR_LVL IPPROTO_IP
59234_ACEOF
59235
59236cat >>confdefs.h <<_ACEOF
59237#define SOCKS_IP_RECVMACHDR_NAME "ip_recvmachdr"
59238_ACEOF
59239    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
59240       #ipv4-only
59241
59242cat >>confdefs.h <<_ACEOF
59243#define SOCKS_IP_RECVMACHDR_IPV4 1
59244_ACEOF
59245
59246cat >>confdefs.h <<_ACEOF
59247#define SOCKS_IP_RECVMACHDR_IPV6 0
59248_ACEOF
59249    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
59250       #ipv6-only
59251
59252cat >>confdefs.h <<_ACEOF
59253#define SOCKS_IP_RECVMACHDR_IPV4 0
59254_ACEOF
59255
59256cat >>confdefs.h <<_ACEOF
59257#define SOCKS_IP_RECVMACHDR_IPV6 1
59258_ACEOF
59259    else
59260       #both ipv4 and ipv6
59261
59262cat >>confdefs.h <<_ACEOF
59263#define SOCKS_IP_RECVMACHDR_IPV4 1
59264_ACEOF
59265
59266cat >>confdefs.h <<_ACEOF
59267#define SOCKS_IP_RECVMACHDR_IPV6 1
59268_ACEOF
59269    fi
59270    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVMACHDR"
59271  else
59272    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
59273$as_echo "no" >&6; }
59274  fi #not usable
59275unset _compileok
59276  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVTOS" >&5
59277$as_echo_n "checking for IPPROTO_IP socket option IP_RECVTOS... " >&6; }
59278  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59279/* end confdefs.h.  */
59280
59281#include <sys/types.h>
59282#include <sys/socket.h>
59283#include <netinet/in.h>
59284#include <netinet/tcp.h>
59285#include <netinet/udp.h>
59286
59287#include <stdio.h>
59288#include <stdlib.h>
59289#include <unistd.h>
59290
59291int
59292main ()
59293{
59294
59295   socklen_t optlen;
59296   int optval;
59297   int stype;
59298   int ptype;
59299   int s;
59300
59301   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59302      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59303      ptype = IPPROTO_TCP;
59304   } else if (IPPROTO_IP == IPPROTO_IP) {
59305      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59306      ptype = IPPROTO_IP;
59307   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59308      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59309      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59310   } else if (IPPROTO_IP == IPPROTO_UDP) {
59311      stype = SOCK_DGRAM;
59312      ptype = IPPROTO_UDP;
59313   } else {
59314       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59315       exit(1);
59316   }
59317
59318   if((s = socket(PF_INET, stype, ptype)) < 0) {
59319      perror("socket");
59320      exit(1);
59321   }
59322
59323   optval = 1;
59324   optlen = sizeof(optval);
59325   if(setsockopt(s, IPPROTO_IP, IP_RECVTOS, &optval, optlen) < 0) {
59326      perror("setsockopt: IPPROTO_IP IP_RECVTOS");
59327      close(s);
59328      exit(1);
59329   }
59330  ;
59331  return 0;
59332}
59333_ACEOF
59334if ac_fn_c_try_compile "$LINENO"; then :
59335  _compileok=1
59336fi
59337rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59338
59339  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59340/* end confdefs.h.  */
59341
59342#include <sys/types.h>
59343#include <sys/socket.h>
59344#include <netinet/in.h>
59345#include <netinet/tcp.h>
59346#include <netinet/udp.h>
59347
59348#include <stdio.h>
59349#include <stdlib.h>
59350#include <unistd.h>
59351
59352int
59353main ()
59354{
59355
59356   socklen_t optlen;
59357   int optval;
59358   int stype;
59359   int ptype;
59360   int s;
59361
59362   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59363      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59364      ptype = IPPROTO_TCP;
59365   } else if (IPPROTO_IP == IPPROTO_IP) {
59366      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59367      ptype = IPPROTO_IP;
59368   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59369      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59370      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59371   } else if (IPPROTO_IP == IPPROTO_UDP) {
59372      stype = SOCK_DGRAM;
59373      ptype = IPPROTO_UDP;
59374   } else {
59375       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59376       exit(1);
59377   }
59378
59379   if((s = socket(PF_INET6, stype, ptype)) < 0) {
59380      perror("socket");
59381      exit(1);
59382   }
59383
59384   optval = 1;
59385   optlen = sizeof(optval);
59386   if(setsockopt(s, IPPROTO_IP, IP_RECVTOS, &optval, optlen) < 0) {
59387      perror("setsockopt: IPPROTO_IP IP_RECVTOS");
59388      close(s);
59389      exit(1);
59390   }
59391  ;
59392  return 0;
59393}
59394_ACEOF
59395if ac_fn_c_try_compile "$LINENO"; then :
59396  _compileok=1
59397fi
59398rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59399
59400  if test x"${_compileok}" != x; then
59401    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
59402$as_echo "yes" >&6; }
59403
59404cat >>confdefs.h <<_ACEOF
59405#define HAVE_IP_RECVTOS 1
59406_ACEOF
59407
59408cat >>confdefs.h <<_ACEOF
59409#define SOCKS_IP_RECVTOS_LVL IPPROTO_IP
59410_ACEOF
59411
59412cat >>confdefs.h <<_ACEOF
59413#define SOCKS_IP_RECVTOS_NAME "ip_recvtos"
59414_ACEOF
59415    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
59416       #ipv4-only
59417
59418cat >>confdefs.h <<_ACEOF
59419#define SOCKS_IP_RECVTOS_IPV4 1
59420_ACEOF
59421
59422cat >>confdefs.h <<_ACEOF
59423#define SOCKS_IP_RECVTOS_IPV6 0
59424_ACEOF
59425    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
59426       #ipv6-only
59427
59428cat >>confdefs.h <<_ACEOF
59429#define SOCKS_IP_RECVTOS_IPV4 0
59430_ACEOF
59431
59432cat >>confdefs.h <<_ACEOF
59433#define SOCKS_IP_RECVTOS_IPV6 1
59434_ACEOF
59435    else
59436       #both ipv4 and ipv6
59437
59438cat >>confdefs.h <<_ACEOF
59439#define SOCKS_IP_RECVTOS_IPV4 1
59440_ACEOF
59441
59442cat >>confdefs.h <<_ACEOF
59443#define SOCKS_IP_RECVTOS_IPV6 1
59444_ACEOF
59445    fi
59446    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVTOS"
59447  else
59448    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
59449$as_echo "no" >&6; }
59450  fi #not usable
59451unset _compileok
59452  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVTTL" >&5
59453$as_echo_n "checking for IPPROTO_IP socket option IP_RECVTTL... " >&6; }
59454  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59455/* end confdefs.h.  */
59456
59457#include <sys/types.h>
59458#include <sys/socket.h>
59459#include <netinet/in.h>
59460#include <netinet/tcp.h>
59461#include <netinet/udp.h>
59462
59463#include <stdio.h>
59464#include <stdlib.h>
59465#include <unistd.h>
59466
59467int
59468main ()
59469{
59470
59471   socklen_t optlen;
59472   int optval;
59473   int stype;
59474   int ptype;
59475   int s;
59476
59477   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59478      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59479      ptype = IPPROTO_TCP;
59480   } else if (IPPROTO_IP == IPPROTO_IP) {
59481      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59482      ptype = IPPROTO_IP;
59483   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59484      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59485      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59486   } else if (IPPROTO_IP == IPPROTO_UDP) {
59487      stype = SOCK_DGRAM;
59488      ptype = IPPROTO_UDP;
59489   } else {
59490       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59491       exit(1);
59492   }
59493
59494   if((s = socket(PF_INET, stype, ptype)) < 0) {
59495      perror("socket");
59496      exit(1);
59497   }
59498
59499   optval = 1;
59500   optlen = sizeof(optval);
59501   if(setsockopt(s, IPPROTO_IP, IP_RECVTTL, &optval, optlen) < 0) {
59502      perror("setsockopt: IPPROTO_IP IP_RECVTTL");
59503      close(s);
59504      exit(1);
59505   }
59506  ;
59507  return 0;
59508}
59509_ACEOF
59510if ac_fn_c_try_compile "$LINENO"; then :
59511  _compileok=1
59512fi
59513rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59514
59515  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59516/* end confdefs.h.  */
59517
59518#include <sys/types.h>
59519#include <sys/socket.h>
59520#include <netinet/in.h>
59521#include <netinet/tcp.h>
59522#include <netinet/udp.h>
59523
59524#include <stdio.h>
59525#include <stdlib.h>
59526#include <unistd.h>
59527
59528int
59529main ()
59530{
59531
59532   socklen_t optlen;
59533   int optval;
59534   int stype;
59535   int ptype;
59536   int s;
59537
59538   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59539      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59540      ptype = IPPROTO_TCP;
59541   } else if (IPPROTO_IP == IPPROTO_IP) {
59542      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59543      ptype = IPPROTO_IP;
59544   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59545      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59546      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59547   } else if (IPPROTO_IP == IPPROTO_UDP) {
59548      stype = SOCK_DGRAM;
59549      ptype = IPPROTO_UDP;
59550   } else {
59551       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59552       exit(1);
59553   }
59554
59555   if((s = socket(PF_INET6, stype, ptype)) < 0) {
59556      perror("socket");
59557      exit(1);
59558   }
59559
59560   optval = 1;
59561   optlen = sizeof(optval);
59562   if(setsockopt(s, IPPROTO_IP, IP_RECVTTL, &optval, optlen) < 0) {
59563      perror("setsockopt: IPPROTO_IP IP_RECVTTL");
59564      close(s);
59565      exit(1);
59566   }
59567  ;
59568  return 0;
59569}
59570_ACEOF
59571if ac_fn_c_try_compile "$LINENO"; then :
59572  _compileok=1
59573fi
59574rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59575
59576  if test x"${_compileok}" != x; then
59577    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
59578$as_echo "yes" >&6; }
59579
59580cat >>confdefs.h <<_ACEOF
59581#define HAVE_IP_RECVTTL 1
59582_ACEOF
59583
59584cat >>confdefs.h <<_ACEOF
59585#define SOCKS_IP_RECVTTL_LVL IPPROTO_IP
59586_ACEOF
59587
59588cat >>confdefs.h <<_ACEOF
59589#define SOCKS_IP_RECVTTL_NAME "ip_recvttl"
59590_ACEOF
59591    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
59592       #ipv4-only
59593
59594cat >>confdefs.h <<_ACEOF
59595#define SOCKS_IP_RECVTTL_IPV4 1
59596_ACEOF
59597
59598cat >>confdefs.h <<_ACEOF
59599#define SOCKS_IP_RECVTTL_IPV6 0
59600_ACEOF
59601    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
59602       #ipv6-only
59603
59604cat >>confdefs.h <<_ACEOF
59605#define SOCKS_IP_RECVTTL_IPV4 0
59606_ACEOF
59607
59608cat >>confdefs.h <<_ACEOF
59609#define SOCKS_IP_RECVTTL_IPV6 1
59610_ACEOF
59611    else
59612       #both ipv4 and ipv6
59613
59614cat >>confdefs.h <<_ACEOF
59615#define SOCKS_IP_RECVTTL_IPV4 1
59616_ACEOF
59617
59618cat >>confdefs.h <<_ACEOF
59619#define SOCKS_IP_RECVTTL_IPV6 1
59620_ACEOF
59621    fi
59622    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVTTL"
59623  else
59624    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
59625$as_echo "no" >&6; }
59626  fi #likely not usable
59627unset _compileok
59628  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_RECVTTL" >&5
59629$as_echo_n "checking for IPPROTO_IP socket option IP_RECVTTL... " >&6; }
59630  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59631/* end confdefs.h.  */
59632
59633#include <sys/types.h>
59634#include <sys/socket.h>
59635#include <netinet/in.h>
59636#include <netinet/tcp.h>
59637#include <netinet/udp.h>
59638
59639#include <stdio.h>
59640#include <stdlib.h>
59641#include <unistd.h>
59642
59643int
59644main ()
59645{
59646
59647   socklen_t optlen;
59648   int optval;
59649   int stype;
59650   int ptype;
59651   int s;
59652
59653   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59654      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59655      ptype = IPPROTO_TCP;
59656   } else if (IPPROTO_IP == IPPROTO_IP) {
59657      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59658      ptype = IPPROTO_IP;
59659   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59660      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59661      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59662   } else if (IPPROTO_IP == IPPROTO_UDP) {
59663      stype = SOCK_DGRAM;
59664      ptype = IPPROTO_UDP;
59665   } else {
59666       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59667       exit(1);
59668   }
59669
59670   if((s = socket(PF_INET, stype, ptype)) < 0) {
59671      perror("socket");
59672      exit(1);
59673   }
59674
59675   optval = 1;
59676   optlen = sizeof(optval);
59677   if(setsockopt(s, IPPROTO_IP, IP_RECVTTL, &optval, optlen) < 0) {
59678      perror("setsockopt: IPPROTO_IP IP_RECVTTL");
59679      close(s);
59680      exit(1);
59681   }
59682  ;
59683  return 0;
59684}
59685_ACEOF
59686if ac_fn_c_try_compile "$LINENO"; then :
59687  _compileok=1
59688fi
59689rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59690
59691  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59692/* end confdefs.h.  */
59693
59694#include <sys/types.h>
59695#include <sys/socket.h>
59696#include <netinet/in.h>
59697#include <netinet/tcp.h>
59698#include <netinet/udp.h>
59699
59700#include <stdio.h>
59701#include <stdlib.h>
59702#include <unistd.h>
59703
59704int
59705main ()
59706{
59707
59708   socklen_t optlen;
59709   int optval;
59710   int stype;
59711   int ptype;
59712   int s;
59713
59714   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59715      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59716      ptype = IPPROTO_TCP;
59717   } else if (IPPROTO_IP == IPPROTO_IP) {
59718      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59719      ptype = IPPROTO_IP;
59720   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59721      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59722      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59723   } else if (IPPROTO_IP == IPPROTO_UDP) {
59724      stype = SOCK_DGRAM;
59725      ptype = IPPROTO_UDP;
59726   } else {
59727       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59728       exit(1);
59729   }
59730
59731   if((s = socket(PF_INET6, stype, ptype)) < 0) {
59732      perror("socket");
59733      exit(1);
59734   }
59735
59736   optval = 1;
59737   optlen = sizeof(optval);
59738   if(setsockopt(s, IPPROTO_IP, IP_RECVTTL, &optval, optlen) < 0) {
59739      perror("setsockopt: IPPROTO_IP IP_RECVTTL");
59740      close(s);
59741      exit(1);
59742   }
59743  ;
59744  return 0;
59745}
59746_ACEOF
59747if ac_fn_c_try_compile "$LINENO"; then :
59748  _compileok=1
59749fi
59750rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59751
59752  if test x"${_compileok}" != x; then
59753    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
59754$as_echo "yes" >&6; }
59755
59756cat >>confdefs.h <<_ACEOF
59757#define HAVE_IP_RECVTTL 1
59758_ACEOF
59759
59760cat >>confdefs.h <<_ACEOF
59761#define SOCKS_IP_RECVTTL_LVL IPPROTO_IP
59762_ACEOF
59763
59764cat >>confdefs.h <<_ACEOF
59765#define SOCKS_IP_RECVTTL_NAME "ip_recvttl"
59766_ACEOF
59767    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
59768       #ipv4-only
59769
59770cat >>confdefs.h <<_ACEOF
59771#define SOCKS_IP_RECVTTL_IPV4 1
59772_ACEOF
59773
59774cat >>confdefs.h <<_ACEOF
59775#define SOCKS_IP_RECVTTL_IPV6 0
59776_ACEOF
59777    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
59778       #ipv6-only
59779
59780cat >>confdefs.h <<_ACEOF
59781#define SOCKS_IP_RECVTTL_IPV4 0
59782_ACEOF
59783
59784cat >>confdefs.h <<_ACEOF
59785#define SOCKS_IP_RECVTTL_IPV6 1
59786_ACEOF
59787    else
59788       #both ipv4 and ipv6
59789
59790cat >>confdefs.h <<_ACEOF
59791#define SOCKS_IP_RECVTTL_IPV4 1
59792_ACEOF
59793
59794cat >>confdefs.h <<_ACEOF
59795#define SOCKS_IP_RECVTTL_IPV6 1
59796_ACEOF
59797    fi
59798    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_RECVTTL"
59799  else
59800    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
59801$as_echo "no" >&6; }
59802  fi #not usable
59803unset _compileok
59804  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_SOURCE_FILTER" >&5
59805$as_echo_n "checking for IPPROTO_IP socket option IP_SOURCE_FILTER... " >&6; }
59806  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59807/* end confdefs.h.  */
59808
59809#include <sys/types.h>
59810#include <sys/socket.h>
59811#include <netinet/in.h>
59812#include <netinet/tcp.h>
59813#include <netinet/udp.h>
59814
59815#include <stdio.h>
59816#include <stdlib.h>
59817#include <unistd.h>
59818
59819int
59820main ()
59821{
59822
59823   socklen_t optlen;
59824   int optval;
59825   int stype;
59826   int ptype;
59827   int s;
59828
59829   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59830      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59831      ptype = IPPROTO_TCP;
59832   } else if (IPPROTO_IP == IPPROTO_IP) {
59833      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59834      ptype = IPPROTO_IP;
59835   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59836      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59837      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59838   } else if (IPPROTO_IP == IPPROTO_UDP) {
59839      stype = SOCK_DGRAM;
59840      ptype = IPPROTO_UDP;
59841   } else {
59842       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59843       exit(1);
59844   }
59845
59846   if((s = socket(PF_INET, stype, ptype)) < 0) {
59847      perror("socket");
59848      exit(1);
59849   }
59850
59851   optval = 1;
59852   optlen = sizeof(optval);
59853   if(setsockopt(s, IPPROTO_IP, IP_SOURCE_FILTER, &optval, optlen) < 0) {
59854      perror("setsockopt: IPPROTO_IP IP_SOURCE_FILTER");
59855      close(s);
59856      exit(1);
59857   }
59858  ;
59859  return 0;
59860}
59861_ACEOF
59862if ac_fn_c_try_compile "$LINENO"; then :
59863  _compileok=1
59864fi
59865rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59866
59867  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59868/* end confdefs.h.  */
59869
59870#include <sys/types.h>
59871#include <sys/socket.h>
59872#include <netinet/in.h>
59873#include <netinet/tcp.h>
59874#include <netinet/udp.h>
59875
59876#include <stdio.h>
59877#include <stdlib.h>
59878#include <unistd.h>
59879
59880int
59881main ()
59882{
59883
59884   socklen_t optlen;
59885   int optval;
59886   int stype;
59887   int ptype;
59888   int s;
59889
59890   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
59891      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
59892      ptype = IPPROTO_TCP;
59893   } else if (IPPROTO_IP == IPPROTO_IP) {
59894      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
59895      ptype = IPPROTO_IP;
59896   } else if (IPPROTO_IP == IPPROTO_IPV6) {
59897      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
59898      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
59899   } else if (IPPROTO_IP == IPPROTO_UDP) {
59900      stype = SOCK_DGRAM;
59901      ptype = IPPROTO_UDP;
59902   } else {
59903       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
59904       exit(1);
59905   }
59906
59907   if((s = socket(PF_INET6, stype, ptype)) < 0) {
59908      perror("socket");
59909      exit(1);
59910   }
59911
59912   optval = 1;
59913   optlen = sizeof(optval);
59914   if(setsockopt(s, IPPROTO_IP, IP_SOURCE_FILTER, &optval, optlen) < 0) {
59915      perror("setsockopt: IPPROTO_IP IP_SOURCE_FILTER");
59916      close(s);
59917      exit(1);
59918   }
59919  ;
59920  return 0;
59921}
59922_ACEOF
59923if ac_fn_c_try_compile "$LINENO"; then :
59924  _compileok=1
59925fi
59926rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
59927
59928  if test x"${_compileok}" != x; then
59929    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
59930$as_echo "yes" >&6; }
59931
59932cat >>confdefs.h <<_ACEOF
59933#define HAVE_IP_SOURCE_FILTER 1
59934_ACEOF
59935
59936cat >>confdefs.h <<_ACEOF
59937#define SOCKS_IP_SOURCE_FILTER_LVL IPPROTO_IP
59938_ACEOF
59939
59940cat >>confdefs.h <<_ACEOF
59941#define SOCKS_IP_SOURCE_FILTER_NAME "ip_source_filter"
59942_ACEOF
59943    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
59944       #ipv4-only
59945
59946cat >>confdefs.h <<_ACEOF
59947#define SOCKS_IP_SOURCE_FILTER_IPV4 1
59948_ACEOF
59949
59950cat >>confdefs.h <<_ACEOF
59951#define SOCKS_IP_SOURCE_FILTER_IPV6 0
59952_ACEOF
59953    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
59954       #ipv6-only
59955
59956cat >>confdefs.h <<_ACEOF
59957#define SOCKS_IP_SOURCE_FILTER_IPV4 0
59958_ACEOF
59959
59960cat >>confdefs.h <<_ACEOF
59961#define SOCKS_IP_SOURCE_FILTER_IPV6 1
59962_ACEOF
59963    else
59964       #both ipv4 and ipv6
59965
59966cat >>confdefs.h <<_ACEOF
59967#define SOCKS_IP_SOURCE_FILTER_IPV4 1
59968_ACEOF
59969
59970cat >>confdefs.h <<_ACEOF
59971#define SOCKS_IP_SOURCE_FILTER_IPV6 1
59972_ACEOF
59973    fi
59974    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_SOURCE_FILTER"
59975  else
59976    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
59977$as_echo "no" >&6; }
59978  fi #not usable
59979unset _compileok
59980  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IP socket option IP_UNBLOCK_SOURCE" >&5
59981$as_echo_n "checking for IPPROTO_IP socket option IP_UNBLOCK_SOURCE... " >&6; }
59982  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
59983/* end confdefs.h.  */
59984
59985#include <sys/types.h>
59986#include <sys/socket.h>
59987#include <netinet/in.h>
59988#include <netinet/tcp.h>
59989#include <netinet/udp.h>
59990
59991#include <stdio.h>
59992#include <stdlib.h>
59993#include <unistd.h>
59994
59995int
59996main ()
59997{
59998
59999   socklen_t optlen;
60000   int optval;
60001   int stype;
60002   int ptype;
60003   int s;
60004
60005   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
60006      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60007      ptype = IPPROTO_TCP;
60008   } else if (IPPROTO_IP == IPPROTO_IP) {
60009      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60010      ptype = IPPROTO_IP;
60011   } else if (IPPROTO_IP == IPPROTO_IPV6) {
60012      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60013      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60014   } else if (IPPROTO_IP == IPPROTO_UDP) {
60015      stype = SOCK_DGRAM;
60016      ptype = IPPROTO_UDP;
60017   } else {
60018       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
60019       exit(1);
60020   }
60021
60022   if((s = socket(PF_INET, stype, ptype)) < 0) {
60023      perror("socket");
60024      exit(1);
60025   }
60026
60027   optval = 1;
60028   optlen = sizeof(optval);
60029   if(setsockopt(s, IPPROTO_IP, IP_UNBLOCK_SOURCE, &optval, optlen) < 0) {
60030      perror("setsockopt: IPPROTO_IP IP_UNBLOCK_SOURCE");
60031      close(s);
60032      exit(1);
60033   }
60034  ;
60035  return 0;
60036}
60037_ACEOF
60038if ac_fn_c_try_compile "$LINENO"; then :
60039  _compileok=1
60040fi
60041rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60042
60043  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60044/* end confdefs.h.  */
60045
60046#include <sys/types.h>
60047#include <sys/socket.h>
60048#include <netinet/in.h>
60049#include <netinet/tcp.h>
60050#include <netinet/udp.h>
60051
60052#include <stdio.h>
60053#include <stdlib.h>
60054#include <unistd.h>
60055
60056int
60057main ()
60058{
60059
60060   socklen_t optlen;
60061   int optval;
60062   int stype;
60063   int ptype;
60064   int s;
60065
60066   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
60067      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60068      ptype = IPPROTO_TCP;
60069   } else if (IPPROTO_IP == IPPROTO_IP) {
60070      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60071      ptype = IPPROTO_IP;
60072   } else if (IPPROTO_IP == IPPROTO_IPV6) {
60073      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60074      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60075   } else if (IPPROTO_IP == IPPROTO_UDP) {
60076      stype = SOCK_DGRAM;
60077      ptype = IPPROTO_UDP;
60078   } else {
60079       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
60080       exit(1);
60081   }
60082
60083   if((s = socket(PF_INET6, stype, ptype)) < 0) {
60084      perror("socket");
60085      exit(1);
60086   }
60087
60088   optval = 1;
60089   optlen = sizeof(optval);
60090   if(setsockopt(s, IPPROTO_IP, IP_UNBLOCK_SOURCE, &optval, optlen) < 0) {
60091      perror("setsockopt: IPPROTO_IP IP_UNBLOCK_SOURCE");
60092      close(s);
60093      exit(1);
60094   }
60095  ;
60096  return 0;
60097}
60098_ACEOF
60099if ac_fn_c_try_compile "$LINENO"; then :
60100  _compileok=1
60101fi
60102rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60103
60104  if test x"${_compileok}" != x; then
60105    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
60106$as_echo "yes" >&6; }
60107
60108cat >>confdefs.h <<_ACEOF
60109#define HAVE_IP_UNBLOCK_SOURCE 1
60110_ACEOF
60111
60112cat >>confdefs.h <<_ACEOF
60113#define SOCKS_IP_UNBLOCK_SOURCE_LVL IPPROTO_IP
60114_ACEOF
60115
60116cat >>confdefs.h <<_ACEOF
60117#define SOCKS_IP_UNBLOCK_SOURCE_NAME "ip_unblock_source"
60118_ACEOF
60119    if test x"IPPROTO_IP" = x"IPPROTO_IP"; then
60120       #ipv4-only
60121
60122cat >>confdefs.h <<_ACEOF
60123#define SOCKS_IP_UNBLOCK_SOURCE_IPV4 1
60124_ACEOF
60125
60126cat >>confdefs.h <<_ACEOF
60127#define SOCKS_IP_UNBLOCK_SOURCE_IPV6 0
60128_ACEOF
60129    elif test x"IPPROTO_IP" = x"IPPROTO_IPV6"; then
60130       #ipv6-only
60131
60132cat >>confdefs.h <<_ACEOF
60133#define SOCKS_IP_UNBLOCK_SOURCE_IPV4 0
60134_ACEOF
60135
60136cat >>confdefs.h <<_ACEOF
60137#define SOCKS_IP_UNBLOCK_SOURCE_IPV6 1
60138_ACEOF
60139    else
60140       #both ipv4 and ipv6
60141
60142cat >>confdefs.h <<_ACEOF
60143#define SOCKS_IP_UNBLOCK_SOURCE_IPV4 1
60144_ACEOF
60145
60146cat >>confdefs.h <<_ACEOF
60147#define SOCKS_IP_UNBLOCK_SOURCE_IPV6 1
60148_ACEOF
60149    fi
60150    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IP_UNBLOCK_SOURCE"
60151  else
60152    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
60153$as_echo "no" >&6; }
60154  fi #not usable
60155
60156#ipv6 level (XXX likely more)
60157unset _compileok
60158  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MULTICAST_HOPS" >&5
60159$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MULTICAST_HOPS... " >&6; }
60160  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60161/* end confdefs.h.  */
60162
60163#include <sys/types.h>
60164#include <sys/socket.h>
60165#include <netinet/in.h>
60166#include <netinet/tcp.h>
60167#include <netinet/udp.h>
60168
60169#include <stdio.h>
60170#include <stdlib.h>
60171#include <unistd.h>
60172
60173int
60174main ()
60175{
60176
60177   socklen_t optlen;
60178   int optval;
60179   int stype;
60180   int ptype;
60181   int s;
60182
60183   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60184      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60185      ptype = IPPROTO_TCP;
60186   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60187      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60188      ptype = IPPROTO_IP;
60189   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60190      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60191      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60192   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60193      stype = SOCK_DGRAM;
60194      ptype = IPPROTO_UDP;
60195   } else {
60196       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60197       exit(1);
60198   }
60199
60200   if((s = socket(PF_INET, stype, ptype)) < 0) {
60201      perror("socket");
60202      exit(1);
60203   }
60204
60205   optval = 1;
60206   optlen = sizeof(optval);
60207   if(setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &optval, optlen) < 0) {
60208      perror("setsockopt: IPPROTO_IPV6 IPV6_MULTICAST_HOPS");
60209      close(s);
60210      exit(1);
60211   }
60212  ;
60213  return 0;
60214}
60215_ACEOF
60216if ac_fn_c_try_compile "$LINENO"; then :
60217  _compileok=1
60218fi
60219rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60220
60221  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60222/* end confdefs.h.  */
60223
60224#include <sys/types.h>
60225#include <sys/socket.h>
60226#include <netinet/in.h>
60227#include <netinet/tcp.h>
60228#include <netinet/udp.h>
60229
60230#include <stdio.h>
60231#include <stdlib.h>
60232#include <unistd.h>
60233
60234int
60235main ()
60236{
60237
60238   socklen_t optlen;
60239   int optval;
60240   int stype;
60241   int ptype;
60242   int s;
60243
60244   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60245      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60246      ptype = IPPROTO_TCP;
60247   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60248      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60249      ptype = IPPROTO_IP;
60250   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60251      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60252      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60253   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60254      stype = SOCK_DGRAM;
60255      ptype = IPPROTO_UDP;
60256   } else {
60257       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60258       exit(1);
60259   }
60260
60261   if((s = socket(PF_INET6, stype, ptype)) < 0) {
60262      perror("socket");
60263      exit(1);
60264   }
60265
60266   optval = 1;
60267   optlen = sizeof(optval);
60268   if(setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &optval, optlen) < 0) {
60269      perror("setsockopt: IPPROTO_IPV6 IPV6_MULTICAST_HOPS");
60270      close(s);
60271      exit(1);
60272   }
60273  ;
60274  return 0;
60275}
60276_ACEOF
60277if ac_fn_c_try_compile "$LINENO"; then :
60278  _compileok=1
60279fi
60280rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60281
60282  if test x"${_compileok}" != x; then
60283    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
60284$as_echo "yes" >&6; }
60285
60286cat >>confdefs.h <<_ACEOF
60287#define HAVE_IPV6_MULTICAST_HOPS 1
60288_ACEOF
60289
60290cat >>confdefs.h <<_ACEOF
60291#define SOCKS_IPV6_MULTICAST_HOPS_LVL IPPROTO_IPV6
60292_ACEOF
60293
60294cat >>confdefs.h <<_ACEOF
60295#define SOCKS_IPV6_MULTICAST_HOPS_NAME "ipv6_multicast_hops"
60296_ACEOF
60297    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
60298       #ipv4-only
60299
60300cat >>confdefs.h <<_ACEOF
60301#define SOCKS_IPV6_MULTICAST_HOPS_IPV4 1
60302_ACEOF
60303
60304cat >>confdefs.h <<_ACEOF
60305#define SOCKS_IPV6_MULTICAST_HOPS_IPV6 0
60306_ACEOF
60307    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
60308       #ipv6-only
60309
60310cat >>confdefs.h <<_ACEOF
60311#define SOCKS_IPV6_MULTICAST_HOPS_IPV4 0
60312_ACEOF
60313
60314cat >>confdefs.h <<_ACEOF
60315#define SOCKS_IPV6_MULTICAST_HOPS_IPV6 1
60316_ACEOF
60317    else
60318       #both ipv4 and ipv6
60319
60320cat >>confdefs.h <<_ACEOF
60321#define SOCKS_IPV6_MULTICAST_HOPS_IPV4 1
60322_ACEOF
60323
60324cat >>confdefs.h <<_ACEOF
60325#define SOCKS_IPV6_MULTICAST_HOPS_IPV6 1
60326_ACEOF
60327    fi
60328    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MULTICAST_HOPS"
60329  else
60330    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
60331$as_echo "no" >&6; }
60332  fi
60333unset _compileok
60334  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MULTICAST_IF" >&5
60335$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MULTICAST_IF... " >&6; }
60336  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60337/* end confdefs.h.  */
60338
60339#include <sys/types.h>
60340#include <sys/socket.h>
60341#include <netinet/in.h>
60342#include <netinet/tcp.h>
60343#include <netinet/udp.h>
60344
60345#include <stdio.h>
60346#include <stdlib.h>
60347#include <unistd.h>
60348
60349int
60350main ()
60351{
60352
60353   socklen_t optlen;
60354   int optval;
60355   int stype;
60356   int ptype;
60357   int s;
60358
60359   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60360      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60361      ptype = IPPROTO_TCP;
60362   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60363      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60364      ptype = IPPROTO_IP;
60365   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60366      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60367      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60368   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60369      stype = SOCK_DGRAM;
60370      ptype = IPPROTO_UDP;
60371   } else {
60372       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60373       exit(1);
60374   }
60375
60376   if((s = socket(PF_INET, stype, ptype)) < 0) {
60377      perror("socket");
60378      exit(1);
60379   }
60380
60381   optval = 1;
60382   optlen = sizeof(optval);
60383   if(setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_IF, &optval, optlen) < 0) {
60384      perror("setsockopt: IPPROTO_IPV6 IPV6_MULTICAST_IF");
60385      close(s);
60386      exit(1);
60387   }
60388  ;
60389  return 0;
60390}
60391_ACEOF
60392if ac_fn_c_try_compile "$LINENO"; then :
60393  _compileok=1
60394fi
60395rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60396
60397  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60398/* end confdefs.h.  */
60399
60400#include <sys/types.h>
60401#include <sys/socket.h>
60402#include <netinet/in.h>
60403#include <netinet/tcp.h>
60404#include <netinet/udp.h>
60405
60406#include <stdio.h>
60407#include <stdlib.h>
60408#include <unistd.h>
60409
60410int
60411main ()
60412{
60413
60414   socklen_t optlen;
60415   int optval;
60416   int stype;
60417   int ptype;
60418   int s;
60419
60420   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60421      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60422      ptype = IPPROTO_TCP;
60423   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60424      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60425      ptype = IPPROTO_IP;
60426   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60427      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60428      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60429   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60430      stype = SOCK_DGRAM;
60431      ptype = IPPROTO_UDP;
60432   } else {
60433       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60434       exit(1);
60435   }
60436
60437   if((s = socket(PF_INET6, stype, ptype)) < 0) {
60438      perror("socket");
60439      exit(1);
60440   }
60441
60442   optval = 1;
60443   optlen = sizeof(optval);
60444   if(setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_IF, &optval, optlen) < 0) {
60445      perror("setsockopt: IPPROTO_IPV6 IPV6_MULTICAST_IF");
60446      close(s);
60447      exit(1);
60448   }
60449  ;
60450  return 0;
60451}
60452_ACEOF
60453if ac_fn_c_try_compile "$LINENO"; then :
60454  _compileok=1
60455fi
60456rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60457
60458  if test x"${_compileok}" != x; then
60459    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
60460$as_echo "yes" >&6; }
60461
60462cat >>confdefs.h <<_ACEOF
60463#define HAVE_IPV6_MULTICAST_IF 1
60464_ACEOF
60465
60466cat >>confdefs.h <<_ACEOF
60467#define SOCKS_IPV6_MULTICAST_IF_LVL IPPROTO_IPV6
60468_ACEOF
60469
60470cat >>confdefs.h <<_ACEOF
60471#define SOCKS_IPV6_MULTICAST_IF_NAME "ipv6_multicast_if"
60472_ACEOF
60473    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
60474       #ipv4-only
60475
60476cat >>confdefs.h <<_ACEOF
60477#define SOCKS_IPV6_MULTICAST_IF_IPV4 1
60478_ACEOF
60479
60480cat >>confdefs.h <<_ACEOF
60481#define SOCKS_IPV6_MULTICAST_IF_IPV6 0
60482_ACEOF
60483    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
60484       #ipv6-only
60485
60486cat >>confdefs.h <<_ACEOF
60487#define SOCKS_IPV6_MULTICAST_IF_IPV4 0
60488_ACEOF
60489
60490cat >>confdefs.h <<_ACEOF
60491#define SOCKS_IPV6_MULTICAST_IF_IPV6 1
60492_ACEOF
60493    else
60494       #both ipv4 and ipv6
60495
60496cat >>confdefs.h <<_ACEOF
60497#define SOCKS_IPV6_MULTICAST_IF_IPV4 1
60498_ACEOF
60499
60500cat >>confdefs.h <<_ACEOF
60501#define SOCKS_IPV6_MULTICAST_IF_IPV6 1
60502_ACEOF
60503    fi
60504    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MULTICAST_IF"
60505  else
60506    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
60507$as_echo "no" >&6; }
60508  fi
60509unset _compileok
60510  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_MULTICAST_LOOP" >&5
60511$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_MULTICAST_LOOP... " >&6; }
60512  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60513/* end confdefs.h.  */
60514
60515#include <sys/types.h>
60516#include <sys/socket.h>
60517#include <netinet/in.h>
60518#include <netinet/tcp.h>
60519#include <netinet/udp.h>
60520
60521#include <stdio.h>
60522#include <stdlib.h>
60523#include <unistd.h>
60524
60525int
60526main ()
60527{
60528
60529   socklen_t optlen;
60530   int optval;
60531   int stype;
60532   int ptype;
60533   int s;
60534
60535   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60536      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60537      ptype = IPPROTO_TCP;
60538   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60539      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60540      ptype = IPPROTO_IP;
60541   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60542      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60543      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60544   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60545      stype = SOCK_DGRAM;
60546      ptype = IPPROTO_UDP;
60547   } else {
60548       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60549       exit(1);
60550   }
60551
60552   if((s = socket(PF_INET, stype, ptype)) < 0) {
60553      perror("socket");
60554      exit(1);
60555   }
60556
60557   optval = 1;
60558   optlen = sizeof(optval);
60559   if(setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &optval, optlen) < 0) {
60560      perror("setsockopt: IPPROTO_IPV6 IPV6_MULTICAST_LOOP");
60561      close(s);
60562      exit(1);
60563   }
60564  ;
60565  return 0;
60566}
60567_ACEOF
60568if ac_fn_c_try_compile "$LINENO"; then :
60569  _compileok=1
60570fi
60571rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60572
60573  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60574/* end confdefs.h.  */
60575
60576#include <sys/types.h>
60577#include <sys/socket.h>
60578#include <netinet/in.h>
60579#include <netinet/tcp.h>
60580#include <netinet/udp.h>
60581
60582#include <stdio.h>
60583#include <stdlib.h>
60584#include <unistd.h>
60585
60586int
60587main ()
60588{
60589
60590   socklen_t optlen;
60591   int optval;
60592   int stype;
60593   int ptype;
60594   int s;
60595
60596   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60597      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60598      ptype = IPPROTO_TCP;
60599   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60600      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60601      ptype = IPPROTO_IP;
60602   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60603      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60604      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60605   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60606      stype = SOCK_DGRAM;
60607      ptype = IPPROTO_UDP;
60608   } else {
60609       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60610       exit(1);
60611   }
60612
60613   if((s = socket(PF_INET6, stype, ptype)) < 0) {
60614      perror("socket");
60615      exit(1);
60616   }
60617
60618   optval = 1;
60619   optlen = sizeof(optval);
60620   if(setsockopt(s, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &optval, optlen) < 0) {
60621      perror("setsockopt: IPPROTO_IPV6 IPV6_MULTICAST_LOOP");
60622      close(s);
60623      exit(1);
60624   }
60625  ;
60626  return 0;
60627}
60628_ACEOF
60629if ac_fn_c_try_compile "$LINENO"; then :
60630  _compileok=1
60631fi
60632rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60633
60634  if test x"${_compileok}" != x; then
60635    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
60636$as_echo "yes" >&6; }
60637
60638cat >>confdefs.h <<_ACEOF
60639#define HAVE_IPV6_MULTICAST_LOOP 1
60640_ACEOF
60641
60642cat >>confdefs.h <<_ACEOF
60643#define SOCKS_IPV6_MULTICAST_LOOP_LVL IPPROTO_IPV6
60644_ACEOF
60645
60646cat >>confdefs.h <<_ACEOF
60647#define SOCKS_IPV6_MULTICAST_LOOP_NAME "ipv6_multicast_loop"
60648_ACEOF
60649    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
60650       #ipv4-only
60651
60652cat >>confdefs.h <<_ACEOF
60653#define SOCKS_IPV6_MULTICAST_LOOP_IPV4 1
60654_ACEOF
60655
60656cat >>confdefs.h <<_ACEOF
60657#define SOCKS_IPV6_MULTICAST_LOOP_IPV6 0
60658_ACEOF
60659    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
60660       #ipv6-only
60661
60662cat >>confdefs.h <<_ACEOF
60663#define SOCKS_IPV6_MULTICAST_LOOP_IPV4 0
60664_ACEOF
60665
60666cat >>confdefs.h <<_ACEOF
60667#define SOCKS_IPV6_MULTICAST_LOOP_IPV6 1
60668_ACEOF
60669    else
60670       #both ipv4 and ipv6
60671
60672cat >>confdefs.h <<_ACEOF
60673#define SOCKS_IPV6_MULTICAST_LOOP_IPV4 1
60674_ACEOF
60675
60676cat >>confdefs.h <<_ACEOF
60677#define SOCKS_IPV6_MULTICAST_LOOP_IPV6 1
60678_ACEOF
60679    fi
60680    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_MULTICAST_LOOP"
60681  else
60682    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
60683$as_echo "no" >&6; }
60684  fi
60685unset _compileok
60686  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_AIXRAWSOCKET" >&5
60687$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_AIXRAWSOCKET... " >&6; }
60688  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60689/* end confdefs.h.  */
60690
60691#include <sys/types.h>
60692#include <sys/socket.h>
60693#include <netinet/in.h>
60694#include <netinet/tcp.h>
60695#include <netinet/udp.h>
60696
60697#include <stdio.h>
60698#include <stdlib.h>
60699#include <unistd.h>
60700
60701int
60702main ()
60703{
60704
60705   socklen_t optlen;
60706   int optval;
60707   int stype;
60708   int ptype;
60709   int s;
60710
60711   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60712      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60713      ptype = IPPROTO_TCP;
60714   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60715      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60716      ptype = IPPROTO_IP;
60717   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60718      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60719      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60720   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60721      stype = SOCK_DGRAM;
60722      ptype = IPPROTO_UDP;
60723   } else {
60724       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60725       exit(1);
60726   }
60727
60728   if((s = socket(PF_INET, stype, ptype)) < 0) {
60729      perror("socket");
60730      exit(1);
60731   }
60732
60733   optval = 1;
60734   optlen = sizeof(optval);
60735   if(setsockopt(s, IPPROTO_IPV6, IPV6_AIXRAWSOCKET, &optval, optlen) < 0) {
60736      perror("setsockopt: IPPROTO_IPV6 IPV6_AIXRAWSOCKET");
60737      close(s);
60738      exit(1);
60739   }
60740  ;
60741  return 0;
60742}
60743_ACEOF
60744if ac_fn_c_try_compile "$LINENO"; then :
60745  _compileok=1
60746fi
60747rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60748
60749  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60750/* end confdefs.h.  */
60751
60752#include <sys/types.h>
60753#include <sys/socket.h>
60754#include <netinet/in.h>
60755#include <netinet/tcp.h>
60756#include <netinet/udp.h>
60757
60758#include <stdio.h>
60759#include <stdlib.h>
60760#include <unistd.h>
60761
60762int
60763main ()
60764{
60765
60766   socklen_t optlen;
60767   int optval;
60768   int stype;
60769   int ptype;
60770   int s;
60771
60772   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60773      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60774      ptype = IPPROTO_TCP;
60775   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60776      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60777      ptype = IPPROTO_IP;
60778   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60779      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60780      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60781   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60782      stype = SOCK_DGRAM;
60783      ptype = IPPROTO_UDP;
60784   } else {
60785       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60786       exit(1);
60787   }
60788
60789   if((s = socket(PF_INET6, stype, ptype)) < 0) {
60790      perror("socket");
60791      exit(1);
60792   }
60793
60794   optval = 1;
60795   optlen = sizeof(optval);
60796   if(setsockopt(s, IPPROTO_IPV6, IPV6_AIXRAWSOCKET, &optval, optlen) < 0) {
60797      perror("setsockopt: IPPROTO_IPV6 IPV6_AIXRAWSOCKET");
60798      close(s);
60799      exit(1);
60800   }
60801  ;
60802  return 0;
60803}
60804_ACEOF
60805if ac_fn_c_try_compile "$LINENO"; then :
60806  _compileok=1
60807fi
60808rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60809
60810  if test x"${_compileok}" != x; then
60811    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
60812$as_echo "yes" >&6; }
60813
60814cat >>confdefs.h <<_ACEOF
60815#define HAVE_IPV6_AIXRAWSOCKET 1
60816_ACEOF
60817
60818cat >>confdefs.h <<_ACEOF
60819#define SOCKS_IPV6_AIXRAWSOCKET_LVL IPPROTO_IPV6
60820_ACEOF
60821
60822cat >>confdefs.h <<_ACEOF
60823#define SOCKS_IPV6_AIXRAWSOCKET_NAME "ipv6_aixrawsocket"
60824_ACEOF
60825    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
60826       #ipv4-only
60827
60828cat >>confdefs.h <<_ACEOF
60829#define SOCKS_IPV6_AIXRAWSOCKET_IPV4 1
60830_ACEOF
60831
60832cat >>confdefs.h <<_ACEOF
60833#define SOCKS_IPV6_AIXRAWSOCKET_IPV6 0
60834_ACEOF
60835    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
60836       #ipv6-only
60837
60838cat >>confdefs.h <<_ACEOF
60839#define SOCKS_IPV6_AIXRAWSOCKET_IPV4 0
60840_ACEOF
60841
60842cat >>confdefs.h <<_ACEOF
60843#define SOCKS_IPV6_AIXRAWSOCKET_IPV6 1
60844_ACEOF
60845    else
60846       #both ipv4 and ipv6
60847
60848cat >>confdefs.h <<_ACEOF
60849#define SOCKS_IPV6_AIXRAWSOCKET_IPV4 1
60850_ACEOF
60851
60852cat >>confdefs.h <<_ACEOF
60853#define SOCKS_IPV6_AIXRAWSOCKET_IPV6 1
60854_ACEOF
60855    fi
60856    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_AIXRAWSOCKET"
60857  else
60858    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
60859$as_echo "no" >&6; }
60860  fi #not usable
60861unset _compileok
60862  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_NOPROBE" >&5
60863$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_NOPROBE... " >&6; }
60864  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60865/* end confdefs.h.  */
60866
60867#include <sys/types.h>
60868#include <sys/socket.h>
60869#include <netinet/in.h>
60870#include <netinet/tcp.h>
60871#include <netinet/udp.h>
60872
60873#include <stdio.h>
60874#include <stdlib.h>
60875#include <unistd.h>
60876
60877int
60878main ()
60879{
60880
60881   socklen_t optlen;
60882   int optval;
60883   int stype;
60884   int ptype;
60885   int s;
60886
60887   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60888      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60889      ptype = IPPROTO_TCP;
60890   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60891      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60892      ptype = IPPROTO_IP;
60893   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60894      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60895      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60896   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60897      stype = SOCK_DGRAM;
60898      ptype = IPPROTO_UDP;
60899   } else {
60900       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60901       exit(1);
60902   }
60903
60904   if((s = socket(PF_INET, stype, ptype)) < 0) {
60905      perror("socket");
60906      exit(1);
60907   }
60908
60909   optval = 1;
60910   optlen = sizeof(optval);
60911   if(setsockopt(s, IPPROTO_IPV6, IPV6_NOPROBE, &optval, optlen) < 0) {
60912      perror("setsockopt: IPPROTO_IPV6 IPV6_NOPROBE");
60913      close(s);
60914      exit(1);
60915   }
60916  ;
60917  return 0;
60918}
60919_ACEOF
60920if ac_fn_c_try_compile "$LINENO"; then :
60921  _compileok=1
60922fi
60923rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60924
60925  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
60926/* end confdefs.h.  */
60927
60928#include <sys/types.h>
60929#include <sys/socket.h>
60930#include <netinet/in.h>
60931#include <netinet/tcp.h>
60932#include <netinet/udp.h>
60933
60934#include <stdio.h>
60935#include <stdlib.h>
60936#include <unistd.h>
60937
60938int
60939main ()
60940{
60941
60942   socklen_t optlen;
60943   int optval;
60944   int stype;
60945   int ptype;
60946   int s;
60947
60948   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
60949      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
60950      ptype = IPPROTO_TCP;
60951   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
60952      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
60953      ptype = IPPROTO_IP;
60954   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
60955      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
60956      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
60957   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
60958      stype = SOCK_DGRAM;
60959      ptype = IPPROTO_UDP;
60960   } else {
60961       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
60962       exit(1);
60963   }
60964
60965   if((s = socket(PF_INET6, stype, ptype)) < 0) {
60966      perror("socket");
60967      exit(1);
60968   }
60969
60970   optval = 1;
60971   optlen = sizeof(optval);
60972   if(setsockopt(s, IPPROTO_IPV6, IPV6_NOPROBE, &optval, optlen) < 0) {
60973      perror("setsockopt: IPPROTO_IPV6 IPV6_NOPROBE");
60974      close(s);
60975      exit(1);
60976   }
60977  ;
60978  return 0;
60979}
60980_ACEOF
60981if ac_fn_c_try_compile "$LINENO"; then :
60982  _compileok=1
60983fi
60984rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
60985
60986  if test x"${_compileok}" != x; then
60987    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
60988$as_echo "yes" >&6; }
60989
60990cat >>confdefs.h <<_ACEOF
60991#define HAVE_IPV6_NOPROBE 1
60992_ACEOF
60993
60994cat >>confdefs.h <<_ACEOF
60995#define SOCKS_IPV6_NOPROBE_LVL IPPROTO_IPV6
60996_ACEOF
60997
60998cat >>confdefs.h <<_ACEOF
60999#define SOCKS_IPV6_NOPROBE_NAME "ipv6_noprobe"
61000_ACEOF
61001    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
61002       #ipv4-only
61003
61004cat >>confdefs.h <<_ACEOF
61005#define SOCKS_IPV6_NOPROBE_IPV4 1
61006_ACEOF
61007
61008cat >>confdefs.h <<_ACEOF
61009#define SOCKS_IPV6_NOPROBE_IPV6 0
61010_ACEOF
61011    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
61012       #ipv6-only
61013
61014cat >>confdefs.h <<_ACEOF
61015#define SOCKS_IPV6_NOPROBE_IPV4 0
61016_ACEOF
61017
61018cat >>confdefs.h <<_ACEOF
61019#define SOCKS_IPV6_NOPROBE_IPV6 1
61020_ACEOF
61021    else
61022       #both ipv4 and ipv6
61023
61024cat >>confdefs.h <<_ACEOF
61025#define SOCKS_IPV6_NOPROBE_IPV4 1
61026_ACEOF
61027
61028cat >>confdefs.h <<_ACEOF
61029#define SOCKS_IPV6_NOPROBE_IPV6 1
61030_ACEOF
61031    fi
61032    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_NOPROBE"
61033  else
61034    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
61035$as_echo "no" >&6; }
61036  fi #not usable
61037unset _compileok
61038  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_PKTOPTIONS" >&5
61039$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_PKTOPTIONS... " >&6; }
61040  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61041/* end confdefs.h.  */
61042
61043#include <sys/types.h>
61044#include <sys/socket.h>
61045#include <netinet/in.h>
61046#include <netinet/tcp.h>
61047#include <netinet/udp.h>
61048
61049#include <stdio.h>
61050#include <stdlib.h>
61051#include <unistd.h>
61052
61053int
61054main ()
61055{
61056
61057   socklen_t optlen;
61058   int optval;
61059   int stype;
61060   int ptype;
61061   int s;
61062
61063   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61064      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61065      ptype = IPPROTO_TCP;
61066   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61067      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61068      ptype = IPPROTO_IP;
61069   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61070      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61071      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61072   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61073      stype = SOCK_DGRAM;
61074      ptype = IPPROTO_UDP;
61075   } else {
61076       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61077       exit(1);
61078   }
61079
61080   if((s = socket(PF_INET, stype, ptype)) < 0) {
61081      perror("socket");
61082      exit(1);
61083   }
61084
61085   optval = 1;
61086   optlen = sizeof(optval);
61087   if(setsockopt(s, IPPROTO_IPV6, IPV6_PKTOPTIONS, &optval, optlen) < 0) {
61088      perror("setsockopt: IPPROTO_IPV6 IPV6_PKTOPTIONS");
61089      close(s);
61090      exit(1);
61091   }
61092  ;
61093  return 0;
61094}
61095_ACEOF
61096if ac_fn_c_try_compile "$LINENO"; then :
61097  _compileok=1
61098fi
61099rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61100
61101  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61102/* end confdefs.h.  */
61103
61104#include <sys/types.h>
61105#include <sys/socket.h>
61106#include <netinet/in.h>
61107#include <netinet/tcp.h>
61108#include <netinet/udp.h>
61109
61110#include <stdio.h>
61111#include <stdlib.h>
61112#include <unistd.h>
61113
61114int
61115main ()
61116{
61117
61118   socklen_t optlen;
61119   int optval;
61120   int stype;
61121   int ptype;
61122   int s;
61123
61124   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61125      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61126      ptype = IPPROTO_TCP;
61127   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61128      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61129      ptype = IPPROTO_IP;
61130   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61131      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61132      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61133   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61134      stype = SOCK_DGRAM;
61135      ptype = IPPROTO_UDP;
61136   } else {
61137       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61138       exit(1);
61139   }
61140
61141   if((s = socket(PF_INET6, stype, ptype)) < 0) {
61142      perror("socket");
61143      exit(1);
61144   }
61145
61146   optval = 1;
61147   optlen = sizeof(optval);
61148   if(setsockopt(s, IPPROTO_IPV6, IPV6_PKTOPTIONS, &optval, optlen) < 0) {
61149      perror("setsockopt: IPPROTO_IPV6 IPV6_PKTOPTIONS");
61150      close(s);
61151      exit(1);
61152   }
61153  ;
61154  return 0;
61155}
61156_ACEOF
61157if ac_fn_c_try_compile "$LINENO"; then :
61158  _compileok=1
61159fi
61160rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61161
61162  if test x"${_compileok}" != x; then
61163    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
61164$as_echo "yes" >&6; }
61165
61166cat >>confdefs.h <<_ACEOF
61167#define HAVE_IPV6_PKTOPTIONS 1
61168_ACEOF
61169
61170cat >>confdefs.h <<_ACEOF
61171#define SOCKS_IPV6_PKTOPTIONS_LVL IPPROTO_IPV6
61172_ACEOF
61173
61174cat >>confdefs.h <<_ACEOF
61175#define SOCKS_IPV6_PKTOPTIONS_NAME "ipv6_pktoptions"
61176_ACEOF
61177    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
61178       #ipv4-only
61179
61180cat >>confdefs.h <<_ACEOF
61181#define SOCKS_IPV6_PKTOPTIONS_IPV4 1
61182_ACEOF
61183
61184cat >>confdefs.h <<_ACEOF
61185#define SOCKS_IPV6_PKTOPTIONS_IPV6 0
61186_ACEOF
61187    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
61188       #ipv6-only
61189
61190cat >>confdefs.h <<_ACEOF
61191#define SOCKS_IPV6_PKTOPTIONS_IPV4 0
61192_ACEOF
61193
61194cat >>confdefs.h <<_ACEOF
61195#define SOCKS_IPV6_PKTOPTIONS_IPV6 1
61196_ACEOF
61197    else
61198       #both ipv4 and ipv6
61199
61200cat >>confdefs.h <<_ACEOF
61201#define SOCKS_IPV6_PKTOPTIONS_IPV4 1
61202_ACEOF
61203
61204cat >>confdefs.h <<_ACEOF
61205#define SOCKS_IPV6_PKTOPTIONS_IPV6 1
61206_ACEOF
61207    fi
61208    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_PKTOPTIONS"
61209  else
61210    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
61211$as_echo "no" >&6; }
61212  fi #not usable
61213unset _compileok
61214  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVHOPS" >&5
61215$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVHOPS... " >&6; }
61216  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61217/* end confdefs.h.  */
61218
61219#include <sys/types.h>
61220#include <sys/socket.h>
61221#include <netinet/in.h>
61222#include <netinet/tcp.h>
61223#include <netinet/udp.h>
61224
61225#include <stdio.h>
61226#include <stdlib.h>
61227#include <unistd.h>
61228
61229int
61230main ()
61231{
61232
61233   socklen_t optlen;
61234   int optval;
61235   int stype;
61236   int ptype;
61237   int s;
61238
61239   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61240      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61241      ptype = IPPROTO_TCP;
61242   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61243      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61244      ptype = IPPROTO_IP;
61245   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61246      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61247      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61248   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61249      stype = SOCK_DGRAM;
61250      ptype = IPPROTO_UDP;
61251   } else {
61252       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61253       exit(1);
61254   }
61255
61256   if((s = socket(PF_INET, stype, ptype)) < 0) {
61257      perror("socket");
61258      exit(1);
61259   }
61260
61261   optval = 1;
61262   optlen = sizeof(optval);
61263   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPS, &optval, optlen) < 0) {
61264      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVHOPS");
61265      close(s);
61266      exit(1);
61267   }
61268  ;
61269  return 0;
61270}
61271_ACEOF
61272if ac_fn_c_try_compile "$LINENO"; then :
61273  _compileok=1
61274fi
61275rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61276
61277  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61278/* end confdefs.h.  */
61279
61280#include <sys/types.h>
61281#include <sys/socket.h>
61282#include <netinet/in.h>
61283#include <netinet/tcp.h>
61284#include <netinet/udp.h>
61285
61286#include <stdio.h>
61287#include <stdlib.h>
61288#include <unistd.h>
61289
61290int
61291main ()
61292{
61293
61294   socklen_t optlen;
61295   int optval;
61296   int stype;
61297   int ptype;
61298   int s;
61299
61300   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61301      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61302      ptype = IPPROTO_TCP;
61303   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61304      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61305      ptype = IPPROTO_IP;
61306   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61307      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61308      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61309   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61310      stype = SOCK_DGRAM;
61311      ptype = IPPROTO_UDP;
61312   } else {
61313       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61314       exit(1);
61315   }
61316
61317   if((s = socket(PF_INET6, stype, ptype)) < 0) {
61318      perror("socket");
61319      exit(1);
61320   }
61321
61322   optval = 1;
61323   optlen = sizeof(optval);
61324   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPS, &optval, optlen) < 0) {
61325      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVHOPS");
61326      close(s);
61327      exit(1);
61328   }
61329  ;
61330  return 0;
61331}
61332_ACEOF
61333if ac_fn_c_try_compile "$LINENO"; then :
61334  _compileok=1
61335fi
61336rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61337
61338  if test x"${_compileok}" != x; then
61339    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
61340$as_echo "yes" >&6; }
61341
61342cat >>confdefs.h <<_ACEOF
61343#define HAVE_IPV6_RECVHOPS 1
61344_ACEOF
61345
61346cat >>confdefs.h <<_ACEOF
61347#define SOCKS_IPV6_RECVHOPS_LVL IPPROTO_IPV6
61348_ACEOF
61349
61350cat >>confdefs.h <<_ACEOF
61351#define SOCKS_IPV6_RECVHOPS_NAME "ipv6_recvhops"
61352_ACEOF
61353    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
61354       #ipv4-only
61355
61356cat >>confdefs.h <<_ACEOF
61357#define SOCKS_IPV6_RECVHOPS_IPV4 1
61358_ACEOF
61359
61360cat >>confdefs.h <<_ACEOF
61361#define SOCKS_IPV6_RECVHOPS_IPV6 0
61362_ACEOF
61363    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
61364       #ipv6-only
61365
61366cat >>confdefs.h <<_ACEOF
61367#define SOCKS_IPV6_RECVHOPS_IPV4 0
61368_ACEOF
61369
61370cat >>confdefs.h <<_ACEOF
61371#define SOCKS_IPV6_RECVHOPS_IPV6 1
61372_ACEOF
61373    else
61374       #both ipv4 and ipv6
61375
61376cat >>confdefs.h <<_ACEOF
61377#define SOCKS_IPV6_RECVHOPS_IPV4 1
61378_ACEOF
61379
61380cat >>confdefs.h <<_ACEOF
61381#define SOCKS_IPV6_RECVHOPS_IPV6 1
61382_ACEOF
61383    fi
61384    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVHOPS"
61385  else
61386    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
61387$as_echo "no" >&6; }
61388  fi #not usable
61389unset _compileok
61390  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVIF" >&5
61391$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVIF... " >&6; }
61392  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61393/* end confdefs.h.  */
61394
61395#include <sys/types.h>
61396#include <sys/socket.h>
61397#include <netinet/in.h>
61398#include <netinet/tcp.h>
61399#include <netinet/udp.h>
61400
61401#include <stdio.h>
61402#include <stdlib.h>
61403#include <unistd.h>
61404
61405int
61406main ()
61407{
61408
61409   socklen_t optlen;
61410   int optval;
61411   int stype;
61412   int ptype;
61413   int s;
61414
61415   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61416      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61417      ptype = IPPROTO_TCP;
61418   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61419      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61420      ptype = IPPROTO_IP;
61421   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61422      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61423      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61424   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61425      stype = SOCK_DGRAM;
61426      ptype = IPPROTO_UDP;
61427   } else {
61428       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61429       exit(1);
61430   }
61431
61432   if((s = socket(PF_INET, stype, ptype)) < 0) {
61433      perror("socket");
61434      exit(1);
61435   }
61436
61437   optval = 1;
61438   optlen = sizeof(optval);
61439   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVIF, &optval, optlen) < 0) {
61440      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVIF");
61441      close(s);
61442      exit(1);
61443   }
61444  ;
61445  return 0;
61446}
61447_ACEOF
61448if ac_fn_c_try_compile "$LINENO"; then :
61449  _compileok=1
61450fi
61451rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61452
61453  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61454/* end confdefs.h.  */
61455
61456#include <sys/types.h>
61457#include <sys/socket.h>
61458#include <netinet/in.h>
61459#include <netinet/tcp.h>
61460#include <netinet/udp.h>
61461
61462#include <stdio.h>
61463#include <stdlib.h>
61464#include <unistd.h>
61465
61466int
61467main ()
61468{
61469
61470   socklen_t optlen;
61471   int optval;
61472   int stype;
61473   int ptype;
61474   int s;
61475
61476   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61477      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61478      ptype = IPPROTO_TCP;
61479   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61480      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61481      ptype = IPPROTO_IP;
61482   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61483      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61484      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61485   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61486      stype = SOCK_DGRAM;
61487      ptype = IPPROTO_UDP;
61488   } else {
61489       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61490       exit(1);
61491   }
61492
61493   if((s = socket(PF_INET6, stype, ptype)) < 0) {
61494      perror("socket");
61495      exit(1);
61496   }
61497
61498   optval = 1;
61499   optlen = sizeof(optval);
61500   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVIF, &optval, optlen) < 0) {
61501      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVIF");
61502      close(s);
61503      exit(1);
61504   }
61505  ;
61506  return 0;
61507}
61508_ACEOF
61509if ac_fn_c_try_compile "$LINENO"; then :
61510  _compileok=1
61511fi
61512rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61513
61514  if test x"${_compileok}" != x; then
61515    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
61516$as_echo "yes" >&6; }
61517
61518cat >>confdefs.h <<_ACEOF
61519#define HAVE_IPV6_RECVIF 1
61520_ACEOF
61521
61522cat >>confdefs.h <<_ACEOF
61523#define SOCKS_IPV6_RECVIF_LVL IPPROTO_IPV6
61524_ACEOF
61525
61526cat >>confdefs.h <<_ACEOF
61527#define SOCKS_IPV6_RECVIF_NAME "ipv6_recvif"
61528_ACEOF
61529    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
61530       #ipv4-only
61531
61532cat >>confdefs.h <<_ACEOF
61533#define SOCKS_IPV6_RECVIF_IPV4 1
61534_ACEOF
61535
61536cat >>confdefs.h <<_ACEOF
61537#define SOCKS_IPV6_RECVIF_IPV6 0
61538_ACEOF
61539    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
61540       #ipv6-only
61541
61542cat >>confdefs.h <<_ACEOF
61543#define SOCKS_IPV6_RECVIF_IPV4 0
61544_ACEOF
61545
61546cat >>confdefs.h <<_ACEOF
61547#define SOCKS_IPV6_RECVIF_IPV6 1
61548_ACEOF
61549    else
61550       #both ipv4 and ipv6
61551
61552cat >>confdefs.h <<_ACEOF
61553#define SOCKS_IPV6_RECVIF_IPV4 1
61554_ACEOF
61555
61556cat >>confdefs.h <<_ACEOF
61557#define SOCKS_IPV6_RECVIF_IPV6 1
61558_ACEOF
61559    fi
61560    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVIF"
61561  else
61562    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
61563$as_echo "no" >&6; }
61564  fi #not usable
61565unset _compileok
61566  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVSRCRT" >&5
61567$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVSRCRT... " >&6; }
61568  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61569/* end confdefs.h.  */
61570
61571#include <sys/types.h>
61572#include <sys/socket.h>
61573#include <netinet/in.h>
61574#include <netinet/tcp.h>
61575#include <netinet/udp.h>
61576
61577#include <stdio.h>
61578#include <stdlib.h>
61579#include <unistd.h>
61580
61581int
61582main ()
61583{
61584
61585   socklen_t optlen;
61586   int optval;
61587   int stype;
61588   int ptype;
61589   int s;
61590
61591   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61592      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61593      ptype = IPPROTO_TCP;
61594   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61595      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61596      ptype = IPPROTO_IP;
61597   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61598      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61599      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61600   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61601      stype = SOCK_DGRAM;
61602      ptype = IPPROTO_UDP;
61603   } else {
61604       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61605       exit(1);
61606   }
61607
61608   if((s = socket(PF_INET, stype, ptype)) < 0) {
61609      perror("socket");
61610      exit(1);
61611   }
61612
61613   optval = 1;
61614   optlen = sizeof(optval);
61615   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVSRCRT, &optval, optlen) < 0) {
61616      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVSRCRT");
61617      close(s);
61618      exit(1);
61619   }
61620  ;
61621  return 0;
61622}
61623_ACEOF
61624if ac_fn_c_try_compile "$LINENO"; then :
61625  _compileok=1
61626fi
61627rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61628
61629  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61630/* end confdefs.h.  */
61631
61632#include <sys/types.h>
61633#include <sys/socket.h>
61634#include <netinet/in.h>
61635#include <netinet/tcp.h>
61636#include <netinet/udp.h>
61637
61638#include <stdio.h>
61639#include <stdlib.h>
61640#include <unistd.h>
61641
61642int
61643main ()
61644{
61645
61646   socklen_t optlen;
61647   int optval;
61648   int stype;
61649   int ptype;
61650   int s;
61651
61652   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61653      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61654      ptype = IPPROTO_TCP;
61655   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61656      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61657      ptype = IPPROTO_IP;
61658   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61659      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61660      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61661   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61662      stype = SOCK_DGRAM;
61663      ptype = IPPROTO_UDP;
61664   } else {
61665       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61666       exit(1);
61667   }
61668
61669   if((s = socket(PF_INET6, stype, ptype)) < 0) {
61670      perror("socket");
61671      exit(1);
61672   }
61673
61674   optval = 1;
61675   optlen = sizeof(optval);
61676   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVSRCRT, &optval, optlen) < 0) {
61677      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVSRCRT");
61678      close(s);
61679      exit(1);
61680   }
61681  ;
61682  return 0;
61683}
61684_ACEOF
61685if ac_fn_c_try_compile "$LINENO"; then :
61686  _compileok=1
61687fi
61688rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61689
61690  if test x"${_compileok}" != x; then
61691    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
61692$as_echo "yes" >&6; }
61693
61694cat >>confdefs.h <<_ACEOF
61695#define HAVE_IPV6_RECVSRCRT 1
61696_ACEOF
61697
61698cat >>confdefs.h <<_ACEOF
61699#define SOCKS_IPV6_RECVSRCRT_LVL IPPROTO_IPV6
61700_ACEOF
61701
61702cat >>confdefs.h <<_ACEOF
61703#define SOCKS_IPV6_RECVSRCRT_NAME "ipv6_recvsrcrt"
61704_ACEOF
61705    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
61706       #ipv4-only
61707
61708cat >>confdefs.h <<_ACEOF
61709#define SOCKS_IPV6_RECVSRCRT_IPV4 1
61710_ACEOF
61711
61712cat >>confdefs.h <<_ACEOF
61713#define SOCKS_IPV6_RECVSRCRT_IPV6 0
61714_ACEOF
61715    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
61716       #ipv6-only
61717
61718cat >>confdefs.h <<_ACEOF
61719#define SOCKS_IPV6_RECVSRCRT_IPV4 0
61720_ACEOF
61721
61722cat >>confdefs.h <<_ACEOF
61723#define SOCKS_IPV6_RECVSRCRT_IPV6 1
61724_ACEOF
61725    else
61726       #both ipv4 and ipv6
61727
61728cat >>confdefs.h <<_ACEOF
61729#define SOCKS_IPV6_RECVSRCRT_IPV4 1
61730_ACEOF
61731
61732cat >>confdefs.h <<_ACEOF
61733#define SOCKS_IPV6_RECVSRCRT_IPV6 1
61734_ACEOF
61735    fi
61736    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVSRCRT"
61737  else
61738    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
61739$as_echo "no" >&6; }
61740  fi #not usable
61741unset _compileok
61742  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_SENDIF" >&5
61743$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_SENDIF... " >&6; }
61744  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61745/* end confdefs.h.  */
61746
61747#include <sys/types.h>
61748#include <sys/socket.h>
61749#include <netinet/in.h>
61750#include <netinet/tcp.h>
61751#include <netinet/udp.h>
61752
61753#include <stdio.h>
61754#include <stdlib.h>
61755#include <unistd.h>
61756
61757int
61758main ()
61759{
61760
61761   socklen_t optlen;
61762   int optval;
61763   int stype;
61764   int ptype;
61765   int s;
61766
61767   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61768      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61769      ptype = IPPROTO_TCP;
61770   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61771      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61772      ptype = IPPROTO_IP;
61773   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61774      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61775      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61776   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61777      stype = SOCK_DGRAM;
61778      ptype = IPPROTO_UDP;
61779   } else {
61780       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61781       exit(1);
61782   }
61783
61784   if((s = socket(PF_INET, stype, ptype)) < 0) {
61785      perror("socket");
61786      exit(1);
61787   }
61788
61789   optval = 1;
61790   optlen = sizeof(optval);
61791   if(setsockopt(s, IPPROTO_IPV6, IPV6_SENDIF, &optval, optlen) < 0) {
61792      perror("setsockopt: IPPROTO_IPV6 IPV6_SENDIF");
61793      close(s);
61794      exit(1);
61795   }
61796  ;
61797  return 0;
61798}
61799_ACEOF
61800if ac_fn_c_try_compile "$LINENO"; then :
61801  _compileok=1
61802fi
61803rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61804
61805  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61806/* end confdefs.h.  */
61807
61808#include <sys/types.h>
61809#include <sys/socket.h>
61810#include <netinet/in.h>
61811#include <netinet/tcp.h>
61812#include <netinet/udp.h>
61813
61814#include <stdio.h>
61815#include <stdlib.h>
61816#include <unistd.h>
61817
61818int
61819main ()
61820{
61821
61822   socklen_t optlen;
61823   int optval;
61824   int stype;
61825   int ptype;
61826   int s;
61827
61828   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61829      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61830      ptype = IPPROTO_TCP;
61831   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61832      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61833      ptype = IPPROTO_IP;
61834   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61835      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61836      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61837   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61838      stype = SOCK_DGRAM;
61839      ptype = IPPROTO_UDP;
61840   } else {
61841       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61842       exit(1);
61843   }
61844
61845   if((s = socket(PF_INET6, stype, ptype)) < 0) {
61846      perror("socket");
61847      exit(1);
61848   }
61849
61850   optval = 1;
61851   optlen = sizeof(optval);
61852   if(setsockopt(s, IPPROTO_IPV6, IPV6_SENDIF, &optval, optlen) < 0) {
61853      perror("setsockopt: IPPROTO_IPV6 IPV6_SENDIF");
61854      close(s);
61855      exit(1);
61856   }
61857  ;
61858  return 0;
61859}
61860_ACEOF
61861if ac_fn_c_try_compile "$LINENO"; then :
61862  _compileok=1
61863fi
61864rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61865
61866  if test x"${_compileok}" != x; then
61867    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
61868$as_echo "yes" >&6; }
61869
61870cat >>confdefs.h <<_ACEOF
61871#define HAVE_IPV6_SENDIF 1
61872_ACEOF
61873
61874cat >>confdefs.h <<_ACEOF
61875#define SOCKS_IPV6_SENDIF_LVL IPPROTO_IPV6
61876_ACEOF
61877
61878cat >>confdefs.h <<_ACEOF
61879#define SOCKS_IPV6_SENDIF_NAME "ipv6_sendif"
61880_ACEOF
61881    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
61882       #ipv4-only
61883
61884cat >>confdefs.h <<_ACEOF
61885#define SOCKS_IPV6_SENDIF_IPV4 1
61886_ACEOF
61887
61888cat >>confdefs.h <<_ACEOF
61889#define SOCKS_IPV6_SENDIF_IPV6 0
61890_ACEOF
61891    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
61892       #ipv6-only
61893
61894cat >>confdefs.h <<_ACEOF
61895#define SOCKS_IPV6_SENDIF_IPV4 0
61896_ACEOF
61897
61898cat >>confdefs.h <<_ACEOF
61899#define SOCKS_IPV6_SENDIF_IPV6 1
61900_ACEOF
61901    else
61902       #both ipv4 and ipv6
61903
61904cat >>confdefs.h <<_ACEOF
61905#define SOCKS_IPV6_SENDIF_IPV4 1
61906_ACEOF
61907
61908cat >>confdefs.h <<_ACEOF
61909#define SOCKS_IPV6_SENDIF_IPV6 1
61910_ACEOF
61911    fi
61912    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_SENDIF"
61913  else
61914    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
61915$as_echo "no" >&6; }
61916  fi #not usable
61917unset _compileok
61918  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_ADD_MEMBERSHIP" >&5
61919$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_ADD_MEMBERSHIP... " >&6; }
61920  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61921/* end confdefs.h.  */
61922
61923#include <sys/types.h>
61924#include <sys/socket.h>
61925#include <netinet/in.h>
61926#include <netinet/tcp.h>
61927#include <netinet/udp.h>
61928
61929#include <stdio.h>
61930#include <stdlib.h>
61931#include <unistd.h>
61932
61933int
61934main ()
61935{
61936
61937   socklen_t optlen;
61938   int optval;
61939   int stype;
61940   int ptype;
61941   int s;
61942
61943   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
61944      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
61945      ptype = IPPROTO_TCP;
61946   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
61947      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
61948      ptype = IPPROTO_IP;
61949   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
61950      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
61951      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
61952   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
61953      stype = SOCK_DGRAM;
61954      ptype = IPPROTO_UDP;
61955   } else {
61956       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
61957       exit(1);
61958   }
61959
61960   if((s = socket(PF_INET, stype, ptype)) < 0) {
61961      perror("socket");
61962      exit(1);
61963   }
61964
61965   optval = 1;
61966   optlen = sizeof(optval);
61967   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &optval, optlen) < 0) {
61968      perror("setsockopt: IPPROTO_IPV6 IPV6_ADD_MEMBERSHIP");
61969      close(s);
61970      exit(1);
61971   }
61972  ;
61973  return 0;
61974}
61975_ACEOF
61976if ac_fn_c_try_compile "$LINENO"; then :
61977  _compileok=1
61978fi
61979rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
61980
61981  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
61982/* end confdefs.h.  */
61983
61984#include <sys/types.h>
61985#include <sys/socket.h>
61986#include <netinet/in.h>
61987#include <netinet/tcp.h>
61988#include <netinet/udp.h>
61989
61990#include <stdio.h>
61991#include <stdlib.h>
61992#include <unistd.h>
61993
61994int
61995main ()
61996{
61997
61998   socklen_t optlen;
61999   int optval;
62000   int stype;
62001   int ptype;
62002   int s;
62003
62004   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62005      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62006      ptype = IPPROTO_TCP;
62007   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62008      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62009      ptype = IPPROTO_IP;
62010   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62011      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62012      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62013   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62014      stype = SOCK_DGRAM;
62015      ptype = IPPROTO_UDP;
62016   } else {
62017       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62018       exit(1);
62019   }
62020
62021   if((s = socket(PF_INET6, stype, ptype)) < 0) {
62022      perror("socket");
62023      exit(1);
62024   }
62025
62026   optval = 1;
62027   optlen = sizeof(optval);
62028   if(setsockopt(s, IPPROTO_IPV6, IPV6_ADD_MEMBERSHIP, &optval, optlen) < 0) {
62029      perror("setsockopt: IPPROTO_IPV6 IPV6_ADD_MEMBERSHIP");
62030      close(s);
62031      exit(1);
62032   }
62033  ;
62034  return 0;
62035}
62036_ACEOF
62037if ac_fn_c_try_compile "$LINENO"; then :
62038  _compileok=1
62039fi
62040rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62041
62042  if test x"${_compileok}" != x; then
62043    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
62044$as_echo "yes" >&6; }
62045
62046cat >>confdefs.h <<_ACEOF
62047#define HAVE_IPV6_ADD_MEMBERSHIP 1
62048_ACEOF
62049
62050cat >>confdefs.h <<_ACEOF
62051#define SOCKS_IPV6_ADD_MEMBERSHIP_LVL IPPROTO_IPV6
62052_ACEOF
62053
62054cat >>confdefs.h <<_ACEOF
62055#define SOCKS_IPV6_ADD_MEMBERSHIP_NAME "ipv6_add_membership"
62056_ACEOF
62057    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
62058       #ipv4-only
62059
62060cat >>confdefs.h <<_ACEOF
62061#define SOCKS_IPV6_ADD_MEMBERSHIP_IPV4 1
62062_ACEOF
62063
62064cat >>confdefs.h <<_ACEOF
62065#define SOCKS_IPV6_ADD_MEMBERSHIP_IPV6 0
62066_ACEOF
62067    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
62068       #ipv6-only
62069
62070cat >>confdefs.h <<_ACEOF
62071#define SOCKS_IPV6_ADD_MEMBERSHIP_IPV4 0
62072_ACEOF
62073
62074cat >>confdefs.h <<_ACEOF
62075#define SOCKS_IPV6_ADD_MEMBERSHIP_IPV6 1
62076_ACEOF
62077    else
62078       #both ipv4 and ipv6
62079
62080cat >>confdefs.h <<_ACEOF
62081#define SOCKS_IPV6_ADD_MEMBERSHIP_IPV4 1
62082_ACEOF
62083
62084cat >>confdefs.h <<_ACEOF
62085#define SOCKS_IPV6_ADD_MEMBERSHIP_IPV6 1
62086_ACEOF
62087    fi
62088    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_ADD_MEMBERSHIP"
62089  else
62090    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
62091$as_echo "no" >&6; }
62092  fi
62093unset _compileok
62094  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_DROP_MEMBERSHIP" >&5
62095$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_DROP_MEMBERSHIP... " >&6; }
62096  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62097/* end confdefs.h.  */
62098
62099#include <sys/types.h>
62100#include <sys/socket.h>
62101#include <netinet/in.h>
62102#include <netinet/tcp.h>
62103#include <netinet/udp.h>
62104
62105#include <stdio.h>
62106#include <stdlib.h>
62107#include <unistd.h>
62108
62109int
62110main ()
62111{
62112
62113   socklen_t optlen;
62114   int optval;
62115   int stype;
62116   int ptype;
62117   int s;
62118
62119   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62120      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62121      ptype = IPPROTO_TCP;
62122   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62123      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62124      ptype = IPPROTO_IP;
62125   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62126      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62127      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62128   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62129      stype = SOCK_DGRAM;
62130      ptype = IPPROTO_UDP;
62131   } else {
62132       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62133       exit(1);
62134   }
62135
62136   if((s = socket(PF_INET, stype, ptype)) < 0) {
62137      perror("socket");
62138      exit(1);
62139   }
62140
62141   optval = 1;
62142   optlen = sizeof(optval);
62143   if(setsockopt(s, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, &optval, optlen) < 0) {
62144      perror("setsockopt: IPPROTO_IPV6 IPV6_DROP_MEMBERSHIP");
62145      close(s);
62146      exit(1);
62147   }
62148  ;
62149  return 0;
62150}
62151_ACEOF
62152if ac_fn_c_try_compile "$LINENO"; then :
62153  _compileok=1
62154fi
62155rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62156
62157  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62158/* end confdefs.h.  */
62159
62160#include <sys/types.h>
62161#include <sys/socket.h>
62162#include <netinet/in.h>
62163#include <netinet/tcp.h>
62164#include <netinet/udp.h>
62165
62166#include <stdio.h>
62167#include <stdlib.h>
62168#include <unistd.h>
62169
62170int
62171main ()
62172{
62173
62174   socklen_t optlen;
62175   int optval;
62176   int stype;
62177   int ptype;
62178   int s;
62179
62180   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62181      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62182      ptype = IPPROTO_TCP;
62183   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62184      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62185      ptype = IPPROTO_IP;
62186   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62187      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62188      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62189   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62190      stype = SOCK_DGRAM;
62191      ptype = IPPROTO_UDP;
62192   } else {
62193       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62194       exit(1);
62195   }
62196
62197   if((s = socket(PF_INET6, stype, ptype)) < 0) {
62198      perror("socket");
62199      exit(1);
62200   }
62201
62202   optval = 1;
62203   optlen = sizeof(optval);
62204   if(setsockopt(s, IPPROTO_IPV6, IPV6_DROP_MEMBERSHIP, &optval, optlen) < 0) {
62205      perror("setsockopt: IPPROTO_IPV6 IPV6_DROP_MEMBERSHIP");
62206      close(s);
62207      exit(1);
62208   }
62209  ;
62210  return 0;
62211}
62212_ACEOF
62213if ac_fn_c_try_compile "$LINENO"; then :
62214  _compileok=1
62215fi
62216rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62217
62218  if test x"${_compileok}" != x; then
62219    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
62220$as_echo "yes" >&6; }
62221
62222cat >>confdefs.h <<_ACEOF
62223#define HAVE_IPV6_DROP_MEMBERSHIP 1
62224_ACEOF
62225
62226cat >>confdefs.h <<_ACEOF
62227#define SOCKS_IPV6_DROP_MEMBERSHIP_LVL IPPROTO_IPV6
62228_ACEOF
62229
62230cat >>confdefs.h <<_ACEOF
62231#define SOCKS_IPV6_DROP_MEMBERSHIP_NAME "ipv6_drop_membership"
62232_ACEOF
62233    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
62234       #ipv4-only
62235
62236cat >>confdefs.h <<_ACEOF
62237#define SOCKS_IPV6_DROP_MEMBERSHIP_IPV4 1
62238_ACEOF
62239
62240cat >>confdefs.h <<_ACEOF
62241#define SOCKS_IPV6_DROP_MEMBERSHIP_IPV6 0
62242_ACEOF
62243    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
62244       #ipv6-only
62245
62246cat >>confdefs.h <<_ACEOF
62247#define SOCKS_IPV6_DROP_MEMBERSHIP_IPV4 0
62248_ACEOF
62249
62250cat >>confdefs.h <<_ACEOF
62251#define SOCKS_IPV6_DROP_MEMBERSHIP_IPV6 1
62252_ACEOF
62253    else
62254       #both ipv4 and ipv6
62255
62256cat >>confdefs.h <<_ACEOF
62257#define SOCKS_IPV6_DROP_MEMBERSHIP_IPV4 1
62258_ACEOF
62259
62260cat >>confdefs.h <<_ACEOF
62261#define SOCKS_IPV6_DROP_MEMBERSHIP_IPV6 1
62262_ACEOF
62263    fi
62264    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_DROP_MEMBERSHIP"
62265  else
62266    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
62267$as_echo "no" >&6; }
62268  fi
62269unset _compileok
62270  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVDSTADDR" >&5
62271$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVDSTADDR... " >&6; }
62272  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62273/* end confdefs.h.  */
62274
62275#include <sys/types.h>
62276#include <sys/socket.h>
62277#include <netinet/in.h>
62278#include <netinet/tcp.h>
62279#include <netinet/udp.h>
62280
62281#include <stdio.h>
62282#include <stdlib.h>
62283#include <unistd.h>
62284
62285int
62286main ()
62287{
62288
62289   socklen_t optlen;
62290   int optval;
62291   int stype;
62292   int ptype;
62293   int s;
62294
62295   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62296      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62297      ptype = IPPROTO_TCP;
62298   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62299      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62300      ptype = IPPROTO_IP;
62301   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62302      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62303      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62304   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62305      stype = SOCK_DGRAM;
62306      ptype = IPPROTO_UDP;
62307   } else {
62308       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62309       exit(1);
62310   }
62311
62312   if((s = socket(PF_INET, stype, ptype)) < 0) {
62313      perror("socket");
62314      exit(1);
62315   }
62316
62317   optval = 1;
62318   optlen = sizeof(optval);
62319   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVDSTADDR, &optval, optlen) < 0) {
62320      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVDSTADDR");
62321      close(s);
62322      exit(1);
62323   }
62324  ;
62325  return 0;
62326}
62327_ACEOF
62328if ac_fn_c_try_compile "$LINENO"; then :
62329  _compileok=1
62330fi
62331rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62332
62333  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62334/* end confdefs.h.  */
62335
62336#include <sys/types.h>
62337#include <sys/socket.h>
62338#include <netinet/in.h>
62339#include <netinet/tcp.h>
62340#include <netinet/udp.h>
62341
62342#include <stdio.h>
62343#include <stdlib.h>
62344#include <unistd.h>
62345
62346int
62347main ()
62348{
62349
62350   socklen_t optlen;
62351   int optval;
62352   int stype;
62353   int ptype;
62354   int s;
62355
62356   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62357      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62358      ptype = IPPROTO_TCP;
62359   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62360      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62361      ptype = IPPROTO_IP;
62362   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62363      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62364      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62365   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62366      stype = SOCK_DGRAM;
62367      ptype = IPPROTO_UDP;
62368   } else {
62369       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62370       exit(1);
62371   }
62372
62373   if((s = socket(PF_INET6, stype, ptype)) < 0) {
62374      perror("socket");
62375      exit(1);
62376   }
62377
62378   optval = 1;
62379   optlen = sizeof(optval);
62380   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVDSTADDR, &optval, optlen) < 0) {
62381      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVDSTADDR");
62382      close(s);
62383      exit(1);
62384   }
62385  ;
62386  return 0;
62387}
62388_ACEOF
62389if ac_fn_c_try_compile "$LINENO"; then :
62390  _compileok=1
62391fi
62392rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62393
62394  if test x"${_compileok}" != x; then
62395    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
62396$as_echo "yes" >&6; }
62397
62398cat >>confdefs.h <<_ACEOF
62399#define HAVE_IPV6_RECVDSTADDR 1
62400_ACEOF
62401
62402cat >>confdefs.h <<_ACEOF
62403#define SOCKS_IPV6_RECVDSTADDR_LVL IPPROTO_IPV6
62404_ACEOF
62405
62406cat >>confdefs.h <<_ACEOF
62407#define SOCKS_IPV6_RECVDSTADDR_NAME "ipv6_recvdstaddr"
62408_ACEOF
62409    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
62410       #ipv4-only
62411
62412cat >>confdefs.h <<_ACEOF
62413#define SOCKS_IPV6_RECVDSTADDR_IPV4 1
62414_ACEOF
62415
62416cat >>confdefs.h <<_ACEOF
62417#define SOCKS_IPV6_RECVDSTADDR_IPV6 0
62418_ACEOF
62419    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
62420       #ipv6-only
62421
62422cat >>confdefs.h <<_ACEOF
62423#define SOCKS_IPV6_RECVDSTADDR_IPV4 0
62424_ACEOF
62425
62426cat >>confdefs.h <<_ACEOF
62427#define SOCKS_IPV6_RECVDSTADDR_IPV6 1
62428_ACEOF
62429    else
62430       #both ipv4 and ipv6
62431
62432cat >>confdefs.h <<_ACEOF
62433#define SOCKS_IPV6_RECVDSTADDR_IPV4 1
62434_ACEOF
62435
62436cat >>confdefs.h <<_ACEOF
62437#define SOCKS_IPV6_RECVDSTADDR_IPV6 1
62438_ACEOF
62439    fi
62440    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVDSTADDR"
62441  else
62442    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
62443$as_echo "no" >&6; }
62444  fi
62445unset _compileok
62446  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVDSTOPTS" >&5
62447$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVDSTOPTS... " >&6; }
62448  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62449/* end confdefs.h.  */
62450
62451#include <sys/types.h>
62452#include <sys/socket.h>
62453#include <netinet/in.h>
62454#include <netinet/tcp.h>
62455#include <netinet/udp.h>
62456
62457#include <stdio.h>
62458#include <stdlib.h>
62459#include <unistd.h>
62460
62461int
62462main ()
62463{
62464
62465   socklen_t optlen;
62466   int optval;
62467   int stype;
62468   int ptype;
62469   int s;
62470
62471   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62472      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62473      ptype = IPPROTO_TCP;
62474   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62475      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62476      ptype = IPPROTO_IP;
62477   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62478      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62479      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62480   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62481      stype = SOCK_DGRAM;
62482      ptype = IPPROTO_UDP;
62483   } else {
62484       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62485       exit(1);
62486   }
62487
62488   if((s = socket(PF_INET, stype, ptype)) < 0) {
62489      perror("socket");
62490      exit(1);
62491   }
62492
62493   optval = 1;
62494   optlen = sizeof(optval);
62495   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVDSTOPTS, &optval, optlen) < 0) {
62496      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVDSTOPTS");
62497      close(s);
62498      exit(1);
62499   }
62500  ;
62501  return 0;
62502}
62503_ACEOF
62504if ac_fn_c_try_compile "$LINENO"; then :
62505  _compileok=1
62506fi
62507rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62508
62509  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62510/* end confdefs.h.  */
62511
62512#include <sys/types.h>
62513#include <sys/socket.h>
62514#include <netinet/in.h>
62515#include <netinet/tcp.h>
62516#include <netinet/udp.h>
62517
62518#include <stdio.h>
62519#include <stdlib.h>
62520#include <unistd.h>
62521
62522int
62523main ()
62524{
62525
62526   socklen_t optlen;
62527   int optval;
62528   int stype;
62529   int ptype;
62530   int s;
62531
62532   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62533      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62534      ptype = IPPROTO_TCP;
62535   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62536      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62537      ptype = IPPROTO_IP;
62538   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62539      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62540      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62541   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62542      stype = SOCK_DGRAM;
62543      ptype = IPPROTO_UDP;
62544   } else {
62545       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62546       exit(1);
62547   }
62548
62549   if((s = socket(PF_INET6, stype, ptype)) < 0) {
62550      perror("socket");
62551      exit(1);
62552   }
62553
62554   optval = 1;
62555   optlen = sizeof(optval);
62556   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVDSTOPTS, &optval, optlen) < 0) {
62557      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVDSTOPTS");
62558      close(s);
62559      exit(1);
62560   }
62561  ;
62562  return 0;
62563}
62564_ACEOF
62565if ac_fn_c_try_compile "$LINENO"; then :
62566  _compileok=1
62567fi
62568rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62569
62570  if test x"${_compileok}" != x; then
62571    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
62572$as_echo "yes" >&6; }
62573
62574cat >>confdefs.h <<_ACEOF
62575#define HAVE_IPV6_RECVDSTOPTS 1
62576_ACEOF
62577
62578cat >>confdefs.h <<_ACEOF
62579#define SOCKS_IPV6_RECVDSTOPTS_LVL IPPROTO_IPV6
62580_ACEOF
62581
62582cat >>confdefs.h <<_ACEOF
62583#define SOCKS_IPV6_RECVDSTOPTS_NAME "ipv6_recvdstopts"
62584_ACEOF
62585    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
62586       #ipv4-only
62587
62588cat >>confdefs.h <<_ACEOF
62589#define SOCKS_IPV6_RECVDSTOPTS_IPV4 1
62590_ACEOF
62591
62592cat >>confdefs.h <<_ACEOF
62593#define SOCKS_IPV6_RECVDSTOPTS_IPV6 0
62594_ACEOF
62595    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
62596       #ipv6-only
62597
62598cat >>confdefs.h <<_ACEOF
62599#define SOCKS_IPV6_RECVDSTOPTS_IPV4 0
62600_ACEOF
62601
62602cat >>confdefs.h <<_ACEOF
62603#define SOCKS_IPV6_RECVDSTOPTS_IPV6 1
62604_ACEOF
62605    else
62606       #both ipv4 and ipv6
62607
62608cat >>confdefs.h <<_ACEOF
62609#define SOCKS_IPV6_RECVDSTOPTS_IPV4 1
62610_ACEOF
62611
62612cat >>confdefs.h <<_ACEOF
62613#define SOCKS_IPV6_RECVDSTOPTS_IPV6 1
62614_ACEOF
62615    fi
62616    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVDSTOPTS"
62617  else
62618    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
62619$as_echo "no" >&6; }
62620  fi
62621unset _compileok
62622  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVERR" >&5
62623$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVERR... " >&6; }
62624  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62625/* end confdefs.h.  */
62626
62627#include <sys/types.h>
62628#include <sys/socket.h>
62629#include <netinet/in.h>
62630#include <netinet/tcp.h>
62631#include <netinet/udp.h>
62632
62633#include <stdio.h>
62634#include <stdlib.h>
62635#include <unistd.h>
62636
62637int
62638main ()
62639{
62640
62641   socklen_t optlen;
62642   int optval;
62643   int stype;
62644   int ptype;
62645   int s;
62646
62647   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62648      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62649      ptype = IPPROTO_TCP;
62650   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62651      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62652      ptype = IPPROTO_IP;
62653   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62654      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62655      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62656   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62657      stype = SOCK_DGRAM;
62658      ptype = IPPROTO_UDP;
62659   } else {
62660       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62661       exit(1);
62662   }
62663
62664   if((s = socket(PF_INET, stype, ptype)) < 0) {
62665      perror("socket");
62666      exit(1);
62667   }
62668
62669   optval = 1;
62670   optlen = sizeof(optval);
62671   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVERR, &optval, optlen) < 0) {
62672      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVERR");
62673      close(s);
62674      exit(1);
62675   }
62676  ;
62677  return 0;
62678}
62679_ACEOF
62680if ac_fn_c_try_compile "$LINENO"; then :
62681  _compileok=1
62682fi
62683rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62684
62685  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62686/* end confdefs.h.  */
62687
62688#include <sys/types.h>
62689#include <sys/socket.h>
62690#include <netinet/in.h>
62691#include <netinet/tcp.h>
62692#include <netinet/udp.h>
62693
62694#include <stdio.h>
62695#include <stdlib.h>
62696#include <unistd.h>
62697
62698int
62699main ()
62700{
62701
62702   socklen_t optlen;
62703   int optval;
62704   int stype;
62705   int ptype;
62706   int s;
62707
62708   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62709      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62710      ptype = IPPROTO_TCP;
62711   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62712      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62713      ptype = IPPROTO_IP;
62714   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62715      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62716      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62717   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62718      stype = SOCK_DGRAM;
62719      ptype = IPPROTO_UDP;
62720   } else {
62721       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62722       exit(1);
62723   }
62724
62725   if((s = socket(PF_INET6, stype, ptype)) < 0) {
62726      perror("socket");
62727      exit(1);
62728   }
62729
62730   optval = 1;
62731   optlen = sizeof(optval);
62732   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVERR, &optval, optlen) < 0) {
62733      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVERR");
62734      close(s);
62735      exit(1);
62736   }
62737  ;
62738  return 0;
62739}
62740_ACEOF
62741if ac_fn_c_try_compile "$LINENO"; then :
62742  _compileok=1
62743fi
62744rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62745
62746  if test x"${_compileok}" != x; then
62747    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
62748$as_echo "yes" >&6; }
62749
62750cat >>confdefs.h <<_ACEOF
62751#define HAVE_IPV6_RECVERR 1
62752_ACEOF
62753
62754cat >>confdefs.h <<_ACEOF
62755#define SOCKS_IPV6_RECVERR_LVL IPPROTO_IPV6
62756_ACEOF
62757
62758cat >>confdefs.h <<_ACEOF
62759#define SOCKS_IPV6_RECVERR_NAME "ipv6_recverr"
62760_ACEOF
62761    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
62762       #ipv4-only
62763
62764cat >>confdefs.h <<_ACEOF
62765#define SOCKS_IPV6_RECVERR_IPV4 1
62766_ACEOF
62767
62768cat >>confdefs.h <<_ACEOF
62769#define SOCKS_IPV6_RECVERR_IPV6 0
62770_ACEOF
62771    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
62772       #ipv6-only
62773
62774cat >>confdefs.h <<_ACEOF
62775#define SOCKS_IPV6_RECVERR_IPV4 0
62776_ACEOF
62777
62778cat >>confdefs.h <<_ACEOF
62779#define SOCKS_IPV6_RECVERR_IPV6 1
62780_ACEOF
62781    else
62782       #both ipv4 and ipv6
62783
62784cat >>confdefs.h <<_ACEOF
62785#define SOCKS_IPV6_RECVERR_IPV4 1
62786_ACEOF
62787
62788cat >>confdefs.h <<_ACEOF
62789#define SOCKS_IPV6_RECVERR_IPV6 1
62790_ACEOF
62791    fi
62792    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVERR"
62793  else
62794    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
62795$as_echo "no" >&6; }
62796  fi
62797unset _compileok
62798  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVHOPLIMIT" >&5
62799$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVHOPLIMIT... " >&6; }
62800  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62801/* end confdefs.h.  */
62802
62803#include <sys/types.h>
62804#include <sys/socket.h>
62805#include <netinet/in.h>
62806#include <netinet/tcp.h>
62807#include <netinet/udp.h>
62808
62809#include <stdio.h>
62810#include <stdlib.h>
62811#include <unistd.h>
62812
62813int
62814main ()
62815{
62816
62817   socklen_t optlen;
62818   int optval;
62819   int stype;
62820   int ptype;
62821   int s;
62822
62823   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62824      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62825      ptype = IPPROTO_TCP;
62826   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62827      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62828      ptype = IPPROTO_IP;
62829   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62830      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62831      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62832   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62833      stype = SOCK_DGRAM;
62834      ptype = IPPROTO_UDP;
62835   } else {
62836       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62837       exit(1);
62838   }
62839
62840   if((s = socket(PF_INET, stype, ptype)) < 0) {
62841      perror("socket");
62842      exit(1);
62843   }
62844
62845   optval = 1;
62846   optlen = sizeof(optval);
62847   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &optval, optlen) < 0) {
62848      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVHOPLIMIT");
62849      close(s);
62850      exit(1);
62851   }
62852  ;
62853  return 0;
62854}
62855_ACEOF
62856if ac_fn_c_try_compile "$LINENO"; then :
62857  _compileok=1
62858fi
62859rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62860
62861  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62862/* end confdefs.h.  */
62863
62864#include <sys/types.h>
62865#include <sys/socket.h>
62866#include <netinet/in.h>
62867#include <netinet/tcp.h>
62868#include <netinet/udp.h>
62869
62870#include <stdio.h>
62871#include <stdlib.h>
62872#include <unistd.h>
62873
62874int
62875main ()
62876{
62877
62878   socklen_t optlen;
62879   int optval;
62880   int stype;
62881   int ptype;
62882   int s;
62883
62884   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
62885      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
62886      ptype = IPPROTO_TCP;
62887   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
62888      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
62889      ptype = IPPROTO_IP;
62890   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
62891      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
62892      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
62893   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
62894      stype = SOCK_DGRAM;
62895      ptype = IPPROTO_UDP;
62896   } else {
62897       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
62898       exit(1);
62899   }
62900
62901   if((s = socket(PF_INET6, stype, ptype)) < 0) {
62902      perror("socket");
62903      exit(1);
62904   }
62905
62906   optval = 1;
62907   optlen = sizeof(optval);
62908   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &optval, optlen) < 0) {
62909      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVHOPLIMIT");
62910      close(s);
62911      exit(1);
62912   }
62913  ;
62914  return 0;
62915}
62916_ACEOF
62917if ac_fn_c_try_compile "$LINENO"; then :
62918  _compileok=1
62919fi
62920rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
62921
62922  if test x"${_compileok}" != x; then
62923    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
62924$as_echo "yes" >&6; }
62925
62926cat >>confdefs.h <<_ACEOF
62927#define HAVE_IPV6_RECVHOPLIMIT 1
62928_ACEOF
62929
62930cat >>confdefs.h <<_ACEOF
62931#define SOCKS_IPV6_RECVHOPLIMIT_LVL IPPROTO_IPV6
62932_ACEOF
62933
62934cat >>confdefs.h <<_ACEOF
62935#define SOCKS_IPV6_RECVHOPLIMIT_NAME "ipv6_recvhoplimit"
62936_ACEOF
62937    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
62938       #ipv4-only
62939
62940cat >>confdefs.h <<_ACEOF
62941#define SOCKS_IPV6_RECVHOPLIMIT_IPV4 1
62942_ACEOF
62943
62944cat >>confdefs.h <<_ACEOF
62945#define SOCKS_IPV6_RECVHOPLIMIT_IPV6 0
62946_ACEOF
62947    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
62948       #ipv6-only
62949
62950cat >>confdefs.h <<_ACEOF
62951#define SOCKS_IPV6_RECVHOPLIMIT_IPV4 0
62952_ACEOF
62953
62954cat >>confdefs.h <<_ACEOF
62955#define SOCKS_IPV6_RECVHOPLIMIT_IPV6 1
62956_ACEOF
62957    else
62958       #both ipv4 and ipv6
62959
62960cat >>confdefs.h <<_ACEOF
62961#define SOCKS_IPV6_RECVHOPLIMIT_IPV4 1
62962_ACEOF
62963
62964cat >>confdefs.h <<_ACEOF
62965#define SOCKS_IPV6_RECVHOPLIMIT_IPV6 1
62966_ACEOF
62967    fi
62968    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVHOPLIMIT"
62969  else
62970    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
62971$as_echo "no" >&6; }
62972  fi
62973unset _compileok
62974  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVHOPOPTS" >&5
62975$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVHOPOPTS... " >&6; }
62976  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
62977/* end confdefs.h.  */
62978
62979#include <sys/types.h>
62980#include <sys/socket.h>
62981#include <netinet/in.h>
62982#include <netinet/tcp.h>
62983#include <netinet/udp.h>
62984
62985#include <stdio.h>
62986#include <stdlib.h>
62987#include <unistd.h>
62988
62989int
62990main ()
62991{
62992
62993   socklen_t optlen;
62994   int optval;
62995   int stype;
62996   int ptype;
62997   int s;
62998
62999   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63000      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63001      ptype = IPPROTO_TCP;
63002   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63003      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63004      ptype = IPPROTO_IP;
63005   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63006      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63007      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63008   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63009      stype = SOCK_DGRAM;
63010      ptype = IPPROTO_UDP;
63011   } else {
63012       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63013       exit(1);
63014   }
63015
63016   if((s = socket(PF_INET, stype, ptype)) < 0) {
63017      perror("socket");
63018      exit(1);
63019   }
63020
63021   optval = 1;
63022   optlen = sizeof(optval);
63023   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPOPTS, &optval, optlen) < 0) {
63024      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVHOPOPTS");
63025      close(s);
63026      exit(1);
63027   }
63028  ;
63029  return 0;
63030}
63031_ACEOF
63032if ac_fn_c_try_compile "$LINENO"; then :
63033  _compileok=1
63034fi
63035rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63036
63037  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63038/* end confdefs.h.  */
63039
63040#include <sys/types.h>
63041#include <sys/socket.h>
63042#include <netinet/in.h>
63043#include <netinet/tcp.h>
63044#include <netinet/udp.h>
63045
63046#include <stdio.h>
63047#include <stdlib.h>
63048#include <unistd.h>
63049
63050int
63051main ()
63052{
63053
63054   socklen_t optlen;
63055   int optval;
63056   int stype;
63057   int ptype;
63058   int s;
63059
63060   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63061      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63062      ptype = IPPROTO_TCP;
63063   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63064      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63065      ptype = IPPROTO_IP;
63066   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63067      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63068      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63069   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63070      stype = SOCK_DGRAM;
63071      ptype = IPPROTO_UDP;
63072   } else {
63073       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63074       exit(1);
63075   }
63076
63077   if((s = socket(PF_INET6, stype, ptype)) < 0) {
63078      perror("socket");
63079      exit(1);
63080   }
63081
63082   optval = 1;
63083   optlen = sizeof(optval);
63084   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVHOPOPTS, &optval, optlen) < 0) {
63085      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVHOPOPTS");
63086      close(s);
63087      exit(1);
63088   }
63089  ;
63090  return 0;
63091}
63092_ACEOF
63093if ac_fn_c_try_compile "$LINENO"; then :
63094  _compileok=1
63095fi
63096rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63097
63098  if test x"${_compileok}" != x; then
63099    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
63100$as_echo "yes" >&6; }
63101
63102cat >>confdefs.h <<_ACEOF
63103#define HAVE_IPV6_RECVHOPOPTS 1
63104_ACEOF
63105
63106cat >>confdefs.h <<_ACEOF
63107#define SOCKS_IPV6_RECVHOPOPTS_LVL IPPROTO_IPV6
63108_ACEOF
63109
63110cat >>confdefs.h <<_ACEOF
63111#define SOCKS_IPV6_RECVHOPOPTS_NAME "ipv6_recvhopopts"
63112_ACEOF
63113    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
63114       #ipv4-only
63115
63116cat >>confdefs.h <<_ACEOF
63117#define SOCKS_IPV6_RECVHOPOPTS_IPV4 1
63118_ACEOF
63119
63120cat >>confdefs.h <<_ACEOF
63121#define SOCKS_IPV6_RECVHOPOPTS_IPV6 0
63122_ACEOF
63123    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
63124       #ipv6-only
63125
63126cat >>confdefs.h <<_ACEOF
63127#define SOCKS_IPV6_RECVHOPOPTS_IPV4 0
63128_ACEOF
63129
63130cat >>confdefs.h <<_ACEOF
63131#define SOCKS_IPV6_RECVHOPOPTS_IPV6 1
63132_ACEOF
63133    else
63134       #both ipv4 and ipv6
63135
63136cat >>confdefs.h <<_ACEOF
63137#define SOCKS_IPV6_RECVHOPOPTS_IPV4 1
63138_ACEOF
63139
63140cat >>confdefs.h <<_ACEOF
63141#define SOCKS_IPV6_RECVHOPOPTS_IPV6 1
63142_ACEOF
63143    fi
63144    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVHOPOPTS"
63145  else
63146    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
63147$as_echo "no" >&6; }
63148  fi
63149unset _compileok
63150  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVOPTS" >&5
63151$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVOPTS... " >&6; }
63152  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63153/* end confdefs.h.  */
63154
63155#include <sys/types.h>
63156#include <sys/socket.h>
63157#include <netinet/in.h>
63158#include <netinet/tcp.h>
63159#include <netinet/udp.h>
63160
63161#include <stdio.h>
63162#include <stdlib.h>
63163#include <unistd.h>
63164
63165int
63166main ()
63167{
63168
63169   socklen_t optlen;
63170   int optval;
63171   int stype;
63172   int ptype;
63173   int s;
63174
63175   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63176      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63177      ptype = IPPROTO_TCP;
63178   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63179      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63180      ptype = IPPROTO_IP;
63181   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63182      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63183      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63184   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63185      stype = SOCK_DGRAM;
63186      ptype = IPPROTO_UDP;
63187   } else {
63188       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63189       exit(1);
63190   }
63191
63192   if((s = socket(PF_INET, stype, ptype)) < 0) {
63193      perror("socket");
63194      exit(1);
63195   }
63196
63197   optval = 1;
63198   optlen = sizeof(optval);
63199   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVOPTS, &optval, optlen) < 0) {
63200      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVOPTS");
63201      close(s);
63202      exit(1);
63203   }
63204  ;
63205  return 0;
63206}
63207_ACEOF
63208if ac_fn_c_try_compile "$LINENO"; then :
63209  _compileok=1
63210fi
63211rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63212
63213  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63214/* end confdefs.h.  */
63215
63216#include <sys/types.h>
63217#include <sys/socket.h>
63218#include <netinet/in.h>
63219#include <netinet/tcp.h>
63220#include <netinet/udp.h>
63221
63222#include <stdio.h>
63223#include <stdlib.h>
63224#include <unistd.h>
63225
63226int
63227main ()
63228{
63229
63230   socklen_t optlen;
63231   int optval;
63232   int stype;
63233   int ptype;
63234   int s;
63235
63236   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63237      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63238      ptype = IPPROTO_TCP;
63239   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63240      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63241      ptype = IPPROTO_IP;
63242   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63243      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63244      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63245   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63246      stype = SOCK_DGRAM;
63247      ptype = IPPROTO_UDP;
63248   } else {
63249       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63250       exit(1);
63251   }
63252
63253   if((s = socket(PF_INET6, stype, ptype)) < 0) {
63254      perror("socket");
63255      exit(1);
63256   }
63257
63258   optval = 1;
63259   optlen = sizeof(optval);
63260   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVOPTS, &optval, optlen) < 0) {
63261      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVOPTS");
63262      close(s);
63263      exit(1);
63264   }
63265  ;
63266  return 0;
63267}
63268_ACEOF
63269if ac_fn_c_try_compile "$LINENO"; then :
63270  _compileok=1
63271fi
63272rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63273
63274  if test x"${_compileok}" != x; then
63275    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
63276$as_echo "yes" >&6; }
63277
63278cat >>confdefs.h <<_ACEOF
63279#define HAVE_IPV6_RECVOPTS 1
63280_ACEOF
63281
63282cat >>confdefs.h <<_ACEOF
63283#define SOCKS_IPV6_RECVOPTS_LVL IPPROTO_IPV6
63284_ACEOF
63285
63286cat >>confdefs.h <<_ACEOF
63287#define SOCKS_IPV6_RECVOPTS_NAME "ipv6_recvopts"
63288_ACEOF
63289    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
63290       #ipv4-only
63291
63292cat >>confdefs.h <<_ACEOF
63293#define SOCKS_IPV6_RECVOPTS_IPV4 1
63294_ACEOF
63295
63296cat >>confdefs.h <<_ACEOF
63297#define SOCKS_IPV6_RECVOPTS_IPV6 0
63298_ACEOF
63299    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
63300       #ipv6-only
63301
63302cat >>confdefs.h <<_ACEOF
63303#define SOCKS_IPV6_RECVOPTS_IPV4 0
63304_ACEOF
63305
63306cat >>confdefs.h <<_ACEOF
63307#define SOCKS_IPV6_RECVOPTS_IPV6 1
63308_ACEOF
63309    else
63310       #both ipv4 and ipv6
63311
63312cat >>confdefs.h <<_ACEOF
63313#define SOCKS_IPV6_RECVOPTS_IPV4 1
63314_ACEOF
63315
63316cat >>confdefs.h <<_ACEOF
63317#define SOCKS_IPV6_RECVOPTS_IPV6 1
63318_ACEOF
63319    fi
63320    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVOPTS"
63321  else
63322    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
63323$as_echo "no" >&6; }
63324  fi
63325unset _compileok
63326  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVORIGDSTADDR" >&5
63327$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVORIGDSTADDR... " >&6; }
63328  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63329/* end confdefs.h.  */
63330
63331#include <sys/types.h>
63332#include <sys/socket.h>
63333#include <netinet/in.h>
63334#include <netinet/tcp.h>
63335#include <netinet/udp.h>
63336
63337#include <stdio.h>
63338#include <stdlib.h>
63339#include <unistd.h>
63340
63341int
63342main ()
63343{
63344
63345   socklen_t optlen;
63346   int optval;
63347   int stype;
63348   int ptype;
63349   int s;
63350
63351   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63352      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63353      ptype = IPPROTO_TCP;
63354   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63355      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63356      ptype = IPPROTO_IP;
63357   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63358      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63359      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63360   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63361      stype = SOCK_DGRAM;
63362      ptype = IPPROTO_UDP;
63363   } else {
63364       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63365       exit(1);
63366   }
63367
63368   if((s = socket(PF_INET, stype, ptype)) < 0) {
63369      perror("socket");
63370      exit(1);
63371   }
63372
63373   optval = 1;
63374   optlen = sizeof(optval);
63375   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVORIGDSTADDR, &optval, optlen) < 0) {
63376      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVORIGDSTADDR");
63377      close(s);
63378      exit(1);
63379   }
63380  ;
63381  return 0;
63382}
63383_ACEOF
63384if ac_fn_c_try_compile "$LINENO"; then :
63385  _compileok=1
63386fi
63387rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63388
63389  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63390/* end confdefs.h.  */
63391
63392#include <sys/types.h>
63393#include <sys/socket.h>
63394#include <netinet/in.h>
63395#include <netinet/tcp.h>
63396#include <netinet/udp.h>
63397
63398#include <stdio.h>
63399#include <stdlib.h>
63400#include <unistd.h>
63401
63402int
63403main ()
63404{
63405
63406   socklen_t optlen;
63407   int optval;
63408   int stype;
63409   int ptype;
63410   int s;
63411
63412   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63413      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63414      ptype = IPPROTO_TCP;
63415   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63416      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63417      ptype = IPPROTO_IP;
63418   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63419      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63420      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63421   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63422      stype = SOCK_DGRAM;
63423      ptype = IPPROTO_UDP;
63424   } else {
63425       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63426       exit(1);
63427   }
63428
63429   if((s = socket(PF_INET6, stype, ptype)) < 0) {
63430      perror("socket");
63431      exit(1);
63432   }
63433
63434   optval = 1;
63435   optlen = sizeof(optval);
63436   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVORIGDSTADDR, &optval, optlen) < 0) {
63437      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVORIGDSTADDR");
63438      close(s);
63439      exit(1);
63440   }
63441  ;
63442  return 0;
63443}
63444_ACEOF
63445if ac_fn_c_try_compile "$LINENO"; then :
63446  _compileok=1
63447fi
63448rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63449
63450  if test x"${_compileok}" != x; then
63451    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
63452$as_echo "yes" >&6; }
63453
63454cat >>confdefs.h <<_ACEOF
63455#define HAVE_IPV6_RECVORIGDSTADDR 1
63456_ACEOF
63457
63458cat >>confdefs.h <<_ACEOF
63459#define SOCKS_IPV6_RECVORIGDSTADDR_LVL IPPROTO_IPV6
63460_ACEOF
63461
63462cat >>confdefs.h <<_ACEOF
63463#define SOCKS_IPV6_RECVORIGDSTADDR_NAME "ipv6_recvorigdstaddr"
63464_ACEOF
63465    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
63466       #ipv4-only
63467
63468cat >>confdefs.h <<_ACEOF
63469#define SOCKS_IPV6_RECVORIGDSTADDR_IPV4 1
63470_ACEOF
63471
63472cat >>confdefs.h <<_ACEOF
63473#define SOCKS_IPV6_RECVORIGDSTADDR_IPV6 0
63474_ACEOF
63475    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
63476       #ipv6-only
63477
63478cat >>confdefs.h <<_ACEOF
63479#define SOCKS_IPV6_RECVORIGDSTADDR_IPV4 0
63480_ACEOF
63481
63482cat >>confdefs.h <<_ACEOF
63483#define SOCKS_IPV6_RECVORIGDSTADDR_IPV6 1
63484_ACEOF
63485    else
63486       #both ipv4 and ipv6
63487
63488cat >>confdefs.h <<_ACEOF
63489#define SOCKS_IPV6_RECVORIGDSTADDR_IPV4 1
63490_ACEOF
63491
63492cat >>confdefs.h <<_ACEOF
63493#define SOCKS_IPV6_RECVORIGDSTADDR_IPV6 1
63494_ACEOF
63495    fi
63496    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVORIGDSTADDR"
63497  else
63498    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
63499$as_echo "no" >&6; }
63500  fi
63501unset _compileok
63502  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVPATHMTU" >&5
63503$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVPATHMTU... " >&6; }
63504  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63505/* end confdefs.h.  */
63506
63507#include <sys/types.h>
63508#include <sys/socket.h>
63509#include <netinet/in.h>
63510#include <netinet/tcp.h>
63511#include <netinet/udp.h>
63512
63513#include <stdio.h>
63514#include <stdlib.h>
63515#include <unistd.h>
63516
63517int
63518main ()
63519{
63520
63521   socklen_t optlen;
63522   int optval;
63523   int stype;
63524   int ptype;
63525   int s;
63526
63527   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63528      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63529      ptype = IPPROTO_TCP;
63530   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63531      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63532      ptype = IPPROTO_IP;
63533   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63534      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63535      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63536   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63537      stype = SOCK_DGRAM;
63538      ptype = IPPROTO_UDP;
63539   } else {
63540       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63541       exit(1);
63542   }
63543
63544   if((s = socket(PF_INET, stype, ptype)) < 0) {
63545      perror("socket");
63546      exit(1);
63547   }
63548
63549   optval = 1;
63550   optlen = sizeof(optval);
63551   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVPATHMTU, &optval, optlen) < 0) {
63552      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVPATHMTU");
63553      close(s);
63554      exit(1);
63555   }
63556  ;
63557  return 0;
63558}
63559_ACEOF
63560if ac_fn_c_try_compile "$LINENO"; then :
63561  _compileok=1
63562fi
63563rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63564
63565  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63566/* end confdefs.h.  */
63567
63568#include <sys/types.h>
63569#include <sys/socket.h>
63570#include <netinet/in.h>
63571#include <netinet/tcp.h>
63572#include <netinet/udp.h>
63573
63574#include <stdio.h>
63575#include <stdlib.h>
63576#include <unistd.h>
63577
63578int
63579main ()
63580{
63581
63582   socklen_t optlen;
63583   int optval;
63584   int stype;
63585   int ptype;
63586   int s;
63587
63588   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63589      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63590      ptype = IPPROTO_TCP;
63591   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63592      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63593      ptype = IPPROTO_IP;
63594   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63595      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63596      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63597   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63598      stype = SOCK_DGRAM;
63599      ptype = IPPROTO_UDP;
63600   } else {
63601       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63602       exit(1);
63603   }
63604
63605   if((s = socket(PF_INET6, stype, ptype)) < 0) {
63606      perror("socket");
63607      exit(1);
63608   }
63609
63610   optval = 1;
63611   optlen = sizeof(optval);
63612   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVPATHMTU, &optval, optlen) < 0) {
63613      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVPATHMTU");
63614      close(s);
63615      exit(1);
63616   }
63617  ;
63618  return 0;
63619}
63620_ACEOF
63621if ac_fn_c_try_compile "$LINENO"; then :
63622  _compileok=1
63623fi
63624rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63625
63626  if test x"${_compileok}" != x; then
63627    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
63628$as_echo "yes" >&6; }
63629
63630cat >>confdefs.h <<_ACEOF
63631#define HAVE_IPV6_RECVPATHMTU 1
63632_ACEOF
63633
63634cat >>confdefs.h <<_ACEOF
63635#define SOCKS_IPV6_RECVPATHMTU_LVL IPPROTO_IPV6
63636_ACEOF
63637
63638cat >>confdefs.h <<_ACEOF
63639#define SOCKS_IPV6_RECVPATHMTU_NAME "ipv6_recvpathmtu"
63640_ACEOF
63641    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
63642       #ipv4-only
63643
63644cat >>confdefs.h <<_ACEOF
63645#define SOCKS_IPV6_RECVPATHMTU_IPV4 1
63646_ACEOF
63647
63648cat >>confdefs.h <<_ACEOF
63649#define SOCKS_IPV6_RECVPATHMTU_IPV6 0
63650_ACEOF
63651    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
63652       #ipv6-only
63653
63654cat >>confdefs.h <<_ACEOF
63655#define SOCKS_IPV6_RECVPATHMTU_IPV4 0
63656_ACEOF
63657
63658cat >>confdefs.h <<_ACEOF
63659#define SOCKS_IPV6_RECVPATHMTU_IPV6 1
63660_ACEOF
63661    else
63662       #both ipv4 and ipv6
63663
63664cat >>confdefs.h <<_ACEOF
63665#define SOCKS_IPV6_RECVPATHMTU_IPV4 1
63666_ACEOF
63667
63668cat >>confdefs.h <<_ACEOF
63669#define SOCKS_IPV6_RECVPATHMTU_IPV6 1
63670_ACEOF
63671    fi
63672    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVPATHMTU"
63673  else
63674    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
63675$as_echo "no" >&6; }
63676  fi
63677unset _compileok
63678  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVPKTINFO" >&5
63679$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVPKTINFO... " >&6; }
63680  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63681/* end confdefs.h.  */
63682
63683#include <sys/types.h>
63684#include <sys/socket.h>
63685#include <netinet/in.h>
63686#include <netinet/tcp.h>
63687#include <netinet/udp.h>
63688
63689#include <stdio.h>
63690#include <stdlib.h>
63691#include <unistd.h>
63692
63693int
63694main ()
63695{
63696
63697   socklen_t optlen;
63698   int optval;
63699   int stype;
63700   int ptype;
63701   int s;
63702
63703   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63704      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63705      ptype = IPPROTO_TCP;
63706   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63707      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63708      ptype = IPPROTO_IP;
63709   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63710      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63711      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63712   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63713      stype = SOCK_DGRAM;
63714      ptype = IPPROTO_UDP;
63715   } else {
63716       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63717       exit(1);
63718   }
63719
63720   if((s = socket(PF_INET, stype, ptype)) < 0) {
63721      perror("socket");
63722      exit(1);
63723   }
63724
63725   optval = 1;
63726   optlen = sizeof(optval);
63727   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &optval, optlen) < 0) {
63728      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVPKTINFO");
63729      close(s);
63730      exit(1);
63731   }
63732  ;
63733  return 0;
63734}
63735_ACEOF
63736if ac_fn_c_try_compile "$LINENO"; then :
63737  _compileok=1
63738fi
63739rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63740
63741  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63742/* end confdefs.h.  */
63743
63744#include <sys/types.h>
63745#include <sys/socket.h>
63746#include <netinet/in.h>
63747#include <netinet/tcp.h>
63748#include <netinet/udp.h>
63749
63750#include <stdio.h>
63751#include <stdlib.h>
63752#include <unistd.h>
63753
63754int
63755main ()
63756{
63757
63758   socklen_t optlen;
63759   int optval;
63760   int stype;
63761   int ptype;
63762   int s;
63763
63764   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63765      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63766      ptype = IPPROTO_TCP;
63767   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63768      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63769      ptype = IPPROTO_IP;
63770   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63771      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63772      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63773   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63774      stype = SOCK_DGRAM;
63775      ptype = IPPROTO_UDP;
63776   } else {
63777       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63778       exit(1);
63779   }
63780
63781   if((s = socket(PF_INET6, stype, ptype)) < 0) {
63782      perror("socket");
63783      exit(1);
63784   }
63785
63786   optval = 1;
63787   optlen = sizeof(optval);
63788   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &optval, optlen) < 0) {
63789      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVPKTINFO");
63790      close(s);
63791      exit(1);
63792   }
63793  ;
63794  return 0;
63795}
63796_ACEOF
63797if ac_fn_c_try_compile "$LINENO"; then :
63798  _compileok=1
63799fi
63800rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63801
63802  if test x"${_compileok}" != x; then
63803    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
63804$as_echo "yes" >&6; }
63805
63806cat >>confdefs.h <<_ACEOF
63807#define HAVE_IPV6_RECVPKTINFO 1
63808_ACEOF
63809
63810cat >>confdefs.h <<_ACEOF
63811#define SOCKS_IPV6_RECVPKTINFO_LVL IPPROTO_IPV6
63812_ACEOF
63813
63814cat >>confdefs.h <<_ACEOF
63815#define SOCKS_IPV6_RECVPKTINFO_NAME "ipv6_recvpktinfo"
63816_ACEOF
63817    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
63818       #ipv4-only
63819
63820cat >>confdefs.h <<_ACEOF
63821#define SOCKS_IPV6_RECVPKTINFO_IPV4 1
63822_ACEOF
63823
63824cat >>confdefs.h <<_ACEOF
63825#define SOCKS_IPV6_RECVPKTINFO_IPV6 0
63826_ACEOF
63827    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
63828       #ipv6-only
63829
63830cat >>confdefs.h <<_ACEOF
63831#define SOCKS_IPV6_RECVPKTINFO_IPV4 0
63832_ACEOF
63833
63834cat >>confdefs.h <<_ACEOF
63835#define SOCKS_IPV6_RECVPKTINFO_IPV6 1
63836_ACEOF
63837    else
63838       #both ipv4 and ipv6
63839
63840cat >>confdefs.h <<_ACEOF
63841#define SOCKS_IPV6_RECVPKTINFO_IPV4 1
63842_ACEOF
63843
63844cat >>confdefs.h <<_ACEOF
63845#define SOCKS_IPV6_RECVPKTINFO_IPV6 1
63846_ACEOF
63847    fi
63848    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVPKTINFO"
63849  else
63850    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
63851$as_echo "no" >&6; }
63852  fi
63853unset _compileok
63854  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVRETOPTS" >&5
63855$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVRETOPTS... " >&6; }
63856  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63857/* end confdefs.h.  */
63858
63859#include <sys/types.h>
63860#include <sys/socket.h>
63861#include <netinet/in.h>
63862#include <netinet/tcp.h>
63863#include <netinet/udp.h>
63864
63865#include <stdio.h>
63866#include <stdlib.h>
63867#include <unistd.h>
63868
63869int
63870main ()
63871{
63872
63873   socklen_t optlen;
63874   int optval;
63875   int stype;
63876   int ptype;
63877   int s;
63878
63879   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63880      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63881      ptype = IPPROTO_TCP;
63882   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63883      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63884      ptype = IPPROTO_IP;
63885   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63886      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63887      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63888   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63889      stype = SOCK_DGRAM;
63890      ptype = IPPROTO_UDP;
63891   } else {
63892       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63893       exit(1);
63894   }
63895
63896   if((s = socket(PF_INET, stype, ptype)) < 0) {
63897      perror("socket");
63898      exit(1);
63899   }
63900
63901   optval = 1;
63902   optlen = sizeof(optval);
63903   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVRETOPTS, &optval, optlen) < 0) {
63904      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVRETOPTS");
63905      close(s);
63906      exit(1);
63907   }
63908  ;
63909  return 0;
63910}
63911_ACEOF
63912if ac_fn_c_try_compile "$LINENO"; then :
63913  _compileok=1
63914fi
63915rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63916
63917  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
63918/* end confdefs.h.  */
63919
63920#include <sys/types.h>
63921#include <sys/socket.h>
63922#include <netinet/in.h>
63923#include <netinet/tcp.h>
63924#include <netinet/udp.h>
63925
63926#include <stdio.h>
63927#include <stdlib.h>
63928#include <unistd.h>
63929
63930int
63931main ()
63932{
63933
63934   socklen_t optlen;
63935   int optval;
63936   int stype;
63937   int ptype;
63938   int s;
63939
63940   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
63941      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
63942      ptype = IPPROTO_TCP;
63943   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
63944      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
63945      ptype = IPPROTO_IP;
63946   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
63947      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
63948      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
63949   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
63950      stype = SOCK_DGRAM;
63951      ptype = IPPROTO_UDP;
63952   } else {
63953       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
63954       exit(1);
63955   }
63956
63957   if((s = socket(PF_INET6, stype, ptype)) < 0) {
63958      perror("socket");
63959      exit(1);
63960   }
63961
63962   optval = 1;
63963   optlen = sizeof(optval);
63964   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVRETOPTS, &optval, optlen) < 0) {
63965      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVRETOPTS");
63966      close(s);
63967      exit(1);
63968   }
63969  ;
63970  return 0;
63971}
63972_ACEOF
63973if ac_fn_c_try_compile "$LINENO"; then :
63974  _compileok=1
63975fi
63976rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
63977
63978  if test x"${_compileok}" != x; then
63979    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
63980$as_echo "yes" >&6; }
63981
63982cat >>confdefs.h <<_ACEOF
63983#define HAVE_IPV6_RECVRETOPTS 1
63984_ACEOF
63985
63986cat >>confdefs.h <<_ACEOF
63987#define SOCKS_IPV6_RECVRETOPTS_LVL IPPROTO_IPV6
63988_ACEOF
63989
63990cat >>confdefs.h <<_ACEOF
63991#define SOCKS_IPV6_RECVRETOPTS_NAME "ipv6_recvretopts"
63992_ACEOF
63993    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
63994       #ipv4-only
63995
63996cat >>confdefs.h <<_ACEOF
63997#define SOCKS_IPV6_RECVRETOPTS_IPV4 1
63998_ACEOF
63999
64000cat >>confdefs.h <<_ACEOF
64001#define SOCKS_IPV6_RECVRETOPTS_IPV6 0
64002_ACEOF
64003    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
64004       #ipv6-only
64005
64006cat >>confdefs.h <<_ACEOF
64007#define SOCKS_IPV6_RECVRETOPTS_IPV4 0
64008_ACEOF
64009
64010cat >>confdefs.h <<_ACEOF
64011#define SOCKS_IPV6_RECVRETOPTS_IPV6 1
64012_ACEOF
64013    else
64014       #both ipv4 and ipv6
64015
64016cat >>confdefs.h <<_ACEOF
64017#define SOCKS_IPV6_RECVRETOPTS_IPV4 1
64018_ACEOF
64019
64020cat >>confdefs.h <<_ACEOF
64021#define SOCKS_IPV6_RECVRETOPTS_IPV6 1
64022_ACEOF
64023    fi
64024    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVRETOPTS"
64025  else
64026    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64027$as_echo "no" >&6; }
64028  fi
64029unset _compileok
64030  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVRTHDR" >&5
64031$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVRTHDR... " >&6; }
64032  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64033/* end confdefs.h.  */
64034
64035#include <sys/types.h>
64036#include <sys/socket.h>
64037#include <netinet/in.h>
64038#include <netinet/tcp.h>
64039#include <netinet/udp.h>
64040
64041#include <stdio.h>
64042#include <stdlib.h>
64043#include <unistd.h>
64044
64045int
64046main ()
64047{
64048
64049   socklen_t optlen;
64050   int optval;
64051   int stype;
64052   int ptype;
64053   int s;
64054
64055   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
64056      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64057      ptype = IPPROTO_TCP;
64058   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
64059      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64060      ptype = IPPROTO_IP;
64061   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
64062      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
64063      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
64064   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
64065      stype = SOCK_DGRAM;
64066      ptype = IPPROTO_UDP;
64067   } else {
64068       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
64069       exit(1);
64070   }
64071
64072   if((s = socket(PF_INET, stype, ptype)) < 0) {
64073      perror("socket");
64074      exit(1);
64075   }
64076
64077   optval = 1;
64078   optlen = sizeof(optval);
64079   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVRTHDR, &optval, optlen) < 0) {
64080      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVRTHDR");
64081      close(s);
64082      exit(1);
64083   }
64084  ;
64085  return 0;
64086}
64087_ACEOF
64088if ac_fn_c_try_compile "$LINENO"; then :
64089  _compileok=1
64090fi
64091rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64092
64093  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64094/* end confdefs.h.  */
64095
64096#include <sys/types.h>
64097#include <sys/socket.h>
64098#include <netinet/in.h>
64099#include <netinet/tcp.h>
64100#include <netinet/udp.h>
64101
64102#include <stdio.h>
64103#include <stdlib.h>
64104#include <unistd.h>
64105
64106int
64107main ()
64108{
64109
64110   socklen_t optlen;
64111   int optval;
64112   int stype;
64113   int ptype;
64114   int s;
64115
64116   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
64117      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64118      ptype = IPPROTO_TCP;
64119   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
64120      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64121      ptype = IPPROTO_IP;
64122   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
64123      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
64124      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
64125   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
64126      stype = SOCK_DGRAM;
64127      ptype = IPPROTO_UDP;
64128   } else {
64129       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
64130       exit(1);
64131   }
64132
64133   if((s = socket(PF_INET6, stype, ptype)) < 0) {
64134      perror("socket");
64135      exit(1);
64136   }
64137
64138   optval = 1;
64139   optlen = sizeof(optval);
64140   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVRTHDR, &optval, optlen) < 0) {
64141      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVRTHDR");
64142      close(s);
64143      exit(1);
64144   }
64145  ;
64146  return 0;
64147}
64148_ACEOF
64149if ac_fn_c_try_compile "$LINENO"; then :
64150  _compileok=1
64151fi
64152rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64153
64154  if test x"${_compileok}" != x; then
64155    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64156$as_echo "yes" >&6; }
64157
64158cat >>confdefs.h <<_ACEOF
64159#define HAVE_IPV6_RECVRTHDR 1
64160_ACEOF
64161
64162cat >>confdefs.h <<_ACEOF
64163#define SOCKS_IPV6_RECVRTHDR_LVL IPPROTO_IPV6
64164_ACEOF
64165
64166cat >>confdefs.h <<_ACEOF
64167#define SOCKS_IPV6_RECVRTHDR_NAME "ipv6_recvrthdr"
64168_ACEOF
64169    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
64170       #ipv4-only
64171
64172cat >>confdefs.h <<_ACEOF
64173#define SOCKS_IPV6_RECVRTHDR_IPV4 1
64174_ACEOF
64175
64176cat >>confdefs.h <<_ACEOF
64177#define SOCKS_IPV6_RECVRTHDR_IPV6 0
64178_ACEOF
64179    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
64180       #ipv6-only
64181
64182cat >>confdefs.h <<_ACEOF
64183#define SOCKS_IPV6_RECVRTHDR_IPV4 0
64184_ACEOF
64185
64186cat >>confdefs.h <<_ACEOF
64187#define SOCKS_IPV6_RECVRTHDR_IPV6 1
64188_ACEOF
64189    else
64190       #both ipv4 and ipv6
64191
64192cat >>confdefs.h <<_ACEOF
64193#define SOCKS_IPV6_RECVRTHDR_IPV4 1
64194_ACEOF
64195
64196cat >>confdefs.h <<_ACEOF
64197#define SOCKS_IPV6_RECVRTHDR_IPV6 1
64198_ACEOF
64199    fi
64200    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVRTHDR"
64201  else
64202    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64203$as_echo "no" >&6; }
64204  fi
64205unset _compileok
64206  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IPPROTO_IPV6 socket option IPV6_RECVTCLASS" >&5
64207$as_echo_n "checking for IPPROTO_IPV6 socket option IPV6_RECVTCLASS... " >&6; }
64208  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64209/* end confdefs.h.  */
64210
64211#include <sys/types.h>
64212#include <sys/socket.h>
64213#include <netinet/in.h>
64214#include <netinet/tcp.h>
64215#include <netinet/udp.h>
64216
64217#include <stdio.h>
64218#include <stdlib.h>
64219#include <unistd.h>
64220
64221int
64222main ()
64223{
64224
64225   socklen_t optlen;
64226   int optval;
64227   int stype;
64228   int ptype;
64229   int s;
64230
64231   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
64232      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64233      ptype = IPPROTO_TCP;
64234   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
64235      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64236      ptype = IPPROTO_IP;
64237   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
64238      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
64239      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
64240   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
64241      stype = SOCK_DGRAM;
64242      ptype = IPPROTO_UDP;
64243   } else {
64244       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
64245       exit(1);
64246   }
64247
64248   if((s = socket(PF_INET, stype, ptype)) < 0) {
64249      perror("socket");
64250      exit(1);
64251   }
64252
64253   optval = 1;
64254   optlen = sizeof(optval);
64255   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVTCLASS, &optval, optlen) < 0) {
64256      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVTCLASS");
64257      close(s);
64258      exit(1);
64259   }
64260  ;
64261  return 0;
64262}
64263_ACEOF
64264if ac_fn_c_try_compile "$LINENO"; then :
64265  _compileok=1
64266fi
64267rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64268
64269  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64270/* end confdefs.h.  */
64271
64272#include <sys/types.h>
64273#include <sys/socket.h>
64274#include <netinet/in.h>
64275#include <netinet/tcp.h>
64276#include <netinet/udp.h>
64277
64278#include <stdio.h>
64279#include <stdlib.h>
64280#include <unistd.h>
64281
64282int
64283main ()
64284{
64285
64286   socklen_t optlen;
64287   int optval;
64288   int stype;
64289   int ptype;
64290   int s;
64291
64292   if (IPPROTO_IPV6 == SOL_SOCKET || IPPROTO_IPV6 == IPPROTO_TCP) {
64293      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64294      ptype = IPPROTO_TCP;
64295   } else if (IPPROTO_IPV6 == IPPROTO_IP) {
64296      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64297      ptype = IPPROTO_IP;
64298   } else if (IPPROTO_IPV6 == IPPROTO_IPV6) {
64299      stype = SOCK_DGRAM;   /* XXX test only UDP in case of IPPROTO_IPV6 */
64300      ptype = IPPROTO_IPV6; /* set to v6 for ipv6 test */
64301   } else if (IPPROTO_IPV6 == IPPROTO_UDP) {
64302      stype = SOCK_DGRAM;
64303      ptype = IPPROTO_UDP;
64304   } else {
64305       fprintf(stderr, "error: unexpected socket type: IPPROTO_IPV6");
64306       exit(1);
64307   }
64308
64309   if((s = socket(PF_INET6, stype, ptype)) < 0) {
64310      perror("socket");
64311      exit(1);
64312   }
64313
64314   optval = 1;
64315   optlen = sizeof(optval);
64316   if(setsockopt(s, IPPROTO_IPV6, IPV6_RECVTCLASS, &optval, optlen) < 0) {
64317      perror("setsockopt: IPPROTO_IPV6 IPV6_RECVTCLASS");
64318      close(s);
64319      exit(1);
64320   }
64321  ;
64322  return 0;
64323}
64324_ACEOF
64325if ac_fn_c_try_compile "$LINENO"; then :
64326  _compileok=1
64327fi
64328rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64329
64330  if test x"${_compileok}" != x; then
64331    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64332$as_echo "yes" >&6; }
64333
64334cat >>confdefs.h <<_ACEOF
64335#define HAVE_IPV6_RECVTCLASS 1
64336_ACEOF
64337
64338cat >>confdefs.h <<_ACEOF
64339#define SOCKS_IPV6_RECVTCLASS_LVL IPPROTO_IPV6
64340_ACEOF
64341
64342cat >>confdefs.h <<_ACEOF
64343#define SOCKS_IPV6_RECVTCLASS_NAME "ipv6_recvtclass"
64344_ACEOF
64345    if test x"IPPROTO_IPV6" = x"IPPROTO_IP"; then
64346       #ipv4-only
64347
64348cat >>confdefs.h <<_ACEOF
64349#define SOCKS_IPV6_RECVTCLASS_IPV4 1
64350_ACEOF
64351
64352cat >>confdefs.h <<_ACEOF
64353#define SOCKS_IPV6_RECVTCLASS_IPV6 0
64354_ACEOF
64355    elif test x"IPPROTO_IPV6" = x"IPPROTO_IPV6"; then
64356       #ipv6-only
64357
64358cat >>confdefs.h <<_ACEOF
64359#define SOCKS_IPV6_RECVTCLASS_IPV4 0
64360_ACEOF
64361
64362cat >>confdefs.h <<_ACEOF
64363#define SOCKS_IPV6_RECVTCLASS_IPV6 1
64364_ACEOF
64365    else
64366       #both ipv4 and ipv6
64367
64368cat >>confdefs.h <<_ACEOF
64369#define SOCKS_IPV6_RECVTCLASS_IPV4 1
64370_ACEOF
64371
64372cat >>confdefs.h <<_ACEOF
64373#define SOCKS_IPV6_RECVTCLASS_IPV6 1
64374_ACEOF
64375    fi
64376    SOCKOPTS="$SOCKOPTS${SOCKOPTS:+ }IPV6_RECVTCLASS"
64377  else
64378    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64379$as_echo "no" >&6; }
64380  fi
64381
64382INVALIDSOCKOPTS="$SOCKOPTS" #not user-settable options
64383
64384ALLSOCKOPTS="$ALLSOCKOPTS $SOCKOPTS"
64385
64386#add symbolic values for options
64387unset SOCKOPTVALSYMS
64388for opt in $OKSOCKOPTS; do
64389    case $opt in
64390	IP_PORTRANGE)
64391	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_DEFAULT" >&5
64392$as_echo_n "checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_DEFAULT... " >&6; }
64393  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64394/* end confdefs.h.  */
64395
64396#include <sys/types.h>
64397#include <sys/socket.h>
64398#include <netinet/in.h>
64399#include <netinet/tcp.h>
64400#include <netinet/udp.h>
64401
64402#include <stdio.h>
64403#include <stdlib.h>
64404#include <unistd.h>
64405
64406int
64407main ()
64408{
64409
64410   socklen_t optlen;
64411   int optval;
64412   int stype;
64413   int ptype;
64414   int s;
64415
64416   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
64417      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64418      ptype = IPPROTO_TCP;
64419   } else if (IPPROTO_IP == IPPROTO_IP) {
64420      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64421      ptype = IPPROTO_IP;
64422   } else if (IPPROTO_IP == IPPROTO_UDP) {
64423      stype = SOCK_DGRAM;
64424      ptype = IPPROTO_UDP;
64425   } else {
64426       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
64427       exit(1);
64428   }
64429
64430   if((s = socket(PF_INET, stype, ptype)) < 0) {
64431      perror("socket");
64432      exit(1);
64433   }
64434
64435   optval = IP_PORTRANGE_DEFAULT;
64436   optlen = sizeof(optval);
64437   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
64438      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
64439      close(s);
64440      exit(1);
64441   }
64442  ;
64443  return 0;
64444}
64445_ACEOF
64446if ac_fn_c_try_compile "$LINENO"; then :
64447  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64448$as_echo "yes" >&6; }
64449
64450cat >>confdefs.h <<_ACEOF
64451#define SOCKS_IP_PORTRANGE_DEFAULT_SYMNAME "ip_portrange_default"
64452_ACEOF
64453     SOCKOPTVALSYMS="$SOCKOPTVALSYMS${SOCKOPTVALSYMS:+ }IP_PORTRANGE_DEFAULT"
64454else
64455  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64456$as_echo "no" >&6; }
64457fi
64458rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64459	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_HIGH" >&5
64460$as_echo_n "checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_HIGH... " >&6; }
64461  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64462/* end confdefs.h.  */
64463
64464#include <sys/types.h>
64465#include <sys/socket.h>
64466#include <netinet/in.h>
64467#include <netinet/tcp.h>
64468#include <netinet/udp.h>
64469
64470#include <stdio.h>
64471#include <stdlib.h>
64472#include <unistd.h>
64473
64474int
64475main ()
64476{
64477
64478   socklen_t optlen;
64479   int optval;
64480   int stype;
64481   int ptype;
64482   int s;
64483
64484   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
64485      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64486      ptype = IPPROTO_TCP;
64487   } else if (IPPROTO_IP == IPPROTO_IP) {
64488      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64489      ptype = IPPROTO_IP;
64490   } else if (IPPROTO_IP == IPPROTO_UDP) {
64491      stype = SOCK_DGRAM;
64492      ptype = IPPROTO_UDP;
64493   } else {
64494       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
64495       exit(1);
64496   }
64497
64498   if((s = socket(PF_INET, stype, ptype)) < 0) {
64499      perror("socket");
64500      exit(1);
64501   }
64502
64503   optval = IP_PORTRANGE_HIGH;
64504   optlen = sizeof(optval);
64505   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
64506      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
64507      close(s);
64508      exit(1);
64509   }
64510  ;
64511  return 0;
64512}
64513_ACEOF
64514if ac_fn_c_try_compile "$LINENO"; then :
64515  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64516$as_echo "yes" >&6; }
64517
64518cat >>confdefs.h <<_ACEOF
64519#define SOCKS_IP_PORTRANGE_HIGH_SYMNAME "ip_portrange_high"
64520_ACEOF
64521     SOCKOPTVALSYMS="$SOCKOPTVALSYMS${SOCKOPTVALSYMS:+ }IP_PORTRANGE_HIGH"
64522else
64523  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64524$as_echo "no" >&6; }
64525fi
64526rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64527	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_LOW" >&5
64528$as_echo_n "checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_LOW... " >&6; }
64529  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64530/* end confdefs.h.  */
64531
64532#include <sys/types.h>
64533#include <sys/socket.h>
64534#include <netinet/in.h>
64535#include <netinet/tcp.h>
64536#include <netinet/udp.h>
64537
64538#include <stdio.h>
64539#include <stdlib.h>
64540#include <unistd.h>
64541
64542int
64543main ()
64544{
64545
64546   socklen_t optlen;
64547   int optval;
64548   int stype;
64549   int ptype;
64550   int s;
64551
64552   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
64553      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64554      ptype = IPPROTO_TCP;
64555   } else if (IPPROTO_IP == IPPROTO_IP) {
64556      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64557      ptype = IPPROTO_IP;
64558   } else if (IPPROTO_IP == IPPROTO_UDP) {
64559      stype = SOCK_DGRAM;
64560      ptype = IPPROTO_UDP;
64561   } else {
64562       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
64563       exit(1);
64564   }
64565
64566   if((s = socket(PF_INET, stype, ptype)) < 0) {
64567      perror("socket");
64568      exit(1);
64569   }
64570
64571   optval = IP_PORTRANGE_LOW;
64572   optlen = sizeof(optval);
64573   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
64574      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
64575      close(s);
64576      exit(1);
64577   }
64578  ;
64579  return 0;
64580}
64581_ACEOF
64582if ac_fn_c_try_compile "$LINENO"; then :
64583  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64584$as_echo "yes" >&6; }
64585
64586cat >>confdefs.h <<_ACEOF
64587#define SOCKS_IP_PORTRANGE_LOW_SYMNAME "ip_portrange_low"
64588_ACEOF
64589     SOCKOPTVALSYMS="$SOCKOPTVALSYMS${SOCKOPTVALSYMS:+ }IP_PORTRANGE_LOW"
64590else
64591  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64592$as_echo "no" >&6; }
64593fi
64594rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64595	    ;;
64596    esac
64597done
64598
64599#define socket option behavior.
64600# the default is integer values that can only be set before bind()/connect(),
64601# exceptions are specified here.
64602
64603#postonly: only settable after bind()/connect()
64604SOCKOPTS_POSTONLY="TCP_CWND"
64605
64606#anytime: always settable
64607SOCKOPTS_ANYTIME="SO_DEBUG IP_TOS" #XXX verify/expand
64608
64609#dup: options for which values should be duplicated across connections
64610SOCKOPTSDUP_IP="IP_HDRINCL IP_MULTICAST_IF IP_MULTICAST_LOOP IP_MULTICAST_TTL
64611                IP_OPTIONS IP_RECVDSTADDR IP_RECVIF IP_TOS IP_TTL"
64612SOCKOPTSDUP_SOL="SO_BROADCAST SO_DEBUG SO_DONTROUTE SO_KEEPALIVE SO_LINGER
64613                 SO_OOBINLINE SO_RCVBUF SO_RCVLOWAT SO_RCVTIMEO SO_REUSEADDR
64614                 SO_REUSEPORT SO_SNDBUF SO_SNDLOWAT SO_SNDTIMEO SO_TIMESTAMP
64615                 SO_USELOOPBACK"
64616SOCKOPTSDUP_TCP="TCP_KEEPALIVE TCP_MAXRT TCP_MAXSEG TCP_NODELAY TCP_STDURG"
64617
64618IPTOS_DSCP="AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43
64619            CS0 CS1 CS2 CS3 CS4 CS5 CS6 CS7 EF"
64620IPTOS_PREC="NETCONTROL INTERNETCONTROL CRITIC_ECP FLASHOVERRIDE FLASH
64621            IMMEDIATE PRIORITY ROUTINE"
64622IPTOS_TOS="LOWDELAY THROUGHPUT RELIABILITY"
64623
64624sockopt2argtype()
64625{
64626   _opt=$1
64627
64628    case ${_opt} in
64629	SO_LINGER)
64630	    _argtype="linger_val"
64631	    ;;
64632	SO_SNDTIMEO | SO_RCVTIMEO)
64633	    _argtype="timeval_val"
64634	    ;;
64635	TCP_IPA)
64636	    _argtype="option28_val"
64637	    ;;
64638	*)
64639	    _argtype="int_val"
64640	    ;;
64641    esac
64642
64643    echo ${_argtype}
64644}
64645
64646optargmatch ()
64647{
64648   _list="$1"
64649   _opt="$2"
64650
64651    for _val in ${_list}; do
64652	if test x"${_val}" = x"${_opt}"; then
64653	    return 0
64654	fi
64655    done
64656
64657    return 1
64658}
64659
64660#priv: options that require privileges to set
64661SOCKOPTS_PRIV="SO_BINDANY SO_RCVBUFFORCE SO_SNDBUFFORCE IP_TRANSPARENT IP_FREEBIND"
64662case $host in
64663    *-*-linux-*)
64664	SOCKOPTS_PRIV="$SOCKOPTS_PRIV${SOCKOPTS_PRIV:+ }SO_DEBUG"
64665	;;
64666esac
64667
64668OPTSRCTMP0=_sockopttmp0.c #for options to be duplicated
64669OPTSRCTMP1=_sockopttmp1.c #for options definitions
64670OPTSRCTMP2=_sockopttmp2.c #for option argument symbols
64671cp /dev/null $OPTSRCTMP0
64672cp /dev/null $OPTSRCTMP1
64673cp /dev/null $OPTSRCTMP2
64674
64675DUPSOCKOPTCNT=0
64676for opt in $ALLSOCKOPTS; do
64677    if optargmatch "${SOCKOPTSDUP_IP}" $opt; then
64678        echo "   { IPPROTO_IP, $opt, \"$opt\" }," >> $OPTSRCTMP0
64679        DUPSOCKOPTCNT=`expr $DUPSOCKOPTCNT + 1`
64680    fi
64681    if optargmatch "${SOCKOPTSDUP_SOL}" $opt; then
64682        echo "   { SOL_SOCKET, $opt, \"$opt\" }," >> $OPTSRCTMP0
64683        DUPSOCKOPTCNT=`expr $DUPSOCKOPTCNT + 1`
64684    fi
64685    if optargmatch "${SOCKOPTSDUP_TCP}" $opt; then
64686        echo "   { IPPROTO_TCP, $opt, \"$opt\" }," >> $OPTSRCTMP0
64687        DUPSOCKOPTCNT=`expr $DUPSOCKOPTCNT + 1`
64688    fi
64689done
64690
64691SOCKOPTCNT=0
64692SOCKOPTSYMCNT=0
64693unset OKSOCKOPTVALSYMS
64694for opt in $OKSOCKOPTS; do
64695    argtype=`sockopt2argtype $opt`
64696
64697    calltype="preonly" #default
64698    if optargmatch "${SOCKOPTS_POSTONLY}" $opt; then
64699       calltype="postonly"
64700    fi
64701    if optargmatch "${SOCKOPTS_ANYTIME}" $opt; then
64702       calltype="anytime"
64703    fi
64704
64705    optshift=0
64706    optmask=0
64707
64708    if optargmatch "${SOCKOPTS_DUP}" $opt; then
64709       dup=1
64710    else
64711       dup=0
64712    fi
64713
64714    priv=0
64715
64716    if optargmatch "${SOCKOPTS_PRIV}" $opt; then
64717       priv=1
64718    else
64719       priv=0
64720    fi
64721
64722    optid=$SOCKOPTCNT
64723
64724    echo "   { $optid, $argtype, ${opt}, SOCKS_${opt}_LVL, SOCKS_${opt}_IPV4, SOCKS_${opt}_IPV6, $calltype, $optshift, $optmask, $dup, $priv, SOCKS_${opt}_NAME }," >> $OPTSRCTMP1
64725    SOCKOPTCNT=`expr $SOCKOPTCNT + 1`
64726
64727    #add subfields
64728    case $opt in
64729	IP_PORTRANGE)
64730	    unset SOCKOPTVALSYMS
64731	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_DEFAULT" >&5
64732$as_echo_n "checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_DEFAULT... " >&6; }
64733  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64734/* end confdefs.h.  */
64735
64736#include <sys/types.h>
64737#include <sys/socket.h>
64738#include <netinet/in.h>
64739#include <netinet/tcp.h>
64740#include <netinet/udp.h>
64741
64742#include <stdio.h>
64743#include <stdlib.h>
64744#include <unistd.h>
64745
64746int
64747main ()
64748{
64749
64750   socklen_t optlen;
64751   int optval;
64752   int stype;
64753   int ptype;
64754   int s;
64755
64756   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
64757      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64758      ptype = IPPROTO_TCP;
64759   } else if (IPPROTO_IP == IPPROTO_IP) {
64760      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64761      ptype = IPPROTO_IP;
64762   } else if (IPPROTO_IP == IPPROTO_UDP) {
64763      stype = SOCK_DGRAM;
64764      ptype = IPPROTO_UDP;
64765   } else {
64766       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
64767       exit(1);
64768   }
64769
64770   if((s = socket(PF_INET, stype, ptype)) < 0) {
64771      perror("socket");
64772      exit(1);
64773   }
64774
64775   optval = IP_PORTRANGE_DEFAULT;
64776   optlen = sizeof(optval);
64777   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
64778      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
64779      close(s);
64780      exit(1);
64781   }
64782  ;
64783  return 0;
64784}
64785_ACEOF
64786if ac_fn_c_try_compile "$LINENO"; then :
64787  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64788$as_echo "yes" >&6; }
64789
64790cat >>confdefs.h <<_ACEOF
64791#define SOCKS_IP_PORTRANGE_DEFAULT_SYMNAME "ip_portrange_default"
64792_ACEOF
64793     SOCKOPTVALSYMS="$SOCKOPTVALSYMS${SOCKOPTVALSYMS:+ }IP_PORTRANGE_DEFAULT"
64794else
64795  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64796$as_echo "no" >&6; }
64797fi
64798rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64799	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_HIGH" >&5
64800$as_echo_n "checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_HIGH... " >&6; }
64801  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64802/* end confdefs.h.  */
64803
64804#include <sys/types.h>
64805#include <sys/socket.h>
64806#include <netinet/in.h>
64807#include <netinet/tcp.h>
64808#include <netinet/udp.h>
64809
64810#include <stdio.h>
64811#include <stdlib.h>
64812#include <unistd.h>
64813
64814int
64815main ()
64816{
64817
64818   socklen_t optlen;
64819   int optval;
64820   int stype;
64821   int ptype;
64822   int s;
64823
64824   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
64825      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64826      ptype = IPPROTO_TCP;
64827   } else if (IPPROTO_IP == IPPROTO_IP) {
64828      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64829      ptype = IPPROTO_IP;
64830   } else if (IPPROTO_IP == IPPROTO_UDP) {
64831      stype = SOCK_DGRAM;
64832      ptype = IPPROTO_UDP;
64833   } else {
64834       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
64835       exit(1);
64836   }
64837
64838   if((s = socket(PF_INET, stype, ptype)) < 0) {
64839      perror("socket");
64840      exit(1);
64841   }
64842
64843   optval = IP_PORTRANGE_HIGH;
64844   optlen = sizeof(optval);
64845   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
64846      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
64847      close(s);
64848      exit(1);
64849   }
64850  ;
64851  return 0;
64852}
64853_ACEOF
64854if ac_fn_c_try_compile "$LINENO"; then :
64855  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64856$as_echo "yes" >&6; }
64857
64858cat >>confdefs.h <<_ACEOF
64859#define SOCKS_IP_PORTRANGE_HIGH_SYMNAME "ip_portrange_high"
64860_ACEOF
64861     SOCKOPTVALSYMS="$SOCKOPTVALSYMS${SOCKOPTVALSYMS:+ }IP_PORTRANGE_HIGH"
64862else
64863  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64864$as_echo "no" >&6; }
64865fi
64866rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64867	    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_LOW" >&5
64868$as_echo_n "checking for socket option symbol IP_PORTRANGE value IP_PORTRANGE_LOW... " >&6; }
64869  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
64870/* end confdefs.h.  */
64871
64872#include <sys/types.h>
64873#include <sys/socket.h>
64874#include <netinet/in.h>
64875#include <netinet/tcp.h>
64876#include <netinet/udp.h>
64877
64878#include <stdio.h>
64879#include <stdlib.h>
64880#include <unistd.h>
64881
64882int
64883main ()
64884{
64885
64886   socklen_t optlen;
64887   int optval;
64888   int stype;
64889   int ptype;
64890   int s;
64891
64892   if (IPPROTO_IP == SOL_SOCKET || IPPROTO_IP == IPPROTO_TCP) {
64893      stype = SOCK_STREAM; /* XXX test only TCP in case of SOL_SOCKET */
64894      ptype = IPPROTO_TCP;
64895   } else if (IPPROTO_IP == IPPROTO_IP) {
64896      stype = SOCK_DGRAM; /* XXX test only UDP in case of IPPROTO_IP */
64897      ptype = IPPROTO_IP;
64898   } else if (IPPROTO_IP == IPPROTO_UDP) {
64899      stype = SOCK_DGRAM;
64900      ptype = IPPROTO_UDP;
64901   } else {
64902       fprintf(stderr, "error: unexpected socket type: IPPROTO_IP");
64903       exit(1);
64904   }
64905
64906   if((s = socket(PF_INET, stype, ptype)) < 0) {
64907      perror("socket");
64908      exit(1);
64909   }
64910
64911   optval = IP_PORTRANGE_LOW;
64912   optlen = sizeof(optval);
64913   if(setsockopt(s, IPPROTO_IP, IP_PORTRANGE, &optval, optlen) < 0) {
64914      perror("setsockopt: IPPROTO_IP IP_PORTRANGE");
64915      close(s);
64916      exit(1);
64917   }
64918  ;
64919  return 0;
64920}
64921_ACEOF
64922if ac_fn_c_try_compile "$LINENO"; then :
64923  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
64924$as_echo "yes" >&6; }
64925
64926cat >>confdefs.h <<_ACEOF
64927#define SOCKS_IP_PORTRANGE_LOW_SYMNAME "ip_portrange_low"
64928_ACEOF
64929     SOCKOPTVALSYMS="$SOCKOPTVALSYMS${SOCKOPTVALSYMS:+ }IP_PORTRANGE_LOW"
64930else
64931  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
64932$as_echo "no" >&6; }
64933fi
64934rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
64935	    unset symlist
64936	    for sym in $SOCKOPTVALSYMS; do
64937		echo "   { $optid, { .int_val = $sym }, SOCKS_${sym}_SYMNAME }," >> $OPTSRCTMP2
64938		lcsym=`echo $sym | ucase`
64939		symlist="$symlist${symlist:+ }$lcsym"
64940		SOCKOPTSYMCNT=`expr $SOCKOPTSYMCNT + 1`
64941	    done
64942	    if test x"$symlist" != x; then
64943		OKSOCKOPTVALSYMS="$OKSOCKOPTVALSYMS${OKSOCKOPTVALSYMS:+ }$opt($symlist)"
64944	    fi
64945	    ;;
64946
64947	IP_TOS)
64948	    #DSCP (rfc2474), 6 bits (2-7)
64949	    optshift=2
64950	    optmask=0x3F
64951	    optid=$SOCKOPTCNT
64952	    subfield="ip_tos.dscp"
64953
64954cat >>confdefs.h <<_ACEOF
64955#define SOCKS_IP_TOS_DSCP_NAME "$subfield"
64956_ACEOF
64957
64958	    echo "   { $optid, $argtype, ${opt}, SOCKS_${opt}_LVL, SOCKS_${opt}_IPV4, SOCKS_${opt}_IPV6, $calltype, $optshift, $optmask, $dup, $priv, SOCKS_IP_TOS_DSCP_NAME }," >> $OPTSRCTMP1
64959	    SOCKOPTCNT=`expr $SOCKOPTCNT + 1`
64960
64961	    unset symlist
64962	    for sym in $IPTOS_DSCP; do
64963		echo "   { $optid, { .int_val = SOCKS_IP_TOS_DSCP_${sym} }, SOCKS_IP_TOS_DSCP_${sym}_SYMNAME }," >> $OPTSRCTMP2
64964		lcsym=`echo $sym | ucase`
64965		symlist="$symlist${symlist:+ }$lcsym"
64966		SOCKOPTSYMCNT=`expr $SOCKOPTSYMCNT + 1`
64967	    done
64968	    if test x"$symlist" != x; then
64969		OKSOCKOPTVALSYMS="$OKSOCKOPTVALSYMS${OKSOCKOPTVALSYMS:+ }$subfield($symlist)"
64970	    fi
64971
64972	    #Precedence
64973	    optshift=5
64974	    optmask=0x7
64975	    optid=$SOCKOPTCNT
64976	    subfield="ip_tos.prec"
64977
64978cat >>confdefs.h <<_ACEOF
64979#define SOCKS_IP_TOS_PREC_NAME "$subfield"
64980_ACEOF
64981
64982	    echo "   { $optid, $argtype, ${opt}, SOCKS_${opt}_LVL, SOCKS_${opt}_IPV4, SOCKS_${opt}_IPV6, $calltype, $optshift, $optmask, $dup, $priv, SOCKS_IP_TOS_PREC_NAME }," >> $OPTSRCTMP1
64983	    SOCKOPTCNT=`expr $SOCKOPTCNT + 1`
64984
64985	    unset symlist
64986	    for sym in $IPTOS_PREC; do
64987		echo "   { $optid, { .int_val = SOCKS_IP_TOS_PREC_${sym} }, SOCKS_IP_TOS_PREC_${sym}_SYMNAME }," >> $OPTSRCTMP2
64988		lcsym=`echo $sym | ucase`
64989		symlist="$symlist${symlist:+ }$lcsym"
64990		SOCKOPTSYMCNT=`expr $SOCKOPTSYMCNT + 1`
64991	    done
64992	    if test x"$symlist" != x; then
64993		OKSOCKOPTVALSYMS="$OKSOCKOPTVALSYMS${OKSOCKOPTVALSYMS:+ }$subfield($symlist)"
64994	    fi
64995
64996	    #TOS (bits 1-4)
64997	    optshift=1
64998	    optmask=0xf
64999	    optid=$SOCKOPTCNT
65000	    subfield="ip_tos.tos"
65001
65002cat >>confdefs.h <<_ACEOF
65003#define SOCKS_IP_TOS_TOS_NAME "$subfield"
65004_ACEOF
65005
65006	    echo "   { $optid, $argtype, ${opt}, SOCKS_${opt}_LVL, SOCKS_${opt}_IPV4, SOCKS_${opt}_IPV6, $calltype, $optshift, $optmask, $dup, $priv, SOCKS_IP_TOS_TOS_NAME }," >> $OPTSRCTMP1
65007	    SOCKOPTCNT=`expr $SOCKOPTCNT + 1`
65008
65009	    unset symlist
65010	    for sym in $IPTOS_TOS; do
65011		echo "   { $optid, { .int_val = SOCKS_IP_TOS_TOS_${sym} }, SOCKS_IP_TOS_TOS_${sym}_SYMNAME }," >> $OPTSRCTMP2
65012		lcsym=`echo $sym | ucase`
65013		symlist="$symlist${symlist:+ }$lcsym"
65014		SOCKOPTSYMCNT=`expr $SOCKOPTSYMCNT + 1`
65015	    done
65016	    if test x"$symlist" != x; then
65017		OKSOCKOPTVALSYMS="$OKSOCKOPTVALSYMS${OKSOCKOPTVALSYMS:+ }$subfield($symlist)"
65018	    fi
65019	    ;;
65020    esac
65021done
65022
65023#hostid options (only set first)
65024unset HOSTIDTYPE
65025{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported hostid type" >&5
65026$as_echo_n "checking for supported hostid type... " >&6; }
65027for opt in $HOSTIDSOCKOPTS; do
65028    argtype=`sockopt2argtype $opt`
65029
65030    calltype="preonly" #default
65031    if optargmatch "${SOCKOPTS_POSTONLY}" $opt; then
65032       calltype="postonly"
65033    fi
65034    if optargmatch "${SOCKOPTS_ANYTIME}" $opt; then
65035       calltype="anytime"
65036    fi
65037
65038    optshift=0
65039    optmask=0
65040
65041    if optargmatch "${SOCKOPTS_DUP}" $opt; then
65042       dup=1
65043    else
65044       dup=0
65045    fi
65046
65047    priv=0
65048
65049    if optargmatch "${SOCKOPTS_PRIV}" $opt; then
65050       priv=1
65051    else
65052       priv=0
65053    fi
65054
65055    optid=$SOCKOPTCNT
65056
65057
65058cat >>confdefs.h <<_ACEOF
65059#define SOCKS_HOSTID_NAME "hostid"
65060_ACEOF
65061
65062    echo "   { $optid, $argtype, ${opt}, SOCKS_${opt}_LVL, SOCKS_${opt}_IPV4, SOCKS_${opt}_IPV6, $calltype, $optshift, $optmask, $dup, $priv, SOCKS_HOSTID_NAME }," >> $OPTSRCTMP1
65063
65064cat >>confdefs.h <<_ACEOF
65065#define SOCKS_HOSTID_TYPE SOCKS_HOSTID_TYPE_${opt}
65066_ACEOF
65067
65068    SOCKOPTCNT=`expr $SOCKOPTCNT + 1`
65069    HOSTIDTYPE=$opt
65070
65071    #add supported arguments
65072    unset symlist
65073    for sym in NONE PASS ADDCLIENT SETCLIENT; do
65074	echo "   { $optid, { .int_val = SOCKS_HOSTID_$sym }, SOCKS_HOSTID_${sym}_SYMNAME }," >> $OPTSRCTMP2
65075	SOCKOPTSYMCNT=`expr $SOCKOPTSYMCNT + 1`
65076    done
65077    OKSOCKOPTVALSYMS="$OKSOCKOPTVALSYMS${OKSOCKOPTVALSYMS:+ }hostid(none pass add-client set-client)"
65078    OKSOCKOPTS="$OKSOCKOPTS${OKSOCKOPTS:+ }hostid($opt)"
65079
65080    break #end after first entry
65081done
65082if test x"$HOSTIDTYPE" = x; then
65083    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65084$as_echo "no" >&6; }
65085
65086$as_echo "#define SOCKS_HOSTID_TYPE SOCKS_HOSTID_TYPE_NONE" >>confdefs.h
65087
65088else
65089    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HOSTIDTYPE" >&5
65090$as_echo "$HOSTIDTYPE" >&6; }
65091    FEAT="$FEAT${FEAT:+ }hostid"
65092fi
65093
65094#options that are not settable by users
65095for opt in $INVALIDSOCKOPTS; do
65096    calltype="invalid"
65097    argtype=`sockopt2argtype $opt`
65098    optshift=0
65099    optmask=0
65100    priv=0
65101    optid=$SOCKOPTCNT
65102
65103    echo "   { $optid, $argtype, ${opt}, SOCKS_${opt}_LVL, SOCKS_${opt}_IPV4, SOCKS_${opt}_IPV6, $calltype, $optshift, $optmask, $dup, $priv, SOCKS_${opt}_NAME }," >> $OPTSRCTMP1
65104    SOCKOPTCNT=`expr $SOCKOPTCNT + 1`
65105done
65106
65107OPTNAMEMAXLEN=0
65108for opt in $ALLSOCKOPTS $INVALIDSOCKOPTS; do
65109    namelen=`echo $opt | wc -c` #should include newline
65110    if test $namelen -gt $OPTNAMEMAXLEN; then
65111       OPTNAMEMAXLEN=$namelen
65112    fi
65113done
65114
65115cat >>confdefs.h <<_ACEOF
65116#define SOCKOPTNAME_MAXLEN $OPTNAMEMAXLEN
65117_ACEOF
65118
65119
65120#generate source file
65121case $APP in
65122    dante)
65123	SOCKOPTSRC="lib/sockopt_gen.c"
65124	;;
65125    *)
65126	SOCKOPTSRC="src/sockopt_gen.c"
65127	;;
65128esac
65129cp /dev/null $SOCKOPTSRC
65130echo "/* NOTICE: $SOCKOPTSRC Generated by configure */" >>$SOCKOPTSRC
65131echo "" >> $SOCKOPTSRC
65132
65133#quotes around argument added to avoid [] in text from disappearing
65134echo 'static const struct option option[] = {' >> $SOCKOPTSRC
65135cat $OPTSRCTMP0 >> $SOCKOPTSRC
65136echo '};' >> $SOCKOPTSRC
65137echo '' >> $SOCKOPTSRC
65138
65139cat >>confdefs.h <<_ACEOF
65140#define HAVE_DUPSOCKOPT_MAX $DUPSOCKOPTCNT
65141_ACEOF
65142
65143#quotes around argument added to avoid [] in text from disappearing
65144echo 'static const sockopt_t sockopts[] = {' >> $SOCKOPTSRC
65145#list of options that can be set also after connection has been established
65146cat $OPTSRCTMP1 >> $SOCKOPTSRC
65147echo '};' >> $SOCKOPTSRC
65148
65149cat >>confdefs.h <<_ACEOF
65150#define HAVE_SOCKOPTVAL_MAX $SOCKOPTCNT
65151_ACEOF
65152
65153#add symbolic values for options
65154echo '' >> $SOCKOPTSRC
65155#quotes around argument added to avoid [] in text from disappearing
65156echo 'static const sockoptvalsym_t sockoptvalsyms[] = {' >> $SOCKOPTSRC
65157cat $OPTSRCTMP2 >> $SOCKOPTSRC
65158echo '};' >> $SOCKOPTSRC
65159
65160cat >>confdefs.h <<_ACEOF
65161#define HAVE_SOCKOPTVALSYM_MAX $SOCKOPTSYMCNT
65162_ACEOF
65163
65164rm -f "$OPTSRCTMP0" "$OPTSRCTMP1" "$OPTSRCTMP2"
65165
65166#set value for server -v option
65167UCOKSOCKOPTS_SO=`echo $OKSOCKOPTS | ucase | xargs -n1 | egrep 'SO_' | xargs`
65168
65169cat >>confdefs.h <<_ACEOF
65170#define DANTE_SOCKOPTS_SO "${UCOKSOCKOPTS_SO}"
65171_ACEOF
65172
65173UCOKSOCKOPTS_IPV4=`echo $OKSOCKOPTS | ucase | xargs -n1 | egrep 'IP_' | xargs`
65174
65175cat >>confdefs.h <<_ACEOF
65176#define DANTE_SOCKOPTS_IPV4 "${UCOKSOCKOPTS_IPV4}"
65177_ACEOF
65178
65179UCOKSOCKOPTS_IPV6=`echo $OKSOCKOPTS | ucase | xargs -n1 | egrep 'IPV6_' | xargs`
65180
65181cat >>confdefs.h <<_ACEOF
65182#define DANTE_SOCKOPTS_IPV6 "${UCOKSOCKOPTS_IPV6}"
65183_ACEOF
65184
65185UCOKSOCKOPTS_TCP=`echo $OKSOCKOPTS | ucase | xargs -n1 | egrep 'TCP_' | xargs`
65186
65187cat >>confdefs.h <<_ACEOF
65188#define DANTE_SOCKOPTS_TCP "${UCOKSOCKOPTS_TCP}"
65189_ACEOF
65190
65191UCOKSOCKOPTS_UDP=`echo $OKSOCKOPTS | ucase | xargs -n1 | egrep 'UDP_' | xargs`
65192
65193cat >>confdefs.h <<_ACEOF
65194#define DANTE_SOCKOPTS_UDP "${UCOKSOCKOPTS_UDP}"
65195_ACEOF
65196
65197
65198
65199#look for modules, and check version
65200servdir=sockd
65201unset MOD_BANDWIDTH MOD_REDIRECT MOD_LDAP MOD_PAC MOD_CONVSID
65202{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for module bandwidth" >&5
65203$as_echo_n "checking for module bandwidth... " >&6; }
65204 if test -f "licensed/bandwidth.c"; then
65205	MINVER="109"
65206	unset MODVER
65207	MODLINE=`head -1 licensed/bandwidth.c | grep MODVER`
65208	if test x"$MODLINE" != x; then
65209		MODVER=`echo "$MODLINE" | cut -d: -f 2`
65210	fi
65211
65212				if test x"$MODVER" = x; then
65213		MODVER=`awk '/Id:/{ split($''4,a,".");print a[2]; exit }' licensed/bandwidth.c`
65214	fi
65215	if test "$MODVER" -lt "$MINVER"; then
65216		echo "" >&2
65217		echo "You have version 1.$MODVER of the bandwidth module, which is outdated." >&2
65218		echo "This version of Dante requires at least version 1.$MINVER." >&2
65219		echo "Please contact Inferno Nettverk A/S for an updated" >&2
65220		echo "version before you attempt to compile." >&2
65221		echo "Inferno Nettverk A/S can be reached at info@inet.no." >&2
65222		echo "" >&2
65223		echo "There is no additional cost for upgrading." >&2
65224		exit 1
65225	fi
65226
65227	#command to run in case of success
65228	MOD_BANDWIDTH=t
65229
65230	unset HAVEMOD_BANDWIDTH
65231
65232$as_echo "#define HAVE_MODULE_BANDWIDTH 1" >>confdefs.h
65233	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
65234$as_echo "yes" >&6; }
65235else
65236	HAVEMOD_BANDWIDTH=un
65237
65238	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65239$as_echo "no" >&6; }
65240fi
65241ac_sources="${HAVEMOD_BANDWIDTH}licensed/bandwidth.c"
65242ac_dests="$servdir/bandwidth.c"
65243while test -n "$ac_sources"; do
65244  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65245  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65246  ac_config_links_1="$ac_config_links_1 $ac_dest:$ac_source"
65247done
65248ac_config_links="$ac_config_links $ac_config_links_1"
65249
65250if test x"" != xnokey; then
65251    ac_sources="${HAVEMOD_BANDWIDTH}licensed/bandwidth_key.c"
65252ac_dests="$servdir/bandwidth_key.c"
65253while test -n "$ac_sources"; do
65254  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65255  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65256  ac_config_links_2="$ac_config_links_2 $ac_dest:$ac_source"
65257done
65258ac_config_links="$ac_config_links $ac_config_links_2"
65259
65260fi
65261
65262{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for module redirect" >&5
65263$as_echo_n "checking for module redirect... " >&6; }
65264 if test -f "licensed/redirect.c"; then
65265	MINVER="79"
65266	unset MODVER
65267	MODLINE=`head -1 licensed/redirect.c | grep MODVER`
65268	if test x"$MODLINE" != x; then
65269		MODVER=`echo "$MODLINE" | cut -d: -f 2`
65270	fi
65271
65272				if test x"$MODVER" = x; then
65273		MODVER=`awk '/Id:/{ split($''4,a,".");print a[2]; exit }' licensed/redirect.c`
65274	fi
65275	if test "$MODVER" -lt "$MINVER"; then
65276		echo "" >&2
65277		echo "You have version 1.$MODVER of the redirect module, which is outdated." >&2
65278		echo "This version of Dante requires at least version 1.$MINVER." >&2
65279		echo "Please contact Inferno Nettverk A/S for an updated" >&2
65280		echo "version before you attempt to compile." >&2
65281		echo "Inferno Nettverk A/S can be reached at info@inet.no." >&2
65282		echo "" >&2
65283		echo "There is no additional cost for upgrading." >&2
65284		exit 1
65285	fi
65286
65287	#command to run in case of success
65288	MOD_REDIRECT=t
65289
65290	unset HAVEMOD_REDIRECT
65291
65292$as_echo "#define HAVE_MODULE_REDIRECT 1" >>confdefs.h
65293	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
65294$as_echo "yes" >&6; }
65295else
65296	HAVEMOD_REDIRECT=un
65297
65298	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65299$as_echo "no" >&6; }
65300fi
65301ac_sources="${HAVEMOD_REDIRECT}licensed/redirect.c"
65302ac_dests="$servdir/redirect.c"
65303while test -n "$ac_sources"; do
65304  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65305  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65306  ac_config_links_3="$ac_config_links_3 $ac_dest:$ac_source"
65307done
65308ac_config_links="$ac_config_links $ac_config_links_3"
65309
65310if test x"" != xnokey; then
65311    ac_sources="${HAVEMOD_REDIRECT}licensed/redirect_key.c"
65312ac_dests="$servdir/redirect_key.c"
65313while test -n "$ac_sources"; do
65314  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65315  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65316  ac_config_links_4="$ac_config_links_4 $ac_dest:$ac_source"
65317done
65318ac_config_links="$ac_config_links $ac_config_links_4"
65319
65320fi
65321
65322{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for module ldap" >&5
65323$as_echo_n "checking for module ldap... " >&6; }
65324 if test -f "licensed/ldap.c"; then
65325	MINVER="211"
65326	unset MODVER
65327	MODLINE=`head -1 licensed/ldap.c | grep MODVER`
65328	if test x"$MODLINE" != x; then
65329		MODVER=`echo "$MODLINE" | cut -d: -f 2`
65330	fi
65331
65332				if test x"$MODVER" = x; then
65333		MODVER=`awk '/Id:/{ split($''4,a,".");print a[2]; exit }' licensed/ldap.c`
65334	fi
65335	if test "$MODVER" -lt "$MINVER"; then
65336		echo "" >&2
65337		echo "You have version 1.$MODVER of the ldap module, which is outdated." >&2
65338		echo "This version of Dante requires at least version 1.$MINVER." >&2
65339		echo "Please contact Inferno Nettverk A/S for an updated" >&2
65340		echo "version before you attempt to compile." >&2
65341		echo "Inferno Nettverk A/S can be reached at info@inet.no." >&2
65342		echo "" >&2
65343		echo "There is no additional cost for upgrading." >&2
65344		exit 1
65345	fi
65346
65347	#command to run in case of success
65348	MOD_LDAP=t
65349
65350	unset HAVEMOD_LDAP
65351
65352$as_echo "#define HAVE_MODULE_LDAP 1" >>confdefs.h
65353	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
65354$as_echo "yes" >&6; }
65355else
65356	HAVEMOD_LDAP=un
65357
65358	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65359$as_echo "no" >&6; }
65360fi
65361ac_sources="${HAVEMOD_LDAP}licensed/ldap.c"
65362ac_dests="$servdir/ldap.c"
65363while test -n "$ac_sources"; do
65364  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65365  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65366  ac_config_links_5="$ac_config_links_5 $ac_dest:$ac_source"
65367done
65368ac_config_links="$ac_config_links $ac_config_links_5"
65369
65370if test x"" != xnokey; then
65371    ac_sources="${HAVEMOD_LDAP}licensed/ldap_key.c"
65372ac_dests="$servdir/ldap_key.c"
65373while test -n "$ac_sources"; do
65374  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65375  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65376  ac_config_links_6="$ac_config_links_6 $ac_dest:$ac_source"
65377done
65378ac_config_links="$ac_config_links $ac_config_links_6"
65379
65380fi
65381
65382{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for module pac" >&5
65383$as_echo_n "checking for module pac... " >&6; }
65384 if test -f "licensed/pac.c"; then
65385	MINVER="30"
65386	unset MODVER
65387	MODLINE=`head -1 licensed/pac.c | grep MODVER`
65388	if test x"$MODLINE" != x; then
65389		MODVER=`echo "$MODLINE" | cut -d: -f 2`
65390	fi
65391
65392				if test x"$MODVER" = x; then
65393		MODVER=`awk '/Id:/{ split($''4,a,".");print a[2]; exit }' licensed/pac.c`
65394	fi
65395	if test "$MODVER" -lt "$MINVER"; then
65396		echo "" >&2
65397		echo "You have version 1.$MODVER of the pac module, which is outdated." >&2
65398		echo "This version of Dante requires at least version 1.$MINVER." >&2
65399		echo "Please contact Inferno Nettverk A/S for an updated" >&2
65400		echo "version before you attempt to compile." >&2
65401		echo "Inferno Nettverk A/S can be reached at info@inet.no." >&2
65402		echo "" >&2
65403		echo "There is no additional cost for upgrading." >&2
65404		exit 1
65405	fi
65406
65407	#command to run in case of success
65408	MOD_PAC=t
65409
65410	unset HAVEMOD_PAC
65411
65412$as_echo "#define HAVE_MODULE_PAC 1" >>confdefs.h
65413	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
65414$as_echo "yes" >&6; }
65415else
65416	HAVEMOD_PAC=un
65417
65418	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65419$as_echo "no" >&6; }
65420fi
65421ac_sources="${HAVEMOD_PAC}licensed/pac.c"
65422ac_dests="$servdir/pac.c"
65423while test -n "$ac_sources"; do
65424  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65425  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65426  ac_config_links_7="$ac_config_links_7 $ac_dest:$ac_source"
65427done
65428ac_config_links="$ac_config_links $ac_config_links_7"
65429
65430if test x"" != xnokey; then
65431    ac_sources="${HAVEMOD_PAC}licensed/pac_key.c"
65432ac_dests="$servdir/pac_key.c"
65433while test -n "$ac_sources"; do
65434  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65435  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65436  ac_config_links_8="$ac_config_links_8 $ac_dest:$ac_source"
65437done
65438ac_config_links="$ac_config_links $ac_config_links_8"
65439
65440fi
65441
65442{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for module checkmodule" >&5
65443$as_echo_n "checking for module checkmodule... " >&6; }
65444 if test -f "licensed/checkmodule.c"; then
65445	MINVER="80"
65446	unset MODVER
65447	MODLINE=`head -1 licensed/checkmodule.c | grep MODVER`
65448	if test x"$MODLINE" != x; then
65449		MODVER=`echo "$MODLINE" | cut -d: -f 2`
65450	fi
65451
65452				if test x"$MODVER" = x; then
65453		MODVER=`awk '/Id:/{ split($''4,a,".");print a[2]; exit }' licensed/checkmodule.c`
65454	fi
65455	if test "$MODVER" -lt "$MINVER"; then
65456		echo "" >&2
65457		echo "You have version 1.$MODVER of the checkmodule module, which is outdated." >&2
65458		echo "This version of Dante requires at least version 1.$MINVER." >&2
65459		echo "Please contact Inferno Nettverk A/S for an updated" >&2
65460		echo "version before you attempt to compile." >&2
65461		echo "Inferno Nettverk A/S can be reached at info@inet.no." >&2
65462		echo "" >&2
65463		echo "There is no additional cost for upgrading." >&2
65464		exit 1
65465	fi
65466
65467	#command to run in case of success
65468
65469
65470	unset HAVEMOD_CHECKMODULE
65471
65472$as_echo "#define HAVE_MODULE_CHECKMODULE 1" >>confdefs.h
65473	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
65474$as_echo "yes" >&6; }
65475else
65476	HAVEMOD_CHECKMODULE=un
65477
65478	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65479$as_echo "no" >&6; }
65480fi
65481ac_sources="${HAVEMOD_CHECKMODULE}licensed/checkmodule.c"
65482ac_dests="$servdir/checkmodule.c"
65483while test -n "$ac_sources"; do
65484  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65485  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65486  ac_config_links_9="$ac_config_links_9 $ac_dest:$ac_source"
65487done
65488ac_config_links="$ac_config_links $ac_config_links_9"
65489
65490if test x"nokey" != xnokey; then
65491    ac_sources="${HAVEMOD_CHECKMODULE}licensed/checkmodule_key.c"
65492ac_dests="$servdir/checkmodule_key.c"
65493while test -n "$ac_sources"; do
65494  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65495  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65496  ac_config_links_10="$ac_config_links_10 $ac_dest:$ac_source"
65497done
65498ac_config_links="$ac_config_links $ac_config_links_10"
65499
65500fi
65501 #helper file
65502{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for module convert_sid" >&5
65503$as_echo_n "checking for module convert_sid... " >&6; }
65504 if test -f "licensed/convert_sid.c"; then
65505	MINVER="1"
65506	unset MODVER
65507	MODLINE=`head -1 licensed/convert_sid.c | grep MODVER`
65508	if test x"$MODLINE" != x; then
65509		MODVER=`echo "$MODLINE" | cut -d: -f 2`
65510	fi
65511
65512				if test x"$MODVER" = x; then
65513		MODVER=`awk '/Id:/{ split($''4,a,".");print a[2]; exit }' licensed/convert_sid.c`
65514	fi
65515	if test "$MODVER" -lt "$MINVER"; then
65516		echo "" >&2
65517		echo "You have version 1.$MODVER of the convert_sid module, which is outdated." >&2
65518		echo "This version of Dante requires at least version 1.$MINVER." >&2
65519		echo "Please contact Inferno Nettverk A/S for an updated" >&2
65520		echo "version before you attempt to compile." >&2
65521		echo "Inferno Nettverk A/S can be reached at info@inet.no." >&2
65522		echo "" >&2
65523		echo "There is no additional cost for upgrading." >&2
65524		exit 1
65525	fi
65526
65527	#command to run in case of success
65528	MOD_CONVSID=t
65529
65530	unset HAVEMOD_CONVERT_SID
65531
65532$as_echo "#define HAVE_MODULE_CONVERT_SID 1" >>confdefs.h
65533	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
65534$as_echo "yes" >&6; }
65535else
65536	HAVEMOD_CONVERT_SID=un
65537
65538	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
65539$as_echo "no" >&6; }
65540fi
65541ac_sources="${HAVEMOD_CONVERT_SID}licensed/convert_sid.c"
65542ac_dests=""bin"/convert_sid.c"
65543while test -n "$ac_sources"; do
65544  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65545  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65546  ac_config_links_11="$ac_config_links_11 $ac_dest:$ac_source"
65547done
65548ac_config_links="$ac_config_links $ac_config_links_11"
65549
65550if test x"nokey" != xnokey; then
65551    ac_sources="${HAVEMOD_CONVERT_SID}licensed/convert_sid_key.c"
65552ac_dests=""bin"/convert_sid_key.c"
65553while test -n "$ac_sources"; do
65554  set $ac_dests; ac_dest=$1; shift; ac_dests=$*
65555  set $ac_sources; ac_source=$1; shift; ac_sources=$*
65556  ac_config_links_12="$ac_config_links_12 $ac_dest:$ac_source"
65557done
65558ac_config_links="$ac_config_links $ac_config_links_12"
65559
65560fi
65561
65562
65563if test x"$MOD_BANDWIDTH" != x; then
65564   FEAT="$FEAT${FEAT:+ }mod-bandwidth"
65565fi
65566unset have_ldap
65567if test x"$MOD_LDAP" != x -a x"${no_ldap}" = x -a x"${no_gssapi}" = x; then
65568   FEAT="$FEAT${FEAT:+ }mod-ldap"
65569   SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$LDAPLIBS"
65570
65571$as_echo "#define HAVE_LDAP 1" >>confdefs.h
65572
65573   have_ldap=t
65574fi
65575unset have_pac
65576if test x"$MOD_PAC" != x -a x"$MOD_LDAP" -a x"${no_ldap}" = x \
65577     -a x"${no_pac}" = x -a x"${no_gssapi}" = x -a x"${no_krb5}" = x; then
65578   FEAT="$FEAT${FEAT:+ }mod-pac"
65579
65580$as_echo "#define HAVE_PAC 1" >>confdefs.h
65581
65582   have_pac=t
65583   if test x"${have_ldap}" = x; then
65584      SOCKDDEPS="${SOCKDDEPS}${SOCKDDEPS:+ }$LDAPLIBS"
65585   fi
65586fi
65587 if test x"${have_pac}" != x; then
65588  HAVEMOD_PAC_TRUE=
65589  HAVEMOD_PAC_FALSE='#'
65590else
65591  HAVEMOD_PAC_TRUE='#'
65592  HAVEMOD_PAC_FALSE=
65593fi
65594
65595
65596if test x"$MOD_REDIRECT" != x; then
65597   FEAT="$FEAT${FEAT:+ }mod-redirect"
65598fi
65599FEAT="$FEAT${FEAT:+ }sess2" #session code now part of base
65600
65601if test x"$prerelease" != x; then
65602   FEAT="$FEAT${FEAT:+ }prerel" #prerelease build
65603fi
65604
65605#standard features
65606FEAT="$FEAT${FEAT:+ }mon-data mon-disconnect" #monitoring code
65607
65608#construct SUBDIRS variable
65609SUBDIRS="unlicensed example doc bin SPECS capi contrib"
65610DISTSUBDIRS="$SUBDIRS"
65611UNITSUBDIRS="" #dirs to do unit testing in
65612if test x"$NOSERVER" = x; then
65613   SUBDIRS="sockd ${SUBDIRS}"
65614   UNITSUBDIRS="sockd ${UNITSUBDIRS}"
65615fi
65616DISTSUBDIRS="$DISTSUBDIRS sockd"
65617if test x"$NOCLIENT" = x; then
65618   if test x"${no_preload_client}" = x; then
65619       SUBDIRS="dlib $SUBDIRS"
65620       UNITSUBDIRS="dlib ${UNITSUBDIRS}"
65621       if test x"$sol64" != x; then
65622           SUBDIRS="dlib64 $SUBDIRS"
65623           UNITSUBDIRS="dlib64 ${UNITSUBDIRS}"
65624       fi
65625       FEAT="$FEAT${FEAT:+ }preload"
65626   fi
65627   #lib handles yacc/lex generation for dlib/sockd, should be before these
65628   SUBDIRS="lib $SUBDIRS"
65629   UNITSUBDIRS="lib ${UNITSUBDIRS}"
65630fi
65631DISTSUBDIRS="include libscompat $DISTSUBDIRS lib dlib dlib64"
65632
65633#include should be done before compilation to ensure that
65634#redefac is executed first
65635TOPSUBDIRS="$subdirs include"
65636#libscompat no longer built directly, but build for prereleases for testing
65637if test x"${build_libscompat}" != x; then
65638    TOPSUBDIRS="$TOPSUBDIRS libscompat"
65639    LIBSCOMPAT="-lscompat"
65640    LDFLAGS="$LDFLAGS${LDFLAGS:+ }-L../libscompat"
65641else
65642    unset LIBSCOMPAT
65643fi
65644TOPSUBDIRS="$TOPSUBDIRS $SUBDIRS"
65645
65646
65647
65648
65649
65650
65651
65652
65653#set build features for server -v option
65654FEATURES=`echo $FEAT | xargs -n 1 echo | sort | xargs echo`
65655
65656cat >>confdefs.h <<_ACEOF
65657#define DANTE_BUILD "$FEATURES"
65658_ACEOF
65659
65660
65661#add libcfail
65662if test x"$have_libcfail" != x; then
65663    LIBS="$LIBS${LIBS:+ }-lcfail"
65664fi
65665
65666#add any warning flags (value set above)
65667CFLAGS="$CFLAGS $warn"
65668
65669#store build environment
65670cp /dev/null buildenv.txt
65671echo "flags: ${ac_configure_args}" >> buildenv.txt
65672echo "CC: $CC $initCC" >> buildenv.txt
65673echo "CFLAGS: $CFLAGS $initCFLAGS" >> buildenv.txt
65674echo "CPP: $CPP $initCPP" >> buildenv.txt
65675echo "CPPFLAGS: $CPPFLAGS $initCPPFLAGS" >> buildenv.txt
65676echo "LDFLAGS: $LDFLAGS $initLDFLAGS" >> buildenv.txt
65677echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}" >> buildenv.txt
65678echo "LIBS: $LIBS $initLIBS" >> buildenv.txt
65679echo "DLIBDEPS: $DLIBDEPS" >> buildenv.txt
65680echo "SOCKDDEPS: $SOCKDDEPS" >> buildenv.txt
65681echo "compiler flags: $comp_flags" >> buildenv.txt
65682echo "warning flags: $warn" >> buildenv.txt
65683echo "FEATURES: $FEAT" >> buildenv.txt
65684echo "compat: $COMPATFUNCS" >> buildenv.txt
65685echo "socket options (socket level): `echo ${UCOKSOCKOPTS_SO} | ucase`" >> buildenv.txt
65686echo "socket options (ipv4 level): `echo ${UCOKSOCKOPTS_IPV4} | ucase`" >> buildenv.txt
65687echo "socket options (ipv6 level): `echo ${UCOKSOCKOPTS_IPV6} | ucase`" >> buildenv.txt
65688echo "socket options (tcp level): `echo ${UCOKSOCKOPTS_TCP} | ucase`" >> buildenv.txt
65689echo "socket options (udp level): `echo ${UCOKSOCKOPTS_UDP} | ucase`" >> buildenv.txt
65690echo "socket option arguments: `echo $OKSOCKOPTVALSYMS | ucase`" >> buildenv.txt
65691
65692cat buildenv.txt
65693
65694echo "#build environment
65695export CC=\"$CC\"
65696export CFLAGS=\"$CFLAGS\"
65697export CPP=\"$CPP\"
65698export CPPFLAGS=\"$CPPFLAGS\"
65699export LDFLAGS=\"$LDFLAGS\"
65700export SOCKDDEPS=\"$SOCKDDEPS\"
65701export LIBS=\"$LIBS\"" > buildenvrc
65702
65703ac_config_files="$ac_config_files sockd/Makefile include/Makefile lib/Makefile dlib/Makefile"
65704
65705ac_config_files="$ac_config_files Makefile example/Makefile doc/Makefile bin/Makefile"
65706
65707ac_config_files="$ac_config_files capi/Makefile SPECS/Makefile SPECS/dante.spec"
65708
65709ac_config_files="$ac_config_files libscompat/Makefile contrib/Makefile"
65710
65711ac_config_files="$ac_config_files unlicensed/Makefile VERSION dlib64/Makefile"
65712
65713
65714#change all #undef's to #define foo 0
65715
65716
65717cat >confcache <<\_ACEOF
65718# This file is a shell script that caches the results of configure
65719# tests run on this system so they can be shared between configure
65720# scripts and configure runs, see configure's option --config-cache.
65721# It is not useful on other systems.  If it contains results you don't
65722# want to keep, you may remove or edit it.
65723#
65724# config.status only pays attention to the cache file if you give it
65725# the --recheck option to rerun configure.
65726#
65727# `ac_cv_env_foo' variables (set or unset) will be overridden when
65728# loading this file, other *unset* `ac_cv_foo' will be assigned the
65729# following values.
65730
65731_ACEOF
65732
65733# The following way of writing the cache mishandles newlines in values,
65734# but we know of no workaround that is simple, portable, and efficient.
65735# So, we kill variables containing newlines.
65736# Ultrix sh set writes to stderr and can't be redirected directly,
65737# and sets the high bit in the cache file unless we assign to the vars.
65738(
65739  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
65740    eval ac_val=\$$ac_var
65741    case $ac_val in #(
65742    *${as_nl}*)
65743      case $ac_var in #(
65744      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
65745$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
65746      esac
65747      case $ac_var in #(
65748      _ | IFS | as_nl) ;; #(
65749      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
65750      *) { eval $ac_var=; unset $ac_var;} ;;
65751      esac ;;
65752    esac
65753  done
65754
65755  (set) 2>&1 |
65756    case $as_nl`(ac_space=' '; set) 2>&1` in #(
65757    *${as_nl}ac_space=\ *)
65758      # `set' does not quote correctly, so add quotes: double-quote
65759      # substitution turns \\\\ into \\, and sed turns \\ into \.
65760      sed -n \
65761	"s/'/'\\\\''/g;
65762	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
65763      ;; #(
65764    *)
65765      # `set' quotes correctly as required by POSIX, so do not add quotes.
65766      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
65767      ;;
65768    esac |
65769    sort
65770) |
65771  sed '
65772     /^ac_cv_env_/b end
65773     t clear
65774     :clear
65775     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
65776     t end
65777     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
65778     :end' >>confcache
65779if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
65780  if test -w "$cache_file"; then
65781    if test "x$cache_file" != "x/dev/null"; then
65782      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
65783$as_echo "$as_me: updating cache $cache_file" >&6;}
65784      if test ! -f "$cache_file" || test -h "$cache_file"; then
65785	cat confcache >"$cache_file"
65786      else
65787        case $cache_file in #(
65788        */* | ?:*)
65789	  mv -f confcache "$cache_file"$$ &&
65790	  mv -f "$cache_file"$$ "$cache_file" ;; #(
65791        *)
65792	  mv -f confcache "$cache_file" ;;
65793	esac
65794      fi
65795    fi
65796  else
65797    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
65798$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
65799  fi
65800fi
65801rm -f confcache
65802
65803test "x$prefix" = xNONE && prefix=$ac_default_prefix
65804# Let make expand exec_prefix.
65805test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
65806
65807DEFS=-DHAVE_CONFIG_H
65808
65809ac_libobjs=
65810ac_ltlibobjs=
65811for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
65812  # 1. Remove the extension, and $U if already installed.
65813  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
65814  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
65815  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
65816  #    will be set to the directory where LIBOBJS objects are built.
65817  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
65818  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
65819done
65820LIBOBJS=$ac_libobjs
65821
65822LTLIBOBJS=$ac_ltlibobjs
65823
65824
65825{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
65826$as_echo_n "checking that generated files are newer than configure... " >&6; }
65827   if test -n "$am_sleep_pid"; then
65828     # Hide warnings about reused PIDs.
65829     wait $am_sleep_pid 2>/dev/null
65830   fi
65831   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
65832$as_echo "done" >&6; }
65833 if test -n "$EXEEXT"; then
65834  am__EXEEXT_TRUE=
65835  am__EXEEXT_FALSE='#'
65836else
65837  am__EXEEXT_TRUE='#'
65838  am__EXEEXT_FALSE=
65839fi
65840
65841if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
65842  as_fn_error $? "conditional \"AMDEP\" was never defined.
65843Usually this means the macro was only invoked conditionally." "$LINENO" 5
65844fi
65845if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
65846  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
65847Usually this means the macro was only invoked conditionally." "$LINENO" 5
65848fi
65849if test -z "${PRERELEASE_TRUE}" && test -z "${PRERELEASE_FALSE}"; then
65850  as_fn_error $? "conditional \"PRERELEASE\" was never defined.
65851Usually this means the macro was only invoked conditionally." "$LINENO" 5
65852fi
65853if test -z "${RUNLINT_TRUE}" && test -z "${RUNLINT_FALSE}"; then
65854  as_fn_error $? "conditional \"RUNLINT\" was never defined.
65855Usually this means the macro was only invoked conditionally." "$LINENO" 5
65856fi
65857if test -z "${SERVER_INTERPOSITION_TRUE}" && test -z "${SERVER_INTERPOSITION_FALSE}"; then
65858  as_fn_error $? "conditional \"SERVER_INTERPOSITION\" was never defined.
65859Usually this means the macro was only invoked conditionally." "$LINENO" 5
65860fi
65861if test -z "${SERVER_INTERPOSITION_ALWAYS_TRUE}" && test -z "${SERVER_INTERPOSITION_ALWAYS_FALSE}"; then
65862  as_fn_error $? "conditional \"SERVER_INTERPOSITION_ALWAYS\" was never defined.
65863Usually this means the macro was only invoked conditionally." "$LINENO" 5
65864fi
65865if test -z "${HAVEMOD_PAC_TRUE}" && test -z "${HAVEMOD_PAC_FALSE}"; then
65866  as_fn_error $? "conditional \"HAVEMOD_PAC\" was never defined.
65867Usually this means the macro was only invoked conditionally." "$LINENO" 5
65868fi
65869
65870: "${CONFIG_STATUS=./config.status}"
65871ac_write_fail=0
65872ac_clean_files_save=$ac_clean_files
65873ac_clean_files="$ac_clean_files $CONFIG_STATUS"
65874{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
65875$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
65876as_write_fail=0
65877cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
65878#! $SHELL
65879# Generated by $as_me.
65880# Run this file to recreate the current configuration.
65881# Compiler output produced by configure, useful for debugging
65882# configure, is in config.log if it exists.
65883
65884debug=false
65885ac_cs_recheck=false
65886ac_cs_silent=false
65887
65888SHELL=\${CONFIG_SHELL-$SHELL}
65889export SHELL
65890_ASEOF
65891cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
65892## -------------------- ##
65893## M4sh Initialization. ##
65894## -------------------- ##
65895
65896# Be more Bourne compatible
65897DUALCASE=1; export DUALCASE # for MKS sh
65898if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
65899  emulate sh
65900  NULLCMD=:
65901  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
65902  # is contrary to our usage.  Disable this feature.
65903  alias -g '${1+"$@"}'='"$@"'
65904  setopt NO_GLOB_SUBST
65905else
65906  case `(set -o) 2>/dev/null` in #(
65907  *posix*) :
65908    set -o posix ;; #(
65909  *) :
65910     ;;
65911esac
65912fi
65913
65914
65915as_nl='
65916'
65917export as_nl
65918# Printing a long string crashes Solaris 7 /usr/bin/printf.
65919as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
65920as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
65921as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
65922# Prefer a ksh shell builtin over an external printf program on Solaris,
65923# but without wasting forks for bash or zsh.
65924if test -z "$BASH_VERSION$ZSH_VERSION" \
65925    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
65926  as_echo='print -r --'
65927  as_echo_n='print -rn --'
65928elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
65929  as_echo='printf %s\n'
65930  as_echo_n='printf %s'
65931else
65932  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
65933    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
65934    as_echo_n='/usr/ucb/echo -n'
65935  else
65936    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
65937    as_echo_n_body='eval
65938      arg=$1;
65939      case $arg in #(
65940      *"$as_nl"*)
65941	expr "X$arg" : "X\\(.*\\)$as_nl";
65942	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
65943      esac;
65944      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
65945    '
65946    export as_echo_n_body
65947    as_echo_n='sh -c $as_echo_n_body as_echo'
65948  fi
65949  export as_echo_body
65950  as_echo='sh -c $as_echo_body as_echo'
65951fi
65952
65953# The user is always right.
65954if test "${PATH_SEPARATOR+set}" != set; then
65955  PATH_SEPARATOR=:
65956  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
65957    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
65958      PATH_SEPARATOR=';'
65959  }
65960fi
65961
65962
65963# IFS
65964# We need space, tab and new line, in precisely that order.  Quoting is
65965# there to prevent editors from complaining about space-tab.
65966# (If _AS_PATH_WALK were called with IFS unset, it would disable word
65967# splitting by setting IFS to empty value.)
65968IFS=" ""	$as_nl"
65969
65970# Find who we are.  Look in the path if we contain no directory separator.
65971as_myself=
65972case $0 in #((
65973  *[\\/]* ) as_myself=$0 ;;
65974  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
65975for as_dir in $PATH
65976do
65977  IFS=$as_save_IFS
65978  test -z "$as_dir" && as_dir=.
65979    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
65980  done
65981IFS=$as_save_IFS
65982
65983     ;;
65984esac
65985# We did not find ourselves, most probably we were run as `sh COMMAND'
65986# in which case we are not to be found in the path.
65987if test "x$as_myself" = x; then
65988  as_myself=$0
65989fi
65990if test ! -f "$as_myself"; then
65991  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
65992  exit 1
65993fi
65994
65995# Unset variables that we do not need and which cause bugs (e.g. in
65996# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
65997# suppresses any "Segmentation fault" message there.  '((' could
65998# trigger a bug in pdksh 5.2.14.
65999for as_var in BASH_ENV ENV MAIL MAILPATH
66000do eval test x\${$as_var+set} = xset \
66001  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
66002done
66003PS1='$ '
66004PS2='> '
66005PS4='+ '
66006
66007# NLS nuisances.
66008LC_ALL=C
66009export LC_ALL
66010LANGUAGE=C
66011export LANGUAGE
66012
66013# CDPATH.
66014(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
66015
66016
66017# as_fn_error STATUS ERROR [LINENO LOG_FD]
66018# ----------------------------------------
66019# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
66020# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
66021# script with STATUS, using 1 if that was 0.
66022as_fn_error ()
66023{
66024  as_status=$1; test $as_status -eq 0 && as_status=1
66025  if test "$4"; then
66026    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
66027    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
66028  fi
66029  $as_echo "$as_me: error: $2" >&2
66030  as_fn_exit $as_status
66031} # as_fn_error
66032
66033
66034# as_fn_set_status STATUS
66035# -----------------------
66036# Set $? to STATUS, without forking.
66037as_fn_set_status ()
66038{
66039  return $1
66040} # as_fn_set_status
66041
66042# as_fn_exit STATUS
66043# -----------------
66044# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
66045as_fn_exit ()
66046{
66047  set +e
66048  as_fn_set_status $1
66049  exit $1
66050} # as_fn_exit
66051
66052# as_fn_unset VAR
66053# ---------------
66054# Portably unset VAR.
66055as_fn_unset ()
66056{
66057  { eval $1=; unset $1;}
66058}
66059as_unset=as_fn_unset
66060# as_fn_append VAR VALUE
66061# ----------------------
66062# Append the text in VALUE to the end of the definition contained in VAR. Take
66063# advantage of any shell optimizations that allow amortized linear growth over
66064# repeated appends, instead of the typical quadratic growth present in naive
66065# implementations.
66066if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
66067  eval 'as_fn_append ()
66068  {
66069    eval $1+=\$2
66070  }'
66071else
66072  as_fn_append ()
66073  {
66074    eval $1=\$$1\$2
66075  }
66076fi # as_fn_append
66077
66078# as_fn_arith ARG...
66079# ------------------
66080# Perform arithmetic evaluation on the ARGs, and store the result in the
66081# global $as_val. Take advantage of shells that can avoid forks. The arguments
66082# must be portable across $(()) and expr.
66083if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
66084  eval 'as_fn_arith ()
66085  {
66086    as_val=$(( $* ))
66087  }'
66088else
66089  as_fn_arith ()
66090  {
66091    as_val=`expr "$@" || test $? -eq 1`
66092  }
66093fi # as_fn_arith
66094
66095
66096if expr a : '\(a\)' >/dev/null 2>&1 &&
66097   test "X`expr 00001 : '.*\(...\)'`" = X001; then
66098  as_expr=expr
66099else
66100  as_expr=false
66101fi
66102
66103if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
66104  as_basename=basename
66105else
66106  as_basename=false
66107fi
66108
66109if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
66110  as_dirname=dirname
66111else
66112  as_dirname=false
66113fi
66114
66115as_me=`$as_basename -- "$0" ||
66116$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
66117	 X"$0" : 'X\(//\)$' \| \
66118	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
66119$as_echo X/"$0" |
66120    sed '/^.*\/\([^/][^/]*\)\/*$/{
66121	    s//\1/
66122	    q
66123	  }
66124	  /^X\/\(\/\/\)$/{
66125	    s//\1/
66126	    q
66127	  }
66128	  /^X\/\(\/\).*/{
66129	    s//\1/
66130	    q
66131	  }
66132	  s/.*/./; q'`
66133
66134# Avoid depending upon Character Ranges.
66135as_cr_letters='abcdefghijklmnopqrstuvwxyz'
66136as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
66137as_cr_Letters=$as_cr_letters$as_cr_LETTERS
66138as_cr_digits='0123456789'
66139as_cr_alnum=$as_cr_Letters$as_cr_digits
66140
66141ECHO_C= ECHO_N= ECHO_T=
66142case `echo -n x` in #(((((
66143-n*)
66144  case `echo 'xy\c'` in
66145  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
66146  xy)  ECHO_C='\c';;
66147  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
66148       ECHO_T='	';;
66149  esac;;
66150*)
66151  ECHO_N='-n';;
66152esac
66153
66154rm -f conf$$ conf$$.exe conf$$.file
66155if test -d conf$$.dir; then
66156  rm -f conf$$.dir/conf$$.file
66157else
66158  rm -f conf$$.dir
66159  mkdir conf$$.dir 2>/dev/null
66160fi
66161if (echo >conf$$.file) 2>/dev/null; then
66162  if ln -s conf$$.file conf$$ 2>/dev/null; then
66163    as_ln_s='ln -s'
66164    # ... but there are two gotchas:
66165    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
66166    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
66167    # In both cases, we have to default to `cp -pR'.
66168    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
66169      as_ln_s='cp -pR'
66170  elif ln conf$$.file conf$$ 2>/dev/null; then
66171    as_ln_s=ln
66172  else
66173    as_ln_s='cp -pR'
66174  fi
66175else
66176  as_ln_s='cp -pR'
66177fi
66178rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
66179rmdir conf$$.dir 2>/dev/null
66180
66181
66182# as_fn_mkdir_p
66183# -------------
66184# Create "$as_dir" as a directory, including parents if necessary.
66185as_fn_mkdir_p ()
66186{
66187
66188  case $as_dir in #(
66189  -*) as_dir=./$as_dir;;
66190  esac
66191  test -d "$as_dir" || eval $as_mkdir_p || {
66192    as_dirs=
66193    while :; do
66194      case $as_dir in #(
66195      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
66196      *) as_qdir=$as_dir;;
66197      esac
66198      as_dirs="'$as_qdir' $as_dirs"
66199      as_dir=`$as_dirname -- "$as_dir" ||
66200$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
66201	 X"$as_dir" : 'X\(//\)[^/]' \| \
66202	 X"$as_dir" : 'X\(//\)$' \| \
66203	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
66204$as_echo X"$as_dir" |
66205    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
66206	    s//\1/
66207	    q
66208	  }
66209	  /^X\(\/\/\)[^/].*/{
66210	    s//\1/
66211	    q
66212	  }
66213	  /^X\(\/\/\)$/{
66214	    s//\1/
66215	    q
66216	  }
66217	  /^X\(\/\).*/{
66218	    s//\1/
66219	    q
66220	  }
66221	  s/.*/./; q'`
66222      test -d "$as_dir" && break
66223    done
66224    test -z "$as_dirs" || eval "mkdir $as_dirs"
66225  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
66226
66227
66228} # as_fn_mkdir_p
66229if mkdir -p . 2>/dev/null; then
66230  as_mkdir_p='mkdir -p "$as_dir"'
66231else
66232  test -d ./-p && rmdir ./-p
66233  as_mkdir_p=false
66234fi
66235
66236
66237# as_fn_executable_p FILE
66238# -----------------------
66239# Test if FILE is an executable regular file.
66240as_fn_executable_p ()
66241{
66242  test -f "$1" && test -x "$1"
66243} # as_fn_executable_p
66244as_test_x='test -x'
66245as_executable_p=as_fn_executable_p
66246
66247# Sed expression to map a string onto a valid CPP name.
66248as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
66249
66250# Sed expression to map a string onto a valid variable name.
66251as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
66252
66253
66254exec 6>&1
66255## ----------------------------------- ##
66256## Main body of $CONFIG_STATUS script. ##
66257## ----------------------------------- ##
66258_ASEOF
66259test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
66260
66261cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66262# Save the log message, to keep $0 and so on meaningful, and to
66263# report actual input values of CONFIG_FILES etc. instead of their
66264# values after options handling.
66265ac_log="
66266This file was extended by $as_me, which was
66267generated by GNU Autoconf 2.69.  Invocation command line was
66268
66269  CONFIG_FILES    = $CONFIG_FILES
66270  CONFIG_HEADERS  = $CONFIG_HEADERS
66271  CONFIG_LINKS    = $CONFIG_LINKS
66272  CONFIG_COMMANDS = $CONFIG_COMMANDS
66273  $ $0 $@
66274
66275on `(hostname || uname -n) 2>/dev/null | sed 1q`
66276"
66277
66278_ACEOF
66279
66280case $ac_config_files in *"
66281"*) set x $ac_config_files; shift; ac_config_files=$*;;
66282esac
66283
66284case $ac_config_headers in *"
66285"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
66286esac
66287
66288
66289cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
66290# Files that config.status was made for.
66291config_files="$ac_config_files"
66292config_headers="$ac_config_headers"
66293config_links="$ac_config_links"
66294config_commands="$ac_config_commands"
66295
66296_ACEOF
66297
66298cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66299ac_cs_usage="\
66300\`$as_me' instantiates files and other configuration actions
66301from templates according to the current configuration.  Unless the files
66302and actions are specified as TAGs, all are instantiated by default.
66303
66304Usage: $0 [OPTION]... [TAG]...
66305
66306  -h, --help       print this help, then exit
66307  -V, --version    print version number and configuration settings, then exit
66308      --config     print configuration, then exit
66309  -q, --quiet, --silent
66310                   do not print progress messages
66311  -d, --debug      don't remove temporary files
66312      --recheck    update $as_me by reconfiguring in the same conditions
66313      --file=FILE[:TEMPLATE]
66314                   instantiate the configuration file FILE
66315      --header=FILE[:TEMPLATE]
66316                   instantiate the configuration header FILE
66317
66318Configuration files:
66319$config_files
66320
66321Configuration headers:
66322$config_headers
66323
66324Configuration links:
66325$config_links
66326
66327Configuration commands:
66328$config_commands
66329
66330Report bugs to the package provider."
66331
66332_ACEOF
66333cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
66334ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
66335ac_cs_version="\\
66336config.status
66337configured by $0, generated by GNU Autoconf 2.69,
66338  with options \\"\$ac_cs_config\\"
66339
66340Copyright (C) 2012 Free Software Foundation, Inc.
66341This config.status script is free software; the Free Software Foundation
66342gives unlimited permission to copy, distribute and modify it."
66343
66344ac_pwd='$ac_pwd'
66345srcdir='$srcdir'
66346INSTALL='$INSTALL'
66347MKDIR_P='$MKDIR_P'
66348AWK='$AWK'
66349test -n "\$AWK" || AWK=awk
66350_ACEOF
66351
66352cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66353# The default lists apply if the user does not specify any file.
66354ac_need_defaults=:
66355while test $# != 0
66356do
66357  case $1 in
66358  --*=?*)
66359    ac_option=`expr "X$1" : 'X\([^=]*\)='`
66360    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
66361    ac_shift=:
66362    ;;
66363  --*=)
66364    ac_option=`expr "X$1" : 'X\([^=]*\)='`
66365    ac_optarg=
66366    ac_shift=:
66367    ;;
66368  *)
66369    ac_option=$1
66370    ac_optarg=$2
66371    ac_shift=shift
66372    ;;
66373  esac
66374
66375  case $ac_option in
66376  # Handling of the options.
66377  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
66378    ac_cs_recheck=: ;;
66379  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
66380    $as_echo "$ac_cs_version"; exit ;;
66381  --config | --confi | --conf | --con | --co | --c )
66382    $as_echo "$ac_cs_config"; exit ;;
66383  --debug | --debu | --deb | --de | --d | -d )
66384    debug=: ;;
66385  --file | --fil | --fi | --f )
66386    $ac_shift
66387    case $ac_optarg in
66388    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
66389    '') as_fn_error $? "missing file argument" ;;
66390    esac
66391    as_fn_append CONFIG_FILES " '$ac_optarg'"
66392    ac_need_defaults=false;;
66393  --header | --heade | --head | --hea )
66394    $ac_shift
66395    case $ac_optarg in
66396    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
66397    esac
66398    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
66399    ac_need_defaults=false;;
66400  --he | --h)
66401    # Conflict between --help and --header
66402    as_fn_error $? "ambiguous option: \`$1'
66403Try \`$0 --help' for more information.";;
66404  --help | --hel | -h )
66405    $as_echo "$ac_cs_usage"; exit ;;
66406  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
66407  | -silent | --silent | --silen | --sile | --sil | --si | --s)
66408    ac_cs_silent=: ;;
66409
66410  # This is an error.
66411  -*) as_fn_error $? "unrecognized option: \`$1'
66412Try \`$0 --help' for more information." ;;
66413
66414  *) as_fn_append ac_config_targets " $1"
66415     ac_need_defaults=false ;;
66416
66417  esac
66418  shift
66419done
66420
66421ac_configure_extra_args=
66422
66423if $ac_cs_silent; then
66424  exec 6>/dev/null
66425  ac_configure_extra_args="$ac_configure_extra_args --silent"
66426fi
66427
66428_ACEOF
66429cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
66430if \$ac_cs_recheck; then
66431  set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
66432  shift
66433  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
66434  CONFIG_SHELL='$SHELL'
66435  export CONFIG_SHELL
66436  exec "\$@"
66437fi
66438
66439_ACEOF
66440cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66441exec 5>>config.log
66442{
66443  echo
66444  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
66445## Running $as_me. ##
66446_ASBOX
66447  $as_echo "$ac_log"
66448} >&5
66449
66450_ACEOF
66451cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
66452#
66453# INIT-COMMANDS
66454#
66455AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
66456
66457
66458# The HP-UX ksh and POSIX shell print the target directory to stdout
66459# if CDPATH is set.
66460(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
66461
66462sed_quote_subst='$sed_quote_subst'
66463double_quote_subst='$double_quote_subst'
66464delay_variable_subst='$delay_variable_subst'
66465macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
66466macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
66467enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
66468enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
66469pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
66470enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
66471SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
66472ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
66473PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
66474host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
66475host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
66476host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
66477build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
66478build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
66479build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
66480SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
66481Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
66482GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
66483EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
66484FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
66485LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
66486NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
66487LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
66488max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
66489ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
66490exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
66491lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
66492lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
66493lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
66494lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
66495lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
66496reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
66497reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
66498OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
66499deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
66500file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
66501file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
66502want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
66503DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
66504sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
66505AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
66506AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
66507archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
66508STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
66509RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
66510old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
66511old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
66512old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
66513lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
66514CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
66515CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
66516compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
66517GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
66518lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
66519lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
66520lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
66521lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
66522nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
66523lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
66524objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
66525MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
66526lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
66527lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
66528lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
66529lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
66530lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
66531need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
66532MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
66533DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
66534NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
66535LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
66536OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
66537OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
66538libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
66539shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
66540extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
66541archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
66542enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
66543export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
66544whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
66545compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
66546old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
66547old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
66548archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
66549archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
66550module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
66551module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
66552with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
66553allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
66554no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
66555hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
66556hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
66557hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
66558hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
66559hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
66560hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
66561hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
66562inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
66563link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
66564always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
66565export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
66566exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
66567include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
66568prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
66569postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
66570file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
66571variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
66572need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
66573need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
66574version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
66575runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
66576shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
66577shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
66578libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
66579library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
66580soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
66581install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
66582postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
66583postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
66584finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
66585finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
66586hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
66587sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
66588sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
66589hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
66590enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
66591enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
66592enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
66593old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
66594striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
66595
66596LTCC='$LTCC'
66597LTCFLAGS='$LTCFLAGS'
66598compiler='$compiler_DEFAULT'
66599
66600# A function that is used when there is no print builtin or printf.
66601func_fallback_echo ()
66602{
66603  eval 'cat <<_LTECHO_EOF
66604\$1
66605_LTECHO_EOF'
66606}
66607
66608# Quote evaled strings.
66609for var in SHELL \
66610ECHO \
66611PATH_SEPARATOR \
66612SED \
66613GREP \
66614EGREP \
66615FGREP \
66616LD \
66617NM \
66618LN_S \
66619lt_SP2NL \
66620lt_NL2SP \
66621reload_flag \
66622OBJDUMP \
66623deplibs_check_method \
66624file_magic_cmd \
66625file_magic_glob \
66626want_nocaseglob \
66627DLLTOOL \
66628sharedlib_from_linklib_cmd \
66629AR \
66630AR_FLAGS \
66631archiver_list_spec \
66632STRIP \
66633RANLIB \
66634CC \
66635CFLAGS \
66636compiler \
66637lt_cv_sys_global_symbol_pipe \
66638lt_cv_sys_global_symbol_to_cdecl \
66639lt_cv_sys_global_symbol_to_c_name_address \
66640lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
66641nm_file_list_spec \
66642lt_prog_compiler_no_builtin_flag \
66643lt_prog_compiler_pic \
66644lt_prog_compiler_wl \
66645lt_prog_compiler_static \
66646lt_cv_prog_compiler_c_o \
66647need_locks \
66648MANIFEST_TOOL \
66649DSYMUTIL \
66650NMEDIT \
66651LIPO \
66652OTOOL \
66653OTOOL64 \
66654shrext_cmds \
66655export_dynamic_flag_spec \
66656whole_archive_flag_spec \
66657compiler_needs_object \
66658with_gnu_ld \
66659allow_undefined_flag \
66660no_undefined_flag \
66661hardcode_libdir_flag_spec \
66662hardcode_libdir_separator \
66663exclude_expsyms \
66664include_expsyms \
66665file_list_spec \
66666variables_saved_for_relink \
66667libname_spec \
66668library_names_spec \
66669soname_spec \
66670install_override_mode \
66671finish_eval \
66672old_striplib \
66673striplib; do
66674    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
66675    *[\\\\\\\`\\"\\\$]*)
66676      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
66677      ;;
66678    *)
66679      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
66680      ;;
66681    esac
66682done
66683
66684# Double-quote double-evaled strings.
66685for var in reload_cmds \
66686old_postinstall_cmds \
66687old_postuninstall_cmds \
66688old_archive_cmds \
66689extract_expsyms_cmds \
66690old_archive_from_new_cmds \
66691old_archive_from_expsyms_cmds \
66692archive_cmds \
66693archive_expsym_cmds \
66694module_cmds \
66695module_expsym_cmds \
66696export_symbols_cmds \
66697prelink_cmds \
66698postlink_cmds \
66699postinstall_cmds \
66700postuninstall_cmds \
66701finish_cmds \
66702sys_lib_search_path_spec \
66703sys_lib_dlsearch_path_spec; do
66704    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
66705    *[\\\\\\\`\\"\\\$]*)
66706      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
66707      ;;
66708    *)
66709      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
66710      ;;
66711    esac
66712done
66713
66714ac_aux_dir='$ac_aux_dir'
66715xsi_shell='$xsi_shell'
66716lt_shell_append='$lt_shell_append'
66717
66718# See if we are running on zsh, and set the options which allow our
66719# commands through without removal of \ escapes INIT.
66720if test -n "\${ZSH_VERSION+set}" ; then
66721   setopt NO_GLOB_SUBST
66722fi
66723
66724
66725    PACKAGE='$PACKAGE'
66726    VERSION='$VERSION'
66727    TIMESTAMP='$TIMESTAMP'
66728    RM='$RM'
66729    ofile='$ofile'
66730
66731
66732
66733
66734_ACEOF
66735
66736cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66737
66738# Handling of arguments.
66739for ac_config_target in $ac_config_targets
66740do
66741  case $ac_config_target in
66742    "include/autoconf.h") CONFIG_HEADERS="$CONFIG_HEADERS include/autoconf.h" ;;
66743    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
66744    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
66745    "bin/socksify") CONFIG_FILES="$CONFIG_FILES bin/socksify" ;;
66746    "capi/socks.h") CONFIG_FILES="$CONFIG_FILES capi/socks.h" ;;
66747    "$ac_config_links_1") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_1" ;;
66748    "$ac_config_links_2") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_2" ;;
66749    "$ac_config_links_3") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_3" ;;
66750    "$ac_config_links_4") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_4" ;;
66751    "$ac_config_links_5") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_5" ;;
66752    "$ac_config_links_6") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_6" ;;
66753    "$ac_config_links_7") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_7" ;;
66754    "$ac_config_links_8") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_8" ;;
66755    "$ac_config_links_9") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_9" ;;
66756    "$ac_config_links_10") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_10" ;;
66757    "$ac_config_links_11") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_11" ;;
66758    "$ac_config_links_12") CONFIG_LINKS="$CONFIG_LINKS $ac_config_links_12" ;;
66759    "sockd/Makefile") CONFIG_FILES="$CONFIG_FILES sockd/Makefile" ;;
66760    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
66761    "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
66762    "dlib/Makefile") CONFIG_FILES="$CONFIG_FILES dlib/Makefile" ;;
66763    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
66764    "example/Makefile") CONFIG_FILES="$CONFIG_FILES example/Makefile" ;;
66765    "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
66766    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
66767    "capi/Makefile") CONFIG_FILES="$CONFIG_FILES capi/Makefile" ;;
66768    "SPECS/Makefile") CONFIG_FILES="$CONFIG_FILES SPECS/Makefile" ;;
66769    "SPECS/dante.spec") CONFIG_FILES="$CONFIG_FILES SPECS/dante.spec" ;;
66770    "libscompat/Makefile") CONFIG_FILES="$CONFIG_FILES libscompat/Makefile" ;;
66771    "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
66772    "unlicensed/Makefile") CONFIG_FILES="$CONFIG_FILES unlicensed/Makefile" ;;
66773    "VERSION") CONFIG_FILES="$CONFIG_FILES VERSION" ;;
66774    "dlib64/Makefile") CONFIG_FILES="$CONFIG_FILES dlib64/Makefile" ;;
66775
66776  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
66777  esac
66778done
66779
66780
66781# If the user did not use the arguments to specify the items to instantiate,
66782# then the envvar interface is used.  Set only those that are not.
66783# We use the long form for the default assignment because of an extremely
66784# bizarre bug on SunOS 4.1.3.
66785if $ac_need_defaults; then
66786  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
66787  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
66788  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
66789  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
66790fi
66791
66792# Have a temporary directory for convenience.  Make it in the build tree
66793# simply because there is no reason against having it here, and in addition,
66794# creating and moving files from /tmp can sometimes cause problems.
66795# Hook for its removal unless debugging.
66796# Note that there is a small window in which the directory will not be cleaned:
66797# after its creation but before its name has been assigned to `$tmp'.
66798$debug ||
66799{
66800  tmp= ac_tmp=
66801  trap 'exit_status=$?
66802  : "${ac_tmp:=$tmp}"
66803  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
66804' 0
66805  trap 'as_fn_exit 1' 1 2 13 15
66806}
66807# Create a (secure) tmp directory for tmp files.
66808
66809{
66810  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
66811  test -d "$tmp"
66812}  ||
66813{
66814  tmp=./conf$$-$RANDOM
66815  (umask 077 && mkdir "$tmp")
66816} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
66817ac_tmp=$tmp
66818
66819# Set up the scripts for CONFIG_FILES section.
66820# No need to generate them if there are no CONFIG_FILES.
66821# This happens for instance with `./config.status config.h'.
66822if test -n "$CONFIG_FILES"; then
66823
66824
66825ac_cr=`echo X | tr X '\015'`
66826# On cygwin, bash can eat \r inside `` if the user requested igncr.
66827# But we know of no other shell where ac_cr would be empty at this
66828# point, so we can use a bashism as a fallback.
66829if test "x$ac_cr" = x; then
66830  eval ac_cr=\$\'\\r\'
66831fi
66832ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
66833if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
66834  ac_cs_awk_cr='\\r'
66835else
66836  ac_cs_awk_cr=$ac_cr
66837fi
66838
66839echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
66840_ACEOF
66841
66842
66843{
66844  echo "cat >conf$$subs.awk <<_ACEOF" &&
66845  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
66846  echo "_ACEOF"
66847} >conf$$subs.sh ||
66848  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
66849ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
66850ac_delim='%!_!# '
66851for ac_last_try in false false false false false :; do
66852  . ./conf$$subs.sh ||
66853    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
66854
66855  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
66856  if test $ac_delim_n = $ac_delim_num; then
66857    break
66858  elif $ac_last_try; then
66859    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
66860  else
66861    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
66862  fi
66863done
66864rm -f conf$$subs.sh
66865
66866cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
66867cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
66868_ACEOF
66869sed -n '
66870h
66871s/^/S["/; s/!.*/"]=/
66872p
66873g
66874s/^[^!]*!//
66875:repl
66876t repl
66877s/'"$ac_delim"'$//
66878t delim
66879:nl
66880h
66881s/\(.\{148\}\)..*/\1/
66882t more1
66883s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
66884p
66885n
66886b repl
66887:more1
66888s/["\\]/\\&/g; s/^/"/; s/$/"\\/
66889p
66890g
66891s/.\{148\}//
66892t nl
66893:delim
66894h
66895s/\(.\{148\}\)..*/\1/
66896t more2
66897s/["\\]/\\&/g; s/^/"/; s/$/"/
66898p
66899b
66900:more2
66901s/["\\]/\\&/g; s/^/"/; s/$/"\\/
66902p
66903g
66904s/.\{148\}//
66905t delim
66906' <conf$$subs.awk | sed '
66907/^[^""]/{
66908  N
66909  s/\n//
66910}
66911' >>$CONFIG_STATUS || ac_write_fail=1
66912rm -f conf$$subs.awk
66913cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
66914_ACAWK
66915cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
66916  for (key in S) S_is_set[key] = 1
66917  FS = ""
66918
66919}
66920{
66921  line = $ 0
66922  nfields = split(line, field, "@")
66923  substed = 0
66924  len = length(field[1])
66925  for (i = 2; i < nfields; i++) {
66926    key = field[i]
66927    keylen = length(key)
66928    if (S_is_set[key]) {
66929      value = S[key]
66930      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
66931      len += length(value) + length(field[++i])
66932      substed = 1
66933    } else
66934      len += 1 + keylen
66935  }
66936
66937  print line
66938}
66939
66940_ACAWK
66941_ACEOF
66942cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66943if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
66944  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
66945else
66946  cat
66947fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
66948  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
66949_ACEOF
66950
66951# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
66952# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
66953# trailing colons and then remove the whole line if VPATH becomes empty
66954# (actually we leave an empty line to preserve line numbers).
66955if test "x$srcdir" = x.; then
66956  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
66957h
66958s///
66959s/^/:/
66960s/[	 ]*$/:/
66961s/:\$(srcdir):/:/g
66962s/:\${srcdir}:/:/g
66963s/:@srcdir@:/:/g
66964s/^:*//
66965s/:*$//
66966x
66967s/\(=[	 ]*\).*/\1/
66968G
66969s/\n//
66970s/^[^=]*=[	 ]*$//
66971}'
66972fi
66973
66974cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
66975fi # test -n "$CONFIG_FILES"
66976
66977# Set up the scripts for CONFIG_HEADERS section.
66978# No need to generate them if there are no CONFIG_HEADERS.
66979# This happens for instance with `./config.status Makefile'.
66980if test -n "$CONFIG_HEADERS"; then
66981cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
66982BEGIN {
66983_ACEOF
66984
66985# Transform confdefs.h into an awk script `defines.awk', embedded as
66986# here-document in config.status, that substitutes the proper values into
66987# config.h.in to produce config.h.
66988
66989# Create a delimiter string that does not exist in confdefs.h, to ease
66990# handling of long lines.
66991ac_delim='%!_!# '
66992for ac_last_try in false false :; do
66993  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
66994  if test -z "$ac_tt"; then
66995    break
66996  elif $ac_last_try; then
66997    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
66998  else
66999    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
67000  fi
67001done
67002
67003# For the awk script, D is an array of macro values keyed by name,
67004# likewise P contains macro parameters if any.  Preserve backslash
67005# newline sequences.
67006
67007ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
67008sed -n '
67009s/.\{148\}/&'"$ac_delim"'/g
67010t rset
67011:rset
67012s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
67013t def
67014d
67015:def
67016s/\\$//
67017t bsnl
67018s/["\\]/\\&/g
67019s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
67020D["\1"]=" \3"/p
67021s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
67022d
67023:bsnl
67024s/["\\]/\\&/g
67025s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
67026D["\1"]=" \3\\\\\\n"\\/p
67027t cont
67028s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
67029t cont
67030d
67031:cont
67032n
67033s/.\{148\}/&'"$ac_delim"'/g
67034t clear
67035:clear
67036s/\\$//
67037t bsnlc
67038s/["\\]/\\&/g; s/^/"/; s/$/"/p
67039d
67040:bsnlc
67041s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
67042b cont
67043' <confdefs.h | sed '
67044s/'"$ac_delim"'/"\\\
67045"/g' >>$CONFIG_STATUS || ac_write_fail=1
67046
67047cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
67048  for (key in D) D_is_set[key] = 1
67049  FS = ""
67050}
67051/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
67052  line = \$ 0
67053  split(line, arg, " ")
67054  if (arg[1] == "#") {
67055    defundef = arg[2]
67056    mac1 = arg[3]
67057  } else {
67058    defundef = substr(arg[1], 2)
67059    mac1 = arg[2]
67060  }
67061  split(mac1, mac2, "(") #)
67062  macro = mac2[1]
67063  prefix = substr(line, 1, index(line, defundef) - 1)
67064  if (D_is_set[macro]) {
67065    # Preserve the white space surrounding the "#".
67066    print prefix "define", macro P[macro] D[macro]
67067    next
67068  } else {
67069    # Replace #undef with comments.  This is necessary, for example,
67070    # in the case of _POSIX_SOURCE, which is predefined and required
67071    # on some systems where configure will not decide to define it.
67072    if (defundef == "undef") {
67073      print "/*", prefix defundef, macro, "*/"
67074      next
67075    }
67076  }
67077}
67078{ print }
67079_ACAWK
67080_ACEOF
67081cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
67082  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
67083fi # test -n "$CONFIG_HEADERS"
67084
67085
67086eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS  :L $CONFIG_LINKS  :C $CONFIG_COMMANDS"
67087shift
67088for ac_tag
67089do
67090  case $ac_tag in
67091  :[FHLC]) ac_mode=$ac_tag; continue;;
67092  esac
67093  case $ac_mode$ac_tag in
67094  :[FHL]*:*);;
67095  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
67096  :[FH]-) ac_tag=-:-;;
67097  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
67098  esac
67099  ac_save_IFS=$IFS
67100  IFS=:
67101  set x $ac_tag
67102  IFS=$ac_save_IFS
67103  shift
67104  ac_file=$1
67105  shift
67106
67107  case $ac_mode in
67108  :L) ac_source=$1;;
67109  :[FH])
67110    ac_file_inputs=
67111    for ac_f
67112    do
67113      case $ac_f in
67114      -) ac_f="$ac_tmp/stdin";;
67115      *) # Look for the file first in the build tree, then in the source tree
67116	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
67117	 # because $ac_f cannot contain `:'.
67118	 test -f "$ac_f" ||
67119	   case $ac_f in
67120	   [\\/$]*) false;;
67121	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
67122	   esac ||
67123	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
67124      esac
67125      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
67126      as_fn_append ac_file_inputs " '$ac_f'"
67127    done
67128
67129    # Let's still pretend it is `configure' which instantiates (i.e., don't
67130    # use $as_me), people would be surprised to read:
67131    #    /* config.h.  Generated by config.status.  */
67132    configure_input='Generated from '`
67133	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
67134	`' by configure.'
67135    if test x"$ac_file" != x-; then
67136      configure_input="$ac_file.  $configure_input"
67137      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
67138$as_echo "$as_me: creating $ac_file" >&6;}
67139    fi
67140    # Neutralize special characters interpreted by sed in replacement strings.
67141    case $configure_input in #(
67142    *\&* | *\|* | *\\* )
67143       ac_sed_conf_input=`$as_echo "$configure_input" |
67144       sed 's/[\\\\&|]/\\\\&/g'`;; #(
67145    *) ac_sed_conf_input=$configure_input;;
67146    esac
67147
67148    case $ac_tag in
67149    *:-:* | *:-) cat >"$ac_tmp/stdin" \
67150      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
67151    esac
67152    ;;
67153  esac
67154
67155  ac_dir=`$as_dirname -- "$ac_file" ||
67156$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
67157	 X"$ac_file" : 'X\(//\)[^/]' \| \
67158	 X"$ac_file" : 'X\(//\)$' \| \
67159	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
67160$as_echo X"$ac_file" |
67161    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
67162	    s//\1/
67163	    q
67164	  }
67165	  /^X\(\/\/\)[^/].*/{
67166	    s//\1/
67167	    q
67168	  }
67169	  /^X\(\/\/\)$/{
67170	    s//\1/
67171	    q
67172	  }
67173	  /^X\(\/\).*/{
67174	    s//\1/
67175	    q
67176	  }
67177	  s/.*/./; q'`
67178  as_dir="$ac_dir"; as_fn_mkdir_p
67179  ac_builddir=.
67180
67181case "$ac_dir" in
67182.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
67183*)
67184  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
67185  # A ".." for each directory in $ac_dir_suffix.
67186  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
67187  case $ac_top_builddir_sub in
67188  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
67189  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
67190  esac ;;
67191esac
67192ac_abs_top_builddir=$ac_pwd
67193ac_abs_builddir=$ac_pwd$ac_dir_suffix
67194# for backward compatibility:
67195ac_top_builddir=$ac_top_build_prefix
67196
67197case $srcdir in
67198  .)  # We are building in place.
67199    ac_srcdir=.
67200    ac_top_srcdir=$ac_top_builddir_sub
67201    ac_abs_top_srcdir=$ac_pwd ;;
67202  [\\/]* | ?:[\\/]* )  # Absolute name.
67203    ac_srcdir=$srcdir$ac_dir_suffix;
67204    ac_top_srcdir=$srcdir
67205    ac_abs_top_srcdir=$srcdir ;;
67206  *) # Relative name.
67207    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
67208    ac_top_srcdir=$ac_top_build_prefix$srcdir
67209    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
67210esac
67211ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
67212
67213
67214  case $ac_mode in
67215  :F)
67216  #
67217  # CONFIG_FILE
67218  #
67219
67220  case $INSTALL in
67221  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
67222  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
67223  esac
67224  ac_MKDIR_P=$MKDIR_P
67225  case $MKDIR_P in
67226  [\\/$]* | ?:[\\/]* ) ;;
67227  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
67228  esac
67229_ACEOF
67230
67231cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
67232# If the template does not know about datarootdir, expand it.
67233# FIXME: This hack should be removed a few years after 2.60.
67234ac_datarootdir_hack=; ac_datarootdir_seen=
67235ac_sed_dataroot='
67236/datarootdir/ {
67237  p
67238  q
67239}
67240/@datadir@/p
67241/@docdir@/p
67242/@infodir@/p
67243/@localedir@/p
67244/@mandir@/p'
67245case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
67246*datarootdir*) ac_datarootdir_seen=yes;;
67247*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
67248  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
67249$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
67250_ACEOF
67251cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
67252  ac_datarootdir_hack='
67253  s&@datadir@&$datadir&g
67254  s&@docdir@&$docdir&g
67255  s&@infodir@&$infodir&g
67256  s&@localedir@&$localedir&g
67257  s&@mandir@&$mandir&g
67258  s&\\\${datarootdir}&$datarootdir&g' ;;
67259esac
67260_ACEOF
67261
67262# Neutralize VPATH when `$srcdir' = `.'.
67263# Shell code in configure.ac might set extrasub.
67264# FIXME: do we really want to maintain this feature?
67265cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
67266ac_sed_extra="$ac_vpsub
67267$extrasub
67268_ACEOF
67269cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
67270:t
67271/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
67272s|@configure_input@|$ac_sed_conf_input|;t t
67273s&@top_builddir@&$ac_top_builddir_sub&;t t
67274s&@top_build_prefix@&$ac_top_build_prefix&;t t
67275s&@srcdir@&$ac_srcdir&;t t
67276s&@abs_srcdir@&$ac_abs_srcdir&;t t
67277s&@top_srcdir@&$ac_top_srcdir&;t t
67278s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
67279s&@builddir@&$ac_builddir&;t t
67280s&@abs_builddir@&$ac_abs_builddir&;t t
67281s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
67282s&@INSTALL@&$ac_INSTALL&;t t
67283s&@MKDIR_P@&$ac_MKDIR_P&;t t
67284$ac_datarootdir_hack
67285"
67286eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
67287  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
67288
67289test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
67290  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
67291  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
67292      "$ac_tmp/out"`; test -z "$ac_out"; } &&
67293  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
67294which seems to be undefined.  Please make sure it is defined" >&5
67295$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
67296which seems to be undefined.  Please make sure it is defined" >&2;}
67297
67298  rm -f "$ac_tmp/stdin"
67299  case $ac_file in
67300  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
67301  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
67302  esac \
67303  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
67304 ;;
67305  :H)
67306  #
67307  # CONFIG_HEADER
67308  #
67309  if test x"$ac_file" != x-; then
67310    {
67311      $as_echo "/* $configure_input  */" \
67312      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
67313    } >"$ac_tmp/config.h" \
67314      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
67315    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
67316      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
67317$as_echo "$as_me: $ac_file is unchanged" >&6;}
67318    else
67319      rm -f "$ac_file"
67320      mv "$ac_tmp/config.h" "$ac_file" \
67321	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
67322    fi
67323  else
67324    $as_echo "/* $configure_input  */" \
67325      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
67326      || as_fn_error $? "could not create -" "$LINENO" 5
67327  fi
67328# Compute "$ac_file"'s index in $config_headers.
67329_am_arg="$ac_file"
67330_am_stamp_count=1
67331for _am_header in $config_headers :; do
67332  case $_am_header in
67333    $_am_arg | $_am_arg:* )
67334      break ;;
67335    * )
67336      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
67337  esac
67338done
67339echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
67340$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
67341	 X"$_am_arg" : 'X\(//\)[^/]' \| \
67342	 X"$_am_arg" : 'X\(//\)$' \| \
67343	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
67344$as_echo X"$_am_arg" |
67345    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
67346	    s//\1/
67347	    q
67348	  }
67349	  /^X\(\/\/\)[^/].*/{
67350	    s//\1/
67351	    q
67352	  }
67353	  /^X\(\/\/\)$/{
67354	    s//\1/
67355	    q
67356	  }
67357	  /^X\(\/\).*/{
67358	    s//\1/
67359	    q
67360	  }
67361	  s/.*/./; q'`/stamp-h$_am_stamp_count
67362 ;;
67363  :L)
67364  #
67365  # CONFIG_LINK
67366  #
67367
67368  if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
67369    :
67370  else
67371    # Prefer the file from the source tree if names are identical.
67372    if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
67373      ac_source=$srcdir/$ac_source
67374    fi
67375
67376    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
67377$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
67378
67379    if test ! -r "$ac_source"; then
67380      as_fn_error $? "$ac_source: file not found" "$LINENO" 5
67381    fi
67382    rm -f "$ac_file"
67383
67384    # Try a relative symlink, then a hard link, then a copy.
67385    case $ac_source in
67386    [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
67387	*) ac_rel_source=$ac_top_build_prefix$ac_source ;;
67388    esac
67389    ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
67390      ln "$ac_source" "$ac_file" 2>/dev/null ||
67391      cp -p "$ac_source" "$ac_file" ||
67392      as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
67393  fi
67394 ;;
67395  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
67396$as_echo "$as_me: executing $ac_file commands" >&6;}
67397 ;;
67398  esac
67399
67400
67401  case $ac_file$ac_mode in
67402    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
67403  # Older Autoconf quotes --file arguments for eval, but not when files
67404  # are listed without --file.  Let's play safe and only enable the eval
67405  # if we detect the quoting.
67406  case $CONFIG_FILES in
67407  *\'*) eval set x "$CONFIG_FILES" ;;
67408  *)   set x $CONFIG_FILES ;;
67409  esac
67410  shift
67411  for mf
67412  do
67413    # Strip MF so we end up with the name of the file.
67414    mf=`echo "$mf" | sed -e 's/:.*$//'`
67415    # Check whether this is an Automake generated Makefile or not.
67416    # We used to match only the files named 'Makefile.in', but
67417    # some people rename them; so instead we look at the file content.
67418    # Grep'ing the first line is not enough: some people post-process
67419    # each Makefile.in and add a new line on top of each file to say so.
67420    # Grep'ing the whole file is not good either: AIX grep has a line
67421    # limit of 2048, but all sed's we know have understand at least 4000.
67422    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
67423      dirpart=`$as_dirname -- "$mf" ||
67424$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
67425	 X"$mf" : 'X\(//\)[^/]' \| \
67426	 X"$mf" : 'X\(//\)$' \| \
67427	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
67428$as_echo X"$mf" |
67429    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
67430	    s//\1/
67431	    q
67432	  }
67433	  /^X\(\/\/\)[^/].*/{
67434	    s//\1/
67435	    q
67436	  }
67437	  /^X\(\/\/\)$/{
67438	    s//\1/
67439	    q
67440	  }
67441	  /^X\(\/\).*/{
67442	    s//\1/
67443	    q
67444	  }
67445	  s/.*/./; q'`
67446    else
67447      continue
67448    fi
67449    # Extract the definition of DEPDIR, am__include, and am__quote
67450    # from the Makefile without running 'make'.
67451    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
67452    test -z "$DEPDIR" && continue
67453    am__include=`sed -n 's/^am__include = //p' < "$mf"`
67454    test -z "$am__include" && continue
67455    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
67456    # Find all dependency output files, they are included files with
67457    # $(DEPDIR) in their names.  We invoke sed twice because it is the
67458    # simplest approach to changing $(DEPDIR) to its actual value in the
67459    # expansion.
67460    for file in `sed -n "
67461      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
67462	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
67463      # Make sure the directory exists.
67464      test -f "$dirpart/$file" && continue
67465      fdir=`$as_dirname -- "$file" ||
67466$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
67467	 X"$file" : 'X\(//\)[^/]' \| \
67468	 X"$file" : 'X\(//\)$' \| \
67469	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
67470$as_echo X"$file" |
67471    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
67472	    s//\1/
67473	    q
67474	  }
67475	  /^X\(\/\/\)[^/].*/{
67476	    s//\1/
67477	    q
67478	  }
67479	  /^X\(\/\/\)$/{
67480	    s//\1/
67481	    q
67482	  }
67483	  /^X\(\/\).*/{
67484	    s//\1/
67485	    q
67486	  }
67487	  s/.*/./; q'`
67488      as_dir=$dirpart/$fdir; as_fn_mkdir_p
67489      # echo "creating $dirpart/$file"
67490      echo '# dummy' > "$dirpart/$file"
67491    done
67492  done
67493}
67494 ;;
67495    "libtool":C)
67496
67497    # See if we are running on zsh, and set the options which allow our
67498    # commands through without removal of \ escapes.
67499    if test -n "${ZSH_VERSION+set}" ; then
67500      setopt NO_GLOB_SUBST
67501    fi
67502
67503    cfgfile="${ofile}T"
67504    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
67505    $RM "$cfgfile"
67506
67507    cat <<_LT_EOF >> "$cfgfile"
67508#! $SHELL
67509
67510# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
67511# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
67512# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
67513# NOTE: Changes made to this file will be lost: look at ltmain.sh.
67514#
67515#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
67516#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
67517#                 Foundation, Inc.
67518#   Written by Gordon Matzigkeit, 1996
67519#
67520#   This file is part of GNU Libtool.
67521#
67522# GNU Libtool is free software; you can redistribute it and/or
67523# modify it under the terms of the GNU General Public License as
67524# published by the Free Software Foundation; either version 2 of
67525# the License, or (at your option) any later version.
67526#
67527# As a special exception to the GNU General Public License,
67528# if you distribute this file as part of a program or library that
67529# is built using GNU Libtool, you may include this file under the
67530# same distribution terms that you use for the rest of that program.
67531#
67532# GNU Libtool is distributed in the hope that it will be useful,
67533# but WITHOUT ANY WARRANTY; without even the implied warranty of
67534# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
67535# GNU General Public License for more details.
67536#
67537# You should have received a copy of the GNU General Public License
67538# along with GNU Libtool; see the file COPYING.  If not, a copy
67539# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
67540# obtained by writing to the Free Software Foundation, Inc.,
67541# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
67542
67543
67544# The names of the tagged configurations supported by this script.
67545available_tags=""
67546
67547# ### BEGIN LIBTOOL CONFIG
67548
67549# Which release of libtool.m4 was used?
67550macro_version=$macro_version
67551macro_revision=$macro_revision
67552
67553# Whether or not to build shared libraries.
67554build_libtool_libs=$enable_shared
67555
67556# Whether or not to build static libraries.
67557build_old_libs=$enable_static
67558
67559# What type of objects to build.
67560pic_mode=$pic_mode
67561
67562# Whether or not to optimize for fast installation.
67563fast_install=$enable_fast_install
67564
67565# Shell to use when invoking shell scripts.
67566SHELL=$lt_SHELL
67567
67568# An echo program that protects backslashes.
67569ECHO=$lt_ECHO
67570
67571# The PATH separator for the build system.
67572PATH_SEPARATOR=$lt_PATH_SEPARATOR
67573
67574# The host system.
67575host_alias=$host_alias
67576host=$host
67577host_os=$host_os
67578
67579# The build system.
67580build_alias=$build_alias
67581build=$build
67582build_os=$build_os
67583
67584# A sed program that does not truncate output.
67585SED=$lt_SED
67586
67587# Sed that helps us avoid accidentally triggering echo(1) options like -n.
67588Xsed="\$SED -e 1s/^X//"
67589
67590# A grep program that handles long lines.
67591GREP=$lt_GREP
67592
67593# An ERE matcher.
67594EGREP=$lt_EGREP
67595
67596# A literal string matcher.
67597FGREP=$lt_FGREP
67598
67599# A BSD- or MS-compatible name lister.
67600NM=$lt_NM
67601
67602# Whether we need soft or hard links.
67603LN_S=$lt_LN_S
67604
67605# What is the maximum length of a command?
67606max_cmd_len=$max_cmd_len
67607
67608# Object file suffix (normally "o").
67609objext=$ac_objext
67610
67611# Executable file suffix (normally "").
67612exeext=$exeext
67613
67614# whether the shell understands "unset".
67615lt_unset=$lt_unset
67616
67617# turn spaces into newlines.
67618SP2NL=$lt_lt_SP2NL
67619
67620# turn newlines into spaces.
67621NL2SP=$lt_lt_NL2SP
67622
67623# convert \$build file names to \$host format.
67624to_host_file_cmd=$lt_cv_to_host_file_cmd
67625
67626# convert \$build files to toolchain format.
67627to_tool_file_cmd=$lt_cv_to_tool_file_cmd
67628
67629# An object symbol dumper.
67630OBJDUMP=$lt_OBJDUMP
67631
67632# Method to check whether dependent libraries are shared objects.
67633deplibs_check_method=$lt_deplibs_check_method
67634
67635# Command to use when deplibs_check_method = "file_magic".
67636file_magic_cmd=$lt_file_magic_cmd
67637
67638# How to find potential files when deplibs_check_method = "file_magic".
67639file_magic_glob=$lt_file_magic_glob
67640
67641# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
67642want_nocaseglob=$lt_want_nocaseglob
67643
67644# DLL creation program.
67645DLLTOOL=$lt_DLLTOOL
67646
67647# Command to associate shared and link libraries.
67648sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
67649
67650# The archiver.
67651AR=$lt_AR
67652
67653# Flags to create an archive.
67654AR_FLAGS=$lt_AR_FLAGS
67655
67656# How to feed a file listing to the archiver.
67657archiver_list_spec=$lt_archiver_list_spec
67658
67659# A symbol stripping program.
67660STRIP=$lt_STRIP
67661
67662# Commands used to install an old-style archive.
67663RANLIB=$lt_RANLIB
67664old_postinstall_cmds=$lt_old_postinstall_cmds
67665old_postuninstall_cmds=$lt_old_postuninstall_cmds
67666
67667# Whether to use a lock for old archive extraction.
67668lock_old_archive_extraction=$lock_old_archive_extraction
67669
67670# A C compiler.
67671LTCC=$lt_CC
67672
67673# LTCC compiler flags.
67674LTCFLAGS=$lt_CFLAGS
67675
67676# Take the output of nm and produce a listing of raw symbols and C names.
67677global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
67678
67679# Transform the output of nm in a proper C declaration.
67680global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
67681
67682# Transform the output of nm in a C name address pair.
67683global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
67684
67685# Transform the output of nm in a C name address pair when lib prefix is needed.
67686global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
67687
67688# Specify filename containing input files for \$NM.
67689nm_file_list_spec=$lt_nm_file_list_spec
67690
67691# The root where to search for dependent libraries,and in which our libraries should be installed.
67692lt_sysroot=$lt_sysroot
67693
67694# The name of the directory that contains temporary libtool files.
67695objdir=$objdir
67696
67697# Used to examine libraries when file_magic_cmd begins with "file".
67698MAGIC_CMD=$MAGIC_CMD
67699
67700# Must we lock files when doing compilation?
67701need_locks=$lt_need_locks
67702
67703# Manifest tool.
67704MANIFEST_TOOL=$lt_MANIFEST_TOOL
67705
67706# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
67707DSYMUTIL=$lt_DSYMUTIL
67708
67709# Tool to change global to local symbols on Mac OS X.
67710NMEDIT=$lt_NMEDIT
67711
67712# Tool to manipulate fat objects and archives on Mac OS X.
67713LIPO=$lt_LIPO
67714
67715# ldd/readelf like tool for Mach-O binaries on Mac OS X.
67716OTOOL=$lt_OTOOL
67717
67718# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
67719OTOOL64=$lt_OTOOL64
67720
67721# Old archive suffix (normally "a").
67722libext=$libext
67723
67724# Shared library suffix (normally ".so").
67725shrext_cmds=$lt_shrext_cmds
67726
67727# The commands to extract the exported symbol list from a shared archive.
67728extract_expsyms_cmds=$lt_extract_expsyms_cmds
67729
67730# Variables whose values should be saved in libtool wrapper scripts and
67731# restored at link time.
67732variables_saved_for_relink=$lt_variables_saved_for_relink
67733
67734# Do we need the "lib" prefix for modules?
67735need_lib_prefix=$need_lib_prefix
67736
67737# Do we need a version for libraries?
67738need_version=$need_version
67739
67740# Library versioning type.
67741version_type=$version_type
67742
67743# Shared library runtime path variable.
67744runpath_var=$runpath_var
67745
67746# Shared library path variable.
67747shlibpath_var=$shlibpath_var
67748
67749# Is shlibpath searched before the hard-coded library search path?
67750shlibpath_overrides_runpath=$shlibpath_overrides_runpath
67751
67752# Format of library name prefix.
67753libname_spec=$lt_libname_spec
67754
67755# List of archive names.  First name is the real one, the rest are links.
67756# The last name is the one that the linker finds with -lNAME
67757library_names_spec=$lt_library_names_spec
67758
67759# The coded name of the library, if different from the real name.
67760soname_spec=$lt_soname_spec
67761
67762# Permission mode override for installation of shared libraries.
67763install_override_mode=$lt_install_override_mode
67764
67765# Command to use after installation of a shared archive.
67766postinstall_cmds=$lt_postinstall_cmds
67767
67768# Command to use after uninstallation of a shared archive.
67769postuninstall_cmds=$lt_postuninstall_cmds
67770
67771# Commands used to finish a libtool library installation in a directory.
67772finish_cmds=$lt_finish_cmds
67773
67774# As "finish_cmds", except a single script fragment to be evaled but
67775# not shown.
67776finish_eval=$lt_finish_eval
67777
67778# Whether we should hardcode library paths into libraries.
67779hardcode_into_libs=$hardcode_into_libs
67780
67781# Compile-time system search path for libraries.
67782sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
67783
67784# Run-time system search path for libraries.
67785sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
67786
67787# Whether dlopen is supported.
67788dlopen_support=$enable_dlopen
67789
67790# Whether dlopen of programs is supported.
67791dlopen_self=$enable_dlopen_self
67792
67793# Whether dlopen of statically linked programs is supported.
67794dlopen_self_static=$enable_dlopen_self_static
67795
67796# Commands to strip libraries.
67797old_striplib=$lt_old_striplib
67798striplib=$lt_striplib
67799
67800
67801# The linker used to build libraries.
67802LD=$lt_LD
67803
67804# How to create reloadable object files.
67805reload_flag=$lt_reload_flag
67806reload_cmds=$lt_reload_cmds
67807
67808# Commands used to build an old-style archive.
67809old_archive_cmds=$lt_old_archive_cmds
67810
67811# A language specific compiler.
67812CC=$lt_compiler
67813
67814# Is the compiler the GNU compiler?
67815with_gcc=$GCC
67816
67817# Compiler flag to turn off builtin functions.
67818no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
67819
67820# Additional compiler flags for building library objects.
67821pic_flag=$lt_lt_prog_compiler_pic
67822
67823# How to pass a linker flag through the compiler.
67824wl=$lt_lt_prog_compiler_wl
67825
67826# Compiler flag to prevent dynamic linking.
67827link_static_flag=$lt_lt_prog_compiler_static
67828
67829# Does compiler simultaneously support -c and -o options?
67830compiler_c_o=$lt_lt_cv_prog_compiler_c_o
67831
67832# Whether or not to add -lc for building shared libraries.
67833build_libtool_need_lc=$archive_cmds_need_lc
67834
67835# Whether or not to disallow shared libs when runtime libs are static.
67836allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
67837
67838# Compiler flag to allow reflexive dlopens.
67839export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
67840
67841# Compiler flag to generate shared objects directly from archives.
67842whole_archive_flag_spec=$lt_whole_archive_flag_spec
67843
67844# Whether the compiler copes with passing no objects directly.
67845compiler_needs_object=$lt_compiler_needs_object
67846
67847# Create an old-style archive from a shared archive.
67848old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
67849
67850# Create a temporary old-style archive to link instead of a shared archive.
67851old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
67852
67853# Commands used to build a shared archive.
67854archive_cmds=$lt_archive_cmds
67855archive_expsym_cmds=$lt_archive_expsym_cmds
67856
67857# Commands used to build a loadable module if different from building
67858# a shared archive.
67859module_cmds=$lt_module_cmds
67860module_expsym_cmds=$lt_module_expsym_cmds
67861
67862# Whether we are building with GNU ld or not.
67863with_gnu_ld=$lt_with_gnu_ld
67864
67865# Flag that allows shared libraries with undefined symbols to be built.
67866allow_undefined_flag=$lt_allow_undefined_flag
67867
67868# Flag that enforces no undefined symbols.
67869no_undefined_flag=$lt_no_undefined_flag
67870
67871# Flag to hardcode \$libdir into a binary during linking.
67872# This must work even if \$libdir does not exist
67873hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
67874
67875# Whether we need a single "-rpath" flag with a separated argument.
67876hardcode_libdir_separator=$lt_hardcode_libdir_separator
67877
67878# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
67879# DIR into the resulting binary.
67880hardcode_direct=$hardcode_direct
67881
67882# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
67883# DIR into the resulting binary and the resulting library dependency is
67884# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
67885# library is relocated.
67886hardcode_direct_absolute=$hardcode_direct_absolute
67887
67888# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
67889# into the resulting binary.
67890hardcode_minus_L=$hardcode_minus_L
67891
67892# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
67893# into the resulting binary.
67894hardcode_shlibpath_var=$hardcode_shlibpath_var
67895
67896# Set to "yes" if building a shared library automatically hardcodes DIR
67897# into the library and all subsequent libraries and executables linked
67898# against it.
67899hardcode_automatic=$hardcode_automatic
67900
67901# Set to yes if linker adds runtime paths of dependent libraries
67902# to runtime path list.
67903inherit_rpath=$inherit_rpath
67904
67905# Whether libtool must link a program against all its dependency libraries.
67906link_all_deplibs=$link_all_deplibs
67907
67908# Set to "yes" if exported symbols are required.
67909always_export_symbols=$always_export_symbols
67910
67911# The commands to list exported symbols.
67912export_symbols_cmds=$lt_export_symbols_cmds
67913
67914# Symbols that should not be listed in the preloaded symbols.
67915exclude_expsyms=$lt_exclude_expsyms
67916
67917# Symbols that must always be exported.
67918include_expsyms=$lt_include_expsyms
67919
67920# Commands necessary for linking programs (against libraries) with templates.
67921prelink_cmds=$lt_prelink_cmds
67922
67923# Commands necessary for finishing linking programs.
67924postlink_cmds=$lt_postlink_cmds
67925
67926# Specify filename containing input files.
67927file_list_spec=$lt_file_list_spec
67928
67929# How to hardcode a shared library path into an executable.
67930hardcode_action=$hardcode_action
67931
67932# ### END LIBTOOL CONFIG
67933
67934_LT_EOF
67935
67936  case $host_os in
67937  aix3*)
67938    cat <<\_LT_EOF >> "$cfgfile"
67939# AIX sometimes has problems with the GCC collect2 program.  For some
67940# reason, if we set the COLLECT_NAMES environment variable, the problems
67941# vanish in a puff of smoke.
67942if test "X${COLLECT_NAMES+set}" != Xset; then
67943  COLLECT_NAMES=
67944  export COLLECT_NAMES
67945fi
67946_LT_EOF
67947    ;;
67948  esac
67949
67950
67951ltmain="$ac_aux_dir/ltmain.sh"
67952
67953
67954  # We use sed instead of cat because bash on DJGPP gets confused if
67955  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
67956  # text mode, it properly converts lines to CR/LF.  This bash problem
67957  # is reportedly fixed, but why not run on old versions too?
67958  sed '$q' "$ltmain" >> "$cfgfile" \
67959     || (rm -f "$cfgfile"; exit 1)
67960
67961  if test x"$xsi_shell" = xyes; then
67962  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
67963func_dirname ()\
67964{\
67965\    case ${1} in\
67966\      */*) func_dirname_result="${1%/*}${2}" ;;\
67967\      *  ) func_dirname_result="${3}" ;;\
67968\    esac\
67969} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
67970  && mv -f "$cfgfile.tmp" "$cfgfile" \
67971    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
67972test 0 -eq $? || _lt_function_replace_fail=:
67973
67974
67975  sed -e '/^func_basename ()$/,/^} # func_basename /c\
67976func_basename ()\
67977{\
67978\    func_basename_result="${1##*/}"\
67979} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
67980  && mv -f "$cfgfile.tmp" "$cfgfile" \
67981    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
67982test 0 -eq $? || _lt_function_replace_fail=:
67983
67984
67985  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
67986func_dirname_and_basename ()\
67987{\
67988\    case ${1} in\
67989\      */*) func_dirname_result="${1%/*}${2}" ;;\
67990\      *  ) func_dirname_result="${3}" ;;\
67991\    esac\
67992\    func_basename_result="${1##*/}"\
67993} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
67994  && mv -f "$cfgfile.tmp" "$cfgfile" \
67995    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
67996test 0 -eq $? || _lt_function_replace_fail=:
67997
67998
67999  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
68000func_stripname ()\
68001{\
68002\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
68003\    # positional parameters, so assign one to ordinary parameter first.\
68004\    func_stripname_result=${3}\
68005\    func_stripname_result=${func_stripname_result#"${1}"}\
68006\    func_stripname_result=${func_stripname_result%"${2}"}\
68007} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
68008  && mv -f "$cfgfile.tmp" "$cfgfile" \
68009    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68010test 0 -eq $? || _lt_function_replace_fail=:
68011
68012
68013  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
68014func_split_long_opt ()\
68015{\
68016\    func_split_long_opt_name=${1%%=*}\
68017\    func_split_long_opt_arg=${1#*=}\
68018} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
68019  && mv -f "$cfgfile.tmp" "$cfgfile" \
68020    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68021test 0 -eq $? || _lt_function_replace_fail=:
68022
68023
68024  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
68025func_split_short_opt ()\
68026{\
68027\    func_split_short_opt_arg=${1#??}\
68028\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
68029} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
68030  && mv -f "$cfgfile.tmp" "$cfgfile" \
68031    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68032test 0 -eq $? || _lt_function_replace_fail=:
68033
68034
68035  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
68036func_lo2o ()\
68037{\
68038\    case ${1} in\
68039\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
68040\      *)    func_lo2o_result=${1} ;;\
68041\    esac\
68042} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
68043  && mv -f "$cfgfile.tmp" "$cfgfile" \
68044    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68045test 0 -eq $? || _lt_function_replace_fail=:
68046
68047
68048  sed -e '/^func_xform ()$/,/^} # func_xform /c\
68049func_xform ()\
68050{\
68051    func_xform_result=${1%.*}.lo\
68052} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
68053  && mv -f "$cfgfile.tmp" "$cfgfile" \
68054    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68055test 0 -eq $? || _lt_function_replace_fail=:
68056
68057
68058  sed -e '/^func_arith ()$/,/^} # func_arith /c\
68059func_arith ()\
68060{\
68061    func_arith_result=$(( $* ))\
68062} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
68063  && mv -f "$cfgfile.tmp" "$cfgfile" \
68064    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68065test 0 -eq $? || _lt_function_replace_fail=:
68066
68067
68068  sed -e '/^func_len ()$/,/^} # func_len /c\
68069func_len ()\
68070{\
68071    func_len_result=${#1}\
68072} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
68073  && mv -f "$cfgfile.tmp" "$cfgfile" \
68074    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68075test 0 -eq $? || _lt_function_replace_fail=:
68076
68077fi
68078
68079if test x"$lt_shell_append" = xyes; then
68080  sed -e '/^func_append ()$/,/^} # func_append /c\
68081func_append ()\
68082{\
68083    eval "${1}+=\\${2}"\
68084} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
68085  && mv -f "$cfgfile.tmp" "$cfgfile" \
68086    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68087test 0 -eq $? || _lt_function_replace_fail=:
68088
68089
68090  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
68091func_append_quoted ()\
68092{\
68093\    func_quote_for_eval "${2}"\
68094\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
68095} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
68096  && mv -f "$cfgfile.tmp" "$cfgfile" \
68097    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68098test 0 -eq $? || _lt_function_replace_fail=:
68099
68100
68101  # Save a `func_append' function call where possible by direct use of '+='
68102  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
68103    && mv -f "$cfgfile.tmp" "$cfgfile" \
68104      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68105  test 0 -eq $? || _lt_function_replace_fail=:
68106else
68107  # Save a `func_append' function call even when '+=' is not available
68108  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
68109    && mv -f "$cfgfile.tmp" "$cfgfile" \
68110      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
68111  test 0 -eq $? || _lt_function_replace_fail=:
68112fi
68113
68114if test x"$_lt_function_replace_fail" = x":"; then
68115  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
68116$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
68117fi
68118
68119
68120   mv -f "$cfgfile" "$ofile" ||
68121    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
68122  chmod +x "$ofile"
68123
68124 ;;
68125
68126  esac
68127done # for ac_tag
68128
68129
68130as_fn_exit 0
68131_ACEOF
68132ac_clean_files=$ac_clean_files_save
68133
68134test $ac_write_fail = 0 ||
68135  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
68136
68137
68138# configure is writing to config.log, and then calls config.status.
68139# config.status does its own redirection, appending to config.log.
68140# Unfortunately, on DOS this fails, as config.log is still kept open
68141# by configure, so config.status won't be able to write to it; its
68142# output is simply discarded.  So we exec the FD to /dev/null,
68143# effectively closing config.log, so it can be properly (re)opened and
68144# appended to by config.status.  When coming back to configure, we
68145# need to make the FD available again.
68146if test "$no_create" != yes; then
68147  ac_cs_success=:
68148  ac_config_status_args=
68149  test "$silent" = yes &&
68150    ac_config_status_args="$ac_config_status_args --quiet"
68151  exec 5>/dev/null
68152  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
68153  exec 5>>config.log
68154  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
68155  # would make configure fail if this is the last instruction.
68156  $ac_cs_success || as_fn_exit 1
68157fi
68158if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
68159  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
68160$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
68161fi
68162
68163
68164rm -f sockd/config_scan.c sockd/config_parse.c
68165(cd sockd; ln -sf ../lib/config_scan.c config_scan.c)
68166(cd sockd; ln -sf ../lib/config_parse.c config_parse.c)
68167(cd dlib; ln -sf ../lib/config_scan.c config_scan.c)
68168(cd dlib; ln -sf ../lib/config_parse.c config_parse.c)
68169
68170(cd sockd; ln -sf ../lib/config_parse.y config_parse.y)
68171(cd sockd; ln -sf ../lib/config_scan.l config_scan.l)
68172(cd dlib; ln -sf ../lib/config_parse.y config_parse.y)
68173(cd dlib; ln -sf ../lib/config_scan.l config_scan.l)
68174
68175echo ""
68176echo "                     Configure status:"
68177echo ""
68178
68179if test x"$NOCLIENT" != x; then
68180    echo "Client:            $NOCLIENT"
68181else
68182    echo "Client:            Enabled"
68183fi
68184if test x"$NOSERVER" != x; then
68185    echo "Server:            $NOSERVER"
68186else
68187    echo "Server:            Enabled"
68188fi
68189if test x"${no_preload}" = xt; then
68190   if test x"${blocked_preload}" = xt; then
68191	echo "Preloading:        Client preloading might not be reliable on this platform"
68192	CONFVAR="${CONFVAR}${CONFVAR:+ }badpreload"
68193   else
68194	echo "Preloading:        Disabled"
68195	CONFVAR="${CONFVAR}${CONFVAR:+ }nopreload"
68196   fi
68197else
68198    echo "Preloading:        Enabled"
68199    CONFVAR="${CONFVAR}${CONFVAR:+ }preload"
68200fi
68201if test x"${nb_select_err}" = xt; then
68202    echo "select:            Unexpected select behaviour on unconnected sockets,"
68203    echo "                   operations on nonblocking sockets might fail "
68204    echo "                   on this platform when using socksify"
68205    CONFVAR="${CONFVAR}${CONFVAR:+ }selecterr"
68206#else
68207#    echo "select:            OK"
68208fi
68209if test x"${no_routeinfo}" = xt; then
68210    echo "Routeinfo:         Not supported on this platform"
68211    CONFVAR="${CONFVAR}${CONFVAR:+ }norouteinfo"
68212else
68213#    echo "Routeinfo:         OK"
68214    CONFVAR="${CONFVAR}${CONFVAR:+ }routeinfo"
68215fi
68216if test x"$NOLIBWRAP" != x; then
68217	echo "Libwrap:           $NOLIBWRAP"
68218else
68219	echo "Libwrap:           Enabled"
68220fi
68221if test x"$NOBSDAUTH" != x; then
68222	echo "BSD Auth:          $NOBSDAUTH"
68223else
68224	echo "BSD Auth:          Enabled"
68225fi
68226if test x"$NOPAM" != x; then
68227	echo "PAM:               $NOPAM"
68228else
68229	echo "PAM:               Enabled"
68230fi
68231if test x"${no_gssapi}" = xt; then
68232   if test x"${bad_gssapi}" = xt; then
68233	echo "GSSAPI:            Located gssapi library not usable"
68234   else
68235	echo "GSSAPI:            Not found/disabled"
68236   fi
68237else
68238	echo "GSSAPI:            Enabled"
68239fi
68240if test x"${no_krb5}" = xt; then
68241	echo "KRB5:              Not found/disabled"
68242else
68243	echo "KRB5:              Enabled"
68244fi
68245if test x"${no_sasl}" = xt; then
68246	echo "SASL:              Not found/disabled"
68247else
68248	echo "SASL:              Enabled"
68249fi
68250if test x"${no_upnp}" = xt; then
68251    if test x"${have_libminiupnp}" = xt; then
68252	echo "UPNP:              Unsupported miniupnp library version"
68253    else
68254	echo "UPNP:              Not found/disabled"
68255    fi
68256else
68257    echo "UPNP:              Enabled"
68258fi
68259if test x"$COMPATFUNCS" = x; then
68260    echo "Compatability:     none"
68261else
68262    echo "Compatability:     $COMPATFUNCS"
68263fi
68264
68265echo ""
68266echo "                     Modules:"
68267echo ""
68268if test x"$MOD_REDIRECT" != x; then
68269    echo "redirect:          Enabled"
68270else
68271    echo "redirect:          Not found"
68272fi
68273if test x"$MOD_BANDWIDTH" != x; then
68274    echo "bandwidth:         Enabled"
68275else
68276    echo "bandwidth:         Not found"
68277fi
68278if test x"$MOD_LDAP" != x; then
68279    if test x"${no_ldap}" != x; then
68280	s="             " #indent
68281	echo "ldap:$s Disabled ($noldap)"
68282	echo "     $s (NOTE: Both libraries and header files for"
68283	echo "     $s  Kerberos/SASL/GSSAPI/LDAP must be installed for the"
68284	echo "     $s  LDAP module to compile. On some platforms header files"
68285	echo "     $s  are found in separate packages (such as gssapi-devel).)"
68286    else
68287	echo "ldap:              Enabled"
68288    fi
68289else
68290    echo "ldap:              Not found"
68291fi
68292if test x"$MOD_PAC" != x; then
68293    if test x"${have_pac}" != x; then
68294        echo "pac:               Enabled"
68295    else
68296        s="             " #indent
68297        echo "pac: $s Disabled ($nopac)"
68298	echo "     $s (NOTE: Both libraries and header files for"
68299	echo "     $s Kerberos/SASL/GSSAPI/LDAP must be installed for the"
68300	echo "     $s PAC module to compile. On some platforms header files"
68301	echo "     $s are found in separate packages (such as gssapi-devel).)"
68302    fi
68303else
68304    echo "pac:               Not found"
68305fi
68306
68307echo ""
68308
68309echo "CONFRES: $CONFVAR" >> buildenv.txt
68310
68311if test x"$prerelease" != x; then
68312   echo "
68313This is a pre-release.  We ask that everyone who can, test it to the
68314extent possible, to help reduce problems in the upcoming release.
68315Problems can be reported to dante-bugs@inet.no.
68316
68317Note that pre-releases are often configured in a way that can
68318significantly increase the load on the machine.  This is done to
68319stress the server more, increasing the chances of detecting potential
68320problems.
68321"
68322fi
68323
68324VINFO=README.latest
68325test -s "$VINFO" && cat "$VINFO"
68326
68327#XXX depcomp regen hack
68328touch _reconf
68329for dir in bin lib dlib sockd unlicensed; do
68330    touch $dir/_reconf
68331done
68332
68333true #ensure $? is zero
68334
68335exit 0
68336