]> git.sur5r.net Git - openldap/blob - configure
6037bab146f63bfab1a933823107fcf6b7ed7538
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP 
4
5 # Copyright 1998-2001 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms are permitted only
8 # as authorized by the OpenLDAP Public License.  A copy of this
9 # license is available at http://www.OpenLDAP.org/license.html or
10 # in file LICENSE in the top-level directory of the distribution.
11
12 echo "Copyright 1998-2001 The OpenLDAP Foundation,  All Rights Reserved."
13 echo "Restrictions apply, see COPYRIGHT and LICENSE files."
14
15 # Guess values for system-dependent variables and create Makefiles.
16 # Generated automatically using autoconf version 2.13.1 
17 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
18 #
19 # This configure script is free software; the Free Software Foundation
20 # gives unlimited permission to copy, distribute and modify it.
21
22 # Defaults:
23 ac_help=
24 ac_default_prefix=/usr/local
25 # Any additions from configure.in:
26 ac_default_prefix=/usr/local
27 ac_help="$ac_help
28   --with-subdir=DIR       change default subdirectory used for installs"
29 ac_help="$ac_help
30   --enable-debug          enable debugging [yes]"
31 ac_help="$ac_help
32   --enable-syslog         enable syslog support [auto]"
33 ac_help="$ac_help
34   --enable-proctitle      enable proctitle support [yes]"
35 ac_help="$ac_help
36   --enable-cache          enable caching [yes]"
37 ac_help="$ac_help
38   --enable-referrals      enable V2 Referrals extension [yes]"
39 ac_help="$ac_help
40   --enable-kbind          enable V2 Kerberos IV bind [no]"
41 ac_help="$ac_help
42   --enable-ipv6           enable IPv6 support [auto]"
43 ac_help="$ac_help
44   --enable-local          enable AF_LOCAL (AF_UNIX) socket support [auto]"
45 ac_help="$ac_help
46   --enable-x-compile      enable cross compiling [no]"
47 ac_help="$ac_help
48   --with-cyrus-sasl       with Cyrus SASL support [auto]"
49 ac_help="$ac_help
50   --with-fetch            with fetch URL support [auto]"
51 ac_help="$ac_help
52   --with-kerberos         with support [auto]"
53 ac_help="$ac_help
54   --with-readline         with readline support [auto]"
55 ac_help="$ac_help
56   --with-threads          with threads [auto]"
57 ac_help="$ac_help
58   --with-tls              with TLS/SSL support [auto]"
59 ac_help="$ac_help
60   --with-yielding-select  with implicitly yielding select [auto]"
61 ac_help="$ac_help
62 SLAPD (Standalone LDAP Daemon) Options:"
63 ac_help="$ac_help
64   --enable-slapd          enable building slapd [yes]"
65 ac_help="$ac_help
66     --enable-cleartext    enable cleartext passwords [yes]"
67 ac_help="$ac_help
68     --enable-crypt        enable crypt(3) passwords [auto]"
69 ac_help="$ac_help
70     --enable-kpasswd      enable kerberos password verification [no]"
71 ac_help="$ac_help
72     --enable-spasswd      enable (Cyrus) SASL password verification [no]"
73 ac_help="$ac_help
74     --enable-modules      enable dynamic module support [no]"
75 ac_help="$ac_help
76     --enable-phonetic     enable phonetic/soundex [no]"
77 ac_help="$ac_help
78     --enable-rlookups     enable reverse lookups [no]"
79 ac_help="$ac_help
80     --enable-aci          enable per-object ACIs [no]"
81 ac_help="$ac_help
82     --enable-wrappers     enable tcp wrapper support [no]"
83 ac_help="$ac_help
84     --enable-dynamic      enable linking built binaries with dynamic libs [no]"
85 ac_help="$ac_help
86     --enable-dnssrv       enable dnssrv backend [no]"
87 ac_help="$ac_help
88     --with-dnssrv-module  module type [static]"
89 ac_help="$ac_help
90     --enable-ldap         enable ldap backend [no]"
91 ac_help="$ac_help
92     --with-ldap-module    module type [static]"
93 ac_help="$ac_help
94     --enable-ldbm         enable ldbm backend [yes]"
95 ac_help="$ac_help
96     --with-ldbm-api       with LDBM API [auto]"
97 ac_help="$ac_help
98     --with-ldbm-module    module type [static]"
99 ac_help="$ac_help
100     --with-ldbm-type      use LDBM type [auto]"
101 ac_help="$ac_help
102     --enable-passwd       enable passwd backend [no]"
103 ac_help="$ac_help
104     --with-passwd-module  module type [static]"
105 ac_help="$ac_help
106     --enable-shell        enable shell backend [no]"
107 ac_help="$ac_help
108     --with-shell-module   module type [static]"
109 ac_help="$ac_help
110     --enable-sql          enable sql backend [no]"
111 ac_help="$ac_help
112     --with-sql-module     module type [static]"
113 ac_help="$ac_help
114 SLURPD (Replication Daemon) Options:"
115 ac_help="$ac_help
116   --enable-slurpd         enable building slurpd [auto]"
117 ac_help="$ac_help
118 Library Generation & Linking Options"
119 ac_help="$ac_help
120   --enable-static[=PKGS]  build static libraries [default=yes]"
121 ac_help="$ac_help
122   --enable-shared[=PKGS]  build shared libraries [default=yes]"
123 ac_help="$ac_help
124   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
125 ac_help="$ac_help
126   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
127 ac_help="$ac_help
128   --disable-libtool-lock  avoid locking (might break parallel builds)"
129
130 # Initialize some variables set by options.
131 # The variables have the same names as the options, with
132 # dashes changed to underlines.
133 build=NONE
134 cache_file=./config.cache
135 exec_prefix=NONE
136 host=NONE
137 no_create=
138 nonopt=NONE
139 no_recursion=
140 prefix=NONE
141 program_prefix=NONE
142 program_suffix=NONE
143 program_transform_name=s,x,x,
144 silent=
145 site=
146 srcdir=
147 target=NONE
148 verbose=
149 x_includes=NONE
150 x_libraries=NONE
151 bindir='${exec_prefix}/bin'
152 sbindir='${exec_prefix}/sbin'
153 libexecdir='${exec_prefix}/libexec'
154 datadir='${prefix}/share'
155 sysconfdir='${prefix}/etc'
156 sharedstatedir='${prefix}/com'
157 localstatedir='${prefix}/var'
158 libdir='${exec_prefix}/lib'
159 includedir='${prefix}/include'
160 oldincludedir='/usr/include'
161 infodir='${prefix}/info'
162 mandir='${prefix}/man'
163
164 # Initialize some other variables.
165 subdirs=
166 MFLAGS= MAKEFLAGS=
167 SHELL=${CONFIG_SHELL-/bin/sh}
168 # Maximum number of lines to put in a shell here document.
169 ac_max_here_lines=12
170
171 ac_prev=
172 for ac_option
173 do
174
175   # If the previous option needs an argument, assign it.
176   if test -n "$ac_prev"; then
177     eval "$ac_prev=\$ac_option"
178     ac_prev=
179     continue
180   fi
181
182   case "$ac_option" in
183   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
184   *) ac_optarg= ;;
185   esac
186
187   # Accept the important Cygnus configure options, so we can diagnose typos.
188
189   case "$ac_option" in
190
191   -bindir | --bindir | --bindi | --bind | --bin | --bi)
192     ac_prev=bindir ;;
193   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
194     bindir="$ac_optarg" ;;
195
196   -build | --build | --buil | --bui | --bu)
197     ac_prev=build ;;
198   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
199     build="$ac_optarg" ;;
200
201   -cache-file | --cache-file | --cache-fil | --cache-fi \
202   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
203     ac_prev=cache_file ;;
204   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
205   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
206     cache_file="$ac_optarg" ;;
207
208   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
209     ac_prev=datadir ;;
210   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
211   | --da=*)
212     datadir="$ac_optarg" ;;
213
214   -disable-* | --disable-*)
215     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
216     # Reject names that are not valid shell variable names.
217     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
218       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
219     fi
220     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
221     eval "enable_${ac_feature}=no" ;;
222
223   -enable-* | --enable-*)
224     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
225     # Reject names that are not valid shell variable names.
226     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
227       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
228     fi
229     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
230     case "$ac_option" in
231       *=*) ;;
232       *) ac_optarg=yes ;;
233     esac
234     eval "enable_${ac_feature}='$ac_optarg'" ;;
235
236   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
237   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
238   | --exec | --exe | --ex)
239     ac_prev=exec_prefix ;;
240   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
241   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
242   | --exec=* | --exe=* | --ex=*)
243     exec_prefix="$ac_optarg" ;;
244
245   -gas | --gas | --ga | --g)
246     # Obsolete; use --with-gas.
247     with_gas=yes ;;
248
249   -help | --help | --hel | --he)
250     # Omit some internal or obsolete options to make the list less imposing.
251     # This message is too long to be a string in the A/UX 3.1 sh.
252     cat << EOF
253 Usage: configure [options] [host]
254 Options: [defaults in brackets after descriptions]
255 Configuration:
256   --cache-file=FILE       cache test results in FILE
257   --help                  print this message
258   --no-create             do not create output files
259   --quiet, --silent       do not print \`checking...' messages
260   --version               print the version of autoconf that created configure
261 Directory and file names:
262   --prefix=PREFIX         install architecture-independent files in PREFIX
263                           [$ac_default_prefix]
264   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
265                           [same as prefix]
266   --bindir=DIR            user executables in DIR [EPREFIX/bin]
267   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
268   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
269   --datadir=DIR           read-only architecture-independent data in DIR
270                           [PREFIX/share]
271   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
272   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
273                           [PREFIX/com]
274   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
275   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
276   --includedir=DIR        C header files in DIR [PREFIX/include]
277   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
278   --infodir=DIR           info documentation in DIR [PREFIX/info]
279   --mandir=DIR            man documentation in DIR [PREFIX/man]
280   --srcdir=DIR            find the sources in DIR [configure dir or ..]
281   --program-prefix=PREFIX prepend PREFIX to installed program names
282   --program-suffix=SUFFIX append SUFFIX to installed program names
283   --program-transform-name=PROGRAM
284                           run sed PROGRAM on installed program names
285 EOF
286     cat << EOF
287 Host type:
288   --build=BUILD           configure for building on BUILD [BUILD=HOST]
289   --host=HOST             configure for HOST [guessed]
290   --target=TARGET         configure for TARGET [TARGET=HOST]
291 Features and packages:
292   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
293   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
294   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
295   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
296   --x-includes=DIR        X include files are in DIR
297   --x-libraries=DIR       X library files are in DIR
298 EOF
299     if test -n "$ac_help"; then
300       echo "--enable and --with options recognized:$ac_help"
301     fi
302     exit 0 ;;
303
304   -host | --host | --hos | --ho)
305     ac_prev=host ;;
306   -host=* | --host=* | --hos=* | --ho=*)
307     host="$ac_optarg" ;;
308
309   -includedir | --includedir | --includedi | --included | --include \
310   | --includ | --inclu | --incl | --inc)
311     ac_prev=includedir ;;
312   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
313   | --includ=* | --inclu=* | --incl=* | --inc=*)
314     includedir="$ac_optarg" ;;
315
316   -infodir | --infodir | --infodi | --infod | --info | --inf)
317     ac_prev=infodir ;;
318   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
319     infodir="$ac_optarg" ;;
320
321   -libdir | --libdir | --libdi | --libd)
322     ac_prev=libdir ;;
323   -libdir=* | --libdir=* | --libdi=* | --libd=*)
324     libdir="$ac_optarg" ;;
325
326   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
327   | --libexe | --libex | --libe)
328     ac_prev=libexecdir ;;
329   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
330   | --libexe=* | --libex=* | --libe=*)
331     libexecdir="$ac_optarg" ;;
332
333   -localstatedir | --localstatedir | --localstatedi | --localstated \
334   | --localstate | --localstat | --localsta | --localst \
335   | --locals | --local | --loca | --loc | --lo)
336     ac_prev=localstatedir ;;
337   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
338   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
339   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
340     localstatedir="$ac_optarg" ;;
341
342   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
343     ac_prev=mandir ;;
344   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
345     mandir="$ac_optarg" ;;
346
347   -nfp | --nfp | --nf)
348     # Obsolete; use --without-fp.
349     with_fp=no ;;
350
351   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
352   | --no-cr | --no-c)
353     no_create=yes ;;
354
355   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
356   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
357     no_recursion=yes ;;
358
359   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
360   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
361   | --oldin | --oldi | --old | --ol | --o)
362     ac_prev=oldincludedir ;;
363   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
364   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
365   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
366     oldincludedir="$ac_optarg" ;;
367
368   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
369     ac_prev=prefix ;;
370   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
371     prefix="$ac_optarg" ;;
372
373   -program-prefix | --program-prefix | --program-prefi | --program-pref \
374   | --program-pre | --program-pr | --program-p)
375     ac_prev=program_prefix ;;
376   -program-prefix=* | --program-prefix=* | --program-prefi=* \
377   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
378     program_prefix="$ac_optarg" ;;
379
380   -program-suffix | --program-suffix | --program-suffi | --program-suff \
381   | --program-suf | --program-su | --program-s)
382     ac_prev=program_suffix ;;
383   -program-suffix=* | --program-suffix=* | --program-suffi=* \
384   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
385     program_suffix="$ac_optarg" ;;
386
387   -program-transform-name | --program-transform-name \
388   | --program-transform-nam | --program-transform-na \
389   | --program-transform-n | --program-transform- \
390   | --program-transform | --program-transfor \
391   | --program-transfo | --program-transf \
392   | --program-trans | --program-tran \
393   | --progr-tra | --program-tr | --program-t)
394     ac_prev=program_transform_name ;;
395   -program-transform-name=* | --program-transform-name=* \
396   | --program-transform-nam=* | --program-transform-na=* \
397   | --program-transform-n=* | --program-transform-=* \
398   | --program-transform=* | --program-transfor=* \
399   | --program-transfo=* | --program-transf=* \
400   | --program-trans=* | --program-tran=* \
401   | --progr-tra=* | --program-tr=* | --program-t=*)
402     program_transform_name="$ac_optarg" ;;
403
404   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
405   | -silent | --silent | --silen | --sile | --sil)
406     silent=yes ;;
407
408   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
409     ac_prev=sbindir ;;
410   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
411   | --sbi=* | --sb=*)
412     sbindir="$ac_optarg" ;;
413
414   -sharedstatedir | --sharedstatedir | --sharedstatedi \
415   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
416   | --sharedst | --shareds | --shared | --share | --shar \
417   | --sha | --sh)
418     ac_prev=sharedstatedir ;;
419   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
420   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
421   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
422   | --sha=* | --sh=*)
423     sharedstatedir="$ac_optarg" ;;
424
425   -site | --site | --sit)
426     ac_prev=site ;;
427   -site=* | --site=* | --sit=*)
428     site="$ac_optarg" ;;
429
430   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
431     ac_prev=srcdir ;;
432   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
433     srcdir="$ac_optarg" ;;
434
435   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
436   | --syscon | --sysco | --sysc | --sys | --sy)
437     ac_prev=sysconfdir ;;
438   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
439   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
440     sysconfdir="$ac_optarg" ;;
441
442   -target | --target | --targe | --targ | --tar | --ta | --t)
443     ac_prev=target ;;
444   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
445     target="$ac_optarg" ;;
446
447   -v | -verbose | --verbose | --verbos | --verbo | --verb)
448     verbose=yes ;;
449
450   -version | --version | --versio | --versi | --vers)
451     echo "configure generated by autoconf version 2.13.1"
452     exit 0 ;;
453
454   -with-* | --with-*)
455     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
456     # Reject names that are not valid shell variable names.
457     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
458       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
459     fi
460     ac_package=`echo $ac_package| sed 's/-/_/g'`
461     case "$ac_option" in
462       *=*) ;;
463       *) ac_optarg=yes ;;
464     esac
465     eval "with_${ac_package}='$ac_optarg'" ;;
466
467   -without-* | --without-*)
468     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
469     # Reject names that are not valid shell variable names.
470     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
471       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
472     fi
473     ac_package=`echo $ac_package| sed 's/-/_/g'`
474     eval "with_${ac_package}=no" ;;
475
476   --x)
477     # Obsolete; use --with-x.
478     with_x=yes ;;
479
480   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
481   | --x-incl | --x-inc | --x-in | --x-i)
482     ac_prev=x_includes ;;
483   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
484   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
485     x_includes="$ac_optarg" ;;
486
487   -x-libraries | --x-libraries | --x-librarie | --x-librari \
488   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
489     ac_prev=x_libraries ;;
490   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
491   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
492     x_libraries="$ac_optarg" ;;
493
494   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
495     ;;
496
497   *)
498     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
499       echo "configure: warning: $ac_option: invalid host type" 1>&2
500     fi
501     if test "x$nonopt" != xNONE; then
502       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
503     fi
504     nonopt="$ac_option"
505     ;;
506
507   esac
508 done
509
510 if test -n "$ac_prev"; then
511   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
512 fi
513
514 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
515
516 # File descriptor usage:
517 # 0 standard input
518 # 1 file creation
519 # 2 errors and warnings
520 # 3 some systems may open it to /dev/tty
521 # 4 used on the Kubota Titan
522 # 6 checking for... messages and results
523 # 5 compiler messages saved in config.log
524 if test "$silent" = yes; then
525   exec 6>/dev/null
526 else
527   exec 6>&1
528 fi
529 exec 5>./config.log
530
531 echo "\
532 This file contains any messages produced by compilers while
533 running configure, to aid debugging if configure makes a mistake.
534 " 1>&5
535
536 # Strip out --no-create and --no-recursion so they do not pile up.
537 # Also quote any args containing shell metacharacters.
538 ac_configure_args=
539 for ac_arg
540 do
541   case "$ac_arg" in
542   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
543   | --no-cr | --no-c) ;;
544   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
545   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
546   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
547   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
548   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
549   esac
550 done
551
552 # NLS nuisances.
553 # Only set these to C if already set.  These must not be set unconditionally
554 # because not all systems understand e.g. LANG=C (notably SCO).
555 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
556 # Non-C LC_CTYPE values break the ctype check.
557 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
558 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
559 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
560 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
561
562 # confdefs.h avoids OS command line length limits that DEFS can exceed.
563 rm -rf conftest* confdefs.h
564 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
565 echo > confdefs.h
566
567 # A filename unique to this package, relative to the directory that
568 # configure is in, which we can look for to find out if srcdir is correct.
569 ac_unique_file=build/version
570
571 # Find the source files, if location was not specified.
572 if test -z "$srcdir"; then
573   ac_srcdir_defaulted=yes
574   # Try the directory containing this script, then its parent.
575   ac_prog=$0
576   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
577   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
578   srcdir=$ac_confdir
579   if test ! -r $srcdir/$ac_unique_file; then
580     srcdir=..
581   fi
582 else
583   ac_srcdir_defaulted=no
584 fi
585 if test ! -r $srcdir/$ac_unique_file; then
586   if test "$ac_srcdir_defaulted" = yes; then
587     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
588   else
589     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
590   fi
591 fi
592 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
593
594 # Prefer explicitly selected file to automatically selected ones.
595 if test -z "$CONFIG_SITE"; then
596   if test "x$prefix" != xNONE; then
597     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
598   else
599     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
600   fi
601 fi
602 for ac_site_file in $CONFIG_SITE; do
603   if test -r "$ac_site_file"; then
604     echo "loading site script $ac_site_file"
605     . "$ac_site_file"
606   fi
607 done
608
609
610 ac_ext=c
611 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
612 ac_cpp='$CPP $CPPFLAGS'
613 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
614 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
615 cross_compiling=$ac_cv_prog_cc_cross
616
617 ac_exeext=
618 ac_objext=o
619 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
620   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
621   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
622     ac_n= ac_c='
623 ' ac_t='        '
624   else
625     ac_n=-n ac_c= ac_t=
626   fi
627 else
628   ac_n= ac_c='\c' ac_t=
629 fi
630
631
632 # set unset (borrowed from autoconf 2.49c)
633 if (OL_FOO=OL_FOO; unset OL_FOO) >/dev/null 2>&1; then
634   ol_unset=unset
635 else
636   ol_unset=false
637 fi
638 # unset CDPATH
639 $ol_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
640
641 ac_aux_dir=
642 for ac_dir in build $srcdir/build; do
643   if test -f $ac_dir/install-sh; then
644     ac_aux_dir=$ac_dir
645     ac_install_sh="$ac_aux_dir/install-sh -c"
646     break
647   elif test -f $ac_dir/install.sh; then
648     ac_aux_dir=$ac_dir
649     ac_install_sh="$ac_aux_dir/install.sh -c"
650     break
651   elif test -f $ac_dir/shtool; then
652     ac_aux_dir=$ac_dir
653     ac_install_sh="$ac_aux_dir/shtool install -c"
654     break
655   fi
656 done
657 if test -z "$ac_aux_dir"; then
658   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
659 fi
660 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
661 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
662 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
663
664 OL_VERSION=`cat $ac_aux_dir/version`
665 if test -z "$OL_VERSION"; then
666         { echo "configure: error: could not determine version" 1>&2; exit 1; }
667 fi
668
669 echo "Configuring OpenLDAP $OL_VERSION ..."
670
671
672 echo $ac_n "checking host system type""... $ac_c" 1>&6
673 echo "configure:674: checking host system type" >&5
674 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
675
676 # Make sure we can run config.sub.
677   if $ac_config_sub sun4 >/dev/null 2>&1; then :
678     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
679   fi
680
681   ac_cv_host_alias=$host
682   case "$ac_cv_host_alias" in
683   NONE)
684     case $nonopt in
685     NONE)
686       if ac_cv_host_alias=`$ac_config_guess`; then :
687       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
688       fi ;;
689     *) ac_cv_host_alias=$nonopt ;;
690     esac ;;
691   esac
692
693   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
694   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
695   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
696   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
697 else
698   echo $ac_n "(cached) $ac_c" 1>&6
699 fi
700
701 echo "$ac_t""$ac_cv_host" 1>&6
702
703 host=$ac_cv_host
704 host_alias=$ac_cv_host_alias
705 host_cpu=$ac_cv_host_cpu
706 host_vendor=$ac_cv_host_vendor
707 host_os=$ac_cv_host_os
708
709
710
711
712
713 echo $ac_n "checking target system type""... $ac_c" 1>&6
714 echo "configure:715: checking target system type" >&5
715 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
716
717 # Make sure we can run config.sub.
718   if $ac_config_sub sun4 >/dev/null 2>&1; then :
719     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
720   fi
721
722   ac_cv_target_alias=$target
723   case "$ac_cv_target_alias" in
724   NONE)
725     case $nonopt in
726     NONE)
727       ac_cv_target_alias=$host_alias ;;
728
729     *) ac_cv_target_alias=$nonopt ;;
730     esac ;;
731   esac
732
733   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
734   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
735   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
736   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
737 else
738   echo $ac_n "(cached) $ac_c" 1>&6
739 fi
740
741 echo "$ac_t""$ac_cv_target" 1>&6
742
743 target=$ac_cv_target
744 target_alias=$ac_cv_target_alias
745 target_cpu=$ac_cv_target_cpu
746 target_vendor=$ac_cv_target_vendor
747 target_os=$ac_cv_target_os
748
749
750
751
752
753 echo $ac_n "checking build system type""... $ac_c" 1>&6
754 echo "configure:755: checking build system type" >&5
755 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
756
757 # Make sure we can run config.sub.
758   if $ac_config_sub sun4 >/dev/null 2>&1; then :
759     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
760   fi
761
762   ac_cv_build_alias=$build
763   case "$ac_cv_build_alias" in
764   NONE)
765     case $nonopt in
766     NONE)
767       ac_cv_build_alias=$host_alias ;;
768
769     *) ac_cv_build_alias=$nonopt ;;
770     esac ;;
771   esac
772
773   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
774   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
775   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
776   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
777 else
778   echo $ac_n "(cached) $ac_c" 1>&6
779 fi
780
781 echo "$ac_t""$ac_cv_build" 1>&6
782
783 build=$ac_cv_build
784 build_alias=$ac_cv_build_alias
785 build_cpu=$ac_cv_build_cpu
786 build_vendor=$ac_cv_build_vendor
787 build_os=$ac_cv_build_os
788
789
790
791
792
793 # Do some error checking and defaulting for the host and target type.
794 # The inputs are:
795 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
796 #
797 # The rules are:
798 # 1. You are not allowed to specify --host, --target, and nonopt at the
799 #    same time.
800 # 2. Host defaults to nonopt.
801 # 3. If nonopt is not specified, then host defaults to the current host,
802 #    as determined by config.guess.
803 # 4. Target and build default to nonopt.
804 # 5. If nonopt is not specified, then target and build default to host.
805
806 # The aliases save the names the user supplied, while $host etc.
807 # will get canonicalized.
808 case $host---$target---$nonopt in
809 NONE---*---* | *---NONE---* | *---*---NONE) ;;
810 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
811 esac
812
813 test "$host_alias" != "$target_alias" &&
814   test "$program_prefix$program_suffix$program_transform_name" = \
815     NONENONEs,x,x, &&
816   program_prefix=${target_alias}-
817
818
819 # Find a good install program.  We prefer a C program (faster),
820 # so one script is as good as another.  But avoid the broken or
821 # incompatible versions:
822 # SysV /etc/install, /usr/sbin/install
823 # SunOS /usr/etc/install
824 # IRIX /sbin/install
825 # AIX /bin/install
826 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
827 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
828 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
829 # ./install, which can be erroneously created by make from ./install.sh.
830 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
831 echo "configure:832: checking for a BSD compatible install" >&5
832 if test -z "$INSTALL"; then
833 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
834   echo $ac_n "(cached) $ac_c" 1>&6
835 else
836     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
837   for ac_dir in $PATH; do
838     # Account for people who put trailing slashes in PATH elements.
839     case "$ac_dir/" in
840     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
841     *)
842       # OSF1 and SCO ODT 3.0 have their own names for install.
843       # Don't use installbsd from OSF since it installs stuff as root
844       # by default.
845       for ac_prog in ginstall scoinst install; do
846         if test -f $ac_dir/$ac_prog; then
847           if test $ac_prog = install &&
848             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
849             # AIX install.  It has an incompatible calling convention.
850             :
851           elif test $ac_prog = install &&
852             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
853             # program-specific install script used by HP pwplus--don't use.
854             :
855           else
856             ac_cv_path_install="$ac_dir/$ac_prog -c"
857             break 2
858           fi
859         fi
860       done
861       ;;
862     esac
863   done
864   IFS="$ac_save_IFS"
865
866 fi
867   if test "${ac_cv_path_install+set}" = set; then
868     INSTALL="$ac_cv_path_install"
869   else
870     # As a last resort, use the slow shell script.  We don't cache a
871     # path for INSTALL within a source directory, because that will
872     # break other packages using the cache if that directory is
873     # removed, or if the path is relative.
874     INSTALL="$ac_install_sh"
875   fi
876 fi
877 echo "$ac_t""$INSTALL" 1>&6
878
879 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
880 # It thinks the first close brace ends the variable substitution.
881 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
882
883 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
884
885 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
886
887 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
888 echo "configure:889: checking whether build environment is sane" >&5
889 # Just in case
890 sleep 1
891 echo timestamp > conftestfile
892 # Do `set' in a subshell so we don't clobber the current shell's
893 # arguments.  Must try -L first in case configure is actually a
894 # symlink; some systems play weird games with the mod time of symlinks
895 # (eg FreeBSD returns the mod time of the symlink's containing
896 # directory).
897 if (
898    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
899    if test "$*" = "X"; then
900       # -L didn't work.
901       set X `ls -t $srcdir/configure conftestfile`
902    fi
903    if test "$*" != "X $srcdir/configure conftestfile" \
904       && test "$*" != "X conftestfile $srcdir/configure"; then
905
906       # If neither matched, then we have a broken ls.  This can happen
907       # if, for instance, CONFIG_SHELL is bash and it inherits a
908       # broken ls alias from the environment.  This has actually
909       # happened.  Such a system could not be considered "sane".
910       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
911 alias in your environment" 1>&2; exit 1; }
912    fi
913
914    test "$2" = conftestfile
915    )
916 then
917    # Ok.
918    :
919 else
920    { echo "configure: error: newly created file is older than distributed files!
921 Check your system clock" 1>&2; exit 1; }
922 fi
923 rm -f conftest*
924 echo "$ac_t""yes" 1>&6
925 if test "$program_transform_name" = s,x,x,; then
926   program_transform_name=
927 else
928   # Double any \ or $.  echo might interpret backslashes.
929   cat <<\EOF_SED > conftestsed
930 s,\\,\\\\,g; s,\$,$$,g
931 EOF_SED
932   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
933   rm -f conftestsed
934 fi
935 test "$program_prefix" != NONE &&
936   program_transform_name="s,^,${program_prefix},;$program_transform_name"
937 # Use a double $ so make ignores it.
938 test "$program_suffix" != NONE &&
939   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
940
941 # sed with no file args requires a program.
942 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
943
944 for ac_prog in mawk gawk nawk awk
945 do
946 # Extract the first word of "$ac_prog", so it can be a program name with args.
947 set dummy $ac_prog; ac_word=$2
948 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
949 echo "configure:950: checking for $ac_word" >&5
950 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
951   echo $ac_n "(cached) $ac_c" 1>&6
952 else
953   if test -n "$AWK"; then
954   ac_cv_prog_AWK="$AWK" # Let the user override the test.
955 else
956   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
957   ac_dummy="$PATH"
958   for ac_dir in $ac_dummy; do
959     test -z "$ac_dir" && ac_dir=.
960     if test -f $ac_dir/$ac_word; then
961       ac_cv_prog_AWK="$ac_prog"
962       break
963     fi
964   done
965   IFS="$ac_save_ifs"
966 fi
967 fi
968 AWK="$ac_cv_prog_AWK"
969 if test -n "$AWK"; then
970   echo "$ac_t""$AWK" 1>&6
971 else
972   echo "$ac_t""no" 1>&6
973 fi
974
975 test -n "$AWK" && break
976 done
977
978 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
979 echo "configure:980: checking whether ${MAKE-make} sets \${MAKE}" >&5
980 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
981 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
982   echo $ac_n "(cached) $ac_c" 1>&6
983 else
984   cat > conftestmake <<\EOF
985 all:
986         @echo 'ac_maketemp="${MAKE}"'
987 EOF
988 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
989 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
990 if test -n "$ac_maketemp"; then
991   eval ac_cv_prog_make_${ac_make}_set=yes
992 else
993   eval ac_cv_prog_make_${ac_make}_set=no
994 fi
995 rm -f conftestmake
996 fi
997 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
998   echo "$ac_t""yes" 1>&6
999   SET_MAKE=
1000 else
1001   echo "$ac_t""no" 1>&6
1002   SET_MAKE="MAKE=${MAKE-make}"
1003 fi
1004
1005
1006
1007 PACKAGE=OpenLDAP
1008
1009 VERSION=$OL_VERSION
1010
1011 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1012   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1013 fi
1014
1015
1016
1017 missing_dir=`cd $ac_aux_dir && pwd`
1018 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1019 echo "configure:1020: checking for working aclocal" >&5
1020 # Run test in a subshell; some versions of sh will print an error if
1021 # an executable is not found, even if stderr is redirected.
1022 # Redirect stdin to placate older versions of autoconf.  Sigh.
1023 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1024    ACLOCAL=aclocal
1025    echo "$ac_t""found" 1>&6
1026 else
1027    ACLOCAL="$missing_dir/missing aclocal"
1028    echo "$ac_t""missing" 1>&6
1029 fi
1030
1031 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1032 echo "configure:1033: checking for working autoconf" >&5
1033 # Run test in a subshell; some versions of sh will print an error if
1034 # an executable is not found, even if stderr is redirected.
1035 # Redirect stdin to placate older versions of autoconf.  Sigh.
1036 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1037    AUTOCONF=autoconf
1038    echo "$ac_t""found" 1>&6
1039 else
1040    AUTOCONF="$missing_dir/missing autoconf"
1041    echo "$ac_t""missing" 1>&6
1042 fi
1043
1044 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1045 echo "configure:1046: checking for working automake" >&5
1046 # Run test in a subshell; some versions of sh will print an error if
1047 # an executable is not found, even if stderr is redirected.
1048 # Redirect stdin to placate older versions of autoconf.  Sigh.
1049 if (automake --version) < /dev/null > /dev/null 2>&1; then
1050    AUTOMAKE=automake
1051    echo "$ac_t""found" 1>&6
1052 else
1053    AUTOMAKE="$missing_dir/missing automake"
1054    echo "$ac_t""missing" 1>&6
1055 fi
1056
1057 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1058 echo "configure:1059: checking for working autoheader" >&5
1059 # Run test in a subshell; some versions of sh will print an error if
1060 # an executable is not found, even if stderr is redirected.
1061 # Redirect stdin to placate older versions of autoconf.  Sigh.
1062 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1063    AUTOHEADER=autoheader
1064    echo "$ac_t""found" 1>&6
1065 else
1066    AUTOHEADER="$missing_dir/missing autoheader"
1067    echo "$ac_t""missing" 1>&6
1068 fi
1069
1070 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1071 echo "configure:1072: checking for working makeinfo" >&5
1072 # Run test in a subshell; some versions of sh will print an error if
1073 # an executable is not found, even if stderr is redirected.
1074 # Redirect stdin to placate older versions of autoconf.  Sigh.
1075 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1076    MAKEINFO=makeinfo
1077    echo "$ac_t""found" 1>&6
1078 else
1079    MAKEINFO="$missing_dir/missing makeinfo"
1080    echo "$ac_t""missing" 1>&6
1081 fi
1082
1083 install_sh="$missing_dir/install-sh"
1084 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1085
1086 for ac_prog in gnutar gtar tar
1087 do
1088 # Extract the first word of "$ac_prog", so it can be a program name with args.
1089 set dummy $ac_prog; ac_word=$2
1090 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1091 echo "configure:1092: checking for $ac_word" >&5
1092 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1093   echo $ac_n "(cached) $ac_c" 1>&6
1094 else
1095   if test -n "$AMTAR"; then
1096   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1097 else
1098   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1099   ac_dummy="$PATH"
1100   for ac_dir in $ac_dummy; do
1101     test -z "$ac_dir" && ac_dir=.
1102     if test -f $ac_dir/$ac_word; then
1103       ac_cv_prog_AMTAR="$ac_prog"
1104       break
1105     fi
1106   done
1107   IFS="$ac_save_ifs"
1108 fi
1109 fi
1110 AMTAR="$ac_cv_prog_AMTAR"
1111 if test -n "$AMTAR"; then
1112   echo "$ac_t""$AMTAR" 1>&6
1113 else
1114   echo "$ac_t""no" 1>&6
1115 fi
1116
1117 test -n "$AMTAR" && break
1118 done
1119
1120
1121 AMTARFLAGS=
1122 if test -n "$AMTAR"; then
1123   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1124         AMTARFLAGS=o
1125   fi
1126 fi
1127
1128 cat >> confdefs.h <<EOF
1129 #define OPENLDAP_PACKAGE "$PACKAGE"
1130 EOF
1131
1132 cat >> confdefs.h <<EOF
1133 #define OPENLDAP_VERSION "$VERSION"
1134 EOF
1135
1136
1137
1138
1139 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1140 echo "configure:1141: checking configure arguments" >&5
1141
1142
1143 top_builddir=`pwd`
1144
1145 ldap_subdir="/openldap"
1146
1147 # Check whether --with-subdir or --without-subdir was given.
1148 if test "${with_subdir+set}" = set; then
1149   withval="$with_subdir"
1150   case "$withval" in
1151         no) ldap_subdir=""
1152                 ;;
1153         yes)
1154                 ;;
1155         /*|\\*)
1156                 ldap_subdir="$withval"
1157                 ;;
1158         *)
1159                 ldap_subdir="/$withval"
1160                 ;;
1161 esac
1162
1163 fi
1164
1165
1166 # OpenLDAP --enable-debug
1167         # Check whether --enable-debug or --disable-debug was given.
1168 if test "${enable_debug+set}" = set; then
1169   enableval="$enable_debug"
1170   
1171         ol_arg=invalid
1172         for ol_val in auto yes no ; do
1173                 if test "$enableval" = "$ol_val" ; then
1174                         ol_arg="$ol_val"
1175                 fi
1176         done
1177         if test "$ol_arg" = "invalid" ; then
1178                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1179         fi
1180         ol_enable_debug="$ol_arg"
1181
1182 else
1183         ol_enable_debug="yes"
1184 fi
1185 # end --enable-debug
1186 # OpenLDAP --enable-syslog
1187         # Check whether --enable-syslog or --disable-syslog was given.
1188 if test "${enable_syslog+set}" = set; then
1189   enableval="$enable_syslog"
1190   
1191         ol_arg=invalid
1192         for ol_val in auto yes no ; do
1193                 if test "$enableval" = "$ol_val" ; then
1194                         ol_arg="$ol_val"
1195                 fi
1196         done
1197         if test "$ol_arg" = "invalid" ; then
1198                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1199         fi
1200         ol_enable_syslog="$ol_arg"
1201
1202 else
1203         ol_enable_syslog="auto"
1204 fi
1205 # end --enable-syslog
1206 # OpenLDAP --enable-proctitle
1207         # Check whether --enable-proctitle or --disable-proctitle was given.
1208 if test "${enable_proctitle+set}" = set; then
1209   enableval="$enable_proctitle"
1210   
1211         ol_arg=invalid
1212         for ol_val in auto yes no ; do
1213                 if test "$enableval" = "$ol_val" ; then
1214                         ol_arg="$ol_val"
1215                 fi
1216         done
1217         if test "$ol_arg" = "invalid" ; then
1218                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1219         fi
1220         ol_enable_proctitle="$ol_arg"
1221
1222 else
1223         ol_enable_proctitle="yes"
1224 fi
1225 # end --enable-proctitle
1226 # OpenLDAP --enable-cache
1227         # Check whether --enable-cache or --disable-cache was given.
1228 if test "${enable_cache+set}" = set; then
1229   enableval="$enable_cache"
1230   
1231         ol_arg=invalid
1232         for ol_val in auto yes no ; do
1233                 if test "$enableval" = "$ol_val" ; then
1234                         ol_arg="$ol_val"
1235                 fi
1236         done
1237         if test "$ol_arg" = "invalid" ; then
1238                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1239         fi
1240         ol_enable_cache="$ol_arg"
1241
1242 else
1243         ol_enable_cache="yes"
1244 fi
1245 # end --enable-cache
1246 # OpenLDAP --enable-referrals
1247         # Check whether --enable-referrals or --disable-referrals was given.
1248 if test "${enable_referrals+set}" = set; then
1249   enableval="$enable_referrals"
1250   
1251         ol_arg=invalid
1252         for ol_val in auto yes no ; do
1253                 if test "$enableval" = "$ol_val" ; then
1254                         ol_arg="$ol_val"
1255                 fi
1256         done
1257         if test "$ol_arg" = "invalid" ; then
1258                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1259         fi
1260         ol_enable_referrals="$ol_arg"
1261
1262 else
1263         ol_enable_referrals="yes"
1264 fi
1265 # end --enable-referrals
1266 # OpenLDAP --enable-kbind
1267         # Check whether --enable-kbind or --disable-kbind was given.
1268 if test "${enable_kbind+set}" = set; then
1269   enableval="$enable_kbind"
1270   
1271         ol_arg=invalid
1272         for ol_val in auto yes no ; do
1273                 if test "$enableval" = "$ol_val" ; then
1274                         ol_arg="$ol_val"
1275                 fi
1276         done
1277         if test "$ol_arg" = "invalid" ; then
1278                 { echo "configure: error: bad value $enableval for --enable-kbind" 1>&2; exit 1; }
1279         fi
1280         ol_enable_kbind="$ol_arg"
1281
1282 else
1283         ol_enable_kbind="no"
1284 fi
1285 # end --enable-kbind
1286 # OpenLDAP --enable-ipv6
1287         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1288 if test "${enable_ipv6+set}" = set; then
1289   enableval="$enable_ipv6"
1290   
1291         ol_arg=invalid
1292         for ol_val in auto yes no ; do
1293                 if test "$enableval" = "$ol_val" ; then
1294                         ol_arg="$ol_val"
1295                 fi
1296         done
1297         if test "$ol_arg" = "invalid" ; then
1298                 { echo "configure: error: bad value $enableval for --enable-ipv6" 1>&2; exit 1; }
1299         fi
1300         ol_enable_ipv6="$ol_arg"
1301
1302 else
1303         ol_enable_ipv6="auto"
1304 fi
1305 # end --enable-ipv6
1306 # OpenLDAP --enable-local
1307         # Check whether --enable-local or --disable-local was given.
1308 if test "${enable_local+set}" = set; then
1309   enableval="$enable_local"
1310   
1311         ol_arg=invalid
1312         for ol_val in auto yes no ; do
1313                 if test "$enableval" = "$ol_val" ; then
1314                         ol_arg="$ol_val"
1315                 fi
1316         done
1317         if test "$ol_arg" = "invalid" ; then
1318                 { echo "configure: error: bad value $enableval for --enable-local" 1>&2; exit 1; }
1319         fi
1320         ol_enable_local="$ol_arg"
1321
1322 else
1323         ol_enable_local="auto"
1324 fi
1325 # end --enable-local
1326 # OpenLDAP --enable-x_compile
1327         # Check whether --enable-x_compile or --disable-x_compile was given.
1328 if test "${enable_x_compile+set}" = set; then
1329   enableval="$enable_x_compile"
1330   
1331         ol_arg=invalid
1332         for ol_val in yes no ; do
1333                 if test "$enableval" = "$ol_val" ; then
1334                         ol_arg="$ol_val"
1335                 fi
1336         done
1337         if test "$ol_arg" = "invalid" ; then
1338                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1339         fi
1340         ol_enable_x_compile="$ol_arg"
1341
1342 else
1343         ol_enable_x_compile="no"
1344 fi
1345 # end --enable-x_compile
1346
1347
1348 # OpenLDAP --with-cyrus_sasl
1349         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1350 if test "${with_cyrus_sasl+set}" = set; then
1351   withval="$with_cyrus_sasl"
1352   
1353         ol_arg=invalid
1354         for ol_val in auto yes no  ; do
1355                 if test "$withval" = "$ol_val" ; then
1356                         ol_arg="$ol_val"
1357                 fi
1358         done
1359         if test "$ol_arg" = "invalid" ; then
1360                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1361         fi
1362         ol_with_cyrus_sasl="$ol_arg"
1363
1364 else
1365         ol_with_cyrus_sasl="auto"
1366 fi
1367 # end --with-cyrus_sasl
1368
1369 # OpenLDAP --with-fetch
1370         # Check whether --with-fetch or --without-fetch was given.
1371 if test "${with_fetch+set}" = set; then
1372   withval="$with_fetch"
1373   
1374         ol_arg=invalid
1375         for ol_val in auto yes no  ; do
1376                 if test "$withval" = "$ol_val" ; then
1377                         ol_arg="$ol_val"
1378                 fi
1379         done
1380         if test "$ol_arg" = "invalid" ; then
1381                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1382         fi
1383         ol_with_fetch="$ol_arg"
1384
1385 else
1386         ol_with_fetch="auto"
1387 fi
1388 # end --with-fetch
1389
1390 # OpenLDAP --with-kerberos
1391         # Check whether --with-kerberos or --without-kerberos was given.
1392 if test "${with_kerberos+set}" = set; then
1393   withval="$with_kerberos"
1394   
1395         ol_arg=invalid
1396         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1397                 if test "$withval" = "$ol_val" ; then
1398                         ol_arg="$ol_val"
1399                 fi
1400         done
1401         if test "$ol_arg" = "invalid" ; then
1402                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1403         fi
1404         ol_with_kerberos="$ol_arg"
1405
1406 else
1407         ol_with_kerberos="auto"
1408 fi
1409 # end --with-kerberos
1410
1411 # OpenLDAP --with-readline
1412         # Check whether --with-readline or --without-readline was given.
1413 if test "${with_readline+set}" = set; then
1414   withval="$with_readline"
1415   
1416         ol_arg=invalid
1417         for ol_val in auto yes no  ; do
1418                 if test "$withval" = "$ol_val" ; then
1419                         ol_arg="$ol_val"
1420                 fi
1421         done
1422         if test "$ol_arg" = "invalid" ; then
1423                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1424         fi
1425         ol_with_readline="$ol_arg"
1426
1427 else
1428         ol_with_readline="auto"
1429 fi
1430 # end --with-readline
1431
1432 # OpenLDAP --with-threads
1433         # Check whether --with-threads or --without-threads was given.
1434 if test "${with_threads+set}" = set; then
1435   withval="$with_threads"
1436   
1437         ol_arg=invalid
1438         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1439                 if test "$withval" = "$ol_val" ; then
1440                         ol_arg="$ol_val"
1441                 fi
1442         done
1443         if test "$ol_arg" = "invalid" ; then
1444                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1445         fi
1446         ol_with_threads="$ol_arg"
1447
1448 else
1449         ol_with_threads="auto"
1450 fi
1451 # end --with-threads
1452
1453 # OpenLDAP --with-tls
1454         # Check whether --with-tls or --without-tls was given.
1455 if test "${with_tls+set}" = set; then
1456   withval="$with_tls"
1457   
1458         ol_arg=invalid
1459         for ol_val in auto ssleay openssl yes no  ; do
1460                 if test "$withval" = "$ol_val" ; then
1461                         ol_arg="$ol_val"
1462                 fi
1463         done
1464         if test "$ol_arg" = "invalid" ; then
1465                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1466         fi
1467         ol_with_tls="$ol_arg"
1468
1469 else
1470         ol_with_tls="auto"
1471 fi
1472 # end --with-tls
1473
1474 # OpenLDAP --with-yielding_select
1475         # Check whether --with-yielding_select or --without-yielding_select was given.
1476 if test "${with_yielding_select+set}" = set; then
1477   withval="$with_yielding_select"
1478   
1479         ol_arg=invalid
1480         for ol_val in auto yes no manual  ; do
1481                 if test "$withval" = "$ol_val" ; then
1482                         ol_arg="$ol_val"
1483                 fi
1484         done
1485         if test "$ol_arg" = "invalid" ; then
1486                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1487         fi
1488         ol_with_yielding_select="$ol_arg"
1489
1490 else
1491         ol_with_yielding_select="auto"
1492 fi
1493 # end --with-yielding_select
1494
1495
1496
1497 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1498 if test "${with_xxslapdoptions+set}" = set; then
1499   withval="$with_xxslapdoptions"
1500   :
1501 fi
1502
1503 # OpenLDAP --enable-slapd
1504         # Check whether --enable-slapd or --disable-slapd was given.
1505 if test "${enable_slapd+set}" = set; then
1506   enableval="$enable_slapd"
1507   
1508         ol_arg=invalid
1509         for ol_val in auto yes no ; do
1510                 if test "$enableval" = "$ol_val" ; then
1511                         ol_arg="$ol_val"
1512                 fi
1513         done
1514         if test "$ol_arg" = "invalid" ; then
1515                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1516         fi
1517         ol_enable_slapd="$ol_arg"
1518
1519 else
1520         ol_enable_slapd="yes"
1521 fi
1522 # end --enable-slapd
1523 # OpenLDAP --enable-cleartext
1524         # Check whether --enable-cleartext or --disable-cleartext was given.
1525 if test "${enable_cleartext+set}" = set; then
1526   enableval="$enable_cleartext"
1527   
1528         ol_arg=invalid
1529         for ol_val in auto yes no ; do
1530                 if test "$enableval" = "$ol_val" ; then
1531                         ol_arg="$ol_val"
1532                 fi
1533         done
1534         if test "$ol_arg" = "invalid" ; then
1535                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1536         fi
1537         ol_enable_cleartext="$ol_arg"
1538
1539 else
1540         ol_enable_cleartext="yes"
1541 fi
1542 # end --enable-cleartext
1543 # OpenLDAP --enable-crypt
1544         # Check whether --enable-crypt or --disable-crypt was given.
1545 if test "${enable_crypt+set}" = set; then
1546   enableval="$enable_crypt"
1547   
1548         ol_arg=invalid
1549         for ol_val in auto yes no ; do
1550                 if test "$enableval" = "$ol_val" ; then
1551                         ol_arg="$ol_val"
1552                 fi
1553         done
1554         if test "$ol_arg" = "invalid" ; then
1555                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1556         fi
1557         ol_enable_crypt="$ol_arg"
1558
1559 else
1560         ol_enable_crypt="auto"
1561 fi
1562 # end --enable-crypt
1563 # OpenLDAP --enable-kpasswd
1564         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1565 if test "${enable_kpasswd+set}" = set; then
1566   enableval="$enable_kpasswd"
1567   
1568         ol_arg=invalid
1569         for ol_val in auto yes no ; do
1570                 if test "$enableval" = "$ol_val" ; then
1571                         ol_arg="$ol_val"
1572                 fi
1573         done
1574         if test "$ol_arg" = "invalid" ; then
1575                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1576         fi
1577         ol_enable_kpasswd="$ol_arg"
1578
1579 else
1580         ol_enable_kpasswd="no"
1581 fi
1582 # end --enable-kpasswd
1583 # OpenLDAP --enable-spasswd
1584         # Check whether --enable-spasswd or --disable-spasswd was given.
1585 if test "${enable_spasswd+set}" = set; then
1586   enableval="$enable_spasswd"
1587   
1588         ol_arg=invalid
1589         for ol_val in auto yes no ; do
1590                 if test "$enableval" = "$ol_val" ; then
1591                         ol_arg="$ol_val"
1592                 fi
1593         done
1594         if test "$ol_arg" = "invalid" ; then
1595                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1596         fi
1597         ol_enable_spasswd="$ol_arg"
1598
1599 else
1600         ol_enable_spasswd="no"
1601 fi
1602 # end --enable-spasswd
1603 # OpenLDAP --enable-modules
1604         # Check whether --enable-modules or --disable-modules was given.
1605 if test "${enable_modules+set}" = set; then
1606   enableval="$enable_modules"
1607   
1608         ol_arg=invalid
1609         for ol_val in auto yes no ; do
1610                 if test "$enableval" = "$ol_val" ; then
1611                         ol_arg="$ol_val"
1612                 fi
1613         done
1614         if test "$ol_arg" = "invalid" ; then
1615                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1616         fi
1617         ol_enable_modules="$ol_arg"
1618
1619 else
1620         ol_enable_modules="no"
1621 fi
1622 # end --enable-modules
1623 # OpenLDAP --enable-phonetic
1624         # Check whether --enable-phonetic or --disable-phonetic was given.
1625 if test "${enable_phonetic+set}" = set; then
1626   enableval="$enable_phonetic"
1627   
1628         ol_arg=invalid
1629         for ol_val in auto yes no ; do
1630                 if test "$enableval" = "$ol_val" ; then
1631                         ol_arg="$ol_val"
1632                 fi
1633         done
1634         if test "$ol_arg" = "invalid" ; then
1635                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1636         fi
1637         ol_enable_phonetic="$ol_arg"
1638
1639 else
1640         ol_enable_phonetic="no"
1641 fi
1642 # end --enable-phonetic
1643 # OpenLDAP --enable-rlookups
1644         # Check whether --enable-rlookups or --disable-rlookups was given.
1645 if test "${enable_rlookups+set}" = set; then
1646   enableval="$enable_rlookups"
1647   
1648         ol_arg=invalid
1649         for ol_val in auto yes no ; do
1650                 if test "$enableval" = "$ol_val" ; then
1651                         ol_arg="$ol_val"
1652                 fi
1653         done
1654         if test "$ol_arg" = "invalid" ; then
1655                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1656         fi
1657         ol_enable_rlookups="$ol_arg"
1658
1659 else
1660         ol_enable_rlookups="no"
1661 fi
1662 # end --enable-rlookups
1663 # OpenLDAP --enable-aci
1664         # Check whether --enable-aci or --disable-aci was given.
1665 if test "${enable_aci+set}" = set; then
1666   enableval="$enable_aci"
1667   
1668         ol_arg=invalid
1669         for ol_val in auto yes no ; do
1670                 if test "$enableval" = "$ol_val" ; then
1671                         ol_arg="$ol_val"
1672                 fi
1673         done
1674         if test "$ol_arg" = "invalid" ; then
1675                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1676         fi
1677         ol_enable_aci="$ol_arg"
1678
1679 else
1680         ol_enable_aci="no"
1681 fi
1682 # end --enable-aci
1683 # OpenLDAP --enable-wrappers
1684         # Check whether --enable-wrappers or --disable-wrappers was given.
1685 if test "${enable_wrappers+set}" = set; then
1686   enableval="$enable_wrappers"
1687   
1688         ol_arg=invalid
1689         for ol_val in auto yes no ; do
1690                 if test "$enableval" = "$ol_val" ; then
1691                         ol_arg="$ol_val"
1692                 fi
1693         done
1694         if test "$ol_arg" = "invalid" ; then
1695                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1696         fi
1697         ol_enable_wrappers="$ol_arg"
1698
1699 else
1700         ol_enable_wrappers="no"
1701 fi
1702 # end --enable-wrappers
1703 # OpenLDAP --enable-dynamic
1704         # Check whether --enable-dynamic or --disable-dynamic was given.
1705 if test "${enable_dynamic+set}" = set; then
1706   enableval="$enable_dynamic"
1707   
1708         ol_arg=invalid
1709         for ol_val in auto yes no ; do
1710                 if test "$enableval" = "$ol_val" ; then
1711                         ol_arg="$ol_val"
1712                 fi
1713         done
1714         if test "$ol_arg" = "invalid" ; then
1715                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1716         fi
1717         ol_enable_dynamic="$ol_arg"
1718
1719 else
1720         ol_enable_dynamic="no"
1721 fi
1722 # end --enable-dynamic
1723
1724 # OpenLDAP --enable-dnssrv
1725         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1726 if test "${enable_dnssrv+set}" = set; then
1727   enableval="$enable_dnssrv"
1728   
1729         ol_arg=invalid
1730         for ol_val in auto yes no ; do
1731                 if test "$enableval" = "$ol_val" ; then
1732                         ol_arg="$ol_val"
1733                 fi
1734         done
1735         if test "$ol_arg" = "invalid" ; then
1736                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1737         fi
1738         ol_enable_dnssrv="$ol_arg"
1739
1740 else
1741         ol_enable_dnssrv="no"
1742 fi
1743 # end --enable-dnssrv
1744 # OpenLDAP --with-dnssrv_module
1745         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1746 if test "${with_dnssrv_module+set}" = set; then
1747   withval="$with_dnssrv_module"
1748   
1749         ol_arg=invalid
1750         for ol_val in static dynamic ; do
1751                 if test "$withval" = "$ol_val" ; then
1752                         ol_arg="$ol_val"
1753                 fi
1754         done
1755         if test "$ol_arg" = "invalid" ; then
1756                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1757         fi
1758         ol_with_dnssrv_module="$ol_arg"
1759
1760 else
1761         ol_with_dnssrv_module="static"
1762 fi
1763 # end --with-dnssrv_module
1764
1765 # OpenLDAP --enable-ldap
1766         # Check whether --enable-ldap or --disable-ldap was given.
1767 if test "${enable_ldap+set}" = set; then
1768   enableval="$enable_ldap"
1769   
1770         ol_arg=invalid
1771         for ol_val in auto yes no ; do
1772                 if test "$enableval" = "$ol_val" ; then
1773                         ol_arg="$ol_val"
1774                 fi
1775         done
1776         if test "$ol_arg" = "invalid" ; then
1777                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1778         fi
1779         ol_enable_ldap="$ol_arg"
1780
1781 else
1782         ol_enable_ldap="no"
1783 fi
1784 # end --enable-ldap
1785 # OpenLDAP --with-ldap_module
1786         # Check whether --with-ldap_module or --without-ldap_module was given.
1787 if test "${with_ldap_module+set}" = set; then
1788   withval="$with_ldap_module"
1789   
1790         ol_arg=invalid
1791         for ol_val in static dynamic ; do
1792                 if test "$withval" = "$ol_val" ; then
1793                         ol_arg="$ol_val"
1794                 fi
1795         done
1796         if test "$ol_arg" = "invalid" ; then
1797                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1798         fi
1799         ol_with_ldap_module="$ol_arg"
1800
1801 else
1802         ol_with_ldap_module="static"
1803 fi
1804 # end --with-ldap_module
1805
1806 # OpenLDAP --enable-ldbm
1807         # Check whether --enable-ldbm or --disable-ldbm was given.
1808 if test "${enable_ldbm+set}" = set; then
1809   enableval="$enable_ldbm"
1810   
1811         ol_arg=invalid
1812         for ol_val in auto yes no ; do
1813                 if test "$enableval" = "$ol_val" ; then
1814                         ol_arg="$ol_val"
1815                 fi
1816         done
1817         if test "$ol_arg" = "invalid" ; then
1818                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1819         fi
1820         ol_enable_ldbm="$ol_arg"
1821
1822 else
1823         ol_enable_ldbm="yes"
1824 fi
1825 # end --enable-ldbm
1826 # OpenLDAP --with-ldbm_api
1827         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1828 if test "${with_ldbm_api+set}" = set; then
1829   withval="$with_ldbm_api"
1830   
1831         ol_arg=invalid
1832         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1833                 if test "$withval" = "$ol_val" ; then
1834                         ol_arg="$ol_val"
1835                 fi
1836         done
1837         if test "$ol_arg" = "invalid" ; then
1838                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1839         fi
1840         ol_with_ldbm_api="$ol_arg"
1841
1842 else
1843         ol_with_ldbm_api="auto"
1844 fi
1845 # end --with-ldbm_api
1846
1847 # OpenLDAP --with-ldbm_module
1848         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1849 if test "${with_ldbm_module+set}" = set; then
1850   withval="$with_ldbm_module"
1851   
1852         ol_arg=invalid
1853         for ol_val in static dynamic ; do
1854                 if test "$withval" = "$ol_val" ; then
1855                         ol_arg="$ol_val"
1856                 fi
1857         done
1858         if test "$ol_arg" = "invalid" ; then
1859                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1860         fi
1861         ol_with_ldbm_module="$ol_arg"
1862
1863 else
1864         ol_with_ldbm_module="static"
1865 fi
1866 # end --with-ldbm_module
1867
1868 # OpenLDAP --with-ldbm_type
1869         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1870 if test "${with_ldbm_type+set}" = set; then
1871   withval="$with_ldbm_type"
1872   
1873         ol_arg=invalid
1874         for ol_val in auto btree hash ; do
1875                 if test "$withval" = "$ol_val" ; then
1876                         ol_arg="$ol_val"
1877                 fi
1878         done
1879         if test "$ol_arg" = "invalid" ; then
1880                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1881         fi
1882         ol_with_ldbm_type="$ol_arg"
1883
1884 else
1885         ol_with_ldbm_type="auto"
1886 fi
1887 # end --with-ldbm_type
1888
1889 # OpenLDAP --enable-passwd
1890         # Check whether --enable-passwd or --disable-passwd was given.
1891 if test "${enable_passwd+set}" = set; then
1892   enableval="$enable_passwd"
1893   
1894         ol_arg=invalid
1895         for ol_val in auto yes no ; do
1896                 if test "$enableval" = "$ol_val" ; then
1897                         ol_arg="$ol_val"
1898                 fi
1899         done
1900         if test "$ol_arg" = "invalid" ; then
1901                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1902         fi
1903         ol_enable_passwd="$ol_arg"
1904
1905 else
1906         ol_enable_passwd="no"
1907 fi
1908 # end --enable-passwd
1909 # OpenLDAP --with-passwd_module
1910         # Check whether --with-passwd_module or --without-passwd_module was given.
1911 if test "${with_passwd_module+set}" = set; then
1912   withval="$with_passwd_module"
1913   
1914         ol_arg=invalid
1915         for ol_val in static dynamic ; do
1916                 if test "$withval" = "$ol_val" ; then
1917                         ol_arg="$ol_val"
1918                 fi
1919         done
1920         if test "$ol_arg" = "invalid" ; then
1921                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1922         fi
1923         ol_with_passwd_module="$ol_arg"
1924
1925 else
1926         ol_with_passwd_module="static"
1927 fi
1928 # end --with-passwd_module
1929
1930 # OpenLDAP --enable-shell
1931         # Check whether --enable-shell or --disable-shell was given.
1932 if test "${enable_shell+set}" = set; then
1933   enableval="$enable_shell"
1934   
1935         ol_arg=invalid
1936         for ol_val in auto yes no ; do
1937                 if test "$enableval" = "$ol_val" ; then
1938                         ol_arg="$ol_val"
1939                 fi
1940         done
1941         if test "$ol_arg" = "invalid" ; then
1942                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1943         fi
1944         ol_enable_shell="$ol_arg"
1945
1946 else
1947         ol_enable_shell="no"
1948 fi
1949 # end --enable-shell
1950 # OpenLDAP --with-shell_module
1951         # Check whether --with-shell_module or --without-shell_module was given.
1952 if test "${with_shell_module+set}" = set; then
1953   withval="$with_shell_module"
1954   
1955         ol_arg=invalid
1956         for ol_val in static dynamic ; do
1957                 if test "$withval" = "$ol_val" ; then
1958                         ol_arg="$ol_val"
1959                 fi
1960         done
1961         if test "$ol_arg" = "invalid" ; then
1962                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
1963         fi
1964         ol_with_shell_module="$ol_arg"
1965
1966 else
1967         ol_with_shell_module="static"
1968 fi
1969 # end --with-shell_module
1970
1971 # OpenLDAP --enable-sql
1972         # Check whether --enable-sql or --disable-sql was given.
1973 if test "${enable_sql+set}" = set; then
1974   enableval="$enable_sql"
1975   
1976         ol_arg=invalid
1977         for ol_val in auto yes no ; do
1978                 if test "$enableval" = "$ol_val" ; then
1979                         ol_arg="$ol_val"
1980                 fi
1981         done
1982         if test "$ol_arg" = "invalid" ; then
1983                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
1984         fi
1985         ol_enable_sql="$ol_arg"
1986
1987 else
1988         ol_enable_sql="no"
1989 fi
1990 # end --enable-sql
1991 # OpenLDAP --with-sql_module
1992         # Check whether --with-sql_module or --without-sql_module was given.
1993 if test "${with_sql_module+set}" = set; then
1994   withval="$with_sql_module"
1995   
1996         ol_arg=invalid
1997         for ol_val in static dynamic ; do
1998                 if test "$withval" = "$ol_val" ; then
1999                         ol_arg="$ol_val"
2000                 fi
2001         done
2002         if test "$ol_arg" = "invalid" ; then
2003                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2004         fi
2005         ol_with_sql_module="$ol_arg"
2006
2007 else
2008         ol_with_sql_module="static"
2009 fi
2010 # end --with-sql_module
2011
2012
2013 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2014 if test "${with_xxslurpdoptions+set}" = set; then
2015   withval="$with_xxslurpdoptions"
2016   :
2017 fi
2018
2019 # OpenLDAP --enable-slurpd
2020         # Check whether --enable-slurpd or --disable-slurpd was given.
2021 if test "${enable_slurpd+set}" = set; then
2022   enableval="$enable_slurpd"
2023   
2024         ol_arg=invalid
2025         for ol_val in auto yes no ; do
2026                 if test "$enableval" = "$ol_val" ; then
2027                         ol_arg="$ol_val"
2028                 fi
2029         done
2030         if test "$ol_arg" = "invalid" ; then
2031                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2032         fi
2033         ol_enable_slurpd="$ol_arg"
2034
2035 else
2036         ol_enable_slurpd="auto"
2037 fi
2038 # end --enable-slurpd
2039
2040 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2041 if test "${with_xxliboptions+set}" = set; then
2042   withval="$with_xxliboptions"
2043   :
2044 fi
2045
2046 # Check whether --enable-static or --disable-static was given.
2047 if test "${enable_static+set}" = set; then
2048   enableval="$enable_static"
2049   p=${PACKAGE-default}
2050 case "$enableval" in
2051 yes) enable_static=yes ;;
2052 no) enable_static=no ;;
2053 *)
2054   enable_static=no
2055   # Look at the argument we got.  We use all the common list separators.
2056   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2057   for pkg in $enableval; do
2058     if test "X$pkg" = "X$p"; then
2059       enable_static=yes
2060     fi
2061   done
2062   IFS="$ac_save_ifs"
2063   ;;
2064 esac
2065 else
2066   enable_static=yes
2067 fi
2068
2069 # Check whether --enable-shared or --disable-shared was given.
2070 if test "${enable_shared+set}" = set; then
2071   enableval="$enable_shared"
2072   p=${PACKAGE-default}
2073 case "$enableval" in
2074 yes) enable_shared=yes ;;
2075 no) enable_shared=no ;;
2076 *)
2077   enable_shared=no
2078   # Look at the argument we got.  We use all the common list separators.
2079   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2080   for pkg in $enableval; do
2081     if test "X$pkg" = "X$p"; then
2082       enable_shared=yes
2083     fi
2084   done
2085   IFS="$ac_save_ifs"
2086   ;;
2087 esac
2088 else
2089   enable_shared=yes
2090 fi
2091
2092
2093
2094 # validate options
2095 if test $ol_enable_slapd = no ; then
2096                 if test $ol_enable_dnssrv = yes ; then
2097                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2098         fi
2099         if test $ol_enable_ldap = yes ; then
2100                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2101         fi
2102         if test $ol_enable_ldbm = yes ; then
2103                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2104         fi
2105         if test $ol_enable_passwd = yes ; then
2106                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2107         fi
2108         if test $ol_enable_shell = yes ; then
2109                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2110         fi
2111         if test $ol_enable_sql = yes ; then
2112                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2113         fi
2114         if test $ol_enable_modules = yes ; then
2115                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2116         fi
2117         if test $ol_enable_multimaster = yes ; then
2118                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2119         fi
2120         if test $ol_enable_wrappers = yes ; then
2121                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2122         fi
2123         if test $ol_enable_phonetic = yes ; then
2124                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2125         fi
2126         if test $ol_enable_rlookups = yes ; then
2127                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2128         fi
2129         if test $ol_enable_aci = yes ; then
2130                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2131         fi
2132         if test $ol_with_ldbm_api != auto ; then
2133                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2134         fi
2135         if test $ol_with_ldbm_type != auto ; then
2136                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2137         fi
2138         if test $ol_with_dnssrv_module != static ; then
2139                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2140         fi
2141         if test $ol_with_ldap_module != static ; then
2142                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2143         fi
2144         if test $ol_with_ldbm_module != static ; then
2145                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2146         fi
2147         if test $ol_with_passwd_module != static ; then
2148                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2149         fi
2150         if test $ol_with_shell_module != static ; then
2151                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2152         fi
2153         if test $ol_with_sql_module != static ; then
2154                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2155         fi
2156         if test $ol_enable_slurpd = yes ; then
2157                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2158         fi
2159
2160         # force settings to no
2161         ol_enable_dnssrv=no
2162         ol_enable_ldap=no
2163         ol_enable_ldbm=no
2164         ol_enable_passwd=no
2165         ol_enable_shell=no
2166         ol_enable_sql=no
2167
2168         ol_enable_modules=no
2169         ol_enable_phonetic=no
2170         ol_enable_rlookups=no
2171         ol_enable_aci=no
2172         ol_enable_wrappers=no
2173         ol_enable_dynamic=no
2174
2175         ol_with_ldbm_api=no
2176         ol_with_ldbm_type=no
2177
2178         ol_with_dnssrv_module=static
2179         ol_with_ldap_module=static
2180         ol_with_ldbm_module=static
2181         ol_with_passwd_module=static
2182         ol_with_shell_module=static
2183         ol_with_sql_module=static
2184
2185         ol_enable_slurpd=no
2186
2187 elif test $ol_enable_ldbm = no ; then
2188         
2189         if test $ol_with_ldbm_api != auto ; then
2190                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2191         fi
2192
2193         if test $ol_with_ldbm_type != auto ; then
2194                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2195         fi
2196
2197         if test $ol_with_ldbm_module != static ; then
2198                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2199         fi
2200
2201         if test $ol_enable_modules != yes -a \
2202                 $ol_enable_dnssrv = no -a \
2203                 $ol_enable_ldap = no -a \
2204                 $ol_enable_passwd = no -a \
2205                 $ol_enable_shell = no -a \
2206                 $ol_enable_sql = no ; then
2207                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2208         fi
2209
2210         ol_with_ldbm_api=no
2211         ol_with_ldbm_type=no
2212         ol_with_ldbm_module=static
2213
2214 else
2215                 if test $ol_with_ldbm_api = gdbm -a \
2216                 $ol_with_ldbm_type = btree ; then
2217                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2218         fi
2219         if test $ol_with_ldbm_api = mdbm -a \
2220                 $ol_with_ldbm_type = btree ; then
2221                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2222         fi
2223         if test $ol_with_ldbm_api = ndbm -a \
2224                 $ol_with_ldbm_type = btree ; then
2225                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2226         fi
2227 fi
2228
2229 if test $ol_enable_slurpd = yes ; then
2230                 if test $ol_with_threads = no ; then
2231                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2232         fi
2233 fi
2234
2235 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2236         if test $ol_with_kerberos = no ; then
2237                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2238         fi
2239         ol_with_kerberos=yes
2240 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2241         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2242                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2243         fi
2244         ol_with_kerberos=no
2245 fi
2246
2247 if test $ol_enable_spasswd = yes ; then
2248         if test $ol_with_cyrus_sasl = no ; then
2249                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2250         fi
2251         ol_with_cyrus_sasl=yes
2252 fi
2253
2254 echo "$ac_t""done" 1>&6
2255
2256 LDAP_LIBS=
2257 LDIF_LIBS=
2258 LDBM_LIBS=
2259 LTHREAD_LIBS=
2260 LUTIL_LIBS=
2261
2262 SLAPD_LIBS=
2263 SLURPD_LIBS=
2264
2265 BUILD_SLAPD=no
2266 BUILD_SLURPD=no
2267
2268 BUILD_THREAD=no
2269
2270 BUILD_DNSSRV=no
2271 BUILD_LDAP=no
2272 BUILD_LDBM=no
2273 BUILD_PASSWD=no
2274 BUILD_SHELL=no
2275 BUILD_SQL=no
2276
2277 BUILD_DNSSRV_DYNAMIC=static
2278 BUILD_LDAP_DYNAMIC=static
2279 BUILD_LDBM_DYNAMIC=static
2280 BUILD_PASSWD_DYNAMIC=static
2281 BUILD_SHELL_DYNAMIC=static
2282 BUILD_SQL_DYNAMIC=static
2283
2284 SLAPD_MODULES_LDFLAGS=
2285 SLAPD_MODULES_CPPFLAGS=
2286 SLAPD_MODULES_LIST=
2287
2288 SLAPD_SQL_LDFLAGS=
2289 SLAPD_SQL_LIBS=
2290 SLAPD_SQL_INCLUDES=
2291
2292 KRB4_LIBS=
2293 KRB5_LIBS=
2294 READLINE_LIBS=
2295 SASL_LIBS=
2296 TERMCAP_LIBS=
2297 TLS_LIBS=
2298 MODULES_LIBS=
2299 AUTH_LIBS=
2300
2301
2302
2303 cat >> confdefs.h <<\EOF
2304 #define HAVE_MKVERSION 1
2305 EOF
2306
2307
2308
2309
2310 ol_aix_threads=no
2311 case "$target" in
2312 *-*-aix*)       if test -z "$CC" ; then
2313                 case "$ol_with_threads" in
2314                 auto | yes |  posix) ol_aix_threads=yes ;;
2315                 esac
2316         fi
2317 ;;
2318 esac
2319
2320 if test $ol_aix_threads = yes ; then
2321         if test -z "${CC}" ; then
2322                 for ac_prog in cc_r xlc_r cc
2323 do
2324 # Extract the first word of "$ac_prog", so it can be a program name with args.
2325 set dummy $ac_prog; ac_word=$2
2326 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2327 echo "configure:2328: checking for $ac_word" >&5
2328 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2329   echo $ac_n "(cached) $ac_c" 1>&6
2330 else
2331   if test -n "$CC"; then
2332   ac_cv_prog_CC="$CC" # Let the user override the test.
2333 else
2334   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2335   ac_dummy="$PATH"
2336   for ac_dir in $ac_dummy; do
2337     test -z "$ac_dir" && ac_dir=.
2338     if test -f $ac_dir/$ac_word; then
2339       ac_cv_prog_CC="$ac_prog"
2340       break
2341     fi
2342   done
2343   IFS="$ac_save_ifs"
2344 fi
2345 fi
2346 CC="$ac_cv_prog_CC"
2347 if test -n "$CC"; then
2348   echo "$ac_t""$CC" 1>&6
2349 else
2350   echo "$ac_t""no" 1>&6
2351 fi
2352
2353 test -n "$CC" && break
2354 done
2355
2356
2357                 if test "$CC" = cc ; then
2358                                                 if test $ol_with_threads != auto ; then
2359                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2360                         else
2361                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2362                         fi
2363                         ol_with_threads=no
2364                 fi
2365         fi
2366
2367         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2368                 ol_with_threads=posix
2369                 ol_cv_pthread_create=yes
2370         fi
2371 fi
2372
2373 if test -z "${CC}"; then
2374         for ac_prog in cc
2375 do
2376 # Extract the first word of "$ac_prog", so it can be a program name with args.
2377 set dummy $ac_prog; ac_word=$2
2378 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2379 echo "configure:2380: checking for $ac_word" >&5
2380 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2381   echo $ac_n "(cached) $ac_c" 1>&6
2382 else
2383   if test -n "$CC"; then
2384   ac_cv_prog_CC="$CC" # Let the user override the test.
2385 else
2386   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2387   ac_dummy="$PATH"
2388   for ac_dir in $ac_dummy; do
2389     test -z "$ac_dir" && ac_dir=.
2390     if test -f $ac_dir/$ac_word; then
2391       ac_cv_prog_CC="$ac_prog"
2392       break
2393     fi
2394   done
2395   IFS="$ac_save_ifs"
2396 fi
2397 fi
2398 CC="$ac_cv_prog_CC"
2399 if test -n "$CC"; then
2400   echo "$ac_t""$CC" 1>&6
2401 else
2402   echo "$ac_t""no" 1>&6
2403 fi
2404
2405 test -n "$CC" && break
2406 done
2407
2408 fi
2409
2410
2411
2412
2413 # Check whether --enable-fast-install or --disable-fast-install was given.
2414 if test "${enable_fast_install+set}" = set; then
2415   enableval="$enable_fast_install"
2416   p=${PACKAGE-default}
2417 case "$enableval" in
2418 yes) enable_fast_install=yes ;;
2419 no) enable_fast_install=no ;;
2420 *)
2421   enable_fast_install=no
2422   # Look at the argument we got.  We use all the common list separators.
2423   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2424   for pkg in $enableval; do
2425     if test "X$pkg" = "X$p"; then
2426       enable_fast_install=yes
2427     fi
2428   done
2429   IFS="$ac_save_ifs"
2430   ;;
2431 esac
2432 else
2433   enable_fast_install=yes
2434 fi
2435
2436 # Extract the first word of "ranlib", so it can be a program name with args.
2437 set dummy ranlib; ac_word=$2
2438 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2439 echo "configure:2440: checking for $ac_word" >&5
2440 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2441   echo $ac_n "(cached) $ac_c" 1>&6
2442 else
2443   if test -n "$RANLIB"; then
2444   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2445 else
2446   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2447   ac_dummy="$PATH"
2448   for ac_dir in $ac_dummy; do
2449     test -z "$ac_dir" && ac_dir=.
2450     if test -f $ac_dir/$ac_word; then
2451       ac_cv_prog_RANLIB="ranlib"
2452       break
2453     fi
2454   done
2455   IFS="$ac_save_ifs"
2456   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2457 fi
2458 fi
2459 RANLIB="$ac_cv_prog_RANLIB"
2460 if test -n "$RANLIB"; then
2461   echo "$ac_t""$RANLIB" 1>&6
2462 else
2463   echo "$ac_t""no" 1>&6
2464 fi
2465
2466 # Extract the first word of "gcc", so it can be a program name with args.
2467 set dummy gcc; ac_word=$2
2468 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2469 echo "configure:2470: checking for $ac_word" >&5
2470 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2471   echo $ac_n "(cached) $ac_c" 1>&6
2472 else
2473   if test -n "$CC"; then
2474   ac_cv_prog_CC="$CC" # Let the user override the test.
2475 else
2476   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2477   ac_dummy="$PATH"
2478   for ac_dir in $ac_dummy; do
2479     test -z "$ac_dir" && ac_dir=.
2480     if test -f $ac_dir/$ac_word; then
2481       ac_cv_prog_CC="gcc"
2482       break
2483     fi
2484   done
2485   IFS="$ac_save_ifs"
2486 fi
2487 fi
2488 CC="$ac_cv_prog_CC"
2489 if test -n "$CC"; then
2490   echo "$ac_t""$CC" 1>&6
2491 else
2492   echo "$ac_t""no" 1>&6
2493 fi
2494
2495 if test -z "$CC"; then
2496   # Extract the first word of "cc", so it can be a program name with args.
2497 set dummy cc; ac_word=$2
2498 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2499 echo "configure:2500: checking for $ac_word" >&5
2500 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2501   echo $ac_n "(cached) $ac_c" 1>&6
2502 else
2503   if test -n "$CC"; then
2504   ac_cv_prog_CC="$CC" # Let the user override the test.
2505 else
2506   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2507   ac_prog_rejected=no
2508   ac_dummy="$PATH"
2509   for ac_dir in $ac_dummy; do
2510     test -z "$ac_dir" && ac_dir=.
2511     if test -f $ac_dir/$ac_word; then
2512       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2513         ac_prog_rejected=yes
2514         continue
2515       fi
2516       ac_cv_prog_CC="cc"
2517       break
2518     fi
2519   done
2520   IFS="$ac_save_ifs"
2521 if test $ac_prog_rejected = yes; then
2522   # We found a bogon in the path, so make sure we never use it.
2523   set dummy $ac_cv_prog_CC
2524   shift
2525   if test $# -gt 0; then
2526     # We chose a different compiler from the bogus one.
2527     # However, it has the same basename, so the bogon will be chosen
2528     # first if we set CC to just the basename; use the full file name.
2529     shift
2530     set dummy "$ac_dir/$ac_word" "$@"
2531     shift
2532     ac_cv_prog_CC="$@"
2533   fi
2534 fi
2535 fi
2536 fi
2537 CC="$ac_cv_prog_CC"
2538 if test -n "$CC"; then
2539   echo "$ac_t""$CC" 1>&6
2540 else
2541   echo "$ac_t""no" 1>&6
2542 fi
2543
2544   if test -z "$CC"; then
2545     case "`uname -s`" in
2546     *win32* | *WIN32* | *CYGWIN*)
2547       # Extract the first word of "cl", so it can be a program name with args.
2548 set dummy cl; ac_word=$2
2549 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2550 echo "configure:2551: checking for $ac_word" >&5
2551 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2552   echo $ac_n "(cached) $ac_c" 1>&6
2553 else
2554   if test -n "$CC"; then
2555   ac_cv_prog_CC="$CC" # Let the user override the test.
2556 else
2557   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2558   ac_dummy="$PATH"
2559   for ac_dir in $ac_dummy; do
2560     test -z "$ac_dir" && ac_dir=.
2561     if test -f $ac_dir/$ac_word; then
2562       ac_cv_prog_CC="cl"
2563       break
2564     fi
2565   done
2566   IFS="$ac_save_ifs"
2567 fi
2568 fi
2569 CC="$ac_cv_prog_CC"
2570 if test -n "$CC"; then
2571   echo "$ac_t""$CC" 1>&6
2572 else
2573   echo "$ac_t""no" 1>&6
2574 fi
2575  ;;
2576     esac
2577   fi
2578   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2579 fi
2580
2581 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2582 echo "configure:2583: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2583
2584 ac_ext=c
2585 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2586 ac_cpp='$CPP $CPPFLAGS'
2587 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2588 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2589 cross_compiling=$ac_cv_prog_cc_cross
2590
2591 cat > conftest.$ac_ext << EOF
2592
2593 #line 2594 "configure"
2594 #include "confdefs.h"
2595
2596 main(){return(0);}
2597 EOF
2598 if { (eval echo configure:2599: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2599   ac_cv_prog_cc_works=yes
2600   # If we can't run a trivial program, we are probably using a cross compiler.
2601   if (./conftest; exit) 2>/dev/null; then
2602     ac_cv_prog_cc_cross=no
2603   else
2604     ac_cv_prog_cc_cross=yes
2605   fi
2606 else
2607   echo "configure: failed program was:" >&5
2608   cat conftest.$ac_ext >&5
2609   ac_cv_prog_cc_works=no
2610 fi
2611 rm -fr conftest*
2612 ac_ext=c
2613 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2614 ac_cpp='$CPP $CPPFLAGS'
2615 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2616 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2617 cross_compiling=$ac_cv_prog_cc_cross
2618
2619 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2620 if test $ac_cv_prog_cc_works = no; then
2621   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2622 fi
2623 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2624 echo "configure:2625: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2625 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2626 cross_compiling=$ac_cv_prog_cc_cross
2627
2628 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2629 echo "configure:2630: checking whether we are using GNU C" >&5
2630 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2631   echo $ac_n "(cached) $ac_c" 1>&6
2632 else
2633   cat > conftest.c <<EOF
2634 #ifdef __GNUC__
2635   yes;
2636 #endif
2637 EOF
2638 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2639   ac_cv_prog_gcc=yes
2640 else
2641   ac_cv_prog_gcc=no
2642 fi
2643 fi
2644
2645 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2646
2647 if test $ac_cv_prog_gcc = yes; then
2648   GCC=yes
2649 else
2650   GCC=
2651 fi
2652
2653 ac_test_CFLAGS="${CFLAGS+set}"
2654 ac_save_CFLAGS="$CFLAGS"
2655 CFLAGS=
2656 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2657 echo "configure:2658: checking whether ${CC-cc} accepts -g" >&5
2658 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2659   echo $ac_n "(cached) $ac_c" 1>&6
2660 else
2661   echo 'void f(){}' > conftest.c
2662 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2663   ac_cv_prog_cc_g=yes
2664 else
2665   ac_cv_prog_cc_g=no
2666 fi
2667 rm -f conftest*
2668
2669 fi
2670
2671 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2672 if test "$ac_test_CFLAGS" = set; then
2673   CFLAGS="$ac_save_CFLAGS"
2674 elif test $ac_cv_prog_cc_g = yes; then
2675   if test "$GCC" = yes; then
2676     CFLAGS="-g -O2"
2677   else
2678     CFLAGS="-g"
2679   fi
2680 else
2681   if test "$GCC" = yes; then
2682     CFLAGS="-O2"
2683   else
2684     CFLAGS=
2685   fi
2686 fi
2687
2688 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2689 if test "${with_gnu_ld+set}" = set; then
2690   withval="$with_gnu_ld"
2691   test "$withval" = no || with_gnu_ld=yes
2692 else
2693   with_gnu_ld=no
2694 fi
2695
2696 ac_prog=ld
2697 if test "$ac_cv_prog_gcc" = yes; then
2698   # Check if gcc -print-prog-name=ld gives a path.
2699   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2700 echo "configure:2701: checking for ld used by GCC" >&5
2701   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2702   case "$ac_prog" in
2703     # Accept absolute paths.
2704     [\\/]* | [A-Za-z]:[\\/]*)
2705       re_direlt='/[^/][^/]*/\.\./'
2706       # Canonicalize the path of ld
2707       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2708       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2709         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2710       done
2711       test -z "$LD" && LD="$ac_prog"
2712       ;;
2713   "")
2714     # If it fails, then pretend we aren't using GCC.
2715     ac_prog=ld
2716     ;;
2717   *)
2718     # If it is relative, then search for the first ld in PATH.
2719     with_gnu_ld=unknown
2720     ;;
2721   esac
2722 elif test "$with_gnu_ld" = yes; then
2723   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2724 echo "configure:2725: checking for GNU ld" >&5
2725 else
2726   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2727 echo "configure:2728: checking for non-GNU ld" >&5
2728 fi
2729 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2730   echo $ac_n "(cached) $ac_c" 1>&6
2731 else
2732   if test -z "$LD"; then
2733   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2734   for ac_dir in $PATH; do
2735     test -z "$ac_dir" && ac_dir=.
2736     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2737       ac_cv_path_LD="$ac_dir/$ac_prog"
2738       # Check to see if the program is GNU ld.  I'd rather use --version,
2739       # but apparently some GNU ld's only accept -v.
2740       # Break only if it was the GNU/non-GNU ld that we prefer.
2741       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2742         test "$with_gnu_ld" != no && break
2743       else
2744         test "$with_gnu_ld" != yes && break
2745       fi
2746     fi
2747   done
2748   IFS="$ac_save_ifs"
2749 else
2750   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2751 fi
2752 fi
2753
2754 LD="$ac_cv_path_LD"
2755 if test -n "$LD"; then
2756   echo "$ac_t""$LD" 1>&6
2757 else
2758   echo "$ac_t""no" 1>&6
2759 fi
2760 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2761 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2762 echo "configure:2763: checking if the linker ($LD) is GNU ld" >&5
2763 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2764   echo $ac_n "(cached) $ac_c" 1>&6
2765 else
2766   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2767 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2768   ac_cv_prog_gnu_ld=yes
2769 else
2770   ac_cv_prog_gnu_ld=no
2771 fi
2772 fi
2773
2774 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2775
2776
2777 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2778 echo "configure:2779: checking for BSD-compatible nm" >&5
2779 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2780   echo $ac_n "(cached) $ac_c" 1>&6
2781 else
2782   if test -n "$NM"; then
2783   # Let the user override the test.
2784   ac_cv_path_NM="$NM"
2785 else
2786   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2787   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2788     test -z "$ac_dir" && ac_dir=.
2789     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2790       # Check to see if the nm accepts a BSD-compat flag.
2791       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2792       #   nm: unknown option "B" ignored
2793       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2794         ac_cv_path_NM="$ac_dir/nm -B"
2795         break
2796       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2797         ac_cv_path_NM="$ac_dir/nm -p"
2798         break
2799       else
2800         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2801         continue # so that we can try to find one that supports BSD flags
2802       fi
2803     fi
2804   done
2805   IFS="$ac_save_ifs"
2806   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2807 fi
2808 fi
2809
2810 NM="$ac_cv_path_NM"
2811 echo "$ac_t""$NM" 1>&6
2812
2813 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2814 echo "configure:2815: checking whether ln -s works" >&5
2815 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2816   echo $ac_n "(cached) $ac_c" 1>&6
2817 else
2818   rm -f conftestdata
2819 if ln -s X conftestdata 2>/dev/null
2820 then
2821   rm -f conftestdata
2822   ac_cv_prog_LN_S="ln -s"
2823 else
2824   ac_cv_prog_LN_S=ln
2825 fi
2826 fi
2827 LN_S="$ac_cv_prog_LN_S"
2828 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2829   echo "$ac_t""yes" 1>&6
2830 else
2831   echo "$ac_t""no" 1>&6
2832 fi
2833
2834 if test $host != $build; then
2835   ac_tool_prefix=${host_alias}-
2836 else
2837   ac_tool_prefix=
2838 fi
2839
2840
2841 case "$target" in
2842 NONE) lt_target="$host" ;;
2843 *) lt_target="$target" ;;
2844 esac
2845
2846 # Check for any special flags to pass to ltconfig.
2847 libtool_flags="--cache-file=$cache_file"
2848 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2849 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2850 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2851 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2852 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2853 libtool_flags="$libtool_flags --enable-dlopen"
2854 libtool_flags="$libtool_flags --enable-win32-dll"
2855 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2856 if test "${enable_libtool_lock+set}" = set; then
2857   enableval="$enable_libtool_lock"
2858   :
2859 fi
2860
2861 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2862 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2863
2864 # Some flags need to be propagated to the compiler or linker for good
2865 # libtool support.
2866 case "$lt_target" in
2867 *-*-irix6*)
2868   # Find out which ABI we are using.
2869   echo '#line 2870 "configure"' > conftest.$ac_ext
2870   if { (eval echo configure:2871: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2871     case "`/usr/bin/file conftest.o`" in
2872     *32-bit*)
2873       LD="${LD-ld} -32"
2874       ;;
2875     *N32*)
2876       LD="${LD-ld} -n32"
2877       ;;
2878     *64-bit*)
2879       LD="${LD-ld} -64"
2880       ;;
2881     esac
2882   fi
2883   rm -rf conftest*
2884   ;;
2885
2886 *-*-sco3.2v5*)
2887   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2888   SAVE_CFLAGS="$CFLAGS"
2889   CFLAGS="$CFLAGS -belf"
2890   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2891 echo "configure:2892: checking whether the C compiler needs -belf" >&5
2892 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2893   echo $ac_n "(cached) $ac_c" 1>&6
2894 else
2895   cat > conftest.$ac_ext <<EOF
2896 #line 2897 "configure"
2897 #include "confdefs.h"
2898
2899 int main() {
2900
2901 ; return 0; }
2902 EOF
2903 if { (eval echo configure:2904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2904   rm -rf conftest*
2905   lt_cv_cc_needs_belf=yes
2906 else
2907   echo "configure: failed program was:" >&5
2908   cat conftest.$ac_ext >&5
2909   rm -rf conftest*
2910   lt_cv_cc_needs_belf=no
2911 fi
2912 rm -f conftest*
2913 fi
2914
2915 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2916   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2917     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2918     CFLAGS="$SAVE_CFLAGS"
2919   fi
2920   ;;
2921
2922 *-*-cygwin* | *-*-mingw*)
2923   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2924 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2925 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2926 echo "configure:2927: checking for $ac_word" >&5
2927 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2928   echo $ac_n "(cached) $ac_c" 1>&6
2929 else
2930   if test -n "$DLLTOOL"; then
2931   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2932 else
2933   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2934   ac_dummy="$PATH"
2935   for ac_dir in $ac_dummy; do
2936     test -z "$ac_dir" && ac_dir=.
2937     if test -f $ac_dir/$ac_word; then
2938       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2939       break
2940     fi
2941   done
2942   IFS="$ac_save_ifs"
2943 fi
2944 fi
2945 DLLTOOL="$ac_cv_prog_DLLTOOL"
2946 if test -n "$DLLTOOL"; then
2947   echo "$ac_t""$DLLTOOL" 1>&6
2948 else
2949   echo "$ac_t""no" 1>&6
2950 fi
2951
2952
2953 if test -z "$ac_cv_prog_DLLTOOL"; then
2954 if test -n "$ac_tool_prefix"; then
2955   # Extract the first word of "dlltool", so it can be a program name with args.
2956 set dummy dlltool; ac_word=$2
2957 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2958 echo "configure:2959: checking for $ac_word" >&5
2959 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2960   echo $ac_n "(cached) $ac_c" 1>&6
2961 else
2962   if test -n "$DLLTOOL"; then
2963   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2964 else
2965   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2966   ac_dummy="$PATH"
2967   for ac_dir in $ac_dummy; do
2968     test -z "$ac_dir" && ac_dir=.
2969     if test -f $ac_dir/$ac_word; then
2970       ac_cv_prog_DLLTOOL="dlltool"
2971       break
2972     fi
2973   done
2974   IFS="$ac_save_ifs"
2975   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
2976 fi
2977 fi
2978 DLLTOOL="$ac_cv_prog_DLLTOOL"
2979 if test -n "$DLLTOOL"; then
2980   echo "$ac_t""$DLLTOOL" 1>&6
2981 else
2982   echo "$ac_t""no" 1>&6
2983 fi
2984
2985 else
2986   DLLTOOL="false"
2987 fi
2988 fi
2989
2990   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
2991 set dummy ${ac_tool_prefix}as; ac_word=$2
2992 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2993 echo "configure:2994: checking for $ac_word" >&5
2994 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
2995   echo $ac_n "(cached) $ac_c" 1>&6
2996 else
2997   if test -n "$AS"; then
2998   ac_cv_prog_AS="$AS" # Let the user override the test.
2999 else
3000   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3001   ac_dummy="$PATH"
3002   for ac_dir in $ac_dummy; do
3003     test -z "$ac_dir" && ac_dir=.
3004     if test -f $ac_dir/$ac_word; then
3005       ac_cv_prog_AS="${ac_tool_prefix}as"
3006       break
3007     fi
3008   done
3009   IFS="$ac_save_ifs"
3010 fi
3011 fi
3012 AS="$ac_cv_prog_AS"
3013 if test -n "$AS"; then
3014   echo "$ac_t""$AS" 1>&6
3015 else
3016   echo "$ac_t""no" 1>&6
3017 fi
3018
3019
3020 if test -z "$ac_cv_prog_AS"; then
3021 if test -n "$ac_tool_prefix"; then
3022   # Extract the first word of "as", so it can be a program name with args.
3023 set dummy as; ac_word=$2
3024 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3025 echo "configure:3026: checking for $ac_word" >&5
3026 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3027   echo $ac_n "(cached) $ac_c" 1>&6
3028 else
3029   if test -n "$AS"; then
3030   ac_cv_prog_AS="$AS" # Let the user override the test.
3031 else
3032   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3033   ac_dummy="$PATH"
3034   for ac_dir in $ac_dummy; do
3035     test -z "$ac_dir" && ac_dir=.
3036     if test -f $ac_dir/$ac_word; then
3037       ac_cv_prog_AS="as"
3038       break
3039     fi
3040   done
3041   IFS="$ac_save_ifs"
3042   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3043 fi
3044 fi
3045 AS="$ac_cv_prog_AS"
3046 if test -n "$AS"; then
3047   echo "$ac_t""$AS" 1>&6
3048 else
3049   echo "$ac_t""no" 1>&6
3050 fi
3051
3052 else
3053   AS="false"
3054 fi
3055 fi
3056
3057   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3058 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3059 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3060 echo "configure:3061: checking for $ac_word" >&5
3061 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3062   echo $ac_n "(cached) $ac_c" 1>&6
3063 else
3064   if test -n "$OBJDUMP"; then
3065   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3066 else
3067   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3068   ac_dummy="$PATH"
3069   for ac_dir in $ac_dummy; do
3070     test -z "$ac_dir" && ac_dir=.
3071     if test -f $ac_dir/$ac_word; then
3072       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3073       break
3074     fi
3075   done
3076   IFS="$ac_save_ifs"
3077 fi
3078 fi
3079 OBJDUMP="$ac_cv_prog_OBJDUMP"
3080 if test -n "$OBJDUMP"; then
3081   echo "$ac_t""$OBJDUMP" 1>&6
3082 else
3083   echo "$ac_t""no" 1>&6
3084 fi
3085
3086
3087 if test -z "$ac_cv_prog_OBJDUMP"; then
3088 if test -n "$ac_tool_prefix"; then
3089   # Extract the first word of "objdump", so it can be a program name with args.
3090 set dummy objdump; ac_word=$2
3091 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3092 echo "configure:3093: checking for $ac_word" >&5
3093 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3094   echo $ac_n "(cached) $ac_c" 1>&6
3095 else
3096   if test -n "$OBJDUMP"; then
3097   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3098 else
3099   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3100   ac_dummy="$PATH"
3101   for ac_dir in $ac_dummy; do
3102     test -z "$ac_dir" && ac_dir=.
3103     if test -f $ac_dir/$ac_word; then
3104       ac_cv_prog_OBJDUMP="objdump"
3105       break
3106     fi
3107   done
3108   IFS="$ac_save_ifs"
3109   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3110 fi
3111 fi
3112 OBJDUMP="$ac_cv_prog_OBJDUMP"
3113 if test -n "$OBJDUMP"; then
3114   echo "$ac_t""$OBJDUMP" 1>&6
3115 else
3116   echo "$ac_t""no" 1>&6
3117 fi
3118
3119 else
3120   OBJDUMP="false"
3121 fi
3122 fi
3123
3124   ;;
3125
3126 esac
3127
3128
3129 # Save cache, so that ltconfig can load it
3130
3131
3132 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3133 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3134 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3135 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3136 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3137 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3138 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3139 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3140
3141 # Reload cache, that may have been modified by ltconfig
3142
3143
3144 # This can be used to rebuild libtool when needed
3145 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3146
3147 # Always use our own libtool.
3148 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3149
3150 # Redirect the config.log output again, so that the ltconfig log is not
3151 # clobbered by the next message.
3152 exec 5>>./config.log
3153
3154
3155 for ac_prog in mawk gawk nawk awk
3156 do
3157 # Extract the first word of "$ac_prog", so it can be a program name with args.
3158 set dummy $ac_prog; ac_word=$2
3159 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3160 echo "configure:3161: checking for $ac_word" >&5
3161 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3162   echo $ac_n "(cached) $ac_c" 1>&6
3163 else
3164   if test -n "$AWK"; then
3165   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3166 else
3167   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3168   ac_dummy="$PATH"
3169   for ac_dir in $ac_dummy; do
3170     test -z "$ac_dir" && ac_dir=.
3171     if test -f $ac_dir/$ac_word; then
3172       ac_cv_prog_AWK="$ac_prog"
3173       break
3174     fi
3175   done
3176   IFS="$ac_save_ifs"
3177 fi
3178 fi
3179 AWK="$ac_cv_prog_AWK"
3180 if test -n "$AWK"; then
3181   echo "$ac_t""$AWK" 1>&6
3182 else
3183   echo "$ac_t""no" 1>&6
3184 fi
3185
3186 test -n "$AWK" && break
3187 done
3188
3189 # test for ln hardlink support
3190 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3191 echo "configure:3192: checking whether ln works" >&5
3192 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3193   echo $ac_n "(cached) $ac_c" 1>&6
3194 else
3195   rm -f conftest.src conftest.dst
3196 echo "conftest" > conftest.src
3197 if ln conftest.src conftest.dst 2>/dev/null
3198 then
3199   ol_cv_prog_LN_H="ln"
3200 else
3201   ol_cv_prog_LN_H="cp"
3202 fi
3203 rm -f conftest.src conftest.dst
3204
3205 fi
3206 LN_H="$ol_cv_prog_LN_H"
3207 if test "$ol_cv_prog_LN_H" = "ln"; then
3208         echo "$ac_t""yes" 1>&6
3209 else
3210         echo "$ac_t""no" 1>&6
3211 fi
3212
3213 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3214 echo "configure:3215: checking whether ln -s works" >&5
3215 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3216   echo $ac_n "(cached) $ac_c" 1>&6
3217 else
3218   rm -f conftestdata
3219 if ln -s X conftestdata 2>/dev/null
3220 then
3221   rm -f conftestdata
3222   ac_cv_prog_LN_S="ln -s"
3223 else
3224   ac_cv_prog_LN_S=ln
3225 fi
3226 fi
3227 LN_S="$ac_cv_prog_LN_S"
3228 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3229   echo "$ac_t""yes" 1>&6
3230 else
3231   echo "$ac_t""no" 1>&6
3232 fi
3233
3234
3235 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3236         LN_S="$LN_H"
3237 fi
3238
3239 # Extract the first word of "sendmail", so it can be a program name with args.
3240 set dummy sendmail; ac_word=$2
3241 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3242 echo "configure:3243: checking for $ac_word" >&5
3243 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3244   echo $ac_n "(cached) $ac_c" 1>&6
3245 else
3246   case "$SENDMAIL" in
3247   /*)
3248   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3249   ;;
3250   ?:/*)
3251   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3252   ;;
3253   *)
3254   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3255   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3256   for ac_dir in $ac_dummy; do 
3257     test -z "$ac_dir" && ac_dir=.
3258     if test -f $ac_dir/$ac_word; then
3259       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3260       break
3261     fi
3262   done
3263   IFS="$ac_save_ifs"
3264   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3265   ;;
3266 esac
3267 fi
3268 SENDMAIL="$ac_cv_path_SENDMAIL"
3269 if test -n "$SENDMAIL"; then
3270   echo "$ac_t""$SENDMAIL" 1>&6
3271 else
3272   echo "$ac_t""no" 1>&6
3273 fi
3274
3275 # Extract the first word of "vi", so it can be a program name with args.
3276 set dummy vi; ac_word=$2
3277 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3278 echo "configure:3279: checking for $ac_word" >&5
3279 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3280   echo $ac_n "(cached) $ac_c" 1>&6
3281 else
3282   case "$EDITOR" in
3283   /*)
3284   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3285   ;;
3286   ?:/*)
3287   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3288   ;;
3289   *)
3290   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3291   ac_dummy="$PATH:/usr/ucb"
3292   for ac_dir in $ac_dummy; do 
3293     test -z "$ac_dir" && ac_dir=.
3294     if test -f $ac_dir/$ac_word; then
3295       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3296       break
3297     fi
3298   done
3299   IFS="$ac_save_ifs"
3300   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3301   ;;
3302 esac
3303 fi
3304 EDITOR="$ac_cv_path_EDITOR"
3305 if test -n "$EDITOR"; then
3306   echo "$ac_t""$EDITOR" 1>&6
3307 else
3308   echo "$ac_t""no" 1>&6
3309 fi
3310
3311 # Extract the first word of "finger", so it can be a program name with args.
3312 set dummy finger; ac_word=$2
3313 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3314 echo "configure:3315: checking for $ac_word" >&5
3315 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3316   echo $ac_n "(cached) $ac_c" 1>&6
3317 else
3318   case "$FINGER" in
3319   /*)
3320   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3321   ;;
3322   ?:/*)
3323   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3324   ;;
3325   *)
3326   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3327   ac_dummy="$PATH:/usr/ucb"
3328   for ac_dir in $ac_dummy; do 
3329     test -z "$ac_dir" && ac_dir=.
3330     if test -f $ac_dir/$ac_word; then
3331       ac_cv_path_FINGER="$ac_dir/$ac_word"
3332       break
3333     fi
3334   done
3335   IFS="$ac_save_ifs"
3336   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3337   ;;
3338 esac
3339 fi
3340 FINGER="$ac_cv_path_FINGER"
3341 if test -n "$FINGER"; then
3342   echo "$ac_t""$FINGER" 1>&6
3343 else
3344   echo "$ac_t""no" 1>&6
3345 fi
3346
3347
3348 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3349 echo "configure:3350: checking how to run the C preprocessor" >&5
3350 # On Suns, sometimes $CPP names a directory.
3351 if test -n "$CPP" && test -d "$CPP"; then
3352   CPP=
3353 fi
3354 if test -z "$CPP"; then
3355 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3356   echo $ac_n "(cached) $ac_c" 1>&6
3357 else
3358     # This must be in double quotes, not single quotes, because CPP may get
3359   # substituted into the Makefile and "${CC-cc}" will confuse make.
3360   CPP="${CC-cc} -E"
3361   # On the NeXT, cc -E runs the code through the compiler's parser,
3362   # not just through cpp.
3363   cat > conftest.$ac_ext <<EOF
3364 #line 3365 "configure"
3365 #include "confdefs.h"
3366 #include <assert.h>
3367 Syntax Error
3368 EOF
3369 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3370 { (eval echo configure:3371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3371 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3372 if test -z "$ac_err"; then
3373   :
3374 else
3375   echo "$ac_err" >&5
3376   echo "configure: failed program was:" >&5
3377   cat conftest.$ac_ext >&5
3378   rm -rf conftest*
3379   CPP="${CC-cc} -E -traditional-cpp"
3380   cat > conftest.$ac_ext <<EOF
3381 #line 3382 "configure"
3382 #include "confdefs.h"
3383 #include <assert.h>
3384 Syntax Error
3385 EOF
3386 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3387 { (eval echo configure:3388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3388 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3389 if test -z "$ac_err"; then
3390   :
3391 else
3392   echo "$ac_err" >&5
3393   echo "configure: failed program was:" >&5
3394   cat conftest.$ac_ext >&5
3395   rm -rf conftest*
3396   CPP="${CC-cc} -nologo -E"
3397   cat > conftest.$ac_ext <<EOF
3398 #line 3399 "configure"
3399 #include "confdefs.h"
3400 #include <assert.h>
3401 Syntax Error
3402 EOF
3403 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3404 { (eval echo configure:3405: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3405 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3406 if test -z "$ac_err"; then
3407   :
3408 else
3409   echo "$ac_err" >&5
3410   echo "configure: failed program was:" >&5
3411   cat conftest.$ac_ext >&5
3412   rm -rf conftest*
3413   CPP=/lib/cpp
3414 fi
3415 rm -f conftest*
3416 fi
3417 rm -f conftest*
3418 fi
3419 rm -f conftest*
3420   ac_cv_prog_CPP="$CPP"
3421 fi
3422   CPP="$ac_cv_prog_CPP"
3423 else
3424   ac_cv_prog_CPP="$CPP"
3425 fi
3426 echo "$ac_t""$CPP" 1>&6
3427
3428
3429 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3430         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3431
3432 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3433         echo "configure: warning: programs compiled here do run here..." 1>&2
3434         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3435
3436 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3437         echo "configure: warning: programs compiled here do not run here..." 1>&2
3438         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3439 fi
3440
3441 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3442 echo "configure:3443: checking for AIX" >&5
3443 cat > conftest.$ac_ext <<EOF
3444 #line 3445 "configure"
3445 #include "confdefs.h"
3446 #ifdef _AIX
3447   yes
3448 #endif
3449
3450 EOF
3451 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3452   egrep "yes" >/dev/null 2>&1; then
3453   rm -rf conftest*
3454   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3455 #define _ALL_SOURCE 1
3456 EOF
3457
3458 else
3459   rm -rf conftest*
3460   echo "$ac_t""no" 1>&6
3461 fi
3462 rm -f conftest*
3463
3464
3465 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3466 echo "configure:3467: checking for POSIXized ISC" >&5
3467 if test -d /etc/conf/kconfig.d &&
3468   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3469 then
3470   echo "$ac_t""yes" 1>&6
3471   ISC=yes # If later tests want to check for ISC.
3472   cat >> confdefs.h <<\EOF
3473 #define _POSIX_SOURCE 1
3474 EOF
3475
3476   if test "$GCC" = yes; then
3477     CC="$CC -posix"
3478   else
3479     CC="$CC -Xp"
3480   fi
3481 else
3482   echo "$ac_t""no" 1>&6
3483   ISC=
3484 fi
3485
3486 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3487 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3488 echo "configure:3489: checking for minix/config.h" >&5
3489 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3490   echo $ac_n "(cached) $ac_c" 1>&6
3491 else
3492   cat > conftest.$ac_ext <<EOF
3493 #line 3494 "configure"
3494 #include "confdefs.h"
3495 #include <minix/config.h>
3496 EOF
3497 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3498 { (eval echo configure:3499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3499 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3500 if test -z "$ac_err"; then
3501   rm -rf conftest*
3502   eval "ac_cv_header_$ac_safe=yes"
3503 else
3504   echo "$ac_err" >&5
3505   echo "configure: failed program was:" >&5
3506   cat conftest.$ac_ext >&5
3507   rm -rf conftest*
3508   eval "ac_cv_header_$ac_safe=no"
3509 fi
3510 rm -f conftest*
3511 fi
3512 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3513   echo "$ac_t""yes" 1>&6
3514   MINIX=yes
3515 else
3516   echo "$ac_t""no" 1>&6
3517 MINIX=
3518 fi
3519
3520 if test "$MINIX" = yes; then
3521   cat >> confdefs.h <<\EOF
3522 #define _POSIX_SOURCE 1
3523 EOF
3524
3525   cat >> confdefs.h <<\EOF
3526 #define _POSIX_1_SOURCE 2
3527 EOF
3528
3529   cat >> confdefs.h <<\EOF
3530 #define _MINIX 1
3531 EOF
3532
3533 fi
3534
3535
3536 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3537 echo "configure:3538: checking for Cygwin environment" >&5
3538 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3539   echo $ac_n "(cached) $ac_c" 1>&6
3540 else
3541   cat > conftest.$ac_ext <<EOF
3542 #line 3543 "configure"
3543 #include "confdefs.h"
3544
3545 int main() {
3546
3547 #ifndef __CYGWIN__
3548 #define __CYGWIN__ __CYGWIN32__
3549 #endif
3550 return __CYGWIN__;
3551 ; return 0; }
3552 EOF
3553 if { (eval echo configure:3554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3554   rm -rf conftest*
3555   ac_cv_cygwin=yes
3556 else
3557   echo "configure: failed program was:" >&5
3558   cat conftest.$ac_ext >&5
3559   rm -rf conftest*
3560   ac_cv_cygwin=no
3561 fi
3562 rm -f conftest*
3563 fi
3564
3565 echo "$ac_t""$ac_cv_cygwin" 1>&6
3566 CYGWIN=
3567 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3568 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3569 echo "configure:3570: checking for mingw32 environment" >&5
3570 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3571   echo $ac_n "(cached) $ac_c" 1>&6
3572 else
3573   cat > conftest.$ac_ext <<EOF
3574 #line 3575 "configure"
3575 #include "confdefs.h"
3576
3577 int main() {
3578 return __MINGW32__;
3579 ; return 0; }
3580 EOF
3581 if { (eval echo configure:3582: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3582   rm -rf conftest*
3583   ac_cv_mingw32=yes
3584 else
3585   echo "configure: failed program was:" >&5
3586   cat conftest.$ac_ext >&5
3587   rm -rf conftest*
3588   ac_cv_mingw32=no
3589 fi
3590 rm -f conftest*
3591 fi
3592
3593 echo "$ac_t""$ac_cv_mingw32" 1>&6
3594 MINGW32=
3595 test "$ac_cv_mingw32" = yes && MINGW32=yes
3596 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3597 echo "configure:3598: checking for EMX OS/2 environment" >&5
3598 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3599   echo $ac_n "(cached) $ac_c" 1>&6
3600 else
3601   cat > conftest.$ac_ext <<EOF
3602 #line 3603 "configure"
3603 #include "confdefs.h"
3604
3605 int main() {
3606 return __EMX__;
3607 ; return 0; }
3608 EOF
3609 if { (eval echo configure:3610: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3610   rm -rf conftest*
3611   ac_cv_emxos2=yes
3612 else
3613   echo "configure: failed program was:" >&5
3614   cat conftest.$ac_ext >&5
3615   rm -rf conftest*
3616   ac_cv_emxos2=no
3617 fi
3618 rm -f conftest*
3619 fi
3620
3621 echo "$ac_t""$ac_cv_emxos2" 1>&6
3622 EMXOS2=
3623 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3624
3625
3626
3627 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3628 echo "configure:3629: checking for executable suffix" >&5
3629 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3630   echo $ac_n "(cached) $ac_c" 1>&6
3631 else
3632   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3633   ac_cv_exeext=.exe
3634 else
3635   rm -f conftest*
3636   echo 'int main () { return 0; }' > conftest.$ac_ext
3637   ac_cv_exeext=
3638   if { (eval echo configure:3639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3639     for file in conftest.*; do
3640       case $file in
3641       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3642       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3643       esac
3644     done
3645   else
3646     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3647   fi
3648   rm -f conftest*
3649   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3650 fi
3651 fi
3652
3653 EXEEXT=""
3654 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3655 echo "$ac_t""${ac_cv_exeext}" 1>&6
3656 ac_exeext=$EXEEXT
3657
3658 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3659 echo "configure:3660: checking for object suffix" >&5
3660 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3661   echo $ac_n "(cached) $ac_c" 1>&6
3662 else
3663   rm -f conftest*
3664 echo 'int i = 1;' > conftest.$ac_ext
3665 if { (eval echo configure:3666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3666   for ac_file in conftest.*; do
3667     case $ac_file in
3668     *.c) ;;
3669     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3670     esac
3671   done
3672 else
3673   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3674 fi
3675 rm -f conftest*
3676 fi
3677
3678 echo "$ac_t""$ac_cv_objext" 1>&6
3679 OBJEXT=$ac_cv_objext
3680 ac_objext=$ac_cv_objext
3681
3682
3683 cat >> confdefs.h <<EOF
3684 #define EXEEXT "${EXEEXT}"
3685 EOF
3686
3687
3688 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3689 echo "configure:3690: checking for be_app in -lbe" >&5
3690 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3691 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3692   echo $ac_n "(cached) $ac_c" 1>&6
3693 else
3694   ac_save_LIBS="$LIBS"
3695 LIBS="-lbe -lroot -lnet $LIBS"
3696 cat > conftest.$ac_ext <<EOF
3697 #line 3698 "configure"
3698 #include "confdefs.h"
3699 /* Override any gcc2 internal prototype to avoid an error.  */
3700 /* We use char because int might match the return type of a gcc2
3701     builtin and then its argument prototype would still apply.  */
3702 char be_app();
3703
3704 int main() {
3705 be_app()
3706 ; return 0; }
3707 EOF
3708 if { (eval echo configure:3709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3709   rm -rf conftest*
3710   eval "ac_cv_lib_$ac_lib_var=yes"
3711 else
3712   echo "configure: failed program was:" >&5
3713   cat conftest.$ac_ext >&5
3714   rm -rf conftest*
3715   eval "ac_cv_lib_$ac_lib_var=no"
3716 fi
3717 rm -f conftest*
3718 LIBS="$ac_save_LIBS"
3719
3720 fi
3721 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3722   echo "$ac_t""yes" 1>&6
3723   LIBS="$LIBS -lbe -lroot -lnet"
3724 else
3725   echo "$ac_t""no" 1>&6
3726 :
3727 fi
3728
3729
3730
3731
3732
3733 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3734 echo "configure:3735: checking for ${CC-cc} option to accept ANSI C" >&5
3735 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3736   echo $ac_n "(cached) $ac_c" 1>&6
3737 else
3738   am_cv_prog_cc_stdc=no
3739 ac_save_CC="$CC"
3740 # Don't try gcc -ansi; that turns off useful extensions and
3741 # breaks some systems' header files.
3742 # AIX                   -qlanglvl=ansi
3743 # Ultrix and OSF/1      -std1
3744 # HP-UX 10.20 and later -Ae
3745 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3746 # SVR4                  -Xc -D__EXTENSIONS__
3747 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3748 do
3749   CC="$ac_save_CC $ac_arg"
3750   cat > conftest.$ac_ext <<EOF
3751 #line 3752 "configure"
3752 #include "confdefs.h"
3753 #include <stdarg.h>
3754 #include <stdio.h>
3755 #include <sys/types.h>
3756 #include <sys/stat.h>
3757 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3758 struct buf { int x; };
3759 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3760 static char *e (p, i)
3761      char **p;
3762      int i;
3763 {
3764   return p[i];
3765 }
3766 static char *f (char * (*g) (char **, int), char **p, ...)
3767 {
3768   char *s;
3769   va_list v;
3770   va_start (v,p);
3771   s = g (p, va_arg (v,int));
3772   va_end (v);
3773   return s;
3774 }
3775 int test (int i, double x);
3776 struct s1 {int (*f) (int a);};
3777 struct s2 {int (*f) (double a);};
3778 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3779 int argc;
3780 char **argv;
3781
3782 int main() {
3783
3784 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3785
3786 ; return 0; }
3787 EOF
3788 if { (eval echo configure:3789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3789   rm -rf conftest*
3790   am_cv_prog_cc_stdc="$ac_arg"; break
3791 else
3792   echo "configure: failed program was:" >&5
3793   cat conftest.$ac_ext >&5
3794 fi
3795 rm -f conftest*
3796 done
3797 CC="$ac_save_CC"
3798
3799 fi
3800
3801 if test -z "$am_cv_prog_cc_stdc"; then
3802   echo "$ac_t""none needed" 1>&6
3803 else
3804   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3805 fi
3806 case "x$am_cv_prog_cc_stdc" in
3807   x|xno) ;;
3808   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3809 esac
3810
3811 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3812         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3813 fi
3814
3815 # test for make depend flag
3816 OL_MKDEP=
3817 OL_MKDEP_FLAGS=
3818 if test -z "${MKDEP}"; then
3819         OL_MKDEP="${CC-cc}"
3820         if test -z "${MKDEP_FLAGS}"; then
3821                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3822 echo "configure:3823: checking for ${OL_MKDEP} depend flag" >&5
3823 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3824   echo $ac_n "(cached) $ac_c" 1>&6
3825 else
3826   
3827                         ol_cv_mkdep=no
3828                         for flag in "-M" "-xM"; do
3829                                 cat > conftest.c <<EOF
3830  noCode;
3831 EOF
3832                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3833: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3833                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3834                                 then
3835                                         if test ! -f conftest."${ac_object}" ; then
3836                                                 ol_cv_mkdep=$flag
3837                                                 OL_MKDEP_FLAGS="$flag"
3838                                                 break
3839                                         fi
3840                                 fi
3841                         done
3842                         rm -f conftest*
3843                 
3844 fi
3845
3846 echo "$ac_t""$ol_cv_mkdep" 1>&6
3847         else
3848                 cc_cv_mkdep=yes
3849                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3850         fi
3851 else
3852         cc_cv_mkdep=yes
3853         OL_MKDEP="${MKDEP}"
3854         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3855 fi
3856
3857
3858
3859 if test "${ol_cv_mkdep}" = no ; then
3860         # this will soon become an error
3861         echo "configure: warning: do not know how to generate dependencies" 1>&2
3862 fi
3863
3864 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3865 echo "configure:3866: checking for afopen in -ls" >&5
3866 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3867 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3868   echo $ac_n "(cached) $ac_c" 1>&6
3869 else
3870   ac_save_LIBS="$LIBS"
3871 LIBS="-ls  $LIBS"
3872 cat > conftest.$ac_ext <<EOF
3873 #line 3874 "configure"
3874 #include "confdefs.h"
3875 /* Override any gcc2 internal prototype to avoid an error.  */
3876 /* We use char because int might match the return type of a gcc2
3877     builtin and then its argument prototype would still apply.  */
3878 char afopen();
3879
3880 int main() {
3881 afopen()
3882 ; return 0; }
3883 EOF
3884 if { (eval echo configure:3885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3885   rm -rf conftest*
3886   eval "ac_cv_lib_$ac_lib_var=yes"
3887 else
3888   echo "configure: failed program was:" >&5
3889   cat conftest.$ac_ext >&5
3890   rm -rf conftest*
3891   eval "ac_cv_lib_$ac_lib_var=no"
3892 fi
3893 rm -f conftest*
3894 LIBS="$ac_save_LIBS"
3895
3896 fi
3897 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3898   echo "$ac_t""yes" 1>&6
3899   
3900         AUTH_LIBS=-ls
3901         cat >> confdefs.h <<\EOF
3902 #define HAVE_AIX_SECURITY 1
3903 EOF
3904
3905
3906 else
3907   echo "$ac_t""no" 1>&6
3908 fi
3909
3910
3911
3912 ol_link_modules=no
3913 if test $ol_enable_modules != no ; then
3914         for ac_hdr in ltdl.h
3915 do
3916 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3917 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3918 echo "configure:3919: checking for $ac_hdr" >&5
3919 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3920   echo $ac_n "(cached) $ac_c" 1>&6
3921 else
3922   cat > conftest.$ac_ext <<EOF
3923 #line 3924 "configure"
3924 #include "confdefs.h"
3925 #include <$ac_hdr>
3926 EOF
3927 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3928 { (eval echo configure:3929: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3929 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3930 if test -z "$ac_err"; then
3931   rm -rf conftest*
3932   eval "ac_cv_header_$ac_safe=yes"
3933 else
3934   echo "$ac_err" >&5
3935   echo "configure: failed program was:" >&5
3936   cat conftest.$ac_ext >&5
3937   rm -rf conftest*
3938   eval "ac_cv_header_$ac_safe=no"
3939 fi
3940 rm -f conftest*
3941 fi
3942 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3943   echo "$ac_t""yes" 1>&6
3944     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3945   cat >> confdefs.h <<EOF
3946 #define $ac_tr_hdr 1
3947 EOF
3948  
3949 else
3950   echo "$ac_t""no" 1>&6
3951 fi
3952 done
3953
3954
3955         if test $ac_cv_header_ltdl_h = no ; then
3956                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3957         fi
3958
3959         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3960 echo "configure:3961: checking for lt_dlinit in -lltdl" >&5
3961 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3962 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3963   echo $ac_n "(cached) $ac_c" 1>&6
3964 else
3965   ac_save_LIBS="$LIBS"
3966 LIBS="-lltdl  $LIBS"
3967 cat > conftest.$ac_ext <<EOF
3968 #line 3969 "configure"
3969 #include "confdefs.h"
3970 /* Override any gcc2 internal prototype to avoid an error.  */
3971 /* We use char because int might match the return type of a gcc2
3972     builtin and then its argument prototype would still apply.  */
3973 char lt_dlinit();
3974
3975 int main() {
3976 lt_dlinit()
3977 ; return 0; }
3978 EOF
3979 if { (eval echo configure:3980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3980   rm -rf conftest*
3981   eval "ac_cv_lib_$ac_lib_var=yes"
3982 else
3983   echo "configure: failed program was:" >&5
3984   cat conftest.$ac_ext >&5
3985   rm -rf conftest*
3986   eval "ac_cv_lib_$ac_lib_var=no"
3987 fi
3988 rm -f conftest*
3989 LIBS="$ac_save_LIBS"
3990
3991 fi
3992 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3993   echo "$ac_t""yes" 1>&6
3994   
3995             MODULES_LIBS=-lltdl
3996             cat >> confdefs.h <<\EOF
3997 #define HAVE_LIBLTDL 1
3998 EOF
3999
4000         
4001 else
4002   echo "$ac_t""no" 1>&6
4003 fi
4004
4005
4006         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4007                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4008         fi
4009         ol_link_modules=yes
4010 else
4011         ol_with_dnssrv_module=static
4012         ol_with_ldap_module=static
4013         ol_with_ldbm_module=static
4014         ol_with_passwd_module=static
4015         ol_with_shell_module=static
4016         ol_with_sql_module=static
4017 fi
4018
4019 # test for EBCDIC
4020 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4021 echo "configure:4022: checking for EBCDIC" >&5
4022 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4023   echo $ac_n "(cached) $ac_c" 1>&6
4024 else
4025   
4026         cat > conftest.$ac_ext <<EOF
4027 #line 4028 "configure"
4028 #include "confdefs.h"
4029
4030 #if !('M' == 0xd4)
4031 #include <__ASCII__/generate_error.h>
4032 #endif
4033
4034 EOF
4035 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4036 { (eval echo configure:4037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4037 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4038 if test -z "$ac_err"; then
4039   rm -rf conftest*
4040   ol_cv_cpp_ebcdic=yes
4041 else
4042   echo "$ac_err" >&5
4043   echo "configure: failed program was:" >&5
4044   cat conftest.$ac_ext >&5
4045   rm -rf conftest*
4046   ol_cv_cpp_ebcdic=no
4047 fi
4048 rm -f conftest*
4049 fi
4050
4051 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4052 if test $ol_cv_cpp_ebcdic = yes ; then
4053         cat >> confdefs.h <<\EOF
4054 #define HAVE_EBCDIC 1
4055 EOF
4056
4057 fi
4058
4059 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4060 echo "configure:4061: checking for ANSI C header files" >&5
4061 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4062   echo $ac_n "(cached) $ac_c" 1>&6
4063 else
4064   cat > conftest.$ac_ext <<EOF
4065 #line 4066 "configure"
4066 #include "confdefs.h"
4067 #include <stdlib.h>
4068 #include <stdarg.h>
4069 #include <string.h>
4070 #include <float.h>
4071 EOF
4072 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4073 { (eval echo configure:4074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4074 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4075 if test -z "$ac_err"; then
4076   rm -rf conftest*
4077   ol_cv_header_stdc=yes
4078 else
4079   echo "$ac_err" >&5
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   ol_cv_header_stdc=no
4084 fi
4085 rm -f conftest*
4086
4087 if test $ol_cv_header_stdc = yes; then
4088   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4089 cat > conftest.$ac_ext <<EOF
4090 #line 4091 "configure"
4091 #include "confdefs.h"
4092 #include <string.h>
4093 EOF
4094 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4095   egrep "memchr" >/dev/null 2>&1; then
4096   :
4097 else
4098   rm -rf conftest*
4099   ol_cv_header_stdc=no
4100 fi
4101 rm -f conftest*
4102
4103 fi
4104
4105 if test $ol_cv_header_stdc = yes; then
4106   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4107 cat > conftest.$ac_ext <<EOF
4108 #line 4109 "configure"
4109 #include "confdefs.h"
4110 #include <stdlib.h>
4111 EOF
4112 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4113   egrep "free" >/dev/null 2>&1; then
4114   :
4115 else
4116   rm -rf conftest*
4117   ol_cv_header_stdc=no
4118 fi
4119 rm -f conftest*
4120
4121 fi
4122
4123 if test $ol_cv_header_stdc = yes; then
4124   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4125 if test "$cross_compiling" = yes; then
4126   :
4127 else
4128   cat > conftest.$ac_ext <<EOF
4129 #line 4130 "configure"
4130 #include "confdefs.h"
4131 #include <ctype.h>
4132 #ifndef HAVE_EBCDIC
4133 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4134 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4135 #else
4136 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4137                 || ('j' <= (c) && (c) <= 'r') \
4138                 || ('s' <= (c) && (c) <= 'z'))
4139 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4140 #endif
4141 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4142 int main () { int i; for (i = 0; i < 256; i++)
4143 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4144 exit (0); }
4145
4146 EOF
4147 if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4148 then
4149   :
4150 else
4151   echo "configure: failed program was:" >&5
4152   cat conftest.$ac_ext >&5
4153   rm -fr conftest*
4154   ol_cv_header_stdc=no
4155 fi
4156 rm -fr conftest*
4157 fi
4158
4159 fi
4160 fi
4161
4162 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4163 if test $ol_cv_header_stdc = yes; then
4164   cat >> confdefs.h <<\EOF
4165 #define STDC_HEADERS 1
4166 EOF
4167
4168 fi
4169 ac_cv_header_stdc=disable
4170
4171
4172 if test $ol_cv_header_stdc != yes; then
4173         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4174 fi
4175
4176 ac_header_dirent=no
4177 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4178 do
4179 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4180 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4181 echo "configure:4182: checking for $ac_hdr that defines DIR" >&5
4182 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4183   echo $ac_n "(cached) $ac_c" 1>&6
4184 else
4185   cat > conftest.$ac_ext <<EOF
4186 #line 4187 "configure"
4187 #include "confdefs.h"
4188 #include <sys/types.h>
4189 #include <$ac_hdr>
4190 int main() {
4191 DIR *dirp = 0;
4192 ; return 0; }
4193 EOF
4194 if { (eval echo configure:4195: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4195   rm -rf conftest*
4196   eval "ac_cv_header_dirent_$ac_safe=yes"
4197 else
4198   echo "configure: failed program was:" >&5
4199   cat conftest.$ac_ext >&5
4200   rm -rf conftest*
4201   eval "ac_cv_header_dirent_$ac_safe=no"
4202 fi
4203 rm -f conftest*
4204 fi
4205 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4206   echo "$ac_t""yes" 1>&6
4207     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4208   cat >> confdefs.h <<EOF
4209 #define $ac_tr_hdr 1
4210 EOF
4211  ac_header_dirent=$ac_hdr; break
4212 else
4213   echo "$ac_t""no" 1>&6
4214 fi
4215 done
4216 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4217 if test $ac_header_dirent = dirent.h; then
4218 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4219 echo "configure:4220: checking for opendir in -ldir" >&5
4220 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4221 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4222   echo $ac_n "(cached) $ac_c" 1>&6
4223 else
4224   ac_save_LIBS="$LIBS"
4225 LIBS="-ldir  $LIBS"
4226 cat > conftest.$ac_ext <<EOF
4227 #line 4228 "configure"
4228 #include "confdefs.h"
4229 /* Override any gcc2 internal prototype to avoid an error.  */
4230 /* We use char because int might match the return type of a gcc2
4231     builtin and then its argument prototype would still apply.  */
4232 char opendir();
4233
4234 int main() {
4235 opendir()
4236 ; return 0; }
4237 EOF
4238 if { (eval echo configure:4239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4239   rm -rf conftest*
4240   eval "ac_cv_lib_$ac_lib_var=yes"
4241 else
4242   echo "configure: failed program was:" >&5
4243   cat conftest.$ac_ext >&5
4244   rm -rf conftest*
4245   eval "ac_cv_lib_$ac_lib_var=no"
4246 fi
4247 rm -f conftest*
4248 LIBS="$ac_save_LIBS"
4249
4250 fi
4251 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4252   echo "$ac_t""yes" 1>&6
4253   LIBS="$LIBS -ldir"
4254 else
4255   echo "$ac_t""no" 1>&6
4256 fi
4257
4258 else
4259 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4260 echo "configure:4261: checking for opendir in -lx" >&5
4261 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4262 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4263   echo $ac_n "(cached) $ac_c" 1>&6
4264 else
4265   ac_save_LIBS="$LIBS"
4266 LIBS="-lx  $LIBS"
4267 cat > conftest.$ac_ext <<EOF
4268 #line 4269 "configure"
4269 #include "confdefs.h"
4270 /* Override any gcc2 internal prototype to avoid an error.  */
4271 /* We use char because int might match the return type of a gcc2
4272     builtin and then its argument prototype would still apply.  */
4273 char opendir();
4274
4275 int main() {
4276 opendir()
4277 ; return 0; }
4278 EOF
4279 if { (eval echo configure:4280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4280   rm -rf conftest*
4281   eval "ac_cv_lib_$ac_lib_var=yes"
4282 else
4283   echo "configure: failed program was:" >&5
4284   cat conftest.$ac_ext >&5
4285   rm -rf conftest*
4286   eval "ac_cv_lib_$ac_lib_var=no"
4287 fi
4288 rm -f conftest*
4289 LIBS="$ac_save_LIBS"
4290
4291 fi
4292 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4293   echo "$ac_t""yes" 1>&6
4294   LIBS="$LIBS -lx"
4295 else
4296   echo "$ac_t""no" 1>&6
4297 fi
4298
4299 fi
4300
4301 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4302 echo "configure:4303: checking for sys/wait.h that is POSIX.1 compatible" >&5
4303 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4304   echo $ac_n "(cached) $ac_c" 1>&6
4305 else
4306   cat > conftest.$ac_ext <<EOF
4307 #line 4308 "configure"
4308 #include "confdefs.h"
4309 #include <sys/types.h>
4310 #include <sys/wait.h>
4311 #ifndef WEXITSTATUS
4312 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4313 #endif
4314 #ifndef WIFEXITED
4315 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4316 #endif
4317 int main() {
4318 int s;
4319 wait (&s);
4320 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4321 ; return 0; }
4322 EOF
4323 if { (eval echo configure:4324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4324   rm -rf conftest*
4325   ac_cv_header_sys_wait_h=yes
4326 else
4327   echo "configure: failed program was:" >&5
4328   cat conftest.$ac_ext >&5
4329   rm -rf conftest*
4330   ac_cv_header_sys_wait_h=no
4331 fi
4332 rm -f conftest*
4333 fi
4334
4335 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4336 if test $ac_cv_header_sys_wait_h = yes; then
4337   cat >> confdefs.h <<\EOF
4338 #define HAVE_SYS_WAIT_H 1
4339 EOF
4340
4341 fi
4342
4343 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4344 echo "configure:4345: checking POSIX termios" >&5
4345 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4346   echo $ac_n "(cached) $ac_c" 1>&6
4347 else
4348   cat > conftest.$ac_ext <<EOF
4349 #line 4350 "configure"
4350 #include "confdefs.h"
4351 #include <sys/types.h>
4352 #include <unistd.h>
4353 #include <termios.h>
4354 int main() {
4355 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4356    tcgetattr(0, 0);
4357 ; return 0; }
4358 EOF
4359 if { (eval echo configure:4360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4360   rm -rf conftest*
4361   am_cv_sys_posix_termios=yes
4362 else
4363   echo "configure: failed program was:" >&5
4364   cat conftest.$ac_ext >&5
4365   rm -rf conftest*
4366   am_cv_sys_posix_termios=no
4367 fi
4368 rm -f conftest*
4369 fi
4370
4371 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4372
4373
4374  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4375 echo "configure:4376: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4376 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4377   echo $ac_n "(cached) $ac_c" 1>&6
4378 else
4379   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4380
4381   gwinsz_in_termios_h=no
4382   if test $am_cv_sys_posix_termios = yes; then
4383     cat > conftest.$ac_ext <<EOF
4384 #line 4385 "configure"
4385 #include "confdefs.h"
4386 #include <sys/types.h>
4387 #     include <termios.h>
4388 #     ifdef TIOCGWINSZ
4389         yes
4390 #     endif
4391     
4392 EOF
4393 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4394   egrep "yes" >/dev/null 2>&1; then
4395   rm -rf conftest*
4396   gwinsz_in_termios_h=yes
4397 fi
4398 rm -f conftest*
4399
4400   fi
4401
4402   if test $gwinsz_in_termios_h = no; then
4403     cat > conftest.$ac_ext <<EOF
4404 #line 4405 "configure"
4405 #include "confdefs.h"
4406 #include <sys/types.h>
4407 #     include <sys/ioctl.h>
4408 #     ifdef TIOCGWINSZ
4409         yes
4410 #     endif
4411     
4412 EOF
4413 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4414   egrep "yes" >/dev/null 2>&1; then
4415   rm -rf conftest*
4416   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4417 fi
4418 rm -f conftest*
4419
4420   fi
4421   
4422 fi
4423
4424 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4425   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4426     cat >> confdefs.h <<\EOF
4427 #define GWINSZ_IN_SYS_IOCTL 1
4428 EOF
4429
4430   fi
4431
4432 if test $am_cv_sys_posix_termios = yes ; then
4433         cat >> confdefs.h <<\EOF
4434 #define HAVE_POSIX_TERMIOS 1
4435 EOF
4436
4437 fi
4438
4439 for ac_hdr in \
4440         arpa/inet.h             \
4441         arpa/nameser.h  \
4442         assert.h                \
4443         conio.h                 \
4444         crypt.h                 \
4445         direct.h                \
4446         errno.h                 \
4447         fcntl.h                 \
4448         filio.h                 \
4449         getopt.h                \
4450         grp.h                   \
4451         io.h                    \
4452         libutil.h               \
4453         limits.h                \
4454         locale.h                \
4455         netinet/tcp.h   \
4456         malloc.h                \
4457         memory.h                \
4458         psap.h                  \
4459         pwd.h                   \
4460         process.h               \
4461         resolv.h                \
4462         sgtty.h                 \
4463         shadow.h                \
4464         stddef.h                \
4465         string.h                \
4466         strings.h               \
4467         sysexits.h              \
4468         sys/file.h              \
4469         sys/filio.h             \
4470         sys/errno.h             \
4471         sys/ioctl.h             \
4472         sys/param.h             \
4473         sys/resource.h  \
4474         sys/select.h    \
4475         sys/socket.h    \
4476         sys/syslog.h    \
4477         sys/time.h              \
4478         sys/types.h             \
4479         syslog.h                \
4480         termios.h               \
4481         unistd.h                \
4482         winsock.h               \
4483
4484 do
4485 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4486 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4487 echo "configure:4488: checking for $ac_hdr" >&5
4488 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4489   echo $ac_n "(cached) $ac_c" 1>&6
4490 else
4491   cat > conftest.$ac_ext <<EOF
4492 #line 4493 "configure"
4493 #include "confdefs.h"
4494 #include <$ac_hdr>
4495 EOF
4496 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4497 { (eval echo configure:4498: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4498 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4499 if test -z "$ac_err"; then
4500   rm -rf conftest*
4501   eval "ac_cv_header_$ac_safe=yes"
4502 else
4503   echo "$ac_err" >&5
4504   echo "configure: failed program was:" >&5
4505   cat conftest.$ac_ext >&5
4506   rm -rf conftest*
4507   eval "ac_cv_header_$ac_safe=no"
4508 fi
4509 rm -f conftest*
4510 fi
4511 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4512   echo "$ac_t""yes" 1>&6
4513     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4514   cat >> confdefs.h <<EOF
4515 #define $ac_tr_hdr 1
4516 EOF
4517  
4518 else
4519   echo "$ac_t""no" 1>&6
4520 fi
4521 done
4522
4523
4524
4525
4526 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
4527 echo "configure:4528: checking for dlopen" >&5
4528 if eval "test \"\${ac_cv_func_dlopen+set}\" = set"; then
4529   echo $ac_n "(cached) $ac_c" 1>&6
4530 else
4531   cat > conftest.$ac_ext <<EOF
4532 #line 4533 "configure"
4533 #include "confdefs.h"
4534 /* System header to define __stub macros and hopefully few prototypes,
4535     which can conflict with char dlopen(); below.  */
4536 #include <assert.h>
4537 /* Override any gcc2 internal prototype to avoid an error.  */
4538 /* We use char because int might match the return type of a gcc2
4539     builtin and then its argument prototype would still apply.  */
4540 char dlopen();
4541 char (*f)();
4542
4543 int main() {
4544
4545 /* The GNU C library defines this for functions which it implements
4546     to always fail with ENOSYS.  Some functions are actually named
4547     something starting with __ and the normal name is an alias.  */
4548 #if defined (__stub_dlopen) || defined (__stub___dlopen)
4549 choke me
4550 #else
4551 f = dlopen;
4552 #endif
4553
4554 ; return 0; }
4555 EOF
4556 if { (eval echo configure:4557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4557   rm -rf conftest*
4558   eval "ac_cv_func_dlopen=yes"
4559 else
4560   echo "configure: failed program was:" >&5
4561   cat conftest.$ac_ext >&5
4562   rm -rf conftest*
4563   eval "ac_cv_func_dlopen=no"
4564 fi
4565 rm -f conftest*
4566 fi
4567
4568 if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
4569   echo "$ac_t""yes" 1>&6
4570   :
4571 else
4572   echo "$ac_t""no" 1>&6
4573 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
4574 echo "configure:4575: checking for dlopen in -ldl" >&5
4575 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-:%__p__%'`
4576 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4577   echo $ac_n "(cached) $ac_c" 1>&6
4578 else
4579   ac_save_LIBS="$LIBS"
4580 LIBS="-ldl  $LIBS"
4581 cat > conftest.$ac_ext <<EOF
4582 #line 4583 "configure"
4583 #include "confdefs.h"
4584 /* Override any gcc2 internal prototype to avoid an error.  */
4585 /* We use char because int might match the return type of a gcc2
4586     builtin and then its argument prototype would still apply.  */
4587 char dlopen();
4588
4589 int main() {
4590 dlopen()
4591 ; return 0; }
4592 EOF
4593 if { (eval echo configure:4594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4594   rm -rf conftest*
4595   eval "ac_cv_lib_$ac_lib_var=yes"
4596 else
4597   echo "configure: failed program was:" >&5
4598   cat conftest.$ac_ext >&5
4599   rm -rf conftest*
4600   eval "ac_cv_lib_$ac_lib_var=no"
4601 fi
4602 rm -f conftest*
4603 LIBS="$ac_save_LIBS"
4604
4605 fi
4606 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4607   echo "$ac_t""yes" 1>&6
4608     ac_tr_lib=HAVE_LIB`echo dl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4609     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4610   cat >> confdefs.h <<EOF
4611 #define $ac_tr_lib 1
4612 EOF
4613
4614   LIBS="-ldl $LIBS"
4615
4616 else
4617   echo "$ac_t""no" 1>&6
4618 fi
4619
4620 fi
4621
4622
4623 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4624 echo "configure:4625: checking for sigset in -lV3" >&5
4625 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4626 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4627   echo $ac_n "(cached) $ac_c" 1>&6
4628 else
4629   ac_save_LIBS="$LIBS"
4630 LIBS="-lV3  $LIBS"
4631 cat > conftest.$ac_ext <<EOF
4632 #line 4633 "configure"
4633 #include "confdefs.h"
4634 /* Override any gcc2 internal prototype to avoid an error.  */
4635 /* We use char because int might match the return type of a gcc2
4636     builtin and then its argument prototype would still apply.  */
4637 char sigset();
4638
4639 int main() {
4640 sigset()
4641 ; return 0; }
4642 EOF
4643 if { (eval echo configure:4644: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4644   rm -rf conftest*
4645   eval "ac_cv_lib_$ac_lib_var=yes"
4646 else
4647   echo "configure: failed program was:" >&5
4648   cat conftest.$ac_ext >&5
4649   rm -rf conftest*
4650   eval "ac_cv_lib_$ac_lib_var=no"
4651 fi
4652 rm -f conftest*
4653 LIBS="$ac_save_LIBS"
4654
4655 fi
4656 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4657   echo "$ac_t""yes" 1>&6
4658     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4659     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4660   cat >> confdefs.h <<EOF
4661 #define $ac_tr_lib 1
4662 EOF
4663
4664   LIBS="-lV3 $LIBS"
4665
4666 else
4667   echo "$ac_t""no" 1>&6
4668 fi
4669
4670
4671 if test $ac_cv_header_winsock_h = yes; then
4672         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4673 echo "configure:4674: checking for winsock" >&5
4674 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4675   echo $ac_n "(cached) $ac_c" 1>&6
4676 else
4677   cat > conftest.$ac_ext <<EOF
4678 #line 4679 "configure"
4679 #include "confdefs.h"
4680 #include <winsock.h>
4681 int main() {
4682
4683                         socket(0,0,0);
4684                         select(0,NULL,NULL,NULL,NULL);
4685                         closesocket(0);
4686                         gethostname(NULL,0);
4687         
4688 ; return 0; }
4689 EOF
4690 if { (eval echo configure:4691: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4691   rm -rf conftest*
4692   ol_cv_winsock=yes
4693 else
4694   echo "configure: failed program was:" >&5
4695   cat conftest.$ac_ext >&5
4696   rm -rf conftest*
4697   ol_cv_winsock=no
4698 fi
4699 rm -f conftest*]
4700 fi
4701
4702 echo "$ac_t""$ol_cv_winsock" 1>&6
4703
4704         if test $ol_cv_winsock = yes ; then
4705                 cat >> confdefs.h <<\EOF
4706 #define HAVE_WINSOCK 1
4707 EOF
4708
4709                 ac_cv_func_socket=yes
4710                 ac_cv_func_select=yes
4711                 ac_cv_func_closesocket=yes
4712                 ac_cv_func_gethostname=yes
4713         fi
4714 fi
4715
4716
4717 echo $ac_n "checking for socket""... $ac_c" 1>&6
4718 echo "configure:4719: checking for socket" >&5
4719 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4720   echo $ac_n "(cached) $ac_c" 1>&6
4721 else
4722   cat > conftest.$ac_ext <<EOF
4723 #line 4724 "configure"
4724 #include "confdefs.h"
4725 /* System header to define __stub macros and hopefully few prototypes,
4726     which can conflict with char socket(); below.  */
4727 #include <assert.h>
4728 /* Override any gcc2 internal prototype to avoid an error.  */
4729 /* We use char because int might match the return type of a gcc2
4730     builtin and then its argument prototype would still apply.  */
4731 char socket();
4732 char (*f)();
4733
4734 int main() {
4735
4736 /* The GNU C library defines this for functions which it implements
4737     to always fail with ENOSYS.  Some functions are actually named
4738     something starting with __ and the normal name is an alias.  */
4739 #if defined (__stub_socket) || defined (__stub___socket)
4740 choke me
4741 #else
4742 f = socket;
4743 #endif
4744
4745 ; return 0; }
4746 EOF
4747 if { (eval echo configure:4748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4748   rm -rf conftest*
4749   eval "ac_cv_func_socket=yes"
4750 else
4751   echo "configure: failed program was:" >&5
4752   cat conftest.$ac_ext >&5
4753   rm -rf conftest*
4754   eval "ac_cv_func_socket=no"
4755 fi
4756 rm -f conftest*
4757 fi
4758
4759 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4760   echo "$ac_t""yes" 1>&6
4761   :
4762 else
4763   echo "$ac_t""no" 1>&6
4764         
4765         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4766 echo "configure:4767: checking for main in -lsocket" >&5
4767 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4768 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4769   echo $ac_n "(cached) $ac_c" 1>&6
4770 else
4771   ac_save_LIBS="$LIBS"
4772 LIBS="-lsocket  $LIBS"
4773 cat > conftest.$ac_ext <<EOF
4774 #line 4775 "configure"
4775 #include "confdefs.h"
4776
4777 int main() {
4778 main()
4779 ; return 0; }
4780 EOF
4781 if { (eval echo configure:4782: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4782   rm -rf conftest*
4783   eval "ac_cv_lib_$ac_lib_var=yes"
4784 else
4785   echo "configure: failed program was:" >&5
4786   cat conftest.$ac_ext >&5
4787   rm -rf conftest*
4788   eval "ac_cv_lib_$ac_lib_var=no"
4789 fi
4790 rm -f conftest*
4791 LIBS="$ac_save_LIBS"
4792
4793 fi
4794 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4795   echo "$ac_t""yes" 1>&6
4796     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4797     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4798   cat >> confdefs.h <<EOF
4799 #define $ac_tr_lib 1
4800 EOF
4801
4802   LIBS="-lsocket $LIBS"
4803
4804 else
4805   echo "$ac_t""no" 1>&6
4806 fi
4807
4808         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4809 echo "configure:4810: checking for main in -lnet" >&5
4810 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4811 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4812   echo $ac_n "(cached) $ac_c" 1>&6
4813 else
4814   ac_save_LIBS="$LIBS"
4815 LIBS="-lnet  $LIBS"
4816 cat > conftest.$ac_ext <<EOF
4817 #line 4818 "configure"
4818 #include "confdefs.h"
4819
4820 int main() {
4821 main()
4822 ; return 0; }
4823 EOF
4824 if { (eval echo configure:4825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4825   rm -rf conftest*
4826   eval "ac_cv_lib_$ac_lib_var=yes"
4827 else
4828   echo "configure: failed program was:" >&5
4829   cat conftest.$ac_ext >&5
4830   rm -rf conftest*
4831   eval "ac_cv_lib_$ac_lib_var=no"
4832 fi
4833 rm -f conftest*
4834 LIBS="$ac_save_LIBS"
4835
4836 fi
4837 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4838   echo "$ac_t""yes" 1>&6
4839     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4840     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4841   cat >> confdefs.h <<EOF
4842 #define $ac_tr_lib 1
4843 EOF
4844
4845   LIBS="-lnet $LIBS"
4846
4847 else
4848   echo "$ac_t""no" 1>&6
4849 fi
4850
4851         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4852 echo "configure:4853: checking for main in -lnsl_s" >&5
4853 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4854 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4855   echo $ac_n "(cached) $ac_c" 1>&6
4856 else
4857   ac_save_LIBS="$LIBS"
4858 LIBS="-lnsl_s  $LIBS"
4859 cat > conftest.$ac_ext <<EOF
4860 #line 4861 "configure"
4861 #include "confdefs.h"
4862
4863 int main() {
4864 main()
4865 ; return 0; }
4866 EOF
4867 if { (eval echo configure:4868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4868   rm -rf conftest*
4869   eval "ac_cv_lib_$ac_lib_var=yes"
4870 else
4871   echo "configure: failed program was:" >&5
4872   cat conftest.$ac_ext >&5
4873   rm -rf conftest*
4874   eval "ac_cv_lib_$ac_lib_var=no"
4875 fi
4876 rm -f conftest*
4877 LIBS="$ac_save_LIBS"
4878
4879 fi
4880 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4881   echo "$ac_t""yes" 1>&6
4882     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4883     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4884   cat >> confdefs.h <<EOF
4885 #define $ac_tr_lib 1
4886 EOF
4887
4888   LIBS="-lnsl_s $LIBS"
4889
4890 else
4891   echo "$ac_t""no" 1>&6
4892 fi
4893
4894         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4895 echo "configure:4896: checking for main in -lnsl" >&5
4896 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4897 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4898   echo $ac_n "(cached) $ac_c" 1>&6
4899 else
4900   ac_save_LIBS="$LIBS"
4901 LIBS="-lnsl  $LIBS"
4902 cat > conftest.$ac_ext <<EOF
4903 #line 4904 "configure"
4904 #include "confdefs.h"
4905
4906 int main() {
4907 main()
4908 ; return 0; }
4909 EOF
4910 if { (eval echo configure:4911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4911   rm -rf conftest*
4912   eval "ac_cv_lib_$ac_lib_var=yes"
4913 else
4914   echo "configure: failed program was:" >&5
4915   cat conftest.$ac_ext >&5
4916   rm -rf conftest*
4917   eval "ac_cv_lib_$ac_lib_var=no"
4918 fi
4919 rm -f conftest*
4920 LIBS="$ac_save_LIBS"
4921
4922 fi
4923 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4924   echo "$ac_t""yes" 1>&6
4925     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4926     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4927   cat >> confdefs.h <<EOF
4928 #define $ac_tr_lib 1
4929 EOF
4930
4931   LIBS="-lnsl $LIBS"
4932
4933 else
4934   echo "$ac_t""no" 1>&6
4935 fi
4936
4937         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4938 echo "configure:4939: checking for socket in -linet" >&5
4939 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4940 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4941   echo $ac_n "(cached) $ac_c" 1>&6
4942 else
4943   ac_save_LIBS="$LIBS"
4944 LIBS="-linet  $LIBS"
4945 cat > conftest.$ac_ext <<EOF
4946 #line 4947 "configure"
4947 #include "confdefs.h"
4948 /* Override any gcc2 internal prototype to avoid an error.  */
4949 /* We use char because int might match the return type of a gcc2
4950     builtin and then its argument prototype would still apply.  */
4951 char socket();
4952
4953 int main() {
4954 socket()
4955 ; return 0; }
4956 EOF
4957 if { (eval echo configure:4958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4958   rm -rf conftest*
4959   eval "ac_cv_lib_$ac_lib_var=yes"
4960 else
4961   echo "configure: failed program was:" >&5
4962   cat conftest.$ac_ext >&5
4963   rm -rf conftest*
4964   eval "ac_cv_lib_$ac_lib_var=no"
4965 fi
4966 rm -f conftest*
4967 LIBS="$ac_save_LIBS"
4968
4969 fi
4970 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4971   echo "$ac_t""yes" 1>&6
4972     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4973     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4974   cat >> confdefs.h <<EOF
4975 #define $ac_tr_lib 1
4976 EOF
4977
4978   LIBS="-linet $LIBS"
4979
4980 else
4981   echo "$ac_t""no" 1>&6
4982 fi
4983
4984         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4985 echo "configure:4986: checking for main in -lgen" >&5
4986 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4987 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4988   echo $ac_n "(cached) $ac_c" 1>&6
4989 else
4990   ac_save_LIBS="$LIBS"
4991 LIBS="-lgen  $LIBS"
4992 cat > conftest.$ac_ext <<EOF
4993 #line 4994 "configure"
4994 #include "confdefs.h"
4995
4996 int main() {
4997 main()
4998 ; return 0; }
4999 EOF
5000 if { (eval echo configure:5001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5001   rm -rf conftest*
5002   eval "ac_cv_lib_$ac_lib_var=yes"
5003 else
5004   echo "configure: failed program was:" >&5
5005   cat conftest.$ac_ext >&5
5006   rm -rf conftest*
5007   eval "ac_cv_lib_$ac_lib_var=no"
5008 fi
5009 rm -f conftest*
5010 LIBS="$ac_save_LIBS"
5011
5012 fi
5013 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5014   echo "$ac_t""yes" 1>&6
5015     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5016     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5017   cat >> confdefs.h <<EOF
5018 #define $ac_tr_lib 1
5019 EOF
5020
5021   LIBS="-lgen $LIBS"
5022
5023 else
5024   echo "$ac_t""no" 1>&6
5025 fi
5026
5027
5028 fi
5029
5030
5031 echo $ac_n "checking for select""... $ac_c" 1>&6
5032 echo "configure:5033: checking for select" >&5
5033 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5034   echo $ac_n "(cached) $ac_c" 1>&6
5035 else
5036   cat > conftest.$ac_ext <<EOF
5037 #line 5038 "configure"
5038 #include "confdefs.h"
5039 /* System header to define __stub macros and hopefully few prototypes,
5040     which can conflict with char select(); below.  */
5041 #include <assert.h>
5042 /* Override any gcc2 internal prototype to avoid an error.  */
5043 /* We use char because int might match the return type of a gcc2
5044     builtin and then its argument prototype would still apply.  */
5045 char select();
5046 char (*f)();
5047
5048 int main() {
5049
5050 /* The GNU C library defines this for functions which it implements
5051     to always fail with ENOSYS.  Some functions are actually named
5052     something starting with __ and the normal name is an alias.  */
5053 #if defined (__stub_select) || defined (__stub___select)
5054 choke me
5055 #else
5056 f = select;
5057 #endif
5058
5059 ; return 0; }
5060 EOF
5061 if { (eval echo configure:5062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5062   rm -rf conftest*
5063   eval "ac_cv_func_select=yes"
5064 else
5065   echo "configure: failed program was:" >&5
5066   cat conftest.$ac_ext >&5
5067   rm -rf conftest*
5068   eval "ac_cv_func_select=no"
5069 fi
5070 rm -f conftest*
5071 fi
5072
5073 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5074   echo "$ac_t""yes" 1>&6
5075   :
5076 else
5077   echo "$ac_t""no" 1>&6
5078 { echo "configure: error: select() required." 1>&2; exit 1; }
5079 fi
5080
5081
5082 if test "${ac_cv_header_winsock_h}" != yes; then
5083                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5084 echo "configure:5085: checking types of arguments for select()" >&5
5085  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5086   echo $ac_n "(cached) $ac_c" 1>&6
5087 else
5088    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5089   echo $ac_n "(cached) $ac_c" 1>&6
5090 else
5091     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5092   echo $ac_n "(cached) $ac_c" 1>&6
5093 else
5094      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5095      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5096       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5097        cat > conftest.$ac_ext <<EOF
5098 #line 5099 "configure"
5099 #include "confdefs.h"
5100 #ifdef HAVE_SYS_TYPES_H
5101 #include <sys/types.h>
5102 #endif
5103 #ifdef HAVE_SYS_TIME_H
5104 #include <sys/time.h>
5105 #endif
5106 #ifdef HAVE_SYS_SELECT_H
5107 #include <sys/select.h>
5108 #endif
5109 #ifdef HAVE_SYS_SOCKET_H
5110 #include <sys/socket.h>
5111 #endif
5112 extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
5113 int main() {
5114
5115 ; return 0; }
5116 EOF
5117 if { (eval echo configure:5118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5118   rm -rf conftest*
5119           ac_not_found=no ; break 3
5120 else
5121   echo "configure: failed program was:" >&5
5122   cat conftest.$ac_ext >&5
5123   rm -rf conftest*
5124   ac_not_found=yes
5125 fi
5126 rm -f conftest*
5127       done
5128      done
5129     done
5130    
5131 fi
5132   
5133 fi
5134  
5135 fi
5136  if test "$ac_not_found" = yes; then
5137   ac_cv_func_select_arg1=int 
5138   ac_cv_func_select_arg234='int *' 
5139   ac_cv_func_select_arg5='struct timeval *'
5140  fi
5141  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5142  cat >> confdefs.h <<EOF
5143 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5144 EOF
5145
5146  cat >> confdefs.h <<EOF
5147 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5148 EOF
5149
5150  cat >> confdefs.h <<EOF
5151 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5152 EOF
5153
5154
5155 fi
5156
5157
5158 for ac_hdr in regex.h 
5159 do
5160 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5161 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5162 echo "configure:5163: checking for $ac_hdr" >&5
5163 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5164   echo $ac_n "(cached) $ac_c" 1>&6
5165 else
5166   cat > conftest.$ac_ext <<EOF
5167 #line 5168 "configure"
5168 #include "confdefs.h"
5169 #include <$ac_hdr>
5170 EOF
5171 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5172 { (eval echo configure:5173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5173 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5174 if test -z "$ac_err"; then
5175   rm -rf conftest*
5176   eval "ac_cv_header_$ac_safe=yes"
5177 else
5178   echo "$ac_err" >&5
5179   echo "configure: failed program was:" >&5
5180   cat conftest.$ac_ext >&5
5181   rm -rf conftest*
5182   eval "ac_cv_header_$ac_safe=no"
5183 fi
5184 rm -f conftest*
5185 fi
5186 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5187   echo "$ac_t""yes" 1>&6
5188     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5189   cat >> confdefs.h <<EOF
5190 #define $ac_tr_hdr 1
5191 EOF
5192  
5193 else
5194   echo "$ac_t""no" 1>&6
5195 fi
5196 done
5197
5198 if test "$ac_cv_header_regex_h" != yes ; then
5199         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5200 fi
5201 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5202 echo "configure:5203: checking for regfree" >&5
5203 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5204   echo $ac_n "(cached) $ac_c" 1>&6
5205 else
5206   cat > conftest.$ac_ext <<EOF
5207 #line 5208 "configure"
5208 #include "confdefs.h"
5209 /* System header to define __stub macros and hopefully few prototypes,
5210     which can conflict with char regfree(); below.  */
5211 #include <assert.h>
5212 /* Override any gcc2 internal prototype to avoid an error.  */
5213 /* We use char because int might match the return type of a gcc2
5214     builtin and then its argument prototype would still apply.  */
5215 char regfree();
5216 char (*f)();
5217
5218 int main() {
5219
5220 /* The GNU C library defines this for functions which it implements
5221     to always fail with ENOSYS.  Some functions are actually named
5222     something starting with __ and the normal name is an alias.  */
5223 #if defined (__stub_regfree) || defined (__stub___regfree)
5224 choke me
5225 #else
5226 f = regfree;
5227 #endif
5228
5229 ; return 0; }
5230 EOF
5231 if { (eval echo configure:5232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5232   rm -rf conftest*
5233   eval "ac_cv_func_regfree=yes"
5234 else
5235   echo "configure: failed program was:" >&5
5236   cat conftest.$ac_ext >&5
5237   rm -rf conftest*
5238   eval "ac_cv_func_regfree=no"
5239 fi
5240 rm -f conftest*
5241 fi
5242
5243 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5244   echo "$ac_t""yes" 1>&6
5245   :
5246 else
5247   echo "$ac_t""no" 1>&6
5248 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5249 fi
5250
5251
5252
5253 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5254 echo "configure:5255: checking for compatible POSIX regex" >&5
5255 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5256   echo $ac_n "(cached) $ac_c" 1>&6
5257 else
5258   
5259         if test "$cross_compiling" = yes; then
5260   ol_cv_c_posix_regex=cross
5261 else
5262   cat > conftest.$ac_ext <<EOF
5263 #line 5264 "configure"
5264 #include "confdefs.h"
5265
5266 #include <sys/types.h>
5267 #include <regex.h>
5268 static char *pattern, *string;
5269 main()
5270 {
5271         int rc;
5272         regex_t re;
5273
5274         pattern = "^A";
5275
5276         if(regcomp(&re, pattern, 0)) {
5277                 return -1;
5278         }
5279         
5280         string = "ALL MATCH";
5281         
5282         rc = regexec(&re, string, 0, (void*)0, 0);
5283
5284         regfree(&re);
5285
5286         return rc;
5287 }
5288 EOF
5289 if { (eval echo configure:5290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5290 then
5291   ol_cv_c_posix_regex=yes
5292 else
5293   echo "configure: failed program was:" >&5
5294   cat conftest.$ac_ext >&5
5295   rm -fr conftest*
5296   ol_cv_c_posix_regex=no
5297 fi
5298 rm -fr conftest*
5299 fi
5300
5301 fi
5302
5303 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5304
5305 if test "$ol_cv_c_posix_regex" = no ; then
5306         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5307 fi
5308
5309 ol_link_dnssrv=no
5310 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5311 echo "configure:5312: checking for res_query" >&5
5312 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5313   echo $ac_n "(cached) $ac_c" 1>&6
5314 else
5315   cat > conftest.$ac_ext <<EOF
5316 #line 5317 "configure"
5317 #include "confdefs.h"
5318 /* System header to define __stub macros and hopefully few prototypes,
5319     which can conflict with char res_query(); below.  */
5320 #include <assert.h>
5321 /* Override any gcc2 internal prototype to avoid an error.  */
5322 /* We use char because int might match the return type of a gcc2
5323     builtin and then its argument prototype would still apply.  */
5324 char res_query();
5325 char (*f)();
5326
5327 int main() {
5328
5329 /* The GNU C library defines this for functions which it implements
5330     to always fail with ENOSYS.  Some functions are actually named
5331     something starting with __ and the normal name is an alias.  */
5332 #if defined (__stub_res_query) || defined (__stub___res_query)
5333 choke me
5334 #else
5335 f = res_query;
5336 #endif
5337
5338 ; return 0; }
5339 EOF
5340 if { (eval echo configure:5341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5341   rm -rf conftest*
5342   eval "ac_cv_func_res_query=yes"
5343 else
5344   echo "configure: failed program was:" >&5
5345   cat conftest.$ac_ext >&5
5346   rm -rf conftest*
5347   eval "ac_cv_func_res_query=no"
5348 fi
5349 rm -f conftest*
5350 fi
5351
5352 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5353   echo "$ac_t""yes" 1>&6
5354   :
5355 else
5356   echo "$ac_t""no" 1>&6
5357 fi
5358
5359 if test $ac_cv_func_res_query = no ; then 
5360         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5361 echo "configure:5362: checking for res_query in -lbind" >&5
5362 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5363 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5364   echo $ac_n "(cached) $ac_c" 1>&6
5365 else
5366   ac_save_LIBS="$LIBS"
5367 LIBS="-lbind  $LIBS"
5368 cat > conftest.$ac_ext <<EOF
5369 #line 5370 "configure"
5370 #include "confdefs.h"
5371 /* Override any gcc2 internal prototype to avoid an error.  */
5372 /* We use char because int might match the return type of a gcc2
5373     builtin and then its argument prototype would still apply.  */
5374 char res_query();
5375
5376 int main() {
5377 res_query()
5378 ; return 0; }
5379 EOF
5380 if { (eval echo configure:5381: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5381   rm -rf conftest*
5382   eval "ac_cv_lib_$ac_lib_var=yes"
5383 else
5384   echo "configure: failed program was:" >&5
5385   cat conftest.$ac_ext >&5
5386   rm -rf conftest*
5387   eval "ac_cv_lib_$ac_lib_var=no"
5388 fi
5389 rm -f conftest*
5390 LIBS="$ac_save_LIBS"
5391
5392 fi
5393 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5394   echo "$ac_t""yes" 1>&6
5395     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5396     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5397   cat >> confdefs.h <<EOF
5398 #define $ac_tr_lib 1
5399 EOF
5400
5401   LIBS="-lbind $LIBS"
5402
5403 else
5404   echo "$ac_t""no" 1>&6
5405 fi
5406
5407         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5408 fi
5409
5410 if test $ac_cv_func_res_query = no ; then 
5411         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5412 echo "configure:5413: checking for __res_query in -lbind" >&5
5413 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5414 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5415   echo $ac_n "(cached) $ac_c" 1>&6
5416 else
5417   ac_save_LIBS="$LIBS"
5418 LIBS="-lbind  $LIBS"
5419 cat > conftest.$ac_ext <<EOF
5420 #line 5421 "configure"
5421 #include "confdefs.h"
5422 /* Override any gcc2 internal prototype to avoid an error.  */
5423 /* We use char because int might match the return type of a gcc2
5424     builtin and then its argument prototype would still apply.  */
5425 char __res_query();
5426
5427 int main() {
5428 __res_query()
5429 ; return 0; }
5430 EOF
5431 if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5432   rm -rf conftest*
5433   eval "ac_cv_lib_$ac_lib_var=yes"
5434 else
5435   echo "configure: failed program was:" >&5
5436   cat conftest.$ac_ext >&5
5437   rm -rf conftest*
5438   eval "ac_cv_lib_$ac_lib_var=no"
5439 fi
5440 rm -f conftest*
5441 LIBS="$ac_save_LIBS"
5442
5443 fi
5444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5445   echo "$ac_t""yes" 1>&6
5446     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5447     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5448   cat >> confdefs.h <<EOF
5449 #define $ac_tr_lib 1
5450 EOF
5451
5452   LIBS="-lbind $LIBS"
5453
5454 else
5455   echo "$ac_t""no" 1>&6
5456 fi
5457
5458         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5459 fi
5460
5461 if test $ac_cv_func_res_query = no ; then 
5462         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5463 echo "configure:5464: checking for res_query in -lresolv" >&5
5464 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5465 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5466   echo $ac_n "(cached) $ac_c" 1>&6
5467 else
5468   ac_save_LIBS="$LIBS"
5469 LIBS="-lresolv  $LIBS"
5470 cat > conftest.$ac_ext <<EOF
5471 #line 5472 "configure"
5472 #include "confdefs.h"
5473 /* Override any gcc2 internal prototype to avoid an error.  */
5474 /* We use char because int might match the return type of a gcc2
5475     builtin and then its argument prototype would still apply.  */
5476 char res_query();
5477
5478 int main() {
5479 res_query()
5480 ; return 0; }
5481 EOF
5482 if { (eval echo configure:5483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5483   rm -rf conftest*
5484   eval "ac_cv_lib_$ac_lib_var=yes"
5485 else
5486   echo "configure: failed program was:" >&5
5487   cat conftest.$ac_ext >&5
5488   rm -rf conftest*
5489   eval "ac_cv_lib_$ac_lib_var=no"
5490 fi
5491 rm -f conftest*
5492 LIBS="$ac_save_LIBS"
5493
5494 fi
5495 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5496   echo "$ac_t""yes" 1>&6
5497     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5498     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5499   cat >> confdefs.h <<EOF
5500 #define $ac_tr_lib 1
5501 EOF
5502
5503   LIBS="-lresolv $LIBS"
5504
5505 else
5506   echo "$ac_t""no" 1>&6
5507 fi
5508
5509         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5510 fi
5511
5512 if test "$ac_cv_func_res_query" = yes ; then
5513         cat >> confdefs.h <<\EOF
5514 #define HAVE_RES_QUERY 1
5515 EOF
5516
5517
5518         if test $ol_enable_dnssrv != no ; then
5519                 ol_link_dnssrv=yes
5520         fi
5521 fi
5522
5523 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5524         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5525 fi
5526
5527 for ac_func in getaddrinfo inet_ntop 
5528 do
5529 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5530 echo "configure:5531: checking for $ac_func" >&5
5531 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5532   echo $ac_n "(cached) $ac_c" 1>&6
5533 else
5534   cat > conftest.$ac_ext <<EOF
5535 #line 5536 "configure"
5536 #include "confdefs.h"
5537 /* System header to define __stub macros and hopefully few prototypes,
5538     which can conflict with char $ac_func(); below.  */
5539 #include <assert.h>
5540 /* Override any gcc2 internal prototype to avoid an error.  */
5541 /* We use char because int might match the return type of a gcc2
5542     builtin and then its argument prototype would still apply.  */
5543 char $ac_func();
5544 char (*f)();
5545
5546 int main() {
5547
5548 /* The GNU C library defines this for functions which it implements
5549     to always fail with ENOSYS.  Some functions are actually named
5550     something starting with __ and the normal name is an alias.  */
5551 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5552 choke me
5553 #else
5554 f = $ac_func;
5555 #endif
5556
5557 ; return 0; }
5558 EOF
5559 if { (eval echo configure:5560: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5560   rm -rf conftest*
5561   eval "ac_cv_func_$ac_func=yes"
5562 else
5563   echo "configure: failed program was:" >&5
5564   cat conftest.$ac_ext >&5
5565   rm -rf conftest*
5566   eval "ac_cv_func_$ac_func=no"
5567 fi
5568 rm -f conftest*
5569 fi
5570
5571 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5572   echo "$ac_t""yes" 1>&6
5573     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5574   cat >> confdefs.h <<EOF
5575 #define $ac_tr_func 1
5576 EOF
5577  
5578 else
5579   echo "$ac_t""no" 1>&6
5580 fi
5581 done
5582
5583
5584 ol_link_ipv6=no
5585 if test $ac_cv_func_getaddrinfo = no -o $ac_cv_func_inet_ntop ; then
5586         if test $ol_enable_ipv6 = yes ; then
5587                 { echo "configure: error: IPv6 support requires getaddrinfo() and inet_ntop()" 1>&2; exit 1; }
5588         fi
5589 else
5590         for ac_func in gai_strerror 
5591 do
5592 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5593 echo "configure:5594: checking for $ac_func" >&5
5594 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5595   echo $ac_n "(cached) $ac_c" 1>&6
5596 else
5597   cat > conftest.$ac_ext <<EOF
5598 #line 5599 "configure"
5599 #include "confdefs.h"
5600 /* System header to define __stub macros and hopefully few prototypes,
5601     which can conflict with char $ac_func(); below.  */
5602 #include <assert.h>
5603 /* Override any gcc2 internal prototype to avoid an error.  */
5604 /* We use char because int might match the return type of a gcc2
5605     builtin and then its argument prototype would still apply.  */
5606 char $ac_func();
5607 char (*f)();
5608
5609 int main() {
5610
5611 /* The GNU C library defines this for functions which it implements
5612     to always fail with ENOSYS.  Some functions are actually named
5613     something starting with __ and the normal name is an alias.  */
5614 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5615 choke me
5616 #else
5617 f = $ac_func;
5618 #endif
5619
5620 ; return 0; }
5621 EOF
5622 if { (eval echo configure:5623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5623   rm -rf conftest*
5624   eval "ac_cv_func_$ac_func=yes"
5625 else
5626   echo "configure: failed program was:" >&5
5627   cat conftest.$ac_ext >&5
5628   rm -rf conftest*
5629   eval "ac_cv_func_$ac_func=no"
5630 fi
5631 rm -f conftest*
5632 fi
5633
5634 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5635   echo "$ac_t""yes" 1>&6
5636     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5637   cat >> confdefs.h <<EOF
5638 #define $ac_tr_func 1
5639 EOF
5640  
5641 else
5642   echo "$ac_t""no" 1>&6
5643 fi
5644 done
5645
5646
5647         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5648 echo "configure:5649: checking INET6_ADDRSTRLEN" >&5
5649 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5650   echo $ac_n "(cached) $ac_c" 1>&6
5651 else
5652   
5653                 cat > conftest.$ac_ext <<EOF
5654 #line 5655 "configure"
5655 #include "confdefs.h"
5656
5657 #                       include <netinet/in.h>
5658 #                       ifdef INET6_ADDRSTRLEN
5659                                 __has_inet6_addrstrlen__;
5660 #                       endif
5661                 
5662 EOF
5663 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5664   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5665   rm -rf conftest*
5666   ol_cv_inet6_addrstrlen=yes
5667 else
5668   rm -rf conftest*
5669   ol_cv_inet6_addrstrlen=no
5670 fi
5671 rm -f conftest*
5672
5673 fi
5674
5675 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5676
5677         if test $ol_cv_inet6_addrstrlen = yes ; then
5678                 ol_link_ipv6=yes
5679         elif test $ol_enable_ipv6 = yes ; then
5680                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5681         fi
5682 fi
5683
5684 if test $ol_enable_local != no ; then
5685         for ac_hdr in sys/un.h 
5686 do
5687 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5688 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5689 echo "configure:5690: checking for $ac_hdr" >&5
5690 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5691   echo $ac_n "(cached) $ac_c" 1>&6
5692 else
5693   cat > conftest.$ac_ext <<EOF
5694 #line 5695 "configure"
5695 #include "confdefs.h"
5696 #include <$ac_hdr>
5697 EOF
5698 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5699 { (eval echo configure:5700: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5700 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5701 if test -z "$ac_err"; then
5702   rm -rf conftest*
5703   eval "ac_cv_header_$ac_safe=yes"
5704 else
5705   echo "$ac_err" >&5
5706   echo "configure: failed program was:" >&5
5707   cat conftest.$ac_ext >&5
5708   rm -rf conftest*
5709   eval "ac_cv_header_$ac_safe=no"
5710 fi
5711 rm -f conftest*
5712 fi
5713 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5714   echo "$ac_t""yes" 1>&6
5715     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5716   cat >> confdefs.h <<EOF
5717 #define $ac_tr_hdr 1
5718 EOF
5719  
5720 else
5721   echo "$ac_t""no" 1>&6
5722 fi
5723 done
5724
5725
5726         if test $ol_enable_local = auto ; then
5727                 ol_enable_local=$ac_cv_header_sys_un_h
5728         elif test $ac_cv_header_sys_un_h = no ; then
5729                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5730         fi
5731 fi
5732
5733 ol_link_kbind=no
5734 ol_link_kpasswd=no
5735 ol_link_krb5=no
5736 ol_link_krb4=no
5737
5738 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5739         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5740         -o $ol_with_kerberos = k425 ; then
5741
5742         for ac_hdr in krb5.h
5743 do
5744 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5745 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5746 echo "configure:5747: checking for $ac_hdr" >&5
5747 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5748   echo $ac_n "(cached) $ac_c" 1>&6
5749 else
5750   cat > conftest.$ac_ext <<EOF
5751 #line 5752 "configure"
5752 #include "confdefs.h"
5753 #include <$ac_hdr>
5754 EOF
5755 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5756 { (eval echo configure:5757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5757 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5758 if test -z "$ac_err"; then
5759   rm -rf conftest*
5760   eval "ac_cv_header_$ac_safe=yes"
5761 else
5762   echo "$ac_err" >&5
5763   echo "configure: failed program was:" >&5
5764   cat conftest.$ac_ext >&5
5765   rm -rf conftest*
5766   eval "ac_cv_header_$ac_safe=no"
5767 fi
5768 rm -f conftest*
5769 fi
5770 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5771   echo "$ac_t""yes" 1>&6
5772     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5773   cat >> confdefs.h <<EOF
5774 #define $ac_tr_hdr 1
5775 EOF
5776  
5777 else
5778   echo "$ac_t""no" 1>&6
5779 fi
5780 done
5781
5782
5783         if test $ac_cv_header_krb5_h = yes ; then
5784                                 for ac_hdr in heim_err.h
5785 do
5786 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5787 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5788 echo "configure:5789: checking for $ac_hdr" >&5
5789 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5790   echo $ac_n "(cached) $ac_c" 1>&6
5791 else
5792   cat > conftest.$ac_ext <<EOF
5793 #line 5794 "configure"
5794 #include "confdefs.h"
5795 #include <$ac_hdr>
5796 EOF
5797 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5798 { (eval echo configure:5799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5799 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5800 if test -z "$ac_err"; then
5801   rm -rf conftest*
5802   eval "ac_cv_header_$ac_safe=yes"
5803 else
5804   echo "$ac_err" >&5
5805   echo "configure: failed program was:" >&5
5806   cat conftest.$ac_ext >&5
5807   rm -rf conftest*
5808   eval "ac_cv_header_$ac_safe=no"
5809 fi
5810 rm -f conftest*
5811 fi
5812 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5813   echo "$ac_t""yes" 1>&6
5814     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5815   cat >> confdefs.h <<EOF
5816 #define $ac_tr_hdr 1
5817 EOF
5818  
5819 else
5820   echo "$ac_t""no" 1>&6
5821 fi
5822 done
5823
5824                 if test $ac_cv_header_heim_err_h = yes ; then
5825                         krb5_impl=heimdal
5826                 else
5827                         krb5_impl=mit
5828                 fi
5829
5830                 if test $krb5_impl = mit; then
5831                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5832 echo "configure:5833: checking for main in -lkrb5" >&5
5833 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5834 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5835   echo $ac_n "(cached) $ac_c" 1>&6
5836 else
5837   ac_save_LIBS="$LIBS"
5838 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
5839 cat > conftest.$ac_ext <<EOF
5840 #line 5841 "configure"
5841 #include "confdefs.h"
5842
5843 int main() {
5844 main()
5845 ; return 0; }
5846 EOF
5847 if { (eval echo configure:5848: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5848   rm -rf conftest*
5849   eval "ac_cv_lib_$ac_lib_var=yes"
5850 else
5851   echo "configure: failed program was:" >&5
5852   cat conftest.$ac_ext >&5
5853   rm -rf conftest*
5854   eval "ac_cv_lib_$ac_lib_var=no"
5855 fi
5856 rm -f conftest*
5857 LIBS="$ac_save_LIBS"
5858
5859 fi
5860 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5861   echo "$ac_t""yes" 1>&6
5862   have_krb5=yes
5863                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
5864 else
5865   echo "$ac_t""no" 1>&6
5866 have_krb5=no
5867 fi
5868
5869
5870                 elif test $krb5_impl = heimdal; then
5871                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5872 echo "configure:5873: checking for main in -lkrb5" >&5
5873 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5874 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5875   echo $ac_n "(cached) $ac_c" 1>&6
5876 else
5877   ac_save_LIBS="$LIBS"
5878 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5879 cat > conftest.$ac_ext <<EOF
5880 #line 5881 "configure"
5881 #include "confdefs.h"
5882
5883 int main() {
5884 main()
5885 ; return 0; }
5886 EOF
5887 if { (eval echo configure:5888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5888   rm -rf conftest*
5889   eval "ac_cv_lib_$ac_lib_var=yes"
5890 else
5891   echo "configure: failed program was:" >&5
5892   cat conftest.$ac_ext >&5
5893   rm -rf conftest*
5894   eval "ac_cv_lib_$ac_lib_var=no"
5895 fi
5896 rm -f conftest*
5897 LIBS="$ac_save_LIBS"
5898
5899 fi
5900 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5901   echo "$ac_t""yes" 1>&6
5902   have_krb5=yes
5903                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
5904 else
5905   echo "$ac_t""no" 1>&6
5906 have_krb5=no
5907 fi
5908
5909
5910                         cat >> confdefs.h <<\EOF
5911 #define HAVE_HEIMDAL_KERBEROS 1
5912 EOF
5913
5914                 else
5915                         have_krb5=no
5916                         echo "configure: warning: Unrecongized Kerberos V Implementation" 1>&2
5917                 fi
5918
5919                 if test $have_krb5 = yes ; then
5920                         ol_link_krb5=yes
5921
5922                         cat >> confdefs.h <<\EOF
5923 #define HAVE_KRB5 1
5924 EOF
5925
5926
5927                         if test $ol_enable_kpasswd != no ; then
5928                                 ol_link_kpasswd=yes;
5929                         fi
5930
5931                         if test $ol_with_kerberos = k5only ; then
5932                                 ol_with_kerberos=found
5933                         fi
5934
5935                 elif test $ol_with_kerberos != auto ; then
5936                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
5937                 fi
5938
5939         fi
5940 fi
5941
5942 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
5943         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
5944
5945         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5946 do
5947 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5948 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5949 echo "configure:5950: checking for $ac_hdr" >&5
5950 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5951   echo $ac_n "(cached) $ac_c" 1>&6
5952 else
5953   cat > conftest.$ac_ext <<EOF
5954 #line 5955 "configure"
5955 #include "confdefs.h"
5956 #include <$ac_hdr>
5957 EOF
5958 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5959 { (eval echo configure:5960: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5960 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5961 if test -z "$ac_err"; then
5962   rm -rf conftest*
5963   eval "ac_cv_header_$ac_safe=yes"
5964 else
5965   echo "$ac_err" >&5
5966   echo "configure: failed program was:" >&5
5967   cat conftest.$ac_ext >&5
5968   rm -rf conftest*
5969   eval "ac_cv_header_$ac_safe=no"
5970 fi
5971 rm -f conftest*
5972 fi
5973 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5974   echo "$ac_t""yes" 1>&6
5975     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5976   cat >> confdefs.h <<EOF
5977 #define $ac_tr_hdr 1
5978 EOF
5979  
5980 else
5981   echo "$ac_t""no" 1>&6
5982 fi
5983 done
5984
5985
5986         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5987                 if test $krb5_impl = mit; then
5988                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5989 echo "configure:5990: checking for main in -lkrb4" >&5
5990 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5991 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5992   echo $ac_n "(cached) $ac_c" 1>&6
5993 else
5994   ac_save_LIBS="$LIBS"
5995 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
5996 cat > conftest.$ac_ext <<EOF
5997 #line 5998 "configure"
5998 #include "confdefs.h"
5999
6000 int main() {
6001 main()
6002 ; return 0; }
6003 EOF
6004 if { (eval echo configure:6005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6005   rm -rf conftest*
6006   eval "ac_cv_lib_$ac_lib_var=yes"
6007 else
6008   echo "configure: failed program was:" >&5
6009   cat conftest.$ac_ext >&5
6010   rm -rf conftest*
6011   eval "ac_cv_lib_$ac_lib_var=no"
6012 fi
6013 rm -f conftest*
6014 LIBS="$ac_save_LIBS"
6015
6016 fi
6017 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6018   echo "$ac_t""yes" 1>&6
6019   have_k425=yes
6020                                 KRB4_LIBS="-lkrb4 -ldes425"
6021 else
6022   echo "$ac_t""no" 1>&6
6023 have_k425=no
6024 fi
6025
6026
6027                 elif test $krb5_impl = heimdal; then
6028                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
6029 echo "configure:6030: checking for main in -lkrb4" >&5
6030 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
6031 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6032   echo $ac_n "(cached) $ac_c" 1>&6
6033 else
6034   ac_save_LIBS="$LIBS"
6035 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
6036 cat > conftest.$ac_ext <<EOF
6037 #line 6038 "configure"
6038 #include "confdefs.h"
6039
6040 int main() {
6041 main()
6042 ; return 0; }
6043 EOF
6044 if { (eval echo configure:6045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6045   rm -rf conftest*
6046   eval "ac_cv_lib_$ac_lib_var=yes"
6047 else
6048   echo "configure: failed program was:" >&5
6049   cat conftest.$ac_ext >&5
6050   rm -rf conftest*
6051   eval "ac_cv_lib_$ac_lib_var=no"
6052 fi
6053 rm -f conftest*
6054 LIBS="$ac_save_LIBS"
6055
6056 fi
6057 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6058   echo "$ac_t""yes" 1>&6
6059   have_k425=yes
6060                                 KRB4_LIBS="-lkrb4"
6061 else
6062   echo "$ac_t""no" 1>&6
6063 have_k425=no
6064 fi
6065
6066
6067                 else
6068                         have_425=no
6069                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
6070                 fi
6071
6072                 if test $have_k425 = yes ; then
6073                         ol_with_kerberos=found
6074                         ol_link_krb4=yes
6075
6076                         cat >> confdefs.h <<\EOF
6077 #define HAVE_KRB425 1
6078 EOF
6079
6080                         cat >> confdefs.h <<\EOF
6081 #define HAVE_KRB4 1
6082 EOF
6083
6084
6085                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
6086 echo "configure:6087: checking for des_debug in Kerberos libraries" >&5
6087 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
6088   echo $ac_n "(cached) $ac_c" 1>&6
6089 else
6090   
6091                                                                 save_LIBS="$LIBS"
6092                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
6093                                 cat > conftest.$ac_ext <<EOF
6094 #line 6095 "configure"
6095 #include "confdefs.h"
6096
6097 #include <kerberosIV/krb.h>
6098 #include <kerberosIV/des.h>
6099 extern int des_debug;
6100
6101 int main() {
6102
6103 des_debug = 1;
6104
6105 ; return 0; }
6106 EOF
6107 if { (eval echo configure:6108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6108   rm -rf conftest*
6109   ol_cv_var_des_debug=yes
6110 else
6111   echo "configure: failed program was:" >&5
6112   cat conftest.$ac_ext >&5
6113   rm -rf conftest*
6114   ol_cv_var_des_debug=no
6115 fi
6116 rm -f conftest*
6117                                                                 LIBS="$save_LIBS"
6118                         
6119 fi
6120
6121 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6122
6123                         if test $ol_cv_var_des_debug = yes ; then
6124                                 cat >> confdefs.h <<\EOF
6125 #define HAVE_DES_DEBUG 1
6126 EOF
6127
6128                         fi
6129
6130                         LIBS="$save_LIBS"
6131                 fi
6132         fi
6133 fi
6134
6135 if test $ol_link_krb5 = yes ; then
6136         ol_with_kerberos=found
6137 fi
6138
6139 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6140         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6141
6142         for ac_hdr in krb.h des.h krb-archaeology.h 
6143 do
6144 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6145 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6146 echo "configure:6147: checking for $ac_hdr" >&5
6147 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6148   echo $ac_n "(cached) $ac_c" 1>&6
6149 else
6150   cat > conftest.$ac_ext <<EOF
6151 #line 6152 "configure"
6152 #include "confdefs.h"
6153 #include <$ac_hdr>
6154 EOF
6155 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6156 { (eval echo configure:6157: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6157 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6158 if test -z "$ac_err"; then
6159   rm -rf conftest*
6160   eval "ac_cv_header_$ac_safe=yes"
6161 else
6162   echo "$ac_err" >&5
6163   echo "configure: failed program was:" >&5
6164   cat conftest.$ac_ext >&5
6165   rm -rf conftest*
6166   eval "ac_cv_header_$ac_safe=no"
6167 fi
6168 rm -f conftest*
6169 fi
6170 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6171   echo "$ac_t""yes" 1>&6
6172     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6173   cat >> confdefs.h <<EOF
6174 #define $ac_tr_hdr 1
6175 EOF
6176  
6177 else
6178   echo "$ac_t""no" 1>&6
6179 fi
6180 done
6181
6182
6183         if test $ac_cv_header_krb_h = yes ; then
6184                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6185 echo "configure:6186: checking for main in -lkrb" >&5
6186 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6187 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6188   echo $ac_n "(cached) $ac_c" 1>&6
6189 else
6190   ac_save_LIBS="$LIBS"
6191 LIBS="-lkrb -ldes $LIBS"
6192 cat > conftest.$ac_ext <<EOF
6193 #line 6194 "configure"
6194 #include "confdefs.h"
6195
6196 int main() {
6197 main()
6198 ; return 0; }
6199 EOF
6200 if { (eval echo configure:6201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6201   rm -rf conftest*
6202   eval "ac_cv_lib_$ac_lib_var=yes"
6203 else
6204   echo "configure: failed program was:" >&5
6205   cat conftest.$ac_ext >&5
6206   rm -rf conftest*
6207   eval "ac_cv_lib_$ac_lib_var=no"
6208 fi
6209 rm -f conftest*
6210 LIBS="$ac_save_LIBS"
6211
6212 fi
6213 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6214   echo "$ac_t""yes" 1>&6
6215   have_k4=yes
6216 else
6217   echo "$ac_t""no" 1>&6
6218 have_k4=no
6219 fi
6220
6221
6222                 if test $have_k4 = yes ; then
6223                         ol_with_kerberos=found
6224                         ol_link_krb4=yes
6225
6226                         cat >> confdefs.h <<\EOF
6227 #define HAVE_KRB4 1
6228 EOF
6229
6230
6231                         KRB4_LIBS="-lkrb -ldes"
6232
6233                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6234                                 cat >> confdefs.h <<\EOF
6235 #define HAVE_KTH_KERBEROS 1
6236 EOF
6237
6238                         fi
6239                 fi
6240         fi
6241 fi
6242
6243 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6244         ol_link_kpasswd=yes
6245 fi
6246
6247 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6248         ol_link_kbind=yes
6249
6250 elif test $ol_enable_kbind = yes ; then
6251         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6252 fi
6253
6254 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6255         cat >> confdefs.h <<\EOF
6256 #define HAVE_KERBEROS 1
6257 EOF
6258
6259
6260 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6261         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6262 fi
6263
6264 ol_link_tls=no
6265 if test $ol_with_tls != no ; then
6266         for ac_hdr in openssl/ssl.h ssl.h
6267 do
6268 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6269 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6270 echo "configure:6271: checking for $ac_hdr" >&5
6271 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6272   echo $ac_n "(cached) $ac_c" 1>&6
6273 else
6274   cat > conftest.$ac_ext <<EOF
6275 #line 6276 "configure"
6276 #include "confdefs.h"
6277 #include <$ac_hdr>
6278 EOF
6279 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6280 { (eval echo configure:6281: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6281 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6282 if test -z "$ac_err"; then
6283   rm -rf conftest*
6284   eval "ac_cv_header_$ac_safe=yes"
6285 else
6286   echo "$ac_err" >&5
6287   echo "configure: failed program was:" >&5
6288   cat conftest.$ac_ext >&5
6289   rm -rf conftest*
6290   eval "ac_cv_header_$ac_safe=no"
6291 fi
6292 rm -f conftest*
6293 fi
6294 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6295   echo "$ac_t""yes" 1>&6
6296     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6297   cat >> confdefs.h <<EOF
6298 #define $ac_tr_hdr 1
6299 EOF
6300  
6301 else
6302   echo "$ac_t""no" 1>&6
6303 fi
6304 done
6305
6306         
6307         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6308                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6309 echo "configure:6310: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6310 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6311 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6312   echo $ac_n "(cached) $ac_c" 1>&6
6313 else
6314   ac_save_LIBS="$LIBS"
6315 LIBS="-lssl -lcrypto $LIBS"
6316 cat > conftest.$ac_ext <<EOF
6317 #line 6318 "configure"
6318 #include "confdefs.h"
6319 /* Override any gcc2 internal prototype to avoid an error.  */
6320 /* We use char because int might match the return type of a gcc2
6321     builtin and then its argument prototype would still apply.  */
6322 char SSLeay_add_ssl_algorithms();
6323
6324 int main() {
6325 SSLeay_add_ssl_algorithms()
6326 ; return 0; }
6327 EOF
6328 if { (eval echo configure:6329: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6329   rm -rf conftest*
6330   eval "ac_cv_lib_$ac_lib_var=yes"
6331 else
6332   echo "configure: failed program was:" >&5
6333   cat conftest.$ac_ext >&5
6334   rm -rf conftest*
6335   eval "ac_cv_lib_$ac_lib_var=no"
6336 fi
6337 rm -f conftest*
6338 LIBS="$ac_save_LIBS"
6339
6340 fi
6341 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6342   echo "$ac_t""yes" 1>&6
6343   have_ssleay=yes
6344                         need_rsaref=no
6345 else
6346   echo "$ac_t""no" 1>&6
6347 have_ssleay=no
6348 fi
6349
6350                         
6351                 if test $have_ssleay = no ; then
6352                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6353 echo "configure:6354: checking for SSL_library_init in -lssl" >&5
6354 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6355 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6356   echo $ac_n "(cached) $ac_c" 1>&6
6357 else
6358   ac_save_LIBS="$LIBS"
6359 LIBS="-lssl -lcrypto $LIBS"
6360 cat > conftest.$ac_ext <<EOF
6361 #line 6362 "configure"
6362 #include "confdefs.h"
6363 /* Override any gcc2 internal prototype to avoid an error.  */
6364 /* We use char because int might match the return type of a gcc2
6365     builtin and then its argument prototype would still apply.  */
6366 char SSL_library_init();
6367
6368 int main() {
6369 SSL_library_init()
6370 ; return 0; }
6371 EOF
6372 if { (eval echo configure:6373: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6373   rm -rf conftest*
6374   eval "ac_cv_lib_$ac_lib_var=yes"
6375 else
6376   echo "configure: failed program was:" >&5
6377   cat conftest.$ac_ext >&5
6378   rm -rf conftest*
6379   eval "ac_cv_lib_$ac_lib_var=no"
6380 fi
6381 rm -f conftest*
6382 LIBS="$ac_save_LIBS"
6383
6384 fi
6385 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6386   echo "$ac_t""yes" 1>&6
6387   have_ssleay=yes
6388                                 need_rsaref=no
6389 else
6390   echo "$ac_t""no" 1>&6
6391 have_ssleay=no
6392 fi
6393
6394                 fi
6395
6396                 if test $have_ssleay = no ; then
6397                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6398 echo "configure:6399: checking for ssl3_accept in -lssl" >&5
6399 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6400 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6401   echo $ac_n "(cached) $ac_c" 1>&6
6402 else
6403   ac_save_LIBS="$LIBS"
6404 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6405 cat > conftest.$ac_ext <<EOF
6406 #line 6407 "configure"
6407 #include "confdefs.h"
6408 /* Override any gcc2 internal prototype to avoid an error.  */
6409 /* We use char because int might match the return type of a gcc2
6410     builtin and then its argument prototype would still apply.  */
6411 char ssl3_accept();
6412
6413 int main() {
6414 ssl3_accept()
6415 ; return 0; }
6416 EOF
6417 if { (eval echo configure:6418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6418   rm -rf conftest*
6419   eval "ac_cv_lib_$ac_lib_var=yes"
6420 else
6421   echo "configure: failed program was:" >&5
6422   cat conftest.$ac_ext >&5
6423   rm -rf conftest*
6424   eval "ac_cv_lib_$ac_lib_var=no"
6425 fi
6426 rm -f conftest*
6427 LIBS="$ac_save_LIBS"
6428
6429 fi
6430 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6431   echo "$ac_t""yes" 1>&6
6432   have_ssleay=yes
6433                                 need_rsaref=yes
6434 else
6435   echo "$ac_t""no" 1>&6
6436 have_ssleay=no
6437 fi
6438
6439                 fi
6440
6441                 if test $have_ssleay = yes ; then
6442                         ol_with_tls=found
6443                         ol_link_tls=yes
6444
6445                         cat >> confdefs.h <<\EOF
6446 #define HAVE_SSLEAY 1
6447 EOF
6448
6449
6450                         if test $need_rsaref = yes; then
6451                                 cat >> confdefs.h <<\EOF
6452 #define HAVE_RSAREF 1
6453 EOF
6454
6455
6456                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6457                         else
6458                                 TLS_LIBS="-lssl -lcrypto"
6459                         fi
6460                 fi
6461         fi
6462
6463 else
6464         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6465 fi
6466
6467 if test $ol_link_tls = yes ; then
6468         cat >> confdefs.h <<\EOF
6469 #define HAVE_TLS 1
6470 EOF
6471
6472
6473 elif test $ol_with_tls = auto ; then
6474         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6475         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6476
6477 elif test $ol_with_tls != no ; then
6478         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6479 fi
6480
6481 for ac_func in \
6482         ctime_r                 \
6483         gethostbyname_r gethostbyaddr_r \
6484
6485 do
6486 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6487 echo "configure:6488: checking for $ac_func" >&5
6488 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6489   echo $ac_n "(cached) $ac_c" 1>&6
6490 else
6491   cat > conftest.$ac_ext <<EOF
6492 #line 6493 "configure"
6493 #include "confdefs.h"
6494 /* System header to define __stub macros and hopefully few prototypes,
6495     which can conflict with char $ac_func(); below.  */
6496 #include <assert.h>
6497 /* Override any gcc2 internal prototype to avoid an error.  */
6498 /* We use char because int might match the return type of a gcc2
6499     builtin and then its argument prototype would still apply.  */
6500 char $ac_func();
6501 char (*f)();
6502
6503 int main() {
6504
6505 /* The GNU C library defines this for functions which it implements
6506     to always fail with ENOSYS.  Some functions are actually named
6507     something starting with __ and the normal name is an alias.  */
6508 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6509 choke me
6510 #else
6511 f = $ac_func;
6512 #endif
6513
6514 ; return 0; }
6515 EOF
6516 if { (eval echo configure:6517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6517   rm -rf conftest*
6518   eval "ac_cv_func_$ac_func=yes"
6519 else
6520   echo "configure: failed program was:" >&5
6521   cat conftest.$ac_ext >&5
6522   rm -rf conftest*
6523   eval "ac_cv_func_$ac_func=no"
6524 fi
6525 rm -f conftest*
6526 fi
6527
6528 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6529   echo "$ac_t""yes" 1>&6
6530     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6531   cat >> confdefs.h <<EOF
6532 #define $ac_tr_func 1
6533 EOF
6534  
6535 else
6536   echo "$ac_t""no" 1>&6
6537 fi
6538 done
6539
6540
6541 if test "$ac_cv_func_ctime_r" = no ; then
6542         ol_cv_func_ctime_r_nargs=0
6543 else
6544         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6545 echo "configure:6546: checking number of arguments of ctime_r" >&5
6546 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6547   echo $ac_n "(cached) $ac_c" 1>&6
6548 else
6549   cat > conftest.$ac_ext <<EOF
6550 #line 6551 "configure"
6551 #include "confdefs.h"
6552 #include <time.h>
6553 int main() {
6554 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6555 ; return 0; }
6556 EOF
6557 if { (eval echo configure:6558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6558   rm -rf conftest*
6559   ol_cv_func_ctime_r_nargs3=yes
6560 else
6561   echo "configure: failed program was:" >&5
6562   cat conftest.$ac_ext >&5
6563   rm -rf conftest*
6564   ol_cv_func_ctime_r_nargs3=no
6565 fi
6566 rm -f conftest*
6567
6568         cat > conftest.$ac_ext <<EOF
6569 #line 6570 "configure"
6570 #include "confdefs.h"
6571 #include <time.h>
6572 int main() {
6573 time_t ti; char *buffer; ctime_r(&ti,buffer);
6574 ; return 0; }
6575 EOF
6576 if { (eval echo configure:6577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6577   rm -rf conftest*
6578   ol_cv_func_ctime_r_nargs2=yes
6579 else
6580   echo "configure: failed program was:" >&5
6581   cat conftest.$ac_ext >&5
6582   rm -rf conftest*
6583   ol_cv_func_ctime_r_nargs2=no
6584 fi
6585 rm -f conftest*
6586
6587         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6588                 $ol_cv_func_ctime_r_nargs2 = no ; then
6589
6590                 ol_cv_func_ctime_r_nargs=3
6591
6592         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6593                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6594
6595                 ol_cv_func_ctime_r_nargs=2
6596
6597         else
6598                 ol_cv_func_ctime_r_nargs=0
6599         fi
6600   
6601 fi
6602
6603 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6604
6605   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6606         cat >> confdefs.h <<EOF
6607 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6608 EOF
6609
6610   fi
6611
6612 fi
6613
6614 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6615         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6616 echo "configure:6617: checking number of arguments of gethostbyname_r" >&5
6617 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6618   echo $ac_n "(cached) $ac_c" 1>&6
6619 else
6620   cat > conftest.$ac_ext <<EOF
6621 #line 6622 "configure"
6622 #include "confdefs.h"
6623 #include <sys/types.h>
6624 #include <sys/socket.h>
6625 #include <netinet/in.h>
6626 #include <netdb.h>
6627 #define BUFSIZE (sizeof(struct hostent)+10)
6628 int main() {
6629 struct hostent hent; char buffer[BUFSIZE];
6630                 int bufsize=BUFSIZE;int h_errno;
6631                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6632                         buffer, bufsize, &h_errno);
6633 ; return 0; }
6634 EOF
6635 if { (eval echo configure:6636: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6636   rm -rf conftest*
6637   ol_cv_func_gethostbyname_r_nargs5=yes
6638 else
6639   echo "configure: failed program was:" >&5
6640   cat conftest.$ac_ext >&5
6641   rm -rf conftest*
6642   ol_cv_func_gethostbyname_r_nargs5=no
6643 fi
6644 rm -f conftest*
6645
6646         cat > conftest.$ac_ext <<EOF
6647 #line 6648 "configure"
6648 #include "confdefs.h"
6649 #include <sys/types.h>
6650 #include <sys/socket.h>
6651 #include <netinet/in.h>
6652 #include <netdb.h>
6653 #define BUFSIZE (sizeof(struct hostent)+10)
6654 int main() {
6655 struct hostent hent;struct hostent *rhent;
6656                 char buffer[BUFSIZE];
6657                 int bufsize=BUFSIZE;int h_errno;
6658                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6659                         &rhent, &h_errno);
6660 ; return 0; }
6661 EOF
6662 if { (eval echo configure:6663: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6663   rm -rf conftest*
6664   ol_cv_func_gethostbyname_r_nargs6=yes
6665 else
6666   echo "configure: failed program was:" >&5
6667   cat conftest.$ac_ext >&5
6668   rm -rf conftest*
6669   ol_cv_func_gethostbyname_r_nargs6=no
6670 fi
6671 rm -f conftest*
6672
6673         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6674                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6675
6676                 ol_cv_func_gethostbyname_r_nargs=5
6677
6678         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6679                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6680
6681                 ol_cv_func_gethostbyname_r_nargs=6
6682
6683         else
6684                 ol_cv_func_gethostbyname_r_nargs=0
6685         fi
6686   
6687 fi
6688
6689 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6690   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6691         cat >> confdefs.h <<EOF
6692 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6693 EOF
6694
6695   fi
6696
6697 else
6698         ol_cv_func_gethostbyname_r_nargs=0
6699 fi
6700  
6701 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6702         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6703 echo "configure:6704: checking number of arguments of gethostbyaddr_r" >&5
6704 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6705   echo $ac_n "(cached) $ac_c" 1>&6
6706 else
6707   cat > conftest.$ac_ext <<EOF
6708 #line 6709 "configure"
6709 #include "confdefs.h"
6710 #include <sys/types.h>
6711 #include <sys/socket.h>
6712 #include <netinet/in.h>
6713 #include <netdb.h>
6714 #define BUFSIZE (sizeof(struct hostent)+10)
6715 int main() {
6716 struct hostent hent; char buffer[BUFSIZE]; 
6717             struct in_addr add;
6718             size_t alen=sizeof(struct in_addr);
6719             int bufsize=BUFSIZE;int h_errno;
6720                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6721                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6722 ; return 0; }
6723 EOF
6724 if { (eval echo configure:6725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6725   rm -rf conftest*
6726   ol_cv_func_gethostbyaddr_r_nargs7=yes
6727 else
6728   echo "configure: failed program was:" >&5
6729   cat conftest.$ac_ext >&5
6730   rm -rf conftest*
6731   ol_cv_func_gethostbyaddr_r_nargs7=no
6732 fi
6733 rm -f conftest*
6734
6735         cat > conftest.$ac_ext <<EOF
6736 #line 6737 "configure"
6737 #include "confdefs.h"
6738 #include <sys/types.h>
6739 #include <sys/socket.h>
6740 #include <netinet/in.h>
6741 #include <netdb.h>
6742 #define BUFSIZE (sizeof(struct hostent)+10)
6743 int main() {
6744 struct hostent hent;
6745                 struct hostent *rhent; char buffer[BUFSIZE]; 
6746                 struct in_addr add;
6747                 size_t alen=sizeof(struct in_addr);
6748                 int bufsize=BUFSIZE;int h_errno;
6749                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6750                         alen, AF_INET, &hent, buffer, bufsize, 
6751                         &rhent, &h_errno);
6752 ; return 0; }
6753 EOF
6754 if { (eval echo configure:6755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6755   rm -rf conftest*
6756   ol_cv_func_gethostbyaddr_r_nargs8=yes
6757 else
6758   echo "configure: failed program was:" >&5
6759   cat conftest.$ac_ext >&5
6760   rm -rf conftest*
6761   ol_cv_func_gethostbyaddr_r_nargs8=no
6762 fi
6763 rm -f conftest*
6764
6765         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6766                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6767
6768                 ol_cv_func_gethostbyaddr_r_nargs=7
6769
6770         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6771                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6772
6773                 ol_cv_func_gethostbyaddr_r_nargs=8
6774
6775         else
6776                 ol_cv_func_gethostbyaddr_r_nargs=0
6777         fi
6778   
6779 fi
6780
6781 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6782   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6783     cat >> confdefs.h <<EOF
6784 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6785 EOF
6786
6787   fi
6788
6789 else
6790         ol_cv_func_gethostbyaddr_r_nargs=0
6791 fi
6792
6793 if test "$ac_cv_func_ctime_r" = yes \
6794         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6795         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6796         -a "$ac_cv_func_gethostbyname_r" = yes \
6797         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6798         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6799         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6800         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6801         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6802         ; then
6803  
6804         cat >> confdefs.h <<\EOF
6805 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6806 EOF
6807
6808 fi
6809
6810 ol_link_threads=no
6811
6812 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6813         -o $ol_with_threads = nt ; then
6814
6815         
6816         echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6817 echo "configure:6818: checking for _beginthread" >&5
6818 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6819   echo $ac_n "(cached) $ac_c" 1>&6
6820 else
6821   cat > conftest.$ac_ext <<EOF
6822 #line 6823 "configure"
6823 #include "confdefs.h"
6824 /* System header to define __stub macros and hopefully few prototypes,
6825     which can conflict with char _beginthread(); below.  */
6826 #include <assert.h>
6827 /* Override any gcc2 internal prototype to avoid an error.  */
6828 /* We use char because int might match the return type of a gcc2
6829     builtin and then its argument prototype would still apply.  */
6830 char _beginthread();
6831 char (*f)();
6832
6833 int main() {
6834
6835 /* The GNU C library defines this for functions which it implements
6836     to always fail with ENOSYS.  Some functions are actually named
6837     something starting with __ and the normal name is an alias.  */
6838 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6839 choke me
6840 #else
6841 f = _beginthread;
6842 #endif
6843
6844 ; return 0; }
6845 EOF
6846 if { (eval echo configure:6847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6847   rm -rf conftest*
6848   eval "ac_cv_func__beginthread=yes"
6849 else
6850   echo "configure: failed program was:" >&5
6851   cat conftest.$ac_ext >&5
6852   rm -rf conftest*
6853   eval "ac_cv_func__beginthread=no"
6854 fi
6855 rm -f conftest*
6856 fi
6857
6858 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6859   echo "$ac_t""yes" 1>&6
6860   :
6861 else
6862   echo "$ac_t""no" 1>&6
6863 fi
6864
6865
6866         if test $ac_cv_func__beginthread = yes ; then
6867                 cat >> confdefs.h <<\EOF
6868 #define HAVE_NT_THREADS 1
6869 EOF
6870
6871         fi
6872
6873
6874         if test "$ol_cv_nt_threads" = yes ; then
6875         ol_link_threads=nt
6876         ol_with_threads=found
6877         ol_with_yielding_select=yes
6878
6879                 cat >> confdefs.h <<\EOF
6880 #define HAVE_NT_SERVICE_MANAGER 1
6881 EOF
6882
6883                 cat >> confdefs.h <<\EOF
6884 #define HAVE_NT_EVENT_LOG 1
6885 EOF
6886
6887         fi
6888
6889         if test $ol_with_threads = nt ; then
6890                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
6891         fi
6892 fi
6893
6894 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6895         -o $ol_with_threads = posix ; then
6896
6897         for ac_hdr in pthread.h
6898 do
6899 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6900 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6901 echo "configure:6902: checking for $ac_hdr" >&5
6902 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6903   echo $ac_n "(cached) $ac_c" 1>&6
6904 else
6905   cat > conftest.$ac_ext <<EOF
6906 #line 6907 "configure"
6907 #include "confdefs.h"
6908 #include <$ac_hdr>
6909 EOF
6910 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6911 { (eval echo configure:6912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6912 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6913 if test -z "$ac_err"; then
6914   rm -rf conftest*
6915   eval "ac_cv_header_$ac_safe=yes"
6916 else
6917   echo "$ac_err" >&5
6918   echo "configure: failed program was:" >&5
6919   cat conftest.$ac_ext >&5
6920   rm -rf conftest*
6921   eval "ac_cv_header_$ac_safe=no"
6922 fi
6923 rm -f conftest*
6924 fi
6925 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6926   echo "$ac_t""yes" 1>&6
6927     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6928   cat >> confdefs.h <<EOF
6929 #define $ac_tr_hdr 1
6930 EOF
6931  
6932 else
6933   echo "$ac_t""no" 1>&6
6934 fi
6935 done
6936
6937
6938         if test $ac_cv_header_pthread_h = yes ; then
6939                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6940 echo "configure:6941: checking POSIX thread version" >&5
6941 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6942   echo $ac_n "(cached) $ac_c" 1>&6
6943 else
6944   
6945         cat > conftest.$ac_ext <<EOF
6946 #line 6947 "configure"
6947 #include "confdefs.h"
6948
6949 #               include <pthread.h>
6950                 /* this check could be improved */
6951 #               ifdef PTHREAD_ONCE_INIT
6952                         pthread_version_final;
6953 #               endif
6954         
6955 EOF
6956 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6957   egrep "pthread_version_final" >/dev/null 2>&1; then
6958   rm -rf conftest*
6959   ol_pthread_final=yes
6960 else
6961   rm -rf conftest*
6962   ol_pthread_final=no
6963 fi
6964 rm -f conftest*
6965
6966
6967         cat > conftest.$ac_ext <<EOF
6968 #line 6969 "configure"
6969 #include "confdefs.h"
6970
6971 #               include <pthread.h>
6972                 /* this check could be improved */
6973 #               ifdef pthread_once_init
6974                         pthread_version_draft4;
6975 #               endif
6976         
6977 EOF
6978 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6979   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6980   rm -rf conftest*
6981   ol_pthread_draft4=yes
6982 else
6983   rm -rf conftest*
6984   ol_pthread_draft4=no
6985 fi
6986 rm -f conftest*
6987
6988
6989         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6990                 ol_cv_pthread_version=final
6991         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6992                 ol_cv_pthread_version=draft4
6993         else
6994                 ol_cv_pthread_version=unknown
6995         fi
6996
6997 fi
6998
6999 echo "$ac_t""$ol_cv_pthread_version" 1>&6
7000
7001
7002                 if test $ol_cv_pthread_version = final ; then
7003                         cat >> confdefs.h <<\EOF
7004 #define HAVE_PTHREADS_FINAL 1
7005 EOF
7006
7007                 elif test $ol_cv_pthread_version = draft4 ; then
7008                         cat >> confdefs.h <<\EOF
7009 #define HAVE_PTHREADS_D4 1
7010 EOF
7011
7012                 else
7013                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
7014                 fi
7015
7016                 # consider threads found
7017                 ol_with_threads=found
7018
7019                 
7020         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7021 echo "configure:7022: checking for LinuxThreads pthread.h" >&5
7022 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
7023   echo $ac_n "(cached) $ac_c" 1>&6
7024 else
7025   cat > conftest.$ac_ext <<EOF
7026 #line 7027 "configure"
7027 #include "confdefs.h"
7028 #include <pthread.h>
7029 EOF
7030 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7031   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7032   rm -rf conftest*
7033   ol_cv_header_linux_threads=yes
7034 else
7035   rm -rf conftest*
7036   ol_cv_header_linux_threads=no
7037 fi
7038 rm -f conftest*
7039
7040                 
7041 fi
7042
7043 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7044         if test $ol_cv_header_linux_threads = yes; then
7045                 cat >> confdefs.h <<\EOF
7046 #define HAVE_LINUX_THREADS 1
7047 EOF
7048
7049         fi
7050
7051                 
7052         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
7053 echo "configure:7054: checking for GNU Pth pthread.h" >&5
7054 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
7055   echo $ac_n "(cached) $ac_c" 1>&6
7056 else
7057   cat > conftest.$ac_ext <<EOF
7058 #line 7059 "configure"
7059 #include "confdefs.h"
7060 #include <pthread.h>
7061 #ifdef _POSIX_THREAD_IS_GNU_PTH
7062         __gnu_pth__;
7063 #endif
7064
7065 EOF
7066 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7067   egrep "__gnu_pth__" >/dev/null 2>&1; then
7068   rm -rf conftest*
7069   ol_cv_header_gnu_pth_pthread_h=yes
7070 else
7071   rm -rf conftest*
7072   ol_cv_header_gnu_pth_pthread_h=no
7073 fi
7074 rm -f conftest*
7075
7076                 
7077 fi
7078
7079 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
7080
7081
7082                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
7083                         for ac_hdr in sched.h
7084 do
7085 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7086 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7087 echo "configure:7088: checking for $ac_hdr" >&5
7088 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7089   echo $ac_n "(cached) $ac_c" 1>&6
7090 else
7091   cat > conftest.$ac_ext <<EOF
7092 #line 7093 "configure"
7093 #include "confdefs.h"
7094 #include <$ac_hdr>
7095 EOF
7096 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7097 { (eval echo configure:7098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7098 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7099 if test -z "$ac_err"; then
7100   rm -rf conftest*
7101   eval "ac_cv_header_$ac_safe=yes"
7102 else
7103   echo "$ac_err" >&5
7104   echo "configure: failed program was:" >&5
7105   cat conftest.$ac_ext >&5
7106   rm -rf conftest*
7107   eval "ac_cv_header_$ac_safe=no"
7108 fi
7109 rm -f conftest*
7110 fi
7111 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7112   echo "$ac_t""yes" 1>&6
7113     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7114   cat >> confdefs.h <<EOF
7115 #define $ac_tr_hdr 1
7116 EOF
7117  
7118 else
7119   echo "$ac_t""no" 1>&6
7120 fi
7121 done
7122
7123                 fi
7124
7125                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7126                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7127 echo "configure:7128: checking for pthread_create in default libraries" >&5
7128 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7129   echo $ac_n "(cached) $ac_c" 1>&6
7130 else
7131   
7132                 if test "$cross_compiling" = yes; then
7133   cat > conftest.$ac_ext <<EOF
7134 #line 7135 "configure"
7135 #include "confdefs.h"
7136 /* pthread test headers */
7137 #include <pthread.h>
7138 #ifndef NULL
7139 #define NULL (void*)0
7140 #endif
7141
7142 static void *task(p)
7143         void *p;
7144 {
7145         return (void *) (p == NULL);
7146 }
7147
7148 int main() {
7149
7150         /* pthread test function */
7151         pthread_t t;
7152         int status;
7153 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7154         /* This system (e.g. AIX) defaults detached; must override */
7155         pthread_attr_t attr;
7156
7157         status = pthread_attr_init(&attr);
7158         if( status ) exit( status );
7159
7160         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7161         if( status ) exit( status );
7162
7163 #       define  ATTR    &attr
7164 #elif defined( HAVE_PTHREADS_D4 )
7165 #       define  ATTR    pthread_attr_default
7166 #else
7167 #       define  ATTR    NULL
7168 #endif
7169
7170         /* make sure pthread_create() isn't just a stub */
7171         status = pthread_create(&t, ATTR, task, NULL);
7172         if( status ) exit( status );
7173
7174         /* give the thread a chance to complete...
7175      * it should remain joinable and hence detachable
7176          */
7177         sleep( 1 );
7178
7179         /* make sure pthread_detach() isn't just a stub */
7180 #if HAVE_PTHREADS_D4
7181         status = pthread_detach( &t );
7182 #else
7183         status = pthread_detach( t );
7184 #endif
7185
7186 #ifdef HAVE_LINUX_THREADS
7187         pthread_kill_other_threads_np();
7188 #endif
7189
7190         exit( status );
7191
7192 ; return 0; }
7193 EOF
7194 if { (eval echo configure:7195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7195   rm -rf conftest*
7196   ol_cv_pthread_create=yes
7197 else
7198   echo "configure: failed program was:" >&5
7199   cat conftest.$ac_ext >&5
7200   rm -rf conftest*
7201   ol_cv_pthread_create=no
7202 fi
7203 rm -f conftest*
7204 else
7205   cat > conftest.$ac_ext <<EOF
7206 #line 7207 "configure"
7207 #include "confdefs.h"
7208 /* pthread test headers */
7209 #include <pthread.h>
7210 #ifndef NULL
7211 #define NULL (void*)0
7212 #endif
7213
7214 static void *task(p)
7215         void *p;
7216 {
7217         return (void *) (p == NULL);
7218 }
7219
7220
7221 int main(argc, argv)
7222         int argc;
7223         char **argv;
7224 {
7225
7226         /* pthread test function */
7227         pthread_t t;
7228         int status;
7229 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7230         /* This system (e.g. AIX) defaults detached; must override */
7231         pthread_attr_t attr;
7232
7233         status = pthread_attr_init(&attr);
7234         if( status ) exit( status );
7235
7236         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7237         if( status ) exit( status );
7238
7239 #       define  ATTR    &attr
7240 #elif defined( HAVE_PTHREADS_D4 )
7241 #       define  ATTR    pthread_attr_default
7242 #else
7243 #       define  ATTR    NULL
7244 #endif
7245
7246         /* make sure pthread_create() isn't just a stub */
7247         status = pthread_create(&t, ATTR, task, NULL);
7248         if( status ) exit( status );
7249
7250         /* give the thread a chance to complete...
7251      * it should remain joinable and hence detachable
7252          */
7253         sleep( 1 );
7254
7255         /* make sure pthread_detach() isn't just a stub */
7256 #if HAVE_PTHREADS_D4
7257         status = pthread_detach( &t );
7258 #else
7259         status = pthread_detach( t );
7260 #endif
7261
7262 #ifdef HAVE_LINUX_THREADS
7263         pthread_kill_other_threads_np();
7264 #endif
7265
7266         exit( status );
7267
7268 }
7269
7270 EOF
7271 if { (eval echo configure:7272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7272 then
7273   ol_cv_pthread_create=yes
7274 else
7275   echo "configure: failed program was:" >&5
7276   cat conftest.$ac_ext >&5
7277   rm -fr conftest*
7278   ol_cv_pthread_create=no
7279 fi
7280 rm -fr conftest*
7281 fi
7282
7283 fi
7284
7285 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7286
7287                 if test $ol_cv_pthread_create != no ; then
7288                         ol_link_threads=posix
7289                         ol_link_pthreads=""
7290                 fi
7291                 
7292                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7293 if test "$ol_link_threads" = no ; then
7294         # try -kthread
7295         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7296 echo "configure:7297: checking for pthread link with -kthread" >&5
7297 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7298   echo $ac_n "(cached) $ac_c" 1>&6
7299 else
7300   
7301                 # save the flags
7302                 ol_LIBS="$LIBS"
7303                 LIBS="-kthread $LIBS"
7304
7305                 if test "$cross_compiling" = yes; then
7306   cat > conftest.$ac_ext <<EOF
7307 #line 7308 "configure"
7308 #include "confdefs.h"
7309 /* pthread test headers */
7310 #include <pthread.h>
7311 #ifndef NULL
7312 #define NULL (void*)0
7313 #endif
7314
7315 static void *task(p)
7316         void *p;
7317 {
7318         return (void *) (p == NULL);
7319 }
7320
7321 int main() {
7322
7323         /* pthread test function */
7324         pthread_t t;
7325         int status;
7326 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7327         /* This system (e.g. AIX) defaults detached; must override */
7328         pthread_attr_t attr;
7329
7330         status = pthread_attr_init(&attr);
7331         if( status ) exit( status );
7332
7333         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7334         if( status ) exit( status );
7335
7336 #       define  ATTR    &attr
7337 #elif defined( HAVE_PTHREADS_D4 )
7338 #       define  ATTR    pthread_attr_default
7339 #else
7340 #       define  ATTR    NULL
7341 #endif
7342
7343         /* make sure pthread_create() isn't just a stub */
7344         status = pthread_create(&t, ATTR, task, NULL);
7345         if( status ) exit( status );
7346
7347         /* give the thread a chance to complete...
7348      * it should remain joinable and hence detachable
7349          */
7350         sleep( 1 );
7351
7352         /* make sure pthread_detach() isn't just a stub */
7353 #if HAVE_PTHREADS_D4
7354         status = pthread_detach( &t );
7355 #else
7356         status = pthread_detach( t );
7357 #endif
7358
7359 #ifdef HAVE_LINUX_THREADS
7360         pthread_kill_other_threads_np();
7361 #endif
7362
7363         exit( status );
7364
7365 ; return 0; }
7366 EOF
7367 if { (eval echo configure:7368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7368   rm -rf conftest*
7369   ol_cv_pthread_kthread=yes
7370 else
7371   echo "configure: failed program was:" >&5
7372   cat conftest.$ac_ext >&5
7373   rm -rf conftest*
7374   ol_cv_pthread_kthread=no
7375 fi
7376 rm -f conftest*
7377 else
7378   cat > conftest.$ac_ext <<EOF
7379 #line 7380 "configure"
7380 #include "confdefs.h"
7381 /* pthread test headers */
7382 #include <pthread.h>
7383 #ifndef NULL
7384 #define NULL (void*)0
7385 #endif
7386
7387 static void *task(p)
7388         void *p;
7389 {
7390         return (void *) (p == NULL);
7391 }
7392
7393
7394 int main(argc, argv)
7395         int argc;
7396         char **argv;
7397 {
7398
7399         /* pthread test function */
7400         pthread_t t;
7401         int status;
7402 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7403         /* This system (e.g. AIX) defaults detached; must override */
7404         pthread_attr_t attr;
7405
7406         status = pthread_attr_init(&attr);
7407         if( status ) exit( status );
7408
7409         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7410         if( status ) exit( status );
7411
7412 #       define  ATTR    &attr
7413 #elif defined( HAVE_PTHREADS_D4 )
7414 #       define  ATTR    pthread_attr_default
7415 #else
7416 #       define  ATTR    NULL
7417 #endif
7418
7419         /* make sure pthread_create() isn't just a stub */
7420         status = pthread_create(&t, ATTR, task, NULL);
7421         if( status ) exit( status );
7422
7423         /* give the thread a chance to complete...
7424      * it should remain joinable and hence detachable
7425          */
7426         sleep( 1 );
7427
7428         /* make sure pthread_detach() isn't just a stub */
7429 #if HAVE_PTHREADS_D4
7430         status = pthread_detach( &t );
7431 #else
7432         status = pthread_detach( t );
7433 #endif
7434
7435 #ifdef HAVE_LINUX_THREADS
7436         pthread_kill_other_threads_np();
7437 #endif
7438
7439         exit( status );
7440
7441 }
7442
7443 EOF
7444 if { (eval echo configure:7445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7445 then
7446   ol_cv_pthread_kthread=yes
7447 else
7448   echo "configure: failed program was:" >&5
7449   cat conftest.$ac_ext >&5
7450   rm -fr conftest*
7451   ol_cv_pthread_kthread=no
7452 fi
7453 rm -fr conftest*
7454 fi
7455
7456
7457                 # restore the LIBS
7458                 LIBS="$ol_LIBS"
7459         
7460 fi
7461
7462 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7463
7464         if test $ol_cv_pthread_kthread = yes ; then
7465                 ol_link_pthreads="-kthread"
7466                 ol_link_threads=posix
7467         fi
7468 fi
7469
7470                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7471 if test "$ol_link_threads" = no ; then
7472         # try -pthread
7473         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7474 echo "configure:7475: checking for pthread link with -pthread" >&5
7475 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7476   echo $ac_n "(cached) $ac_c" 1>&6
7477 else
7478   
7479                 # save the flags
7480                 ol_LIBS="$LIBS"
7481                 LIBS="-pthread $LIBS"
7482
7483                 if test "$cross_compiling" = yes; then
7484   cat > conftest.$ac_ext <<EOF
7485 #line 7486 "configure"
7486 #include "confdefs.h"
7487 /* pthread test headers */
7488 #include <pthread.h>
7489 #ifndef NULL
7490 #define NULL (void*)0
7491 #endif
7492
7493 static void *task(p)
7494         void *p;
7495 {
7496         return (void *) (p == NULL);
7497 }
7498
7499 int main() {
7500
7501         /* pthread test function */
7502         pthread_t t;
7503         int status;
7504 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7505         /* This system (e.g. AIX) defaults detached; must override */
7506         pthread_attr_t attr;
7507
7508         status = pthread_attr_init(&attr);
7509         if( status ) exit( status );
7510
7511         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7512         if( status ) exit( status );
7513
7514 #       define  ATTR    &attr
7515 #elif defined( HAVE_PTHREADS_D4 )
7516 #       define  ATTR    pthread_attr_default
7517 #else
7518 #       define  ATTR    NULL
7519 #endif
7520
7521         /* make sure pthread_create() isn't just a stub */
7522         status = pthread_create(&t, ATTR, task, NULL);
7523         if( status ) exit( status );
7524
7525         /* give the thread a chance to complete...
7526      * it should remain joinable and hence detachable
7527          */
7528         sleep( 1 );
7529
7530         /* make sure pthread_detach() isn't just a stub */
7531 #if HAVE_PTHREADS_D4
7532         status = pthread_detach( &t );
7533 #else
7534         status = pthread_detach( t );
7535 #endif
7536
7537 #ifdef HAVE_LINUX_THREADS
7538         pthread_kill_other_threads_np();
7539 #endif
7540
7541         exit( status );
7542
7543 ; return 0; }
7544 EOF
7545 if { (eval echo configure:7546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7546   rm -rf conftest*
7547   ol_cv_pthread_pthread=yes
7548 else
7549   echo "configure: failed program was:" >&5
7550   cat conftest.$ac_ext >&5
7551   rm -rf conftest*
7552   ol_cv_pthread_pthread=no
7553 fi
7554 rm -f conftest*
7555 else
7556   cat > conftest.$ac_ext <<EOF
7557 #line 7558 "configure"
7558 #include "confdefs.h"
7559 /* pthread test headers */
7560 #include <pthread.h>
7561 #ifndef NULL
7562 #define NULL (void*)0
7563 #endif
7564
7565 static void *task(p)
7566         void *p;
7567 {
7568         return (void *) (p == NULL);
7569 }
7570
7571
7572 int main(argc, argv)
7573         int argc;
7574         char **argv;
7575 {
7576
7577         /* pthread test function */
7578         pthread_t t;
7579         int status;
7580 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7581         /* This system (e.g. AIX) defaults detached; must override */
7582         pthread_attr_t attr;
7583
7584         status = pthread_attr_init(&attr);
7585         if( status ) exit( status );
7586
7587         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7588         if( status ) exit( status );
7589
7590 #       define  ATTR    &attr
7591 #elif defined( HAVE_PTHREADS_D4 )
7592 #       define  ATTR    pthread_attr_default
7593 #else
7594 #       define  ATTR    NULL
7595 #endif
7596
7597         /* make sure pthread_create() isn't just a stub */
7598         status = pthread_create(&t, ATTR, task, NULL);
7599         if( status ) exit( status );
7600
7601         /* give the thread a chance to complete...
7602      * it should remain joinable and hence detachable
7603          */
7604         sleep( 1 );
7605
7606         /* make sure pthread_detach() isn't just a stub */
7607 #if HAVE_PTHREADS_D4
7608         status = pthread_detach( &t );
7609 #else
7610         status = pthread_detach( t );
7611 #endif
7612
7613 #ifdef HAVE_LINUX_THREADS
7614         pthread_kill_other_threads_np();
7615 #endif
7616
7617         exit( status );
7618
7619 }
7620
7621 EOF
7622 if { (eval echo configure:7623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7623 then
7624   ol_cv_pthread_pthread=yes
7625 else
7626   echo "configure: failed program was:" >&5
7627   cat conftest.$ac_ext >&5
7628   rm -fr conftest*
7629   ol_cv_pthread_pthread=no
7630 fi
7631 rm -fr conftest*
7632 fi
7633
7634
7635                 # restore the LIBS
7636                 LIBS="$ol_LIBS"
7637         
7638 fi
7639
7640 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7641
7642         if test $ol_cv_pthread_pthread = yes ; then
7643                 ol_link_pthreads="-pthread"
7644                 ol_link_threads=posix
7645         fi
7646 fi
7647
7648                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7649 if test "$ol_link_threads" = no ; then
7650         # try -pthreads
7651         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7652 echo "configure:7653: checking for pthread link with -pthreads" >&5
7653 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7654   echo $ac_n "(cached) $ac_c" 1>&6
7655 else
7656   
7657                 # save the flags
7658                 ol_LIBS="$LIBS"
7659                 LIBS="-pthreads $LIBS"
7660
7661                 if test "$cross_compiling" = yes; then
7662   cat > conftest.$ac_ext <<EOF
7663 #line 7664 "configure"
7664 #include "confdefs.h"
7665 /* pthread test headers */
7666 #include <pthread.h>
7667 #ifndef NULL
7668 #define NULL (void*)0
7669 #endif
7670
7671 static void *task(p)
7672         void *p;
7673 {
7674         return (void *) (p == NULL);
7675 }
7676
7677 int main() {
7678
7679         /* pthread test function */
7680         pthread_t t;
7681         int status;
7682 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7683         /* This system (e.g. AIX) defaults detached; must override */
7684         pthread_attr_t attr;
7685
7686         status = pthread_attr_init(&attr);
7687         if( status ) exit( status );
7688
7689         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7690         if( status ) exit( status );
7691
7692 #       define  ATTR    &attr
7693 #elif defined( HAVE_PTHREADS_D4 )
7694 #       define  ATTR    pthread_attr_default
7695 #else
7696 #       define  ATTR    NULL
7697 #endif
7698
7699         /* make sure pthread_create() isn't just a stub */
7700         status = pthread_create(&t, ATTR, task, NULL);
7701         if( status ) exit( status );
7702
7703         /* give the thread a chance to complete...
7704      * it should remain joinable and hence detachable
7705          */
7706         sleep( 1 );
7707
7708         /* make sure pthread_detach() isn't just a stub */
7709 #if HAVE_PTHREADS_D4
7710         status = pthread_detach( &t );
7711 #else
7712         status = pthread_detach( t );
7713 #endif
7714
7715 #ifdef HAVE_LINUX_THREADS
7716         pthread_kill_other_threads_np();
7717 #endif
7718
7719         exit( status );
7720
7721 ; return 0; }
7722 EOF
7723 if { (eval echo configure:7724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7724   rm -rf conftest*
7725   ol_cv_pthread_pthreads=yes
7726 else
7727   echo "configure: failed program was:" >&5
7728   cat conftest.$ac_ext >&5
7729   rm -rf conftest*
7730   ol_cv_pthread_pthreads=no
7731 fi
7732 rm -f conftest*
7733 else
7734   cat > conftest.$ac_ext <<EOF
7735 #line 7736 "configure"
7736 #include "confdefs.h"
7737 /* pthread test headers */
7738 #include <pthread.h>
7739 #ifndef NULL
7740 #define NULL (void*)0
7741 #endif
7742
7743 static void *task(p)
7744         void *p;
7745 {
7746         return (void *) (p == NULL);
7747 }
7748
7749
7750 int main(argc, argv)
7751         int argc;
7752         char **argv;
7753 {
7754
7755         /* pthread test function */
7756         pthread_t t;
7757         int status;
7758 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7759         /* This system (e.g. AIX) defaults detached; must override */
7760         pthread_attr_t attr;
7761
7762         status = pthread_attr_init(&attr);
7763         if( status ) exit( status );
7764
7765         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7766         if( status ) exit( status );
7767
7768 #       define  ATTR    &attr
7769 #elif defined( HAVE_PTHREADS_D4 )
7770 #       define  ATTR    pthread_attr_default
7771 #else
7772 #       define  ATTR    NULL
7773 #endif
7774
7775         /* make sure pthread_create() isn't just a stub */
7776         status = pthread_create(&t, ATTR, task, NULL);
7777         if( status ) exit( status );
7778
7779         /* give the thread a chance to complete...
7780      * it should remain joinable and hence detachable
7781          */
7782         sleep( 1 );
7783
7784         /* make sure pthread_detach() isn't just a stub */
7785 #if HAVE_PTHREADS_D4
7786         status = pthread_detach( &t );
7787 #else
7788         status = pthread_detach( t );
7789 #endif
7790
7791 #ifdef HAVE_LINUX_THREADS
7792         pthread_kill_other_threads_np();
7793 #endif
7794
7795         exit( status );
7796
7797 }
7798
7799 EOF
7800 if { (eval echo configure:7801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7801 then
7802   ol_cv_pthread_pthreads=yes
7803 else
7804   echo "configure: failed program was:" >&5
7805   cat conftest.$ac_ext >&5
7806   rm -fr conftest*
7807   ol_cv_pthread_pthreads=no
7808 fi
7809 rm -fr conftest*
7810 fi
7811
7812
7813                 # restore the LIBS
7814                 LIBS="$ol_LIBS"
7815         
7816 fi
7817
7818 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7819
7820         if test $ol_cv_pthread_pthreads = yes ; then
7821                 ol_link_pthreads="-pthreads"
7822                 ol_link_threads=posix
7823         fi
7824 fi
7825
7826                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7827 if test "$ol_link_threads" = no ; then
7828         # try -mthreads
7829         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7830 echo "configure:7831: checking for pthread link with -mthreads" >&5
7831 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7832   echo $ac_n "(cached) $ac_c" 1>&6
7833 else
7834   
7835                 # save the flags
7836                 ol_LIBS="$LIBS"
7837                 LIBS="-mthreads $LIBS"
7838
7839                 if test "$cross_compiling" = yes; then
7840   cat > conftest.$ac_ext <<EOF
7841 #line 7842 "configure"
7842 #include "confdefs.h"
7843 /* pthread test headers */
7844 #include <pthread.h>
7845 #ifndef NULL
7846 #define NULL (void*)0
7847 #endif
7848
7849 static void *task(p)
7850         void *p;
7851 {
7852         return (void *) (p == NULL);
7853 }
7854
7855 int main() {
7856
7857         /* pthread test function */
7858         pthread_t t;
7859         int status;
7860 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7861         /* This system (e.g. AIX) defaults detached; must override */
7862         pthread_attr_t attr;
7863
7864         status = pthread_attr_init(&attr);
7865         if( status ) exit( status );
7866
7867         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7868         if( status ) exit( status );
7869
7870 #       define  ATTR    &attr
7871 #elif defined( HAVE_PTHREADS_D4 )
7872 #       define  ATTR    pthread_attr_default
7873 #else
7874 #       define  ATTR    NULL
7875 #endif
7876
7877         /* make sure pthread_create() isn't just a stub */
7878         status = pthread_create(&t, ATTR, task, NULL);
7879         if( status ) exit( status );
7880
7881         /* give the thread a chance to complete...
7882      * it should remain joinable and hence detachable
7883          */
7884         sleep( 1 );
7885
7886         /* make sure pthread_detach() isn't just a stub */
7887 #if HAVE_PTHREADS_D4
7888         status = pthread_detach( &t );
7889 #else
7890         status = pthread_detach( t );
7891 #endif
7892
7893 #ifdef HAVE_LINUX_THREADS
7894         pthread_kill_other_threads_np();
7895 #endif
7896
7897         exit( status );
7898
7899 ; return 0; }
7900 EOF
7901 if { (eval echo configure:7902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7902   rm -rf conftest*
7903   ol_cv_pthread_mthreads=yes
7904 else
7905   echo "configure: failed program was:" >&5
7906   cat conftest.$ac_ext >&5
7907   rm -rf conftest*
7908   ol_cv_pthread_mthreads=no
7909 fi
7910 rm -f conftest*
7911 else
7912   cat > conftest.$ac_ext <<EOF
7913 #line 7914 "configure"
7914 #include "confdefs.h"
7915 /* pthread test headers */
7916 #include <pthread.h>
7917 #ifndef NULL
7918 #define NULL (void*)0
7919 #endif
7920
7921 static void *task(p)
7922         void *p;
7923 {
7924         return (void *) (p == NULL);
7925 }
7926
7927
7928 int main(argc, argv)
7929         int argc;
7930         char **argv;
7931 {
7932
7933         /* pthread test function */
7934         pthread_t t;
7935         int status;
7936 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7937         /* This system (e.g. AIX) defaults detached; must override */
7938         pthread_attr_t attr;
7939
7940         status = pthread_attr_init(&attr);
7941         if( status ) exit( status );
7942
7943         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7944         if( status ) exit( status );
7945
7946 #       define  ATTR    &attr
7947 #elif defined( HAVE_PTHREADS_D4 )
7948 #       define  ATTR    pthread_attr_default
7949 #else
7950 #       define  ATTR    NULL
7951 #endif
7952
7953         /* make sure pthread_create() isn't just a stub */
7954         status = pthread_create(&t, ATTR, task, NULL);
7955         if( status ) exit( status );
7956
7957         /* give the thread a chance to complete...
7958      * it should remain joinable and hence detachable
7959          */
7960         sleep( 1 );
7961
7962         /* make sure pthread_detach() isn't just a stub */
7963 #if HAVE_PTHREADS_D4
7964         status = pthread_detach( &t );
7965 #else
7966         status = pthread_detach( t );
7967 #endif
7968
7969 #ifdef HAVE_LINUX_THREADS
7970         pthread_kill_other_threads_np();
7971 #endif
7972
7973         exit( status );
7974
7975 }
7976
7977 EOF
7978 if { (eval echo configure:7979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7979 then
7980   ol_cv_pthread_mthreads=yes
7981 else
7982   echo "configure: failed program was:" >&5
7983   cat conftest.$ac_ext >&5
7984   rm -fr conftest*
7985   ol_cv_pthread_mthreads=no
7986 fi
7987 rm -fr conftest*
7988 fi
7989
7990
7991                 # restore the LIBS
7992                 LIBS="$ol_LIBS"
7993         
7994 fi
7995
7996 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7997
7998         if test $ol_cv_pthread_mthreads = yes ; then
7999                 ol_link_pthreads="-mthreads"
8000                 ol_link_threads=posix
8001         fi
8002 fi
8003
8004                 # Pthread try link: -thread (ol_cv_pthread_thread)
8005 if test "$ol_link_threads" = no ; then
8006         # try -thread
8007         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
8008 echo "configure:8009: checking for pthread link with -thread" >&5
8009 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
8010   echo $ac_n "(cached) $ac_c" 1>&6
8011 else
8012   
8013                 # save the flags
8014                 ol_LIBS="$LIBS"
8015                 LIBS="-thread $LIBS"
8016
8017                 if test "$cross_compiling" = yes; then
8018   cat > conftest.$ac_ext <<EOF
8019 #line 8020 "configure"
8020 #include "confdefs.h"
8021 /* pthread test headers */
8022 #include <pthread.h>
8023 #ifndef NULL
8024 #define NULL (void*)0
8025 #endif
8026
8027 static void *task(p)
8028         void *p;
8029 {
8030         return (void *) (p == NULL);
8031 }
8032
8033 int main() {
8034
8035         /* pthread test function */
8036         pthread_t t;
8037         int status;
8038 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8039         /* This system (e.g. AIX) defaults detached; must override */
8040         pthread_attr_t attr;
8041
8042         status = pthread_attr_init(&attr);
8043         if( status ) exit( status );
8044
8045         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8046         if( status ) exit( status );
8047
8048 #       define  ATTR    &attr
8049 #elif defined( HAVE_PTHREADS_D4 )
8050 #       define  ATTR    pthread_attr_default
8051 #else
8052 #       define  ATTR    NULL
8053 #endif
8054
8055         /* make sure pthread_create() isn't just a stub */
8056         status = pthread_create(&t, ATTR, task, NULL);
8057         if( status ) exit( status );
8058
8059         /* give the thread a chance to complete...
8060      * it should remain joinable and hence detachable
8061          */
8062         sleep( 1 );
8063
8064         /* make sure pthread_detach() isn't just a stub */
8065 #if HAVE_PTHREADS_D4
8066         status = pthread_detach( &t );
8067 #else
8068         status = pthread_detach( t );
8069 #endif
8070
8071 #ifdef HAVE_LINUX_THREADS
8072         pthread_kill_other_threads_np();
8073 #endif
8074
8075         exit( status );
8076
8077 ; return 0; }
8078 EOF
8079 if { (eval echo configure:8080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8080   rm -rf conftest*
8081   ol_cv_pthread_thread=yes
8082 else
8083   echo "configure: failed program was:" >&5
8084   cat conftest.$ac_ext >&5
8085   rm -rf conftest*
8086   ol_cv_pthread_thread=no
8087 fi
8088 rm -f conftest*
8089 else
8090   cat > conftest.$ac_ext <<EOF
8091 #line 8092 "configure"
8092 #include "confdefs.h"
8093 /* pthread test headers */
8094 #include <pthread.h>
8095 #ifndef NULL
8096 #define NULL (void*)0
8097 #endif
8098
8099 static void *task(p)
8100         void *p;
8101 {
8102         return (void *) (p == NULL);
8103 }
8104
8105
8106 int main(argc, argv)
8107         int argc;
8108         char **argv;
8109 {
8110
8111         /* pthread test function */
8112         pthread_t t;
8113         int status;
8114 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8115         /* This system (e.g. AIX) defaults detached; must override */
8116         pthread_attr_t attr;
8117
8118         status = pthread_attr_init(&attr);
8119         if( status ) exit( status );
8120
8121         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8122         if( status ) exit( status );
8123
8124 #       define  ATTR    &attr
8125 #elif defined( HAVE_PTHREADS_D4 )
8126 #       define  ATTR    pthread_attr_default
8127 #else
8128 #       define  ATTR    NULL
8129 #endif
8130
8131         /* make sure pthread_create() isn't just a stub */
8132         status = pthread_create(&t, ATTR, task, NULL);
8133         if( status ) exit( status );
8134
8135         /* give the thread a chance to complete...
8136      * it should remain joinable and hence detachable
8137          */
8138         sleep( 1 );
8139
8140         /* make sure pthread_detach() isn't just a stub */
8141 #if HAVE_PTHREADS_D4
8142         status = pthread_detach( &t );
8143 #else
8144         status = pthread_detach( t );
8145 #endif
8146
8147 #ifdef HAVE_LINUX_THREADS
8148         pthread_kill_other_threads_np();
8149 #endif
8150
8151         exit( status );
8152
8153 }
8154
8155 EOF
8156 if { (eval echo configure:8157: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8157 then
8158   ol_cv_pthread_thread=yes
8159 else
8160   echo "configure: failed program was:" >&5
8161   cat conftest.$ac_ext >&5
8162   rm -fr conftest*
8163   ol_cv_pthread_thread=no
8164 fi
8165 rm -fr conftest*
8166 fi
8167
8168
8169                 # restore the LIBS
8170                 LIBS="$ol_LIBS"
8171         
8172 fi
8173
8174 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8175
8176         if test $ol_cv_pthread_thread = yes ; then
8177                 ol_link_pthreads="-thread"
8178                 ol_link_threads=posix
8179         fi
8180 fi
8181
8182
8183                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8184 if test "$ol_link_threads" = no ; then
8185         # try -lpthread -lmach -lexc -lc_r
8186         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8187 echo "configure:8188: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8188 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8189   echo $ac_n "(cached) $ac_c" 1>&6
8190 else
8191   
8192                 # save the flags
8193                 ol_LIBS="$LIBS"
8194                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8195
8196                 if test "$cross_compiling" = yes; then
8197   cat > conftest.$ac_ext <<EOF
8198 #line 8199 "configure"
8199 #include "confdefs.h"
8200 /* pthread test headers */
8201 #include <pthread.h>
8202 #ifndef NULL
8203 #define NULL (void*)0
8204 #endif
8205
8206 static void *task(p)
8207         void *p;
8208 {
8209         return (void *) (p == NULL);
8210 }
8211
8212 int main() {
8213
8214         /* pthread test function */
8215         pthread_t t;
8216         int status;
8217 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8218         /* This system (e.g. AIX) defaults detached; must override */
8219         pthread_attr_t attr;
8220
8221         status = pthread_attr_init(&attr);
8222         if( status ) exit( status );
8223
8224         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8225         if( status ) exit( status );
8226
8227 #       define  ATTR    &attr
8228 #elif defined( HAVE_PTHREADS_D4 )
8229 #       define  ATTR    pthread_attr_default
8230 #else
8231 #       define  ATTR    NULL
8232 #endif
8233
8234         /* make sure pthread_create() isn't just a stub */
8235         status = pthread_create(&t, ATTR, task, NULL);
8236         if( status ) exit( status );
8237
8238         /* give the thread a chance to complete...
8239      * it should remain joinable and hence detachable
8240          */
8241         sleep( 1 );
8242
8243         /* make sure pthread_detach() isn't just a stub */
8244 #if HAVE_PTHREADS_D4
8245         status = pthread_detach( &t );
8246 #else
8247         status = pthread_detach( t );
8248 #endif
8249
8250 #ifdef HAVE_LINUX_THREADS
8251         pthread_kill_other_threads_np();
8252 #endif
8253
8254         exit( status );
8255
8256 ; return 0; }
8257 EOF
8258 if { (eval echo configure:8259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8259   rm -rf conftest*
8260   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8261 else
8262   echo "configure: failed program was:" >&5
8263   cat conftest.$ac_ext >&5
8264   rm -rf conftest*
8265   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8266 fi
8267 rm -f conftest*
8268 else
8269   cat > conftest.$ac_ext <<EOF
8270 #line 8271 "configure"
8271 #include "confdefs.h"
8272 /* pthread test headers */
8273 #include <pthread.h>
8274 #ifndef NULL
8275 #define NULL (void*)0
8276 #endif
8277
8278 static void *task(p)
8279         void *p;
8280 {
8281         return (void *) (p == NULL);
8282 }
8283
8284
8285 int main(argc, argv)
8286         int argc;
8287         char **argv;
8288 {
8289
8290         /* pthread test function */
8291         pthread_t t;
8292         int status;
8293 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8294         /* This system (e.g. AIX) defaults detached; must override */
8295         pthread_attr_t attr;
8296
8297         status = pthread_attr_init(&attr);
8298         if( status ) exit( status );
8299
8300         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8301         if( status ) exit( status );
8302
8303 #       define  ATTR    &attr
8304 #elif defined( HAVE_PTHREADS_D4 )
8305 #       define  ATTR    pthread_attr_default
8306 #else
8307 #       define  ATTR    NULL
8308 #endif
8309
8310         /* make sure pthread_create() isn't just a stub */
8311         status = pthread_create(&t, ATTR, task, NULL);
8312         if( status ) exit( status );
8313
8314         /* give the thread a chance to complete...
8315      * it should remain joinable and hence detachable
8316          */
8317         sleep( 1 );
8318
8319         /* make sure pthread_detach() isn't just a stub */
8320 #if HAVE_PTHREADS_D4
8321         status = pthread_detach( &t );
8322 #else
8323         status = pthread_detach( t );
8324 #endif
8325
8326 #ifdef HAVE_LINUX_THREADS
8327         pthread_kill_other_threads_np();
8328 #endif
8329
8330         exit( status );
8331
8332 }
8333
8334 EOF
8335 if { (eval echo configure:8336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8336 then
8337   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8338 else
8339   echo "configure: failed program was:" >&5
8340   cat conftest.$ac_ext >&5
8341   rm -fr conftest*
8342   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8343 fi
8344 rm -fr conftest*
8345 fi
8346
8347
8348                 # restore the LIBS
8349                 LIBS="$ol_LIBS"
8350         
8351 fi
8352
8353 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8354
8355         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8356                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8357                 ol_link_threads=posix
8358         fi
8359 fi
8360
8361                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8362 if test "$ol_link_threads" = no ; then
8363         # try -lpthread -lmach -lexc
8364         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8365 echo "configure:8366: checking for pthread link with -lpthread -lmach -lexc" >&5
8366 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8367   echo $ac_n "(cached) $ac_c" 1>&6
8368 else
8369   
8370                 # save the flags
8371                 ol_LIBS="$LIBS"
8372                 LIBS="-lpthread -lmach -lexc $LIBS"
8373
8374                 if test "$cross_compiling" = yes; then
8375   cat > conftest.$ac_ext <<EOF
8376 #line 8377 "configure"
8377 #include "confdefs.h"
8378 /* pthread test headers */
8379 #include <pthread.h>
8380 #ifndef NULL
8381 #define NULL (void*)0
8382 #endif
8383
8384 static void *task(p)
8385         void *p;
8386 {
8387         return (void *) (p == NULL);
8388 }
8389
8390 int main() {
8391
8392         /* pthread test function */
8393         pthread_t t;
8394         int status;
8395 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8396         /* This system (e.g. AIX) defaults detached; must override */
8397         pthread_attr_t attr;
8398
8399         status = pthread_attr_init(&attr);
8400         if( status ) exit( status );
8401
8402         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8403         if( status ) exit( status );
8404
8405 #       define  ATTR    &attr
8406 #elif defined( HAVE_PTHREADS_D4 )
8407 #       define  ATTR    pthread_attr_default
8408 #else
8409 #       define  ATTR    NULL
8410 #endif
8411
8412         /* make sure pthread_create() isn't just a stub */
8413         status = pthread_create(&t, ATTR, task, NULL);
8414         if( status ) exit( status );
8415
8416         /* give the thread a chance to complete...
8417      * it should remain joinable and hence detachable
8418          */
8419         sleep( 1 );
8420
8421         /* make sure pthread_detach() isn't just a stub */
8422 #if HAVE_PTHREADS_D4
8423         status = pthread_detach( &t );
8424 #else
8425         status = pthread_detach( t );
8426 #endif
8427
8428 #ifdef HAVE_LINUX_THREADS
8429         pthread_kill_other_threads_np();
8430 #endif
8431
8432         exit( status );
8433
8434 ; return 0; }
8435 EOF
8436 if { (eval echo configure:8437: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8437   rm -rf conftest*
8438   ol_cv_pthread_lpthread_lmach_lexc=yes
8439 else
8440   echo "configure: failed program was:" >&5
8441   cat conftest.$ac_ext >&5
8442   rm -rf conftest*
8443   ol_cv_pthread_lpthread_lmach_lexc=no
8444 fi
8445 rm -f conftest*
8446 else
8447   cat > conftest.$ac_ext <<EOF
8448 #line 8449 "configure"
8449 #include "confdefs.h"
8450 /* pthread test headers */
8451 #include <pthread.h>
8452 #ifndef NULL
8453 #define NULL (void*)0
8454 #endif
8455
8456 static void *task(p)
8457         void *p;
8458 {
8459         return (void *) (p == NULL);
8460 }
8461
8462
8463 int main(argc, argv)
8464         int argc;
8465         char **argv;
8466 {
8467
8468         /* pthread test function */
8469         pthread_t t;
8470         int status;
8471 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8472         /* This system (e.g. AIX) defaults detached; must override */
8473         pthread_attr_t attr;
8474
8475         status = pthread_attr_init(&attr);
8476         if( status ) exit( status );
8477
8478         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8479         if( status ) exit( status );
8480
8481 #       define  ATTR    &attr
8482 #elif defined( HAVE_PTHREADS_D4 )
8483 #       define  ATTR    pthread_attr_default
8484 #else
8485 #       define  ATTR    NULL
8486 #endif
8487
8488         /* make sure pthread_create() isn't just a stub */
8489         status = pthread_create(&t, ATTR, task, NULL);
8490         if( status ) exit( status );
8491
8492         /* give the thread a chance to complete...
8493      * it should remain joinable and hence detachable
8494          */
8495         sleep( 1 );
8496
8497         /* make sure pthread_detach() isn't just a stub */
8498 #if HAVE_PTHREADS_D4
8499         status = pthread_detach( &t );
8500 #else
8501         status = pthread_detach( t );
8502 #endif
8503
8504 #ifdef HAVE_LINUX_THREADS
8505         pthread_kill_other_threads_np();
8506 #endif
8507
8508         exit( status );
8509
8510 }
8511
8512 EOF
8513 if { (eval echo configure:8514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8514 then
8515   ol_cv_pthread_lpthread_lmach_lexc=yes
8516 else
8517   echo "configure: failed program was:" >&5
8518   cat conftest.$ac_ext >&5
8519   rm -fr conftest*
8520   ol_cv_pthread_lpthread_lmach_lexc=no
8521 fi
8522 rm -fr conftest*
8523 fi
8524
8525
8526                 # restore the LIBS
8527                 LIBS="$ol_LIBS"
8528         
8529 fi
8530
8531 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8532
8533         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8534                 ol_link_pthreads="-lpthread -lmach -lexc"
8535                 ol_link_threads=posix
8536         fi
8537 fi
8538
8539
8540                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8541 if test "$ol_link_threads" = no ; then
8542         # try -lpthread -Wl,-woff,85
8543         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8544 echo "configure:8545: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8545 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8546   echo $ac_n "(cached) $ac_c" 1>&6
8547 else
8548   
8549                 # save the flags
8550                 ol_LIBS="$LIBS"
8551                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8552
8553                 if test "$cross_compiling" = yes; then
8554   cat > conftest.$ac_ext <<EOF
8555 #line 8556 "configure"
8556 #include "confdefs.h"
8557 /* pthread test headers */
8558 #include <pthread.h>
8559 #ifndef NULL
8560 #define NULL (void*)0
8561 #endif
8562
8563 static void *task(p)
8564         void *p;
8565 {
8566         return (void *) (p == NULL);
8567 }
8568
8569 int main() {
8570
8571         /* pthread test function */
8572         pthread_t t;
8573         int status;
8574 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8575         /* This system (e.g. AIX) defaults detached; must override */
8576         pthread_attr_t attr;
8577
8578         status = pthread_attr_init(&attr);
8579         if( status ) exit( status );
8580
8581         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8582         if( status ) exit( status );
8583
8584 #       define  ATTR    &attr
8585 #elif defined( HAVE_PTHREADS_D4 )
8586 #       define  ATTR    pthread_attr_default
8587 #else
8588 #       define  ATTR    NULL
8589 #endif
8590
8591         /* make sure pthread_create() isn't just a stub */
8592         status = pthread_create(&t, ATTR, task, NULL);
8593         if( status ) exit( status );
8594
8595         /* give the thread a chance to complete...
8596      * it should remain joinable and hence detachable
8597          */
8598         sleep( 1 );
8599
8600         /* make sure pthread_detach() isn't just a stub */
8601 #if HAVE_PTHREADS_D4
8602         status = pthread_detach( &t );
8603 #else
8604         status = pthread_detach( t );
8605 #endif
8606
8607 #ifdef HAVE_LINUX_THREADS
8608         pthread_kill_other_threads_np();
8609 #endif
8610
8611         exit( status );
8612
8613 ; return 0; }
8614 EOF
8615 if { (eval echo configure:8616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8616   rm -rf conftest*
8617   ol_cv_pthread_lib_lpthread_woff=yes
8618 else
8619   echo "configure: failed program was:" >&5
8620   cat conftest.$ac_ext >&5
8621   rm -rf conftest*
8622   ol_cv_pthread_lib_lpthread_woff=no
8623 fi
8624 rm -f conftest*
8625 else
8626   cat > conftest.$ac_ext <<EOF
8627 #line 8628 "configure"
8628 #include "confdefs.h"
8629 /* pthread test headers */
8630 #include <pthread.h>
8631 #ifndef NULL
8632 #define NULL (void*)0
8633 #endif
8634
8635 static void *task(p)
8636         void *p;
8637 {
8638         return (void *) (p == NULL);
8639 }
8640
8641
8642 int main(argc, argv)
8643         int argc;
8644         char **argv;
8645 {
8646
8647         /* pthread test function */
8648         pthread_t t;
8649         int status;
8650 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8651         /* This system (e.g. AIX) defaults detached; must override */
8652         pthread_attr_t attr;
8653
8654         status = pthread_attr_init(&attr);
8655         if( status ) exit( status );
8656
8657         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8658         if( status ) exit( status );
8659
8660 #       define  ATTR    &attr
8661 #elif defined( HAVE_PTHREADS_D4 )
8662 #       define  ATTR    pthread_attr_default
8663 #else
8664 #       define  ATTR    NULL
8665 #endif
8666
8667         /* make sure pthread_create() isn't just a stub */
8668         status = pthread_create(&t, ATTR, task, NULL);
8669         if( status ) exit( status );
8670
8671         /* give the thread a chance to complete...
8672      * it should remain joinable and hence detachable
8673          */
8674         sleep( 1 );
8675
8676         /* make sure pthread_detach() isn't just a stub */
8677 #if HAVE_PTHREADS_D4
8678         status = pthread_detach( &t );
8679 #else
8680         status = pthread_detach( t );
8681 #endif
8682
8683 #ifdef HAVE_LINUX_THREADS
8684         pthread_kill_other_threads_np();
8685 #endif
8686
8687         exit( status );
8688
8689 }
8690
8691 EOF
8692 if { (eval echo configure:8693: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8693 then
8694   ol_cv_pthread_lib_lpthread_woff=yes
8695 else
8696   echo "configure: failed program was:" >&5
8697   cat conftest.$ac_ext >&5
8698   rm -fr conftest*
8699   ol_cv_pthread_lib_lpthread_woff=no
8700 fi
8701 rm -fr conftest*
8702 fi
8703
8704
8705                 # restore the LIBS
8706                 LIBS="$ol_LIBS"
8707         
8708 fi
8709
8710 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
8711
8712         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
8713                 ol_link_pthreads="-lpthread -Wl,-woff,85"
8714                 ol_link_threads=posix
8715         fi
8716 fi
8717
8718
8719                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
8720 if test "$ol_link_threads" = no ; then
8721         # try -lpthread
8722         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
8723 echo "configure:8724: checking for pthread link with -lpthread" >&5
8724 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
8725   echo $ac_n "(cached) $ac_c" 1>&6
8726 else
8727   
8728                 # save the flags
8729                 ol_LIBS="$LIBS"
8730                 LIBS="-lpthread $LIBS"
8731
8732                 if test "$cross_compiling" = yes; then
8733   cat > conftest.$ac_ext <<EOF
8734 #line 8735 "configure"
8735 #include "confdefs.h"
8736 /* pthread test headers */
8737 #include <pthread.h>
8738 #ifndef NULL
8739 #define NULL (void*)0
8740 #endif
8741
8742 static void *task(p)
8743         void *p;
8744 {
8745         return (void *) (p == NULL);
8746 }
8747
8748 int main() {
8749
8750         /* pthread test function */
8751         pthread_t t;
8752         int status;
8753 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8754         /* This system (e.g. AIX) defaults detached; must override */
8755         pthread_attr_t attr;
8756
8757         status = pthread_attr_init(&attr);
8758         if( status ) exit( status );
8759
8760         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8761         if( status ) exit( status );
8762
8763 #       define  ATTR    &attr
8764 #elif defined( HAVE_PTHREADS_D4 )
8765 #       define  ATTR    pthread_attr_default
8766 #else
8767 #       define  ATTR    NULL
8768 #endif
8769
8770         /* make sure pthread_create() isn't just a stub */
8771         status = pthread_create(&t, ATTR, task, NULL);
8772         if( status ) exit( status );
8773
8774         /* give the thread a chance to complete...
8775      * it should remain joinable and hence detachable
8776          */
8777         sleep( 1 );
8778
8779         /* make sure pthread_detach() isn't just a stub */
8780 #if HAVE_PTHREADS_D4
8781         status = pthread_detach( &t );
8782 #else
8783         status = pthread_detach( t );
8784 #endif
8785
8786 #ifdef HAVE_LINUX_THREADS
8787         pthread_kill_other_threads_np();
8788 #endif
8789
8790         exit( status );
8791
8792 ; return 0; }
8793 EOF
8794 if { (eval echo configure:8795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8795   rm -rf conftest*
8796   ol_cv_pthread_lpthread=yes
8797 else
8798   echo "configure: failed program was:" >&5
8799   cat conftest.$ac_ext >&5
8800   rm -rf conftest*
8801   ol_cv_pthread_lpthread=no
8802 fi
8803 rm -f conftest*
8804 else
8805   cat > conftest.$ac_ext <<EOF
8806 #line 8807 "configure"
8807 #include "confdefs.h"
8808 /* pthread test headers */
8809 #include <pthread.h>
8810 #ifndef NULL
8811 #define NULL (void*)0
8812 #endif
8813
8814 static void *task(p)
8815         void *p;
8816 {
8817         return (void *) (p == NULL);
8818 }
8819
8820
8821 int main(argc, argv)
8822         int argc;
8823         char **argv;
8824 {
8825
8826         /* pthread test function */
8827         pthread_t t;
8828         int status;
8829 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8830         /* This system (e.g. AIX) defaults detached; must override */
8831         pthread_attr_t attr;
8832
8833         status = pthread_attr_init(&attr);
8834         if( status ) exit( status );
8835
8836         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8837         if( status ) exit( status );
8838
8839 #       define  ATTR    &attr
8840 #elif defined( HAVE_PTHREADS_D4 )
8841 #       define  ATTR    pthread_attr_default
8842 #else
8843 #       define  ATTR    NULL
8844 #endif
8845
8846         /* make sure pthread_create() isn't just a stub */
8847         status = pthread_create(&t, ATTR, task, NULL);
8848         if( status ) exit( status );
8849
8850         /* give the thread a chance to complete...
8851      * it should remain joinable and hence detachable
8852          */
8853         sleep( 1 );
8854
8855         /* make sure pthread_detach() isn't just a stub */
8856 #if HAVE_PTHREADS_D4
8857         status = pthread_detach( &t );
8858 #else
8859         status = pthread_detach( t );
8860 #endif
8861
8862 #ifdef HAVE_LINUX_THREADS
8863         pthread_kill_other_threads_np();
8864 #endif
8865
8866         exit( status );
8867
8868 }
8869
8870 EOF
8871 if { (eval echo configure:8872: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8872 then
8873   ol_cv_pthread_lpthread=yes
8874 else
8875   echo "configure: failed program was:" >&5
8876   cat conftest.$ac_ext >&5
8877   rm -fr conftest*
8878   ol_cv_pthread_lpthread=no
8879 fi
8880 rm -fr conftest*
8881 fi
8882
8883
8884                 # restore the LIBS
8885                 LIBS="$ol_LIBS"
8886         
8887 fi
8888
8889 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
8890
8891         if test $ol_cv_pthread_lpthread = yes ; then
8892                 ol_link_pthreads="-lpthread"
8893                 ol_link_threads=posix
8894         fi
8895 fi
8896
8897                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
8898 if test "$ol_link_threads" = no ; then
8899         # try -lc_r
8900         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
8901 echo "configure:8902: checking for pthread link with -lc_r" >&5
8902 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
8903   echo $ac_n "(cached) $ac_c" 1>&6
8904 else
8905   
8906                 # save the flags
8907                 ol_LIBS="$LIBS"
8908                 LIBS="-lc_r $LIBS"
8909
8910                 if test "$cross_compiling" = yes; then
8911   cat > conftest.$ac_ext <<EOF
8912 #line 8913 "configure"
8913 #include "confdefs.h"
8914 /* pthread test headers */
8915 #include <pthread.h>
8916 #ifndef NULL
8917 #define NULL (void*)0
8918 #endif
8919
8920 static void *task(p)
8921         void *p;
8922 {
8923         return (void *) (p == NULL);
8924 }
8925
8926 int main() {
8927
8928         /* pthread test function */
8929         pthread_t t;
8930         int status;
8931 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8932         /* This system (e.g. AIX) defaults detached; must override */
8933         pthread_attr_t attr;
8934
8935         status = pthread_attr_init(&attr);
8936         if( status ) exit( status );
8937
8938         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8939         if( status ) exit( status );
8940
8941 #       define  ATTR    &attr
8942 #elif defined( HAVE_PTHREADS_D4 )
8943 #       define  ATTR    pthread_attr_default
8944 #else
8945 #       define  ATTR    NULL
8946 #endif
8947
8948         /* make sure pthread_create() isn't just a stub */
8949         status = pthread_create(&t, ATTR, task, NULL);
8950         if( status ) exit( status );
8951
8952         /* give the thread a chance to complete...
8953      * it should remain joinable and hence detachable
8954          */
8955         sleep( 1 );
8956
8957         /* make sure pthread_detach() isn't just a stub */
8958 #if HAVE_PTHREADS_D4
8959         status = pthread_detach( &t );
8960 #else
8961         status = pthread_detach( t );
8962 #endif
8963
8964 #ifdef HAVE_LINUX_THREADS
8965         pthread_kill_other_threads_np();
8966 #endif
8967
8968         exit( status );
8969
8970 ; return 0; }
8971 EOF
8972 if { (eval echo configure:8973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8973   rm -rf conftest*
8974   ol_cv_pthread_lc_r=yes
8975 else
8976   echo "configure: failed program was:" >&5
8977   cat conftest.$ac_ext >&5
8978   rm -rf conftest*
8979   ol_cv_pthread_lc_r=no
8980 fi
8981 rm -f conftest*
8982 else
8983   cat > conftest.$ac_ext <<EOF
8984 #line 8985 "configure"
8985 #include "confdefs.h"
8986 /* pthread test headers */
8987 #include <pthread.h>
8988 #ifndef NULL
8989 #define NULL (void*)0
8990 #endif
8991
8992 static void *task(p)
8993         void *p;
8994 {
8995         return (void *) (p == NULL);
8996 }
8997
8998
8999 int main(argc, argv)
9000         int argc;
9001         char **argv;
9002 {
9003
9004         /* pthread test function */
9005         pthread_t t;
9006         int status;
9007 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9008         /* This system (e.g. AIX) defaults detached; must override */
9009         pthread_attr_t attr;
9010
9011         status = pthread_attr_init(&attr);
9012         if( status ) exit( status );
9013
9014         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9015         if( status ) exit( status );
9016
9017 #       define  ATTR    &attr
9018 #elif defined( HAVE_PTHREADS_D4 )
9019 #       define  ATTR    pthread_attr_default
9020 #else
9021 #       define  ATTR    NULL
9022 #endif
9023
9024         /* make sure pthread_create() isn't just a stub */
9025         status = pthread_create(&t, ATTR, task, NULL);
9026         if( status ) exit( status );
9027
9028         /* give the thread a chance to complete...
9029      * it should remain joinable and hence detachable
9030          */
9031         sleep( 1 );
9032
9033         /* make sure pthread_detach() isn't just a stub */
9034 #if HAVE_PTHREADS_D4
9035         status = pthread_detach( &t );
9036 #else
9037         status = pthread_detach( t );
9038 #endif
9039
9040 #ifdef HAVE_LINUX_THREADS
9041         pthread_kill_other_threads_np();
9042 #endif
9043
9044         exit( status );
9045
9046 }
9047
9048 EOF
9049 if { (eval echo configure:9050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9050 then
9051   ol_cv_pthread_lc_r=yes
9052 else
9053   echo "configure: failed program was:" >&5
9054   cat conftest.$ac_ext >&5
9055   rm -fr conftest*
9056   ol_cv_pthread_lc_r=no
9057 fi
9058 rm -fr conftest*
9059 fi
9060
9061
9062                 # restore the LIBS
9063                 LIBS="$ol_LIBS"
9064         
9065 fi
9066
9067 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
9068
9069         if test $ol_cv_pthread_lc_r = yes ; then
9070                 ol_link_pthreads="-lc_r"
9071                 ol_link_threads=posix
9072         fi
9073 fi
9074
9075
9076                 # Pthread try link: -threads (ol_cv_pthread_threads)
9077 if test "$ol_link_threads" = no ; then
9078         # try -threads
9079         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
9080 echo "configure:9081: checking for pthread link with -threads" >&5
9081 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
9082   echo $ac_n "(cached) $ac_c" 1>&6
9083 else
9084   
9085                 # save the flags
9086                 ol_LIBS="$LIBS"
9087                 LIBS="-threads $LIBS"
9088
9089                 if test "$cross_compiling" = yes; then
9090   cat > conftest.$ac_ext <<EOF
9091 #line 9092 "configure"
9092 #include "confdefs.h"
9093 /* pthread test headers */
9094 #include <pthread.h>
9095 #ifndef NULL
9096 #define NULL (void*)0
9097 #endif
9098
9099 static void *task(p)
9100         void *p;
9101 {
9102         return (void *) (p == NULL);
9103 }
9104
9105 int main() {
9106
9107         /* pthread test function */
9108         pthread_t t;
9109         int status;
9110 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9111         /* This system (e.g. AIX) defaults detached; must override */
9112         pthread_attr_t attr;
9113
9114         status = pthread_attr_init(&attr);
9115         if( status ) exit( status );
9116
9117         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9118         if( status ) exit( status );
9119
9120 #       define  ATTR    &attr
9121 #elif defined( HAVE_PTHREADS_D4 )
9122 #       define  ATTR    pthread_attr_default
9123 #else
9124 #       define  ATTR    NULL
9125 #endif
9126
9127         /* make sure pthread_create() isn't just a stub */
9128         status = pthread_create(&t, ATTR, task, NULL);
9129         if( status ) exit( status );
9130
9131         /* give the thread a chance to complete...
9132      * it should remain joinable and hence detachable
9133          */
9134         sleep( 1 );
9135
9136         /* make sure pthread_detach() isn't just a stub */
9137 #if HAVE_PTHREADS_D4
9138         status = pthread_detach( &t );
9139 #else
9140         status = pthread_detach( t );
9141 #endif
9142
9143 #ifdef HAVE_LINUX_THREADS
9144         pthread_kill_other_threads_np();
9145 #endif
9146
9147         exit( status );
9148
9149 ; return 0; }
9150 EOF
9151 if { (eval echo configure:9152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9152   rm -rf conftest*
9153   ol_cv_pthread_threads=yes
9154 else
9155   echo "configure: failed program was:" >&5
9156   cat conftest.$ac_ext >&5
9157   rm -rf conftest*
9158   ol_cv_pthread_threads=no
9159 fi
9160 rm -f conftest*
9161 else
9162   cat > conftest.$ac_ext <<EOF
9163 #line 9164 "configure"
9164 #include "confdefs.h"
9165 /* pthread test headers */
9166 #include <pthread.h>
9167 #ifndef NULL
9168 #define NULL (void*)0
9169 #endif
9170
9171 static void *task(p)
9172         void *p;
9173 {
9174         return (void *) (p == NULL);
9175 }
9176
9177
9178 int main(argc, argv)
9179         int argc;
9180         char **argv;
9181 {
9182
9183         /* pthread test function */
9184         pthread_t t;
9185         int status;
9186 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9187         /* This system (e.g. AIX) defaults detached; must override */
9188         pthread_attr_t attr;
9189
9190         status = pthread_attr_init(&attr);
9191         if( status ) exit( status );
9192
9193         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9194         if( status ) exit( status );
9195
9196 #       define  ATTR    &attr
9197 #elif defined( HAVE_PTHREADS_D4 )
9198 #       define  ATTR    pthread_attr_default
9199 #else
9200 #       define  ATTR    NULL
9201 #endif
9202
9203         /* make sure pthread_create() isn't just a stub */
9204         status = pthread_create(&t, ATTR, task, NULL);
9205         if( status ) exit( status );
9206
9207         /* give the thread a chance to complete...
9208      * it should remain joinable and hence detachable
9209          */
9210         sleep( 1 );
9211
9212         /* make sure pthread_detach() isn't just a stub */
9213 #if HAVE_PTHREADS_D4
9214         status = pthread_detach( &t );
9215 #else
9216         status = pthread_detach( t );
9217 #endif
9218
9219 #ifdef HAVE_LINUX_THREADS
9220         pthread_kill_other_threads_np();
9221 #endif
9222
9223         exit( status );
9224
9225 }
9226
9227 EOF
9228 if { (eval echo configure:9229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9229 then
9230   ol_cv_pthread_threads=yes
9231 else
9232   echo "configure: failed program was:" >&5
9233   cat conftest.$ac_ext >&5
9234   rm -fr conftest*
9235   ol_cv_pthread_threads=no
9236 fi
9237 rm -fr conftest*
9238 fi
9239
9240
9241                 # restore the LIBS
9242                 LIBS="$ol_LIBS"
9243         
9244 fi
9245
9246 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9247
9248         if test $ol_cv_pthread_threads = yes ; then
9249                 ol_link_pthreads="-threads"
9250                 ol_link_threads=posix
9251         fi
9252 fi
9253
9254
9255                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9256 if test "$ol_link_threads" = no ; then
9257         # try -lpthreads -lmach -lexc -lc_r
9258         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9259 echo "configure:9260: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9260 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9261   echo $ac_n "(cached) $ac_c" 1>&6
9262 else
9263   
9264                 # save the flags
9265                 ol_LIBS="$LIBS"
9266                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9267
9268                 if test "$cross_compiling" = yes; then
9269   cat > conftest.$ac_ext <<EOF
9270 #line 9271 "configure"
9271 #include "confdefs.h"
9272 /* pthread test headers */
9273 #include <pthread.h>
9274 #ifndef NULL
9275 #define NULL (void*)0
9276 #endif
9277
9278 static void *task(p)
9279         void *p;
9280 {
9281         return (void *) (p == NULL);
9282 }
9283
9284 int main() {
9285
9286         /* pthread test function */
9287         pthread_t t;
9288         int status;
9289 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9290         /* This system (e.g. AIX) defaults detached; must override */
9291         pthread_attr_t attr;
9292
9293         status = pthread_attr_init(&attr);
9294         if( status ) exit( status );
9295
9296         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9297         if( status ) exit( status );
9298
9299 #       define  ATTR    &attr
9300 #elif defined( HAVE_PTHREADS_D4 )
9301 #       define  ATTR    pthread_attr_default
9302 #else
9303 #       define  ATTR    NULL
9304 #endif
9305
9306         /* make sure pthread_create() isn't just a stub */
9307         status = pthread_create(&t, ATTR, task, NULL);
9308         if( status ) exit( status );
9309
9310         /* give the thread a chance to complete...
9311      * it should remain joinable and hence detachable
9312          */
9313         sleep( 1 );
9314
9315         /* make sure pthread_detach() isn't just a stub */
9316 #if HAVE_PTHREADS_D4
9317         status = pthread_detach( &t );
9318 #else
9319         status = pthread_detach( t );
9320 #endif
9321
9322 #ifdef HAVE_LINUX_THREADS
9323         pthread_kill_other_threads_np();
9324 #endif
9325
9326         exit( status );
9327
9328 ; return 0; }
9329 EOF
9330 if { (eval echo configure:9331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9331   rm -rf conftest*
9332   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9333 else
9334   echo "configure: failed program was:" >&5
9335   cat conftest.$ac_ext >&5
9336   rm -rf conftest*
9337   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9338 fi
9339 rm -f conftest*
9340 else
9341   cat > conftest.$ac_ext <<EOF
9342 #line 9343 "configure"
9343 #include "confdefs.h"
9344 /* pthread test headers */
9345 #include <pthread.h>
9346 #ifndef NULL
9347 #define NULL (void*)0
9348 #endif
9349
9350 static void *task(p)
9351         void *p;
9352 {
9353         return (void *) (p == NULL);
9354 }
9355
9356
9357 int main(argc, argv)
9358         int argc;
9359         char **argv;
9360 {
9361
9362         /* pthread test function */
9363         pthread_t t;
9364         int status;
9365 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9366         /* This system (e.g. AIX) defaults detached; must override */
9367         pthread_attr_t attr;
9368
9369         status = pthread_attr_init(&attr);
9370         if( status ) exit( status );
9371
9372         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9373         if( status ) exit( status );
9374
9375 #       define  ATTR    &attr
9376 #elif defined( HAVE_PTHREADS_D4 )
9377 #       define  ATTR    pthread_attr_default
9378 #else
9379 #       define  ATTR    NULL
9380 #endif
9381
9382         /* make sure pthread_create() isn't just a stub */
9383         status = pthread_create(&t, ATTR, task, NULL);
9384         if( status ) exit( status );
9385
9386         /* give the thread a chance to complete...
9387      * it should remain joinable and hence detachable
9388          */
9389         sleep( 1 );
9390
9391         /* make sure pthread_detach() isn't just a stub */
9392 #if HAVE_PTHREADS_D4
9393         status = pthread_detach( &t );
9394 #else
9395         status = pthread_detach( t );
9396 #endif
9397
9398 #ifdef HAVE_LINUX_THREADS
9399         pthread_kill_other_threads_np();
9400 #endif
9401
9402         exit( status );
9403
9404 }
9405
9406 EOF
9407 if { (eval echo configure:9408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9408 then
9409   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9410 else
9411   echo "configure: failed program was:" >&5
9412   cat conftest.$ac_ext >&5
9413   rm -fr conftest*
9414   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9415 fi
9416 rm -fr conftest*
9417 fi
9418
9419
9420                 # restore the LIBS
9421                 LIBS="$ol_LIBS"
9422         
9423 fi
9424
9425 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9426
9427         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9428                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9429                 ol_link_threads=posix
9430         fi
9431 fi
9432
9433                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9434 if test "$ol_link_threads" = no ; then
9435         # try -lpthreads -lmach -lexc
9436         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9437 echo "configure:9438: checking for pthread link with -lpthreads -lmach -lexc" >&5
9438 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9439   echo $ac_n "(cached) $ac_c" 1>&6
9440 else
9441   
9442                 # save the flags
9443                 ol_LIBS="$LIBS"
9444                 LIBS="-lpthreads -lmach -lexc $LIBS"
9445
9446                 if test "$cross_compiling" = yes; then
9447   cat > conftest.$ac_ext <<EOF
9448 #line 9449 "configure"
9449 #include "confdefs.h"
9450 /* pthread test headers */
9451 #include <pthread.h>
9452 #ifndef NULL
9453 #define NULL (void*)0
9454 #endif
9455
9456 static void *task(p)
9457         void *p;
9458 {
9459         return (void *) (p == NULL);
9460 }
9461
9462 int main() {
9463
9464         /* pthread test function */
9465         pthread_t t;
9466         int status;
9467 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9468         /* This system (e.g. AIX) defaults detached; must override */
9469         pthread_attr_t attr;
9470
9471         status = pthread_attr_init(&attr);
9472         if( status ) exit( status );
9473
9474         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9475         if( status ) exit( status );
9476
9477 #       define  ATTR    &attr
9478 #elif defined( HAVE_PTHREADS_D4 )
9479 #       define  ATTR    pthread_attr_default
9480 #else
9481 #       define  ATTR    NULL
9482 #endif
9483
9484         /* make sure pthread_create() isn't just a stub */
9485         status = pthread_create(&t, ATTR, task, NULL);
9486         if( status ) exit( status );
9487
9488         /* give the thread a chance to complete...
9489      * it should remain joinable and hence detachable
9490          */
9491         sleep( 1 );
9492
9493         /* make sure pthread_detach() isn't just a stub */
9494 #if HAVE_PTHREADS_D4
9495         status = pthread_detach( &t );
9496 #else
9497         status = pthread_detach( t );
9498 #endif
9499
9500 #ifdef HAVE_LINUX_THREADS
9501         pthread_kill_other_threads_np();
9502 #endif
9503
9504         exit( status );
9505
9506 ; return 0; }
9507 EOF
9508 if { (eval echo configure:9509: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9509   rm -rf conftest*
9510   ol_cv_pthread_lpthreads_lmach_lexc=yes
9511 else
9512   echo "configure: failed program was:" >&5
9513   cat conftest.$ac_ext >&5
9514   rm -rf conftest*
9515   ol_cv_pthread_lpthreads_lmach_lexc=no
9516 fi
9517 rm -f conftest*
9518 else
9519   cat > conftest.$ac_ext <<EOF
9520 #line 9521 "configure"
9521 #include "confdefs.h"
9522 /* pthread test headers */
9523 #include <pthread.h>
9524 #ifndef NULL
9525 #define NULL (void*)0
9526 #endif
9527
9528 static void *task(p)
9529         void *p;
9530 {
9531         return (void *) (p == NULL);
9532 }
9533
9534
9535 int main(argc, argv)
9536         int argc;
9537         char **argv;
9538 {
9539
9540         /* pthread test function */
9541         pthread_t t;
9542         int status;
9543 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9544         /* This system (e.g. AIX) defaults detached; must override */
9545         pthread_attr_t attr;
9546
9547         status = pthread_attr_init(&attr);
9548         if( status ) exit( status );
9549
9550         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9551         if( status ) exit( status );
9552
9553 #       define  ATTR    &attr
9554 #elif defined( HAVE_PTHREADS_D4 )
9555 #       define  ATTR    pthread_attr_default
9556 #else
9557 #       define  ATTR    NULL
9558 #endif
9559
9560         /* make sure pthread_create() isn't just a stub */
9561         status = pthread_create(&t, ATTR, task, NULL);
9562         if( status ) exit( status );
9563
9564         /* give the thread a chance to complete...
9565      * it should remain joinable and hence detachable
9566          */
9567         sleep( 1 );
9568
9569         /* make sure pthread_detach() isn't just a stub */
9570 #if HAVE_PTHREADS_D4
9571         status = pthread_detach( &t );
9572 #else
9573         status = pthread_detach( t );
9574 #endif
9575
9576 #ifdef HAVE_LINUX_THREADS
9577         pthread_kill_other_threads_np();
9578 #endif
9579
9580         exit( status );
9581
9582 }
9583
9584 EOF
9585 if { (eval echo configure:9586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9586 then
9587   ol_cv_pthread_lpthreads_lmach_lexc=yes
9588 else
9589   echo "configure: failed program was:" >&5
9590   cat conftest.$ac_ext >&5
9591   rm -fr conftest*
9592   ol_cv_pthread_lpthreads_lmach_lexc=no
9593 fi
9594 rm -fr conftest*
9595 fi
9596
9597
9598                 # restore the LIBS
9599                 LIBS="$ol_LIBS"
9600         
9601 fi
9602
9603 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9604
9605         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
9606                 ol_link_pthreads="-lpthreads -lmach -lexc"
9607                 ol_link_threads=posix
9608         fi
9609 fi
9610
9611                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
9612 if test "$ol_link_threads" = no ; then
9613         # try -lpthreads -lexc
9614         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
9615 echo "configure:9616: checking for pthread link with -lpthreads -lexc" >&5
9616 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
9617   echo $ac_n "(cached) $ac_c" 1>&6
9618 else
9619   
9620                 # save the flags
9621                 ol_LIBS="$LIBS"
9622                 LIBS="-lpthreads -lexc $LIBS"
9623
9624                 if test "$cross_compiling" = yes; then
9625   cat > conftest.$ac_ext <<EOF
9626 #line 9627 "configure"
9627 #include "confdefs.h"
9628 /* pthread test headers */
9629 #include <pthread.h>
9630 #ifndef NULL
9631 #define NULL (void*)0
9632 #endif
9633
9634 static void *task(p)
9635         void *p;
9636 {
9637         return (void *) (p == NULL);
9638 }
9639
9640 int main() {
9641
9642         /* pthread test function */
9643         pthread_t t;
9644         int status;
9645 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9646         /* This system (e.g. AIX) defaults detached; must override */
9647         pthread_attr_t attr;
9648
9649         status = pthread_attr_init(&attr);
9650         if( status ) exit( status );
9651
9652         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9653         if( status ) exit( status );
9654
9655 #       define  ATTR    &attr
9656 #elif defined( HAVE_PTHREADS_D4 )
9657 #       define  ATTR    pthread_attr_default
9658 #else
9659 #       define  ATTR    NULL
9660 #endif
9661
9662         /* make sure pthread_create() isn't just a stub */
9663         status = pthread_create(&t, ATTR, task, NULL);
9664         if( status ) exit( status );
9665
9666         /* give the thread a chance to complete...
9667      * it should remain joinable and hence detachable
9668          */
9669         sleep( 1 );
9670
9671         /* make sure pthread_detach() isn't just a stub */
9672 #if HAVE_PTHREADS_D4
9673         status = pthread_detach( &t );
9674 #else
9675         status = pthread_detach( t );
9676 #endif
9677
9678 #ifdef HAVE_LINUX_THREADS
9679         pthread_kill_other_threads_np();
9680 #endif
9681
9682         exit( status );
9683
9684 ; return 0; }
9685 EOF
9686 if { (eval echo configure:9687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9687   rm -rf conftest*
9688   ol_cv_pthread_lpthreads_lexc=yes
9689 else
9690   echo "configure: failed program was:" >&5
9691   cat conftest.$ac_ext >&5
9692   rm -rf conftest*
9693   ol_cv_pthread_lpthreads_lexc=no
9694 fi
9695 rm -f conftest*
9696 else
9697   cat > conftest.$ac_ext <<EOF
9698 #line 9699 "configure"
9699 #include "confdefs.h"
9700 /* pthread test headers */
9701 #include <pthread.h>
9702 #ifndef NULL
9703 #define NULL (void*)0
9704 #endif
9705
9706 static void *task(p)
9707         void *p;
9708 {
9709         return (void *) (p == NULL);
9710 }
9711
9712
9713 int main(argc, argv)
9714         int argc;
9715         char **argv;
9716 {
9717
9718         /* pthread test function */
9719         pthread_t t;
9720         int status;
9721 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9722         /* This system (e.g. AIX) defaults detached; must override */
9723         pthread_attr_t attr;
9724
9725         status = pthread_attr_init(&attr);
9726         if( status ) exit( status );
9727
9728         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9729         if( status ) exit( status );
9730
9731 #       define  ATTR    &attr
9732 #elif defined( HAVE_PTHREADS_D4 )
9733 #       define  ATTR    pthread_attr_default
9734 #else
9735 #       define  ATTR    NULL
9736 #endif
9737
9738         /* make sure pthread_create() isn't just a stub */
9739         status = pthread_create(&t, ATTR, task, NULL);
9740         if( status ) exit( status );
9741
9742         /* give the thread a chance to complete...
9743      * it should remain joinable and hence detachable
9744          */
9745         sleep( 1 );
9746
9747         /* make sure pthread_detach() isn't just a stub */
9748 #if HAVE_PTHREADS_D4
9749         status = pthread_detach( &t );
9750 #else
9751         status = pthread_detach( t );
9752 #endif
9753
9754 #ifdef HAVE_LINUX_THREADS
9755         pthread_kill_other_threads_np();
9756 #endif
9757
9758         exit( status );
9759
9760 }
9761
9762 EOF
9763 if { (eval echo configure:9764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9764 then
9765   ol_cv_pthread_lpthreads_lexc=yes
9766 else
9767   echo "configure: failed program was:" >&5
9768   cat conftest.$ac_ext >&5
9769   rm -fr conftest*
9770   ol_cv_pthread_lpthreads_lexc=no
9771 fi
9772 rm -fr conftest*
9773 fi
9774
9775
9776                 # restore the LIBS
9777                 LIBS="$ol_LIBS"
9778         
9779 fi
9780
9781 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
9782
9783         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
9784                 ol_link_pthreads="-lpthreads -lexc"
9785                 ol_link_threads=posix
9786         fi
9787 fi
9788
9789
9790                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
9791 if test "$ol_link_threads" = no ; then
9792         # try -lpthreads
9793         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
9794 echo "configure:9795: checking for pthread link with -lpthreads" >&5
9795 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
9796   echo $ac_n "(cached) $ac_c" 1>&6
9797 else
9798   
9799                 # save the flags
9800                 ol_LIBS="$LIBS"
9801                 LIBS="-lpthreads $LIBS"
9802
9803                 if test "$cross_compiling" = yes; then
9804   cat > conftest.$ac_ext <<EOF
9805 #line 9806 "configure"
9806 #include "confdefs.h"
9807 /* pthread test headers */
9808 #include <pthread.h>
9809 #ifndef NULL
9810 #define NULL (void*)0
9811 #endif
9812
9813 static void *task(p)
9814         void *p;
9815 {
9816         return (void *) (p == NULL);
9817 }
9818
9819 int main() {
9820
9821         /* pthread test function */
9822         pthread_t t;
9823         int status;
9824 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9825         /* This system (e.g. AIX) defaults detached; must override */
9826         pthread_attr_t attr;
9827
9828         status = pthread_attr_init(&attr);
9829         if( status ) exit( status );
9830
9831         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9832         if( status ) exit( status );
9833
9834 #       define  ATTR    &attr
9835 #elif defined( HAVE_PTHREADS_D4 )
9836 #       define  ATTR    pthread_attr_default
9837 #else
9838 #       define  ATTR    NULL
9839 #endif
9840
9841         /* make sure pthread_create() isn't just a stub */
9842         status = pthread_create(&t, ATTR, task, NULL);
9843         if( status ) exit( status );
9844
9845         /* give the thread a chance to complete...
9846      * it should remain joinable and hence detachable
9847          */
9848         sleep( 1 );
9849
9850         /* make sure pthread_detach() isn't just a stub */
9851 #if HAVE_PTHREADS_D4
9852         status = pthread_detach( &t );
9853 #else
9854         status = pthread_detach( t );
9855 #endif
9856
9857 #ifdef HAVE_LINUX_THREADS
9858         pthread_kill_other_threads_np();
9859 #endif
9860
9861         exit( status );
9862
9863 ; return 0; }
9864 EOF
9865 if { (eval echo configure:9866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9866   rm -rf conftest*
9867   ol_cv_pthread_lib_lpthreads=yes
9868 else
9869   echo "configure: failed program was:" >&5
9870   cat conftest.$ac_ext >&5
9871   rm -rf conftest*
9872   ol_cv_pthread_lib_lpthreads=no
9873 fi
9874 rm -f conftest*
9875 else
9876   cat > conftest.$ac_ext <<EOF
9877 #line 9878 "configure"
9878 #include "confdefs.h"
9879 /* pthread test headers */
9880 #include <pthread.h>
9881 #ifndef NULL
9882 #define NULL (void*)0
9883 #endif
9884
9885 static void *task(p)
9886         void *p;
9887 {
9888         return (void *) (p == NULL);
9889 }
9890
9891
9892 int main(argc, argv)
9893         int argc;
9894         char **argv;
9895 {
9896
9897         /* pthread test function */
9898         pthread_t t;
9899         int status;
9900 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9901         /* This system (e.g. AIX) defaults detached; must override */
9902         pthread_attr_t attr;
9903
9904         status = pthread_attr_init(&attr);
9905         if( status ) exit( status );
9906
9907         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9908         if( status ) exit( status );
9909
9910 #       define  ATTR    &attr
9911 #elif defined( HAVE_PTHREADS_D4 )
9912 #       define  ATTR    pthread_attr_default
9913 #else
9914 #       define  ATTR    NULL
9915 #endif
9916
9917         /* make sure pthread_create() isn't just a stub */
9918         status = pthread_create(&t, ATTR, task, NULL);
9919         if( status ) exit( status );
9920
9921         /* give the thread a chance to complete...
9922      * it should remain joinable and hence detachable
9923          */
9924         sleep( 1 );
9925
9926         /* make sure pthread_detach() isn't just a stub */
9927 #if HAVE_PTHREADS_D4
9928         status = pthread_detach( &t );
9929 #else
9930         status = pthread_detach( t );
9931 #endif
9932
9933 #ifdef HAVE_LINUX_THREADS
9934         pthread_kill_other_threads_np();
9935 #endif
9936
9937         exit( status );
9938
9939 }
9940
9941 EOF
9942 if { (eval echo configure:9943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9943 then
9944   ol_cv_pthread_lib_lpthreads=yes
9945 else
9946   echo "configure: failed program was:" >&5
9947   cat conftest.$ac_ext >&5
9948   rm -fr conftest*
9949   ol_cv_pthread_lib_lpthreads=no
9950 fi
9951 rm -fr conftest*
9952 fi
9953
9954
9955                 # restore the LIBS
9956                 LIBS="$ol_LIBS"
9957         
9958 fi
9959
9960 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
9961
9962         if test $ol_cv_pthread_lib_lpthreads = yes ; then
9963                 ol_link_pthreads="-lpthreads"
9964                 ol_link_threads=posix
9965         fi
9966 fi
9967
9968
9969                 if test $ol_link_threads != no ; then
9970                         cat >> confdefs.h <<\EOF
9971 #define HAVE_PTHREADS 1
9972 EOF
9973
9974
9975                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
9976
9977                                                 save_CPPFLAGS="$CPPFLAGS"
9978                         save_LIBS="$LIBS"
9979                         LIBS="$LTHREAD_LIBS $LIBS"
9980
9981                                                                                                 for ac_func in sched_yield pthread_yield
9982 do
9983 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9984 echo "configure:9985: checking for $ac_func" >&5
9985 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9986   echo $ac_n "(cached) $ac_c" 1>&6
9987 else
9988   cat > conftest.$ac_ext <<EOF
9989 #line 9990 "configure"
9990 #include "confdefs.h"
9991 /* System header to define __stub macros and hopefully few prototypes,
9992     which can conflict with char $ac_func(); below.  */
9993 #include <assert.h>
9994 /* Override any gcc2 internal prototype to avoid an error.  */
9995 /* We use char because int might match the return type of a gcc2
9996     builtin and then its argument prototype would still apply.  */
9997 char $ac_func();
9998 char (*f)();
9999
10000 int main() {
10001
10002 /* The GNU C library defines this for functions which it implements
10003     to always fail with ENOSYS.  Some functions are actually named
10004     something starting with __ and the normal name is an alias.  */
10005 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10006 choke me
10007 #else
10008 f = $ac_func;
10009 #endif
10010
10011 ; return 0; }
10012 EOF
10013 if { (eval echo configure:10014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10014   rm -rf conftest*
10015   eval "ac_cv_func_$ac_func=yes"
10016 else
10017   echo "configure: failed program was:" >&5
10018   cat conftest.$ac_ext >&5
10019   rm -rf conftest*
10020   eval "ac_cv_func_$ac_func=no"
10021 fi
10022 rm -f conftest*
10023 fi
10024
10025 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10026   echo "$ac_t""yes" 1>&6
10027     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10028   cat >> confdefs.h <<EOF
10029 #define $ac_tr_func 1
10030 EOF
10031  
10032 else
10033   echo "$ac_t""no" 1>&6
10034 fi
10035 done
10036
10037
10038                         if test $ac_cv_func_sched_yield = no -a \
10039                                 $ac_cv_func_pthread_yield = no ; then
10040                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
10041 echo "configure:10042: checking for sched_yield in -lrt" >&5
10042 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
10043 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10044   echo $ac_n "(cached) $ac_c" 1>&6
10045 else
10046   ac_save_LIBS="$LIBS"
10047 LIBS="-lrt  $LIBS"
10048 cat > conftest.$ac_ext <<EOF
10049 #line 10050 "configure"
10050 #include "confdefs.h"
10051 /* Override any gcc2 internal prototype to avoid an error.  */
10052 /* We use char because int might match the return type of a gcc2
10053     builtin and then its argument prototype would still apply.  */
10054 char sched_yield();
10055
10056 int main() {
10057 sched_yield()
10058 ; return 0; }
10059 EOF
10060 if { (eval echo configure:10061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10061   rm -rf conftest*
10062   eval "ac_cv_lib_$ac_lib_var=yes"
10063 else
10064   echo "configure: failed program was:" >&5
10065   cat conftest.$ac_ext >&5
10066   rm -rf conftest*
10067   eval "ac_cv_lib_$ac_lib_var=no"
10068 fi
10069 rm -f conftest*
10070 LIBS="$ac_save_LIBS"
10071
10072 fi
10073 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10074   echo "$ac_t""yes" 1>&6
10075   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
10076                                         cat >> confdefs.h <<\EOF
10077 #define HAVE_SCHED_YIELD 1
10078 EOF
10079
10080                                         ac_cv_func_sched_yield=yes
10081 else
10082   echo "$ac_t""no" 1>&6
10083 ac_cv_func_sched_yield=no
10084 fi
10085
10086                         fi
10087                         if test $ac_cv_func_sched_yield = no -a \
10088                                 $ac_cv_func_pthread_yield = no ; then
10089                                                                                                 for ac_func in thr_yield
10090 do
10091 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10092 echo "configure:10093: checking for $ac_func" >&5
10093 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10094   echo $ac_n "(cached) $ac_c" 1>&6
10095 else
10096   cat > conftest.$ac_ext <<EOF
10097 #line 10098 "configure"
10098 #include "confdefs.h"
10099 /* System header to define __stub macros and hopefully few prototypes,
10100     which can conflict with char $ac_func(); below.  */
10101 #include <assert.h>
10102 /* Override any gcc2 internal prototype to avoid an error.  */
10103 /* We use char because int might match the return type of a gcc2
10104     builtin and then its argument prototype would still apply.  */
10105 char $ac_func();
10106 char (*f)();
10107
10108 int main() {
10109
10110 /* The GNU C library defines this for functions which it implements
10111     to always fail with ENOSYS.  Some functions are actually named
10112     something starting with __ and the normal name is an alias.  */
10113 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10114 choke me
10115 #else
10116 f = $ac_func;
10117 #endif
10118
10119 ; return 0; }
10120 EOF
10121 if { (eval echo configure:10122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10122   rm -rf conftest*
10123   eval "ac_cv_func_$ac_func=yes"
10124 else
10125   echo "configure: failed program was:" >&5
10126   cat conftest.$ac_ext >&5
10127   rm -rf conftest*
10128   eval "ac_cv_func_$ac_func=no"
10129 fi
10130 rm -f conftest*
10131 fi
10132
10133 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10134   echo "$ac_t""yes" 1>&6
10135     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10136   cat >> confdefs.h <<EOF
10137 #define $ac_tr_func 1
10138 EOF
10139  
10140 else
10141   echo "$ac_t""no" 1>&6
10142 fi
10143 done
10144
10145                         fi
10146                         if test $ac_cv_func_sched_yield = no -a \
10147                                 $ac_cv_func_pthread_yield = no -a \
10148                                 "$ac_cv_func_thr_yield" = no ; then
10149                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10150                         fi
10151
10152                                                 for ac_func in pthread_kill pthread_rwlock_destroy
10153 do
10154 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10155 echo "configure:10156: checking for $ac_func" >&5
10156 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10157   echo $ac_n "(cached) $ac_c" 1>&6
10158 else
10159   cat > conftest.$ac_ext <<EOF
10160 #line 10161 "configure"
10161 #include "confdefs.h"
10162 /* System header to define __stub macros and hopefully few prototypes,
10163     which can conflict with char $ac_func(); below.  */
10164 #include <assert.h>
10165 /* Override any gcc2 internal prototype to avoid an error.  */
10166 /* We use char because int might match the return type of a gcc2
10167     builtin and then its argument prototype would still apply.  */
10168 char $ac_func();
10169 char (*f)();
10170
10171 int main() {
10172
10173 /* The GNU C library defines this for functions which it implements
10174     to always fail with ENOSYS.  Some functions are actually named
10175     something starting with __ and the normal name is an alias.  */
10176 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10177 choke me
10178 #else
10179 f = $ac_func;
10180 #endif
10181
10182 ; return 0; }
10183 EOF
10184 if { (eval echo configure:10185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10185   rm -rf conftest*
10186   eval "ac_cv_func_$ac_func=yes"
10187 else
10188   echo "configure: failed program was:" >&5
10189   cat conftest.$ac_ext >&5
10190   rm -rf conftest*
10191   eval "ac_cv_func_$ac_func=no"
10192 fi
10193 rm -f conftest*
10194 fi
10195
10196 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10197   echo "$ac_t""yes" 1>&6
10198     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10199   cat >> confdefs.h <<EOF
10200 #define $ac_tr_func 1
10201 EOF
10202  
10203 else
10204   echo "$ac_t""no" 1>&6
10205 fi
10206 done
10207
10208
10209                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
10210 echo "configure:10211: checking for pthread_detach with <pthread.h>" >&5
10211 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
10212   echo $ac_n "(cached) $ac_c" 1>&6
10213 else
10214   
10215                                                                 cat > conftest.$ac_ext <<EOF
10216 #line 10217 "configure"
10217 #include "confdefs.h"
10218
10219 #include <pthread.h>
10220 #ifndef NULL
10221 #define NULL (void*)0
10222 #endif
10223
10224 int main() {
10225 pthread_detach(NULL);
10226 ; return 0; }
10227 EOF
10228 if { (eval echo configure:10229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10229   rm -rf conftest*
10230   ol_cv_func_pthread_detach=yes
10231 else
10232   echo "configure: failed program was:" >&5
10233   cat conftest.$ac_ext >&5
10234   rm -rf conftest*
10235   ol_cv_func_pthread_detach=no
10236 fi
10237 rm -f conftest*
10238                         
10239 fi
10240
10241 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
10242
10243                         if test $ol_cv_func_pthread_detach = no ; then
10244                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
10245                         fi
10246
10247                         cat >> confdefs.h <<\EOF
10248 #define HAVE_PTHREAD_DETACH 1
10249 EOF
10250
10251
10252                                                 for ac_func in \
10253                                 pthread_setconcurrency \
10254                                 pthread_getconcurrency \
10255                                 thr_setconcurrency \
10256                                 thr_getconcurrency \
10257                         
10258 do
10259 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10260 echo "configure:10261: checking for $ac_func" >&5
10261 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10262   echo $ac_n "(cached) $ac_c" 1>&6
10263 else
10264   cat > conftest.$ac_ext <<EOF
10265 #line 10266 "configure"
10266 #include "confdefs.h"
10267 /* System header to define __stub macros and hopefully few prototypes,
10268     which can conflict with char $ac_func(); below.  */
10269 #include <assert.h>
10270 /* Override any gcc2 internal prototype to avoid an error.  */
10271 /* We use char because int might match the return type of a gcc2
10272     builtin and then its argument prototype would still apply.  */
10273 char $ac_func();
10274 char (*f)();
10275
10276 int main() {
10277
10278 /* The GNU C library defines this for functions which it implements
10279     to always fail with ENOSYS.  Some functions are actually named
10280     something starting with __ and the normal name is an alias.  */
10281 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10282 choke me
10283 #else
10284 f = $ac_func;
10285 #endif
10286
10287 ; return 0; }
10288 EOF
10289 if { (eval echo configure:10290: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10290   rm -rf conftest*
10291   eval "ac_cv_func_$ac_func=yes"
10292 else
10293   echo "configure: failed program was:" >&5
10294   cat conftest.$ac_ext >&5
10295   rm -rf conftest*
10296   eval "ac_cv_func_$ac_func=no"
10297 fi
10298 rm -f conftest*
10299 fi
10300
10301 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10302   echo "$ac_t""yes" 1>&6
10303     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10304   cat >> confdefs.h <<EOF
10305 #define $ac_tr_func 1
10306 EOF
10307  
10308 else
10309   echo "$ac_t""no" 1>&6
10310 fi
10311 done
10312
10313
10314                         
10315         for ac_func in pthread_kill_other_threads_np
10316 do
10317 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10318 echo "configure:10319: checking for $ac_func" >&5
10319 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10320   echo $ac_n "(cached) $ac_c" 1>&6
10321 else
10322   cat > conftest.$ac_ext <<EOF
10323 #line 10324 "configure"
10324 #include "confdefs.h"
10325 /* System header to define __stub macros and hopefully few prototypes,
10326     which can conflict with char $ac_func(); below.  */
10327 #include <assert.h>
10328 /* Override any gcc2 internal prototype to avoid an error.  */
10329 /* We use char because int might match the return type of a gcc2
10330     builtin and then its argument prototype would still apply.  */
10331 char $ac_func();
10332 char (*f)();
10333
10334 int main() {
10335
10336 /* The GNU C library defines this for functions which it implements
10337     to always fail with ENOSYS.  Some functions are actually named
10338     something starting with __ and the normal name is an alias.  */
10339 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10340 choke me
10341 #else
10342 f = $ac_func;
10343 #endif
10344
10345 ; return 0; }
10346 EOF
10347 if { (eval echo configure:10348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10348   rm -rf conftest*
10349   eval "ac_cv_func_$ac_func=yes"
10350 else
10351   echo "configure: failed program was:" >&5
10352   cat conftest.$ac_ext >&5
10353   rm -rf conftest*
10354   eval "ac_cv_func_$ac_func=no"
10355 fi
10356 rm -f conftest*
10357 fi
10358
10359 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10360   echo "$ac_t""yes" 1>&6
10361     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10362   cat >> confdefs.h <<EOF
10363 #define $ac_tr_func 1
10364 EOF
10365  
10366 else
10367   echo "$ac_t""no" 1>&6
10368 fi
10369 done
10370
10371         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10372 echo "configure:10373: checking for LinuxThreads implementation" >&5
10373 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10374   echo $ac_n "(cached) $ac_c" 1>&6
10375 else
10376   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10377 fi
10378
10379 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10380
10381                         
10382         
10383         
10384         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10385 echo "configure:10386: checking for LinuxThreads consistency" >&5
10386 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10387   echo $ac_n "(cached) $ac_c" 1>&6
10388 else
10389   
10390                 if test $ol_cv_header_linux_threads = yes -a \
10391                         $ol_cv_sys_linux_threads = yes; then
10392                         ol_cv_linux_threads=yes
10393                 elif test $ol_cv_header_linux_threads = no -a \
10394                         $ol_cv_sys_linux_threads = no; then
10395                         ol_cv_linux_threads=no
10396                 else
10397                         ol_cv_linux_threads=error
10398                 fi
10399         
10400 fi
10401
10402 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10403
10404
10405                         if test $ol_cv_linux_threads = error; then
10406                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10407                         fi
10408
10409                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10410 echo "configure:10411: checking if pthread_create() works" >&5
10411 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10412   echo $ac_n "(cached) $ac_c" 1>&6
10413 else
10414   
10415                         if test "$cross_compiling" = yes; then
10416                                 ol_cv_pthread_create_works=yes
10417 else
10418   cat > conftest.$ac_ext <<EOF
10419 #line 10420 "configure"
10420 #include "confdefs.h"
10421 /* pthread test headers */
10422 #include <pthread.h>
10423 #ifndef NULL
10424 #define NULL (void*)0
10425 #endif
10426
10427 static void *task(p)
10428         void *p;
10429 {
10430         return (void *) (p == NULL);
10431 }
10432
10433
10434 int main(argc, argv)
10435         int argc;
10436         char **argv;
10437 {
10438
10439         /* pthread test function */
10440         pthread_t t;
10441         int status;
10442 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10443         /* This system (e.g. AIX) defaults detached; must override */
10444         pthread_attr_t attr;
10445
10446         status = pthread_attr_init(&attr);
10447         if( status ) exit( status );
10448
10449         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10450         if( status ) exit( status );
10451
10452 #       define  ATTR    &attr
10453 #elif defined( HAVE_PTHREADS_D4 )
10454 #       define  ATTR    pthread_attr_default
10455 #else
10456 #       define  ATTR    NULL
10457 #endif
10458
10459         /* make sure pthread_create() isn't just a stub */
10460         status = pthread_create(&t, ATTR, task, NULL);
10461         if( status ) exit( status );
10462
10463         /* give the thread a chance to complete...
10464      * it should remain joinable and hence detachable
10465          */
10466         sleep( 1 );
10467
10468         /* make sure pthread_detach() isn't just a stub */
10469 #if HAVE_PTHREADS_D4
10470         status = pthread_detach( &t );
10471 #else
10472         status = pthread_detach( t );
10473 #endif
10474
10475 #ifdef HAVE_LINUX_THREADS
10476         pthread_kill_other_threads_np();
10477 #endif
10478
10479         exit( status );
10480
10481 }
10482
10483 EOF
10484 if { (eval echo configure:10485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10485 then
10486   ol_cv_pthread_create_works=yes
10487 else
10488   echo "configure: failed program was:" >&5
10489   cat conftest.$ac_ext >&5
10490   rm -fr conftest*
10491   ol_cv_pthread_create_works=no
10492 fi
10493 rm -fr conftest*
10494 fi
10495
10496 fi
10497
10498 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10499
10500                         if test $ol_cv_pthread_create_works = no ; then
10501                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10502                         fi
10503
10504                                                 if test $ol_with_yielding_select = auto ; then
10505                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10506 echo "configure:10507: checking if select yields when using pthreads" >&5
10507 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10508   echo $ac_n "(cached) $ac_c" 1>&6
10509 else
10510   
10511                                 if test "$cross_compiling" = yes; then
10512   ol_cv_pthread_select_yields=cross
10513 else
10514   cat > conftest.$ac_ext <<EOF
10515 #line 10516 "configure"
10516 #include "confdefs.h"
10517
10518 #include <sys/types.h>
10519 #include <sys/time.h>
10520 #include <unistd.h>
10521 #include <pthread.h>
10522 #ifndef NULL
10523 #define NULL (void*) 0
10524 #endif
10525
10526 static int fildes[2];
10527
10528 static void *task(p)
10529         void *p;
10530 {
10531         int i;
10532         struct timeval tv;
10533
10534         fd_set rfds;
10535
10536         tv.tv_sec=10;
10537         tv.tv_usec=0;
10538
10539         FD_ZERO(&rfds);
10540         FD_SET(fildes[0], &rfds);
10541
10542         /* we're not interested in any fds */
10543         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10544
10545         if(i < 0) {
10546                 perror("select");
10547                 exit(10);
10548         }
10549
10550         exit(0); /* if we exit here, the select blocked the whole process */
10551 }
10552
10553 int main(argc, argv)
10554         int argc;
10555         char **argv;
10556 {
10557         pthread_t t;
10558
10559         /* create a pipe to select */
10560         if(pipe(&fildes[0])) {
10561                 perror("select");
10562                 exit(1);
10563         }
10564
10565 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10566         (void) pthread_setconcurrency(2);
10567 #else
10568 #ifdef HAVE_THR_SETCONCURRENCY
10569         /* Set Solaris LWP concurrency to 2 */
10570         thr_setconcurrency(2);
10571 #endif
10572 #endif
10573
10574 #if HAVE_PTHREADS_D4
10575         pthread_create(&t, pthread_attr_default, task, NULL);
10576 #else
10577         pthread_create(&t, NULL, task, NULL);
10578 #endif
10579
10580 #if HAVE_SCHED_YIELD
10581         sched_yield();  /* make sure task runs first */
10582 #else
10583 #ifdef HAVE_PTHREAD_YIELD
10584         pthread_yield();        /* make sure task runs first */
10585 #endif
10586 #endif
10587
10588         exit(2);
10589 }
10590 EOF
10591 if { (eval echo configure:10592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10592 then
10593   ol_cv_pthread_select_yields=no
10594 else
10595   echo "configure: failed program was:" >&5
10596   cat conftest.$ac_ext >&5
10597   rm -fr conftest*
10598   ol_cv_pthread_select_yields=yes
10599 fi
10600 rm -fr conftest*
10601 fi
10602
10603 fi
10604
10605 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
10606
10607                                 if test $ol_cv_pthread_select_yields = cross ; then
10608                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
10609                                 fi
10610
10611                                 if test $ol_cv_pthread_select_yields = yes ; then
10612                                         ol_with_yielding_select=yes
10613                                 fi
10614                         fi
10615
10616                                                 CPPFLAGS="$save_CPPFLAGS"
10617                         LIBS="$save_LIBS"
10618                 else
10619                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
10620                 fi
10621         fi
10622
10623         if test $ol_with_threads = posix ; then
10624                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
10625         fi
10626 fi
10627
10628 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10629         -o $ol_with_threads = mach ; then
10630
10631                 for ac_hdr in mach/cthreads.h
10632 do
10633 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10634 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10635 echo "configure:10636: checking for $ac_hdr" >&5
10636 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10637   echo $ac_n "(cached) $ac_c" 1>&6
10638 else
10639   cat > conftest.$ac_ext <<EOF
10640 #line 10641 "configure"
10641 #include "confdefs.h"
10642 #include <$ac_hdr>
10643 EOF
10644 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10645 { (eval echo configure:10646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10646 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10647 if test -z "$ac_err"; then
10648   rm -rf conftest*
10649   eval "ac_cv_header_$ac_safe=yes"
10650 else
10651   echo "$ac_err" >&5
10652   echo "configure: failed program was:" >&5
10653   cat conftest.$ac_ext >&5
10654   rm -rf conftest*
10655   eval "ac_cv_header_$ac_safe=no"
10656 fi
10657 rm -f conftest*
10658 fi
10659 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10660   echo "$ac_t""yes" 1>&6
10661     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10662   cat >> confdefs.h <<EOF
10663 #define $ac_tr_hdr 1
10664 EOF
10665  
10666 else
10667   echo "$ac_t""no" 1>&6
10668 fi
10669 done
10670
10671         if test $ac_cv_header_mach_cthreads_h = yes ; then
10672                 ol_with_threads=found
10673
10674                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
10675 echo "configure:10676: checking for cthread_fork" >&5
10676 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
10677   echo $ac_n "(cached) $ac_c" 1>&6
10678 else
10679   cat > conftest.$ac_ext <<EOF
10680 #line 10681 "configure"
10681 #include "confdefs.h"
10682 /* System header to define __stub macros and hopefully few prototypes,
10683     which can conflict with char cthread_fork(); below.  */
10684 #include <assert.h>
10685 /* Override any gcc2 internal prototype to avoid an error.  */
10686 /* We use char because int might match the return type of a gcc2
10687     builtin and then its argument prototype would still apply.  */
10688 char cthread_fork();
10689 char (*f)();
10690
10691 int main() {
10692
10693 /* The GNU C library defines this for functions which it implements
10694     to always fail with ENOSYS.  Some functions are actually named
10695     something starting with __ and the normal name is an alias.  */
10696 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
10697 choke me
10698 #else
10699 f = cthread_fork;
10700 #endif
10701
10702 ; return 0; }
10703 EOF
10704 if { (eval echo configure:10705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10705   rm -rf conftest*
10706   eval "ac_cv_func_cthread_fork=yes"
10707 else
10708   echo "configure: failed program was:" >&5
10709   cat conftest.$ac_ext >&5
10710   rm -rf conftest*
10711   eval "ac_cv_func_cthread_fork=no"
10712 fi
10713 rm -f conftest*
10714 fi
10715
10716 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
10717   echo "$ac_t""yes" 1>&6
10718   ol_link_threads=yes
10719 else
10720   echo "$ac_t""no" 1>&6
10721 fi
10722
10723
10724                 if test $ol_link_threads = no ; then
10725                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
10726 echo "configure:10727: checking for cthread_fork with -all_load" >&5
10727 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
10728   echo $ac_n "(cached) $ac_c" 1>&6
10729 else
10730   
10731                                                                 save_LIBS="$LIBS"
10732                                 LIBS="-all_load $LIBS"
10733                                 cat > conftest.$ac_ext <<EOF
10734 #line 10735 "configure"
10735 #include "confdefs.h"
10736 #include <mach/cthreads.h>
10737 int main() {
10738
10739                                         cthread_fork((void *)0, (void *)0);
10740                                         
10741 ; return 0; }
10742 EOF
10743 if { (eval echo configure:10744: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10744   rm -rf conftest*
10745   ol_cv_cthread_all_load=yes
10746 else
10747   echo "configure: failed program was:" >&5
10748   cat conftest.$ac_ext >&5
10749   rm -rf conftest*
10750   ol_cv_cthread_all_load=no
10751 fi
10752 rm -f conftest*
10753                                                                 LIBS="$save_LIBS"
10754                         
10755 fi
10756
10757 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
10758
10759                         if test $ol_cv_cthread_all_load = yes ; then
10760                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
10761                                 ol_link_threads=mach
10762                         fi
10763                 fi
10764
10765                 if test $ol_link_threads != no ; then
10766                         : check for cthread specific functionality here
10767                         cat >> confdefs.h <<\EOF
10768 #define HAVE_MACH_CTHREADS 1
10769 EOF
10770
10771                 else
10772                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
10773                 fi
10774         fi
10775
10776         if test $ol_with_threads = mach ; then
10777                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
10778         fi
10779 fi
10780
10781 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10782         -o $ol_with_threads = pth ; then
10783
10784         for ac_hdr in pth.h
10785 do
10786 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10787 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10788 echo "configure:10789: checking for $ac_hdr" >&5
10789 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10790   echo $ac_n "(cached) $ac_c" 1>&6
10791 else
10792   cat > conftest.$ac_ext <<EOF
10793 #line 10794 "configure"
10794 #include "confdefs.h"
10795 #include <$ac_hdr>
10796 EOF
10797 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10798 { (eval echo configure:10799: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10799 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10800 if test -z "$ac_err"; then
10801   rm -rf conftest*
10802   eval "ac_cv_header_$ac_safe=yes"
10803 else
10804   echo "$ac_err" >&5
10805   echo "configure: failed program was:" >&5
10806   cat conftest.$ac_ext >&5
10807   rm -rf conftest*
10808   eval "ac_cv_header_$ac_safe=no"
10809 fi
10810 rm -f conftest*
10811 fi
10812 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10813   echo "$ac_t""yes" 1>&6
10814     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10815   cat >> confdefs.h <<EOF
10816 #define $ac_tr_hdr 1
10817 EOF
10818  
10819 else
10820   echo "$ac_t""no" 1>&6
10821 fi
10822 done
10823
10824
10825         if test $ac_cv_header_pth_h = yes ; then
10826                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
10827 echo "configure:10828: checking for pth_version in -lpth" >&5
10828 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
10829 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10830   echo $ac_n "(cached) $ac_c" 1>&6
10831 else
10832   ac_save_LIBS="$LIBS"
10833 LIBS="-lpth  $LIBS"
10834 cat > conftest.$ac_ext <<EOF
10835 #line 10836 "configure"
10836 #include "confdefs.h"
10837 /* Override any gcc2 internal prototype to avoid an error.  */
10838 /* We use char because int might match the return type of a gcc2
10839     builtin and then its argument prototype would still apply.  */
10840 char pth_version();
10841
10842 int main() {
10843 pth_version()
10844 ; return 0; }
10845 EOF
10846 if { (eval echo configure:10847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10847   rm -rf conftest*
10848   eval "ac_cv_lib_$ac_lib_var=yes"
10849 else
10850   echo "configure: failed program was:" >&5
10851   cat conftest.$ac_ext >&5
10852   rm -rf conftest*
10853   eval "ac_cv_lib_$ac_lib_var=no"
10854 fi
10855 rm -f conftest*
10856 LIBS="$ac_save_LIBS"
10857
10858 fi
10859 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10860   echo "$ac_t""yes" 1>&6
10861   have_pth=yes
10862 else
10863   echo "$ac_t""no" 1>&6
10864 have_pth=no
10865 fi
10866
10867
10868                 if test $have_pth = yes ; then
10869                         cat >> confdefs.h <<\EOF
10870 #define HAVE_GNU_PTH 1
10871 EOF
10872
10873                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
10874                         ol_link_threads=pth
10875
10876                         if test $ol_with_yielding_select = auto ; then
10877                                 ol_with_yielding_select=yes
10878                         fi
10879                 fi
10880         fi
10881 fi
10882
10883 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10884         -o $ol_with_threads = lwp ; then
10885
10886                 for ac_hdr in thread.h synch.h
10887 do
10888 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10889 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10890 echo "configure:10891: checking for $ac_hdr" >&5
10891 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10892   echo $ac_n "(cached) $ac_c" 1>&6
10893 else
10894   cat > conftest.$ac_ext <<EOF
10895 #line 10896 "configure"
10896 #include "confdefs.h"
10897 #include <$ac_hdr>
10898 EOF
10899 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10900 { (eval echo configure:10901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10901 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10902 if test -z "$ac_err"; then
10903   rm -rf conftest*
10904   eval "ac_cv_header_$ac_safe=yes"
10905 else
10906   echo "$ac_err" >&5
10907   echo "configure: failed program was:" >&5
10908   cat conftest.$ac_ext >&5
10909   rm -rf conftest*
10910   eval "ac_cv_header_$ac_safe=no"
10911 fi
10912 rm -f conftest*
10913 fi
10914 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10915   echo "$ac_t""yes" 1>&6
10916     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10917   cat >> confdefs.h <<EOF
10918 #define $ac_tr_hdr 1
10919 EOF
10920  
10921 else
10922   echo "$ac_t""no" 1>&6
10923 fi
10924 done
10925
10926         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
10927                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
10928 echo "configure:10929: checking for thr_create in -lthread" >&5
10929 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
10930 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10931   echo $ac_n "(cached) $ac_c" 1>&6
10932 else
10933   ac_save_LIBS="$LIBS"
10934 LIBS="-lthread  $LIBS"
10935 cat > conftest.$ac_ext <<EOF
10936 #line 10937 "configure"
10937 #include "confdefs.h"
10938 /* Override any gcc2 internal prototype to avoid an error.  */
10939 /* We use char because int might match the return type of a gcc2
10940     builtin and then its argument prototype would still apply.  */
10941 char thr_create();
10942
10943 int main() {
10944 thr_create()
10945 ; return 0; }
10946 EOF
10947 if { (eval echo configure:10948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10948   rm -rf conftest*
10949   eval "ac_cv_lib_$ac_lib_var=yes"
10950 else
10951   echo "configure: failed program was:" >&5
10952   cat conftest.$ac_ext >&5
10953   rm -rf conftest*
10954   eval "ac_cv_lib_$ac_lib_var=no"
10955 fi
10956 rm -f conftest*
10957 LIBS="$ac_save_LIBS"
10958
10959 fi
10960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10961   echo "$ac_t""yes" 1>&6
10962   have_thr=yes
10963 else
10964   echo "$ac_t""no" 1>&6
10965 have_thr=no
10966 fi
10967
10968
10969                 if test $have_thr = yes ; then
10970                         cat >> confdefs.h <<\EOF
10971 #define HAVE_THR 1
10972 EOF
10973
10974                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
10975                         ol_link_threads=thr
10976
10977                         if test $ol_with_yielding_select = auto ; then
10978                                 ol_with_yielding_select=yes
10979                         fi
10980
10981                                                 for ac_func in \
10982                                 thr_setconcurrency \
10983                                 thr_getconcurrency \
10984                         
10985 do
10986 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10987 echo "configure:10988: checking for $ac_func" >&5
10988 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10989   echo $ac_n "(cached) $ac_c" 1>&6
10990 else
10991   cat > conftest.$ac_ext <<EOF
10992 #line 10993 "configure"
10993 #include "confdefs.h"
10994 /* System header to define __stub macros and hopefully few prototypes,
10995     which can conflict with char $ac_func(); below.  */
10996 #include <assert.h>
10997 /* Override any gcc2 internal prototype to avoid an error.  */
10998 /* We use char because int might match the return type of a gcc2
10999     builtin and then its argument prototype would still apply.  */
11000 char $ac_func();
11001 char (*f)();
11002
11003 int main() {
11004
11005 /* The GNU C library defines this for functions which it implements
11006     to always fail with ENOSYS.  Some functions are actually named
11007     something starting with __ and the normal name is an alias.  */
11008 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11009 choke me
11010 #else
11011 f = $ac_func;
11012 #endif
11013
11014 ; return 0; }
11015 EOF
11016 if { (eval echo configure:11017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11017   rm -rf conftest*
11018   eval "ac_cv_func_$ac_func=yes"
11019 else
11020   echo "configure: failed program was:" >&5
11021   cat conftest.$ac_ext >&5
11022   rm -rf conftest*
11023   eval "ac_cv_func_$ac_func=no"
11024 fi
11025 rm -f conftest*
11026 fi
11027
11028 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11029   echo "$ac_t""yes" 1>&6
11030     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11031   cat >> confdefs.h <<EOF
11032 #define $ac_tr_func 1
11033 EOF
11034  
11035 else
11036   echo "$ac_t""no" 1>&6
11037 fi
11038 done
11039
11040                 fi
11041         fi
11042
11043                 for ac_hdr in lwp/lwp.h
11044 do
11045 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11046 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11047 echo "configure:11048: checking for $ac_hdr" >&5
11048 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11049   echo $ac_n "(cached) $ac_c" 1>&6
11050 else
11051   cat > conftest.$ac_ext <<EOF
11052 #line 11053 "configure"
11053 #include "confdefs.h"
11054 #include <$ac_hdr>
11055 EOF
11056 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11057 { (eval echo configure:11058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11058 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11059 if test -z "$ac_err"; then
11060   rm -rf conftest*
11061   eval "ac_cv_header_$ac_safe=yes"
11062 else
11063   echo "$ac_err" >&5
11064   echo "configure: failed program was:" >&5
11065   cat conftest.$ac_ext >&5
11066   rm -rf conftest*
11067   eval "ac_cv_header_$ac_safe=no"
11068 fi
11069 rm -f conftest*
11070 fi
11071 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11072   echo "$ac_t""yes" 1>&6
11073     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11074   cat >> confdefs.h <<EOF
11075 #define $ac_tr_hdr 1
11076 EOF
11077  
11078 else
11079   echo "$ac_t""no" 1>&6
11080 fi
11081 done
11082
11083         if test $ac_cv_header_lwp_lwp_h = yes ; then
11084                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
11085 echo "configure:11086: checking for lwp_create in -llwp" >&5
11086 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11087 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11088   echo $ac_n "(cached) $ac_c" 1>&6
11089 else
11090   ac_save_LIBS="$LIBS"
11091 LIBS="-llwp  $LIBS"
11092 cat > conftest.$ac_ext <<EOF
11093 #line 11094 "configure"
11094 #include "confdefs.h"
11095 /* Override any gcc2 internal prototype to avoid an error.  */
11096 /* We use char because int might match the return type of a gcc2
11097     builtin and then its argument prototype would still apply.  */
11098 char lwp_create();
11099
11100 int main() {
11101 lwp_create()
11102 ; return 0; }
11103 EOF
11104 if { (eval echo configure:11105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11105   rm -rf conftest*
11106   eval "ac_cv_lib_$ac_lib_var=yes"
11107 else
11108   echo "configure: failed program was:" >&5
11109   cat conftest.$ac_ext >&5
11110   rm -rf conftest*
11111   eval "ac_cv_lib_$ac_lib_var=no"
11112 fi
11113 rm -f conftest*
11114 LIBS="$ac_save_LIBS"
11115
11116 fi
11117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11118   echo "$ac_t""yes" 1>&6
11119   have_lwp=yes
11120 else
11121   echo "$ac_t""no" 1>&6
11122 have_lwp=no
11123 fi
11124
11125
11126                 if test $have_lwp = yes ; then
11127                         cat >> confdefs.h <<\EOF
11128 #define HAVE_LWP 1
11129 EOF
11130
11131                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
11132                         ol_link_threads=lwp
11133
11134                         if test $ol_with_yielding_select = auto ; then
11135                                 ol_with_yielding_select=no
11136                         fi
11137                 fi
11138         fi
11139 fi
11140
11141 if test $ol_with_yielding_select = yes ; then
11142         cat >> confdefs.h <<\EOF
11143 #define HAVE_YIELDING_SELECT 1
11144 EOF
11145
11146 fi
11147
11148 if test $ol_with_threads = manual ; then
11149                 ol_link_threads=yes
11150
11151         echo "configure: warning: thread defines and link options must be set manually" 1>&2
11152
11153         for ac_hdr in pthread.h sched.h
11154 do
11155 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11156 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11157 echo "configure:11158: checking for $ac_hdr" >&5
11158 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11159   echo $ac_n "(cached) $ac_c" 1>&6
11160 else
11161   cat > conftest.$ac_ext <<EOF
11162 #line 11163 "configure"
11163 #include "confdefs.h"
11164 #include <$ac_hdr>
11165 EOF
11166 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11167 { (eval echo configure:11168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11168 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11169 if test -z "$ac_err"; then
11170   rm -rf conftest*
11171   eval "ac_cv_header_$ac_safe=yes"
11172 else
11173   echo "$ac_err" >&5
11174   echo "configure: failed program was:" >&5
11175   cat conftest.$ac_ext >&5
11176   rm -rf conftest*
11177   eval "ac_cv_header_$ac_safe=no"
11178 fi
11179 rm -f conftest*
11180 fi
11181 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11182   echo "$ac_t""yes" 1>&6
11183     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11184   cat >> confdefs.h <<EOF
11185 #define $ac_tr_hdr 1
11186 EOF
11187  
11188 else
11189   echo "$ac_t""no" 1>&6
11190 fi
11191 done
11192
11193         for ac_func in sched_yield pthread_yield
11194 do
11195 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11196 echo "configure:11197: checking for $ac_func" >&5
11197 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11198   echo $ac_n "(cached) $ac_c" 1>&6
11199 else
11200   cat > conftest.$ac_ext <<EOF
11201 #line 11202 "configure"
11202 #include "confdefs.h"
11203 /* System header to define __stub macros and hopefully few prototypes,
11204     which can conflict with char $ac_func(); below.  */
11205 #include <assert.h>
11206 /* Override any gcc2 internal prototype to avoid an error.  */
11207 /* We use char because int might match the return type of a gcc2
11208     builtin and then its argument prototype would still apply.  */
11209 char $ac_func();
11210 char (*f)();
11211
11212 int main() {
11213
11214 /* The GNU C library defines this for functions which it implements
11215     to always fail with ENOSYS.  Some functions are actually named
11216     something starting with __ and the normal name is an alias.  */
11217 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11218 choke me
11219 #else
11220 f = $ac_func;
11221 #endif
11222
11223 ; return 0; }
11224 EOF
11225 if { (eval echo configure:11226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11226   rm -rf conftest*
11227   eval "ac_cv_func_$ac_func=yes"
11228 else
11229   echo "configure: failed program was:" >&5
11230   cat conftest.$ac_ext >&5
11231   rm -rf conftest*
11232   eval "ac_cv_func_$ac_func=no"
11233 fi
11234 rm -f conftest*
11235 fi
11236
11237 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11238   echo "$ac_t""yes" 1>&6
11239     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11240   cat >> confdefs.h <<EOF
11241 #define $ac_tr_func 1
11242 EOF
11243  
11244 else
11245   echo "$ac_t""no" 1>&6
11246 fi
11247 done
11248
11249         
11250         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11251 echo "configure:11252: checking for LinuxThreads pthread.h" >&5
11252 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11253   echo $ac_n "(cached) $ac_c" 1>&6
11254 else
11255   cat > conftest.$ac_ext <<EOF
11256 #line 11257 "configure"
11257 #include "confdefs.h"
11258 #include <pthread.h>
11259 EOF
11260 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11261   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11262   rm -rf conftest*
11263   ol_cv_header_linux_threads=yes
11264 else
11265   rm -rf conftest*
11266   ol_cv_header_linux_threads=no
11267 fi
11268 rm -f conftest*
11269
11270                 
11271 fi
11272
11273 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11274         if test $ol_cv_header_linux_threads = yes; then
11275                 cat >> confdefs.h <<\EOF
11276 #define HAVE_LINUX_THREADS 1
11277 EOF
11278
11279         fi
11280
11281
11282         for ac_hdr in mach/cthreads.h
11283 do
11284 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11285 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11286 echo "configure:11287: checking for $ac_hdr" >&5
11287 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11288   echo $ac_n "(cached) $ac_c" 1>&6
11289 else
11290   cat > conftest.$ac_ext <<EOF
11291 #line 11292 "configure"
11292 #include "confdefs.h"
11293 #include <$ac_hdr>
11294 EOF
11295 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11296 { (eval echo configure:11297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11297 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11298 if test -z "$ac_err"; then
11299   rm -rf conftest*
11300   eval "ac_cv_header_$ac_safe=yes"
11301 else
11302   echo "$ac_err" >&5
11303   echo "configure: failed program was:" >&5
11304   cat conftest.$ac_ext >&5
11305   rm -rf conftest*
11306   eval "ac_cv_header_$ac_safe=no"
11307 fi
11308 rm -f conftest*
11309 fi
11310 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11311   echo "$ac_t""yes" 1>&6
11312     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11313   cat >> confdefs.h <<EOF
11314 #define $ac_tr_hdr 1
11315 EOF
11316  
11317 else
11318   echo "$ac_t""no" 1>&6
11319 fi
11320 done
11321
11322         for ac_hdr in lwp/lwp.h
11323 do
11324 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11325 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11326 echo "configure:11327: checking for $ac_hdr" >&5
11327 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11328   echo $ac_n "(cached) $ac_c" 1>&6
11329 else
11330   cat > conftest.$ac_ext <<EOF
11331 #line 11332 "configure"
11332 #include "confdefs.h"
11333 #include <$ac_hdr>
11334 EOF
11335 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11336 { (eval echo configure:11337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11337 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11338 if test -z "$ac_err"; then
11339   rm -rf conftest*
11340   eval "ac_cv_header_$ac_safe=yes"
11341 else
11342   echo "$ac_err" >&5
11343   echo "configure: failed program was:" >&5
11344   cat conftest.$ac_ext >&5
11345   rm -rf conftest*
11346   eval "ac_cv_header_$ac_safe=no"
11347 fi
11348 rm -f conftest*
11349 fi
11350 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11351   echo "$ac_t""yes" 1>&6
11352     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11353   cat >> confdefs.h <<EOF
11354 #define $ac_tr_hdr 1
11355 EOF
11356  
11357 else
11358   echo "$ac_t""no" 1>&6
11359 fi
11360 done
11361
11362         for ac_hdr in thread.h synch.h
11363 do
11364 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11365 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11366 echo "configure:11367: checking for $ac_hdr" >&5
11367 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11368   echo $ac_n "(cached) $ac_c" 1>&6
11369 else
11370   cat > conftest.$ac_ext <<EOF
11371 #line 11372 "configure"
11372 #include "confdefs.h"
11373 #include <$ac_hdr>
11374 EOF
11375 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11376 { (eval echo configure:11377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11377 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11378 if test -z "$ac_err"; then
11379   rm -rf conftest*
11380   eval "ac_cv_header_$ac_safe=yes"
11381 else
11382   echo "$ac_err" >&5
11383   echo "configure: failed program was:" >&5
11384   cat conftest.$ac_ext >&5
11385   rm -rf conftest*
11386   eval "ac_cv_header_$ac_safe=no"
11387 fi
11388 rm -f conftest*
11389 fi
11390 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11391   echo "$ac_t""yes" 1>&6
11392     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11393   cat >> confdefs.h <<EOF
11394 #define $ac_tr_hdr 1
11395 EOF
11396  
11397 else
11398   echo "$ac_t""no" 1>&6
11399 fi
11400 done
11401
11402 fi
11403
11404 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11405                         cat >> confdefs.h <<\EOF
11406 #define REENTRANT 1
11407 EOF
11408
11409         cat >> confdefs.h <<\EOF
11410 #define _REENTRANT 1
11411 EOF
11412
11413         cat >> confdefs.h <<\EOF
11414 #define THREAD_SAFE 1
11415 EOF
11416
11417         cat >> confdefs.h <<\EOF
11418 #define _THREAD_SAFE 1
11419 EOF
11420
11421         cat >> confdefs.h <<\EOF
11422 #define THREADSAFE 1
11423 EOF
11424
11425         cat >> confdefs.h <<\EOF
11426 #define _THREADSAFE 1
11427 EOF
11428
11429         cat >> confdefs.h <<\EOF
11430 #define _SGI_MP_SOURCE 1
11431 EOF
11432
11433
11434                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11435 echo "configure:11436: checking for thread specific errno" >&5
11436 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11437   echo $ac_n "(cached) $ac_c" 1>&6
11438 else
11439   
11440                 cat > conftest.$ac_ext <<EOF
11441 #line 11442 "configure"
11442 #include "confdefs.h"
11443 #include <errno.h>
11444 int main() {
11445 errno = 0;
11446 ; return 0; }
11447 EOF
11448 if { (eval echo configure:11449: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11449   rm -rf conftest*
11450   ol_cv_errno_thread_specific=yes
11451 else
11452   echo "configure: failed program was:" >&5
11453   cat conftest.$ac_ext >&5
11454   rm -rf conftest*
11455   ol_cv_errno_thread_specific=no
11456 fi
11457 rm -f conftest*
11458         
11459 fi
11460
11461 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11462
11463                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11464 echo "configure:11465: checking for thread specific h_errno" >&5
11465 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11466   echo $ac_n "(cached) $ac_c" 1>&6
11467 else
11468   
11469                 cat > conftest.$ac_ext <<EOF
11470 #line 11471 "configure"
11471 #include "confdefs.h"
11472 #include <netdb.h>
11473 int main() {
11474 h_errno = 0;
11475 ; return 0; }
11476 EOF
11477 if { (eval echo configure:11478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11478   rm -rf conftest*
11479   ol_cv_h_errno_thread_specific=yes
11480 else
11481   echo "configure: failed program was:" >&5
11482   cat conftest.$ac_ext >&5
11483   rm -rf conftest*
11484   ol_cv_h_errno_thread_specific=no
11485 fi
11486 rm -f conftest*
11487         
11488 fi
11489
11490 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11491
11492         if test $ol_cv_errno_thread_specific != yes \
11493                 -o $ol_cv_h_errno_thread_specific != yes ; then
11494                 LIBS="$LTHREAD_LIBS $LIBS"
11495                 LTHREAD_LIBS=""
11496         fi
11497
11498 fi  
11499
11500 if test $ol_link_threads = no ; then
11501         if test $ol_with_threads = yes ; then
11502                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11503         fi
11504
11505         if test $ol_with_threads = auto ; then
11506                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11507                 ol_with_threads=no
11508         fi
11509
11510         cat >> confdefs.h <<\EOF
11511 #define NO_THREADS 1
11512 EOF
11513
11514         LTHREAD_LIBS=""
11515 fi
11516
11517 if test $ol_link_threads != no ; then
11518         cat >> confdefs.h <<\EOF
11519 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11520 EOF
11521
11522 fi
11523
11524 ol_link_ldbm=no 
11525
11526 if test $ol_with_ldbm_api = auto \
11527         -o $ol_with_ldbm_api = berkeley \
11528         -o $ol_with_ldbm_api = bcompat ; then
11529
11530         if test $ol_with_ldbm_api = bcompat; then \
11531                 ol_cv_berkeley_db=no
11532 for ac_hdr in db_185.h db.h
11533 do
11534 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11535 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11536 echo "configure:11537: checking for $ac_hdr" >&5
11537 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11538   echo $ac_n "(cached) $ac_c" 1>&6
11539 else
11540   cat > conftest.$ac_ext <<EOF
11541 #line 11542 "configure"
11542 #include "confdefs.h"
11543 #include <$ac_hdr>
11544 EOF
11545 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11546 { (eval echo configure:11547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11547 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11548 if test -z "$ac_err"; then
11549   rm -rf conftest*
11550   eval "ac_cv_header_$ac_safe=yes"
11551 else
11552   echo "$ac_err" >&5
11553   echo "configure: failed program was:" >&5
11554   cat conftest.$ac_ext >&5
11555   rm -rf conftest*
11556   eval "ac_cv_header_$ac_safe=no"
11557 fi
11558 rm -f conftest*
11559 fi
11560 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11561   echo "$ac_t""yes" 1>&6
11562     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11563   cat >> confdefs.h <<EOF
11564 #define $ac_tr_hdr 1
11565 EOF
11566  
11567 else
11568   echo "$ac_t""no" 1>&6
11569 fi
11570 done
11571
11572 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11573         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11574 echo "configure:11575: checking if Berkeley DB header compatibility" >&5
11575 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11576   echo $ac_n "(cached) $ac_c" 1>&6
11577 else
11578   
11579                 cat > conftest.$ac_ext <<EOF
11580 #line 11581 "configure"
11581 #include "confdefs.h"
11582
11583 #if HAVE_DB_185_H
11584 #       include <db_185.h>
11585 #else
11586 #       include <db.h>
11587 #endif
11588
11589  /* this check could be improved */
11590 #ifndef DB_VERSION_MAJOR
11591 #       define DB_VERSION_MAJOR 1
11592 #endif
11593
11594 #if DB_VERSION_MAJOR == 1 
11595         __db_version_1
11596 #endif
11597
11598 EOF
11599 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11600   egrep "__db_version_1" >/dev/null 2>&1; then
11601   rm -rf conftest*
11602   ol_cv_header_db1=yes
11603 else
11604   rm -rf conftest*
11605   ol_cv_header_db1=no
11606 fi
11607 rm -f conftest*
11608
11609 fi
11610
11611 echo "$ac_t""$ol_cv_header_db1" 1>&6
11612
11613         if test ol_cv_header_db1=yes ; then
11614                 ol_cv_lib_db=no
11615 if test $ol_cv_lib_db = no ; then
11616         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11617 echo "configure:11618: checking for Berkeley DB link (default)" >&5
11618 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11619   echo $ac_n "(cached) $ac_c" 1>&6
11620 else
11621   
11622         ol_DB_LIB=
11623         ol_LIBS=$LIBS
11624         LIBS="$ol_DB_LIB $LIBS"
11625
11626         cat > conftest.$ac_ext <<EOF
11627 #line 11628 "configure"
11628 #include "confdefs.h"
11629
11630 #ifdef HAVE_DB_185_H
11631 # include <db_185.h>
11632 #else
11633 # include <db.h>
11634 #endif
11635
11636 #ifndef DB_VERSION_MAJOR
11637 # define DB_VERSION_MAJOR 1
11638 #endif
11639
11640 #ifndef NULL
11641 #define NULL ((void*)0)
11642 #endif
11643
11644 int main() {
11645
11646 #if DB_VERSION_MAJOR > 2
11647         db_env_create( NULL, 0 );
11648 #elif DB_VERSION_MAJOR > 1
11649         db_appexit( NULL );
11650 #else
11651         (void) dbopen( NULL, 0, 0, 0, NULL);
11652 #endif
11653
11654 ; return 0; }
11655 EOF
11656 if { (eval echo configure:11657: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11657   rm -rf conftest*
11658   ol_cv_db_none=yes
11659 else
11660   echo "configure: failed program was:" >&5
11661   cat conftest.$ac_ext >&5
11662   rm -rf conftest*
11663   ol_cv_db_none=no
11664 fi
11665 rm -f conftest*
11666
11667         LIBS="$ol_LIBS"
11668
11669 fi
11670
11671 echo "$ac_t""$ol_cv_db_none" 1>&6
11672
11673         if test $ol_cv_db_none = yes ; then
11674                 ol_cv_lib_db=yes
11675         fi
11676 fi
11677
11678 if test $ol_cv_lib_db = no ; then
11679         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11680 echo "configure:11681: checking for Berkeley DB link (-ldb)" >&5
11681 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11682   echo $ac_n "(cached) $ac_c" 1>&6
11683 else
11684   
11685         ol_DB_LIB=-ldb
11686         ol_LIBS=$LIBS
11687         LIBS="$ol_DB_LIB $LIBS"
11688
11689         cat > conftest.$ac_ext <<EOF
11690 #line 11691 "configure"
11691 #include "confdefs.h"
11692
11693 #ifdef HAVE_DB_185_H
11694 # include <db_185.h>
11695 #else
11696 # include <db.h>
11697 #endif
11698
11699 #ifndef DB_VERSION_MAJOR
11700 # define DB_VERSION_MAJOR 1
11701 #endif
11702
11703 #ifndef NULL
11704 #define NULL ((void*)0)
11705 #endif
11706
11707 int main() {
11708
11709 #if DB_VERSION_MAJOR > 2
11710         db_env_create( NULL, 0 );
11711 #elif DB_VERSION_MAJOR > 1
11712         db_appexit( NULL );
11713 #else
11714         (void) dbopen( NULL, 0, 0, 0, NULL);
11715 #endif
11716
11717 ; return 0; }
11718 EOF
11719 if { (eval echo configure:11720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11720   rm -rf conftest*
11721   ol_cv_db_db=yes
11722 else
11723   echo "configure: failed program was:" >&5
11724   cat conftest.$ac_ext >&5
11725   rm -rf conftest*
11726   ol_cv_db_db=no
11727 fi
11728 rm -f conftest*
11729
11730         LIBS="$ol_LIBS"
11731
11732 fi
11733
11734 echo "$ac_t""$ol_cv_db_db" 1>&6
11735
11736         if test $ol_cv_db_db = yes ; then
11737                 ol_cv_lib_db=-ldb
11738         fi
11739 fi
11740
11741 if test $ol_cv_lib_db = no ; then
11742         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11743 echo "configure:11744: checking for Berkeley DB link (-ldb3)" >&5
11744 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11745   echo $ac_n "(cached) $ac_c" 1>&6
11746 else
11747   
11748         ol_DB_LIB=-ldb3
11749         ol_LIBS=$LIBS
11750         LIBS="$ol_DB_LIB $LIBS"
11751
11752         cat > conftest.$ac_ext <<EOF
11753 #line 11754 "configure"
11754 #include "confdefs.h"
11755
11756 #ifdef HAVE_DB_185_H
11757 # include <db_185.h>
11758 #else
11759 # include <db.h>
11760 #endif
11761
11762 #ifndef DB_VERSION_MAJOR
11763 # define DB_VERSION_MAJOR 1
11764 #endif
11765
11766 #ifndef NULL
11767 #define NULL ((void*)0)
11768 #endif
11769
11770 int main() {
11771
11772 #if DB_VERSION_MAJOR > 2
11773         db_env_create( NULL, 0 );
11774 #elif DB_VERSION_MAJOR > 1
11775         db_appexit( NULL );
11776 #else
11777         (void) dbopen( NULL, 0, 0, 0, NULL);
11778 #endif
11779
11780 ; return 0; }
11781 EOF
11782 if { (eval echo configure:11783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11783   rm -rf conftest*
11784   ol_cv_db_db3=yes
11785 else
11786   echo "configure: failed program was:" >&5
11787   cat conftest.$ac_ext >&5
11788   rm -rf conftest*
11789   ol_cv_db_db3=no
11790 fi
11791 rm -f conftest*
11792
11793         LIBS="$ol_LIBS"
11794
11795 fi
11796
11797 echo "$ac_t""$ol_cv_db_db3" 1>&6
11798
11799         if test $ol_cv_db_db3 = yes ; then
11800                 ol_cv_lib_db=-ldb3
11801         fi
11802 fi
11803
11804 if test $ol_cv_lib_db = no ; then
11805         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11806 echo "configure:11807: checking for Berkeley DB link (-ldb2)" >&5
11807 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11808   echo $ac_n "(cached) $ac_c" 1>&6
11809 else
11810   
11811         ol_DB_LIB=-ldb2
11812         ol_LIBS=$LIBS
11813         LIBS="$ol_DB_LIB $LIBS"
11814
11815         cat > conftest.$ac_ext <<EOF
11816 #line 11817 "configure"
11817 #include "confdefs.h"
11818
11819 #ifdef HAVE_DB_185_H
11820 # include <db_185.h>
11821 #else
11822 # include <db.h>
11823 #endif
11824
11825 #ifndef DB_VERSION_MAJOR
11826 # define DB_VERSION_MAJOR 1
11827 #endif
11828
11829 #ifndef NULL
11830 #define NULL ((void*)0)
11831 #endif
11832
11833 int main() {
11834
11835 #if DB_VERSION_MAJOR > 2
11836         db_env_create( NULL, 0 );
11837 #elif DB_VERSION_MAJOR > 1
11838         db_appexit( NULL );
11839 #else
11840         (void) dbopen( NULL, 0, 0, 0, NULL);
11841 #endif
11842
11843 ; return 0; }
11844 EOF
11845 if { (eval echo configure:11846: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11846   rm -rf conftest*
11847   ol_cv_db_db2=yes
11848 else
11849   echo "configure: failed program was:" >&5
11850   cat conftest.$ac_ext >&5
11851   rm -rf conftest*
11852   ol_cv_db_db2=no
11853 fi
11854 rm -f conftest*
11855
11856         LIBS="$ol_LIBS"
11857
11858 fi
11859
11860 echo "$ac_t""$ol_cv_db_db2" 1>&6
11861
11862         if test $ol_cv_db_db2 = yes ; then
11863                 ol_cv_lib_db=-ldb2
11864         fi
11865 fi
11866
11867 if test $ol_cv_lib_db = no ; then
11868         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11869 echo "configure:11870: checking for Berkeley DB link (-ldb1)" >&5
11870 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11871   echo $ac_n "(cached) $ac_c" 1>&6
11872 else
11873   
11874         ol_DB_LIB=-ldb1
11875         ol_LIBS=$LIBS
11876         LIBS="$ol_DB_LIB $LIBS"
11877
11878         cat > conftest.$ac_ext <<EOF
11879 #line 11880 "configure"
11880 #include "confdefs.h"
11881
11882 #ifdef HAVE_DB_185_H
11883 # include <db_185.h>
11884 #else
11885 # include <db.h>
11886 #endif
11887
11888 #ifndef DB_VERSION_MAJOR
11889 # define DB_VERSION_MAJOR 1
11890 #endif
11891
11892 #ifndef NULL
11893 #define NULL ((void*)0)
11894 #endif
11895
11896 int main() {
11897
11898 #if DB_VERSION_MAJOR > 2
11899         db_env_create( NULL, 0 );
11900 #elif DB_VERSION_MAJOR > 1
11901         db_appexit( NULL );
11902 #else
11903         (void) dbopen( NULL, 0, 0, 0, NULL);
11904 #endif
11905
11906 ; return 0; }
11907 EOF
11908 if { (eval echo configure:11909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11909   rm -rf conftest*
11910   ol_cv_db_db1=yes
11911 else
11912   echo "configure: failed program was:" >&5
11913   cat conftest.$ac_ext >&5
11914   rm -rf conftest*
11915   ol_cv_db_db1=no
11916 fi
11917 rm -f conftest*
11918
11919         LIBS="$ol_LIBS"
11920
11921 fi
11922
11923 echo "$ac_t""$ol_cv_db_db1" 1>&6
11924
11925         if test $ol_cv_db_db1 = yes ; then
11926                 ol_cv_lib_db=-ldb1
11927         fi
11928 fi
11929
11930
11931                 if test "$ol_cv_lib_db" != no ; then
11932                         ol_cv_berkeley_db=yes
11933                 fi
11934         fi
11935 fi
11936
11937         else
11938                 ol_cv_berkeley_db=no
11939 for ac_hdr in db.h
11940 do
11941 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11942 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11943 echo "configure:11944: checking for $ac_hdr" >&5
11944 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11945   echo $ac_n "(cached) $ac_c" 1>&6
11946 else
11947   cat > conftest.$ac_ext <<EOF
11948 #line 11949 "configure"
11949 #include "confdefs.h"
11950 #include <$ac_hdr>
11951 EOF
11952 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11953 { (eval echo configure:11954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11954 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11955 if test -z "$ac_err"; then
11956   rm -rf conftest*
11957   eval "ac_cv_header_$ac_safe=yes"
11958 else
11959   echo "$ac_err" >&5
11960   echo "configure: failed program was:" >&5
11961   cat conftest.$ac_ext >&5
11962   rm -rf conftest*
11963   eval "ac_cv_header_$ac_safe=no"
11964 fi
11965 rm -f conftest*
11966 fi
11967 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11968   echo "$ac_t""yes" 1>&6
11969     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11970   cat >> confdefs.h <<EOF
11971 #define $ac_tr_hdr 1
11972 EOF
11973  
11974 else
11975   echo "$ac_t""no" 1>&6
11976 fi
11977 done
11978
11979 if test $ac_cv_header_db_h = yes; then
11980         ol_cv_lib_db=no
11981 if test $ol_cv_lib_db = no ; then
11982         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11983 echo "configure:11984: checking for Berkeley DB link (default)" >&5
11984 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11985   echo $ac_n "(cached) $ac_c" 1>&6
11986 else
11987   
11988         ol_DB_LIB=
11989         ol_LIBS=$LIBS
11990         LIBS="$ol_DB_LIB $LIBS"
11991
11992         cat > conftest.$ac_ext <<EOF
11993 #line 11994 "configure"
11994 #include "confdefs.h"
11995
11996 #ifdef HAVE_DB_185_H
11997 # include <db_185.h>
11998 #else
11999 # include <db.h>
12000 #endif
12001
12002 #ifndef DB_VERSION_MAJOR
12003 # define DB_VERSION_MAJOR 1
12004 #endif
12005
12006 #ifndef NULL
12007 #define NULL ((void*)0)
12008 #endif
12009
12010 int main() {
12011
12012 #if DB_VERSION_MAJOR > 2
12013         db_env_create( NULL, 0 );
12014 #elif DB_VERSION_MAJOR > 1
12015         db_appexit( NULL );
12016 #else
12017         (void) dbopen( NULL, 0, 0, 0, NULL);
12018 #endif
12019
12020 ; return 0; }
12021 EOF
12022 if { (eval echo configure:12023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12023   rm -rf conftest*
12024   ol_cv_db_none=yes
12025 else
12026   echo "configure: failed program was:" >&5
12027   cat conftest.$ac_ext >&5
12028   rm -rf conftest*
12029   ol_cv_db_none=no
12030 fi
12031 rm -f conftest*
12032
12033         LIBS="$ol_LIBS"
12034
12035 fi
12036
12037 echo "$ac_t""$ol_cv_db_none" 1>&6
12038
12039         if test $ol_cv_db_none = yes ; then
12040                 ol_cv_lib_db=yes
12041         fi
12042 fi
12043
12044 if test $ol_cv_lib_db = no ; then
12045         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
12046 echo "configure:12047: checking for Berkeley DB link (-ldb)" >&5
12047 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
12048   echo $ac_n "(cached) $ac_c" 1>&6
12049 else
12050   
12051         ol_DB_LIB=-ldb
12052         ol_LIBS=$LIBS
12053         LIBS="$ol_DB_LIB $LIBS"
12054
12055         cat > conftest.$ac_ext <<EOF
12056 #line 12057 "configure"
12057 #include "confdefs.h"
12058
12059 #ifdef HAVE_DB_185_H
12060 # include <db_185.h>
12061 #else
12062 # include <db.h>
12063 #endif
12064
12065 #ifndef DB_VERSION_MAJOR
12066 # define DB_VERSION_MAJOR 1
12067 #endif
12068
12069 #ifndef NULL
12070 #define NULL ((void*)0)
12071 #endif
12072
12073 int main() {
12074
12075 #if DB_VERSION_MAJOR > 2
12076         db_env_create( NULL, 0 );
12077 #elif DB_VERSION_MAJOR > 1
12078         db_appexit( NULL );
12079 #else
12080         (void) dbopen( NULL, 0, 0, 0, NULL);
12081 #endif
12082
12083 ; return 0; }
12084 EOF
12085 if { (eval echo configure:12086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12086   rm -rf conftest*
12087   ol_cv_db_db=yes
12088 else
12089   echo "configure: failed program was:" >&5
12090   cat conftest.$ac_ext >&5
12091   rm -rf conftest*
12092   ol_cv_db_db=no
12093 fi
12094 rm -f conftest*
12095
12096         LIBS="$ol_LIBS"
12097
12098 fi
12099
12100 echo "$ac_t""$ol_cv_db_db" 1>&6
12101
12102         if test $ol_cv_db_db = yes ; then
12103                 ol_cv_lib_db=-ldb
12104         fi
12105 fi
12106
12107 if test $ol_cv_lib_db = no ; then
12108         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12109 echo "configure:12110: checking for Berkeley DB link (-ldb3)" >&5
12110 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12111   echo $ac_n "(cached) $ac_c" 1>&6
12112 else
12113   
12114         ol_DB_LIB=-ldb3
12115         ol_LIBS=$LIBS
12116         LIBS="$ol_DB_LIB $LIBS"
12117
12118         cat > conftest.$ac_ext <<EOF
12119 #line 12120 "configure"
12120 #include "confdefs.h"
12121
12122 #ifdef HAVE_DB_185_H
12123 # include <db_185.h>
12124 #else
12125 # include <db.h>
12126 #endif
12127
12128 #ifndef DB_VERSION_MAJOR
12129 # define DB_VERSION_MAJOR 1
12130 #endif
12131
12132 #ifndef NULL
12133 #define NULL ((void*)0)
12134 #endif
12135
12136 int main() {
12137
12138 #if DB_VERSION_MAJOR > 2
12139         db_env_create( NULL, 0 );
12140 #elif DB_VERSION_MAJOR > 1
12141         db_appexit( NULL );
12142 #else
12143         (void) dbopen( NULL, 0, 0, 0, NULL);
12144 #endif
12145
12146 ; return 0; }
12147 EOF
12148 if { (eval echo configure:12149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12149   rm -rf conftest*
12150   ol_cv_db_db3=yes
12151 else
12152   echo "configure: failed program was:" >&5
12153   cat conftest.$ac_ext >&5
12154   rm -rf conftest*
12155   ol_cv_db_db3=no
12156 fi
12157 rm -f conftest*
12158
12159         LIBS="$ol_LIBS"
12160
12161 fi
12162
12163 echo "$ac_t""$ol_cv_db_db3" 1>&6
12164
12165         if test $ol_cv_db_db3 = yes ; then
12166                 ol_cv_lib_db=-ldb3
12167         fi
12168 fi
12169
12170 if test $ol_cv_lib_db = no ; then
12171         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12172 echo "configure:12173: checking for Berkeley DB link (-ldb2)" >&5
12173 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12174   echo $ac_n "(cached) $ac_c" 1>&6
12175 else
12176   
12177         ol_DB_LIB=-ldb2
12178         ol_LIBS=$LIBS
12179         LIBS="$ol_DB_LIB $LIBS"
12180
12181         cat > conftest.$ac_ext <<EOF
12182 #line 12183 "configure"
12183 #include "confdefs.h"
12184
12185 #ifdef HAVE_DB_185_H
12186 # include <db_185.h>
12187 #else
12188 # include <db.h>
12189 #endif
12190
12191 #ifndef DB_VERSION_MAJOR
12192 # define DB_VERSION_MAJOR 1
12193 #endif
12194
12195 #ifndef NULL
12196 #define NULL ((void*)0)
12197 #endif
12198
12199 int main() {
12200
12201 #if DB_VERSION_MAJOR > 2
12202         db_env_create( NULL, 0 );
12203 #elif DB_VERSION_MAJOR > 1
12204         db_appexit( NULL );
12205 #else
12206         (void) dbopen( NULL, 0, 0, 0, NULL);
12207 #endif
12208
12209 ; return 0; }
12210 EOF
12211 if { (eval echo configure:12212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12212   rm -rf conftest*
12213   ol_cv_db_db2=yes
12214 else
12215   echo "configure: failed program was:" >&5
12216   cat conftest.$ac_ext >&5
12217   rm -rf conftest*
12218   ol_cv_db_db2=no
12219 fi
12220 rm -f conftest*
12221
12222         LIBS="$ol_LIBS"
12223
12224 fi
12225
12226 echo "$ac_t""$ol_cv_db_db2" 1>&6
12227
12228         if test $ol_cv_db_db2 = yes ; then
12229                 ol_cv_lib_db=-ldb2
12230         fi
12231 fi
12232
12233 if test $ol_cv_lib_db = no ; then
12234         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12235 echo "configure:12236: checking for Berkeley DB link (-ldb1)" >&5
12236 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12237   echo $ac_n "(cached) $ac_c" 1>&6
12238 else
12239   
12240         ol_DB_LIB=-ldb1
12241         ol_LIBS=$LIBS
12242         LIBS="$ol_DB_LIB $LIBS"
12243
12244         cat > conftest.$ac_ext <<EOF
12245 #line 12246 "configure"
12246 #include "confdefs.h"
12247
12248 #ifdef HAVE_DB_185_H
12249 # include <db_185.h>
12250 #else
12251 # include <db.h>
12252 #endif
12253
12254 #ifndef DB_VERSION_MAJOR
12255 # define DB_VERSION_MAJOR 1
12256 #endif
12257
12258 #ifndef NULL
12259 #define NULL ((void*)0)
12260 #endif
12261
12262 int main() {
12263
12264 #if DB_VERSION_MAJOR > 2
12265         db_env_create( NULL, 0 );
12266 #elif DB_VERSION_MAJOR > 1
12267         db_appexit( NULL );
12268 #else
12269         (void) dbopen( NULL, 0, 0, 0, NULL);
12270 #endif
12271
12272 ; return 0; }
12273 EOF
12274 if { (eval echo configure:12275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12275   rm -rf conftest*
12276   ol_cv_db_db1=yes
12277 else
12278   echo "configure: failed program was:" >&5
12279   cat conftest.$ac_ext >&5
12280   rm -rf conftest*
12281   ol_cv_db_db1=no
12282 fi
12283 rm -f conftest*
12284
12285         LIBS="$ol_LIBS"
12286
12287 fi
12288
12289 echo "$ac_t""$ol_cv_db_db1" 1>&6
12290
12291         if test $ol_cv_db_db1 = yes ; then
12292                 ol_cv_lib_db=-ldb1
12293         fi
12294 fi
12295
12296
12297         if test "$ol_cv_lib_db" != no ; then
12298                 ol_cv_berkeley_db=yes
12299                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12300 echo "configure:12301: checking for Berkeley DB thread support" >&5
12301 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12302   echo $ac_n "(cached) $ac_c" 1>&6
12303 else
12304   
12305         ol_LIBS="$LIBS"
12306         if test $ol_cv_lib_db != yes ; then
12307                 LIBS="$ol_cv_lib_db"
12308         fi
12309
12310         if test "$cross_compiling" = yes; then
12311   ol_cv_berkeley_db_thread=cross
12312 else
12313   cat > conftest.$ac_ext <<EOF
12314 #line 12315 "configure"
12315 #include "confdefs.h"
12316
12317 #ifdef HAVE_DB_185_H
12318         choke me;
12319 #else
12320 #include <db.h>
12321 #endif
12322 #ifndef NULL
12323 #define NULL ((void *)0)
12324 #endif
12325 main()
12326 {
12327         int rc;
12328         u_int32_t flags = DB_CREATE | DB_THREAD;
12329
12330 #if DB_VERSION_MAJOR > 2
12331         DB_ENV *env = NULL;
12332
12333         rc = db_env_create( &env, 0 );
12334
12335         if( rc == 0 ) {
12336 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12337                 rc = env->open( env, NULL, flags, 0 );
12338 #else
12339                 rc = env->open( env, NULL, NULL, flags, 0 );
12340 #endif
12341         }
12342
12343 #else
12344         DB_ENV env;
12345         memset( &env, '\0', sizeof(env) );
12346
12347         rc = db_appinit( NULL, NULL, &env, flags );
12348
12349         if( rc == 0 ) {
12350                 db_appexit( &env );
12351         }
12352 #endif
12353 #if DB_VERSION_MAJOR > 2
12354 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12355         env->remove( env, NULL, DB_FORCE);
12356 #else
12357         env->remove( env, NULL, NULL, DB_FORCE);
12358 #endif
12359 #endif
12360
12361         return rc;
12362 }
12363 EOF
12364 if { (eval echo configure:12365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12365 then
12366   ol_cv_berkeley_db_thread=yes
12367 else
12368   echo "configure: failed program was:" >&5
12369   cat conftest.$ac_ext >&5
12370   rm -fr conftest*
12371   ol_cv_berkeley_db_thread=no
12372 fi
12373 rm -fr conftest*
12374 fi
12375
12376
12377         LIBS="$ol_LIBS"
12378
12379         if test $ol_cv_berkeley_db_thread != no ; then
12380                 cat >> confdefs.h <<\EOF
12381 #define HAVE_BERKELEY_DB_THREAD 1
12382 EOF
12383
12384         fi
12385
12386 fi
12387
12388 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12389         fi
12390 fi
12391
12392         fi
12393
12394         if test $ol_cv_berkeley_db != no ; then
12395                 cat >> confdefs.h <<\EOF
12396 #define HAVE_BERKELEY_DB 1
12397 EOF
12398
12399
12400                 ol_link_ldbm=berkeley
12401                 ol_with_ldbm_api=db
12402
12403                 if test $ol_with_ldbm_type = hash ; then
12404                         cat >> confdefs.h <<\EOF
12405 #define LDBM_USE_DBHASH 1
12406 EOF
12407
12408                 else
12409                         cat >> confdefs.h <<\EOF
12410 #define LDBM_USE_DBBTREE 1
12411 EOF
12412
12413                 fi
12414
12415                                                 if test $ol_cv_lib_db != yes ; then
12416                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12417                 fi
12418         fi
12419 fi
12420
12421 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12422         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12423         ol_with_ldbm_api=none
12424 fi
12425
12426 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12427         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12428 echo "configure:12429: checking for MDBM library" >&5
12429 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12430   echo $ac_n "(cached) $ac_c" 1>&6
12431 else
12432         ol_LIBS="$LIBS"
12433         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12434 echo "configure:12435: checking for mdbm_set_chain" >&5
12435 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12436   echo $ac_n "(cached) $ac_c" 1>&6
12437 else
12438   cat > conftest.$ac_ext <<EOF
12439 #line 12440 "configure"
12440 #include "confdefs.h"
12441 /* System header to define __stub macros and hopefully few prototypes,
12442     which can conflict with char mdbm_set_chain(); below.  */
12443 #include <assert.h>
12444 /* Override any gcc2 internal prototype to avoid an error.  */
12445 /* We use char because int might match the return type of a gcc2
12446     builtin and then its argument prototype would still apply.  */
12447 char mdbm_set_chain();
12448 char (*f)();
12449
12450 int main() {
12451
12452 /* The GNU C library defines this for functions which it implements
12453     to always fail with ENOSYS.  Some functions are actually named
12454     something starting with __ and the normal name is an alias.  */
12455 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12456 choke me
12457 #else
12458 f = mdbm_set_chain;
12459 #endif
12460
12461 ; return 0; }
12462 EOF
12463 if { (eval echo configure:12464: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12464   rm -rf conftest*
12465   eval "ac_cv_func_mdbm_set_chain=yes"
12466 else
12467   echo "configure: failed program was:" >&5
12468   cat conftest.$ac_ext >&5
12469   rm -rf conftest*
12470   eval "ac_cv_func_mdbm_set_chain=no"
12471 fi
12472 rm -f conftest*
12473 fi
12474
12475 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12476   echo "$ac_t""yes" 1>&6
12477   ol_cv_lib_mdbm=yes
12478 else
12479   echo "$ac_t""no" 1>&6
12480
12481                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12482 echo "configure:12483: checking for mdbm_set_chain in -lmdbm" >&5
12483 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12484 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12485   echo $ac_n "(cached) $ac_c" 1>&6
12486 else
12487   ac_save_LIBS="$LIBS"
12488 LIBS="-lmdbm  $LIBS"
12489 cat > conftest.$ac_ext <<EOF
12490 #line 12491 "configure"
12491 #include "confdefs.h"
12492 /* Override any gcc2 internal prototype to avoid an error.  */
12493 /* We use char because int might match the return type of a gcc2
12494     builtin and then its argument prototype would still apply.  */
12495 char mdbm_set_chain();
12496
12497 int main() {
12498 mdbm_set_chain()
12499 ; return 0; }
12500 EOF
12501 if { (eval echo configure:12502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12502   rm -rf conftest*
12503   eval "ac_cv_lib_$ac_lib_var=yes"
12504 else
12505   echo "configure: failed program was:" >&5
12506   cat conftest.$ac_ext >&5
12507   rm -rf conftest*
12508   eval "ac_cv_lib_$ac_lib_var=no"
12509 fi
12510 rm -f conftest*
12511 LIBS="$ac_save_LIBS"
12512
12513 fi
12514 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12515   echo "$ac_t""yes" 1>&6
12516   ol_cv_lib_mdbm=-lmdbm
12517 else
12518   echo "$ac_t""no" 1>&6
12519 ol_cv_lib_mdbm=no
12520 fi
12521
12522         
12523 fi
12524
12525         LIBS="$ol_LIBS"
12526
12527 fi
12528
12529 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12530
12531
12532  for ac_hdr in mdbm.h
12533 do
12534 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12535 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12536 echo "configure:12537: checking for $ac_hdr" >&5
12537 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12538   echo $ac_n "(cached) $ac_c" 1>&6
12539 else
12540   cat > conftest.$ac_ext <<EOF
12541 #line 12542 "configure"
12542 #include "confdefs.h"
12543 #include <$ac_hdr>
12544 EOF
12545 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12546 { (eval echo configure:12547: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12547 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12548 if test -z "$ac_err"; then
12549   rm -rf conftest*
12550   eval "ac_cv_header_$ac_safe=yes"
12551 else
12552   echo "$ac_err" >&5
12553   echo "configure: failed program was:" >&5
12554   cat conftest.$ac_ext >&5
12555   rm -rf conftest*
12556   eval "ac_cv_header_$ac_safe=no"
12557 fi
12558 rm -f conftest*
12559 fi
12560 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12561   echo "$ac_t""yes" 1>&6
12562     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12563   cat >> confdefs.h <<EOF
12564 #define $ac_tr_hdr 1
12565 EOF
12566  
12567 else
12568   echo "$ac_t""no" 1>&6
12569 fi
12570 done
12571
12572  echo $ac_n "checking for db""... $ac_c" 1>&6
12573 echo "configure:12574: checking for db" >&5
12574 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12575   echo $ac_n "(cached) $ac_c" 1>&6
12576 else
12577   
12578         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12579                 ol_cv_mdbm=no
12580         else
12581                 ol_cv_mdbm=yes
12582         fi
12583
12584 fi
12585
12586 echo "$ac_t""$ol_cv_mdbm" 1>&6
12587  if test $ol_cv_mdbm = yes ; then
12588         cat >> confdefs.h <<\EOF
12589 #define HAVE_MDBM 1
12590 EOF
12591
12592  fi
12593
12594
12595         if test $ol_cv_mdbm = yes ; then
12596                 ol_link_ldbm=mdbm
12597                 ol_with_ldbm_api=mdbm
12598                 if test $ol_cv_lib_mdbm != yes ; then
12599                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
12600                 fi
12601         fi
12602 fi
12603
12604 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
12605         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
12606 echo "configure:12607: checking for GDBM library" >&5
12607 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
12608   echo $ac_n "(cached) $ac_c" 1>&6
12609 else
12610         ol_LIBS="$LIBS"
12611         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
12612 echo "configure:12613: checking for gdbm_open" >&5
12613 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
12614   echo $ac_n "(cached) $ac_c" 1>&6
12615 else
12616   cat > conftest.$ac_ext <<EOF
12617 #line 12618 "configure"
12618 #include "confdefs.h"
12619 /* System header to define __stub macros and hopefully few prototypes,
12620     which can conflict with char gdbm_open(); below.  */
12621 #include <assert.h>
12622 /* Override any gcc2 internal prototype to avoid an error.  */
12623 /* We use char because int might match the return type of a gcc2
12624     builtin and then its argument prototype would still apply.  */
12625 char gdbm_open();
12626 char (*f)();
12627
12628 int main() {
12629
12630 /* The GNU C library defines this for functions which it implements
12631     to always fail with ENOSYS.  Some functions are actually named
12632     something starting with __ and the normal name is an alias.  */
12633 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
12634 choke me
12635 #else
12636 f = gdbm_open;
12637 #endif
12638
12639 ; return 0; }
12640 EOF
12641 if { (eval echo configure:12642: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12642   rm -rf conftest*
12643   eval "ac_cv_func_gdbm_open=yes"
12644 else
12645   echo "configure: failed program was:" >&5
12646   cat conftest.$ac_ext >&5
12647   rm -rf conftest*
12648   eval "ac_cv_func_gdbm_open=no"
12649 fi
12650 rm -f conftest*
12651 fi
12652
12653 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
12654   echo "$ac_t""yes" 1>&6
12655   ol_cv_lib_gdbm=yes
12656 else
12657   echo "$ac_t""no" 1>&6
12658
12659                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
12660 echo "configure:12661: checking for gdbm_open in -lgdbm" >&5
12661 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
12662 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12663   echo $ac_n "(cached) $ac_c" 1>&6
12664 else
12665   ac_save_LIBS="$LIBS"
12666 LIBS="-lgdbm  $LIBS"
12667 cat > conftest.$ac_ext <<EOF
12668 #line 12669 "configure"
12669 #include "confdefs.h"
12670 /* Override any gcc2 internal prototype to avoid an error.  */
12671 /* We use char because int might match the return type of a gcc2
12672     builtin and then its argument prototype would still apply.  */
12673 char gdbm_open();
12674
12675 int main() {
12676 gdbm_open()
12677 ; return 0; }
12678 EOF
12679 if { (eval echo configure:12680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12680   rm -rf conftest*
12681   eval "ac_cv_lib_$ac_lib_var=yes"
12682 else
12683   echo "configure: failed program was:" >&5
12684   cat conftest.$ac_ext >&5
12685   rm -rf conftest*
12686   eval "ac_cv_lib_$ac_lib_var=no"
12687 fi
12688 rm -f conftest*
12689 LIBS="$ac_save_LIBS"
12690
12691 fi
12692 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12693   echo "$ac_t""yes" 1>&6
12694   ol_cv_lib_gdbm=-lgdbm
12695 else
12696   echo "$ac_t""no" 1>&6
12697 ol_cv_lib_gdbm=no
12698 fi
12699
12700         
12701 fi
12702
12703         LIBS="$ol_LIBS"
12704
12705 fi
12706
12707 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
12708
12709
12710  for ac_hdr in gdbm.h
12711 do
12712 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12713 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12714 echo "configure:12715: checking for $ac_hdr" >&5
12715 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12716   echo $ac_n "(cached) $ac_c" 1>&6
12717 else
12718   cat > conftest.$ac_ext <<EOF
12719 #line 12720 "configure"
12720 #include "confdefs.h"
12721 #include <$ac_hdr>
12722 EOF
12723 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12724 { (eval echo configure:12725: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12725 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12726 if test -z "$ac_err"; then
12727   rm -rf conftest*
12728   eval "ac_cv_header_$ac_safe=yes"
12729 else
12730   echo "$ac_err" >&5
12731   echo "configure: failed program was:" >&5
12732   cat conftest.$ac_ext >&5
12733   rm -rf conftest*
12734   eval "ac_cv_header_$ac_safe=no"
12735 fi
12736 rm -f conftest*
12737 fi
12738 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12739   echo "$ac_t""yes" 1>&6
12740     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12741   cat >> confdefs.h <<EOF
12742 #define $ac_tr_hdr 1
12743 EOF
12744  
12745 else
12746   echo "$ac_t""no" 1>&6
12747 fi
12748 done
12749
12750  echo $ac_n "checking for db""... $ac_c" 1>&6
12751 echo "configure:12752: checking for db" >&5
12752 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
12753   echo $ac_n "(cached) $ac_c" 1>&6
12754 else
12755   
12756         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
12757                 ol_cv_gdbm=no
12758         else
12759                 ol_cv_gdbm=yes
12760         fi
12761
12762 fi
12763
12764 echo "$ac_t""$ol_cv_gdbm" 1>&6
12765  if test $ol_cv_gdbm = yes ; then
12766         cat >> confdefs.h <<\EOF
12767 #define HAVE_GDBM 1
12768 EOF
12769
12770  fi
12771
12772
12773         if test $ol_cv_gdbm = yes ; then
12774                 ol_link_ldbm=gdbm
12775                 ol_with_ldbm_api=gdbm
12776
12777                 if test $ol_cv_lib_gdbm != yes ; then
12778                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
12779                 fi
12780         fi
12781 fi
12782
12783 if test $ol_with_ldbm_api = ndbm ; then
12784         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
12785 echo "configure:12786: checking for NDBM library" >&5
12786 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
12787   echo $ac_n "(cached) $ac_c" 1>&6
12788 else
12789         ol_LIBS="$LIBS"
12790         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12791 echo "configure:12792: checking for dbm_open" >&5
12792 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
12793   echo $ac_n "(cached) $ac_c" 1>&6
12794 else
12795   cat > conftest.$ac_ext <<EOF
12796 #line 12797 "configure"
12797 #include "confdefs.h"
12798 /* System header to define __stub macros and hopefully few prototypes,
12799     which can conflict with char dbm_open(); below.  */
12800 #include <assert.h>
12801 /* Override any gcc2 internal prototype to avoid an error.  */
12802 /* We use char because int might match the return type of a gcc2
12803     builtin and then its argument prototype would still apply.  */
12804 char dbm_open();
12805 char (*f)();
12806
12807 int main() {
12808
12809 /* The GNU C library defines this for functions which it implements
12810     to always fail with ENOSYS.  Some functions are actually named
12811     something starting with __ and the normal name is an alias.  */
12812 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12813 choke me
12814 #else
12815 f = dbm_open;
12816 #endif
12817
12818 ; return 0; }
12819 EOF
12820 if { (eval echo configure:12821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12821   rm -rf conftest*
12822   eval "ac_cv_func_dbm_open=yes"
12823 else
12824   echo "configure: failed program was:" >&5
12825   cat conftest.$ac_ext >&5
12826   rm -rf conftest*
12827   eval "ac_cv_func_dbm_open=no"
12828 fi
12829 rm -f conftest*
12830 fi
12831
12832 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12833   echo "$ac_t""yes" 1>&6
12834   ol_cv_lib_ndbm=yes
12835 else
12836   echo "$ac_t""no" 1>&6
12837
12838                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
12839 echo "configure:12840: checking for dbm_open in -lndbm" >&5
12840 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12841 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12842   echo $ac_n "(cached) $ac_c" 1>&6
12843 else
12844   ac_save_LIBS="$LIBS"
12845 LIBS="-lndbm  $LIBS"
12846 cat > conftest.$ac_ext <<EOF
12847 #line 12848 "configure"
12848 #include "confdefs.h"
12849 /* Override any gcc2 internal prototype to avoid an error.  */
12850 /* We use char because int might match the return type of a gcc2
12851     builtin and then its argument prototype would still apply.  */
12852 char dbm_open();
12853
12854 int main() {
12855 dbm_open()
12856 ; return 0; }
12857 EOF
12858 if { (eval echo configure:12859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12859   rm -rf conftest*
12860   eval "ac_cv_lib_$ac_lib_var=yes"
12861 else
12862   echo "configure: failed program was:" >&5
12863   cat conftest.$ac_ext >&5
12864   rm -rf conftest*
12865   eval "ac_cv_lib_$ac_lib_var=no"
12866 fi
12867 rm -f conftest*
12868 LIBS="$ac_save_LIBS"
12869
12870 fi
12871 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12872   echo "$ac_t""yes" 1>&6
12873   ol_cv_lib_ndbm=-lndbm
12874 else
12875   echo "$ac_t""no" 1>&6
12876
12877                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12878 echo "configure:12879: checking for dbm_open in -ldbm" >&5
12879 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12880 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12881   echo $ac_n "(cached) $ac_c" 1>&6
12882 else
12883   ac_save_LIBS="$LIBS"
12884 LIBS="-ldbm  $LIBS"
12885 cat > conftest.$ac_ext <<EOF
12886 #line 12887 "configure"
12887 #include "confdefs.h"
12888 /* Override any gcc2 internal prototype to avoid an error.  */
12889 /* We use char because int might match the return type of a gcc2
12890     builtin and then its argument prototype would still apply.  */
12891 char dbm_open();
12892
12893 int main() {
12894 dbm_open()
12895 ; return 0; }
12896 EOF
12897 if { (eval echo configure:12898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12898   rm -rf conftest*
12899   eval "ac_cv_lib_$ac_lib_var=yes"
12900 else
12901   echo "configure: failed program was:" >&5
12902   cat conftest.$ac_ext >&5
12903   rm -rf conftest*
12904   eval "ac_cv_lib_$ac_lib_var=no"
12905 fi
12906 rm -f conftest*
12907 LIBS="$ac_save_LIBS"
12908
12909 fi
12910 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12911   echo "$ac_t""yes" 1>&6
12912   ol_cv_lib_ndbm=-ldbm
12913 else
12914   echo "$ac_t""no" 1>&6
12915 ol_cv_lib_ndbm=no
12916 fi
12917                 
12918 fi
12919
12920         
12921 fi
12922
12923         LIBS="$ol_LIBS"
12924
12925 fi
12926
12927 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
12928
12929
12930  for ac_hdr in ndbm.h
12931 do
12932 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12933 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12934 echo "configure:12935: checking for $ac_hdr" >&5
12935 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12936   echo $ac_n "(cached) $ac_c" 1>&6
12937 else
12938   cat > conftest.$ac_ext <<EOF
12939 #line 12940 "configure"
12940 #include "confdefs.h"
12941 #include <$ac_hdr>
12942 EOF
12943 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12944 { (eval echo configure:12945: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12945 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12946 if test -z "$ac_err"; then
12947   rm -rf conftest*
12948   eval "ac_cv_header_$ac_safe=yes"
12949 else
12950   echo "$ac_err" >&5
12951   echo "configure: failed program was:" >&5
12952   cat conftest.$ac_ext >&5
12953   rm -rf conftest*
12954   eval "ac_cv_header_$ac_safe=no"
12955 fi
12956 rm -f conftest*
12957 fi
12958 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12959   echo "$ac_t""yes" 1>&6
12960     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12961   cat >> confdefs.h <<EOF
12962 #define $ac_tr_hdr 1
12963 EOF
12964  
12965 else
12966   echo "$ac_t""no" 1>&6
12967 fi
12968 done
12969
12970  echo $ac_n "checking for db""... $ac_c" 1>&6
12971 echo "configure:12972: checking for db" >&5
12972 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
12973   echo $ac_n "(cached) $ac_c" 1>&6
12974 else
12975   
12976         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
12977                 ol_cv_ndbm=no
12978         else
12979                 ol_cv_ndbm=yes
12980         fi
12981
12982 fi
12983
12984 echo "$ac_t""$ol_cv_ndbm" 1>&6
12985  if test $ol_cv_ndbm = yes ; then
12986         cat >> confdefs.h <<\EOF
12987 #define HAVE_NDBM 1
12988 EOF
12989
12990  fi
12991
12992
12993         if test $ol_cv_ndbm = yes ; then
12994                 ol_link_ldbm=ndbm
12995                 ol_with_ldbm_api=ndbm
12996
12997                 if test $ol_cv_lib_ndbm != yes ; then
12998                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
12999                 fi
13000         fi
13001 fi
13002
13003 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
13004         echo "configure: warning: could not find suitable LDBM backend" 1>&2
13005         if test $ol_enable_ldbm = yes ; then
13006                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
13007         fi
13008
13009         echo "configure: warning: disabling LDBM" 1>&2
13010         ol_enable_ldbm=no
13011 fi
13012
13013 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
13014         LINK_BINS_DYNAMIC="yes"
13015 else
13016         LINK_BINS_DYNAMIC="no"
13017 fi
13018
13019 if test $ol_enable_wrappers != no ; then
13020         for ac_hdr in tcpd.h
13021 do
13022 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13023 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13024 echo "configure:13025: checking for $ac_hdr" >&5
13025 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13026   echo $ac_n "(cached) $ac_c" 1>&6
13027 else
13028   cat > conftest.$ac_ext <<EOF
13029 #line 13030 "configure"
13030 #include "confdefs.h"
13031 #include <$ac_hdr>
13032 EOF
13033 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13034 { (eval echo configure:13035: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13035 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13036 if test -z "$ac_err"; then
13037   rm -rf conftest*
13038   eval "ac_cv_header_$ac_safe=yes"
13039 else
13040   echo "$ac_err" >&5
13041   echo "configure: failed program was:" >&5
13042   cat conftest.$ac_ext >&5
13043   rm -rf conftest*
13044   eval "ac_cv_header_$ac_safe=no"
13045 fi
13046 rm -f conftest*
13047 fi
13048 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13049   echo "$ac_t""yes" 1>&6
13050     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13051   cat >> confdefs.h <<EOF
13052 #define $ac_tr_hdr 1
13053 EOF
13054  
13055 else
13056   echo "$ac_t""no" 1>&6
13057 fi
13058 done
13059
13060
13061         if test $ac_cv_header_tcpd_h != yes ; then
13062                 have_wrappers=no
13063         else
13064                 cat > conftest.$ac_ext <<EOF
13065 #line 13066 "configure"
13066 #include "confdefs.h"
13067
13068 int allow_severity = 0;
13069 int deny_severity  = 0;
13070                 
13071 int main() {
13072 hosts_access()
13073 ; return 0; }
13074 EOF
13075 if { (eval echo configure:13076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13076   rm -rf conftest*
13077   have_wrappers=yes
13078 else
13079   echo "configure: failed program was:" >&5
13080   cat conftest.$ac_ext >&5
13081   rm -rf conftest*
13082   have_wrappers=no
13083 fi
13084 rm -f conftest*
13085         fi
13086
13087         if test $have_wrappers = yes ; then
13088                 cat >> confdefs.h <<\EOF
13089 #define HAVE_TCPD 1
13090 EOF
13091
13092                 WRAP_LIBS="-lwrap"
13093
13094                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
13095 echo "configure:13096: checking for main in -lnsl" >&5
13096 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
13097 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13098   echo $ac_n "(cached) $ac_c" 1>&6
13099 else
13100   ac_save_LIBS="$LIBS"
13101 LIBS="-lnsl  $LIBS"
13102 cat > conftest.$ac_ext <<EOF
13103 #line 13104 "configure"
13104 #include "confdefs.h"
13105
13106 int main() {
13107 main()
13108 ; return 0; }
13109 EOF
13110 if { (eval echo configure:13111: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13111   rm -rf conftest*
13112   eval "ac_cv_lib_$ac_lib_var=yes"
13113 else
13114   echo "configure: failed program was:" >&5
13115   cat conftest.$ac_ext >&5
13116   rm -rf conftest*
13117   eval "ac_cv_lib_$ac_lib_var=no"
13118 fi
13119 rm -f conftest*
13120 LIBS="$ac_save_LIBS"
13121
13122 fi
13123 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13124   echo "$ac_t""yes" 1>&6
13125     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
13126     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
13127   cat >> confdefs.h <<EOF
13128 #define $ac_tr_lib 1
13129 EOF
13130
13131   LIBS="-lnsl $LIBS"
13132
13133 else
13134   echo "$ac_t""no" 1>&6
13135 fi
13136
13137         else
13138                 echo "configure: warning: could not find -lwrap" 1>&2
13139                 if test $ol_enable_wrappers = yes ; then
13140                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
13141                 fi
13142
13143                 echo "configure: warning: disabling wrappers support" 1>&2
13144                 ol_enable_wrappers=no
13145                 WRAP_LIBS=""
13146         fi
13147 fi
13148
13149 if test $ol_enable_syslog != no ; then
13150         echo $ac_n "checking for openlog""... $ac_c" 1>&6
13151 echo "configure:13152: checking for openlog" >&5
13152 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
13153   echo $ac_n "(cached) $ac_c" 1>&6
13154 else
13155   cat > conftest.$ac_ext <<EOF
13156 #line 13157 "configure"
13157 #include "confdefs.h"
13158 /* System header to define __stub macros and hopefully few prototypes,
13159     which can conflict with char openlog(); below.  */
13160 #include <assert.h>
13161 /* Override any gcc2 internal prototype to avoid an error.  */
13162 /* We use char because int might match the return type of a gcc2
13163     builtin and then its argument prototype would still apply.  */
13164 char openlog();
13165 char (*f)();
13166
13167 int main() {
13168
13169 /* The GNU C library defines this for functions which it implements
13170     to always fail with ENOSYS.  Some functions are actually named
13171     something starting with __ and the normal name is an alias.  */
13172 #if defined (__stub_openlog) || defined (__stub___openlog)
13173 choke me
13174 #else
13175 f = openlog;
13176 #endif
13177
13178 ; return 0; }
13179 EOF
13180 if { (eval echo configure:13181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13181   rm -rf conftest*
13182   eval "ac_cv_func_openlog=yes"
13183 else
13184   echo "configure: failed program was:" >&5
13185   cat conftest.$ac_ext >&5
13186   rm -rf conftest*
13187   eval "ac_cv_func_openlog=no"
13188 fi
13189 rm -f conftest*
13190 fi
13191
13192 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
13193   echo "$ac_t""yes" 1>&6
13194   :
13195 else
13196   echo "$ac_t""no" 1>&6
13197 fi
13198
13199         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
13200                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
13201         fi
13202         ol_enable_syslog=$ac_cv_func_openlog
13203 fi
13204
13205 ol_link_sql=no
13206 if test $ol_enable_sql != no ; then
13207         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
13208 echo "configure:13209: checking for SQLDriverConnect in -liodbc" >&5
13209 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13210 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13211   echo $ac_n "(cached) $ac_c" 1>&6
13212 else
13213   ac_save_LIBS="$LIBS"
13214 LIBS="-liodbc  $LIBS"
13215 cat > conftest.$ac_ext <<EOF
13216 #line 13217 "configure"
13217 #include "confdefs.h"
13218 /* Override any gcc2 internal prototype to avoid an error.  */
13219 /* We use char because int might match the return type of a gcc2
13220     builtin and then its argument prototype would still apply.  */
13221 char SQLDriverConnect();
13222
13223 int main() {
13224 SQLDriverConnect()
13225 ; return 0; }
13226 EOF
13227 if { (eval echo configure:13228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13228   rm -rf conftest*
13229   eval "ac_cv_lib_$ac_lib_var=yes"
13230 else
13231   echo "configure: failed program was:" >&5
13232   cat conftest.$ac_ext >&5
13233   rm -rf conftest*
13234   eval "ac_cv_lib_$ac_lib_var=no"
13235 fi
13236 rm -f conftest*
13237 LIBS="$ac_save_LIBS"
13238
13239 fi
13240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13241   echo "$ac_t""yes" 1>&6
13242   have_iodbc=yes
13243 else
13244   echo "$ac_t""no" 1>&6
13245 have_iodbc=no
13246 fi
13247
13248         if test $have_iodbc = yes ; then
13249                 ol_link_sql="-liodbc"
13250         else
13251                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
13252 echo "configure:13253: checking for SQLDriverConnect in -lodbc" >&5
13253 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13254 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13255   echo $ac_n "(cached) $ac_c" 1>&6
13256 else
13257   ac_save_LIBS="$LIBS"
13258 LIBS="-lodbc  $LIBS"
13259 cat > conftest.$ac_ext <<EOF
13260 #line 13261 "configure"
13261 #include "confdefs.h"
13262 /* Override any gcc2 internal prototype to avoid an error.  */
13263 /* We use char because int might match the return type of a gcc2
13264     builtin and then its argument prototype would still apply.  */
13265 char SQLDriverConnect();
13266
13267 int main() {
13268 SQLDriverConnect()
13269 ; return 0; }
13270 EOF
13271 if { (eval echo configure:13272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13272   rm -rf conftest*
13273   eval "ac_cv_lib_$ac_lib_var=yes"
13274 else
13275   echo "configure: failed program was:" >&5
13276   cat conftest.$ac_ext >&5
13277   rm -rf conftest*
13278   eval "ac_cv_lib_$ac_lib_var=no"
13279 fi
13280 rm -f conftest*
13281 LIBS="$ac_save_LIBS"
13282
13283 fi
13284 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13285   echo "$ac_t""yes" 1>&6
13286   have_odbc=yes
13287 else
13288   echo "$ac_t""no" 1>&6
13289 have_odbc=no
13290 fi
13291
13292                 if test $have_odbc = yes ; then
13293                         ol_link_sql="-lodbc"
13294                 fi
13295         fi
13296
13297         if test $ol_link_sql != no ; then
13298                 SLAPD_SQL_LIBS="$ol_link_sql"
13299
13300         elif test $ol_enable_sql != auto ; then
13301                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
13302         fi
13303 fi
13304
13305 ol_link_termcap=no
13306 for ac_hdr in termcap.h ncurses.h
13307 do
13308 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13309 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13310 echo "configure:13311: checking for $ac_hdr" >&5
13311 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13312   echo $ac_n "(cached) $ac_c" 1>&6
13313 else
13314   cat > conftest.$ac_ext <<EOF
13315 #line 13316 "configure"
13316 #include "confdefs.h"
13317 #include <$ac_hdr>
13318 EOF
13319 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13320 { (eval echo configure:13321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13321 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13322 if test -z "$ac_err"; then
13323   rm -rf conftest*
13324   eval "ac_cv_header_$ac_safe=yes"
13325 else
13326   echo "$ac_err" >&5
13327   echo "configure: failed program was:" >&5
13328   cat conftest.$ac_ext >&5
13329   rm -rf conftest*
13330   eval "ac_cv_header_$ac_safe=no"
13331 fi
13332 rm -f conftest*
13333 fi
13334 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13335   echo "$ac_t""yes" 1>&6
13336     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13337   cat >> confdefs.h <<EOF
13338 #define $ac_tr_hdr 1
13339 EOF
13340  
13341 else
13342   echo "$ac_t""no" 1>&6
13343 fi
13344 done
13345
13346
13347 if test $ol_link_termcap = no ; then
13348         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
13349 echo "configure:13350: checking for tputs in -ltermcap" >&5
13350 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
13351 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13352   echo $ac_n "(cached) $ac_c" 1>&6
13353 else
13354   ac_save_LIBS="$LIBS"
13355 LIBS="-ltermcap  $LIBS"
13356 cat > conftest.$ac_ext <<EOF
13357 #line 13358 "configure"
13358 #include "confdefs.h"
13359 /* Override any gcc2 internal prototype to avoid an error.  */
13360 /* We use char because int might match the return type of a gcc2
13361     builtin and then its argument prototype would still apply.  */
13362 char tputs();
13363
13364 int main() {
13365 tputs()
13366 ; return 0; }
13367 EOF
13368 if { (eval echo configure:13369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13369   rm -rf conftest*
13370   eval "ac_cv_lib_$ac_lib_var=yes"
13371 else
13372   echo "configure: failed program was:" >&5
13373   cat conftest.$ac_ext >&5
13374   rm -rf conftest*
13375   eval "ac_cv_lib_$ac_lib_var=no"
13376 fi
13377 rm -f conftest*
13378 LIBS="$ac_save_LIBS"
13379
13380 fi
13381 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13382   echo "$ac_t""yes" 1>&6
13383   have_termcap=yes
13384 else
13385   echo "$ac_t""no" 1>&6
13386 have_termcap=no
13387 fi
13388
13389         if test $have_termcap = yes ; then
13390                 cat >> confdefs.h <<\EOF
13391 #define HAVE_TERMCAP 1
13392 EOF
13393
13394                 ol_link_termcap=yes
13395                 TERMCAP_LIBS=-ltermcap
13396         fi
13397 fi
13398
13399 if test $ol_link_termcap = no ; then
13400         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13401 echo "configure:13402: checking for initscr in -lncurses" >&5
13402 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13403 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13404   echo $ac_n "(cached) $ac_c" 1>&6
13405 else
13406   ac_save_LIBS="$LIBS"
13407 LIBS="-lncurses  $LIBS"
13408 cat > conftest.$ac_ext <<EOF
13409 #line 13410 "configure"
13410 #include "confdefs.h"
13411 /* Override any gcc2 internal prototype to avoid an error.  */
13412 /* We use char because int might match the return type of a gcc2
13413     builtin and then its argument prototype would still apply.  */
13414 char initscr();
13415
13416 int main() {
13417 initscr()
13418 ; return 0; }
13419 EOF
13420 if { (eval echo configure:13421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13421   rm -rf conftest*
13422   eval "ac_cv_lib_$ac_lib_var=yes"
13423 else
13424   echo "configure: failed program was:" >&5
13425   cat conftest.$ac_ext >&5
13426   rm -rf conftest*
13427   eval "ac_cv_lib_$ac_lib_var=no"
13428 fi
13429 rm -f conftest*
13430 LIBS="$ac_save_LIBS"
13431
13432 fi
13433 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13434   echo "$ac_t""yes" 1>&6
13435   have_ncurses=yes
13436 else
13437   echo "$ac_t""no" 1>&6
13438 have_ncurses=no
13439 fi
13440
13441         if test $have_ncurses = yes ; then
13442                 cat >> confdefs.h <<\EOF
13443 #define HAVE_NCURSES 1
13444 EOF
13445
13446                 ol_link_termcap=yes
13447                 TERMCAP_LIBS=-lncurses
13448         fi
13449 fi
13450
13451 if test $ol_link_termcap = no ; then
13452         cat >> confdefs.h <<\EOF
13453 #define NO_TERMCAP 1
13454 EOF
13455
13456         TERMCAP_LIBS=
13457 fi
13458
13459 ol_link_sasl=no
13460 ol_link_spasswd=no
13461 if test $ol_with_cyrus_sasl != no ; then
13462         for ac_hdr in sasl.h
13463 do
13464 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13465 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13466 echo "configure:13467: checking for $ac_hdr" >&5
13467 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13468   echo $ac_n "(cached) $ac_c" 1>&6
13469 else
13470   cat > conftest.$ac_ext <<EOF
13471 #line 13472 "configure"
13472 #include "confdefs.h"
13473 #include <$ac_hdr>
13474 EOF
13475 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13476 { (eval echo configure:13477: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13477 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13478 if test -z "$ac_err"; then
13479   rm -rf conftest*
13480   eval "ac_cv_header_$ac_safe=yes"
13481 else
13482   echo "$ac_err" >&5
13483   echo "configure: failed program was:" >&5
13484   cat conftest.$ac_ext >&5
13485   rm -rf conftest*
13486   eval "ac_cv_header_$ac_safe=no"
13487 fi
13488 rm -f conftest*
13489 fi
13490 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13491   echo "$ac_t""yes" 1>&6
13492     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13493   cat >> confdefs.h <<EOF
13494 #define $ac_tr_hdr 1
13495 EOF
13496  
13497 else
13498   echo "$ac_t""no" 1>&6
13499 fi
13500 done
13501
13502
13503         if test $ac_cv_header_sasl_h = yes ; then
13504                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
13505 echo "configure:13506: checking for sasl_client_init in -lsasl" >&5
13506 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
13507 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13508   echo $ac_n "(cached) $ac_c" 1>&6
13509 else
13510   ac_save_LIBS="$LIBS"
13511 LIBS="-lsasl  $LIBS"
13512 cat > conftest.$ac_ext <<EOF
13513 #line 13514 "configure"
13514 #include "confdefs.h"
13515 /* Override any gcc2 internal prototype to avoid an error.  */
13516 /* We use char because int might match the return type of a gcc2
13517     builtin and then its argument prototype would still apply.  */
13518 char sasl_client_init();
13519
13520 int main() {
13521 sasl_client_init()
13522 ; return 0; }
13523 EOF
13524 if { (eval echo configure:13525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13525   rm -rf conftest*
13526   eval "ac_cv_lib_$ac_lib_var=yes"
13527 else
13528   echo "configure: failed program was:" >&5
13529   cat conftest.$ac_ext >&5
13530   rm -rf conftest*
13531   eval "ac_cv_lib_$ac_lib_var=no"
13532 fi
13533 rm -f conftest*
13534 LIBS="$ac_save_LIBS"
13535
13536 fi
13537 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13538   echo "$ac_t""yes" 1>&6
13539   have_cyrus_sasl=yes
13540 else
13541   echo "$ac_t""no" 1>&6
13542 have_cyrus_sasl=no
13543 fi
13544
13545
13546                 if test $have_cyrus_sasl != no ; then
13547                         SASL_LIBS="-lsasl"
13548                         cat >> confdefs.h <<\EOF
13549 #define HAVE_CYRUS_SASL 1
13550 EOF
13551
13552                         ol_link_sasl=yes
13553                 fi
13554         fi
13555
13556         if test $ol_link_sasl = no ; then
13557                 if test $ol_with_cyrus_sasl != auto ; then
13558                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
13559                 else
13560                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
13561                         echo "configure: warning: SASL authentication not supported!" 1>&2
13562                         if test $ol_link_tls = no ; then
13563                                 echo "configure: warning: Strong authentication not supported!" 1>&2
13564                         fi
13565                 fi
13566
13567         elif test $ol_enable_spasswd != no ; then
13568                 ol_link_spasswd=yes
13569         fi
13570
13571 else
13572         echo "configure: warning: SASL authentication not supported!" 1>&2
13573         if test $ol_link_tls = no ; then
13574                 echo "configure: warning: Strong authentication not supported!" 1>&2
13575         fi
13576 fi
13577
13578 if test $cross_compiling != yes ; then
13579         dev=no
13580         if test -r /dev/urandom ; then
13581                 dev="/dev/urandom";
13582         elif test -r /idev/urandom ; then
13583                 dev="/idev/urandom";
13584         elif test -r /dev/srandom ; then
13585                 dev="/dev/srandom";
13586         elif test -r /dev/random ; then
13587                 dev="/dev/random";
13588         elif test -r /idev/random ; then
13589                 dev="/idev/random";
13590         fi
13591
13592         if test $dev != no ; then
13593                 cat >> confdefs.h <<EOF
13594 #define URANDOM_DEVICE "$dev"
13595 EOF
13596
13597         fi
13598 fi
13599
13600 ol_link_fetch=no
13601 if test $ol_with_fetch != no ; then
13602         ol_LIBS=$LIBS
13603 LIBS="-lfetch -lcom_err $LIBS"
13604 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
13605 echo "configure:13606: checking fetch(3) library" >&5
13606 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
13607   echo $ac_n "(cached) $ac_c" 1>&6
13608 else
13609   
13610         cat > conftest.$ac_ext <<EOF
13611 #line 13612 "configure"
13612 #include "confdefs.h"
13613
13614 #include <sys/param.h>
13615 #include <stdio.h>
13616 #include <fetch.h>
13617 int main() {
13618 struct url *u = fetchParseURL("file:///"); 
13619 ; return 0; }
13620 EOF
13621 if { (eval echo configure:13622: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13622   rm -rf conftest*
13623   ol_cv_lib_fetch=yes
13624 else
13625   echo "configure: failed program was:" >&5
13626   cat conftest.$ac_ext >&5
13627   rm -rf conftest*
13628   ol_cv_lib_fetch=no
13629 fi
13630 rm -f conftest*
13631 fi
13632
13633 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
13634 LIBS=$ol_LIBS
13635 if test $ol_cv_lib_fetch != no ; then
13636         ol_link_fetch="-lfetch -lcom_err"
13637         cat >> confdefs.h <<\EOF
13638 #define HAVE_FETCH 1
13639 EOF
13640
13641 fi
13642
13643
13644         if test $ol_cv_lib_fetch != no ; then
13645                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
13646                 ol_link_fetch=freebsd
13647
13648         elif test $ol_with_fetch != auto ; then
13649                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
13650         fi 
13651 fi
13652
13653 ol_link_readline=no
13654 if test $ol_with_readline != no ; then
13655         for ac_hdr in readline/readline.h readline/history.h
13656 do
13657 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13658 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13659 echo "configure:13660: checking for $ac_hdr" >&5
13660 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13661   echo $ac_n "(cached) $ac_c" 1>&6
13662 else
13663   cat > conftest.$ac_ext <<EOF
13664 #line 13665 "configure"
13665 #include "confdefs.h"
13666 #include <$ac_hdr>
13667 EOF
13668 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13669 { (eval echo configure:13670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13670 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13671 if test -z "$ac_err"; then
13672   rm -rf conftest*
13673   eval "ac_cv_header_$ac_safe=yes"
13674 else
13675   echo "$ac_err" >&5
13676   echo "configure: failed program was:" >&5
13677   cat conftest.$ac_ext >&5
13678   rm -rf conftest*
13679   eval "ac_cv_header_$ac_safe=no"
13680 fi
13681 rm -f conftest*
13682 fi
13683 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13684   echo "$ac_t""yes" 1>&6
13685     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13686   cat >> confdefs.h <<EOF
13687 #define $ac_tr_hdr 1
13688 EOF
13689  
13690 else
13691   echo "$ac_t""no" 1>&6
13692 fi
13693 done
13694
13695
13696         if test $ac_cv_header_readline_readline_h = yes ; then
13697                 save_LIBS="$LIBS"
13698                 LIBS="$TERMCAP_LIBS $LIBS"
13699                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
13700 echo "configure:13701: checking for readline in -lreadline" >&5
13701 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
13702 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13703   echo $ac_n "(cached) $ac_c" 1>&6
13704 else
13705   ac_save_LIBS="$LIBS"
13706 LIBS="-lreadline  $LIBS"
13707 cat > conftest.$ac_ext <<EOF
13708 #line 13709 "configure"
13709 #include "confdefs.h"
13710 /* Override any gcc2 internal prototype to avoid an error.  */
13711 /* We use char because int might match the return type of a gcc2
13712     builtin and then its argument prototype would still apply.  */
13713 char readline();
13714
13715 int main() {
13716 readline()
13717 ; return 0; }
13718 EOF
13719 if { (eval echo configure:13720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13720   rm -rf conftest*
13721   eval "ac_cv_lib_$ac_lib_var=yes"
13722 else
13723   echo "configure: failed program was:" >&5
13724   cat conftest.$ac_ext >&5
13725   rm -rf conftest*
13726   eval "ac_cv_lib_$ac_lib_var=no"
13727 fi
13728 rm -f conftest*
13729 LIBS="$ac_save_LIBS"
13730
13731 fi
13732 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13733   echo "$ac_t""yes" 1>&6
13734   have_readline=yes
13735 else
13736   echo "$ac_t""no" 1>&6
13737 have_readline=no
13738 fi
13739
13740                 LIBS="$save_LIBS"
13741                         
13742                 if test $have_readline = yes ; then
13743                         ol_with_readline=found
13744                         ol_link_readline=yes
13745
13746                         READLINE_LIBS="-lreadline"
13747                 fi
13748         fi
13749 fi
13750
13751 if test $ol_link_readline = yes ; then
13752         cat >> confdefs.h <<\EOF
13753 #define HAVE_READLINE 1
13754 EOF
13755
13756 fi
13757
13758
13759 if test $ol_enable_crypt != no ; then
13760         echo $ac_n "checking for crypt""... $ac_c" 1>&6
13761 echo "configure:13762: checking for crypt" >&5
13762 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
13763   echo $ac_n "(cached) $ac_c" 1>&6
13764 else
13765   cat > conftest.$ac_ext <<EOF
13766 #line 13767 "configure"
13767 #include "confdefs.h"
13768 /* System header to define __stub macros and hopefully few prototypes,
13769     which can conflict with char crypt(); below.  */
13770 #include <assert.h>
13771 /* Override any gcc2 internal prototype to avoid an error.  */
13772 /* We use char because int might match the return type of a gcc2
13773     builtin and then its argument prototype would still apply.  */
13774 char crypt();
13775 char (*f)();
13776
13777 int main() {
13778
13779 /* The GNU C library defines this for functions which it implements
13780     to always fail with ENOSYS.  Some functions are actually named
13781     something starting with __ and the normal name is an alias.  */
13782 #if defined (__stub_crypt) || defined (__stub___crypt)
13783 choke me
13784 #else
13785 f = crypt;
13786 #endif
13787
13788 ; return 0; }
13789 EOF
13790 if { (eval echo configure:13791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13791   rm -rf conftest*
13792   eval "ac_cv_func_crypt=yes"
13793 else
13794   echo "configure: failed program was:" >&5
13795   cat conftest.$ac_ext >&5
13796   rm -rf conftest*
13797   eval "ac_cv_func_crypt=no"
13798 fi
13799 rm -f conftest*
13800 fi
13801
13802 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
13803   echo "$ac_t""yes" 1>&6
13804   have_crypt=yes
13805 else
13806   echo "$ac_t""no" 1>&6
13807
13808                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
13809 echo "configure:13810: checking for crypt in -lcrypt" >&5
13810 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
13811 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13812   echo $ac_n "(cached) $ac_c" 1>&6
13813 else
13814   ac_save_LIBS="$LIBS"
13815 LIBS="-lcrypt  $LIBS"
13816 cat > conftest.$ac_ext <<EOF
13817 #line 13818 "configure"
13818 #include "confdefs.h"
13819 /* Override any gcc2 internal prototype to avoid an error.  */
13820 /* We use char because int might match the return type of a gcc2
13821     builtin and then its argument prototype would still apply.  */
13822 char crypt();
13823
13824 int main() {
13825 crypt()
13826 ; return 0; }
13827 EOF
13828 if { (eval echo configure:13829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13829   rm -rf conftest*
13830   eval "ac_cv_lib_$ac_lib_var=yes"
13831 else
13832   echo "configure: failed program was:" >&5
13833   cat conftest.$ac_ext >&5
13834   rm -rf conftest*
13835   eval "ac_cv_lib_$ac_lib_var=no"
13836 fi
13837 rm -f conftest*
13838 LIBS="$ac_save_LIBS"
13839
13840 fi
13841 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13842   echo "$ac_t""yes" 1>&6
13843   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
13844                         have_crypt=yes
13845 else
13846   echo "$ac_t""no" 1>&6
13847 have_crypt=no
13848 fi
13849
13850 fi
13851
13852
13853         if test $have_crypt = yes ; then
13854                 cat >> confdefs.h <<\EOF
13855 #define HAVE_CRYPT 1
13856 EOF
13857
13858         else
13859                 echo "configure: warning: could not find crypt" 1>&2
13860                 if test $ol_enable_crypt = yes ; then
13861                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
13862                 fi
13863
13864                 echo "configure: warning: disabling crypt support" 1>&2
13865                 ol_enable_crypt=no
13866         fi
13867 fi
13868
13869 if test $ol_enable_proctitle != no ; then
13870         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
13871 echo "configure:13872: checking for setproctitle" >&5
13872 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
13873   echo $ac_n "(cached) $ac_c" 1>&6
13874 else
13875   cat > conftest.$ac_ext <<EOF
13876 #line 13877 "configure"
13877 #include "confdefs.h"
13878 /* System header to define __stub macros and hopefully few prototypes,
13879     which can conflict with char setproctitle(); below.  */
13880 #include <assert.h>
13881 /* Override any gcc2 internal prototype to avoid an error.  */
13882 /* We use char because int might match the return type of a gcc2
13883     builtin and then its argument prototype would still apply.  */
13884 char setproctitle();
13885 char (*f)();
13886
13887 int main() {
13888
13889 /* The GNU C library defines this for functions which it implements
13890     to always fail with ENOSYS.  Some functions are actually named
13891     something starting with __ and the normal name is an alias.  */
13892 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
13893 choke me
13894 #else
13895 f = setproctitle;
13896 #endif
13897
13898 ; return 0; }
13899 EOF
13900 if { (eval echo configure:13901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13901   rm -rf conftest*
13902   eval "ac_cv_func_setproctitle=yes"
13903 else
13904   echo "configure: failed program was:" >&5
13905   cat conftest.$ac_ext >&5
13906   rm -rf conftest*
13907   eval "ac_cv_func_setproctitle=no"
13908 fi
13909 rm -f conftest*
13910 fi
13911
13912 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
13913   echo "$ac_t""yes" 1>&6
13914   have_setproctitle=yes
13915 else
13916   echo "$ac_t""no" 1>&6
13917
13918                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
13919 echo "configure:13920: checking for setproctitle in -lutil" >&5
13920 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
13921 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13922   echo $ac_n "(cached) $ac_c" 1>&6
13923 else
13924   ac_save_LIBS="$LIBS"
13925 LIBS="-lutil  $LIBS"
13926 cat > conftest.$ac_ext <<EOF
13927 #line 13928 "configure"
13928 #include "confdefs.h"
13929 /* Override any gcc2 internal prototype to avoid an error.  */
13930 /* We use char because int might match the return type of a gcc2
13931     builtin and then its argument prototype would still apply.  */
13932 char setproctitle();
13933
13934 int main() {
13935 setproctitle()
13936 ; return 0; }
13937 EOF
13938 if { (eval echo configure:13939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13939   rm -rf conftest*
13940   eval "ac_cv_lib_$ac_lib_var=yes"
13941 else
13942   echo "configure: failed program was:" >&5
13943   cat conftest.$ac_ext >&5
13944   rm -rf conftest*
13945   eval "ac_cv_lib_$ac_lib_var=no"
13946 fi
13947 rm -f conftest*
13948 LIBS="$ac_save_LIBS"
13949
13950 fi
13951 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13952   echo "$ac_t""yes" 1>&6
13953   have_setproctitle=yes
13954                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
13955 else
13956   echo "$ac_t""no" 1>&6
13957 have_setproctitle=no
13958                         LIBOBJS="$LIBOBJS setproctitle.o"
13959                         LIBSRCS="$LIBSRCS setproctitle.c"
13960 fi
13961
13962 fi
13963
13964
13965         if test $have_setproctitle = yes ; then
13966                 cat >> confdefs.h <<\EOF
13967 #define HAVE_SETPROCTITLE 1
13968 EOF
13969
13970         fi
13971 fi
13972
13973 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
13974 echo "configure:13975: checking for ANSI C header files" >&5
13975 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
13976   echo $ac_n "(cached) $ac_c" 1>&6
13977 else
13978   cat > conftest.$ac_ext <<EOF
13979 #line 13980 "configure"
13980 #include "confdefs.h"
13981 #include <stdlib.h>
13982 #include <stdarg.h>
13983 #include <string.h>
13984 #include <float.h>
13985 EOF
13986 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13987 { (eval echo configure:13988: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13988 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13989 if test -z "$ac_err"; then
13990   rm -rf conftest*
13991   ac_cv_header_stdc=yes
13992 else
13993   echo "$ac_err" >&5
13994   echo "configure: failed program was:" >&5
13995   cat conftest.$ac_ext >&5
13996   rm -rf conftest*
13997   ac_cv_header_stdc=no
13998 fi
13999 rm -f conftest*
14000
14001 if test $ac_cv_header_stdc = yes; then
14002   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
14003 cat > conftest.$ac_ext <<EOF
14004 #line 14005 "configure"
14005 #include "confdefs.h"
14006 #include <string.h>
14007 EOF
14008 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14009   egrep "memchr" >/dev/null 2>&1; then
14010   :
14011 else
14012   rm -rf conftest*
14013   ac_cv_header_stdc=no
14014 fi
14015 rm -f conftest*
14016
14017 fi
14018
14019 if test $ac_cv_header_stdc = yes; then
14020   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
14021 cat > conftest.$ac_ext <<EOF
14022 #line 14023 "configure"
14023 #include "confdefs.h"
14024 #include <stdlib.h>
14025 EOF
14026 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14027   egrep "free" >/dev/null 2>&1; then
14028   :
14029 else
14030   rm -rf conftest*
14031   ac_cv_header_stdc=no
14032 fi
14033 rm -f conftest*
14034
14035 fi
14036
14037 if test $ac_cv_header_stdc = yes; then
14038   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
14039 if test "$cross_compiling" = yes; then
14040   :
14041 else
14042   cat > conftest.$ac_ext <<EOF
14043 #line 14044 "configure"
14044 #include "confdefs.h"
14045 #include <ctype.h>
14046 #if ((' ' & 0x0FF) == 0x020)
14047 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
14048 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
14049 #else
14050 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
14051  || ('j' <= (c) && (c) <= 'r') \
14052  || ('s' <= (c) && (c) <= 'z'))
14053 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
14054 #endif
14055 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
14056 int main () { int i; for (i = 0; i < 256; i++)
14057 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
14058 exit (0); }
14059
14060 EOF
14061 if { (eval echo configure:14062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14062 then
14063   :
14064 else
14065   echo "configure: failed program was:" >&5
14066   cat conftest.$ac_ext >&5
14067   rm -fr conftest*
14068   ac_cv_header_stdc=no
14069 fi
14070 rm -fr conftest*
14071 fi
14072
14073 fi
14074 fi
14075
14076 echo "$ac_t""$ac_cv_header_stdc" 1>&6
14077 if test $ac_cv_header_stdc = yes; then
14078   cat >> confdefs.h <<\EOF
14079 #define STDC_HEADERS 1
14080 EOF
14081
14082 fi
14083
14084 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
14085 echo "configure:14086: checking for mode_t" >&5
14086 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
14087   echo $ac_n "(cached) $ac_c" 1>&6
14088 else
14089   cat > conftest.$ac_ext <<EOF
14090 #line 14091 "configure"
14091 #include "confdefs.h"
14092 #include <sys/types.h>
14093 #if STDC_HEADERS
14094 #include <stdlib.h>
14095 #include <stddef.h>
14096 #endif
14097
14098 EOF
14099 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14100   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14101   rm -rf conftest*
14102   eval "ac_cv_type_mode_t=yes"
14103 else
14104   rm -rf conftest*
14105   eval "ac_cv_type_mode_t=no"
14106 fi
14107 rm -f conftest*
14108
14109 fi
14110 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
14111   echo "$ac_t""yes" 1>&6
14112 else
14113   echo "$ac_t""no" 1>&6
14114   cat >> confdefs.h <<EOF
14115 #define mode_t int
14116 EOF
14117
14118 fi
14119
14120 echo $ac_n "checking for off_t""... $ac_c" 1>&6
14121 echo "configure:14122: checking for off_t" >&5
14122 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
14123   echo $ac_n "(cached) $ac_c" 1>&6
14124 else
14125   cat > conftest.$ac_ext <<EOF
14126 #line 14127 "configure"
14127 #include "confdefs.h"
14128 #include <sys/types.h>
14129 #if STDC_HEADERS
14130 #include <stdlib.h>
14131 #include <stddef.h>
14132 #endif
14133
14134 EOF
14135 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14136   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14137   rm -rf conftest*
14138   eval "ac_cv_type_off_t=yes"
14139 else
14140   rm -rf conftest*
14141   eval "ac_cv_type_off_t=no"
14142 fi
14143 rm -f conftest*
14144
14145 fi
14146 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
14147   echo "$ac_t""yes" 1>&6
14148 else
14149   echo "$ac_t""no" 1>&6
14150   cat >> confdefs.h <<EOF
14151 #define off_t long
14152 EOF
14153
14154 fi
14155
14156 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
14157 echo "configure:14158: checking for pid_t" >&5
14158 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
14159   echo $ac_n "(cached) $ac_c" 1>&6
14160 else
14161   cat > conftest.$ac_ext <<EOF
14162 #line 14163 "configure"
14163 #include "confdefs.h"
14164 #include <sys/types.h>
14165 #if STDC_HEADERS
14166 #include <stdlib.h>
14167 #include <stddef.h>
14168 #endif
14169
14170 EOF
14171 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14172   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14173   rm -rf conftest*
14174   eval "ac_cv_type_pid_t=yes"
14175 else
14176   rm -rf conftest*
14177   eval "ac_cv_type_pid_t=no"
14178 fi
14179 rm -f conftest*
14180
14181 fi
14182 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
14183   echo "$ac_t""yes" 1>&6
14184 else
14185   echo "$ac_t""no" 1>&6
14186   cat >> confdefs.h <<EOF
14187 #define pid_t int
14188 EOF
14189
14190 fi
14191
14192 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
14193 echo "configure:14194: checking for ptrdiff_t" >&5
14194 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
14195   echo $ac_n "(cached) $ac_c" 1>&6
14196 else
14197   cat > conftest.$ac_ext <<EOF
14198 #line 14199 "configure"
14199 #include "confdefs.h"
14200 #include <stddef.h>
14201 int main() {
14202 ptrdiff_t p
14203 ; return 0; }
14204 EOF
14205 if { (eval echo configure:14206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14206   rm -rf conftest*
14207   am_cv_type_ptrdiff_t=yes
14208 else
14209   echo "configure: failed program was:" >&5
14210   cat conftest.$ac_ext >&5
14211   rm -rf conftest*
14212   am_cv_type_ptrdiff_t=no
14213 fi
14214 rm -f conftest*
14215 fi
14216
14217 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
14218    if test $am_cv_type_ptrdiff_t = yes; then
14219      cat >> confdefs.h <<\EOF
14220 #define HAVE_PTRDIFF_T 1
14221 EOF
14222
14223    fi
14224
14225 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
14226 echo "configure:14227: checking return type of signal handlers" >&5
14227 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
14228   echo $ac_n "(cached) $ac_c" 1>&6
14229 else
14230   cat > conftest.$ac_ext <<EOF
14231 #line 14232 "configure"
14232 #include "confdefs.h"
14233 #include <sys/types.h>
14234 #include <signal.h>
14235 #ifdef signal
14236 #undef signal
14237 #endif
14238 #ifdef __cplusplus
14239 extern "C" void (*signal (int, void (*)(int)))(int);
14240 #else
14241 void (*signal ()) ();
14242 #endif
14243
14244 int main() {
14245 int i;
14246 ; return 0; }
14247 EOF
14248 if { (eval echo configure:14249: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14249   rm -rf conftest*
14250   ac_cv_type_signal=void
14251 else
14252   echo "configure: failed program was:" >&5
14253   cat conftest.$ac_ext >&5
14254   rm -rf conftest*
14255   ac_cv_type_signal=int
14256 fi
14257 rm -f conftest*
14258 fi
14259
14260 echo "$ac_t""$ac_cv_type_signal" 1>&6
14261 cat >> confdefs.h <<EOF
14262 #define RETSIGTYPE $ac_cv_type_signal
14263 EOF
14264
14265
14266 echo $ac_n "checking for size_t""... $ac_c" 1>&6
14267 echo "configure:14268: checking for size_t" >&5
14268 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
14269   echo $ac_n "(cached) $ac_c" 1>&6
14270 else
14271   cat > conftest.$ac_ext <<EOF
14272 #line 14273 "configure"
14273 #include "confdefs.h"
14274 #include <sys/types.h>
14275 #if STDC_HEADERS
14276 #include <stdlib.h>
14277 #include <stddef.h>
14278 #endif
14279
14280 EOF
14281 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14282   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14283   rm -rf conftest*
14284   eval "ac_cv_type_size_t=yes"
14285 else
14286   rm -rf conftest*
14287   eval "ac_cv_type_size_t=no"
14288 fi
14289 rm -f conftest*
14290
14291 fi
14292 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
14293   echo "$ac_t""yes" 1>&6
14294 else
14295   echo "$ac_t""no" 1>&6
14296   cat >> confdefs.h <<EOF
14297 #define size_t unsigned
14298 EOF
14299
14300 fi
14301
14302
14303 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
14304 echo "configure:14305: checking for ssize_t" >&5
14305 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
14306   echo $ac_n "(cached) $ac_c" 1>&6
14307 else
14308   cat > conftest.$ac_ext <<EOF
14309 #line 14310 "configure"
14310 #include "confdefs.h"
14311 #include <sys/types.h>
14312 #if STDC_HEADERS
14313 #include <stdlib.h>
14314 #include <stddef.h>
14315 #endif
14316
14317 EOF
14318 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14319   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14320   rm -rf conftest*
14321   eval "ac_cv_type_ssize_t=yes"
14322 else
14323   rm -rf conftest*
14324   eval "ac_cv_type_ssize_t=no"
14325 fi
14326 rm -f conftest*
14327
14328 fi
14329 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
14330   echo "$ac_t""yes" 1>&6
14331 else
14332   echo "$ac_t""no" 1>&6
14333   cat >> confdefs.h <<EOF
14334 #define ssize_t signed int
14335 EOF
14336
14337 fi
14338
14339 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
14340 echo "configure:14341: checking for caddr_t" >&5
14341 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
14342   echo $ac_n "(cached) $ac_c" 1>&6
14343 else
14344   cat > conftest.$ac_ext <<EOF
14345 #line 14346 "configure"
14346 #include "confdefs.h"
14347 #include <sys/types.h>
14348 #if STDC_HEADERS
14349 #include <stdlib.h>
14350 #include <stddef.h>
14351 #endif
14352
14353 EOF
14354 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14355   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14356   rm -rf conftest*
14357   eval "ac_cv_type_caddr_t=yes"
14358 else
14359   rm -rf conftest*
14360   eval "ac_cv_type_caddr_t=no"
14361 fi
14362 rm -f conftest*
14363
14364 fi
14365 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
14366   echo "$ac_t""yes" 1>&6
14367 else
14368   echo "$ac_t""no" 1>&6
14369   cat >> confdefs.h <<EOF
14370 #define caddr_t char *
14371 EOF
14372
14373 fi
14374
14375
14376 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
14377 echo "configure:14378: checking for socklen_t" >&5
14378 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
14379   echo $ac_n "(cached) $ac_c" 1>&6
14380 else
14381   cat > conftest.$ac_ext <<EOF
14382 #line 14383 "configure"
14383 #include "confdefs.h"
14384
14385 #ifdef HAVE_SYS_TYPES_H
14386 #include <sys/types.h>
14387 #endif
14388 #ifdef HAVE_SYS_SOCKET_H
14389 #include <sys/socket.h>
14390 #endif
14391
14392 int main() {
14393 socklen_t len;
14394 ; return 0; }
14395 EOF
14396 if { (eval echo configure:14397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14397   rm -rf conftest*
14398   ol_cv_type_socklen_t=yes
14399 else
14400   echo "configure: failed program was:" >&5
14401   cat conftest.$ac_ext >&5
14402   rm -rf conftest*
14403   ol_cv_type_socklen_t=no
14404 fi
14405 rm -f conftest*
14406 fi
14407
14408 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
14409   if test $ol_cv_type_socklen_t = no; then
14410     cat >> confdefs.h <<\EOF
14411 #define socklen_t int
14412 EOF
14413
14414   fi
14415  
14416 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
14417 echo "configure:14418: checking for member st_blksize in aggregate type struct stat" >&5
14418 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
14419   echo $ac_n "(cached) $ac_c" 1>&6
14420 else
14421   cat > conftest.$ac_ext <<EOF
14422 #line 14423 "configure"
14423 #include "confdefs.h"
14424 #include <sys/types.h>
14425 #include <sys/stat.h>
14426 int main() {
14427 struct stat foo; foo.st_blksize;
14428 ; return 0; }
14429 EOF
14430 if { (eval echo configure:14431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14431   rm -rf conftest*
14432   ac_cv_c_struct_member_st_blksize=yes
14433 else
14434   echo "configure: failed program was:" >&5
14435   cat conftest.$ac_ext >&5
14436   rm -rf conftest*
14437   ac_cv_c_struct_member_st_blksize=no
14438 fi
14439 rm -f conftest*
14440 fi
14441
14442 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
14443 st_blksize="$ac_cv_c_struct_member_st_blksize"
14444 if test $ac_cv_c_struct_member_st_blksize = yes; then
14445   cat >> confdefs.h <<\EOF
14446 #define HAVE_ST_BLKSIZE 1
14447 EOF
14448
14449 fi
14450
14451 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
14452 echo "configure:14453: checking whether time.h and sys/time.h may both be included" >&5
14453 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
14454   echo $ac_n "(cached) $ac_c" 1>&6
14455 else
14456   cat > conftest.$ac_ext <<EOF
14457 #line 14458 "configure"
14458 #include "confdefs.h"
14459 #include <sys/types.h>
14460 #include <sys/time.h>
14461 #include <time.h>
14462 int main() {
14463 struct tm *tp;
14464 ; return 0; }
14465 EOF
14466 if { (eval echo configure:14467: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14467   rm -rf conftest*
14468   ac_cv_header_time=yes
14469 else
14470   echo "configure: failed program was:" >&5
14471   cat conftest.$ac_ext >&5
14472   rm -rf conftest*
14473   ac_cv_header_time=no
14474 fi
14475 rm -f conftest*
14476 fi
14477
14478 echo "$ac_t""$ac_cv_header_time" 1>&6
14479 if test $ac_cv_header_time = yes; then
14480   cat >> confdefs.h <<\EOF
14481 #define TIME_WITH_SYS_TIME 1
14482 EOF
14483
14484 fi
14485
14486 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
14487 echo "configure:14488: checking whether struct tm is in sys/time.h or time.h" >&5
14488 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
14489   echo $ac_n "(cached) $ac_c" 1>&6
14490 else
14491   cat > conftest.$ac_ext <<EOF
14492 #line 14493 "configure"
14493 #include "confdefs.h"
14494 #include <sys/types.h>
14495 #include <time.h>
14496 int main() {
14497 struct tm *tp; tp->tm_sec;
14498 ; return 0; }
14499 EOF
14500 if { (eval echo configure:14501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14501   rm -rf conftest*
14502   ac_cv_struct_tm=time.h
14503 else
14504   echo "configure: failed program was:" >&5
14505   cat conftest.$ac_ext >&5
14506   rm -rf conftest*
14507   ac_cv_struct_tm=sys/time.h
14508 fi
14509 rm -f conftest*
14510 fi
14511
14512 echo "$ac_t""$ac_cv_struct_tm" 1>&6
14513 if test $ac_cv_struct_tm = sys/time.h; then
14514   cat >> confdefs.h <<\EOF
14515 #define TM_IN_SYS_TIME 1
14516 EOF
14517
14518 fi
14519
14520 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
14521 echo "configure:14522: checking for uid_t in sys/types.h" >&5
14522 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
14523   echo $ac_n "(cached) $ac_c" 1>&6
14524 else
14525   cat > conftest.$ac_ext <<EOF
14526 #line 14527 "configure"
14527 #include "confdefs.h"
14528 #include <sys/types.h>
14529 EOF
14530 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14531   egrep "uid_t" >/dev/null 2>&1; then
14532   rm -rf conftest*
14533   ac_cv_type_uid_t=yes
14534 else
14535   rm -rf conftest*
14536   ac_cv_type_uid_t=no
14537 fi
14538 rm -f conftest*
14539
14540 fi
14541
14542 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
14543 if test $ac_cv_type_uid_t = no; then
14544   cat >> confdefs.h <<\EOF
14545 #define uid_t int
14546 EOF
14547
14548   cat >> confdefs.h <<\EOF
14549 #define gid_t int
14550 EOF
14551
14552 fi
14553
14554 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
14555 echo "configure:14556: checking for sig_atomic_t" >&5
14556 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
14557   echo $ac_n "(cached) $ac_c" 1>&6
14558 else
14559   cat > conftest.$ac_ext <<EOF
14560 #line 14561 "configure"
14561 #include "confdefs.h"
14562 #include <signal.h>
14563 int main() {
14564 sig_atomic_t atomic;
14565 ; return 0; }
14566 EOF
14567 if { (eval echo configure:14568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14568   rm -rf conftest*
14569   ol_cv_type_sig_atomic_t=yes
14570 else
14571   echo "configure: failed program was:" >&5
14572   cat conftest.$ac_ext >&5
14573   rm -rf conftest*
14574   ol_cv_type_sig_atomic_t=no
14575 fi
14576 rm -f conftest*
14577 fi
14578
14579 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
14580   if test $ol_cv_type_sig_atomic_t = no; then
14581     cat >> confdefs.h <<\EOF
14582 #define sig_atomic_t int
14583 EOF
14584
14585   fi
14586  
14587
14588
14589 # test for pw_gecos in struct passwd
14590 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
14591 echo "configure:14592: checking struct passwd for pw_gecos" >&5
14592 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
14593   echo $ac_n "(cached) $ac_c" 1>&6
14594 else
14595   
14596         cat > conftest.$ac_ext <<EOF
14597 #line 14598 "configure"
14598 #include "confdefs.h"
14599 #include <pwd.h>
14600 int main() {
14601
14602         struct passwd pwd;
14603         pwd.pw_gecos = pwd.pw_name;
14604
14605 ; return 0; }
14606 EOF
14607 if { (eval echo configure:14608: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14608   rm -rf conftest*
14609   ol_cv_struct_passwd_pw_gecos=yes
14610 else
14611   echo "configure: failed program was:" >&5
14612   cat conftest.$ac_ext >&5
14613   rm -rf conftest*
14614   ol_cv_struct_passwd_pw_gecos=no
14615 fi
14616 rm -f conftest*
14617 fi
14618
14619 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
14620 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
14621         cat >> confdefs.h <<\EOF
14622 #define HAVE_PW_GECOS 1
14623 EOF
14624
14625 fi
14626
14627 # test for pw_passwd in struct passwd
14628 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
14629 echo "configure:14630: checking struct passwd for pw_passwd" >&5
14630 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
14631   echo $ac_n "(cached) $ac_c" 1>&6
14632 else
14633   
14634         cat > conftest.$ac_ext <<EOF
14635 #line 14636 "configure"
14636 #include "confdefs.h"
14637 #include <pwd.h>
14638 int main() {
14639
14640         struct passwd pwd;
14641         pwd.pw_passwd = pwd.pw_name;
14642
14643 ; return 0; }
14644 EOF
14645 if { (eval echo configure:14646: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14646   rm -rf conftest*
14647   ol_cv_struct_passwd_pw_passwd=yes
14648 else
14649   echo "configure: failed program was:" >&5
14650   cat conftest.$ac_ext >&5
14651   rm -rf conftest*
14652   ol_cv_struct_passwd_pw_passwd=no
14653 fi
14654 rm -f conftest*
14655 fi
14656
14657 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
14658 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
14659         cat >> confdefs.h <<\EOF
14660 #define HAVE_PW_PASSWD 1
14661 EOF
14662
14663 fi
14664
14665
14666 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
14667 echo "configure:14668: checking if toupper() requires islower()" >&5
14668 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
14669   echo $ac_n "(cached) $ac_c" 1>&6
14670 else
14671   
14672         if test "$cross_compiling" = yes; then
14673   ol_cv_c_upper_lower=safe
14674 else
14675   cat > conftest.$ac_ext <<EOF
14676 #line 14677 "configure"
14677 #include "confdefs.h"
14678
14679 #include <ctype.h>
14680 main()
14681 {
14682         if ('C' == toupper('C'))
14683                 exit(0);
14684         else
14685                 exit(1);
14686 }
14687 EOF
14688 if { (eval echo configure:14689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14689 then
14690   ol_cv_c_upper_lower=no
14691 else
14692   echo "configure: failed program was:" >&5
14693   cat conftest.$ac_ext >&5
14694   rm -fr conftest*
14695   ol_cv_c_upper_lower=yes
14696 fi
14697 rm -fr conftest*
14698 fi
14699
14700 fi
14701
14702 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
14703 if test $ol_cv_c_upper_lower != no ; then
14704         cat >> confdefs.h <<\EOF
14705 #define C_UPPER_LOWER 1
14706 EOF
14707
14708 fi
14709
14710 echo $ac_n "checking for working const""... $ac_c" 1>&6
14711 echo "configure:14712: checking for working const" >&5
14712 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
14713   echo $ac_n "(cached) $ac_c" 1>&6
14714 else
14715   cat > conftest.$ac_ext <<EOF
14716 #line 14717 "configure"
14717 #include "confdefs.h"
14718
14719 int main() {
14720
14721 /* Ultrix mips cc rejects this.  */
14722 typedef int charset[2]; const charset x;
14723 /* SunOS 4.1.1 cc rejects this.  */
14724 char const *const *ccp;
14725 char **p;
14726 /* NEC SVR4.0.2 mips cc rejects this.  */
14727 struct point {int x, y;};
14728 static struct point const zero = {0,0};
14729 /* AIX XL C 1.02.0.0 rejects this.
14730    It does not let you subtract one const X* pointer from another in an arm
14731    of an if-expression whose if-part is not a constant expression */
14732 const char *g = "string";
14733 ccp = &g + (g ? g-g : 0);
14734 /* HPUX 7.0 cc rejects these. */
14735 ++ccp;
14736 p = (char**) ccp;
14737 ccp = (char const *const *) p;
14738 { /* SCO 3.2v4 cc rejects this.  */
14739   char *t;
14740   char const *s = 0 ? (char *) 0 : (char const *) 0;
14741
14742   *t++ = 0;
14743 }
14744 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14745   int x[] = {25, 17};
14746   const int *foo = &x[0];
14747   ++foo;
14748 }
14749 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14750   typedef const int *iptr;
14751   iptr p = 0;
14752   ++p;
14753 }
14754 { /* AIX XL C 1.02.0.0 rejects this saying
14755      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14756   struct s { int j; const int *ap[3]; };
14757   struct s *b; b->j = 5;
14758 }
14759 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14760   const int foo = 10;
14761 }
14762
14763 ; return 0; }
14764 EOF
14765 if { (eval echo configure:14766: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14766   rm -rf conftest*
14767   ac_cv_c_const=yes
14768 else
14769   echo "configure: failed program was:" >&5
14770   cat conftest.$ac_ext >&5
14771   rm -rf conftest*
14772   ac_cv_c_const=no
14773 fi
14774 rm -f conftest*
14775 fi
14776
14777 echo "$ac_t""$ac_cv_c_const" 1>&6
14778 if test $ac_cv_c_const = no; then
14779   cat >> confdefs.h <<\EOF
14780 #define const 
14781 EOF
14782
14783 fi
14784
14785 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
14786 echo "configure:14787: checking if compiler understands volatile" >&5
14787 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
14788   echo $ac_n "(cached) $ac_c" 1>&6
14789 else
14790   cat > conftest.$ac_ext <<EOF
14791 #line 14792 "configure"
14792 #include "confdefs.h"
14793 int x, y, z;
14794 int main() {
14795 volatile int a; int * volatile b = x ? &y : &z;
14796       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
14797       *b = 0;
14798 ; return 0; }
14799 EOF
14800 if { (eval echo configure:14801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14801   rm -rf conftest*
14802   ol_cv_c_volatile=yes
14803 else
14804   echo "configure: failed program was:" >&5
14805   cat conftest.$ac_ext >&5
14806   rm -rf conftest*
14807   ol_cv_c_volatile=no
14808 fi
14809 rm -f conftest*
14810 fi
14811
14812 echo "$ac_t""$ol_cv_c_volatile" 1>&6
14813   if test $ol_cv_c_volatile = yes; then
14814     : 
14815   else
14816     cat >> confdefs.h <<\EOF
14817 #define volatile 
14818 EOF
14819
14820   fi
14821  
14822
14823 if test $cross_compiling = yes ; then
14824         cat >> confdefs.h <<\EOF
14825 #define CROSS_COMPILING 1
14826 EOF
14827
14828 else
14829         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
14830 echo "configure:14831: checking whether byte ordering is bigendian" >&5
14831 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
14832   echo $ac_n "(cached) $ac_c" 1>&6
14833 else
14834   ac_cv_c_bigendian=unknown
14835 # See if sys/param.h defines the BYTE_ORDER macro.
14836 cat > conftest.$ac_ext <<EOF
14837 #line 14838 "configure"
14838 #include "confdefs.h"
14839 #include <sys/types.h>
14840 #include <sys/param.h>
14841 int main() {
14842
14843 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
14844  bogus endian macros
14845 #endif
14846 ; return 0; }
14847 EOF
14848 if { (eval echo configure:14849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14849   rm -rf conftest*
14850   # It does; now see whether it defined to BIG_ENDIAN or not.
14851 cat > conftest.$ac_ext <<EOF
14852 #line 14853 "configure"
14853 #include "confdefs.h"
14854 #include <sys/types.h>
14855 #include <sys/param.h>
14856 int main() {
14857
14858 #if BYTE_ORDER != BIG_ENDIAN
14859  not big endian
14860 #endif
14861 ; return 0; }
14862 EOF
14863 if { (eval echo configure:14864: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14864   rm -rf conftest*
14865   ac_cv_c_bigendian=yes
14866 else
14867   echo "configure: failed program was:" >&5
14868   cat conftest.$ac_ext >&5
14869   rm -rf conftest*
14870   ac_cv_c_bigendian=no
14871 fi
14872 rm -f conftest*
14873 else
14874   echo "configure: failed program was:" >&5
14875   cat conftest.$ac_ext >&5
14876 fi
14877 rm -f conftest*
14878 if test $ac_cv_c_bigendian = unknown; then
14879 if test "$cross_compiling" = yes; then
14880     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
14881 else
14882   cat > conftest.$ac_ext <<EOF
14883 #line 14884 "configure"
14884 #include "confdefs.h"
14885 main () {
14886   /* Are we little or big endian?  From Harbison&Steele.  */
14887   union
14888   {
14889     long l;
14890     char c[sizeof (long)];
14891   } u;
14892   u.l = 1;
14893   exit (u.c[sizeof (long) - 1] == 1);
14894 }
14895 EOF
14896 if { (eval echo configure:14897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14897 then
14898   ac_cv_c_bigendian=no
14899 else
14900   echo "configure: failed program was:" >&5
14901   cat conftest.$ac_ext >&5
14902   rm -fr conftest*
14903   ac_cv_c_bigendian=yes
14904 fi
14905 rm -fr conftest*
14906 fi
14907
14908 fi
14909 fi
14910
14911 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
14912 if test $ac_cv_c_bigendian = yes; then
14913   cat >> confdefs.h <<\EOF
14914 #define WORDS_BIGENDIAN 1
14915 EOF
14916
14917 fi
14918
14919 fi
14920
14921 echo $ac_n "checking size of short""... $ac_c" 1>&6
14922 echo "configure:14923: checking size of short" >&5 
14923 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
14924   echo $ac_n "(cached) $ac_c" 1>&6
14925 else
14926   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14927   cat > conftest.$ac_ext <<EOF
14928 #line 14929 "configure"
14929 #include "confdefs.h"
14930 #include "confdefs.h" 
14931 #include <sys/types.h> 
14932  
14933
14934 int main() {
14935 switch (0) case 0: case (sizeof (short) == $ac_size):;
14936 ; return 0; }
14937 EOF
14938 if { (eval echo configure:14939: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14939   rm -rf conftest*
14940   ac_cv_sizeof_short=$ac_size
14941 else
14942   echo "configure: failed program was:" >&5
14943   cat conftest.$ac_ext >&5
14944 fi
14945 rm -f conftest* 
14946   if test x$ac_cv_sizeof_short != x ; then break; fi 
14947 done 
14948
14949 fi
14950  
14951 if test x$ac_cv_sizeof_short = x ; then 
14952   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
14953 fi 
14954 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
14955 cat >> confdefs.h <<EOF
14956 #define SIZEOF_SHORT $ac_cv_sizeof_short
14957 EOF
14958  
14959  
14960 echo $ac_n "checking size of int""... $ac_c" 1>&6
14961 echo "configure:14962: checking size of int" >&5 
14962 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
14963   echo $ac_n "(cached) $ac_c" 1>&6
14964 else
14965   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14966   cat > conftest.$ac_ext <<EOF
14967 #line 14968 "configure"
14968 #include "confdefs.h"
14969 #include "confdefs.h" 
14970 #include <sys/types.h> 
14971  
14972
14973 int main() {
14974 switch (0) case 0: case (sizeof (int) == $ac_size):;
14975 ; return 0; }
14976 EOF
14977 if { (eval echo configure:14978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14978   rm -rf conftest*
14979   ac_cv_sizeof_int=$ac_size
14980 else
14981   echo "configure: failed program was:" >&5
14982   cat conftest.$ac_ext >&5
14983 fi
14984 rm -f conftest* 
14985   if test x$ac_cv_sizeof_int != x ; then break; fi 
14986 done 
14987
14988 fi
14989  
14990 if test x$ac_cv_sizeof_int = x ; then 
14991   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
14992 fi 
14993 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
14994 cat >> confdefs.h <<EOF
14995 #define SIZEOF_INT $ac_cv_sizeof_int
14996 EOF
14997  
14998  
14999 echo $ac_n "checking size of long""... $ac_c" 1>&6
15000 echo "configure:15001: checking size of long" >&5 
15001 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
15002   echo $ac_n "(cached) $ac_c" 1>&6
15003 else
15004   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
15005   cat > conftest.$ac_ext <<EOF
15006 #line 15007 "configure"
15007 #include "confdefs.h"
15008 #include "confdefs.h" 
15009 #include <sys/types.h> 
15010  
15011
15012 int main() {
15013 switch (0) case 0: case (sizeof (long) == $ac_size):;
15014 ; return 0; }
15015 EOF
15016 if { (eval echo configure:15017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15017   rm -rf conftest*
15018   ac_cv_sizeof_long=$ac_size
15019 else
15020   echo "configure: failed program was:" >&5
15021   cat conftest.$ac_ext >&5
15022 fi
15023 rm -f conftest* 
15024   if test x$ac_cv_sizeof_long != x ; then break; fi 
15025 done 
15026
15027 fi
15028  
15029 if test x$ac_cv_sizeof_long = x ; then 
15030   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
15031 fi 
15032 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
15033 cat >> confdefs.h <<EOF
15034 #define SIZEOF_LONG $ac_cv_sizeof_long
15035 EOF
15036  
15037
15038
15039 if test "$ac_cv_sizeof_int" -lt 4 ; then
15040         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
15041
15042         cat >> confdefs.h <<\EOF
15043 #define LBER_INT_T long
15044 EOF
15045
15046 else
15047         cat >> confdefs.h <<\EOF
15048 #define LBER_INT_T int
15049 EOF
15050
15051 fi
15052
15053 cat >> confdefs.h <<\EOF
15054 #define LBER_LEN_T long
15055 EOF
15056
15057 cat >> confdefs.h <<\EOF
15058 #define LBER_SOCKET_T int
15059 EOF
15060
15061 cat >> confdefs.h <<\EOF
15062 #define LBER_TAG_T long
15063 EOF
15064
15065
15066 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
15067 echo "configure:15068: checking for 8-bit clean memcmp" >&5
15068 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
15069   echo $ac_n "(cached) $ac_c" 1>&6
15070 else
15071   if test "$cross_compiling" = yes; then
15072   ac_cv_func_memcmp_clean=no
15073 else
15074   cat > conftest.$ac_ext <<EOF
15075 #line 15076 "configure"
15076 #include "confdefs.h"
15077
15078 main()
15079 {
15080   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
15081   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
15082 }
15083
15084 EOF
15085 if { (eval echo configure:15086: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15086 then
15087   ac_cv_func_memcmp_clean=yes
15088 else
15089   echo "configure: failed program was:" >&5
15090   cat conftest.$ac_ext >&5
15091   rm -fr conftest*
15092   ac_cv_func_memcmp_clean=no
15093 fi
15094 rm -fr conftest*
15095 fi
15096
15097 fi
15098
15099 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
15100 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
15101
15102 echo $ac_n "checking for strftime""... $ac_c" 1>&6
15103 echo "configure:15104: checking for strftime" >&5
15104 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
15105   echo $ac_n "(cached) $ac_c" 1>&6
15106 else
15107   cat > conftest.$ac_ext <<EOF
15108 #line 15109 "configure"
15109 #include "confdefs.h"
15110 /* System header to define __stub macros and hopefully few prototypes,
15111     which can conflict with char strftime(); below.  */
15112 #include <assert.h>
15113 /* Override any gcc2 internal prototype to avoid an error.  */
15114 /* We use char because int might match the return type of a gcc2
15115     builtin and then its argument prototype would still apply.  */
15116 char strftime();
15117 char (*f)();
15118
15119 int main() {
15120
15121 /* The GNU C library defines this for functions which it implements
15122     to always fail with ENOSYS.  Some functions are actually named
15123     something starting with __ and the normal name is an alias.  */
15124 #if defined (__stub_strftime) || defined (__stub___strftime)
15125 choke me
15126 #else
15127 f = strftime;
15128 #endif
15129
15130 ; return 0; }
15131 EOF
15132 if { (eval echo configure:15133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15133   rm -rf conftest*
15134   eval "ac_cv_func_strftime=yes"
15135 else
15136   echo "configure: failed program was:" >&5
15137   cat conftest.$ac_ext >&5
15138   rm -rf conftest*
15139   eval "ac_cv_func_strftime=no"
15140 fi
15141 rm -f conftest*
15142 fi
15143
15144 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
15145   echo "$ac_t""yes" 1>&6
15146   cat >> confdefs.h <<\EOF
15147 #define HAVE_STRFTIME 1
15148 EOF
15149
15150 else
15151   echo "$ac_t""no" 1>&6
15152 # strftime is in -lintl on SCO UNIX.
15153 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
15154 echo "configure:15155: checking for strftime in -lintl" >&5
15155 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
15156 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15157   echo $ac_n "(cached) $ac_c" 1>&6
15158 else
15159   ac_save_LIBS="$LIBS"
15160 LIBS="-lintl  $LIBS"
15161 cat > conftest.$ac_ext <<EOF
15162 #line 15163 "configure"
15163 #include "confdefs.h"
15164 /* Override any gcc2 internal prototype to avoid an error.  */
15165 /* We use char because int might match the return type of a gcc2
15166     builtin and then its argument prototype would still apply.  */
15167 char strftime();
15168
15169 int main() {
15170 strftime()
15171 ; return 0; }
15172 EOF
15173 if { (eval echo configure:15174: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15174   rm -rf conftest*
15175   eval "ac_cv_lib_$ac_lib_var=yes"
15176 else
15177   echo "configure: failed program was:" >&5
15178   cat conftest.$ac_ext >&5
15179   rm -rf conftest*
15180   eval "ac_cv_lib_$ac_lib_var=no"
15181 fi
15182 rm -f conftest*
15183 LIBS="$ac_save_LIBS"
15184
15185 fi
15186 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15187   echo "$ac_t""yes" 1>&6
15188   cat >> confdefs.h <<\EOF
15189 #define HAVE_STRFTIME 1
15190 EOF
15191
15192 LIBS="-lintl $LIBS"
15193 else
15194   echo "$ac_t""no" 1>&6
15195 fi
15196
15197 fi
15198
15199
15200 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
15201 echo "configure:15202: checking for inet_aton()" >&5
15202 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
15203   echo $ac_n "(cached) $ac_c" 1>&6
15204 else
15205   cat > conftest.$ac_ext <<EOF
15206 #line 15207 "configure"
15207 #include "confdefs.h"
15208
15209 #ifdef HAVE_SYS_TYPES_H
15210 #       include <sys/types.h>
15211 #endif
15212 #ifdef HAVE_SYS_SOCKET_H
15213 #       include <sys/socket.h>
15214 #       ifdef HAVE_SYS_SELECT_H
15215 #               include <sys/select.h>
15216 #       endif
15217 #       include <netinet/in.h>
15218 #       ifdef HAVE_ARPA_INET_H
15219 #               include <arpa/inet.h>
15220 #       endif
15221 #endif
15222
15223 int main() {
15224 struct in_addr in;
15225 int rc = inet_aton( "255.255.255.255", &in );
15226 ; return 0; }
15227 EOF
15228 if { (eval echo configure:15229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15229   rm -rf conftest*
15230   ol_cv_func_inet_aton=yes
15231 else
15232   echo "configure: failed program was:" >&5
15233   cat conftest.$ac_ext >&5
15234   rm -rf conftest*
15235   ol_cv_func_inet_aton=no
15236 fi
15237 rm -f conftest*
15238 fi
15239
15240 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
15241   if test $ol_cv_func_inet_aton != no; then
15242     cat >> confdefs.h <<\EOF
15243 #define HAVE_INET_ATON 1
15244 EOF
15245
15246   fi
15247  
15248
15249 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
15250 echo "configure:15251: checking for _spawnlp" >&5
15251 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
15252   echo $ac_n "(cached) $ac_c" 1>&6
15253 else
15254   cat > conftest.$ac_ext <<EOF
15255 #line 15256 "configure"
15256 #include "confdefs.h"
15257 /* System header to define __stub macros and hopefully few prototypes,
15258     which can conflict with char _spawnlp(); below.  */
15259 #include <assert.h>
15260 /* Override any gcc2 internal prototype to avoid an error.  */
15261 /* We use char because int might match the return type of a gcc2
15262     builtin and then its argument prototype would still apply.  */
15263 char _spawnlp();
15264 char (*f)();
15265
15266 int main() {
15267
15268 /* The GNU C library defines this for functions which it implements
15269     to always fail with ENOSYS.  Some functions are actually named
15270     something starting with __ and the normal name is an alias.  */
15271 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
15272 choke me
15273 #else
15274 f = _spawnlp;
15275 #endif
15276
15277 ; return 0; }
15278 EOF
15279 if { (eval echo configure:15280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15280   rm -rf conftest*
15281   eval "ac_cv_func__spawnlp=yes"
15282 else
15283   echo "configure: failed program was:" >&5
15284   cat conftest.$ac_ext >&5
15285   rm -rf conftest*
15286   eval "ac_cv_func__spawnlp=no"
15287 fi
15288 rm -f conftest*
15289 fi
15290
15291 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
15292   echo "$ac_t""yes" 1>&6
15293   cat >> confdefs.h <<\EOF
15294 #define HAVE_SPAWNLP 1
15295 EOF
15296
15297 else
15298   echo "$ac_t""no" 1>&6
15299 fi
15300
15301
15302 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
15303 echo "configure:15304: checking for _snprintf" >&5
15304 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
15305   echo $ac_n "(cached) $ac_c" 1>&6
15306 else
15307   cat > conftest.$ac_ext <<EOF
15308 #line 15309 "configure"
15309 #include "confdefs.h"
15310 /* System header to define __stub macros and hopefully few prototypes,
15311     which can conflict with char _snprintf(); below.  */
15312 #include <assert.h>
15313 /* Override any gcc2 internal prototype to avoid an error.  */
15314 /* We use char because int might match the return type of a gcc2
15315     builtin and then its argument prototype would still apply.  */
15316 char _snprintf();
15317 char (*f)();
15318
15319 int main() {
15320
15321 /* The GNU C library defines this for functions which it implements
15322     to always fail with ENOSYS.  Some functions are actually named
15323     something starting with __ and the normal name is an alias.  */
15324 #if defined (__stub__snprintf) || defined (__stub____snprintf)
15325 choke me
15326 #else
15327 f = _snprintf;
15328 #endif
15329
15330 ; return 0; }
15331 EOF
15332 if { (eval echo configure:15333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15333   rm -rf conftest*
15334   eval "ac_cv_func__snprintf=yes"
15335 else
15336   echo "configure: failed program was:" >&5
15337   cat conftest.$ac_ext >&5
15338   rm -rf conftest*
15339   eval "ac_cv_func__snprintf=no"
15340 fi
15341 rm -f conftest*
15342 fi
15343
15344 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
15345   echo "$ac_t""yes" 1>&6
15346   ac_cv_func_snprintf=yes
15347         cat >> confdefs.h <<\EOF
15348 #define snprintf _snprintf
15349 EOF
15350
15351
15352 else
15353   echo "$ac_t""no" 1>&6
15354 fi
15355
15356
15357 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
15358 echo "configure:15359: checking for _vsnprintf" >&5
15359 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
15360   echo $ac_n "(cached) $ac_c" 1>&6
15361 else
15362   cat > conftest.$ac_ext <<EOF
15363 #line 15364 "configure"
15364 #include "confdefs.h"
15365 /* System header to define __stub macros and hopefully few prototypes,
15366     which can conflict with char _vsnprintf(); below.  */
15367 #include <assert.h>
15368 /* Override any gcc2 internal prototype to avoid an error.  */
15369 /* We use char because int might match the return type of a gcc2
15370     builtin and then its argument prototype would still apply.  */
15371 char _vsnprintf();
15372 char (*f)();
15373
15374 int main() {
15375
15376 /* The GNU C library defines this for functions which it implements
15377     to always fail with ENOSYS.  Some functions are actually named
15378     something starting with __ and the normal name is an alias.  */
15379 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
15380 choke me
15381 #else
15382 f = _vsnprintf;
15383 #endif
15384
15385 ; return 0; }
15386 EOF
15387 if { (eval echo configure:15388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15388   rm -rf conftest*
15389   eval "ac_cv_func__vsnprintf=yes"
15390 else
15391   echo "configure: failed program was:" >&5
15392   cat conftest.$ac_ext >&5
15393   rm -rf conftest*
15394   eval "ac_cv_func__vsnprintf=no"
15395 fi
15396 rm -f conftest*
15397 fi
15398
15399 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
15400   echo "$ac_t""yes" 1>&6
15401   ac_cv_func_vsnprintf=yes
15402         cat >> confdefs.h <<\EOF
15403 #define vsnprintf _vsnprintf
15404 EOF
15405
15406
15407 else
15408   echo "$ac_t""no" 1>&6
15409 fi
15410
15411
15412 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
15413 echo "configure:15414: checking for vprintf" >&5
15414 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
15415   echo $ac_n "(cached) $ac_c" 1>&6
15416 else
15417   cat > conftest.$ac_ext <<EOF
15418 #line 15419 "configure"
15419 #include "confdefs.h"
15420 /* System header to define __stub macros and hopefully few prototypes,
15421     which can conflict with char vprintf(); below.  */
15422 #include <assert.h>
15423 /* Override any gcc2 internal prototype to avoid an error.  */
15424 /* We use char because int might match the return type of a gcc2
15425     builtin and then its argument prototype would still apply.  */
15426 char vprintf();
15427 char (*f)();
15428
15429 int main() {
15430
15431 /* The GNU C library defines this for functions which it implements
15432     to always fail with ENOSYS.  Some functions are actually named
15433     something starting with __ and the normal name is an alias.  */
15434 #if defined (__stub_vprintf) || defined (__stub___vprintf)
15435 choke me
15436 #else
15437 f = vprintf;
15438 #endif
15439
15440 ; return 0; }
15441 EOF
15442 if { (eval echo configure:15443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15443   rm -rf conftest*
15444   eval "ac_cv_func_vprintf=yes"
15445 else
15446   echo "configure: failed program was:" >&5
15447   cat conftest.$ac_ext >&5
15448   rm -rf conftest*
15449   eval "ac_cv_func_vprintf=no"
15450 fi
15451 rm -f conftest*
15452 fi
15453
15454 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
15455   echo "$ac_t""yes" 1>&6
15456   cat >> confdefs.h <<\EOF
15457 #define HAVE_VPRINTF 1
15458 EOF
15459
15460 else
15461   echo "$ac_t""no" 1>&6
15462 fi
15463
15464 if test "$ac_cv_func_vprintf" != yes; then
15465 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
15466 echo "configure:15467: checking for _doprnt" >&5
15467 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
15468   echo $ac_n "(cached) $ac_c" 1>&6
15469 else
15470   cat > conftest.$ac_ext <<EOF
15471 #line 15472 "configure"
15472 #include "confdefs.h"
15473 /* System header to define __stub macros and hopefully few prototypes,
15474     which can conflict with char _doprnt(); below.  */
15475 #include <assert.h>
15476 /* Override any gcc2 internal prototype to avoid an error.  */
15477 /* We use char because int might match the return type of a gcc2
15478     builtin and then its argument prototype would still apply.  */
15479 char _doprnt();
15480 char (*f)();
15481
15482 int main() {
15483
15484 /* The GNU C library defines this for functions which it implements
15485     to always fail with ENOSYS.  Some functions are actually named
15486     something starting with __ and the normal name is an alias.  */
15487 #if defined (__stub__doprnt) || defined (__stub____doprnt)
15488 choke me
15489 #else
15490 f = _doprnt;
15491 #endif
15492
15493 ; return 0; }
15494 EOF
15495 if { (eval echo configure:15496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15496   rm -rf conftest*
15497   eval "ac_cv_func__doprnt=yes"
15498 else
15499   echo "configure: failed program was:" >&5
15500   cat conftest.$ac_ext >&5
15501   rm -rf conftest*
15502   eval "ac_cv_func__doprnt=no"
15503 fi
15504 rm -f conftest*
15505 fi
15506
15507 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
15508   echo "$ac_t""yes" 1>&6
15509   cat >> confdefs.h <<\EOF
15510 #define HAVE_DOPRNT 1
15511 EOF
15512
15513 else
15514   echo "$ac_t""no" 1>&6
15515 fi
15516
15517 fi
15518
15519
15520 if test $ac_cv_func_vprintf = yes ; then
15521                 for ac_func in vsnprintf vsprintf
15522 do
15523 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15524 echo "configure:15525: checking for $ac_func" >&5
15525 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15526   echo $ac_n "(cached) $ac_c" 1>&6
15527 else
15528   cat > conftest.$ac_ext <<EOF
15529 #line 15530 "configure"
15530 #include "confdefs.h"
15531 /* System header to define __stub macros and hopefully few prototypes,
15532     which can conflict with char $ac_func(); below.  */
15533 #include <assert.h>
15534 /* Override any gcc2 internal prototype to avoid an error.  */
15535 /* We use char because int might match the return type of a gcc2
15536     builtin and then its argument prototype would still apply.  */
15537 char $ac_func();
15538 char (*f)();
15539
15540 int main() {
15541
15542 /* The GNU C library defines this for functions which it implements
15543     to always fail with ENOSYS.  Some functions are actually named
15544     something starting with __ and the normal name is an alias.  */
15545 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15546 choke me
15547 #else
15548 f = $ac_func;
15549 #endif
15550
15551 ; return 0; }
15552 EOF
15553 if { (eval echo configure:15554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15554   rm -rf conftest*
15555   eval "ac_cv_func_$ac_func=yes"
15556 else
15557   echo "configure: failed program was:" >&5
15558   cat conftest.$ac_ext >&5
15559   rm -rf conftest*
15560   eval "ac_cv_func_$ac_func=no"
15561 fi
15562 rm -f conftest*
15563 fi
15564
15565 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15566   echo "$ac_t""yes" 1>&6
15567     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15568   cat >> confdefs.h <<EOF
15569 #define $ac_tr_func 1
15570 EOF
15571  
15572 else
15573   echo "$ac_t""no" 1>&6
15574 fi
15575 done
15576
15577 fi
15578
15579 for ac_func in \
15580         bcopy                   \
15581         closesocket             \
15582         chroot                  \
15583         endgrent                \
15584         endpwent                \
15585         fcntl                   \
15586         flock                   \
15587         getdtablesize   \
15588         getgrgid                \
15589         gethostname             \
15590         getpass                 \
15591         getpassphrase   \
15592         getpwuid                \
15593         getpwnam                \
15594         getspnam                \
15595         gettimeofday    \
15596         initgroups              \
15597         lockf                   \
15598         memcpy                  \
15599         memmove                 \
15600         mkstemp                 \
15601         pipe                    \
15602         read                    \
15603         recv                    \
15604         recvfrom                \
15605         setpwfile               \
15606         setgid                  \
15607         setegid                 \
15608         setsid                  \
15609         setuid                  \
15610         seteuid                 \
15611         sigaction               \
15612         signal                  \
15613         sigset                  \
15614         snprintf                \
15615         strdup                  \
15616         strerror                \
15617         strpbrk                 \
15618         strrchr                 \
15619         strsep                  \
15620         strstr                  \
15621         strtol                  \
15622         strtoul                 \
15623         strspn                  \
15624         sysconf                 \
15625         waitpid                 \
15626         wait4                   \
15627         write                   \
15628         send                    \
15629         sendto                  \
15630
15631 do
15632 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15633 echo "configure:15634: checking for $ac_func" >&5
15634 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15635   echo $ac_n "(cached) $ac_c" 1>&6
15636 else
15637   cat > conftest.$ac_ext <<EOF
15638 #line 15639 "configure"
15639 #include "confdefs.h"
15640 /* System header to define __stub macros and hopefully few prototypes,
15641     which can conflict with char $ac_func(); below.  */
15642 #include <assert.h>
15643 /* Override any gcc2 internal prototype to avoid an error.  */
15644 /* We use char because int might match the return type of a gcc2
15645     builtin and then its argument prototype would still apply.  */
15646 char $ac_func();
15647 char (*f)();
15648
15649 int main() {
15650
15651 /* The GNU C library defines this for functions which it implements
15652     to always fail with ENOSYS.  Some functions are actually named
15653     something starting with __ and the normal name is an alias.  */
15654 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15655 choke me
15656 #else
15657 f = $ac_func;
15658 #endif
15659
15660 ; return 0; }
15661 EOF
15662 if { (eval echo configure:15663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15663   rm -rf conftest*
15664   eval "ac_cv_func_$ac_func=yes"
15665 else
15666   echo "configure: failed program was:" >&5
15667   cat conftest.$ac_ext >&5
15668   rm -rf conftest*
15669   eval "ac_cv_func_$ac_func=no"
15670 fi
15671 rm -f conftest*
15672 fi
15673
15674 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15675   echo "$ac_t""yes" 1>&6
15676     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15677   cat >> confdefs.h <<EOF
15678 #define $ac_tr_func 1
15679 EOF
15680  
15681 else
15682   echo "$ac_t""no" 1>&6
15683 fi
15684 done
15685
15686
15687 for ac_func in getopt tempnam
15688 do
15689 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15690 echo "configure:15691: checking for $ac_func" >&5
15691 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15692   echo $ac_n "(cached) $ac_c" 1>&6
15693 else
15694   cat > conftest.$ac_ext <<EOF
15695 #line 15696 "configure"
15696 #include "confdefs.h"
15697 /* System header to define __stub macros and hopefully few prototypes,
15698     which can conflict with char $ac_func(); below.  */
15699 #include <assert.h>
15700 /* Override any gcc2 internal prototype to avoid an error.  */
15701 /* We use char because int might match the return type of a gcc2
15702     builtin and then its argument prototype would still apply.  */
15703 char $ac_func();
15704 char (*f)();
15705
15706 int main() {
15707
15708 /* The GNU C library defines this for functions which it implements
15709     to always fail with ENOSYS.  Some functions are actually named
15710     something starting with __ and the normal name is an alias.  */
15711 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15712 choke me
15713 #else
15714 f = $ac_func;
15715 #endif
15716
15717 ; return 0; }
15718 EOF
15719 if { (eval echo configure:15720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15720   rm -rf conftest*
15721   eval "ac_cv_func_$ac_func=yes"
15722 else
15723   echo "configure: failed program was:" >&5
15724   cat conftest.$ac_ext >&5
15725   rm -rf conftest*
15726   eval "ac_cv_func_$ac_func=no"
15727 fi
15728 rm -f conftest*
15729 fi
15730
15731 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15732   echo "$ac_t""yes" 1>&6
15733     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15734   cat >> confdefs.h <<EOF
15735 #define $ac_tr_func 1
15736 EOF
15737  
15738 else
15739   echo "$ac_t""no" 1>&6
15740 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
15741 fi
15742 done
15743
15744
15745
15746 if test "$ac_cv_func_getopt" != yes; then
15747     LIBSRCS="$LIBSRCS getopt.c"
15748 fi
15749
15750 if test "$ac_cv_func_tempnam" != yes; then
15751     LIBSRCS="$LIBSRCS tempnam.c"
15752 fi
15753
15754 # Check Configuration
15755 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
15756 echo "configure:15757: checking declaration of sys_errlist" >&5
15757 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
15758   echo $ac_n "(cached) $ac_c" 1>&6
15759 else
15760   
15761         cat > conftest.$ac_ext <<EOF
15762 #line 15763 "configure"
15763 #include "confdefs.h"
15764
15765 #include <stdio.h>
15766 #include <sys/types.h>
15767 #include <errno.h>
15768 #ifdef WINNT
15769 #include <stdlib.h>
15770 #endif 
15771 int main() {
15772 char *c = (char *) *sys_errlist
15773 ; return 0; }
15774 EOF
15775 if { (eval echo configure:15776: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15776   rm -rf conftest*
15777   ol_cv_dcl_sys_errlist=yes
15778         ol_cv_have_sys_errlist=yes
15779 else
15780   echo "configure: failed program was:" >&5
15781   cat conftest.$ac_ext >&5
15782   rm -rf conftest*
15783   ol_cv_dcl_sys_errlist=no
15784 fi
15785 rm -f conftest*
15786 fi
15787
15788 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
15789 #
15790 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
15791 if test $ol_cv_dcl_sys_errlist = no ; then
15792         cat >> confdefs.h <<\EOF
15793 #define DECL_SYS_ERRLIST 1
15794 EOF
15795
15796
15797         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
15798 echo "configure:15799: checking existence of sys_errlist" >&5
15799 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
15800   echo $ac_n "(cached) $ac_c" 1>&6
15801 else
15802   
15803                 cat > conftest.$ac_ext <<EOF
15804 #line 15805 "configure"
15805 #include "confdefs.h"
15806 #include <errno.h>
15807 int main() {
15808 char *c = (char *) *sys_errlist
15809 ; return 0; }
15810 EOF
15811 if { (eval echo configure:15812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15812   rm -rf conftest*
15813   ol_cv_have_sys_errlist=yes
15814 else
15815   echo "configure: failed program was:" >&5
15816   cat conftest.$ac_ext >&5
15817   rm -rf conftest*
15818   ol_cv_have_sys_errlist=no
15819 fi
15820 rm -f conftest*
15821 fi
15822
15823 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
15824 fi
15825 if test $ol_cv_have_sys_errlist = yes ; then
15826         cat >> confdefs.h <<\EOF
15827 #define HAVE_SYS_ERRLIST 1
15828 EOF
15829
15830 fi
15831
15832
15833
15834 if test "$ol_enable_debug" != no ; then
15835         cat >> confdefs.h <<\EOF
15836 #define LDAP_DEBUG 1
15837 EOF
15838
15839 fi
15840 if test "$ol_enable_syslog" = yes ; then
15841         cat >> confdefs.h <<\EOF
15842 #define LDAP_SYSLOG 1
15843 EOF
15844
15845 fi
15846 if test "$ol_enable_cache" = no ; then
15847         cat >> confdefs.h <<\EOF
15848 #define LDAP_NOCACHE 1
15849 EOF
15850
15851 fi
15852 if test "$ol_link_kbind" != no ; then
15853         cat >> confdefs.h <<\EOF
15854 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
15855 EOF
15856
15857 fi
15858 if test "$ol_enable_proctitle" != no ; then
15859         cat >> confdefs.h <<\EOF
15860 #define LDAP_PROCTITLE 1
15861 EOF
15862
15863 fi
15864 if test "$ol_enable_referrals" != no ; then
15865         cat >> confdefs.h <<\EOF
15866 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
15867 EOF
15868
15869 fi
15870 if test "$ol_enable_local" != no; then
15871         cat >> confdefs.h <<\EOF
15872 #define LDAP_PF_LOCAL 1
15873 EOF
15874
15875 fi
15876 if test "$ol_link_ipv6" != no; then
15877         cat >> confdefs.h <<\EOF
15878 #define LDAP_PF_INET6 1
15879 EOF
15880
15881 fi
15882 if test "$ol_enable_cleartext" != no ; then
15883         cat >> confdefs.h <<\EOF
15884 #define SLAPD_CLEARTEXT 1
15885 EOF
15886
15887 fi
15888 if test "$ol_enable_crypt" != no ; then
15889         cat >> confdefs.h <<\EOF
15890 #define SLAPD_CRYPT 1
15891 EOF
15892
15893 fi
15894 if test "$ol_link_kpasswd" != no ; then
15895         cat >> confdefs.h <<\EOF
15896 #define SLAPD_KPASSWD 1
15897 EOF
15898
15899 fi
15900 if test "$ol_link_spasswd" != no ; then
15901         cat >> confdefs.h <<\EOF
15902 #define SLAPD_SPASSWD 1
15903 EOF
15904
15905 fi
15906 if test "$ol_enable_phonetic" != no ; then
15907         cat >> confdefs.h <<\EOF
15908 #define SLAPD_PHONETIC 1
15909 EOF
15910
15911 fi
15912 if test "$ol_enable_rlookups" != no ; then
15913         cat >> confdefs.h <<\EOF
15914 #define SLAPD_RLOOKUPS 1
15915 EOF
15916
15917 fi
15918 if test "$ol_enable_aci" != no ; then
15919         cat >> confdefs.h <<\EOF
15920 #define SLAPD_ACI_ENABLED 1
15921 EOF
15922
15923 fi
15924
15925 if test "$ol_link_modules" != no ; then
15926         cat >> confdefs.h <<\EOF
15927 #define SLAPD_MODULES 1
15928 EOF
15929
15930         BUILD_SLAPD=yes
15931         SLAPD_MODULES_LDFLAGS="-dlopen self"
15932 fi
15933
15934 if test "$ol_link_dnssrv" != no ; then
15935         cat >> confdefs.h <<\EOF
15936 #define SLAPD_DNSSRV 1
15937 EOF
15938
15939         BUILD_SLAPD=yes
15940         BUILD_DNSSRV=yes
15941         if test "$ol_with_dnssrv_module" != static ; then
15942                 cat >> confdefs.h <<\EOF
15943 #define SLAPD_DNSSRV_DYNAMIC 1
15944 EOF
15945
15946                 BUILD_DNSSRV=mod
15947                 BUILD_DNSSRV_DYNAMIC=shared
15948                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
15949         fi
15950 fi
15951
15952 if test "$ol_enable_ldap" != no ; then
15953         cat >> confdefs.h <<\EOF
15954 #define SLAPD_LDAP 1
15955 EOF
15956
15957         BUILD_SLAPD=yes
15958         BUILD_LDAP=yes
15959         if test "$ol_with_ldap_module" != static ; then
15960                 cat >> confdefs.h <<\EOF
15961 #define SLAPD_LDAP_DYNAMIC 1
15962 EOF
15963
15964                 BUILD_LDAP=mod
15965                 BUILD_LDAP_DYNAMIC=shared
15966                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
15967         fi
15968 fi
15969
15970 if test "$ol_link_ldbm" != no ; then
15971         cat >> confdefs.h <<\EOF
15972 #define SLAPD_LDBM 1
15973 EOF
15974
15975         BUILD_SLAPD=yes
15976         BUILD_LDBM=yes
15977         if test "$ol_with_ldbm_module" != static ; then
15978                 cat >> confdefs.h <<\EOF
15979 #define SLAPD_LDBM_DYNAMIC 1
15980 EOF
15981
15982                 BUILD_LDBM=mod
15983                 BUILD_LDBM_DYNAMIC=shared
15984                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
15985         fi
15986 fi
15987
15988 if test "$ol_enable_passwd" != no ; then
15989         cat >> confdefs.h <<\EOF
15990 #define SLAPD_PASSWD 1
15991 EOF
15992
15993         BUILD_SLAPD=yes
15994         BUILD_PASSWD=yes
15995         if test "$ol_with_passwd_module" != static ; then
15996                 cat >> confdefs.h <<\EOF
15997 #define SLAPD_PASSWD_DYNAMIC 1
15998 EOF
15999
16000                 BUILD_PASSWD=mod
16001                 BUILD_PASSWD_DYNAMIC=shared
16002                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
16003         fi
16004 fi
16005
16006 if test "$ol_enable_shell" != no ; then
16007         cat >> confdefs.h <<\EOF
16008 #define SLAPD_SHELL 1
16009 EOF
16010
16011         BUILD_SLAPD=yes
16012         BUILD_SHELL=yes
16013         if test "$ol_with_shell_module" != static ; then
16014                 cat >> confdefs.h <<\EOF
16015 #define SLAPD_SHELL_DYNAMIC 1
16016 EOF
16017
16018                 BUILD_SHELL=mod
16019                 BUILD_SHELL_DYNAMIC=shared
16020                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
16021         fi
16022 fi
16023
16024 if test "$ol_enable_sql" != no ; then
16025         cat >> confdefs.h <<\EOF
16026 #define SLAPD_SQL 1
16027 EOF
16028
16029         BUILD_SLAPD=yes
16030         BUILD_SQL=yes
16031         if test "$ol_with_sql_module" != static; then
16032                 cat >> confdefs.h <<\EOF
16033 #define SLAPD_SQL_DYNAMIC 1
16034 EOF
16035
16036                 BUILD_SQL=mod
16037                 BUILD_SQL_DYNAMIC=shared
16038                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
16039         fi
16040 fi
16041
16042 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
16043         $BUILD_SLAPD = yes ; then
16044         BUILD_SLURPD=yes
16045 fi
16046
16047
16048 if test "$LINK_BINS_DYNAMIC" = yes; then
16049     LIB_LINKAGE=DYN
16050     LT_LIB_LINKAGE=shared
16051 else
16052     LIB_LINKAGE=STAT
16053     LT_LIB_LINKAGE=static
16054 fi
16055
16056 if test "$ac_cv_mingw32" = yes ; then
16057     PLAT=NT
16058     DYN_EXT=dll
16059 else
16060     PLAT=UNIX
16061     DYN_EXT=so
16062 fi
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072   
16073   
16074   
16075   
16076   
16077   
16078   
16079   
16080   
16081   
16082   
16083   
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114 trap '' 1 2 15
16115
16116 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
16117
16118 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16119 # Let make expand exec_prefix.
16120 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16121
16122 # Any assignment to VPATH causes Sun make to only execute
16123 # the first set of double-colon rules, so remove it if not needed.
16124 # If there is a colon in the path, we need to keep it.
16125 if test "x$srcdir" = x.; then
16126   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
16127 fi
16128
16129 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
16130
16131 DEFS=-DHAVE_CONFIG_H
16132
16133 # Without the "./", some shells look in PATH for config.status.
16134 : ${CONFIG_STATUS=./config.status}
16135
16136 echo creating $CONFIG_STATUS
16137 rm -f $CONFIG_STATUS
16138 cat > $CONFIG_STATUS <<EOF
16139 #! /bin/sh
16140 # Generated automatically by configure.
16141 # Run this file to recreate the current configuration.
16142 # This directory was configured as follows,
16143 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
16144 #
16145 # $0 $ac_configure_args
16146 #
16147 # Compiler output produced by configure, useful for debugging
16148 # configure, is in ./config.log if it exists.
16149
16150 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
16151 for ac_option
16152 do
16153   case "\$ac_option" in
16154   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16155     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
16156     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
16157   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
16158     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
16159     exit 0 ;;
16160   -help | --help | --hel | --he | --h)
16161     echo "\$ac_cs_usage"; exit 0 ;;
16162   *) echo "\$ac_cs_usage"; exit 1 ;;
16163   esac
16164 done
16165
16166 ac_given_srcdir=$srcdir
16167 ac_given_INSTALL="$INSTALL"
16168
16169 trap 'rm -fr `echo "\
16170 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16171 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16172 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16173 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16174 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16175 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16176 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16177 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16178 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16179 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16180 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16181 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16182 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16183 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16184 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
16185 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16186 include/Makefile:build/top.mk:include/Makefile.in \
16187 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16188 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16189 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16190 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16191 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16192 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16193 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16194 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16195 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16196 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16197 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16198 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16199 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16200 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16201 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16202 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16203 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16204 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16205 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16206 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16207 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16208 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16209 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16210 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16211  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
16212 EOF
16213 cat >> $CONFIG_STATUS <<EOF
16214
16215 # Protect against being on the right side of a sed subst in config.status.
16216 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
16217  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
16218 $ac_vpsub
16219 $extrasub
16220 s%@SHELL@%$SHELL%g
16221 s%@CFLAGS@%$CFLAGS%g
16222 s%@CPPFLAGS@%$CPPFLAGS%g
16223 s%@CXXFLAGS@%$CXXFLAGS%g
16224 s%@FFLAGS@%$FFLAGS%g
16225 s%@DEFS@%$DEFS%g
16226 s%@LDFLAGS@%$LDFLAGS%g
16227 s%@LIBS@%$LIBS%g
16228 s%@exec_prefix@%$exec_prefix%g
16229 s%@prefix@%$prefix%g
16230 s%@program_transform_name@%$program_transform_name%g
16231 s%@bindir@%$bindir%g
16232 s%@sbindir@%$sbindir%g
16233 s%@libexecdir@%$libexecdir%g
16234 s%@datadir@%$datadir%g
16235 s%@sysconfdir@%$sysconfdir%g
16236 s%@sharedstatedir@%$sharedstatedir%g
16237 s%@localstatedir@%$localstatedir%g
16238 s%@libdir@%$libdir%g
16239 s%@includedir@%$includedir%g
16240 s%@oldincludedir@%$oldincludedir%g
16241 s%@infodir@%$infodir%g
16242 s%@mandir@%$mandir%g
16243 s%@host@%$host%g
16244 s%@host_alias@%$host_alias%g
16245 s%@host_cpu@%$host_cpu%g
16246 s%@host_vendor@%$host_vendor%g
16247 s%@host_os@%$host_os%g
16248 s%@target@%$target%g
16249 s%@target_alias@%$target_alias%g
16250 s%@target_cpu@%$target_cpu%g
16251 s%@target_vendor@%$target_vendor%g
16252 s%@target_os@%$target_os%g
16253 s%@build@%$build%g
16254 s%@build_alias@%$build_alias%g
16255 s%@build_cpu@%$build_cpu%g
16256 s%@build_vendor@%$build_vendor%g
16257 s%@build_os@%$build_os%g
16258 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
16259 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
16260 s%@INSTALL_DATA@%$INSTALL_DATA%g
16261 s%@PACKAGE@%$PACKAGE%g
16262 s%@VERSION@%$VERSION%g
16263 s%@ACLOCAL@%$ACLOCAL%g
16264 s%@AUTOCONF@%$AUTOCONF%g
16265 s%@AUTOMAKE@%$AUTOMAKE%g
16266 s%@AUTOHEADER@%$AUTOHEADER%g
16267 s%@MAKEINFO@%$MAKEINFO%g
16268 s%@install_sh@%$install_sh%g
16269 s%@AMTAR@%$AMTAR%g
16270 s%@AWK@%$AWK%g
16271 s%@AMTARFLAGS@%$AMTARFLAGS%g
16272 s%@SET_MAKE@%$SET_MAKE%g
16273 s%@top_builddir@%$top_builddir%g
16274 s%@ldap_subdir@%$ldap_subdir%g
16275 s%@CC@%$CC%g
16276 s%@RANLIB@%$RANLIB%g
16277 s%@LN_S@%$LN_S%g
16278 s%@DLLTOOL@%$DLLTOOL%g
16279 s%@AS@%$AS%g
16280 s%@OBJDUMP@%$OBJDUMP%g
16281 s%@LIBTOOL@%$LIBTOOL%g
16282 s%@LN_H@%$LN_H%g
16283 s%@SENDMAIL@%$SENDMAIL%g
16284 s%@EDITOR@%$EDITOR%g
16285 s%@FINGER@%$FINGER%g
16286 s%@CPP@%$CPP%g
16287 s%@EXEEXT@%$EXEEXT%g
16288 s%@OBJEXT@%$OBJEXT%g
16289 s%@OL_MKDEP@%$OL_MKDEP%g
16290 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
16291 s%@LIBOBJS@%$LIBOBJS%g
16292 s%@LIBSRCS@%$LIBSRCS%g
16293 s%@PLAT@%$PLAT%g
16294 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
16295 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
16296 s%@DYN_EXT@%$DYN_EXT%g
16297 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
16298 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
16299 s%@BUILD_LDAP@%$BUILD_LDAP%g
16300 s%@BUILD_LDBM@%$BUILD_LDBM%g
16301 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
16302 s%@BUILD_SHELL@%$BUILD_SHELL%g
16303 s%@BUILD_SQL@%$BUILD_SQL%g
16304 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
16305 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
16306 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
16307 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
16308 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
16309 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
16310 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
16311 s%@LDAP_LIBS@%$LDAP_LIBS%g
16312 s%@LDIF_LIBS@%$LDIF_LIBS%g
16313 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
16314 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
16315 s%@LDBM_LIBS@%$LDBM_LIBS%g
16316 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
16317 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
16318 s%@WRAP_LIBS@%$WRAP_LIBS%g
16319 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
16320 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
16321 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
16322 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
16323 s%@KRB4_LIBS@%$KRB4_LIBS%g
16324 s%@KRB5_LIBS@%$KRB5_LIBS%g
16325 s%@READLINE_LIBS@%$READLINE_LIBS%g
16326 s%@SASL_LIBS@%$SASL_LIBS%g
16327 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
16328 s%@TLS_LIBS@%$TLS_LIBS%g
16329 s%@MODULES_LIBS@%$MODULES_LIBS%g
16330 s%@AUTH_LIBS@%$AUTH_LIBS%g
16331 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
16332 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
16333 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
16334
16335 CEOF
16336 EOF
16337
16338 cat >> $CONFIG_STATUS <<\EOF
16339
16340 # Split the substitutions into bite-sized pieces for seds with
16341 # small command number limits, like on Digital OSF/1 and HP-UX.
16342 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
16343 ac_file=1 # Number of current file.
16344 ac_beg=1 # First line for current file.
16345 ac_end=$ac_max_sed_cmds # Line after last line for current file.
16346 ac_more_lines=:
16347 ac_sed_cmds=""
16348 while $ac_more_lines; do
16349   if test $ac_beg -gt 1; then
16350     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
16351   else
16352     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
16353   fi
16354   if test ! -s conftest.s$ac_file; then
16355     ac_more_lines=false
16356     rm -f conftest.s$ac_file
16357   else
16358     if test -z "$ac_sed_cmds"; then
16359       ac_sed_cmds="sed -f conftest.s$ac_file"
16360     else
16361       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
16362     fi
16363     ac_file=`expr $ac_file + 1`
16364     ac_beg=$ac_end
16365     ac_end=`expr $ac_end + $ac_max_sed_cmds`
16366   fi
16367 done
16368 if test -z "$ac_sed_cmds"; then
16369   ac_sed_cmds=cat
16370 fi
16371 EOF
16372
16373 cat >> $CONFIG_STATUS <<EOF
16374
16375 CONFIG_FILES=\${CONFIG_FILES-"\
16376 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16377 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16378 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16379 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16380 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16381 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16382 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16383 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16384 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16385 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16386 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16387 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16388 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16389 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16390 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
16391 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16392 include/Makefile:build/top.mk:include/Makefile.in \
16393 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16394 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16395 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16396 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16397 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16398 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16399 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16400 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16401 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16402 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16403 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16404 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16405 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16406 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16407 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16408 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16409 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16410 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16411 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16412 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16413 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16414 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16415 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16416 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16417 "}
16418 EOF
16419 cat >> $CONFIG_STATUS <<\EOF
16420 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
16421   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16422   case "$ac_file" in
16423   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16424        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16425   *) ac_file_in="${ac_file}.in" ;;
16426   esac
16427
16428   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
16429
16430   # Remove last slash and all that follows it.  Not all systems have dirname.
16431   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16432   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16433     # The file is in a subdirectory.
16434     test ! -d "$ac_dir" && mkdir "$ac_dir"
16435     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
16436     # A "../" for each directory in $ac_dir_suffix.
16437     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
16438   else
16439     ac_dir_suffix= ac_dots=
16440   fi
16441
16442   case "$ac_given_srcdir" in
16443   .)  srcdir=.
16444       if test -z "$ac_dots"; then top_srcdir=.
16445       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
16446   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
16447   *) # Relative path.
16448     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
16449     top_srcdir="$ac_dots$ac_given_srcdir" ;;
16450   esac
16451
16452   case "$ac_given_INSTALL" in
16453   [/$]*) INSTALL="$ac_given_INSTALL" ;;
16454   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
16455   esac
16456
16457   echo creating "$ac_file"
16458   rm -f "$ac_file"
16459   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
16460   case "$ac_file" in
16461   *[Mm]akefile*) ac_comsub="1i\\
16462 # $configure_input" ;;
16463   *) ac_comsub= ;;
16464   esac
16465
16466   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16467   sed -e "$ac_comsub
16468 s%@configure_input@%$configure_input%g
16469 s%@srcdir@%$srcdir%g
16470 s%@top_srcdir@%$top_srcdir%g
16471 s%@INSTALL@%$INSTALL%g
16472 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
16473 fi; done
16474 rm -f conftest.s*
16475
16476 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16477 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16478 #
16479 # ac_d sets the value in "#define NAME VALUE" lines.
16480 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16481 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
16482 ac_dC='\3'
16483 ac_dD='%g'
16484 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16485 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16486 ac_uB='\([      ]\)%\1#\2define\3'
16487 ac_uC=' '
16488 ac_uD='\4%g'
16489 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16490 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16491 ac_eB='$%\1#\2define\3'
16492 ac_eC=' '
16493 ac_eD='%g'
16494
16495 if test "${CONFIG_HEADERS+set}" != set; then
16496 EOF
16497 cat >> $CONFIG_STATUS <<EOF
16498   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
16499 EOF
16500 cat >> $CONFIG_STATUS <<\EOF
16501 fi
16502 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
16503   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16504   case "$ac_file" in
16505   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16506        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16507   *) ac_file_in="${ac_file}.in" ;;
16508   esac
16509
16510   echo creating $ac_file
16511
16512   rm -f conftest.frag conftest.in conftest.out
16513   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16514   cat $ac_file_inputs > conftest.in
16515
16516 EOF
16517
16518 # Transform confdefs.h into a sed script conftest.vals that substitutes
16519 # the proper values into config.h.in to produce config.h.  And first:
16520 # Protect against being on the right side of a sed subst in config.status.
16521 # Protect against being in an unquoted here document in config.status.
16522 rm -f conftest.vals
16523 cat > conftest.hdr <<\EOF
16524 s/[\\&%]/\\&/g
16525 s%[\\$`]%\\&%g
16526 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
16527 s%ac_d%ac_u%gp
16528 s%ac_u%ac_e%gp
16529 EOF
16530 sed -n -f conftest.hdr confdefs.h > conftest.vals
16531 rm -f conftest.hdr
16532
16533 # This sed command replaces #undef with comments.  This is necessary, for
16534 # example, in the case of _POSIX_SOURCE, which is predefined and required
16535 # on some systems where configure will not decide to define it.
16536 cat >> conftest.vals <<\EOF
16537 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
16538 EOF
16539
16540 # Break up conftest.vals because some shells have a limit on
16541 # the size of here documents, and old seds have small limits too.
16542
16543 rm -f conftest.tail
16544 while :
16545 do
16546   ac_lines=`grep -c . conftest.vals`
16547   # grep -c gives empty output for an empty file on some AIX systems.
16548   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
16549   # Write a limited-size here document to conftest.frag.
16550   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
16551   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
16552   echo 'CEOF
16553   sed -f conftest.frag conftest.in > conftest.out
16554   rm -f conftest.in
16555   mv conftest.out conftest.in
16556 ' >> $CONFIG_STATUS
16557   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16558   rm -f conftest.vals
16559   mv conftest.tail conftest.vals
16560 done
16561 rm -f conftest.vals
16562
16563 cat >> $CONFIG_STATUS <<\EOF
16564   rm -f conftest.frag conftest.h
16565   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
16566   cat conftest.in >> conftest.h
16567   rm -f conftest.in
16568   if cmp -s $ac_file conftest.h 2>/dev/null; then
16569     echo "$ac_file is unchanged"
16570     rm -f conftest.h
16571   else
16572     # Remove last slash and all that follows it.  Not all systems have dirname.
16573       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16574       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16575       # The file is in a subdirectory.
16576       test ! -d "$ac_dir" && mkdir "$ac_dir"
16577     fi
16578     rm -f $ac_file
16579     mv conftest.h $ac_file
16580   fi
16581 fi; done
16582
16583 EOF
16584 cat >> $CONFIG_STATUS <<EOF
16585
16586 EOF
16587 cat >> $CONFIG_STATUS <<\EOF
16588
16589 date > stamp-h
16590 echo Please \"make depend\" to build dependencies
16591
16592 exit 0
16593 EOF
16594 chmod +x $CONFIG_STATUS
16595 rm -fr confdefs* $ac_clean_files
16596 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
16597