xref: /freebsd/contrib/tcpdump/configure (revision daf1cffce2e07931f27c6c6998652e90df6ba87e)
1#! /bin/sh
2
3# Guess values for system-dependent variables and create Makefiles.
4# Generated automatically using autoconf version 2.13
5# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6#
7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it.
9
10# Defaults:
11ac_help=
12ac_default_prefix=/usr/local
13# Any additions from configure.in:
14ac_help="$ac_help
15  --without-gcc           don't use gcc"
16ac_help="$ac_help
17  --enable-ipv6           enable ipv6 (with ipv4) support
18  --disable-ipv6          disable ipv6 support"
19
20# Initialize some variables set by options.
21# The variables have the same names as the options, with
22# dashes changed to underlines.
23build=NONE
24cache_file=./config.cache
25exec_prefix=NONE
26host=NONE
27no_create=
28nonopt=NONE
29no_recursion=
30prefix=NONE
31program_prefix=NONE
32program_suffix=NONE
33program_transform_name=s,x,x,
34silent=
35site=
36srcdir=
37target=NONE
38verbose=
39x_includes=NONE
40x_libraries=NONE
41bindir='${exec_prefix}/bin'
42sbindir='${exec_prefix}/sbin'
43libexecdir='${exec_prefix}/libexec'
44datadir='${prefix}/share'
45sysconfdir='${prefix}/etc'
46sharedstatedir='${prefix}/com'
47localstatedir='${prefix}/var'
48libdir='${exec_prefix}/lib'
49includedir='${prefix}/include'
50oldincludedir='/usr/include'
51infodir='${prefix}/info'
52mandir='${prefix}/man'
53
54# Initialize some other variables.
55subdirs=
56MFLAGS= MAKEFLAGS=
57SHELL=${CONFIG_SHELL-/bin/sh}
58# Maximum number of lines to put in a shell here document.
59ac_max_here_lines=12
60
61ac_prev=
62for ac_option
63do
64
65  # If the previous option needs an argument, assign it.
66  if test -n "$ac_prev"; then
67    eval "$ac_prev=\$ac_option"
68    ac_prev=
69    continue
70  fi
71
72  case "$ac_option" in
73  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
74  *) ac_optarg= ;;
75  esac
76
77  # Accept the important Cygnus configure options, so we can diagnose typos.
78
79  case "$ac_option" in
80
81  -bindir | --bindir | --bindi | --bind | --bin | --bi)
82    ac_prev=bindir ;;
83  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
84    bindir="$ac_optarg" ;;
85
86  -build | --build | --buil | --bui | --bu)
87    ac_prev=build ;;
88  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
89    build="$ac_optarg" ;;
90
91  -cache-file | --cache-file | --cache-fil | --cache-fi \
92  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
93    ac_prev=cache_file ;;
94  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
95  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
96    cache_file="$ac_optarg" ;;
97
98  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
99    ac_prev=datadir ;;
100  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
101  | --da=*)
102    datadir="$ac_optarg" ;;
103
104  -disable-* | --disable-*)
105    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
106    # Reject names that are not valid shell variable names.
107    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
108      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
109    fi
110    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
111    eval "enable_${ac_feature}=no" ;;
112
113  -enable-* | --enable-*)
114    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
115    # Reject names that are not valid shell variable names.
116    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
117      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
118    fi
119    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
120    case "$ac_option" in
121      *=*) ;;
122      *) ac_optarg=yes ;;
123    esac
124    eval "enable_${ac_feature}='$ac_optarg'" ;;
125
126  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
127  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
128  | --exec | --exe | --ex)
129    ac_prev=exec_prefix ;;
130  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
131  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
132  | --exec=* | --exe=* | --ex=*)
133    exec_prefix="$ac_optarg" ;;
134
135  -gas | --gas | --ga | --g)
136    # Obsolete; use --with-gas.
137    with_gas=yes ;;
138
139  -help | --help | --hel | --he)
140    # Omit some internal or obsolete options to make the list less imposing.
141    # This message is too long to be a string in the A/UX 3.1 sh.
142    cat << EOF
143Usage: configure [options] [host]
144Options: [defaults in brackets after descriptions]
145Configuration:
146  --cache-file=FILE       cache test results in FILE
147  --help                  print this message
148  --no-create             do not create output files
149  --quiet, --silent       do not print \`checking...' messages
150  --version               print the version of autoconf that created configure
151Directory and file names:
152  --prefix=PREFIX         install architecture-independent files in PREFIX
153                          [$ac_default_prefix]
154  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
155                          [same as prefix]
156  --bindir=DIR            user executables in DIR [EPREFIX/bin]
157  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
158  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
159  --datadir=DIR           read-only architecture-independent data in DIR
160                          [PREFIX/share]
161  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
162  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
163                          [PREFIX/com]
164  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
165  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
166  --includedir=DIR        C header files in DIR [PREFIX/include]
167  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
168  --infodir=DIR           info documentation in DIR [PREFIX/info]
169  --mandir=DIR            man documentation in DIR [PREFIX/man]
170  --srcdir=DIR            find the sources in DIR [configure dir or ..]
171  --program-prefix=PREFIX prepend PREFIX to installed program names
172  --program-suffix=SUFFIX append SUFFIX to installed program names
173  --program-transform-name=PROGRAM
174                          run sed PROGRAM on installed program names
175EOF
176    cat << EOF
177Host type:
178  --build=BUILD           configure for building on BUILD [BUILD=HOST]
179  --host=HOST             configure for HOST [guessed]
180  --target=TARGET         configure for TARGET [TARGET=HOST]
181Features and packages:
182  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
183  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
184  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
185  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
186  --x-includes=DIR        X include files are in DIR
187  --x-libraries=DIR       X library files are in DIR
188EOF
189    if test -n "$ac_help"; then
190      echo "--enable and --with options recognized:$ac_help"
191    fi
192    exit 0 ;;
193
194  -host | --host | --hos | --ho)
195    ac_prev=host ;;
196  -host=* | --host=* | --hos=* | --ho=*)
197    host="$ac_optarg" ;;
198
199  -includedir | --includedir | --includedi | --included | --include \
200  | --includ | --inclu | --incl | --inc)
201    ac_prev=includedir ;;
202  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
203  | --includ=* | --inclu=* | --incl=* | --inc=*)
204    includedir="$ac_optarg" ;;
205
206  -infodir | --infodir | --infodi | --infod | --info | --inf)
207    ac_prev=infodir ;;
208  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
209    infodir="$ac_optarg" ;;
210
211  -libdir | --libdir | --libdi | --libd)
212    ac_prev=libdir ;;
213  -libdir=* | --libdir=* | --libdi=* | --libd=*)
214    libdir="$ac_optarg" ;;
215
216  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
217  | --libexe | --libex | --libe)
218    ac_prev=libexecdir ;;
219  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
220  | --libexe=* | --libex=* | --libe=*)
221    libexecdir="$ac_optarg" ;;
222
223  -localstatedir | --localstatedir | --localstatedi | --localstated \
224  | --localstate | --localstat | --localsta | --localst \
225  | --locals | --local | --loca | --loc | --lo)
226    ac_prev=localstatedir ;;
227  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
228  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
229  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
230    localstatedir="$ac_optarg" ;;
231
232  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
233    ac_prev=mandir ;;
234  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
235    mandir="$ac_optarg" ;;
236
237  -nfp | --nfp | --nf)
238    # Obsolete; use --without-fp.
239    with_fp=no ;;
240
241  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
242  | --no-cr | --no-c)
243    no_create=yes ;;
244
245  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
246  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
247    no_recursion=yes ;;
248
249  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
250  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
251  | --oldin | --oldi | --old | --ol | --o)
252    ac_prev=oldincludedir ;;
253  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
254  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
255  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
256    oldincludedir="$ac_optarg" ;;
257
258  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
259    ac_prev=prefix ;;
260  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
261    prefix="$ac_optarg" ;;
262
263  -program-prefix | --program-prefix | --program-prefi | --program-pref \
264  | --program-pre | --program-pr | --program-p)
265    ac_prev=program_prefix ;;
266  -program-prefix=* | --program-prefix=* | --program-prefi=* \
267  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
268    program_prefix="$ac_optarg" ;;
269
270  -program-suffix | --program-suffix | --program-suffi | --program-suff \
271  | --program-suf | --program-su | --program-s)
272    ac_prev=program_suffix ;;
273  -program-suffix=* | --program-suffix=* | --program-suffi=* \
274  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
275    program_suffix="$ac_optarg" ;;
276
277  -program-transform-name | --program-transform-name \
278  | --program-transform-nam | --program-transform-na \
279  | --program-transform-n | --program-transform- \
280  | --program-transform | --program-transfor \
281  | --program-transfo | --program-transf \
282  | --program-trans | --program-tran \
283  | --progr-tra | --program-tr | --program-t)
284    ac_prev=program_transform_name ;;
285  -program-transform-name=* | --program-transform-name=* \
286  | --program-transform-nam=* | --program-transform-na=* \
287  | --program-transform-n=* | --program-transform-=* \
288  | --program-transform=* | --program-transfor=* \
289  | --program-transfo=* | --program-transf=* \
290  | --program-trans=* | --program-tran=* \
291  | --progr-tra=* | --program-tr=* | --program-t=*)
292    program_transform_name="$ac_optarg" ;;
293
294  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
295  | -silent | --silent | --silen | --sile | --sil)
296    silent=yes ;;
297
298  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
299    ac_prev=sbindir ;;
300  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
301  | --sbi=* | --sb=*)
302    sbindir="$ac_optarg" ;;
303
304  -sharedstatedir | --sharedstatedir | --sharedstatedi \
305  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
306  | --sharedst | --shareds | --shared | --share | --shar \
307  | --sha | --sh)
308    ac_prev=sharedstatedir ;;
309  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
310  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
311  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
312  | --sha=* | --sh=*)
313    sharedstatedir="$ac_optarg" ;;
314
315  -site | --site | --sit)
316    ac_prev=site ;;
317  -site=* | --site=* | --sit=*)
318    site="$ac_optarg" ;;
319
320  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
321    ac_prev=srcdir ;;
322  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
323    srcdir="$ac_optarg" ;;
324
325  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
326  | --syscon | --sysco | --sysc | --sys | --sy)
327    ac_prev=sysconfdir ;;
328  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
329  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
330    sysconfdir="$ac_optarg" ;;
331
332  -target | --target | --targe | --targ | --tar | --ta | --t)
333    ac_prev=target ;;
334  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
335    target="$ac_optarg" ;;
336
337  -v | -verbose | --verbose | --verbos | --verbo | --verb)
338    verbose=yes ;;
339
340  -version | --version | --versio | --versi | --vers)
341    echo "configure generated by autoconf version 2.13"
342    exit 0 ;;
343
344  -with-* | --with-*)
345    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
346    # Reject names that are not valid shell variable names.
347    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
348      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
349    fi
350    ac_package=`echo $ac_package| sed 's/-/_/g'`
351    case "$ac_option" in
352      *=*) ;;
353      *) ac_optarg=yes ;;
354    esac
355    eval "with_${ac_package}='$ac_optarg'" ;;
356
357  -without-* | --without-*)
358    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
359    # Reject names that are not valid shell variable names.
360    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
361      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
362    fi
363    ac_package=`echo $ac_package| sed 's/-/_/g'`
364    eval "with_${ac_package}=no" ;;
365
366  --x)
367    # Obsolete; use --with-x.
368    with_x=yes ;;
369
370  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
371  | --x-incl | --x-inc | --x-in | --x-i)
372    ac_prev=x_includes ;;
373  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
374  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
375    x_includes="$ac_optarg" ;;
376
377  -x-libraries | --x-libraries | --x-librarie | --x-librari \
378  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
379    ac_prev=x_libraries ;;
380  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
381  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
382    x_libraries="$ac_optarg" ;;
383
384  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
385    ;;
386
387  *)
388    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
389      echo "configure: warning: $ac_option: invalid host type" 1>&2
390    fi
391    if test "x$nonopt" != xNONE; then
392      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
393    fi
394    nonopt="$ac_option"
395    ;;
396
397  esac
398done
399
400if test -n "$ac_prev"; then
401  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
402fi
403
404trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
405
406# File descriptor usage:
407# 0 standard input
408# 1 file creation
409# 2 errors and warnings
410# 3 some systems may open it to /dev/tty
411# 4 used on the Kubota Titan
412# 6 checking for... messages and results
413# 5 compiler messages saved in config.log
414if test "$silent" = yes; then
415  exec 6>/dev/null
416else
417  exec 6>&1
418fi
419exec 5>./config.log
420
421echo "\
422This file contains any messages produced by compilers while
423running configure, to aid debugging if configure makes a mistake.
424" 1>&5
425
426# Strip out --no-create and --no-recursion so they do not pile up.
427# Also quote any args containing shell metacharacters.
428ac_configure_args=
429for ac_arg
430do
431  case "$ac_arg" in
432  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
433  | --no-cr | --no-c) ;;
434  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
435  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
436  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
437  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
438  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
439  esac
440done
441
442# NLS nuisances.
443# Only set these to C if already set.  These must not be set unconditionally
444# because not all systems understand e.g. LANG=C (notably SCO).
445# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
446# Non-C LC_CTYPE values break the ctype check.
447if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
448if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
449if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
450if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
451
452# confdefs.h avoids OS command line length limits that DEFS can exceed.
453rm -rf conftest* confdefs.h
454# AIX cpp loses on an empty file, so make sure it contains at least a newline.
455echo > confdefs.h
456
457# A filename unique to this package, relative to the directory that
458# configure is in, which we can look for to find out if srcdir is correct.
459ac_unique_file=tcpdump.c
460
461# Find the source files, if location was not specified.
462if test -z "$srcdir"; then
463  ac_srcdir_defaulted=yes
464  # Try the directory containing this script, then its parent.
465  ac_prog=$0
466  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
467  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
468  srcdir=$ac_confdir
469  if test ! -r $srcdir/$ac_unique_file; then
470    srcdir=..
471  fi
472else
473  ac_srcdir_defaulted=no
474fi
475if test ! -r $srcdir/$ac_unique_file; then
476  if test "$ac_srcdir_defaulted" = yes; then
477    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
478  else
479    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
480  fi
481fi
482srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
483
484# Prefer explicitly selected file to automatically selected ones.
485if test -z "$CONFIG_SITE"; then
486  if test "x$prefix" != xNONE; then
487    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
488  else
489    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
490  fi
491fi
492for ac_site_file in $CONFIG_SITE; do
493  if test -r "$ac_site_file"; then
494    echo "loading site script $ac_site_file"
495    . "$ac_site_file"
496  fi
497done
498
499if test -r "$cache_file"; then
500  echo "loading cache $cache_file"
501  . $cache_file
502else
503  echo "creating cache $cache_file"
504  > $cache_file
505fi
506
507ac_ext=c
508# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
509ac_cpp='$CPP $CPPFLAGS'
510ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
511ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
512cross_compiling=$ac_cv_prog_cc_cross
513
514ac_exeext=
515ac_objext=o
516if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
517  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
518  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
519    ac_n= ac_c='
520' ac_t='	'
521  else
522    ac_n=-n ac_c= ac_t=
523  fi
524else
525  ac_n= ac_c='\c' ac_t=
526fi
527
528
529
530ac_aux_dir=
531for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
532  if test -f $ac_dir/install-sh; then
533    ac_aux_dir=$ac_dir
534    ac_install_sh="$ac_aux_dir/install-sh -c"
535    break
536  elif test -f $ac_dir/install.sh; then
537    ac_aux_dir=$ac_dir
538    ac_install_sh="$ac_aux_dir/install.sh -c"
539    break
540  fi
541done
542if test -z "$ac_aux_dir"; then
543  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
544fi
545ac_config_guess=$ac_aux_dir/config.guess
546ac_config_sub=$ac_aux_dir/config.sub
547ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
548
549
550# Do some error checking and defaulting for the host and target type.
551# The inputs are:
552#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
553#
554# The rules are:
555# 1. You are not allowed to specify --host, --target, and nonopt at the
556#    same time.
557# 2. Host defaults to nonopt.
558# 3. If nonopt is not specified, then host defaults to the current host,
559#    as determined by config.guess.
560# 4. Target and build default to nonopt.
561# 5. If nonopt is not specified, then target and build default to host.
562
563# The aliases save the names the user supplied, while $host etc.
564# will get canonicalized.
565case $host---$target---$nonopt in
566NONE---*---* | *---NONE---* | *---*---NONE) ;;
567*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
568esac
569
570
571# Make sure we can run config.sub.
572if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
573else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
574fi
575
576echo $ac_n "checking host system type""... $ac_c" 1>&6
577echo "configure:578: checking host system type" >&5
578
579host_alias=$host
580case "$host_alias" in
581NONE)
582  case $nonopt in
583  NONE)
584    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
585    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
586    fi ;;
587  *) host_alias=$nonopt ;;
588  esac ;;
589esac
590
591host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
592host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
593host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
594host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
595echo "$ac_t""$host" 1>&6
596
597echo $ac_n "checking target system type""... $ac_c" 1>&6
598echo "configure:599: checking target system type" >&5
599
600target_alias=$target
601case "$target_alias" in
602NONE)
603  case $nonopt in
604  NONE) target_alias=$host_alias ;;
605  *) target_alias=$nonopt ;;
606  esac ;;
607esac
608
609target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
610target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
611target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
612target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
613echo "$ac_t""$target" 1>&6
614
615echo $ac_n "checking build system type""... $ac_c" 1>&6
616echo "configure:617: checking build system type" >&5
617
618build_alias=$build
619case "$build_alias" in
620NONE)
621  case $nonopt in
622  NONE) build_alias=$host_alias ;;
623  *) build_alias=$nonopt ;;
624  esac ;;
625esac
626
627build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
628build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
629build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
630build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
631echo "$ac_t""$build" 1>&6
632
633test "$host_alias" != "$target_alias" &&
634  test "$program_prefix$program_suffix$program_transform_name" = \
635    NONENONEs,x,x, &&
636  program_prefix=${target_alias}-
637
638
639umask 002
640
641if test -z "$PWD" ; then
642	PWD=`pwd`
643fi
644
645
646
647
648
649    # Check whether --with-gcc or --without-gcc was given.
650if test "${with_gcc+set}" = set; then
651  withval="$with_gcc"
652  :
653fi
654
655    V_CCOPT="-O"
656    V_INCLS=""
657    if test "${srcdir}" != "." ; then
658	    V_INCLS="-I\$(srcdir)"
659    fi
660    if test "${CFLAGS+set}" = set; then
661	    LBL_CFLAGS="$CFLAGS"
662    fi
663    if test -z "$CC" ; then
664	    case "$target_os" in
665
666	    bsdi*)
667		    # Extract the first word of "shlicc2", so it can be a program name with args.
668set dummy shlicc2; ac_word=$2
669echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
670echo "configure:671: checking for $ac_word" >&5
671if eval "test \"`echo '$''{'ac_cv_prog_SHLICC2'+set}'`\" = set"; then
672  echo $ac_n "(cached) $ac_c" 1>&6
673else
674  if test -n "$SHLICC2"; then
675  ac_cv_prog_SHLICC2="$SHLICC2" # Let the user override the test.
676else
677  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
678  ac_dummy="$PATH"
679  for ac_dir in $ac_dummy; do
680    test -z "$ac_dir" && ac_dir=.
681    if test -f $ac_dir/$ac_word; then
682      ac_cv_prog_SHLICC2="yes"
683      break
684    fi
685  done
686  IFS="$ac_save_ifs"
687  test -z "$ac_cv_prog_SHLICC2" && ac_cv_prog_SHLICC2="no"
688fi
689fi
690SHLICC2="$ac_cv_prog_SHLICC2"
691if test -n "$SHLICC2"; then
692  echo "$ac_t""$SHLICC2" 1>&6
693else
694  echo "$ac_t""no" 1>&6
695fi
696
697		    if test $SHLICC2 = yes ; then
698			    CC=shlicc2
699			    export CC
700		    fi
701		    ;;
702	    esac
703    fi
704    if test -z "$CC" -a "$with_gcc" = no ; then
705	    CC=cc
706	    export CC
707    fi
708    # Extract the first word of "gcc", so it can be a program name with args.
709set dummy gcc; ac_word=$2
710echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
711echo "configure:712: checking for $ac_word" >&5
712if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
713  echo $ac_n "(cached) $ac_c" 1>&6
714else
715  if test -n "$CC"; then
716  ac_cv_prog_CC="$CC" # Let the user override the test.
717else
718  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
719  ac_dummy="$PATH"
720  for ac_dir in $ac_dummy; do
721    test -z "$ac_dir" && ac_dir=.
722    if test -f $ac_dir/$ac_word; then
723      ac_cv_prog_CC="gcc"
724      break
725    fi
726  done
727  IFS="$ac_save_ifs"
728fi
729fi
730CC="$ac_cv_prog_CC"
731if test -n "$CC"; then
732  echo "$ac_t""$CC" 1>&6
733else
734  echo "$ac_t""no" 1>&6
735fi
736
737if test -z "$CC"; then
738  # Extract the first word of "cc", so it can be a program name with args.
739set dummy cc; ac_word=$2
740echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
741echo "configure:742: checking for $ac_word" >&5
742if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
743  echo $ac_n "(cached) $ac_c" 1>&6
744else
745  if test -n "$CC"; then
746  ac_cv_prog_CC="$CC" # Let the user override the test.
747else
748  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
749  ac_prog_rejected=no
750  ac_dummy="$PATH"
751  for ac_dir in $ac_dummy; do
752    test -z "$ac_dir" && ac_dir=.
753    if test -f $ac_dir/$ac_word; then
754      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
755        ac_prog_rejected=yes
756	continue
757      fi
758      ac_cv_prog_CC="cc"
759      break
760    fi
761  done
762  IFS="$ac_save_ifs"
763if test $ac_prog_rejected = yes; then
764  # We found a bogon in the path, so make sure we never use it.
765  set dummy $ac_cv_prog_CC
766  shift
767  if test $# -gt 0; then
768    # We chose a different compiler from the bogus one.
769    # However, it has the same basename, so the bogon will be chosen
770    # first if we set CC to just the basename; use the full file name.
771    shift
772    set dummy "$ac_dir/$ac_word" "$@"
773    shift
774    ac_cv_prog_CC="$@"
775  fi
776fi
777fi
778fi
779CC="$ac_cv_prog_CC"
780if test -n "$CC"; then
781  echo "$ac_t""$CC" 1>&6
782else
783  echo "$ac_t""no" 1>&6
784fi
785
786  if test -z "$CC"; then
787    case "`uname -s`" in
788    *win32* | *WIN32*)
789      # Extract the first word of "cl", so it can be a program name with args.
790set dummy cl; ac_word=$2
791echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
792echo "configure:793: checking for $ac_word" >&5
793if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
794  echo $ac_n "(cached) $ac_c" 1>&6
795else
796  if test -n "$CC"; then
797  ac_cv_prog_CC="$CC" # Let the user override the test.
798else
799  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
800  ac_dummy="$PATH"
801  for ac_dir in $ac_dummy; do
802    test -z "$ac_dir" && ac_dir=.
803    if test -f $ac_dir/$ac_word; then
804      ac_cv_prog_CC="cl"
805      break
806    fi
807  done
808  IFS="$ac_save_ifs"
809fi
810fi
811CC="$ac_cv_prog_CC"
812if test -n "$CC"; then
813  echo "$ac_t""$CC" 1>&6
814else
815  echo "$ac_t""no" 1>&6
816fi
817 ;;
818    esac
819  fi
820  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
821fi
822
823echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
824echo "configure:825: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
825
826ac_ext=c
827# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
828ac_cpp='$CPP $CPPFLAGS'
829ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
830ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
831cross_compiling=$ac_cv_prog_cc_cross
832
833cat > conftest.$ac_ext << EOF
834
835#line 836 "configure"
836#include "confdefs.h"
837
838main(){return(0);}
839EOF
840if { (eval echo configure:841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
841  ac_cv_prog_cc_works=yes
842  # If we can't run a trivial program, we are probably using a cross compiler.
843  if (./conftest; exit) 2>/dev/null; then
844    ac_cv_prog_cc_cross=no
845  else
846    ac_cv_prog_cc_cross=yes
847  fi
848else
849  echo "configure: failed program was:" >&5
850  cat conftest.$ac_ext >&5
851  ac_cv_prog_cc_works=no
852fi
853rm -fr conftest*
854ac_ext=c
855# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
856ac_cpp='$CPP $CPPFLAGS'
857ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
858ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
859cross_compiling=$ac_cv_prog_cc_cross
860
861echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
862if test $ac_cv_prog_cc_works = no; then
863  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
864fi
865echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
866echo "configure:867: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
867echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
868cross_compiling=$ac_cv_prog_cc_cross
869
870echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
871echo "configure:872: checking whether we are using GNU C" >&5
872if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
873  echo $ac_n "(cached) $ac_c" 1>&6
874else
875  cat > conftest.c <<EOF
876#ifdef __GNUC__
877  yes;
878#endif
879EOF
880if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
881  ac_cv_prog_gcc=yes
882else
883  ac_cv_prog_gcc=no
884fi
885fi
886
887echo "$ac_t""$ac_cv_prog_gcc" 1>&6
888
889if test $ac_cv_prog_gcc = yes; then
890  GCC=yes
891else
892  GCC=
893fi
894
895ac_test_CFLAGS="${CFLAGS+set}"
896ac_save_CFLAGS="$CFLAGS"
897CFLAGS=
898echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
899echo "configure:900: checking whether ${CC-cc} accepts -g" >&5
900if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
901  echo $ac_n "(cached) $ac_c" 1>&6
902else
903  echo 'void f(){}' > conftest.c
904if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
905  ac_cv_prog_cc_g=yes
906else
907  ac_cv_prog_cc_g=no
908fi
909rm -f conftest*
910
911fi
912
913echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
914if test "$ac_test_CFLAGS" = set; then
915  CFLAGS="$ac_save_CFLAGS"
916elif test $ac_cv_prog_cc_g = yes; then
917  if test "$GCC" = yes; then
918    CFLAGS="-g -O2"
919  else
920    CFLAGS="-g"
921  fi
922else
923  if test "$GCC" = yes; then
924    CFLAGS="-O2"
925  else
926    CFLAGS=
927  fi
928fi
929
930    if test "$GCC" = yes ; then
931	    if test "$SHLICC2" = yes ; then
932		    ac_cv_lbl_gcc_vers=2
933		    V_CCOPT="-O2"
934	    else
935		    echo $ac_n "checking gcc version""... $ac_c" 1>&6
936echo "configure:937: checking gcc version" >&5
937		    if eval "test \"`echo '$''{'ac_cv_lbl_gcc_vers'+set}'`\" = set"; then
938  echo $ac_n "(cached) $ac_c" 1>&6
939else
940  ac_cv_lbl_gcc_vers=`$CC -v 2>&1 | \
941			    sed -e '/^gcc version /!d' \
942				-e 's/^gcc version //' \
943				-e 's/ .*//' -e 's/^[^0-9]*//' \
944				-e 's/\..*//'`
945fi
946
947		    echo "$ac_t""$ac_cv_lbl_gcc_vers" 1>&6
948		    if test $ac_cv_lbl_gcc_vers -gt 1 ; then
949			    V_CCOPT="-O2"
950		    fi
951	    fi
952    else
953	    echo $ac_n "checking that $CC handles ansi prototypes""... $ac_c" 1>&6
954echo "configure:955: checking that $CC handles ansi prototypes" >&5
955	    if eval "test \"`echo '$''{'ac_cv_lbl_cc_ansi_prototypes'+set}'`\" = set"; then
956  echo $ac_n "(cached) $ac_c" 1>&6
957else
958  cat > conftest.$ac_ext <<EOF
959#line 960 "configure"
960#include "confdefs.h"
961#include <sys/types.h>
962int main() {
963int frob(int, char *)
964; return 0; }
965EOF
966if { (eval echo configure:967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
967  rm -rf conftest*
968  ac_cv_lbl_cc_ansi_prototypes=yes
969else
970  echo "configure: failed program was:" >&5
971  cat conftest.$ac_ext >&5
972  rm -rf conftest*
973  ac_cv_lbl_cc_ansi_prototypes=no
974fi
975rm -f conftest*
976fi
977
978	    echo "$ac_t""$ac_cv_lbl_cc_ansi_prototypes" 1>&6
979	    if test $ac_cv_lbl_cc_ansi_prototypes = no ; then
980		    case "$target_os" in
981
982		    hpux*)
983			    echo $ac_n "checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)""... $ac_c" 1>&6
984echo "configure:985: checking for HP-UX ansi compiler ($CC -Aa -D_HPUX_SOURCE)" >&5
985			    savedcflags="$CFLAGS"
986			    CFLAGS="-Aa -D_HPUX_SOURCE $CFLAGS"
987			    if eval "test \"`echo '$''{'ac_cv_lbl_cc_hpux_cc_aa'+set}'`\" = set"; then
988  echo $ac_n "(cached) $ac_c" 1>&6
989else
990  cat > conftest.$ac_ext <<EOF
991#line 992 "configure"
992#include "confdefs.h"
993#include <sys/types.h>
994int main() {
995int frob(int, char *)
996; return 0; }
997EOF
998if { (eval echo configure:999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
999  rm -rf conftest*
1000  ac_cv_lbl_cc_hpux_cc_aa=yes
1001else
1002  echo "configure: failed program was:" >&5
1003  cat conftest.$ac_ext >&5
1004  rm -rf conftest*
1005  ac_cv_lbl_cc_hpux_cc_aa=no
1006fi
1007rm -f conftest*
1008fi
1009
1010			    echo "$ac_t""$ac_cv_lbl_cc_hpux_cc_aa" 1>&6
1011			    if test $ac_cv_lbl_cc_hpux_cc_aa = no ; then
1012				    { echo "configure: error: see the INSTALL doc for more info" 1>&2; exit 1; }
1013			    fi
1014			    CFLAGS="$savedcflags"
1015			    V_CCOPT="-Aa $V_CCOPT"
1016			    cat >> confdefs.h <<\EOF
1017#define _HPUX_SOURCE 1
1018EOF
1019
1020			    ;;
1021
1022		    *)
1023			    { echo "configure: error: see the INSTALL doc for more info" 1>&2; exit 1; }
1024			    ;;
1025		    esac
1026	    fi
1027	    V_INCLS="$V_INCLS -I/usr/local/include"
1028	    LDFLAGS="$LDFLAGS -L/usr/local/lib"
1029
1030	    case "$target_os" in
1031
1032	    irix*)
1033		    V_CCOPT="$V_CCOPT -xansi -signed -g3"
1034		    ;;
1035
1036	    osf*)
1037		    V_CCOPT="$V_CCOPT -std1 -g3"
1038		    ;;
1039
1040	    ultrix*)
1041		    echo $ac_n "checking that Ultrix $CC hacks const in prototypes""... $ac_c" 1>&6
1042echo "configure:1043: checking that Ultrix $CC hacks const in prototypes" >&5
1043		    if eval "test \"`echo '$''{'ac_cv_lbl_cc_const_proto'+set}'`\" = set"; then
1044  echo $ac_n "(cached) $ac_c" 1>&6
1045else
1046  cat > conftest.$ac_ext <<EOF
1047#line 1048 "configure"
1048#include "confdefs.h"
1049#include <sys/types.h>
1050int main() {
1051struct a { int b; };
1052			    void c(const struct a *)
1053; return 0; }
1054EOF
1055if { (eval echo configure:1056: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1056  rm -rf conftest*
1057  ac_cv_lbl_cc_const_proto=yes
1058else
1059  echo "configure: failed program was:" >&5
1060  cat conftest.$ac_ext >&5
1061  rm -rf conftest*
1062  ac_cv_lbl_cc_const_proto=no
1063fi
1064rm -f conftest*
1065fi
1066
1067		    echo "$ac_t""$ac_cv_lbl_cc_const_proto" 1>&6
1068		    if test $ac_cv_lbl_cc_const_proto = no ; then
1069			    cat >> confdefs.h <<\EOF
1070#define const
1071EOF
1072
1073		    fi
1074		    ;;
1075	    esac
1076    fi
1077
1078echo $ac_n "checking for inline""... $ac_c" 1>&6
1079echo "configure:1080: checking for inline" >&5
1080if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
1081  echo $ac_n "(cached) $ac_c" 1>&6
1082else
1083  ac_cv_c_inline=no
1084for ac_kw in inline __inline__ __inline; do
1085  cat > conftest.$ac_ext <<EOF
1086#line 1087 "configure"
1087#include "confdefs.h"
1088
1089int main() {
1090} $ac_kw foo() {
1091; return 0; }
1092EOF
1093if { (eval echo configure:1094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1094  rm -rf conftest*
1095  ac_cv_c_inline=$ac_kw; break
1096else
1097  echo "configure: failed program was:" >&5
1098  cat conftest.$ac_ext >&5
1099fi
1100rm -f conftest*
1101done
1102
1103fi
1104
1105echo "$ac_t""$ac_cv_c_inline" 1>&6
1106case "$ac_cv_c_inline" in
1107  inline | yes) ;;
1108  no) cat >> confdefs.h <<\EOF
1109#define inline
1110EOF
1111 ;;
1112  *)  cat >> confdefs.h <<EOF
1113#define inline $ac_cv_c_inline
1114EOF
1115 ;;
1116esac
1117
1118
1119echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
1120echo "configure:1121: checking how to run the C preprocessor" >&5
1121# On Suns, sometimes $CPP names a directory.
1122if test -n "$CPP" && test -d "$CPP"; then
1123  CPP=
1124fi
1125if test -z "$CPP"; then
1126if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
1127  echo $ac_n "(cached) $ac_c" 1>&6
1128else
1129    # This must be in double quotes, not single quotes, because CPP may get
1130  # substituted into the Makefile and "${CC-cc}" will confuse make.
1131  CPP="${CC-cc} -E"
1132  # On the NeXT, cc -E runs the code through the compiler's parser,
1133  # not just through cpp.
1134  cat > conftest.$ac_ext <<EOF
1135#line 1136 "configure"
1136#include "confdefs.h"
1137#include <assert.h>
1138Syntax Error
1139EOF
1140ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1141{ (eval echo configure:1142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1142ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1143if test -z "$ac_err"; then
1144  :
1145else
1146  echo "$ac_err" >&5
1147  echo "configure: failed program was:" >&5
1148  cat conftest.$ac_ext >&5
1149  rm -rf conftest*
1150  CPP="${CC-cc} -E -traditional-cpp"
1151  cat > conftest.$ac_ext <<EOF
1152#line 1153 "configure"
1153#include "confdefs.h"
1154#include <assert.h>
1155Syntax Error
1156EOF
1157ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1158{ (eval echo configure:1159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1159ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1160if test -z "$ac_err"; then
1161  :
1162else
1163  echo "$ac_err" >&5
1164  echo "configure: failed program was:" >&5
1165  cat conftest.$ac_ext >&5
1166  rm -rf conftest*
1167  CPP="${CC-cc} -nologo -E"
1168  cat > conftest.$ac_ext <<EOF
1169#line 1170 "configure"
1170#include "confdefs.h"
1171#include <assert.h>
1172Syntax Error
1173EOF
1174ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1175{ (eval echo configure:1176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1176ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1177if test -z "$ac_err"; then
1178  :
1179else
1180  echo "$ac_err" >&5
1181  echo "configure: failed program was:" >&5
1182  cat conftest.$ac_ext >&5
1183  rm -rf conftest*
1184  CPP=/lib/cpp
1185fi
1186rm -f conftest*
1187fi
1188rm -f conftest*
1189fi
1190rm -f conftest*
1191  ac_cv_prog_CPP="$CPP"
1192fi
1193  CPP="$ac_cv_prog_CPP"
1194else
1195  ac_cv_prog_CPP="$CPP"
1196fi
1197echo "$ac_t""$CPP" 1>&6
1198
1199for ac_hdr in fcntl.h malloc.h memory.h rpc/rpcent.h
1200do
1201ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1202echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1203echo "configure:1204: checking for $ac_hdr" >&5
1204if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1205  echo $ac_n "(cached) $ac_c" 1>&6
1206else
1207  cat > conftest.$ac_ext <<EOF
1208#line 1209 "configure"
1209#include "confdefs.h"
1210#include <$ac_hdr>
1211EOF
1212ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1213{ (eval echo configure:1214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1214ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1215if test -z "$ac_err"; then
1216  rm -rf conftest*
1217  eval "ac_cv_header_$ac_safe=yes"
1218else
1219  echo "$ac_err" >&5
1220  echo "configure: failed program was:" >&5
1221  cat conftest.$ac_ext >&5
1222  rm -rf conftest*
1223  eval "ac_cv_header_$ac_safe=no"
1224fi
1225rm -f conftest*
1226fi
1227if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1228  echo "$ac_t""yes" 1>&6
1229    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1230  cat >> confdefs.h <<EOF
1231#define $ac_tr_hdr 1
1232EOF
1233
1234else
1235  echo "$ac_t""no" 1>&6
1236fi
1237done
1238
1239echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
1240echo "configure:1241: checking whether time.h and sys/time.h may both be included" >&5
1241if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
1242  echo $ac_n "(cached) $ac_c" 1>&6
1243else
1244  cat > conftest.$ac_ext <<EOF
1245#line 1246 "configure"
1246#include "confdefs.h"
1247#include <sys/types.h>
1248#include <sys/time.h>
1249#include <time.h>
1250int main() {
1251struct tm *tp;
1252; return 0; }
1253EOF
1254if { (eval echo configure:1255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
1255  rm -rf conftest*
1256  ac_cv_header_time=yes
1257else
1258  echo "configure: failed program was:" >&5
1259  cat conftest.$ac_ext >&5
1260  rm -rf conftest*
1261  ac_cv_header_time=no
1262fi
1263rm -f conftest*
1264fi
1265
1266echo "$ac_t""$ac_cv_header_time" 1>&6
1267if test $ac_cv_header_time = yes; then
1268  cat >> confdefs.h <<\EOF
1269#define TIME_WITH_SYS_TIME 1
1270EOF
1271
1272fi
1273
1274
1275case "$target_os" in
1276
1277linux*)
1278	echo $ac_n "checking Linux kernel version""... $ac_c" 1>&6
1279echo "configure:1280: checking Linux kernel version" >&5
1280	if eval "test \"`echo '$''{'ac_cv_linux_vers'+set}'`\" = set"; then
1281  echo $ac_n "(cached) $ac_c" 1>&6
1282else
1283  ac_cv_linux_vers=`uname -r 2>&1 | \
1284		sed -n -e '$s/.* //' -e '$s/\..*//p'`
1285fi
1286
1287	echo "$ac_t""$ac_cv_linux_vers" 1>&6
1288	if test $ac_cv_linux_vers -lt 2 ; then
1289		{ echo "configure: error: version 2 or higher required; see the INSTALL doc for more info" 1>&2; exit 1; }
1290	fi
1291	cat >> confdefs.h <<\EOF
1292#define HAVE_NET_SLIP_H 1
1293EOF
1294
1295	;;
1296
1297*)
1298	for ac_hdr in net/slip.h
1299do
1300ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1301echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1302echo "configure:1303: checking for $ac_hdr" >&5
1303if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1304  echo $ac_n "(cached) $ac_c" 1>&6
1305else
1306  cat > conftest.$ac_ext <<EOF
1307#line 1308 "configure"
1308#include "confdefs.h"
1309#include <$ac_hdr>
1310EOF
1311ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1312{ (eval echo configure:1313: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1313ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1314if test -z "$ac_err"; then
1315  rm -rf conftest*
1316  eval "ac_cv_header_$ac_safe=yes"
1317else
1318  echo "$ac_err" >&5
1319  echo "configure: failed program was:" >&5
1320  cat conftest.$ac_ext >&5
1321  rm -rf conftest*
1322  eval "ac_cv_header_$ac_safe=no"
1323fi
1324rm -f conftest*
1325fi
1326if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1327  echo "$ac_t""yes" 1>&6
1328    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1329  cat >> confdefs.h <<EOF
1330#define $ac_tr_hdr 1
1331EOF
1332
1333else
1334  echo "$ac_t""no" 1>&6
1335fi
1336done
1337
1338	;;
1339esac
1340
1341
1342for ac_hdr in smi.h
1343do
1344ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
1345echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
1346echo "configure:1347: checking for $ac_hdr" >&5
1347if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
1348  echo $ac_n "(cached) $ac_c" 1>&6
1349else
1350  cat > conftest.$ac_ext <<EOF
1351#line 1352 "configure"
1352#include "confdefs.h"
1353#include <$ac_hdr>
1354EOF
1355ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
1356{ (eval echo configure:1357: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
1357ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
1358if test -z "$ac_err"; then
1359  rm -rf conftest*
1360  eval "ac_cv_header_$ac_safe=yes"
1361else
1362  echo "$ac_err" >&5
1363  echo "configure: failed program was:" >&5
1364  cat conftest.$ac_ext >&5
1365  rm -rf conftest*
1366  eval "ac_cv_header_$ac_safe=no"
1367fi
1368rm -f conftest*
1369fi
1370if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
1371  echo "$ac_t""yes" 1>&6
1372    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
1373  cat >> confdefs.h <<EOF
1374#define $ac_tr_hdr 1
1375EOF
1376
1377else
1378  echo "$ac_t""no" 1>&6
1379fi
1380done
1381
1382echo $ac_n "checking for main in -lsmi""... $ac_c" 1>&6
1383echo "configure:1384: checking for main in -lsmi" >&5
1384ac_lib_var=`echo smi'_'main | sed 'y%./+-%__p_%'`
1385if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
1386  echo $ac_n "(cached) $ac_c" 1>&6
1387else
1388  ac_save_LIBS="$LIBS"
1389LIBS="-lsmi  $LIBS"
1390cat > conftest.$ac_ext <<EOF
1391#line 1392 "configure"
1392#include "confdefs.h"
1393
1394int main() {
1395main()
1396; return 0; }
1397EOF
1398if { (eval echo configure:1399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1399  rm -rf conftest*
1400  eval "ac_cv_lib_$ac_lib_var=yes"
1401else
1402  echo "configure: failed program was:" >&5
1403  cat conftest.$ac_ext >&5
1404  rm -rf conftest*
1405  eval "ac_cv_lib_$ac_lib_var=no"
1406fi
1407rm -f conftest*
1408LIBS="$ac_save_LIBS"
1409
1410fi
1411if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
1412  echo "$ac_t""yes" 1>&6
1413    ac_tr_lib=HAVE_LIB`echo smi | sed -e 's/[^a-zA-Z0-9_]/_/g' \
1414    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
1415  cat >> confdefs.h <<EOF
1416#define $ac_tr_lib 1
1417EOF
1418
1419  LIBS="-lsmi $LIBS"
1420
1421else
1422  echo "$ac_t""no" 1>&6
1423fi
1424
1425echo $ac_n "checking whether to enable libsmi""... $ac_c" 1>&6
1426echo "configure:1427: checking whether to enable libsmi" >&5
1427        if test "$cross_compiling" = yes; then
1428    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
1429else
1430  cat > conftest.$ac_ext <<EOF
1431#line 1432 "configure"
1432#include "confdefs.h"
1433 /* libsmi available check */
1434#include <smi.h>
1435main()
1436{
1437  if (smiInit("")) 
1438    exit(1);
1439  else
1440    exit(0);
1441}
1442
1443EOF
1444if { (eval echo configure:1445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1445then
1446   echo "$ac_t""yes" 1>&6
1447  cat >> confdefs.h <<\EOF
1448#define LIBSMI 1
1449EOF
1450
1451  libsmi=yes
1452else
1453  echo "configure: failed program was:" >&5
1454  cat conftest.$ac_ext >&5
1455  rm -fr conftest*
1456   echo "$ac_t""no" 1>&6
1457  libsmi=no
1458
1459fi
1460rm -fr conftest*
1461fi
1462
1463
1464
1465CFLAGS="$CFLAGS -Dss_family=__ss_family -Dss_len=__ss_len"
1466echo $ac_n "checking whether to enable ipv6""... $ac_c" 1>&6
1467echo "configure:1468: checking whether to enable ipv6" >&5
1468# Check whether --enable-ipv6 or --disable-ipv6 was given.
1469if test "${enable_ipv6+set}" = set; then
1470  enableval="$enable_ipv6"
1471   case "$enableval" in
1472yes)   echo "$ac_t""yes" 1>&6
1473       cat >> confdefs.h <<\EOF
1474#define ENABLE_IPV6 1
1475EOF
1476
1477       LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
1478       cat >> confdefs.h <<\EOF
1479#define INET6 1
1480EOF
1481
1482       ipv6=yes
1483       ;;
1484*)
1485       echo "$ac_t""no" 1>&6
1486       ipv6=no
1487       ;;
1488  esac
1489else
1490  if test "$cross_compiling" = yes; then
1491   echo "$ac_t""no" 1>&6
1492  ipv6=no
1493
1494else
1495  cat > conftest.$ac_ext <<EOF
1496#line 1497 "configure"
1497#include "confdefs.h"
1498 /* AF_INET6 available check */
1499#include <sys/types.h>
1500#include <sys/socket.h>
1501main()
1502{
1503 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
1504   exit(1);
1505 else
1506   exit(0);
1507}
1508
1509EOF
1510if { (eval echo configure:1511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1511then
1512   echo "$ac_t""yes" 1>&6
1513  cat >> confdefs.h <<\EOF
1514#define ENABLE_IPV6 1
1515EOF
1516
1517  LOCALSRC="print-ip6.c print-ip6opts.c print-ripng.c print-icmp6.c print-frag6.c print-rt6.c print-ospf6.c print-dhcp6.c $LOCALSRC"
1518  cat >> confdefs.h <<\EOF
1519#define INET6 1
1520EOF
1521
1522  ipv6=yes
1523else
1524  echo "configure: failed program was:" >&5
1525  cat conftest.$ac_ext >&5
1526  rm -fr conftest*
1527   echo "$ac_t""no" 1>&6
1528  ipv6=no
1529fi
1530rm -fr conftest*
1531fi
1532
1533fi
1534
1535
1536ipv6type=unknown
1537ipv6lib=none
1538ipv6trylibc=no
1539
1540if test "$ipv6" = "yes"; then
1541	echo $ac_n "checking ipv6 stack type""... $ac_c" 1>&6
1542echo "configure:1543: checking ipv6 stack type" >&5
1543	for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
1544		case $i in
1545		inria)
1546						cat > conftest.$ac_ext <<EOF
1547#line 1548 "configure"
1548#include "confdefs.h"
1549dnl
1550#include <netinet/in.h>
1551#ifdef IPV6_INRIA_VERSION
1552yes
1553#endif
1554EOF
1555if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1556  egrep "yes" >/dev/null 2>&1; then
1557  rm -rf conftest*
1558  ipv6type=$i;
1559				CFLAGS="-DINET6 $CFLAGS"
1560fi
1561rm -f conftest*
1562
1563			;;
1564		kame)
1565						cat > conftest.$ac_ext <<EOF
1566#line 1567 "configure"
1567#include "confdefs.h"
1568dnl
1569#include <netinet/in.h>
1570#ifdef __KAME__
1571yes
1572#endif
1573EOF
1574if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1575  egrep "yes" >/dev/null 2>&1; then
1576  rm -rf conftest*
1577  ipv6type=$i;
1578				ipv6lib=inet6;
1579				ipv6libdir=/usr/local/v6/lib;
1580				ipv6trylibc=yes;
1581				CFLAGS="-DINET6 $CFLAGS"
1582fi
1583rm -f conftest*
1584
1585			;;
1586		linux-glibc)
1587						cat > conftest.$ac_ext <<EOF
1588#line 1589 "configure"
1589#include "confdefs.h"
1590dnl
1591#include <features.h>
1592#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
1593yes
1594#endif
1595EOF
1596if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1597  egrep "yes" >/dev/null 2>&1; then
1598  rm -rf conftest*
1599  ipv6type=$i;
1600				CFLAGS="-DINET6 $CFLAGS"
1601fi
1602rm -f conftest*
1603
1604			;;
1605		linux-libinet6)
1606						if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
1607				ipv6type=$i
1608				ipv6lib=inet6
1609				ipv6libdir=/usr/inet6/lib
1610				ipv6trylibc=yes;
1611				CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
1612			fi
1613			;;
1614		toshiba)
1615			cat > conftest.$ac_ext <<EOF
1616#line 1617 "configure"
1617#include "confdefs.h"
1618dnl
1619#include <sys/param.h>
1620#ifdef _TOSHIBA_INET6
1621yes
1622#endif
1623EOF
1624if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1625  egrep "yes" >/dev/null 2>&1; then
1626  rm -rf conftest*
1627  ipv6type=$i;
1628				ipv6lib=inet6;
1629				ipv6libdir=/usr/local/v6/lib;
1630				CFLAGS="-DINET6 $CFLAGS"
1631fi
1632rm -f conftest*
1633
1634			;;
1635		v6d)
1636			cat > conftest.$ac_ext <<EOF
1637#line 1638 "configure"
1638#include "confdefs.h"
1639dnl
1640#include </usr/local/v6/include/sys/v6config.h>
1641#ifdef __V6D__
1642yes
1643#endif
1644EOF
1645if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1646  egrep "yes" >/dev/null 2>&1; then
1647  rm -rf conftest*
1648  ipv6type=$i;
1649				ipv6lib=v6;
1650				ipv6libdir=/usr/local/v6/lib;
1651				CFLAGS="-I/usr/local/v6/include $CFLAGS"
1652fi
1653rm -f conftest*
1654
1655			;;
1656		zeta)
1657			cat > conftest.$ac_ext <<EOF
1658#line 1659 "configure"
1659#include "confdefs.h"
1660dnl
1661#include <sys/param.h>
1662#ifdef _ZETA_MINAMI_INET6
1663yes
1664#endif
1665EOF
1666if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
1667  egrep "yes" >/dev/null 2>&1; then
1668  rm -rf conftest*
1669  ipv6type=$i;
1670				ipv6lib=inet6;
1671				ipv6libdir=/usr/local/v6/lib;
1672				CFLAGS="-DINET6 $CFLAGS"
1673fi
1674rm -f conftest*
1675
1676			;;
1677		esac
1678		if test "$ipv6type" != "unknown"; then
1679			break
1680		fi
1681	done
1682	echo "$ac_t""$ipv6type" 1>&6
1683fi
1684
1685if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
1686	if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
1687		LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
1688		echo "You have $ipv6lib library, using it"
1689	else
1690		if test "$ipv6trylibc" = "yes"; then
1691			echo "You do not have $ipv6lib library, using libc"
1692		else
1693			echo 'Fatal: no $ipv6lib library found.  cannot continue.'
1694			echo "You need to fetch lib$ipv6lib.a from appropriate"
1695			echo 'ipv6 kit and compile beforehand.'
1696			exit 1
1697		fi
1698	fi
1699fi
1700
1701
1702if test "$ipv6" = "yes"; then
1703	for ac_func in getaddrinfo
1704do
1705echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1706echo "configure:1707: checking for $ac_func" >&5
1707if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1708  echo $ac_n "(cached) $ac_c" 1>&6
1709else
1710  cat > conftest.$ac_ext <<EOF
1711#line 1712 "configure"
1712#include "confdefs.h"
1713/* System header to define __stub macros and hopefully few prototypes,
1714    which can conflict with char $ac_func(); below.  */
1715#include <assert.h>
1716/* Override any gcc2 internal prototype to avoid an error.  */
1717/* We use char because int might match the return type of a gcc2
1718    builtin and then its argument prototype would still apply.  */
1719char $ac_func();
1720
1721int main() {
1722
1723/* The GNU C library defines this for functions which it implements
1724    to always fail with ENOSYS.  Some functions are actually named
1725    something starting with __ and the normal name is an alias.  */
1726#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1727choke me
1728#else
1729$ac_func();
1730#endif
1731
1732; return 0; }
1733EOF
1734if { (eval echo configure:1735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1735  rm -rf conftest*
1736  eval "ac_cv_func_$ac_func=yes"
1737else
1738  echo "configure: failed program was:" >&5
1739  cat conftest.$ac_ext >&5
1740  rm -rf conftest*
1741  eval "ac_cv_func_$ac_func=no"
1742fi
1743rm -f conftest*
1744fi
1745
1746if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1747  echo "$ac_t""yes" 1>&6
1748    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1749  cat >> confdefs.h <<EOF
1750#define $ac_tr_func 1
1751EOF
1752 	echo $ac_n "checking getaddrinfo bug""... $ac_c" 1>&6
1753echo "configure:1754: checking getaddrinfo bug" >&5
1754	if test "$cross_compiling" = yes; then
1755  echo "$ac_t""buggy" 1>&6
1756	buggygetaddrinfo=yes
1757else
1758  cat > conftest.$ac_ext <<EOF
1759#line 1760 "configure"
1760#include "confdefs.h"
1761
1762#include <sys/types.h>
1763#include <netdb.h>
1764#include <string.h>
1765#include <sys/socket.h>
1766#include <netinet/in.h>
1767
1768main()
1769{
1770  int passive, gaierr, inet4 = 0, inet6 = 0;
1771  struct addrinfo hints, *ai, *aitop;
1772  char straddr[INET6_ADDRSTRLEN], strport[16];
1773
1774  for (passive = 0; passive <= 1; passive++) {
1775    memset(&hints, 0, sizeof(hints));
1776    hints.ai_family = AF_UNSPEC;
1777    hints.ai_flags = passive ? AI_PASSIVE : 0;
1778    hints.ai_socktype = SOCK_STREAM;
1779    if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
1780      (void)gai_strerror(gaierr);
1781      goto bad;
1782    }
1783    for (ai = aitop; ai; ai = ai->ai_next) {
1784      if (ai->ai_addr == NULL ||
1785          ai->ai_addrlen == 0 ||
1786          getnameinfo(ai->ai_addr, ai->ai_addrlen,
1787                      straddr, sizeof(straddr), strport, sizeof(strport),
1788                      NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
1789        goto bad;
1790      }
1791      switch (ai->ai_family) {
1792      case AF_INET:
1793        if (strcmp(strport, "54321") != 0) {
1794          goto bad;
1795        }
1796        if (passive) {
1797          if (strcmp(straddr, "0.0.0.0") != 0) {
1798            goto bad;
1799          }
1800        } else {
1801          if (strcmp(straddr, "127.0.0.1") != 0) {
1802            goto bad;
1803          }
1804        }
1805        inet4++;
1806        break;
1807      case AF_INET6:
1808        if (strcmp(strport, "54321") != 0) {
1809          goto bad;
1810        }
1811        if (passive) {
1812          if (strcmp(straddr, "::") != 0) {
1813            goto bad;
1814          }
1815        } else {
1816          if (strcmp(straddr, "::1") != 0) {
1817            goto bad;
1818          }
1819        }
1820        inet6++;
1821        break;
1822      case AF_UNSPEC:
1823        goto bad;
1824        break;
1825#ifdef AF_UNIX
1826      case AF_UNIX:
1827#else
1828#ifdef AF_LOCAL
1829      case AF_LOCAL:
1830#endif
1831#endif
1832      default:
1833        /* another family support? */
1834        break;
1835      }
1836    }
1837  }
1838
1839  /* supported family should be 2, unsupported family should be 0 */
1840  if (!(inet4 == 0 || inet4 == 2))
1841    goto bad;
1842  if (!(inet6 == 0 || inet6 == 2))
1843    goto bad;
1844
1845  if (aitop)
1846    freeaddrinfo(aitop);
1847  exit(0);
1848
1849 bad:
1850  if (aitop)
1851    freeaddrinfo(aitop);
1852  exit(1);
1853}
1854
1855EOF
1856if { (eval echo configure:1857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
1857then
1858  echo "$ac_t""good" 1>&6
1859	buggygetaddrinfo=no
1860else
1861  echo "configure: failed program was:" >&5
1862  cat conftest.$ac_ext >&5
1863  rm -fr conftest*
1864  echo "$ac_t""buggy" 1>&6
1865	buggygetaddrinfo=yes
1866fi
1867rm -fr conftest*
1868fi
1869
1870else
1871  echo "$ac_t""no" 1>&6
1872buggygetaddrinfo=yes
1873fi
1874done
1875
1876
1877	if test "$buggygetaddrinfo" = "yes"; then
1878		if test "$ipv6type" != "linux"; then
1879			echo 'Fatal: You must get working getaddrinfo() function.'
1880			echo '       or you can specify "--disable-ipv6"'.
1881			exit 1
1882		else
1883			echo 'Warning: getaddrinfo() implementation on your system seems be buggy.'
1884			echo '         Better upgreade your system library to newest version'
1885			echo '         of GNU C library (aka glibc).'
1886		fi
1887	fi
1888	for ac_func in getaddrinfo getnameinfo
1889do
1890echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1891echo "configure:1892: checking for $ac_func" >&5
1892if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1893  echo $ac_n "(cached) $ac_c" 1>&6
1894else
1895  cat > conftest.$ac_ext <<EOF
1896#line 1897 "configure"
1897#include "confdefs.h"
1898/* System header to define __stub macros and hopefully few prototypes,
1899    which can conflict with char $ac_func(); below.  */
1900#include <assert.h>
1901/* Override any gcc2 internal prototype to avoid an error.  */
1902/* We use char because int might match the return type of a gcc2
1903    builtin and then its argument prototype would still apply.  */
1904char $ac_func();
1905
1906int main() {
1907
1908/* The GNU C library defines this for functions which it implements
1909    to always fail with ENOSYS.  Some functions are actually named
1910    something starting with __ and the normal name is an alias.  */
1911#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1912choke me
1913#else
1914$ac_func();
1915#endif
1916
1917; return 0; }
1918EOF
1919if { (eval echo configure:1920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1920  rm -rf conftest*
1921  eval "ac_cv_func_$ac_func=yes"
1922else
1923  echo "configure: failed program was:" >&5
1924  cat conftest.$ac_ext >&5
1925  rm -rf conftest*
1926  eval "ac_cv_func_$ac_func=no"
1927fi
1928rm -f conftest*
1929fi
1930
1931if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1932  echo "$ac_t""yes" 1>&6
1933    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1934  cat >> confdefs.h <<EOF
1935#define $ac_tr_func 1
1936EOF
1937
1938else
1939  echo "$ac_t""no" 1>&6
1940LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
1941fi
1942done
1943
1944
1945fi
1946for ac_func in inet_ntop inet_pton inet_aton
1947do
1948echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
1949echo "configure:1950: checking for $ac_func" >&5
1950if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
1951  echo $ac_n "(cached) $ac_c" 1>&6
1952else
1953  cat > conftest.$ac_ext <<EOF
1954#line 1955 "configure"
1955#include "confdefs.h"
1956/* System header to define __stub macros and hopefully few prototypes,
1957    which can conflict with char $ac_func(); below.  */
1958#include <assert.h>
1959/* Override any gcc2 internal prototype to avoid an error.  */
1960/* We use char because int might match the return type of a gcc2
1961    builtin and then its argument prototype would still apply.  */
1962char $ac_func();
1963
1964int main() {
1965
1966/* The GNU C library defines this for functions which it implements
1967    to always fail with ENOSYS.  Some functions are actually named
1968    something starting with __ and the normal name is an alias.  */
1969#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
1970choke me
1971#else
1972$ac_func();
1973#endif
1974
1975; return 0; }
1976EOF
1977if { (eval echo configure:1978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1978  rm -rf conftest*
1979  eval "ac_cv_func_$ac_func=yes"
1980else
1981  echo "configure: failed program was:" >&5
1982  cat conftest.$ac_ext >&5
1983  rm -rf conftest*
1984  eval "ac_cv_func_$ac_func=no"
1985fi
1986rm -f conftest*
1987fi
1988
1989if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
1990  echo "$ac_t""yes" 1>&6
1991    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
1992  cat >> confdefs.h <<EOF
1993#define $ac_tr_func 1
1994EOF
1995
1996else
1997  echo "$ac_t""no" 1>&6
1998LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
1999fi
2000done
2001
2002
2003
2004
2005	echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6
2006echo "configure:2007: checking if sockaddr struct has sa_len member" >&5
2007	if eval "test \"`echo '$''{'ac_cv_sockaddr_has_sa_len'+set}'`\" = set"; then
2008  echo $ac_n "(cached) $ac_c" 1>&6
2009else
2010  cat > conftest.$ac_ext <<EOF
2011#line 2012 "configure"
2012#include "confdefs.h"
2013
2014#		include <sys/types.h>
2015#		include <sys/socket.h>
2016int main() {
2017u_int i = sizeof(((struct sockaddr *)0)->sa_len)
2018; return 0; }
2019EOF
2020if { (eval echo configure:2021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2021  rm -rf conftest*
2022  ac_cv_sockaddr_has_sa_len=yes
2023else
2024  echo "configure: failed program was:" >&5
2025  cat conftest.$ac_ext >&5
2026  rm -rf conftest*
2027  ac_cv_sockaddr_has_sa_len=no
2028fi
2029rm -f conftest*
2030fi
2031
2032	echo "$ac_t""$ac_cv_sockaddr_has_sa_len" 1>&6
2033		if test $ac_cv_sockaddr_has_sa_len = yes ; then
2034			cat >> confdefs.h <<\EOF
2035#define HAVE_SOCKADDR_SA_LEN 1
2036EOF
2037
2038	fi
2039
2040if test "$ac_cv_sockaddr_has_sa_len" = no; then
2041	missing_includes=yes
2042fi
2043
2044
2045	echo $ac_n "checking for __P""... $ac_c" 1>&6
2046echo "configure:2047: checking for __P" >&5
2047	if eval "test \"`echo '$''{'ac_cv_portable_proto'+set}'`\" = set"; then
2048  echo $ac_n "(cached) $ac_c" 1>&6
2049else
2050  cat > conftest.$ac_ext <<EOF
2051#line 2052 "configure"
2052#include "confdefs.h"
2053
2054#		include <unistd.h>
2055int main() {
2056int f __P(())
2057; return 0; }
2058EOF
2059if { (eval echo configure:2060: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2060  rm -rf conftest*
2061  ac_cv_portable_proto=yes
2062else
2063  echo "configure: failed program was:" >&5
2064  cat conftest.$ac_ext >&5
2065  rm -rf conftest*
2066  ac_cv_portable_proto=no
2067fi
2068rm -f conftest*
2069fi
2070
2071	echo "$ac_t""$ac_cv_portable_proto" 1>&6
2072	if test $ac_cv_portable_proto = yes; then
2073		cat >> confdefs.h <<\EOF
2074#define HAVE_PORTABLE_PROTOTYPE 1
2075EOF
2076
2077	fi
2078
2079if test "$ac_cv_portable_proto" = no; then
2080	missing_includes=yes
2081fi
2082
2083echo $ac_n "checking size of char""... $ac_c" 1>&6
2084echo "configure:2085: checking size of char" >&5
2085if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
2086  echo $ac_n "(cached) $ac_c" 1>&6
2087else
2088  if test "$cross_compiling" = yes; then
2089  ac_cv_sizeof_char=1
2090else
2091  cat > conftest.$ac_ext <<EOF
2092#line 2093 "configure"
2093#include "confdefs.h"
2094#include <stdio.h>
2095main()
2096{
2097  FILE *f=fopen("conftestval", "w");
2098  if (!f) exit(1);
2099  fprintf(f, "%d\n", sizeof(char));
2100  exit(0);
2101}
2102EOF
2103if { (eval echo configure:2104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2104then
2105  ac_cv_sizeof_char=`cat conftestval`
2106else
2107  echo "configure: failed program was:" >&5
2108  cat conftest.$ac_ext >&5
2109  rm -fr conftest*
2110  ac_cv_sizeof_char=0
2111fi
2112rm -fr conftest*
2113fi
2114
2115fi
2116echo "$ac_t""$ac_cv_sizeof_char" 1>&6
2117cat >> confdefs.h <<EOF
2118#define SIZEOF_CHAR $ac_cv_sizeof_char
2119EOF
2120
2121
2122echo $ac_n "checking size of short""... $ac_c" 1>&6
2123echo "configure:2124: checking size of short" >&5
2124if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
2125  echo $ac_n "(cached) $ac_c" 1>&6
2126else
2127  if test "$cross_compiling" = yes; then
2128  ac_cv_sizeof_short=2
2129else
2130  cat > conftest.$ac_ext <<EOF
2131#line 2132 "configure"
2132#include "confdefs.h"
2133#include <stdio.h>
2134main()
2135{
2136  FILE *f=fopen("conftestval", "w");
2137  if (!f) exit(1);
2138  fprintf(f, "%d\n", sizeof(short));
2139  exit(0);
2140}
2141EOF
2142if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2143then
2144  ac_cv_sizeof_short=`cat conftestval`
2145else
2146  echo "configure: failed program was:" >&5
2147  cat conftest.$ac_ext >&5
2148  rm -fr conftest*
2149  ac_cv_sizeof_short=0
2150fi
2151rm -fr conftest*
2152fi
2153
2154fi
2155echo "$ac_t""$ac_cv_sizeof_short" 1>&6
2156cat >> confdefs.h <<EOF
2157#define SIZEOF_SHORT $ac_cv_sizeof_short
2158EOF
2159
2160
2161echo $ac_n "checking size of int""... $ac_c" 1>&6
2162echo "configure:2163: checking size of int" >&5
2163if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
2164  echo $ac_n "(cached) $ac_c" 1>&6
2165else
2166  if test "$cross_compiling" = yes; then
2167  ac_cv_sizeof_int=4
2168else
2169  cat > conftest.$ac_ext <<EOF
2170#line 2171 "configure"
2171#include "confdefs.h"
2172#include <stdio.h>
2173main()
2174{
2175  FILE *f=fopen("conftestval", "w");
2176  if (!f) exit(1);
2177  fprintf(f, "%d\n", sizeof(int));
2178  exit(0);
2179}
2180EOF
2181if { (eval echo configure:2182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2182then
2183  ac_cv_sizeof_int=`cat conftestval`
2184else
2185  echo "configure: failed program was:" >&5
2186  cat conftest.$ac_ext >&5
2187  rm -fr conftest*
2188  ac_cv_sizeof_int=0
2189fi
2190rm -fr conftest*
2191fi
2192
2193fi
2194echo "$ac_t""$ac_cv_sizeof_int" 1>&6
2195cat >> confdefs.h <<EOF
2196#define SIZEOF_INT $ac_cv_sizeof_int
2197EOF
2198
2199
2200echo $ac_n "checking size of long""... $ac_c" 1>&6
2201echo "configure:2202: checking size of long" >&5
2202if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
2203  echo $ac_n "(cached) $ac_c" 1>&6
2204else
2205  if test "$cross_compiling" = yes; then
2206  ac_cv_sizeof_long=4
2207else
2208  cat > conftest.$ac_ext <<EOF
2209#line 2210 "configure"
2210#include "confdefs.h"
2211#include <stdio.h>
2212main()
2213{
2214  FILE *f=fopen("conftestval", "w");
2215  if (!f) exit(1);
2216  fprintf(f, "%d\n", sizeof(long));
2217  exit(0);
2218}
2219EOF
2220if { (eval echo configure:2221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2221then
2222  ac_cv_sizeof_long=`cat conftestval`
2223else
2224  echo "configure: failed program was:" >&5
2225  cat conftest.$ac_ext >&5
2226  rm -fr conftest*
2227  ac_cv_sizeof_long=0
2228fi
2229rm -fr conftest*
2230fi
2231
2232fi
2233echo "$ac_t""$ac_cv_sizeof_long" 1>&6
2234cat >> confdefs.h <<EOF
2235#define SIZEOF_LONG $ac_cv_sizeof_long
2236EOF
2237
2238
2239
2240
2241
2242	echo $ac_n "checking for addrinfo""... $ac_c" 1>&6
2243echo "configure:2244: checking for addrinfo" >&5
2244	if eval "test \"`echo '$''{'ac_cv_addrinfo'+set}'`\" = set"; then
2245  echo $ac_n "(cached) $ac_c" 1>&6
2246else
2247  cat > conftest.$ac_ext <<EOF
2248#line 2249 "configure"
2249#include "confdefs.h"
2250
2251#		include <netdb.h>
2252int main() {
2253struct addrinfo a
2254; return 0; }
2255EOF
2256if { (eval echo configure:2257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2257  rm -rf conftest*
2258  ac_cv_addrinfo=yes
2259else
2260  echo "configure: failed program was:" >&5
2261  cat conftest.$ac_ext >&5
2262  rm -rf conftest*
2263  ac_cv_addrinfo=no
2264fi
2265rm -f conftest*
2266fi
2267
2268	echo "$ac_t""$ac_cv_addrinfo" 1>&6
2269	if test $ac_cv_addrinfo = yes; then
2270		cat >> confdefs.h <<\EOF
2271#define HAVE_ADDRINFO 1
2272EOF
2273
2274	else
2275		cat >> confdefs.h <<\EOF
2276#define NEED_ADDRINFO_H 1
2277EOF
2278
2279	fi
2280
2281if test "$ac_cv_addrinfo" = no; then
2282	missing_includes=yes
2283fi
2284
2285
2286	echo $ac_n "checking for NI_MAXSERV""... $ac_c" 1>&6
2287echo "configure:2288: checking for NI_MAXSERV" >&5
2288	if eval "test \"`echo '$''{'ac_cv_maxserv'+set}'`\" = set"; then
2289  echo $ac_n "(cached) $ac_c" 1>&6
2290else
2291  cat > conftest.$ac_ext <<EOF
2292#line 2293 "configure"
2293#include "confdefs.h"
2294#include <netdb.h>
2295#ifdef NI_MAXSERV
2296yes
2297#endif
2298EOF
2299if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2300  egrep "yes" >/dev/null 2>&1; then
2301  rm -rf conftest*
2302  ac_cv_maxserv=yes
2303else
2304  rm -rf conftest*
2305  ac_cv_maxserv=no
2306fi
2307rm -f conftest*
2308
2309fi
2310
2311	echo "$ac_t""$ac_cv_maxserv" 1>&6
2312	if test $ac_cv_maxserv != yes; then
2313		cat >> confdefs.h <<\EOF
2314#define NEED_ADDRINFO_H 1
2315EOF
2316
2317	fi
2318
2319if test "$ac_cv_maxserv" = no; then
2320	missing_includes=yes
2321fi
2322
2323
2324	echo $ac_n "checking for NI_NAMEREQD""... $ac_c" 1>&6
2325echo "configure:2326: checking for NI_NAMEREQD" >&5
2326	if eval "test \"`echo '$''{'ac_cv_namereqd'+set}'`\" = set"; then
2327  echo $ac_n "(cached) $ac_c" 1>&6
2328else
2329  cat > conftest.$ac_ext <<EOF
2330#line 2331 "configure"
2331#include "confdefs.h"
2332#include <netdb.h>
2333#ifdef NI_NOFQDN
2334yes
2335#endif
2336EOF
2337if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2338  egrep "yes" >/dev/null 2>&1; then
2339  rm -rf conftest*
2340  ac_cv_namereqd=yes
2341else
2342  rm -rf conftest*
2343  ac_cv_namereqd=no
2344fi
2345rm -f conftest*
2346
2347fi
2348
2349	echo "$ac_t""$ac_cv_namereqd" 1>&6
2350	if test $ac_cv_namereqd != yes; then
2351		cat >> confdefs.h <<\EOF
2352#define NEED_ADDRINFO_H 1
2353EOF
2354
2355	fi
2356
2357if test "$ac_cv_namereqd" = no; then
2358	missing_includes=yes
2359fi
2360
2361
2362	echo $ac_n "checking for sockaddr_storage""... $ac_c" 1>&6
2363echo "configure:2364: checking for sockaddr_storage" >&5
2364	if eval "test \"`echo '$''{'ac_cv_sa_storage'+set}'`\" = set"; then
2365  echo $ac_n "(cached) $ac_c" 1>&6
2366else
2367  cat > conftest.$ac_ext <<EOF
2368#line 2369 "configure"
2369#include "confdefs.h"
2370
2371#		include <sys/types.h>
2372#		include <sys/socket.h>
2373int main() {
2374struct sockaddr_storage s
2375; return 0; }
2376EOF
2377if { (eval echo configure:2378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2378  rm -rf conftest*
2379  ac_cv_sa_storage=yes
2380else
2381  echo "configure: failed program was:" >&5
2382  cat conftest.$ac_ext >&5
2383  rm -rf conftest*
2384  ac_cv_sa_storage=no
2385fi
2386rm -f conftest*
2387fi
2388
2389	echo "$ac_t""$ac_cv_sa_storage" 1>&6
2390	if test $ac_cv_sa_storage = yes; then
2391		cat >> confdefs.h <<\EOF
2392#define HAVE_SOCKADDR_STORAGE 1
2393EOF
2394
2395	fi
2396
2397if test "$ac_cv_sa_storage" = no; then
2398	missing_includes=yes
2399fi
2400
2401
2402	ac_cv_addrsz=yes
2403	echo $ac_n "checking for INADDRSZ""... $ac_c" 1>&6
2404echo "configure:2405: checking for INADDRSZ" >&5
2405	if eval "test \"`echo '$''{'ac_cv_inaddrsz'+set}'`\" = set"; then
2406  echo $ac_n "(cached) $ac_c" 1>&6
2407else
2408  cat > conftest.$ac_ext <<EOF
2409#line 2410 "configure"
2410#include "confdefs.h"
2411
2412#		include <arpa/nameser.h>
2413int main() {
2414int a = INADDRSZ
2415; return 0; }
2416EOF
2417if { (eval echo configure:2418: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2418  rm -rf conftest*
2419  ac_cv_inaddrsz=yes
2420else
2421  echo "configure: failed program was:" >&5
2422  cat conftest.$ac_ext >&5
2423  rm -rf conftest*
2424  ac_cv_inaddrsz=no
2425fi
2426rm -f conftest*
2427fi
2428
2429	echo "$ac_t""$ac_cv_inaddrsz" 1>&6
2430	if test $ac_cv_inaddrsz = yes; then
2431		cat >> confdefs.h <<\EOF
2432#define HAVE_INADDRSZ 1
2433EOF
2434
2435	else
2436		ac_cv_addrsz=no
2437	fi
2438	echo $ac_n "checking for IN6ADDRSZ""... $ac_c" 1>&6
2439echo "configure:2440: checking for IN6ADDRSZ" >&5
2440	if eval "test \"`echo '$''{'ac_cv_in6addrsz'+set}'`\" = set"; then
2441  echo $ac_n "(cached) $ac_c" 1>&6
2442else
2443  cat > conftest.$ac_ext <<EOF
2444#line 2445 "configure"
2445#include "confdefs.h"
2446
2447#		include <arpa/nameser.h>
2448int main() {
2449int a = IN6ADDRSZ
2450; return 0; }
2451EOF
2452if { (eval echo configure:2453: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2453  rm -rf conftest*
2454  ac_cv_in6addrsz=yes
2455else
2456  echo "configure: failed program was:" >&5
2457  cat conftest.$ac_ext >&5
2458  rm -rf conftest*
2459  ac_cv_in6addrsz=no
2460fi
2461rm -f conftest*
2462fi
2463
2464	echo "$ac_t""$ac_cv_in6addrsz" 1>&6
2465	if test $ac_cv_in6addrsz = yes; then
2466		cat >> confdefs.h <<\EOF
2467#define HAVE_IN6ADDRSZ 1
2468EOF
2469
2470	else
2471		ac_cv_addrsz=no
2472	fi
2473
2474if test "$ac_cv_addrsz" = no; then
2475	missing_includes=yes
2476fi
2477
2478
2479	echo $ac_n "checking for RES_USE_INET6""... $ac_c" 1>&6
2480echo "configure:2481: checking for RES_USE_INET6" >&5
2481	if eval "test \"`echo '$''{'ac_cv_res_inet6'+set}'`\" = set"; then
2482  echo $ac_n "(cached) $ac_c" 1>&6
2483else
2484  cat > conftest.$ac_ext <<EOF
2485#line 2486 "configure"
2486#include "confdefs.h"
2487
2488#		include <sys/types.h>
2489#		include <netinet/in.h>
2490#		include <resolv.h>
2491int main() {
2492int a = RES_USE_INET6
2493; return 0; }
2494EOF
2495if { (eval echo configure:2496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2496  rm -rf conftest*
2497  ac_cv_res_inet6=yes
2498else
2499  echo "configure: failed program was:" >&5
2500  cat conftest.$ac_ext >&5
2501  rm -rf conftest*
2502  ac_cv_res_inet6=no
2503fi
2504rm -f conftest*
2505fi
2506
2507	echo "$ac_t""$ac_cv_res_inet6" 1>&6
2508	if test $ac_cv_res_inet6 = yes; then
2509		cat >> confdefs.h <<\EOF
2510#define HAVE_RES_USE_INET6 1
2511EOF
2512
2513	fi
2514
2515if test "$ac_cv_res_inet6" = no; then
2516	missing_includes=yes
2517fi
2518
2519
2520	echo $ac_n "checking for AAAA""... $ac_c" 1>&6
2521echo "configure:2522: checking for AAAA" >&5
2522	if eval "test \"`echo '$''{'ac_cv_aaaa'+set}'`\" = set"; then
2523  echo $ac_n "(cached) $ac_c" 1>&6
2524else
2525  cat > conftest.$ac_ext <<EOF
2526#line 2527 "configure"
2527#include "confdefs.h"
2528
2529#		include <sys/types.h>
2530#		include <arpa/nameser.h>
2531int main() {
2532int a = T_AAAA
2533; return 0; }
2534EOF
2535if { (eval echo configure:2536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2536  rm -rf conftest*
2537  ac_cv_aaaa=yes
2538else
2539  echo "configure: failed program was:" >&5
2540  cat conftest.$ac_ext >&5
2541  rm -rf conftest*
2542  ac_cv_aaaa=no
2543fi
2544rm -f conftest*
2545fi
2546
2547	echo "$ac_t""$ac_cv_aaaa" 1>&6
2548	if test $ac_cv_aaaa = yes; then
2549		cat >> confdefs.h <<\EOF
2550#define HAVE_AAAA 1
2551EOF
2552
2553	fi
2554
2555if test "$ac_cv_aaaa" = no; then
2556	cat >> confdefs.h <<\EOF
2557#define T_AAAA 28
2558EOF
2559
2560fi
2561
2562
2563	echo $ac_n "checking for res_state_ext""... $ac_c" 1>&6
2564echo "configure:2565: checking for res_state_ext" >&5
2565	if eval "test \"`echo '$''{'ac_cv_res_state_ext'+set}'`\" = set"; then
2566  echo $ac_n "(cached) $ac_c" 1>&6
2567else
2568  cat > conftest.$ac_ext <<EOF
2569#line 2570 "configure"
2570#include "confdefs.h"
2571
2572#		include <sys/types.h>
2573#		include <netinet/in.h>
2574#		include <netinet6/in6.h>
2575#		include <resolv.h>
2576int main() {
2577struct __res_state_ext e
2578; return 0; }
2579EOF
2580if { (eval echo configure:2581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2581  rm -rf conftest*
2582  ac_cv_res_state_ext=yes
2583else
2584  echo "configure: failed program was:" >&5
2585  cat conftest.$ac_ext >&5
2586  rm -rf conftest*
2587  ac_cv_res_state_ext=no
2588fi
2589rm -f conftest*
2590fi
2591
2592	echo "$ac_t""$ac_cv_res_state_ext" 1>&6
2593	if test $ac_cv_res_state_ext = yes; then
2594		cat >> confdefs.h <<\EOF
2595#define HAVE_RES_STATE_EXT 1
2596EOF
2597
2598	fi
2599
2600if test "$ac_cv_res_state_ext" = no; then
2601	missing_includes=yes
2602fi
2603
2604
2605	echo $ac_n "checking for nsort in res_state""... $ac_c" 1>&6
2606echo "configure:2607: checking for nsort in res_state" >&5
2607	if eval "test \"`echo '$''{'ac_cv_res_state'+set}'`\" = set"; then
2608  echo $ac_n "(cached) $ac_c" 1>&6
2609else
2610  cat > conftest.$ac_ext <<EOF
2611#line 2612 "configure"
2612#include "confdefs.h"
2613
2614#		include <sys/types.h>
2615#		include <netinet/in.h>
2616#		include <netinet6/in6.h>
2617#		include <resolv.h>
2618int main() {
2619struct __res_state e; e.nsort = 0
2620; return 0; }
2621EOF
2622if { (eval echo configure:2623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2623  rm -rf conftest*
2624  ac_cv_res_state=yes
2625else
2626  echo "configure: failed program was:" >&5
2627  cat conftest.$ac_ext >&5
2628  rm -rf conftest*
2629  ac_cv_res_state=no
2630fi
2631rm -f conftest*
2632fi
2633
2634	echo "$ac_t""$ac_cv_res_state" 1>&6
2635	if test $ac_cv_res_state = yes; then
2636		cat >> confdefs.h <<\EOF
2637#define HAVE_NEW_RES_STATE 1
2638EOF
2639
2640	fi
2641
2642
2643if test "$missing_includes" = "yes"; then
2644	CPPFLAGS="$CPPFLAGS -I\$(srcdir)/missing"
2645	V_INCLS="$V_INCLS -I\$(srcdir)/missing"
2646fi
2647
2648
2649for ac_func in vfprintf strcasecmp
2650do
2651echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2652echo "configure:2653: checking for $ac_func" >&5
2653if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2654  echo $ac_n "(cached) $ac_c" 1>&6
2655else
2656  cat > conftest.$ac_ext <<EOF
2657#line 2658 "configure"
2658#include "confdefs.h"
2659/* System header to define __stub macros and hopefully few prototypes,
2660    which can conflict with char $ac_func(); below.  */
2661#include <assert.h>
2662/* Override any gcc2 internal prototype to avoid an error.  */
2663/* We use char because int might match the return type of a gcc2
2664    builtin and then its argument prototype would still apply.  */
2665char $ac_func();
2666
2667int main() {
2668
2669/* The GNU C library defines this for functions which it implements
2670    to always fail with ENOSYS.  Some functions are actually named
2671    something starting with __ and the normal name is an alias.  */
2672#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2673choke me
2674#else
2675$ac_func();
2676#endif
2677
2678; return 0; }
2679EOF
2680if { (eval echo configure:2681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2681  rm -rf conftest*
2682  eval "ac_cv_func_$ac_func=yes"
2683else
2684  echo "configure: failed program was:" >&5
2685  cat conftest.$ac_ext >&5
2686  rm -rf conftest*
2687  eval "ac_cv_func_$ac_func=no"
2688fi
2689rm -f conftest*
2690fi
2691
2692if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2693  echo "$ac_t""yes" 1>&6
2694    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2695  cat >> confdefs.h <<EOF
2696#define $ac_tr_func 1
2697EOF
2698
2699else
2700  echo "$ac_t""no" 1>&6
2701LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
2702fi
2703done
2704
2705
2706for ac_func in ether_ntohost setlinebuf gethostbyname2
2707do
2708echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
2709echo "configure:2710: checking for $ac_func" >&5
2710if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
2711  echo $ac_n "(cached) $ac_c" 1>&6
2712else
2713  cat > conftest.$ac_ext <<EOF
2714#line 2715 "configure"
2715#include "confdefs.h"
2716/* System header to define __stub macros and hopefully few prototypes,
2717    which can conflict with char $ac_func(); below.  */
2718#include <assert.h>
2719/* Override any gcc2 internal prototype to avoid an error.  */
2720/* We use char because int might match the return type of a gcc2
2721    builtin and then its argument prototype would still apply.  */
2722char $ac_func();
2723
2724int main() {
2725
2726/* The GNU C library defines this for functions which it implements
2727    to always fail with ENOSYS.  Some functions are actually named
2728    something starting with __ and the normal name is an alias.  */
2729#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
2730choke me
2731#else
2732$ac_func();
2733#endif
2734
2735; return 0; }
2736EOF
2737if { (eval echo configure:2738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2738  rm -rf conftest*
2739  eval "ac_cv_func_$ac_func=yes"
2740else
2741  echo "configure: failed program was:" >&5
2742  cat conftest.$ac_ext >&5
2743  rm -rf conftest*
2744  eval "ac_cv_func_$ac_func=no"
2745fi
2746rm -f conftest*
2747fi
2748
2749if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
2750  echo "$ac_t""yes" 1>&6
2751    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
2752  cat >> confdefs.h <<EOF
2753#define $ac_tr_func 1
2754EOF
2755
2756else
2757  echo "$ac_t""no" 1>&6
2758fi
2759done
2760
2761
2762echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
2763echo "configure:2764: checking whether byte ordering is bigendian" >&5
2764if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
2765  echo $ac_n "(cached) $ac_c" 1>&6
2766else
2767  ac_cv_c_bigendian=unknown
2768# See if sys/param.h defines the BYTE_ORDER macro.
2769cat > conftest.$ac_ext <<EOF
2770#line 2771 "configure"
2771#include "confdefs.h"
2772#include <sys/types.h>
2773#include <sys/param.h>
2774int main() {
2775
2776#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
2777 bogus endian macros
2778#endif
2779; return 0; }
2780EOF
2781if { (eval echo configure:2782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2782  rm -rf conftest*
2783  # It does; now see whether it defined to BIG_ENDIAN or not.
2784cat > conftest.$ac_ext <<EOF
2785#line 2786 "configure"
2786#include "confdefs.h"
2787#include <sys/types.h>
2788#include <sys/param.h>
2789int main() {
2790
2791#if BYTE_ORDER != BIG_ENDIAN
2792 not big endian
2793#endif
2794; return 0; }
2795EOF
2796if { (eval echo configure:2797: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2797  rm -rf conftest*
2798  ac_cv_c_bigendian=yes
2799else
2800  echo "configure: failed program was:" >&5
2801  cat conftest.$ac_ext >&5
2802  rm -rf conftest*
2803  ac_cv_c_bigendian=no
2804fi
2805rm -f conftest*
2806else
2807  echo "configure: failed program was:" >&5
2808  cat conftest.$ac_ext >&5
2809fi
2810rm -f conftest*
2811if test $ac_cv_c_bigendian = unknown; then
2812if test "$cross_compiling" = yes; then
2813    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
2814else
2815  cat > conftest.$ac_ext <<EOF
2816#line 2817 "configure"
2817#include "confdefs.h"
2818main () {
2819  /* Are we little or big endian?  From Harbison&Steele.  */
2820  union
2821  {
2822    long l;
2823    char c[sizeof (long)];
2824  } u;
2825  u.l = 1;
2826  exit (u.c[sizeof (long) - 1] == 1);
2827}
2828EOF
2829if { (eval echo configure:2830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
2830then
2831  ac_cv_c_bigendian=no
2832else
2833  echo "configure: failed program was:" >&5
2834  cat conftest.$ac_ext >&5
2835  rm -fr conftest*
2836  ac_cv_c_bigendian=yes
2837fi
2838rm -fr conftest*
2839fi
2840
2841fi
2842fi
2843
2844echo "$ac_t""$ac_cv_c_bigendian" 1>&6
2845if test $ac_cv_c_bigendian = yes; then
2846  cat >> confdefs.h <<\EOF
2847#define WORDS_BIGENDIAN 1
2848EOF
2849
2850fi
2851
2852
2853echo $ac_n "checking for main in -ldnet""... $ac_c" 1>&6
2854echo "configure:2855: checking for main in -ldnet" >&5
2855ac_lib_var=`echo dnet'_'main | sed 'y%./+-%__p_%'`
2856if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2857  echo $ac_n "(cached) $ac_c" 1>&6
2858else
2859  ac_save_LIBS="$LIBS"
2860LIBS="-ldnet  $LIBS"
2861cat > conftest.$ac_ext <<EOF
2862#line 2863 "configure"
2863#include "confdefs.h"
2864
2865int main() {
2866main()
2867; return 0; }
2868EOF
2869if { (eval echo configure:2870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2870  rm -rf conftest*
2871  eval "ac_cv_lib_$ac_lib_var=yes"
2872else
2873  echo "configure: failed program was:" >&5
2874  cat conftest.$ac_ext >&5
2875  rm -rf conftest*
2876  eval "ac_cv_lib_$ac_lib_var=no"
2877fi
2878rm -f conftest*
2879LIBS="$ac_save_LIBS"
2880
2881fi
2882if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2883  echo "$ac_t""yes" 1>&6
2884    ac_tr_lib=HAVE_LIB`echo dnet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2885    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2886  cat >> confdefs.h <<EOF
2887#define $ac_tr_lib 1
2888EOF
2889
2890  LIBS="-ldnet $LIBS"
2891
2892else
2893  echo "$ac_t""no" 1>&6
2894fi
2895
2896echo $ac_n "checking for main in -lrpc""... $ac_c" 1>&6
2897echo "configure:2898: checking for main in -lrpc" >&5
2898ac_lib_var=`echo rpc'_'main | sed 'y%./+-%__p_%'`
2899if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2900  echo $ac_n "(cached) $ac_c" 1>&6
2901else
2902  ac_save_LIBS="$LIBS"
2903LIBS="-lrpc  $LIBS"
2904cat > conftest.$ac_ext <<EOF
2905#line 2906 "configure"
2906#include "confdefs.h"
2907
2908int main() {
2909main()
2910; return 0; }
2911EOF
2912if { (eval echo configure:2913: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2913  rm -rf conftest*
2914  eval "ac_cv_lib_$ac_lib_var=yes"
2915else
2916  echo "configure: failed program was:" >&5
2917  cat conftest.$ac_ext >&5
2918  rm -rf conftest*
2919  eval "ac_cv_lib_$ac_lib_var=no"
2920fi
2921rm -f conftest*
2922LIBS="$ac_save_LIBS"
2923
2924fi
2925if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2926  echo "$ac_t""yes" 1>&6
2927    ac_tr_lib=HAVE_LIB`echo rpc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2928    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2929  cat >> confdefs.h <<EOF
2930#define $ac_tr_lib 1
2931EOF
2932
2933  LIBS="-lrpc $LIBS"
2934
2935else
2936  echo "$ac_t""no" 1>&6
2937fi
2938
2939echo $ac_n "checking for uncompress in -lz""... $ac_c" 1>&6
2940echo "configure:2941: checking for uncompress in -lz" >&5
2941ac_lib_var=`echo z'_'uncompress | sed 'y%./+-%__p_%'`
2942if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2943  echo $ac_n "(cached) $ac_c" 1>&6
2944else
2945  ac_save_LIBS="$LIBS"
2946LIBS="-lz  $LIBS"
2947cat > conftest.$ac_ext <<EOF
2948#line 2949 "configure"
2949#include "confdefs.h"
2950/* Override any gcc2 internal prototype to avoid an error.  */
2951/* We use char because int might match the return type of a gcc2
2952    builtin and then its argument prototype would still apply.  */
2953char uncompress();
2954
2955int main() {
2956uncompress()
2957; return 0; }
2958EOF
2959if { (eval echo configure:2960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2960  rm -rf conftest*
2961  eval "ac_cv_lib_$ac_lib_var=yes"
2962else
2963  echo "configure: failed program was:" >&5
2964  cat conftest.$ac_ext >&5
2965  rm -rf conftest*
2966  eval "ac_cv_lib_$ac_lib_var=no"
2967fi
2968rm -f conftest*
2969LIBS="$ac_save_LIBS"
2970
2971fi
2972if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2973  echo "$ac_t""yes" 1>&6
2974    ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2975    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2976  cat >> confdefs.h <<EOF
2977#define $ac_tr_lib 1
2978EOF
2979
2980  LIBS="-lz $LIBS"
2981
2982else
2983  echo "$ac_t""no" 1>&6
2984fi
2985
2986for ac_hdr in zlib.h
2987do
2988ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
2989echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
2990echo "configure:2991: checking for $ac_hdr" >&5
2991if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2992  echo $ac_n "(cached) $ac_c" 1>&6
2993else
2994  cat > conftest.$ac_ext <<EOF
2995#line 2996 "configure"
2996#include "confdefs.h"
2997#include <$ac_hdr>
2998EOF
2999ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3000{ (eval echo configure:3001: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3001ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3002if test -z "$ac_err"; then
3003  rm -rf conftest*
3004  eval "ac_cv_header_$ac_safe=yes"
3005else
3006  echo "$ac_err" >&5
3007  echo "configure: failed program was:" >&5
3008  cat conftest.$ac_ext >&5
3009  rm -rf conftest*
3010  eval "ac_cv_header_$ac_safe=no"
3011fi
3012rm -f conftest*
3013fi
3014if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3015  echo "$ac_t""yes" 1>&6
3016    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3017  cat >> confdefs.h <<EOF
3018#define $ac_tr_hdr 1
3019EOF
3020
3021else
3022  echo "$ac_t""no" 1>&6
3023fi
3024done
3025
3026
3027
3028    echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
3029echo "configure:3030: checking return type of signal handlers" >&5
3030if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
3031  echo $ac_n "(cached) $ac_c" 1>&6
3032else
3033  cat > conftest.$ac_ext <<EOF
3034#line 3035 "configure"
3035#include "confdefs.h"
3036#include <sys/types.h>
3037#include <signal.h>
3038#ifdef signal
3039#undef signal
3040#endif
3041#ifdef __cplusplus
3042extern "C" void (*signal (int, void (*)(int)))(int);
3043#else
3044void (*signal ()) ();
3045#endif
3046
3047int main() {
3048int i;
3049; return 0; }
3050EOF
3051if { (eval echo configure:3052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3052  rm -rf conftest*
3053  ac_cv_type_signal=void
3054else
3055  echo "configure: failed program was:" >&5
3056  cat conftest.$ac_ext >&5
3057  rm -rf conftest*
3058  ac_cv_type_signal=int
3059fi
3060rm -f conftest*
3061fi
3062
3063echo "$ac_t""$ac_cv_type_signal" 1>&6
3064cat >> confdefs.h <<EOF
3065#define RETSIGTYPE $ac_cv_type_signal
3066EOF
3067
3068
3069    if test "$ac_cv_type_signal" = void ; then
3070	    cat >> confdefs.h <<\EOF
3071#define RETSIGVAL
3072EOF
3073
3074    else
3075	    cat >> confdefs.h <<\EOF
3076#define RETSIGVAL (0)
3077EOF
3078
3079    fi
3080    case "$target_os" in
3081
3082    irix*)
3083	    cat >> confdefs.h <<\EOF
3084#define _BSD_SIGNALS 1
3085EOF
3086
3087	    ;;
3088
3089    *)
3090	    	    for ac_func in sigset
3091do
3092echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3093echo "configure:3094: checking for $ac_func" >&5
3094if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3095  echo $ac_n "(cached) $ac_c" 1>&6
3096else
3097  cat > conftest.$ac_ext <<EOF
3098#line 3099 "configure"
3099#include "confdefs.h"
3100/* System header to define __stub macros and hopefully few prototypes,
3101    which can conflict with char $ac_func(); below.  */
3102#include <assert.h>
3103/* Override any gcc2 internal prototype to avoid an error.  */
3104/* We use char because int might match the return type of a gcc2
3105    builtin and then its argument prototype would still apply.  */
3106char $ac_func();
3107
3108int main() {
3109
3110/* The GNU C library defines this for functions which it implements
3111    to always fail with ENOSYS.  Some functions are actually named
3112    something starting with __ and the normal name is an alias.  */
3113#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3114choke me
3115#else
3116$ac_func();
3117#endif
3118
3119; return 0; }
3120EOF
3121if { (eval echo configure:3122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3122  rm -rf conftest*
3123  eval "ac_cv_func_$ac_func=yes"
3124else
3125  echo "configure: failed program was:" >&5
3126  cat conftest.$ac_ext >&5
3127  rm -rf conftest*
3128  eval "ac_cv_func_$ac_func=no"
3129fi
3130rm -f conftest*
3131fi
3132
3133if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3134  echo "$ac_t""yes" 1>&6
3135    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3136  cat >> confdefs.h <<EOF
3137#define $ac_tr_func 1
3138EOF
3139
3140else
3141  echo "$ac_t""no" 1>&6
3142fi
3143done
3144
3145	    if test $ac_cv_func_sigset = no ; then
3146		    for ac_func in sigaction
3147do
3148echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3149echo "configure:3150: checking for $ac_func" >&5
3150if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3151  echo $ac_n "(cached) $ac_c" 1>&6
3152else
3153  cat > conftest.$ac_ext <<EOF
3154#line 3155 "configure"
3155#include "confdefs.h"
3156/* System header to define __stub macros and hopefully few prototypes,
3157    which can conflict with char $ac_func(); below.  */
3158#include <assert.h>
3159/* Override any gcc2 internal prototype to avoid an error.  */
3160/* We use char because int might match the return type of a gcc2
3161    builtin and then its argument prototype would still apply.  */
3162char $ac_func();
3163
3164int main() {
3165
3166/* The GNU C library defines this for functions which it implements
3167    to always fail with ENOSYS.  Some functions are actually named
3168    something starting with __ and the normal name is an alias.  */
3169#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3170choke me
3171#else
3172$ac_func();
3173#endif
3174
3175; return 0; }
3176EOF
3177if { (eval echo configure:3178: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3178  rm -rf conftest*
3179  eval "ac_cv_func_$ac_func=yes"
3180else
3181  echo "configure: failed program was:" >&5
3182  cat conftest.$ac_ext >&5
3183  rm -rf conftest*
3184  eval "ac_cv_func_$ac_func=no"
3185fi
3186rm -f conftest*
3187fi
3188
3189if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3190  echo "$ac_t""yes" 1>&6
3191    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3192  cat >> confdefs.h <<EOF
3193#define $ac_tr_func 1
3194EOF
3195
3196else
3197  echo "$ac_t""no" 1>&6
3198fi
3199done
3200
3201	    fi
3202	    ;;
3203    esac
3204
3205
3206    # Most operating systems have gethostbyname() in the default searched
3207    # libraries (i.e. libc):
3208    echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
3209echo "configure:3210: checking for gethostbyname" >&5
3210if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
3211  echo $ac_n "(cached) $ac_c" 1>&6
3212else
3213  cat > conftest.$ac_ext <<EOF
3214#line 3215 "configure"
3215#include "confdefs.h"
3216/* System header to define __stub macros and hopefully few prototypes,
3217    which can conflict with char gethostbyname(); below.  */
3218#include <assert.h>
3219/* Override any gcc2 internal prototype to avoid an error.  */
3220/* We use char because int might match the return type of a gcc2
3221    builtin and then its argument prototype would still apply.  */
3222char gethostbyname();
3223
3224int main() {
3225
3226/* The GNU C library defines this for functions which it implements
3227    to always fail with ENOSYS.  Some functions are actually named
3228    something starting with __ and the normal name is an alias.  */
3229#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
3230choke me
3231#else
3232gethostbyname();
3233#endif
3234
3235; return 0; }
3236EOF
3237if { (eval echo configure:3238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3238  rm -rf conftest*
3239  eval "ac_cv_func_gethostbyname=yes"
3240else
3241  echo "configure: failed program was:" >&5
3242  cat conftest.$ac_ext >&5
3243  rm -rf conftest*
3244  eval "ac_cv_func_gethostbyname=no"
3245fi
3246rm -f conftest*
3247fi
3248
3249if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then
3250  echo "$ac_t""yes" 1>&6
3251  :
3252else
3253  echo "$ac_t""no" 1>&6
3254# Some OSes (eg. Solaris) place it in libnsl:
3255	echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
3256echo "configure:3257: checking for gethostbyname in -lnsl" >&5
3257ac_lib_var=`echo nsl'_'gethostbyname'_' | sed 'y%./+- %__p__%'`
3258if eval "test \"`echo '$''{'ac_cv_lbl_lib_$ac_lib_var'+set}'`\" = set"; then
3259  echo $ac_n "(cached) $ac_c" 1>&6
3260else
3261  ac_save_LIBS="$LIBS"
3262LIBS="-lnsl  $LIBS"
3263cat > conftest.$ac_ext <<EOF
3264#line 3265 "configure"
3265#include "confdefs.h"
3266/* Override any gcc2 internal prototype to avoid an error.  */
3267/* We use char because int might match the return type of a gcc2
3268    builtin and then its argument prototype would still apply.  */
3269char gethostbyname();
3270
3271int main() {
3272gethostbyname()
3273; return 0; }
3274EOF
3275if { (eval echo configure:3276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3276  rm -rf conftest*
3277  eval "ac_cv_lbl_lib_$ac_lib_var=yes"
3278else
3279  echo "configure: failed program was:" >&5
3280  cat conftest.$ac_ext >&5
3281  rm -rf conftest*
3282  eval "ac_cv_lbl_lib_$ac_lib_var=no"
3283fi
3284rm -f conftest*
3285LIBS="$ac_save_LIBS"
3286
3287fi
3288if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
3289  echo "$ac_t""yes" 1>&6
3290    ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/^a-zA-Z0-9_/_/g' \
3291    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3292  cat >> confdefs.h <<EOF
3293#define $ac_tr_lib 1
3294EOF
3295
3296  LIBS="-lnsl $LIBS"
3297
3298else
3299  echo "$ac_t""no" 1>&6
3300# Some strange OSes (SINIX) have it in libsocket:
3301	    echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6
3302echo "configure:3303: checking for gethostbyname in -lsocket" >&5
3303ac_lib_var=`echo socket'_'gethostbyname'_' | sed 'y%./+- %__p__%'`
3304if eval "test \"`echo '$''{'ac_cv_lbl_lib_$ac_lib_var'+set}'`\" = set"; then
3305  echo $ac_n "(cached) $ac_c" 1>&6
3306else
3307  ac_save_LIBS="$LIBS"
3308LIBS="-lsocket  $LIBS"
3309cat > conftest.$ac_ext <<EOF
3310#line 3311 "configure"
3311#include "confdefs.h"
3312/* Override any gcc2 internal prototype to avoid an error.  */
3313/* We use char because int might match the return type of a gcc2
3314    builtin and then its argument prototype would still apply.  */
3315char gethostbyname();
3316
3317int main() {
3318gethostbyname()
3319; return 0; }
3320EOF
3321if { (eval echo configure:3322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3322  rm -rf conftest*
3323  eval "ac_cv_lbl_lib_$ac_lib_var=yes"
3324else
3325  echo "configure: failed program was:" >&5
3326  cat conftest.$ac_ext >&5
3327  rm -rf conftest*
3328  eval "ac_cv_lbl_lib_$ac_lib_var=no"
3329fi
3330rm -f conftest*
3331LIBS="$ac_save_LIBS"
3332
3333fi
3334if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
3335  echo "$ac_t""yes" 1>&6
3336    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \
3337    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3338  cat >> confdefs.h <<EOF
3339#define $ac_tr_lib 1
3340EOF
3341
3342  LIBS="-lsocket $LIBS"
3343
3344else
3345  echo "$ac_t""no" 1>&6
3346# Unfortunately libsocket sometimes depends on libnsl.
3347		# AC_CHECK_LIB's API is essentially broken so the
3348		# following ugliness is necessary:
3349		echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6
3350echo "configure:3351: checking for gethostbyname in -lsocket" >&5
3351ac_lib_var=`echo socket'_'gethostbyname'_'-lnsl | sed 'y%./+- %__p__%'`
3352if eval "test \"`echo '$''{'ac_cv_lbl_lib_$ac_lib_var'+set}'`\" = set"; then
3353  echo $ac_n "(cached) $ac_c" 1>&6
3354else
3355  ac_save_LIBS="$LIBS"
3356LIBS="-lsocket -lnsl $LIBS"
3357cat > conftest.$ac_ext <<EOF
3358#line 3359 "configure"
3359#include "confdefs.h"
3360/* Override any gcc2 internal prototype to avoid an error.  */
3361/* We use char because int might match the return type of a gcc2
3362    builtin and then its argument prototype would still apply.  */
3363char gethostbyname();
3364
3365int main() {
3366gethostbyname()
3367; return 0; }
3368EOF
3369if { (eval echo configure:3370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3370  rm -rf conftest*
3371  eval "ac_cv_lbl_lib_$ac_lib_var=yes"
3372else
3373  echo "configure: failed program was:" >&5
3374  cat conftest.$ac_ext >&5
3375  rm -rf conftest*
3376  eval "ac_cv_lbl_lib_$ac_lib_var=no"
3377fi
3378rm -f conftest*
3379LIBS="$ac_save_LIBS"
3380
3381fi
3382if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
3383  echo "$ac_t""yes" 1>&6
3384  LIBS="-lsocket -lnsl $LIBS"
3385else
3386  echo "$ac_t""no" 1>&6
3387echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6
3388echo "configure:3389: checking for gethostbyname in -lresolv" >&5
3389ac_lib_var=`echo resolv'_'gethostbyname | sed 'y%./+-%__p_%'`
3390if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3391  echo $ac_n "(cached) $ac_c" 1>&6
3392else
3393  ac_save_LIBS="$LIBS"
3394LIBS="-lresolv  $LIBS"
3395cat > conftest.$ac_ext <<EOF
3396#line 3397 "configure"
3397#include "confdefs.h"
3398/* Override any gcc2 internal prototype to avoid an error.  */
3399/* We use char because int might match the return type of a gcc2
3400    builtin and then its argument prototype would still apply.  */
3401char gethostbyname();
3402
3403int main() {
3404gethostbyname()
3405; return 0; }
3406EOF
3407if { (eval echo configure:3408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3408  rm -rf conftest*
3409  eval "ac_cv_lib_$ac_lib_var=yes"
3410else
3411  echo "configure: failed program was:" >&5
3412  cat conftest.$ac_ext >&5
3413  rm -rf conftest*
3414  eval "ac_cv_lib_$ac_lib_var=no"
3415fi
3416rm -f conftest*
3417LIBS="$ac_save_LIBS"
3418
3419fi
3420if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3421  echo "$ac_t""yes" 1>&6
3422    ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/^a-zA-Z0-9_/_/g' \
3423    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3424  cat >> confdefs.h <<EOF
3425#define $ac_tr_lib 1
3426EOF
3427
3428  LIBS="-lresolv $LIBS"
3429
3430else
3431  echo "$ac_t""no" 1>&6
3432fi
3433
3434fi
3435
3436fi
3437
3438fi
3439
3440fi
3441
3442    echo $ac_n "checking for socket""... $ac_c" 1>&6
3443echo "configure:3444: checking for socket" >&5
3444if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3445  echo $ac_n "(cached) $ac_c" 1>&6
3446else
3447  cat > conftest.$ac_ext <<EOF
3448#line 3449 "configure"
3449#include "confdefs.h"
3450/* System header to define __stub macros and hopefully few prototypes,
3451    which can conflict with char socket(); below.  */
3452#include <assert.h>
3453/* Override any gcc2 internal prototype to avoid an error.  */
3454/* We use char because int might match the return type of a gcc2
3455    builtin and then its argument prototype would still apply.  */
3456char socket();
3457
3458int main() {
3459
3460/* The GNU C library defines this for functions which it implements
3461    to always fail with ENOSYS.  Some functions are actually named
3462    something starting with __ and the normal name is an alias.  */
3463#if defined (__stub_socket) || defined (__stub___socket)
3464choke me
3465#else
3466socket();
3467#endif
3468
3469; return 0; }
3470EOF
3471if { (eval echo configure:3472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3472  rm -rf conftest*
3473  eval "ac_cv_func_socket=yes"
3474else
3475  echo "configure: failed program was:" >&5
3476  cat conftest.$ac_ext >&5
3477  rm -rf conftest*
3478  eval "ac_cv_func_socket=no"
3479fi
3480rm -f conftest*
3481fi
3482
3483if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3484  echo "$ac_t""yes" 1>&6
3485  :
3486else
3487  echo "$ac_t""no" 1>&6
3488echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
3489echo "configure:3490: checking for socket in -lsocket" >&5
3490ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
3491if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3492  echo $ac_n "(cached) $ac_c" 1>&6
3493else
3494  ac_save_LIBS="$LIBS"
3495LIBS="-lsocket  $LIBS"
3496cat > conftest.$ac_ext <<EOF
3497#line 3498 "configure"
3498#include "confdefs.h"
3499/* Override any gcc2 internal prototype to avoid an error.  */
3500/* We use char because int might match the return type of a gcc2
3501    builtin and then its argument prototype would still apply.  */
3502char socket();
3503
3504int main() {
3505socket()
3506; return 0; }
3507EOF
3508if { (eval echo configure:3509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3509  rm -rf conftest*
3510  eval "ac_cv_lib_$ac_lib_var=yes"
3511else
3512  echo "configure: failed program was:" >&5
3513  cat conftest.$ac_ext >&5
3514  rm -rf conftest*
3515  eval "ac_cv_lib_$ac_lib_var=no"
3516fi
3517rm -f conftest*
3518LIBS="$ac_save_LIBS"
3519
3520fi
3521if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3522  echo "$ac_t""yes" 1>&6
3523    ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \
3524    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3525  cat >> confdefs.h <<EOF
3526#define $ac_tr_lib 1
3527EOF
3528
3529  LIBS="-lsocket $LIBS"
3530
3531else
3532  echo "$ac_t""no" 1>&6
3533echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
3534echo "configure:3535: checking for socket in -lsocket" >&5
3535ac_lib_var=`echo socket'_'socket'_'-lnsl | sed 'y%./+- %__p__%'`
3536if eval "test \"`echo '$''{'ac_cv_lbl_lib_$ac_lib_var'+set}'`\" = set"; then
3537  echo $ac_n "(cached) $ac_c" 1>&6
3538else
3539  ac_save_LIBS="$LIBS"
3540LIBS="-lsocket -lnsl $LIBS"
3541cat > conftest.$ac_ext <<EOF
3542#line 3543 "configure"
3543#include "confdefs.h"
3544/* Override any gcc2 internal prototype to avoid an error.  */
3545/* We use char because int might match the return type of a gcc2
3546    builtin and then its argument prototype would still apply.  */
3547char socket();
3548
3549int main() {
3550socket()
3551; return 0; }
3552EOF
3553if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3554  rm -rf conftest*
3555  eval "ac_cv_lbl_lib_$ac_lib_var=yes"
3556else
3557  echo "configure: failed program was:" >&5
3558  cat conftest.$ac_ext >&5
3559  rm -rf conftest*
3560  eval "ac_cv_lbl_lib_$ac_lib_var=no"
3561fi
3562rm -f conftest*
3563LIBS="$ac_save_LIBS"
3564
3565fi
3566if eval "test \"`echo '$ac_cv_lbl_lib_'$ac_lib_var`\" = yes"; then
3567  echo "$ac_t""yes" 1>&6
3568  LIBS="-lsocket -lnsl $LIBS"
3569else
3570  echo "$ac_t""no" 1>&6
3571fi
3572
3573fi
3574
3575fi
3576
3577    # DLPI needs putmsg under HPUX so test for -lstr while we're at it
3578    echo $ac_n "checking for putmsg in -lstr""... $ac_c" 1>&6
3579echo "configure:3580: checking for putmsg in -lstr" >&5
3580ac_lib_var=`echo str'_'putmsg | sed 'y%./+-%__p_%'`
3581if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3582  echo $ac_n "(cached) $ac_c" 1>&6
3583else
3584  ac_save_LIBS="$LIBS"
3585LIBS="-lstr  $LIBS"
3586cat > conftest.$ac_ext <<EOF
3587#line 3588 "configure"
3588#include "confdefs.h"
3589/* Override any gcc2 internal prototype to avoid an error.  */
3590/* We use char because int might match the return type of a gcc2
3591    builtin and then its argument prototype would still apply.  */
3592char putmsg();
3593
3594int main() {
3595putmsg()
3596; return 0; }
3597EOF
3598if { (eval echo configure:3599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3599  rm -rf conftest*
3600  eval "ac_cv_lib_$ac_lib_var=yes"
3601else
3602  echo "configure: failed program was:" >&5
3603  cat conftest.$ac_ext >&5
3604  rm -rf conftest*
3605  eval "ac_cv_lib_$ac_lib_var=no"
3606fi
3607rm -f conftest*
3608LIBS="$ac_save_LIBS"
3609
3610fi
3611if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3612  echo "$ac_t""yes" 1>&6
3613    ac_tr_lib=HAVE_LIB`echo str | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3614    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3615  cat >> confdefs.h <<EOF
3616#define $ac_tr_lib 1
3617EOF
3618
3619  LIBS="-lstr $LIBS"
3620
3621else
3622  echo "$ac_t""no" 1>&6
3623fi
3624
3625
3626
3627                LBL_LIBS="$LIBS"
3628    pfopen=/usr/examples/packetfilter/pfopen.c
3629    if test -f $pfopen ; then
3630	    for ac_func in pfopen
3631do
3632echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3633echo "configure:3634: checking for $ac_func" >&5
3634if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3635  echo $ac_n "(cached) $ac_c" 1>&6
3636else
3637  cat > conftest.$ac_ext <<EOF
3638#line 3639 "configure"
3639#include "confdefs.h"
3640/* System header to define __stub macros and hopefully few prototypes,
3641    which can conflict with char $ac_func(); below.  */
3642#include <assert.h>
3643/* Override any gcc2 internal prototype to avoid an error.  */
3644/* We use char because int might match the return type of a gcc2
3645    builtin and then its argument prototype would still apply.  */
3646char $ac_func();
3647
3648int main() {
3649
3650/* The GNU C library defines this for functions which it implements
3651    to always fail with ENOSYS.  Some functions are actually named
3652    something starting with __ and the normal name is an alias.  */
3653#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3654choke me
3655#else
3656$ac_func();
3657#endif
3658
3659; return 0; }
3660EOF
3661if { (eval echo configure:3662: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3662  rm -rf conftest*
3663  eval "ac_cv_func_$ac_func=yes"
3664else
3665  echo "configure: failed program was:" >&5
3666  cat conftest.$ac_ext >&5
3667  rm -rf conftest*
3668  eval "ac_cv_func_$ac_func=no"
3669fi
3670rm -f conftest*
3671fi
3672
3673if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3674  echo "$ac_t""yes" 1>&6
3675    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3676  cat >> confdefs.h <<EOF
3677#define $ac_tr_func 1
3678EOF
3679
3680else
3681  echo "$ac_t""no" 1>&6
3682fi
3683done
3684
3685	    if test $ac_cv_func_pfopen = "no" ; then
3686		    echo "$ac_t""Using $pfopen" 1>&6
3687		    LIBS="$LIBS $pfopen"
3688	    fi
3689    fi
3690    echo $ac_n "checking for local pcap library""... $ac_c" 1>&6
3691echo "configure:3692: checking for local pcap library" >&5
3692    libpcap=FAIL
3693    lastdir=FAIL
3694    places=`ls .. | sed -e 's,/$,,' -e 's,^,../,' | \
3695	egrep '/libpcap-[0-9]*\.[0-9]*(\.[0-9]*)?([ab][0-9]*)?$'`
3696    for dir in $places ../libpcap libpcap ; do
3697	    basedir=`echo $dir | sed -e 's/[ab][0-9]*$//'`
3698	    if test $lastdir = $basedir ; then
3699		    		    continue;
3700	    fi
3701	    lastdir=$dir
3702	    if test -r $dir/libpcap.a ; then
3703		    libpcap=$dir/libpcap.a
3704		    d=$dir
3705		    	    fi
3706    done
3707    if test $libpcap = FAIL ; then
3708	    echo "$ac_t""not found" 1>&6
3709	    echo $ac_n "checking for main in -lpcap""... $ac_c" 1>&6
3710echo "configure:3711: checking for main in -lpcap" >&5
3711ac_lib_var=`echo pcap'_'main | sed 'y%./+-%__p_%'`
3712if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3713  echo $ac_n "(cached) $ac_c" 1>&6
3714else
3715  ac_save_LIBS="$LIBS"
3716LIBS="-lpcap  $LIBS"
3717cat > conftest.$ac_ext <<EOF
3718#line 3719 "configure"
3719#include "confdefs.h"
3720
3721int main() {
3722main()
3723; return 0; }
3724EOF
3725if { (eval echo configure:3726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3726  rm -rf conftest*
3727  eval "ac_cv_lib_$ac_lib_var=yes"
3728else
3729  echo "configure: failed program was:" >&5
3730  cat conftest.$ac_ext >&5
3731  rm -rf conftest*
3732  eval "ac_cv_lib_$ac_lib_var=no"
3733fi
3734rm -f conftest*
3735LIBS="$ac_save_LIBS"
3736
3737fi
3738if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3739  echo "$ac_t""yes" 1>&6
3740  libpcap="-lpcap"
3741else
3742  echo "$ac_t""no" 1>&6
3743fi
3744
3745	    if test $libpcap = FAIL ; then
3746		    { echo "configure: error: see the INSTALL doc for more info" 1>&2; exit 1; }
3747	    fi
3748    else
3749	    V_PCAPDEP=$libpcap
3750	    if test -r $d/pcap.h; then
3751	    V_INCLS="-I$d $V_INCLS"
3752	    elif test -r $srcdir/../libpcap/pcap.h; then
3753		    V_INCLS="-I$d -I$srcdir/../libpcap $V_INCLS"
3754	    else
3755                    { echo "configure: error: cannot find pcap.h" 1>&2; exit 1; }
3756 	    fi
3757	    echo "$ac_t""$libpcap" 1>&6
3758    fi
3759    LIBS="$libpcap $LIBS"
3760    case "$target_os" in
3761
3762    aix*)
3763	    pseexe="/lib/pse.exp"
3764	    echo $ac_n "checking for $pseexe""... $ac_c" 1>&6
3765echo "configure:3766: checking for $pseexe" >&5
3766	    if test -f $pseexe ; then
3767		    echo "$ac_t""yes" 1>&6
3768		    LIBS="$LIBS -I:$pseexe"
3769	    fi
3770	    ;;
3771    esac
3772
3773V_GROUP=0
3774if test -f /etc/group -a ! -z "`grep '^wheel:' /etc/group`" ; then
3775	V_GROUP=wheel
3776fi
3777case "$target_os" in
3778
3779aix*)
3780		cat >> confdefs.h <<\EOF
3781#define _SUN 1
3782EOF
3783
3784	;;
3785
3786irix*)
3787	V_GROUP=sys
3788	;;
3789
3790linux*)
3791	V_INCLS="$V_INCLS -I\$(srcdir)/linux-include"
3792	;;
3793
3794osf*)
3795	V_GROUP=system
3796		cat >> confdefs.h <<\EOF
3797#define __STDC__ 2
3798EOF
3799
3800	;;
3801
3802solaris*)
3803	V_GROUP=sys
3804	;;
3805esac
3806
3807if test -f /dev/bpf0 ; then
3808	V_GROUP=bpf
3809fi
3810
3811echo $ac_n "checking for u_int8_t using $CC""... $ac_c" 1>&6
3812echo "configure:3813: checking for u_int8_t using $CC" >&5
3813    if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int8_t'+set}'`\" = set"; then
3814  echo $ac_n "(cached) $ac_c" 1>&6
3815else
3816  cat > conftest.$ac_ext <<EOF
3817#line 3818 "configure"
3818#include "confdefs.h"
3819
3820#	include "confdefs.h"
3821#	include <sys/types.h>
3822#	if STDC_HEADERS
3823#	include <stdlib.h>
3824#	include <stddef.h>
3825#	endif
3826int main() {
3827u_int8_t i
3828; return 0; }
3829EOF
3830if { (eval echo configure:3831: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3831  rm -rf conftest*
3832  ac_cv_lbl_have_u_int8_t=yes
3833else
3834  echo "configure: failed program was:" >&5
3835  cat conftest.$ac_ext >&5
3836  rm -rf conftest*
3837  ac_cv_lbl_have_u_int8_t=no
3838fi
3839rm -f conftest*
3840fi
3841
3842    echo "$ac_t""$ac_cv_lbl_have_u_int8_t" 1>&6
3843    if test $ac_cv_lbl_have_u_int8_t = no ; then
3844	    cat >> confdefs.h <<\EOF
3845#define u_int8_t u_char
3846EOF
3847
3848    fi
3849echo $ac_n "checking for int16_t using $CC""... $ac_c" 1>&6
3850echo "configure:3851: checking for int16_t using $CC" >&5
3851    if eval "test \"`echo '$''{'ac_cv_lbl_have_int16_t'+set}'`\" = set"; then
3852  echo $ac_n "(cached) $ac_c" 1>&6
3853else
3854  cat > conftest.$ac_ext <<EOF
3855#line 3856 "configure"
3856#include "confdefs.h"
3857
3858#	include "confdefs.h"
3859#	include <sys/types.h>
3860#	if STDC_HEADERS
3861#	include <stdlib.h>
3862#	include <stddef.h>
3863#	endif
3864int main() {
3865int16_t i
3866; return 0; }
3867EOF
3868if { (eval echo configure:3869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3869  rm -rf conftest*
3870  ac_cv_lbl_have_int16_t=yes
3871else
3872  echo "configure: failed program was:" >&5
3873  cat conftest.$ac_ext >&5
3874  rm -rf conftest*
3875  ac_cv_lbl_have_int16_t=no
3876fi
3877rm -f conftest*
3878fi
3879
3880    echo "$ac_t""$ac_cv_lbl_have_int16_t" 1>&6
3881    if test $ac_cv_lbl_have_int16_t = no ; then
3882	    cat >> confdefs.h <<\EOF
3883#define int16_t short
3884EOF
3885
3886    fi
3887echo $ac_n "checking for u_int16_t using $CC""... $ac_c" 1>&6
3888echo "configure:3889: checking for u_int16_t using $CC" >&5
3889    if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int16_t'+set}'`\" = set"; then
3890  echo $ac_n "(cached) $ac_c" 1>&6
3891else
3892  cat > conftest.$ac_ext <<EOF
3893#line 3894 "configure"
3894#include "confdefs.h"
3895
3896#	include "confdefs.h"
3897#	include <sys/types.h>
3898#	if STDC_HEADERS
3899#	include <stdlib.h>
3900#	include <stddef.h>
3901#	endif
3902int main() {
3903u_int16_t i
3904; return 0; }
3905EOF
3906if { (eval echo configure:3907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3907  rm -rf conftest*
3908  ac_cv_lbl_have_u_int16_t=yes
3909else
3910  echo "configure: failed program was:" >&5
3911  cat conftest.$ac_ext >&5
3912  rm -rf conftest*
3913  ac_cv_lbl_have_u_int16_t=no
3914fi
3915rm -f conftest*
3916fi
3917
3918    echo "$ac_t""$ac_cv_lbl_have_u_int16_t" 1>&6
3919    if test $ac_cv_lbl_have_u_int16_t = no ; then
3920	    cat >> confdefs.h <<\EOF
3921#define u_int16_t u_short
3922EOF
3923
3924    fi
3925echo $ac_n "checking for int32_t using $CC""... $ac_c" 1>&6
3926echo "configure:3927: checking for int32_t using $CC" >&5
3927    if eval "test \"`echo '$''{'ac_cv_lbl_have_int32_t'+set}'`\" = set"; then
3928  echo $ac_n "(cached) $ac_c" 1>&6
3929else
3930  cat > conftest.$ac_ext <<EOF
3931#line 3932 "configure"
3932#include "confdefs.h"
3933
3934#	include "confdefs.h"
3935#	include <sys/types.h>
3936#	if STDC_HEADERS
3937#	include <stdlib.h>
3938#	include <stddef.h>
3939#	endif
3940int main() {
3941int32_t i
3942; return 0; }
3943EOF
3944if { (eval echo configure:3945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3945  rm -rf conftest*
3946  ac_cv_lbl_have_int32_t=yes
3947else
3948  echo "configure: failed program was:" >&5
3949  cat conftest.$ac_ext >&5
3950  rm -rf conftest*
3951  ac_cv_lbl_have_int32_t=no
3952fi
3953rm -f conftest*
3954fi
3955
3956    echo "$ac_t""$ac_cv_lbl_have_int32_t" 1>&6
3957    if test $ac_cv_lbl_have_int32_t = no ; then
3958	    cat >> confdefs.h <<\EOF
3959#define int32_t int
3960EOF
3961
3962    fi
3963echo $ac_n "checking for u_int32_t using $CC""... $ac_c" 1>&6
3964echo "configure:3965: checking for u_int32_t using $CC" >&5
3965    if eval "test \"`echo '$''{'ac_cv_lbl_have_u_int32_t'+set}'`\" = set"; then
3966  echo $ac_n "(cached) $ac_c" 1>&6
3967else
3968  cat > conftest.$ac_ext <<EOF
3969#line 3970 "configure"
3970#include "confdefs.h"
3971
3972#	include "confdefs.h"
3973#	include <sys/types.h>
3974#	if STDC_HEADERS
3975#	include <stdlib.h>
3976#	include <stddef.h>
3977#	endif
3978int main() {
3979u_int32_t i
3980; return 0; }
3981EOF
3982if { (eval echo configure:3983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3983  rm -rf conftest*
3984  ac_cv_lbl_have_u_int32_t=yes
3985else
3986  echo "configure: failed program was:" >&5
3987  cat conftest.$ac_ext >&5
3988  rm -rf conftest*
3989  ac_cv_lbl_have_u_int32_t=no
3990fi
3991rm -f conftest*
3992fi
3993
3994    echo "$ac_t""$ac_cv_lbl_have_u_int32_t" 1>&6
3995    if test $ac_cv_lbl_have_u_int32_t = no ; then
3996	    cat >> confdefs.h <<\EOF
3997#define u_int32_t u_int
3998EOF
3999
4000    fi
4001
4002rm -f os-proto.h
4003    if test "${LBL_CFLAGS+set}" = set; then
4004	    V_CCOPT="$V_CCOPT ${LBL_CFLAGS}"
4005    fi
4006    if test -f .devel ; then
4007	    if test "$GCC" = yes ; then
4008		    if test "${LBL_CFLAGS+set}" != set; then
4009			    if test "$ac_cv_prog_cc_g" = yes ; then
4010				    V_CCOPT="-g $V_CCOPT"
4011			    fi
4012			    V_CCOPT="$V_CCOPT -Wall"
4013			    if test $ac_cv_lbl_gcc_vers -gt 1 ; then
4014				    V_CCOPT="$V_CCOPT -Wmissing-prototypes -Wstrict-prototypes"
4015			    fi
4016		    fi
4017	    else
4018		    case "$target_os" in
4019
4020		    irix6*)
4021			    V_CCOPT="$V_CCOPT -n32"
4022			    ;;
4023
4024		    *)
4025			    ;;
4026		    esac
4027	    fi
4028	    os=`echo $target_os | sed -e 's/\([0-9][0-9]*\)[^0-9].*$/\1/'`
4029	    name="lbl/os-$os.h"
4030	    if test -f $name ; then
4031		    ln -s $name os-proto.h
4032		    cat >> confdefs.h <<\EOF
4033#define HAVE_OS_PROTO_H 1
4034EOF
4035
4036	    else
4037		    echo "configure: warning: can't find $name" 1>&2
4038	    fi
4039    fi
4040
4041echo $ac_n "checking if sockaddr struct has sa_len member""... $ac_c" 1>&6
4042echo "configure:4043: checking if sockaddr struct has sa_len member" >&5
4043    if eval "test \"`echo '$''{'ac_cv_lbl_sockaddr_has_sa_len'+set}'`\" = set"; then
4044  echo $ac_n "(cached) $ac_c" 1>&6
4045else
4046  cat > conftest.$ac_ext <<EOF
4047#line 4048 "configure"
4048#include "confdefs.h"
4049
4050#	include <sys/types.h>
4051#	include <sys/socket.h>
4052int main() {
4053u_int i = sizeof(((struct sockaddr *)0)->sa_len)
4054; return 0; }
4055EOF
4056if { (eval echo configure:4057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4057  rm -rf conftest*
4058  ac_cv_lbl_sockaddr_has_sa_len=yes
4059else
4060  echo "configure: failed program was:" >&5
4061  cat conftest.$ac_ext >&5
4062  rm -rf conftest*
4063  ac_cv_lbl_sockaddr_has_sa_len=no
4064fi
4065rm -f conftest*
4066fi
4067
4068    echo "$ac_t""$ac_cv_lbl_sockaddr_has_sa_len" 1>&6
4069    if test $ac_cv_lbl_sockaddr_has_sa_len = yes ; then
4070	    cat >> confdefs.h <<\EOF
4071#define HAVE_SOCKADDR_SA_LEN 1
4072EOF
4073
4074    fi
4075
4076echo $ac_n "checking if ether_header uses ether_addr structs""... $ac_c" 1>&6
4077echo "configure:4078: checking if ether_header uses ether_addr structs" >&5
4078if eval "test \"`echo '$''{'ac_cv_ether_header_has_ea'+set}'`\" = set"; then
4079  echo $ac_n "(cached) $ac_c" 1>&6
4080else
4081  LBL_SAVE_CFLAGS="$CFLAGS"
4082    CFLAGS="$CFLAGS $V_INCLS"
4083    cat > conftest.$ac_ext <<EOF
4084#line 4085 "configure"
4085#include "confdefs.h"
4086
4087#	include <sys/types.h>
4088#	if __STDC__
4089	/* osf3 has REALLY good prototyes */
4090	struct mbuf;
4091	struct rtentry;
4092#	endif
4093#	include <sys/socket.h>
4094#	include <net/if.h>
4095#	include <netinet/in.h>
4096#	include <netinet/if_ether.h>
4097int main() {
4098u_int i =
4099	    sizeof(((struct ether_header *)0)->ether_dhost.ether_addr_octet)
4100; return 0; }
4101EOF
4102if { (eval echo configure:4103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4103  rm -rf conftest*
4104  ac_cv_ether_header_has_ea=yes
4105else
4106  echo "configure: failed program was:" >&5
4107  cat conftest.$ac_ext >&5
4108  rm -rf conftest*
4109  ac_cv_ether_header_has_ea=no
4110fi
4111rm -f conftest*
4112    CFLAGS="$LBL_SAVE_CFLAGS"
4113fi
4114
4115echo "$ac_t""$ac_cv_ether_header_has_ea" 1>&6
4116if test $ac_cv_ether_header_has_ea = yes ; then
4117	cat >> confdefs.h <<\EOF
4118#define ETHER_HEADER_HAS_EA 1
4119EOF
4120
4121fi
4122
4123echo $ac_n "checking if ether_arp uses ether_addr structs""... $ac_c" 1>&6
4124echo "configure:4125: checking if ether_arp uses ether_addr structs" >&5
4125if eval "test \"`echo '$''{'ac_cv_ether_arp_has_ea'+set}'`\" = set"; then
4126  echo $ac_n "(cached) $ac_c" 1>&6
4127else
4128  LBL_SAVE_CFLAGS="$CFLAGS"
4129    CFLAGS="$CFLAGS $V_INCLS"
4130    cat > conftest.$ac_ext <<EOF
4131#line 4132 "configure"
4132#include "confdefs.h"
4133
4134#	include <sys/types.h>
4135#	if __STDC__
4136	/* osf3 has REALLY good prototyes */
4137	struct mbuf;
4138	struct rtentry;
4139#	endif
4140#	include <sys/socket.h>
4141#	include <net/if.h>
4142#	include <netinet/in.h>
4143#	include <netinet/if_ether.h>
4144int main() {
4145u_int i =
4146	    sizeof(((struct ether_arp *)0)->arp_sha.ether_addr_octet)
4147; return 0; }
4148EOF
4149if { (eval echo configure:4150: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4150  rm -rf conftest*
4151  ac_cv_ether_arp_has_ea=yes
4152else
4153  echo "configure: failed program was:" >&5
4154  cat conftest.$ac_ext >&5
4155  rm -rf conftest*
4156  ac_cv_ether_arp_has_ea=no
4157fi
4158rm -f conftest*
4159    CFLAGS="$LBL_SAVE_CFLAGS"
4160fi
4161
4162echo "$ac_t""$ac_cv_ether_arp_has_ea" 1>&6
4163if test $ac_cv_ether_arp_has_ea = yes ; then
4164	cat >> confdefs.h <<\EOF
4165#define ETHER_ARP_HAS_EA 1
4166EOF
4167
4168fi
4169
4170echo $ac_n "checking if ether_arp uses erp_xsha member""... $ac_c" 1>&6
4171echo "configure:4172: checking if ether_arp uses erp_xsha member" >&5
4172if eval "test \"`echo '$''{'ac_cv_struct_ether_arp_x'+set}'`\" = set"; then
4173  echo $ac_n "(cached) $ac_c" 1>&6
4174else
4175  LBL_SAVE_CFLAGS="$CFLAGS"
4176    CFLAGS="$CFLAGS $V_INCLS"
4177    cat > conftest.$ac_ext <<EOF
4178#line 4179 "configure"
4179#include "confdefs.h"
4180
4181#	include <sys/types.h>
4182#	include <sys/socket.h>
4183#	if __STDC__
4184	/* osf3 has REALLY good prototyes */
4185	struct mbuf;
4186	struct rtentry;
4187#	endif
4188#	include <net/if.h>
4189#	include <netinet/in.h>
4190#	include <netinet/if_ether.h>
4191int main() {
4192u_int i = sizeof( ((struct ether_arp *)0)->arp_xsha)
4193; return 0; }
4194EOF
4195if { (eval echo configure:4196: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4196  rm -rf conftest*
4197  ac_cv_struct_ether_arp_x=yes
4198else
4199  echo "configure: failed program was:" >&5
4200  cat conftest.$ac_ext >&5
4201  rm -rf conftest*
4202  ac_cv_struct_ether_arp_x=no
4203fi
4204rm -f conftest*
4205    CFLAGS="$LBL_SAVE_CFLAGS"
4206fi
4207
4208echo "$ac_t""$ac_cv_struct_ether_arp_x" 1>&6
4209if test $ac_cv_struct_ether_arp_x = yes ; then
4210	cat >> confdefs.h <<\EOF
4211#define ETHER_ARP_HAS_X 1
4212EOF
4213
4214fi
4215
4216echo $ac_n "checking if unaligned accesses fail""... $ac_c" 1>&6
4217echo "configure:4218: checking if unaligned accesses fail" >&5
4218    if eval "test \"`echo '$''{'ac_cv_lbl_unaligned_fail'+set}'`\" = set"; then
4219  echo $ac_n "(cached) $ac_c" 1>&6
4220else
4221  case "$target_cpu" in
4222
4223	alpha|hp*|mips|sparc)
4224		ac_cv_lbl_unaligned_fail=yes
4225		;;
4226
4227	*)
4228		cat >conftest.c <<EOF
4229#		include <sys/types.h>
4230#		include <sys/wait.h>
4231#		include <stdio.h>
4232		unsigned char a[5] = { 1, 2, 3, 4, 5 };
4233		main() {
4234		unsigned int i;
4235		pid_t pid;
4236		int status;
4237		/* avoid "core dumped" message */
4238		pid = fork();
4239		if (pid <  0)
4240			exit(2);
4241		if (pid > 0) {
4242			/* parent */
4243			pid = waitpid(pid, &status, 0);
4244			if (pid < 0)
4245				exit(3);
4246			exit(!WIFEXITED(status));
4247		}
4248		/* child */
4249		i = *(unsigned int *)&a[1];
4250		printf("%d\n", i);
4251		exit(0);
4252		}
4253EOF
4254		${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS \
4255		    conftest.c $LIBS >/dev/null 2>&1
4256		if test ! -x conftest ; then
4257						ac_cv_lbl_unaligned_fail=yes
4258		else
4259			./conftest >conftest.out
4260			if test ! -s conftest.out ; then
4261				ac_cv_lbl_unaligned_fail=yes
4262			else
4263				ac_cv_lbl_unaligned_fail=no
4264			fi
4265		fi
4266		rm -f conftest* core core.conftest
4267		;;
4268	esac
4269fi
4270
4271    echo "$ac_t""$ac_cv_lbl_unaligned_fail" 1>&6
4272    if test $ac_cv_lbl_unaligned_fail = yes ; then
4273	    cat >> confdefs.h <<\EOF
4274#define LBL_ALIGN 1
4275EOF
4276
4277    fi
4278
4279
4280	echo $ac_n "checking for h_errno""... $ac_c" 1>&6
4281echo "configure:4282: checking for h_errno" >&5
4282	if eval "test \"`echo '$''{'ac_cv_var_h_errno'+set}'`\" = set"; then
4283  echo $ac_n "(cached) $ac_c" 1>&6
4284else
4285  cat > conftest.$ac_ext <<EOF
4286#line 4287 "configure"
4287#include "confdefs.h"
4288
4289#		include <sys/types.h>
4290#		include <netdb.h>
4291int main() {
4292int foo = h_errno;
4293; return 0; }
4294EOF
4295if { (eval echo configure:4296: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4296  rm -rf conftest*
4297  ac_cv_var_h_errno=yes
4298else
4299  echo "configure: failed program was:" >&5
4300  cat conftest.$ac_ext >&5
4301  rm -rf conftest*
4302  ac_cv_var_h_errno=no
4303fi
4304rm -f conftest*
4305fi
4306
4307	echo "$ac_t""$ac_cv_var_h_errno" 1>&6
4308	if test "$ac_cv_var_h_errno" = "yes"; then
4309		cat >> confdefs.h <<\EOF
4310#define HAVE_H_ERRNO 1
4311EOF
4312
4313	fi
4314
4315
4316echo $ac_n "checking for SSLeay""... $ac_c" 1>&6
4317echo "configure:4318: checking for SSLeay" >&5
4318ac_cv_ssleay_path=no
4319incdir=no
4320for dir in /usr/local /usr/local/ssl /usr/pkg; do
4321	if test -d $dir/lib -a -f $dir/lib/libcrypto.a; then
4322		ac_cv_ssleay_path=$dir
4323	fi
4324	if test -d $dir/include -a -f $dir/include/des.h; then
4325		incdir="-I$dir/include"
4326	else
4327		if test -d $dir/include/ssleay -a -f $dir/include/ssleay/des.h; then
4328			incdir="-I$dir/include/ssleay"
4329		elif test -d $dir/include/openssl -a -f $dir/include/openssl/des.h; then
4330			incdir="-I$dir/include -I$dir/include/openssl"
4331		fi
4332	fi
4333	if test "$ac_cv_ssleay_path" != "no" -a "$incdir" != "no"; then
4334		break;
4335	else
4336		ac_cv_ssleay_path=no
4337		incdir=no
4338	fi
4339done
4340echo "$ac_t""$ac_cv_ssleay_path" 1>&6
4341if test "$ac_cv_ssleay_path" != no; then
4342	V_INCLS="$V_INCLS $incdir"
4343	LIBS="$LIBS -L$dir/lib"
4344	if test -f $ac_cv_ssleay_path/lib/libRSAglue.a; then
4345		LIBS="$LIBS -lRSAglue"
4346	fi
4347	if test -f $ac_cv_ssleay_path/lib/librsaref.a; then
4348		LIBS="$LIBS -lrsaref"
4349	fi
4350	echo $ac_n "checking for des_cbc_encrypt in -lcrypto""... $ac_c" 1>&6
4351echo "configure:4352: checking for des_cbc_encrypt in -lcrypto" >&5
4352ac_lib_var=`echo crypto'_'des_cbc_encrypt | sed 'y%./+-%__p_%'`
4353if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4354  echo $ac_n "(cached) $ac_c" 1>&6
4355else
4356  ac_save_LIBS="$LIBS"
4357LIBS="-lcrypto  $LIBS"
4358cat > conftest.$ac_ext <<EOF
4359#line 4360 "configure"
4360#include "confdefs.h"
4361/* Override any gcc2 internal prototype to avoid an error.  */
4362/* We use char because int might match the return type of a gcc2
4363    builtin and then its argument prototype would still apply.  */
4364char des_cbc_encrypt();
4365
4366int main() {
4367des_cbc_encrypt()
4368; return 0; }
4369EOF
4370if { (eval echo configure:4371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4371  rm -rf conftest*
4372  eval "ac_cv_lib_$ac_lib_var=yes"
4373else
4374  echo "configure: failed program was:" >&5
4375  cat conftest.$ac_ext >&5
4376  rm -rf conftest*
4377  eval "ac_cv_lib_$ac_lib_var=no"
4378fi
4379rm -f conftest*
4380LIBS="$ac_save_LIBS"
4381
4382fi
4383if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4384  echo "$ac_t""yes" 1>&6
4385    ac_tr_lib=HAVE_LIB`echo crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4386    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4387  cat >> confdefs.h <<EOF
4388#define $ac_tr_lib 1
4389EOF
4390
4391  LIBS="-lcrypto $LIBS"
4392
4393else
4394  echo "$ac_t""no" 1>&6
4395fi
4396
4397	cat >> confdefs.h <<\EOF
4398#define CRYPTO 1
4399EOF
4400
4401
4402	bak_CPPFLAGS=$CPPFLAGS
4403	CPPFLAGS="$CPPFLAGS $V_INCLS"
4404	for ac_hdr in cast.h rc5.h
4405do
4406ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4407echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4408echo "configure:4409: checking for $ac_hdr" >&5
4409if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4410  echo $ac_n "(cached) $ac_c" 1>&6
4411else
4412  cat > conftest.$ac_ext <<EOF
4413#line 4414 "configure"
4414#include "confdefs.h"
4415#include <$ac_hdr>
4416EOF
4417ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4418{ (eval echo configure:4419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4419ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4420if test -z "$ac_err"; then
4421  rm -rf conftest*
4422  eval "ac_cv_header_$ac_safe=yes"
4423else
4424  echo "$ac_err" >&5
4425  echo "configure: failed program was:" >&5
4426  cat conftest.$ac_ext >&5
4427  rm -rf conftest*
4428  eval "ac_cv_header_$ac_safe=no"
4429fi
4430rm -f conftest*
4431fi
4432if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4433  echo "$ac_t""yes" 1>&6
4434    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4435  cat >> confdefs.h <<EOF
4436#define $ac_tr_hdr 1
4437EOF
4438
4439else
4440  echo "$ac_t""no" 1>&6
4441fi
4442done
4443
4444
4445	if test "$ac_cv_header_cast_h" = "yes"; then
4446		echo $ac_n "checking for buggy CAST128""... $ac_c" 1>&6
4447echo "configure:4448: checking for buggy CAST128" >&5
4448		if test "$cross_compiling" = yes; then
4449  buggy_cast128="cross-compiling, assume yes"
4450else
4451  cat > conftest.$ac_ext <<EOF
4452#line 4453 "configure"
4453#include "confdefs.h"
4454
4455#include <cast.h>
4456main()
4457{
4458	unsigned char key[] = {0x01,0x23,0x45,0x67,0x12};
4459	unsigned char in[] = {0x01,0x23,0x45,0x67,0x89,0xAB,0xCD,0xEF};
4460	unsigned char out[sizeof(in)];
4461	unsigned char ok[] = {0x7A,0xC8,0x16,0xD1,0x6E,0x9B,0x30,0x2E};
4462	CAST_KEY ks;
4463	CAST_set_key(&ks, sizeof(key), key);
4464	CAST_ecb_encrypt(in, out, &ks, CAST_ENCRYPT);
4465	if (memcmp(out, ok, sizeof(ok)) != 0)
4466		return 0;
4467	else
4468		return 1;
4469}
4470EOF
4471if { (eval echo configure:4472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4472then
4473  buggy_cast128=yes
4474else
4475  echo "configure: failed program was:" >&5
4476  cat conftest.$ac_ext >&5
4477  rm -fr conftest*
4478  buggy_cast128=no
4479fi
4480rm -fr conftest*
4481fi
4482
4483		echo "$ac_t""$buggy_cast128" 1>&6
4484		if test "$buggy_cast128" != no; then
4485			echo "NOTE: SSLeay 0.9.0b has a bug in CAST128 en/decoding routine."
4486			echo "disabling CAST128 support."
4487			cat >> confdefs.h <<\EOF
4488#define HAVE_BUGGY_CAST128 1
4489EOF
4490
4491		fi
4492	fi
4493
4494	CPPFLAGS=$bak_CPPFLAGS
4495fi
4496
4497if test -r ${srcdir}/lbl/gnuc.h ; then
4498	rm -f gnuc.h
4499	ln -s ${srcdir}/lbl/gnuc.h gnuc.h
4500fi
4501
4502
4503
4504
4505
4506
4507
4508# Find a good install program.  We prefer a C program (faster),
4509# so one script is as good as another.  But avoid the broken or
4510# incompatible versions:
4511# SysV /etc/install, /usr/sbin/install
4512# SunOS /usr/etc/install
4513# IRIX /sbin/install
4514# AIX /bin/install
4515# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
4516# AFS /usr/afsws/bin/install, which mishandles nonexistent args
4517# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
4518# ./install, which can be erroneously created by make from ./install.sh.
4519echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
4520echo "configure:4521: checking for a BSD compatible install" >&5
4521if test -z "$INSTALL"; then
4522if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
4523  echo $ac_n "(cached) $ac_c" 1>&6
4524else
4525    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
4526  for ac_dir in $PATH; do
4527    # Account for people who put trailing slashes in PATH elements.
4528    case "$ac_dir/" in
4529    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
4530    *)
4531      # OSF1 and SCO ODT 3.0 have their own names for install.
4532      # Don't use installbsd from OSF since it installs stuff as root
4533      # by default.
4534      for ac_prog in ginstall scoinst install; do
4535        if test -f $ac_dir/$ac_prog; then
4536	  if test $ac_prog = install &&
4537            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
4538	    # AIX install.  It has an incompatible calling convention.
4539	    :
4540	  else
4541	    ac_cv_path_install="$ac_dir/$ac_prog -c"
4542	    break 2
4543	  fi
4544	fi
4545      done
4546      ;;
4547    esac
4548  done
4549  IFS="$ac_save_IFS"
4550
4551fi
4552  if test "${ac_cv_path_install+set}" = set; then
4553    INSTALL="$ac_cv_path_install"
4554  else
4555    # As a last resort, use the slow shell script.  We don't cache a
4556    # path for INSTALL within a source directory, because that will
4557    # break other packages using the cache if that directory is
4558    # removed, or if the path is relative.
4559    INSTALL="$ac_install_sh"
4560  fi
4561fi
4562echo "$ac_t""$INSTALL" 1>&6
4563
4564# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
4565# It thinks the first close brace ends the variable substitution.
4566test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
4567
4568test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
4569
4570test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
4571
4572
4573
4574
4575trap '' 1 2 15
4576cat > confcache <<\EOF
4577# This file is a shell script that caches the results of configure
4578# tests run on this system so they can be shared between configure
4579# scripts and configure runs.  It is not useful on other systems.
4580# If it contains results you don't want to keep, you may remove or edit it.
4581#
4582# By default, configure uses ./config.cache as the cache file,
4583# creating it if it does not exist already.  You can give configure
4584# the --cache-file=FILE option to use a different cache file; that is
4585# what configure does when it calls configure scripts in
4586# subdirectories, so they share the cache.
4587# Giving --cache-file=/dev/null disables caching, for debugging configure.
4588# config.status only pays attention to the cache file if you give it the
4589# --recheck option to rerun configure.
4590#
4591EOF
4592# The following way of writing the cache mishandles newlines in values,
4593# but we know of no workaround that is simple, portable, and efficient.
4594# So, don't put newlines in cache variables' values.
4595# Ultrix sh set writes to stderr and can't be redirected directly,
4596# and sets the high bit in the cache file unless we assign to the vars.
4597(set) 2>&1 |
4598  case `(ac_space=' '; set | grep ac_space) 2>&1` in
4599  *ac_space=\ *)
4600    # `set' does not quote correctly, so add quotes (double-quote substitution
4601    # turns \\\\ into \\, and sed turns \\ into \).
4602    sed -n \
4603      -e "s/'/'\\\\''/g" \
4604      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
4605    ;;
4606  *)
4607    # `set' quotes correctly as required by POSIX, so do not add quotes.
4608    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
4609    ;;
4610  esac >> confcache
4611if cmp -s $cache_file confcache; then
4612  :
4613else
4614  if test -w $cache_file; then
4615    echo "updating cache $cache_file"
4616    cat confcache > $cache_file
4617  else
4618    echo "not updating unwritable cache $cache_file"
4619  fi
4620fi
4621rm -f confcache
4622
4623trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
4624
4625test "x$prefix" = xNONE && prefix=$ac_default_prefix
4626# Let make expand exec_prefix.
4627test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
4628
4629# Any assignment to VPATH causes Sun make to only execute
4630# the first set of double-colon rules, so remove it if not needed.
4631# If there is a colon in the path, we need to keep it.
4632if test "x$srcdir" = x.; then
4633  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
4634fi
4635
4636trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
4637
4638DEFS=-DHAVE_CONFIG_H
4639
4640# Without the "./", some shells look in PATH for config.status.
4641: ${CONFIG_STATUS=./config.status}
4642
4643echo creating $CONFIG_STATUS
4644rm -f $CONFIG_STATUS
4645cat > $CONFIG_STATUS <<EOF
4646#! /bin/sh
4647# Generated automatically by configure.
4648# Run this file to recreate the current configuration.
4649# This directory was configured as follows,
4650# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
4651#
4652# $0 $ac_configure_args
4653#
4654# Compiler output produced by configure, useful for debugging
4655# configure, is in ./config.log if it exists.
4656
4657ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
4658for ac_option
4659do
4660  case "\$ac_option" in
4661  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
4662    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
4663    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
4664  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
4665    echo "$CONFIG_STATUS generated by autoconf version 2.13"
4666    exit 0 ;;
4667  -help | --help | --hel | --he | --h)
4668    echo "\$ac_cs_usage"; exit 0 ;;
4669  *) echo "\$ac_cs_usage"; exit 1 ;;
4670  esac
4671done
4672
4673ac_given_srcdir=$srcdir
4674ac_given_INSTALL="$INSTALL"
4675
4676trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
4677EOF
4678cat >> $CONFIG_STATUS <<EOF
4679
4680# Protect against being on the right side of a sed subst in config.status.
4681sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
4682 s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
4683$ac_vpsub
4684$extrasub
4685s%@SHELL@%$SHELL%g
4686s%@CFLAGS@%$CFLAGS%g
4687s%@CPPFLAGS@%$CPPFLAGS%g
4688s%@CXXFLAGS@%$CXXFLAGS%g
4689s%@FFLAGS@%$FFLAGS%g
4690s%@DEFS@%$DEFS%g
4691s%@LDFLAGS@%$LDFLAGS%g
4692s%@LIBS@%$LIBS%g
4693s%@exec_prefix@%$exec_prefix%g
4694s%@prefix@%$prefix%g
4695s%@program_transform_name@%$program_transform_name%g
4696s%@bindir@%$bindir%g
4697s%@sbindir@%$sbindir%g
4698s%@libexecdir@%$libexecdir%g
4699s%@datadir@%$datadir%g
4700s%@sysconfdir@%$sysconfdir%g
4701s%@sharedstatedir@%$sharedstatedir%g
4702s%@localstatedir@%$localstatedir%g
4703s%@libdir@%$libdir%g
4704s%@includedir@%$includedir%g
4705s%@oldincludedir@%$oldincludedir%g
4706s%@infodir@%$infodir%g
4707s%@mandir@%$mandir%g
4708s%@host@%$host%g
4709s%@host_alias@%$host_alias%g
4710s%@host_cpu@%$host_cpu%g
4711s%@host_vendor@%$host_vendor%g
4712s%@host_os@%$host_os%g
4713s%@target@%$target%g
4714s%@target_alias@%$target_alias%g
4715s%@target_cpu@%$target_cpu%g
4716s%@target_vendor@%$target_vendor%g
4717s%@target_os@%$target_os%g
4718s%@build@%$build%g
4719s%@build_alias@%$build_alias%g
4720s%@build_cpu@%$build_cpu%g
4721s%@build_vendor@%$build_vendor%g
4722s%@build_os@%$build_os%g
4723s%@SHLICC2@%$SHLICC2%g
4724s%@CC@%$CC%g
4725s%@CPP@%$CPP%g
4726s%@LIBOBJS@%$LIBOBJS%g
4727s%@V_CCOPT@%$V_CCOPT%g
4728s%@V_GROUP@%$V_GROUP%g
4729s%@V_INCLS@%$V_INCLS%g
4730s%@V_PCAPDEP@%$V_PCAPDEP%g
4731s%@LOCALSRC@%$LOCALSRC%g
4732s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
4733s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
4734s%@INSTALL_DATA@%$INSTALL_DATA%g
4735
4736CEOF
4737EOF
4738
4739cat >> $CONFIG_STATUS <<\EOF
4740
4741# Split the substitutions into bite-sized pieces for seds with
4742# small command number limits, like on Digital OSF/1 and HP-UX.
4743ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
4744ac_file=1 # Number of current file.
4745ac_beg=1 # First line for current file.
4746ac_end=$ac_max_sed_cmds # Line after last line for current file.
4747ac_more_lines=:
4748ac_sed_cmds=""
4749while $ac_more_lines; do
4750  if test $ac_beg -gt 1; then
4751    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
4752  else
4753    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
4754  fi
4755  if test ! -s conftest.s$ac_file; then
4756    ac_more_lines=false
4757    rm -f conftest.s$ac_file
4758  else
4759    if test -z "$ac_sed_cmds"; then
4760      ac_sed_cmds="sed -f conftest.s$ac_file"
4761    else
4762      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
4763    fi
4764    ac_file=`expr $ac_file + 1`
4765    ac_beg=$ac_end
4766    ac_end=`expr $ac_end + $ac_max_sed_cmds`
4767  fi
4768done
4769if test -z "$ac_sed_cmds"; then
4770  ac_sed_cmds=cat
4771fi
4772EOF
4773
4774cat >> $CONFIG_STATUS <<EOF
4775
4776CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
4777EOF
4778cat >> $CONFIG_STATUS <<\EOF
4779for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
4780  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4781  case "$ac_file" in
4782  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
4783       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
4784  *) ac_file_in="${ac_file}.in" ;;
4785  esac
4786
4787  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
4788
4789  # Remove last slash and all that follows it.  Not all systems have dirname.
4790  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
4791  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4792    # The file is in a subdirectory.
4793    test ! -d "$ac_dir" && mkdir "$ac_dir"
4794    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
4795    # A "../" for each directory in $ac_dir_suffix.
4796    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
4797  else
4798    ac_dir_suffix= ac_dots=
4799  fi
4800
4801  case "$ac_given_srcdir" in
4802  .)  srcdir=.
4803      if test -z "$ac_dots"; then top_srcdir=.
4804      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
4805  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
4806  *) # Relative path.
4807    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
4808    top_srcdir="$ac_dots$ac_given_srcdir" ;;
4809  esac
4810
4811  case "$ac_given_INSTALL" in
4812  [/$]*) INSTALL="$ac_given_INSTALL" ;;
4813  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
4814  esac
4815
4816  echo creating "$ac_file"
4817  rm -f "$ac_file"
4818  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
4819  case "$ac_file" in
4820  *Makefile*) ac_comsub="1i\\
4821# $configure_input" ;;
4822  *) ac_comsub= ;;
4823  esac
4824
4825  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
4826  sed -e "$ac_comsub
4827s%@configure_input@%$configure_input%g
4828s%@srcdir@%$srcdir%g
4829s%@top_srcdir@%$top_srcdir%g
4830s%@INSTALL@%$INSTALL%g
4831" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
4832fi; done
4833rm -f conftest.s*
4834
4835# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
4836# NAME is the cpp macro being defined and VALUE is the value it is being given.
4837#
4838# ac_d sets the value in "#define NAME VALUE" lines.
4839ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
4840ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
4841ac_dC='\3'
4842ac_dD='%g'
4843# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
4844ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
4845ac_uB='\([ 	]\)%\1#\2define\3'
4846ac_uC=' '
4847ac_uD='\4%g'
4848# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
4849ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
4850ac_eB='$%\1#\2define\3'
4851ac_eC=' '
4852ac_eD='%g'
4853
4854if test "${CONFIG_HEADERS+set}" != set; then
4855EOF
4856cat >> $CONFIG_STATUS <<EOF
4857  CONFIG_HEADERS="config.h"
4858EOF
4859cat >> $CONFIG_STATUS <<\EOF
4860fi
4861for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
4862  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
4863  case "$ac_file" in
4864  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
4865       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
4866  *) ac_file_in="${ac_file}.in" ;;
4867  esac
4868
4869  echo creating $ac_file
4870
4871  rm -f conftest.frag conftest.in conftest.out
4872  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
4873  cat $ac_file_inputs > conftest.in
4874
4875EOF
4876
4877# Transform confdefs.h into a sed script conftest.vals that substitutes
4878# the proper values into config.h.in to produce config.h.  And first:
4879# Protect against being on the right side of a sed subst in config.status.
4880# Protect against being in an unquoted here document in config.status.
4881rm -f conftest.vals
4882cat > conftest.hdr <<\EOF
4883s/[\\&%]/\\&/g
4884s%[\\$`]%\\&%g
4885s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
4886s%ac_d%ac_u%gp
4887s%ac_u%ac_e%gp
4888EOF
4889sed -n -f conftest.hdr confdefs.h > conftest.vals
4890rm -f conftest.hdr
4891
4892# This sed command replaces #undef with comments.  This is necessary, for
4893# example, in the case of _POSIX_SOURCE, which is predefined and required
4894# on some systems where configure will not decide to define it.
4895cat >> conftest.vals <<\EOF
4896s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
4897EOF
4898
4899# Break up conftest.vals because some shells have a limit on
4900# the size of here documents, and old seds have small limits too.
4901
4902rm -f conftest.tail
4903while :
4904do
4905  ac_lines=`grep -c . conftest.vals`
4906  # grep -c gives empty output for an empty file on some AIX systems.
4907  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
4908  # Write a limited-size here document to conftest.frag.
4909  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
4910  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
4911  echo 'CEOF
4912  sed -f conftest.frag conftest.in > conftest.out
4913  rm -f conftest.in
4914  mv conftest.out conftest.in
4915' >> $CONFIG_STATUS
4916  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
4917  rm -f conftest.vals
4918  mv conftest.tail conftest.vals
4919done
4920rm -f conftest.vals
4921
4922cat >> $CONFIG_STATUS <<\EOF
4923  rm -f conftest.frag conftest.h
4924  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
4925  cat conftest.in >> conftest.h
4926  rm -f conftest.in
4927  if cmp -s $ac_file conftest.h 2>/dev/null; then
4928    echo "$ac_file is unchanged"
4929    rm -f conftest.h
4930  else
4931    # Remove last slash and all that follows it.  Not all systems have dirname.
4932      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
4933      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
4934      # The file is in a subdirectory.
4935      test ! -d "$ac_dir" && mkdir "$ac_dir"
4936    fi
4937    rm -f $ac_file
4938    mv conftest.h $ac_file
4939  fi
4940fi; done
4941
4942EOF
4943cat >> $CONFIG_STATUS <<EOF
4944
4945EOF
4946cat >> $CONFIG_STATUS <<\EOF
4947
4948exit 0
4949EOF
4950chmod +x $CONFIG_STATUS
4951rm -fr confdefs* $ac_clean_files
4952test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
4953
4954
4955if test -f .devel ; then
4956	make depend
4957fi
4958exit 0
4959