]> git.sur5r.net Git - openldap/blob - configure
Sync with DEVEL, namely -llber handening fixes
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP 
4
5 # Copyright 1998-2000 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-2000 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 sigset in -lV3""... $ac_c" 1>&6
4527 echo "configure:4528: checking for sigset in -lV3" >&5
4528 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4529 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4530   echo $ac_n "(cached) $ac_c" 1>&6
4531 else
4532   ac_save_LIBS="$LIBS"
4533 LIBS="-lV3  $LIBS"
4534 cat > conftest.$ac_ext <<EOF
4535 #line 4536 "configure"
4536 #include "confdefs.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 sigset();
4541
4542 int main() {
4543 sigset()
4544 ; return 0; }
4545 EOF
4546 if { (eval echo configure:4547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4547   rm -rf conftest*
4548   eval "ac_cv_lib_$ac_lib_var=yes"
4549 else
4550   echo "configure: failed program was:" >&5
4551   cat conftest.$ac_ext >&5
4552   rm -rf conftest*
4553   eval "ac_cv_lib_$ac_lib_var=no"
4554 fi
4555 rm -f conftest*
4556 LIBS="$ac_save_LIBS"
4557
4558 fi
4559 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4560   echo "$ac_t""yes" 1>&6
4561     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4562     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4563   cat >> confdefs.h <<EOF
4564 #define $ac_tr_lib 1
4565 EOF
4566
4567   LIBS="-lV3 $LIBS"
4568
4569 else
4570   echo "$ac_t""no" 1>&6
4571 fi
4572
4573
4574 if test $ac_cv_header_winsock_h = yes; then
4575         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4576 echo "configure:4577: checking for winsock" >&5
4577 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4578   echo $ac_n "(cached) $ac_c" 1>&6
4579 else
4580   cat > conftest.$ac_ext <<EOF
4581 #line 4582 "configure"
4582 #include "confdefs.h"
4583 #include <winsock.h>
4584 int main() {
4585
4586                         socket(0,0,0);
4587                         select(0,NULL,NULL,NULL,NULL);
4588                         closesocket(0);
4589                         gethostname(NULL,0);
4590         
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   ol_cv_winsock=yes
4596 else
4597   echo "configure: failed program was:" >&5
4598   cat conftest.$ac_ext >&5
4599   rm -rf conftest*
4600   ol_cv_winsock=no
4601 fi
4602 rm -f conftest*]
4603 fi
4604
4605 echo "$ac_t""$ol_cv_winsock" 1>&6
4606
4607         if test $ol_cv_winsock = yes ; then
4608                 cat >> confdefs.h <<\EOF
4609 #define HAVE_WINSOCK 1
4610 EOF
4611
4612                 ac_cv_func_socket=yes
4613                 ac_cv_func_select=yes
4614                 ac_cv_func_closesocket=yes
4615                 ac_cv_func_gethostname=yes
4616         fi
4617 fi
4618
4619
4620 echo $ac_n "checking for socket""... $ac_c" 1>&6
4621 echo "configure:4622: checking for socket" >&5
4622 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4623   echo $ac_n "(cached) $ac_c" 1>&6
4624 else
4625   cat > conftest.$ac_ext <<EOF
4626 #line 4627 "configure"
4627 #include "confdefs.h"
4628 /* System header to define __stub macros and hopefully few prototypes,
4629     which can conflict with char socket(); below.  */
4630 #include <assert.h>
4631 /* Override any gcc2 internal prototype to avoid an error.  */
4632 /* We use char because int might match the return type of a gcc2
4633     builtin and then its argument prototype would still apply.  */
4634 char socket();
4635 char (*f)();
4636
4637 int main() {
4638
4639 /* The GNU C library defines this for functions which it implements
4640     to always fail with ENOSYS.  Some functions are actually named
4641     something starting with __ and the normal name is an alias.  */
4642 #if defined (__stub_socket) || defined (__stub___socket)
4643 choke me
4644 #else
4645 f = socket;
4646 #endif
4647
4648 ; return 0; }
4649 EOF
4650 if { (eval echo configure:4651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4651   rm -rf conftest*
4652   eval "ac_cv_func_socket=yes"
4653 else
4654   echo "configure: failed program was:" >&5
4655   cat conftest.$ac_ext >&5
4656   rm -rf conftest*
4657   eval "ac_cv_func_socket=no"
4658 fi
4659 rm -f conftest*
4660 fi
4661
4662 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4663   echo "$ac_t""yes" 1>&6
4664   :
4665 else
4666   echo "$ac_t""no" 1>&6
4667         
4668         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4669 echo "configure:4670: checking for main in -lsocket" >&5
4670 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4671 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4672   echo $ac_n "(cached) $ac_c" 1>&6
4673 else
4674   ac_save_LIBS="$LIBS"
4675 LIBS="-lsocket  $LIBS"
4676 cat > conftest.$ac_ext <<EOF
4677 #line 4678 "configure"
4678 #include "confdefs.h"
4679
4680 int main() {
4681 main()
4682 ; return 0; }
4683 EOF
4684 if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4685   rm -rf conftest*
4686   eval "ac_cv_lib_$ac_lib_var=yes"
4687 else
4688   echo "configure: failed program was:" >&5
4689   cat conftest.$ac_ext >&5
4690   rm -rf conftest*
4691   eval "ac_cv_lib_$ac_lib_var=no"
4692 fi
4693 rm -f conftest*
4694 LIBS="$ac_save_LIBS"
4695
4696 fi
4697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4698   echo "$ac_t""yes" 1>&6
4699     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4700     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4701   cat >> confdefs.h <<EOF
4702 #define $ac_tr_lib 1
4703 EOF
4704
4705   LIBS="-lsocket $LIBS"
4706
4707 else
4708   echo "$ac_t""no" 1>&6
4709 fi
4710
4711         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4712 echo "configure:4713: checking for main in -lnet" >&5
4713 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4714 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4715   echo $ac_n "(cached) $ac_c" 1>&6
4716 else
4717   ac_save_LIBS="$LIBS"
4718 LIBS="-lnet  $LIBS"
4719 cat > conftest.$ac_ext <<EOF
4720 #line 4721 "configure"
4721 #include "confdefs.h"
4722
4723 int main() {
4724 main()
4725 ; return 0; }
4726 EOF
4727 if { (eval echo configure:4728: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4728   rm -rf conftest*
4729   eval "ac_cv_lib_$ac_lib_var=yes"
4730 else
4731   echo "configure: failed program was:" >&5
4732   cat conftest.$ac_ext >&5
4733   rm -rf conftest*
4734   eval "ac_cv_lib_$ac_lib_var=no"
4735 fi
4736 rm -f conftest*
4737 LIBS="$ac_save_LIBS"
4738
4739 fi
4740 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4741   echo "$ac_t""yes" 1>&6
4742     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4743     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4744   cat >> confdefs.h <<EOF
4745 #define $ac_tr_lib 1
4746 EOF
4747
4748   LIBS="-lnet $LIBS"
4749
4750 else
4751   echo "$ac_t""no" 1>&6
4752 fi
4753
4754         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4755 echo "configure:4756: checking for main in -lnsl_s" >&5
4756 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4757 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4758   echo $ac_n "(cached) $ac_c" 1>&6
4759 else
4760   ac_save_LIBS="$LIBS"
4761 LIBS="-lnsl_s  $LIBS"
4762 cat > conftest.$ac_ext <<EOF
4763 #line 4764 "configure"
4764 #include "confdefs.h"
4765
4766 int main() {
4767 main()
4768 ; return 0; }
4769 EOF
4770 if { (eval echo configure:4771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4771   rm -rf conftest*
4772   eval "ac_cv_lib_$ac_lib_var=yes"
4773 else
4774   echo "configure: failed program was:" >&5
4775   cat conftest.$ac_ext >&5
4776   rm -rf conftest*
4777   eval "ac_cv_lib_$ac_lib_var=no"
4778 fi
4779 rm -f conftest*
4780 LIBS="$ac_save_LIBS"
4781
4782 fi
4783 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4784   echo "$ac_t""yes" 1>&6
4785     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4786     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4787   cat >> confdefs.h <<EOF
4788 #define $ac_tr_lib 1
4789 EOF
4790
4791   LIBS="-lnsl_s $LIBS"
4792
4793 else
4794   echo "$ac_t""no" 1>&6
4795 fi
4796
4797         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4798 echo "configure:4799: checking for main in -lnsl" >&5
4799 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4800 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4801   echo $ac_n "(cached) $ac_c" 1>&6
4802 else
4803   ac_save_LIBS="$LIBS"
4804 LIBS="-lnsl  $LIBS"
4805 cat > conftest.$ac_ext <<EOF
4806 #line 4807 "configure"
4807 #include "confdefs.h"
4808
4809 int main() {
4810 main()
4811 ; return 0; }
4812 EOF
4813 if { (eval echo configure:4814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4814   rm -rf conftest*
4815   eval "ac_cv_lib_$ac_lib_var=yes"
4816 else
4817   echo "configure: failed program was:" >&5
4818   cat conftest.$ac_ext >&5
4819   rm -rf conftest*
4820   eval "ac_cv_lib_$ac_lib_var=no"
4821 fi
4822 rm -f conftest*
4823 LIBS="$ac_save_LIBS"
4824
4825 fi
4826 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4827   echo "$ac_t""yes" 1>&6
4828     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4829     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4830   cat >> confdefs.h <<EOF
4831 #define $ac_tr_lib 1
4832 EOF
4833
4834   LIBS="-lnsl $LIBS"
4835
4836 else
4837   echo "$ac_t""no" 1>&6
4838 fi
4839
4840         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4841 echo "configure:4842: checking for socket in -linet" >&5
4842 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4843 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4844   echo $ac_n "(cached) $ac_c" 1>&6
4845 else
4846   ac_save_LIBS="$LIBS"
4847 LIBS="-linet  $LIBS"
4848 cat > conftest.$ac_ext <<EOF
4849 #line 4850 "configure"
4850 #include "confdefs.h"
4851 /* Override any gcc2 internal prototype to avoid an error.  */
4852 /* We use char because int might match the return type of a gcc2
4853     builtin and then its argument prototype would still apply.  */
4854 char socket();
4855
4856 int main() {
4857 socket()
4858 ; return 0; }
4859 EOF
4860 if { (eval echo configure:4861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4861   rm -rf conftest*
4862   eval "ac_cv_lib_$ac_lib_var=yes"
4863 else
4864   echo "configure: failed program was:" >&5
4865   cat conftest.$ac_ext >&5
4866   rm -rf conftest*
4867   eval "ac_cv_lib_$ac_lib_var=no"
4868 fi
4869 rm -f conftest*
4870 LIBS="$ac_save_LIBS"
4871
4872 fi
4873 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4874   echo "$ac_t""yes" 1>&6
4875     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4876     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4877   cat >> confdefs.h <<EOF
4878 #define $ac_tr_lib 1
4879 EOF
4880
4881   LIBS="-linet $LIBS"
4882
4883 else
4884   echo "$ac_t""no" 1>&6
4885 fi
4886
4887         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4888 echo "configure:4889: checking for main in -lgen" >&5
4889 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4890 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4891   echo $ac_n "(cached) $ac_c" 1>&6
4892 else
4893   ac_save_LIBS="$LIBS"
4894 LIBS="-lgen  $LIBS"
4895 cat > conftest.$ac_ext <<EOF
4896 #line 4897 "configure"
4897 #include "confdefs.h"
4898
4899 int main() {
4900 main()
4901 ; return 0; }
4902 EOF
4903 if { (eval echo configure:4904: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4904   rm -rf conftest*
4905   eval "ac_cv_lib_$ac_lib_var=yes"
4906 else
4907   echo "configure: failed program was:" >&5
4908   cat conftest.$ac_ext >&5
4909   rm -rf conftest*
4910   eval "ac_cv_lib_$ac_lib_var=no"
4911 fi
4912 rm -f conftest*
4913 LIBS="$ac_save_LIBS"
4914
4915 fi
4916 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4917   echo "$ac_t""yes" 1>&6
4918     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4919     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4920   cat >> confdefs.h <<EOF
4921 #define $ac_tr_lib 1
4922 EOF
4923
4924   LIBS="-lgen $LIBS"
4925
4926 else
4927   echo "$ac_t""no" 1>&6
4928 fi
4929
4930
4931 fi
4932
4933
4934 echo $ac_n "checking for select""... $ac_c" 1>&6
4935 echo "configure:4936: checking for select" >&5
4936 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4937   echo $ac_n "(cached) $ac_c" 1>&6
4938 else
4939   cat > conftest.$ac_ext <<EOF
4940 #line 4941 "configure"
4941 #include "confdefs.h"
4942 /* System header to define __stub macros and hopefully few prototypes,
4943     which can conflict with char select(); below.  */
4944 #include <assert.h>
4945 /* Override any gcc2 internal prototype to avoid an error.  */
4946 /* We use char because int might match the return type of a gcc2
4947     builtin and then its argument prototype would still apply.  */
4948 char select();
4949 char (*f)();
4950
4951 int main() {
4952
4953 /* The GNU C library defines this for functions which it implements
4954     to always fail with ENOSYS.  Some functions are actually named
4955     something starting with __ and the normal name is an alias.  */
4956 #if defined (__stub_select) || defined (__stub___select)
4957 choke me
4958 #else
4959 f = select;
4960 #endif
4961
4962 ; return 0; }
4963 EOF
4964 if { (eval echo configure:4965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4965   rm -rf conftest*
4966   eval "ac_cv_func_select=yes"
4967 else
4968   echo "configure: failed program was:" >&5
4969   cat conftest.$ac_ext >&5
4970   rm -rf conftest*
4971   eval "ac_cv_func_select=no"
4972 fi
4973 rm -f conftest*
4974 fi
4975
4976 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4977   echo "$ac_t""yes" 1>&6
4978   :
4979 else
4980   echo "$ac_t""no" 1>&6
4981 { echo "configure: error: select() required." 1>&2; exit 1; }
4982 fi
4983
4984
4985 if test "${ac_cv_header_winsock_h}" != yes; then
4986                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4987 echo "configure:4988: checking types of arguments for select()" >&5
4988  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
4989   echo $ac_n "(cached) $ac_c" 1>&6
4990 else
4991    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
4992   echo $ac_n "(cached) $ac_c" 1>&6
4993 else
4994     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
4995   echo $ac_n "(cached) $ac_c" 1>&6
4996 else
4997      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4998      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4999       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5000        cat > conftest.$ac_ext <<EOF
5001 #line 5002 "configure"
5002 #include "confdefs.h"
5003 #ifdef HAVE_SYS_TYPES_H
5004 #include <sys/types.h>
5005 #endif
5006 #ifdef HAVE_SYS_TIME_H
5007 #include <sys/time.h>
5008 #endif
5009 #ifdef HAVE_SYS_SELECT_H
5010 #include <sys/select.h>
5011 #endif
5012 #ifdef HAVE_SYS_SOCKET_H
5013 #include <sys/socket.h>
5014 #endif
5015 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);
5016 int main() {
5017
5018 ; return 0; }
5019 EOF
5020 if { (eval echo configure:5021: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5021   rm -rf conftest*
5022           ac_not_found=no ; break 3
5023 else
5024   echo "configure: failed program was:" >&5
5025   cat conftest.$ac_ext >&5
5026   rm -rf conftest*
5027   ac_not_found=yes
5028 fi
5029 rm -f conftest*
5030       done
5031      done
5032     done
5033    
5034 fi
5035   
5036 fi
5037  
5038 fi
5039  if test "$ac_not_found" = yes; then
5040   ac_cv_func_select_arg1=int 
5041   ac_cv_func_select_arg234='int *' 
5042   ac_cv_func_select_arg5='struct timeval *'
5043  fi
5044  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5045  cat >> confdefs.h <<EOF
5046 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5047 EOF
5048
5049  cat >> confdefs.h <<EOF
5050 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5051 EOF
5052
5053  cat >> confdefs.h <<EOF
5054 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5055 EOF
5056
5057
5058 fi
5059
5060
5061 for ac_hdr in regex.h 
5062 do
5063 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5064 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5065 echo "configure:5066: checking for $ac_hdr" >&5
5066 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5067   echo $ac_n "(cached) $ac_c" 1>&6
5068 else
5069   cat > conftest.$ac_ext <<EOF
5070 #line 5071 "configure"
5071 #include "confdefs.h"
5072 #include <$ac_hdr>
5073 EOF
5074 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5075 { (eval echo configure:5076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5076 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5077 if test -z "$ac_err"; then
5078   rm -rf conftest*
5079   eval "ac_cv_header_$ac_safe=yes"
5080 else
5081   echo "$ac_err" >&5
5082   echo "configure: failed program was:" >&5
5083   cat conftest.$ac_ext >&5
5084   rm -rf conftest*
5085   eval "ac_cv_header_$ac_safe=no"
5086 fi
5087 rm -f conftest*
5088 fi
5089 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5090   echo "$ac_t""yes" 1>&6
5091     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5092   cat >> confdefs.h <<EOF
5093 #define $ac_tr_hdr 1
5094 EOF
5095  
5096 else
5097   echo "$ac_t""no" 1>&6
5098 fi
5099 done
5100
5101 if test "$ac_cv_header_regex_h" != yes ; then
5102         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5103 fi
5104 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5105 echo "configure:5106: checking for regfree" >&5
5106 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5107   echo $ac_n "(cached) $ac_c" 1>&6
5108 else
5109   cat > conftest.$ac_ext <<EOF
5110 #line 5111 "configure"
5111 #include "confdefs.h"
5112 /* System header to define __stub macros and hopefully few prototypes,
5113     which can conflict with char regfree(); below.  */
5114 #include <assert.h>
5115 /* Override any gcc2 internal prototype to avoid an error.  */
5116 /* We use char because int might match the return type of a gcc2
5117     builtin and then its argument prototype would still apply.  */
5118 char regfree();
5119 char (*f)();
5120
5121 int main() {
5122
5123 /* The GNU C library defines this for functions which it implements
5124     to always fail with ENOSYS.  Some functions are actually named
5125     something starting with __ and the normal name is an alias.  */
5126 #if defined (__stub_regfree) || defined (__stub___regfree)
5127 choke me
5128 #else
5129 f = regfree;
5130 #endif
5131
5132 ; return 0; }
5133 EOF
5134 if { (eval echo configure:5135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5135   rm -rf conftest*
5136   eval "ac_cv_func_regfree=yes"
5137 else
5138   echo "configure: failed program was:" >&5
5139   cat conftest.$ac_ext >&5
5140   rm -rf conftest*
5141   eval "ac_cv_func_regfree=no"
5142 fi
5143 rm -f conftest*
5144 fi
5145
5146 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5147   echo "$ac_t""yes" 1>&6
5148   :
5149 else
5150   echo "$ac_t""no" 1>&6
5151 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5152 fi
5153
5154
5155
5156 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5157 echo "configure:5158: checking for compatible POSIX regex" >&5
5158 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5159   echo $ac_n "(cached) $ac_c" 1>&6
5160 else
5161   
5162         if test "$cross_compiling" = yes; then
5163   ol_cv_c_posix_regex=cross
5164 else
5165   cat > conftest.$ac_ext <<EOF
5166 #line 5167 "configure"
5167 #include "confdefs.h"
5168
5169 #include <sys/types.h>
5170 #include <regex.h>
5171 static char *pattern, *string;
5172 main()
5173 {
5174         int rc;
5175         regex_t re;
5176
5177         pattern = "^A";
5178
5179         if(regcomp(&re, pattern, 0)) {
5180                 return -1;
5181         }
5182         
5183         string = "ALL MATCH";
5184         
5185         rc = regexec(&re, string, 0, (void*)0, 0);
5186
5187         regfree(&re);
5188
5189         return rc;
5190 }
5191 EOF
5192 if { (eval echo configure:5193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5193 then
5194   ol_cv_c_posix_regex=yes
5195 else
5196   echo "configure: failed program was:" >&5
5197   cat conftest.$ac_ext >&5
5198   rm -fr conftest*
5199   ol_cv_c_posix_regex=no
5200 fi
5201 rm -fr conftest*
5202 fi
5203
5204 fi
5205
5206 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5207
5208 if test "$ol_cv_c_posix_regex" = no ; then
5209         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5210 fi
5211
5212 ol_link_dnssrv=no
5213 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5214 echo "configure:5215: checking for res_query" >&5
5215 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5216   echo $ac_n "(cached) $ac_c" 1>&6
5217 else
5218   cat > conftest.$ac_ext <<EOF
5219 #line 5220 "configure"
5220 #include "confdefs.h"
5221 /* System header to define __stub macros and hopefully few prototypes,
5222     which can conflict with char res_query(); below.  */
5223 #include <assert.h>
5224 /* Override any gcc2 internal prototype to avoid an error.  */
5225 /* We use char because int might match the return type of a gcc2
5226     builtin and then its argument prototype would still apply.  */
5227 char res_query();
5228 char (*f)();
5229
5230 int main() {
5231
5232 /* The GNU C library defines this for functions which it implements
5233     to always fail with ENOSYS.  Some functions are actually named
5234     something starting with __ and the normal name is an alias.  */
5235 #if defined (__stub_res_query) || defined (__stub___res_query)
5236 choke me
5237 #else
5238 f = res_query;
5239 #endif
5240
5241 ; return 0; }
5242 EOF
5243 if { (eval echo configure:5244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5244   rm -rf conftest*
5245   eval "ac_cv_func_res_query=yes"
5246 else
5247   echo "configure: failed program was:" >&5
5248   cat conftest.$ac_ext >&5
5249   rm -rf conftest*
5250   eval "ac_cv_func_res_query=no"
5251 fi
5252 rm -f conftest*
5253 fi
5254
5255 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5256   echo "$ac_t""yes" 1>&6
5257   :
5258 else
5259   echo "$ac_t""no" 1>&6
5260 fi
5261
5262 if test $ac_cv_func_res_query = no ; then 
5263         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5264 echo "configure:5265: checking for res_query in -lbind" >&5
5265 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5266 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5267   echo $ac_n "(cached) $ac_c" 1>&6
5268 else
5269   ac_save_LIBS="$LIBS"
5270 LIBS="-lbind  $LIBS"
5271 cat > conftest.$ac_ext <<EOF
5272 #line 5273 "configure"
5273 #include "confdefs.h"
5274 /* Override any gcc2 internal prototype to avoid an error.  */
5275 /* We use char because int might match the return type of a gcc2
5276     builtin and then its argument prototype would still apply.  */
5277 char res_query();
5278
5279 int main() {
5280 res_query()
5281 ; return 0; }
5282 EOF
5283 if { (eval echo configure:5284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5284   rm -rf conftest*
5285   eval "ac_cv_lib_$ac_lib_var=yes"
5286 else
5287   echo "configure: failed program was:" >&5
5288   cat conftest.$ac_ext >&5
5289   rm -rf conftest*
5290   eval "ac_cv_lib_$ac_lib_var=no"
5291 fi
5292 rm -f conftest*
5293 LIBS="$ac_save_LIBS"
5294
5295 fi
5296 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5297   echo "$ac_t""yes" 1>&6
5298     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5299     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5300   cat >> confdefs.h <<EOF
5301 #define $ac_tr_lib 1
5302 EOF
5303
5304   LIBS="-lbind $LIBS"
5305
5306 else
5307   echo "$ac_t""no" 1>&6
5308 fi
5309
5310         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5311 fi
5312
5313 if test $ac_cv_func_res_query = no ; then 
5314         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5315 echo "configure:5316: checking for __res_query in -lbind" >&5
5316 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5317 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5318   echo $ac_n "(cached) $ac_c" 1>&6
5319 else
5320   ac_save_LIBS="$LIBS"
5321 LIBS="-lbind  $LIBS"
5322 cat > conftest.$ac_ext <<EOF
5323 #line 5324 "configure"
5324 #include "confdefs.h"
5325 /* Override any gcc2 internal prototype to avoid an error.  */
5326 /* We use char because int might match the return type of a gcc2
5327     builtin and then its argument prototype would still apply.  */
5328 char __res_query();
5329
5330 int main() {
5331 __res_query()
5332 ; return 0; }
5333 EOF
5334 if { (eval echo configure:5335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5335   rm -rf conftest*
5336   eval "ac_cv_lib_$ac_lib_var=yes"
5337 else
5338   echo "configure: failed program was:" >&5
5339   cat conftest.$ac_ext >&5
5340   rm -rf conftest*
5341   eval "ac_cv_lib_$ac_lib_var=no"
5342 fi
5343 rm -f conftest*
5344 LIBS="$ac_save_LIBS"
5345
5346 fi
5347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5348   echo "$ac_t""yes" 1>&6
5349     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5350     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5351   cat >> confdefs.h <<EOF
5352 #define $ac_tr_lib 1
5353 EOF
5354
5355   LIBS="-lbind $LIBS"
5356
5357 else
5358   echo "$ac_t""no" 1>&6
5359 fi
5360
5361         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5362 fi
5363
5364 if test $ac_cv_func_res_query = no ; then 
5365         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5366 echo "configure:5367: checking for res_query in -lresolv" >&5
5367 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5368 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5369   echo $ac_n "(cached) $ac_c" 1>&6
5370 else
5371   ac_save_LIBS="$LIBS"
5372 LIBS="-lresolv  $LIBS"
5373 cat > conftest.$ac_ext <<EOF
5374 #line 5375 "configure"
5375 #include "confdefs.h"
5376 /* Override any gcc2 internal prototype to avoid an error.  */
5377 /* We use char because int might match the return type of a gcc2
5378     builtin and then its argument prototype would still apply.  */
5379 char res_query();
5380
5381 int main() {
5382 res_query()
5383 ; return 0; }
5384 EOF
5385 if { (eval echo configure:5386: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5386   rm -rf conftest*
5387   eval "ac_cv_lib_$ac_lib_var=yes"
5388 else
5389   echo "configure: failed program was:" >&5
5390   cat conftest.$ac_ext >&5
5391   rm -rf conftest*
5392   eval "ac_cv_lib_$ac_lib_var=no"
5393 fi
5394 rm -f conftest*
5395 LIBS="$ac_save_LIBS"
5396
5397 fi
5398 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5399   echo "$ac_t""yes" 1>&6
5400     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5401     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5402   cat >> confdefs.h <<EOF
5403 #define $ac_tr_lib 1
5404 EOF
5405
5406   LIBS="-lresolv $LIBS"
5407
5408 else
5409   echo "$ac_t""no" 1>&6
5410 fi
5411
5412         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5413 fi
5414
5415 if test "$ac_cv_func_res_query" = yes ; then
5416         cat >> confdefs.h <<\EOF
5417 #define HAVE_RES_QUERY 1
5418 EOF
5419
5420
5421         if test $ol_enable_dnssrv != no ; then
5422                 ol_link_dnssrv=yes
5423         fi
5424 fi
5425
5426 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5427         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5428 fi
5429
5430 for ac_func in getaddrinfo 
5431 do
5432 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5433 echo "configure:5434: checking for $ac_func" >&5
5434 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5435   echo $ac_n "(cached) $ac_c" 1>&6
5436 else
5437   cat > conftest.$ac_ext <<EOF
5438 #line 5439 "configure"
5439 #include "confdefs.h"
5440 /* System header to define __stub macros and hopefully few prototypes,
5441     which can conflict with char $ac_func(); below.  */
5442 #include <assert.h>
5443 /* Override any gcc2 internal prototype to avoid an error.  */
5444 /* We use char because int might match the return type of a gcc2
5445     builtin and then its argument prototype would still apply.  */
5446 char $ac_func();
5447 char (*f)();
5448
5449 int main() {
5450
5451 /* The GNU C library defines this for functions which it implements
5452     to always fail with ENOSYS.  Some functions are actually named
5453     something starting with __ and the normal name is an alias.  */
5454 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5455 choke me
5456 #else
5457 f = $ac_func;
5458 #endif
5459
5460 ; return 0; }
5461 EOF
5462 if { (eval echo configure:5463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5463   rm -rf conftest*
5464   eval "ac_cv_func_$ac_func=yes"
5465 else
5466   echo "configure: failed program was:" >&5
5467   cat conftest.$ac_ext >&5
5468   rm -rf conftest*
5469   eval "ac_cv_func_$ac_func=no"
5470 fi
5471 rm -f conftest*
5472 fi
5473
5474 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5475   echo "$ac_t""yes" 1>&6
5476     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5477   cat >> confdefs.h <<EOF
5478 #define $ac_tr_func 1
5479 EOF
5480  
5481 else
5482   echo "$ac_t""no" 1>&6
5483 fi
5484 done
5485
5486
5487 ol_link_ipv6=no
5488 if test $ac_cv_func_getaddrinfo = no ; then
5489         if test $ol_enable_ipv6 = yes ; then
5490                 { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
5491         fi
5492 else
5493         for ac_func in gai_strerror 
5494 do
5495 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5496 echo "configure:5497: checking for $ac_func" >&5
5497 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5498   echo $ac_n "(cached) $ac_c" 1>&6
5499 else
5500   cat > conftest.$ac_ext <<EOF
5501 #line 5502 "configure"
5502 #include "confdefs.h"
5503 /* System header to define __stub macros and hopefully few prototypes,
5504     which can conflict with char $ac_func(); below.  */
5505 #include <assert.h>
5506 /* Override any gcc2 internal prototype to avoid an error.  */
5507 /* We use char because int might match the return type of a gcc2
5508     builtin and then its argument prototype would still apply.  */
5509 char $ac_func();
5510 char (*f)();
5511
5512 int main() {
5513
5514 /* The GNU C library defines this for functions which it implements
5515     to always fail with ENOSYS.  Some functions are actually named
5516     something starting with __ and the normal name is an alias.  */
5517 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5518 choke me
5519 #else
5520 f = $ac_func;
5521 #endif
5522
5523 ; return 0; }
5524 EOF
5525 if { (eval echo configure:5526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5526   rm -rf conftest*
5527   eval "ac_cv_func_$ac_func=yes"
5528 else
5529   echo "configure: failed program was:" >&5
5530   cat conftest.$ac_ext >&5
5531   rm -rf conftest*
5532   eval "ac_cv_func_$ac_func=no"
5533 fi
5534 rm -f conftest*
5535 fi
5536
5537 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5538   echo "$ac_t""yes" 1>&6
5539     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5540   cat >> confdefs.h <<EOF
5541 #define $ac_tr_func 1
5542 EOF
5543  
5544 else
5545   echo "$ac_t""no" 1>&6
5546 fi
5547 done
5548
5549
5550         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5551 echo "configure:5552: checking INET6_ADDRSTRLEN" >&5
5552 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5553   echo $ac_n "(cached) $ac_c" 1>&6
5554 else
5555   
5556                 cat > conftest.$ac_ext <<EOF
5557 #line 5558 "configure"
5558 #include "confdefs.h"
5559
5560 #                       include <netinet/in.h>
5561 #                       ifdef INET6_ADDRSTRLEN
5562                                 __has_inet6_addrstrlen__;
5563 #                       endif
5564                 
5565 EOF
5566 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5567   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5568   rm -rf conftest*
5569   ol_cv_inet6_addrstrlen=yes
5570 else
5571   rm -rf conftest*
5572   ol_cv_inet6_addrstrlen=no
5573 fi
5574 rm -f conftest*
5575
5576 fi
5577
5578 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5579
5580         if test $ol_cv_inet6_addrstrlen = yes ; then
5581                 ol_link_ipv6=yes
5582         elif test $ol_enable_ipv6 = yes ; then
5583                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5584         fi
5585 fi
5586
5587 if test $ol_enable_local != no ; then
5588         for ac_hdr in sys/un.h 
5589 do
5590 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5591 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5592 echo "configure:5593: checking for $ac_hdr" >&5
5593 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5594   echo $ac_n "(cached) $ac_c" 1>&6
5595 else
5596   cat > conftest.$ac_ext <<EOF
5597 #line 5598 "configure"
5598 #include "confdefs.h"
5599 #include <$ac_hdr>
5600 EOF
5601 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5602 { (eval echo configure:5603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5603 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5604 if test -z "$ac_err"; then
5605   rm -rf conftest*
5606   eval "ac_cv_header_$ac_safe=yes"
5607 else
5608   echo "$ac_err" >&5
5609   echo "configure: failed program was:" >&5
5610   cat conftest.$ac_ext >&5
5611   rm -rf conftest*
5612   eval "ac_cv_header_$ac_safe=no"
5613 fi
5614 rm -f conftest*
5615 fi
5616 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5617   echo "$ac_t""yes" 1>&6
5618     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5619   cat >> confdefs.h <<EOF
5620 #define $ac_tr_hdr 1
5621 EOF
5622  
5623 else
5624   echo "$ac_t""no" 1>&6
5625 fi
5626 done
5627
5628
5629         if test $ol_enable_local = auto ; then
5630                 ol_enable_local=$ac_cv_header_sys_un_h
5631         elif test $ac_cv_header_sys_un_h = no ; then
5632                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5633         fi
5634 fi
5635
5636 ol_link_kbind=no
5637 ol_link_kpasswd=no
5638 ol_link_krb5=no
5639 ol_link_krb4=no
5640
5641 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5642         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5643         -o $ol_with_kerberos = k425 ; then
5644
5645         for ac_hdr in krb5.h
5646 do
5647 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5648 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5649 echo "configure:5650: checking for $ac_hdr" >&5
5650 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5651   echo $ac_n "(cached) $ac_c" 1>&6
5652 else
5653   cat > conftest.$ac_ext <<EOF
5654 #line 5655 "configure"
5655 #include "confdefs.h"
5656 #include <$ac_hdr>
5657 EOF
5658 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5659 { (eval echo configure:5660: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5660 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5661 if test -z "$ac_err"; then
5662   rm -rf conftest*
5663   eval "ac_cv_header_$ac_safe=yes"
5664 else
5665   echo "$ac_err" >&5
5666   echo "configure: failed program was:" >&5
5667   cat conftest.$ac_ext >&5
5668   rm -rf conftest*
5669   eval "ac_cv_header_$ac_safe=no"
5670 fi
5671 rm -f conftest*
5672 fi
5673 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5674   echo "$ac_t""yes" 1>&6
5675     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5676   cat >> confdefs.h <<EOF
5677 #define $ac_tr_hdr 1
5678 EOF
5679  
5680 else
5681   echo "$ac_t""no" 1>&6
5682 fi
5683 done
5684
5685
5686         if test $ac_cv_header_krb5_h = yes ; then
5687                                 for ac_hdr in heim_err.h
5688 do
5689 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5690 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5691 echo "configure:5692: checking for $ac_hdr" >&5
5692 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5693   echo $ac_n "(cached) $ac_c" 1>&6
5694 else
5695   cat > conftest.$ac_ext <<EOF
5696 #line 5697 "configure"
5697 #include "confdefs.h"
5698 #include <$ac_hdr>
5699 EOF
5700 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5701 { (eval echo configure:5702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5702 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5703 if test -z "$ac_err"; then
5704   rm -rf conftest*
5705   eval "ac_cv_header_$ac_safe=yes"
5706 else
5707   echo "$ac_err" >&5
5708   echo "configure: failed program was:" >&5
5709   cat conftest.$ac_ext >&5
5710   rm -rf conftest*
5711   eval "ac_cv_header_$ac_safe=no"
5712 fi
5713 rm -f conftest*
5714 fi
5715 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5716   echo "$ac_t""yes" 1>&6
5717     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5718   cat >> confdefs.h <<EOF
5719 #define $ac_tr_hdr 1
5720 EOF
5721  
5722 else
5723   echo "$ac_t""no" 1>&6
5724 fi
5725 done
5726
5727                 if test $ac_cv_header_heim_err_h = yes ; then
5728                         krb5_impl=heimdal
5729                 else
5730                         krb5_impl=mit
5731                 fi
5732
5733                 if test $krb5_impl = mit; then
5734                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5735 echo "configure:5736: checking for main in -lkrb5" >&5
5736 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5737 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5738   echo $ac_n "(cached) $ac_c" 1>&6
5739 else
5740   ac_save_LIBS="$LIBS"
5741 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
5742 cat > conftest.$ac_ext <<EOF
5743 #line 5744 "configure"
5744 #include "confdefs.h"
5745
5746 int main() {
5747 main()
5748 ; return 0; }
5749 EOF
5750 if { (eval echo configure:5751: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5751   rm -rf conftest*
5752   eval "ac_cv_lib_$ac_lib_var=yes"
5753 else
5754   echo "configure: failed program was:" >&5
5755   cat conftest.$ac_ext >&5
5756   rm -rf conftest*
5757   eval "ac_cv_lib_$ac_lib_var=no"
5758 fi
5759 rm -f conftest*
5760 LIBS="$ac_save_LIBS"
5761
5762 fi
5763 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5764   echo "$ac_t""yes" 1>&6
5765   have_krb5=yes
5766                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
5767 else
5768   echo "$ac_t""no" 1>&6
5769 have_krb5=no
5770 fi
5771
5772
5773                 elif test $krb5_impl = heimdal; then
5774                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5775 echo "configure:5776: checking for main in -lkrb5" >&5
5776 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5777 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5778   echo $ac_n "(cached) $ac_c" 1>&6
5779 else
5780   ac_save_LIBS="$LIBS"
5781 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5782 cat > conftest.$ac_ext <<EOF
5783 #line 5784 "configure"
5784 #include "confdefs.h"
5785
5786 int main() {
5787 main()
5788 ; return 0; }
5789 EOF
5790 if { (eval echo configure:5791: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5791   rm -rf conftest*
5792   eval "ac_cv_lib_$ac_lib_var=yes"
5793 else
5794   echo "configure: failed program was:" >&5
5795   cat conftest.$ac_ext >&5
5796   rm -rf conftest*
5797   eval "ac_cv_lib_$ac_lib_var=no"
5798 fi
5799 rm -f conftest*
5800 LIBS="$ac_save_LIBS"
5801
5802 fi
5803 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5804   echo "$ac_t""yes" 1>&6
5805   have_krb5=yes
5806                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
5807 else
5808   echo "$ac_t""no" 1>&6
5809 have_krb5=no
5810 fi
5811
5812
5813                         cat >> confdefs.h <<\EOF
5814 #define HAVE_HEIMDAL_KERBEROS 1
5815 EOF
5816
5817                 else
5818                         have_krb5=no
5819                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5820                 fi
5821
5822                 if test $have_krb5 = yes ; then
5823                         ol_link_krb5=yes
5824
5825                         cat >> confdefs.h <<\EOF
5826 #define HAVE_KRB5 1
5827 EOF
5828
5829
5830                         if test $ol_enable_kpasswd != no ; then
5831                                 ol_link_kpasswd=yes;
5832                         fi
5833
5834                         if test $ol_with_kerberos = k5only ; then
5835                                 ol_with_kerberos=found
5836                         fi
5837
5838                 elif test $ol_with_kerberos != auto ; then
5839                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
5840                 fi
5841
5842         fi
5843 fi
5844
5845 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
5846         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
5847
5848         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5849 do
5850 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5851 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5852 echo "configure:5853: checking for $ac_hdr" >&5
5853 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5854   echo $ac_n "(cached) $ac_c" 1>&6
5855 else
5856   cat > conftest.$ac_ext <<EOF
5857 #line 5858 "configure"
5858 #include "confdefs.h"
5859 #include <$ac_hdr>
5860 EOF
5861 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5862 { (eval echo configure:5863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5863 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5864 if test -z "$ac_err"; then
5865   rm -rf conftest*
5866   eval "ac_cv_header_$ac_safe=yes"
5867 else
5868   echo "$ac_err" >&5
5869   echo "configure: failed program was:" >&5
5870   cat conftest.$ac_ext >&5
5871   rm -rf conftest*
5872   eval "ac_cv_header_$ac_safe=no"
5873 fi
5874 rm -f conftest*
5875 fi
5876 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5877   echo "$ac_t""yes" 1>&6
5878     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5879   cat >> confdefs.h <<EOF
5880 #define $ac_tr_hdr 1
5881 EOF
5882  
5883 else
5884   echo "$ac_t""no" 1>&6
5885 fi
5886 done
5887
5888
5889         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5890                 if test $krb5_impl = mit; then
5891                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5892 echo "configure:5893: checking for main in -lkrb4" >&5
5893 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5894 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5895   echo $ac_n "(cached) $ac_c" 1>&6
5896 else
5897   ac_save_LIBS="$LIBS"
5898 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
5899 cat > conftest.$ac_ext <<EOF
5900 #line 5901 "configure"
5901 #include "confdefs.h"
5902
5903 int main() {
5904 main()
5905 ; return 0; }
5906 EOF
5907 if { (eval echo configure:5908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5908   rm -rf conftest*
5909   eval "ac_cv_lib_$ac_lib_var=yes"
5910 else
5911   echo "configure: failed program was:" >&5
5912   cat conftest.$ac_ext >&5
5913   rm -rf conftest*
5914   eval "ac_cv_lib_$ac_lib_var=no"
5915 fi
5916 rm -f conftest*
5917 LIBS="$ac_save_LIBS"
5918
5919 fi
5920 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5921   echo "$ac_t""yes" 1>&6
5922   have_k425=yes
5923                                 KRB4_LIBS="-lkrb4 -ldes425"
5924 else
5925   echo "$ac_t""no" 1>&6
5926 have_k425=no
5927 fi
5928
5929
5930                 elif test $krb5_impl = heimdal; then
5931                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5932 echo "configure:5933: checking for main in -lkrb4" >&5
5933 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5934 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5935   echo $ac_n "(cached) $ac_c" 1>&6
5936 else
5937   ac_save_LIBS="$LIBS"
5938 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5939 cat > conftest.$ac_ext <<EOF
5940 #line 5941 "configure"
5941 #include "confdefs.h"
5942
5943 int main() {
5944 main()
5945 ; return 0; }
5946 EOF
5947 if { (eval echo configure:5948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5948   rm -rf conftest*
5949   eval "ac_cv_lib_$ac_lib_var=yes"
5950 else
5951   echo "configure: failed program was:" >&5
5952   cat conftest.$ac_ext >&5
5953   rm -rf conftest*
5954   eval "ac_cv_lib_$ac_lib_var=no"
5955 fi
5956 rm -f conftest*
5957 LIBS="$ac_save_LIBS"
5958
5959 fi
5960 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5961   echo "$ac_t""yes" 1>&6
5962   have_k425=yes
5963                                 KRB4_LIBS="-lkrb4"
5964 else
5965   echo "$ac_t""no" 1>&6
5966 have_k425=no
5967 fi
5968
5969
5970                 else
5971                         have_425=no
5972                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5973                 fi
5974
5975                 if test $have_k425 = yes ; then
5976                         ol_with_kerberos=found
5977                         ol_link_krb4=yes
5978
5979                         cat >> confdefs.h <<\EOF
5980 #define HAVE_KRB425 1
5981 EOF
5982
5983                         cat >> confdefs.h <<\EOF
5984 #define HAVE_KRB4 1
5985 EOF
5986
5987
5988                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5989 echo "configure:5990: checking for des_debug in Kerberos libraries" >&5
5990 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5991   echo $ac_n "(cached) $ac_c" 1>&6
5992 else
5993   
5994                                                                 save_LIBS="$LIBS"
5995                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
5996                                 cat > conftest.$ac_ext <<EOF
5997 #line 5998 "configure"
5998 #include "confdefs.h"
5999
6000 #include <kerberosIV/krb.h>
6001 #include <kerberosIV/des.h>
6002 extern int des_debug;
6003
6004 int main() {
6005
6006 des_debug = 1;
6007
6008 ; return 0; }
6009 EOF
6010 if { (eval echo configure:6011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6011   rm -rf conftest*
6012   ol_cv_var_des_debug=yes
6013 else
6014   echo "configure: failed program was:" >&5
6015   cat conftest.$ac_ext >&5
6016   rm -rf conftest*
6017   ol_cv_var_des_debug=no
6018 fi
6019 rm -f conftest*
6020                                                                 LIBS="$save_LIBS"
6021                         
6022 fi
6023
6024 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
6025
6026                         if test $ol_cv_var_des_debug = yes ; then
6027                                 cat >> confdefs.h <<\EOF
6028 #define HAVE_DES_DEBUG 1
6029 EOF
6030
6031                         fi
6032
6033                         LIBS="$save_LIBS"
6034                 fi
6035         fi
6036 fi
6037
6038 if test $ol_link_krb5 = yes ; then
6039         ol_with_kerberos=found
6040 fi
6041
6042 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6043         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6044
6045         for ac_hdr in krb.h des.h krb-archaeology.h 
6046 do
6047 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6048 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6049 echo "configure:6050: checking for $ac_hdr" >&5
6050 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6051   echo $ac_n "(cached) $ac_c" 1>&6
6052 else
6053   cat > conftest.$ac_ext <<EOF
6054 #line 6055 "configure"
6055 #include "confdefs.h"
6056 #include <$ac_hdr>
6057 EOF
6058 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6059 { (eval echo configure:6060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6060 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6061 if test -z "$ac_err"; then
6062   rm -rf conftest*
6063   eval "ac_cv_header_$ac_safe=yes"
6064 else
6065   echo "$ac_err" >&5
6066   echo "configure: failed program was:" >&5
6067   cat conftest.$ac_ext >&5
6068   rm -rf conftest*
6069   eval "ac_cv_header_$ac_safe=no"
6070 fi
6071 rm -f conftest*
6072 fi
6073 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6074   echo "$ac_t""yes" 1>&6
6075     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6076   cat >> confdefs.h <<EOF
6077 #define $ac_tr_hdr 1
6078 EOF
6079  
6080 else
6081   echo "$ac_t""no" 1>&6
6082 fi
6083 done
6084
6085
6086         if test $ac_cv_header_krb_h = yes ; then
6087                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6088 echo "configure:6089: checking for main in -lkrb" >&5
6089 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6090 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6091   echo $ac_n "(cached) $ac_c" 1>&6
6092 else
6093   ac_save_LIBS="$LIBS"
6094 LIBS="-lkrb -ldes $LIBS"
6095 cat > conftest.$ac_ext <<EOF
6096 #line 6097 "configure"
6097 #include "confdefs.h"
6098
6099 int main() {
6100 main()
6101 ; return 0; }
6102 EOF
6103 if { (eval echo configure:6104: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6104   rm -rf conftest*
6105   eval "ac_cv_lib_$ac_lib_var=yes"
6106 else
6107   echo "configure: failed program was:" >&5
6108   cat conftest.$ac_ext >&5
6109   rm -rf conftest*
6110   eval "ac_cv_lib_$ac_lib_var=no"
6111 fi
6112 rm -f conftest*
6113 LIBS="$ac_save_LIBS"
6114
6115 fi
6116 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6117   echo "$ac_t""yes" 1>&6
6118   have_k4=yes
6119 else
6120   echo "$ac_t""no" 1>&6
6121 have_k4=no
6122 fi
6123
6124
6125                 if test $have_k4 = yes ; then
6126                         ol_with_kerberos=found
6127                         ol_link_krb4=yes
6128
6129                         cat >> confdefs.h <<\EOF
6130 #define HAVE_KRB4 1
6131 EOF
6132
6133
6134                         KRB4_LIBS="-lkrb -ldes"
6135
6136                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6137                                 cat >> confdefs.h <<\EOF
6138 #define HAVE_KTH_KERBEROS 1
6139 EOF
6140
6141                         fi
6142                 fi
6143         fi
6144 fi
6145
6146 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6147         ol_link_kpasswd=yes
6148 fi
6149
6150 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6151         ol_link_kbind=yes
6152
6153 elif test $ol_enable_kbind = yes ; then
6154         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6155 fi
6156
6157 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6158         cat >> confdefs.h <<\EOF
6159 #define HAVE_KERBEROS 1
6160 EOF
6161
6162
6163 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6164         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6165 fi
6166
6167 ol_link_tls=no
6168 if test $ol_with_tls != no ; then
6169         for ac_hdr in openssl/ssl.h ssl.h
6170 do
6171 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6172 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6173 echo "configure:6174: checking for $ac_hdr" >&5
6174 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6175   echo $ac_n "(cached) $ac_c" 1>&6
6176 else
6177   cat > conftest.$ac_ext <<EOF
6178 #line 6179 "configure"
6179 #include "confdefs.h"
6180 #include <$ac_hdr>
6181 EOF
6182 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6183 { (eval echo configure:6184: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6184 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6185 if test -z "$ac_err"; then
6186   rm -rf conftest*
6187   eval "ac_cv_header_$ac_safe=yes"
6188 else
6189   echo "$ac_err" >&5
6190   echo "configure: failed program was:" >&5
6191   cat conftest.$ac_ext >&5
6192   rm -rf conftest*
6193   eval "ac_cv_header_$ac_safe=no"
6194 fi
6195 rm -f conftest*
6196 fi
6197 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6198   echo "$ac_t""yes" 1>&6
6199     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6200   cat >> confdefs.h <<EOF
6201 #define $ac_tr_hdr 1
6202 EOF
6203  
6204 else
6205   echo "$ac_t""no" 1>&6
6206 fi
6207 done
6208
6209         
6210         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6211                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6212 echo "configure:6213: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6213 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6214 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6215   echo $ac_n "(cached) $ac_c" 1>&6
6216 else
6217   ac_save_LIBS="$LIBS"
6218 LIBS="-lssl -lcrypto $LIBS"
6219 cat > conftest.$ac_ext <<EOF
6220 #line 6221 "configure"
6221 #include "confdefs.h"
6222 /* Override any gcc2 internal prototype to avoid an error.  */
6223 /* We use char because int might match the return type of a gcc2
6224     builtin and then its argument prototype would still apply.  */
6225 char SSLeay_add_ssl_algorithms();
6226
6227 int main() {
6228 SSLeay_add_ssl_algorithms()
6229 ; return 0; }
6230 EOF
6231 if { (eval echo configure:6232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6232   rm -rf conftest*
6233   eval "ac_cv_lib_$ac_lib_var=yes"
6234 else
6235   echo "configure: failed program was:" >&5
6236   cat conftest.$ac_ext >&5
6237   rm -rf conftest*
6238   eval "ac_cv_lib_$ac_lib_var=no"
6239 fi
6240 rm -f conftest*
6241 LIBS="$ac_save_LIBS"
6242
6243 fi
6244 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6245   echo "$ac_t""yes" 1>&6
6246   have_ssleay=yes
6247                         need_rsaref=no
6248 else
6249   echo "$ac_t""no" 1>&6
6250 have_ssleay=no
6251 fi
6252
6253                         
6254                 if test $have_ssleay = no ; then
6255                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6256 echo "configure:6257: checking for SSL_library_init in -lssl" >&5
6257 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6258 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6259   echo $ac_n "(cached) $ac_c" 1>&6
6260 else
6261   ac_save_LIBS="$LIBS"
6262 LIBS="-lssl -lcrypto $LIBS"
6263 cat > conftest.$ac_ext <<EOF
6264 #line 6265 "configure"
6265 #include "confdefs.h"
6266 /* Override any gcc2 internal prototype to avoid an error.  */
6267 /* We use char because int might match the return type of a gcc2
6268     builtin and then its argument prototype would still apply.  */
6269 char SSL_library_init();
6270
6271 int main() {
6272 SSL_library_init()
6273 ; return 0; }
6274 EOF
6275 if { (eval echo configure:6276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6276   rm -rf conftest*
6277   eval "ac_cv_lib_$ac_lib_var=yes"
6278 else
6279   echo "configure: failed program was:" >&5
6280   cat conftest.$ac_ext >&5
6281   rm -rf conftest*
6282   eval "ac_cv_lib_$ac_lib_var=no"
6283 fi
6284 rm -f conftest*
6285 LIBS="$ac_save_LIBS"
6286
6287 fi
6288 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6289   echo "$ac_t""yes" 1>&6
6290   have_ssleay=yes
6291                                 need_rsaref=no
6292 else
6293   echo "$ac_t""no" 1>&6
6294 have_ssleay=no
6295 fi
6296
6297                 fi
6298
6299                 if test $have_ssleay = no ; then
6300                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6301 echo "configure:6302: checking for ssl3_accept in -lssl" >&5
6302 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6303 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6304   echo $ac_n "(cached) $ac_c" 1>&6
6305 else
6306   ac_save_LIBS="$LIBS"
6307 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6308 cat > conftest.$ac_ext <<EOF
6309 #line 6310 "configure"
6310 #include "confdefs.h"
6311 /* Override any gcc2 internal prototype to avoid an error.  */
6312 /* We use char because int might match the return type of a gcc2
6313     builtin and then its argument prototype would still apply.  */
6314 char ssl3_accept();
6315
6316 int main() {
6317 ssl3_accept()
6318 ; return 0; }
6319 EOF
6320 if { (eval echo configure:6321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6321   rm -rf conftest*
6322   eval "ac_cv_lib_$ac_lib_var=yes"
6323 else
6324   echo "configure: failed program was:" >&5
6325   cat conftest.$ac_ext >&5
6326   rm -rf conftest*
6327   eval "ac_cv_lib_$ac_lib_var=no"
6328 fi
6329 rm -f conftest*
6330 LIBS="$ac_save_LIBS"
6331
6332 fi
6333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6334   echo "$ac_t""yes" 1>&6
6335   have_ssleay=yes
6336                                 need_rsaref=yes
6337 else
6338   echo "$ac_t""no" 1>&6
6339 have_ssleay=no
6340 fi
6341
6342                 fi
6343
6344                 if test $have_ssleay = yes ; then
6345                         ol_with_tls=found
6346                         ol_link_tls=yes
6347
6348                         cat >> confdefs.h <<\EOF
6349 #define HAVE_SSLEAY 1
6350 EOF
6351
6352
6353                         if test $need_rsaref = yes; then
6354                                 cat >> confdefs.h <<\EOF
6355 #define HAVE_RSAREF 1
6356 EOF
6357
6358
6359                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6360                         else
6361                                 TLS_LIBS="-lssl -lcrypto"
6362                         fi
6363                 fi
6364         fi
6365
6366 else
6367         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6368 fi
6369
6370 if test $ol_link_tls = yes ; then
6371         cat >> confdefs.h <<\EOF
6372 #define HAVE_TLS 1
6373 EOF
6374
6375
6376 elif test $ol_with_tls = auto ; then
6377         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6378         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6379
6380 elif test $ol_with_tls != no ; then
6381         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6382 fi
6383
6384 for ac_func in \
6385         ctime_r                 \
6386         gethostbyname_r gethostbyaddr_r \
6387
6388 do
6389 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6390 echo "configure:6391: checking for $ac_func" >&5
6391 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6392   echo $ac_n "(cached) $ac_c" 1>&6
6393 else
6394   cat > conftest.$ac_ext <<EOF
6395 #line 6396 "configure"
6396 #include "confdefs.h"
6397 /* System header to define __stub macros and hopefully few prototypes,
6398     which can conflict with char $ac_func(); below.  */
6399 #include <assert.h>
6400 /* Override any gcc2 internal prototype to avoid an error.  */
6401 /* We use char because int might match the return type of a gcc2
6402     builtin and then its argument prototype would still apply.  */
6403 char $ac_func();
6404 char (*f)();
6405
6406 int main() {
6407
6408 /* The GNU C library defines this for functions which it implements
6409     to always fail with ENOSYS.  Some functions are actually named
6410     something starting with __ and the normal name is an alias.  */
6411 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6412 choke me
6413 #else
6414 f = $ac_func;
6415 #endif
6416
6417 ; return 0; }
6418 EOF
6419 if { (eval echo configure:6420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6420   rm -rf conftest*
6421   eval "ac_cv_func_$ac_func=yes"
6422 else
6423   echo "configure: failed program was:" >&5
6424   cat conftest.$ac_ext >&5
6425   rm -rf conftest*
6426   eval "ac_cv_func_$ac_func=no"
6427 fi
6428 rm -f conftest*
6429 fi
6430
6431 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6432   echo "$ac_t""yes" 1>&6
6433     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6434   cat >> confdefs.h <<EOF
6435 #define $ac_tr_func 1
6436 EOF
6437  
6438 else
6439   echo "$ac_t""no" 1>&6
6440 fi
6441 done
6442
6443
6444 if test "$ac_cv_func_ctime_r" = no ; then
6445         ol_cv_func_ctime_r_nargs=0
6446 else
6447         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6448 echo "configure:6449: checking number of arguments of ctime_r" >&5
6449 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6450   echo $ac_n "(cached) $ac_c" 1>&6
6451 else
6452   cat > conftest.$ac_ext <<EOF
6453 #line 6454 "configure"
6454 #include "confdefs.h"
6455 #include <time.h>
6456 int main() {
6457 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6458 ; return 0; }
6459 EOF
6460 if { (eval echo configure:6461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6461   rm -rf conftest*
6462   ol_cv_func_ctime_r_nargs3=yes
6463 else
6464   echo "configure: failed program was:" >&5
6465   cat conftest.$ac_ext >&5
6466   rm -rf conftest*
6467   ol_cv_func_ctime_r_nargs3=no
6468 fi
6469 rm -f conftest*
6470
6471         cat > conftest.$ac_ext <<EOF
6472 #line 6473 "configure"
6473 #include "confdefs.h"
6474 #include <time.h>
6475 int main() {
6476 time_t ti; char *buffer; ctime_r(&ti,buffer);
6477 ; return 0; }
6478 EOF
6479 if { (eval echo configure:6480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6480   rm -rf conftest*
6481   ol_cv_func_ctime_r_nargs2=yes
6482 else
6483   echo "configure: failed program was:" >&5
6484   cat conftest.$ac_ext >&5
6485   rm -rf conftest*
6486   ol_cv_func_ctime_r_nargs2=no
6487 fi
6488 rm -f conftest*
6489
6490         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6491                 $ol_cv_func_ctime_r_nargs2 = no ; then
6492
6493                 ol_cv_func_ctime_r_nargs=3
6494
6495         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6496                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6497
6498                 ol_cv_func_ctime_r_nargs=2
6499
6500         else
6501                 ol_cv_func_ctime_r_nargs=0
6502         fi
6503   
6504 fi
6505
6506 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6507
6508   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6509         cat >> confdefs.h <<EOF
6510 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6511 EOF
6512
6513   fi
6514
6515 fi
6516
6517 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6518         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6519 echo "configure:6520: checking number of arguments of gethostbyname_r" >&5
6520 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6521   echo $ac_n "(cached) $ac_c" 1>&6
6522 else
6523   cat > conftest.$ac_ext <<EOF
6524 #line 6525 "configure"
6525 #include "confdefs.h"
6526 #include <sys/types.h>
6527 #include <sys/socket.h>
6528 #include <netinet/in.h>
6529 #include <netdb.h>
6530 #define BUFSIZE (sizeof(struct hostent)+10)
6531 int main() {
6532 struct hostent hent; char buffer[BUFSIZE];
6533                 int bufsize=BUFSIZE;int h_errno;
6534                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6535                         buffer, bufsize, &h_errno);
6536 ; return 0; }
6537 EOF
6538 if { (eval echo configure:6539: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6539   rm -rf conftest*
6540   ol_cv_func_gethostbyname_r_nargs5=yes
6541 else
6542   echo "configure: failed program was:" >&5
6543   cat conftest.$ac_ext >&5
6544   rm -rf conftest*
6545   ol_cv_func_gethostbyname_r_nargs5=no
6546 fi
6547 rm -f conftest*
6548
6549         cat > conftest.$ac_ext <<EOF
6550 #line 6551 "configure"
6551 #include "confdefs.h"
6552 #include <sys/types.h>
6553 #include <sys/socket.h>
6554 #include <netinet/in.h>
6555 #include <netdb.h>
6556 #define BUFSIZE (sizeof(struct hostent)+10)
6557 int main() {
6558 struct hostent hent;struct hostent *rhent;
6559                 char buffer[BUFSIZE];
6560                 int bufsize=BUFSIZE;int h_errno;
6561                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6562                         &rhent, &h_errno);
6563 ; return 0; }
6564 EOF
6565 if { (eval echo configure:6566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6566   rm -rf conftest*
6567   ol_cv_func_gethostbyname_r_nargs6=yes
6568 else
6569   echo "configure: failed program was:" >&5
6570   cat conftest.$ac_ext >&5
6571   rm -rf conftest*
6572   ol_cv_func_gethostbyname_r_nargs6=no
6573 fi
6574 rm -f conftest*
6575
6576         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6577                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6578
6579                 ol_cv_func_gethostbyname_r_nargs=5
6580
6581         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6582                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6583
6584                 ol_cv_func_gethostbyname_r_nargs=6
6585
6586         else
6587                 ol_cv_func_gethostbyname_r_nargs=0
6588         fi
6589   
6590 fi
6591
6592 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6593   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6594         cat >> confdefs.h <<EOF
6595 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6596 EOF
6597
6598   fi
6599
6600 else
6601         ol_cv_func_gethostbyname_r_nargs=0
6602 fi
6603  
6604 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6605         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6606 echo "configure:6607: checking number of arguments of gethostbyaddr_r" >&5
6607 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6608   echo $ac_n "(cached) $ac_c" 1>&6
6609 else
6610   cat > conftest.$ac_ext <<EOF
6611 #line 6612 "configure"
6612 #include "confdefs.h"
6613 #include <sys/types.h>
6614 #include <sys/socket.h>
6615 #include <netinet/in.h>
6616 #include <netdb.h>
6617 #define BUFSIZE (sizeof(struct hostent)+10)
6618 int main() {
6619 struct hostent hent; char buffer[BUFSIZE]; 
6620             struct in_addr add;
6621             size_t alen=sizeof(struct in_addr);
6622             int bufsize=BUFSIZE;int h_errno;
6623                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6624                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6625 ; return 0; }
6626 EOF
6627 if { (eval echo configure:6628: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6628   rm -rf conftest*
6629   ol_cv_func_gethostbyaddr_r_nargs7=yes
6630 else
6631   echo "configure: failed program was:" >&5
6632   cat conftest.$ac_ext >&5
6633   rm -rf conftest*
6634   ol_cv_func_gethostbyaddr_r_nargs7=no
6635 fi
6636 rm -f conftest*
6637
6638         cat > conftest.$ac_ext <<EOF
6639 #line 6640 "configure"
6640 #include "confdefs.h"
6641 #include <sys/types.h>
6642 #include <sys/socket.h>
6643 #include <netinet/in.h>
6644 #include <netdb.h>
6645 #define BUFSIZE (sizeof(struct hostent)+10)
6646 int main() {
6647 struct hostent hent;
6648                 struct hostent *rhent; char buffer[BUFSIZE]; 
6649                 struct in_addr add;
6650                 size_t alen=sizeof(struct in_addr);
6651                 int bufsize=BUFSIZE;int h_errno;
6652                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6653                         alen, AF_INET, &hent, buffer, bufsize, 
6654                         &rhent, &h_errno);
6655 ; return 0; }
6656 EOF
6657 if { (eval echo configure:6658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6658   rm -rf conftest*
6659   ol_cv_func_gethostbyaddr_r_nargs8=yes
6660 else
6661   echo "configure: failed program was:" >&5
6662   cat conftest.$ac_ext >&5
6663   rm -rf conftest*
6664   ol_cv_func_gethostbyaddr_r_nargs8=no
6665 fi
6666 rm -f conftest*
6667
6668         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6669                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6670
6671                 ol_cv_func_gethostbyaddr_r_nargs=7
6672
6673         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6674                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6675
6676                 ol_cv_func_gethostbyaddr_r_nargs=8
6677
6678         else
6679                 ol_cv_func_gethostbyaddr_r_nargs=0
6680         fi
6681   
6682 fi
6683
6684 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6685   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6686     cat >> confdefs.h <<EOF
6687 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6688 EOF
6689
6690   fi
6691
6692 else
6693         ol_cv_func_gethostbyaddr_r_nargs=0
6694 fi
6695
6696 if test "$ac_cv_func_ctime_r" = yes \
6697         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6698         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6699         -a "$ac_cv_func_gethostbyname_r" = yes \
6700         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6701         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6702         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6703         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6704         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6705         ; then
6706  
6707         cat >> confdefs.h <<\EOF
6708 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6709 EOF
6710
6711 fi
6712
6713 ol_link_threads=no
6714
6715 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6716         -o $ol_with_threads = nt ; then
6717
6718         
6719         echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
6720 echo "configure:6721: checking for NT Threads" >&5
6721 if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
6722   echo $ac_n "(cached) $ac_c" 1>&6
6723 else
6724   
6725                 echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6726 echo "configure:6727: checking for _beginthread" >&5
6727 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6728   echo $ac_n "(cached) $ac_c" 1>&6
6729 else
6730   cat > conftest.$ac_ext <<EOF
6731 #line 6732 "configure"
6732 #include "confdefs.h"
6733 /* System header to define __stub macros and hopefully few prototypes,
6734     which can conflict with char _beginthread(); below.  */
6735 #include <assert.h>
6736 /* Override any gcc2 internal prototype to avoid an error.  */
6737 /* We use char because int might match the return type of a gcc2
6738     builtin and then its argument prototype would still apply.  */
6739 char _beginthread();
6740 char (*f)();
6741
6742 int main() {
6743
6744 /* The GNU C library defines this for functions which it implements
6745     to always fail with ENOSYS.  Some functions are actually named
6746     something starting with __ and the normal name is an alias.  */
6747 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6748 choke me
6749 #else
6750 f = _beginthread;
6751 #endif
6752
6753 ; return 0; }
6754 EOF
6755 if { (eval echo configure:6756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6756   rm -rf conftest*
6757   eval "ac_cv_func__beginthread=yes"
6758 else
6759   echo "configure: failed program was:" >&5
6760   cat conftest.$ac_ext >&5
6761   rm -rf conftest*
6762   eval "ac_cv_func__beginthread=no"
6763 fi
6764 rm -f conftest*
6765 fi
6766
6767 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6768   echo "$ac_t""yes" 1>&6
6769   ol_cv_nt_threads=yes
6770 else
6771   echo "$ac_t""no" 1>&6
6772 ol_cv_nt_threads=no
6773 fi
6774
6775         
6776 fi
6777
6778 echo "$ac_t""$ol_cv_nt_threads" 1>&6
6779
6780         if test $ol_cv_nt_threads = yes ; then
6781                 cat >> confdefs.h <<\EOF
6782 #define HAVE_NT_THREADS 1
6783 EOF
6784
6785         fi
6786
6787
6788         if test "$ol_cv_nt_threads" = yes ; then
6789         ol_link_threads=nt
6790         ol_with_threads=found
6791         ol_with_yielding_select=yes
6792
6793                 cat >> confdefs.h <<\EOF
6794 #define HAVE_NT_SERVICE_MANAGER 1
6795 EOF
6796
6797                 cat >> confdefs.h <<\EOF
6798 #define HAVE_NT_EVENT_LOG 1
6799 EOF
6800
6801         fi
6802
6803         if test $ol_with_threads = nt ; then
6804                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
6805         fi
6806 fi
6807
6808 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6809         -o $ol_with_threads = posix ; then
6810
6811         for ac_hdr in pthread.h
6812 do
6813 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6814 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6815 echo "configure:6816: checking for $ac_hdr" >&5
6816 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6817   echo $ac_n "(cached) $ac_c" 1>&6
6818 else
6819   cat > conftest.$ac_ext <<EOF
6820 #line 6821 "configure"
6821 #include "confdefs.h"
6822 #include <$ac_hdr>
6823 EOF
6824 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6825 { (eval echo configure:6826: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6826 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6827 if test -z "$ac_err"; then
6828   rm -rf conftest*
6829   eval "ac_cv_header_$ac_safe=yes"
6830 else
6831   echo "$ac_err" >&5
6832   echo "configure: failed program was:" >&5
6833   cat conftest.$ac_ext >&5
6834   rm -rf conftest*
6835   eval "ac_cv_header_$ac_safe=no"
6836 fi
6837 rm -f conftest*
6838 fi
6839 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6840   echo "$ac_t""yes" 1>&6
6841     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6842   cat >> confdefs.h <<EOF
6843 #define $ac_tr_hdr 1
6844 EOF
6845  
6846 else
6847   echo "$ac_t""no" 1>&6
6848 fi
6849 done
6850
6851
6852         if test $ac_cv_header_pthread_h = yes ; then
6853                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6854 echo "configure:6855: checking POSIX thread version" >&5
6855 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6856   echo $ac_n "(cached) $ac_c" 1>&6
6857 else
6858   
6859         cat > conftest.$ac_ext <<EOF
6860 #line 6861 "configure"
6861 #include "confdefs.h"
6862
6863 #               include <pthread.h>
6864                 /* this check could be improved */
6865 #               ifdef PTHREAD_ONCE_INIT
6866                         pthread_version_final;
6867 #               endif
6868         
6869 EOF
6870 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6871   egrep "pthread_version_final" >/dev/null 2>&1; then
6872   rm -rf conftest*
6873   ol_pthread_final=yes
6874 else
6875   rm -rf conftest*
6876   ol_pthread_final=no
6877 fi
6878 rm -f conftest*
6879
6880
6881         cat > conftest.$ac_ext <<EOF
6882 #line 6883 "configure"
6883 #include "confdefs.h"
6884
6885 #               include <pthread.h>
6886                 /* this check could be improved */
6887 #               ifdef pthread_once_init
6888                         pthread_version_draft4;
6889 #               endif
6890         
6891 EOF
6892 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6893   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6894   rm -rf conftest*
6895   ol_pthread_draft4=yes
6896 else
6897   rm -rf conftest*
6898   ol_pthread_draft4=no
6899 fi
6900 rm -f conftest*
6901
6902
6903         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6904                 ol_cv_pthread_version=final
6905         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6906                 ol_cv_pthread_version=draft4
6907         else
6908                 ol_cv_pthread_version=unknown
6909         fi
6910
6911 fi
6912
6913 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6914
6915
6916                 if test $ol_cv_pthread_version = final ; then
6917                         cat >> confdefs.h <<\EOF
6918 #define HAVE_PTHREADS_FINAL 1
6919 EOF
6920
6921                 elif test $ol_cv_pthread_version = draft4 ; then
6922                         cat >> confdefs.h <<\EOF
6923 #define HAVE_PTHREADS_D4 1
6924 EOF
6925
6926                 else
6927                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6928                 fi
6929
6930                 # consider threads found
6931                 ol_with_threads=found
6932
6933                 
6934         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6935 echo "configure:6936: checking for LinuxThreads pthread.h" >&5
6936 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6937   echo $ac_n "(cached) $ac_c" 1>&6
6938 else
6939   cat > conftest.$ac_ext <<EOF
6940 #line 6941 "configure"
6941 #include "confdefs.h"
6942 #include <pthread.h>
6943 EOF
6944 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6945   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6946   rm -rf conftest*
6947   ol_cv_header_linux_threads=yes
6948 else
6949   rm -rf conftest*
6950   ol_cv_header_linux_threads=no
6951 fi
6952 rm -f conftest*
6953
6954                 
6955 fi
6956
6957 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6958         if test $ol_cv_header_linux_threads = yes; then
6959                 cat >> confdefs.h <<\EOF
6960 #define HAVE_LINUX_THREADS 1
6961 EOF
6962
6963         fi
6964
6965                 
6966         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6967 echo "configure:6968: checking for GNU Pth pthread.h" >&5
6968 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6969   echo $ac_n "(cached) $ac_c" 1>&6
6970 else
6971   cat > conftest.$ac_ext <<EOF
6972 #line 6973 "configure"
6973 #include "confdefs.h"
6974 #include <pthread.h>
6975 #ifdef _POSIX_THREAD_IS_GNU_PTH
6976         __gnu_pth__;
6977 #endif
6978
6979 EOF
6980 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6981   egrep "__gnu_pth__" >/dev/null 2>&1; then
6982   rm -rf conftest*
6983   ol_cv_header_gnu_pth_pthread_h=yes
6984 else
6985   rm -rf conftest*
6986   ol_cv_header_gnu_pth_pthread_h=no
6987 fi
6988 rm -f conftest*
6989
6990                 
6991 fi
6992
6993 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6994
6995
6996                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6997                         for ac_hdr in sched.h
6998 do
6999 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7000 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7001 echo "configure:7002: checking for $ac_hdr" >&5
7002 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
7003   echo $ac_n "(cached) $ac_c" 1>&6
7004 else
7005   cat > conftest.$ac_ext <<EOF
7006 #line 7007 "configure"
7007 #include "confdefs.h"
7008 #include <$ac_hdr>
7009 EOF
7010 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7011 { (eval echo configure:7012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7012 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7013 if test -z "$ac_err"; then
7014   rm -rf conftest*
7015   eval "ac_cv_header_$ac_safe=yes"
7016 else
7017   echo "$ac_err" >&5
7018   echo "configure: failed program was:" >&5
7019   cat conftest.$ac_ext >&5
7020   rm -rf conftest*
7021   eval "ac_cv_header_$ac_safe=no"
7022 fi
7023 rm -f conftest*
7024 fi
7025 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7026   echo "$ac_t""yes" 1>&6
7027     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7028   cat >> confdefs.h <<EOF
7029 #define $ac_tr_hdr 1
7030 EOF
7031  
7032 else
7033   echo "$ac_t""no" 1>&6
7034 fi
7035 done
7036
7037                 fi
7038
7039                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7040                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7041 echo "configure:7042: checking for pthread_create in default libraries" >&5
7042 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7043   echo $ac_n "(cached) $ac_c" 1>&6
7044 else
7045   
7046                 if test "$cross_compiling" = yes; then
7047   cat > conftest.$ac_ext <<EOF
7048 #line 7049 "configure"
7049 #include "confdefs.h"
7050 /* pthread test headers */
7051 #include <pthread.h>
7052 #ifndef NULL
7053 #define NULL (void*)0
7054 #endif
7055
7056 static void *task(p)
7057         void *p;
7058 {
7059         return (void *) (p == NULL);
7060 }
7061
7062 int main() {
7063
7064         /* pthread test function */
7065         pthread_t t;
7066         int status;
7067 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7068         /* This system (e.g. AIX) defaults detached; must override */
7069         pthread_attr_t attr;
7070
7071         status = pthread_attr_init(&attr);
7072         if( status ) exit( status );
7073
7074         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7075         if( status ) exit( status );
7076
7077 #       define  ATTR    &attr
7078 #elif defined( HAVE_PTHREADS_D4 )
7079 #       define  ATTR    pthread_attr_default
7080 #else
7081 #       define  ATTR    NULL
7082 #endif
7083
7084         /* make sure pthread_create() isn't just a stub */
7085         status = pthread_create(&t, ATTR, task, NULL);
7086         if( status ) exit( status );
7087
7088         /* give the thread a chance to complete...
7089      * it should remain joinable and hence detachable
7090          */
7091         sleep( 1 );
7092
7093         /* make sure pthread_detach() isn't just a stub */
7094 #if HAVE_PTHREADS_D4
7095         status = pthread_detach( &t );
7096 #else
7097         status = pthread_detach( t );
7098 #endif
7099
7100 #ifdef HAVE_LINUX_THREADS
7101         pthread_kill_other_threads_np();
7102 #endif
7103
7104         exit( status );
7105
7106 ; return 0; }
7107 EOF
7108 if { (eval echo configure:7109: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7109   rm -rf conftest*
7110   ol_cv_pthread_create=yes
7111 else
7112   echo "configure: failed program was:" >&5
7113   cat conftest.$ac_ext >&5
7114   rm -rf conftest*
7115   ol_cv_pthread_create=no
7116 fi
7117 rm -f conftest*
7118 else
7119   cat > conftest.$ac_ext <<EOF
7120 #line 7121 "configure"
7121 #include "confdefs.h"
7122 /* pthread test headers */
7123 #include <pthread.h>
7124 #ifndef NULL
7125 #define NULL (void*)0
7126 #endif
7127
7128 static void *task(p)
7129         void *p;
7130 {
7131         return (void *) (p == NULL);
7132 }
7133
7134
7135 int main(argc, argv)
7136         int argc;
7137         char **argv;
7138 {
7139
7140         /* pthread test function */
7141         pthread_t t;
7142         int status;
7143 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7144         /* This system (e.g. AIX) defaults detached; must override */
7145         pthread_attr_t attr;
7146
7147         status = pthread_attr_init(&attr);
7148         if( status ) exit( status );
7149
7150         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7151         if( status ) exit( status );
7152
7153 #       define  ATTR    &attr
7154 #elif defined( HAVE_PTHREADS_D4 )
7155 #       define  ATTR    pthread_attr_default
7156 #else
7157 #       define  ATTR    NULL
7158 #endif
7159
7160         /* make sure pthread_create() isn't just a stub */
7161         status = pthread_create(&t, ATTR, task, NULL);
7162         if( status ) exit( status );
7163
7164         /* give the thread a chance to complete...
7165      * it should remain joinable and hence detachable
7166          */
7167         sleep( 1 );
7168
7169         /* make sure pthread_detach() isn't just a stub */
7170 #if HAVE_PTHREADS_D4
7171         status = pthread_detach( &t );
7172 #else
7173         status = pthread_detach( t );
7174 #endif
7175
7176 #ifdef HAVE_LINUX_THREADS
7177         pthread_kill_other_threads_np();
7178 #endif
7179
7180         exit( status );
7181
7182 }
7183
7184 EOF
7185 if { (eval echo configure:7186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7186 then
7187   ol_cv_pthread_create=yes
7188 else
7189   echo "configure: failed program was:" >&5
7190   cat conftest.$ac_ext >&5
7191   rm -fr conftest*
7192   ol_cv_pthread_create=no
7193 fi
7194 rm -fr conftest*
7195 fi
7196
7197 fi
7198
7199 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7200
7201                 if test $ol_cv_pthread_create != no ; then
7202                         ol_link_threads=posix
7203                         ol_link_pthreads=""
7204                 fi
7205                 
7206                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7207 if test "$ol_link_threads" = no ; then
7208         # try -kthread
7209         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7210 echo "configure:7211: checking for pthread link with -kthread" >&5
7211 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7212   echo $ac_n "(cached) $ac_c" 1>&6
7213 else
7214   
7215                 # save the flags
7216                 ol_LIBS="$LIBS"
7217                 LIBS="-kthread $LIBS"
7218
7219                 if test "$cross_compiling" = yes; then
7220   cat > conftest.$ac_ext <<EOF
7221 #line 7222 "configure"
7222 #include "confdefs.h"
7223 /* pthread test headers */
7224 #include <pthread.h>
7225 #ifndef NULL
7226 #define NULL (void*)0
7227 #endif
7228
7229 static void *task(p)
7230         void *p;
7231 {
7232         return (void *) (p == NULL);
7233 }
7234
7235 int main() {
7236
7237         /* pthread test function */
7238         pthread_t t;
7239         int status;
7240 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7241         /* This system (e.g. AIX) defaults detached; must override */
7242         pthread_attr_t attr;
7243
7244         status = pthread_attr_init(&attr);
7245         if( status ) exit( status );
7246
7247         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7248         if( status ) exit( status );
7249
7250 #       define  ATTR    &attr
7251 #elif defined( HAVE_PTHREADS_D4 )
7252 #       define  ATTR    pthread_attr_default
7253 #else
7254 #       define  ATTR    NULL
7255 #endif
7256
7257         /* make sure pthread_create() isn't just a stub */
7258         status = pthread_create(&t, ATTR, task, NULL);
7259         if( status ) exit( status );
7260
7261         /* give the thread a chance to complete...
7262      * it should remain joinable and hence detachable
7263          */
7264         sleep( 1 );
7265
7266         /* make sure pthread_detach() isn't just a stub */
7267 #if HAVE_PTHREADS_D4
7268         status = pthread_detach( &t );
7269 #else
7270         status = pthread_detach( t );
7271 #endif
7272
7273 #ifdef HAVE_LINUX_THREADS
7274         pthread_kill_other_threads_np();
7275 #endif
7276
7277         exit( status );
7278
7279 ; return 0; }
7280 EOF
7281 if { (eval echo configure:7282: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7282   rm -rf conftest*
7283   ol_cv_pthread_kthread=yes
7284 else
7285   echo "configure: failed program was:" >&5
7286   cat conftest.$ac_ext >&5
7287   rm -rf conftest*
7288   ol_cv_pthread_kthread=no
7289 fi
7290 rm -f conftest*
7291 else
7292   cat > conftest.$ac_ext <<EOF
7293 #line 7294 "configure"
7294 #include "confdefs.h"
7295 /* pthread test headers */
7296 #include <pthread.h>
7297 #ifndef NULL
7298 #define NULL (void*)0
7299 #endif
7300
7301 static void *task(p)
7302         void *p;
7303 {
7304         return (void *) (p == NULL);
7305 }
7306
7307
7308 int main(argc, argv)
7309         int argc;
7310         char **argv;
7311 {
7312
7313         /* pthread test function */
7314         pthread_t t;
7315         int status;
7316 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7317         /* This system (e.g. AIX) defaults detached; must override */
7318         pthread_attr_t attr;
7319
7320         status = pthread_attr_init(&attr);
7321         if( status ) exit( status );
7322
7323         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7324         if( status ) exit( status );
7325
7326 #       define  ATTR    &attr
7327 #elif defined( HAVE_PTHREADS_D4 )
7328 #       define  ATTR    pthread_attr_default
7329 #else
7330 #       define  ATTR    NULL
7331 #endif
7332
7333         /* make sure pthread_create() isn't just a stub */
7334         status = pthread_create(&t, ATTR, task, NULL);
7335         if( status ) exit( status );
7336
7337         /* give the thread a chance to complete...
7338      * it should remain joinable and hence detachable
7339          */
7340         sleep( 1 );
7341
7342         /* make sure pthread_detach() isn't just a stub */
7343 #if HAVE_PTHREADS_D4
7344         status = pthread_detach( &t );
7345 #else
7346         status = pthread_detach( t );
7347 #endif
7348
7349 #ifdef HAVE_LINUX_THREADS
7350         pthread_kill_other_threads_np();
7351 #endif
7352
7353         exit( status );
7354
7355 }
7356
7357 EOF
7358 if { (eval echo configure:7359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7359 then
7360   ol_cv_pthread_kthread=yes
7361 else
7362   echo "configure: failed program was:" >&5
7363   cat conftest.$ac_ext >&5
7364   rm -fr conftest*
7365   ol_cv_pthread_kthread=no
7366 fi
7367 rm -fr conftest*
7368 fi
7369
7370
7371                 # restore the LIBS
7372                 LIBS="$ol_LIBS"
7373         
7374 fi
7375
7376 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7377
7378         if test $ol_cv_pthread_kthread = yes ; then
7379                 ol_link_pthreads="-kthread"
7380                 ol_link_threads=posix
7381         fi
7382 fi
7383
7384                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7385 if test "$ol_link_threads" = no ; then
7386         # try -pthread
7387         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7388 echo "configure:7389: checking for pthread link with -pthread" >&5
7389 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7390   echo $ac_n "(cached) $ac_c" 1>&6
7391 else
7392   
7393                 # save the flags
7394                 ol_LIBS="$LIBS"
7395                 LIBS="-pthread $LIBS"
7396
7397                 if test "$cross_compiling" = yes; then
7398   cat > conftest.$ac_ext <<EOF
7399 #line 7400 "configure"
7400 #include "confdefs.h"
7401 /* pthread test headers */
7402 #include <pthread.h>
7403 #ifndef NULL
7404 #define NULL (void*)0
7405 #endif
7406
7407 static void *task(p)
7408         void *p;
7409 {
7410         return (void *) (p == NULL);
7411 }
7412
7413 int main() {
7414
7415         /* pthread test function */
7416         pthread_t t;
7417         int status;
7418 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7419         /* This system (e.g. AIX) defaults detached; must override */
7420         pthread_attr_t attr;
7421
7422         status = pthread_attr_init(&attr);
7423         if( status ) exit( status );
7424
7425         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7426         if( status ) exit( status );
7427
7428 #       define  ATTR    &attr
7429 #elif defined( HAVE_PTHREADS_D4 )
7430 #       define  ATTR    pthread_attr_default
7431 #else
7432 #       define  ATTR    NULL
7433 #endif
7434
7435         /* make sure pthread_create() isn't just a stub */
7436         status = pthread_create(&t, ATTR, task, NULL);
7437         if( status ) exit( status );
7438
7439         /* give the thread a chance to complete...
7440      * it should remain joinable and hence detachable
7441          */
7442         sleep( 1 );
7443
7444         /* make sure pthread_detach() isn't just a stub */
7445 #if HAVE_PTHREADS_D4
7446         status = pthread_detach( &t );
7447 #else
7448         status = pthread_detach( t );
7449 #endif
7450
7451 #ifdef HAVE_LINUX_THREADS
7452         pthread_kill_other_threads_np();
7453 #endif
7454
7455         exit( status );
7456
7457 ; return 0; }
7458 EOF
7459 if { (eval echo configure:7460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7460   rm -rf conftest*
7461   ol_cv_pthread_pthread=yes
7462 else
7463   echo "configure: failed program was:" >&5
7464   cat conftest.$ac_ext >&5
7465   rm -rf conftest*
7466   ol_cv_pthread_pthread=no
7467 fi
7468 rm -f conftest*
7469 else
7470   cat > conftest.$ac_ext <<EOF
7471 #line 7472 "configure"
7472 #include "confdefs.h"
7473 /* pthread test headers */
7474 #include <pthread.h>
7475 #ifndef NULL
7476 #define NULL (void*)0
7477 #endif
7478
7479 static void *task(p)
7480         void *p;
7481 {
7482         return (void *) (p == NULL);
7483 }
7484
7485
7486 int main(argc, argv)
7487         int argc;
7488         char **argv;
7489 {
7490
7491         /* pthread test function */
7492         pthread_t t;
7493         int status;
7494 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7495         /* This system (e.g. AIX) defaults detached; must override */
7496         pthread_attr_t attr;
7497
7498         status = pthread_attr_init(&attr);
7499         if( status ) exit( status );
7500
7501         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7502         if( status ) exit( status );
7503
7504 #       define  ATTR    &attr
7505 #elif defined( HAVE_PTHREADS_D4 )
7506 #       define  ATTR    pthread_attr_default
7507 #else
7508 #       define  ATTR    NULL
7509 #endif
7510
7511         /* make sure pthread_create() isn't just a stub */
7512         status = pthread_create(&t, ATTR, task, NULL);
7513         if( status ) exit( status );
7514
7515         /* give the thread a chance to complete...
7516      * it should remain joinable and hence detachable
7517          */
7518         sleep( 1 );
7519
7520         /* make sure pthread_detach() isn't just a stub */
7521 #if HAVE_PTHREADS_D4
7522         status = pthread_detach( &t );
7523 #else
7524         status = pthread_detach( t );
7525 #endif
7526
7527 #ifdef HAVE_LINUX_THREADS
7528         pthread_kill_other_threads_np();
7529 #endif
7530
7531         exit( status );
7532
7533 }
7534
7535 EOF
7536 if { (eval echo configure:7537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7537 then
7538   ol_cv_pthread_pthread=yes
7539 else
7540   echo "configure: failed program was:" >&5
7541   cat conftest.$ac_ext >&5
7542   rm -fr conftest*
7543   ol_cv_pthread_pthread=no
7544 fi
7545 rm -fr conftest*
7546 fi
7547
7548
7549                 # restore the LIBS
7550                 LIBS="$ol_LIBS"
7551         
7552 fi
7553
7554 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7555
7556         if test $ol_cv_pthread_pthread = yes ; then
7557                 ol_link_pthreads="-pthread"
7558                 ol_link_threads=posix
7559         fi
7560 fi
7561
7562                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7563 if test "$ol_link_threads" = no ; then
7564         # try -pthreads
7565         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7566 echo "configure:7567: checking for pthread link with -pthreads" >&5
7567 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7568   echo $ac_n "(cached) $ac_c" 1>&6
7569 else
7570   
7571                 # save the flags
7572                 ol_LIBS="$LIBS"
7573                 LIBS="-pthreads $LIBS"
7574
7575                 if test "$cross_compiling" = yes; then
7576   cat > conftest.$ac_ext <<EOF
7577 #line 7578 "configure"
7578 #include "confdefs.h"
7579 /* pthread test headers */
7580 #include <pthread.h>
7581 #ifndef NULL
7582 #define NULL (void*)0
7583 #endif
7584
7585 static void *task(p)
7586         void *p;
7587 {
7588         return (void *) (p == NULL);
7589 }
7590
7591 int main() {
7592
7593         /* pthread test function */
7594         pthread_t t;
7595         int status;
7596 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7597         /* This system (e.g. AIX) defaults detached; must override */
7598         pthread_attr_t attr;
7599
7600         status = pthread_attr_init(&attr);
7601         if( status ) exit( status );
7602
7603         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7604         if( status ) exit( status );
7605
7606 #       define  ATTR    &attr
7607 #elif defined( HAVE_PTHREADS_D4 )
7608 #       define  ATTR    pthread_attr_default
7609 #else
7610 #       define  ATTR    NULL
7611 #endif
7612
7613         /* make sure pthread_create() isn't just a stub */
7614         status = pthread_create(&t, ATTR, task, NULL);
7615         if( status ) exit( status );
7616
7617         /* give the thread a chance to complete...
7618      * it should remain joinable and hence detachable
7619          */
7620         sleep( 1 );
7621
7622         /* make sure pthread_detach() isn't just a stub */
7623 #if HAVE_PTHREADS_D4
7624         status = pthread_detach( &t );
7625 #else
7626         status = pthread_detach( t );
7627 #endif
7628
7629 #ifdef HAVE_LINUX_THREADS
7630         pthread_kill_other_threads_np();
7631 #endif
7632
7633         exit( status );
7634
7635 ; return 0; }
7636 EOF
7637 if { (eval echo configure:7638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7638   rm -rf conftest*
7639   ol_cv_pthread_pthreads=yes
7640 else
7641   echo "configure: failed program was:" >&5
7642   cat conftest.$ac_ext >&5
7643   rm -rf conftest*
7644   ol_cv_pthread_pthreads=no
7645 fi
7646 rm -f conftest*
7647 else
7648   cat > conftest.$ac_ext <<EOF
7649 #line 7650 "configure"
7650 #include "confdefs.h"
7651 /* pthread test headers */
7652 #include <pthread.h>
7653 #ifndef NULL
7654 #define NULL (void*)0
7655 #endif
7656
7657 static void *task(p)
7658         void *p;
7659 {
7660         return (void *) (p == NULL);
7661 }
7662
7663
7664 int main(argc, argv)
7665         int argc;
7666         char **argv;
7667 {
7668
7669         /* pthread test function */
7670         pthread_t t;
7671         int status;
7672 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7673         /* This system (e.g. AIX) defaults detached; must override */
7674         pthread_attr_t attr;
7675
7676         status = pthread_attr_init(&attr);
7677         if( status ) exit( status );
7678
7679         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7680         if( status ) exit( status );
7681
7682 #       define  ATTR    &attr
7683 #elif defined( HAVE_PTHREADS_D4 )
7684 #       define  ATTR    pthread_attr_default
7685 #else
7686 #       define  ATTR    NULL
7687 #endif
7688
7689         /* make sure pthread_create() isn't just a stub */
7690         status = pthread_create(&t, ATTR, task, NULL);
7691         if( status ) exit( status );
7692
7693         /* give the thread a chance to complete...
7694      * it should remain joinable and hence detachable
7695          */
7696         sleep( 1 );
7697
7698         /* make sure pthread_detach() isn't just a stub */
7699 #if HAVE_PTHREADS_D4
7700         status = pthread_detach( &t );
7701 #else
7702         status = pthread_detach( t );
7703 #endif
7704
7705 #ifdef HAVE_LINUX_THREADS
7706         pthread_kill_other_threads_np();
7707 #endif
7708
7709         exit( status );
7710
7711 }
7712
7713 EOF
7714 if { (eval echo configure:7715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7715 then
7716   ol_cv_pthread_pthreads=yes
7717 else
7718   echo "configure: failed program was:" >&5
7719   cat conftest.$ac_ext >&5
7720   rm -fr conftest*
7721   ol_cv_pthread_pthreads=no
7722 fi
7723 rm -fr conftest*
7724 fi
7725
7726
7727                 # restore the LIBS
7728                 LIBS="$ol_LIBS"
7729         
7730 fi
7731
7732 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7733
7734         if test $ol_cv_pthread_pthreads = yes ; then
7735                 ol_link_pthreads="-pthreads"
7736                 ol_link_threads=posix
7737         fi
7738 fi
7739
7740                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7741 if test "$ol_link_threads" = no ; then
7742         # try -mthreads
7743         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7744 echo "configure:7745: checking for pthread link with -mthreads" >&5
7745 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7746   echo $ac_n "(cached) $ac_c" 1>&6
7747 else
7748   
7749                 # save the flags
7750                 ol_LIBS="$LIBS"
7751                 LIBS="-mthreads $LIBS"
7752
7753                 if test "$cross_compiling" = yes; then
7754   cat > conftest.$ac_ext <<EOF
7755 #line 7756 "configure"
7756 #include "confdefs.h"
7757 /* pthread test headers */
7758 #include <pthread.h>
7759 #ifndef NULL
7760 #define NULL (void*)0
7761 #endif
7762
7763 static void *task(p)
7764         void *p;
7765 {
7766         return (void *) (p == NULL);
7767 }
7768
7769 int main() {
7770
7771         /* pthread test function */
7772         pthread_t t;
7773         int status;
7774 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7775         /* This system (e.g. AIX) defaults detached; must override */
7776         pthread_attr_t attr;
7777
7778         status = pthread_attr_init(&attr);
7779         if( status ) exit( status );
7780
7781         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7782         if( status ) exit( status );
7783
7784 #       define  ATTR    &attr
7785 #elif defined( HAVE_PTHREADS_D4 )
7786 #       define  ATTR    pthread_attr_default
7787 #else
7788 #       define  ATTR    NULL
7789 #endif
7790
7791         /* make sure pthread_create() isn't just a stub */
7792         status = pthread_create(&t, ATTR, task, NULL);
7793         if( status ) exit( status );
7794
7795         /* give the thread a chance to complete...
7796      * it should remain joinable and hence detachable
7797          */
7798         sleep( 1 );
7799
7800         /* make sure pthread_detach() isn't just a stub */
7801 #if HAVE_PTHREADS_D4
7802         status = pthread_detach( &t );
7803 #else
7804         status = pthread_detach( t );
7805 #endif
7806
7807 #ifdef HAVE_LINUX_THREADS
7808         pthread_kill_other_threads_np();
7809 #endif
7810
7811         exit( status );
7812
7813 ; return 0; }
7814 EOF
7815 if { (eval echo configure:7816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7816   rm -rf conftest*
7817   ol_cv_pthread_mthreads=yes
7818 else
7819   echo "configure: failed program was:" >&5
7820   cat conftest.$ac_ext >&5
7821   rm -rf conftest*
7822   ol_cv_pthread_mthreads=no
7823 fi
7824 rm -f conftest*
7825 else
7826   cat > conftest.$ac_ext <<EOF
7827 #line 7828 "configure"
7828 #include "confdefs.h"
7829 /* pthread test headers */
7830 #include <pthread.h>
7831 #ifndef NULL
7832 #define NULL (void*)0
7833 #endif
7834
7835 static void *task(p)
7836         void *p;
7837 {
7838         return (void *) (p == NULL);
7839 }
7840
7841
7842 int main(argc, argv)
7843         int argc;
7844         char **argv;
7845 {
7846
7847         /* pthread test function */
7848         pthread_t t;
7849         int status;
7850 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7851         /* This system (e.g. AIX) defaults detached; must override */
7852         pthread_attr_t attr;
7853
7854         status = pthread_attr_init(&attr);
7855         if( status ) exit( status );
7856
7857         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7858         if( status ) exit( status );
7859
7860 #       define  ATTR    &attr
7861 #elif defined( HAVE_PTHREADS_D4 )
7862 #       define  ATTR    pthread_attr_default
7863 #else
7864 #       define  ATTR    NULL
7865 #endif
7866
7867         /* make sure pthread_create() isn't just a stub */
7868         status = pthread_create(&t, ATTR, task, NULL);
7869         if( status ) exit( status );
7870
7871         /* give the thread a chance to complete...
7872      * it should remain joinable and hence detachable
7873          */
7874         sleep( 1 );
7875
7876         /* make sure pthread_detach() isn't just a stub */
7877 #if HAVE_PTHREADS_D4
7878         status = pthread_detach( &t );
7879 #else
7880         status = pthread_detach( t );
7881 #endif
7882
7883 #ifdef HAVE_LINUX_THREADS
7884         pthread_kill_other_threads_np();
7885 #endif
7886
7887         exit( status );
7888
7889 }
7890
7891 EOF
7892 if { (eval echo configure:7893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7893 then
7894   ol_cv_pthread_mthreads=yes
7895 else
7896   echo "configure: failed program was:" >&5
7897   cat conftest.$ac_ext >&5
7898   rm -fr conftest*
7899   ol_cv_pthread_mthreads=no
7900 fi
7901 rm -fr conftest*
7902 fi
7903
7904
7905                 # restore the LIBS
7906                 LIBS="$ol_LIBS"
7907         
7908 fi
7909
7910 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7911
7912         if test $ol_cv_pthread_mthreads = yes ; then
7913                 ol_link_pthreads="-mthreads"
7914                 ol_link_threads=posix
7915         fi
7916 fi
7917
7918                 # Pthread try link: -thread (ol_cv_pthread_thread)
7919 if test "$ol_link_threads" = no ; then
7920         # try -thread
7921         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7922 echo "configure:7923: checking for pthread link with -thread" >&5
7923 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7924   echo $ac_n "(cached) $ac_c" 1>&6
7925 else
7926   
7927                 # save the flags
7928                 ol_LIBS="$LIBS"
7929                 LIBS="-thread $LIBS"
7930
7931                 if test "$cross_compiling" = yes; then
7932   cat > conftest.$ac_ext <<EOF
7933 #line 7934 "configure"
7934 #include "confdefs.h"
7935 /* pthread test headers */
7936 #include <pthread.h>
7937 #ifndef NULL
7938 #define NULL (void*)0
7939 #endif
7940
7941 static void *task(p)
7942         void *p;
7943 {
7944         return (void *) (p == NULL);
7945 }
7946
7947 int main() {
7948
7949         /* pthread test function */
7950         pthread_t t;
7951         int status;
7952 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7953         /* This system (e.g. AIX) defaults detached; must override */
7954         pthread_attr_t attr;
7955
7956         status = pthread_attr_init(&attr);
7957         if( status ) exit( status );
7958
7959         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7960         if( status ) exit( status );
7961
7962 #       define  ATTR    &attr
7963 #elif defined( HAVE_PTHREADS_D4 )
7964 #       define  ATTR    pthread_attr_default
7965 #else
7966 #       define  ATTR    NULL
7967 #endif
7968
7969         /* make sure pthread_create() isn't just a stub */
7970         status = pthread_create(&t, ATTR, task, NULL);
7971         if( status ) exit( status );
7972
7973         /* give the thread a chance to complete...
7974      * it should remain joinable and hence detachable
7975          */
7976         sleep( 1 );
7977
7978         /* make sure pthread_detach() isn't just a stub */
7979 #if HAVE_PTHREADS_D4
7980         status = pthread_detach( &t );
7981 #else
7982         status = pthread_detach( t );
7983 #endif
7984
7985 #ifdef HAVE_LINUX_THREADS
7986         pthread_kill_other_threads_np();
7987 #endif
7988
7989         exit( status );
7990
7991 ; return 0; }
7992 EOF
7993 if { (eval echo configure:7994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7994   rm -rf conftest*
7995   ol_cv_pthread_thread=yes
7996 else
7997   echo "configure: failed program was:" >&5
7998   cat conftest.$ac_ext >&5
7999   rm -rf conftest*
8000   ol_cv_pthread_thread=no
8001 fi
8002 rm -f conftest*
8003 else
8004   cat > conftest.$ac_ext <<EOF
8005 #line 8006 "configure"
8006 #include "confdefs.h"
8007 /* pthread test headers */
8008 #include <pthread.h>
8009 #ifndef NULL
8010 #define NULL (void*)0
8011 #endif
8012
8013 static void *task(p)
8014         void *p;
8015 {
8016         return (void *) (p == NULL);
8017 }
8018
8019
8020 int main(argc, argv)
8021         int argc;
8022         char **argv;
8023 {
8024
8025         /* pthread test function */
8026         pthread_t t;
8027         int status;
8028 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8029         /* This system (e.g. AIX) defaults detached; must override */
8030         pthread_attr_t attr;
8031
8032         status = pthread_attr_init(&attr);
8033         if( status ) exit( status );
8034
8035         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8036         if( status ) exit( status );
8037
8038 #       define  ATTR    &attr
8039 #elif defined( HAVE_PTHREADS_D4 )
8040 #       define  ATTR    pthread_attr_default
8041 #else
8042 #       define  ATTR    NULL
8043 #endif
8044
8045         /* make sure pthread_create() isn't just a stub */
8046         status = pthread_create(&t, ATTR, task, NULL);
8047         if( status ) exit( status );
8048
8049         /* give the thread a chance to complete...
8050      * it should remain joinable and hence detachable
8051          */
8052         sleep( 1 );
8053
8054         /* make sure pthread_detach() isn't just a stub */
8055 #if HAVE_PTHREADS_D4
8056         status = pthread_detach( &t );
8057 #else
8058         status = pthread_detach( t );
8059 #endif
8060
8061 #ifdef HAVE_LINUX_THREADS
8062         pthread_kill_other_threads_np();
8063 #endif
8064
8065         exit( status );
8066
8067 }
8068
8069 EOF
8070 if { (eval echo configure:8071: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8071 then
8072   ol_cv_pthread_thread=yes
8073 else
8074   echo "configure: failed program was:" >&5
8075   cat conftest.$ac_ext >&5
8076   rm -fr conftest*
8077   ol_cv_pthread_thread=no
8078 fi
8079 rm -fr conftest*
8080 fi
8081
8082
8083                 # restore the LIBS
8084                 LIBS="$ol_LIBS"
8085         
8086 fi
8087
8088 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8089
8090         if test $ol_cv_pthread_thread = yes ; then
8091                 ol_link_pthreads="-thread"
8092                 ol_link_threads=posix
8093         fi
8094 fi
8095
8096
8097                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8098 if test "$ol_link_threads" = no ; then
8099         # try -lpthread -lmach -lexc -lc_r
8100         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8101 echo "configure:8102: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8102 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8103   echo $ac_n "(cached) $ac_c" 1>&6
8104 else
8105   
8106                 # save the flags
8107                 ol_LIBS="$LIBS"
8108                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8109
8110                 if test "$cross_compiling" = yes; then
8111   cat > conftest.$ac_ext <<EOF
8112 #line 8113 "configure"
8113 #include "confdefs.h"
8114 /* pthread test headers */
8115 #include <pthread.h>
8116 #ifndef NULL
8117 #define NULL (void*)0
8118 #endif
8119
8120 static void *task(p)
8121         void *p;
8122 {
8123         return (void *) (p == NULL);
8124 }
8125
8126 int main() {
8127
8128         /* pthread test function */
8129         pthread_t t;
8130         int status;
8131 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8132         /* This system (e.g. AIX) defaults detached; must override */
8133         pthread_attr_t attr;
8134
8135         status = pthread_attr_init(&attr);
8136         if( status ) exit( status );
8137
8138         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8139         if( status ) exit( status );
8140
8141 #       define  ATTR    &attr
8142 #elif defined( HAVE_PTHREADS_D4 )
8143 #       define  ATTR    pthread_attr_default
8144 #else
8145 #       define  ATTR    NULL
8146 #endif
8147
8148         /* make sure pthread_create() isn't just a stub */
8149         status = pthread_create(&t, ATTR, task, NULL);
8150         if( status ) exit( status );
8151
8152         /* give the thread a chance to complete...
8153      * it should remain joinable and hence detachable
8154          */
8155         sleep( 1 );
8156
8157         /* make sure pthread_detach() isn't just a stub */
8158 #if HAVE_PTHREADS_D4
8159         status = pthread_detach( &t );
8160 #else
8161         status = pthread_detach( t );
8162 #endif
8163
8164 #ifdef HAVE_LINUX_THREADS
8165         pthread_kill_other_threads_np();
8166 #endif
8167
8168         exit( status );
8169
8170 ; return 0; }
8171 EOF
8172 if { (eval echo configure:8173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8173   rm -rf conftest*
8174   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8175 else
8176   echo "configure: failed program was:" >&5
8177   cat conftest.$ac_ext >&5
8178   rm -rf conftest*
8179   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8180 fi
8181 rm -f conftest*
8182 else
8183   cat > conftest.$ac_ext <<EOF
8184 #line 8185 "configure"
8185 #include "confdefs.h"
8186 /* pthread test headers */
8187 #include <pthread.h>
8188 #ifndef NULL
8189 #define NULL (void*)0
8190 #endif
8191
8192 static void *task(p)
8193         void *p;
8194 {
8195         return (void *) (p == NULL);
8196 }
8197
8198
8199 int main(argc, argv)
8200         int argc;
8201         char **argv;
8202 {
8203
8204         /* pthread test function */
8205         pthread_t t;
8206         int status;
8207 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8208         /* This system (e.g. AIX) defaults detached; must override */
8209         pthread_attr_t attr;
8210
8211         status = pthread_attr_init(&attr);
8212         if( status ) exit( status );
8213
8214         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8215         if( status ) exit( status );
8216
8217 #       define  ATTR    &attr
8218 #elif defined( HAVE_PTHREADS_D4 )
8219 #       define  ATTR    pthread_attr_default
8220 #else
8221 #       define  ATTR    NULL
8222 #endif
8223
8224         /* make sure pthread_create() isn't just a stub */
8225         status = pthread_create(&t, ATTR, task, NULL);
8226         if( status ) exit( status );
8227
8228         /* give the thread a chance to complete...
8229      * it should remain joinable and hence detachable
8230          */
8231         sleep( 1 );
8232
8233         /* make sure pthread_detach() isn't just a stub */
8234 #if HAVE_PTHREADS_D4
8235         status = pthread_detach( &t );
8236 #else
8237         status = pthread_detach( t );
8238 #endif
8239
8240 #ifdef HAVE_LINUX_THREADS
8241         pthread_kill_other_threads_np();
8242 #endif
8243
8244         exit( status );
8245
8246 }
8247
8248 EOF
8249 if { (eval echo configure:8250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8250 then
8251   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8252 else
8253   echo "configure: failed program was:" >&5
8254   cat conftest.$ac_ext >&5
8255   rm -fr conftest*
8256   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8257 fi
8258 rm -fr conftest*
8259 fi
8260
8261
8262                 # restore the LIBS
8263                 LIBS="$ol_LIBS"
8264         
8265 fi
8266
8267 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8268
8269         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8270                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8271                 ol_link_threads=posix
8272         fi
8273 fi
8274
8275                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8276 if test "$ol_link_threads" = no ; then
8277         # try -lpthread -lmach -lexc
8278         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8279 echo "configure:8280: checking for pthread link with -lpthread -lmach -lexc" >&5
8280 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8281   echo $ac_n "(cached) $ac_c" 1>&6
8282 else
8283   
8284                 # save the flags
8285                 ol_LIBS="$LIBS"
8286                 LIBS="-lpthread -lmach -lexc $LIBS"
8287
8288                 if test "$cross_compiling" = yes; then
8289   cat > conftest.$ac_ext <<EOF
8290 #line 8291 "configure"
8291 #include "confdefs.h"
8292 /* pthread test headers */
8293 #include <pthread.h>
8294 #ifndef NULL
8295 #define NULL (void*)0
8296 #endif
8297
8298 static void *task(p)
8299         void *p;
8300 {
8301         return (void *) (p == NULL);
8302 }
8303
8304 int main() {
8305
8306         /* pthread test function */
8307         pthread_t t;
8308         int status;
8309 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8310         /* This system (e.g. AIX) defaults detached; must override */
8311         pthread_attr_t attr;
8312
8313         status = pthread_attr_init(&attr);
8314         if( status ) exit( status );
8315
8316         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8317         if( status ) exit( status );
8318
8319 #       define  ATTR    &attr
8320 #elif defined( HAVE_PTHREADS_D4 )
8321 #       define  ATTR    pthread_attr_default
8322 #else
8323 #       define  ATTR    NULL
8324 #endif
8325
8326         /* make sure pthread_create() isn't just a stub */
8327         status = pthread_create(&t, ATTR, task, NULL);
8328         if( status ) exit( status );
8329
8330         /* give the thread a chance to complete...
8331      * it should remain joinable and hence detachable
8332          */
8333         sleep( 1 );
8334
8335         /* make sure pthread_detach() isn't just a stub */
8336 #if HAVE_PTHREADS_D4
8337         status = pthread_detach( &t );
8338 #else
8339         status = pthread_detach( t );
8340 #endif
8341
8342 #ifdef HAVE_LINUX_THREADS
8343         pthread_kill_other_threads_np();
8344 #endif
8345
8346         exit( status );
8347
8348 ; return 0; }
8349 EOF
8350 if { (eval echo configure:8351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8351   rm -rf conftest*
8352   ol_cv_pthread_lpthread_lmach_lexc=yes
8353 else
8354   echo "configure: failed program was:" >&5
8355   cat conftest.$ac_ext >&5
8356   rm -rf conftest*
8357   ol_cv_pthread_lpthread_lmach_lexc=no
8358 fi
8359 rm -f conftest*
8360 else
8361   cat > conftest.$ac_ext <<EOF
8362 #line 8363 "configure"
8363 #include "confdefs.h"
8364 /* pthread test headers */
8365 #include <pthread.h>
8366 #ifndef NULL
8367 #define NULL (void*)0
8368 #endif
8369
8370 static void *task(p)
8371         void *p;
8372 {
8373         return (void *) (p == NULL);
8374 }
8375
8376
8377 int main(argc, argv)
8378         int argc;
8379         char **argv;
8380 {
8381
8382         /* pthread test function */
8383         pthread_t t;
8384         int status;
8385 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8386         /* This system (e.g. AIX) defaults detached; must override */
8387         pthread_attr_t attr;
8388
8389         status = pthread_attr_init(&attr);
8390         if( status ) exit( status );
8391
8392         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8393         if( status ) exit( status );
8394
8395 #       define  ATTR    &attr
8396 #elif defined( HAVE_PTHREADS_D4 )
8397 #       define  ATTR    pthread_attr_default
8398 #else
8399 #       define  ATTR    NULL
8400 #endif
8401
8402         /* make sure pthread_create() isn't just a stub */
8403         status = pthread_create(&t, ATTR, task, NULL);
8404         if( status ) exit( status );
8405
8406         /* give the thread a chance to complete...
8407      * it should remain joinable and hence detachable
8408          */
8409         sleep( 1 );
8410
8411         /* make sure pthread_detach() isn't just a stub */
8412 #if HAVE_PTHREADS_D4
8413         status = pthread_detach( &t );
8414 #else
8415         status = pthread_detach( t );
8416 #endif
8417
8418 #ifdef HAVE_LINUX_THREADS
8419         pthread_kill_other_threads_np();
8420 #endif
8421
8422         exit( status );
8423
8424 }
8425
8426 EOF
8427 if { (eval echo configure:8428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8428 then
8429   ol_cv_pthread_lpthread_lmach_lexc=yes
8430 else
8431   echo "configure: failed program was:" >&5
8432   cat conftest.$ac_ext >&5
8433   rm -fr conftest*
8434   ol_cv_pthread_lpthread_lmach_lexc=no
8435 fi
8436 rm -fr conftest*
8437 fi
8438
8439
8440                 # restore the LIBS
8441                 LIBS="$ol_LIBS"
8442         
8443 fi
8444
8445 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8446
8447         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8448                 ol_link_pthreads="-lpthread -lmach -lexc"
8449                 ol_link_threads=posix
8450         fi
8451 fi
8452
8453
8454                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8455 if test "$ol_link_threads" = no ; then
8456         # try -lpthread -Wl,-woff,85
8457         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8458 echo "configure:8459: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8459 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8460   echo $ac_n "(cached) $ac_c" 1>&6
8461 else
8462   
8463                 # save the flags
8464                 ol_LIBS="$LIBS"
8465                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8466
8467                 if test "$cross_compiling" = yes; then
8468   cat > conftest.$ac_ext <<EOF
8469 #line 8470 "configure"
8470 #include "confdefs.h"
8471 /* pthread test headers */
8472 #include <pthread.h>
8473 #ifndef NULL
8474 #define NULL (void*)0
8475 #endif
8476
8477 static void *task(p)
8478         void *p;
8479 {
8480         return (void *) (p == NULL);
8481 }
8482
8483 int main() {
8484
8485         /* pthread test function */
8486         pthread_t t;
8487         int status;
8488 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8489         /* This system (e.g. AIX) defaults detached; must override */
8490         pthread_attr_t attr;
8491
8492         status = pthread_attr_init(&attr);
8493         if( status ) exit( status );
8494
8495         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8496         if( status ) exit( status );
8497
8498 #       define  ATTR    &attr
8499 #elif defined( HAVE_PTHREADS_D4 )
8500 #       define  ATTR    pthread_attr_default
8501 #else
8502 #       define  ATTR    NULL
8503 #endif
8504
8505         /* make sure pthread_create() isn't just a stub */
8506         status = pthread_create(&t, ATTR, task, NULL);
8507         if( status ) exit( status );
8508
8509         /* give the thread a chance to complete...
8510      * it should remain joinable and hence detachable
8511          */
8512         sleep( 1 );
8513
8514         /* make sure pthread_detach() isn't just a stub */
8515 #if HAVE_PTHREADS_D4
8516         status = pthread_detach( &t );
8517 #else
8518         status = pthread_detach( t );
8519 #endif
8520
8521 #ifdef HAVE_LINUX_THREADS
8522         pthread_kill_other_threads_np();
8523 #endif
8524
8525         exit( status );
8526
8527 ; return 0; }
8528 EOF
8529 if { (eval echo configure:8530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8530   rm -rf conftest*
8531   ol_cv_pthread_lib_lpthread_woff=yes
8532 else
8533   echo "configure: failed program was:" >&5
8534   cat conftest.$ac_ext >&5
8535   rm -rf conftest*
8536   ol_cv_pthread_lib_lpthread_woff=no
8537 fi
8538 rm -f conftest*
8539 else
8540   cat > conftest.$ac_ext <<EOF
8541 #line 8542 "configure"
8542 #include "confdefs.h"
8543 /* pthread test headers */
8544 #include <pthread.h>
8545 #ifndef NULL
8546 #define NULL (void*)0
8547 #endif
8548
8549 static void *task(p)
8550         void *p;
8551 {
8552         return (void *) (p == NULL);
8553 }
8554
8555
8556 int main(argc, argv)
8557         int argc;
8558         char **argv;
8559 {
8560
8561         /* pthread test function */
8562         pthread_t t;
8563         int status;
8564 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8565         /* This system (e.g. AIX) defaults detached; must override */
8566         pthread_attr_t attr;
8567
8568         status = pthread_attr_init(&attr);
8569         if( status ) exit( status );
8570
8571         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8572         if( status ) exit( status );
8573
8574 #       define  ATTR    &attr
8575 #elif defined( HAVE_PTHREADS_D4 )
8576 #       define  ATTR    pthread_attr_default
8577 #else
8578 #       define  ATTR    NULL
8579 #endif
8580
8581         /* make sure pthread_create() isn't just a stub */
8582         status = pthread_create(&t, ATTR, task, NULL);
8583         if( status ) exit( status );
8584
8585         /* give the thread a chance to complete...
8586      * it should remain joinable and hence detachable
8587          */
8588         sleep( 1 );
8589
8590         /* make sure pthread_detach() isn't just a stub */
8591 #if HAVE_PTHREADS_D4
8592         status = pthread_detach( &t );
8593 #else
8594         status = pthread_detach( t );
8595 #endif
8596
8597 #ifdef HAVE_LINUX_THREADS
8598         pthread_kill_other_threads_np();
8599 #endif
8600
8601         exit( status );
8602
8603 }
8604
8605 EOF
8606 if { (eval echo configure:8607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8607 then
8608   ol_cv_pthread_lib_lpthread_woff=yes
8609 else
8610   echo "configure: failed program was:" >&5
8611   cat conftest.$ac_ext >&5
8612   rm -fr conftest*
8613   ol_cv_pthread_lib_lpthread_woff=no
8614 fi
8615 rm -fr conftest*
8616 fi
8617
8618
8619                 # restore the LIBS
8620                 LIBS="$ol_LIBS"
8621         
8622 fi
8623
8624 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
8625
8626         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
8627                 ol_link_pthreads="-lpthread -Wl,-woff,85"
8628                 ol_link_threads=posix
8629         fi
8630 fi
8631
8632
8633                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
8634 if test "$ol_link_threads" = no ; then
8635         # try -lpthread
8636         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
8637 echo "configure:8638: checking for pthread link with -lpthread" >&5
8638 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
8639   echo $ac_n "(cached) $ac_c" 1>&6
8640 else
8641   
8642                 # save the flags
8643                 ol_LIBS="$LIBS"
8644                 LIBS="-lpthread $LIBS"
8645
8646                 if test "$cross_compiling" = yes; then
8647   cat > conftest.$ac_ext <<EOF
8648 #line 8649 "configure"
8649 #include "confdefs.h"
8650 /* pthread test headers */
8651 #include <pthread.h>
8652 #ifndef NULL
8653 #define NULL (void*)0
8654 #endif
8655
8656 static void *task(p)
8657         void *p;
8658 {
8659         return (void *) (p == NULL);
8660 }
8661
8662 int main() {
8663
8664         /* pthread test function */
8665         pthread_t t;
8666         int status;
8667 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8668         /* This system (e.g. AIX) defaults detached; must override */
8669         pthread_attr_t attr;
8670
8671         status = pthread_attr_init(&attr);
8672         if( status ) exit( status );
8673
8674         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8675         if( status ) exit( status );
8676
8677 #       define  ATTR    &attr
8678 #elif defined( HAVE_PTHREADS_D4 )
8679 #       define  ATTR    pthread_attr_default
8680 #else
8681 #       define  ATTR    NULL
8682 #endif
8683
8684         /* make sure pthread_create() isn't just a stub */
8685         status = pthread_create(&t, ATTR, task, NULL);
8686         if( status ) exit( status );
8687
8688         /* give the thread a chance to complete...
8689      * it should remain joinable and hence detachable
8690          */
8691         sleep( 1 );
8692
8693         /* make sure pthread_detach() isn't just a stub */
8694 #if HAVE_PTHREADS_D4
8695         status = pthread_detach( &t );
8696 #else
8697         status = pthread_detach( t );
8698 #endif
8699
8700 #ifdef HAVE_LINUX_THREADS
8701         pthread_kill_other_threads_np();
8702 #endif
8703
8704         exit( status );
8705
8706 ; return 0; }
8707 EOF
8708 if { (eval echo configure:8709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8709   rm -rf conftest*
8710   ol_cv_pthread_lpthread=yes
8711 else
8712   echo "configure: failed program was:" >&5
8713   cat conftest.$ac_ext >&5
8714   rm -rf conftest*
8715   ol_cv_pthread_lpthread=no
8716 fi
8717 rm -f conftest*
8718 else
8719   cat > conftest.$ac_ext <<EOF
8720 #line 8721 "configure"
8721 #include "confdefs.h"
8722 /* pthread test headers */
8723 #include <pthread.h>
8724 #ifndef NULL
8725 #define NULL (void*)0
8726 #endif
8727
8728 static void *task(p)
8729         void *p;
8730 {
8731         return (void *) (p == NULL);
8732 }
8733
8734
8735 int main(argc, argv)
8736         int argc;
8737         char **argv;
8738 {
8739
8740         /* pthread test function */
8741         pthread_t t;
8742         int status;
8743 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8744         /* This system (e.g. AIX) defaults detached; must override */
8745         pthread_attr_t attr;
8746
8747         status = pthread_attr_init(&attr);
8748         if( status ) exit( status );
8749
8750         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8751         if( status ) exit( status );
8752
8753 #       define  ATTR    &attr
8754 #elif defined( HAVE_PTHREADS_D4 )
8755 #       define  ATTR    pthread_attr_default
8756 #else
8757 #       define  ATTR    NULL
8758 #endif
8759
8760         /* make sure pthread_create() isn't just a stub */
8761         status = pthread_create(&t, ATTR, task, NULL);
8762         if( status ) exit( status );
8763
8764         /* give the thread a chance to complete...
8765      * it should remain joinable and hence detachable
8766          */
8767         sleep( 1 );
8768
8769         /* make sure pthread_detach() isn't just a stub */
8770 #if HAVE_PTHREADS_D4
8771         status = pthread_detach( &t );
8772 #else
8773         status = pthread_detach( t );
8774 #endif
8775
8776 #ifdef HAVE_LINUX_THREADS
8777         pthread_kill_other_threads_np();
8778 #endif
8779
8780         exit( status );
8781
8782 }
8783
8784 EOF
8785 if { (eval echo configure:8786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8786 then
8787   ol_cv_pthread_lpthread=yes
8788 else
8789   echo "configure: failed program was:" >&5
8790   cat conftest.$ac_ext >&5
8791   rm -fr conftest*
8792   ol_cv_pthread_lpthread=no
8793 fi
8794 rm -fr conftest*
8795 fi
8796
8797
8798                 # restore the LIBS
8799                 LIBS="$ol_LIBS"
8800         
8801 fi
8802
8803 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
8804
8805         if test $ol_cv_pthread_lpthread = yes ; then
8806                 ol_link_pthreads="-lpthread"
8807                 ol_link_threads=posix
8808         fi
8809 fi
8810
8811                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
8812 if test "$ol_link_threads" = no ; then
8813         # try -lc_r
8814         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
8815 echo "configure:8816: checking for pthread link with -lc_r" >&5
8816 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
8817   echo $ac_n "(cached) $ac_c" 1>&6
8818 else
8819   
8820                 # save the flags
8821                 ol_LIBS="$LIBS"
8822                 LIBS="-lc_r $LIBS"
8823
8824                 if test "$cross_compiling" = yes; then
8825   cat > conftest.$ac_ext <<EOF
8826 #line 8827 "configure"
8827 #include "confdefs.h"
8828 /* pthread test headers */
8829 #include <pthread.h>
8830 #ifndef NULL
8831 #define NULL (void*)0
8832 #endif
8833
8834 static void *task(p)
8835         void *p;
8836 {
8837         return (void *) (p == NULL);
8838 }
8839
8840 int main() {
8841
8842         /* pthread test function */
8843         pthread_t t;
8844         int status;
8845 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8846         /* This system (e.g. AIX) defaults detached; must override */
8847         pthread_attr_t attr;
8848
8849         status = pthread_attr_init(&attr);
8850         if( status ) exit( status );
8851
8852         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8853         if( status ) exit( status );
8854
8855 #       define  ATTR    &attr
8856 #elif defined( HAVE_PTHREADS_D4 )
8857 #       define  ATTR    pthread_attr_default
8858 #else
8859 #       define  ATTR    NULL
8860 #endif
8861
8862         /* make sure pthread_create() isn't just a stub */
8863         status = pthread_create(&t, ATTR, task, NULL);
8864         if( status ) exit( status );
8865
8866         /* give the thread a chance to complete...
8867      * it should remain joinable and hence detachable
8868          */
8869         sleep( 1 );
8870
8871         /* make sure pthread_detach() isn't just a stub */
8872 #if HAVE_PTHREADS_D4
8873         status = pthread_detach( &t );
8874 #else
8875         status = pthread_detach( t );
8876 #endif
8877
8878 #ifdef HAVE_LINUX_THREADS
8879         pthread_kill_other_threads_np();
8880 #endif
8881
8882         exit( status );
8883
8884 ; return 0; }
8885 EOF
8886 if { (eval echo configure:8887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8887   rm -rf conftest*
8888   ol_cv_pthread_lc_r=yes
8889 else
8890   echo "configure: failed program was:" >&5
8891   cat conftest.$ac_ext >&5
8892   rm -rf conftest*
8893   ol_cv_pthread_lc_r=no
8894 fi
8895 rm -f conftest*
8896 else
8897   cat > conftest.$ac_ext <<EOF
8898 #line 8899 "configure"
8899 #include "confdefs.h"
8900 /* pthread test headers */
8901 #include <pthread.h>
8902 #ifndef NULL
8903 #define NULL (void*)0
8904 #endif
8905
8906 static void *task(p)
8907         void *p;
8908 {
8909         return (void *) (p == NULL);
8910 }
8911
8912
8913 int main(argc, argv)
8914         int argc;
8915         char **argv;
8916 {
8917
8918         /* pthread test function */
8919         pthread_t t;
8920         int status;
8921 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8922         /* This system (e.g. AIX) defaults detached; must override */
8923         pthread_attr_t attr;
8924
8925         status = pthread_attr_init(&attr);
8926         if( status ) exit( status );
8927
8928         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8929         if( status ) exit( status );
8930
8931 #       define  ATTR    &attr
8932 #elif defined( HAVE_PTHREADS_D4 )
8933 #       define  ATTR    pthread_attr_default
8934 #else
8935 #       define  ATTR    NULL
8936 #endif
8937
8938         /* make sure pthread_create() isn't just a stub */
8939         status = pthread_create(&t, ATTR, task, NULL);
8940         if( status ) exit( status );
8941
8942         /* give the thread a chance to complete...
8943      * it should remain joinable and hence detachable
8944          */
8945         sleep( 1 );
8946
8947         /* make sure pthread_detach() isn't just a stub */
8948 #if HAVE_PTHREADS_D4
8949         status = pthread_detach( &t );
8950 #else
8951         status = pthread_detach( t );
8952 #endif
8953
8954 #ifdef HAVE_LINUX_THREADS
8955         pthread_kill_other_threads_np();
8956 #endif
8957
8958         exit( status );
8959
8960 }
8961
8962 EOF
8963 if { (eval echo configure:8964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8964 then
8965   ol_cv_pthread_lc_r=yes
8966 else
8967   echo "configure: failed program was:" >&5
8968   cat conftest.$ac_ext >&5
8969   rm -fr conftest*
8970   ol_cv_pthread_lc_r=no
8971 fi
8972 rm -fr conftest*
8973 fi
8974
8975
8976                 # restore the LIBS
8977                 LIBS="$ol_LIBS"
8978         
8979 fi
8980
8981 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8982
8983         if test $ol_cv_pthread_lc_r = yes ; then
8984                 ol_link_pthreads="-lc_r"
8985                 ol_link_threads=posix
8986         fi
8987 fi
8988
8989
8990                 # Pthread try link: -threads (ol_cv_pthread_threads)
8991 if test "$ol_link_threads" = no ; then
8992         # try -threads
8993         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8994 echo "configure:8995: checking for pthread link with -threads" >&5
8995 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8996   echo $ac_n "(cached) $ac_c" 1>&6
8997 else
8998   
8999                 # save the flags
9000                 ol_LIBS="$LIBS"
9001                 LIBS="-threads $LIBS"
9002
9003                 if test "$cross_compiling" = yes; then
9004   cat > conftest.$ac_ext <<EOF
9005 #line 9006 "configure"
9006 #include "confdefs.h"
9007 /* pthread test headers */
9008 #include <pthread.h>
9009 #ifndef NULL
9010 #define NULL (void*)0
9011 #endif
9012
9013 static void *task(p)
9014         void *p;
9015 {
9016         return (void *) (p == NULL);
9017 }
9018
9019 int main() {
9020
9021         /* pthread test function */
9022         pthread_t t;
9023         int status;
9024 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9025         /* This system (e.g. AIX) defaults detached; must override */
9026         pthread_attr_t attr;
9027
9028         status = pthread_attr_init(&attr);
9029         if( status ) exit( status );
9030
9031         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9032         if( status ) exit( status );
9033
9034 #       define  ATTR    &attr
9035 #elif defined( HAVE_PTHREADS_D4 )
9036 #       define  ATTR    pthread_attr_default
9037 #else
9038 #       define  ATTR    NULL
9039 #endif
9040
9041         /* make sure pthread_create() isn't just a stub */
9042         status = pthread_create(&t, ATTR, task, NULL);
9043         if( status ) exit( status );
9044
9045         /* give the thread a chance to complete...
9046      * it should remain joinable and hence detachable
9047          */
9048         sleep( 1 );
9049
9050         /* make sure pthread_detach() isn't just a stub */
9051 #if HAVE_PTHREADS_D4
9052         status = pthread_detach( &t );
9053 #else
9054         status = pthread_detach( t );
9055 #endif
9056
9057 #ifdef HAVE_LINUX_THREADS
9058         pthread_kill_other_threads_np();
9059 #endif
9060
9061         exit( status );
9062
9063 ; return 0; }
9064 EOF
9065 if { (eval echo configure:9066: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9066   rm -rf conftest*
9067   ol_cv_pthread_threads=yes
9068 else
9069   echo "configure: failed program was:" >&5
9070   cat conftest.$ac_ext >&5
9071   rm -rf conftest*
9072   ol_cv_pthread_threads=no
9073 fi
9074 rm -f conftest*
9075 else
9076   cat > conftest.$ac_ext <<EOF
9077 #line 9078 "configure"
9078 #include "confdefs.h"
9079 /* pthread test headers */
9080 #include <pthread.h>
9081 #ifndef NULL
9082 #define NULL (void*)0
9083 #endif
9084
9085 static void *task(p)
9086         void *p;
9087 {
9088         return (void *) (p == NULL);
9089 }
9090
9091
9092 int main(argc, argv)
9093         int argc;
9094         char **argv;
9095 {
9096
9097         /* pthread test function */
9098         pthread_t t;
9099         int status;
9100 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9101         /* This system (e.g. AIX) defaults detached; must override */
9102         pthread_attr_t attr;
9103
9104         status = pthread_attr_init(&attr);
9105         if( status ) exit( status );
9106
9107         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9108         if( status ) exit( status );
9109
9110 #       define  ATTR    &attr
9111 #elif defined( HAVE_PTHREADS_D4 )
9112 #       define  ATTR    pthread_attr_default
9113 #else
9114 #       define  ATTR    NULL
9115 #endif
9116
9117         /* make sure pthread_create() isn't just a stub */
9118         status = pthread_create(&t, ATTR, task, NULL);
9119         if( status ) exit( status );
9120
9121         /* give the thread a chance to complete...
9122      * it should remain joinable and hence detachable
9123          */
9124         sleep( 1 );
9125
9126         /* make sure pthread_detach() isn't just a stub */
9127 #if HAVE_PTHREADS_D4
9128         status = pthread_detach( &t );
9129 #else
9130         status = pthread_detach( t );
9131 #endif
9132
9133 #ifdef HAVE_LINUX_THREADS
9134         pthread_kill_other_threads_np();
9135 #endif
9136
9137         exit( status );
9138
9139 }
9140
9141 EOF
9142 if { (eval echo configure:9143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9143 then
9144   ol_cv_pthread_threads=yes
9145 else
9146   echo "configure: failed program was:" >&5
9147   cat conftest.$ac_ext >&5
9148   rm -fr conftest*
9149   ol_cv_pthread_threads=no
9150 fi
9151 rm -fr conftest*
9152 fi
9153
9154
9155                 # restore the LIBS
9156                 LIBS="$ol_LIBS"
9157         
9158 fi
9159
9160 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9161
9162         if test $ol_cv_pthread_threads = yes ; then
9163                 ol_link_pthreads="-threads"
9164                 ol_link_threads=posix
9165         fi
9166 fi
9167
9168
9169                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9170 if test "$ol_link_threads" = no ; then
9171         # try -lpthreads -lmach -lexc -lc_r
9172         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9173 echo "configure:9174: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9174 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9175   echo $ac_n "(cached) $ac_c" 1>&6
9176 else
9177   
9178                 # save the flags
9179                 ol_LIBS="$LIBS"
9180                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9181
9182                 if test "$cross_compiling" = yes; then
9183   cat > conftest.$ac_ext <<EOF
9184 #line 9185 "configure"
9185 #include "confdefs.h"
9186 /* pthread test headers */
9187 #include <pthread.h>
9188 #ifndef NULL
9189 #define NULL (void*)0
9190 #endif
9191
9192 static void *task(p)
9193         void *p;
9194 {
9195         return (void *) (p == NULL);
9196 }
9197
9198 int main() {
9199
9200         /* pthread test function */
9201         pthread_t t;
9202         int status;
9203 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9204         /* This system (e.g. AIX) defaults detached; must override */
9205         pthread_attr_t attr;
9206
9207         status = pthread_attr_init(&attr);
9208         if( status ) exit( status );
9209
9210         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9211         if( status ) exit( status );
9212
9213 #       define  ATTR    &attr
9214 #elif defined( HAVE_PTHREADS_D4 )
9215 #       define  ATTR    pthread_attr_default
9216 #else
9217 #       define  ATTR    NULL
9218 #endif
9219
9220         /* make sure pthread_create() isn't just a stub */
9221         status = pthread_create(&t, ATTR, task, NULL);
9222         if( status ) exit( status );
9223
9224         /* give the thread a chance to complete...
9225      * it should remain joinable and hence detachable
9226          */
9227         sleep( 1 );
9228
9229         /* make sure pthread_detach() isn't just a stub */
9230 #if HAVE_PTHREADS_D4
9231         status = pthread_detach( &t );
9232 #else
9233         status = pthread_detach( t );
9234 #endif
9235
9236 #ifdef HAVE_LINUX_THREADS
9237         pthread_kill_other_threads_np();
9238 #endif
9239
9240         exit( status );
9241
9242 ; return 0; }
9243 EOF
9244 if { (eval echo configure:9245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9245   rm -rf conftest*
9246   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9247 else
9248   echo "configure: failed program was:" >&5
9249   cat conftest.$ac_ext >&5
9250   rm -rf conftest*
9251   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9252 fi
9253 rm -f conftest*
9254 else
9255   cat > conftest.$ac_ext <<EOF
9256 #line 9257 "configure"
9257 #include "confdefs.h"
9258 /* pthread test headers */
9259 #include <pthread.h>
9260 #ifndef NULL
9261 #define NULL (void*)0
9262 #endif
9263
9264 static void *task(p)
9265         void *p;
9266 {
9267         return (void *) (p == NULL);
9268 }
9269
9270
9271 int main(argc, argv)
9272         int argc;
9273         char **argv;
9274 {
9275
9276         /* pthread test function */
9277         pthread_t t;
9278         int status;
9279 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9280         /* This system (e.g. AIX) defaults detached; must override */
9281         pthread_attr_t attr;
9282
9283         status = pthread_attr_init(&attr);
9284         if( status ) exit( status );
9285
9286         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9287         if( status ) exit( status );
9288
9289 #       define  ATTR    &attr
9290 #elif defined( HAVE_PTHREADS_D4 )
9291 #       define  ATTR    pthread_attr_default
9292 #else
9293 #       define  ATTR    NULL
9294 #endif
9295
9296         /* make sure pthread_create() isn't just a stub */
9297         status = pthread_create(&t, ATTR, task, NULL);
9298         if( status ) exit( status );
9299
9300         /* give the thread a chance to complete...
9301      * it should remain joinable and hence detachable
9302          */
9303         sleep( 1 );
9304
9305         /* make sure pthread_detach() isn't just a stub */
9306 #if HAVE_PTHREADS_D4
9307         status = pthread_detach( &t );
9308 #else
9309         status = pthread_detach( t );
9310 #endif
9311
9312 #ifdef HAVE_LINUX_THREADS
9313         pthread_kill_other_threads_np();
9314 #endif
9315
9316         exit( status );
9317
9318 }
9319
9320 EOF
9321 if { (eval echo configure:9322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9322 then
9323   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9324 else
9325   echo "configure: failed program was:" >&5
9326   cat conftest.$ac_ext >&5
9327   rm -fr conftest*
9328   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9329 fi
9330 rm -fr conftest*
9331 fi
9332
9333
9334                 # restore the LIBS
9335                 LIBS="$ol_LIBS"
9336         
9337 fi
9338
9339 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9340
9341         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9342                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9343                 ol_link_threads=posix
9344         fi
9345 fi
9346
9347                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9348 if test "$ol_link_threads" = no ; then
9349         # try -lpthreads -lmach -lexc
9350         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9351 echo "configure:9352: checking for pthread link with -lpthreads -lmach -lexc" >&5
9352 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9353   echo $ac_n "(cached) $ac_c" 1>&6
9354 else
9355   
9356                 # save the flags
9357                 ol_LIBS="$LIBS"
9358                 LIBS="-lpthreads -lmach -lexc $LIBS"
9359
9360                 if test "$cross_compiling" = yes; then
9361   cat > conftest.$ac_ext <<EOF
9362 #line 9363 "configure"
9363 #include "confdefs.h"
9364 /* pthread test headers */
9365 #include <pthread.h>
9366 #ifndef NULL
9367 #define NULL (void*)0
9368 #endif
9369
9370 static void *task(p)
9371         void *p;
9372 {
9373         return (void *) (p == NULL);
9374 }
9375
9376 int main() {
9377
9378         /* pthread test function */
9379         pthread_t t;
9380         int status;
9381 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9382         /* This system (e.g. AIX) defaults detached; must override */
9383         pthread_attr_t attr;
9384
9385         status = pthread_attr_init(&attr);
9386         if( status ) exit( status );
9387
9388         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9389         if( status ) exit( status );
9390
9391 #       define  ATTR    &attr
9392 #elif defined( HAVE_PTHREADS_D4 )
9393 #       define  ATTR    pthread_attr_default
9394 #else
9395 #       define  ATTR    NULL
9396 #endif
9397
9398         /* make sure pthread_create() isn't just a stub */
9399         status = pthread_create(&t, ATTR, task, NULL);
9400         if( status ) exit( status );
9401
9402         /* give the thread a chance to complete...
9403      * it should remain joinable and hence detachable
9404          */
9405         sleep( 1 );
9406
9407         /* make sure pthread_detach() isn't just a stub */
9408 #if HAVE_PTHREADS_D4
9409         status = pthread_detach( &t );
9410 #else
9411         status = pthread_detach( t );
9412 #endif
9413
9414 #ifdef HAVE_LINUX_THREADS
9415         pthread_kill_other_threads_np();
9416 #endif
9417
9418         exit( status );
9419
9420 ; return 0; }
9421 EOF
9422 if { (eval echo configure:9423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9423   rm -rf conftest*
9424   ol_cv_pthread_lpthreads_lmach_lexc=yes
9425 else
9426   echo "configure: failed program was:" >&5
9427   cat conftest.$ac_ext >&5
9428   rm -rf conftest*
9429   ol_cv_pthread_lpthreads_lmach_lexc=no
9430 fi
9431 rm -f conftest*
9432 else
9433   cat > conftest.$ac_ext <<EOF
9434 #line 9435 "configure"
9435 #include "confdefs.h"
9436 /* pthread test headers */
9437 #include <pthread.h>
9438 #ifndef NULL
9439 #define NULL (void*)0
9440 #endif
9441
9442 static void *task(p)
9443         void *p;
9444 {
9445         return (void *) (p == NULL);
9446 }
9447
9448
9449 int main(argc, argv)
9450         int argc;
9451         char **argv;
9452 {
9453
9454         /* pthread test function */
9455         pthread_t t;
9456         int status;
9457 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9458         /* This system (e.g. AIX) defaults detached; must override */
9459         pthread_attr_t attr;
9460
9461         status = pthread_attr_init(&attr);
9462         if( status ) exit( status );
9463
9464         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9465         if( status ) exit( status );
9466
9467 #       define  ATTR    &attr
9468 #elif defined( HAVE_PTHREADS_D4 )
9469 #       define  ATTR    pthread_attr_default
9470 #else
9471 #       define  ATTR    NULL
9472 #endif
9473
9474         /* make sure pthread_create() isn't just a stub */
9475         status = pthread_create(&t, ATTR, task, NULL);
9476         if( status ) exit( status );
9477
9478         /* give the thread a chance to complete...
9479      * it should remain joinable and hence detachable
9480          */
9481         sleep( 1 );
9482
9483         /* make sure pthread_detach() isn't just a stub */
9484 #if HAVE_PTHREADS_D4
9485         status = pthread_detach( &t );
9486 #else
9487         status = pthread_detach( t );
9488 #endif
9489
9490 #ifdef HAVE_LINUX_THREADS
9491         pthread_kill_other_threads_np();
9492 #endif
9493
9494         exit( status );
9495
9496 }
9497
9498 EOF
9499 if { (eval echo configure:9500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9500 then
9501   ol_cv_pthread_lpthreads_lmach_lexc=yes
9502 else
9503   echo "configure: failed program was:" >&5
9504   cat conftest.$ac_ext >&5
9505   rm -fr conftest*
9506   ol_cv_pthread_lpthreads_lmach_lexc=no
9507 fi
9508 rm -fr conftest*
9509 fi
9510
9511
9512                 # restore the LIBS
9513                 LIBS="$ol_LIBS"
9514         
9515 fi
9516
9517 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9518
9519         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
9520                 ol_link_pthreads="-lpthreads -lmach -lexc"
9521                 ol_link_threads=posix
9522         fi
9523 fi
9524
9525                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
9526 if test "$ol_link_threads" = no ; then
9527         # try -lpthreads -lexc
9528         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
9529 echo "configure:9530: checking for pthread link with -lpthreads -lexc" >&5
9530 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
9531   echo $ac_n "(cached) $ac_c" 1>&6
9532 else
9533   
9534                 # save the flags
9535                 ol_LIBS="$LIBS"
9536                 LIBS="-lpthreads -lexc $LIBS"
9537
9538                 if test "$cross_compiling" = yes; then
9539   cat > conftest.$ac_ext <<EOF
9540 #line 9541 "configure"
9541 #include "confdefs.h"
9542 /* pthread test headers */
9543 #include <pthread.h>
9544 #ifndef NULL
9545 #define NULL (void*)0
9546 #endif
9547
9548 static void *task(p)
9549         void *p;
9550 {
9551         return (void *) (p == NULL);
9552 }
9553
9554 int main() {
9555
9556         /* pthread test function */
9557         pthread_t t;
9558         int status;
9559 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9560         /* This system (e.g. AIX) defaults detached; must override */
9561         pthread_attr_t attr;
9562
9563         status = pthread_attr_init(&attr);
9564         if( status ) exit( status );
9565
9566         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9567         if( status ) exit( status );
9568
9569 #       define  ATTR    &attr
9570 #elif defined( HAVE_PTHREADS_D4 )
9571 #       define  ATTR    pthread_attr_default
9572 #else
9573 #       define  ATTR    NULL
9574 #endif
9575
9576         /* make sure pthread_create() isn't just a stub */
9577         status = pthread_create(&t, ATTR, task, NULL);
9578         if( status ) exit( status );
9579
9580         /* give the thread a chance to complete...
9581      * it should remain joinable and hence detachable
9582          */
9583         sleep( 1 );
9584
9585         /* make sure pthread_detach() isn't just a stub */
9586 #if HAVE_PTHREADS_D4
9587         status = pthread_detach( &t );
9588 #else
9589         status = pthread_detach( t );
9590 #endif
9591
9592 #ifdef HAVE_LINUX_THREADS
9593         pthread_kill_other_threads_np();
9594 #endif
9595
9596         exit( status );
9597
9598 ; return 0; }
9599 EOF
9600 if { (eval echo configure:9601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9601   rm -rf conftest*
9602   ol_cv_pthread_lpthreads_lexc=yes
9603 else
9604   echo "configure: failed program was:" >&5
9605   cat conftest.$ac_ext >&5
9606   rm -rf conftest*
9607   ol_cv_pthread_lpthreads_lexc=no
9608 fi
9609 rm -f conftest*
9610 else
9611   cat > conftest.$ac_ext <<EOF
9612 #line 9613 "configure"
9613 #include "confdefs.h"
9614 /* pthread test headers */
9615 #include <pthread.h>
9616 #ifndef NULL
9617 #define NULL (void*)0
9618 #endif
9619
9620 static void *task(p)
9621         void *p;
9622 {
9623         return (void *) (p == NULL);
9624 }
9625
9626
9627 int main(argc, argv)
9628         int argc;
9629         char **argv;
9630 {
9631
9632         /* pthread test function */
9633         pthread_t t;
9634         int status;
9635 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9636         /* This system (e.g. AIX) defaults detached; must override */
9637         pthread_attr_t attr;
9638
9639         status = pthread_attr_init(&attr);
9640         if( status ) exit( status );
9641
9642         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9643         if( status ) exit( status );
9644
9645 #       define  ATTR    &attr
9646 #elif defined( HAVE_PTHREADS_D4 )
9647 #       define  ATTR    pthread_attr_default
9648 #else
9649 #       define  ATTR    NULL
9650 #endif
9651
9652         /* make sure pthread_create() isn't just a stub */
9653         status = pthread_create(&t, ATTR, task, NULL);
9654         if( status ) exit( status );
9655
9656         /* give the thread a chance to complete...
9657      * it should remain joinable and hence detachable
9658          */
9659         sleep( 1 );
9660
9661         /* make sure pthread_detach() isn't just a stub */
9662 #if HAVE_PTHREADS_D4
9663         status = pthread_detach( &t );
9664 #else
9665         status = pthread_detach( t );
9666 #endif
9667
9668 #ifdef HAVE_LINUX_THREADS
9669         pthread_kill_other_threads_np();
9670 #endif
9671
9672         exit( status );
9673
9674 }
9675
9676 EOF
9677 if { (eval echo configure:9678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9678 then
9679   ol_cv_pthread_lpthreads_lexc=yes
9680 else
9681   echo "configure: failed program was:" >&5
9682   cat conftest.$ac_ext >&5
9683   rm -fr conftest*
9684   ol_cv_pthread_lpthreads_lexc=no
9685 fi
9686 rm -fr conftest*
9687 fi
9688
9689
9690                 # restore the LIBS
9691                 LIBS="$ol_LIBS"
9692         
9693 fi
9694
9695 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
9696
9697         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
9698                 ol_link_pthreads="-lpthreads -lexc"
9699                 ol_link_threads=posix
9700         fi
9701 fi
9702
9703
9704                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
9705 if test "$ol_link_threads" = no ; then
9706         # try -lpthreads
9707         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
9708 echo "configure:9709: checking for pthread link with -lpthreads" >&5
9709 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
9710   echo $ac_n "(cached) $ac_c" 1>&6
9711 else
9712   
9713                 # save the flags
9714                 ol_LIBS="$LIBS"
9715                 LIBS="-lpthreads $LIBS"
9716
9717                 if test "$cross_compiling" = yes; then
9718   cat > conftest.$ac_ext <<EOF
9719 #line 9720 "configure"
9720 #include "confdefs.h"
9721 /* pthread test headers */
9722 #include <pthread.h>
9723 #ifndef NULL
9724 #define NULL (void*)0
9725 #endif
9726
9727 static void *task(p)
9728         void *p;
9729 {
9730         return (void *) (p == NULL);
9731 }
9732
9733 int main() {
9734
9735         /* pthread test function */
9736         pthread_t t;
9737         int status;
9738 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9739         /* This system (e.g. AIX) defaults detached; must override */
9740         pthread_attr_t attr;
9741
9742         status = pthread_attr_init(&attr);
9743         if( status ) exit( status );
9744
9745         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9746         if( status ) exit( status );
9747
9748 #       define  ATTR    &attr
9749 #elif defined( HAVE_PTHREADS_D4 )
9750 #       define  ATTR    pthread_attr_default
9751 #else
9752 #       define  ATTR    NULL
9753 #endif
9754
9755         /* make sure pthread_create() isn't just a stub */
9756         status = pthread_create(&t, ATTR, task, NULL);
9757         if( status ) exit( status );
9758
9759         /* give the thread a chance to complete...
9760      * it should remain joinable and hence detachable
9761          */
9762         sleep( 1 );
9763
9764         /* make sure pthread_detach() isn't just a stub */
9765 #if HAVE_PTHREADS_D4
9766         status = pthread_detach( &t );
9767 #else
9768         status = pthread_detach( t );
9769 #endif
9770
9771 #ifdef HAVE_LINUX_THREADS
9772         pthread_kill_other_threads_np();
9773 #endif
9774
9775         exit( status );
9776
9777 ; return 0; }
9778 EOF
9779 if { (eval echo configure:9780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9780   rm -rf conftest*
9781   ol_cv_pthread_lib_lpthreads=yes
9782 else
9783   echo "configure: failed program was:" >&5
9784   cat conftest.$ac_ext >&5
9785   rm -rf conftest*
9786   ol_cv_pthread_lib_lpthreads=no
9787 fi
9788 rm -f conftest*
9789 else
9790   cat > conftest.$ac_ext <<EOF
9791 #line 9792 "configure"
9792 #include "confdefs.h"
9793 /* pthread test headers */
9794 #include <pthread.h>
9795 #ifndef NULL
9796 #define NULL (void*)0
9797 #endif
9798
9799 static void *task(p)
9800         void *p;
9801 {
9802         return (void *) (p == NULL);
9803 }
9804
9805
9806 int main(argc, argv)
9807         int argc;
9808         char **argv;
9809 {
9810
9811         /* pthread test function */
9812         pthread_t t;
9813         int status;
9814 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9815         /* This system (e.g. AIX) defaults detached; must override */
9816         pthread_attr_t attr;
9817
9818         status = pthread_attr_init(&attr);
9819         if( status ) exit( status );
9820
9821         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9822         if( status ) exit( status );
9823
9824 #       define  ATTR    &attr
9825 #elif defined( HAVE_PTHREADS_D4 )
9826 #       define  ATTR    pthread_attr_default
9827 #else
9828 #       define  ATTR    NULL
9829 #endif
9830
9831         /* make sure pthread_create() isn't just a stub */
9832         status = pthread_create(&t, ATTR, task, NULL);
9833         if( status ) exit( status );
9834
9835         /* give the thread a chance to complete...
9836      * it should remain joinable and hence detachable
9837          */
9838         sleep( 1 );
9839
9840         /* make sure pthread_detach() isn't just a stub */
9841 #if HAVE_PTHREADS_D4
9842         status = pthread_detach( &t );
9843 #else
9844         status = pthread_detach( t );
9845 #endif
9846
9847 #ifdef HAVE_LINUX_THREADS
9848         pthread_kill_other_threads_np();
9849 #endif
9850
9851         exit( status );
9852
9853 }
9854
9855 EOF
9856 if { (eval echo configure:9857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9857 then
9858   ol_cv_pthread_lib_lpthreads=yes
9859 else
9860   echo "configure: failed program was:" >&5
9861   cat conftest.$ac_ext >&5
9862   rm -fr conftest*
9863   ol_cv_pthread_lib_lpthreads=no
9864 fi
9865 rm -fr conftest*
9866 fi
9867
9868
9869                 # restore the LIBS
9870                 LIBS="$ol_LIBS"
9871         
9872 fi
9873
9874 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
9875
9876         if test $ol_cv_pthread_lib_lpthreads = yes ; then
9877                 ol_link_pthreads="-lpthreads"
9878                 ol_link_threads=posix
9879         fi
9880 fi
9881
9882
9883                 if test $ol_link_threads != no ; then
9884                         cat >> confdefs.h <<\EOF
9885 #define HAVE_PTHREADS 1
9886 EOF
9887
9888
9889                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
9890
9891                                                 save_CPPFLAGS="$CPPFLAGS"
9892                         save_LIBS="$LIBS"
9893                         LIBS="$LTHREAD_LIBS $LIBS"
9894
9895                                                                                                 for ac_func in sched_yield pthread_yield
9896 do
9897 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9898 echo "configure:9899: checking for $ac_func" >&5
9899 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9900   echo $ac_n "(cached) $ac_c" 1>&6
9901 else
9902   cat > conftest.$ac_ext <<EOF
9903 #line 9904 "configure"
9904 #include "confdefs.h"
9905 /* System header to define __stub macros and hopefully few prototypes,
9906     which can conflict with char $ac_func(); below.  */
9907 #include <assert.h>
9908 /* Override any gcc2 internal prototype to avoid an error.  */
9909 /* We use char because int might match the return type of a gcc2
9910     builtin and then its argument prototype would still apply.  */
9911 char $ac_func();
9912 char (*f)();
9913
9914 int main() {
9915
9916 /* The GNU C library defines this for functions which it implements
9917     to always fail with ENOSYS.  Some functions are actually named
9918     something starting with __ and the normal name is an alias.  */
9919 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9920 choke me
9921 #else
9922 f = $ac_func;
9923 #endif
9924
9925 ; return 0; }
9926 EOF
9927 if { (eval echo configure:9928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9928   rm -rf conftest*
9929   eval "ac_cv_func_$ac_func=yes"
9930 else
9931   echo "configure: failed program was:" >&5
9932   cat conftest.$ac_ext >&5
9933   rm -rf conftest*
9934   eval "ac_cv_func_$ac_func=no"
9935 fi
9936 rm -f conftest*
9937 fi
9938
9939 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9940   echo "$ac_t""yes" 1>&6
9941     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9942   cat >> confdefs.h <<EOF
9943 #define $ac_tr_func 1
9944 EOF
9945  
9946 else
9947   echo "$ac_t""no" 1>&6
9948 fi
9949 done
9950
9951
9952                         if test $ac_cv_func_sched_yield = no -a \
9953                                 $ac_cv_func_pthread_yield = no ; then
9954                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
9955 echo "configure:9956: checking for sched_yield in -lrt" >&5
9956 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
9957 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9958   echo $ac_n "(cached) $ac_c" 1>&6
9959 else
9960   ac_save_LIBS="$LIBS"
9961 LIBS="-lrt  $LIBS"
9962 cat > conftest.$ac_ext <<EOF
9963 #line 9964 "configure"
9964 #include "confdefs.h"
9965 /* Override any gcc2 internal prototype to avoid an error.  */
9966 /* We use char because int might match the return type of a gcc2
9967     builtin and then its argument prototype would still apply.  */
9968 char sched_yield();
9969
9970 int main() {
9971 sched_yield()
9972 ; return 0; }
9973 EOF
9974 if { (eval echo configure:9975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9975   rm -rf conftest*
9976   eval "ac_cv_lib_$ac_lib_var=yes"
9977 else
9978   echo "configure: failed program was:" >&5
9979   cat conftest.$ac_ext >&5
9980   rm -rf conftest*
9981   eval "ac_cv_lib_$ac_lib_var=no"
9982 fi
9983 rm -f conftest*
9984 LIBS="$ac_save_LIBS"
9985
9986 fi
9987 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9988   echo "$ac_t""yes" 1>&6
9989   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
9990                                         cat >> confdefs.h <<\EOF
9991 #define HAVE_SCHED_YIELD 1
9992 EOF
9993
9994                                         ac_cv_func_sched_yield=yes
9995 else
9996   echo "$ac_t""no" 1>&6
9997 ac_cv_func_sched_yield=no
9998 fi
9999
10000                         fi
10001                         if test $ac_cv_func_sched_yield = no -a \
10002                                 $ac_cv_func_pthread_yield = no ; then
10003                                                                                                 for ac_func in thr_yield
10004 do
10005 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10006 echo "configure:10007: checking for $ac_func" >&5
10007 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10008   echo $ac_n "(cached) $ac_c" 1>&6
10009 else
10010   cat > conftest.$ac_ext <<EOF
10011 #line 10012 "configure"
10012 #include "confdefs.h"
10013 /* System header to define __stub macros and hopefully few prototypes,
10014     which can conflict with char $ac_func(); below.  */
10015 #include <assert.h>
10016 /* Override any gcc2 internal prototype to avoid an error.  */
10017 /* We use char because int might match the return type of a gcc2
10018     builtin and then its argument prototype would still apply.  */
10019 char $ac_func();
10020 char (*f)();
10021
10022 int main() {
10023
10024 /* The GNU C library defines this for functions which it implements
10025     to always fail with ENOSYS.  Some functions are actually named
10026     something starting with __ and the normal name is an alias.  */
10027 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10028 choke me
10029 #else
10030 f = $ac_func;
10031 #endif
10032
10033 ; return 0; }
10034 EOF
10035 if { (eval echo configure:10036: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10036   rm -rf conftest*
10037   eval "ac_cv_func_$ac_func=yes"
10038 else
10039   echo "configure: failed program was:" >&5
10040   cat conftest.$ac_ext >&5
10041   rm -rf conftest*
10042   eval "ac_cv_func_$ac_func=no"
10043 fi
10044 rm -f conftest*
10045 fi
10046
10047 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10048   echo "$ac_t""yes" 1>&6
10049     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10050   cat >> confdefs.h <<EOF
10051 #define $ac_tr_func 1
10052 EOF
10053  
10054 else
10055   echo "$ac_t""no" 1>&6
10056 fi
10057 done
10058
10059                         fi
10060                         if test $ac_cv_func_sched_yield = no -a \
10061                                 $ac_cv_func_pthread_yield = no -a \
10062                                 "$ac_cv_func_thr_yield" = no ; then
10063                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
10064                         fi
10065
10066                                                 for ac_func in pthread_kill pthread_rwlock_destroy
10067 do
10068 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10069 echo "configure:10070: checking for $ac_func" >&5
10070 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10071   echo $ac_n "(cached) $ac_c" 1>&6
10072 else
10073   cat > conftest.$ac_ext <<EOF
10074 #line 10075 "configure"
10075 #include "confdefs.h"
10076 /* System header to define __stub macros and hopefully few prototypes,
10077     which can conflict with char $ac_func(); below.  */
10078 #include <assert.h>
10079 /* Override any gcc2 internal prototype to avoid an error.  */
10080 /* We use char because int might match the return type of a gcc2
10081     builtin and then its argument prototype would still apply.  */
10082 char $ac_func();
10083 char (*f)();
10084
10085 int main() {
10086
10087 /* The GNU C library defines this for functions which it implements
10088     to always fail with ENOSYS.  Some functions are actually named
10089     something starting with __ and the normal name is an alias.  */
10090 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10091 choke me
10092 #else
10093 f = $ac_func;
10094 #endif
10095
10096 ; return 0; }
10097 EOF
10098 if { (eval echo configure:10099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10099   rm -rf conftest*
10100   eval "ac_cv_func_$ac_func=yes"
10101 else
10102   echo "configure: failed program was:" >&5
10103   cat conftest.$ac_ext >&5
10104   rm -rf conftest*
10105   eval "ac_cv_func_$ac_func=no"
10106 fi
10107 rm -f conftest*
10108 fi
10109
10110 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10111   echo "$ac_t""yes" 1>&6
10112     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10113   cat >> confdefs.h <<EOF
10114 #define $ac_tr_func 1
10115 EOF
10116  
10117 else
10118   echo "$ac_t""no" 1>&6
10119 fi
10120 done
10121
10122
10123                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
10124 echo "configure:10125: checking for pthread_detach with <pthread.h>" >&5
10125 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
10126   echo $ac_n "(cached) $ac_c" 1>&6
10127 else
10128   
10129                                                                 cat > conftest.$ac_ext <<EOF
10130 #line 10131 "configure"
10131 #include "confdefs.h"
10132
10133 #include <pthread.h>
10134 #ifndef NULL
10135 #define NULL (void*)0
10136 #endif
10137
10138 int main() {
10139 pthread_detach(NULL);
10140 ; return 0; }
10141 EOF
10142 if { (eval echo configure:10143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10143   rm -rf conftest*
10144   ol_cv_func_pthread_detach=yes
10145 else
10146   echo "configure: failed program was:" >&5
10147   cat conftest.$ac_ext >&5
10148   rm -rf conftest*
10149   ol_cv_func_pthread_detach=no
10150 fi
10151 rm -f conftest*
10152                         
10153 fi
10154
10155 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
10156
10157                         if test $ol_cv_func_pthread_detach = no ; then
10158                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
10159                         fi
10160
10161                         cat >> confdefs.h <<\EOF
10162 #define HAVE_PTHREAD_DETACH 1
10163 EOF
10164
10165
10166                                                 for ac_func in \
10167                                 pthread_setconcurrency \
10168                                 pthread_getconcurrency \
10169                                 thr_setconcurrency \
10170                                 thr_getconcurrency \
10171                         
10172 do
10173 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10174 echo "configure:10175: checking for $ac_func" >&5
10175 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10176   echo $ac_n "(cached) $ac_c" 1>&6
10177 else
10178   cat > conftest.$ac_ext <<EOF
10179 #line 10180 "configure"
10180 #include "confdefs.h"
10181 /* System header to define __stub macros and hopefully few prototypes,
10182     which can conflict with char $ac_func(); below.  */
10183 #include <assert.h>
10184 /* Override any gcc2 internal prototype to avoid an error.  */
10185 /* We use char because int might match the return type of a gcc2
10186     builtin and then its argument prototype would still apply.  */
10187 char $ac_func();
10188 char (*f)();
10189
10190 int main() {
10191
10192 /* The GNU C library defines this for functions which it implements
10193     to always fail with ENOSYS.  Some functions are actually named
10194     something starting with __ and the normal name is an alias.  */
10195 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10196 choke me
10197 #else
10198 f = $ac_func;
10199 #endif
10200
10201 ; return 0; }
10202 EOF
10203 if { (eval echo configure:10204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10204   rm -rf conftest*
10205   eval "ac_cv_func_$ac_func=yes"
10206 else
10207   echo "configure: failed program was:" >&5
10208   cat conftest.$ac_ext >&5
10209   rm -rf conftest*
10210   eval "ac_cv_func_$ac_func=no"
10211 fi
10212 rm -f conftest*
10213 fi
10214
10215 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10216   echo "$ac_t""yes" 1>&6
10217     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10218   cat >> confdefs.h <<EOF
10219 #define $ac_tr_func 1
10220 EOF
10221  
10222 else
10223   echo "$ac_t""no" 1>&6
10224 fi
10225 done
10226
10227
10228                         
10229         for ac_func in pthread_kill_other_threads_np
10230 do
10231 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10232 echo "configure:10233: checking for $ac_func" >&5
10233 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10234   echo $ac_n "(cached) $ac_c" 1>&6
10235 else
10236   cat > conftest.$ac_ext <<EOF
10237 #line 10238 "configure"
10238 #include "confdefs.h"
10239 /* System header to define __stub macros and hopefully few prototypes,
10240     which can conflict with char $ac_func(); below.  */
10241 #include <assert.h>
10242 /* Override any gcc2 internal prototype to avoid an error.  */
10243 /* We use char because int might match the return type of a gcc2
10244     builtin and then its argument prototype would still apply.  */
10245 char $ac_func();
10246 char (*f)();
10247
10248 int main() {
10249
10250 /* The GNU C library defines this for functions which it implements
10251     to always fail with ENOSYS.  Some functions are actually named
10252     something starting with __ and the normal name is an alias.  */
10253 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10254 choke me
10255 #else
10256 f = $ac_func;
10257 #endif
10258
10259 ; return 0; }
10260 EOF
10261 if { (eval echo configure:10262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10262   rm -rf conftest*
10263   eval "ac_cv_func_$ac_func=yes"
10264 else
10265   echo "configure: failed program was:" >&5
10266   cat conftest.$ac_ext >&5
10267   rm -rf conftest*
10268   eval "ac_cv_func_$ac_func=no"
10269 fi
10270 rm -f conftest*
10271 fi
10272
10273 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10274   echo "$ac_t""yes" 1>&6
10275     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10276   cat >> confdefs.h <<EOF
10277 #define $ac_tr_func 1
10278 EOF
10279  
10280 else
10281   echo "$ac_t""no" 1>&6
10282 fi
10283 done
10284
10285         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10286 echo "configure:10287: checking for LinuxThreads implementation" >&5
10287 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10288   echo $ac_n "(cached) $ac_c" 1>&6
10289 else
10290   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10291 fi
10292
10293 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10294
10295                         
10296         
10297         
10298         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10299 echo "configure:10300: checking for LinuxThreads consistency" >&5
10300 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10301   echo $ac_n "(cached) $ac_c" 1>&6
10302 else
10303   
10304                 if test $ol_cv_header_linux_threads = yes -a \
10305                         $ol_cv_sys_linux_threads = yes; then
10306                         ol_cv_linux_threads=yes
10307                 elif test $ol_cv_header_linux_threads = no -a \
10308                         $ol_cv_sys_linux_threads = no; then
10309                         ol_cv_linux_threads=no
10310                 else
10311                         ol_cv_linux_threads=error
10312                 fi
10313         
10314 fi
10315
10316 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10317
10318
10319                         if test $ol_cv_linux_threads = error; then
10320                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10321                         fi
10322
10323                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10324 echo "configure:10325: checking if pthread_create() works" >&5
10325 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10326   echo $ac_n "(cached) $ac_c" 1>&6
10327 else
10328   
10329                         if test "$cross_compiling" = yes; then
10330                                 ol_cv_pthread_create_works=yes
10331 else
10332   cat > conftest.$ac_ext <<EOF
10333 #line 10334 "configure"
10334 #include "confdefs.h"
10335 /* pthread test headers */
10336 #include <pthread.h>
10337 #ifndef NULL
10338 #define NULL (void*)0
10339 #endif
10340
10341 static void *task(p)
10342         void *p;
10343 {
10344         return (void *) (p == NULL);
10345 }
10346
10347
10348 int main(argc, argv)
10349         int argc;
10350         char **argv;
10351 {
10352
10353         /* pthread test function */
10354         pthread_t t;
10355         int status;
10356 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10357         /* This system (e.g. AIX) defaults detached; must override */
10358         pthread_attr_t attr;
10359
10360         status = pthread_attr_init(&attr);
10361         if( status ) exit( status );
10362
10363         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10364         if( status ) exit( status );
10365
10366 #       define  ATTR    &attr
10367 #elif defined( HAVE_PTHREADS_D4 )
10368 #       define  ATTR    pthread_attr_default
10369 #else
10370 #       define  ATTR    NULL
10371 #endif
10372
10373         /* make sure pthread_create() isn't just a stub */
10374         status = pthread_create(&t, ATTR, task, NULL);
10375         if( status ) exit( status );
10376
10377         /* give the thread a chance to complete...
10378      * it should remain joinable and hence detachable
10379          */
10380         sleep( 1 );
10381
10382         /* make sure pthread_detach() isn't just a stub */
10383 #if HAVE_PTHREADS_D4
10384         status = pthread_detach( &t );
10385 #else
10386         status = pthread_detach( t );
10387 #endif
10388
10389 #ifdef HAVE_LINUX_THREADS
10390         pthread_kill_other_threads_np();
10391 #endif
10392
10393         exit( status );
10394
10395 }
10396
10397 EOF
10398 if { (eval echo configure:10399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10399 then
10400   ol_cv_pthread_create_works=yes
10401 else
10402   echo "configure: failed program was:" >&5
10403   cat conftest.$ac_ext >&5
10404   rm -fr conftest*
10405   ol_cv_pthread_create_works=no
10406 fi
10407 rm -fr conftest*
10408 fi
10409
10410 fi
10411
10412 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10413
10414                         if test $ol_cv_pthread_create_works = no ; then
10415                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10416                         fi
10417
10418                                                 if test $ol_with_yielding_select = auto ; then
10419                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10420 echo "configure:10421: checking if select yields when using pthreads" >&5
10421 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10422   echo $ac_n "(cached) $ac_c" 1>&6
10423 else
10424   
10425                                 if test "$cross_compiling" = yes; then
10426   ol_cv_pthread_select_yields=cross
10427 else
10428   cat > conftest.$ac_ext <<EOF
10429 #line 10430 "configure"
10430 #include "confdefs.h"
10431
10432 #include <sys/types.h>
10433 #include <sys/time.h>
10434 #include <unistd.h>
10435 #include <pthread.h>
10436 #ifndef NULL
10437 #define NULL (void*) 0
10438 #endif
10439
10440 static int fildes[2];
10441
10442 static void *task(p)
10443         void *p;
10444 {
10445         int i;
10446         struct timeval tv;
10447
10448         fd_set rfds;
10449
10450         tv.tv_sec=10;
10451         tv.tv_usec=0;
10452
10453         FD_ZERO(&rfds);
10454         FD_SET(fildes[0], &rfds);
10455
10456         /* we're not interested in any fds */
10457         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10458
10459         if(i < 0) {
10460                 perror("select");
10461                 exit(10);
10462         }
10463
10464         exit(0); /* if we exit here, the select blocked the whole process */
10465 }
10466
10467 int main(argc, argv)
10468         int argc;
10469         char **argv;
10470 {
10471         pthread_t t;
10472
10473         /* create a pipe to select */
10474         if(pipe(&fildes[0])) {
10475                 perror("select");
10476                 exit(1);
10477         }
10478
10479 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10480         (void) pthread_setconcurrency(2);
10481 #else
10482 #ifdef HAVE_THR_SETCONCURRENCY
10483         /* Set Solaris LWP concurrency to 2 */
10484         thr_setconcurrency(2);
10485 #endif
10486 #endif
10487
10488 #if HAVE_PTHREADS_D4
10489         pthread_create(&t, pthread_attr_default, task, NULL);
10490 #else
10491         pthread_create(&t, NULL, task, NULL);
10492 #endif
10493
10494 #if HAVE_SCHED_YIELD
10495         sched_yield();  /* make sure task runs first */
10496 #else
10497 #ifdef HAVE_PTHREAD_YIELD
10498         pthread_yield();        /* make sure task runs first */
10499 #endif
10500 #endif
10501
10502         exit(2);
10503 }
10504 EOF
10505 if { (eval echo configure:10506: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10506 then
10507   ol_cv_pthread_select_yields=no
10508 else
10509   echo "configure: failed program was:" >&5
10510   cat conftest.$ac_ext >&5
10511   rm -fr conftest*
10512   ol_cv_pthread_select_yields=yes
10513 fi
10514 rm -fr conftest*
10515 fi
10516
10517 fi
10518
10519 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
10520
10521                                 if test $ol_cv_pthread_select_yields = cross ; then
10522                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
10523                                 fi
10524
10525                                 if test $ol_cv_pthread_select_yields = yes ; then
10526                                         ol_with_yielding_select=yes
10527                                 fi
10528                         fi
10529
10530                                                 CPPFLAGS="$save_CPPFLAGS"
10531                         LIBS="$save_LIBS"
10532                 else
10533                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
10534                 fi
10535         fi
10536
10537         if test $ol_with_threads = posix ; then
10538                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
10539         fi
10540 fi
10541
10542 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10543         -o $ol_with_threads = mach ; then
10544
10545                 for ac_hdr in mach/cthreads.h
10546 do
10547 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10548 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10549 echo "configure:10550: checking for $ac_hdr" >&5
10550 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10551   echo $ac_n "(cached) $ac_c" 1>&6
10552 else
10553   cat > conftest.$ac_ext <<EOF
10554 #line 10555 "configure"
10555 #include "confdefs.h"
10556 #include <$ac_hdr>
10557 EOF
10558 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10559 { (eval echo configure:10560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10560 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10561 if test -z "$ac_err"; then
10562   rm -rf conftest*
10563   eval "ac_cv_header_$ac_safe=yes"
10564 else
10565   echo "$ac_err" >&5
10566   echo "configure: failed program was:" >&5
10567   cat conftest.$ac_ext >&5
10568   rm -rf conftest*
10569   eval "ac_cv_header_$ac_safe=no"
10570 fi
10571 rm -f conftest*
10572 fi
10573 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10574   echo "$ac_t""yes" 1>&6
10575     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10576   cat >> confdefs.h <<EOF
10577 #define $ac_tr_hdr 1
10578 EOF
10579  
10580 else
10581   echo "$ac_t""no" 1>&6
10582 fi
10583 done
10584
10585         if test $ac_cv_header_mach_cthreads_h = yes ; then
10586                 ol_with_threads=found
10587
10588                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
10589 echo "configure:10590: checking for cthread_fork" >&5
10590 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
10591   echo $ac_n "(cached) $ac_c" 1>&6
10592 else
10593   cat > conftest.$ac_ext <<EOF
10594 #line 10595 "configure"
10595 #include "confdefs.h"
10596 /* System header to define __stub macros and hopefully few prototypes,
10597     which can conflict with char cthread_fork(); below.  */
10598 #include <assert.h>
10599 /* Override any gcc2 internal prototype to avoid an error.  */
10600 /* We use char because int might match the return type of a gcc2
10601     builtin and then its argument prototype would still apply.  */
10602 char cthread_fork();
10603 char (*f)();
10604
10605 int main() {
10606
10607 /* The GNU C library defines this for functions which it implements
10608     to always fail with ENOSYS.  Some functions are actually named
10609     something starting with __ and the normal name is an alias.  */
10610 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
10611 choke me
10612 #else
10613 f = cthread_fork;
10614 #endif
10615
10616 ; return 0; }
10617 EOF
10618 if { (eval echo configure:10619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10619   rm -rf conftest*
10620   eval "ac_cv_func_cthread_fork=yes"
10621 else
10622   echo "configure: failed program was:" >&5
10623   cat conftest.$ac_ext >&5
10624   rm -rf conftest*
10625   eval "ac_cv_func_cthread_fork=no"
10626 fi
10627 rm -f conftest*
10628 fi
10629
10630 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
10631   echo "$ac_t""yes" 1>&6
10632   ol_link_threads=yes
10633 else
10634   echo "$ac_t""no" 1>&6
10635 fi
10636
10637
10638                 if test $ol_link_threads = no ; then
10639                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
10640 echo "configure:10641: checking for cthread_fork with -all_load" >&5
10641 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
10642   echo $ac_n "(cached) $ac_c" 1>&6
10643 else
10644   
10645                                                                 save_LIBS="$LIBS"
10646                                 LIBS="-all_load $LIBS"
10647                                 cat > conftest.$ac_ext <<EOF
10648 #line 10649 "configure"
10649 #include "confdefs.h"
10650 #include <mach/cthreads.h>
10651 int main() {
10652
10653                                         cthread_fork((void *)0, (void *)0);
10654                                         
10655 ; return 0; }
10656 EOF
10657 if { (eval echo configure:10658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10658   rm -rf conftest*
10659   ol_cv_cthread_all_load=yes
10660 else
10661   echo "configure: failed program was:" >&5
10662   cat conftest.$ac_ext >&5
10663   rm -rf conftest*
10664   ol_cv_cthread_all_load=no
10665 fi
10666 rm -f conftest*
10667                                                                 LIBS="$save_LIBS"
10668                         
10669 fi
10670
10671 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
10672
10673                         if test $ol_cv_cthread_all_load = yes ; then
10674                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
10675                                 ol_link_threads=mach
10676                         fi
10677                 fi
10678
10679                 if test $ol_link_threads != no ; then
10680                         : check for cthread specific functionality here
10681                         cat >> confdefs.h <<\EOF
10682 #define HAVE_MACH_CTHREADS 1
10683 EOF
10684
10685                 else
10686                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
10687                 fi
10688         fi
10689
10690         if test $ol_with_threads = mach ; then
10691                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
10692         fi
10693 fi
10694
10695 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10696         -o $ol_with_threads = pth ; then
10697
10698         for ac_hdr in pth.h
10699 do
10700 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10701 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10702 echo "configure:10703: checking for $ac_hdr" >&5
10703 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10704   echo $ac_n "(cached) $ac_c" 1>&6
10705 else
10706   cat > conftest.$ac_ext <<EOF
10707 #line 10708 "configure"
10708 #include "confdefs.h"
10709 #include <$ac_hdr>
10710 EOF
10711 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10712 { (eval echo configure:10713: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10713 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10714 if test -z "$ac_err"; then
10715   rm -rf conftest*
10716   eval "ac_cv_header_$ac_safe=yes"
10717 else
10718   echo "$ac_err" >&5
10719   echo "configure: failed program was:" >&5
10720   cat conftest.$ac_ext >&5
10721   rm -rf conftest*
10722   eval "ac_cv_header_$ac_safe=no"
10723 fi
10724 rm -f conftest*
10725 fi
10726 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10727   echo "$ac_t""yes" 1>&6
10728     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10729   cat >> confdefs.h <<EOF
10730 #define $ac_tr_hdr 1
10731 EOF
10732  
10733 else
10734   echo "$ac_t""no" 1>&6
10735 fi
10736 done
10737
10738
10739         if test $ac_cv_header_pth_h = yes ; then
10740                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
10741 echo "configure:10742: checking for pth_version in -lpth" >&5
10742 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
10743 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10744   echo $ac_n "(cached) $ac_c" 1>&6
10745 else
10746   ac_save_LIBS="$LIBS"
10747 LIBS="-lpth  $LIBS"
10748 cat > conftest.$ac_ext <<EOF
10749 #line 10750 "configure"
10750 #include "confdefs.h"
10751 /* Override any gcc2 internal prototype to avoid an error.  */
10752 /* We use char because int might match the return type of a gcc2
10753     builtin and then its argument prototype would still apply.  */
10754 char pth_version();
10755
10756 int main() {
10757 pth_version()
10758 ; return 0; }
10759 EOF
10760 if { (eval echo configure:10761: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10761   rm -rf conftest*
10762   eval "ac_cv_lib_$ac_lib_var=yes"
10763 else
10764   echo "configure: failed program was:" >&5
10765   cat conftest.$ac_ext >&5
10766   rm -rf conftest*
10767   eval "ac_cv_lib_$ac_lib_var=no"
10768 fi
10769 rm -f conftest*
10770 LIBS="$ac_save_LIBS"
10771
10772 fi
10773 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10774   echo "$ac_t""yes" 1>&6
10775   have_pth=yes
10776 else
10777   echo "$ac_t""no" 1>&6
10778 have_pth=no
10779 fi
10780
10781
10782                 if test $have_pth = yes ; then
10783                         cat >> confdefs.h <<\EOF
10784 #define HAVE_GNU_PTH 1
10785 EOF
10786
10787                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
10788                         ol_link_threads=pth
10789
10790                         if test $ol_with_yielding_select = auto ; then
10791                                 ol_with_yielding_select=yes
10792                         fi
10793                 fi
10794         fi
10795 fi
10796
10797 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10798         -o $ol_with_threads = lwp ; then
10799
10800                 for ac_hdr in thread.h synch.h
10801 do
10802 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10803 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10804 echo "configure:10805: checking for $ac_hdr" >&5
10805 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10806   echo $ac_n "(cached) $ac_c" 1>&6
10807 else
10808   cat > conftest.$ac_ext <<EOF
10809 #line 10810 "configure"
10810 #include "confdefs.h"
10811 #include <$ac_hdr>
10812 EOF
10813 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10814 { (eval echo configure:10815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10815 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10816 if test -z "$ac_err"; then
10817   rm -rf conftest*
10818   eval "ac_cv_header_$ac_safe=yes"
10819 else
10820   echo "$ac_err" >&5
10821   echo "configure: failed program was:" >&5
10822   cat conftest.$ac_ext >&5
10823   rm -rf conftest*
10824   eval "ac_cv_header_$ac_safe=no"
10825 fi
10826 rm -f conftest*
10827 fi
10828 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10829   echo "$ac_t""yes" 1>&6
10830     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10831   cat >> confdefs.h <<EOF
10832 #define $ac_tr_hdr 1
10833 EOF
10834  
10835 else
10836   echo "$ac_t""no" 1>&6
10837 fi
10838 done
10839
10840         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
10841                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
10842 echo "configure:10843: checking for thr_create in -lthread" >&5
10843 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
10844 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10845   echo $ac_n "(cached) $ac_c" 1>&6
10846 else
10847   ac_save_LIBS="$LIBS"
10848 LIBS="-lthread  $LIBS"
10849 cat > conftest.$ac_ext <<EOF
10850 #line 10851 "configure"
10851 #include "confdefs.h"
10852 /* Override any gcc2 internal prototype to avoid an error.  */
10853 /* We use char because int might match the return type of a gcc2
10854     builtin and then its argument prototype would still apply.  */
10855 char thr_create();
10856
10857 int main() {
10858 thr_create()
10859 ; return 0; }
10860 EOF
10861 if { (eval echo configure:10862: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10862   rm -rf conftest*
10863   eval "ac_cv_lib_$ac_lib_var=yes"
10864 else
10865   echo "configure: failed program was:" >&5
10866   cat conftest.$ac_ext >&5
10867   rm -rf conftest*
10868   eval "ac_cv_lib_$ac_lib_var=no"
10869 fi
10870 rm -f conftest*
10871 LIBS="$ac_save_LIBS"
10872
10873 fi
10874 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10875   echo "$ac_t""yes" 1>&6
10876   have_thr=yes
10877 else
10878   echo "$ac_t""no" 1>&6
10879 have_thr=no
10880 fi
10881
10882
10883                 if test $have_thr = yes ; then
10884                         cat >> confdefs.h <<\EOF
10885 #define HAVE_THR 1
10886 EOF
10887
10888                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
10889                         ol_link_threads=thr
10890
10891                         if test $ol_with_yielding_select = auto ; then
10892                                 ol_with_yielding_select=yes
10893                         fi
10894
10895                                                 for ac_func in \
10896                                 thr_setconcurrency \
10897                                 thr_getconcurrency \
10898                         
10899 do
10900 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10901 echo "configure:10902: checking for $ac_func" >&5
10902 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10903   echo $ac_n "(cached) $ac_c" 1>&6
10904 else
10905   cat > conftest.$ac_ext <<EOF
10906 #line 10907 "configure"
10907 #include "confdefs.h"
10908 /* System header to define __stub macros and hopefully few prototypes,
10909     which can conflict with char $ac_func(); below.  */
10910 #include <assert.h>
10911 /* Override any gcc2 internal prototype to avoid an error.  */
10912 /* We use char because int might match the return type of a gcc2
10913     builtin and then its argument prototype would still apply.  */
10914 char $ac_func();
10915 char (*f)();
10916
10917 int main() {
10918
10919 /* The GNU C library defines this for functions which it implements
10920     to always fail with ENOSYS.  Some functions are actually named
10921     something starting with __ and the normal name is an alias.  */
10922 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10923 choke me
10924 #else
10925 f = $ac_func;
10926 #endif
10927
10928 ; return 0; }
10929 EOF
10930 if { (eval echo configure:10931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10931   rm -rf conftest*
10932   eval "ac_cv_func_$ac_func=yes"
10933 else
10934   echo "configure: failed program was:" >&5
10935   cat conftest.$ac_ext >&5
10936   rm -rf conftest*
10937   eval "ac_cv_func_$ac_func=no"
10938 fi
10939 rm -f conftest*
10940 fi
10941
10942 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10943   echo "$ac_t""yes" 1>&6
10944     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10945   cat >> confdefs.h <<EOF
10946 #define $ac_tr_func 1
10947 EOF
10948  
10949 else
10950   echo "$ac_t""no" 1>&6
10951 fi
10952 done
10953
10954                 fi
10955         fi
10956
10957                 for ac_hdr in lwp/lwp.h
10958 do
10959 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10960 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10961 echo "configure:10962: checking for $ac_hdr" >&5
10962 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10963   echo $ac_n "(cached) $ac_c" 1>&6
10964 else
10965   cat > conftest.$ac_ext <<EOF
10966 #line 10967 "configure"
10967 #include "confdefs.h"
10968 #include <$ac_hdr>
10969 EOF
10970 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10971 { (eval echo configure:10972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10972 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10973 if test -z "$ac_err"; then
10974   rm -rf conftest*
10975   eval "ac_cv_header_$ac_safe=yes"
10976 else
10977   echo "$ac_err" >&5
10978   echo "configure: failed program was:" >&5
10979   cat conftest.$ac_ext >&5
10980   rm -rf conftest*
10981   eval "ac_cv_header_$ac_safe=no"
10982 fi
10983 rm -f conftest*
10984 fi
10985 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10986   echo "$ac_t""yes" 1>&6
10987     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10988   cat >> confdefs.h <<EOF
10989 #define $ac_tr_hdr 1
10990 EOF
10991  
10992 else
10993   echo "$ac_t""no" 1>&6
10994 fi
10995 done
10996
10997         if test $ac_cv_header_lwp_lwp_h = yes ; then
10998                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
10999 echo "configure:11000: checking for lwp_create in -llwp" >&5
11000 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
11001 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
11002   echo $ac_n "(cached) $ac_c" 1>&6
11003 else
11004   ac_save_LIBS="$LIBS"
11005 LIBS="-llwp  $LIBS"
11006 cat > conftest.$ac_ext <<EOF
11007 #line 11008 "configure"
11008 #include "confdefs.h"
11009 /* Override any gcc2 internal prototype to avoid an error.  */
11010 /* We use char because int might match the return type of a gcc2
11011     builtin and then its argument prototype would still apply.  */
11012 char lwp_create();
11013
11014 int main() {
11015 lwp_create()
11016 ; return 0; }
11017 EOF
11018 if { (eval echo configure:11019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11019   rm -rf conftest*
11020   eval "ac_cv_lib_$ac_lib_var=yes"
11021 else
11022   echo "configure: failed program was:" >&5
11023   cat conftest.$ac_ext >&5
11024   rm -rf conftest*
11025   eval "ac_cv_lib_$ac_lib_var=no"
11026 fi
11027 rm -f conftest*
11028 LIBS="$ac_save_LIBS"
11029
11030 fi
11031 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11032   echo "$ac_t""yes" 1>&6
11033   have_lwp=yes
11034 else
11035   echo "$ac_t""no" 1>&6
11036 have_lwp=no
11037 fi
11038
11039
11040                 if test $have_lwp = yes ; then
11041                         cat >> confdefs.h <<\EOF
11042 #define HAVE_LWP 1
11043 EOF
11044
11045                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
11046                         ol_link_threads=lwp
11047
11048                         if test $ol_with_yielding_select = auto ; then
11049                                 ol_with_yielding_select=no
11050                         fi
11051                 fi
11052         fi
11053 fi
11054
11055 if test $ol_with_yielding_select = yes ; then
11056         cat >> confdefs.h <<\EOF
11057 #define HAVE_YIELDING_SELECT 1
11058 EOF
11059
11060 fi
11061
11062 if test $ol_with_threads = manual ; then
11063                 ol_link_threads=yes
11064
11065         echo "configure: warning: thread defines and link options must be set manually" 1>&2
11066
11067         for ac_hdr in pthread.h sched.h
11068 do
11069 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11070 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11071 echo "configure:11072: checking for $ac_hdr" >&5
11072 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11073   echo $ac_n "(cached) $ac_c" 1>&6
11074 else
11075   cat > conftest.$ac_ext <<EOF
11076 #line 11077 "configure"
11077 #include "confdefs.h"
11078 #include <$ac_hdr>
11079 EOF
11080 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11081 { (eval echo configure:11082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11082 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11083 if test -z "$ac_err"; then
11084   rm -rf conftest*
11085   eval "ac_cv_header_$ac_safe=yes"
11086 else
11087   echo "$ac_err" >&5
11088   echo "configure: failed program was:" >&5
11089   cat conftest.$ac_ext >&5
11090   rm -rf conftest*
11091   eval "ac_cv_header_$ac_safe=no"
11092 fi
11093 rm -f conftest*
11094 fi
11095 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11096   echo "$ac_t""yes" 1>&6
11097     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11098   cat >> confdefs.h <<EOF
11099 #define $ac_tr_hdr 1
11100 EOF
11101  
11102 else
11103   echo "$ac_t""no" 1>&6
11104 fi
11105 done
11106
11107         for ac_func in sched_yield pthread_yield
11108 do
11109 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11110 echo "configure:11111: checking for $ac_func" >&5
11111 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
11112   echo $ac_n "(cached) $ac_c" 1>&6
11113 else
11114   cat > conftest.$ac_ext <<EOF
11115 #line 11116 "configure"
11116 #include "confdefs.h"
11117 /* System header to define __stub macros and hopefully few prototypes,
11118     which can conflict with char $ac_func(); below.  */
11119 #include <assert.h>
11120 /* Override any gcc2 internal prototype to avoid an error.  */
11121 /* We use char because int might match the return type of a gcc2
11122     builtin and then its argument prototype would still apply.  */
11123 char $ac_func();
11124 char (*f)();
11125
11126 int main() {
11127
11128 /* The GNU C library defines this for functions which it implements
11129     to always fail with ENOSYS.  Some functions are actually named
11130     something starting with __ and the normal name is an alias.  */
11131 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11132 choke me
11133 #else
11134 f = $ac_func;
11135 #endif
11136
11137 ; return 0; }
11138 EOF
11139 if { (eval echo configure:11140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11140   rm -rf conftest*
11141   eval "ac_cv_func_$ac_func=yes"
11142 else
11143   echo "configure: failed program was:" >&5
11144   cat conftest.$ac_ext >&5
11145   rm -rf conftest*
11146   eval "ac_cv_func_$ac_func=no"
11147 fi
11148 rm -f conftest*
11149 fi
11150
11151 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11152   echo "$ac_t""yes" 1>&6
11153     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11154   cat >> confdefs.h <<EOF
11155 #define $ac_tr_func 1
11156 EOF
11157  
11158 else
11159   echo "$ac_t""no" 1>&6
11160 fi
11161 done
11162
11163         
11164         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11165 echo "configure:11166: checking for LinuxThreads pthread.h" >&5
11166 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11167   echo $ac_n "(cached) $ac_c" 1>&6
11168 else
11169   cat > conftest.$ac_ext <<EOF
11170 #line 11171 "configure"
11171 #include "confdefs.h"
11172 #include <pthread.h>
11173 EOF
11174 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11175   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11176   rm -rf conftest*
11177   ol_cv_header_linux_threads=yes
11178 else
11179   rm -rf conftest*
11180   ol_cv_header_linux_threads=no
11181 fi
11182 rm -f conftest*
11183
11184                 
11185 fi
11186
11187 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11188         if test $ol_cv_header_linux_threads = yes; then
11189                 cat >> confdefs.h <<\EOF
11190 #define HAVE_LINUX_THREADS 1
11191 EOF
11192
11193         fi
11194
11195
11196         for ac_hdr in mach/cthreads.h
11197 do
11198 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11199 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11200 echo "configure:11201: checking for $ac_hdr" >&5
11201 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11202   echo $ac_n "(cached) $ac_c" 1>&6
11203 else
11204   cat > conftest.$ac_ext <<EOF
11205 #line 11206 "configure"
11206 #include "confdefs.h"
11207 #include <$ac_hdr>
11208 EOF
11209 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11210 { (eval echo configure:11211: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11211 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11212 if test -z "$ac_err"; then
11213   rm -rf conftest*
11214   eval "ac_cv_header_$ac_safe=yes"
11215 else
11216   echo "$ac_err" >&5
11217   echo "configure: failed program was:" >&5
11218   cat conftest.$ac_ext >&5
11219   rm -rf conftest*
11220   eval "ac_cv_header_$ac_safe=no"
11221 fi
11222 rm -f conftest*
11223 fi
11224 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11225   echo "$ac_t""yes" 1>&6
11226     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11227   cat >> confdefs.h <<EOF
11228 #define $ac_tr_hdr 1
11229 EOF
11230  
11231 else
11232   echo "$ac_t""no" 1>&6
11233 fi
11234 done
11235
11236         for ac_hdr in lwp/lwp.h
11237 do
11238 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11239 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11240 echo "configure:11241: checking for $ac_hdr" >&5
11241 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11242   echo $ac_n "(cached) $ac_c" 1>&6
11243 else
11244   cat > conftest.$ac_ext <<EOF
11245 #line 11246 "configure"
11246 #include "confdefs.h"
11247 #include <$ac_hdr>
11248 EOF
11249 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11250 { (eval echo configure:11251: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11251 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11252 if test -z "$ac_err"; then
11253   rm -rf conftest*
11254   eval "ac_cv_header_$ac_safe=yes"
11255 else
11256   echo "$ac_err" >&5
11257   echo "configure: failed program was:" >&5
11258   cat conftest.$ac_ext >&5
11259   rm -rf conftest*
11260   eval "ac_cv_header_$ac_safe=no"
11261 fi
11262 rm -f conftest*
11263 fi
11264 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11265   echo "$ac_t""yes" 1>&6
11266     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11267   cat >> confdefs.h <<EOF
11268 #define $ac_tr_hdr 1
11269 EOF
11270  
11271 else
11272   echo "$ac_t""no" 1>&6
11273 fi
11274 done
11275
11276         for ac_hdr in thread.h synch.h
11277 do
11278 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11279 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11280 echo "configure:11281: checking for $ac_hdr" >&5
11281 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11282   echo $ac_n "(cached) $ac_c" 1>&6
11283 else
11284   cat > conftest.$ac_ext <<EOF
11285 #line 11286 "configure"
11286 #include "confdefs.h"
11287 #include <$ac_hdr>
11288 EOF
11289 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11290 { (eval echo configure:11291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11291 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11292 if test -z "$ac_err"; then
11293   rm -rf conftest*
11294   eval "ac_cv_header_$ac_safe=yes"
11295 else
11296   echo "$ac_err" >&5
11297   echo "configure: failed program was:" >&5
11298   cat conftest.$ac_ext >&5
11299   rm -rf conftest*
11300   eval "ac_cv_header_$ac_safe=no"
11301 fi
11302 rm -f conftest*
11303 fi
11304 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11305   echo "$ac_t""yes" 1>&6
11306     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11307   cat >> confdefs.h <<EOF
11308 #define $ac_tr_hdr 1
11309 EOF
11310  
11311 else
11312   echo "$ac_t""no" 1>&6
11313 fi
11314 done
11315
11316 fi
11317
11318 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11319                         cat >> confdefs.h <<\EOF
11320 #define REENTRANT 1
11321 EOF
11322
11323         cat >> confdefs.h <<\EOF
11324 #define _REENTRANT 1
11325 EOF
11326
11327         cat >> confdefs.h <<\EOF
11328 #define THREAD_SAFE 1
11329 EOF
11330
11331         cat >> confdefs.h <<\EOF
11332 #define _THREAD_SAFE 1
11333 EOF
11334
11335         cat >> confdefs.h <<\EOF
11336 #define THREADSAFE 1
11337 EOF
11338
11339         cat >> confdefs.h <<\EOF
11340 #define _THREADSAFE 1
11341 EOF
11342
11343         cat >> confdefs.h <<\EOF
11344 #define _SGI_MP_SOURCE 1
11345 EOF
11346
11347
11348                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11349 echo "configure:11350: checking for thread specific errno" >&5
11350 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11351   echo $ac_n "(cached) $ac_c" 1>&6
11352 else
11353   
11354                 cat > conftest.$ac_ext <<EOF
11355 #line 11356 "configure"
11356 #include "confdefs.h"
11357 #include <errno.h>
11358 int main() {
11359 errno = 0;
11360 ; return 0; }
11361 EOF
11362 if { (eval echo configure:11363: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11363   rm -rf conftest*
11364   ol_cv_errno_thread_specific=yes
11365 else
11366   echo "configure: failed program was:" >&5
11367   cat conftest.$ac_ext >&5
11368   rm -rf conftest*
11369   ol_cv_errno_thread_specific=no
11370 fi
11371 rm -f conftest*
11372         
11373 fi
11374
11375 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11376
11377                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11378 echo "configure:11379: checking for thread specific h_errno" >&5
11379 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11380   echo $ac_n "(cached) $ac_c" 1>&6
11381 else
11382   
11383                 cat > conftest.$ac_ext <<EOF
11384 #line 11385 "configure"
11385 #include "confdefs.h"
11386 #include <netdb.h>
11387 int main() {
11388 h_errno = 0;
11389 ; return 0; }
11390 EOF
11391 if { (eval echo configure:11392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11392   rm -rf conftest*
11393   ol_cv_h_errno_thread_specific=yes
11394 else
11395   echo "configure: failed program was:" >&5
11396   cat conftest.$ac_ext >&5
11397   rm -rf conftest*
11398   ol_cv_h_errno_thread_specific=no
11399 fi
11400 rm -f conftest*
11401         
11402 fi
11403
11404 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11405
11406         if test $ol_cv_errno_thread_specific != yes \
11407                 -o $ol_cv_h_errno_thread_specific != yes ; then
11408                 LIBS="$LTHREAD_LIBS $LIBS"
11409                 LTHREAD_LIBS=""
11410         fi
11411
11412 fi  
11413
11414 if test $ol_link_threads = no ; then
11415         if test $ol_with_threads = yes ; then
11416                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11417         fi
11418
11419         if test $ol_with_threads = auto ; then
11420                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11421                 ol_with_threads=no
11422         fi
11423
11424         cat >> confdefs.h <<\EOF
11425 #define NO_THREADS 1
11426 EOF
11427
11428         LTHREAD_LIBS=""
11429 fi
11430
11431 if test $ol_link_threads != no ; then
11432         cat >> confdefs.h <<\EOF
11433 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11434 EOF
11435
11436 fi
11437
11438 ol_link_ldbm=no 
11439
11440 if test $ol_with_ldbm_api = auto \
11441         -o $ol_with_ldbm_api = berkeley \
11442         -o $ol_with_ldbm_api = bcompat ; then
11443
11444         if test $ol_with_ldbm_api = bcompat; then \
11445                 ol_cv_berkeley_db=no
11446 for ac_hdr in db_185.h db.h
11447 do
11448 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11449 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11450 echo "configure:11451: checking for $ac_hdr" >&5
11451 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11452   echo $ac_n "(cached) $ac_c" 1>&6
11453 else
11454   cat > conftest.$ac_ext <<EOF
11455 #line 11456 "configure"
11456 #include "confdefs.h"
11457 #include <$ac_hdr>
11458 EOF
11459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11460 { (eval echo configure:11461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11462 if test -z "$ac_err"; then
11463   rm -rf conftest*
11464   eval "ac_cv_header_$ac_safe=yes"
11465 else
11466   echo "$ac_err" >&5
11467   echo "configure: failed program was:" >&5
11468   cat conftest.$ac_ext >&5
11469   rm -rf conftest*
11470   eval "ac_cv_header_$ac_safe=no"
11471 fi
11472 rm -f conftest*
11473 fi
11474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11475   echo "$ac_t""yes" 1>&6
11476     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11477   cat >> confdefs.h <<EOF
11478 #define $ac_tr_hdr 1
11479 EOF
11480  
11481 else
11482   echo "$ac_t""no" 1>&6
11483 fi
11484 done
11485
11486 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11487         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11488 echo "configure:11489: checking if Berkeley DB header compatibility" >&5
11489 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11490   echo $ac_n "(cached) $ac_c" 1>&6
11491 else
11492   
11493                 cat > conftest.$ac_ext <<EOF
11494 #line 11495 "configure"
11495 #include "confdefs.h"
11496
11497 #if HAVE_DB_185_H
11498 #       include <db_185.h>
11499 #else
11500 #       include <db.h>
11501 #endif
11502
11503  /* this check could be improved */
11504 #ifndef DB_VERSION_MAJOR
11505 #       define DB_VERSION_MAJOR 1
11506 #endif
11507
11508 #if DB_VERSION_MAJOR == 1 
11509         __db_version_1
11510 #endif
11511
11512 EOF
11513 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11514   egrep "__db_version_1" >/dev/null 2>&1; then
11515   rm -rf conftest*
11516   ol_cv_header_db1=yes
11517 else
11518   rm -rf conftest*
11519   ol_cv_header_db1=no
11520 fi
11521 rm -f conftest*
11522
11523 fi
11524
11525 echo "$ac_t""$ol_cv_header_db1" 1>&6
11526
11527         if test ol_cv_header_db1=yes ; then
11528                 ol_cv_lib_db=no
11529 if test $ol_cv_lib_db = no ; then
11530         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11531 echo "configure:11532: checking for Berkeley DB link (default)" >&5
11532 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11533   echo $ac_n "(cached) $ac_c" 1>&6
11534 else
11535   
11536         ol_DB_LIB=
11537         ol_LIBS=$LIBS
11538         LIBS="$ol_DB_LIB $LIBS"
11539
11540         cat > conftest.$ac_ext <<EOF
11541 #line 11542 "configure"
11542 #include "confdefs.h"
11543
11544 #ifdef HAVE_DB_185_H
11545 # include <db_185.h>
11546 #else
11547 # include <db.h>
11548 #endif
11549
11550 #ifndef DB_VERSION_MAJOR
11551 # define DB_VERSION_MAJOR 1
11552 #endif
11553
11554 #ifndef NULL
11555 #define NULL ((void*)0)
11556 #endif
11557
11558 int main() {
11559
11560 #if DB_VERSION_MAJOR > 2
11561         db_env_create( NULL, 0 );
11562 #elif DB_VERSION_MAJOR > 1
11563         db_appexit( NULL );
11564 #else
11565         (void) dbopen( NULL, 0, 0, 0, NULL);
11566 #endif
11567
11568 ; return 0; }
11569 EOF
11570 if { (eval echo configure:11571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11571   rm -rf conftest*
11572   ol_cv_db_none=yes
11573 else
11574   echo "configure: failed program was:" >&5
11575   cat conftest.$ac_ext >&5
11576   rm -rf conftest*
11577   ol_cv_db_none=no
11578 fi
11579 rm -f conftest*
11580
11581         LIBS="$ol_LIBS"
11582
11583 fi
11584
11585 echo "$ac_t""$ol_cv_db_none" 1>&6
11586
11587         if test $ol_cv_db_none = yes ; then
11588                 ol_cv_lib_db=yes
11589         fi
11590 fi
11591
11592 if test $ol_cv_lib_db = no ; then
11593         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11594 echo "configure:11595: checking for Berkeley DB link (-ldb)" >&5
11595 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11596   echo $ac_n "(cached) $ac_c" 1>&6
11597 else
11598   
11599         ol_DB_LIB=-ldb
11600         ol_LIBS=$LIBS
11601         LIBS="$ol_DB_LIB $LIBS"
11602
11603         cat > conftest.$ac_ext <<EOF
11604 #line 11605 "configure"
11605 #include "confdefs.h"
11606
11607 #ifdef HAVE_DB_185_H
11608 # include <db_185.h>
11609 #else
11610 # include <db.h>
11611 #endif
11612
11613 #ifndef DB_VERSION_MAJOR
11614 # define DB_VERSION_MAJOR 1
11615 #endif
11616
11617 #ifndef NULL
11618 #define NULL ((void*)0)
11619 #endif
11620
11621 int main() {
11622
11623 #if DB_VERSION_MAJOR > 2
11624         db_env_create( NULL, 0 );
11625 #elif DB_VERSION_MAJOR > 1
11626         db_appexit( NULL );
11627 #else
11628         (void) dbopen( NULL, 0, 0, 0, NULL);
11629 #endif
11630
11631 ; return 0; }
11632 EOF
11633 if { (eval echo configure:11634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11634   rm -rf conftest*
11635   ol_cv_db_db=yes
11636 else
11637   echo "configure: failed program was:" >&5
11638   cat conftest.$ac_ext >&5
11639   rm -rf conftest*
11640   ol_cv_db_db=no
11641 fi
11642 rm -f conftest*
11643
11644         LIBS="$ol_LIBS"
11645
11646 fi
11647
11648 echo "$ac_t""$ol_cv_db_db" 1>&6
11649
11650         if test $ol_cv_db_db = yes ; then
11651                 ol_cv_lib_db=-ldb
11652         fi
11653 fi
11654
11655 if test $ol_cv_lib_db = no ; then
11656         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11657 echo "configure:11658: checking for Berkeley DB link (-ldb3)" >&5
11658 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11659   echo $ac_n "(cached) $ac_c" 1>&6
11660 else
11661   
11662         ol_DB_LIB=-ldb3
11663         ol_LIBS=$LIBS
11664         LIBS="$ol_DB_LIB $LIBS"
11665
11666         cat > conftest.$ac_ext <<EOF
11667 #line 11668 "configure"
11668 #include "confdefs.h"
11669
11670 #ifdef HAVE_DB_185_H
11671 # include <db_185.h>
11672 #else
11673 # include <db.h>
11674 #endif
11675
11676 #ifndef DB_VERSION_MAJOR
11677 # define DB_VERSION_MAJOR 1
11678 #endif
11679
11680 #ifndef NULL
11681 #define NULL ((void*)0)
11682 #endif
11683
11684 int main() {
11685
11686 #if DB_VERSION_MAJOR > 2
11687         db_env_create( NULL, 0 );
11688 #elif DB_VERSION_MAJOR > 1
11689         db_appexit( NULL );
11690 #else
11691         (void) dbopen( NULL, 0, 0, 0, NULL);
11692 #endif
11693
11694 ; return 0; }
11695 EOF
11696 if { (eval echo configure:11697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11697   rm -rf conftest*
11698   ol_cv_db_db3=yes
11699 else
11700   echo "configure: failed program was:" >&5
11701   cat conftest.$ac_ext >&5
11702   rm -rf conftest*
11703   ol_cv_db_db3=no
11704 fi
11705 rm -f conftest*
11706
11707         LIBS="$ol_LIBS"
11708
11709 fi
11710
11711 echo "$ac_t""$ol_cv_db_db3" 1>&6
11712
11713         if test $ol_cv_db_db3 = yes ; then
11714                 ol_cv_lib_db=-ldb3
11715         fi
11716 fi
11717
11718 if test $ol_cv_lib_db = no ; then
11719         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11720 echo "configure:11721: checking for Berkeley DB link (-ldb2)" >&5
11721 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11722   echo $ac_n "(cached) $ac_c" 1>&6
11723 else
11724   
11725         ol_DB_LIB=-ldb2
11726         ol_LIBS=$LIBS
11727         LIBS="$ol_DB_LIB $LIBS"
11728
11729         cat > conftest.$ac_ext <<EOF
11730 #line 11731 "configure"
11731 #include "confdefs.h"
11732
11733 #ifdef HAVE_DB_185_H
11734 # include <db_185.h>
11735 #else
11736 # include <db.h>
11737 #endif
11738
11739 #ifndef DB_VERSION_MAJOR
11740 # define DB_VERSION_MAJOR 1
11741 #endif
11742
11743 #ifndef NULL
11744 #define NULL ((void*)0)
11745 #endif
11746
11747 int main() {
11748
11749 #if DB_VERSION_MAJOR > 2
11750         db_env_create( NULL, 0 );
11751 #elif DB_VERSION_MAJOR > 1
11752         db_appexit( NULL );
11753 #else
11754         (void) dbopen( NULL, 0, 0, 0, NULL);
11755 #endif
11756
11757 ; return 0; }
11758 EOF
11759 if { (eval echo configure:11760: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11760   rm -rf conftest*
11761   ol_cv_db_db2=yes
11762 else
11763   echo "configure: failed program was:" >&5
11764   cat conftest.$ac_ext >&5
11765   rm -rf conftest*
11766   ol_cv_db_db2=no
11767 fi
11768 rm -f conftest*
11769
11770         LIBS="$ol_LIBS"
11771
11772 fi
11773
11774 echo "$ac_t""$ol_cv_db_db2" 1>&6
11775
11776         if test $ol_cv_db_db2 = yes ; then
11777                 ol_cv_lib_db=-ldb2
11778         fi
11779 fi
11780
11781 if test $ol_cv_lib_db = no ; then
11782         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11783 echo "configure:11784: checking for Berkeley DB link (-ldb1)" >&5
11784 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11785   echo $ac_n "(cached) $ac_c" 1>&6
11786 else
11787   
11788         ol_DB_LIB=-ldb1
11789         ol_LIBS=$LIBS
11790         LIBS="$ol_DB_LIB $LIBS"
11791
11792         cat > conftest.$ac_ext <<EOF
11793 #line 11794 "configure"
11794 #include "confdefs.h"
11795
11796 #ifdef HAVE_DB_185_H
11797 # include <db_185.h>
11798 #else
11799 # include <db.h>
11800 #endif
11801
11802 #ifndef DB_VERSION_MAJOR
11803 # define DB_VERSION_MAJOR 1
11804 #endif
11805
11806 #ifndef NULL
11807 #define NULL ((void*)0)
11808 #endif
11809
11810 int main() {
11811
11812 #if DB_VERSION_MAJOR > 2
11813         db_env_create( NULL, 0 );
11814 #elif DB_VERSION_MAJOR > 1
11815         db_appexit( NULL );
11816 #else
11817         (void) dbopen( NULL, 0, 0, 0, NULL);
11818 #endif
11819
11820 ; return 0; }
11821 EOF
11822 if { (eval echo configure:11823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11823   rm -rf conftest*
11824   ol_cv_db_db1=yes
11825 else
11826   echo "configure: failed program was:" >&5
11827   cat conftest.$ac_ext >&5
11828   rm -rf conftest*
11829   ol_cv_db_db1=no
11830 fi
11831 rm -f conftest*
11832
11833         LIBS="$ol_LIBS"
11834
11835 fi
11836
11837 echo "$ac_t""$ol_cv_db_db1" 1>&6
11838
11839         if test $ol_cv_db_db1 = yes ; then
11840                 ol_cv_lib_db=-ldb1
11841         fi
11842 fi
11843
11844
11845                 if test "$ol_cv_lib_db" != no ; then
11846                         ol_cv_berkeley_db=yes
11847                 fi
11848         fi
11849 fi
11850
11851         else
11852                 ol_cv_berkeley_db=no
11853 for ac_hdr in db.h
11854 do
11855 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11856 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11857 echo "configure:11858: checking for $ac_hdr" >&5
11858 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11859   echo $ac_n "(cached) $ac_c" 1>&6
11860 else
11861   cat > conftest.$ac_ext <<EOF
11862 #line 11863 "configure"
11863 #include "confdefs.h"
11864 #include <$ac_hdr>
11865 EOF
11866 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11867 { (eval echo configure:11868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11868 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11869 if test -z "$ac_err"; then
11870   rm -rf conftest*
11871   eval "ac_cv_header_$ac_safe=yes"
11872 else
11873   echo "$ac_err" >&5
11874   echo "configure: failed program was:" >&5
11875   cat conftest.$ac_ext >&5
11876   rm -rf conftest*
11877   eval "ac_cv_header_$ac_safe=no"
11878 fi
11879 rm -f conftest*
11880 fi
11881 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11882   echo "$ac_t""yes" 1>&6
11883     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11884   cat >> confdefs.h <<EOF
11885 #define $ac_tr_hdr 1
11886 EOF
11887  
11888 else
11889   echo "$ac_t""no" 1>&6
11890 fi
11891 done
11892
11893 if test $ac_cv_header_db_h = yes; then
11894         ol_cv_lib_db=no
11895 if test $ol_cv_lib_db = no ; then
11896         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11897 echo "configure:11898: checking for Berkeley DB link (default)" >&5
11898 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11899   echo $ac_n "(cached) $ac_c" 1>&6
11900 else
11901   
11902         ol_DB_LIB=
11903         ol_LIBS=$LIBS
11904         LIBS="$ol_DB_LIB $LIBS"
11905
11906         cat > conftest.$ac_ext <<EOF
11907 #line 11908 "configure"
11908 #include "confdefs.h"
11909
11910 #ifdef HAVE_DB_185_H
11911 # include <db_185.h>
11912 #else
11913 # include <db.h>
11914 #endif
11915
11916 #ifndef DB_VERSION_MAJOR
11917 # define DB_VERSION_MAJOR 1
11918 #endif
11919
11920 #ifndef NULL
11921 #define NULL ((void*)0)
11922 #endif
11923
11924 int main() {
11925
11926 #if DB_VERSION_MAJOR > 2
11927         db_env_create( NULL, 0 );
11928 #elif DB_VERSION_MAJOR > 1
11929         db_appexit( NULL );
11930 #else
11931         (void) dbopen( NULL, 0, 0, 0, NULL);
11932 #endif
11933
11934 ; return 0; }
11935 EOF
11936 if { (eval echo configure:11937: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11937   rm -rf conftest*
11938   ol_cv_db_none=yes
11939 else
11940   echo "configure: failed program was:" >&5
11941   cat conftest.$ac_ext >&5
11942   rm -rf conftest*
11943   ol_cv_db_none=no
11944 fi
11945 rm -f conftest*
11946
11947         LIBS="$ol_LIBS"
11948
11949 fi
11950
11951 echo "$ac_t""$ol_cv_db_none" 1>&6
11952
11953         if test $ol_cv_db_none = yes ; then
11954                 ol_cv_lib_db=yes
11955         fi
11956 fi
11957
11958 if test $ol_cv_lib_db = no ; then
11959         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11960 echo "configure:11961: checking for Berkeley DB link (-ldb)" >&5
11961 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11962   echo $ac_n "(cached) $ac_c" 1>&6
11963 else
11964   
11965         ol_DB_LIB=-ldb
11966         ol_LIBS=$LIBS
11967         LIBS="$ol_DB_LIB $LIBS"
11968
11969         cat > conftest.$ac_ext <<EOF
11970 #line 11971 "configure"
11971 #include "confdefs.h"
11972
11973 #ifdef HAVE_DB_185_H
11974 # include <db_185.h>
11975 #else
11976 # include <db.h>
11977 #endif
11978
11979 #ifndef DB_VERSION_MAJOR
11980 # define DB_VERSION_MAJOR 1
11981 #endif
11982
11983 #ifndef NULL
11984 #define NULL ((void*)0)
11985 #endif
11986
11987 int main() {
11988
11989 #if DB_VERSION_MAJOR > 2
11990         db_env_create( NULL, 0 );
11991 #elif DB_VERSION_MAJOR > 1
11992         db_appexit( NULL );
11993 #else
11994         (void) dbopen( NULL, 0, 0, 0, NULL);
11995 #endif
11996
11997 ; return 0; }
11998 EOF
11999 if { (eval echo configure:12000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12000   rm -rf conftest*
12001   ol_cv_db_db=yes
12002 else
12003   echo "configure: failed program was:" >&5
12004   cat conftest.$ac_ext >&5
12005   rm -rf conftest*
12006   ol_cv_db_db=no
12007 fi
12008 rm -f conftest*
12009
12010         LIBS="$ol_LIBS"
12011
12012 fi
12013
12014 echo "$ac_t""$ol_cv_db_db" 1>&6
12015
12016         if test $ol_cv_db_db = yes ; then
12017                 ol_cv_lib_db=-ldb
12018         fi
12019 fi
12020
12021 if test $ol_cv_lib_db = no ; then
12022         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
12023 echo "configure:12024: checking for Berkeley DB link (-ldb3)" >&5
12024 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
12025   echo $ac_n "(cached) $ac_c" 1>&6
12026 else
12027   
12028         ol_DB_LIB=-ldb3
12029         ol_LIBS=$LIBS
12030         LIBS="$ol_DB_LIB $LIBS"
12031
12032         cat > conftest.$ac_ext <<EOF
12033 #line 12034 "configure"
12034 #include "confdefs.h"
12035
12036 #ifdef HAVE_DB_185_H
12037 # include <db_185.h>
12038 #else
12039 # include <db.h>
12040 #endif
12041
12042 #ifndef DB_VERSION_MAJOR
12043 # define DB_VERSION_MAJOR 1
12044 #endif
12045
12046 #ifndef NULL
12047 #define NULL ((void*)0)
12048 #endif
12049
12050 int main() {
12051
12052 #if DB_VERSION_MAJOR > 2
12053         db_env_create( NULL, 0 );
12054 #elif DB_VERSION_MAJOR > 1
12055         db_appexit( NULL );
12056 #else
12057         (void) dbopen( NULL, 0, 0, 0, NULL);
12058 #endif
12059
12060 ; return 0; }
12061 EOF
12062 if { (eval echo configure:12063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12063   rm -rf conftest*
12064   ol_cv_db_db3=yes
12065 else
12066   echo "configure: failed program was:" >&5
12067   cat conftest.$ac_ext >&5
12068   rm -rf conftest*
12069   ol_cv_db_db3=no
12070 fi
12071 rm -f conftest*
12072
12073         LIBS="$ol_LIBS"
12074
12075 fi
12076
12077 echo "$ac_t""$ol_cv_db_db3" 1>&6
12078
12079         if test $ol_cv_db_db3 = yes ; then
12080                 ol_cv_lib_db=-ldb3
12081         fi
12082 fi
12083
12084 if test $ol_cv_lib_db = no ; then
12085         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
12086 echo "configure:12087: checking for Berkeley DB link (-ldb2)" >&5
12087 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
12088   echo $ac_n "(cached) $ac_c" 1>&6
12089 else
12090   
12091         ol_DB_LIB=-ldb2
12092         ol_LIBS=$LIBS
12093         LIBS="$ol_DB_LIB $LIBS"
12094
12095         cat > conftest.$ac_ext <<EOF
12096 #line 12097 "configure"
12097 #include "confdefs.h"
12098
12099 #ifdef HAVE_DB_185_H
12100 # include <db_185.h>
12101 #else
12102 # include <db.h>
12103 #endif
12104
12105 #ifndef DB_VERSION_MAJOR
12106 # define DB_VERSION_MAJOR 1
12107 #endif
12108
12109 #ifndef NULL
12110 #define NULL ((void*)0)
12111 #endif
12112
12113 int main() {
12114
12115 #if DB_VERSION_MAJOR > 2
12116         db_env_create( NULL, 0 );
12117 #elif DB_VERSION_MAJOR > 1
12118         db_appexit( NULL );
12119 #else
12120         (void) dbopen( NULL, 0, 0, 0, NULL);
12121 #endif
12122
12123 ; return 0; }
12124 EOF
12125 if { (eval echo configure:12126: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12126   rm -rf conftest*
12127   ol_cv_db_db2=yes
12128 else
12129   echo "configure: failed program was:" >&5
12130   cat conftest.$ac_ext >&5
12131   rm -rf conftest*
12132   ol_cv_db_db2=no
12133 fi
12134 rm -f conftest*
12135
12136         LIBS="$ol_LIBS"
12137
12138 fi
12139
12140 echo "$ac_t""$ol_cv_db_db2" 1>&6
12141
12142         if test $ol_cv_db_db2 = yes ; then
12143                 ol_cv_lib_db=-ldb2
12144         fi
12145 fi
12146
12147 if test $ol_cv_lib_db = no ; then
12148         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
12149 echo "configure:12150: checking for Berkeley DB link (-ldb1)" >&5
12150 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
12151   echo $ac_n "(cached) $ac_c" 1>&6
12152 else
12153   
12154         ol_DB_LIB=-ldb1
12155         ol_LIBS=$LIBS
12156         LIBS="$ol_DB_LIB $LIBS"
12157
12158         cat > conftest.$ac_ext <<EOF
12159 #line 12160 "configure"
12160 #include "confdefs.h"
12161
12162 #ifdef HAVE_DB_185_H
12163 # include <db_185.h>
12164 #else
12165 # include <db.h>
12166 #endif
12167
12168 #ifndef DB_VERSION_MAJOR
12169 # define DB_VERSION_MAJOR 1
12170 #endif
12171
12172 #ifndef NULL
12173 #define NULL ((void*)0)
12174 #endif
12175
12176 int main() {
12177
12178 #if DB_VERSION_MAJOR > 2
12179         db_env_create( NULL, 0 );
12180 #elif DB_VERSION_MAJOR > 1
12181         db_appexit( NULL );
12182 #else
12183         (void) dbopen( NULL, 0, 0, 0, NULL);
12184 #endif
12185
12186 ; return 0; }
12187 EOF
12188 if { (eval echo configure:12189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12189   rm -rf conftest*
12190   ol_cv_db_db1=yes
12191 else
12192   echo "configure: failed program was:" >&5
12193   cat conftest.$ac_ext >&5
12194   rm -rf conftest*
12195   ol_cv_db_db1=no
12196 fi
12197 rm -f conftest*
12198
12199         LIBS="$ol_LIBS"
12200
12201 fi
12202
12203 echo "$ac_t""$ol_cv_db_db1" 1>&6
12204
12205         if test $ol_cv_db_db1 = yes ; then
12206                 ol_cv_lib_db=-ldb1
12207         fi
12208 fi
12209
12210
12211         if test "$ol_cv_lib_db" != no ; then
12212                 ol_cv_berkeley_db=yes
12213                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12214 echo "configure:12215: checking for Berkeley DB thread support" >&5
12215 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12216   echo $ac_n "(cached) $ac_c" 1>&6
12217 else
12218   
12219         ol_LIBS="$LIBS"
12220         if test $ol_cv_lib_db != yes ; then
12221                 LIBS="$ol_cv_lib_db"
12222         fi
12223
12224         if test "$cross_compiling" = yes; then
12225   ol_cv_berkeley_db_thread=cross
12226 else
12227   cat > conftest.$ac_ext <<EOF
12228 #line 12229 "configure"
12229 #include "confdefs.h"
12230
12231 #ifdef HAVE_DB_185_H
12232         choke me;
12233 #else
12234 #include <db.h>
12235 #endif
12236 #ifndef NULL
12237 #define NULL ((void *)0)
12238 #endif
12239 main()
12240 {
12241         int rc;
12242         u_int32_t flags = DB_CREATE | DB_THREAD;
12243
12244 #if DB_VERSION_MAJOR > 2
12245         DB_ENV *env = NULL;
12246
12247         rc = db_env_create( &env, 0 );
12248
12249         if( rc == 0 ) {
12250 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12251                 rc = env->open( env, NULL, flags, 0 );
12252 #else
12253                 rc = env->open( env, NULL, NULL, flags, 0 );
12254 #endif
12255         }
12256
12257 #else
12258         DB_ENV env;
12259         memset( &env, '\0', sizeof(env) );
12260
12261         rc = db_appinit( NULL, NULL, &env, flags );
12262
12263         if( rc == 0 ) {
12264                 db_appexit( &env );
12265         }
12266 #endif
12267 #if DB_VERSION_MAJOR > 2
12268 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12269         env->remove( env, NULL, DB_FORCE);
12270 #else
12271         env->remove( env, NULL, NULL, DB_FORCE);
12272 #endif
12273 #endif
12274
12275         return rc;
12276 }
12277 EOF
12278 if { (eval echo configure:12279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12279 then
12280   ol_cv_berkeley_db_thread=yes
12281 else
12282   echo "configure: failed program was:" >&5
12283   cat conftest.$ac_ext >&5
12284   rm -fr conftest*
12285   ol_cv_berkeley_db_thread=no
12286 fi
12287 rm -fr conftest*
12288 fi
12289
12290
12291         LIBS="$ol_LIBS"
12292
12293         if test $ol_cv_berkeley_db_thread != no ; then
12294                 cat >> confdefs.h <<\EOF
12295 #define HAVE_BERKELEY_DB_THREAD 1
12296 EOF
12297
12298         fi
12299
12300 fi
12301
12302 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12303         fi
12304 fi
12305
12306         fi
12307
12308         if test $ol_cv_berkeley_db != no ; then
12309                 cat >> confdefs.h <<\EOF
12310 #define HAVE_BERKELEY_DB 1
12311 EOF
12312
12313
12314                 ol_link_ldbm=berkeley
12315                 ol_with_ldbm_api=db
12316
12317                 if test $ol_with_ldbm_type = hash ; then
12318                         cat >> confdefs.h <<\EOF
12319 #define LDBM_USE_DBHASH 1
12320 EOF
12321
12322                 else
12323                         cat >> confdefs.h <<\EOF
12324 #define LDBM_USE_DBBTREE 1
12325 EOF
12326
12327                 fi
12328
12329                                                 if test $ol_cv_lib_db != yes ; then
12330                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12331                 fi
12332         fi
12333 fi
12334
12335 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12336         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12337         ol_with_ldbm_api=none
12338 fi
12339
12340 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12341         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12342 echo "configure:12343: checking for MDBM library" >&5
12343 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12344   echo $ac_n "(cached) $ac_c" 1>&6
12345 else
12346         ol_LIBS="$LIBS"
12347         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12348 echo "configure:12349: checking for mdbm_set_chain" >&5
12349 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12350   echo $ac_n "(cached) $ac_c" 1>&6
12351 else
12352   cat > conftest.$ac_ext <<EOF
12353 #line 12354 "configure"
12354 #include "confdefs.h"
12355 /* System header to define __stub macros and hopefully few prototypes,
12356     which can conflict with char mdbm_set_chain(); below.  */
12357 #include <assert.h>
12358 /* Override any gcc2 internal prototype to avoid an error.  */
12359 /* We use char because int might match the return type of a gcc2
12360     builtin and then its argument prototype would still apply.  */
12361 char mdbm_set_chain();
12362 char (*f)();
12363
12364 int main() {
12365
12366 /* The GNU C library defines this for functions which it implements
12367     to always fail with ENOSYS.  Some functions are actually named
12368     something starting with __ and the normal name is an alias.  */
12369 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12370 choke me
12371 #else
12372 f = mdbm_set_chain;
12373 #endif
12374
12375 ; return 0; }
12376 EOF
12377 if { (eval echo configure:12378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12378   rm -rf conftest*
12379   eval "ac_cv_func_mdbm_set_chain=yes"
12380 else
12381   echo "configure: failed program was:" >&5
12382   cat conftest.$ac_ext >&5
12383   rm -rf conftest*
12384   eval "ac_cv_func_mdbm_set_chain=no"
12385 fi
12386 rm -f conftest*
12387 fi
12388
12389 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12390   echo "$ac_t""yes" 1>&6
12391   ol_cv_lib_mdbm=yes
12392 else
12393   echo "$ac_t""no" 1>&6
12394
12395                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12396 echo "configure:12397: checking for mdbm_set_chain in -lmdbm" >&5
12397 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12398 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12399   echo $ac_n "(cached) $ac_c" 1>&6
12400 else
12401   ac_save_LIBS="$LIBS"
12402 LIBS="-lmdbm  $LIBS"
12403 cat > conftest.$ac_ext <<EOF
12404 #line 12405 "configure"
12405 #include "confdefs.h"
12406 /* Override any gcc2 internal prototype to avoid an error.  */
12407 /* We use char because int might match the return type of a gcc2
12408     builtin and then its argument prototype would still apply.  */
12409 char mdbm_set_chain();
12410
12411 int main() {
12412 mdbm_set_chain()
12413 ; return 0; }
12414 EOF
12415 if { (eval echo configure:12416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12416   rm -rf conftest*
12417   eval "ac_cv_lib_$ac_lib_var=yes"
12418 else
12419   echo "configure: failed program was:" >&5
12420   cat conftest.$ac_ext >&5
12421   rm -rf conftest*
12422   eval "ac_cv_lib_$ac_lib_var=no"
12423 fi
12424 rm -f conftest*
12425 LIBS="$ac_save_LIBS"
12426
12427 fi
12428 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12429   echo "$ac_t""yes" 1>&6
12430   ol_cv_lib_mdbm=-lmdbm
12431 else
12432   echo "$ac_t""no" 1>&6
12433 ol_cv_lib_mdbm=no
12434 fi
12435
12436         
12437 fi
12438
12439         LIBS="$ol_LIBS"
12440
12441 fi
12442
12443 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12444
12445
12446  for ac_hdr in mdbm.h
12447 do
12448 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12449 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12450 echo "configure:12451: checking for $ac_hdr" >&5
12451 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12452   echo $ac_n "(cached) $ac_c" 1>&6
12453 else
12454   cat > conftest.$ac_ext <<EOF
12455 #line 12456 "configure"
12456 #include "confdefs.h"
12457 #include <$ac_hdr>
12458 EOF
12459 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12460 { (eval echo configure:12461: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12461 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12462 if test -z "$ac_err"; then
12463   rm -rf conftest*
12464   eval "ac_cv_header_$ac_safe=yes"
12465 else
12466   echo "$ac_err" >&5
12467   echo "configure: failed program was:" >&5
12468   cat conftest.$ac_ext >&5
12469   rm -rf conftest*
12470   eval "ac_cv_header_$ac_safe=no"
12471 fi
12472 rm -f conftest*
12473 fi
12474 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12475   echo "$ac_t""yes" 1>&6
12476     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12477   cat >> confdefs.h <<EOF
12478 #define $ac_tr_hdr 1
12479 EOF
12480  
12481 else
12482   echo "$ac_t""no" 1>&6
12483 fi
12484 done
12485
12486  echo $ac_n "checking for db""... $ac_c" 1>&6
12487 echo "configure:12488: checking for db" >&5
12488 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12489   echo $ac_n "(cached) $ac_c" 1>&6
12490 else
12491   
12492         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12493                 ol_cv_mdbm=no
12494         else
12495                 ol_cv_mdbm=yes
12496         fi
12497
12498 fi
12499
12500 echo "$ac_t""$ol_cv_mdbm" 1>&6
12501  if test $ol_cv_mdbm = yes ; then
12502         cat >> confdefs.h <<\EOF
12503 #define HAVE_MDBM 1
12504 EOF
12505
12506  fi
12507
12508
12509         if test $ol_cv_mdbm = yes ; then
12510                 ol_link_ldbm=mdbm
12511                 ol_with_ldbm_api=mdbm
12512                 if test $ol_cv_lib_mdbm != yes ; then
12513                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
12514                 fi
12515         fi
12516 fi
12517
12518 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
12519         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
12520 echo "configure:12521: checking for GDBM library" >&5
12521 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
12522   echo $ac_n "(cached) $ac_c" 1>&6
12523 else
12524         ol_LIBS="$LIBS"
12525         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
12526 echo "configure:12527: checking for gdbm_open" >&5
12527 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
12528   echo $ac_n "(cached) $ac_c" 1>&6
12529 else
12530   cat > conftest.$ac_ext <<EOF
12531 #line 12532 "configure"
12532 #include "confdefs.h"
12533 /* System header to define __stub macros and hopefully few prototypes,
12534     which can conflict with char gdbm_open(); below.  */
12535 #include <assert.h>
12536 /* Override any gcc2 internal prototype to avoid an error.  */
12537 /* We use char because int might match the return type of a gcc2
12538     builtin and then its argument prototype would still apply.  */
12539 char gdbm_open();
12540 char (*f)();
12541
12542 int main() {
12543
12544 /* The GNU C library defines this for functions which it implements
12545     to always fail with ENOSYS.  Some functions are actually named
12546     something starting with __ and the normal name is an alias.  */
12547 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
12548 choke me
12549 #else
12550 f = gdbm_open;
12551 #endif
12552
12553 ; return 0; }
12554 EOF
12555 if { (eval echo configure:12556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12556   rm -rf conftest*
12557   eval "ac_cv_func_gdbm_open=yes"
12558 else
12559   echo "configure: failed program was:" >&5
12560   cat conftest.$ac_ext >&5
12561   rm -rf conftest*
12562   eval "ac_cv_func_gdbm_open=no"
12563 fi
12564 rm -f conftest*
12565 fi
12566
12567 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
12568   echo "$ac_t""yes" 1>&6
12569   ol_cv_lib_gdbm=yes
12570 else
12571   echo "$ac_t""no" 1>&6
12572
12573                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
12574 echo "configure:12575: checking for gdbm_open in -lgdbm" >&5
12575 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
12576 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12577   echo $ac_n "(cached) $ac_c" 1>&6
12578 else
12579   ac_save_LIBS="$LIBS"
12580 LIBS="-lgdbm  $LIBS"
12581 cat > conftest.$ac_ext <<EOF
12582 #line 12583 "configure"
12583 #include "confdefs.h"
12584 /* Override any gcc2 internal prototype to avoid an error.  */
12585 /* We use char because int might match the return type of a gcc2
12586     builtin and then its argument prototype would still apply.  */
12587 char gdbm_open();
12588
12589 int main() {
12590 gdbm_open()
12591 ; return 0; }
12592 EOF
12593 if { (eval echo configure:12594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12594   rm -rf conftest*
12595   eval "ac_cv_lib_$ac_lib_var=yes"
12596 else
12597   echo "configure: failed program was:" >&5
12598   cat conftest.$ac_ext >&5
12599   rm -rf conftest*
12600   eval "ac_cv_lib_$ac_lib_var=no"
12601 fi
12602 rm -f conftest*
12603 LIBS="$ac_save_LIBS"
12604
12605 fi
12606 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12607   echo "$ac_t""yes" 1>&6
12608   ol_cv_lib_gdbm=-lgdbm
12609 else
12610   echo "$ac_t""no" 1>&6
12611 ol_cv_lib_gdbm=no
12612 fi
12613
12614         
12615 fi
12616
12617         LIBS="$ol_LIBS"
12618
12619 fi
12620
12621 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
12622
12623
12624  for ac_hdr in gdbm.h
12625 do
12626 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12627 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12628 echo "configure:12629: checking for $ac_hdr" >&5
12629 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12630   echo $ac_n "(cached) $ac_c" 1>&6
12631 else
12632   cat > conftest.$ac_ext <<EOF
12633 #line 12634 "configure"
12634 #include "confdefs.h"
12635 #include <$ac_hdr>
12636 EOF
12637 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12638 { (eval echo configure:12639: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12639 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12640 if test -z "$ac_err"; then
12641   rm -rf conftest*
12642   eval "ac_cv_header_$ac_safe=yes"
12643 else
12644   echo "$ac_err" >&5
12645   echo "configure: failed program was:" >&5
12646   cat conftest.$ac_ext >&5
12647   rm -rf conftest*
12648   eval "ac_cv_header_$ac_safe=no"
12649 fi
12650 rm -f conftest*
12651 fi
12652 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12653   echo "$ac_t""yes" 1>&6
12654     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12655   cat >> confdefs.h <<EOF
12656 #define $ac_tr_hdr 1
12657 EOF
12658  
12659 else
12660   echo "$ac_t""no" 1>&6
12661 fi
12662 done
12663
12664  echo $ac_n "checking for db""... $ac_c" 1>&6
12665 echo "configure:12666: checking for db" >&5
12666 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
12667   echo $ac_n "(cached) $ac_c" 1>&6
12668 else
12669   
12670         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
12671                 ol_cv_gdbm=no
12672         else
12673                 ol_cv_gdbm=yes
12674         fi
12675
12676 fi
12677
12678 echo "$ac_t""$ol_cv_gdbm" 1>&6
12679  if test $ol_cv_gdbm = yes ; then
12680         cat >> confdefs.h <<\EOF
12681 #define HAVE_GDBM 1
12682 EOF
12683
12684  fi
12685
12686
12687         if test $ol_cv_gdbm = yes ; then
12688                 ol_link_ldbm=gdbm
12689                 ol_with_ldbm_api=gdbm
12690
12691                 if test $ol_cv_lib_gdbm != yes ; then
12692                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
12693                 fi
12694         fi
12695 fi
12696
12697 if test $ol_with_ldbm_api = ndbm ; then
12698         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
12699 echo "configure:12700: checking for NDBM library" >&5
12700 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
12701   echo $ac_n "(cached) $ac_c" 1>&6
12702 else
12703         ol_LIBS="$LIBS"
12704         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12705 echo "configure:12706: checking for dbm_open" >&5
12706 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
12707   echo $ac_n "(cached) $ac_c" 1>&6
12708 else
12709   cat > conftest.$ac_ext <<EOF
12710 #line 12711 "configure"
12711 #include "confdefs.h"
12712 /* System header to define __stub macros and hopefully few prototypes,
12713     which can conflict with char dbm_open(); below.  */
12714 #include <assert.h>
12715 /* Override any gcc2 internal prototype to avoid an error.  */
12716 /* We use char because int might match the return type of a gcc2
12717     builtin and then its argument prototype would still apply.  */
12718 char dbm_open();
12719 char (*f)();
12720
12721 int main() {
12722
12723 /* The GNU C library defines this for functions which it implements
12724     to always fail with ENOSYS.  Some functions are actually named
12725     something starting with __ and the normal name is an alias.  */
12726 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12727 choke me
12728 #else
12729 f = dbm_open;
12730 #endif
12731
12732 ; return 0; }
12733 EOF
12734 if { (eval echo configure:12735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12735   rm -rf conftest*
12736   eval "ac_cv_func_dbm_open=yes"
12737 else
12738   echo "configure: failed program was:" >&5
12739   cat conftest.$ac_ext >&5
12740   rm -rf conftest*
12741   eval "ac_cv_func_dbm_open=no"
12742 fi
12743 rm -f conftest*
12744 fi
12745
12746 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12747   echo "$ac_t""yes" 1>&6
12748   ol_cv_lib_ndbm=yes
12749 else
12750   echo "$ac_t""no" 1>&6
12751
12752                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
12753 echo "configure:12754: checking for dbm_open in -lndbm" >&5
12754 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12755 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12756   echo $ac_n "(cached) $ac_c" 1>&6
12757 else
12758   ac_save_LIBS="$LIBS"
12759 LIBS="-lndbm  $LIBS"
12760 cat > conftest.$ac_ext <<EOF
12761 #line 12762 "configure"
12762 #include "confdefs.h"
12763 /* Override any gcc2 internal prototype to avoid an error.  */
12764 /* We use char because int might match the return type of a gcc2
12765     builtin and then its argument prototype would still apply.  */
12766 char dbm_open();
12767
12768 int main() {
12769 dbm_open()
12770 ; return 0; }
12771 EOF
12772 if { (eval echo configure:12773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12773   rm -rf conftest*
12774   eval "ac_cv_lib_$ac_lib_var=yes"
12775 else
12776   echo "configure: failed program was:" >&5
12777   cat conftest.$ac_ext >&5
12778   rm -rf conftest*
12779   eval "ac_cv_lib_$ac_lib_var=no"
12780 fi
12781 rm -f conftest*
12782 LIBS="$ac_save_LIBS"
12783
12784 fi
12785 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12786   echo "$ac_t""yes" 1>&6
12787   ol_cv_lib_ndbm=-lndbm
12788 else
12789   echo "$ac_t""no" 1>&6
12790
12791                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12792 echo "configure:12793: checking for dbm_open in -ldbm" >&5
12793 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12794 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12795   echo $ac_n "(cached) $ac_c" 1>&6
12796 else
12797   ac_save_LIBS="$LIBS"
12798 LIBS="-ldbm  $LIBS"
12799 cat > conftest.$ac_ext <<EOF
12800 #line 12801 "configure"
12801 #include "confdefs.h"
12802 /* Override any gcc2 internal prototype to avoid an error.  */
12803 /* We use char because int might match the return type of a gcc2
12804     builtin and then its argument prototype would still apply.  */
12805 char dbm_open();
12806
12807 int main() {
12808 dbm_open()
12809 ; return 0; }
12810 EOF
12811 if { (eval echo configure:12812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12812   rm -rf conftest*
12813   eval "ac_cv_lib_$ac_lib_var=yes"
12814 else
12815   echo "configure: failed program was:" >&5
12816   cat conftest.$ac_ext >&5
12817   rm -rf conftest*
12818   eval "ac_cv_lib_$ac_lib_var=no"
12819 fi
12820 rm -f conftest*
12821 LIBS="$ac_save_LIBS"
12822
12823 fi
12824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12825   echo "$ac_t""yes" 1>&6
12826   ol_cv_lib_ndbm=-ldbm
12827 else
12828   echo "$ac_t""no" 1>&6
12829 ol_cv_lib_ndbm=no
12830 fi
12831                 
12832 fi
12833
12834         
12835 fi
12836
12837         LIBS="$ol_LIBS"
12838
12839 fi
12840
12841 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
12842
12843
12844  for ac_hdr in ndbm.h
12845 do
12846 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12847 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12848 echo "configure:12849: checking for $ac_hdr" >&5
12849 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12850   echo $ac_n "(cached) $ac_c" 1>&6
12851 else
12852   cat > conftest.$ac_ext <<EOF
12853 #line 12854 "configure"
12854 #include "confdefs.h"
12855 #include <$ac_hdr>
12856 EOF
12857 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12858 { (eval echo configure:12859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12859 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12860 if test -z "$ac_err"; then
12861   rm -rf conftest*
12862   eval "ac_cv_header_$ac_safe=yes"
12863 else
12864   echo "$ac_err" >&5
12865   echo "configure: failed program was:" >&5
12866   cat conftest.$ac_ext >&5
12867   rm -rf conftest*
12868   eval "ac_cv_header_$ac_safe=no"
12869 fi
12870 rm -f conftest*
12871 fi
12872 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12873   echo "$ac_t""yes" 1>&6
12874     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12875   cat >> confdefs.h <<EOF
12876 #define $ac_tr_hdr 1
12877 EOF
12878  
12879 else
12880   echo "$ac_t""no" 1>&6
12881 fi
12882 done
12883
12884  echo $ac_n "checking for db""... $ac_c" 1>&6
12885 echo "configure:12886: checking for db" >&5
12886 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
12887   echo $ac_n "(cached) $ac_c" 1>&6
12888 else
12889   
12890         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
12891                 ol_cv_ndbm=no
12892         else
12893                 ol_cv_ndbm=yes
12894         fi
12895
12896 fi
12897
12898 echo "$ac_t""$ol_cv_ndbm" 1>&6
12899  if test $ol_cv_ndbm = yes ; then
12900         cat >> confdefs.h <<\EOF
12901 #define HAVE_NDBM 1
12902 EOF
12903
12904  fi
12905
12906
12907         if test $ol_cv_ndbm = yes ; then
12908                 ol_link_ldbm=ndbm
12909                 ol_with_ldbm_api=ndbm
12910
12911                 if test $ol_cv_lib_ndbm != yes ; then
12912                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
12913                 fi
12914         fi
12915 fi
12916
12917 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
12918         echo "configure: warning: could not find suitable LDBM backend" 1>&2
12919         if test $ol_enable_ldbm = yes ; then
12920                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
12921         fi
12922
12923         echo "configure: warning: disabling LDBM" 1>&2
12924         ol_enable_ldbm=no
12925 fi
12926
12927 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
12928         LINK_BINS_DYNAMIC="yes"
12929 else
12930         LINK_BINS_DYNAMIC="no"
12931 fi
12932
12933 if test $ol_enable_wrappers != no ; then
12934         for ac_hdr in tcpd.h
12935 do
12936 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12937 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12938 echo "configure:12939: checking for $ac_hdr" >&5
12939 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12940   echo $ac_n "(cached) $ac_c" 1>&6
12941 else
12942   cat > conftest.$ac_ext <<EOF
12943 #line 12944 "configure"
12944 #include "confdefs.h"
12945 #include <$ac_hdr>
12946 EOF
12947 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12948 { (eval echo configure:12949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12949 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12950 if test -z "$ac_err"; then
12951   rm -rf conftest*
12952   eval "ac_cv_header_$ac_safe=yes"
12953 else
12954   echo "$ac_err" >&5
12955   echo "configure: failed program was:" >&5
12956   cat conftest.$ac_ext >&5
12957   rm -rf conftest*
12958   eval "ac_cv_header_$ac_safe=no"
12959 fi
12960 rm -f conftest*
12961 fi
12962 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12963   echo "$ac_t""yes" 1>&6
12964     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12965   cat >> confdefs.h <<EOF
12966 #define $ac_tr_hdr 1
12967 EOF
12968  
12969 else
12970   echo "$ac_t""no" 1>&6
12971 fi
12972 done
12973
12974
12975         if test $ac_cv_header_tcpd_h != yes ; then
12976                 have_wrappers=no
12977         else
12978                 cat > conftest.$ac_ext <<EOF
12979 #line 12980 "configure"
12980 #include "confdefs.h"
12981
12982 int allow_severity = 0;
12983 int deny_severity  = 0;
12984                 
12985 int main() {
12986 hosts_access()
12987 ; return 0; }
12988 EOF
12989 if { (eval echo configure:12990: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12990   rm -rf conftest*
12991   have_wrappers=yes
12992 else
12993   echo "configure: failed program was:" >&5
12994   cat conftest.$ac_ext >&5
12995   rm -rf conftest*
12996   have_wrappers=no
12997 fi
12998 rm -f conftest*
12999         fi
13000
13001         if test $have_wrappers = yes ; then
13002                 cat >> confdefs.h <<\EOF
13003 #define HAVE_TCPD 1
13004 EOF
13005
13006                 WRAP_LIBS="-lwrap"
13007
13008                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
13009 echo "configure:13010: checking for main in -lnsl" >&5
13010 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
13011 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13012   echo $ac_n "(cached) $ac_c" 1>&6
13013 else
13014   ac_save_LIBS="$LIBS"
13015 LIBS="-lnsl  $LIBS"
13016 cat > conftest.$ac_ext <<EOF
13017 #line 13018 "configure"
13018 #include "confdefs.h"
13019
13020 int main() {
13021 main()
13022 ; return 0; }
13023 EOF
13024 if { (eval echo configure:13025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13025   rm -rf conftest*
13026   eval "ac_cv_lib_$ac_lib_var=yes"
13027 else
13028   echo "configure: failed program was:" >&5
13029   cat conftest.$ac_ext >&5
13030   rm -rf conftest*
13031   eval "ac_cv_lib_$ac_lib_var=no"
13032 fi
13033 rm -f conftest*
13034 LIBS="$ac_save_LIBS"
13035
13036 fi
13037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13038   echo "$ac_t""yes" 1>&6
13039     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
13040     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
13041   cat >> confdefs.h <<EOF
13042 #define $ac_tr_lib 1
13043 EOF
13044
13045   LIBS="-lnsl $LIBS"
13046
13047 else
13048   echo "$ac_t""no" 1>&6
13049 fi
13050
13051         else
13052                 echo "configure: warning: could not find -lwrap" 1>&2
13053                 if test $ol_enable_wrappers = yes ; then
13054                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
13055                 fi
13056
13057                 echo "configure: warning: disabling wrappers support" 1>&2
13058                 ol_enable_wrappers=no
13059                 WRAP_LIBS=""
13060         fi
13061 fi
13062
13063 if test $ol_enable_syslog != no ; then
13064         echo $ac_n "checking for openlog""... $ac_c" 1>&6
13065 echo "configure:13066: checking for openlog" >&5
13066 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
13067   echo $ac_n "(cached) $ac_c" 1>&6
13068 else
13069   cat > conftest.$ac_ext <<EOF
13070 #line 13071 "configure"
13071 #include "confdefs.h"
13072 /* System header to define __stub macros and hopefully few prototypes,
13073     which can conflict with char openlog(); below.  */
13074 #include <assert.h>
13075 /* Override any gcc2 internal prototype to avoid an error.  */
13076 /* We use char because int might match the return type of a gcc2
13077     builtin and then its argument prototype would still apply.  */
13078 char openlog();
13079 char (*f)();
13080
13081 int main() {
13082
13083 /* The GNU C library defines this for functions which it implements
13084     to always fail with ENOSYS.  Some functions are actually named
13085     something starting with __ and the normal name is an alias.  */
13086 #if defined (__stub_openlog) || defined (__stub___openlog)
13087 choke me
13088 #else
13089 f = openlog;
13090 #endif
13091
13092 ; return 0; }
13093 EOF
13094 if { (eval echo configure:13095: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13095   rm -rf conftest*
13096   eval "ac_cv_func_openlog=yes"
13097 else
13098   echo "configure: failed program was:" >&5
13099   cat conftest.$ac_ext >&5
13100   rm -rf conftest*
13101   eval "ac_cv_func_openlog=no"
13102 fi
13103 rm -f conftest*
13104 fi
13105
13106 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
13107   echo "$ac_t""yes" 1>&6
13108   :
13109 else
13110   echo "$ac_t""no" 1>&6
13111 fi
13112
13113         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
13114                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
13115         fi
13116         ol_enable_syslog=$ac_cv_func_openlog
13117 fi
13118
13119 ol_link_sql=no
13120 if test $ol_enable_sql != no ; then
13121         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
13122 echo "configure:13123: checking for SQLDriverConnect in -liodbc" >&5
13123 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13124 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13125   echo $ac_n "(cached) $ac_c" 1>&6
13126 else
13127   ac_save_LIBS="$LIBS"
13128 LIBS="-liodbc  $LIBS"
13129 cat > conftest.$ac_ext <<EOF
13130 #line 13131 "configure"
13131 #include "confdefs.h"
13132 /* Override any gcc2 internal prototype to avoid an error.  */
13133 /* We use char because int might match the return type of a gcc2
13134     builtin and then its argument prototype would still apply.  */
13135 char SQLDriverConnect();
13136
13137 int main() {
13138 SQLDriverConnect()
13139 ; return 0; }
13140 EOF
13141 if { (eval echo configure:13142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13142   rm -rf conftest*
13143   eval "ac_cv_lib_$ac_lib_var=yes"
13144 else
13145   echo "configure: failed program was:" >&5
13146   cat conftest.$ac_ext >&5
13147   rm -rf conftest*
13148   eval "ac_cv_lib_$ac_lib_var=no"
13149 fi
13150 rm -f conftest*
13151 LIBS="$ac_save_LIBS"
13152
13153 fi
13154 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13155   echo "$ac_t""yes" 1>&6
13156   have_iodbc=yes
13157 else
13158   echo "$ac_t""no" 1>&6
13159 have_iodbc=no
13160 fi
13161
13162         if test $have_iodbc = yes ; then
13163                 ol_link_sql="-liodbc"
13164         else
13165                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
13166 echo "configure:13167: checking for SQLDriverConnect in -lodbc" >&5
13167 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13168 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13169   echo $ac_n "(cached) $ac_c" 1>&6
13170 else
13171   ac_save_LIBS="$LIBS"
13172 LIBS="-lodbc  $LIBS"
13173 cat > conftest.$ac_ext <<EOF
13174 #line 13175 "configure"
13175 #include "confdefs.h"
13176 /* Override any gcc2 internal prototype to avoid an error.  */
13177 /* We use char because int might match the return type of a gcc2
13178     builtin and then its argument prototype would still apply.  */
13179 char SQLDriverConnect();
13180
13181 int main() {
13182 SQLDriverConnect()
13183 ; return 0; }
13184 EOF
13185 if { (eval echo configure:13186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13186   rm -rf conftest*
13187   eval "ac_cv_lib_$ac_lib_var=yes"
13188 else
13189   echo "configure: failed program was:" >&5
13190   cat conftest.$ac_ext >&5
13191   rm -rf conftest*
13192   eval "ac_cv_lib_$ac_lib_var=no"
13193 fi
13194 rm -f conftest*
13195 LIBS="$ac_save_LIBS"
13196
13197 fi
13198 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13199   echo "$ac_t""yes" 1>&6
13200   have_odbc=yes
13201 else
13202   echo "$ac_t""no" 1>&6
13203 have_odbc=no
13204 fi
13205
13206                 if test $have_odbc = yes ; then
13207                         ol_link_sql="-lodbc"
13208                 fi
13209         fi
13210
13211         if test $ol_link_sql != no ; then
13212                 SLAPD_SQL_LIBS="$ol_link_sql"
13213
13214         elif test $ol_enable_sql != auto ; then
13215                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
13216         fi
13217 fi
13218
13219 ol_link_termcap=no
13220 for ac_hdr in termcap.h ncurses.h
13221 do
13222 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13223 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13224 echo "configure:13225: checking for $ac_hdr" >&5
13225 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13226   echo $ac_n "(cached) $ac_c" 1>&6
13227 else
13228   cat > conftest.$ac_ext <<EOF
13229 #line 13230 "configure"
13230 #include "confdefs.h"
13231 #include <$ac_hdr>
13232 EOF
13233 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13234 { (eval echo configure:13235: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13235 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13236 if test -z "$ac_err"; then
13237   rm -rf conftest*
13238   eval "ac_cv_header_$ac_safe=yes"
13239 else
13240   echo "$ac_err" >&5
13241   echo "configure: failed program was:" >&5
13242   cat conftest.$ac_ext >&5
13243   rm -rf conftest*
13244   eval "ac_cv_header_$ac_safe=no"
13245 fi
13246 rm -f conftest*
13247 fi
13248 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13249   echo "$ac_t""yes" 1>&6
13250     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13251   cat >> confdefs.h <<EOF
13252 #define $ac_tr_hdr 1
13253 EOF
13254  
13255 else
13256   echo "$ac_t""no" 1>&6
13257 fi
13258 done
13259
13260
13261 if test $ol_link_termcap = no ; then
13262         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
13263 echo "configure:13264: checking for tputs in -ltermcap" >&5
13264 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
13265 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13266   echo $ac_n "(cached) $ac_c" 1>&6
13267 else
13268   ac_save_LIBS="$LIBS"
13269 LIBS="-ltermcap  $LIBS"
13270 cat > conftest.$ac_ext <<EOF
13271 #line 13272 "configure"
13272 #include "confdefs.h"
13273 /* Override any gcc2 internal prototype to avoid an error.  */
13274 /* We use char because int might match the return type of a gcc2
13275     builtin and then its argument prototype would still apply.  */
13276 char tputs();
13277
13278 int main() {
13279 tputs()
13280 ; return 0; }
13281 EOF
13282 if { (eval echo configure:13283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13283   rm -rf conftest*
13284   eval "ac_cv_lib_$ac_lib_var=yes"
13285 else
13286   echo "configure: failed program was:" >&5
13287   cat conftest.$ac_ext >&5
13288   rm -rf conftest*
13289   eval "ac_cv_lib_$ac_lib_var=no"
13290 fi
13291 rm -f conftest*
13292 LIBS="$ac_save_LIBS"
13293
13294 fi
13295 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13296   echo "$ac_t""yes" 1>&6
13297   have_termcap=yes
13298 else
13299   echo "$ac_t""no" 1>&6
13300 have_termcap=no
13301 fi
13302
13303         if test $have_termcap = yes ; then
13304                 cat >> confdefs.h <<\EOF
13305 #define HAVE_TERMCAP 1
13306 EOF
13307
13308                 ol_link_termcap=yes
13309                 TERMCAP_LIBS=-ltermcap
13310         fi
13311 fi
13312
13313 if test $ol_link_termcap = no ; then
13314         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13315 echo "configure:13316: checking for initscr in -lncurses" >&5
13316 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13317 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13318   echo $ac_n "(cached) $ac_c" 1>&6
13319 else
13320   ac_save_LIBS="$LIBS"
13321 LIBS="-lncurses  $LIBS"
13322 cat > conftest.$ac_ext <<EOF
13323 #line 13324 "configure"
13324 #include "confdefs.h"
13325 /* Override any gcc2 internal prototype to avoid an error.  */
13326 /* We use char because int might match the return type of a gcc2
13327     builtin and then its argument prototype would still apply.  */
13328 char initscr();
13329
13330 int main() {
13331 initscr()
13332 ; return 0; }
13333 EOF
13334 if { (eval echo configure:13335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13335   rm -rf conftest*
13336   eval "ac_cv_lib_$ac_lib_var=yes"
13337 else
13338   echo "configure: failed program was:" >&5
13339   cat conftest.$ac_ext >&5
13340   rm -rf conftest*
13341   eval "ac_cv_lib_$ac_lib_var=no"
13342 fi
13343 rm -f conftest*
13344 LIBS="$ac_save_LIBS"
13345
13346 fi
13347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13348   echo "$ac_t""yes" 1>&6
13349   have_ncurses=yes
13350 else
13351   echo "$ac_t""no" 1>&6
13352 have_ncurses=no
13353 fi
13354
13355         if test $have_ncurses = yes ; then
13356                 cat >> confdefs.h <<\EOF
13357 #define HAVE_NCURSES 1
13358 EOF
13359
13360                 ol_link_termcap=yes
13361                 TERMCAP_LIBS=-lncurses
13362         fi
13363 fi
13364
13365 if test $ol_link_termcap = no ; then
13366         cat >> confdefs.h <<\EOF
13367 #define NO_TERMCAP 1
13368 EOF
13369
13370         TERMCAP_LIBS=
13371 fi
13372
13373 ol_link_sasl=no
13374 ol_link_spasswd=no
13375 if test $ol_with_cyrus_sasl != no ; then
13376         for ac_hdr in sasl.h
13377 do
13378 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13379 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13380 echo "configure:13381: checking for $ac_hdr" >&5
13381 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13382   echo $ac_n "(cached) $ac_c" 1>&6
13383 else
13384   cat > conftest.$ac_ext <<EOF
13385 #line 13386 "configure"
13386 #include "confdefs.h"
13387 #include <$ac_hdr>
13388 EOF
13389 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13390 { (eval echo configure:13391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13391 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13392 if test -z "$ac_err"; then
13393   rm -rf conftest*
13394   eval "ac_cv_header_$ac_safe=yes"
13395 else
13396   echo "$ac_err" >&5
13397   echo "configure: failed program was:" >&5
13398   cat conftest.$ac_ext >&5
13399   rm -rf conftest*
13400   eval "ac_cv_header_$ac_safe=no"
13401 fi
13402 rm -f conftest*
13403 fi
13404 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13405   echo "$ac_t""yes" 1>&6
13406     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13407   cat >> confdefs.h <<EOF
13408 #define $ac_tr_hdr 1
13409 EOF
13410  
13411 else
13412   echo "$ac_t""no" 1>&6
13413 fi
13414 done
13415
13416
13417         if test $ac_cv_header_sasl_h = yes ; then
13418                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
13419 echo "configure:13420: checking for sasl_client_init in -lsasl" >&5
13420 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
13421 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13422   echo $ac_n "(cached) $ac_c" 1>&6
13423 else
13424   ac_save_LIBS="$LIBS"
13425 LIBS="-lsasl  $LIBS"
13426 cat > conftest.$ac_ext <<EOF
13427 #line 13428 "configure"
13428 #include "confdefs.h"
13429 /* Override any gcc2 internal prototype to avoid an error.  */
13430 /* We use char because int might match the return type of a gcc2
13431     builtin and then its argument prototype would still apply.  */
13432 char sasl_client_init();
13433
13434 int main() {
13435 sasl_client_init()
13436 ; return 0; }
13437 EOF
13438 if { (eval echo configure:13439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13439   rm -rf conftest*
13440   eval "ac_cv_lib_$ac_lib_var=yes"
13441 else
13442   echo "configure: failed program was:" >&5
13443   cat conftest.$ac_ext >&5
13444   rm -rf conftest*
13445   eval "ac_cv_lib_$ac_lib_var=no"
13446 fi
13447 rm -f conftest*
13448 LIBS="$ac_save_LIBS"
13449
13450 fi
13451 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13452   echo "$ac_t""yes" 1>&6
13453   have_cyrus_sasl=yes
13454 else
13455   echo "$ac_t""no" 1>&6
13456 have_cyrus_sasl=no
13457 fi
13458
13459
13460                 if test $have_cyrus_sasl != no ; then
13461                         SASL_LIBS="-lsasl"
13462                         cat >> confdefs.h <<\EOF
13463 #define HAVE_CYRUS_SASL 1
13464 EOF
13465
13466                         ol_link_sasl=yes
13467                 fi
13468         fi
13469
13470         if test $ol_link_sasl = no ; then
13471                 if test $ol_with_cyrus_sasl != auto ; then
13472                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
13473                 else
13474                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
13475                         echo "configure: warning: SASL authentication not supported!" 1>&2
13476                         if test $ol_link_tls = no ; then
13477                                 echo "configure: warning: Strong authentication not supported!" 1>&2
13478                         fi
13479                 fi
13480
13481         elif test $ol_enable_spasswd != no ; then
13482                 ol_link_spasswd=yes
13483         fi
13484
13485 else
13486         echo "configure: warning: SASL authentication not supported!" 1>&2
13487         if test $ol_link_tls = no ; then
13488                 echo "configure: warning: Strong authentication not supported!" 1>&2
13489         fi
13490 fi
13491
13492 if test $cross_compiling != yes ; then
13493         dev=no
13494         if test -r /dev/urandom ; then
13495                 dev="/dev/urandom";
13496         elif test -r /idev/urandom ; then
13497                 dev="/idev/urandom";
13498         elif test -r /dev/srandom ; then
13499                 dev="/dev/srandom";
13500         elif test -r /dev/random ; then
13501                 dev="/dev/random";
13502         elif test -r /idev/random ; then
13503                 dev="/idev/random";
13504         fi
13505
13506         if test $dev != no ; then
13507                 cat >> confdefs.h <<EOF
13508 #define URANDOM_DEVICE "$dev"
13509 EOF
13510
13511         fi
13512 fi
13513
13514 ol_link_fetch=no
13515 if test $ol_with_fetch != no ; then
13516         ol_LIBS=$LIBS
13517 LIBS="-lfetch -lcom_err $LIBS"
13518 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
13519 echo "configure:13520: checking fetch(3) library" >&5
13520 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
13521   echo $ac_n "(cached) $ac_c" 1>&6
13522 else
13523   
13524         cat > conftest.$ac_ext <<EOF
13525 #line 13526 "configure"
13526 #include "confdefs.h"
13527
13528 #include <sys/param.h>
13529 #include <stdio.h>
13530 #include <fetch.h>
13531 int main() {
13532 struct url *u = fetchParseURL("file:///"); 
13533 ; return 0; }
13534 EOF
13535 if { (eval echo configure:13536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13536   rm -rf conftest*
13537   ol_cv_lib_fetch=yes
13538 else
13539   echo "configure: failed program was:" >&5
13540   cat conftest.$ac_ext >&5
13541   rm -rf conftest*
13542   ol_cv_lib_fetch=no
13543 fi
13544 rm -f conftest*
13545 fi
13546
13547 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
13548 LIBS=$ol_LIBS
13549 if test $ol_cv_lib_fetch != no ; then
13550         ol_link_fetch="-lfetch -lcom_err"
13551         cat >> confdefs.h <<\EOF
13552 #define HAVE_FETCH 1
13553 EOF
13554
13555 fi
13556
13557
13558         if test $ol_cv_lib_fetch != no ; then
13559                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
13560                 ol_link_fetch=freebsd
13561
13562         elif test $ol_with_fetch != auto ; then
13563                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
13564         fi 
13565 fi
13566
13567 ol_link_readline=no
13568 if test $ol_with_readline != no ; then
13569         for ac_hdr in readline/readline.h readline/history.h
13570 do
13571 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13572 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13573 echo "configure:13574: checking for $ac_hdr" >&5
13574 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13575   echo $ac_n "(cached) $ac_c" 1>&6
13576 else
13577   cat > conftest.$ac_ext <<EOF
13578 #line 13579 "configure"
13579 #include "confdefs.h"
13580 #include <$ac_hdr>
13581 EOF
13582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13583 { (eval echo configure:13584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13584 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13585 if test -z "$ac_err"; then
13586   rm -rf conftest*
13587   eval "ac_cv_header_$ac_safe=yes"
13588 else
13589   echo "$ac_err" >&5
13590   echo "configure: failed program was:" >&5
13591   cat conftest.$ac_ext >&5
13592   rm -rf conftest*
13593   eval "ac_cv_header_$ac_safe=no"
13594 fi
13595 rm -f conftest*
13596 fi
13597 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13598   echo "$ac_t""yes" 1>&6
13599     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13600   cat >> confdefs.h <<EOF
13601 #define $ac_tr_hdr 1
13602 EOF
13603  
13604 else
13605   echo "$ac_t""no" 1>&6
13606 fi
13607 done
13608
13609
13610         if test $ac_cv_header_readline_readline_h = yes ; then
13611                 save_LIBS="$LIBS"
13612                 LIBS="$TERMCAP_LIBS $LIBS"
13613                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
13614 echo "configure:13615: checking for readline in -lreadline" >&5
13615 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
13616 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13617   echo $ac_n "(cached) $ac_c" 1>&6
13618 else
13619   ac_save_LIBS="$LIBS"
13620 LIBS="-lreadline  $LIBS"
13621 cat > conftest.$ac_ext <<EOF
13622 #line 13623 "configure"
13623 #include "confdefs.h"
13624 /* Override any gcc2 internal prototype to avoid an error.  */
13625 /* We use char because int might match the return type of a gcc2
13626     builtin and then its argument prototype would still apply.  */
13627 char readline();
13628
13629 int main() {
13630 readline()
13631 ; return 0; }
13632 EOF
13633 if { (eval echo configure:13634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13634   rm -rf conftest*
13635   eval "ac_cv_lib_$ac_lib_var=yes"
13636 else
13637   echo "configure: failed program was:" >&5
13638   cat conftest.$ac_ext >&5
13639   rm -rf conftest*
13640   eval "ac_cv_lib_$ac_lib_var=no"
13641 fi
13642 rm -f conftest*
13643 LIBS="$ac_save_LIBS"
13644
13645 fi
13646 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13647   echo "$ac_t""yes" 1>&6
13648   have_readline=yes
13649 else
13650   echo "$ac_t""no" 1>&6
13651 have_readline=no
13652 fi
13653
13654                 LIBS="$save_LIBS"
13655                         
13656                 if test $have_readline = yes ; then
13657                         ol_with_readline=found
13658                         ol_link_readline=yes
13659
13660                         READLINE_LIBS="-lreadline"
13661                 fi
13662         fi
13663 fi
13664
13665 if test $ol_link_readline = yes ; then
13666         cat >> confdefs.h <<\EOF
13667 #define HAVE_READLINE 1
13668 EOF
13669
13670 fi
13671
13672
13673 if test $ol_enable_crypt != no ; then
13674         echo $ac_n "checking for crypt""... $ac_c" 1>&6
13675 echo "configure:13676: checking for crypt" >&5
13676 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
13677   echo $ac_n "(cached) $ac_c" 1>&6
13678 else
13679   cat > conftest.$ac_ext <<EOF
13680 #line 13681 "configure"
13681 #include "confdefs.h"
13682 /* System header to define __stub macros and hopefully few prototypes,
13683     which can conflict with char crypt(); below.  */
13684 #include <assert.h>
13685 /* Override any gcc2 internal prototype to avoid an error.  */
13686 /* We use char because int might match the return type of a gcc2
13687     builtin and then its argument prototype would still apply.  */
13688 char crypt();
13689 char (*f)();
13690
13691 int main() {
13692
13693 /* The GNU C library defines this for functions which it implements
13694     to always fail with ENOSYS.  Some functions are actually named
13695     something starting with __ and the normal name is an alias.  */
13696 #if defined (__stub_crypt) || defined (__stub___crypt)
13697 choke me
13698 #else
13699 f = crypt;
13700 #endif
13701
13702 ; return 0; }
13703 EOF
13704 if { (eval echo configure:13705: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13705   rm -rf conftest*
13706   eval "ac_cv_func_crypt=yes"
13707 else
13708   echo "configure: failed program was:" >&5
13709   cat conftest.$ac_ext >&5
13710   rm -rf conftest*
13711   eval "ac_cv_func_crypt=no"
13712 fi
13713 rm -f conftest*
13714 fi
13715
13716 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
13717   echo "$ac_t""yes" 1>&6
13718   have_crypt=yes
13719 else
13720   echo "$ac_t""no" 1>&6
13721
13722                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
13723 echo "configure:13724: checking for crypt in -lcrypt" >&5
13724 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
13725 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13726   echo $ac_n "(cached) $ac_c" 1>&6
13727 else
13728   ac_save_LIBS="$LIBS"
13729 LIBS="-lcrypt  $LIBS"
13730 cat > conftest.$ac_ext <<EOF
13731 #line 13732 "configure"
13732 #include "confdefs.h"
13733 /* Override any gcc2 internal prototype to avoid an error.  */
13734 /* We use char because int might match the return type of a gcc2
13735     builtin and then its argument prototype would still apply.  */
13736 char crypt();
13737
13738 int main() {
13739 crypt()
13740 ; return 0; }
13741 EOF
13742 if { (eval echo configure:13743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13743   rm -rf conftest*
13744   eval "ac_cv_lib_$ac_lib_var=yes"
13745 else
13746   echo "configure: failed program was:" >&5
13747   cat conftest.$ac_ext >&5
13748   rm -rf conftest*
13749   eval "ac_cv_lib_$ac_lib_var=no"
13750 fi
13751 rm -f conftest*
13752 LIBS="$ac_save_LIBS"
13753
13754 fi
13755 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13756   echo "$ac_t""yes" 1>&6
13757   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
13758                         have_crypt=yes
13759 else
13760   echo "$ac_t""no" 1>&6
13761 have_crypt=no
13762 fi
13763
13764 fi
13765
13766
13767         if test $have_crypt = yes ; then
13768                 cat >> confdefs.h <<\EOF
13769 #define HAVE_CRYPT 1
13770 EOF
13771
13772         else
13773                 echo "configure: warning: could not find crypt" 1>&2
13774                 if test $ol_enable_crypt = yes ; then
13775                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
13776                 fi
13777
13778                 echo "configure: warning: disabling crypt support" 1>&2
13779                 ol_enable_crypt=no
13780         fi
13781 fi
13782
13783 if test $ol_enable_proctitle != no ; then
13784         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
13785 echo "configure:13786: checking for setproctitle" >&5
13786 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
13787   echo $ac_n "(cached) $ac_c" 1>&6
13788 else
13789   cat > conftest.$ac_ext <<EOF
13790 #line 13791 "configure"
13791 #include "confdefs.h"
13792 /* System header to define __stub macros and hopefully few prototypes,
13793     which can conflict with char setproctitle(); below.  */
13794 #include <assert.h>
13795 /* Override any gcc2 internal prototype to avoid an error.  */
13796 /* We use char because int might match the return type of a gcc2
13797     builtin and then its argument prototype would still apply.  */
13798 char setproctitle();
13799 char (*f)();
13800
13801 int main() {
13802
13803 /* The GNU C library defines this for functions which it implements
13804     to always fail with ENOSYS.  Some functions are actually named
13805     something starting with __ and the normal name is an alias.  */
13806 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
13807 choke me
13808 #else
13809 f = setproctitle;
13810 #endif
13811
13812 ; return 0; }
13813 EOF
13814 if { (eval echo configure:13815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13815   rm -rf conftest*
13816   eval "ac_cv_func_setproctitle=yes"
13817 else
13818   echo "configure: failed program was:" >&5
13819   cat conftest.$ac_ext >&5
13820   rm -rf conftest*
13821   eval "ac_cv_func_setproctitle=no"
13822 fi
13823 rm -f conftest*
13824 fi
13825
13826 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
13827   echo "$ac_t""yes" 1>&6
13828   have_setproctitle=yes
13829 else
13830   echo "$ac_t""no" 1>&6
13831
13832                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
13833 echo "configure:13834: checking for setproctitle in -lutil" >&5
13834 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
13835 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13836   echo $ac_n "(cached) $ac_c" 1>&6
13837 else
13838   ac_save_LIBS="$LIBS"
13839 LIBS="-lutil  $LIBS"
13840 cat > conftest.$ac_ext <<EOF
13841 #line 13842 "configure"
13842 #include "confdefs.h"
13843 /* Override any gcc2 internal prototype to avoid an error.  */
13844 /* We use char because int might match the return type of a gcc2
13845     builtin and then its argument prototype would still apply.  */
13846 char setproctitle();
13847
13848 int main() {
13849 setproctitle()
13850 ; return 0; }
13851 EOF
13852 if { (eval echo configure:13853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13853   rm -rf conftest*
13854   eval "ac_cv_lib_$ac_lib_var=yes"
13855 else
13856   echo "configure: failed program was:" >&5
13857   cat conftest.$ac_ext >&5
13858   rm -rf conftest*
13859   eval "ac_cv_lib_$ac_lib_var=no"
13860 fi
13861 rm -f conftest*
13862 LIBS="$ac_save_LIBS"
13863
13864 fi
13865 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13866   echo "$ac_t""yes" 1>&6
13867   have_setproctitle=yes
13868                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
13869 else
13870   echo "$ac_t""no" 1>&6
13871 have_setproctitle=no
13872                         LIBOBJS="$LIBOBJS setproctitle.o"
13873                         LIBSRCS="$LIBSRCS setproctitle.c"
13874 fi
13875
13876 fi
13877
13878
13879         if test $have_setproctitle = yes ; then
13880                 cat >> confdefs.h <<\EOF
13881 #define HAVE_SETPROCTITLE 1
13882 EOF
13883
13884         fi
13885 fi
13886
13887 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
13888 echo "configure:13889: checking for ANSI C header files" >&5
13889 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
13890   echo $ac_n "(cached) $ac_c" 1>&6
13891 else
13892   cat > conftest.$ac_ext <<EOF
13893 #line 13894 "configure"
13894 #include "confdefs.h"
13895 #include <stdlib.h>
13896 #include <stdarg.h>
13897 #include <string.h>
13898 #include <float.h>
13899 EOF
13900 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13901 { (eval echo configure:13902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13902 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13903 if test -z "$ac_err"; then
13904   rm -rf conftest*
13905   ac_cv_header_stdc=yes
13906 else
13907   echo "$ac_err" >&5
13908   echo "configure: failed program was:" >&5
13909   cat conftest.$ac_ext >&5
13910   rm -rf conftest*
13911   ac_cv_header_stdc=no
13912 fi
13913 rm -f conftest*
13914
13915 if test $ac_cv_header_stdc = yes; then
13916   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13917 cat > conftest.$ac_ext <<EOF
13918 #line 13919 "configure"
13919 #include "confdefs.h"
13920 #include <string.h>
13921 EOF
13922 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13923   egrep "memchr" >/dev/null 2>&1; then
13924   :
13925 else
13926   rm -rf conftest*
13927   ac_cv_header_stdc=no
13928 fi
13929 rm -f conftest*
13930
13931 fi
13932
13933 if test $ac_cv_header_stdc = yes; then
13934   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13935 cat > conftest.$ac_ext <<EOF
13936 #line 13937 "configure"
13937 #include "confdefs.h"
13938 #include <stdlib.h>
13939 EOF
13940 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13941   egrep "free" >/dev/null 2>&1; then
13942   :
13943 else
13944   rm -rf conftest*
13945   ac_cv_header_stdc=no
13946 fi
13947 rm -f conftest*
13948
13949 fi
13950
13951 if test $ac_cv_header_stdc = yes; then
13952   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13953 if test "$cross_compiling" = yes; then
13954   :
13955 else
13956   cat > conftest.$ac_ext <<EOF
13957 #line 13958 "configure"
13958 #include "confdefs.h"
13959 #include <ctype.h>
13960 #if ((' ' & 0x0FF) == 0x020)
13961 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13962 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13963 #else
13964 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13965  || ('j' <= (c) && (c) <= 'r') \
13966  || ('s' <= (c) && (c) <= 'z'))
13967 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13968 #endif
13969 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13970 int main () { int i; for (i = 0; i < 256; i++)
13971 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
13972 exit (0); }
13973
13974 EOF
13975 if { (eval echo configure:13976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13976 then
13977   :
13978 else
13979   echo "configure: failed program was:" >&5
13980   cat conftest.$ac_ext >&5
13981   rm -fr conftest*
13982   ac_cv_header_stdc=no
13983 fi
13984 rm -fr conftest*
13985 fi
13986
13987 fi
13988 fi
13989
13990 echo "$ac_t""$ac_cv_header_stdc" 1>&6
13991 if test $ac_cv_header_stdc = yes; then
13992   cat >> confdefs.h <<\EOF
13993 #define STDC_HEADERS 1
13994 EOF
13995
13996 fi
13997
13998 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
13999 echo "configure:14000: checking for mode_t" >&5
14000 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
14001   echo $ac_n "(cached) $ac_c" 1>&6
14002 else
14003   cat > conftest.$ac_ext <<EOF
14004 #line 14005 "configure"
14005 #include "confdefs.h"
14006 #include <sys/types.h>
14007 #if STDC_HEADERS
14008 #include <stdlib.h>
14009 #include <stddef.h>
14010 #endif
14011
14012 EOF
14013 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14014   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14015   rm -rf conftest*
14016   eval "ac_cv_type_mode_t=yes"
14017 else
14018   rm -rf conftest*
14019   eval "ac_cv_type_mode_t=no"
14020 fi
14021 rm -f conftest*
14022
14023 fi
14024 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
14025   echo "$ac_t""yes" 1>&6
14026 else
14027   echo "$ac_t""no" 1>&6
14028   cat >> confdefs.h <<EOF
14029 #define mode_t int
14030 EOF
14031
14032 fi
14033
14034 echo $ac_n "checking for off_t""... $ac_c" 1>&6
14035 echo "configure:14036: checking for off_t" >&5
14036 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
14037   echo $ac_n "(cached) $ac_c" 1>&6
14038 else
14039   cat > conftest.$ac_ext <<EOF
14040 #line 14041 "configure"
14041 #include "confdefs.h"
14042 #include <sys/types.h>
14043 #if STDC_HEADERS
14044 #include <stdlib.h>
14045 #include <stddef.h>
14046 #endif
14047
14048 EOF
14049 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14050   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14051   rm -rf conftest*
14052   eval "ac_cv_type_off_t=yes"
14053 else
14054   rm -rf conftest*
14055   eval "ac_cv_type_off_t=no"
14056 fi
14057 rm -f conftest*
14058
14059 fi
14060 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
14061   echo "$ac_t""yes" 1>&6
14062 else
14063   echo "$ac_t""no" 1>&6
14064   cat >> confdefs.h <<EOF
14065 #define off_t long
14066 EOF
14067
14068 fi
14069
14070 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
14071 echo "configure:14072: checking for pid_t" >&5
14072 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
14073   echo $ac_n "(cached) $ac_c" 1>&6
14074 else
14075   cat > conftest.$ac_ext <<EOF
14076 #line 14077 "configure"
14077 #include "confdefs.h"
14078 #include <sys/types.h>
14079 #if STDC_HEADERS
14080 #include <stdlib.h>
14081 #include <stddef.h>
14082 #endif
14083
14084 EOF
14085 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14086   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14087   rm -rf conftest*
14088   eval "ac_cv_type_pid_t=yes"
14089 else
14090   rm -rf conftest*
14091   eval "ac_cv_type_pid_t=no"
14092 fi
14093 rm -f conftest*
14094
14095 fi
14096 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
14097   echo "$ac_t""yes" 1>&6
14098 else
14099   echo "$ac_t""no" 1>&6
14100   cat >> confdefs.h <<EOF
14101 #define pid_t int
14102 EOF
14103
14104 fi
14105
14106 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
14107 echo "configure:14108: checking for ptrdiff_t" >&5
14108 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
14109   echo $ac_n "(cached) $ac_c" 1>&6
14110 else
14111   cat > conftest.$ac_ext <<EOF
14112 #line 14113 "configure"
14113 #include "confdefs.h"
14114 #include <stddef.h>
14115 int main() {
14116 ptrdiff_t p
14117 ; return 0; }
14118 EOF
14119 if { (eval echo configure:14120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14120   rm -rf conftest*
14121   am_cv_type_ptrdiff_t=yes
14122 else
14123   echo "configure: failed program was:" >&5
14124   cat conftest.$ac_ext >&5
14125   rm -rf conftest*
14126   am_cv_type_ptrdiff_t=no
14127 fi
14128 rm -f conftest*
14129 fi
14130
14131 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
14132    if test $am_cv_type_ptrdiff_t = yes; then
14133      cat >> confdefs.h <<\EOF
14134 #define HAVE_PTRDIFF_T 1
14135 EOF
14136
14137    fi
14138
14139 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
14140 echo "configure:14141: checking return type of signal handlers" >&5
14141 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
14142   echo $ac_n "(cached) $ac_c" 1>&6
14143 else
14144   cat > conftest.$ac_ext <<EOF
14145 #line 14146 "configure"
14146 #include "confdefs.h"
14147 #include <sys/types.h>
14148 #include <signal.h>
14149 #ifdef signal
14150 #undef signal
14151 #endif
14152 #ifdef __cplusplus
14153 extern "C" void (*signal (int, void (*)(int)))(int);
14154 #else
14155 void (*signal ()) ();
14156 #endif
14157
14158 int main() {
14159 int i;
14160 ; return 0; }
14161 EOF
14162 if { (eval echo configure:14163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14163   rm -rf conftest*
14164   ac_cv_type_signal=void
14165 else
14166   echo "configure: failed program was:" >&5
14167   cat conftest.$ac_ext >&5
14168   rm -rf conftest*
14169   ac_cv_type_signal=int
14170 fi
14171 rm -f conftest*
14172 fi
14173
14174 echo "$ac_t""$ac_cv_type_signal" 1>&6
14175 cat >> confdefs.h <<EOF
14176 #define RETSIGTYPE $ac_cv_type_signal
14177 EOF
14178
14179
14180 echo $ac_n "checking for size_t""... $ac_c" 1>&6
14181 echo "configure:14182: checking for size_t" >&5
14182 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
14183   echo $ac_n "(cached) $ac_c" 1>&6
14184 else
14185   cat > conftest.$ac_ext <<EOF
14186 #line 14187 "configure"
14187 #include "confdefs.h"
14188 #include <sys/types.h>
14189 #if STDC_HEADERS
14190 #include <stdlib.h>
14191 #include <stddef.h>
14192 #endif
14193
14194 EOF
14195 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14196   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14197   rm -rf conftest*
14198   eval "ac_cv_type_size_t=yes"
14199 else
14200   rm -rf conftest*
14201   eval "ac_cv_type_size_t=no"
14202 fi
14203 rm -f conftest*
14204
14205 fi
14206 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
14207   echo "$ac_t""yes" 1>&6
14208 else
14209   echo "$ac_t""no" 1>&6
14210   cat >> confdefs.h <<EOF
14211 #define size_t unsigned
14212 EOF
14213
14214 fi
14215
14216
14217 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
14218 echo "configure:14219: checking for ssize_t" >&5
14219 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
14220   echo $ac_n "(cached) $ac_c" 1>&6
14221 else
14222   cat > conftest.$ac_ext <<EOF
14223 #line 14224 "configure"
14224 #include "confdefs.h"
14225 #include <sys/types.h>
14226 #if STDC_HEADERS
14227 #include <stdlib.h>
14228 #include <stddef.h>
14229 #endif
14230
14231 EOF
14232 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14233   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14234   rm -rf conftest*
14235   eval "ac_cv_type_ssize_t=yes"
14236 else
14237   rm -rf conftest*
14238   eval "ac_cv_type_ssize_t=no"
14239 fi
14240 rm -f conftest*
14241
14242 fi
14243 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
14244   echo "$ac_t""yes" 1>&6
14245 else
14246   echo "$ac_t""no" 1>&6
14247   cat >> confdefs.h <<EOF
14248 #define ssize_t signed int
14249 EOF
14250
14251 fi
14252
14253 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
14254 echo "configure:14255: checking for caddr_t" >&5
14255 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
14256   echo $ac_n "(cached) $ac_c" 1>&6
14257 else
14258   cat > conftest.$ac_ext <<EOF
14259 #line 14260 "configure"
14260 #include "confdefs.h"
14261 #include <sys/types.h>
14262 #if STDC_HEADERS
14263 #include <stdlib.h>
14264 #include <stddef.h>
14265 #endif
14266
14267 EOF
14268 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14269   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14270   rm -rf conftest*
14271   eval "ac_cv_type_caddr_t=yes"
14272 else
14273   rm -rf conftest*
14274   eval "ac_cv_type_caddr_t=no"
14275 fi
14276 rm -f conftest*
14277
14278 fi
14279 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
14280   echo "$ac_t""yes" 1>&6
14281 else
14282   echo "$ac_t""no" 1>&6
14283   cat >> confdefs.h <<EOF
14284 #define caddr_t char *
14285 EOF
14286
14287 fi
14288
14289
14290 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
14291 echo "configure:14292: checking for socklen_t" >&5
14292 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
14293   echo $ac_n "(cached) $ac_c" 1>&6
14294 else
14295   cat > conftest.$ac_ext <<EOF
14296 #line 14297 "configure"
14297 #include "confdefs.h"
14298
14299 #ifdef HAVE_SYS_TYPES_H
14300 #include <sys/types.h>
14301 #endif
14302 #ifdef HAVE_SYS_SOCKET_H
14303 #include <sys/socket.h>
14304 #endif
14305
14306 int main() {
14307 socklen_t len;
14308 ; return 0; }
14309 EOF
14310 if { (eval echo configure:14311: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14311   rm -rf conftest*
14312   ol_cv_type_socklen_t=yes
14313 else
14314   echo "configure: failed program was:" >&5
14315   cat conftest.$ac_ext >&5
14316   rm -rf conftest*
14317   ol_cv_type_socklen_t=no
14318 fi
14319 rm -f conftest*
14320 fi
14321
14322 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
14323   if test $ol_cv_type_socklen_t = no; then
14324     cat >> confdefs.h <<\EOF
14325 #define socklen_t int
14326 EOF
14327
14328   fi
14329  
14330 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
14331 echo "configure:14332: checking for member st_blksize in aggregate type struct stat" >&5
14332 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
14333   echo $ac_n "(cached) $ac_c" 1>&6
14334 else
14335   cat > conftest.$ac_ext <<EOF
14336 #line 14337 "configure"
14337 #include "confdefs.h"
14338 #include <sys/types.h>
14339 #include <sys/stat.h>
14340 int main() {
14341 struct stat foo; foo.st_blksize;
14342 ; return 0; }
14343 EOF
14344 if { (eval echo configure:14345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14345   rm -rf conftest*
14346   ac_cv_c_struct_member_st_blksize=yes
14347 else
14348   echo "configure: failed program was:" >&5
14349   cat conftest.$ac_ext >&5
14350   rm -rf conftest*
14351   ac_cv_c_struct_member_st_blksize=no
14352 fi
14353 rm -f conftest*
14354 fi
14355
14356 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
14357 st_blksize="$ac_cv_c_struct_member_st_blksize"
14358 if test $ac_cv_c_struct_member_st_blksize = yes; then
14359   cat >> confdefs.h <<\EOF
14360 #define HAVE_ST_BLKSIZE 1
14361 EOF
14362
14363 fi
14364
14365 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
14366 echo "configure:14367: checking whether time.h and sys/time.h may both be included" >&5
14367 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
14368   echo $ac_n "(cached) $ac_c" 1>&6
14369 else
14370   cat > conftest.$ac_ext <<EOF
14371 #line 14372 "configure"
14372 #include "confdefs.h"
14373 #include <sys/types.h>
14374 #include <sys/time.h>
14375 #include <time.h>
14376 int main() {
14377 struct tm *tp;
14378 ; return 0; }
14379 EOF
14380 if { (eval echo configure:14381: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14381   rm -rf conftest*
14382   ac_cv_header_time=yes
14383 else
14384   echo "configure: failed program was:" >&5
14385   cat conftest.$ac_ext >&5
14386   rm -rf conftest*
14387   ac_cv_header_time=no
14388 fi
14389 rm -f conftest*
14390 fi
14391
14392 echo "$ac_t""$ac_cv_header_time" 1>&6
14393 if test $ac_cv_header_time = yes; then
14394   cat >> confdefs.h <<\EOF
14395 #define TIME_WITH_SYS_TIME 1
14396 EOF
14397
14398 fi
14399
14400 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
14401 echo "configure:14402: checking whether struct tm is in sys/time.h or time.h" >&5
14402 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
14403   echo $ac_n "(cached) $ac_c" 1>&6
14404 else
14405   cat > conftest.$ac_ext <<EOF
14406 #line 14407 "configure"
14407 #include "confdefs.h"
14408 #include <sys/types.h>
14409 #include <time.h>
14410 int main() {
14411 struct tm *tp; tp->tm_sec;
14412 ; return 0; }
14413 EOF
14414 if { (eval echo configure:14415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14415   rm -rf conftest*
14416   ac_cv_struct_tm=time.h
14417 else
14418   echo "configure: failed program was:" >&5
14419   cat conftest.$ac_ext >&5
14420   rm -rf conftest*
14421   ac_cv_struct_tm=sys/time.h
14422 fi
14423 rm -f conftest*
14424 fi
14425
14426 echo "$ac_t""$ac_cv_struct_tm" 1>&6
14427 if test $ac_cv_struct_tm = sys/time.h; then
14428   cat >> confdefs.h <<\EOF
14429 #define TM_IN_SYS_TIME 1
14430 EOF
14431
14432 fi
14433
14434 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
14435 echo "configure:14436: checking for uid_t in sys/types.h" >&5
14436 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
14437   echo $ac_n "(cached) $ac_c" 1>&6
14438 else
14439   cat > conftest.$ac_ext <<EOF
14440 #line 14441 "configure"
14441 #include "confdefs.h"
14442 #include <sys/types.h>
14443 EOF
14444 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14445   egrep "uid_t" >/dev/null 2>&1; then
14446   rm -rf conftest*
14447   ac_cv_type_uid_t=yes
14448 else
14449   rm -rf conftest*
14450   ac_cv_type_uid_t=no
14451 fi
14452 rm -f conftest*
14453
14454 fi
14455
14456 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
14457 if test $ac_cv_type_uid_t = no; then
14458   cat >> confdefs.h <<\EOF
14459 #define uid_t int
14460 EOF
14461
14462   cat >> confdefs.h <<\EOF
14463 #define gid_t int
14464 EOF
14465
14466 fi
14467
14468 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
14469 echo "configure:14470: checking for sig_atomic_t" >&5
14470 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
14471   echo $ac_n "(cached) $ac_c" 1>&6
14472 else
14473   cat > conftest.$ac_ext <<EOF
14474 #line 14475 "configure"
14475 #include "confdefs.h"
14476 #include <signal.h>
14477 int main() {
14478 sig_atomic_t atomic;
14479 ; return 0; }
14480 EOF
14481 if { (eval echo configure:14482: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14482   rm -rf conftest*
14483   ol_cv_type_sig_atomic_t=yes
14484 else
14485   echo "configure: failed program was:" >&5
14486   cat conftest.$ac_ext >&5
14487   rm -rf conftest*
14488   ol_cv_type_sig_atomic_t=no
14489 fi
14490 rm -f conftest*
14491 fi
14492
14493 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
14494   if test $ol_cv_type_sig_atomic_t = no; then
14495     cat >> confdefs.h <<\EOF
14496 #define sig_atomic_t int
14497 EOF
14498
14499   fi
14500  
14501
14502
14503 # test for pw_gecos in struct passwd
14504 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
14505 echo "configure:14506: checking struct passwd for pw_gecos" >&5
14506 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
14507   echo $ac_n "(cached) $ac_c" 1>&6
14508 else
14509   
14510         cat > conftest.$ac_ext <<EOF
14511 #line 14512 "configure"
14512 #include "confdefs.h"
14513 #include <pwd.h>
14514 int main() {
14515
14516         struct passwd pwd;
14517         pwd.pw_gecos = pwd.pw_name;
14518
14519 ; return 0; }
14520 EOF
14521 if { (eval echo configure:14522: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14522   rm -rf conftest*
14523   ol_cv_struct_passwd_pw_gecos=yes
14524 else
14525   echo "configure: failed program was:" >&5
14526   cat conftest.$ac_ext >&5
14527   rm -rf conftest*
14528   ol_cv_struct_passwd_pw_gecos=no
14529 fi
14530 rm -f conftest*
14531 fi
14532
14533 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
14534 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
14535         cat >> confdefs.h <<\EOF
14536 #define HAVE_PW_GECOS 1
14537 EOF
14538
14539 fi
14540
14541 # test for pw_passwd in struct passwd
14542 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
14543 echo "configure:14544: checking struct passwd for pw_passwd" >&5
14544 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
14545   echo $ac_n "(cached) $ac_c" 1>&6
14546 else
14547   
14548         cat > conftest.$ac_ext <<EOF
14549 #line 14550 "configure"
14550 #include "confdefs.h"
14551 #include <pwd.h>
14552 int main() {
14553
14554         struct passwd pwd;
14555         pwd.pw_passwd = pwd.pw_name;
14556
14557 ; return 0; }
14558 EOF
14559 if { (eval echo configure:14560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14560   rm -rf conftest*
14561   ol_cv_struct_passwd_pw_passwd=yes
14562 else
14563   echo "configure: failed program was:" >&5
14564   cat conftest.$ac_ext >&5
14565   rm -rf conftest*
14566   ol_cv_struct_passwd_pw_passwd=no
14567 fi
14568 rm -f conftest*
14569 fi
14570
14571 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
14572 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
14573         cat >> confdefs.h <<\EOF
14574 #define HAVE_PW_PASSWD 1
14575 EOF
14576
14577 fi
14578
14579
14580 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
14581 echo "configure:14582: checking if toupper() requires islower()" >&5
14582 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
14583   echo $ac_n "(cached) $ac_c" 1>&6
14584 else
14585   
14586         if test "$cross_compiling" = yes; then
14587   ol_cv_c_upper_lower=safe
14588 else
14589   cat > conftest.$ac_ext <<EOF
14590 #line 14591 "configure"
14591 #include "confdefs.h"
14592
14593 #include <ctype.h>
14594 main()
14595 {
14596         if ('C' == toupper('C'))
14597                 exit(0);
14598         else
14599                 exit(1);
14600 }
14601 EOF
14602 if { (eval echo configure:14603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14603 then
14604   ol_cv_c_upper_lower=no
14605 else
14606   echo "configure: failed program was:" >&5
14607   cat conftest.$ac_ext >&5
14608   rm -fr conftest*
14609   ol_cv_c_upper_lower=yes
14610 fi
14611 rm -fr conftest*
14612 fi
14613
14614 fi
14615
14616 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
14617 if test $ol_cv_c_upper_lower != no ; then
14618         cat >> confdefs.h <<\EOF
14619 #define C_UPPER_LOWER 1
14620 EOF
14621
14622 fi
14623
14624 echo $ac_n "checking for working const""... $ac_c" 1>&6
14625 echo "configure:14626: checking for working const" >&5
14626 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
14627   echo $ac_n "(cached) $ac_c" 1>&6
14628 else
14629   cat > conftest.$ac_ext <<EOF
14630 #line 14631 "configure"
14631 #include "confdefs.h"
14632
14633 int main() {
14634
14635 /* Ultrix mips cc rejects this.  */
14636 typedef int charset[2]; const charset x;
14637 /* SunOS 4.1.1 cc rejects this.  */
14638 char const *const *ccp;
14639 char **p;
14640 /* NEC SVR4.0.2 mips cc rejects this.  */
14641 struct point {int x, y;};
14642 static struct point const zero = {0,0};
14643 /* AIX XL C 1.02.0.0 rejects this.
14644    It does not let you subtract one const X* pointer from another in an arm
14645    of an if-expression whose if-part is not a constant expression */
14646 const char *g = "string";
14647 ccp = &g + (g ? g-g : 0);
14648 /* HPUX 7.0 cc rejects these. */
14649 ++ccp;
14650 p = (char**) ccp;
14651 ccp = (char const *const *) p;
14652 { /* SCO 3.2v4 cc rejects this.  */
14653   char *t;
14654   char const *s = 0 ? (char *) 0 : (char const *) 0;
14655
14656   *t++ = 0;
14657 }
14658 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14659   int x[] = {25, 17};
14660   const int *foo = &x[0];
14661   ++foo;
14662 }
14663 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14664   typedef const int *iptr;
14665   iptr p = 0;
14666   ++p;
14667 }
14668 { /* AIX XL C 1.02.0.0 rejects this saying
14669      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14670   struct s { int j; const int *ap[3]; };
14671   struct s *b; b->j = 5;
14672 }
14673 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14674   const int foo = 10;
14675 }
14676
14677 ; return 0; }
14678 EOF
14679 if { (eval echo configure:14680: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14680   rm -rf conftest*
14681   ac_cv_c_const=yes
14682 else
14683   echo "configure: failed program was:" >&5
14684   cat conftest.$ac_ext >&5
14685   rm -rf conftest*
14686   ac_cv_c_const=no
14687 fi
14688 rm -f conftest*
14689 fi
14690
14691 echo "$ac_t""$ac_cv_c_const" 1>&6
14692 if test $ac_cv_c_const = no; then
14693   cat >> confdefs.h <<\EOF
14694 #define const 
14695 EOF
14696
14697 fi
14698
14699 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
14700 echo "configure:14701: checking if compiler understands volatile" >&5
14701 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
14702   echo $ac_n "(cached) $ac_c" 1>&6
14703 else
14704   cat > conftest.$ac_ext <<EOF
14705 #line 14706 "configure"
14706 #include "confdefs.h"
14707 int x, y, z;
14708 int main() {
14709 volatile int a; int * volatile b = x ? &y : &z;
14710       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
14711       *b = 0;
14712 ; return 0; }
14713 EOF
14714 if { (eval echo configure:14715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14715   rm -rf conftest*
14716   ol_cv_c_volatile=yes
14717 else
14718   echo "configure: failed program was:" >&5
14719   cat conftest.$ac_ext >&5
14720   rm -rf conftest*
14721   ol_cv_c_volatile=no
14722 fi
14723 rm -f conftest*
14724 fi
14725
14726 echo "$ac_t""$ol_cv_c_volatile" 1>&6
14727   if test $ol_cv_c_volatile = yes; then
14728     : 
14729   else
14730     cat >> confdefs.h <<\EOF
14731 #define volatile 
14732 EOF
14733
14734   fi
14735  
14736
14737 if test $cross_compiling = yes ; then
14738         cat >> confdefs.h <<\EOF
14739 #define CROSS_COMPILING 1
14740 EOF
14741
14742 else
14743         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
14744 echo "configure:14745: checking whether byte ordering is bigendian" >&5
14745 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
14746   echo $ac_n "(cached) $ac_c" 1>&6
14747 else
14748   ac_cv_c_bigendian=unknown
14749 # See if sys/param.h defines the BYTE_ORDER macro.
14750 cat > conftest.$ac_ext <<EOF
14751 #line 14752 "configure"
14752 #include "confdefs.h"
14753 #include <sys/types.h>
14754 #include <sys/param.h>
14755 int main() {
14756
14757 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
14758  bogus endian macros
14759 #endif
14760 ; return 0; }
14761 EOF
14762 if { (eval echo configure:14763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14763   rm -rf conftest*
14764   # It does; now see whether it defined to BIG_ENDIAN or not.
14765 cat > conftest.$ac_ext <<EOF
14766 #line 14767 "configure"
14767 #include "confdefs.h"
14768 #include <sys/types.h>
14769 #include <sys/param.h>
14770 int main() {
14771
14772 #if BYTE_ORDER != BIG_ENDIAN
14773  not big endian
14774 #endif
14775 ; return 0; }
14776 EOF
14777 if { (eval echo configure:14778: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14778   rm -rf conftest*
14779   ac_cv_c_bigendian=yes
14780 else
14781   echo "configure: failed program was:" >&5
14782   cat conftest.$ac_ext >&5
14783   rm -rf conftest*
14784   ac_cv_c_bigendian=no
14785 fi
14786 rm -f conftest*
14787 else
14788   echo "configure: failed program was:" >&5
14789   cat conftest.$ac_ext >&5
14790 fi
14791 rm -f conftest*
14792 if test $ac_cv_c_bigendian = unknown; then
14793 if test "$cross_compiling" = yes; then
14794     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
14795 else
14796   cat > conftest.$ac_ext <<EOF
14797 #line 14798 "configure"
14798 #include "confdefs.h"
14799 main () {
14800   /* Are we little or big endian?  From Harbison&Steele.  */
14801   union
14802   {
14803     long l;
14804     char c[sizeof (long)];
14805   } u;
14806   u.l = 1;
14807   exit (u.c[sizeof (long) - 1] == 1);
14808 }
14809 EOF
14810 if { (eval echo configure:14811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14811 then
14812   ac_cv_c_bigendian=no
14813 else
14814   echo "configure: failed program was:" >&5
14815   cat conftest.$ac_ext >&5
14816   rm -fr conftest*
14817   ac_cv_c_bigendian=yes
14818 fi
14819 rm -fr conftest*
14820 fi
14821
14822 fi
14823 fi
14824
14825 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
14826 if test $ac_cv_c_bigendian = yes; then
14827   cat >> confdefs.h <<\EOF
14828 #define WORDS_BIGENDIAN 1
14829 EOF
14830
14831 fi
14832
14833 fi
14834
14835 echo $ac_n "checking size of short""... $ac_c" 1>&6
14836 echo "configure:14837: checking size of short" >&5 
14837 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
14838   echo $ac_n "(cached) $ac_c" 1>&6
14839 else
14840   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14841   cat > conftest.$ac_ext <<EOF
14842 #line 14843 "configure"
14843 #include "confdefs.h"
14844 #include "confdefs.h" 
14845 #include <sys/types.h> 
14846  
14847
14848 int main() {
14849 switch (0) case 0: case (sizeof (short) == $ac_size):;
14850 ; return 0; }
14851 EOF
14852 if { (eval echo configure:14853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14853   rm -rf conftest*
14854   ac_cv_sizeof_short=$ac_size
14855 else
14856   echo "configure: failed program was:" >&5
14857   cat conftest.$ac_ext >&5
14858 fi
14859 rm -f conftest* 
14860   if test x$ac_cv_sizeof_short != x ; then break; fi 
14861 done 
14862
14863 fi
14864  
14865 if test x$ac_cv_sizeof_short = x ; then 
14866   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
14867 fi 
14868 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
14869 cat >> confdefs.h <<EOF
14870 #define SIZEOF_SHORT $ac_cv_sizeof_short
14871 EOF
14872  
14873  
14874 echo $ac_n "checking size of int""... $ac_c" 1>&6
14875 echo "configure:14876: checking size of int" >&5 
14876 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
14877   echo $ac_n "(cached) $ac_c" 1>&6
14878 else
14879   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14880   cat > conftest.$ac_ext <<EOF
14881 #line 14882 "configure"
14882 #include "confdefs.h"
14883 #include "confdefs.h" 
14884 #include <sys/types.h> 
14885  
14886
14887 int main() {
14888 switch (0) case 0: case (sizeof (int) == $ac_size):;
14889 ; return 0; }
14890 EOF
14891 if { (eval echo configure:14892: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14892   rm -rf conftest*
14893   ac_cv_sizeof_int=$ac_size
14894 else
14895   echo "configure: failed program was:" >&5
14896   cat conftest.$ac_ext >&5
14897 fi
14898 rm -f conftest* 
14899   if test x$ac_cv_sizeof_int != x ; then break; fi 
14900 done 
14901
14902 fi
14903  
14904 if test x$ac_cv_sizeof_int = x ; then 
14905   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
14906 fi 
14907 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
14908 cat >> confdefs.h <<EOF
14909 #define SIZEOF_INT $ac_cv_sizeof_int
14910 EOF
14911  
14912  
14913 echo $ac_n "checking size of long""... $ac_c" 1>&6
14914 echo "configure:14915: checking size of long" >&5 
14915 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
14916   echo $ac_n "(cached) $ac_c" 1>&6
14917 else
14918   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14919   cat > conftest.$ac_ext <<EOF
14920 #line 14921 "configure"
14921 #include "confdefs.h"
14922 #include "confdefs.h" 
14923 #include <sys/types.h> 
14924  
14925
14926 int main() {
14927 switch (0) case 0: case (sizeof (long) == $ac_size):;
14928 ; return 0; }
14929 EOF
14930 if { (eval echo configure:14931: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14931   rm -rf conftest*
14932   ac_cv_sizeof_long=$ac_size
14933 else
14934   echo "configure: failed program was:" >&5
14935   cat conftest.$ac_ext >&5
14936 fi
14937 rm -f conftest* 
14938   if test x$ac_cv_sizeof_long != x ; then break; fi 
14939 done 
14940
14941 fi
14942  
14943 if test x$ac_cv_sizeof_long = x ; then 
14944   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
14945 fi 
14946 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
14947 cat >> confdefs.h <<EOF
14948 #define SIZEOF_LONG $ac_cv_sizeof_long
14949 EOF
14950  
14951
14952
14953 if test "$ac_cv_sizeof_int" -lt 4 ; then
14954         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
14955
14956         cat >> confdefs.h <<\EOF
14957 #define LBER_INT_T long
14958 EOF
14959
14960 else
14961         cat >> confdefs.h <<\EOF
14962 #define LBER_INT_T int
14963 EOF
14964
14965 fi
14966
14967 cat >> confdefs.h <<\EOF
14968 #define LBER_LEN_T long
14969 EOF
14970
14971 cat >> confdefs.h <<\EOF
14972 #define LBER_SOCKET_T int
14973 EOF
14974
14975 cat >> confdefs.h <<\EOF
14976 #define LBER_TAG_T long
14977 EOF
14978
14979
14980 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
14981 echo "configure:14982: checking for 8-bit clean memcmp" >&5
14982 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
14983   echo $ac_n "(cached) $ac_c" 1>&6
14984 else
14985   if test "$cross_compiling" = yes; then
14986   ac_cv_func_memcmp_clean=no
14987 else
14988   cat > conftest.$ac_ext <<EOF
14989 #line 14990 "configure"
14990 #include "confdefs.h"
14991
14992 main()
14993 {
14994   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
14995   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
14996 }
14997
14998 EOF
14999 if { (eval echo configure:15000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
15000 then
15001   ac_cv_func_memcmp_clean=yes
15002 else
15003   echo "configure: failed program was:" >&5
15004   cat conftest.$ac_ext >&5
15005   rm -fr conftest*
15006   ac_cv_func_memcmp_clean=no
15007 fi
15008 rm -fr conftest*
15009 fi
15010
15011 fi
15012
15013 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
15014 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
15015
15016 echo $ac_n "checking for strftime""... $ac_c" 1>&6
15017 echo "configure:15018: checking for strftime" >&5
15018 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
15019   echo $ac_n "(cached) $ac_c" 1>&6
15020 else
15021   cat > conftest.$ac_ext <<EOF
15022 #line 15023 "configure"
15023 #include "confdefs.h"
15024 /* System header to define __stub macros and hopefully few prototypes,
15025     which can conflict with char strftime(); below.  */
15026 #include <assert.h>
15027 /* Override any gcc2 internal prototype to avoid an error.  */
15028 /* We use char because int might match the return type of a gcc2
15029     builtin and then its argument prototype would still apply.  */
15030 char strftime();
15031 char (*f)();
15032
15033 int main() {
15034
15035 /* The GNU C library defines this for functions which it implements
15036     to always fail with ENOSYS.  Some functions are actually named
15037     something starting with __ and the normal name is an alias.  */
15038 #if defined (__stub_strftime) || defined (__stub___strftime)
15039 choke me
15040 #else
15041 f = strftime;
15042 #endif
15043
15044 ; return 0; }
15045 EOF
15046 if { (eval echo configure:15047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15047   rm -rf conftest*
15048   eval "ac_cv_func_strftime=yes"
15049 else
15050   echo "configure: failed program was:" >&5
15051   cat conftest.$ac_ext >&5
15052   rm -rf conftest*
15053   eval "ac_cv_func_strftime=no"
15054 fi
15055 rm -f conftest*
15056 fi
15057
15058 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
15059   echo "$ac_t""yes" 1>&6
15060   cat >> confdefs.h <<\EOF
15061 #define HAVE_STRFTIME 1
15062 EOF
15063
15064 else
15065   echo "$ac_t""no" 1>&6
15066 # strftime is in -lintl on SCO UNIX.
15067 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
15068 echo "configure:15069: checking for strftime in -lintl" >&5
15069 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
15070 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
15071   echo $ac_n "(cached) $ac_c" 1>&6
15072 else
15073   ac_save_LIBS="$LIBS"
15074 LIBS="-lintl  $LIBS"
15075 cat > conftest.$ac_ext <<EOF
15076 #line 15077 "configure"
15077 #include "confdefs.h"
15078 /* Override any gcc2 internal prototype to avoid an error.  */
15079 /* We use char because int might match the return type of a gcc2
15080     builtin and then its argument prototype would still apply.  */
15081 char strftime();
15082
15083 int main() {
15084 strftime()
15085 ; return 0; }
15086 EOF
15087 if { (eval echo configure:15088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15088   rm -rf conftest*
15089   eval "ac_cv_lib_$ac_lib_var=yes"
15090 else
15091   echo "configure: failed program was:" >&5
15092   cat conftest.$ac_ext >&5
15093   rm -rf conftest*
15094   eval "ac_cv_lib_$ac_lib_var=no"
15095 fi
15096 rm -f conftest*
15097 LIBS="$ac_save_LIBS"
15098
15099 fi
15100 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
15101   echo "$ac_t""yes" 1>&6
15102   cat >> confdefs.h <<\EOF
15103 #define HAVE_STRFTIME 1
15104 EOF
15105
15106 LIBS="-lintl $LIBS"
15107 else
15108   echo "$ac_t""no" 1>&6
15109 fi
15110
15111 fi
15112
15113
15114 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
15115 echo "configure:15116: checking for inet_aton()" >&5
15116 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
15117   echo $ac_n "(cached) $ac_c" 1>&6
15118 else
15119   cat > conftest.$ac_ext <<EOF
15120 #line 15121 "configure"
15121 #include "confdefs.h"
15122
15123 #ifdef HAVE_SYS_TYPES_H
15124 #       include <sys/types.h>
15125 #endif
15126 #ifdef HAVE_SYS_SOCKET_H
15127 #       include <sys/socket.h>
15128 #       ifdef HAVE_SYS_SELECT_H
15129 #               include <sys/select.h>
15130 #       endif
15131 #       include <netinet/in.h>
15132 #       ifdef HAVE_ARPA_INET_H
15133 #               include <arpa/inet.h>
15134 #       endif
15135 #endif
15136
15137 int main() {
15138 struct in_addr in;
15139 int rc = inet_aton( "255.255.255.255", &in );
15140 ; return 0; }
15141 EOF
15142 if { (eval echo configure:15143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15143   rm -rf conftest*
15144   ol_cv_func_inet_aton=yes
15145 else
15146   echo "configure: failed program was:" >&5
15147   cat conftest.$ac_ext >&5
15148   rm -rf conftest*
15149   ol_cv_func_inet_aton=no
15150 fi
15151 rm -f conftest*
15152 fi
15153
15154 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
15155   if test $ol_cv_func_inet_aton != no; then
15156     cat >> confdefs.h <<\EOF
15157 #define HAVE_INET_ATON 1
15158 EOF
15159
15160   fi
15161  
15162
15163 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
15164 echo "configure:15165: checking for _spawnlp" >&5
15165 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
15166   echo $ac_n "(cached) $ac_c" 1>&6
15167 else
15168   cat > conftest.$ac_ext <<EOF
15169 #line 15170 "configure"
15170 #include "confdefs.h"
15171 /* System header to define __stub macros and hopefully few prototypes,
15172     which can conflict with char _spawnlp(); below.  */
15173 #include <assert.h>
15174 /* Override any gcc2 internal prototype to avoid an error.  */
15175 /* We use char because int might match the return type of a gcc2
15176     builtin and then its argument prototype would still apply.  */
15177 char _spawnlp();
15178 char (*f)();
15179
15180 int main() {
15181
15182 /* The GNU C library defines this for functions which it implements
15183     to always fail with ENOSYS.  Some functions are actually named
15184     something starting with __ and the normal name is an alias.  */
15185 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
15186 choke me
15187 #else
15188 f = _spawnlp;
15189 #endif
15190
15191 ; return 0; }
15192 EOF
15193 if { (eval echo configure:15194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15194   rm -rf conftest*
15195   eval "ac_cv_func__spawnlp=yes"
15196 else
15197   echo "configure: failed program was:" >&5
15198   cat conftest.$ac_ext >&5
15199   rm -rf conftest*
15200   eval "ac_cv_func__spawnlp=no"
15201 fi
15202 rm -f conftest*
15203 fi
15204
15205 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
15206   echo "$ac_t""yes" 1>&6
15207   cat >> confdefs.h <<\EOF
15208 #define HAVE_SPAWNLP 1
15209 EOF
15210
15211 else
15212   echo "$ac_t""no" 1>&6
15213 fi
15214
15215
15216 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
15217 echo "configure:15218: checking for _snprintf" >&5
15218 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
15219   echo $ac_n "(cached) $ac_c" 1>&6
15220 else
15221   cat > conftest.$ac_ext <<EOF
15222 #line 15223 "configure"
15223 #include "confdefs.h"
15224 /* System header to define __stub macros and hopefully few prototypes,
15225     which can conflict with char _snprintf(); below.  */
15226 #include <assert.h>
15227 /* Override any gcc2 internal prototype to avoid an error.  */
15228 /* We use char because int might match the return type of a gcc2
15229     builtin and then its argument prototype would still apply.  */
15230 char _snprintf();
15231 char (*f)();
15232
15233 int main() {
15234
15235 /* The GNU C library defines this for functions which it implements
15236     to always fail with ENOSYS.  Some functions are actually named
15237     something starting with __ and the normal name is an alias.  */
15238 #if defined (__stub__snprintf) || defined (__stub____snprintf)
15239 choke me
15240 #else
15241 f = _snprintf;
15242 #endif
15243
15244 ; return 0; }
15245 EOF
15246 if { (eval echo configure:15247: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15247   rm -rf conftest*
15248   eval "ac_cv_func__snprintf=yes"
15249 else
15250   echo "configure: failed program was:" >&5
15251   cat conftest.$ac_ext >&5
15252   rm -rf conftest*
15253   eval "ac_cv_func__snprintf=no"
15254 fi
15255 rm -f conftest*
15256 fi
15257
15258 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
15259   echo "$ac_t""yes" 1>&6
15260   ac_cv_func_snprintf=yes
15261         cat >> confdefs.h <<\EOF
15262 #define snprintf _snprintf
15263 EOF
15264
15265
15266 else
15267   echo "$ac_t""no" 1>&6
15268 fi
15269
15270
15271 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
15272 echo "configure:15273: checking for _vsnprintf" >&5
15273 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
15274   echo $ac_n "(cached) $ac_c" 1>&6
15275 else
15276   cat > conftest.$ac_ext <<EOF
15277 #line 15278 "configure"
15278 #include "confdefs.h"
15279 /* System header to define __stub macros and hopefully few prototypes,
15280     which can conflict with char _vsnprintf(); below.  */
15281 #include <assert.h>
15282 /* Override any gcc2 internal prototype to avoid an error.  */
15283 /* We use char because int might match the return type of a gcc2
15284     builtin and then its argument prototype would still apply.  */
15285 char _vsnprintf();
15286 char (*f)();
15287
15288 int main() {
15289
15290 /* The GNU C library defines this for functions which it implements
15291     to always fail with ENOSYS.  Some functions are actually named
15292     something starting with __ and the normal name is an alias.  */
15293 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
15294 choke me
15295 #else
15296 f = _vsnprintf;
15297 #endif
15298
15299 ; return 0; }
15300 EOF
15301 if { (eval echo configure:15302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15302   rm -rf conftest*
15303   eval "ac_cv_func__vsnprintf=yes"
15304 else
15305   echo "configure: failed program was:" >&5
15306   cat conftest.$ac_ext >&5
15307   rm -rf conftest*
15308   eval "ac_cv_func__vsnprintf=no"
15309 fi
15310 rm -f conftest*
15311 fi
15312
15313 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
15314   echo "$ac_t""yes" 1>&6
15315   ac_cv_func_vsnprintf=yes
15316         cat >> confdefs.h <<\EOF
15317 #define vsnprintf _vsnprintf
15318 EOF
15319
15320
15321 else
15322   echo "$ac_t""no" 1>&6
15323 fi
15324
15325
15326 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
15327 echo "configure:15328: checking for vprintf" >&5
15328 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
15329   echo $ac_n "(cached) $ac_c" 1>&6
15330 else
15331   cat > conftest.$ac_ext <<EOF
15332 #line 15333 "configure"
15333 #include "confdefs.h"
15334 /* System header to define __stub macros and hopefully few prototypes,
15335     which can conflict with char vprintf(); below.  */
15336 #include <assert.h>
15337 /* Override any gcc2 internal prototype to avoid an error.  */
15338 /* We use char because int might match the return type of a gcc2
15339     builtin and then its argument prototype would still apply.  */
15340 char vprintf();
15341 char (*f)();
15342
15343 int main() {
15344
15345 /* The GNU C library defines this for functions which it implements
15346     to always fail with ENOSYS.  Some functions are actually named
15347     something starting with __ and the normal name is an alias.  */
15348 #if defined (__stub_vprintf) || defined (__stub___vprintf)
15349 choke me
15350 #else
15351 f = vprintf;
15352 #endif
15353
15354 ; return 0; }
15355 EOF
15356 if { (eval echo configure:15357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15357   rm -rf conftest*
15358   eval "ac_cv_func_vprintf=yes"
15359 else
15360   echo "configure: failed program was:" >&5
15361   cat conftest.$ac_ext >&5
15362   rm -rf conftest*
15363   eval "ac_cv_func_vprintf=no"
15364 fi
15365 rm -f conftest*
15366 fi
15367
15368 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
15369   echo "$ac_t""yes" 1>&6
15370   cat >> confdefs.h <<\EOF
15371 #define HAVE_VPRINTF 1
15372 EOF
15373
15374 else
15375   echo "$ac_t""no" 1>&6
15376 fi
15377
15378 if test "$ac_cv_func_vprintf" != yes; then
15379 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
15380 echo "configure:15381: checking for _doprnt" >&5
15381 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
15382   echo $ac_n "(cached) $ac_c" 1>&6
15383 else
15384   cat > conftest.$ac_ext <<EOF
15385 #line 15386 "configure"
15386 #include "confdefs.h"
15387 /* System header to define __stub macros and hopefully few prototypes,
15388     which can conflict with char _doprnt(); below.  */
15389 #include <assert.h>
15390 /* Override any gcc2 internal prototype to avoid an error.  */
15391 /* We use char because int might match the return type of a gcc2
15392     builtin and then its argument prototype would still apply.  */
15393 char _doprnt();
15394 char (*f)();
15395
15396 int main() {
15397
15398 /* The GNU C library defines this for functions which it implements
15399     to always fail with ENOSYS.  Some functions are actually named
15400     something starting with __ and the normal name is an alias.  */
15401 #if defined (__stub__doprnt) || defined (__stub____doprnt)
15402 choke me
15403 #else
15404 f = _doprnt;
15405 #endif
15406
15407 ; return 0; }
15408 EOF
15409 if { (eval echo configure:15410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15410   rm -rf conftest*
15411   eval "ac_cv_func__doprnt=yes"
15412 else
15413   echo "configure: failed program was:" >&5
15414   cat conftest.$ac_ext >&5
15415   rm -rf conftest*
15416   eval "ac_cv_func__doprnt=no"
15417 fi
15418 rm -f conftest*
15419 fi
15420
15421 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
15422   echo "$ac_t""yes" 1>&6
15423   cat >> confdefs.h <<\EOF
15424 #define HAVE_DOPRNT 1
15425 EOF
15426
15427 else
15428   echo "$ac_t""no" 1>&6
15429 fi
15430
15431 fi
15432
15433
15434 if test $ac_cv_func_vprintf = yes ; then
15435                 for ac_func in vsnprintf vsprintf
15436 do
15437 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15438 echo "configure:15439: checking for $ac_func" >&5
15439 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15440   echo $ac_n "(cached) $ac_c" 1>&6
15441 else
15442   cat > conftest.$ac_ext <<EOF
15443 #line 15444 "configure"
15444 #include "confdefs.h"
15445 /* System header to define __stub macros and hopefully few prototypes,
15446     which can conflict with char $ac_func(); below.  */
15447 #include <assert.h>
15448 /* Override any gcc2 internal prototype to avoid an error.  */
15449 /* We use char because int might match the return type of a gcc2
15450     builtin and then its argument prototype would still apply.  */
15451 char $ac_func();
15452 char (*f)();
15453
15454 int main() {
15455
15456 /* The GNU C library defines this for functions which it implements
15457     to always fail with ENOSYS.  Some functions are actually named
15458     something starting with __ and the normal name is an alias.  */
15459 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15460 choke me
15461 #else
15462 f = $ac_func;
15463 #endif
15464
15465 ; return 0; }
15466 EOF
15467 if { (eval echo configure:15468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15468   rm -rf conftest*
15469   eval "ac_cv_func_$ac_func=yes"
15470 else
15471   echo "configure: failed program was:" >&5
15472   cat conftest.$ac_ext >&5
15473   rm -rf conftest*
15474   eval "ac_cv_func_$ac_func=no"
15475 fi
15476 rm -f conftest*
15477 fi
15478
15479 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15480   echo "$ac_t""yes" 1>&6
15481     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15482   cat >> confdefs.h <<EOF
15483 #define $ac_tr_func 1
15484 EOF
15485  
15486 else
15487   echo "$ac_t""no" 1>&6
15488 fi
15489 done
15490
15491 fi
15492
15493 for ac_func in \
15494         bcopy                   \
15495         closesocket             \
15496         chroot                  \
15497         endgrent                \
15498         endpwent                \
15499         flock                   \
15500         getdtablesize   \
15501         getgrgid                \
15502         gethostname             \
15503         getpass                 \
15504         getpassphrase   \
15505         getpwuid                \
15506         getpwnam                \
15507         getspnam                \
15508         gettimeofday    \
15509         initgroups              \
15510         lockf                   \
15511         memcpy                  \
15512         memmove                 \
15513         mkstemp                 \
15514         pipe                    \
15515         read                    \
15516         recv                    \
15517         recvfrom                \
15518         setpwfile               \
15519         setgid                  \
15520         setegid                 \
15521         setsid                  \
15522         setuid                  \
15523         seteuid                 \
15524         sigaction               \
15525         signal                  \
15526         sigset                  \
15527         snprintf                \
15528         strdup                  \
15529         strerror                \
15530         strpbrk                 \
15531         strrchr                 \
15532         strsep                  \
15533         strstr                  \
15534         strtol                  \
15535         strtoul                 \
15536         strspn                  \
15537         sysconf                 \
15538         waitpid                 \
15539         wait4                   \
15540         write                   \
15541         send                    \
15542         sendto                  \
15543
15544 do
15545 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15546 echo "configure:15547: checking for $ac_func" >&5
15547 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15548   echo $ac_n "(cached) $ac_c" 1>&6
15549 else
15550   cat > conftest.$ac_ext <<EOF
15551 #line 15552 "configure"
15552 #include "confdefs.h"
15553 /* System header to define __stub macros and hopefully few prototypes,
15554     which can conflict with char $ac_func(); below.  */
15555 #include <assert.h>
15556 /* Override any gcc2 internal prototype to avoid an error.  */
15557 /* We use char because int might match the return type of a gcc2
15558     builtin and then its argument prototype would still apply.  */
15559 char $ac_func();
15560 char (*f)();
15561
15562 int main() {
15563
15564 /* The GNU C library defines this for functions which it implements
15565     to always fail with ENOSYS.  Some functions are actually named
15566     something starting with __ and the normal name is an alias.  */
15567 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15568 choke me
15569 #else
15570 f = $ac_func;
15571 #endif
15572
15573 ; return 0; }
15574 EOF
15575 if { (eval echo configure:15576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15576   rm -rf conftest*
15577   eval "ac_cv_func_$ac_func=yes"
15578 else
15579   echo "configure: failed program was:" >&5
15580   cat conftest.$ac_ext >&5
15581   rm -rf conftest*
15582   eval "ac_cv_func_$ac_func=no"
15583 fi
15584 rm -f conftest*
15585 fi
15586
15587 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15588   echo "$ac_t""yes" 1>&6
15589     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15590   cat >> confdefs.h <<EOF
15591 #define $ac_tr_func 1
15592 EOF
15593  
15594 else
15595   echo "$ac_t""no" 1>&6
15596 fi
15597 done
15598
15599
15600 for ac_func in getopt tempnam
15601 do
15602 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15603 echo "configure:15604: checking for $ac_func" >&5
15604 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15605   echo $ac_n "(cached) $ac_c" 1>&6
15606 else
15607   cat > conftest.$ac_ext <<EOF
15608 #line 15609 "configure"
15609 #include "confdefs.h"
15610 /* System header to define __stub macros and hopefully few prototypes,
15611     which can conflict with char $ac_func(); below.  */
15612 #include <assert.h>
15613 /* Override any gcc2 internal prototype to avoid an error.  */
15614 /* We use char because int might match the return type of a gcc2
15615     builtin and then its argument prototype would still apply.  */
15616 char $ac_func();
15617 char (*f)();
15618
15619 int main() {
15620
15621 /* The GNU C library defines this for functions which it implements
15622     to always fail with ENOSYS.  Some functions are actually named
15623     something starting with __ and the normal name is an alias.  */
15624 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15625 choke me
15626 #else
15627 f = $ac_func;
15628 #endif
15629
15630 ; return 0; }
15631 EOF
15632 if { (eval echo configure:15633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15633   rm -rf conftest*
15634   eval "ac_cv_func_$ac_func=yes"
15635 else
15636   echo "configure: failed program was:" >&5
15637   cat conftest.$ac_ext >&5
15638   rm -rf conftest*
15639   eval "ac_cv_func_$ac_func=no"
15640 fi
15641 rm -f conftest*
15642 fi
15643
15644 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15645   echo "$ac_t""yes" 1>&6
15646     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15647   cat >> confdefs.h <<EOF
15648 #define $ac_tr_func 1
15649 EOF
15650  
15651 else
15652   echo "$ac_t""no" 1>&6
15653 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
15654 fi
15655 done
15656
15657
15658
15659 if test "$ac_cv_func_getopt" != yes; then
15660     LIBSRCS="$LIBSRCS getopt.c"
15661 fi
15662
15663 if test "$ac_cv_func_tempnam" != yes; then
15664     LIBSRCS="$LIBSRCS tempnam.c"
15665 fi
15666
15667 # Check Configuration
15668 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
15669 echo "configure:15670: checking declaration of sys_errlist" >&5
15670 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
15671   echo $ac_n "(cached) $ac_c" 1>&6
15672 else
15673   
15674         cat > conftest.$ac_ext <<EOF
15675 #line 15676 "configure"
15676 #include "confdefs.h"
15677
15678 #include <stdio.h>
15679 #include <sys/types.h>
15680 #include <errno.h>
15681 #ifdef WINNT
15682 #include <stdlib.h>
15683 #endif 
15684 int main() {
15685 char *c = (char *) *sys_errlist
15686 ; return 0; }
15687 EOF
15688 if { (eval echo configure:15689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15689   rm -rf conftest*
15690   ol_cv_dcl_sys_errlist=yes
15691         ol_cv_have_sys_errlist=yes
15692 else
15693   echo "configure: failed program was:" >&5
15694   cat conftest.$ac_ext >&5
15695   rm -rf conftest*
15696   ol_cv_dcl_sys_errlist=no
15697 fi
15698 rm -f conftest*
15699 fi
15700
15701 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
15702 #
15703 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
15704 if test $ol_cv_dcl_sys_errlist = no ; then
15705         cat >> confdefs.h <<\EOF
15706 #define DECL_SYS_ERRLIST 1
15707 EOF
15708
15709
15710         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
15711 echo "configure:15712: checking existence of sys_errlist" >&5
15712 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
15713   echo $ac_n "(cached) $ac_c" 1>&6
15714 else
15715   
15716                 cat > conftest.$ac_ext <<EOF
15717 #line 15718 "configure"
15718 #include "confdefs.h"
15719 #include <errno.h>
15720 int main() {
15721 char *c = (char *) *sys_errlist
15722 ; return 0; }
15723 EOF
15724 if { (eval echo configure:15725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15725   rm -rf conftest*
15726   ol_cv_have_sys_errlist=yes
15727 else
15728   echo "configure: failed program was:" >&5
15729   cat conftest.$ac_ext >&5
15730   rm -rf conftest*
15731   ol_cv_have_sys_errlist=no
15732 fi
15733 rm -f conftest*
15734 fi
15735
15736 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
15737 fi
15738 if test $ol_cv_have_sys_errlist = yes ; then
15739         cat >> confdefs.h <<\EOF
15740 #define HAVE_SYS_ERRLIST 1
15741 EOF
15742
15743 fi
15744
15745
15746
15747 if test "$ol_enable_debug" != no ; then
15748         cat >> confdefs.h <<\EOF
15749 #define LDAP_DEBUG 1
15750 EOF
15751
15752 fi
15753 if test "$ol_enable_syslog" = yes ; then
15754         cat >> confdefs.h <<\EOF
15755 #define LDAP_SYSLOG 1
15756 EOF
15757
15758 fi
15759 if test "$ol_enable_libui" = yes ; then
15760         cat >> confdefs.h <<\EOF
15761 #define LDAP_LIBUI 1
15762 EOF
15763
15764 fi
15765 if test "$ol_enable_cache" = no ; then
15766         cat >> confdefs.h <<\EOF
15767 #define LDAP_NOCACHE 1
15768 EOF
15769
15770 fi
15771 if test "$ol_link_kbind" != no ; then
15772         cat >> confdefs.h <<\EOF
15773 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
15774 EOF
15775
15776 fi
15777 if test "$ol_enable_proctitle" != no ; then
15778         cat >> confdefs.h <<\EOF
15779 #define LDAP_PROCTITLE 1
15780 EOF
15781
15782 fi
15783 if test "$ol_enable_referrals" != no ; then
15784         cat >> confdefs.h <<\EOF
15785 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
15786 EOF
15787
15788 fi
15789 if test "$ol_enable_local" != no; then
15790         cat >> confdefs.h <<\EOF
15791 #define LDAP_PF_LOCAL 1
15792 EOF
15793
15794 fi
15795 if test "$ol_link_ipv6" != no; then
15796         cat >> confdefs.h <<\EOF
15797 #define LDAP_PF_INET6 1
15798 EOF
15799
15800 fi
15801 if test "$ol_enable_cleartext" != no ; then
15802         cat >> confdefs.h <<\EOF
15803 #define SLAPD_CLEARTEXT 1
15804 EOF
15805
15806 fi
15807 if test "$ol_enable_crypt" != no ; then
15808         cat >> confdefs.h <<\EOF
15809 #define SLAPD_CRYPT 1
15810 EOF
15811
15812 fi
15813 if test "$ol_link_kpasswd" != no ; then
15814         cat >> confdefs.h <<\EOF
15815 #define SLAPD_KPASSWD 1
15816 EOF
15817
15818 fi
15819 if test "$ol_link_spasswd" != no ; then
15820         cat >> confdefs.h <<\EOF
15821 #define SLAPD_SPASSWD 1
15822 EOF
15823
15824 fi
15825 if test "$ol_enable_phonetic" != no ; then
15826         cat >> confdefs.h <<\EOF
15827 #define SLAPD_PHONETIC 1
15828 EOF
15829
15830 fi
15831 if test "$ol_enable_rlookups" != no ; then
15832         cat >> confdefs.h <<\EOF
15833 #define SLAPD_RLOOKUPS 1
15834 EOF
15835
15836 fi
15837 if test "$ol_enable_aci" != no ; then
15838         cat >> confdefs.h <<\EOF
15839 #define SLAPD_ACI_ENABLED 1
15840 EOF
15841
15842 fi
15843
15844 if test "$ol_link_modules" != no ; then
15845         cat >> confdefs.h <<\EOF
15846 #define SLAPD_MODULES 1
15847 EOF
15848
15849         BUILD_SLAPD=yes
15850         SLAPD_MODULES_LDFLAGS="-dlopen self"
15851 fi
15852
15853 if test "$ol_link_dnssrv" != no ; then
15854         cat >> confdefs.h <<\EOF
15855 #define SLAPD_DNSSRV 1
15856 EOF
15857
15858         BUILD_SLAPD=yes
15859         BUILD_DNSSRV=yes
15860         if test "$ol_with_dnssrv_module" != static ; then
15861                 cat >> confdefs.h <<\EOF
15862 #define SLAPD_DNSSRV_DYNAMIC 1
15863 EOF
15864
15865                 BUILD_DNSSRV=mod
15866                 BUILD_DNSSRV_DYNAMIC=shared
15867                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
15868         fi
15869 fi
15870
15871 if test "$ol_enable_ldap" != no ; then
15872         cat >> confdefs.h <<\EOF
15873 #define SLAPD_LDAP 1
15874 EOF
15875
15876         BUILD_SLAPD=yes
15877         BUILD_LDAP=yes
15878         if test "$ol_with_ldap_module" != static ; then
15879                 cat >> confdefs.h <<\EOF
15880 #define SLAPD_LDAP_DYNAMIC 1
15881 EOF
15882
15883                 BUILD_LDAP=mod
15884                 BUILD_LDAP_DYNAMIC=shared
15885                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
15886         fi
15887 fi
15888
15889 if test "$ol_link_ldbm" != no ; then
15890         cat >> confdefs.h <<\EOF
15891 #define SLAPD_LDBM 1
15892 EOF
15893
15894         BUILD_SLAPD=yes
15895         BUILD_LDBM=yes
15896         if test "$ol_with_ldbm_module" != static ; then
15897                 cat >> confdefs.h <<\EOF
15898 #define SLAPD_LDBM_DYNAMIC 1
15899 EOF
15900
15901                 BUILD_LDBM=mod
15902                 BUILD_LDBM_DYNAMIC=shared
15903                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
15904         fi
15905 fi
15906
15907 if test "$ol_enable_passwd" != no ; then
15908         cat >> confdefs.h <<\EOF
15909 #define SLAPD_PASSWD 1
15910 EOF
15911
15912         BUILD_SLAPD=yes
15913         BUILD_PASSWD=yes
15914         if test "$ol_with_passwd_module" != static ; then
15915                 cat >> confdefs.h <<\EOF
15916 #define SLAPD_PASSWD_DYNAMIC 1
15917 EOF
15918
15919                 BUILD_PASSWD=mod
15920                 BUILD_PASSWD_DYNAMIC=shared
15921                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
15922         fi
15923 fi
15924
15925 if test "$ol_enable_shell" != no ; then
15926         cat >> confdefs.h <<\EOF
15927 #define SLAPD_SHELL 1
15928 EOF
15929
15930         BUILD_SLAPD=yes
15931         BUILD_SHELL=yes
15932         if test "$ol_with_shell_module" != static ; then
15933                 cat >> confdefs.h <<\EOF
15934 #define SLAPD_SHELL_DYNAMIC 1
15935 EOF
15936
15937                 BUILD_SHELL=mod
15938                 BUILD_SHELL_DYNAMIC=shared
15939                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
15940         fi
15941 fi
15942
15943 if test "$ol_enable_sql" != no ; then
15944         cat >> confdefs.h <<\EOF
15945 #define SLAPD_SQL 1
15946 EOF
15947
15948         BUILD_SLAPD=yes
15949         BUILD_SQL=yes
15950         if test "$ol_with_sql_module" != static; then
15951                 cat >> confdefs.h <<\EOF
15952 #define SLAPD_SQL_DYNAMIC 1
15953 EOF
15954
15955                 BUILD_SQL=mod
15956                 BUILD_SQL_DYNAMIC=shared
15957                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
15958         fi
15959 fi
15960
15961 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
15962         $BUILD_SLAPD = yes ; then
15963         BUILD_SLURPD=yes
15964 fi
15965
15966
15967 if test "$LINK_BINS_DYNAMIC" = yes; then
15968     LIB_LINKAGE=DYN
15969     LT_LIB_LINKAGE=shared
15970 else
15971     LIB_LINKAGE=STAT
15972     LT_LIB_LINKAGE=static
15973 fi
15974
15975 if test "$ac_cv_mingw32" = yes ; then
15976     PLAT=NT
15977     DYN_EXT=dll
15978 else
15979     PLAT=UNIX
15980     DYN_EXT=so
15981 fi
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991   
15992   
15993   
15994   
15995   
15996   
15997   
15998   
15999   
16000   
16001   
16002   
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033 trap '' 1 2 15
16034
16035 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
16036
16037 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16038 # Let make expand exec_prefix.
16039 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16040
16041 # Any assignment to VPATH causes Sun make to only execute
16042 # the first set of double-colon rules, so remove it if not needed.
16043 # If there is a colon in the path, we need to keep it.
16044 if test "x$srcdir" = x.; then
16045   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
16046 fi
16047
16048 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
16049
16050 DEFS=-DHAVE_CONFIG_H
16051
16052 # Without the "./", some shells look in PATH for config.status.
16053 : ${CONFIG_STATUS=./config.status}
16054
16055 echo creating $CONFIG_STATUS
16056 rm -f $CONFIG_STATUS
16057 cat > $CONFIG_STATUS <<EOF
16058 #! /bin/sh
16059 # Generated automatically by configure.
16060 # Run this file to recreate the current configuration.
16061 # This directory was configured as follows,
16062 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
16063 #
16064 # $0 $ac_configure_args
16065 #
16066 # Compiler output produced by configure, useful for debugging
16067 # configure, is in ./config.log if it exists.
16068
16069 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
16070 for ac_option
16071 do
16072   case "\$ac_option" in
16073   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16074     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
16075     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
16076   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
16077     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
16078     exit 0 ;;
16079   -help | --help | --hel | --he | --h)
16080     echo "\$ac_cs_usage"; exit 0 ;;
16081   *) echo "\$ac_cs_usage"; exit 1 ;;
16082   esac
16083 done
16084
16085 ac_given_srcdir=$srcdir
16086 ac_given_INSTALL="$INSTALL"
16087
16088 trap 'rm -fr `echo "\
16089 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16090 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16091 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16092 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16093 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16094 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16095 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16096 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16097 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16098 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16099 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16100 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16101 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16102 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16103 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
16104 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16105 include/Makefile:build/top.mk:include/Makefile.in \
16106 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16107 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16108 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16109 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16110 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16111 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16112 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16113 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16114 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16115 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16116 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16117 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16118 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16119 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16120 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16121 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16122 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16123 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16124 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16125 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16126 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16127 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16128 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16129 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16130  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
16131 EOF
16132 cat >> $CONFIG_STATUS <<EOF
16133
16134 # Protect against being on the right side of a sed subst in config.status.
16135 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
16136  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
16137 $ac_vpsub
16138 $extrasub
16139 s%@SHELL@%$SHELL%g
16140 s%@CFLAGS@%$CFLAGS%g
16141 s%@CPPFLAGS@%$CPPFLAGS%g
16142 s%@CXXFLAGS@%$CXXFLAGS%g
16143 s%@FFLAGS@%$FFLAGS%g
16144 s%@DEFS@%$DEFS%g
16145 s%@LDFLAGS@%$LDFLAGS%g
16146 s%@LIBS@%$LIBS%g
16147 s%@exec_prefix@%$exec_prefix%g
16148 s%@prefix@%$prefix%g
16149 s%@program_transform_name@%$program_transform_name%g
16150 s%@bindir@%$bindir%g
16151 s%@sbindir@%$sbindir%g
16152 s%@libexecdir@%$libexecdir%g
16153 s%@datadir@%$datadir%g
16154 s%@sysconfdir@%$sysconfdir%g
16155 s%@sharedstatedir@%$sharedstatedir%g
16156 s%@localstatedir@%$localstatedir%g
16157 s%@libdir@%$libdir%g
16158 s%@includedir@%$includedir%g
16159 s%@oldincludedir@%$oldincludedir%g
16160 s%@infodir@%$infodir%g
16161 s%@mandir@%$mandir%g
16162 s%@host@%$host%g
16163 s%@host_alias@%$host_alias%g
16164 s%@host_cpu@%$host_cpu%g
16165 s%@host_vendor@%$host_vendor%g
16166 s%@host_os@%$host_os%g
16167 s%@target@%$target%g
16168 s%@target_alias@%$target_alias%g
16169 s%@target_cpu@%$target_cpu%g
16170 s%@target_vendor@%$target_vendor%g
16171 s%@target_os@%$target_os%g
16172 s%@build@%$build%g
16173 s%@build_alias@%$build_alias%g
16174 s%@build_cpu@%$build_cpu%g
16175 s%@build_vendor@%$build_vendor%g
16176 s%@build_os@%$build_os%g
16177 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
16178 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
16179 s%@INSTALL_DATA@%$INSTALL_DATA%g
16180 s%@PACKAGE@%$PACKAGE%g
16181 s%@VERSION@%$VERSION%g
16182 s%@ACLOCAL@%$ACLOCAL%g
16183 s%@AUTOCONF@%$AUTOCONF%g
16184 s%@AUTOMAKE@%$AUTOMAKE%g
16185 s%@AUTOHEADER@%$AUTOHEADER%g
16186 s%@MAKEINFO@%$MAKEINFO%g
16187 s%@install_sh@%$install_sh%g
16188 s%@AMTAR@%$AMTAR%g
16189 s%@AWK@%$AWK%g
16190 s%@AMTARFLAGS@%$AMTARFLAGS%g
16191 s%@SET_MAKE@%$SET_MAKE%g
16192 s%@top_builddir@%$top_builddir%g
16193 s%@ldap_subdir@%$ldap_subdir%g
16194 s%@CC@%$CC%g
16195 s%@RANLIB@%$RANLIB%g
16196 s%@LN_S@%$LN_S%g
16197 s%@DLLTOOL@%$DLLTOOL%g
16198 s%@AS@%$AS%g
16199 s%@OBJDUMP@%$OBJDUMP%g
16200 s%@LIBTOOL@%$LIBTOOL%g
16201 s%@LN_H@%$LN_H%g
16202 s%@SENDMAIL@%$SENDMAIL%g
16203 s%@EDITOR@%$EDITOR%g
16204 s%@FINGER@%$FINGER%g
16205 s%@CPP@%$CPP%g
16206 s%@EXEEXT@%$EXEEXT%g
16207 s%@OBJEXT@%$OBJEXT%g
16208 s%@OL_MKDEP@%$OL_MKDEP%g
16209 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
16210 s%@LIBOBJS@%$LIBOBJS%g
16211 s%@LIBSRCS@%$LIBSRCS%g
16212 s%@PLAT@%$PLAT%g
16213 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
16214 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
16215 s%@DYN_EXT@%$DYN_EXT%g
16216 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
16217 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
16218 s%@BUILD_LDAP@%$BUILD_LDAP%g
16219 s%@BUILD_LDBM@%$BUILD_LDBM%g
16220 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
16221 s%@BUILD_SHELL@%$BUILD_SHELL%g
16222 s%@BUILD_SQL@%$BUILD_SQL%g
16223 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
16224 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
16225 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
16226 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
16227 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
16228 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
16229 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
16230 s%@LDAP_LIBS@%$LDAP_LIBS%g
16231 s%@LDIF_LIBS@%$LDIF_LIBS%g
16232 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
16233 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
16234 s%@LDBM_LIBS@%$LDBM_LIBS%g
16235 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
16236 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
16237 s%@WRAP_LIBS@%$WRAP_LIBS%g
16238 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
16239 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
16240 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
16241 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
16242 s%@KRB4_LIBS@%$KRB4_LIBS%g
16243 s%@KRB5_LIBS@%$KRB5_LIBS%g
16244 s%@READLINE_LIBS@%$READLINE_LIBS%g
16245 s%@SASL_LIBS@%$SASL_LIBS%g
16246 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
16247 s%@TLS_LIBS@%$TLS_LIBS%g
16248 s%@MODULES_LIBS@%$MODULES_LIBS%g
16249 s%@AUTH_LIBS@%$AUTH_LIBS%g
16250 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
16251 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
16252 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
16253
16254 CEOF
16255 EOF
16256
16257 cat >> $CONFIG_STATUS <<\EOF
16258
16259 # Split the substitutions into bite-sized pieces for seds with
16260 # small command number limits, like on Digital OSF/1 and HP-UX.
16261 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
16262 ac_file=1 # Number of current file.
16263 ac_beg=1 # First line for current file.
16264 ac_end=$ac_max_sed_cmds # Line after last line for current file.
16265 ac_more_lines=:
16266 ac_sed_cmds=""
16267 while $ac_more_lines; do
16268   if test $ac_beg -gt 1; then
16269     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
16270   else
16271     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
16272   fi
16273   if test ! -s conftest.s$ac_file; then
16274     ac_more_lines=false
16275     rm -f conftest.s$ac_file
16276   else
16277     if test -z "$ac_sed_cmds"; then
16278       ac_sed_cmds="sed -f conftest.s$ac_file"
16279     else
16280       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
16281     fi
16282     ac_file=`expr $ac_file + 1`
16283     ac_beg=$ac_end
16284     ac_end=`expr $ac_end + $ac_max_sed_cmds`
16285   fi
16286 done
16287 if test -z "$ac_sed_cmds"; then
16288   ac_sed_cmds=cat
16289 fi
16290 EOF
16291
16292 cat >> $CONFIG_STATUS <<EOF
16293
16294 CONFIG_FILES=\${CONFIG_FILES-"\
16295 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16296 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16297 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16298 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16299 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16300 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16301 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16302 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16303 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16304 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16305 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16306 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16307 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16308 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16309 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
16310 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16311 include/Makefile:build/top.mk:include/Makefile.in \
16312 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16313 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16314 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16315 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16316 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16317 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16318 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16319 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16320 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16321 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16322 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16323 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16324 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16325 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16326 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16327 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16328 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16329 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16330 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16331 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16332 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16333 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16334 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16335 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16336 "}
16337 EOF
16338 cat >> $CONFIG_STATUS <<\EOF
16339 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
16340   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16341   case "$ac_file" in
16342   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16343        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16344   *) ac_file_in="${ac_file}.in" ;;
16345   esac
16346
16347   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
16348
16349   # Remove last slash and all that follows it.  Not all systems have dirname.
16350   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16351   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16352     # The file is in a subdirectory.
16353     test ! -d "$ac_dir" && mkdir "$ac_dir"
16354     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
16355     # A "../" for each directory in $ac_dir_suffix.
16356     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
16357   else
16358     ac_dir_suffix= ac_dots=
16359   fi
16360
16361   case "$ac_given_srcdir" in
16362   .)  srcdir=.
16363       if test -z "$ac_dots"; then top_srcdir=.
16364       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
16365   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
16366   *) # Relative path.
16367     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
16368     top_srcdir="$ac_dots$ac_given_srcdir" ;;
16369   esac
16370
16371   case "$ac_given_INSTALL" in
16372   [/$]*) INSTALL="$ac_given_INSTALL" ;;
16373   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
16374   esac
16375
16376   echo creating "$ac_file"
16377   rm -f "$ac_file"
16378   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
16379   case "$ac_file" in
16380   *[Mm]akefile*) ac_comsub="1i\\
16381 # $configure_input" ;;
16382   *) ac_comsub= ;;
16383   esac
16384
16385   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16386   sed -e "$ac_comsub
16387 s%@configure_input@%$configure_input%g
16388 s%@srcdir@%$srcdir%g
16389 s%@top_srcdir@%$top_srcdir%g
16390 s%@INSTALL@%$INSTALL%g
16391 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
16392 fi; done
16393 rm -f conftest.s*
16394
16395 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16396 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16397 #
16398 # ac_d sets the value in "#define NAME VALUE" lines.
16399 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16400 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
16401 ac_dC='\3'
16402 ac_dD='%g'
16403 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16404 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16405 ac_uB='\([      ]\)%\1#\2define\3'
16406 ac_uC=' '
16407 ac_uD='\4%g'
16408 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16409 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16410 ac_eB='$%\1#\2define\3'
16411 ac_eC=' '
16412 ac_eD='%g'
16413
16414 if test "${CONFIG_HEADERS+set}" != set; then
16415 EOF
16416 cat >> $CONFIG_STATUS <<EOF
16417   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
16418 EOF
16419 cat >> $CONFIG_STATUS <<\EOF
16420 fi
16421 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
16422   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16423   case "$ac_file" in
16424   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16425        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16426   *) ac_file_in="${ac_file}.in" ;;
16427   esac
16428
16429   echo creating $ac_file
16430
16431   rm -f conftest.frag conftest.in conftest.out
16432   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16433   cat $ac_file_inputs > conftest.in
16434
16435 EOF
16436
16437 # Transform confdefs.h into a sed script conftest.vals that substitutes
16438 # the proper values into config.h.in to produce config.h.  And first:
16439 # Protect against being on the right side of a sed subst in config.status.
16440 # Protect against being in an unquoted here document in config.status.
16441 rm -f conftest.vals
16442 cat > conftest.hdr <<\EOF
16443 s/[\\&%]/\\&/g
16444 s%[\\$`]%\\&%g
16445 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
16446 s%ac_d%ac_u%gp
16447 s%ac_u%ac_e%gp
16448 EOF
16449 sed -n -f conftest.hdr confdefs.h > conftest.vals
16450 rm -f conftest.hdr
16451
16452 # This sed command replaces #undef with comments.  This is necessary, for
16453 # example, in the case of _POSIX_SOURCE, which is predefined and required
16454 # on some systems where configure will not decide to define it.
16455 cat >> conftest.vals <<\EOF
16456 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
16457 EOF
16458
16459 # Break up conftest.vals because some shells have a limit on
16460 # the size of here documents, and old seds have small limits too.
16461
16462 rm -f conftest.tail
16463 while :
16464 do
16465   ac_lines=`grep -c . conftest.vals`
16466   # grep -c gives empty output for an empty file on some AIX systems.
16467   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
16468   # Write a limited-size here document to conftest.frag.
16469   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
16470   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
16471   echo 'CEOF
16472   sed -f conftest.frag conftest.in > conftest.out
16473   rm -f conftest.in
16474   mv conftest.out conftest.in
16475 ' >> $CONFIG_STATUS
16476   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16477   rm -f conftest.vals
16478   mv conftest.tail conftest.vals
16479 done
16480 rm -f conftest.vals
16481
16482 cat >> $CONFIG_STATUS <<\EOF
16483   rm -f conftest.frag conftest.h
16484   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
16485   cat conftest.in >> conftest.h
16486   rm -f conftest.in
16487   if cmp -s $ac_file conftest.h 2>/dev/null; then
16488     echo "$ac_file is unchanged"
16489     rm -f conftest.h
16490   else
16491     # Remove last slash and all that follows it.  Not all systems have dirname.
16492       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16493       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16494       # The file is in a subdirectory.
16495       test ! -d "$ac_dir" && mkdir "$ac_dir"
16496     fi
16497     rm -f $ac_file
16498     mv conftest.h $ac_file
16499   fi
16500 fi; done
16501
16502 EOF
16503 cat >> $CONFIG_STATUS <<EOF
16504
16505 EOF
16506 cat >> $CONFIG_STATUS <<\EOF
16507
16508 date > stamp-h
16509 echo Please \"make depend\" to build dependencies
16510
16511 exit 0
16512 EOF
16513 chmod +x $CONFIG_STATUS
16514 rm -fr confdefs* $ac_clean_files
16515 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
16516