]> git.sur5r.net Git - openldap/blob - configure
New routine tls_report_error to analyze errors from OpenSSL
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local
15 ac_help="$ac_help
16   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-cleartext  enable cleartext passwords (yes)"
55 ac_help="$ac_help
56     --enable-crypt      enable crypt(3) passwords (auto)"
57 ac_help="$ac_help
58     --enable-modules    enable dynamic module support (no)"
59 ac_help="$ac_help
60     --enable-phonetic   enable phonetic/soundex (no)"
61 ac_help="$ac_help
62     --enable-rlookups   enable reverse lookups (auto)"
63 ac_help="$ac_help
64     --enable-wrappers   enable tcp wrapper support (no)"
65 ac_help="$ac_help
66     --enable-bdb2       enable bdb2 backend (no)"
67 ac_help="$ac_help
68       --with-bdb2-module        module type (static)"
69 ac_help="$ac_help
70     --enable-ldap       enable ldap backend (no)"
71 ac_help="$ac_help
72       --with-ldap-module        module type (static)"
73 ac_help="$ac_help
74     --enable-ldbm       enable ldbm backend (yes)"
75 ac_help="$ac_help
76       --with-ldbm-module        module type (static)"
77 ac_help="$ac_help
78       --with-ldbm-api   use LDBM API (auto)"
79 ac_help="$ac_help
80       --with-ldbm-type  use LDBM type (auto)"
81 ac_help="$ac_help
82     --enable-passwd     enable passwd backend (no)"
83 ac_help="$ac_help
84       --with-passwd-module      module type (static)"
85 ac_help="$ac_help
86     --enable-perl       enable perl backend (no)"
87 ac_help="$ac_help
88       --with-perl-module        module type (static)"
89 ac_help="$ac_help
90     --enable-shell      enable shell backend (no)"
91 ac_help="$ac_help
92       --with-shell-module       module type (static)"
93 ac_help="$ac_help
94     --enable-tcl        enable tcl backend (no)"
95 ac_help="$ac_help
96       --with-tcl-module module type (static)"
97 ac_help="$ac_help
98 SLURPD Options:"
99 ac_help="$ac_help
100   --enable-slurpd       enable building slurpd (auto)"
101 ac_help="$ac_help
102 Library Generation & Linking Options"
103 ac_help="$ac_help
104   --enable-static         build static libraries [default=yes]
105   --enable-static=PKGS    only build shared libraries if the current package
106                           appears as an element in the PKGS list"
107 ac_help="$ac_help
108   --enable-shared         build shared libraries [default=yes]
109   --enable-shared=PKGS    only build shared libraries if the current package
110                           appears as an element in the PKGS list"
111 ac_help="$ac_help
112   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
113
114 # Initialize some variables set by options.
115 # The variables have the same names as the options, with
116 # dashes changed to underlines.
117 build=NONE
118 cache_file=./config.cache
119 exec_prefix=NONE
120 host=NONE
121 no_create=
122 nonopt=NONE
123 no_recursion=
124 prefix=NONE
125 program_prefix=NONE
126 program_suffix=NONE
127 program_transform_name=s,x,x,
128 silent=
129 site=
130 srcdir=
131 target=NONE
132 verbose=
133 x_includes=NONE
134 x_libraries=NONE
135 bindir='${exec_prefix}/bin'
136 sbindir='${exec_prefix}/sbin'
137 libexecdir='${exec_prefix}/libexec'
138 datadir='${prefix}/share'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${prefix}/info'
146 mandir='${prefix}/man'
147
148 # Initialize some other variables.
149 subdirs=
150 MFLAGS= MAKEFLAGS=
151 SHELL=${CONFIG_SHELL-/bin/sh}
152 # Maximum number of lines to put in a shell here document.
153 ac_max_here_lines=12
154
155 ac_prev=
156 for ac_option
157 do
158
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   case "$ac_option" in
167   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
168   *) ac_optarg= ;;
169   esac
170
171   # Accept the important Cygnus configure options, so we can diagnose typos.
172
173   case "$ac_option" in
174
175   -bindir | --bindir | --bindi | --bind | --bin | --bi)
176     ac_prev=bindir ;;
177   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
178     bindir="$ac_optarg" ;;
179
180   -build | --build | --buil | --bui | --bu)
181     ac_prev=build ;;
182   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
183     build="$ac_optarg" ;;
184
185   -cache-file | --cache-file | --cache-fil | --cache-fi \
186   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
187     ac_prev=cache_file ;;
188   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
189   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
190     cache_file="$ac_optarg" ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir="$ac_optarg" ;;
197
198   -disable-* | --disable-*)
199     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
200     # Reject names that are not valid shell variable names.
201     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
202       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
203     fi
204     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
205     eval "enable_${ac_feature}=no" ;;
206
207   -enable-* | --enable-*)
208     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
209     # Reject names that are not valid shell variable names.
210     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
211       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
212     fi
213     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
214     case "$ac_option" in
215       *=*) ;;
216       *) ac_optarg=yes ;;
217     esac
218     eval "enable_${ac_feature}='$ac_optarg'" ;;
219
220   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
221   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
222   | --exec | --exe | --ex)
223     ac_prev=exec_prefix ;;
224   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
225   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
226   | --exec=* | --exe=* | --ex=*)
227     exec_prefix="$ac_optarg" ;;
228
229   -gas | --gas | --ga | --g)
230     # Obsolete; use --with-gas.
231     with_gas=yes ;;
232
233   -help | --help | --hel | --he)
234     # Omit some internal or obsolete options to make the list less imposing.
235     # This message is too long to be a string in the A/UX 3.1 sh.
236     cat << EOF
237 Usage: configure [options] [host]
238 Options: [defaults in brackets after descriptions]
239 Configuration:
240   --cache-file=FILE       cache test results in FILE
241   --help                  print this message
242   --no-create             do not create output files
243   --quiet, --silent       do not print \`checking...' messages
244   --version               print the version of autoconf that created configure
245 Directory and file names:
246   --prefix=PREFIX         install architecture-independent files in PREFIX
247                           [$ac_default_prefix]
248   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
249                           [same as prefix]
250   --bindir=DIR            user executables in DIR [EPREFIX/bin]
251   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
252   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
253   --datadir=DIR           read-only architecture-independent data in DIR
254                           [PREFIX/share]
255   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
256   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
257                           [PREFIX/com]
258   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
259   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
260   --includedir=DIR        C header files in DIR [PREFIX/include]
261   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
262   --infodir=DIR           info documentation in DIR [PREFIX/info]
263   --mandir=DIR            man documentation in DIR [PREFIX/man]
264   --srcdir=DIR            find the sources in DIR [configure dir or ..]
265   --program-prefix=PREFIX prepend PREFIX to installed program names
266   --program-suffix=SUFFIX append SUFFIX to installed program names
267   --program-transform-name=PROGRAM
268                           run sed PROGRAM on installed program names
269 EOF
270     cat << EOF
271 Host type:
272   --build=BUILD           configure for building on BUILD [BUILD=HOST]
273   --host=HOST             configure for HOST [guessed]
274   --target=TARGET         configure for TARGET [TARGET=HOST]
275 Features and packages:
276   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
277   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
278   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
279   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
280   --x-includes=DIR        X include files are in DIR
281   --x-libraries=DIR       X library files are in DIR
282 EOF
283     if test -n "$ac_help"; then
284       echo "--enable and --with options recognized:$ac_help"
285     fi
286     exit 0 ;;
287
288   -host | --host | --hos | --ho)
289     ac_prev=host ;;
290   -host=* | --host=* | --hos=* | --ho=*)
291     host="$ac_optarg" ;;
292
293   -includedir | --includedir | --includedi | --included | --include \
294   | --includ | --inclu | --incl | --inc)
295     ac_prev=includedir ;;
296   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
297   | --includ=* | --inclu=* | --incl=* | --inc=*)
298     includedir="$ac_optarg" ;;
299
300   -infodir | --infodir | --infodi | --infod | --info | --inf)
301     ac_prev=infodir ;;
302   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
303     infodir="$ac_optarg" ;;
304
305   -libdir | --libdir | --libdi | --libd)
306     ac_prev=libdir ;;
307   -libdir=* | --libdir=* | --libdi=* | --libd=*)
308     libdir="$ac_optarg" ;;
309
310   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
311   | --libexe | --libex | --libe)
312     ac_prev=libexecdir ;;
313   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
314   | --libexe=* | --libex=* | --libe=*)
315     libexecdir="$ac_optarg" ;;
316
317   -localstatedir | --localstatedir | --localstatedi | --localstated \
318   | --localstate | --localstat | --localsta | --localst \
319   | --locals | --local | --loca | --loc | --lo)
320     ac_prev=localstatedir ;;
321   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
322   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
323   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
324     localstatedir="$ac_optarg" ;;
325
326   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
327     ac_prev=mandir ;;
328   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
329     mandir="$ac_optarg" ;;
330
331   -nfp | --nfp | --nf)
332     # Obsolete; use --without-fp.
333     with_fp=no ;;
334
335   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
336   | --no-cr | --no-c)
337     no_create=yes ;;
338
339   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
340   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
341     no_recursion=yes ;;
342
343   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
344   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
345   | --oldin | --oldi | --old | --ol | --o)
346     ac_prev=oldincludedir ;;
347   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
348   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
349   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
350     oldincludedir="$ac_optarg" ;;
351
352   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
353     ac_prev=prefix ;;
354   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
355     prefix="$ac_optarg" ;;
356
357   -program-prefix | --program-prefix | --program-prefi | --program-pref \
358   | --program-pre | --program-pr | --program-p)
359     ac_prev=program_prefix ;;
360   -program-prefix=* | --program-prefix=* | --program-prefi=* \
361   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
362     program_prefix="$ac_optarg" ;;
363
364   -program-suffix | --program-suffix | --program-suffi | --program-suff \
365   | --program-suf | --program-su | --program-s)
366     ac_prev=program_suffix ;;
367   -program-suffix=* | --program-suffix=* | --program-suffi=* \
368   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
369     program_suffix="$ac_optarg" ;;
370
371   -program-transform-name | --program-transform-name \
372   | --program-transform-nam | --program-transform-na \
373   | --program-transform-n | --program-transform- \
374   | --program-transform | --program-transfor \
375   | --program-transfo | --program-transf \
376   | --program-trans | --program-tran \
377   | --progr-tra | --program-tr | --program-t)
378     ac_prev=program_transform_name ;;
379   -program-transform-name=* | --program-transform-name=* \
380   | --program-transform-nam=* | --program-transform-na=* \
381   | --program-transform-n=* | --program-transform-=* \
382   | --program-transform=* | --program-transfor=* \
383   | --program-transfo=* | --program-transf=* \
384   | --program-trans=* | --program-tran=* \
385   | --progr-tra=* | --program-tr=* | --program-t=*)
386     program_transform_name="$ac_optarg" ;;
387
388   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
389   | -silent | --silent | --silen | --sile | --sil)
390     silent=yes ;;
391
392   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
393     ac_prev=sbindir ;;
394   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
395   | --sbi=* | --sb=*)
396     sbindir="$ac_optarg" ;;
397
398   -sharedstatedir | --sharedstatedir | --sharedstatedi \
399   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
400   | --sharedst | --shareds | --shared | --share | --shar \
401   | --sha | --sh)
402     ac_prev=sharedstatedir ;;
403   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
404   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
405   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
406   | --sha=* | --sh=*)
407     sharedstatedir="$ac_optarg" ;;
408
409   -site | --site | --sit)
410     ac_prev=site ;;
411   -site=* | --site=* | --sit=*)
412     site="$ac_optarg" ;;
413
414   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
415     ac_prev=srcdir ;;
416   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
417     srcdir="$ac_optarg" ;;
418
419   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
420   | --syscon | --sysco | --sysc | --sys | --sy)
421     ac_prev=sysconfdir ;;
422   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
423   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
424     sysconfdir="$ac_optarg" ;;
425
426   -target | --target | --targe | --targ | --tar | --ta | --t)
427     ac_prev=target ;;
428   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
429     target="$ac_optarg" ;;
430
431   -v | -verbose | --verbose | --verbos | --verbo | --verb)
432     verbose=yes ;;
433
434   -version | --version | --versio | --versi | --vers)
435     echo "configure generated by autoconf version 2.13"
436     exit 0 ;;
437
438   -with-* | --with-*)
439     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
440     # Reject names that are not valid shell variable names.
441     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
442       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
443     fi
444     ac_package=`echo $ac_package| sed 's/-/_/g'`
445     case "$ac_option" in
446       *=*) ;;
447       *) ac_optarg=yes ;;
448     esac
449     eval "with_${ac_package}='$ac_optarg'" ;;
450
451   -without-* | --without-*)
452     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
453     # Reject names that are not valid shell variable names.
454     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
455       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
456     fi
457     ac_package=`echo $ac_package| sed 's/-/_/g'`
458     eval "with_${ac_package}=no" ;;
459
460   --x)
461     # Obsolete; use --with-x.
462     with_x=yes ;;
463
464   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
465   | --x-incl | --x-inc | --x-in | --x-i)
466     ac_prev=x_includes ;;
467   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
468   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
469     x_includes="$ac_optarg" ;;
470
471   -x-libraries | --x-libraries | --x-librarie | --x-librari \
472   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
473     ac_prev=x_libraries ;;
474   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
475   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
476     x_libraries="$ac_optarg" ;;
477
478   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
479     ;;
480
481   *)
482     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
483       echo "configure: warning: $ac_option: invalid host type" 1>&2
484     fi
485     if test "x$nonopt" != xNONE; then
486       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
487     fi
488     nonopt="$ac_option"
489     ;;
490
491   esac
492 done
493
494 if test -n "$ac_prev"; then
495   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
496 fi
497
498 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
499
500 # File descriptor usage:
501 # 0 standard input
502 # 1 file creation
503 # 2 errors and warnings
504 # 3 some systems may open it to /dev/tty
505 # 4 used on the Kubota Titan
506 # 6 checking for... messages and results
507 # 5 compiler messages saved in config.log
508 if test "$silent" = yes; then
509   exec 6>/dev/null
510 else
511   exec 6>&1
512 fi
513 exec 5>./config.log
514
515 echo "\
516 This file contains any messages produced by compilers while
517 running configure, to aid debugging if configure makes a mistake.
518 " 1>&5
519
520 # Strip out --no-create and --no-recursion so they do not pile up.
521 # Also quote any args containing shell metacharacters.
522 ac_configure_args=
523 for ac_arg
524 do
525   case "$ac_arg" in
526   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
527   | --no-cr | --no-c) ;;
528   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
529   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
530   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
531   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
532   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
533   esac
534 done
535
536 # NLS nuisances.
537 # Only set these to C if already set.  These must not be set unconditionally
538 # because not all systems understand e.g. LANG=C (notably SCO).
539 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
540 # Non-C LC_CTYPE values break the ctype check.
541 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
542 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
543 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
544 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
545
546 # confdefs.h avoids OS command line length limits that DEFS can exceed.
547 rm -rf conftest* confdefs.h
548 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
549 echo > confdefs.h
550
551 # A filename unique to this package, relative to the directory that
552 # configure is in, which we can look for to find out if srcdir is correct.
553 ac_unique_file=build/version
554
555 # Find the source files, if location was not specified.
556 if test -z "$srcdir"; then
557   ac_srcdir_defaulted=yes
558   # Try the directory containing this script, then its parent.
559   ac_prog=$0
560   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
561   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
562   srcdir=$ac_confdir
563   if test ! -r $srcdir/$ac_unique_file; then
564     srcdir=..
565   fi
566 else
567   ac_srcdir_defaulted=no
568 fi
569 if test ! -r $srcdir/$ac_unique_file; then
570   if test "$ac_srcdir_defaulted" = yes; then
571     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
572   else
573     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
574   fi
575 fi
576 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
577
578 # Prefer explicitly selected file to automatically selected ones.
579 if test -z "$CONFIG_SITE"; then
580   if test "x$prefix" != xNONE; then
581     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
582   else
583     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
584   fi
585 fi
586 for ac_site_file in $CONFIG_SITE; do
587   if test -r "$ac_site_file"; then
588     echo "loading site script $ac_site_file"
589     . "$ac_site_file"
590   fi
591 done
592
593
594 ac_ext=c
595 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
596 ac_cpp='$CPP $CPPFLAGS'
597 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
598 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
599 cross_compiling=$ac_cv_prog_cc_cross
600
601 ac_exeext=
602 ac_objext=o
603 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
604   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
605   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
606     ac_n= ac_c='
607 ' ac_t='        '
608   else
609     ac_n=-n ac_c= ac_t=
610   fi
611 else
612   ac_n= ac_c='\c' ac_t=
613 fi
614
615 ac_aux_dir=
616 for ac_dir in build $srcdir/build; do
617   if test -f $ac_dir/install-sh; then
618     ac_aux_dir=$ac_dir
619     ac_install_sh="$ac_aux_dir/install-sh -c"
620     break
621   elif test -f $ac_dir/install.sh; then
622     ac_aux_dir=$ac_dir
623     ac_install_sh="$ac_aux_dir/install.sh -c"
624     break
625   fi
626 done
627 if test -z "$ac_aux_dir"; then
628   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
629 fi
630 ac_config_guess=$ac_aux_dir/config.guess
631 ac_config_sub=$ac_aux_dir/config.sub
632 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
633
634 OL_VERSION=`cat $ac_aux_dir/version`
635 if test -z "$OL_VERSION"; then
636         { echo "configure: error: could not determine version" 1>&2; exit 1; }
637 fi
638
639
640 # Do some error checking and defaulting for the host and target type.
641 # The inputs are:
642 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
643 #
644 # The rules are:
645 # 1. You are not allowed to specify --host, --target, and nonopt at the
646 #    same time.
647 # 2. Host defaults to nonopt.
648 # 3. If nonopt is not specified, then host defaults to the current host,
649 #    as determined by config.guess.
650 # 4. Target and build default to nonopt.
651 # 5. If nonopt is not specified, then target and build default to host.
652
653 # The aliases save the names the user supplied, while $host etc.
654 # will get canonicalized.
655 case $host---$target---$nonopt in
656 NONE---*---* | *---NONE---* | *---*---NONE) ;;
657 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
658 esac
659
660
661 # Make sure we can run config.sub.
662 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
663 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
664 fi
665
666 echo $ac_n "checking host system type""... $ac_c" 1>&6
667 echo "configure:668: checking host system type" >&5
668
669 host_alias=$host
670 case "$host_alias" in
671 NONE)
672   case $nonopt in
673   NONE)
674     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
675     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
676     fi ;;
677   *) host_alias=$nonopt ;;
678   esac ;;
679 esac
680
681 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
682 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
683 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
684 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
685 echo "$ac_t""$host" 1>&6
686
687 echo $ac_n "checking target system type""... $ac_c" 1>&6
688 echo "configure:689: checking target system type" >&5
689
690 target_alias=$target
691 case "$target_alias" in
692 NONE)
693   case $nonopt in
694   NONE) target_alias=$host_alias ;;
695   *) target_alias=$nonopt ;;
696   esac ;;
697 esac
698
699 target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
700 target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
701 target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
702 target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
703 echo "$ac_t""$target" 1>&6
704
705 echo $ac_n "checking build system type""... $ac_c" 1>&6
706 echo "configure:707: checking build system type" >&5
707
708 build_alias=$build
709 case "$build_alias" in
710 NONE)
711   case $nonopt in
712   NONE) build_alias=$host_alias ;;
713   *) build_alias=$nonopt ;;
714   esac ;;
715 esac
716
717 build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
718 build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
719 build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
720 build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
721 echo "$ac_t""$build" 1>&6
722
723 test "$host_alias" != "$target_alias" &&
724   test "$program_prefix$program_suffix$program_transform_name" = \
725     NONENONEs,x,x, &&
726   program_prefix=${target_alias}-
727
728
729 # Find a good install program.  We prefer a C program (faster),
730 # so one script is as good as another.  But avoid the broken or
731 # incompatible versions:
732 # SysV /etc/install, /usr/sbin/install
733 # SunOS /usr/etc/install
734 # IRIX /sbin/install
735 # AIX /bin/install
736 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
737 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
738 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
739 # ./install, which can be erroneously created by make from ./install.sh.
740 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
741 echo "configure:742: checking for a BSD compatible install" >&5
742 if test -z "$INSTALL"; then
743 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
744   echo $ac_n "(cached) $ac_c" 1>&6
745 else
746     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
747   for ac_dir in $PATH; do
748     # Account for people who put trailing slashes in PATH elements.
749     case "$ac_dir/" in
750     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
751     *)
752       # OSF1 and SCO ODT 3.0 have their own names for install.
753       # Don't use installbsd from OSF since it installs stuff as root
754       # by default.
755       for ac_prog in ginstall scoinst install; do
756         if test -f $ac_dir/$ac_prog; then
757           if test $ac_prog = install &&
758             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
759             # AIX install.  It has an incompatible calling convention.
760             :
761           else
762             ac_cv_path_install="$ac_dir/$ac_prog -c"
763             break 2
764           fi
765         fi
766       done
767       ;;
768     esac
769   done
770   IFS="$ac_save_IFS"
771
772 fi
773   if test "${ac_cv_path_install+set}" = set; then
774     INSTALL="$ac_cv_path_install"
775   else
776     # As a last resort, use the slow shell script.  We don't cache a
777     # path for INSTALL within a source directory, because that will
778     # break other packages using the cache if that directory is
779     # removed, or if the path is relative.
780     INSTALL="$ac_install_sh"
781   fi
782 fi
783 echo "$ac_t""$INSTALL" 1>&6
784
785 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
786 # It thinks the first close brace ends the variable substitution.
787 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
788
789 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
790
791 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
792
793 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
794 echo "configure:795: checking whether build environment is sane" >&5
795 # Just in case
796 sleep 1
797 echo timestamp > conftestfile
798 # Do `set' in a subshell so we don't clobber the current shell's
799 # arguments.  Must try -L first in case configure is actually a
800 # symlink; some systems play weird games with the mod time of symlinks
801 # (eg FreeBSD returns the mod time of the symlink's containing
802 # directory).
803 if (
804    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
805    if test "$*" = "X"; then
806       # -L didn't work.
807       set X `ls -t $srcdir/configure conftestfile`
808    fi
809    if test "$*" != "X $srcdir/configure conftestfile" \
810       && test "$*" != "X conftestfile $srcdir/configure"; then
811
812       # If neither matched, then we have a broken ls.  This can happen
813       # if, for instance, CONFIG_SHELL is bash and it inherits a
814       # broken ls alias from the environment.  This has actually
815       # happened.  Such a system could not be considered "sane".
816       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
817 alias in your environment" 1>&2; exit 1; }
818    fi
819
820    test "$2" = conftestfile
821    )
822 then
823    # Ok.
824    :
825 else
826    { echo "configure: error: newly created file is older than distributed files!
827 Check your system clock" 1>&2; exit 1; }
828 fi
829 rm -f conftest*
830 echo "$ac_t""yes" 1>&6
831 if test "$program_transform_name" = s,x,x,; then
832   program_transform_name=
833 else
834   # Double any \ or $.  echo might interpret backslashes.
835   cat <<\EOF_SED > conftestsed
836 s,\\,\\\\,g; s,\$,$$,g
837 EOF_SED
838   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
839   rm -f conftestsed
840 fi
841 test "$program_prefix" != NONE &&
842   program_transform_name="s,^,${program_prefix},; $program_transform_name"
843 # Use a double $ so make ignores it.
844 test "$program_suffix" != NONE &&
845   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
846
847 # sed with no file args requires a program.
848 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
849
850 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
851 echo "configure:852: checking whether ${MAKE-make} sets \${MAKE}" >&5
852 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
853 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
854   echo $ac_n "(cached) $ac_c" 1>&6
855 else
856   cat > conftestmake <<\EOF
857 all:
858         @echo 'ac_maketemp="${MAKE}"'
859 EOF
860 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
861 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
862 if test -n "$ac_maketemp"; then
863   eval ac_cv_prog_make_${ac_make}_set=yes
864 else
865   eval ac_cv_prog_make_${ac_make}_set=no
866 fi
867 rm -f conftestmake
868 fi
869 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
870   echo "$ac_t""yes" 1>&6
871   SET_MAKE=
872 else
873   echo "$ac_t""no" 1>&6
874   SET_MAKE="MAKE=${MAKE-make}"
875 fi
876
877
878 PACKAGE=OpenLDAP
879
880 VERSION=$OL_VERSION
881
882 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
883   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
884 fi
885
886
887
888 missing_dir=`cd $ac_aux_dir && pwd`
889 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
890 echo "configure:891: checking for working aclocal" >&5
891 # Run test in a subshell; some versions of sh will print an error if
892 # an executable is not found, even if stderr is redirected.
893 # Redirect stdin to placate older versions of autoconf.  Sigh.
894 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
895    ACLOCAL=aclocal
896    echo "$ac_t""found" 1>&6
897 else
898    ACLOCAL="$missing_dir/missing aclocal"
899    echo "$ac_t""missing" 1>&6
900 fi
901
902 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
903 echo "configure:904: checking for working autoconf" >&5
904 # Run test in a subshell; some versions of sh will print an error if
905 # an executable is not found, even if stderr is redirected.
906 # Redirect stdin to placate older versions of autoconf.  Sigh.
907 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
908    AUTOCONF=autoconf
909    echo "$ac_t""found" 1>&6
910 else
911    AUTOCONF="$missing_dir/missing autoconf"
912    echo "$ac_t""missing" 1>&6
913 fi
914
915 echo $ac_n "checking for working automake""... $ac_c" 1>&6
916 echo "configure:917: checking for working automake" >&5
917 # Run test in a subshell; some versions of sh will print an error if
918 # an executable is not found, even if stderr is redirected.
919 # Redirect stdin to placate older versions of autoconf.  Sigh.
920 if (automake --version) < /dev/null > /dev/null 2>&1; then
921    AUTOMAKE=automake
922    echo "$ac_t""found" 1>&6
923 else
924    AUTOMAKE="$missing_dir/missing automake"
925    echo "$ac_t""missing" 1>&6
926 fi
927
928 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
929 echo "configure:930: checking for working autoheader" >&5
930 # Run test in a subshell; some versions of sh will print an error if
931 # an executable is not found, even if stderr is redirected.
932 # Redirect stdin to placate older versions of autoconf.  Sigh.
933 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
934    AUTOHEADER=autoheader
935    echo "$ac_t""found" 1>&6
936 else
937    AUTOHEADER="$missing_dir/missing autoheader"
938    echo "$ac_t""missing" 1>&6
939 fi
940
941 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
942 echo "configure:943: checking for working makeinfo" >&5
943 # Run test in a subshell; some versions of sh will print an error if
944 # an executable is not found, even if stderr is redirected.
945 # Redirect stdin to placate older versions of autoconf.  Sigh.
946 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
947    MAKEINFO=makeinfo
948    echo "$ac_t""found" 1>&6
949 else
950    MAKEINFO="$missing_dir/missing makeinfo"
951    echo "$ac_t""missing" 1>&6
952 fi
953
954
955
956 cat >> confdefs.h <<EOF
957 #define OPENLDAP_PACKAGE "$PACKAGE"
958 EOF
959
960 cat >> confdefs.h <<EOF
961 #define OPENLDAP_VERSION "$VERSION"
962 EOF
963
964
965
966
967 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
968 echo "configure:969: checking configure arguments" >&5
969
970
971 top_builddir=`pwd`
972
973 cat >> confdefs.h <<\EOF
974 #define HAVE_MKVERSION 1
975 EOF
976
977
978 ldap_subdir="openldap"
979
980 # Check whether --with-subdir or --without-subdir was given.
981 if test "${with_subdir+set}" = set; then
982   withval="$with_subdir"
983   
984         if test "$withval" = "no"; then
985                 ldap_subdir=""
986         elif test "$withval" != "yes"; then
987                 ldap_subdir="$withval"
988         fi
989
990 fi
991
992
993 # OpenLDAP --enable-debug
994         # Check whether --enable-debug or --disable-debug was given.
995 if test "${enable_debug+set}" = set; then
996   enableval="$enable_debug"
997   
998         ol_arg=invalid
999         for ol_val in auto yes no ; do
1000                 if test "$enableval" = "$ol_val" ; then
1001                         ol_arg="$ol_val"
1002                 fi
1003         done
1004         if test "$ol_arg" = "invalid" ; then
1005                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1006         fi
1007         ol_enable_debug="$ol_arg"
1008
1009 else
1010         ol_enable_debug="yes"
1011 fi
1012 # end --enable-debug
1013 # OpenLDAP --enable-syslog
1014         # Check whether --enable-syslog or --disable-syslog was given.
1015 if test "${enable_syslog+set}" = set; then
1016   enableval="$enable_syslog"
1017   
1018         ol_arg=invalid
1019         for ol_val in auto yes no ; do
1020                 if test "$enableval" = "$ol_val" ; then
1021                         ol_arg="$ol_val"
1022                 fi
1023         done
1024         if test "$ol_arg" = "invalid" ; then
1025                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1026         fi
1027         ol_enable_syslog="$ol_arg"
1028
1029 else
1030         ol_enable_syslog="auto"
1031 fi
1032 # end --enable-syslog
1033 # OpenLDAP --enable-proctitle
1034         # Check whether --enable-proctitle or --disable-proctitle was given.
1035 if test "${enable_proctitle+set}" = set; then
1036   enableval="$enable_proctitle"
1037   
1038         ol_arg=invalid
1039         for ol_val in auto yes no ; do
1040                 if test "$enableval" = "$ol_val" ; then
1041                         ol_arg="$ol_val"
1042                 fi
1043         done
1044         if test "$ol_arg" = "invalid" ; then
1045                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1046         fi
1047         ol_enable_proctitle="$ol_arg"
1048
1049 else
1050         ol_enable_proctitle="yes"
1051 fi
1052 # end --enable-proctitle
1053 # OpenLDAP --enable-cache
1054         # Check whether --enable-cache or --disable-cache was given.
1055 if test "${enable_cache+set}" = set; then
1056   enableval="$enable_cache"
1057   
1058         ol_arg=invalid
1059         for ol_val in auto yes no ; do
1060                 if test "$enableval" = "$ol_val" ; then
1061                         ol_arg="$ol_val"
1062                 fi
1063         done
1064         if test "$ol_arg" = "invalid" ; then
1065                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1066         fi
1067         ol_enable_cache="$ol_arg"
1068
1069 else
1070         ol_enable_cache="yes"
1071 fi
1072 # end --enable-cache
1073 # OpenLDAP --enable-dns
1074         # Check whether --enable-dns or --disable-dns was given.
1075 if test "${enable_dns+set}" = set; then
1076   enableval="$enable_dns"
1077   
1078         ol_arg=invalid
1079         for ol_val in auto yes no ; do
1080                 if test "$enableval" = "$ol_val" ; then
1081                         ol_arg="$ol_val"
1082                 fi
1083         done
1084         if test "$ol_arg" = "invalid" ; then
1085                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
1086         fi
1087         ol_enable_dns="$ol_arg"
1088
1089 else
1090         ol_enable_dns="no"
1091 fi
1092 # end --enable-dns
1093 # OpenLDAP --enable-referrals
1094         # Check whether --enable-referrals or --disable-referrals was given.
1095 if test "${enable_referrals+set}" = set; then
1096   enableval="$enable_referrals"
1097   
1098         ol_arg=invalid
1099         for ol_val in auto yes no ; do
1100                 if test "$enableval" = "$ol_val" ; then
1101                         ol_arg="$ol_val"
1102                 fi
1103         done
1104         if test "$ol_arg" = "invalid" ; then
1105                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1106         fi
1107         ol_enable_referrals="$ol_arg"
1108
1109 else
1110         ol_enable_referrals="yes"
1111 fi
1112 # end --enable-referrals
1113 # OpenLDAP --enable-cldap
1114         # Check whether --enable-cldap or --disable-cldap was given.
1115 if test "${enable_cldap+set}" = set; then
1116   enableval="$enable_cldap"
1117   
1118         ol_arg=invalid
1119         for ol_val in auto yes no ; do
1120                 if test "$enableval" = "$ol_val" ; then
1121                         ol_arg="$ol_val"
1122                 fi
1123         done
1124         if test "$ol_arg" = "invalid" ; then
1125                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1126         fi
1127         ol_enable_cldap="$ol_arg"
1128
1129 else
1130         ol_enable_cldap="no"
1131 fi
1132 # end --enable-cldap
1133 # OpenLDAP --enable-x_compile
1134         # Check whether --enable-x_compile or --disable-x_compile was given.
1135 if test "${enable_x_compile+set}" = set; then
1136   enableval="$enable_x_compile"
1137   
1138         ol_arg=invalid
1139         for ol_val in yes no ; do
1140                 if test "$enableval" = "$ol_val" ; then
1141                         ol_arg="$ol_val"
1142                 fi
1143         done
1144         if test "$ol_arg" = "invalid" ; then
1145                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1146         fi
1147         ol_enable_x_compile="$ol_arg"
1148
1149 else
1150         ol_enable_x_compile="no"
1151 fi
1152 # end --enable-x_compile
1153
1154 # OpenLDAP --enable-dmalloc
1155         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1156 if test "${enable_dmalloc+set}" = set; then
1157   enableval="$enable_dmalloc"
1158   
1159         ol_arg=invalid
1160         for ol_val in auto yes no ; do
1161                 if test "$enableval" = "$ol_val" ; then
1162                         ol_arg="$ol_val"
1163                 fi
1164         done
1165         if test "$ol_arg" = "invalid" ; then
1166                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1167         fi
1168         ol_enable_dmalloc="$ol_arg"
1169
1170 else
1171         ol_enable_dmalloc="no"
1172 fi
1173 # end --enable-dmalloc
1174
1175 # OpenLDAP --with-kerberos
1176         # Check whether --with-kerberos or --without-kerberos was given.
1177 if test "${with_kerberos+set}" = set; then
1178   withval="$with_kerberos"
1179   
1180         ol_arg=invalid
1181         for ol_val in auto k5 k4 afs yes no ; do
1182                 if test "$withval" = "$ol_val" ; then
1183                         ol_arg="$ol_val"
1184                 fi
1185         done
1186         if test "$ol_arg" = "invalid" ; then
1187                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1188         fi
1189         ol_with_kerberos="$ol_arg"
1190
1191 else
1192         ol_with_kerberos="auto"
1193 fi
1194 # end --with-kerberos
1195
1196 # OpenLDAP --with-readline
1197         # Check whether --with-readline or --without-readline was given.
1198 if test "${with_readline+set}" = set; then
1199   withval="$with_readline"
1200   
1201         ol_arg=invalid
1202         for ol_val in auto yes no  ; do
1203                 if test "$withval" = "$ol_val" ; then
1204                         ol_arg="$ol_val"
1205                 fi
1206         done
1207         if test "$ol_arg" = "invalid" ; then
1208                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1209         fi
1210         ol_with_readline="$ol_arg"
1211
1212 else
1213         ol_with_readline="auto"
1214 fi
1215 # end --with-readline
1216
1217 # OpenLDAP --with-threads
1218         # Check whether --with-threads or --without-threads was given.
1219 if test "${with_threads+set}" = set; then
1220   withval="$with_threads"
1221   
1222         ol_arg=invalid
1223         for ol_val in auto posix mach lwp yes no manual  ; do
1224                 if test "$withval" = "$ol_val" ; then
1225                         ol_arg="$ol_val"
1226                 fi
1227         done
1228         if test "$ol_arg" = "invalid" ; then
1229                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1230         fi
1231         ol_with_threads="$ol_arg"
1232
1233 else
1234         ol_with_threads="auto"
1235 fi
1236 # end --with-threads
1237
1238 # OpenLDAP --with-tls
1239         # Check whether --with-tls or --without-tls was given.
1240 if test "${with_tls+set}" = set; then
1241   withval="$with_tls"
1242   
1243         ol_arg=invalid
1244         for ol_val in auto ssleay openssl yes no  ; do
1245                 if test "$withval" = "$ol_val" ; then
1246                         ol_arg="$ol_val"
1247                 fi
1248         done
1249         if test "$ol_arg" = "invalid" ; then
1250                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1251         fi
1252         ol_with_tls="$ol_arg"
1253
1254 else
1255         ol_with_tls="auto"
1256 fi
1257 # end --with-tls
1258
1259 # OpenLDAP --with-yielding_select
1260         # Check whether --with-yielding_select or --without-yielding_select was given.
1261 if test "${with_yielding_select+set}" = set; then
1262   withval="$with_yielding_select"
1263   
1264         ol_arg=invalid
1265         for ol_val in auto yes no manual  ; do
1266                 if test "$withval" = "$ol_val" ; then
1267                         ol_arg="$ol_val"
1268                 fi
1269         done
1270         if test "$ol_arg" = "invalid" ; then
1271                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1272         fi
1273         ol_with_yielding_select="$ol_arg"
1274
1275 else
1276         ol_with_yielding_select="auto"
1277 fi
1278 # end --with-yielding_select
1279
1280
1281
1282 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1283 if test "${with_xxldapdoptions+set}" = set; then
1284   withval="$with_xxldapdoptions"
1285   :
1286 fi
1287
1288 # OpenLDAP --enable-ldapd
1289         # Check whether --enable-ldapd or --disable-ldapd was given.
1290 if test "${enable_ldapd+set}" = set; then
1291   enableval="$enable_ldapd"
1292   
1293         ol_arg=invalid
1294         for ol_val in auto yes no ; do
1295                 if test "$enableval" = "$ol_val" ; then
1296                         ol_arg="$ol_val"
1297                 fi
1298         done
1299         if test "$ol_arg" = "invalid" ; then
1300                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1301         fi
1302         ol_enable_ldapd="$ol_arg"
1303
1304 else
1305         ol_enable_ldapd="no"
1306 fi
1307 # end --enable-ldapd
1308
1309 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1310 if test "${with_xxslapdoptions+set}" = set; then
1311   withval="$with_xxslapdoptions"
1312   :
1313 fi
1314
1315 # OpenLDAP --enable-slapd
1316         # Check whether --enable-slapd or --disable-slapd was given.
1317 if test "${enable_slapd+set}" = set; then
1318   enableval="$enable_slapd"
1319   
1320         ol_arg=invalid
1321         for ol_val in auto yes no ; do
1322                 if test "$enableval" = "$ol_val" ; then
1323                         ol_arg="$ol_val"
1324                 fi
1325         done
1326         if test "$ol_arg" = "invalid" ; then
1327                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1328         fi
1329         ol_enable_slapd="$ol_arg"
1330
1331 else
1332         ol_enable_slapd="yes"
1333 fi
1334 # end --enable-slapd
1335 # OpenLDAP --enable-cleartext
1336         # Check whether --enable-cleartext or --disable-cleartext was given.
1337 if test "${enable_cleartext+set}" = set; then
1338   enableval="$enable_cleartext"
1339   
1340         ol_arg=invalid
1341         for ol_val in auto yes no ; do
1342                 if test "$enableval" = "$ol_val" ; then
1343                         ol_arg="$ol_val"
1344                 fi
1345         done
1346         if test "$ol_arg" = "invalid" ; then
1347                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1348         fi
1349         ol_enable_cleartext="$ol_arg"
1350
1351 else
1352         ol_enable_cleartext="yes"
1353 fi
1354 # end --enable-cleartext
1355 # OpenLDAP --enable-crypt
1356         # Check whether --enable-crypt or --disable-crypt was given.
1357 if test "${enable_crypt+set}" = set; then
1358   enableval="$enable_crypt"
1359   
1360         ol_arg=invalid
1361         for ol_val in auto yes no ; do
1362                 if test "$enableval" = "$ol_val" ; then
1363                         ol_arg="$ol_val"
1364                 fi
1365         done
1366         if test "$ol_arg" = "invalid" ; then
1367                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1368         fi
1369         ol_enable_crypt="$ol_arg"
1370
1371 else
1372         ol_enable_crypt="auto"
1373 fi
1374 # end --enable-crypt
1375 # OpenLDAP --enable-modules
1376         # Check whether --enable-modules or --disable-modules was given.
1377 if test "${enable_modules+set}" = set; then
1378   enableval="$enable_modules"
1379   
1380         ol_arg=invalid
1381         for ol_val in auto yes no ; do
1382                 if test "$enableval" = "$ol_val" ; then
1383                         ol_arg="$ol_val"
1384                 fi
1385         done
1386         if test "$ol_arg" = "invalid" ; then
1387                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1388         fi
1389         ol_enable_modules="$ol_arg"
1390
1391 else
1392         ol_enable_modules="no"
1393 fi
1394 # end --enable-modules
1395 # OpenLDAP --enable-phonetic
1396         # Check whether --enable-phonetic or --disable-phonetic was given.
1397 if test "${enable_phonetic+set}" = set; then
1398   enableval="$enable_phonetic"
1399   
1400         ol_arg=invalid
1401         for ol_val in auto yes no ; do
1402                 if test "$enableval" = "$ol_val" ; then
1403                         ol_arg="$ol_val"
1404                 fi
1405         done
1406         if test "$ol_arg" = "invalid" ; then
1407                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1408         fi
1409         ol_enable_phonetic="$ol_arg"
1410
1411 else
1412         ol_enable_phonetic="no"
1413 fi
1414 # end --enable-phonetic
1415 # OpenLDAP --enable-rlookups
1416         # Check whether --enable-rlookups or --disable-rlookups was given.
1417 if test "${enable_rlookups+set}" = set; then
1418   enableval="$enable_rlookups"
1419   
1420         ol_arg=invalid
1421         for ol_val in auto yes no ; do
1422                 if test "$enableval" = "$ol_val" ; then
1423                         ol_arg="$ol_val"
1424                 fi
1425         done
1426         if test "$ol_arg" = "invalid" ; then
1427                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1428         fi
1429         ol_enable_rlookups="$ol_arg"
1430
1431 else
1432         ol_enable_rlookups="auto"
1433 fi
1434 # end --enable-rlookups
1435 # OpenLDAP --enable-wrappers
1436         # Check whether --enable-wrappers or --disable-wrappers was given.
1437 if test "${enable_wrappers+set}" = set; then
1438   enableval="$enable_wrappers"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no ; do
1442                 if test "$enableval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1448         fi
1449         ol_enable_wrappers="$ol_arg"
1450
1451 else
1452         ol_enable_wrappers="no"
1453 fi
1454 # end --enable-wrappers
1455
1456 # OpenLDAP --enable-bdb2
1457         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1458 if test "${enable_bdb2+set}" = set; then
1459   enableval="$enable_bdb2"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto yes no ; do
1463                 if test "$enableval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1469         fi
1470         ol_enable_bdb2="$ol_arg"
1471
1472 else
1473         ol_enable_bdb2="no"
1474 fi
1475 # end --enable-bdb2
1476 # OpenLDAP --with-bdb2_module
1477         # Check whether --with-bdb2_module or --without-bdb2_module was given.
1478 if test "${with_bdb2_module+set}" = set; then
1479   withval="$with_bdb2_module"
1480   
1481         ol_arg=invalid
1482         for ol_val in static dynamic ; do
1483                 if test "$withval" = "$ol_val" ; then
1484                         ol_arg="$ol_val"
1485                 fi
1486         done
1487         if test "$ol_arg" = "invalid" ; then
1488                 { echo "configure: error: bad value $withval for --with-bdb2_module" 1>&2; exit 1; }
1489         fi
1490         ol_with_bdb2_module="$ol_arg"
1491
1492 else
1493         ol_with_bdb2_module="static"
1494 fi
1495 # end --with-bdb2_module
1496
1497 # OpenLDAP --enable-ldap
1498         # Check whether --enable-ldap or --disable-ldap was given.
1499 if test "${enable_ldap+set}" = set; then
1500   enableval="$enable_ldap"
1501   
1502         ol_arg=invalid
1503         for ol_val in auto yes no ; do
1504                 if test "$enableval" = "$ol_val" ; then
1505                         ol_arg="$ol_val"
1506                 fi
1507         done
1508         if test "$ol_arg" = "invalid" ; then
1509                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1510         fi
1511         ol_enable_ldap="$ol_arg"
1512
1513 else
1514         ol_enable_ldap="no"
1515 fi
1516 # end --enable-ldap
1517 # OpenLDAP --with-ldap_module
1518         # Check whether --with-ldap_module or --without-ldap_module was given.
1519 if test "${with_ldap_module+set}" = set; then
1520   withval="$with_ldap_module"
1521   
1522         ol_arg=invalid
1523         for ol_val in static dynamic ; do
1524                 if test "$withval" = "$ol_val" ; then
1525                         ol_arg="$ol_val"
1526                 fi
1527         done
1528         if test "$ol_arg" = "invalid" ; then
1529                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1530         fi
1531         ol_with_ldap_module="$ol_arg"
1532
1533 else
1534         ol_with_ldap_module="static"
1535 fi
1536 # end --with-ldap_module
1537
1538 # OpenLDAP --enable-ldbm
1539         # Check whether --enable-ldbm or --disable-ldbm was given.
1540 if test "${enable_ldbm+set}" = set; then
1541   enableval="$enable_ldbm"
1542   
1543         ol_arg=invalid
1544         for ol_val in auto yes no ; do
1545                 if test "$enableval" = "$ol_val" ; then
1546                         ol_arg="$ol_val"
1547                 fi
1548         done
1549         if test "$ol_arg" = "invalid" ; then
1550                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1551         fi
1552         ol_enable_ldbm="$ol_arg"
1553
1554 else
1555         ol_enable_ldbm="yes"
1556 fi
1557 # end --enable-ldbm
1558 # OpenLDAP --with-ldbm_module
1559         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1560 if test "${with_ldbm_module+set}" = set; then
1561   withval="$with_ldbm_module"
1562   
1563         ol_arg=invalid
1564         for ol_val in static dynamic ; do
1565                 if test "$withval" = "$ol_val" ; then
1566                         ol_arg="$ol_val"
1567                 fi
1568         done
1569         if test "$ol_arg" = "invalid" ; then
1570                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1571         fi
1572         ol_with_ldbm_module="$ol_arg"
1573
1574 else
1575         ol_with_ldbm_module="static"
1576 fi
1577 # end --with-ldbm_module
1578
1579 # OpenLDAP --with-ldbm_api
1580         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1581 if test "${with_ldbm_api+set}" = set; then
1582   withval="$with_ldbm_api"
1583   
1584         ol_arg=invalid
1585         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1586                 if test "$withval" = "$ol_val" ; then
1587                         ol_arg="$ol_val"
1588                 fi
1589         done
1590         if test "$ol_arg" = "invalid" ; then
1591                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1592         fi
1593         ol_with_ldbm_api="$ol_arg"
1594
1595 else
1596         ol_with_ldbm_api="auto"
1597 fi
1598 # end --with-ldbm_api
1599
1600 # OpenLDAP --with-ldbm_type
1601         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1602 if test "${with_ldbm_type+set}" = set; then
1603   withval="$with_ldbm_type"
1604   
1605         ol_arg=invalid
1606         for ol_val in auto btree hash ; do
1607                 if test "$withval" = "$ol_val" ; then
1608                         ol_arg="$ol_val"
1609                 fi
1610         done
1611         if test "$ol_arg" = "invalid" ; then
1612                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1613         fi
1614         ol_with_ldbm_type="$ol_arg"
1615
1616 else
1617         ol_with_ldbm_type="auto"
1618 fi
1619 # end --with-ldbm_type
1620
1621
1622 # OpenLDAP --enable-passwd
1623         # Check whether --enable-passwd or --disable-passwd was given.
1624 if test "${enable_passwd+set}" = set; then
1625   enableval="$enable_passwd"
1626   
1627         ol_arg=invalid
1628         for ol_val in auto yes no ; do
1629                 if test "$enableval" = "$ol_val" ; then
1630                         ol_arg="$ol_val"
1631                 fi
1632         done
1633         if test "$ol_arg" = "invalid" ; then
1634                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1635         fi
1636         ol_enable_passwd="$ol_arg"
1637
1638 else
1639         ol_enable_passwd="no"
1640 fi
1641 # end --enable-passwd
1642 # OpenLDAP --with-passwd_module
1643         # Check whether --with-passwd_module or --without-passwd_module was given.
1644 if test "${with_passwd_module+set}" = set; then
1645   withval="$with_passwd_module"
1646   
1647         ol_arg=invalid
1648         for ol_val in static dynamic ; do
1649                 if test "$withval" = "$ol_val" ; then
1650                         ol_arg="$ol_val"
1651                 fi
1652         done
1653         if test "$ol_arg" = "invalid" ; then
1654                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1655         fi
1656         ol_with_passwd_module="$ol_arg"
1657
1658 else
1659         ol_with_passwd_module="static"
1660 fi
1661 # end --with-passwd_module
1662
1663 # OpenLDAP --enable-perl
1664         # Check whether --enable-perl or --disable-perl was given.
1665 if test "${enable_perl+set}" = set; then
1666   enableval="$enable_perl"
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-perl" 1>&2; exit 1; }
1676         fi
1677         ol_enable_perl="$ol_arg"
1678
1679 else
1680         ol_enable_perl="no"
1681 fi
1682 # end --enable-perl
1683 # OpenLDAP --with-perl_module
1684         # Check whether --with-perl_module or --without-perl_module was given.
1685 if test "${with_perl_module+set}" = set; then
1686   withval="$with_perl_module"
1687   
1688         ol_arg=invalid
1689         for ol_val in static dynamic ; do
1690                 if test "$withval" = "$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 $withval for --with-perl_module" 1>&2; exit 1; }
1696         fi
1697         ol_with_perl_module="$ol_arg"
1698
1699 else
1700         ol_with_perl_module="static"
1701 fi
1702 # end --with-perl_module
1703
1704 # OpenLDAP --enable-shell
1705         # Check whether --enable-shell or --disable-shell was given.
1706 if test "${enable_shell+set}" = set; then
1707   enableval="$enable_shell"
1708   
1709         ol_arg=invalid
1710         for ol_val in auto yes no ; do
1711                 if test "$enableval" = "$ol_val" ; then
1712                         ol_arg="$ol_val"
1713                 fi
1714         done
1715         if test "$ol_arg" = "invalid" ; then
1716                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1717         fi
1718         ol_enable_shell="$ol_arg"
1719
1720 else
1721         ol_enable_shell="no"
1722 fi
1723 # end --enable-shell
1724 # OpenLDAP --with-shell_module
1725         # Check whether --with-shell_module or --without-shell_module was given.
1726 if test "${with_shell_module+set}" = set; then
1727   withval="$with_shell_module"
1728   
1729         ol_arg=invalid
1730         for ol_val in static dynamic ; do
1731                 if test "$withval" = "$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 $withval for --with-shell_module" 1>&2; exit 1; }
1737         fi
1738         ol_with_shell_module="$ol_arg"
1739
1740 else
1741         ol_with_shell_module="static"
1742 fi
1743 # end --with-shell_module
1744
1745 # OpenLDAP --enable-tcl
1746         # Check whether --enable-tcl or --disable-tcl was given.
1747 if test "${enable_tcl+set}" = set; then
1748   enableval="$enable_tcl"
1749   
1750         ol_arg=invalid
1751         for ol_val in auto yes no ; do
1752                 if test "$enableval" = "$ol_val" ; then
1753                         ol_arg="$ol_val"
1754                 fi
1755         done
1756         if test "$ol_arg" = "invalid" ; then
1757                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1758         fi
1759         ol_enable_tcl="$ol_arg"
1760
1761 else
1762         ol_enable_tcl="no"
1763 fi
1764 # end --enable-tcl
1765 # OpenLDAP --with-tcl_module
1766         # Check whether --with-tcl_module or --without-tcl_module was given.
1767 if test "${with_tcl_module+set}" = set; then
1768   withval="$with_tcl_module"
1769   
1770         ol_arg=invalid
1771         for ol_val in static dynamic ; do
1772                 if test "$withval" = "$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 $withval for --with-tcl_module" 1>&2; exit 1; }
1778         fi
1779         ol_with_tcl_module="$ol_arg"
1780
1781 else
1782         ol_with_tcl_module="static"
1783 fi
1784 # end --with-tcl_module
1785
1786
1787 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1788 if test "${with_xxslurpdoptions+set}" = set; then
1789   withval="$with_xxslurpdoptions"
1790   :
1791 fi
1792
1793 # OpenLDAP --enable-slurpd
1794         # Check whether --enable-slurpd or --disable-slurpd was given.
1795 if test "${enable_slurpd+set}" = set; then
1796   enableval="$enable_slurpd"
1797   
1798         ol_arg=invalid
1799         for ol_val in auto yes no ; do
1800                 if test "$enableval" = "$ol_val" ; then
1801                         ol_arg="$ol_val"
1802                 fi
1803         done
1804         if test "$ol_arg" = "invalid" ; then
1805                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1806         fi
1807         ol_enable_slurpd="$ol_arg"
1808
1809 else
1810         ol_enable_slurpd="auto"
1811 fi
1812 # end --enable-slurpd
1813
1814 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1815 if test "${with_xxliboptions+set}" = set; then
1816   withval="$with_xxliboptions"
1817   :
1818 fi
1819
1820 # Check whether --enable-static or --disable-static was given.
1821 if test "${enable_static+set}" = set; then
1822   enableval="$enable_static"
1823   p=${PACKAGE-default}
1824 case "$enableval" in
1825 yes) enable_static=yes ;;
1826 no) enable_static=no ;;
1827 *)
1828   enable_static=no
1829   # Look at the argument we got.  We use all the common list separators.
1830   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1831   for pkg in $enableval; do
1832     if test "X$pkg" = "X$p"; then
1833       enable_static=yes
1834     fi
1835   done
1836   IFS="$ac_save_ifs"
1837   ;;
1838 esac
1839 else
1840   enable_static=yes
1841 fi
1842
1843 # Check whether --enable-shared or --disable-shared was given.
1844 if test "${enable_shared+set}" = set; then
1845   enableval="$enable_shared"
1846   p=${PACKAGE-default}
1847 case "$enableval" in
1848 yes) enable_shared=yes ;;
1849 no) enable_shared=no ;;
1850 *)
1851   enable_shared=no
1852   # Look at the argument we got.  We use all the common list separators.
1853   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1854   for pkg in $enableval; do
1855     if test "X$pkg" = "X$p"; then
1856       enable_shared=yes
1857     fi
1858   done
1859   IFS="$ac_save_ifs"
1860   ;;
1861 esac
1862 else
1863   enable_shared=yes
1864 fi
1865
1866
1867 # validate options
1868 if test $ol_enable_dns = yes ; then
1869         if test $ol_enable_referrals = no ; then
1870                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1871         fi
1872         if test $ol_enable_referrals = auto ; then
1873                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1874                 ol_enable_referrals=yes
1875         fi
1876 fi
1877
1878 if test $ol_enable_slapd = no ; then
1879                 if test $ol_enable_bdb2 = yes ; then
1880                 echo "configure: warning: slapd disabled, ignoring --enable-bdb2 argument" 1>&2
1881         fi
1882         if test $ol_enable_ldap = yes ; then
1883                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
1884         fi
1885         if test $ol_enable_ldbm = yes ; then
1886                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
1887         fi
1888         if test $ol_enable_passwd = yes ; then
1889                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
1890         fi
1891         if test $ol_enable_perl = yes ; then
1892                 echo "configure: warning: slapd disabled, ignoring --enable-perl argument" 1>&2
1893         fi
1894         if test $ol_enable_shell = yes ; then
1895                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
1896         fi
1897         if test $ol_enable_tcl = yes ; then
1898                 echo "configure: warning: slapd disabled, ignoring --enable-tcl argument" 1>&2
1899         fi
1900         if test $ol_enable_modules = yes ; then
1901                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
1902         fi
1903         if test $ol_enable_wrappers = yes ; then
1904                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
1905         fi
1906         if test $ol_enable_phonetic = yes ; then
1907                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
1908         fi
1909         if test $ol_enable_rlookups = yes ; then
1910                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
1911         fi
1912         if test $ol_with_ldbm_api != auto ; then
1913                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
1914         fi
1915         if test $ol_with_ldbm_type != auto ; then
1916                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
1917         fi
1918         if test $ol_with_bdb2_module != static ; then
1919                 echo "configure: warning: slapd disabled, ignoring --with-bdb2-module argument" 1>&2
1920         fi
1921         if test $ol_with_ldap_module != static ; then
1922                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
1923         fi
1924         if test $ol_with_ldbm_module != static ; then
1925                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
1926         fi
1927         if test $ol_with_passwd_module != static ; then
1928                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
1929         fi
1930         if test $ol_with_perl_module != static ; then
1931                 echo "configure: warning: slapd disabled, ignoring --with-perl-module argument" 1>&2
1932         fi
1933         if test $ol_with_shell_module != static ; then
1934                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
1935         fi
1936         if test $ol_with_tcl_module != static ; then
1937                 echo "configure: warning: slapd disabled, ignoring --with-tcl-module argument" 1>&2
1938         fi
1939         if test $ol_enable_slurpd = yes ; then
1940                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1941         fi
1942
1943         # force settings to no
1944         ol_enable_bdb2=no
1945         ol_enable_ldap=no
1946         ol_enable_ldbm=no
1947         ol_enable_passwd=no
1948         ol_enable_perl=no
1949         ol_enable_shell=no
1950         ol_enable_tcl=no
1951
1952         ol_enable_modules=no
1953         ol_enable_phonetic=no
1954         ol_enable_rlookups=no
1955         ol_enable_wrappers=no
1956
1957         ol_with_ldbm_api=no
1958         ol_with_ldbm_type=no
1959
1960         ol_with_bdb2_module=static
1961         ol_with_ldap_module=static
1962         ol_with_ldbm_module=static
1963         ol_with_passwd_module=static
1964         ol_with_perl_module=static
1965         ol_with_shell_module=static
1966         ol_with_tcl_module=static
1967
1968         ol_enable_slurpd=no
1969
1970 elif test $ol_enable_ldbm = no ; then
1971         
1972         if test $ol_with_ldbm_api != auto ; then
1973                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
1974         fi
1975
1976         if test $ol_with_ldbm_type != auto ; then
1977                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
1978         fi
1979
1980         if test $ol_with_ldbm_module != static ; then
1981                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
1982         fi
1983
1984         if test $ol_enable_bdb2 = yes ; then
1985                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1986         fi
1987
1988         if test $ol_enable_modules != yes -a \
1989                 $ol_enable_ldap = no -a \
1990                 $ol_enable_passwd = no -a \
1991                 $ol_enable_perl = no -a \
1992                 $ol_enable_shell = no -a \
1993                 $ol_enable_tcl = no ; then
1994                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1995         fi
1996
1997         ol_with_ldbm_api=no
1998         ol_with_ldbm_type=no
1999         ol_with_ldbm_module=static
2000
2001 elif test $ol_enable_bdb2 = yes ; then
2002         
2003         if test $ol_with_ldbm_api != auto -a \
2004                 $ol_with_ldbm_api != db2 ; then
2005                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
2006         fi
2007
2008         ol_with_ldbm_api=db2
2009
2010 else
2011         
2012         if test $ol_enable_bdb2 != no ; then
2013                 if test $ol_with_ldbm_api != auto -a \
2014                         $ol_with_ldbm_api != db2 ; then
2015                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
2016                         ol_enable_bdb2=no
2017                 fi
2018         fi
2019
2020         if test $ol_with_ldbm_api = gdbm -a \
2021                 $ol_with_ldbm_type = btree ; then
2022                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2023         fi
2024         if test $ol_with_ldbm_api = mdbm -a \
2025                 $ol_with_ldbm_type = btree ; then
2026                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2027         fi
2028         if test $ol_with_ldbm_api = ndbm -a \
2029                 $ol_with_ldbm_type = btree ; then
2030                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2031         fi
2032 fi
2033
2034 if test $ol_enable_slurpd = yes ; then
2035                 if test $ol_with_threads = no ; then
2036                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2037         fi
2038 fi
2039
2040 echo "$ac_t""done" 1>&6
2041
2042 ## Initialize vars
2043 LDAP_LIBS=
2044 LDBM_LIBS=
2045 LTHREAD_LIBS=
2046 LUTIL_LIBS=
2047
2048 LDAPD_LIBS=
2049 SLAPD_LIBS=
2050 SLURPD_LIBS=
2051
2052 BUILD_LDAPD=no
2053 BUILD_SLAPD=no
2054 BUILD_SLURPD=no
2055
2056 BUILD_BDB2=no
2057 BUILD_LDAP=no
2058 BUILD_LDBM=no
2059 BUILD_PASSWD=no
2060 BUILD_PERL=no
2061 BUILD_SHELL=no
2062 BUILD_TCL=no
2063 BUILD_THREAD=no
2064
2065 BUILD_BDB2_DYNAMIC=no
2066 BUILD_LDAP_DYNAMIC=no
2067 BUILD_LDBM_DYNAMIC=no
2068 BUILD_PASSWD_DYNAMIC=no
2069 BUILD_PERL_DYNAMIC=no
2070 BUILD_SHELL_DYNAMIC=no
2071 BUILD_TCL_DYNAMIC=no
2072
2073 SLAPD_MODULES_LDFLAGS=
2074 SLAPD_MODULES_CPPFLAGS=
2075
2076 SLAPD_PERL_LDFLAGS=
2077 SLAPD_PERL_CPPFLAGS=
2078
2079 KRB_LIBS=
2080 READLINE_LIBS=
2081 TERMCAP_LIBS=
2082 TLS_LIBS=
2083
2084
2085
2086
2087 ol_aix_threads=no
2088 case "$target" in
2089 *-*-aix*)       if test -z "$CC" ; then
2090                 case "$ol_with_threads" in
2091                 auto | yes |  posix) ol_aix_threads=yes ;;
2092                 esac
2093         fi
2094 ;;
2095 esac
2096
2097 if test $ol_aix_threads = yes ; then
2098         if test -z "${CC}" ; then
2099                 for ac_prog in cc_r xlc_r cc
2100 do
2101 # Extract the first word of "$ac_prog", so it can be a program name with args.
2102 set dummy $ac_prog; ac_word=$2
2103 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2104 echo "configure:2105: checking for $ac_word" >&5
2105 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2106   echo $ac_n "(cached) $ac_c" 1>&6
2107 else
2108   if test -n "$CC"; then
2109   ac_cv_prog_CC="$CC" # Let the user override the test.
2110 else
2111   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2112   ac_dummy="$PATH"
2113   for ac_dir in $ac_dummy; do
2114     test -z "$ac_dir" && ac_dir=.
2115     if test -f $ac_dir/$ac_word; then
2116       ac_cv_prog_CC="$ac_prog"
2117       break
2118     fi
2119   done
2120   IFS="$ac_save_ifs"
2121 fi
2122 fi
2123 CC="$ac_cv_prog_CC"
2124 if test -n "$CC"; then
2125   echo "$ac_t""$CC" 1>&6
2126 else
2127   echo "$ac_t""no" 1>&6
2128 fi
2129
2130 test -n "$CC" && break
2131 done
2132
2133
2134                 if test "$CC" = cc ; then
2135                                                 if test $ol_with_threads != auto ; then
2136                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2137                         else
2138                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2139                         fi
2140                         ol_with_threads=no
2141                 fi
2142         fi
2143
2144         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2145                 ol_with_threads=posix
2146                 ol_cv_pthread_create=yes
2147         fi
2148 fi
2149
2150 if test -z "${CC}"; then
2151         for ac_prog in cc
2152 do
2153 # Extract the first word of "$ac_prog", so it can be a program name with args.
2154 set dummy $ac_prog; ac_word=$2
2155 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2156 echo "configure:2157: checking for $ac_word" >&5
2157 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2158   echo $ac_n "(cached) $ac_c" 1>&6
2159 else
2160   if test -n "$CC"; then
2161   ac_cv_prog_CC="$CC" # Let the user override the test.
2162 else
2163   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2164   ac_dummy="$PATH"
2165   for ac_dir in $ac_dummy; do
2166     test -z "$ac_dir" && ac_dir=.
2167     if test -f $ac_dir/$ac_word; then
2168       ac_cv_prog_CC="$ac_prog"
2169       break
2170     fi
2171   done
2172   IFS="$ac_save_ifs"
2173 fi
2174 fi
2175 CC="$ac_cv_prog_CC"
2176 if test -n "$CC"; then
2177   echo "$ac_t""$CC" 1>&6
2178 else
2179   echo "$ac_t""no" 1>&6
2180 fi
2181
2182 test -n "$CC" && break
2183 done
2184
2185 fi
2186
2187
2188 # Extract the first word of "ranlib", so it can be a program name with args.
2189 set dummy ranlib; ac_word=$2
2190 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2191 echo "configure:2192: checking for $ac_word" >&5
2192 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
2193   echo $ac_n "(cached) $ac_c" 1>&6
2194 else
2195   if test -n "$RANLIB"; then
2196   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2197 else
2198   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2199   ac_dummy="$PATH"
2200   for ac_dir in $ac_dummy; do
2201     test -z "$ac_dir" && ac_dir=.
2202     if test -f $ac_dir/$ac_word; then
2203       ac_cv_prog_RANLIB="ranlib"
2204       break
2205     fi
2206   done
2207   IFS="$ac_save_ifs"
2208   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2209 fi
2210 fi
2211 RANLIB="$ac_cv_prog_RANLIB"
2212 if test -n "$RANLIB"; then
2213   echo "$ac_t""$RANLIB" 1>&6
2214 else
2215   echo "$ac_t""no" 1>&6
2216 fi
2217
2218 # Extract the first word of "gcc", so it can be a program name with args.
2219 set dummy gcc; ac_word=$2
2220 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2221 echo "configure:2222: checking for $ac_word" >&5
2222 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2223   echo $ac_n "(cached) $ac_c" 1>&6
2224 else
2225   if test -n "$CC"; then
2226   ac_cv_prog_CC="$CC" # Let the user override the test.
2227 else
2228   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2229   ac_dummy="$PATH"
2230   for ac_dir in $ac_dummy; do
2231     test -z "$ac_dir" && ac_dir=.
2232     if test -f $ac_dir/$ac_word; then
2233       ac_cv_prog_CC="gcc"
2234       break
2235     fi
2236   done
2237   IFS="$ac_save_ifs"
2238 fi
2239 fi
2240 CC="$ac_cv_prog_CC"
2241 if test -n "$CC"; then
2242   echo "$ac_t""$CC" 1>&6
2243 else
2244   echo "$ac_t""no" 1>&6
2245 fi
2246
2247 if test -z "$CC"; then
2248   # Extract the first word of "cc", so it can be a program name with args.
2249 set dummy cc; ac_word=$2
2250 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2251 echo "configure:2252: checking for $ac_word" >&5
2252 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2253   echo $ac_n "(cached) $ac_c" 1>&6
2254 else
2255   if test -n "$CC"; then
2256   ac_cv_prog_CC="$CC" # Let the user override the test.
2257 else
2258   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2259   ac_prog_rejected=no
2260   ac_dummy="$PATH"
2261   for ac_dir in $ac_dummy; do
2262     test -z "$ac_dir" && ac_dir=.
2263     if test -f $ac_dir/$ac_word; then
2264       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2265         ac_prog_rejected=yes
2266         continue
2267       fi
2268       ac_cv_prog_CC="cc"
2269       break
2270     fi
2271   done
2272   IFS="$ac_save_ifs"
2273 if test $ac_prog_rejected = yes; then
2274   # We found a bogon in the path, so make sure we never use it.
2275   set dummy $ac_cv_prog_CC
2276   shift
2277   if test $# -gt 0; then
2278     # We chose a different compiler from the bogus one.
2279     # However, it has the same basename, so the bogon will be chosen
2280     # first if we set CC to just the basename; use the full file name.
2281     shift
2282     set dummy "$ac_dir/$ac_word" "$@"
2283     shift
2284     ac_cv_prog_CC="$@"
2285   fi
2286 fi
2287 fi
2288 fi
2289 CC="$ac_cv_prog_CC"
2290 if test -n "$CC"; then
2291   echo "$ac_t""$CC" 1>&6
2292 else
2293   echo "$ac_t""no" 1>&6
2294 fi
2295
2296   if test -z "$CC"; then
2297     case "`uname -s`" in
2298     *win32* | *WIN32*)
2299       # Extract the first word of "cl", so it can be a program name with args.
2300 set dummy cl; ac_word=$2
2301 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2302 echo "configure:2303: checking for $ac_word" >&5
2303 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
2304   echo $ac_n "(cached) $ac_c" 1>&6
2305 else
2306   if test -n "$CC"; then
2307   ac_cv_prog_CC="$CC" # Let the user override the test.
2308 else
2309   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2310   ac_dummy="$PATH"
2311   for ac_dir in $ac_dummy; do
2312     test -z "$ac_dir" && ac_dir=.
2313     if test -f $ac_dir/$ac_word; then
2314       ac_cv_prog_CC="cl"
2315       break
2316     fi
2317   done
2318   IFS="$ac_save_ifs"
2319 fi
2320 fi
2321 CC="$ac_cv_prog_CC"
2322 if test -n "$CC"; then
2323   echo "$ac_t""$CC" 1>&6
2324 else
2325   echo "$ac_t""no" 1>&6
2326 fi
2327  ;;
2328     esac
2329   fi
2330   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2331 fi
2332
2333 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2334 echo "configure:2335: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2335
2336 ac_ext=c
2337 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2338 ac_cpp='$CPP $CPPFLAGS'
2339 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2340 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2341 cross_compiling=$ac_cv_prog_cc_cross
2342
2343 cat > conftest.$ac_ext << EOF
2344
2345 #line 2346 "configure"
2346 #include "confdefs.h"
2347
2348 main(){return(0);}
2349 EOF
2350 if { (eval echo configure:2351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2351   ac_cv_prog_cc_works=yes
2352   # If we can't run a trivial program, we are probably using a cross compiler.
2353   if (./conftest; exit) 2>/dev/null; then
2354     ac_cv_prog_cc_cross=no
2355   else
2356     ac_cv_prog_cc_cross=yes
2357   fi
2358 else
2359   echo "configure: failed program was:" >&5
2360   cat conftest.$ac_ext >&5
2361   ac_cv_prog_cc_works=no
2362 fi
2363 rm -fr conftest*
2364 ac_ext=c
2365 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2366 ac_cpp='$CPP $CPPFLAGS'
2367 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2368 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2369 cross_compiling=$ac_cv_prog_cc_cross
2370
2371 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2372 if test $ac_cv_prog_cc_works = no; then
2373   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2374 fi
2375 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2376 echo "configure:2377: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2377 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2378 cross_compiling=$ac_cv_prog_cc_cross
2379
2380 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2381 echo "configure:2382: checking whether we are using GNU C" >&5
2382 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2383   echo $ac_n "(cached) $ac_c" 1>&6
2384 else
2385   cat > conftest.c <<EOF
2386 #ifdef __GNUC__
2387   yes;
2388 #endif
2389 EOF
2390 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2391   ac_cv_prog_gcc=yes
2392 else
2393   ac_cv_prog_gcc=no
2394 fi
2395 fi
2396
2397 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2398
2399 if test $ac_cv_prog_gcc = yes; then
2400   GCC=yes
2401 else
2402   GCC=
2403 fi
2404
2405 ac_test_CFLAGS="${CFLAGS+set}"
2406 ac_save_CFLAGS="$CFLAGS"
2407 CFLAGS=
2408 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2409 echo "configure:2410: checking whether ${CC-cc} accepts -g" >&5
2410 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2411   echo $ac_n "(cached) $ac_c" 1>&6
2412 else
2413   echo 'void f(){}' > conftest.c
2414 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2415   ac_cv_prog_cc_g=yes
2416 else
2417   ac_cv_prog_cc_g=no
2418 fi
2419 rm -f conftest*
2420
2421 fi
2422
2423 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2424 if test "$ac_test_CFLAGS" = set; then
2425   CFLAGS="$ac_save_CFLAGS"
2426 elif test $ac_cv_prog_cc_g = yes; then
2427   if test "$GCC" = yes; then
2428     CFLAGS="-g -O2"
2429   else
2430     CFLAGS="-g"
2431   fi
2432 else
2433   if test "$GCC" = yes; then
2434     CFLAGS="-O2"
2435   else
2436     CFLAGS=
2437   fi
2438 fi
2439
2440 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2441 if test "${with_gnu_ld+set}" = set; then
2442   withval="$with_gnu_ld"
2443   test "$withval" = no || with_gnu_ld=yes
2444 else
2445   with_gnu_ld=no
2446 fi
2447
2448
2449 ac_prog=ld
2450 if test "$ac_cv_prog_gcc" = yes; then
2451   # Check if gcc -print-prog-name=ld gives a path.
2452   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2453 echo "configure:2454: checking for ld used by GCC" >&5
2454   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2455   case "$ac_prog" in
2456   # Accept absolute paths.
2457   /* | A-Za-z:\\*)
2458     test -z "$LD" && LD="$ac_prog"
2459     ;;
2460   "")
2461     # If it fails, then pretend we aren't using GCC.
2462     ac_prog=ld
2463     ;;
2464   *)
2465     # If it is relative, then search for the first ld in PATH.
2466     with_gnu_ld=unknown
2467     ;;
2468   esac
2469 elif test "$with_gnu_ld" = yes; then
2470   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2471 echo "configure:2472: checking for GNU ld" >&5
2472 else
2473   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2474 echo "configure:2475: checking for non-GNU ld" >&5
2475 fi
2476 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2477   echo $ac_n "(cached) $ac_c" 1>&6
2478 else
2479   if test -z "$LD"; then
2480   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2481   for ac_dir in $PATH; do
2482     test -z "$ac_dir" && ac_dir=.
2483     if test -f "$ac_dir/$ac_prog"; then
2484       ac_cv_path_LD="$ac_dir/$ac_prog"
2485       # Check to see if the program is GNU ld.  I'd rather use --version,
2486       # but apparently some GNU ld's only accept -v.
2487       # Break only if it was the GNU/non-GNU ld that we prefer.
2488       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2489         test "$with_gnu_ld" != no && break
2490       else
2491         test "$with_gnu_ld" != yes && break
2492       fi
2493     fi
2494   done
2495   IFS="$ac_save_ifs"
2496 else
2497   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2498 fi
2499 fi
2500
2501 LD="$ac_cv_path_LD"
2502 if test -n "$LD"; then
2503   echo "$ac_t""$LD" 1>&6
2504 else
2505   echo "$ac_t""no" 1>&6
2506 fi
2507 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2508
2509 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2510 echo "configure:2511: checking if the linker ($LD) is GNU ld" >&5
2511 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2512   echo $ac_n "(cached) $ac_c" 1>&6
2513 else
2514   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2515 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2516   ac_cv_prog_gnu_ld=yes
2517 else
2518   ac_cv_prog_gnu_ld=no
2519 fi
2520 fi
2521
2522 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2523
2524
2525 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2526 echo "configure:2527: checking for BSD-compatible nm" >&5
2527 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2528   echo $ac_n "(cached) $ac_c" 1>&6
2529 else
2530   case "$NM" in
2531 /* | A-Za-z:\\*)
2532   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2533   ;;
2534 *)
2535   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2536   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2537     test -z "$ac_dir" && ac_dir=.
2538     if test -f $ac_dir/nm; then
2539       # Check to see if the nm accepts a BSD-compat flag.
2540       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2541       #   nm: unknown option "B" ignored
2542       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2543         ac_cv_path_NM="$ac_dir/nm -B"
2544       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2545         ac_cv_path_NM="$ac_dir/nm -p"
2546       else
2547         ac_cv_path_NM="$ac_dir/nm"
2548       fi
2549       break
2550     fi
2551   done
2552   IFS="$ac_save_ifs"
2553   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2554   ;;
2555 esac
2556 fi
2557
2558 NM="$ac_cv_path_NM"
2559 echo "$ac_t""$NM" 1>&6
2560
2561
2562 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2563 echo "configure:2564: checking whether ln -s works" >&5
2564 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2565   echo $ac_n "(cached) $ac_c" 1>&6
2566 else
2567   rm -f conftestdata
2568 if ln -s X conftestdata 2>/dev/null
2569 then
2570   rm -f conftestdata
2571   ac_cv_prog_LN_S="ln -s"
2572 else
2573   ac_cv_prog_LN_S=ln
2574 fi
2575 fi
2576 LN_S="$ac_cv_prog_LN_S"
2577 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2578   echo "$ac_t""yes" 1>&6
2579 else
2580   echo "$ac_t""no" 1>&6
2581 fi
2582
2583 # Always use our own libtool.
2584 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2585
2586 # Check for any special flags to pass to ltconfig.
2587 libtool_flags=
2588 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2589 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2590 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2591 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2592 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2593
2594 # Some flags need to be propagated to the compiler or linker for good
2595 # libtool support.
2596 case "$host" in
2597 *-*-irix6*)
2598   # Find out which ABI we are using.
2599   echo '#line 2600 "configure"' > conftest.$ac_ext
2600   if { (eval echo configure:2601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2601     case "`/usr/bin/file conftest.o`" in
2602     *32-bit*)
2603       LD="${LD-ld} -32"
2604       ;;
2605     *N32*)
2606       LD="${LD-ld} -n32"
2607       ;;
2608     *64-bit*)
2609       LD="${LD-ld} -64"
2610       ;;
2611     esac
2612   fi
2613   rm -rf conftest*
2614   ;;
2615
2616 *-*-sco3.2v5*)
2617   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2618   CFLAGS="$CFLAGS -belf"
2619   ;;
2620 esac
2621
2622 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2623 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2624 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2625 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2626 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2627 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2628
2629
2630 for ac_prog in mawk gawk nawk awk
2631 do
2632 # Extract the first word of "$ac_prog", so it can be a program name with args.
2633 set dummy $ac_prog; ac_word=$2
2634 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2635 echo "configure:2636: checking for $ac_word" >&5
2636 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2637   echo $ac_n "(cached) $ac_c" 1>&6
2638 else
2639   if test -n "$AWK"; then
2640   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2641 else
2642   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2643   ac_dummy="$PATH"
2644   for ac_dir in $ac_dummy; do
2645     test -z "$ac_dir" && ac_dir=.
2646     if test -f $ac_dir/$ac_word; then
2647       ac_cv_prog_AWK="$ac_prog"
2648       break
2649     fi
2650   done
2651   IFS="$ac_save_ifs"
2652 fi
2653 fi
2654 AWK="$ac_cv_prog_AWK"
2655 if test -n "$AWK"; then
2656   echo "$ac_t""$AWK" 1>&6
2657 else
2658   echo "$ac_t""no" 1>&6
2659 fi
2660
2661 test -n "$AWK" && break
2662 done
2663
2664 # test for ln hardlink support
2665 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2666 echo "configure:2667: checking whether ln works" >&5
2667 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2668   echo $ac_n "(cached) $ac_c" 1>&6
2669 else
2670   rm -f conftest.src conftest.dst
2671 echo "conftest" > conftest.src
2672 if ln conftest.src conftest.dst 2>/dev/null
2673 then
2674   ol_cv_prog_LN_H="ln"
2675 else
2676   ol_cv_prog_LN_H="cp"
2677 fi
2678 rm -f conftest.src conftest.dst
2679
2680 fi
2681 LN_H="$ol_cv_prog_LN_H"
2682 if test "$ol_cv_prog_LN_H" = "ln"; then
2683         echo "$ac_t""yes" 1>&6
2684 else
2685         echo "$ac_t""no" 1>&6
2686 fi
2687
2688 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2689 echo "configure:2690: checking whether ln -s works" >&5
2690 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2691   echo $ac_n "(cached) $ac_c" 1>&6
2692 else
2693   rm -f conftestdata
2694 if ln -s X conftestdata 2>/dev/null
2695 then
2696   rm -f conftestdata
2697   ac_cv_prog_LN_S="ln -s"
2698 else
2699   ac_cv_prog_LN_S=ln
2700 fi
2701 fi
2702 LN_S="$ac_cv_prog_LN_S"
2703 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2704   echo "$ac_t""yes" 1>&6
2705 else
2706   echo "$ac_t""no" 1>&6
2707 fi
2708
2709
2710 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2711         LN_S="$LN_H"
2712 fi
2713
2714 # Extract the first word of "sendmail", so it can be a program name with args.
2715 set dummy sendmail; ac_word=$2
2716 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2717 echo "configure:2718: checking for $ac_word" >&5
2718 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2719   echo $ac_n "(cached) $ac_c" 1>&6
2720 else
2721   case "$SENDMAIL" in
2722   /*)
2723   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2724   ;;
2725   ?:/*)                  
2726   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2727   ;;
2728   *)
2729   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2730   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2731   for ac_dir in $ac_dummy; do 
2732     test -z "$ac_dir" && ac_dir=.
2733     if test -f $ac_dir/$ac_word; then
2734       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2735       break
2736     fi
2737   done
2738   IFS="$ac_save_ifs"
2739   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2740   ;;
2741 esac
2742 fi
2743 SENDMAIL="$ac_cv_path_SENDMAIL"
2744 if test -n "$SENDMAIL"; then
2745   echo "$ac_t""$SENDMAIL" 1>&6
2746 else
2747   echo "$ac_t""no" 1>&6
2748 fi
2749
2750 # Extract the first word of "vi", so it can be a program name with args.
2751 set dummy vi; ac_word=$2
2752 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2753 echo "configure:2754: checking for $ac_word" >&5
2754 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2755   echo $ac_n "(cached) $ac_c" 1>&6
2756 else
2757   case "$EDITOR" in
2758   /*)
2759   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2760   ;;
2761   ?:/*)                  
2762   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2763   ;;
2764   *)
2765   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2766   ac_dummy="$PATH:/usr/ucb"
2767   for ac_dir in $ac_dummy; do 
2768     test -z "$ac_dir" && ac_dir=.
2769     if test -f $ac_dir/$ac_word; then
2770       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2771       break
2772     fi
2773   done
2774   IFS="$ac_save_ifs"
2775   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2776   ;;
2777 esac
2778 fi
2779 EDITOR="$ac_cv_path_EDITOR"
2780 if test -n "$EDITOR"; then
2781   echo "$ac_t""$EDITOR" 1>&6
2782 else
2783   echo "$ac_t""no" 1>&6
2784 fi
2785
2786 # Extract the first word of "finger", so it can be a program name with args.
2787 set dummy finger; ac_word=$2
2788 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2789 echo "configure:2790: checking for $ac_word" >&5
2790 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2791   echo $ac_n "(cached) $ac_c" 1>&6
2792 else
2793   case "$FINGER" in
2794   /*)
2795   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2796   ;;
2797   ?:/*)                  
2798   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2799   ;;
2800   *)
2801   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2802   ac_dummy="$PATH:/usr/ucb"
2803   for ac_dir in $ac_dummy; do 
2804     test -z "$ac_dir" && ac_dir=.
2805     if test -f $ac_dir/$ac_word; then
2806       ac_cv_path_FINGER="$ac_dir/$ac_word"
2807       break
2808     fi
2809   done
2810   IFS="$ac_save_ifs"
2811   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2812   ;;
2813 esac
2814 fi
2815 FINGER="$ac_cv_path_FINGER"
2816 if test -n "$FINGER"; then
2817   echo "$ac_t""$FINGER" 1>&6
2818 else
2819   echo "$ac_t""no" 1>&6
2820 fi
2821
2822
2823 ol_link_modules=no
2824 if test $ol_enable_modules != no ; then
2825         # Extract the first word of "glib-config", so it can be a program name with args.
2826 set dummy glib-config; ac_word=$2
2827 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2828 echo "configure:2829: checking for $ac_word" >&5
2829 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2830   echo $ac_n "(cached) $ac_c" 1>&6
2831 else
2832   case "$GLIBCONFIG" in
2833   /*)
2834   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2835   ;;
2836   ?:/*)                  
2837   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2838   ;;
2839   *)
2840   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2841   ac_dummy="$PATH"
2842   for ac_dir in $ac_dummy; do 
2843     test -z "$ac_dir" && ac_dir=.
2844     if test -f $ac_dir/$ac_word; then
2845       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2846       break
2847     fi
2848   done
2849   IFS="$ac_save_ifs"
2850   ;;
2851 esac
2852 fi
2853 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2854 if test -n "$GLIBCONFIG"; then
2855   echo "$ac_t""$GLIBCONFIG" 1>&6
2856 else
2857   echo "$ac_t""no" 1>&6
2858 fi
2859
2860
2861         if test "no$GLIBCONFIG" = "no" ; then
2862                 if test $ol_enable_modules = yes ; then
2863                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2864                 fi
2865
2866         else
2867                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2868                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2869                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2870
2871                                 ol_link_modules=yes
2872         fi
2873 else
2874         ol_with_bdb2_module=static
2875         ol_with_ldap_module=static
2876         ol_with_ldbm_module=static
2877         ol_with_passwd_module=static
2878         ol_with_perl_module=static
2879         ol_with_shell_module=static
2880         ol_with_tcl_module=static
2881 fi
2882
2883 ol_link_perl=no
2884 if test $ol_enable_perl != no ; then
2885         # Extract the first word of "perl", so it can be a program name with args.
2886 set dummy perl; ac_word=$2
2887 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2888 echo "configure:2889: checking for $ac_word" >&5
2889 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2890   echo $ac_n "(cached) $ac_c" 1>&6
2891 else
2892   case "$PERLBIN" in
2893   /*)
2894   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2895   ;;
2896   ?:/*)                  
2897   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2898   ;;
2899   *)
2900   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2901   ac_dummy="$PATH"
2902   for ac_dir in $ac_dummy; do 
2903     test -z "$ac_dir" && ac_dir=.
2904     if test -f $ac_dir/$ac_word; then
2905       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2906       break
2907     fi
2908   done
2909   IFS="$ac_save_ifs"
2910   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2911   ;;
2912 esac
2913 fi
2914 PERLBIN="$ac_cv_path_PERLBIN"
2915 if test -n "$PERLBIN"; then
2916   echo "$ac_t""$PERLBIN" 1>&6
2917 else
2918   echo "$ac_t""no" 1>&6
2919 fi
2920
2921
2922         if test "no$PERLBIN" = "no" ; then
2923                 if test $ol_enable_perl = yes ; then
2924                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2925                 fi
2926
2927         else
2928                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2929                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2930
2931                                 ol_link_perl=yes
2932         fi
2933 fi
2934
2935 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2936 echo "configure:2937: checking how to run the C preprocessor" >&5
2937 # On Suns, sometimes $CPP names a directory.
2938 if test -n "$CPP" && test -d "$CPP"; then
2939   CPP=
2940 fi
2941 if test -z "$CPP"; then
2942 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2943   echo $ac_n "(cached) $ac_c" 1>&6
2944 else
2945     # This must be in double quotes, not single quotes, because CPP may get
2946   # substituted into the Makefile and "${CC-cc}" will confuse make.
2947   CPP="${CC-cc} -E"
2948   # On the NeXT, cc -E runs the code through the compiler's parser,
2949   # not just through cpp.
2950   cat > conftest.$ac_ext <<EOF
2951 #line 2952 "configure"
2952 #include "confdefs.h"
2953 #include <assert.h>
2954 Syntax Error
2955 EOF
2956 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2957 { (eval echo configure:2958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2958 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2959 if test -z "$ac_err"; then
2960   :
2961 else
2962   echo "$ac_err" >&5
2963   echo "configure: failed program was:" >&5
2964   cat conftest.$ac_ext >&5
2965   rm -rf conftest*
2966   CPP="${CC-cc} -E -traditional-cpp"
2967   cat > conftest.$ac_ext <<EOF
2968 #line 2969 "configure"
2969 #include "confdefs.h"
2970 #include <assert.h>
2971 Syntax Error
2972 EOF
2973 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2974 { (eval echo configure:2975: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2975 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2976 if test -z "$ac_err"; then
2977   :
2978 else
2979   echo "$ac_err" >&5
2980   echo "configure: failed program was:" >&5
2981   cat conftest.$ac_ext >&5
2982   rm -rf conftest*
2983   CPP="${CC-cc} -nologo -E"
2984   cat > conftest.$ac_ext <<EOF
2985 #line 2986 "configure"
2986 #include "confdefs.h"
2987 #include <assert.h>
2988 Syntax Error
2989 EOF
2990 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2991 { (eval echo configure:2992: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2992 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2993 if test -z "$ac_err"; then
2994   :
2995 else
2996   echo "$ac_err" >&5
2997   echo "configure: failed program was:" >&5
2998   cat conftest.$ac_ext >&5
2999   rm -rf conftest*
3000   CPP=/lib/cpp
3001 fi
3002 rm -f conftest*
3003 fi
3004 rm -f conftest*
3005 fi
3006 rm -f conftest*
3007   ac_cv_prog_CPP="$CPP"
3008 fi
3009   CPP="$ac_cv_prog_CPP"
3010 else
3011   ac_cv_prog_CPP="$CPP"
3012 fi
3013 echo "$ac_t""$CPP" 1>&6
3014
3015
3016 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3017         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3018
3019 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3020         echo "configure: warning: programs compiled here do run here..." 1>&2
3021         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3022
3023 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3024         echo "configure: warning: programs compiled here do not run here..." 1>&2
3025         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3026 fi
3027
3028 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3029 echo "configure:3030: checking for AIX" >&5
3030 cat > conftest.$ac_ext <<EOF
3031 #line 3032 "configure"
3032 #include "confdefs.h"
3033 #ifdef _AIX
3034   yes
3035 #endif
3036
3037 EOF
3038 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3039   egrep "yes" >/dev/null 2>&1; then
3040   rm -rf conftest*
3041   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3042 #define _ALL_SOURCE 1
3043 EOF
3044
3045 else
3046   rm -rf conftest*
3047   echo "$ac_t""no" 1>&6
3048 fi
3049 rm -f conftest*
3050
3051
3052 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3053 echo "configure:3054: checking for POSIXized ISC" >&5
3054 if test -d /etc/conf/kconfig.d &&
3055   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3056 then
3057   echo "$ac_t""yes" 1>&6
3058   ISC=yes # If later tests want to check for ISC.
3059   cat >> confdefs.h <<\EOF
3060 #define _POSIX_SOURCE 1
3061 EOF
3062
3063   if test "$GCC" = yes; then
3064     CC="$CC -posix"
3065   else
3066     CC="$CC -Xp"
3067   fi
3068 else
3069   echo "$ac_t""no" 1>&6
3070   ISC=
3071 fi
3072
3073 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3074 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3075 echo "configure:3076: checking for minix/config.h" >&5
3076 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3077   echo $ac_n "(cached) $ac_c" 1>&6
3078 else
3079   cat > conftest.$ac_ext <<EOF
3080 #line 3081 "configure"
3081 #include "confdefs.h"
3082 #include <minix/config.h>
3083 EOF
3084 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3085 { (eval echo configure:3086: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3086 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3087 if test -z "$ac_err"; then
3088   rm -rf conftest*
3089   eval "ac_cv_header_$ac_safe=yes"
3090 else
3091   echo "$ac_err" >&5
3092   echo "configure: failed program was:" >&5
3093   cat conftest.$ac_ext >&5
3094   rm -rf conftest*
3095   eval "ac_cv_header_$ac_safe=no"
3096 fi
3097 rm -f conftest*
3098 fi
3099 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3100   echo "$ac_t""yes" 1>&6
3101   MINIX=yes
3102 else
3103   echo "$ac_t""no" 1>&6
3104 MINIX=
3105 fi
3106
3107 if test "$MINIX" = yes; then
3108   cat >> confdefs.h <<\EOF
3109 #define _POSIX_SOURCE 1
3110 EOF
3111
3112   cat >> confdefs.h <<\EOF
3113 #define _POSIX_1_SOURCE 2
3114 EOF
3115
3116   cat >> confdefs.h <<\EOF
3117 #define _MINIX 1
3118 EOF
3119
3120 fi
3121
3122
3123 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3124 echo "configure:3125: checking for be_app in -lbe" >&5
3125 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
3126 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3127   echo $ac_n "(cached) $ac_c" 1>&6
3128 else
3129   ac_save_LIBS="$LIBS"
3130 LIBS="-lbe -lroot -lnet $LIBS"
3131 cat > conftest.$ac_ext <<EOF
3132 #line 3133 "configure"
3133 #include "confdefs.h"
3134 /* Override any gcc2 internal prototype to avoid an error.  */
3135 /* We use char because int might match the return type of a gcc2
3136     builtin and then its argument prototype would still apply.  */
3137 char be_app();
3138
3139 int main() {
3140 be_app()
3141 ; return 0; }
3142 EOF
3143 if { (eval echo configure:3144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3144   rm -rf conftest*
3145   eval "ac_cv_lib_$ac_lib_var=yes"
3146 else
3147   echo "configure: failed program was:" >&5
3148   cat conftest.$ac_ext >&5
3149   rm -rf conftest*
3150   eval "ac_cv_lib_$ac_lib_var=no"
3151 fi
3152 rm -f conftest*
3153 LIBS="$ac_save_LIBS"
3154
3155 fi
3156 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3157   echo "$ac_t""yes" 1>&6
3158   LIBS="$LIBS -lbe -lroot -lnet"
3159 else
3160   echo "$ac_t""no" 1>&6
3161 :
3162 fi
3163
3164
3165 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3166 echo "configure:3167: checking for Cygwin environment" >&5
3167 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
3168   echo $ac_n "(cached) $ac_c" 1>&6
3169 else
3170   cat > conftest.$ac_ext <<EOF
3171 #line 3172 "configure"
3172 #include "confdefs.h"
3173
3174 int main() {
3175
3176 #ifndef __CYGWIN__
3177 #define __CYGWIN__ __CYGWIN32__
3178 #endif
3179 return __CYGWIN__;
3180 ; return 0; }
3181 EOF
3182 if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3183   rm -rf conftest*
3184   ac_cv_cygwin=yes
3185 else
3186   echo "configure: failed program was:" >&5
3187   cat conftest.$ac_ext >&5
3188   rm -rf conftest*
3189   ac_cv_cygwin=no
3190 fi
3191 rm -f conftest*
3192 rm -f conftest*
3193 fi
3194
3195 echo "$ac_t""$ac_cv_cygwin" 1>&6
3196 CYGWIN=
3197 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3198 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3199 echo "configure:3200: checking for mingw32 environment" >&5
3200 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
3201   echo $ac_n "(cached) $ac_c" 1>&6
3202 else
3203   cat > conftest.$ac_ext <<EOF
3204 #line 3205 "configure"
3205 #include "confdefs.h"
3206
3207 int main() {
3208 return __MINGW32__;
3209 ; return 0; }
3210 EOF
3211 if { (eval echo configure:3212: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3212   rm -rf conftest*
3213   ac_cv_mingw32=yes
3214 else
3215   echo "configure: failed program was:" >&5
3216   cat conftest.$ac_ext >&5
3217   rm -rf conftest*
3218   ac_cv_mingw32=no
3219 fi
3220 rm -f conftest*
3221 rm -f conftest*
3222 fi
3223
3224 echo "$ac_t""$ac_cv_mingw32" 1>&6
3225 MINGW32=
3226 test "$ac_cv_mingw32" = yes && MINGW32=yes
3227
3228
3229 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3230 echo "configure:3231: checking for executable suffix" >&5
3231 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
3232   echo $ac_n "(cached) $ac_c" 1>&6
3233 else
3234   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
3235   ac_cv_exeext=.exe
3236 else
3237   rm -f conftest*
3238   echo 'int main () { return 0; }' > conftest.$ac_ext
3239   ac_cv_exeext=
3240   if { (eval echo configure:3241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3241     for file in conftest.*; do
3242       case $file in
3243       *.c | *.o | *.obj) ;;
3244       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3245       esac
3246     done
3247   else
3248     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3249   fi
3250   rm -f conftest*
3251   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3252 fi
3253 fi
3254
3255 EXEEXT=""
3256 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3257 echo "$ac_t""${ac_cv_exeext}" 1>&6
3258 ac_exeext=$EXEEXT
3259
3260 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3261 echo "configure:3262: checking for object suffix" >&5
3262 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
3263   echo $ac_n "(cached) $ac_c" 1>&6
3264 else
3265   rm -f conftest*
3266 echo 'int i = 1;' > conftest.$ac_ext
3267 if { (eval echo configure:3268: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3268   for ac_file in conftest.*; do
3269     case $ac_file in
3270     *.c) ;;
3271     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3272     esac
3273   done
3274 else
3275   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3276 fi
3277 rm -f conftest*
3278 fi
3279
3280 echo "$ac_t""$ac_cv_objext" 1>&6
3281 OBJEXT=$ac_cv_objext
3282 ac_objext=$ac_cv_objext
3283
3284
3285 cat >> confdefs.h <<EOF
3286 #define EXEEXT "${EXEEXT}"
3287 EOF
3288
3289
3290
3291
3292
3293 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3294 echo "configure:3295: checking for ${CC-cc} option to accept ANSI C" >&5
3295 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
3296   echo $ac_n "(cached) $ac_c" 1>&6
3297 else
3298   am_cv_prog_cc_stdc=no
3299 ac_save_CC="$CC"
3300 # Don't try gcc -ansi; that turns off useful extensions and
3301 # breaks some systems' header files.
3302 # AIX                   -qlanglvl=ansi
3303 # Ultrix and OSF/1      -std1
3304 # HP-UX                 -Aa -D_HPUX_SOURCE
3305 # SVR4                  -Xc -D__EXTENSIONS__
3306 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3307 do
3308   CC="$ac_save_CC $ac_arg"
3309   cat > conftest.$ac_ext <<EOF
3310 #line 3311 "configure"
3311 #include "confdefs.h"
3312 #include <stdarg.h>
3313 #include <stdio.h>
3314 #include <sys/types.h>
3315 #include <sys/stat.h>
3316 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3317 struct buf { int x; };
3318 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3319 static char *e (p, i)
3320      char **p;
3321      int i;
3322 {
3323   return p[i];
3324 }
3325 static char *f (char * (*g) (char **, int), char **p, ...)
3326 {
3327   char *s;
3328   va_list v;
3329   va_start (v,p);
3330   s = g (p, va_arg (v,int));
3331   va_end (v);
3332   return s;
3333 }
3334 int test (int i, double x);
3335 struct s1 {int (*f) (int a);};
3336 struct s2 {int (*f) (double a);};
3337 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3338 int argc;
3339 char **argv;
3340
3341 int main() {
3342
3343 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3344
3345 ; return 0; }
3346 EOF
3347 if { (eval echo configure:3348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3348   rm -rf conftest*
3349   am_cv_prog_cc_stdc="$ac_arg"; break
3350 else
3351   echo "configure: failed program was:" >&5
3352   cat conftest.$ac_ext >&5
3353 fi
3354 rm -f conftest*
3355 done
3356 CC="$ac_save_CC"
3357
3358 fi
3359
3360 if test -z "$am_cv_prog_cc_stdc"; then
3361   echo "$ac_t""none needed" 1>&6
3362 else
3363   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3364 fi
3365 case "x$am_cv_prog_cc_stdc" in
3366   x|xno) ;;
3367   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3368 esac
3369
3370 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3371         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3372 fi
3373
3374
3375 # test for make depend flag
3376 OL_MKDEP=
3377 OL_MKDEP_FLAGS=
3378 if test -z "${MKDEP}"; then
3379         OL_MKDEP="${CC-cc}"
3380         if test -z "${MKDEP_FLAGS}"; then
3381                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3382 echo "configure:3383: checking for ${OL_MKDEP} depend flag" >&5
3383 if eval "test \"`echo '$''{'ol_cv_mkdep'+set}'`\" = set"; then
3384   echo $ac_n "(cached) $ac_c" 1>&6
3385 else
3386   
3387                         ol_cv_mkdep=no
3388                         for flag in "-M" "-xM"; do
3389                                 cat > conftest.c <<EOF
3390  noCode;
3391 EOF
3392                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3393: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3393                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3394                                 then
3395                                         if test ! -f conftest."${ac_object}" ; then
3396                                                 ol_cv_mkdep=$flag
3397                                                 OL_MKDEP_FLAGS="$flag"
3398                                                 break
3399                                         fi
3400                                 fi
3401                         done
3402                         rm -f conftest*
3403                 
3404 fi
3405
3406 echo "$ac_t""$ol_cv_mkdep" 1>&6
3407         else
3408                 cc_cv_mkdep=yes
3409                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3410         fi
3411 else
3412         cc_cv_mkdep=yes
3413         OL_MKDEP="${MKDEP}"
3414         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3415 fi
3416
3417
3418
3419 if test "${ol_cv_mkdep}" = no ; then
3420         # this will soon become an error
3421         echo "configure: warning: do not know how to generate dependencies" 1>&2
3422 fi
3423
3424
3425
3426 echo $ac_n "checking for socket""... $ac_c" 1>&6
3427 echo "configure:3428: checking for socket" >&5
3428 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3429   echo $ac_n "(cached) $ac_c" 1>&6
3430 else
3431   cat > conftest.$ac_ext <<EOF
3432 #line 3433 "configure"
3433 #include "confdefs.h"
3434 /* System header to define __stub macros and hopefully few prototypes,
3435     which can conflict with char socket(); below.  */
3436 #include <assert.h>
3437 /* Override any gcc2 internal prototype to avoid an error.  */
3438 /* We use char because int might match the return type of a gcc2
3439     builtin and then its argument prototype would still apply.  */
3440 char socket();
3441
3442 int main() {
3443
3444 /* The GNU C library defines this for functions which it implements
3445     to always fail with ENOSYS.  Some functions are actually named
3446     something starting with __ and the normal name is an alias.  */
3447 #if defined (__stub_socket) || defined (__stub___socket)
3448 choke me
3449 #else
3450 socket();
3451 #endif
3452
3453 ; return 0; }
3454 EOF
3455 if { (eval echo configure:3456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3456   rm -rf conftest*
3457   eval "ac_cv_func_socket=yes"
3458 else
3459   echo "configure: failed program was:" >&5
3460   cat conftest.$ac_ext >&5
3461   rm -rf conftest*
3462   eval "ac_cv_func_socket=no"
3463 fi
3464 rm -f conftest*
3465 fi
3466
3467 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3468   echo "$ac_t""yes" 1>&6
3469   :
3470 else
3471   echo "$ac_t""no" 1>&6
3472         
3473         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3474 echo "configure:3475: checking for main in -lsocket" >&5
3475 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3476 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3477   echo $ac_n "(cached) $ac_c" 1>&6
3478 else
3479   ac_save_LIBS="$LIBS"
3480 LIBS="-lsocket  $LIBS"
3481 cat > conftest.$ac_ext <<EOF
3482 #line 3483 "configure"
3483 #include "confdefs.h"
3484
3485 int main() {
3486 main()
3487 ; return 0; }
3488 EOF
3489 if { (eval echo configure:3490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3490   rm -rf conftest*
3491   eval "ac_cv_lib_$ac_lib_var=yes"
3492 else
3493   echo "configure: failed program was:" >&5
3494   cat conftest.$ac_ext >&5
3495   rm -rf conftest*
3496   eval "ac_cv_lib_$ac_lib_var=no"
3497 fi
3498 rm -f conftest*
3499 LIBS="$ac_save_LIBS"
3500
3501 fi
3502 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3503   echo "$ac_t""yes" 1>&6
3504     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3505     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3506   cat >> confdefs.h <<EOF
3507 #define $ac_tr_lib 1
3508 EOF
3509
3510   LIBS="-lsocket $LIBS"
3511
3512 else
3513   echo "$ac_t""no" 1>&6
3514 fi
3515
3516         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3517 echo "configure:3518: checking for main in -lnet" >&5
3518 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3519 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3520   echo $ac_n "(cached) $ac_c" 1>&6
3521 else
3522   ac_save_LIBS="$LIBS"
3523 LIBS="-lnet  $LIBS"
3524 cat > conftest.$ac_ext <<EOF
3525 #line 3526 "configure"
3526 #include "confdefs.h"
3527
3528 int main() {
3529 main()
3530 ; return 0; }
3531 EOF
3532 if { (eval echo configure:3533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3533   rm -rf conftest*
3534   eval "ac_cv_lib_$ac_lib_var=yes"
3535 else
3536   echo "configure: failed program was:" >&5
3537   cat conftest.$ac_ext >&5
3538   rm -rf conftest*
3539   eval "ac_cv_lib_$ac_lib_var=no"
3540 fi
3541 rm -f conftest*
3542 LIBS="$ac_save_LIBS"
3543
3544 fi
3545 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3546   echo "$ac_t""yes" 1>&6
3547     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3548     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3549   cat >> confdefs.h <<EOF
3550 #define $ac_tr_lib 1
3551 EOF
3552
3553   LIBS="-lnet $LIBS"
3554
3555 else
3556   echo "$ac_t""no" 1>&6
3557 fi
3558
3559         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3560 echo "configure:3561: checking for socket in -lnet" >&5
3561 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3562 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3563   echo $ac_n "(cached) $ac_c" 1>&6
3564 else
3565   ac_save_LIBS="$LIBS"
3566 LIBS="-lnet  $LIBS"
3567 cat > conftest.$ac_ext <<EOF
3568 #line 3569 "configure"
3569 #include "confdefs.h"
3570 /* Override any gcc2 internal prototype to avoid an error.  */
3571 /* We use char because int might match the return type of a gcc2
3572     builtin and then its argument prototype would still apply.  */
3573 char socket();
3574
3575 int main() {
3576 socket()
3577 ; return 0; }
3578 EOF
3579 if { (eval echo configure:3580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3580   rm -rf conftest*
3581   eval "ac_cv_lib_$ac_lib_var=yes"
3582 else
3583   echo "configure: failed program was:" >&5
3584   cat conftest.$ac_ext >&5
3585   rm -rf conftest*
3586   eval "ac_cv_lib_$ac_lib_var=no"
3587 fi
3588 rm -f conftest*
3589 LIBS="$ac_save_LIBS"
3590
3591 fi
3592 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3593   echo "$ac_t""yes" 1>&6
3594     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3595     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3596   cat >> confdefs.h <<EOF
3597 #define $ac_tr_lib 1
3598 EOF
3599
3600   LIBS="-lnet $LIBS"
3601
3602 else
3603   echo "$ac_t""no" 1>&6
3604 fi
3605
3606         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3607 echo "configure:3608: checking for main in -lnsl_s" >&5
3608 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3609 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3610   echo $ac_n "(cached) $ac_c" 1>&6
3611 else
3612   ac_save_LIBS="$LIBS"
3613 LIBS="-lnsl_s  $LIBS"
3614 cat > conftest.$ac_ext <<EOF
3615 #line 3616 "configure"
3616 #include "confdefs.h"
3617
3618 int main() {
3619 main()
3620 ; return 0; }
3621 EOF
3622 if { (eval echo configure:3623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3623   rm -rf conftest*
3624   eval "ac_cv_lib_$ac_lib_var=yes"
3625 else
3626   echo "configure: failed program was:" >&5
3627   cat conftest.$ac_ext >&5
3628   rm -rf conftest*
3629   eval "ac_cv_lib_$ac_lib_var=no"
3630 fi
3631 rm -f conftest*
3632 LIBS="$ac_save_LIBS"
3633
3634 fi
3635 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3636   echo "$ac_t""yes" 1>&6
3637     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3638     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3639   cat >> confdefs.h <<EOF
3640 #define $ac_tr_lib 1
3641 EOF
3642
3643   LIBS="-lnsl_s $LIBS"
3644
3645 else
3646   echo "$ac_t""no" 1>&6
3647 fi
3648
3649         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3650 echo "configure:3651: checking for main in -lnsl" >&5
3651 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3652 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3653   echo $ac_n "(cached) $ac_c" 1>&6
3654 else
3655   ac_save_LIBS="$LIBS"
3656 LIBS="-lnsl  $LIBS"
3657 cat > conftest.$ac_ext <<EOF
3658 #line 3659 "configure"
3659 #include "confdefs.h"
3660
3661 int main() {
3662 main()
3663 ; return 0; }
3664 EOF
3665 if { (eval echo configure:3666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3666   rm -rf conftest*
3667   eval "ac_cv_lib_$ac_lib_var=yes"
3668 else
3669   echo "configure: failed program was:" >&5
3670   cat conftest.$ac_ext >&5
3671   rm -rf conftest*
3672   eval "ac_cv_lib_$ac_lib_var=no"
3673 fi
3674 rm -f conftest*
3675 LIBS="$ac_save_LIBS"
3676
3677 fi
3678 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3679   echo "$ac_t""yes" 1>&6
3680     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3681     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3682   cat >> confdefs.h <<EOF
3683 #define $ac_tr_lib 1
3684 EOF
3685
3686   LIBS="-lnsl $LIBS"
3687
3688 else
3689   echo "$ac_t""no" 1>&6
3690 fi
3691
3692         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3693 echo "configure:3694: checking for socket in -linet" >&5
3694 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3695 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3696   echo $ac_n "(cached) $ac_c" 1>&6
3697 else
3698   ac_save_LIBS="$LIBS"
3699 LIBS="-linet  $LIBS"
3700 cat > conftest.$ac_ext <<EOF
3701 #line 3702 "configure"
3702 #include "confdefs.h"
3703 /* Override any gcc2 internal prototype to avoid an error.  */
3704 /* We use char because int might match the return type of a gcc2
3705     builtin and then its argument prototype would still apply.  */
3706 char socket();
3707
3708 int main() {
3709 socket()
3710 ; return 0; }
3711 EOF
3712 if { (eval echo configure:3713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3713   rm -rf conftest*
3714   eval "ac_cv_lib_$ac_lib_var=yes"
3715 else
3716   echo "configure: failed program was:" >&5
3717   cat conftest.$ac_ext >&5
3718   rm -rf conftest*
3719   eval "ac_cv_lib_$ac_lib_var=no"
3720 fi
3721 rm -f conftest*
3722 LIBS="$ac_save_LIBS"
3723
3724 fi
3725 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3726   echo "$ac_t""yes" 1>&6
3727     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3728     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3729   cat >> confdefs.h <<EOF
3730 #define $ac_tr_lib 1
3731 EOF
3732
3733   LIBS="-linet $LIBS"
3734
3735 else
3736   echo "$ac_t""no" 1>&6
3737 fi
3738
3739         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3740 echo "configure:3741: checking for main in -lgen" >&5
3741 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3742 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3743   echo $ac_n "(cached) $ac_c" 1>&6
3744 else
3745   ac_save_LIBS="$LIBS"
3746 LIBS="-lgen  $LIBS"
3747 cat > conftest.$ac_ext <<EOF
3748 #line 3749 "configure"
3749 #include "confdefs.h"
3750
3751 int main() {
3752 main()
3753 ; return 0; }
3754 EOF
3755 if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3756   rm -rf conftest*
3757   eval "ac_cv_lib_$ac_lib_var=yes"
3758 else
3759   echo "configure: failed program was:" >&5
3760   cat conftest.$ac_ext >&5
3761   rm -rf conftest*
3762   eval "ac_cv_lib_$ac_lib_var=no"
3763 fi
3764 rm -f conftest*
3765 LIBS="$ac_save_LIBS"
3766
3767 fi
3768 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3769   echo "$ac_t""yes" 1>&6
3770     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3771     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3772   cat >> confdefs.h <<EOF
3773 #define $ac_tr_lib 1
3774 EOF
3775
3776   LIBS="-lgen $LIBS"
3777
3778 else
3779   echo "$ac_t""no" 1>&6
3780 fi
3781
3782
3783 fi
3784
3785
3786 for ac_func in res_search
3787 do
3788 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3789 echo "configure:3790: checking for $ac_func" >&5
3790 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3791   echo $ac_n "(cached) $ac_c" 1>&6
3792 else
3793   cat > conftest.$ac_ext <<EOF
3794 #line 3795 "configure"
3795 #include "confdefs.h"
3796 /* System header to define __stub macros and hopefully few prototypes,
3797     which can conflict with char $ac_func(); below.  */
3798 #include <assert.h>
3799 /* Override any gcc2 internal prototype to avoid an error.  */
3800 /* We use char because int might match the return type of a gcc2
3801     builtin and then its argument prototype would still apply.  */
3802 char $ac_func();
3803
3804 int main() {
3805
3806 /* The GNU C library defines this for functions which it implements
3807     to always fail with ENOSYS.  Some functions are actually named
3808     something starting with __ and the normal name is an alias.  */
3809 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3810 choke me
3811 #else
3812 $ac_func();
3813 #endif
3814
3815 ; return 0; }
3816 EOF
3817 if { (eval echo configure:3818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3818   rm -rf conftest*
3819   eval "ac_cv_func_$ac_func=yes"
3820 else
3821   echo "configure: failed program was:" >&5
3822   cat conftest.$ac_ext >&5
3823   rm -rf conftest*
3824   eval "ac_cv_func_$ac_func=no"
3825 fi
3826 rm -f conftest*
3827 fi
3828
3829 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3830   echo "$ac_t""yes" 1>&6
3831     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3832   cat >> confdefs.h <<EOF
3833 #define $ac_tr_func 1
3834 EOF
3835  
3836 else
3837   echo "$ac_t""no" 1>&6
3838 fi
3839 done
3840
3841 if test $ac_cv_func_res_search = "no" ; then 
3842         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3843 echo "configure:3844: checking for res_search in -lbind" >&5
3844 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3845 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3846   echo $ac_n "(cached) $ac_c" 1>&6
3847 else
3848   ac_save_LIBS="$LIBS"
3849 LIBS="-lbind  $LIBS"
3850 cat > conftest.$ac_ext <<EOF
3851 #line 3852 "configure"
3852 #include "confdefs.h"
3853 /* Override any gcc2 internal prototype to avoid an error.  */
3854 /* We use char because int might match the return type of a gcc2
3855     builtin and then its argument prototype would still apply.  */
3856 char res_search();
3857
3858 int main() {
3859 res_search()
3860 ; return 0; }
3861 EOF
3862 if { (eval echo configure:3863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3863   rm -rf conftest*
3864   eval "ac_cv_lib_$ac_lib_var=yes"
3865 else
3866   echo "configure: failed program was:" >&5
3867   cat conftest.$ac_ext >&5
3868   rm -rf conftest*
3869   eval "ac_cv_lib_$ac_lib_var=no"
3870 fi
3871 rm -f conftest*
3872 LIBS="$ac_save_LIBS"
3873
3874 fi
3875 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3876   echo "$ac_t""yes" 1>&6
3877     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3878     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3879   cat >> confdefs.h <<EOF
3880 #define $ac_tr_lib 1
3881 EOF
3882
3883   LIBS="-lbind $LIBS"
3884
3885 else
3886   echo "$ac_t""no" 1>&6
3887 fi
3888
3889         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3890                 cat >> confdefs.h <<\EOF
3891 #define HAVE_RES_SEARCH 1
3892 EOF
3893
3894         else
3895                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3896 echo "configure:3897: checking for res_search in -lresolv" >&5
3897 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3898 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3899   echo $ac_n "(cached) $ac_c" 1>&6
3900 else
3901   ac_save_LIBS="$LIBS"
3902 LIBS="-lresolv  $LIBS"
3903 cat > conftest.$ac_ext <<EOF
3904 #line 3905 "configure"
3905 #include "confdefs.h"
3906 /* Override any gcc2 internal prototype to avoid an error.  */
3907 /* We use char because int might match the return type of a gcc2
3908     builtin and then its argument prototype would still apply.  */
3909 char res_search();
3910
3911 int main() {
3912 res_search()
3913 ; return 0; }
3914 EOF
3915 if { (eval echo configure:3916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3916   rm -rf conftest*
3917   eval "ac_cv_lib_$ac_lib_var=yes"
3918 else
3919   echo "configure: failed program was:" >&5
3920   cat conftest.$ac_ext >&5
3921   rm -rf conftest*
3922   eval "ac_cv_lib_$ac_lib_var=no"
3923 fi
3924 rm -f conftest*
3925 LIBS="$ac_save_LIBS"
3926
3927 fi
3928 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3929   echo "$ac_t""yes" 1>&6
3930     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3931     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3932   cat >> confdefs.h <<EOF
3933 #define $ac_tr_lib 1
3934 EOF
3935
3936   LIBS="-lresolv $LIBS"
3937
3938 else
3939   echo "$ac_t""no" 1>&6
3940 fi
3941
3942                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3943                         cat >> confdefs.h <<\EOF
3944 #define HAVE_RES_SEARCH 1
3945 EOF
3946
3947                 fi
3948         fi
3949 fi
3950
3951 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3952 echo "configure:3953: checking for sigset in -lV3" >&5
3953 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3954 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3955   echo $ac_n "(cached) $ac_c" 1>&6
3956 else
3957   ac_save_LIBS="$LIBS"
3958 LIBS="-lV3  $LIBS"
3959 cat > conftest.$ac_ext <<EOF
3960 #line 3961 "configure"
3961 #include "confdefs.h"
3962 /* Override any gcc2 internal prototype to avoid an error.  */
3963 /* We use char because int might match the return type of a gcc2
3964     builtin and then its argument prototype would still apply.  */
3965 char sigset();
3966
3967 int main() {
3968 sigset()
3969 ; return 0; }
3970 EOF
3971 if { (eval echo configure:3972: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3972   rm -rf conftest*
3973   eval "ac_cv_lib_$ac_lib_var=yes"
3974 else
3975   echo "configure: failed program was:" >&5
3976   cat conftest.$ac_ext >&5
3977   rm -rf conftest*
3978   eval "ac_cv_lib_$ac_lib_var=no"
3979 fi
3980 rm -f conftest*
3981 LIBS="$ac_save_LIBS"
3982
3983 fi
3984 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3985   echo "$ac_t""yes" 1>&6
3986     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3987     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3988   cat >> confdefs.h <<EOF
3989 #define $ac_tr_lib 1
3990 EOF
3991
3992   LIBS="-lV3 $LIBS"
3993
3994 else
3995   echo "$ac_t""no" 1>&6
3996 fi
3997
3998
3999 for ac_hdr in regex.h 
4000 do
4001 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4002 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4003 echo "configure:4004: checking for $ac_hdr" >&5
4004 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4005   echo $ac_n "(cached) $ac_c" 1>&6
4006 else
4007   cat > conftest.$ac_ext <<EOF
4008 #line 4009 "configure"
4009 #include "confdefs.h"
4010 #include <$ac_hdr>
4011 EOF
4012 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4013 { (eval echo configure:4014: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4014 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4015 if test -z "$ac_err"; then
4016   rm -rf conftest*
4017   eval "ac_cv_header_$ac_safe=yes"
4018 else
4019   echo "$ac_err" >&5
4020   echo "configure: failed program was:" >&5
4021   cat conftest.$ac_ext >&5
4022   rm -rf conftest*
4023   eval "ac_cv_header_$ac_safe=no"
4024 fi
4025 rm -f conftest*
4026 fi
4027 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4028   echo "$ac_t""yes" 1>&6
4029     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4030   cat >> confdefs.h <<EOF
4031 #define $ac_tr_hdr 1
4032 EOF
4033  
4034 else
4035   echo "$ac_t""no" 1>&6
4036 fi
4037 done
4038
4039 if test "$ac_cv_header_regex_h" != yes ; then
4040         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
4041 fi
4042 echo $ac_n "checking for regfree""... $ac_c" 1>&6
4043 echo "configure:4044: checking for regfree" >&5
4044 if eval "test \"`echo '$''{'ac_cv_func_regfree'+set}'`\" = set"; then
4045   echo $ac_n "(cached) $ac_c" 1>&6
4046 else
4047   cat > conftest.$ac_ext <<EOF
4048 #line 4049 "configure"
4049 #include "confdefs.h"
4050 /* System header to define __stub macros and hopefully few prototypes,
4051     which can conflict with char regfree(); below.  */
4052 #include <assert.h>
4053 /* Override any gcc2 internal prototype to avoid an error.  */
4054 /* We use char because int might match the return type of a gcc2
4055     builtin and then its argument prototype would still apply.  */
4056 char regfree();
4057
4058 int main() {
4059
4060 /* The GNU C library defines this for functions which it implements
4061     to always fail with ENOSYS.  Some functions are actually named
4062     something starting with __ and the normal name is an alias.  */
4063 #if defined (__stub_regfree) || defined (__stub___regfree)
4064 choke me
4065 #else
4066 regfree();
4067 #endif
4068
4069 ; return 0; }
4070 EOF
4071 if { (eval echo configure:4072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4072   rm -rf conftest*
4073   eval "ac_cv_func_regfree=yes"
4074 else
4075   echo "configure: failed program was:" >&5
4076   cat conftest.$ac_ext >&5
4077   rm -rf conftest*
4078   eval "ac_cv_func_regfree=no"
4079 fi
4080 rm -f conftest*
4081 fi
4082
4083 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
4084   echo "$ac_t""yes" 1>&6
4085   :
4086 else
4087   echo "$ac_t""no" 1>&6
4088 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
4089 fi
4090
4091
4092
4093 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
4094 echo "configure:4095: checking for compatible POSIX regex" >&5
4095 if eval "test \"`echo '$''{'ol_cv_c_posix_regex'+set}'`\" = set"; then
4096   echo $ac_n "(cached) $ac_c" 1>&6
4097 else
4098   
4099         if test "$cross_compiling" = yes; then
4100   ol_cv_c_posix_regex=cross
4101 else
4102   cat > conftest.$ac_ext <<EOF
4103 #line 4104 "configure"
4104 #include "confdefs.h"
4105
4106 #include <sys/types.h>
4107 #include <regex.h>
4108 static char *pattern, *string;
4109 main()
4110 {
4111         int rc;
4112         regex_t re;
4113
4114         pattern = "^A";
4115
4116         if(regcomp(&re, pattern, 0)) {
4117                 return -1;
4118         }
4119         
4120         string = "ALL MATCH";
4121         
4122         rc = regexec(&re, string, 0, (void*)0, 0);
4123
4124         regfree(&re);
4125
4126         return rc;
4127 }
4128 EOF
4129 if { (eval echo configure:4130: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4130 then
4131   ol_cv_c_posix_regex=yes
4132 else
4133   echo "configure: failed program was:" >&5
4134   cat conftest.$ac_ext >&5
4135   rm -fr conftest*
4136   ol_cv_c_posix_regex=no
4137 fi
4138 rm -fr conftest*
4139 fi
4140
4141 fi
4142
4143 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
4144
4145 if test "$ol_cv_c_posix_regex" = no ; then
4146         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
4147 fi
4148
4149 echo $ac_n "checking for select""... $ac_c" 1>&6
4150 echo "configure:4151: checking for select" >&5
4151 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
4152   echo $ac_n "(cached) $ac_c" 1>&6
4153 else
4154   cat > conftest.$ac_ext <<EOF
4155 #line 4156 "configure"
4156 #include "confdefs.h"
4157 /* System header to define __stub macros and hopefully few prototypes,
4158     which can conflict with char select(); below.  */
4159 #include <assert.h>
4160 /* Override any gcc2 internal prototype to avoid an error.  */
4161 /* We use char because int might match the return type of a gcc2
4162     builtin and then its argument prototype would still apply.  */
4163 char select();
4164
4165 int main() {
4166
4167 /* The GNU C library defines this for functions which it implements
4168     to always fail with ENOSYS.  Some functions are actually named
4169     something starting with __ and the normal name is an alias.  */
4170 #if defined (__stub_select) || defined (__stub___select)
4171 choke me
4172 #else
4173 select();
4174 #endif
4175
4176 ; return 0; }
4177 EOF
4178 if { (eval echo configure:4179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4179   rm -rf conftest*
4180   eval "ac_cv_func_select=yes"
4181 else
4182   echo "configure: failed program was:" >&5
4183   cat conftest.$ac_ext >&5
4184   rm -rf conftest*
4185   eval "ac_cv_func_select=no"
4186 fi
4187 rm -f conftest*
4188 fi
4189
4190 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
4191   echo "$ac_t""yes" 1>&6
4192   :
4193 else
4194   echo "$ac_t""no" 1>&6
4195 { echo "configure: error: select() required." 1>&2; exit 1; }
4196 fi
4197
4198
4199 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
4200 echo "configure:4201: checking types of arguments for select()" >&5
4201  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
4202   echo $ac_n "(cached) $ac_c" 1>&6
4203 else
4204    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
4205   echo $ac_n "(cached) $ac_c" 1>&6
4206 else
4207     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
4208   echo $ac_n "(cached) $ac_c" 1>&6
4209 else
4210      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
4211      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
4212       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
4213        cat > conftest.$ac_ext <<EOF
4214 #line 4215 "configure"
4215 #include "confdefs.h"
4216 #ifdef HAVE_SYS_TYPES_H
4217 #include <sys/types.h>
4218 #endif
4219 #ifdef HAVE_SYS_TIME_H
4220 #include <sys/time.h>
4221 #endif
4222 #ifdef HAVE_SYS_SELECT_H
4223 #include <sys/select.h>
4224 #endif
4225 #ifdef HAVE_SYS_SOCKET_H
4226 #include <sys/socket.h>
4227 #endif
4228 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);
4229 int main() {
4230
4231 ; return 0; }
4232 EOF
4233 if { (eval echo configure:4234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4234   rm -rf conftest*
4235           ac_not_found=no ; break 3
4236 else
4237   echo "configure: failed program was:" >&5
4238   cat conftest.$ac_ext >&5
4239   rm -rf conftest*
4240   ac_not_found=yes
4241 fi
4242 rm -f conftest*
4243       done
4244      done
4245     done
4246    
4247 fi
4248   
4249 fi
4250  
4251 fi
4252  if test "$ac_not_found" = yes; then
4253   ac_cv_func_select_arg1=int 
4254   ac_cv_func_select_arg234='int *' 
4255   ac_cv_func_select_arg5='struct timeval *'
4256  fi
4257  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
4258  cat >> confdefs.h <<EOF
4259 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
4260 EOF
4261
4262  cat >> confdefs.h <<EOF
4263 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
4264 EOF
4265
4266  cat >> confdefs.h <<EOF
4267 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
4268 EOF
4269
4270
4271
4272 # ISODE tests
4273 ol_link_isode=no
4274 if test $ol_enable_ldapd != no ; then
4275         echo "configure: warning: ldapd is not supported and may suffer from bit rot." 1>&2
4276
4277                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
4278 echo "configure:4279: checking for main in -lxtpp" >&5
4279 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
4280 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4281   echo $ac_n "(cached) $ac_c" 1>&6
4282 else
4283   ac_save_LIBS="$LIBS"
4284 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
4285 cat > conftest.$ac_ext <<EOF
4286 #line 4287 "configure"
4287 #include "confdefs.h"
4288
4289 int main() {
4290 main()
4291 ; return 0; }
4292 EOF
4293 if { (eval echo configure:4294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4294   rm -rf conftest*
4295   eval "ac_cv_lib_$ac_lib_var=yes"
4296 else
4297   echo "configure: failed program was:" >&5
4298   cat conftest.$ac_ext >&5
4299   rm -rf conftest*
4300   eval "ac_cv_lib_$ac_lib_var=no"
4301 fi
4302 rm -f conftest*
4303 LIBS="$ac_save_LIBS"
4304
4305 fi
4306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4307   echo "$ac_t""yes" 1>&6
4308   
4309                 ol_link_isode=yes
4310                 cat >> confdefs.h <<\EOF
4311 #define HAVE_XTPP 1
4312 EOF
4313
4314                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
4315                 
4316 else
4317   echo "$ac_t""no" 1>&6
4318 :
4319 fi
4320
4321         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
4322 echo "configure:4323: checking for main in -ldsap" >&5
4323 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
4324 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4325   echo $ac_n "(cached) $ac_c" 1>&6
4326 else
4327   ac_save_LIBS="$LIBS"
4328 LIBS="-ldsap -lisode $LIBS"
4329 cat > conftest.$ac_ext <<EOF
4330 #line 4331 "configure"
4331 #include "confdefs.h"
4332
4333 int main() {
4334 main()
4335 ; return 0; }
4336 EOF
4337 if { (eval echo configure:4338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4338   rm -rf conftest*
4339   eval "ac_cv_lib_$ac_lib_var=yes"
4340 else
4341   echo "configure: failed program was:" >&5
4342   cat conftest.$ac_ext >&5
4343   rm -rf conftest*
4344   eval "ac_cv_lib_$ac_lib_var=no"
4345 fi
4346 rm -f conftest*
4347 LIBS="$ac_save_LIBS"
4348
4349 fi
4350 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4351   echo "$ac_t""yes" 1>&6
4352   
4353                 ol_link_isode=yes
4354                 cat >> confdefs.h <<\EOF
4355 #define HAVE_DSAP 1
4356 EOF
4357
4358                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
4359                 
4360 else
4361   echo "$ac_t""no" 1>&6
4362 :
4363 fi
4364
4365         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
4366 echo "configure:4367: checking for main in -lisode" >&5
4367 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
4368 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4369   echo $ac_n "(cached) $ac_c" 1>&6
4370 else
4371   ac_save_LIBS="$LIBS"
4372 LIBS="-lisode  $LIBS"
4373 cat > conftest.$ac_ext <<EOF
4374 #line 4375 "configure"
4375 #include "confdefs.h"
4376
4377 int main() {
4378 main()
4379 ; return 0; }
4380 EOF
4381 if { (eval echo configure:4382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4382   rm -rf conftest*
4383   eval "ac_cv_lib_$ac_lib_var=yes"
4384 else
4385   echo "configure: failed program was:" >&5
4386   cat conftest.$ac_ext >&5
4387   rm -rf conftest*
4388   eval "ac_cv_lib_$ac_lib_var=no"
4389 fi
4390 rm -f conftest*
4391 LIBS="$ac_save_LIBS"
4392
4393 fi
4394 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4395   echo "$ac_t""yes" 1>&6
4396   
4397                 ol_link_isode=yes
4398                 cat >> confdefs.h <<\EOF
4399 #define HAVE_ISODE 1
4400 EOF
4401
4402                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
4403                 
4404 else
4405   echo "$ac_t""no" 1>&6
4406 :
4407 fi
4408
4409 fi
4410
4411 if test $ol_link_isode != no; then
4412         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
4413 echo "configure:4414: checking for main in -lpp" >&5
4414 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
4415 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4416   echo $ac_n "(cached) $ac_c" 1>&6
4417 else
4418   ac_save_LIBS="$LIBS"
4419 LIBS="-lpp  $LIBS"
4420 cat > conftest.$ac_ext <<EOF
4421 #line 4422 "configure"
4422 #include "confdefs.h"
4423
4424 int main() {
4425 main()
4426 ; return 0; }
4427 EOF
4428 if { (eval echo configure:4429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4429   rm -rf conftest*
4430   eval "ac_cv_lib_$ac_lib_var=yes"
4431 else
4432   echo "configure: failed program was:" >&5
4433   cat conftest.$ac_ext >&5
4434   rm -rf conftest*
4435   eval "ac_cv_lib_$ac_lib_var=no"
4436 fi
4437 rm -f conftest*
4438 LIBS="$ac_save_LIBS"
4439
4440 fi
4441 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4442   echo "$ac_t""yes" 1>&6
4443   
4444                 cat >> confdefs.h <<\EOF
4445 #define HAVE_PP 1
4446 EOF
4447
4448                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
4449                 
4450 else
4451   echo "$ac_t""no" 1>&6
4452 :
4453 fi
4454
4455
4456         # Extract the first word of "pepsy", so it can be a program name with args.
4457 set dummy pepsy; ac_word=$2
4458 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
4459 echo "configure:4460: checking for $ac_word" >&5
4460 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
4461   echo $ac_n "(cached) $ac_c" 1>&6
4462 else
4463   case "$PEPSY" in
4464   /*)
4465   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
4466   ;;
4467   ?:/*)                  
4468   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
4469   ;;
4470   *)
4471   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
4472   ac_dummy="$PATH"
4473   for ac_dir in $ac_dummy; do 
4474     test -z "$ac_dir" && ac_dir=.
4475     if test -f $ac_dir/$ac_word; then
4476       ac_cv_path_PEPSY="$ac_dir/$ac_word"
4477       break
4478     fi
4479   done
4480   IFS="$ac_save_ifs"
4481   ;;
4482 esac
4483 fi
4484 PEPSY="$ac_cv_path_PEPSY"
4485 if test -n "$PEPSY"; then
4486   echo "$ac_t""$PEPSY" 1>&6
4487 else
4488   echo "$ac_t""no" 1>&6
4489 fi
4490
4491 fi
4492
4493 ol_link_kerberos=no
4494
4495 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
4496         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
4497 do
4498 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4499 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4500 echo "configure:4501: checking for $ac_hdr" >&5
4501 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4502   echo $ac_n "(cached) $ac_c" 1>&6
4503 else
4504   cat > conftest.$ac_ext <<EOF
4505 #line 4506 "configure"
4506 #include "confdefs.h"
4507 #include <$ac_hdr>
4508 EOF
4509 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4510 { (eval echo configure:4511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4511 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4512 if test -z "$ac_err"; then
4513   rm -rf conftest*
4514   eval "ac_cv_header_$ac_safe=yes"
4515 else
4516   echo "$ac_err" >&5
4517   echo "configure: failed program was:" >&5
4518   cat conftest.$ac_ext >&5
4519   rm -rf conftest*
4520   eval "ac_cv_header_$ac_safe=no"
4521 fi
4522 rm -f conftest*
4523 fi
4524 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4525   echo "$ac_t""yes" 1>&6
4526     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4527   cat >> confdefs.h <<EOF
4528 #define $ac_tr_hdr 1
4529 EOF
4530  
4531 else
4532   echo "$ac_t""no" 1>&6
4533 fi
4534 done
4535
4536
4537         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4538                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4539 echo "configure:4540: checking for main in -lkrb4" >&5
4540 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4541 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4542   echo $ac_n "(cached) $ac_c" 1>&6
4543 else
4544   ac_save_LIBS="$LIBS"
4545 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4546 cat > conftest.$ac_ext <<EOF
4547 #line 4548 "configure"
4548 #include "confdefs.h"
4549
4550 int main() {
4551 main()
4552 ; return 0; }
4553 EOF
4554 if { (eval echo configure:4555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4555   rm -rf conftest*
4556   eval "ac_cv_lib_$ac_lib_var=yes"
4557 else
4558   echo "configure: failed program was:" >&5
4559   cat conftest.$ac_ext >&5
4560   rm -rf conftest*
4561   eval "ac_cv_lib_$ac_lib_var=no"
4562 fi
4563 rm -f conftest*
4564 LIBS="$ac_save_LIBS"
4565
4566 fi
4567 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4568   echo "$ac_t""yes" 1>&6
4569   have_k5=yes
4570 else
4571   echo "$ac_t""no" 1>&6
4572 have_k5=no
4573 fi
4574
4575
4576                 if test $have_k5 = yes ; then
4577                         ol_with_kerberos=found
4578                         ol_link_kerberos=yes
4579
4580                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4581
4582                         LIBS="$KRB_LIBS $LIBS"
4583
4584                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4585 echo "configure:4586: checking for des_debug in Kerberos libraries" >&5
4586 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4587   echo $ac_n "(cached) $ac_c" 1>&6
4588 else
4589   
4590                                                                 save_LIBS="$LIBS"
4591                                 LIBS="$KRB_LIBS $LIBS"
4592                                 cat > conftest.$ac_ext <<EOF
4593 #line 4594 "configure"
4594 #include "confdefs.h"
4595
4596 #include <kerberosIV/krb.h>
4597 #include <kerberosIV/des.h>
4598 extern int des_debug;
4599
4600 int main() {
4601
4602 des_debug = 1;
4603
4604 ; return 0; }
4605 EOF
4606 if { (eval echo configure:4607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4607   rm -rf conftest*
4608   ol_cv_var_des_debug=yes
4609 else
4610   echo "configure: failed program was:" >&5
4611   cat conftest.$ac_ext >&5
4612   rm -rf conftest*
4613   ol_cv_var_des_debug=no
4614 fi
4615 rm -f conftest*
4616                                                                 LIBS="$save_LIBS"
4617                         
4618 fi
4619
4620 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4621
4622                         if test $ol_cv_var_des_debug = yes ; then
4623                                 cat >> confdefs.h <<\EOF
4624 #define HAVE_DES_DEBUG 1
4625 EOF
4626
4627                         fi
4628
4629                         LIBS="$save_LIBS"
4630                 fi
4631         fi
4632 fi
4633
4634 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4635         for ac_hdr in krb.h des.h
4636 do
4637 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4638 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4639 echo "configure:4640: checking for $ac_hdr" >&5
4640 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4641   echo $ac_n "(cached) $ac_c" 1>&6
4642 else
4643   cat > conftest.$ac_ext <<EOF
4644 #line 4645 "configure"
4645 #include "confdefs.h"
4646 #include <$ac_hdr>
4647 EOF
4648 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4649 { (eval echo configure:4650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4650 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4651 if test -z "$ac_err"; then
4652   rm -rf conftest*
4653   eval "ac_cv_header_$ac_safe=yes"
4654 else
4655   echo "$ac_err" >&5
4656   echo "configure: failed program was:" >&5
4657   cat conftest.$ac_ext >&5
4658   rm -rf conftest*
4659   eval "ac_cv_header_$ac_safe=no"
4660 fi
4661 rm -f conftest*
4662 fi
4663 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4664   echo "$ac_t""yes" 1>&6
4665     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4666   cat >> confdefs.h <<EOF
4667 #define $ac_tr_hdr 1
4668 EOF
4669  
4670 else
4671   echo "$ac_t""no" 1>&6
4672 fi
4673 done
4674
4675
4676         if test $ac_cv_header_krb_h = yes ; then
4677                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4678 echo "configure:4679: checking for main in -lkrb" >&5
4679 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4680 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4681   echo $ac_n "(cached) $ac_c" 1>&6
4682 else
4683   ac_save_LIBS="$LIBS"
4684 LIBS="-lkrb -ldes $LIBS"
4685 cat > conftest.$ac_ext <<EOF
4686 #line 4687 "configure"
4687 #include "confdefs.h"
4688
4689 int main() {
4690 main()
4691 ; return 0; }
4692 EOF
4693 if { (eval echo configure:4694: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4694   rm -rf conftest*
4695   eval "ac_cv_lib_$ac_lib_var=yes"
4696 else
4697   echo "configure: failed program was:" >&5
4698   cat conftest.$ac_ext >&5
4699   rm -rf conftest*
4700   eval "ac_cv_lib_$ac_lib_var=no"
4701 fi
4702 rm -f conftest*
4703 LIBS="$ac_save_LIBS"
4704
4705 fi
4706 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4707   echo "$ac_t""yes" 1>&6
4708   have_k4=yes
4709 else
4710   echo "$ac_t""no" 1>&6
4711 have_k4=no
4712 fi
4713
4714
4715                 if test $have_k4 = yes ; then
4716                         ol_with_kerberos=found
4717                         ol_link_kerberos=yes
4718
4719                         KRB_LIBS="-lkrb -ldes"
4720                 fi
4721         fi
4722 fi
4723
4724 if test $ol_link_kerberos = yes ; then
4725         cat >> confdefs.h <<\EOF
4726 #define HAVE_KERBEROS 1
4727 EOF
4728
4729 fi
4730
4731 ol_link_tls=no
4732 if test $ol_with_tls != no ; then
4733         
4734         for ac_hdr in openssl/ssl.h ssl.h
4735 do
4736 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4737 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4738 echo "configure:4739: checking for $ac_hdr" >&5
4739 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4740   echo $ac_n "(cached) $ac_c" 1>&6
4741 else
4742   cat > conftest.$ac_ext <<EOF
4743 #line 4744 "configure"
4744 #include "confdefs.h"
4745 #include <$ac_hdr>
4746 EOF
4747 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4748 { (eval echo configure:4749: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4749 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4750 if test -z "$ac_err"; then
4751   rm -rf conftest*
4752   eval "ac_cv_header_$ac_safe=yes"
4753 else
4754   echo "$ac_err" >&5
4755   echo "configure: failed program was:" >&5
4756   cat conftest.$ac_ext >&5
4757   rm -rf conftest*
4758   eval "ac_cv_header_$ac_safe=no"
4759 fi
4760 rm -f conftest*
4761 fi
4762 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4763   echo "$ac_t""yes" 1>&6
4764     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4765   cat >> confdefs.h <<EOF
4766 #define $ac_tr_hdr 1
4767 EOF
4768  
4769 else
4770   echo "$ac_t""no" 1>&6
4771 fi
4772 done
4773
4774         
4775         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
4776                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4777 echo "configure:4778: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4778 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4779 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4780   echo $ac_n "(cached) $ac_c" 1>&6
4781 else
4782   ac_save_LIBS="$LIBS"
4783 LIBS="-lssl -lcrypto $LIBS"
4784 cat > conftest.$ac_ext <<EOF
4785 #line 4786 "configure"
4786 #include "confdefs.h"
4787 /* Override any gcc2 internal prototype to avoid an error.  */
4788 /* We use char because int might match the return type of a gcc2
4789     builtin and then its argument prototype would still apply.  */
4790 char SSLeay_add_ssl_algorithms();
4791
4792 int main() {
4793 SSLeay_add_ssl_algorithms()
4794 ; return 0; }
4795 EOF
4796 if { (eval echo configure:4797: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4797   rm -rf conftest*
4798   eval "ac_cv_lib_$ac_lib_var=yes"
4799 else
4800   echo "configure: failed program was:" >&5
4801   cat conftest.$ac_ext >&5
4802   rm -rf conftest*
4803   eval "ac_cv_lib_$ac_lib_var=no"
4804 fi
4805 rm -f conftest*
4806 LIBS="$ac_save_LIBS"
4807
4808 fi
4809 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4810   echo "$ac_t""yes" 1>&6
4811   have_ssleay=yes
4812                         need_rsaref=no
4813 else
4814   echo "$ac_t""no" 1>&6
4815 have_ssleay=no
4816 fi
4817
4818                         
4819                 if test $have_ssleay = no ; then
4820                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
4821 echo "configure:4822: checking for SSL_library_init in -lssl" >&5
4822 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-%__p_%'`
4823 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4824   echo $ac_n "(cached) $ac_c" 1>&6
4825 else
4826   ac_save_LIBS="$LIBS"
4827 LIBS="-lssl -lcrypto $LIBS"
4828 cat > conftest.$ac_ext <<EOF
4829 #line 4830 "configure"
4830 #include "confdefs.h"
4831 /* Override any gcc2 internal prototype to avoid an error.  */
4832 /* We use char because int might match the return type of a gcc2
4833     builtin and then its argument prototype would still apply.  */
4834 char SSL_library_init();
4835
4836 int main() {
4837 SSL_library_init()
4838 ; return 0; }
4839 EOF
4840 if { (eval echo configure:4841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4841   rm -rf conftest*
4842   eval "ac_cv_lib_$ac_lib_var=yes"
4843 else
4844   echo "configure: failed program was:" >&5
4845   cat conftest.$ac_ext >&5
4846   rm -rf conftest*
4847   eval "ac_cv_lib_$ac_lib_var=no"
4848 fi
4849 rm -f conftest*
4850 LIBS="$ac_save_LIBS"
4851
4852 fi
4853 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4854   echo "$ac_t""yes" 1>&6
4855   have_ssleay=yes
4856                                 need_rsaref=no
4857 else
4858   echo "$ac_t""no" 1>&6
4859 have_ssleay=no
4860 fi
4861
4862                 fi
4863
4864                 if test $have_ssleay = no ; then
4865                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4866 echo "configure:4867: checking for ssl3_accept in -lssl" >&5
4867 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4868 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4869   echo $ac_n "(cached) $ac_c" 1>&6
4870 else
4871   ac_save_LIBS="$LIBS"
4872 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4873 cat > conftest.$ac_ext <<EOF
4874 #line 4875 "configure"
4875 #include "confdefs.h"
4876 /* Override any gcc2 internal prototype to avoid an error.  */
4877 /* We use char because int might match the return type of a gcc2
4878     builtin and then its argument prototype would still apply.  */
4879 char ssl3_accept();
4880
4881 int main() {
4882 ssl3_accept()
4883 ; return 0; }
4884 EOF
4885 if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4886   rm -rf conftest*
4887   eval "ac_cv_lib_$ac_lib_var=yes"
4888 else
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891   rm -rf conftest*
4892   eval "ac_cv_lib_$ac_lib_var=no"
4893 fi
4894 rm -f conftest*
4895 LIBS="$ac_save_LIBS"
4896
4897 fi
4898 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4899   echo "$ac_t""yes" 1>&6
4900   have_ssleay=yes
4901                                 need_rsaref=yes
4902 else
4903   echo "$ac_t""no" 1>&6
4904 have_ssleay=no
4905 fi
4906
4907                 fi
4908
4909                 if test $have_ssleay = yes ; then
4910                         ol_with_tls=found
4911                         ol_link_tls=yes
4912
4913                         cat >> confdefs.h <<\EOF
4914 #define HAVE_SSLEAY 1
4915 EOF
4916
4917
4918                         if test $need_rsaref = yes; then
4919                                 cat >> confdefs.h <<\EOF
4920 #define HAVE_RSAREF 1
4921 EOF
4922
4923
4924                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4925                         else
4926                                 TLS_LIBS="-lssl -lcrypto"
4927                         fi
4928                 fi
4929         fi
4930 fi
4931
4932 if test $ol_link_tls = yes ; then
4933         cat >> confdefs.h <<\EOF
4934 #define HAVE_TLS 1
4935 EOF
4936
4937 fi      
4938
4939 for ac_func in \
4940         ctime_r                 \
4941         gethostbyname_r gethostbyaddr_r \
4942
4943 do
4944 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4945 echo "configure:4946: checking for $ac_func" >&5
4946 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4947   echo $ac_n "(cached) $ac_c" 1>&6
4948 else
4949   cat > conftest.$ac_ext <<EOF
4950 #line 4951 "configure"
4951 #include "confdefs.h"
4952 /* System header to define __stub macros and hopefully few prototypes,
4953     which can conflict with char $ac_func(); below.  */
4954 #include <assert.h>
4955 /* Override any gcc2 internal prototype to avoid an error.  */
4956 /* We use char because int might match the return type of a gcc2
4957     builtin and then its argument prototype would still apply.  */
4958 char $ac_func();
4959
4960 int main() {
4961
4962 /* The GNU C library defines this for functions which it implements
4963     to always fail with ENOSYS.  Some functions are actually named
4964     something starting with __ and the normal name is an alias.  */
4965 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4966 choke me
4967 #else
4968 $ac_func();
4969 #endif
4970
4971 ; return 0; }
4972 EOF
4973 if { (eval echo configure:4974: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4974   rm -rf conftest*
4975   eval "ac_cv_func_$ac_func=yes"
4976 else
4977   echo "configure: failed program was:" >&5
4978   cat conftest.$ac_ext >&5
4979   rm -rf conftest*
4980   eval "ac_cv_func_$ac_func=no"
4981 fi
4982 rm -f conftest*
4983 fi
4984
4985 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4986   echo "$ac_t""yes" 1>&6
4987     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4988   cat >> confdefs.h <<EOF
4989 #define $ac_tr_func 1
4990 EOF
4991  
4992 else
4993   echo "$ac_t""no" 1>&6
4994 fi
4995 done
4996
4997
4998 if test "$ac_cv_func_ctime_r" = no ; then
4999         ol_cv_func_ctime_r_nargs=0
5000 else
5001         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
5002 echo "configure:5003: checking number of arguments of ctime_r" >&5
5003 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
5004   echo $ac_n "(cached) $ac_c" 1>&6
5005 else
5006   cat > conftest.$ac_ext <<EOF
5007 #line 5008 "configure"
5008 #include "confdefs.h"
5009 #include <time.h>
5010 int main() {
5011 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
5012 ; return 0; }
5013 EOF
5014 if { (eval echo configure:5015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5015   rm -rf conftest*
5016   ol_cv_func_ctime_r_nargs=3
5017 else
5018   echo "configure: failed program was:" >&5
5019   cat conftest.$ac_ext >&5
5020   rm -rf conftest*
5021   cat > conftest.$ac_ext <<EOF
5022 #line 5023 "configure"
5023 #include "confdefs.h"
5024 #include <time.h>
5025 int main() {
5026 time_t ti; char *buffer; ctime_r(&ti,buffer);
5027 ; return 0; }
5028 EOF
5029 if { (eval echo configure:5030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5030   rm -rf conftest*
5031   ol_cv_func_ctime_r_nargs=2
5032 else
5033   echo "configure: failed program was:" >&5
5034   cat conftest.$ac_ext >&5
5035   rm -rf conftest*
5036   ol_cv_func_ctime_r_nargs=0
5037 fi
5038 rm -f conftest*
5039 fi
5040 rm -f conftest*
5041 fi
5042
5043 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
5044   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
5045     cat >> confdefs.h <<EOF
5046 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
5047 EOF
5048
5049   fi
5050
5051 fi
5052
5053 if test "$ac_cv_func_gethostbyname_r" = yes ; then
5054         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
5055 echo "configure:5056: checking number of arguments of gethostbyname_r" >&5
5056 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
5057   echo $ac_n "(cached) $ac_c" 1>&6
5058 else
5059   cat > conftest.$ac_ext <<EOF
5060 #line 5061 "configure"
5061 #include "confdefs.h"
5062 #include <sys/types.h>
5063 #include <sys/socket.h>
5064 #include <netinet/in.h>
5065 #include <netdb.h>
5066 #define BUFSIZE (sizeof(struct hostent)+10)
5067 int main() {
5068 struct hostent hent; char buffer[BUFSIZE];
5069                 int bufsize=BUFSIZE;int h_errno;
5070                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
5071                         buffer, bufsize, &h_errno);
5072 ; return 0; }
5073 EOF
5074 if { (eval echo configure:5075: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5075   rm -rf conftest*
5076   ol_cv_func_gethostbyname_r_nargs=5
5077 else
5078   echo "configure: failed program was:" >&5
5079   cat conftest.$ac_ext >&5
5080   rm -rf conftest*
5081   cat > conftest.$ac_ext <<EOF
5082 #line 5083 "configure"
5083 #include "confdefs.h"
5084 #include <sys/types.h>
5085 #include <sys/socket.h>
5086 #include <netinet/in.h>
5087 #include <netdb.h>
5088 #define BUFSIZE (sizeof(struct hostent)+10)
5089 int main() {
5090 struct hostent hent;struct hostent *rhent;
5091                         char buffer[BUFSIZE];
5092                         int bufsize=BUFSIZE;int h_errno;
5093                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
5094                                 &rhent, &h_errno);
5095 ; return 0; }
5096 EOF
5097 if { (eval echo configure:5098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5098   rm -rf conftest*
5099   ol_cv_func_gethostbyname_r_nargs=6
5100 else
5101   echo "configure: failed program was:" >&5
5102   cat conftest.$ac_ext >&5
5103   rm -rf conftest*
5104   ol_cv_func_gethostbyname_r_nargs=0
5105 fi
5106 rm -f conftest*
5107 fi
5108 rm -f conftest*
5109 fi
5110
5111 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
5112   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
5113         cat >> confdefs.h <<EOF
5114 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
5115 EOF
5116
5117   fi
5118
5119 else
5120         ol_cv_func_gethostbyname_r_nargs=0
5121 fi
5122  
5123 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
5124         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
5125 echo "configure:5126: checking number of arguments of gethostbyaddr_r" >&5
5126 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
5127   echo $ac_n "(cached) $ac_c" 1>&6
5128 else
5129   cat > conftest.$ac_ext <<EOF
5130 #line 5131 "configure"
5131 #include "confdefs.h"
5132 #include <sys/types.h>
5133 #include <sys/socket.h>
5134 #include <netinet/in.h>
5135 #include <netdb.h>
5136 #define BUFSIZE (sizeof(struct hostent)+10)
5137 int main() {
5138 struct hostent hent; char buffer[BUFSIZE]; 
5139             struct in_addr add;
5140             size_t alen=sizeof(struct in_addr);
5141             int bufsize=BUFSIZE;int h_errno;
5142                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
5143                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
5144 ; return 0; }
5145 EOF
5146 if { (eval echo configure:5147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5147   rm -rf conftest*
5148   ol_cv_func_gethostbyaddr_r_nargs=7
5149 else
5150   echo "configure: failed program was:" >&5
5151   cat conftest.$ac_ext >&5
5152   rm -rf conftest*
5153   cat > conftest.$ac_ext <<EOF
5154 #line 5155 "configure"
5155 #include "confdefs.h"
5156 #include <sys/types.h>
5157 #include <sys/socket.h>
5158 #include <netinet/in.h>
5159 #include <netdb.h>
5160 #define BUFSIZE (sizeof(struct hostent)+10)
5161 int main() {
5162 struct hostent hent;
5163                         struct hostent *rhent; char buffer[BUFSIZE]; 
5164                         struct in_addr add;
5165                         size_t alen=sizeof(struct in_addr);
5166                         int bufsize=BUFSIZE;int h_errno;
5167                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
5168                                 alen, AF_INET, &hent, buffer, bufsize, 
5169                                 &rhent, &h_errno);
5170 ; return 0; }
5171 EOF
5172 if { (eval echo configure:5173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5173   rm -rf conftest*
5174   ol_cv_func_gethostbyaddr_r_nargs=8
5175 else
5176   echo "configure: failed program was:" >&5
5177   cat conftest.$ac_ext >&5
5178   rm -rf conftest*
5179   ol_cv_func_gethostbyaddr_r_nargs=0
5180 fi
5181 rm -f conftest*
5182 fi
5183 rm -f conftest*
5184 fi
5185
5186 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
5187   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
5188     cat >> confdefs.h <<EOF
5189 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
5190 EOF
5191
5192   fi
5193
5194 else
5195         ol_cv_func_gethostbyaddr_r_nargs=0
5196 fi
5197
5198 if test "$ac_cv_func_ctime_r" = yes \
5199         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
5200         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
5201         -a "$ac_cv_func_gethostbyname_r" = yes \
5202         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
5203         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
5204         -a "$ac_cv_func_gethostbyaddr_r" = yes \
5205         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
5206         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
5207         ; then
5208  
5209         cat >> confdefs.h <<\EOF
5210 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
5211 EOF
5212
5213 fi
5214
5215 ol_link_threads=no
5216 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5217         -o $ol_with_threads = posix ; then
5218
5219         for ac_hdr in pthread.h sched.h
5220 do
5221 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5222 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5223 echo "configure:5224: checking for $ac_hdr" >&5
5224 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5225   echo $ac_n "(cached) $ac_c" 1>&6
5226 else
5227   cat > conftest.$ac_ext <<EOF
5228 #line 5229 "configure"
5229 #include "confdefs.h"
5230 #include <$ac_hdr>
5231 EOF
5232 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5233 { (eval echo configure:5234: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5234 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5235 if test -z "$ac_err"; then
5236   rm -rf conftest*
5237   eval "ac_cv_header_$ac_safe=yes"
5238 else
5239   echo "$ac_err" >&5
5240   echo "configure: failed program was:" >&5
5241   cat conftest.$ac_ext >&5
5242   rm -rf conftest*
5243   eval "ac_cv_header_$ac_safe=no"
5244 fi
5245 rm -f conftest*
5246 fi
5247 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5248   echo "$ac_t""yes" 1>&6
5249     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5250   cat >> confdefs.h <<EOF
5251 #define $ac_tr_hdr 1
5252 EOF
5253  
5254 else
5255   echo "$ac_t""no" 1>&6
5256 fi
5257 done
5258
5259
5260         if test $ac_cv_header_pthread_h = yes ; then
5261                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
5262 echo "configure:5263: checking POSIX thread version" >&5
5263 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
5264   echo $ac_n "(cached) $ac_c" 1>&6
5265 else
5266   
5267         cat > conftest.$ac_ext <<EOF
5268 #line 5269 "configure"
5269 #include "confdefs.h"
5270
5271 #               include <pthread.h>
5272                 /* this check could be improved */
5273 #               ifdef PTHREAD_ONCE_INIT
5274                         pthread_version_final
5275 #               endif
5276         
5277 EOF
5278 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5279   egrep "pthread_version_final" >/dev/null 2>&1; then
5280   rm -rf conftest*
5281   ol_pthread_final=yes
5282 else
5283   rm -rf conftest*
5284   ol_pthread_final=no
5285 fi
5286 rm -f conftest*
5287
5288
5289         cat > conftest.$ac_ext <<EOF
5290 #line 5291 "configure"
5291 #include "confdefs.h"
5292
5293 #               include <pthread.h>
5294                 /* this check could be improved */
5295 #               ifdef pthread_once_init
5296                         pthread_version_draft4
5297 #               endif
5298         
5299 EOF
5300 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5301   egrep "pthread_version_draft4" >/dev/null 2>&1; then
5302   rm -rf conftest*
5303   ol_pthread_draft4=yes
5304 else
5305   rm -rf conftest*
5306   ol_pthread_draft4=no
5307 fi
5308 rm -f conftest*
5309
5310
5311         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
5312                 ol_cv_pthread_version=final
5313         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
5314                 ol_cv_pthread_version=draft4
5315         else
5316                 ol_cv_pthread_version=unknown
5317         fi
5318
5319 fi
5320
5321 echo "$ac_t""$ol_cv_pthread_version" 1>&6
5322
5323
5324                 if test $ol_cv_pthread_version = final ; then
5325                         cat >> confdefs.h <<\EOF
5326 #define HAVE_PTHREADS_FINAL 1
5327 EOF
5328
5329                 elif test $ol_cv_pthread_version = draft4 ; then
5330                         cat >> confdefs.h <<\EOF
5331 #define HAVE_PTHREADS_D4 1
5332 EOF
5333
5334                 else
5335                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
5336                 fi
5337
5338                 # consider threads found
5339                 ol_with_threads=found
5340
5341                 
5342         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
5343 echo "configure:5344: checking for LinuxThreads pthread.h" >&5
5344 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
5345   echo $ac_n "(cached) $ac_c" 1>&6
5346 else
5347   cat > conftest.$ac_ext <<EOF
5348 #line 5349 "configure"
5349 #include "confdefs.h"
5350 #include <pthread.h>
5351 EOF
5352 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5353   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
5354   rm -rf conftest*
5355   ol_cv_header_linux_threads=yes
5356 else
5357   rm -rf conftest*
5358   ol_cv_header_linux_threads=no
5359 fi
5360 rm -f conftest*
5361
5362                 
5363 fi
5364
5365 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
5366         if test $ol_cv_header_linux_threads = yes; then
5367                 cat >> confdefs.h <<\EOF
5368 #define HAVE_LINUX_THREADS 1
5369 EOF
5370
5371         fi
5372
5373
5374                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
5375                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
5376 echo "configure:5377: checking for pthread_create in default libraries" >&5
5377                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
5378   echo $ac_n "(cached) $ac_c" 1>&6
5379 else
5380   
5381                 if test "$cross_compiling" = yes; then
5382                         ol_cv_pthread_create=yes
5383 else
5384   cat > conftest.$ac_ext <<EOF
5385 #line 5386 "configure"
5386 #include "confdefs.h"
5387
5388 #include <pthread.h>
5389 #ifndef NULL
5390 #define NULL (void*)0
5391 #endif
5392
5393 static void *task(p)
5394         void *p;
5395 {
5396         return (void *) (p == NULL);
5397 }
5398
5399 int main(argc, argv)
5400         int argc;
5401         char **argv;
5402 {
5403         pthread_t t;
5404         int status;
5405
5406         /* make sure pthread_create() isn't just a stub */
5407 #if HAVE_PTHREADS_D4
5408         status = pthread_create(&t, pthread_attr_default, task, NULL);
5409 #else
5410         status = pthread_create(&t, NULL, task, NULL);
5411 #endif
5412
5413         if( status ) return status;
5414
5415         /* make sure pthread_detach() isn't just a stub */
5416 #if HAVE_PTHREADS_D4
5417         status = pthread_detach( &t );
5418 #else
5419         status = pthread_detach( t );
5420 #endif
5421
5422         if( status ) return status;
5423
5424         return status;
5425 }
5426
5427 EOF
5428 if { (eval echo configure:5429: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5429 then
5430   ol_cv_pthread_create=yes
5431 else
5432   echo "configure: failed program was:" >&5
5433   cat conftest.$ac_ext >&5
5434   rm -fr conftest*
5435   ol_cv_pthread_create=no
5436 fi
5437 rm -fr conftest*
5438 fi
5439
5440 fi
5441
5442                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
5443
5444                 if test $ol_cv_pthread_create != no ; then
5445                         ol_link_threads=posix
5446                         ol_link_pthreads=""
5447                 fi
5448                 
5449                 # Pthread try link: -mt (ol_cv_pthread_mt)
5450         if test "$ol_link_threads" = no ; then
5451                 # try -mt
5452                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
5453 echo "configure:5454: checking for pthread link with -mt" >&5
5454 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
5455   echo $ac_n "(cached) $ac_c" 1>&6
5456 else
5457   
5458                         # save the flags
5459                         ol_LIBS="$LIBS"
5460                         LIBS="-mt $LIBS"
5461
5462                         cat > conftest.$ac_ext <<EOF
5463 #line 5464 "configure"
5464 #include "confdefs.h"
5465
5466 #include <pthread.h>
5467 #ifndef NULL
5468 #define NULL (void*)0
5469 #endif
5470
5471 int main() {
5472
5473         pthread_t t;
5474
5475 #if HAVE_PTHREADS_D4
5476         pthread_create(&t, pthread_attr_default, NULL, NULL);
5477         pthread_detach( &t );
5478 #else
5479         pthread_create(&t, NULL, NULL, NULL);
5480         pthread_detach( t );
5481 #endif
5482 #ifdef HAVE_LINUX_THREADS
5483         pthread_kill_other_threads_np();
5484 #endif
5485
5486 ; return 0; }
5487 EOF
5488 if { (eval echo configure:5489: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5489   rm -rf conftest*
5490   ol_cv_pthread_mt=yes
5491 else
5492   echo "configure: failed program was:" >&5
5493   cat conftest.$ac_ext >&5
5494   rm -rf conftest*
5495   ol_cv_pthread_mt=no
5496 fi
5497 rm -f conftest*
5498
5499                 # restore the LIBS
5500                 LIBS="$ol_LIBS"
5501                 
5502 fi
5503
5504 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
5505
5506                 if test $ol_cv_pthread_mt = yes ; then
5507                         ol_link_pthreads="-mt"
5508                         ol_link_threads=posix
5509                 fi
5510         fi
5511
5512                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
5513         if test "$ol_link_threads" = no ; then
5514                 # try -kthread
5515                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
5516 echo "configure:5517: checking for pthread link with -kthread" >&5
5517 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
5518   echo $ac_n "(cached) $ac_c" 1>&6
5519 else
5520   
5521                         # save the flags
5522                         ol_LIBS="$LIBS"
5523                         LIBS="-kthread $LIBS"
5524
5525                         cat > conftest.$ac_ext <<EOF
5526 #line 5527 "configure"
5527 #include "confdefs.h"
5528
5529 #include <pthread.h>
5530 #ifndef NULL
5531 #define NULL (void*)0
5532 #endif
5533
5534 int main() {
5535
5536         pthread_t t;
5537
5538 #if HAVE_PTHREADS_D4
5539         pthread_create(&t, pthread_attr_default, NULL, NULL);
5540         pthread_detach( &t );
5541 #else
5542         pthread_create(&t, NULL, NULL, NULL);
5543         pthread_detach( t );
5544 #endif
5545 #ifdef HAVE_LINUX_THREADS
5546         pthread_kill_other_threads_np();
5547 #endif
5548
5549 ; return 0; }
5550 EOF
5551 if { (eval echo configure:5552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5552   rm -rf conftest*
5553   ol_cv_pthread_kthread=yes
5554 else
5555   echo "configure: failed program was:" >&5
5556   cat conftest.$ac_ext >&5
5557   rm -rf conftest*
5558   ol_cv_pthread_kthread=no
5559 fi
5560 rm -f conftest*
5561
5562                 # restore the LIBS
5563                 LIBS="$ol_LIBS"
5564                 
5565 fi
5566
5567 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
5568
5569                 if test $ol_cv_pthread_kthread = yes ; then
5570                         ol_link_pthreads="-kthread"
5571                         ol_link_threads=posix
5572                 fi
5573         fi
5574
5575                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5576         if test "$ol_link_threads" = no ; then
5577                 # try -pthread
5578                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5579 echo "configure:5580: checking for pthread link with -pthread" >&5
5580 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5581   echo $ac_n "(cached) $ac_c" 1>&6
5582 else
5583   
5584                         # save the flags
5585                         ol_LIBS="$LIBS"
5586                         LIBS="-pthread $LIBS"
5587
5588                         cat > conftest.$ac_ext <<EOF
5589 #line 5590 "configure"
5590 #include "confdefs.h"
5591
5592 #include <pthread.h>
5593 #ifndef NULL
5594 #define NULL (void*)0
5595 #endif
5596
5597 int main() {
5598
5599         pthread_t t;
5600
5601 #if HAVE_PTHREADS_D4
5602         pthread_create(&t, pthread_attr_default, NULL, NULL);
5603         pthread_detach( &t );
5604 #else
5605         pthread_create(&t, NULL, NULL, NULL);
5606         pthread_detach( t );
5607 #endif
5608 #ifdef HAVE_LINUX_THREADS
5609         pthread_kill_other_threads_np();
5610 #endif
5611
5612 ; return 0; }
5613 EOF
5614 if { (eval echo configure:5615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5615   rm -rf conftest*
5616   ol_cv_pthread_pthread=yes
5617 else
5618   echo "configure: failed program was:" >&5
5619   cat conftest.$ac_ext >&5
5620   rm -rf conftest*
5621   ol_cv_pthread_pthread=no
5622 fi
5623 rm -f conftest*
5624
5625                 # restore the LIBS
5626                 LIBS="$ol_LIBS"
5627                 
5628 fi
5629
5630 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5631
5632                 if test $ol_cv_pthread_pthread = yes ; then
5633                         ol_link_pthreads="-pthread"
5634                         ol_link_threads=posix
5635                 fi
5636         fi
5637
5638                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5639         if test "$ol_link_threads" = no ; then
5640                 # try -pthreads
5641                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5642 echo "configure:5643: checking for pthread link with -pthreads" >&5
5643 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5644   echo $ac_n "(cached) $ac_c" 1>&6
5645 else
5646   
5647                         # save the flags
5648                         ol_LIBS="$LIBS"
5649                         LIBS="-pthreads $LIBS"
5650
5651                         cat > conftest.$ac_ext <<EOF
5652 #line 5653 "configure"
5653 #include "confdefs.h"
5654
5655 #include <pthread.h>
5656 #ifndef NULL
5657 #define NULL (void*)0
5658 #endif
5659
5660 int main() {
5661
5662         pthread_t t;
5663
5664 #if HAVE_PTHREADS_D4
5665         pthread_create(&t, pthread_attr_default, NULL, NULL);
5666         pthread_detach( &t );
5667 #else
5668         pthread_create(&t, NULL, NULL, NULL);
5669         pthread_detach( t );
5670 #endif
5671 #ifdef HAVE_LINUX_THREADS
5672         pthread_kill_other_threads_np();
5673 #endif
5674
5675 ; return 0; }
5676 EOF
5677 if { (eval echo configure:5678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5678   rm -rf conftest*
5679   ol_cv_pthread_pthreads=yes
5680 else
5681   echo "configure: failed program was:" >&5
5682   cat conftest.$ac_ext >&5
5683   rm -rf conftest*
5684   ol_cv_pthread_pthreads=no
5685 fi
5686 rm -f conftest*
5687
5688                 # restore the LIBS
5689                 LIBS="$ol_LIBS"
5690                 
5691 fi
5692
5693 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5694
5695                 if test $ol_cv_pthread_pthreads = yes ; then
5696                         ol_link_pthreads="-pthreads"
5697                         ol_link_threads=posix
5698                 fi
5699         fi
5700
5701                 # Pthread try link: -thread (ol_cv_pthread_thread)
5702         if test "$ol_link_threads" = no ; then
5703                 # try -thread
5704                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5705 echo "configure:5706: checking for pthread link with -thread" >&5
5706 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5707   echo $ac_n "(cached) $ac_c" 1>&6
5708 else
5709   
5710                         # save the flags
5711                         ol_LIBS="$LIBS"
5712                         LIBS="-thread $LIBS"
5713
5714                         cat > conftest.$ac_ext <<EOF
5715 #line 5716 "configure"
5716 #include "confdefs.h"
5717
5718 #include <pthread.h>
5719 #ifndef NULL
5720 #define NULL (void*)0
5721 #endif
5722
5723 int main() {
5724
5725         pthread_t t;
5726
5727 #if HAVE_PTHREADS_D4
5728         pthread_create(&t, pthread_attr_default, NULL, NULL);
5729         pthread_detach( &t );
5730 #else
5731         pthread_create(&t, NULL, NULL, NULL);
5732         pthread_detach( t );
5733 #endif
5734 #ifdef HAVE_LINUX_THREADS
5735         pthread_kill_other_threads_np();
5736 #endif
5737
5738 ; return 0; }
5739 EOF
5740 if { (eval echo configure:5741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5741   rm -rf conftest*
5742   ol_cv_pthread_thread=yes
5743 else
5744   echo "configure: failed program was:" >&5
5745   cat conftest.$ac_ext >&5
5746   rm -rf conftest*
5747   ol_cv_pthread_thread=no
5748 fi
5749 rm -f conftest*
5750
5751                 # restore the LIBS
5752                 LIBS="$ol_LIBS"
5753                 
5754 fi
5755
5756 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5757
5758                 if test $ol_cv_pthread_thread = yes ; then
5759                         ol_link_pthreads="-thread"
5760                         ol_link_threads=posix
5761                 fi
5762         fi
5763
5764
5765                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5766         if test "$ol_link_threads" = no ; then
5767                 # try -lpthread -lmach -lexc -lc_r
5768                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5769 echo "configure:5770: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5770 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5771   echo $ac_n "(cached) $ac_c" 1>&6
5772 else
5773   
5774                         # save the flags
5775                         ol_LIBS="$LIBS"
5776                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5777
5778                         cat > conftest.$ac_ext <<EOF
5779 #line 5780 "configure"
5780 #include "confdefs.h"
5781
5782 #include <pthread.h>
5783 #ifndef NULL
5784 #define NULL (void*)0
5785 #endif
5786
5787 int main() {
5788
5789         pthread_t t;
5790
5791 #if HAVE_PTHREADS_D4
5792         pthread_create(&t, pthread_attr_default, NULL, NULL);
5793         pthread_detach( &t );
5794 #else
5795         pthread_create(&t, NULL, NULL, NULL);
5796         pthread_detach( t );
5797 #endif
5798 #ifdef HAVE_LINUX_THREADS
5799         pthread_kill_other_threads_np();
5800 #endif
5801
5802 ; return 0; }
5803 EOF
5804 if { (eval echo configure:5805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5805   rm -rf conftest*
5806   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5807 else
5808   echo "configure: failed program was:" >&5
5809   cat conftest.$ac_ext >&5
5810   rm -rf conftest*
5811   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5812 fi
5813 rm -f conftest*
5814
5815                 # restore the LIBS
5816                 LIBS="$ol_LIBS"
5817                 
5818 fi
5819
5820 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5821
5822                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5823                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5824                         ol_link_threads=posix
5825                 fi
5826         fi
5827
5828                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5829         if test "$ol_link_threads" = no ; then
5830                 # try -lpthread -lmach -lexc
5831                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5832 echo "configure:5833: checking for pthread link with -lpthread -lmach -lexc" >&5
5833 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5834   echo $ac_n "(cached) $ac_c" 1>&6
5835 else
5836   
5837                         # save the flags
5838                         ol_LIBS="$LIBS"
5839                         LIBS="-lpthread -lmach -lexc $LIBS"
5840
5841                         cat > conftest.$ac_ext <<EOF
5842 #line 5843 "configure"
5843 #include "confdefs.h"
5844
5845 #include <pthread.h>
5846 #ifndef NULL
5847 #define NULL (void*)0
5848 #endif
5849
5850 int main() {
5851
5852         pthread_t t;
5853
5854 #if HAVE_PTHREADS_D4
5855         pthread_create(&t, pthread_attr_default, NULL, NULL);
5856         pthread_detach( &t );
5857 #else
5858         pthread_create(&t, NULL, NULL, NULL);
5859         pthread_detach( t );
5860 #endif
5861 #ifdef HAVE_LINUX_THREADS
5862         pthread_kill_other_threads_np();
5863 #endif
5864
5865 ; return 0; }
5866 EOF
5867 if { (eval echo configure:5868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5868   rm -rf conftest*
5869   ol_cv_pthread_lpthread_lmach_lexc=yes
5870 else
5871   echo "configure: failed program was:" >&5
5872   cat conftest.$ac_ext >&5
5873   rm -rf conftest*
5874   ol_cv_pthread_lpthread_lmach_lexc=no
5875 fi
5876 rm -f conftest*
5877
5878                 # restore the LIBS
5879                 LIBS="$ol_LIBS"
5880                 
5881 fi
5882
5883 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5884
5885                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5886                         ol_link_pthreads="-lpthread -lmach -lexc"
5887                         ol_link_threads=posix
5888                 fi
5889         fi
5890
5891
5892                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5893         if test "$ol_link_threads" = no ; then
5894                 # try -lpthread -Wl,-woff,85
5895                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5896 echo "configure:5897: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5897 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5898   echo $ac_n "(cached) $ac_c" 1>&6
5899 else
5900   
5901                         # save the flags
5902                         ol_LIBS="$LIBS"
5903                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5904
5905                         cat > conftest.$ac_ext <<EOF
5906 #line 5907 "configure"
5907 #include "confdefs.h"
5908
5909 #include <pthread.h>
5910 #ifndef NULL
5911 #define NULL (void*)0
5912 #endif
5913
5914 int main() {
5915
5916         pthread_t t;
5917
5918 #if HAVE_PTHREADS_D4
5919         pthread_create(&t, pthread_attr_default, NULL, NULL);
5920         pthread_detach( &t );
5921 #else
5922         pthread_create(&t, NULL, NULL, NULL);
5923         pthread_detach( t );
5924 #endif
5925 #ifdef HAVE_LINUX_THREADS
5926         pthread_kill_other_threads_np();
5927 #endif
5928
5929 ; return 0; }
5930 EOF
5931 if { (eval echo configure:5932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5932   rm -rf conftest*
5933   ol_cv_pthread_lib_lpthread_woff=yes
5934 else
5935   echo "configure: failed program was:" >&5
5936   cat conftest.$ac_ext >&5
5937   rm -rf conftest*
5938   ol_cv_pthread_lib_lpthread_woff=no
5939 fi
5940 rm -f conftest*
5941
5942                 # restore the LIBS
5943                 LIBS="$ol_LIBS"
5944                 
5945 fi
5946
5947 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5948
5949                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5950                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5951                         ol_link_threads=posix
5952                 fi
5953         fi
5954
5955
5956                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5957         if test "$ol_link_threads" = no ; then
5958                 # try -lpthread
5959                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5960 echo "configure:5961: checking for pthread link with -lpthread" >&5
5961 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5962   echo $ac_n "(cached) $ac_c" 1>&6
5963 else
5964   
5965                         # save the flags
5966                         ol_LIBS="$LIBS"
5967                         LIBS="-lpthread $LIBS"
5968
5969                         cat > conftest.$ac_ext <<EOF
5970 #line 5971 "configure"
5971 #include "confdefs.h"
5972
5973 #include <pthread.h>
5974 #ifndef NULL
5975 #define NULL (void*)0
5976 #endif
5977
5978 int main() {
5979
5980         pthread_t t;
5981
5982 #if HAVE_PTHREADS_D4
5983         pthread_create(&t, pthread_attr_default, NULL, NULL);
5984         pthread_detach( &t );
5985 #else
5986         pthread_create(&t, NULL, NULL, NULL);
5987         pthread_detach( t );
5988 #endif
5989 #ifdef HAVE_LINUX_THREADS
5990         pthread_kill_other_threads_np();
5991 #endif
5992
5993 ; return 0; }
5994 EOF
5995 if { (eval echo configure:5996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5996   rm -rf conftest*
5997   ol_cv_pthread_lpthread=yes
5998 else
5999   echo "configure: failed program was:" >&5
6000   cat conftest.$ac_ext >&5
6001   rm -rf conftest*
6002   ol_cv_pthread_lpthread=no
6003 fi
6004 rm -f conftest*
6005
6006                 # restore the LIBS
6007                 LIBS="$ol_LIBS"
6008                 
6009 fi
6010
6011 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
6012
6013                 if test $ol_cv_pthread_lpthread = yes ; then
6014                         ol_link_pthreads="-lpthread"
6015                         ol_link_threads=posix
6016                 fi
6017         fi
6018
6019                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
6020         if test "$ol_link_threads" = no ; then
6021                 # try -lc_r
6022                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
6023 echo "configure:6024: checking for pthread link with -lc_r" >&5
6024 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
6025   echo $ac_n "(cached) $ac_c" 1>&6
6026 else
6027   
6028                         # save the flags
6029                         ol_LIBS="$LIBS"
6030                         LIBS="-lc_r $LIBS"
6031
6032                         cat > conftest.$ac_ext <<EOF
6033 #line 6034 "configure"
6034 #include "confdefs.h"
6035
6036 #include <pthread.h>
6037 #ifndef NULL
6038 #define NULL (void*)0
6039 #endif
6040
6041 int main() {
6042
6043         pthread_t t;
6044
6045 #if HAVE_PTHREADS_D4
6046         pthread_create(&t, pthread_attr_default, NULL, NULL);
6047         pthread_detach( &t );
6048 #else
6049         pthread_create(&t, NULL, NULL, NULL);
6050         pthread_detach( t );
6051 #endif
6052 #ifdef HAVE_LINUX_THREADS
6053         pthread_kill_other_threads_np();
6054 #endif
6055
6056 ; return 0; }
6057 EOF
6058 if { (eval echo configure:6059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6059   rm -rf conftest*
6060   ol_cv_pthread_lc_r=yes
6061 else
6062   echo "configure: failed program was:" >&5
6063   cat conftest.$ac_ext >&5
6064   rm -rf conftest*
6065   ol_cv_pthread_lc_r=no
6066 fi
6067 rm -f conftest*
6068
6069                 # restore the LIBS
6070                 LIBS="$ol_LIBS"
6071                 
6072 fi
6073
6074 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
6075
6076                 if test $ol_cv_pthread_lc_r = yes ; then
6077                         ol_link_pthreads="-lc_r"
6078                         ol_link_threads=posix
6079                 fi
6080         fi
6081
6082
6083                 # Pthread try link: -threads (ol_cv_pthread_threads)
6084         if test "$ol_link_threads" = no ; then
6085                 # try -threads
6086                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
6087 echo "configure:6088: checking for pthread link with -threads" >&5
6088 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
6089   echo $ac_n "(cached) $ac_c" 1>&6
6090 else
6091   
6092                         # save the flags
6093                         ol_LIBS="$LIBS"
6094                         LIBS="-threads $LIBS"
6095
6096                         cat > conftest.$ac_ext <<EOF
6097 #line 6098 "configure"
6098 #include "confdefs.h"
6099
6100 #include <pthread.h>
6101 #ifndef NULL
6102 #define NULL (void*)0
6103 #endif
6104
6105 int main() {
6106
6107         pthread_t t;
6108
6109 #if HAVE_PTHREADS_D4
6110         pthread_create(&t, pthread_attr_default, NULL, NULL);
6111         pthread_detach( &t );
6112 #else
6113         pthread_create(&t, NULL, NULL, NULL);
6114         pthread_detach( t );
6115 #endif
6116 #ifdef HAVE_LINUX_THREADS
6117         pthread_kill_other_threads_np();
6118 #endif
6119
6120 ; return 0; }
6121 EOF
6122 if { (eval echo configure:6123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6123   rm -rf conftest*
6124   ol_cv_pthread_threads=yes
6125 else
6126   echo "configure: failed program was:" >&5
6127   cat conftest.$ac_ext >&5
6128   rm -rf conftest*
6129   ol_cv_pthread_threads=no
6130 fi
6131 rm -f conftest*
6132
6133                 # restore the LIBS
6134                 LIBS="$ol_LIBS"
6135                 
6136 fi
6137
6138 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
6139
6140                 if test $ol_cv_pthread_threads = yes ; then
6141                         ol_link_pthreads="-threads"
6142                         ol_link_threads=posix
6143                 fi
6144         fi
6145
6146
6147                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
6148         if test "$ol_link_threads" = no ; then
6149                 # try -lpthreads -lmach -lexc -lc_r
6150                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
6151 echo "configure:6152: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
6152 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
6153   echo $ac_n "(cached) $ac_c" 1>&6
6154 else
6155   
6156                         # save the flags
6157                         ol_LIBS="$LIBS"
6158                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
6159
6160                         cat > conftest.$ac_ext <<EOF
6161 #line 6162 "configure"
6162 #include "confdefs.h"
6163
6164 #include <pthread.h>
6165 #ifndef NULL
6166 #define NULL (void*)0
6167 #endif
6168
6169 int main() {
6170
6171         pthread_t t;
6172
6173 #if HAVE_PTHREADS_D4
6174         pthread_create(&t, pthread_attr_default, NULL, NULL);
6175         pthread_detach( &t );
6176 #else
6177         pthread_create(&t, NULL, NULL, NULL);
6178         pthread_detach( t );
6179 #endif
6180 #ifdef HAVE_LINUX_THREADS
6181         pthread_kill_other_threads_np();
6182 #endif
6183
6184 ; return 0; }
6185 EOF
6186 if { (eval echo configure:6187: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6187   rm -rf conftest*
6188   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
6189 else
6190   echo "configure: failed program was:" >&5
6191   cat conftest.$ac_ext >&5
6192   rm -rf conftest*
6193   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
6194 fi
6195 rm -f conftest*
6196
6197                 # restore the LIBS
6198                 LIBS="$ol_LIBS"
6199                 
6200 fi
6201
6202 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
6203
6204                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
6205                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
6206                         ol_link_threads=posix
6207                 fi
6208         fi
6209
6210                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
6211         if test "$ol_link_threads" = no ; then
6212                 # try -lpthreads -lmach -lexc
6213                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
6214 echo "configure:6215: checking for pthread link with -lpthreads -lmach -lexc" >&5
6215 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
6216   echo $ac_n "(cached) $ac_c" 1>&6
6217 else
6218   
6219                         # save the flags
6220                         ol_LIBS="$LIBS"
6221                         LIBS="-lpthreads -lmach -lexc $LIBS"
6222
6223                         cat > conftest.$ac_ext <<EOF
6224 #line 6225 "configure"
6225 #include "confdefs.h"
6226
6227 #include <pthread.h>
6228 #ifndef NULL
6229 #define NULL (void*)0
6230 #endif
6231
6232 int main() {
6233
6234         pthread_t t;
6235
6236 #if HAVE_PTHREADS_D4
6237         pthread_create(&t, pthread_attr_default, NULL, NULL);
6238         pthread_detach( &t );
6239 #else
6240         pthread_create(&t, NULL, NULL, NULL);
6241         pthread_detach( t );
6242 #endif
6243 #ifdef HAVE_LINUX_THREADS
6244         pthread_kill_other_threads_np();
6245 #endif
6246
6247 ; return 0; }
6248 EOF
6249 if { (eval echo configure:6250: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6250   rm -rf conftest*
6251   ol_cv_pthread_lpthreads_lmach_lexc=yes
6252 else
6253   echo "configure: failed program was:" >&5
6254   cat conftest.$ac_ext >&5
6255   rm -rf conftest*
6256   ol_cv_pthread_lpthreads_lmach_lexc=no
6257 fi
6258 rm -f conftest*
6259
6260                 # restore the LIBS
6261                 LIBS="$ol_LIBS"
6262                 
6263 fi
6264
6265 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
6266
6267                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
6268                         ol_link_pthreads="-lpthreads -lmach -lexc"
6269                         ol_link_threads=posix
6270                 fi
6271         fi
6272
6273                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
6274         if test "$ol_link_threads" = no ; then
6275                 # try -lpthreads -lexc
6276                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
6277 echo "configure:6278: checking for pthread link with -lpthreads -lexc" >&5
6278 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
6279   echo $ac_n "(cached) $ac_c" 1>&6
6280 else
6281   
6282                         # save the flags
6283                         ol_LIBS="$LIBS"
6284                         LIBS="-lpthreads -lexc $LIBS"
6285
6286                         cat > conftest.$ac_ext <<EOF
6287 #line 6288 "configure"
6288 #include "confdefs.h"
6289
6290 #include <pthread.h>
6291 #ifndef NULL
6292 #define NULL (void*)0
6293 #endif
6294
6295 int main() {
6296
6297         pthread_t t;
6298
6299 #if HAVE_PTHREADS_D4
6300         pthread_create(&t, pthread_attr_default, NULL, NULL);
6301         pthread_detach( &t );
6302 #else
6303         pthread_create(&t, NULL, NULL, NULL);
6304         pthread_detach( t );
6305 #endif
6306 #ifdef HAVE_LINUX_THREADS
6307         pthread_kill_other_threads_np();
6308 #endif
6309
6310 ; return 0; }
6311 EOF
6312 if { (eval echo configure:6313: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6313   rm -rf conftest*
6314   ol_cv_pthread_lpthreads_lexc=yes
6315 else
6316   echo "configure: failed program was:" >&5
6317   cat conftest.$ac_ext >&5
6318   rm -rf conftest*
6319   ol_cv_pthread_lpthreads_lexc=no
6320 fi
6321 rm -f conftest*
6322
6323                 # restore the LIBS
6324                 LIBS="$ol_LIBS"
6325                 
6326 fi
6327
6328 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
6329
6330                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
6331                         ol_link_pthreads="-lpthreads -lexc"
6332                         ol_link_threads=posix
6333                 fi
6334         fi
6335
6336
6337                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
6338         if test "$ol_link_threads" = no ; then
6339                 # try -lpthreads
6340                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
6341 echo "configure:6342: checking for pthread link with -lpthreads" >&5
6342 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
6343   echo $ac_n "(cached) $ac_c" 1>&6
6344 else
6345   
6346                         # save the flags
6347                         ol_LIBS="$LIBS"
6348                         LIBS="-lpthreads $LIBS"
6349
6350                         cat > conftest.$ac_ext <<EOF
6351 #line 6352 "configure"
6352 #include "confdefs.h"
6353
6354 #include <pthread.h>
6355 #ifndef NULL
6356 #define NULL (void*)0
6357 #endif
6358
6359 int main() {
6360
6361         pthread_t t;
6362
6363 #if HAVE_PTHREADS_D4
6364         pthread_create(&t, pthread_attr_default, NULL, NULL);
6365         pthread_detach( &t );
6366 #else
6367         pthread_create(&t, NULL, NULL, NULL);
6368         pthread_detach( t );
6369 #endif
6370 #ifdef HAVE_LINUX_THREADS
6371         pthread_kill_other_threads_np();
6372 #endif
6373
6374 ; return 0; }
6375 EOF
6376 if { (eval echo configure:6377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6377   rm -rf conftest*
6378   ol_cv_pthread_lib_lpthreads=yes
6379 else
6380   echo "configure: failed program was:" >&5
6381   cat conftest.$ac_ext >&5
6382   rm -rf conftest*
6383   ol_cv_pthread_lib_lpthreads=no
6384 fi
6385 rm -f conftest*
6386
6387                 # restore the LIBS
6388                 LIBS="$ol_LIBS"
6389                 
6390 fi
6391
6392 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
6393
6394                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
6395                         ol_link_pthreads="-lpthreads"
6396                         ol_link_threads=posix
6397                 fi
6398         fi
6399
6400
6401                 if test $ol_link_threads != no ; then
6402                         cat >> confdefs.h <<\EOF
6403 #define HAVE_PTHREADS 1
6404 EOF
6405
6406
6407                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
6408
6409                                                 save_CPPFLAGS="$CPPFLAGS"
6410                         save_LIBS="$LIBS"
6411                         LIBS="$LTHREAD_LIBS $LIBS"
6412
6413                                                                                                 for ac_func in sched_yield pthread_yield
6414 do
6415 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6416 echo "configure:6417: checking for $ac_func" >&5
6417 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6418   echo $ac_n "(cached) $ac_c" 1>&6
6419 else
6420   cat > conftest.$ac_ext <<EOF
6421 #line 6422 "configure"
6422 #include "confdefs.h"
6423 /* System header to define __stub macros and hopefully few prototypes,
6424     which can conflict with char $ac_func(); below.  */
6425 #include <assert.h>
6426 /* Override any gcc2 internal prototype to avoid an error.  */
6427 /* We use char because int might match the return type of a gcc2
6428     builtin and then its argument prototype would still apply.  */
6429 char $ac_func();
6430
6431 int main() {
6432
6433 /* The GNU C library defines this for functions which it implements
6434     to always fail with ENOSYS.  Some functions are actually named
6435     something starting with __ and the normal name is an alias.  */
6436 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6437 choke me
6438 #else
6439 $ac_func();
6440 #endif
6441
6442 ; return 0; }
6443 EOF
6444 if { (eval echo configure:6445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6445   rm -rf conftest*
6446   eval "ac_cv_func_$ac_func=yes"
6447 else
6448   echo "configure: failed program was:" >&5
6449   cat conftest.$ac_ext >&5
6450   rm -rf conftest*
6451   eval "ac_cv_func_$ac_func=no"
6452 fi
6453 rm -f conftest*
6454 fi
6455
6456 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6457   echo "$ac_t""yes" 1>&6
6458     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6459   cat >> confdefs.h <<EOF
6460 #define $ac_tr_func 1
6461 EOF
6462  
6463 else
6464   echo "$ac_t""no" 1>&6
6465 fi
6466 done
6467
6468
6469                         if test $ac_cv_func_sched_yield = no -a \
6470                                 $ac_cv_func_pthread_yield = no ; then
6471                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
6472 echo "configure:6473: checking for sched_yield in -lrt" >&5
6473 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
6474 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6475   echo $ac_n "(cached) $ac_c" 1>&6
6476 else
6477   ac_save_LIBS="$LIBS"
6478 LIBS="-lrt  $LIBS"
6479 cat > conftest.$ac_ext <<EOF
6480 #line 6481 "configure"
6481 #include "confdefs.h"
6482 /* Override any gcc2 internal prototype to avoid an error.  */
6483 /* We use char because int might match the return type of a gcc2
6484     builtin and then its argument prototype would still apply.  */
6485 char sched_yield();
6486
6487 int main() {
6488 sched_yield()
6489 ; return 0; }
6490 EOF
6491 if { (eval echo configure:6492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6492   rm -rf conftest*
6493   eval "ac_cv_lib_$ac_lib_var=yes"
6494 else
6495   echo "configure: failed program was:" >&5
6496   cat conftest.$ac_ext >&5
6497   rm -rf conftest*
6498   eval "ac_cv_lib_$ac_lib_var=no"
6499 fi
6500 rm -f conftest*
6501 LIBS="$ac_save_LIBS"
6502
6503 fi
6504 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6505   echo "$ac_t""yes" 1>&6
6506   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
6507                                         cat >> confdefs.h <<\EOF
6508 #define HAVE_SCHED_YIELD 1
6509 EOF
6510
6511                                         ac_cv_func_sched_yield=yes
6512 else
6513   echo "$ac_t""no" 1>&6
6514 ac_cv_func_sched_yield=no
6515 fi
6516
6517                         fi
6518                         if test $ac_cv_func_sched_yield = no -a \
6519                                 $ac_cv_func_pthread_yield = no ; then
6520                                                                                                 for ac_func in thr_yield
6521 do
6522 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6523 echo "configure:6524: checking for $ac_func" >&5
6524 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6525   echo $ac_n "(cached) $ac_c" 1>&6
6526 else
6527   cat > conftest.$ac_ext <<EOF
6528 #line 6529 "configure"
6529 #include "confdefs.h"
6530 /* System header to define __stub macros and hopefully few prototypes,
6531     which can conflict with char $ac_func(); below.  */
6532 #include <assert.h>
6533 /* Override any gcc2 internal prototype to avoid an error.  */
6534 /* We use char because int might match the return type of a gcc2
6535     builtin and then its argument prototype would still apply.  */
6536 char $ac_func();
6537
6538 int main() {
6539
6540 /* The GNU C library defines this for functions which it implements
6541     to always fail with ENOSYS.  Some functions are actually named
6542     something starting with __ and the normal name is an alias.  */
6543 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6544 choke me
6545 #else
6546 $ac_func();
6547 #endif
6548
6549 ; return 0; }
6550 EOF
6551 if { (eval echo configure:6552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6552   rm -rf conftest*
6553   eval "ac_cv_func_$ac_func=yes"
6554 else
6555   echo "configure: failed program was:" >&5
6556   cat conftest.$ac_ext >&5
6557   rm -rf conftest*
6558   eval "ac_cv_func_$ac_func=no"
6559 fi
6560 rm -f conftest*
6561 fi
6562
6563 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6564   echo "$ac_t""yes" 1>&6
6565     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6566   cat >> confdefs.h <<EOF
6567 #define $ac_tr_func 1
6568 EOF
6569  
6570 else
6571   echo "$ac_t""no" 1>&6
6572 fi
6573 done
6574
6575                         fi
6576                         if test $ac_cv_func_sched_yield = no -a \
6577                                 $ac_cv_func_pthread_yield = no -a \
6578                                 "$ac_cv_func_thr_yield" = no ; then
6579                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6580                         fi
6581
6582                                                 for ac_func in pthread_kill
6583 do
6584 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6585 echo "configure:6586: checking for $ac_func" >&5
6586 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6587   echo $ac_n "(cached) $ac_c" 1>&6
6588 else
6589   cat > conftest.$ac_ext <<EOF
6590 #line 6591 "configure"
6591 #include "confdefs.h"
6592 /* System header to define __stub macros and hopefully few prototypes,
6593     which can conflict with char $ac_func(); below.  */
6594 #include <assert.h>
6595 /* Override any gcc2 internal prototype to avoid an error.  */
6596 /* We use char because int might match the return type of a gcc2
6597     builtin and then its argument prototype would still apply.  */
6598 char $ac_func();
6599
6600 int main() {
6601
6602 /* The GNU C library defines this for functions which it implements
6603     to always fail with ENOSYS.  Some functions are actually named
6604     something starting with __ and the normal name is an alias.  */
6605 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6606 choke me
6607 #else
6608 $ac_func();
6609 #endif
6610
6611 ; return 0; }
6612 EOF
6613 if { (eval echo configure:6614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6614   rm -rf conftest*
6615   eval "ac_cv_func_$ac_func=yes"
6616 else
6617   echo "configure: failed program was:" >&5
6618   cat conftest.$ac_ext >&5
6619   rm -rf conftest*
6620   eval "ac_cv_func_$ac_func=no"
6621 fi
6622 rm -f conftest*
6623 fi
6624
6625 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6626   echo "$ac_t""yes" 1>&6
6627     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6628   cat >> confdefs.h <<EOF
6629 #define $ac_tr_func 1
6630 EOF
6631  
6632 else
6633   echo "$ac_t""no" 1>&6
6634 fi
6635 done
6636
6637
6638                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6639 echo "configure:6640: checking for pthread_detach with <pthread.h>" >&5
6640 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6641   echo $ac_n "(cached) $ac_c" 1>&6
6642 else
6643   
6644                                                                 cat > conftest.$ac_ext <<EOF
6645 #line 6646 "configure"
6646 #include "confdefs.h"
6647
6648 #include <pthread.h>
6649 #ifndef NULL
6650 #define NULL (void*)0
6651 #endif
6652
6653 int main() {
6654 pthread_detach(NULL);
6655 ; return 0; }
6656 EOF
6657 if { (eval echo configure:6658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6658   rm -rf conftest*
6659   ol_cv_func_pthread_detach=yes
6660 else
6661   echo "configure: failed program was:" >&5
6662   cat conftest.$ac_ext >&5
6663   rm -rf conftest*
6664   ol_cv_func_pthread_detach=no
6665 fi
6666 rm -f conftest*
6667                         
6668 fi
6669
6670 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6671
6672                         if test $ol_cv_func_pthread_detach = no ; then
6673                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6674                         fi
6675
6676                         cat >> confdefs.h <<\EOF
6677 #define HAVE_PTHREAD_DETACH 1
6678 EOF
6679
6680
6681                                                 for ac_func in \
6682                                 pthread_setconcurrency \
6683                                 pthread_getconcurrency \
6684                                 thr_setconcurrency \
6685                                 thr_getconcurrency \
6686                         
6687 do
6688 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6689 echo "configure:6690: checking for $ac_func" >&5
6690 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6691   echo $ac_n "(cached) $ac_c" 1>&6
6692 else
6693   cat > conftest.$ac_ext <<EOF
6694 #line 6695 "configure"
6695 #include "confdefs.h"
6696 /* System header to define __stub macros and hopefully few prototypes,
6697     which can conflict with char $ac_func(); below.  */
6698 #include <assert.h>
6699 /* Override any gcc2 internal prototype to avoid an error.  */
6700 /* We use char because int might match the return type of a gcc2
6701     builtin and then its argument prototype would still apply.  */
6702 char $ac_func();
6703
6704 int main() {
6705
6706 /* The GNU C library defines this for functions which it implements
6707     to always fail with ENOSYS.  Some functions are actually named
6708     something starting with __ and the normal name is an alias.  */
6709 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6710 choke me
6711 #else
6712 $ac_func();
6713 #endif
6714
6715 ; return 0; }
6716 EOF
6717 if { (eval echo configure:6718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6718   rm -rf conftest*
6719   eval "ac_cv_func_$ac_func=yes"
6720 else
6721   echo "configure: failed program was:" >&5
6722   cat conftest.$ac_ext >&5
6723   rm -rf conftest*
6724   eval "ac_cv_func_$ac_func=no"
6725 fi
6726 rm -f conftest*
6727 fi
6728
6729 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6730   echo "$ac_t""yes" 1>&6
6731     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6732   cat >> confdefs.h <<EOF
6733 #define $ac_tr_func 1
6734 EOF
6735  
6736 else
6737   echo "$ac_t""no" 1>&6
6738 fi
6739 done
6740
6741
6742                         
6743         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6744 echo "configure:6745: checking for pthread_kill_other_threads_np" >&5
6745 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6746   echo $ac_n "(cached) $ac_c" 1>&6
6747 else
6748   cat > conftest.$ac_ext <<EOF
6749 #line 6750 "configure"
6750 #include "confdefs.h"
6751 /* System header to define __stub macros and hopefully few prototypes,
6752     which can conflict with char pthread_kill_other_threads_np(); below.  */
6753 #include <assert.h>
6754 /* Override any gcc2 internal prototype to avoid an error.  */
6755 /* We use char because int might match the return type of a gcc2
6756     builtin and then its argument prototype would still apply.  */
6757 char pthread_kill_other_threads_np();
6758
6759 int main() {
6760
6761 /* The GNU C library defines this for functions which it implements
6762     to always fail with ENOSYS.  Some functions are actually named
6763     something starting with __ and the normal name is an alias.  */
6764 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6765 choke me
6766 #else
6767 pthread_kill_other_threads_np();
6768 #endif
6769
6770 ; return 0; }
6771 EOF
6772 if { (eval echo configure:6773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6773   rm -rf conftest*
6774   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6775 else
6776   echo "configure: failed program was:" >&5
6777   cat conftest.$ac_ext >&5
6778   rm -rf conftest*
6779   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6780 fi
6781 rm -f conftest*
6782 fi
6783
6784 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6785   echo "$ac_t""yes" 1>&6
6786   :
6787 else
6788   echo "$ac_t""no" 1>&6
6789 fi
6790
6791         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6792 echo "configure:6793: checking for LinuxThreads implementation" >&5
6793 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6794   echo $ac_n "(cached) $ac_c" 1>&6
6795 else
6796   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6797 fi
6798
6799 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6800
6801                         
6802         
6803         
6804         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6805 echo "configure:6806: checking for LinuxThreads consistency" >&5
6806 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6807   echo $ac_n "(cached) $ac_c" 1>&6
6808 else
6809   
6810                 if test $ol_cv_header_linux_threads = yes -a \
6811                         $ol_cv_sys_linux_threads = yes; then
6812                         ol_cv_linux_threads=yes
6813                 elif test $ol_cv_header_linux_threads = no -a \
6814                         $ol_cv_sys_linux_threads = no; then
6815                         ol_cv_linux_threads=no
6816                 else
6817                         ol_cv_linux_threads=error
6818                 fi
6819         
6820 fi
6821
6822 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6823
6824
6825                         if test $ol_cv_linux_threads = error; then
6826                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6827                         fi
6828
6829                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6830 echo "configure:6831: checking if pthread_create() works" >&5
6831                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6832   echo $ac_n "(cached) $ac_c" 1>&6
6833 else
6834   
6835                         if test "$cross_compiling" = yes; then
6836                                 ol_cv_pthread_create_works=yes
6837 else
6838   cat > conftest.$ac_ext <<EOF
6839 #line 6840 "configure"
6840 #include "confdefs.h"
6841
6842 #include <pthread.h>
6843 #ifndef NULL
6844 #define NULL (void*)0
6845 #endif
6846
6847 static void *task(p)
6848         void *p;
6849 {
6850         return (void *) (p == NULL);
6851 }
6852
6853 int main(argc, argv)
6854         int argc;
6855         char **argv;
6856 {
6857         pthread_t t;
6858 #if HAVE_PTHREADS_D4
6859         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6860 #else
6861         exit(pthread_create(&t, NULL, task, NULL));
6862 #endif
6863 }
6864
6865 EOF
6866 if { (eval echo configure:6867: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6867 then
6868   ol_cv_pthread_create_works=yes
6869 else
6870   echo "configure: failed program was:" >&5
6871   cat conftest.$ac_ext >&5
6872   rm -fr conftest*
6873   ol_cv_pthread_create_works=no
6874 fi
6875 rm -fr conftest*
6876 fi
6877
6878 fi
6879
6880                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6881
6882                         if test $ol_cv_pthread_create_works = no ; then
6883                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6884                         fi
6885
6886                                                 if test $ol_with_yielding_select = auto ; then
6887                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6888 echo "configure:6889: checking if select yields when using pthreads" >&5
6889                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6890   echo $ac_n "(cached) $ac_c" 1>&6
6891 else
6892   
6893                                 if test "$cross_compiling" = yes; then
6894   
6895                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6896 else
6897   cat > conftest.$ac_ext <<EOF
6898 #line 6899 "configure"
6899 #include "confdefs.h"
6900
6901 #include <sys/types.h>
6902 #include <sys/time.h>
6903 #include <unistd.h>
6904 #include <pthread.h>
6905 #ifndef NULL
6906 #define NULL (void*) 0
6907 #endif
6908
6909 static int fildes[2];
6910
6911 static void *task(p)
6912         void *p;
6913 {
6914         int i;
6915         struct timeval tv;
6916
6917         fd_set rfds;
6918
6919         tv.tv_sec=10;
6920         tv.tv_usec=0;
6921
6922         FD_ZERO(&rfds);
6923         FD_SET(fildes[0], &rfds);
6924
6925         /* we're not interested in any fds */
6926         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6927
6928         if(i < 0) {
6929                 perror("select");
6930                 exit(10);
6931         }
6932
6933         exit(0); /* if we exit here, the select blocked the whole process */
6934 }
6935
6936 int main(argc, argv)
6937         int argc;
6938         char **argv;
6939 {
6940         pthread_t t;
6941
6942         /* create a pipe to select */
6943         if(pipe(&fildes[0])) {
6944                 perror("select");
6945                 exit(1);
6946         }
6947
6948 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6949         (void) pthread_setconcurrency(2);
6950 #else
6951 #ifdef HAVE_THR_SETCONCURRENCY
6952         /* Set Solaris LWP concurrency to 2 */
6953         thr_setconcurrency(2);
6954 #endif
6955 #endif
6956
6957 #if HAVE_PTHREADS_D4
6958         pthread_create(&t, pthread_attr_default, task, NULL);
6959 #else
6960         pthread_create(&t, NULL, task, NULL);
6961 #endif
6962
6963 #if HAVE_SCHED_YIELD
6964         sched_yield();  /* make sure task runs first */
6965 #else
6966 #ifdef HAVE_PTHREAD_YIELD
6967         pthread_yield();        /* make sure task runs first */
6968 #endif
6969 #endif
6970
6971         exit(2);
6972 }
6973 EOF
6974 if { (eval echo configure:6975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6975 then
6976   ol_cv_pthread_select_yields=no
6977 else
6978   echo "configure: failed program was:" >&5
6979   cat conftest.$ac_ext >&5
6980   rm -fr conftest*
6981   ol_cv_pthread_select_yields=yes
6982 fi
6983 rm -fr conftest*
6984 fi
6985
6986 fi
6987
6988                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6989
6990                                 if test $ol_cv_pthread_select_yields = yes ; then
6991                                         ol_with_yielding_select=yes
6992                                 fi
6993                         fi
6994
6995                                                 CPPFLAGS="$save_CPPFLAGS"
6996                         LIBS="$save_LIBS"
6997                 else
6998                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6999                 fi
7000         fi
7001
7002         if test $ol_with_threads = posix ; then
7003                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
7004         fi
7005 fi
7006
7007 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7008         -o $ol_with_threads = mach ; then
7009
7010                 for ac_hdr in mach/cthreads.h
7011 do
7012 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7013 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7014 echo "configure:7015: checking for $ac_hdr" >&5
7015 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7016   echo $ac_n "(cached) $ac_c" 1>&6
7017 else
7018   cat > conftest.$ac_ext <<EOF
7019 #line 7020 "configure"
7020 #include "confdefs.h"
7021 #include <$ac_hdr>
7022 EOF
7023 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7024 { (eval echo configure:7025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7025 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7026 if test -z "$ac_err"; then
7027   rm -rf conftest*
7028   eval "ac_cv_header_$ac_safe=yes"
7029 else
7030   echo "$ac_err" >&5
7031   echo "configure: failed program was:" >&5
7032   cat conftest.$ac_ext >&5
7033   rm -rf conftest*
7034   eval "ac_cv_header_$ac_safe=no"
7035 fi
7036 rm -f conftest*
7037 fi
7038 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7039   echo "$ac_t""yes" 1>&6
7040     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7041   cat >> confdefs.h <<EOF
7042 #define $ac_tr_hdr 1
7043 EOF
7044  
7045 else
7046   echo "$ac_t""no" 1>&6
7047 fi
7048 done
7049
7050         if test $ac_cv_header_mach_cthreads_h = yes ; then
7051                 ol_with_threads=found
7052
7053                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
7054 echo "configure:7055: checking for cthread_fork" >&5
7055 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
7056   echo $ac_n "(cached) $ac_c" 1>&6
7057 else
7058   cat > conftest.$ac_ext <<EOF
7059 #line 7060 "configure"
7060 #include "confdefs.h"
7061 /* System header to define __stub macros and hopefully few prototypes,
7062     which can conflict with char cthread_fork(); below.  */
7063 #include <assert.h>
7064 /* Override any gcc2 internal prototype to avoid an error.  */
7065 /* We use char because int might match the return type of a gcc2
7066     builtin and then its argument prototype would still apply.  */
7067 char cthread_fork();
7068
7069 int main() {
7070
7071 /* The GNU C library defines this for functions which it implements
7072     to always fail with ENOSYS.  Some functions are actually named
7073     something starting with __ and the normal name is an alias.  */
7074 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
7075 choke me
7076 #else
7077 cthread_fork();
7078 #endif
7079
7080 ; return 0; }
7081 EOF
7082 if { (eval echo configure:7083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7083   rm -rf conftest*
7084   eval "ac_cv_func_cthread_fork=yes"
7085 else
7086   echo "configure: failed program was:" >&5
7087   cat conftest.$ac_ext >&5
7088   rm -rf conftest*
7089   eval "ac_cv_func_cthread_fork=no"
7090 fi
7091 rm -f conftest*
7092 fi
7093
7094 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
7095   echo "$ac_t""yes" 1>&6
7096   ol_link_threads=yes
7097 else
7098   echo "$ac_t""no" 1>&6
7099 fi
7100
7101
7102                 if test $ol_link_threads = no ; then
7103                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
7104 echo "configure:7105: checking for cthread_fork with -all_load" >&5
7105 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
7106   echo $ac_n "(cached) $ac_c" 1>&6
7107 else
7108   
7109                                                                 save_LIBS="$LIBS"
7110                                 LIBS="-all_load $LIBS"
7111                                 cat > conftest.$ac_ext <<EOF
7112 #line 7113 "configure"
7113 #include "confdefs.h"
7114 #include <mach/cthreads.h>
7115 int main() {
7116
7117                                         cthread_fork((void *)0, (void *)0);
7118                                         
7119 ; return 0; }
7120 EOF
7121 if { (eval echo configure:7122: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7122   rm -rf conftest*
7123   ol_cv_cthread_all_load=yes
7124 else
7125   echo "configure: failed program was:" >&5
7126   cat conftest.$ac_ext >&5
7127   rm -rf conftest*
7128   ol_cv_cthread_all_load=no
7129 fi
7130 rm -f conftest*
7131                                                                 LIBS="$save_LIBS"
7132                         
7133 fi
7134
7135 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
7136
7137                         if test $ol_cv_cthread_all_load = yes ; then
7138                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
7139                                 ol_link_threads=mach
7140                         fi
7141                 fi
7142
7143                 if test $ol_link_threads != no ; then
7144                         : check for cthread specific functionality here
7145                         cat >> confdefs.h <<\EOF
7146 #define HAVE_MACH_CTHREADS 1
7147 EOF
7148
7149                 else
7150                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
7151                 fi
7152         fi
7153
7154         if test $ol_with_threads = mach ; then
7155                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
7156         fi
7157 fi
7158
7159 if test $ol_with_threads = auto -o $ol_with_threads = yes \
7160         -o $ol_with_threads = lwp ; then
7161
7162                 for ac_hdr in thread.h synch.h
7163 do
7164 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7165 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7166 echo "configure:7167: checking for $ac_hdr" >&5
7167 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7168   echo $ac_n "(cached) $ac_c" 1>&6
7169 else
7170   cat > conftest.$ac_ext <<EOF
7171 #line 7172 "configure"
7172 #include "confdefs.h"
7173 #include <$ac_hdr>
7174 EOF
7175 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7176 { (eval echo configure:7177: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7177 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7178 if test -z "$ac_err"; then
7179   rm -rf conftest*
7180   eval "ac_cv_header_$ac_safe=yes"
7181 else
7182   echo "$ac_err" >&5
7183   echo "configure: failed program was:" >&5
7184   cat conftest.$ac_ext >&5
7185   rm -rf conftest*
7186   eval "ac_cv_header_$ac_safe=no"
7187 fi
7188 rm -f conftest*
7189 fi
7190 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7191   echo "$ac_t""yes" 1>&6
7192     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7193   cat >> confdefs.h <<EOF
7194 #define $ac_tr_hdr 1
7195 EOF
7196  
7197 else
7198   echo "$ac_t""no" 1>&6
7199 fi
7200 done
7201
7202         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
7203                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
7204 echo "configure:7205: checking for thr_create in -lthread" >&5
7205 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
7206 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7207   echo $ac_n "(cached) $ac_c" 1>&6
7208 else
7209   ac_save_LIBS="$LIBS"
7210 LIBS="-lthread  $LIBS"
7211 cat > conftest.$ac_ext <<EOF
7212 #line 7213 "configure"
7213 #include "confdefs.h"
7214 /* Override any gcc2 internal prototype to avoid an error.  */
7215 /* We use char because int might match the return type of a gcc2
7216     builtin and then its argument prototype would still apply.  */
7217 char thr_create();
7218
7219 int main() {
7220 thr_create()
7221 ; return 0; }
7222 EOF
7223 if { (eval echo configure:7224: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7224   rm -rf conftest*
7225   eval "ac_cv_lib_$ac_lib_var=yes"
7226 else
7227   echo "configure: failed program was:" >&5
7228   cat conftest.$ac_ext >&5
7229   rm -rf conftest*
7230   eval "ac_cv_lib_$ac_lib_var=no"
7231 fi
7232 rm -f conftest*
7233 LIBS="$ac_save_LIBS"
7234
7235 fi
7236 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7237   echo "$ac_t""yes" 1>&6
7238   have_thr=yes
7239 else
7240   echo "$ac_t""no" 1>&6
7241 have_thr=no
7242 fi
7243
7244
7245                 if test $have_thr = yes ; then
7246                         cat >> confdefs.h <<\EOF
7247 #define HAVE_THR 1
7248 EOF
7249
7250                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
7251                         ol_link_threads=thr
7252
7253                         if test $ol_with_yielding_select = auto ; then
7254                                 ol_with_yielding_select=yes
7255                         fi
7256
7257                                                 for ac_func in \
7258                                 thr_setconcurrency \
7259                                 thr_getconcurrency \
7260                         
7261 do
7262 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7263 echo "configure:7264: checking for $ac_func" >&5
7264 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7265   echo $ac_n "(cached) $ac_c" 1>&6
7266 else
7267   cat > conftest.$ac_ext <<EOF
7268 #line 7269 "configure"
7269 #include "confdefs.h"
7270 /* System header to define __stub macros and hopefully few prototypes,
7271     which can conflict with char $ac_func(); below.  */
7272 #include <assert.h>
7273 /* Override any gcc2 internal prototype to avoid an error.  */
7274 /* We use char because int might match the return type of a gcc2
7275     builtin and then its argument prototype would still apply.  */
7276 char $ac_func();
7277
7278 int main() {
7279
7280 /* The GNU C library defines this for functions which it implements
7281     to always fail with ENOSYS.  Some functions are actually named
7282     something starting with __ and the normal name is an alias.  */
7283 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7284 choke me
7285 #else
7286 $ac_func();
7287 #endif
7288
7289 ; return 0; }
7290 EOF
7291 if { (eval echo configure:7292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7292   rm -rf conftest*
7293   eval "ac_cv_func_$ac_func=yes"
7294 else
7295   echo "configure: failed program was:" >&5
7296   cat conftest.$ac_ext >&5
7297   rm -rf conftest*
7298   eval "ac_cv_func_$ac_func=no"
7299 fi
7300 rm -f conftest*
7301 fi
7302
7303 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7304   echo "$ac_t""yes" 1>&6
7305     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7306   cat >> confdefs.h <<EOF
7307 #define $ac_tr_func 1
7308 EOF
7309  
7310 else
7311   echo "$ac_t""no" 1>&6
7312 fi
7313 done
7314
7315                 fi
7316         fi
7317
7318                 for ac_hdr in lwp/lwp.h
7319 do
7320 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7321 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7322 echo "configure:7323: checking for $ac_hdr" >&5
7323 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7324   echo $ac_n "(cached) $ac_c" 1>&6
7325 else
7326   cat > conftest.$ac_ext <<EOF
7327 #line 7328 "configure"
7328 #include "confdefs.h"
7329 #include <$ac_hdr>
7330 EOF
7331 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7332 { (eval echo configure:7333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7333 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7334 if test -z "$ac_err"; then
7335   rm -rf conftest*
7336   eval "ac_cv_header_$ac_safe=yes"
7337 else
7338   echo "$ac_err" >&5
7339   echo "configure: failed program was:" >&5
7340   cat conftest.$ac_ext >&5
7341   rm -rf conftest*
7342   eval "ac_cv_header_$ac_safe=no"
7343 fi
7344 rm -f conftest*
7345 fi
7346 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7347   echo "$ac_t""yes" 1>&6
7348     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7349   cat >> confdefs.h <<EOF
7350 #define $ac_tr_hdr 1
7351 EOF
7352  
7353 else
7354   echo "$ac_t""no" 1>&6
7355 fi
7356 done
7357
7358         if test $ac_cv_header_lwp_lwp_h = yes ; then
7359                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
7360 echo "configure:7361: checking for lwp_create in -llwp" >&5
7361 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
7362 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7363   echo $ac_n "(cached) $ac_c" 1>&6
7364 else
7365   ac_save_LIBS="$LIBS"
7366 LIBS="-llwp  $LIBS"
7367 cat > conftest.$ac_ext <<EOF
7368 #line 7369 "configure"
7369 #include "confdefs.h"
7370 /* Override any gcc2 internal prototype to avoid an error.  */
7371 /* We use char because int might match the return type of a gcc2
7372     builtin and then its argument prototype would still apply.  */
7373 char lwp_create();
7374
7375 int main() {
7376 lwp_create()
7377 ; return 0; }
7378 EOF
7379 if { (eval echo configure:7380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7380   rm -rf conftest*
7381   eval "ac_cv_lib_$ac_lib_var=yes"
7382 else
7383   echo "configure: failed program was:" >&5
7384   cat conftest.$ac_ext >&5
7385   rm -rf conftest*
7386   eval "ac_cv_lib_$ac_lib_var=no"
7387 fi
7388 rm -f conftest*
7389 LIBS="$ac_save_LIBS"
7390
7391 fi
7392 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7393   echo "$ac_t""yes" 1>&6
7394   have_lwp=yes
7395 else
7396   echo "$ac_t""no" 1>&6
7397 have_lwp=no
7398 fi
7399
7400
7401                 if test $have_lwp = yes ; then
7402                         cat >> confdefs.h <<\EOF
7403 #define HAVE_LWP 1
7404 EOF
7405
7406                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
7407                         ol_link_threads=lwp
7408
7409                         if test $ol_with_yielding_select = auto ; then
7410                                 ol_with_yielding_select=no
7411                         fi
7412                 fi
7413         fi
7414 fi
7415
7416 if test $ol_with_yielding_select = yes ; then
7417         cat >> confdefs.h <<\EOF
7418 #define HAVE_YIELDING_SELECT 1
7419 EOF
7420
7421 fi
7422
7423 if test $ol_with_threads = manual ; then
7424                 ol_link_threads=yes
7425
7426         echo "configure: warning: thread defines and link options must be set manually" 1>&2
7427
7428         for ac_hdr in pthread.h sched.h
7429 do
7430 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7431 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7432 echo "configure:7433: checking for $ac_hdr" >&5
7433 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7434   echo $ac_n "(cached) $ac_c" 1>&6
7435 else
7436   cat > conftest.$ac_ext <<EOF
7437 #line 7438 "configure"
7438 #include "confdefs.h"
7439 #include <$ac_hdr>
7440 EOF
7441 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7442 { (eval echo configure:7443: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7443 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7444 if test -z "$ac_err"; then
7445   rm -rf conftest*
7446   eval "ac_cv_header_$ac_safe=yes"
7447 else
7448   echo "$ac_err" >&5
7449   echo "configure: failed program was:" >&5
7450   cat conftest.$ac_ext >&5
7451   rm -rf conftest*
7452   eval "ac_cv_header_$ac_safe=no"
7453 fi
7454 rm -f conftest*
7455 fi
7456 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7457   echo "$ac_t""yes" 1>&6
7458     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7459   cat >> confdefs.h <<EOF
7460 #define $ac_tr_hdr 1
7461 EOF
7462  
7463 else
7464   echo "$ac_t""no" 1>&6
7465 fi
7466 done
7467
7468         for ac_func in sched_yield pthread_yield
7469 do
7470 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
7471 echo "configure:7472: checking for $ac_func" >&5
7472 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
7473   echo $ac_n "(cached) $ac_c" 1>&6
7474 else
7475   cat > conftest.$ac_ext <<EOF
7476 #line 7477 "configure"
7477 #include "confdefs.h"
7478 /* System header to define __stub macros and hopefully few prototypes,
7479     which can conflict with char $ac_func(); below.  */
7480 #include <assert.h>
7481 /* Override any gcc2 internal prototype to avoid an error.  */
7482 /* We use char because int might match the return type of a gcc2
7483     builtin and then its argument prototype would still apply.  */
7484 char $ac_func();
7485
7486 int main() {
7487
7488 /* The GNU C library defines this for functions which it implements
7489     to always fail with ENOSYS.  Some functions are actually named
7490     something starting with __ and the normal name is an alias.  */
7491 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7492 choke me
7493 #else
7494 $ac_func();
7495 #endif
7496
7497 ; return 0; }
7498 EOF
7499 if { (eval echo configure:7500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7500   rm -rf conftest*
7501   eval "ac_cv_func_$ac_func=yes"
7502 else
7503   echo "configure: failed program was:" >&5
7504   cat conftest.$ac_ext >&5
7505   rm -rf conftest*
7506   eval "ac_cv_func_$ac_func=no"
7507 fi
7508 rm -f conftest*
7509 fi
7510
7511 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
7512   echo "$ac_t""yes" 1>&6
7513     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
7514   cat >> confdefs.h <<EOF
7515 #define $ac_tr_func 1
7516 EOF
7517  
7518 else
7519   echo "$ac_t""no" 1>&6
7520 fi
7521 done
7522
7523         
7524         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
7525 echo "configure:7526: checking for LinuxThreads pthread.h" >&5
7526 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
7527   echo $ac_n "(cached) $ac_c" 1>&6
7528 else
7529   cat > conftest.$ac_ext <<EOF
7530 #line 7531 "configure"
7531 #include "confdefs.h"
7532 #include <pthread.h>
7533 EOF
7534 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7535   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
7536   rm -rf conftest*
7537   ol_cv_header_linux_threads=yes
7538 else
7539   rm -rf conftest*
7540   ol_cv_header_linux_threads=no
7541 fi
7542 rm -f conftest*
7543
7544                 
7545 fi
7546
7547 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
7548         if test $ol_cv_header_linux_threads = yes; then
7549                 cat >> confdefs.h <<\EOF
7550 #define HAVE_LINUX_THREADS 1
7551 EOF
7552
7553         fi
7554
7555
7556         for ac_hdr in mach/cthreads.h
7557 do
7558 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7559 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7560 echo "configure:7561: checking for $ac_hdr" >&5
7561 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7562   echo $ac_n "(cached) $ac_c" 1>&6
7563 else
7564   cat > conftest.$ac_ext <<EOF
7565 #line 7566 "configure"
7566 #include "confdefs.h"
7567 #include <$ac_hdr>
7568 EOF
7569 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7570 { (eval echo configure:7571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7571 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7572 if test -z "$ac_err"; then
7573   rm -rf conftest*
7574   eval "ac_cv_header_$ac_safe=yes"
7575 else
7576   echo "$ac_err" >&5
7577   echo "configure: failed program was:" >&5
7578   cat conftest.$ac_ext >&5
7579   rm -rf conftest*
7580   eval "ac_cv_header_$ac_safe=no"
7581 fi
7582 rm -f conftest*
7583 fi
7584 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7585   echo "$ac_t""yes" 1>&6
7586     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7587   cat >> confdefs.h <<EOF
7588 #define $ac_tr_hdr 1
7589 EOF
7590  
7591 else
7592   echo "$ac_t""no" 1>&6
7593 fi
7594 done
7595
7596         for ac_hdr in lwp/lwp.h
7597 do
7598 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7599 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7600 echo "configure:7601: checking for $ac_hdr" >&5
7601 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7602   echo $ac_n "(cached) $ac_c" 1>&6
7603 else
7604   cat > conftest.$ac_ext <<EOF
7605 #line 7606 "configure"
7606 #include "confdefs.h"
7607 #include <$ac_hdr>
7608 EOF
7609 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7610 { (eval echo configure:7611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7611 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7612 if test -z "$ac_err"; then
7613   rm -rf conftest*
7614   eval "ac_cv_header_$ac_safe=yes"
7615 else
7616   echo "$ac_err" >&5
7617   echo "configure: failed program was:" >&5
7618   cat conftest.$ac_ext >&5
7619   rm -rf conftest*
7620   eval "ac_cv_header_$ac_safe=no"
7621 fi
7622 rm -f conftest*
7623 fi
7624 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7625   echo "$ac_t""yes" 1>&6
7626     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7627   cat >> confdefs.h <<EOF
7628 #define $ac_tr_hdr 1
7629 EOF
7630  
7631 else
7632   echo "$ac_t""no" 1>&6
7633 fi
7634 done
7635
7636         for ac_hdr in thread.h synch.h
7637 do
7638 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7639 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7640 echo "configure:7641: checking for $ac_hdr" >&5
7641 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7642   echo $ac_n "(cached) $ac_c" 1>&6
7643 else
7644   cat > conftest.$ac_ext <<EOF
7645 #line 7646 "configure"
7646 #include "confdefs.h"
7647 #include <$ac_hdr>
7648 EOF
7649 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7650 { (eval echo configure:7651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7651 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7652 if test -z "$ac_err"; then
7653   rm -rf conftest*
7654   eval "ac_cv_header_$ac_safe=yes"
7655 else
7656   echo "$ac_err" >&5
7657   echo "configure: failed program was:" >&5
7658   cat conftest.$ac_ext >&5
7659   rm -rf conftest*
7660   eval "ac_cv_header_$ac_safe=no"
7661 fi
7662 rm -f conftest*
7663 fi
7664 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7665   echo "$ac_t""yes" 1>&6
7666     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7667   cat >> confdefs.h <<EOF
7668 #define $ac_tr_hdr 1
7669 EOF
7670  
7671 else
7672   echo "$ac_t""no" 1>&6
7673 fi
7674 done
7675
7676 fi
7677
7678 if test $ol_link_threads != no ; then  
7679                         cat >> confdefs.h <<\EOF
7680 #define REENTRANT 1
7681 EOF
7682
7683         cat >> confdefs.h <<\EOF
7684 #define _REENTRANT 1
7685 EOF
7686
7687         cat >> confdefs.h <<\EOF
7688 #define THREAD_SAFE 1
7689 EOF
7690
7691         cat >> confdefs.h <<\EOF
7692 #define _THREAD_SAFE 1
7693 EOF
7694
7695         cat >> confdefs.h <<\EOF
7696 #define THREADSAFE 1
7697 EOF
7698
7699         cat >> confdefs.h <<\EOF
7700 #define _THREADSAFE 1
7701 EOF
7702
7703         cat >> confdefs.h <<\EOF
7704 #define _SGI_MP_SOURCE 1
7705 EOF
7706
7707
7708                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7709 echo "configure:7710: checking for thread specific errno" >&5
7710 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7711   echo $ac_n "(cached) $ac_c" 1>&6
7712 else
7713   
7714                 cat > conftest.$ac_ext <<EOF
7715 #line 7716 "configure"
7716 #include "confdefs.h"
7717 #include <errno.h>
7718 int main() {
7719 errno = 0;
7720 ; return 0; }
7721 EOF
7722 if { (eval echo configure:7723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7723   rm -rf conftest*
7724   ol_cv_errno_thread_specific=yes
7725 else
7726   echo "configure: failed program was:" >&5
7727   cat conftest.$ac_ext >&5
7728   rm -rf conftest*
7729   ol_cv_errno_thread_specific=no
7730 fi
7731 rm -f conftest*
7732         
7733 fi
7734
7735 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7736
7737                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
7738 echo "configure:7739: checking for thread specific h_errno" >&5
7739 if eval "test \"`echo '$''{'ol_cv_h_errno_thread_specific'+set}'`\" = set"; then
7740   echo $ac_n "(cached) $ac_c" 1>&6
7741 else
7742   
7743                 cat > conftest.$ac_ext <<EOF
7744 #line 7745 "configure"
7745 #include "confdefs.h"
7746 #include <netdb.h>
7747 int main() {
7748 h_errno = 0;
7749 ; return 0; }
7750 EOF
7751 if { (eval echo configure:7752: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7752   rm -rf conftest*
7753   ol_cv_h_errno_thread_specific=yes
7754 else
7755   echo "configure: failed program was:" >&5
7756   cat conftest.$ac_ext >&5
7757   rm -rf conftest*
7758   ol_cv_h_errno_thread_specific=no
7759 fi
7760 rm -f conftest*
7761         
7762 fi
7763
7764 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
7765
7766         if test $ol_cv_errno_thread_specific != yes \
7767                 -o $ol_cv_h_errno_thread_specific != yes ; then
7768                 LIBS="$LTHREAD_LIBS $LIBS"
7769                 LTHREAD_LIBS=""
7770         fi
7771
7772 fi  
7773
7774 if test $ol_link_threads = no ; then
7775         if test $ol_with_threads = yes ; then
7776                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7777         fi
7778
7779         if test $ol_with_threads = auto ; then
7780                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7781                 ol_with_threads=no
7782         fi
7783
7784         cat >> confdefs.h <<\EOF
7785 #define NO_THREADS 1
7786 EOF
7787
7788         LTHREAD_LIBS=""
7789 fi
7790
7791 if test $ol_link_threads != no ; then
7792         cat >> confdefs.h <<\EOF
7793 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7794 EOF
7795
7796 fi
7797
7798
7799 ol_link_ldbm=no 
7800 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7801         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7802 echo "configure:7803: checking for DB2 library" >&5
7803 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7804   echo $ac_n "(cached) $ac_c" 1>&6
7805 else
7806         ol_LIBS="$LIBS"
7807         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7808 echo "configure:7809: checking for db_open in -ldb" >&5
7809 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7810 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7811   echo $ac_n "(cached) $ac_c" 1>&6
7812 else
7813   ac_save_LIBS="$LIBS"
7814 LIBS="-ldb  $LIBS"
7815 cat > conftest.$ac_ext <<EOF
7816 #line 7817 "configure"
7817 #include "confdefs.h"
7818 /* Override any gcc2 internal prototype to avoid an error.  */
7819 /* We use char because int might match the return type of a gcc2
7820     builtin and then its argument prototype would still apply.  */
7821 char db_open();
7822
7823 int main() {
7824 db_open()
7825 ; return 0; }
7826 EOF
7827 if { (eval echo configure:7828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7828   rm -rf conftest*
7829   eval "ac_cv_lib_$ac_lib_var=yes"
7830 else
7831   echo "configure: failed program was:" >&5
7832   cat conftest.$ac_ext >&5
7833   rm -rf conftest*
7834   eval "ac_cv_lib_$ac_lib_var=no"
7835 fi
7836 rm -f conftest*
7837 LIBS="$ac_save_LIBS"
7838
7839 fi
7840 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7841   echo "$ac_t""yes" 1>&6
7842   ol_cv_lib_db2=-ldb
7843 else
7844   echo "$ac_t""no" 1>&6
7845 ol_cv_lib_db2=no
7846 fi
7847
7848         LIBS="$ol_LIBS"
7849
7850 fi
7851
7852 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7853
7854 for ac_hdr in db.h
7855 do
7856 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7857 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7858 echo "configure:7859: checking for $ac_hdr" >&5
7859 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7860   echo $ac_n "(cached) $ac_c" 1>&6
7861 else
7862   cat > conftest.$ac_ext <<EOF
7863 #line 7864 "configure"
7864 #include "confdefs.h"
7865 #include <$ac_hdr>
7866 EOF
7867 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7868 { (eval echo configure:7869: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7869 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7870 if test -z "$ac_err"; then
7871   rm -rf conftest*
7872   eval "ac_cv_header_$ac_safe=yes"
7873 else
7874   echo "$ac_err" >&5
7875   echo "configure: failed program was:" >&5
7876   cat conftest.$ac_ext >&5
7877   rm -rf conftest*
7878   eval "ac_cv_header_$ac_safe=no"
7879 fi
7880 rm -f conftest*
7881 fi
7882 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7883   echo "$ac_t""yes" 1>&6
7884     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7885   cat >> confdefs.h <<EOF
7886 #define $ac_tr_hdr 1
7887 EOF
7888  
7889 else
7890   echo "$ac_t""no" 1>&6
7891 fi
7892 done
7893
7894 if test $ac_cv_header_db_h = yes ; then
7895         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7896 echo "configure:7897: checking if db.h is DB2" >&5
7897 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7898   echo $ac_n "(cached) $ac_c" 1>&6
7899 else
7900   
7901                 cat > conftest.$ac_ext <<EOF
7902 #line 7903 "configure"
7903 #include "confdefs.h"
7904
7905 #                       include <db.h>
7906                         /* this check could be improved */
7907 #                       ifdef DB_VERSION_MAJOR
7908 #                               if DB_VERSION_MAJOR == 2
7909                                         __db_version_2
7910 #                               endif
7911 #                       endif
7912                 
7913 EOF
7914 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7915   egrep "__db_version_2" >/dev/null 2>&1; then
7916   rm -rf conftest*
7917   ol_cv_header_db2=yes
7918 else
7919   rm -rf conftest*
7920   ol_cv_header_db2=no
7921 fi
7922 rm -f conftest*
7923
7924 fi
7925
7926 echo "$ac_t""$ol_cv_header_db2" 1>&6
7927 else
7928         ol_cv_header_db2=no
7929 fi
7930
7931
7932  
7933  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7934 echo "configure:7935: checking for Berkeley DB2" >&5
7935 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7936   echo $ac_n "(cached) $ac_c" 1>&6
7937 else
7938   
7939         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7940                 ol_cv_berkeley_db2=no
7941         else
7942                 ol_cv_berkeley_db2=yes
7943         fi
7944
7945 fi
7946
7947 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7948  if test $ol_cv_berkeley_db2 = yes ; then
7949         cat >> confdefs.h <<\EOF
7950 #define HAVE_BERKELEY_DB2 1
7951 EOF
7952
7953  fi
7954
7955
7956         if test $ol_cv_berkeley_db2 = yes ; then
7957                 ol_link_ldbm=db2
7958                 ol_with_ldbm_api=db2
7959
7960                 if test $ol_with_ldbm_type = hash ; then
7961                         cat >> confdefs.h <<\EOF
7962 #define LDBM_USE_DBHASH 1
7963 EOF
7964
7965                 else
7966                         cat >> confdefs.h <<\EOF
7967 #define LDBM_USE_DBBTREE 1
7968 EOF
7969
7970                 fi
7971
7972                                                 if test $ol_cv_lib_db2 != yes ; then
7973                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7974                 fi
7975         fi
7976 fi
7977
7978 ol_link_bdb2=no
7979 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7980         ol_link_bdb2=yes
7981 fi
7982
7983 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7984         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7985 echo "configure:7986: checking for Berkeley DB library" >&5
7986 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7987   echo $ac_n "(cached) $ac_c" 1>&6
7988 else
7989   
7990         for ac_hdr in db1/db.h
7991 do
7992 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7993 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7994 echo "configure:7995: checking for $ac_hdr" >&5
7995 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7996   echo $ac_n "(cached) $ac_c" 1>&6
7997 else
7998   cat > conftest.$ac_ext <<EOF
7999 #line 8000 "configure"
8000 #include "confdefs.h"
8001 #include <$ac_hdr>
8002 EOF
8003 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8004 { (eval echo configure:8005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8005 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8006 if test -z "$ac_err"; then
8007   rm -rf conftest*
8008   eval "ac_cv_header_$ac_safe=yes"
8009 else
8010   echo "$ac_err" >&5
8011   echo "configure: failed program was:" >&5
8012   cat conftest.$ac_ext >&5
8013   rm -rf conftest*
8014   eval "ac_cv_header_$ac_safe=no"
8015 fi
8016 rm -f conftest*
8017 fi
8018 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8019   echo "$ac_t""yes" 1>&6
8020     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8021   cat >> confdefs.h <<EOF
8022 #define $ac_tr_hdr 1
8023 EOF
8024  
8025 else
8026   echo "$ac_t""no" 1>&6
8027 fi
8028 done
8029
8030         ol_LIBS="$LIBS"
8031         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
8032 echo "configure:8033: checking for dbopen" >&5
8033 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
8034   echo $ac_n "(cached) $ac_c" 1>&6
8035 else
8036   cat > conftest.$ac_ext <<EOF
8037 #line 8038 "configure"
8038 #include "confdefs.h"
8039 /* System header to define __stub macros and hopefully few prototypes,
8040     which can conflict with char dbopen(); below.  */
8041 #include <assert.h>
8042 /* Override any gcc2 internal prototype to avoid an error.  */
8043 /* We use char because int might match the return type of a gcc2
8044     builtin and then its argument prototype would still apply.  */
8045 char dbopen();
8046
8047 int main() {
8048
8049 /* The GNU C library defines this for functions which it implements
8050     to always fail with ENOSYS.  Some functions are actually named
8051     something starting with __ and the normal name is an alias.  */
8052 #if defined (__stub_dbopen) || defined (__stub___dbopen)
8053 choke me
8054 #else
8055 dbopen();
8056 #endif
8057
8058 ; return 0; }
8059 EOF
8060 if { (eval echo configure:8061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8061   rm -rf conftest*
8062   eval "ac_cv_func_dbopen=yes"
8063 else
8064   echo "configure: failed program was:" >&5
8065   cat conftest.$ac_ext >&5
8066   rm -rf conftest*
8067   eval "ac_cv_func_dbopen=no"
8068 fi
8069 rm -f conftest*
8070 fi
8071
8072 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
8073   echo "$ac_t""yes" 1>&6
8074   ol_cv_lib_db=yes
8075 else
8076   echo "$ac_t""no" 1>&6
8077
8078                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
8079 echo "configure:8080: checking for dbopen in -ldb1" >&5
8080 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
8081 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8082   echo $ac_n "(cached) $ac_c" 1>&6
8083 else
8084   ac_save_LIBS="$LIBS"
8085 LIBS="-ldb1  $LIBS"
8086 cat > conftest.$ac_ext <<EOF
8087 #line 8088 "configure"
8088 #include "confdefs.h"
8089 /* Override any gcc2 internal prototype to avoid an error.  */
8090 /* We use char because int might match the return type of a gcc2
8091     builtin and then its argument prototype would still apply.  */
8092 char dbopen();
8093
8094 int main() {
8095 dbopen()
8096 ; return 0; }
8097 EOF
8098 if { (eval echo configure:8099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8099   rm -rf conftest*
8100   eval "ac_cv_lib_$ac_lib_var=yes"
8101 else
8102   echo "configure: failed program was:" >&5
8103   cat conftest.$ac_ext >&5
8104   rm -rf conftest*
8105   eval "ac_cv_lib_$ac_lib_var=no"
8106 fi
8107 rm -f conftest*
8108 LIBS="$ac_save_LIBS"
8109
8110 fi
8111 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8112   echo "$ac_t""yes" 1>&6
8113   ol_cv_lib_db=-ldb1
8114 else
8115   echo "$ac_t""no" 1>&6
8116
8117                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
8118 echo "configure:8119: checking for dbopen in -ldb" >&5
8119 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
8120 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8121   echo $ac_n "(cached) $ac_c" 1>&6
8122 else
8123   ac_save_LIBS="$LIBS"
8124 LIBS="-ldb  $LIBS"
8125 cat > conftest.$ac_ext <<EOF
8126 #line 8127 "configure"
8127 #include "confdefs.h"
8128 /* Override any gcc2 internal prototype to avoid an error.  */
8129 /* We use char because int might match the return type of a gcc2
8130     builtin and then its argument prototype would still apply.  */
8131 char dbopen();
8132
8133 int main() {
8134 dbopen()
8135 ; return 0; }
8136 EOF
8137 if { (eval echo configure:8138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8138   rm -rf conftest*
8139   eval "ac_cv_lib_$ac_lib_var=yes"
8140 else
8141   echo "configure: failed program was:" >&5
8142   cat conftest.$ac_ext >&5
8143   rm -rf conftest*
8144   eval "ac_cv_lib_$ac_lib_var=no"
8145 fi
8146 rm -f conftest*
8147 LIBS="$ac_save_LIBS"
8148
8149 fi
8150 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8151   echo "$ac_t""yes" 1>&6
8152   ol_cv_lib_db=-ldb
8153 else
8154   echo "$ac_t""no" 1>&6
8155 ol_cv_lib_db=no
8156 fi
8157
8158                 
8159 fi
8160
8161         
8162 fi
8163
8164         LIBS="$ol_LIBS"
8165
8166 fi
8167
8168 echo "$ac_t""$ol_cv_lib_db" 1>&6
8169
8170
8171 for ac_hdr in db_185.h
8172 do
8173 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8174 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8175 echo "configure:8176: checking for $ac_hdr" >&5
8176 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8177   echo $ac_n "(cached) $ac_c" 1>&6
8178 else
8179   cat > conftest.$ac_ext <<EOF
8180 #line 8181 "configure"
8181 #include "confdefs.h"
8182 #include <$ac_hdr>
8183 EOF
8184 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8185 { (eval echo configure:8186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8186 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8187 if test -z "$ac_err"; then
8188   rm -rf conftest*
8189   eval "ac_cv_header_$ac_safe=yes"
8190 else
8191   echo "$ac_err" >&5
8192   echo "configure: failed program was:" >&5
8193   cat conftest.$ac_ext >&5
8194   rm -rf conftest*
8195   eval "ac_cv_header_$ac_safe=no"
8196 fi
8197 rm -f conftest*
8198 fi
8199 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8200   echo "$ac_t""yes" 1>&6
8201     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8202   cat >> confdefs.h <<EOF
8203 #define $ac_tr_hdr 1
8204 EOF
8205  
8206 else
8207   echo "$ac_t""no" 1>&6
8208 fi
8209 done
8210
8211 if test "$ol_cv_header_db2" = yes ; then
8212         
8213         ol_cv_header_db=$ac_cv_header_db_185_h
8214 else
8215         ol_cv_header_db=$ac_cv_header_db_h
8216 fi
8217
8218
8219  
8220  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
8221 echo "configure:8222: checking for Berkeley DB" >&5
8222 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
8223   echo $ac_n "(cached) $ac_c" 1>&6
8224 else
8225   
8226         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
8227                 ol_cv_berkeley_db=no
8228         else
8229                 ol_cv_berkeley_db=yes
8230         fi
8231
8232 fi
8233
8234 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
8235  if test $ol_cv_berkeley_db = yes ; then
8236         cat >> confdefs.h <<\EOF
8237 #define HAVE_BERKELEY_DB 1
8238 EOF
8239
8240  fi
8241
8242
8243         if test $ol_cv_berkeley_db = yes ; then
8244                 ol_link_ldbm=db
8245                 ol_with_ldbm_api=db
8246
8247                 if test $ol_with_ldbm_type = hash ; then
8248                         cat >> confdefs.h <<\EOF
8249 #define LDBM_USE_DBHASH 1
8250 EOF
8251
8252                 else
8253                         cat >> confdefs.h <<\EOF
8254 #define LDBM_USE_DBBTREE 1
8255 EOF
8256
8257                 fi
8258
8259                                                 if test $ol_cv_lib_db != yes ; then
8260                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
8261                 fi
8262         fi
8263 fi
8264
8265 if test $ol_with_ldbm_api = manual ; then
8266                 ol_link_ldbm=yes
8267
8268         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
8269
8270         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
8271 do
8272 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8273 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8274 echo "configure:8275: checking for $ac_hdr" >&5
8275 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8276   echo $ac_n "(cached) $ac_c" 1>&6
8277 else
8278   cat > conftest.$ac_ext <<EOF
8279 #line 8280 "configure"
8280 #include "confdefs.h"
8281 #include <$ac_hdr>
8282 EOF
8283 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8284 { (eval echo configure:8285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8285 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8286 if test -z "$ac_err"; then
8287   rm -rf conftest*
8288   eval "ac_cv_header_$ac_safe=yes"
8289 else
8290   echo "$ac_err" >&5
8291   echo "configure: failed program was:" >&5
8292   cat conftest.$ac_ext >&5
8293   rm -rf conftest*
8294   eval "ac_cv_header_$ac_safe=no"
8295 fi
8296 rm -f conftest*
8297 fi
8298 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8299   echo "$ac_t""yes" 1>&6
8300     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8301   cat >> confdefs.h <<EOF
8302 #define $ac_tr_hdr 1
8303 EOF
8304  
8305 else
8306   echo "$ac_t""no" 1>&6
8307 fi
8308 done
8309
8310 fi
8311
8312 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
8313         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
8314         ol_with_ldbm_api=none
8315 fi
8316
8317 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
8318         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
8319 echo "configure:8320: checking for MDBM library" >&5
8320 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
8321   echo $ac_n "(cached) $ac_c" 1>&6
8322 else
8323         ol_LIBS="$LIBS"
8324         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
8325 echo "configure:8326: checking for mdbm_set_chain" >&5
8326 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
8327   echo $ac_n "(cached) $ac_c" 1>&6
8328 else
8329   cat > conftest.$ac_ext <<EOF
8330 #line 8331 "configure"
8331 #include "confdefs.h"
8332 /* System header to define __stub macros and hopefully few prototypes,
8333     which can conflict with char mdbm_set_chain(); below.  */
8334 #include <assert.h>
8335 /* Override any gcc2 internal prototype to avoid an error.  */
8336 /* We use char because int might match the return type of a gcc2
8337     builtin and then its argument prototype would still apply.  */
8338 char mdbm_set_chain();
8339
8340 int main() {
8341
8342 /* The GNU C library defines this for functions which it implements
8343     to always fail with ENOSYS.  Some functions are actually named
8344     something starting with __ and the normal name is an alias.  */
8345 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
8346 choke me
8347 #else
8348 mdbm_set_chain();
8349 #endif
8350
8351 ; return 0; }
8352 EOF
8353 if { (eval echo configure:8354: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8354   rm -rf conftest*
8355   eval "ac_cv_func_mdbm_set_chain=yes"
8356 else
8357   echo "configure: failed program was:" >&5
8358   cat conftest.$ac_ext >&5
8359   rm -rf conftest*
8360   eval "ac_cv_func_mdbm_set_chain=no"
8361 fi
8362 rm -f conftest*
8363 fi
8364
8365 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
8366   echo "$ac_t""yes" 1>&6
8367   ol_cv_lib_mdbm=yes
8368 else
8369   echo "$ac_t""no" 1>&6
8370
8371                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
8372 echo "configure:8373: checking for mdbm_set_chain in -lmdbm" >&5
8373 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
8374 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8375   echo $ac_n "(cached) $ac_c" 1>&6
8376 else
8377   ac_save_LIBS="$LIBS"
8378 LIBS="-lmdbm  $LIBS"
8379 cat > conftest.$ac_ext <<EOF
8380 #line 8381 "configure"
8381 #include "confdefs.h"
8382 /* Override any gcc2 internal prototype to avoid an error.  */
8383 /* We use char because int might match the return type of a gcc2
8384     builtin and then its argument prototype would still apply.  */
8385 char mdbm_set_chain();
8386
8387 int main() {
8388 mdbm_set_chain()
8389 ; return 0; }
8390 EOF
8391 if { (eval echo configure:8392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8392   rm -rf conftest*
8393   eval "ac_cv_lib_$ac_lib_var=yes"
8394 else
8395   echo "configure: failed program was:" >&5
8396   cat conftest.$ac_ext >&5
8397   rm -rf conftest*
8398   eval "ac_cv_lib_$ac_lib_var=no"
8399 fi
8400 rm -f conftest*
8401 LIBS="$ac_save_LIBS"
8402
8403 fi
8404 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8405   echo "$ac_t""yes" 1>&6
8406   ol_cv_lib_mdbm=-lmdbm
8407 else
8408   echo "$ac_t""no" 1>&6
8409 ol_cv_lib_mdbm=no
8410 fi
8411
8412         
8413 fi
8414
8415         LIBS="$ol_LIBS"
8416
8417 fi
8418
8419 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
8420
8421
8422  for ac_hdr in mdbm.h
8423 do
8424 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8425 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8426 echo "configure:8427: checking for $ac_hdr" >&5
8427 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8428   echo $ac_n "(cached) $ac_c" 1>&6
8429 else
8430   cat > conftest.$ac_ext <<EOF
8431 #line 8432 "configure"
8432 #include "confdefs.h"
8433 #include <$ac_hdr>
8434 EOF
8435 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8436 { (eval echo configure:8437: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8437 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8438 if test -z "$ac_err"; then
8439   rm -rf conftest*
8440   eval "ac_cv_header_$ac_safe=yes"
8441 else
8442   echo "$ac_err" >&5
8443   echo "configure: failed program was:" >&5
8444   cat conftest.$ac_ext >&5
8445   rm -rf conftest*
8446   eval "ac_cv_header_$ac_safe=no"
8447 fi
8448 rm -f conftest*
8449 fi
8450 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8451   echo "$ac_t""yes" 1>&6
8452     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8453   cat >> confdefs.h <<EOF
8454 #define $ac_tr_hdr 1
8455 EOF
8456  
8457 else
8458   echo "$ac_t""no" 1>&6
8459 fi
8460 done
8461
8462  echo $ac_n "checking for db""... $ac_c" 1>&6
8463 echo "configure:8464: checking for db" >&5
8464 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
8465   echo $ac_n "(cached) $ac_c" 1>&6
8466 else
8467   
8468         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
8469                 ol_cv_mdbm=no
8470         else
8471                 ol_cv_mdbm=yes
8472         fi
8473
8474 fi
8475
8476 echo "$ac_t""$ol_cv_mdbm" 1>&6
8477  if test $ol_cv_mdbm = yes ; then
8478         cat >> confdefs.h <<\EOF
8479 #define HAVE_MDBM 1
8480 EOF
8481
8482  fi
8483
8484
8485         if test $ol_cv_mdbm = yes ; then
8486                 ol_link_ldbm=mdbm
8487                 ol_with_ldbm_api=mdbm
8488                 if test $ol_cv_lib_mdbm != yes ; then
8489                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
8490                 fi
8491         fi
8492 fi
8493
8494 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
8495         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
8496 echo "configure:8497: checking for GDBM library" >&5
8497 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
8498   echo $ac_n "(cached) $ac_c" 1>&6
8499 else
8500         ol_LIBS="$LIBS"
8501         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
8502 echo "configure:8503: checking for gdbm_open" >&5
8503 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
8504   echo $ac_n "(cached) $ac_c" 1>&6
8505 else
8506   cat > conftest.$ac_ext <<EOF
8507 #line 8508 "configure"
8508 #include "confdefs.h"
8509 /* System header to define __stub macros and hopefully few prototypes,
8510     which can conflict with char gdbm_open(); below.  */
8511 #include <assert.h>
8512 /* Override any gcc2 internal prototype to avoid an error.  */
8513 /* We use char because int might match the return type of a gcc2
8514     builtin and then its argument prototype would still apply.  */
8515 char gdbm_open();
8516
8517 int main() {
8518
8519 /* The GNU C library defines this for functions which it implements
8520     to always fail with ENOSYS.  Some functions are actually named
8521     something starting with __ and the normal name is an alias.  */
8522 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
8523 choke me
8524 #else
8525 gdbm_open();
8526 #endif
8527
8528 ; return 0; }
8529 EOF
8530 if { (eval echo configure:8531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8531   rm -rf conftest*
8532   eval "ac_cv_func_gdbm_open=yes"
8533 else
8534   echo "configure: failed program was:" >&5
8535   cat conftest.$ac_ext >&5
8536   rm -rf conftest*
8537   eval "ac_cv_func_gdbm_open=no"
8538 fi
8539 rm -f conftest*
8540 fi
8541
8542 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
8543   echo "$ac_t""yes" 1>&6
8544   ol_cv_lib_gdbm=yes
8545 else
8546   echo "$ac_t""no" 1>&6
8547
8548                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
8549 echo "configure:8550: checking for gdbm_open in -lgdbm" >&5
8550 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
8551 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8552   echo $ac_n "(cached) $ac_c" 1>&6
8553 else
8554   ac_save_LIBS="$LIBS"
8555 LIBS="-lgdbm  $LIBS"
8556 cat > conftest.$ac_ext <<EOF
8557 #line 8558 "configure"
8558 #include "confdefs.h"
8559 /* Override any gcc2 internal prototype to avoid an error.  */
8560 /* We use char because int might match the return type of a gcc2
8561     builtin and then its argument prototype would still apply.  */
8562 char gdbm_open();
8563
8564 int main() {
8565 gdbm_open()
8566 ; return 0; }
8567 EOF
8568 if { (eval echo configure:8569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8569   rm -rf conftest*
8570   eval "ac_cv_lib_$ac_lib_var=yes"
8571 else
8572   echo "configure: failed program was:" >&5
8573   cat conftest.$ac_ext >&5
8574   rm -rf conftest*
8575   eval "ac_cv_lib_$ac_lib_var=no"
8576 fi
8577 rm -f conftest*
8578 LIBS="$ac_save_LIBS"
8579
8580 fi
8581 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8582   echo "$ac_t""yes" 1>&6
8583   ol_cv_lib_gdbm=-lgdbm
8584 else
8585   echo "$ac_t""no" 1>&6
8586 ol_cv_lib_gdbm=no
8587 fi
8588
8589         
8590 fi
8591
8592         LIBS="$ol_LIBS"
8593
8594 fi
8595
8596 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
8597
8598
8599  for ac_hdr in gdbm.h
8600 do
8601 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8602 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8603 echo "configure:8604: checking for $ac_hdr" >&5
8604 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8605   echo $ac_n "(cached) $ac_c" 1>&6
8606 else
8607   cat > conftest.$ac_ext <<EOF
8608 #line 8609 "configure"
8609 #include "confdefs.h"
8610 #include <$ac_hdr>
8611 EOF
8612 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8613 { (eval echo configure:8614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8614 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8615 if test -z "$ac_err"; then
8616   rm -rf conftest*
8617   eval "ac_cv_header_$ac_safe=yes"
8618 else
8619   echo "$ac_err" >&5
8620   echo "configure: failed program was:" >&5
8621   cat conftest.$ac_ext >&5
8622   rm -rf conftest*
8623   eval "ac_cv_header_$ac_safe=no"
8624 fi
8625 rm -f conftest*
8626 fi
8627 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8628   echo "$ac_t""yes" 1>&6
8629     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8630   cat >> confdefs.h <<EOF
8631 #define $ac_tr_hdr 1
8632 EOF
8633  
8634 else
8635   echo "$ac_t""no" 1>&6
8636 fi
8637 done
8638
8639  echo $ac_n "checking for db""... $ac_c" 1>&6
8640 echo "configure:8641: checking for db" >&5
8641 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8642   echo $ac_n "(cached) $ac_c" 1>&6
8643 else
8644   
8645         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8646                 ol_cv_gdbm=no
8647         else
8648                 ol_cv_gdbm=yes
8649         fi
8650
8651 fi
8652
8653 echo "$ac_t""$ol_cv_gdbm" 1>&6
8654  if test $ol_cv_gdbm = yes ; then
8655         cat >> confdefs.h <<\EOF
8656 #define HAVE_GDBM 1
8657 EOF
8658
8659  fi
8660
8661
8662         if test $ol_cv_gdbm = yes ; then
8663                 ol_link_ldbm=gdbm
8664                 ol_with_ldbm_api=gdbm
8665
8666                 if test $ol_cv_lib_gdbm != yes ; then
8667                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8668                 fi
8669         fi
8670 fi
8671
8672 if test $ol_with_ldbm_api = auto ; then
8673         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8674 elif test $ol_with_ldbm_api = ndbm ; then
8675         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8676 echo "configure:8677: checking for NDBM library" >&5
8677 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8678   echo $ac_n "(cached) $ac_c" 1>&6
8679 else
8680         ol_LIBS="$LIBS"
8681         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8682 echo "configure:8683: checking for dbm_open" >&5
8683 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8684   echo $ac_n "(cached) $ac_c" 1>&6
8685 else
8686   cat > conftest.$ac_ext <<EOF
8687 #line 8688 "configure"
8688 #include "confdefs.h"
8689 /* System header to define __stub macros and hopefully few prototypes,
8690     which can conflict with char dbm_open(); below.  */
8691 #include <assert.h>
8692 /* Override any gcc2 internal prototype to avoid an error.  */
8693 /* We use char because int might match the return type of a gcc2
8694     builtin and then its argument prototype would still apply.  */
8695 char dbm_open();
8696
8697 int main() {
8698
8699 /* The GNU C library defines this for functions which it implements
8700     to always fail with ENOSYS.  Some functions are actually named
8701     something starting with __ and the normal name is an alias.  */
8702 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8703 choke me
8704 #else
8705 dbm_open();
8706 #endif
8707
8708 ; return 0; }
8709 EOF
8710 if { (eval echo configure:8711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8711   rm -rf conftest*
8712   eval "ac_cv_func_dbm_open=yes"
8713 else
8714   echo "configure: failed program was:" >&5
8715   cat conftest.$ac_ext >&5
8716   rm -rf conftest*
8717   eval "ac_cv_func_dbm_open=no"
8718 fi
8719 rm -f conftest*
8720 fi
8721
8722 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8723   echo "$ac_t""yes" 1>&6
8724   ol_cv_lib_ndbm=yes
8725 else
8726   echo "$ac_t""no" 1>&6
8727
8728                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8729 echo "configure:8730: checking for dbm_open in -lndbm" >&5
8730 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8731 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8732   echo $ac_n "(cached) $ac_c" 1>&6
8733 else
8734   ac_save_LIBS="$LIBS"
8735 LIBS="-lndbm  $LIBS"
8736 cat > conftest.$ac_ext <<EOF
8737 #line 8738 "configure"
8738 #include "confdefs.h"
8739 /* Override any gcc2 internal prototype to avoid an error.  */
8740 /* We use char because int might match the return type of a gcc2
8741     builtin and then its argument prototype would still apply.  */
8742 char dbm_open();
8743
8744 int main() {
8745 dbm_open()
8746 ; return 0; }
8747 EOF
8748 if { (eval echo configure:8749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8749   rm -rf conftest*
8750   eval "ac_cv_lib_$ac_lib_var=yes"
8751 else
8752   echo "configure: failed program was:" >&5
8753   cat conftest.$ac_ext >&5
8754   rm -rf conftest*
8755   eval "ac_cv_lib_$ac_lib_var=no"
8756 fi
8757 rm -f conftest*
8758 LIBS="$ac_save_LIBS"
8759
8760 fi
8761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8762   echo "$ac_t""yes" 1>&6
8763   ol_cv_lib_ndbm=-lndbm
8764 else
8765   echo "$ac_t""no" 1>&6
8766
8767                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8768 echo "configure:8769: checking for dbm_open in -ldbm" >&5
8769 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8770 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8771   echo $ac_n "(cached) $ac_c" 1>&6
8772 else
8773   ac_save_LIBS="$LIBS"
8774 LIBS="-ldbm  $LIBS"
8775 cat > conftest.$ac_ext <<EOF
8776 #line 8777 "configure"
8777 #include "confdefs.h"
8778 /* Override any gcc2 internal prototype to avoid an error.  */
8779 /* We use char because int might match the return type of a gcc2
8780     builtin and then its argument prototype would still apply.  */
8781 char dbm_open();
8782
8783 int main() {
8784 dbm_open()
8785 ; return 0; }
8786 EOF
8787 if { (eval echo configure:8788: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8788   rm -rf conftest*
8789   eval "ac_cv_lib_$ac_lib_var=yes"
8790 else
8791   echo "configure: failed program was:" >&5
8792   cat conftest.$ac_ext >&5
8793   rm -rf conftest*
8794   eval "ac_cv_lib_$ac_lib_var=no"
8795 fi
8796 rm -f conftest*
8797 LIBS="$ac_save_LIBS"
8798
8799 fi
8800 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8801   echo "$ac_t""yes" 1>&6
8802   ol_cv_lib_ndbm=-ldbm
8803 else
8804   echo "$ac_t""no" 1>&6
8805 ol_cv_lib_ndbm=no
8806 fi
8807                 
8808 fi
8809
8810         
8811 fi
8812
8813         LIBS="$ol_LIBS"
8814
8815 fi
8816
8817 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8818
8819
8820  for ac_hdr in ndbm.h
8821 do
8822 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8823 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8824 echo "configure:8825: checking for $ac_hdr" >&5
8825 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8826   echo $ac_n "(cached) $ac_c" 1>&6
8827 else
8828   cat > conftest.$ac_ext <<EOF
8829 #line 8830 "configure"
8830 #include "confdefs.h"
8831 #include <$ac_hdr>
8832 EOF
8833 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8834 { (eval echo configure:8835: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8835 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8836 if test -z "$ac_err"; then
8837   rm -rf conftest*
8838   eval "ac_cv_header_$ac_safe=yes"
8839 else
8840   echo "$ac_err" >&5
8841   echo "configure: failed program was:" >&5
8842   cat conftest.$ac_ext >&5
8843   rm -rf conftest*
8844   eval "ac_cv_header_$ac_safe=no"
8845 fi
8846 rm -f conftest*
8847 fi
8848 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8849   echo "$ac_t""yes" 1>&6
8850     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8851   cat >> confdefs.h <<EOF
8852 #define $ac_tr_hdr 1
8853 EOF
8854  
8855 else
8856   echo "$ac_t""no" 1>&6
8857 fi
8858 done
8859
8860  echo $ac_n "checking for db""... $ac_c" 1>&6
8861 echo "configure:8862: checking for db" >&5
8862 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8863   echo $ac_n "(cached) $ac_c" 1>&6
8864 else
8865   
8866         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8867                 ol_cv_ndbm=no
8868         else
8869                 ol_cv_ndbm=yes
8870         fi
8871
8872 fi
8873
8874 echo "$ac_t""$ol_cv_ndbm" 1>&6
8875  if test $ol_cv_ndbm = yes ; then
8876         cat >> confdefs.h <<\EOF
8877 #define HAVE_NDBM 1
8878 EOF
8879
8880  fi
8881
8882
8883         if test $ol_cv_ndbm = yes ; then
8884                 ol_link_ldbm=ndbm
8885                 ol_with_ldbm_api=ndbm
8886
8887                 if test $ol_cv_lib_ndbm != yes ; then
8888                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8889                 fi
8890         fi
8891 fi
8892
8893 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8894         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8895         if test $ol_enable_ldbm = yes ; then
8896                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8897         fi
8898
8899         echo "configure: warning: disabling LDBM" 1>&2
8900         ol_enable_ldbm=no
8901 fi
8902
8903 if test $ol_enable_wrappers != no ; then
8904         for ac_hdr in tcpd.h
8905 do
8906 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8907 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8908 echo "configure:8909: checking for $ac_hdr" >&5
8909 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8910   echo $ac_n "(cached) $ac_c" 1>&6
8911 else
8912   cat > conftest.$ac_ext <<EOF
8913 #line 8914 "configure"
8914 #include "confdefs.h"
8915 #include <$ac_hdr>
8916 EOF
8917 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8918 { (eval echo configure:8919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8919 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8920 if test -z "$ac_err"; then
8921   rm -rf conftest*
8922   eval "ac_cv_header_$ac_safe=yes"
8923 else
8924   echo "$ac_err" >&5
8925   echo "configure: failed program was:" >&5
8926   cat conftest.$ac_ext >&5
8927   rm -rf conftest*
8928   eval "ac_cv_header_$ac_safe=no"
8929 fi
8930 rm -f conftest*
8931 fi
8932 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8933   echo "$ac_t""yes" 1>&6
8934     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8935   cat >> confdefs.h <<EOF
8936 #define $ac_tr_hdr 1
8937 EOF
8938  
8939 else
8940   echo "$ac_t""no" 1>&6
8941 fi
8942 done
8943
8944
8945         if test $ac_cv_header_tcpd_h != yes ; then
8946                 have_wrappers=no
8947         else
8948                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8949 echo "configure:8950: checking for main in -lwrap" >&5
8950 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8951 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8952   echo $ac_n "(cached) $ac_c" 1>&6
8953 else
8954   ac_save_LIBS="$LIBS"
8955 LIBS="-lwrap  $LIBS"
8956 cat > conftest.$ac_ext <<EOF
8957 #line 8958 "configure"
8958 #include "confdefs.h"
8959
8960 int main() {
8961 main()
8962 ; return 0; }
8963 EOF
8964 if { (eval echo configure:8965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8965   rm -rf conftest*
8966   eval "ac_cv_lib_$ac_lib_var=yes"
8967 else
8968   echo "configure: failed program was:" >&5
8969   cat conftest.$ac_ext >&5
8970   rm -rf conftest*
8971   eval "ac_cv_lib_$ac_lib_var=no"
8972 fi
8973 rm -f conftest*
8974 LIBS="$ac_save_LIBS"
8975
8976 fi
8977 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8978   echo "$ac_t""yes" 1>&6
8979   have_wrappers=yes
8980 else
8981   echo "$ac_t""no" 1>&6
8982 have_wrappers=no
8983 fi
8984
8985         fi
8986
8987         if test $have_wrappers = yes ; then
8988                 cat >> confdefs.h <<\EOF
8989 #define HAVE_TCPD 1
8990 EOF
8991
8992                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8993
8994                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8995 echo "configure:8996: checking for main in -lnsl" >&5
8996 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8997 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8998   echo $ac_n "(cached) $ac_c" 1>&6
8999 else
9000   ac_save_LIBS="$LIBS"
9001 LIBS="-lnsl  $LIBS"
9002 cat > conftest.$ac_ext <<EOF
9003 #line 9004 "configure"
9004 #include "confdefs.h"
9005
9006 int main() {
9007 main()
9008 ; return 0; }
9009 EOF
9010 if { (eval echo configure:9011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9011   rm -rf conftest*
9012   eval "ac_cv_lib_$ac_lib_var=yes"
9013 else
9014   echo "configure: failed program was:" >&5
9015   cat conftest.$ac_ext >&5
9016   rm -rf conftest*
9017   eval "ac_cv_lib_$ac_lib_var=no"
9018 fi
9019 rm -f conftest*
9020 LIBS="$ac_save_LIBS"
9021
9022 fi
9023 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9024   echo "$ac_t""yes" 1>&6
9025     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9026     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9027   cat >> confdefs.h <<EOF
9028 #define $ac_tr_lib 1
9029 EOF
9030
9031   LIBS="-lnsl $LIBS"
9032
9033 else
9034   echo "$ac_t""no" 1>&6
9035 fi
9036
9037         else
9038                 echo "configure: warning: could not find -lwrap" 1>&2
9039                 if test $ol_enable_wrappers = yes ; then
9040                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
9041                 fi
9042
9043                 echo "configure: warning: disabling wrappers support" 1>&2
9044                 ol_enable_wrappers=no
9045         fi
9046 fi
9047
9048 if test $ol_enable_syslog != no ; then
9049         echo $ac_n "checking for openlog""... $ac_c" 1>&6
9050 echo "configure:9051: checking for openlog" >&5
9051 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
9052   echo $ac_n "(cached) $ac_c" 1>&6
9053 else
9054   cat > conftest.$ac_ext <<EOF
9055 #line 9056 "configure"
9056 #include "confdefs.h"
9057 /* System header to define __stub macros and hopefully few prototypes,
9058     which can conflict with char openlog(); below.  */
9059 #include <assert.h>
9060 /* Override any gcc2 internal prototype to avoid an error.  */
9061 /* We use char because int might match the return type of a gcc2
9062     builtin and then its argument prototype would still apply.  */
9063 char openlog();
9064
9065 int main() {
9066
9067 /* The GNU C library defines this for functions which it implements
9068     to always fail with ENOSYS.  Some functions are actually named
9069     something starting with __ and the normal name is an alias.  */
9070 #if defined (__stub_openlog) || defined (__stub___openlog)
9071 choke me
9072 #else
9073 openlog();
9074 #endif
9075
9076 ; return 0; }
9077 EOF
9078 if { (eval echo configure:9079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9079   rm -rf conftest*
9080   eval "ac_cv_func_openlog=yes"
9081 else
9082   echo "configure: failed program was:" >&5
9083   cat conftest.$ac_ext >&5
9084   rm -rf conftest*
9085   eval "ac_cv_func_openlog=no"
9086 fi
9087 rm -f conftest*
9088 fi
9089
9090 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
9091   echo "$ac_t""yes" 1>&6
9092   :
9093 else
9094   echo "$ac_t""no" 1>&6
9095 fi
9096
9097         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
9098                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
9099         fi
9100         ol_enable_syslog=$ac_cv_func_openlog
9101 fi
9102
9103 if test $ol_enable_dmalloc != no ; then
9104         for ac_hdr in dmalloc.h
9105 do
9106 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9107 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9108 echo "configure:9109: checking for $ac_hdr" >&5
9109 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9110   echo $ac_n "(cached) $ac_c" 1>&6
9111 else
9112   cat > conftest.$ac_ext <<EOF
9113 #line 9114 "configure"
9114 #include "confdefs.h"
9115 #include <$ac_hdr>
9116 EOF
9117 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9118 { (eval echo configure:9119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9119 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9120 if test -z "$ac_err"; then
9121   rm -rf conftest*
9122   eval "ac_cv_header_$ac_safe=yes"
9123 else
9124   echo "$ac_err" >&5
9125   echo "configure: failed program was:" >&5
9126   cat conftest.$ac_ext >&5
9127   rm -rf conftest*
9128   eval "ac_cv_header_$ac_safe=no"
9129 fi
9130 rm -f conftest*
9131 fi
9132 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9133   echo "$ac_t""yes" 1>&6
9134     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9135   cat >> confdefs.h <<EOF
9136 #define $ac_tr_hdr 1
9137 EOF
9138  
9139 else
9140   echo "$ac_t""no" 1>&6
9141 fi
9142 done
9143
9144         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
9145 echo "configure:9146: checking for dmalloc_shutdown in -ldmalloc" >&5
9146 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
9147 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9148   echo $ac_n "(cached) $ac_c" 1>&6
9149 else
9150   ac_save_LIBS="$LIBS"
9151 LIBS="-ldmalloc  $LIBS"
9152 cat > conftest.$ac_ext <<EOF
9153 #line 9154 "configure"
9154 #include "confdefs.h"
9155 /* Override any gcc2 internal prototype to avoid an error.  */
9156 /* We use char because int might match the return type of a gcc2
9157     builtin and then its argument prototype would still apply.  */
9158 char dmalloc_shutdown();
9159
9160 int main() {
9161 dmalloc_shutdown()
9162 ; return 0; }
9163 EOF
9164 if { (eval echo configure:9165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9165   rm -rf conftest*
9166   eval "ac_cv_lib_$ac_lib_var=yes"
9167 else
9168   echo "configure: failed program was:" >&5
9169   cat conftest.$ac_ext >&5
9170   rm -rf conftest*
9171   eval "ac_cv_lib_$ac_lib_var=no"
9172 fi
9173 rm -f conftest*
9174 LIBS="$ac_save_LIBS"
9175
9176 fi
9177 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9178   echo "$ac_t""yes" 1>&6
9179     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
9180     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
9181   cat >> confdefs.h <<EOF
9182 #define $ac_tr_lib 1
9183 EOF
9184
9185   LIBS="-ldmalloc $LIBS"
9186
9187 else
9188   echo "$ac_t""no" 1>&6
9189 fi
9190
9191 fi
9192
9193 if test $ol_enable_tcl != no ; then
9194         for ac_hdr in tcl.h
9195 do
9196 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9197 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9198 echo "configure:9199: checking for $ac_hdr" >&5
9199 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9200   echo $ac_n "(cached) $ac_c" 1>&6
9201 else
9202   cat > conftest.$ac_ext <<EOF
9203 #line 9204 "configure"
9204 #include "confdefs.h"
9205 #include <$ac_hdr>
9206 EOF
9207 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9208 { (eval echo configure:9209: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9209 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9210 if test -z "$ac_err"; then
9211   rm -rf conftest*
9212   eval "ac_cv_header_$ac_safe=yes"
9213 else
9214   echo "$ac_err" >&5
9215   echo "configure: failed program was:" >&5
9216   cat conftest.$ac_ext >&5
9217   rm -rf conftest*
9218   eval "ac_cv_header_$ac_safe=no"
9219 fi
9220 rm -f conftest*
9221 fi
9222 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9223   echo "$ac_t""yes" 1>&6
9224     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9225   cat >> confdefs.h <<EOF
9226 #define $ac_tr_hdr 1
9227 EOF
9228  
9229 else
9230   echo "$ac_t""no" 1>&6
9231 fi
9232 done
9233
9234
9235         if test $ac_cv_header_tcl_h != yes ; then
9236                 have_tcl=no
9237         else
9238                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
9239 echo "configure:9240: checking for main in -ltcl" >&5
9240 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
9241 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9242   echo $ac_n "(cached) $ac_c" 1>&6
9243 else
9244   ac_save_LIBS="$LIBS"
9245 LIBS="-ltcl  $LIBS"
9246 cat > conftest.$ac_ext <<EOF
9247 #line 9248 "configure"
9248 #include "confdefs.h"
9249
9250 int main() {
9251 main()
9252 ; return 0; }
9253 EOF
9254 if { (eval echo configure:9255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9255   rm -rf conftest*
9256   eval "ac_cv_lib_$ac_lib_var=yes"
9257 else
9258   echo "configure: failed program was:" >&5
9259   cat conftest.$ac_ext >&5
9260   rm -rf conftest*
9261   eval "ac_cv_lib_$ac_lib_var=no"
9262 fi
9263 rm -f conftest*
9264 LIBS="$ac_save_LIBS"
9265
9266 fi
9267 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9268   echo "$ac_t""yes" 1>&6
9269   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
9270 else
9271   echo "$ac_t""no" 1>&6
9272 have_tcl=no
9273 fi
9274
9275
9276                 if test $have_tcl != yes; then
9277                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
9278 echo "configure:9279: checking for main in -ltcl7.6" >&5
9279 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
9280 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9281   echo $ac_n "(cached) $ac_c" 1>&6
9282 else
9283   ac_save_LIBS="$LIBS"
9284 LIBS="-ltcl7.6  $LIBS"
9285 cat > conftest.$ac_ext <<EOF
9286 #line 9287 "configure"
9287 #include "confdefs.h"
9288
9289 int main() {
9290 main()
9291 ; return 0; }
9292 EOF
9293 if { (eval echo configure:9294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9294   rm -rf conftest*
9295   eval "ac_cv_lib_$ac_lib_var=yes"
9296 else
9297   echo "configure: failed program was:" >&5
9298   cat conftest.$ac_ext >&5
9299   rm -rf conftest*
9300   eval "ac_cv_lib_$ac_lib_var=no"
9301 fi
9302 rm -f conftest*
9303 LIBS="$ac_save_LIBS"
9304
9305 fi
9306 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9307   echo "$ac_t""yes" 1>&6
9308   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
9309 else
9310   echo "$ac_t""no" 1>&6
9311 have_tcl=no
9312 fi
9313
9314                 fi
9315
9316                 if test $have_tcl != yes; then
9317                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
9318 echo "configure:9319: checking for main in -ltcl8.0" >&5
9319 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
9320 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9321   echo $ac_n "(cached) $ac_c" 1>&6
9322 else
9323   ac_save_LIBS="$LIBS"
9324 LIBS="-ltcl8.0  $LIBS"
9325 cat > conftest.$ac_ext <<EOF
9326 #line 9327 "configure"
9327 #include "confdefs.h"
9328
9329 int main() {
9330 main()
9331 ; return 0; }
9332 EOF
9333 if { (eval echo configure:9334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9334   rm -rf conftest*
9335   eval "ac_cv_lib_$ac_lib_var=yes"
9336 else
9337   echo "configure: failed program was:" >&5
9338   cat conftest.$ac_ext >&5
9339   rm -rf conftest*
9340   eval "ac_cv_lib_$ac_lib_var=no"
9341 fi
9342 rm -f conftest*
9343 LIBS="$ac_save_LIBS"
9344
9345 fi
9346 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9347   echo "$ac_t""yes" 1>&6
9348   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
9349 else
9350   echo "$ac_t""no" 1>&6
9351 have_tcl=no
9352 fi
9353
9354                 fi
9355         fi
9356
9357         if test $have_tcl != yes ; then
9358                 echo "configure: warning: could not find -ltcl" 1>&2
9359                 if test $ol_enable_tcl = yes ; then
9360                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
9361                 fi
9362
9363                 ol_enable_tcl=no
9364         fi
9365 fi
9366
9367 # ud needs termcap (should insert check here)
9368 ol_link_termcap=no
9369 for ac_hdr in termcap.h ncurses.h
9370 do
9371 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9372 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9373 echo "configure:9374: checking for $ac_hdr" >&5
9374 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9375   echo $ac_n "(cached) $ac_c" 1>&6
9376 else
9377   cat > conftest.$ac_ext <<EOF
9378 #line 9379 "configure"
9379 #include "confdefs.h"
9380 #include <$ac_hdr>
9381 EOF
9382 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9383 { (eval echo configure:9384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9384 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9385 if test -z "$ac_err"; then
9386   rm -rf conftest*
9387   eval "ac_cv_header_$ac_safe=yes"
9388 else
9389   echo "$ac_err" >&5
9390   echo "configure: failed program was:" >&5
9391   cat conftest.$ac_ext >&5
9392   rm -rf conftest*
9393   eval "ac_cv_header_$ac_safe=no"
9394 fi
9395 rm -f conftest*
9396 fi
9397 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9398   echo "$ac_t""yes" 1>&6
9399     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9400   cat >> confdefs.h <<EOF
9401 #define $ac_tr_hdr 1
9402 EOF
9403  
9404 else
9405   echo "$ac_t""no" 1>&6
9406 fi
9407 done
9408
9409
9410 if test $ol_link_termcap = no ; then
9411         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
9412 echo "configure:9413: checking for tputs in -ltermcap" >&5
9413 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
9414 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9415   echo $ac_n "(cached) $ac_c" 1>&6
9416 else
9417   ac_save_LIBS="$LIBS"
9418 LIBS="-ltermcap  $LIBS"
9419 cat > conftest.$ac_ext <<EOF
9420 #line 9421 "configure"
9421 #include "confdefs.h"
9422 /* Override any gcc2 internal prototype to avoid an error.  */
9423 /* We use char because int might match the return type of a gcc2
9424     builtin and then its argument prototype would still apply.  */
9425 char tputs();
9426
9427 int main() {
9428 tputs()
9429 ; return 0; }
9430 EOF
9431 if { (eval echo configure:9432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9432   rm -rf conftest*
9433   eval "ac_cv_lib_$ac_lib_var=yes"
9434 else
9435   echo "configure: failed program was:" >&5
9436   cat conftest.$ac_ext >&5
9437   rm -rf conftest*
9438   eval "ac_cv_lib_$ac_lib_var=no"
9439 fi
9440 rm -f conftest*
9441 LIBS="$ac_save_LIBS"
9442
9443 fi
9444 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9445   echo "$ac_t""yes" 1>&6
9446   have_termcap=yes
9447 else
9448   echo "$ac_t""no" 1>&6
9449 have_termcap=no
9450 fi
9451
9452         if test $have_termcap = yes ; then
9453                 cat >> confdefs.h <<\EOF
9454 #define HAVE_TERMCAP 1
9455 EOF
9456
9457                 ol_link_termcap=yes
9458                 TERMCAP_LIBS=-ltermcap
9459         fi
9460 fi
9461
9462 if test $ol_link_termcap = no ; then
9463         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
9464 echo "configure:9465: checking for initscr in -lncurses" >&5
9465 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
9466 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9467   echo $ac_n "(cached) $ac_c" 1>&6
9468 else
9469   ac_save_LIBS="$LIBS"
9470 LIBS="-lncurses  $LIBS"
9471 cat > conftest.$ac_ext <<EOF
9472 #line 9473 "configure"
9473 #include "confdefs.h"
9474 /* Override any gcc2 internal prototype to avoid an error.  */
9475 /* We use char because int might match the return type of a gcc2
9476     builtin and then its argument prototype would still apply.  */
9477 char initscr();
9478
9479 int main() {
9480 initscr()
9481 ; return 0; }
9482 EOF
9483 if { (eval echo configure:9484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9484   rm -rf conftest*
9485   eval "ac_cv_lib_$ac_lib_var=yes"
9486 else
9487   echo "configure: failed program was:" >&5
9488   cat conftest.$ac_ext >&5
9489   rm -rf conftest*
9490   eval "ac_cv_lib_$ac_lib_var=no"
9491 fi
9492 rm -f conftest*
9493 LIBS="$ac_save_LIBS"
9494
9495 fi
9496 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9497   echo "$ac_t""yes" 1>&6
9498   have_ncurses=yes
9499 else
9500   echo "$ac_t""no" 1>&6
9501 have_ncurses=no
9502 fi
9503
9504         if test $have_ncurses = yes ; then
9505                 cat >> confdefs.h <<\EOF
9506 #define HAVE_NCURSES 1
9507 EOF
9508
9509                 ol_link_termcap=yes
9510                 TERMCAP_LIBS=-lncurses
9511         fi
9512 fi
9513
9514 if test $ol_link_termcap = no ; then
9515         cat >> confdefs.h <<\EOF
9516 #define NO_TERMCAP 1
9517 EOF
9518
9519         TERMCAP_LIBS=
9520 fi
9521
9522 ol_link_readline=no
9523 if test $ol_with_readline != no ; then
9524         for ac_hdr in readline/readline.h readline/history.h
9525 do
9526 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9527 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9528 echo "configure:9529: checking for $ac_hdr" >&5
9529 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9530   echo $ac_n "(cached) $ac_c" 1>&6
9531 else
9532   cat > conftest.$ac_ext <<EOF
9533 #line 9534 "configure"
9534 #include "confdefs.h"
9535 #include <$ac_hdr>
9536 EOF
9537 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9538 { (eval echo configure:9539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9539 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9540 if test -z "$ac_err"; then
9541   rm -rf conftest*
9542   eval "ac_cv_header_$ac_safe=yes"
9543 else
9544   echo "$ac_err" >&5
9545   echo "configure: failed program was:" >&5
9546   cat conftest.$ac_ext >&5
9547   rm -rf conftest*
9548   eval "ac_cv_header_$ac_safe=no"
9549 fi
9550 rm -f conftest*
9551 fi
9552 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9553   echo "$ac_t""yes" 1>&6
9554     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9555   cat >> confdefs.h <<EOF
9556 #define $ac_tr_hdr 1
9557 EOF
9558  
9559 else
9560   echo "$ac_t""no" 1>&6
9561 fi
9562 done
9563
9564
9565         if test $ac_cv_header_readline_readline_h = yes ; then
9566                 save_LIBS="$LIBS"
9567                 LIBS="$TERMCAP_LIBS $LIBS"
9568                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
9569 echo "configure:9570: checking for readline in -lreadline" >&5
9570 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
9571 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9572   echo $ac_n "(cached) $ac_c" 1>&6
9573 else
9574   ac_save_LIBS="$LIBS"
9575 LIBS="-lreadline  $LIBS"
9576 cat > conftest.$ac_ext <<EOF
9577 #line 9578 "configure"
9578 #include "confdefs.h"
9579 /* Override any gcc2 internal prototype to avoid an error.  */
9580 /* We use char because int might match the return type of a gcc2
9581     builtin and then its argument prototype would still apply.  */
9582 char readline();
9583
9584 int main() {
9585 readline()
9586 ; return 0; }
9587 EOF
9588 if { (eval echo configure:9589: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9589   rm -rf conftest*
9590   eval "ac_cv_lib_$ac_lib_var=yes"
9591 else
9592   echo "configure: failed program was:" >&5
9593   cat conftest.$ac_ext >&5
9594   rm -rf conftest*
9595   eval "ac_cv_lib_$ac_lib_var=no"
9596 fi
9597 rm -f conftest*
9598 LIBS="$ac_save_LIBS"
9599
9600 fi
9601 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9602   echo "$ac_t""yes" 1>&6
9603   have_readline=yes
9604 else
9605   echo "$ac_t""no" 1>&6
9606 have_readline=no
9607 fi
9608
9609                 LIBS="$save_LIBS"
9610                         
9611                 if test $have_readline = yes ; then
9612                         ol_with_readline=found
9613                         ol_link_readline=yes
9614
9615                         READLINE_LIBS="-lreadline"
9616                 fi
9617         fi
9618 fi
9619
9620 if test $ol_link_readline = yes ; then
9621         cat >> confdefs.h <<\EOF
9622 #define HAVE_READLINE 1
9623 EOF
9624
9625 fi
9626
9627
9628 # FreeBSD (and others) have crypt(3) in -lcrypt
9629 if test $ol_enable_crypt != no ; then
9630         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9631 echo "configure:9632: checking for crypt" >&5
9632 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9633   echo $ac_n "(cached) $ac_c" 1>&6
9634 else
9635   cat > conftest.$ac_ext <<EOF
9636 #line 9637 "configure"
9637 #include "confdefs.h"
9638 /* System header to define __stub macros and hopefully few prototypes,
9639     which can conflict with char crypt(); below.  */
9640 #include <assert.h>
9641 /* Override any gcc2 internal prototype to avoid an error.  */
9642 /* We use char because int might match the return type of a gcc2
9643     builtin and then its argument prototype would still apply.  */
9644 char crypt();
9645
9646 int main() {
9647
9648 /* The GNU C library defines this for functions which it implements
9649     to always fail with ENOSYS.  Some functions are actually named
9650     something starting with __ and the normal name is an alias.  */
9651 #if defined (__stub_crypt) || defined (__stub___crypt)
9652 choke me
9653 #else
9654 crypt();
9655 #endif
9656
9657 ; return 0; }
9658 EOF
9659 if { (eval echo configure:9660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9660   rm -rf conftest*
9661   eval "ac_cv_func_crypt=yes"
9662 else
9663   echo "configure: failed program was:" >&5
9664   cat conftest.$ac_ext >&5
9665   rm -rf conftest*
9666   eval "ac_cv_func_crypt=no"
9667 fi
9668 rm -f conftest*
9669 fi
9670
9671 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9672   echo "$ac_t""yes" 1>&6
9673   have_crypt=yes
9674 else
9675   echo "$ac_t""no" 1>&6
9676
9677                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9678 echo "configure:9679: checking for crypt in -lcrypt" >&5
9679 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9680 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9681   echo $ac_n "(cached) $ac_c" 1>&6
9682 else
9683   ac_save_LIBS="$LIBS"
9684 LIBS="-lcrypt  $LIBS"
9685 cat > conftest.$ac_ext <<EOF
9686 #line 9687 "configure"
9687 #include "confdefs.h"
9688 /* Override any gcc2 internal prototype to avoid an error.  */
9689 /* We use char because int might match the return type of a gcc2
9690     builtin and then its argument prototype would still apply.  */
9691 char crypt();
9692
9693 int main() {
9694 crypt()
9695 ; return 0; }
9696 EOF
9697 if { (eval echo configure:9698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9698   rm -rf conftest*
9699   eval "ac_cv_lib_$ac_lib_var=yes"
9700 else
9701   echo "configure: failed program was:" >&5
9702   cat conftest.$ac_ext >&5
9703   rm -rf conftest*
9704   eval "ac_cv_lib_$ac_lib_var=no"
9705 fi
9706 rm -f conftest*
9707 LIBS="$ac_save_LIBS"
9708
9709 fi
9710 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9711   echo "$ac_t""yes" 1>&6
9712   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9713                         have_crypt=yes
9714 else
9715   echo "$ac_t""no" 1>&6
9716 have_crypt=no
9717 fi
9718
9719 fi
9720
9721
9722         if test $have_crypt = yes ; then
9723                 cat >> confdefs.h <<\EOF
9724 #define HAVE_CRYPT 1
9725 EOF
9726
9727         else
9728                 echo "configure: warning: could not find crypt" 1>&2
9729                 if test $ol_enable_crypt = yes ; then
9730                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9731                 fi
9732
9733                 echo "configure: warning: disabling crypt support" 1>&2
9734                 ol_enable_crypt=no
9735         fi
9736 fi
9737
9738 # FreeBSD (and others) have setproctitle(3) in -lutil
9739 if test $ol_enable_proctitle != no ; then
9740         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9741 echo "configure:9742: checking for setproctitle" >&5
9742 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9743   echo $ac_n "(cached) $ac_c" 1>&6
9744 else
9745   cat > conftest.$ac_ext <<EOF
9746 #line 9747 "configure"
9747 #include "confdefs.h"
9748 /* System header to define __stub macros and hopefully few prototypes,
9749     which can conflict with char setproctitle(); below.  */
9750 #include <assert.h>
9751 /* Override any gcc2 internal prototype to avoid an error.  */
9752 /* We use char because int might match the return type of a gcc2
9753     builtin and then its argument prototype would still apply.  */
9754 char setproctitle();
9755
9756 int main() {
9757
9758 /* The GNU C library defines this for functions which it implements
9759     to always fail with ENOSYS.  Some functions are actually named
9760     something starting with __ and the normal name is an alias.  */
9761 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9762 choke me
9763 #else
9764 setproctitle();
9765 #endif
9766
9767 ; return 0; }
9768 EOF
9769 if { (eval echo configure:9770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9770   rm -rf conftest*
9771   eval "ac_cv_func_setproctitle=yes"
9772 else
9773   echo "configure: failed program was:" >&5
9774   cat conftest.$ac_ext >&5
9775   rm -rf conftest*
9776   eval "ac_cv_func_setproctitle=no"
9777 fi
9778 rm -f conftest*
9779 fi
9780
9781 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9782   echo "$ac_t""yes" 1>&6
9783   have_setproctitle=yes
9784 else
9785   echo "$ac_t""no" 1>&6
9786
9787                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9788 echo "configure:9789: checking for setproctitle in -lutil" >&5
9789 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9790 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9791   echo $ac_n "(cached) $ac_c" 1>&6
9792 else
9793   ac_save_LIBS="$LIBS"
9794 LIBS="-lutil  $LIBS"
9795 cat > conftest.$ac_ext <<EOF
9796 #line 9797 "configure"
9797 #include "confdefs.h"
9798 /* Override any gcc2 internal prototype to avoid an error.  */
9799 /* We use char because int might match the return type of a gcc2
9800     builtin and then its argument prototype would still apply.  */
9801 char setproctitle();
9802
9803 int main() {
9804 setproctitle()
9805 ; return 0; }
9806 EOF
9807 if { (eval echo configure:9808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9808   rm -rf conftest*
9809   eval "ac_cv_lib_$ac_lib_var=yes"
9810 else
9811   echo "configure: failed program was:" >&5
9812   cat conftest.$ac_ext >&5
9813   rm -rf conftest*
9814   eval "ac_cv_lib_$ac_lib_var=no"
9815 fi
9816 rm -f conftest*
9817 LIBS="$ac_save_LIBS"
9818
9819 fi
9820 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9821   echo "$ac_t""yes" 1>&6
9822   have_setproctitle=yes
9823                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9824 else
9825   echo "$ac_t""no" 1>&6
9826 have_setproctitle=no
9827                         LIBOBJS="$LIBOBJS setproctitle.o"
9828 fi
9829
9830 fi
9831
9832
9833         if test $have_setproctitle = yes ; then
9834                 cat >> confdefs.h <<\EOF
9835 #define HAVE_SETPROCTITLE 1
9836 EOF
9837
9838         fi
9839 fi
9840
9841 # test for EBCDIC
9842 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9843 echo "configure:9844: checking for EBCDIC" >&5
9844 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9845   echo $ac_n "(cached) $ac_c" 1>&6
9846 else
9847   
9848         cat > conftest.$ac_ext <<EOF
9849 #line 9850 "configure"
9850 #include "confdefs.h"
9851
9852 #if !('M' == 0xd4)
9853 #include <__ASCII__/generate_error.h>
9854 #endif
9855
9856 EOF
9857 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9858 { (eval echo configure:9859: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9859 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9860 if test -z "$ac_err"; then
9861   rm -rf conftest*
9862   ol_cv_cpp_ebcdic=yes
9863 else
9864   echo "$ac_err" >&5
9865   echo "configure: failed program was:" >&5
9866   cat conftest.$ac_ext >&5
9867   rm -rf conftest*
9868   ol_cv_cpp_ebcdic=no
9869 fi
9870 rm -f conftest*
9871 fi
9872
9873 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9874 if test $ol_cv_cpp_ebcdic = yes ; then
9875         cat >> confdefs.h <<\EOF
9876 #define HAVE_EBCDIC 1
9877 EOF
9878
9879 fi
9880
9881 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9882 echo "configure:9883: checking for ANSI C header files" >&5
9883 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9884   echo $ac_n "(cached) $ac_c" 1>&6
9885 else
9886   cat > conftest.$ac_ext <<EOF
9887 #line 9888 "configure"
9888 #include "confdefs.h"
9889 #include <stdlib.h>
9890 #include <stdarg.h>
9891 #include <string.h>
9892 #include <float.h>
9893 EOF
9894 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9895 { (eval echo configure:9896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9896 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9897 if test -z "$ac_err"; then
9898   rm -rf conftest*
9899   ol_cv_header_stdc=yes
9900 else
9901   echo "$ac_err" >&5
9902   echo "configure: failed program was:" >&5
9903   cat conftest.$ac_ext >&5
9904   rm -rf conftest*
9905   ol_cv_header_stdc=no
9906 fi
9907 rm -f conftest*
9908
9909 if test $ol_cv_header_stdc = yes; then
9910   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9911 cat > conftest.$ac_ext <<EOF
9912 #line 9913 "configure"
9913 #include "confdefs.h"
9914 #include <string.h>
9915 EOF
9916 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9917   egrep "memchr" >/dev/null 2>&1; then
9918   :
9919 else
9920   rm -rf conftest*
9921   ol_cv_header_stdc=no
9922 fi
9923 rm -f conftest*
9924
9925 fi
9926
9927 if test $ol_cv_header_stdc = yes; then
9928   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9929 cat > conftest.$ac_ext <<EOF
9930 #line 9931 "configure"
9931 #include "confdefs.h"
9932 #include <stdlib.h>
9933 EOF
9934 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9935   egrep "free" >/dev/null 2>&1; then
9936   :
9937 else
9938   rm -rf conftest*
9939   ol_cv_header_stdc=no
9940 fi
9941 rm -f conftest*
9942
9943 fi
9944
9945 if test $ol_cv_header_stdc = yes; then
9946   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9947 if test "$cross_compiling" = yes; then
9948   :
9949 else
9950   cat > conftest.$ac_ext <<EOF
9951 #line 9952 "configure"
9952 #include "confdefs.h"
9953 #include <ctype.h>
9954 #ifndef HAVE_EBCDIC
9955 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9956 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9957 #else
9958 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9959                 || ('j' <= (c) && (c) <= 'r') \
9960                 || ('s' <= (c) && (c) <= 'z'))
9961 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9962 #endif
9963 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9964 int main () { int i; for (i = 0; i < 256; i++)
9965 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9966 exit (0); }
9967
9968 EOF
9969 if { (eval echo configure:9970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9970 then
9971   :
9972 else
9973   echo "configure: failed program was:" >&5
9974   cat conftest.$ac_ext >&5
9975   rm -fr conftest*
9976   ol_cv_header_stdc=no
9977 fi
9978 rm -fr conftest*
9979 fi
9980
9981 fi
9982 fi
9983
9984 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9985 if test $ol_cv_header_stdc = yes; then
9986   cat >> confdefs.h <<\EOF
9987 #define STDC_HEADERS 1
9988 EOF
9989
9990 fi
9991 ac_cv_header_stdc=disable
9992
9993
9994 if test $ol_cv_header_stdc != yes; then
9995         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9996 fi
9997
9998 ac_header_dirent=no
9999 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
10000 do
10001 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10002 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
10003 echo "configure:10004: checking for $ac_hdr that defines DIR" >&5
10004 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
10005   echo $ac_n "(cached) $ac_c" 1>&6
10006 else
10007   cat > conftest.$ac_ext <<EOF
10008 #line 10009 "configure"
10009 #include "confdefs.h"
10010 #include <sys/types.h>
10011 #include <$ac_hdr>
10012 int main() {
10013 DIR *dirp = 0;
10014 ; return 0; }
10015 EOF
10016 if { (eval echo configure:10017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10017   rm -rf conftest*
10018   eval "ac_cv_header_dirent_$ac_safe=yes"
10019 else
10020   echo "configure: failed program was:" >&5
10021   cat conftest.$ac_ext >&5
10022   rm -rf conftest*
10023   eval "ac_cv_header_dirent_$ac_safe=no"
10024 fi
10025 rm -f conftest*
10026 fi
10027 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
10028   echo "$ac_t""yes" 1>&6
10029     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10030   cat >> confdefs.h <<EOF
10031 #define $ac_tr_hdr 1
10032 EOF
10033  ac_header_dirent=$ac_hdr; break
10034 else
10035   echo "$ac_t""no" 1>&6
10036 fi
10037 done
10038 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
10039 if test $ac_header_dirent = dirent.h; then
10040 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
10041 echo "configure:10042: checking for opendir in -ldir" >&5
10042 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
10043 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10044   echo $ac_n "(cached) $ac_c" 1>&6
10045 else
10046   ac_save_LIBS="$LIBS"
10047 LIBS="-ldir  $LIBS"
10048 cat > conftest.$ac_ext <<EOF
10049 #line 10050 "configure"
10050 #include "confdefs.h"
10051 /* Override any gcc2 internal prototype to avoid an error.  */
10052 /* We use char because int might match the return type of a gcc2
10053     builtin and then its argument prototype would still apply.  */
10054 char opendir();
10055
10056 int main() {
10057 opendir()
10058 ; return 0; }
10059 EOF
10060 if { (eval echo configure:10061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10061   rm -rf conftest*
10062   eval "ac_cv_lib_$ac_lib_var=yes"
10063 else
10064   echo "configure: failed program was:" >&5
10065   cat conftest.$ac_ext >&5
10066   rm -rf conftest*
10067   eval "ac_cv_lib_$ac_lib_var=no"
10068 fi
10069 rm -f conftest*
10070 LIBS="$ac_save_LIBS"
10071
10072 fi
10073 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10074   echo "$ac_t""yes" 1>&6
10075   LIBS="$LIBS -ldir"
10076 else
10077   echo "$ac_t""no" 1>&6
10078 fi
10079
10080 else
10081 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
10082 echo "configure:10083: checking for opendir in -lx" >&5
10083 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
10084 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10085   echo $ac_n "(cached) $ac_c" 1>&6
10086 else
10087   ac_save_LIBS="$LIBS"
10088 LIBS="-lx  $LIBS"
10089 cat > conftest.$ac_ext <<EOF
10090 #line 10091 "configure"
10091 #include "confdefs.h"
10092 /* Override any gcc2 internal prototype to avoid an error.  */
10093 /* We use char because int might match the return type of a gcc2
10094     builtin and then its argument prototype would still apply.  */
10095 char opendir();
10096
10097 int main() {
10098 opendir()
10099 ; return 0; }
10100 EOF
10101 if { (eval echo configure:10102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10102   rm -rf conftest*
10103   eval "ac_cv_lib_$ac_lib_var=yes"
10104 else
10105   echo "configure: failed program was:" >&5
10106   cat conftest.$ac_ext >&5
10107   rm -rf conftest*
10108   eval "ac_cv_lib_$ac_lib_var=no"
10109 fi
10110 rm -f conftest*
10111 LIBS="$ac_save_LIBS"
10112
10113 fi
10114 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10115   echo "$ac_t""yes" 1>&6
10116   LIBS="$LIBS -lx"
10117 else
10118   echo "$ac_t""no" 1>&6
10119 fi
10120
10121 fi
10122
10123 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
10124 echo "configure:10125: checking for sys/wait.h that is POSIX.1 compatible" >&5
10125 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
10126   echo $ac_n "(cached) $ac_c" 1>&6
10127 else
10128   cat > conftest.$ac_ext <<EOF
10129 #line 10130 "configure"
10130 #include "confdefs.h"
10131 #include <sys/types.h>
10132 #include <sys/wait.h>
10133 #ifndef WEXITSTATUS
10134 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
10135 #endif
10136 #ifndef WIFEXITED
10137 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
10138 #endif
10139 int main() {
10140 int s;
10141 wait (&s);
10142 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
10143 ; return 0; }
10144 EOF
10145 if { (eval echo configure:10146: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10146   rm -rf conftest*
10147   ac_cv_header_sys_wait_h=yes
10148 else
10149   echo "configure: failed program was:" >&5
10150   cat conftest.$ac_ext >&5
10151   rm -rf conftest*
10152   ac_cv_header_sys_wait_h=no
10153 fi
10154 rm -f conftest*
10155 fi
10156
10157 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
10158 if test $ac_cv_header_sys_wait_h = yes; then
10159   cat >> confdefs.h <<\EOF
10160 #define HAVE_SYS_WAIT_H 1
10161 EOF
10162
10163 fi
10164
10165 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
10166 echo "configure:10167: checking POSIX termios" >&5
10167 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
10168   echo $ac_n "(cached) $ac_c" 1>&6
10169 else
10170   cat > conftest.$ac_ext <<EOF
10171 #line 10172 "configure"
10172 #include "confdefs.h"
10173 #include <sys/types.h>
10174 #include <unistd.h>
10175 #include <termios.h>
10176 int main() {
10177 /* SunOS 4.0.3 has termios.h but not the library calls.  */
10178    tcgetattr(0, 0);
10179 ; return 0; }
10180 EOF
10181 if { (eval echo configure:10182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10182   rm -rf conftest*
10183   am_cv_sys_posix_termios=yes
10184 else
10185   echo "configure: failed program was:" >&5
10186   cat conftest.$ac_ext >&5
10187   rm -rf conftest*
10188   am_cv_sys_posix_termios=no
10189 fi
10190 rm -f conftest*
10191 fi
10192
10193 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
10194
10195
10196  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
10197 echo "configure:10198: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
10198 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
10199   echo $ac_n "(cached) $ac_c" 1>&6
10200 else
10201   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
10202
10203   gwinsz_in_termios_h=no
10204   if test $am_cv_sys_posix_termios = yes; then
10205     cat > conftest.$ac_ext <<EOF
10206 #line 10207 "configure"
10207 #include "confdefs.h"
10208 #include <sys/types.h>
10209 #     include <termios.h>
10210 #     ifdef TIOCGWINSZ
10211         yes
10212 #     endif
10213     
10214 EOF
10215 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10216   egrep "yes" >/dev/null 2>&1; then
10217   rm -rf conftest*
10218   gwinsz_in_termios_h=yes
10219 fi
10220 rm -f conftest*
10221
10222   fi
10223
10224   if test $gwinsz_in_termios_h = no; then
10225     cat > conftest.$ac_ext <<EOF
10226 #line 10227 "configure"
10227 #include "confdefs.h"
10228 #include <sys/types.h>
10229 #     include <sys/ioctl.h>
10230 #     ifdef TIOCGWINSZ
10231         yes
10232 #     endif
10233     
10234 EOF
10235 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10236   egrep "yes" >/dev/null 2>&1; then
10237   rm -rf conftest*
10238   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
10239 fi
10240 rm -f conftest*
10241
10242   fi
10243   
10244 fi
10245
10246 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
10247   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
10248     cat >> confdefs.h <<\EOF
10249 #define GWINSZ_IN_SYS_IOCTL 1
10250 EOF
10251
10252   fi
10253
10254 if test $am_cv_sys_posix_termios = yes ; then
10255         cat >> confdefs.h <<\EOF
10256 #define HAVE_POSIX_TERMIOS 1
10257 EOF
10258
10259 fi
10260
10261 for ac_hdr in \
10262         arpa/inet.h             \
10263         arpa/nameser.h  \
10264         assert.h                \
10265         crypt.h                 \
10266         errno.h                 \
10267         fcntl.h                 \
10268         filio.h                 \
10269         getopt.h                \
10270         grp.h                   \
10271         libutil.h               \
10272         limits.h                \
10273         locale.h                \
10274         malloc.h                \
10275         memory.h                \
10276         psap.h                  \
10277         pwd.h                   \
10278         resolv.h                \
10279         sgtty.h                 \
10280         shadow.h                \
10281         stdarg.h                \
10282         stddef.h                \
10283         string.h                \
10284         strings.h               \
10285         sysexits.h              \
10286         sys/file.h              \
10287         sys/filio.h             \
10288         sys/errno.h             \
10289         sys/ioctl.h             \
10290         sys/param.h             \
10291         sys/resource.h  \
10292         sys/select.h    \
10293         sys/socket.h    \
10294         sys/syslog.h    \
10295         sys/time.h              \
10296         sys/types.h             \
10297         syslog.h                \
10298         termios.h               \
10299         unistd.h                \
10300
10301 do
10302 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10303 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10304 echo "configure:10305: checking for $ac_hdr" >&5
10305 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
10306   echo $ac_n "(cached) $ac_c" 1>&6
10307 else
10308   cat > conftest.$ac_ext <<EOF
10309 #line 10310 "configure"
10310 #include "confdefs.h"
10311 #include <$ac_hdr>
10312 EOF
10313 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10314 { (eval echo configure:10315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10315 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10316 if test -z "$ac_err"; then
10317   rm -rf conftest*
10318   eval "ac_cv_header_$ac_safe=yes"
10319 else
10320   echo "$ac_err" >&5
10321   echo "configure: failed program was:" >&5
10322   cat conftest.$ac_ext >&5
10323   rm -rf conftest*
10324   eval "ac_cv_header_$ac_safe=no"
10325 fi
10326 rm -f conftest*
10327 fi
10328 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10329   echo "$ac_t""yes" 1>&6
10330     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10331   cat >> confdefs.h <<EOF
10332 #define $ac_tr_hdr 1
10333 EOF
10334  
10335 else
10336   echo "$ac_t""no" 1>&6
10337 fi
10338 done
10339
10340
10341 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
10342 echo "configure:10343: checking for uid_t in sys/types.h" >&5
10343 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
10344   echo $ac_n "(cached) $ac_c" 1>&6
10345 else
10346   cat > conftest.$ac_ext <<EOF
10347 #line 10348 "configure"
10348 #include "confdefs.h"
10349 #include <sys/types.h>
10350 EOF
10351 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10352   egrep "uid_t" >/dev/null 2>&1; then
10353   rm -rf conftest*
10354   ac_cv_type_uid_t=yes
10355 else
10356   rm -rf conftest*
10357   ac_cv_type_uid_t=no
10358 fi
10359 rm -f conftest*
10360
10361 fi
10362
10363 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
10364 if test $ac_cv_type_uid_t = no; then
10365   cat >> confdefs.h <<\EOF
10366 #define uid_t int
10367 EOF
10368
10369   cat >> confdefs.h <<\EOF
10370 #define gid_t int
10371 EOF
10372
10373 fi
10374
10375 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
10376 echo "configure:10377: checking type of array argument to getgroups" >&5
10377 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
10378   echo $ac_n "(cached) $ac_c" 1>&6
10379 else
10380   if test "$cross_compiling" = yes; then
10381   ac_cv_type_getgroups=cross
10382 else
10383   cat > conftest.$ac_ext <<EOF
10384 #line 10385 "configure"
10385 #include "confdefs.h"
10386
10387 /* Thanks to Mike Rendell for this test.  */
10388 #include <sys/types.h>
10389 #define NGID 256
10390 #undef MAX
10391 #define MAX(x, y) ((x) > (y) ? (x) : (y))
10392 main()
10393 {
10394   gid_t gidset[NGID];
10395   int i, n;
10396   union { gid_t gval; long lval; }  val;
10397
10398   val.lval = -1;
10399   for (i = 0; i < NGID; i++)
10400     gidset[i] = val.gval;
10401   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
10402                  gidset);
10403   /* Exit non-zero if getgroups seems to require an array of ints.  This
10404      happens when gid_t is short but getgroups modifies an array of ints.  */
10405   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
10406 }
10407
10408 EOF
10409 if { (eval echo configure:10410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10410 then
10411     ac_cv_type_getgroups=gid_t
10412 else
10413   echo "configure: failed program was:" >&5
10414   cat conftest.$ac_ext >&5
10415   rm -fr conftest*
10416   ac_cv_type_getgroups=int
10417 fi
10418 rm -fr conftest*
10419 fi
10420
10421 if test $ac_cv_type_getgroups = cross; then
10422         cat > conftest.$ac_ext <<EOF
10423 #line 10424 "configure"
10424 #include "confdefs.h"
10425 #include <unistd.h>
10426 EOF
10427 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10428   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
10429   rm -rf conftest*
10430   ac_cv_type_getgroups=gid_t
10431 else
10432   rm -rf conftest*
10433   ac_cv_type_getgroups=int
10434 fi
10435 rm -f conftest*
10436
10437 fi
10438 fi
10439
10440 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
10441 cat >> confdefs.h <<EOF
10442 #define GETGROUPS_T $ac_cv_type_getgroups
10443 EOF
10444
10445  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
10446 echo "configure:10447: checking for ANSI C header files" >&5
10447 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
10448   echo $ac_n "(cached) $ac_c" 1>&6
10449 else
10450   cat > conftest.$ac_ext <<EOF
10451 #line 10452 "configure"
10452 #include "confdefs.h"
10453 #include <stdlib.h>
10454 #include <stdarg.h>
10455 #include <string.h>
10456 #include <float.h>
10457 EOF
10458 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10459 { (eval echo configure:10460: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10460 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10461 if test -z "$ac_err"; then
10462   rm -rf conftest*
10463   ac_cv_header_stdc=yes
10464 else
10465   echo "$ac_err" >&5
10466   echo "configure: failed program was:" >&5
10467   cat conftest.$ac_ext >&5
10468   rm -rf conftest*
10469   ac_cv_header_stdc=no
10470 fi
10471 rm -f conftest*
10472
10473 if test $ac_cv_header_stdc = yes; then
10474   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10475 cat > conftest.$ac_ext <<EOF
10476 #line 10477 "configure"
10477 #include "confdefs.h"
10478 #include <string.h>
10479 EOF
10480 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10481   egrep "memchr" >/dev/null 2>&1; then
10482   :
10483 else
10484   rm -rf conftest*
10485   ac_cv_header_stdc=no
10486 fi
10487 rm -f conftest*
10488
10489 fi
10490
10491 if test $ac_cv_header_stdc = yes; then
10492   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
10493 cat > conftest.$ac_ext <<EOF
10494 #line 10495 "configure"
10495 #include "confdefs.h"
10496 #include <stdlib.h>
10497 EOF
10498 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10499   egrep "free" >/dev/null 2>&1; then
10500   :
10501 else
10502   rm -rf conftest*
10503   ac_cv_header_stdc=no
10504 fi
10505 rm -f conftest*
10506
10507 fi
10508
10509 if test $ac_cv_header_stdc = yes; then
10510   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
10511 if test "$cross_compiling" = yes; then
10512   :
10513 else
10514   cat > conftest.$ac_ext <<EOF
10515 #line 10516 "configure"
10516 #include "confdefs.h"
10517 #include <ctype.h>
10518 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10519 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10520 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
10521 int main () { int i; for (i = 0; i < 256; i++)
10522 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
10523 exit (0); }
10524
10525 EOF
10526 if { (eval echo configure:10527: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10527 then
10528   :
10529 else
10530   echo "configure: failed program was:" >&5
10531   cat conftest.$ac_ext >&5
10532   rm -fr conftest*
10533   ac_cv_header_stdc=no
10534 fi
10535 rm -fr conftest*
10536 fi
10537
10538 fi
10539 fi
10540
10541 echo "$ac_t""$ac_cv_header_stdc" 1>&6
10542 if test $ac_cv_header_stdc = yes; then
10543   cat >> confdefs.h <<\EOF
10544 #define STDC_HEADERS 1
10545 EOF
10546
10547 fi
10548
10549 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
10550 echo "configure:10551: checking for mode_t" >&5
10551 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
10552   echo $ac_n "(cached) $ac_c" 1>&6
10553 else
10554   cat > conftest.$ac_ext <<EOF
10555 #line 10556 "configure"
10556 #include "confdefs.h"
10557 #include <sys/types.h>
10558 #if STDC_HEADERS
10559 #include <stdlib.h>
10560 #include <stddef.h>
10561 #endif
10562 EOF
10563 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10564   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10565   rm -rf conftest*
10566   ac_cv_type_mode_t=yes
10567 else
10568   rm -rf conftest*
10569   ac_cv_type_mode_t=no
10570 fi
10571 rm -f conftest*
10572
10573 fi
10574 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
10575 if test $ac_cv_type_mode_t = no; then
10576   cat >> confdefs.h <<\EOF
10577 #define mode_t int
10578 EOF
10579
10580 fi
10581
10582 echo $ac_n "checking for off_t""... $ac_c" 1>&6
10583 echo "configure:10584: checking for off_t" >&5
10584 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
10585   echo $ac_n "(cached) $ac_c" 1>&6
10586 else
10587   cat > conftest.$ac_ext <<EOF
10588 #line 10589 "configure"
10589 #include "confdefs.h"
10590 #include <sys/types.h>
10591 #if STDC_HEADERS
10592 #include <stdlib.h>
10593 #include <stddef.h>
10594 #endif
10595 EOF
10596 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10597   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10598   rm -rf conftest*
10599   ac_cv_type_off_t=yes
10600 else
10601   rm -rf conftest*
10602   ac_cv_type_off_t=no
10603 fi
10604 rm -f conftest*
10605
10606 fi
10607 echo "$ac_t""$ac_cv_type_off_t" 1>&6
10608 if test $ac_cv_type_off_t = no; then
10609   cat >> confdefs.h <<\EOF
10610 #define off_t long
10611 EOF
10612
10613 fi
10614
10615 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10616 echo "configure:10617: checking for pid_t" >&5
10617 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10618   echo $ac_n "(cached) $ac_c" 1>&6
10619 else
10620   cat > conftest.$ac_ext <<EOF
10621 #line 10622 "configure"
10622 #include "confdefs.h"
10623 #include <sys/types.h>
10624 #if STDC_HEADERS
10625 #include <stdlib.h>
10626 #include <stddef.h>
10627 #endif
10628 EOF
10629 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10630   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10631   rm -rf conftest*
10632   ac_cv_type_pid_t=yes
10633 else
10634   rm -rf conftest*
10635   ac_cv_type_pid_t=no
10636 fi
10637 rm -f conftest*
10638
10639 fi
10640 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10641 if test $ac_cv_type_pid_t = no; then
10642   cat >> confdefs.h <<\EOF
10643 #define pid_t int
10644 EOF
10645
10646 fi
10647
10648 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10649 echo "configure:10650: checking for ptrdiff_t" >&5
10650 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10651   echo $ac_n "(cached) $ac_c" 1>&6
10652 else
10653   cat > conftest.$ac_ext <<EOF
10654 #line 10655 "configure"
10655 #include "confdefs.h"
10656 #include <stddef.h>
10657 int main() {
10658 ptrdiff_t p
10659 ; return 0; }
10660 EOF
10661 if { (eval echo configure:10662: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10662   rm -rf conftest*
10663   am_cv_type_ptrdiff_t=yes
10664 else
10665   echo "configure: failed program was:" >&5
10666   cat conftest.$ac_ext >&5
10667   rm -rf conftest*
10668   am_cv_type_ptrdiff_t=no
10669 fi
10670 rm -f conftest*
10671 fi
10672
10673 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10674    if test $am_cv_type_ptrdiff_t = yes; then
10675      cat >> confdefs.h <<\EOF
10676 #define HAVE_PTRDIFF_T 1
10677 EOF
10678
10679    fi
10680
10681 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10682 echo "configure:10683: checking return type of signal handlers" >&5
10683 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10684   echo $ac_n "(cached) $ac_c" 1>&6
10685 else
10686   cat > conftest.$ac_ext <<EOF
10687 #line 10688 "configure"
10688 #include "confdefs.h"
10689 #include <sys/types.h>
10690 #include <signal.h>
10691 #ifdef signal
10692 #undef signal
10693 #endif
10694 #ifdef __cplusplus
10695 extern "C" void (*signal (int, void (*)(int)))(int);
10696 #else
10697 void (*signal ()) ();
10698 #endif
10699
10700 int main() {
10701 int i;
10702 ; return 0; }
10703 EOF
10704 if { (eval echo configure:10705: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10705   rm -rf conftest*
10706   ac_cv_type_signal=void
10707 else
10708   echo "configure: failed program was:" >&5
10709   cat conftest.$ac_ext >&5
10710   rm -rf conftest*
10711   ac_cv_type_signal=int
10712 fi
10713 rm -f conftest*
10714 fi
10715
10716 echo "$ac_t""$ac_cv_type_signal" 1>&6
10717 cat >> confdefs.h <<EOF
10718 #define RETSIGTYPE $ac_cv_type_signal
10719 EOF
10720
10721
10722 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10723 echo "configure:10724: checking for sig_atomic_t" >&5
10724 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10725   echo $ac_n "(cached) $ac_c" 1>&6
10726 else
10727   cat > conftest.$ac_ext <<EOF
10728 #line 10729 "configure"
10729 #include "confdefs.h"
10730 #include <signal.h>
10731 int main() {
10732 sig_atomic_t atomic;
10733 ; return 0; }
10734 EOF
10735 if { (eval echo configure:10736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10736   rm -rf conftest*
10737   ol_cv_type_sig_atomic_t=yes
10738 else
10739   echo "configure: failed program was:" >&5
10740   cat conftest.$ac_ext >&5
10741   rm -rf conftest*
10742   ol_cv_type_sig_atomic_t=no
10743 fi
10744 rm -f conftest*
10745 fi
10746
10747 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10748   if test $ol_cv_type_sig_atomic_t = no; then
10749     cat >> confdefs.h <<\EOF
10750 #define sig_atomic_t int
10751 EOF
10752
10753   fi
10754  
10755 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10756 echo "configure:10757: checking for size_t" >&5
10757 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10758   echo $ac_n "(cached) $ac_c" 1>&6
10759 else
10760   cat > conftest.$ac_ext <<EOF
10761 #line 10762 "configure"
10762 #include "confdefs.h"
10763 #include <sys/types.h>
10764 #if STDC_HEADERS
10765 #include <stdlib.h>
10766 #include <stddef.h>
10767 #endif
10768 EOF
10769 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10770   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10771   rm -rf conftest*
10772   ac_cv_type_size_t=yes
10773 else
10774   rm -rf conftest*
10775   ac_cv_type_size_t=no
10776 fi
10777 rm -f conftest*
10778
10779 fi
10780 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10781 if test $ac_cv_type_size_t = no; then
10782   cat >> confdefs.h <<\EOF
10783 #define size_t unsigned
10784 EOF
10785
10786 fi
10787
10788 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
10789 echo "configure:10790: checking for socklen_t" >&5
10790 if eval "test \"`echo '$''{'ol_cv_type_socklen_t'+set}'`\" = set"; then
10791   echo $ac_n "(cached) $ac_c" 1>&6
10792 else
10793   cat > conftest.$ac_ext <<EOF
10794 #line 10795 "configure"
10795 #include "confdefs.h"
10796
10797 #ifdef HAVE_SYS_TYPES_H
10798 #include <sys/types.h>
10799 #endif
10800 #ifdef HAVE_SYS_SOCKET_H
10801 #include <sys/socket.h>
10802 #endif
10803
10804 int main() {
10805 socklen_t len;
10806 ; return 0; }
10807 EOF
10808 if { (eval echo configure:10809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10809   rm -rf conftest*
10810   ol_cv_type_socklen_t=yes
10811 else
10812   echo "configure: failed program was:" >&5
10813   cat conftest.$ac_ext >&5
10814   rm -rf conftest*
10815   ol_cv_type_socklen_t=no
10816 fi
10817 rm -f conftest*
10818 fi
10819
10820 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
10821   if test $ol_cv_type_socklen_t = no; then
10822     cat >> confdefs.h <<\EOF
10823 #define socklen_t int
10824 EOF
10825
10826   fi
10827  
10828 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10829 echo "configure:10830: checking for st_blksize in struct stat" >&5
10830 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10831   echo $ac_n "(cached) $ac_c" 1>&6
10832 else
10833   cat > conftest.$ac_ext <<EOF
10834 #line 10835 "configure"
10835 #include "confdefs.h"
10836 #include <sys/types.h>
10837 #include <sys/stat.h>
10838 int main() {
10839 struct stat s; s.st_blksize;
10840 ; return 0; }
10841 EOF
10842 if { (eval echo configure:10843: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10843   rm -rf conftest*
10844   ac_cv_struct_st_blksize=yes
10845 else
10846   echo "configure: failed program was:" >&5
10847   cat conftest.$ac_ext >&5
10848   rm -rf conftest*
10849   ac_cv_struct_st_blksize=no
10850 fi
10851 rm -f conftest*
10852 fi
10853
10854 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10855 if test $ac_cv_struct_st_blksize = yes; then
10856   cat >> confdefs.h <<\EOF
10857 #define HAVE_ST_BLKSIZE 1
10858 EOF
10859
10860 fi
10861
10862 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10863 echo "configure:10864: checking whether time.h and sys/time.h may both be included" >&5
10864 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10865   echo $ac_n "(cached) $ac_c" 1>&6
10866 else
10867   cat > conftest.$ac_ext <<EOF
10868 #line 10869 "configure"
10869 #include "confdefs.h"
10870 #include <sys/types.h>
10871 #include <sys/time.h>
10872 #include <time.h>
10873 int main() {
10874 struct tm *tp;
10875 ; return 0; }
10876 EOF
10877 if { (eval echo configure:10878: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10878   rm -rf conftest*
10879   ac_cv_header_time=yes
10880 else
10881   echo "configure: failed program was:" >&5
10882   cat conftest.$ac_ext >&5
10883   rm -rf conftest*
10884   ac_cv_header_time=no
10885 fi
10886 rm -f conftest*
10887 fi
10888
10889 echo "$ac_t""$ac_cv_header_time" 1>&6
10890 if test $ac_cv_header_time = yes; then
10891   cat >> confdefs.h <<\EOF
10892 #define TIME_WITH_SYS_TIME 1
10893 EOF
10894
10895 fi
10896
10897 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10898 echo "configure:10899: checking whether struct tm is in sys/time.h or time.h" >&5
10899 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10900   echo $ac_n "(cached) $ac_c" 1>&6
10901 else
10902   cat > conftest.$ac_ext <<EOF
10903 #line 10904 "configure"
10904 #include "confdefs.h"
10905 #include <sys/types.h>
10906 #include <time.h>
10907 int main() {
10908 struct tm *tp; tp->tm_sec;
10909 ; return 0; }
10910 EOF
10911 if { (eval echo configure:10912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10912   rm -rf conftest*
10913   ac_cv_struct_tm=time.h
10914 else
10915   echo "configure: failed program was:" >&5
10916   cat conftest.$ac_ext >&5
10917   rm -rf conftest*
10918   ac_cv_struct_tm=sys/time.h
10919 fi
10920 rm -f conftest*
10921 fi
10922
10923 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10924 if test $ac_cv_struct_tm = sys/time.h; then
10925   cat >> confdefs.h <<\EOF
10926 #define TM_IN_SYS_TIME 1
10927 EOF
10928
10929 fi
10930
10931 # test for pw_gecos in struct passwd
10932 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10933 echo "configure:10934: checking struct passwd for pw_gecos" >&5
10934 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10935   echo $ac_n "(cached) $ac_c" 1>&6
10936 else
10937   
10938         cat > conftest.$ac_ext <<EOF
10939 #line 10940 "configure"
10940 #include "confdefs.h"
10941 #include <pwd.h>
10942 int main() {
10943
10944         struct passwd pwd;
10945         pwd.pw_gecos = pwd.pw_name;
10946
10947 ; return 0; }
10948 EOF
10949 if { (eval echo configure:10950: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10950   rm -rf conftest*
10951   ol_cv_struct_passwd_pw_gecos=yes
10952 else
10953   echo "configure: failed program was:" >&5
10954   cat conftest.$ac_ext >&5
10955   rm -rf conftest*
10956   ol_cv_struct_passwd_pw_gecos=no
10957 fi
10958 rm -f conftest*
10959 fi
10960
10961 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10962 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10963         cat >> confdefs.h <<\EOF
10964 #define HAVE_PW_GECOS 1
10965 EOF
10966
10967 fi
10968
10969 # test for pw_passwd in struct passwd
10970 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
10971 echo "configure:10972: checking struct passwd for pw_passwd" >&5
10972 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_passwd'+set}'`\" = set"; then
10973   echo $ac_n "(cached) $ac_c" 1>&6
10974 else
10975   
10976         cat > conftest.$ac_ext <<EOF
10977 #line 10978 "configure"
10978 #include "confdefs.h"
10979 #include <pwd.h>
10980 int main() {
10981
10982         struct passwd pwd;
10983         pwd.pw_passwd = pwd.pw_name;
10984
10985 ; return 0; }
10986 EOF
10987 if { (eval echo configure:10988: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10988   rm -rf conftest*
10989   ol_cv_struct_passwd_pw_passwd=yes
10990 else
10991   echo "configure: failed program was:" >&5
10992   cat conftest.$ac_ext >&5
10993   rm -rf conftest*
10994   ol_cv_struct_passwd_pw_passwd=no
10995 fi
10996 rm -f conftest*
10997 fi
10998
10999 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
11000 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
11001         cat >> confdefs.h <<\EOF
11002 #define HAVE_PW_PASSWD 1
11003 EOF
11004
11005 fi
11006
11007
11008
11009 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
11010 echo "configure:11011: checking if toupper() requires islower()" >&5
11011 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
11012   echo $ac_n "(cached) $ac_c" 1>&6
11013 else
11014   
11015         if test "$cross_compiling" = yes; then
11016   ol_cv_c_upper_lower=safe
11017 else
11018   cat > conftest.$ac_ext <<EOF
11019 #line 11020 "configure"
11020 #include "confdefs.h"
11021
11022 #include <ctype.h>
11023 main()
11024 {
11025         if ('C' == toupper('C'))
11026                 exit(0);
11027         else
11028                 exit(1);
11029 }
11030 EOF
11031 if { (eval echo configure:11032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11032 then
11033   ol_cv_c_upper_lower=no
11034 else
11035   echo "configure: failed program was:" >&5
11036   cat conftest.$ac_ext >&5
11037   rm -fr conftest*
11038   ol_cv_c_upper_lower=yes
11039 fi
11040 rm -fr conftest*
11041 fi
11042
11043 fi
11044
11045 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
11046 if test $ol_cv_c_upper_lower != no ; then
11047         cat >> confdefs.h <<\EOF
11048 #define C_UPPER_LOWER 1
11049 EOF
11050
11051 fi
11052
11053 echo $ac_n "checking for working const""... $ac_c" 1>&6
11054 echo "configure:11055: checking for working const" >&5
11055 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
11056   echo $ac_n "(cached) $ac_c" 1>&6
11057 else
11058   cat > conftest.$ac_ext <<EOF
11059 #line 11060 "configure"
11060 #include "confdefs.h"
11061
11062 int main() {
11063
11064 /* Ultrix mips cc rejects this.  */
11065 typedef int charset[2]; const charset x;
11066 /* SunOS 4.1.1 cc rejects this.  */
11067 char const *const *ccp;
11068 char **p;
11069 /* NEC SVR4.0.2 mips cc rejects this.  */
11070 struct point {int x, y;};
11071 static struct point const zero = {0,0};
11072 /* AIX XL C 1.02.0.0 rejects this.
11073    It does not let you subtract one const X* pointer from another in an arm
11074    of an if-expression whose if-part is not a constant expression */
11075 const char *g = "string";
11076 ccp = &g + (g ? g-g : 0);
11077 /* HPUX 7.0 cc rejects these. */
11078 ++ccp;
11079 p = (char**) ccp;
11080 ccp = (char const *const *) p;
11081 { /* SCO 3.2v4 cc rejects this.  */
11082   char *t;
11083   char const *s = 0 ? (char *) 0 : (char const *) 0;
11084
11085   *t++ = 0;
11086 }
11087 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
11088   int x[] = {25, 17};
11089   const int *foo = &x[0];
11090   ++foo;
11091 }
11092 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
11093   typedef const int *iptr;
11094   iptr p = 0;
11095   ++p;
11096 }
11097 { /* AIX XL C 1.02.0.0 rejects this saying
11098      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
11099   struct s { int j; const int *ap[3]; };
11100   struct s *b; b->j = 5;
11101 }
11102 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
11103   const int foo = 10;
11104 }
11105
11106 ; return 0; }
11107 EOF
11108 if { (eval echo configure:11109: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11109   rm -rf conftest*
11110   ac_cv_c_const=yes
11111 else
11112   echo "configure: failed program was:" >&5
11113   cat conftest.$ac_ext >&5
11114   rm -rf conftest*
11115   ac_cv_c_const=no
11116 fi
11117 rm -f conftest*
11118 fi
11119
11120 echo "$ac_t""$ac_cv_c_const" 1>&6
11121 if test $ac_cv_c_const = no; then
11122   cat >> confdefs.h <<\EOF
11123 #define const 
11124 EOF
11125
11126 fi
11127
11128 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
11129 echo "configure:11130: checking if compiler understands volatile" >&5
11130 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
11131   echo $ac_n "(cached) $ac_c" 1>&6
11132 else
11133   cat > conftest.$ac_ext <<EOF
11134 #line 11135 "configure"
11135 #include "confdefs.h"
11136 int x, y, z;
11137 int main() {
11138 volatile int a; int * volatile b = x ? &y : &z;
11139       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
11140       *b = 0;
11141 ; return 0; }
11142 EOF
11143 if { (eval echo configure:11144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11144   rm -rf conftest*
11145   ol_cv_c_volatile=yes
11146 else
11147   echo "configure: failed program was:" >&5
11148   cat conftest.$ac_ext >&5
11149   rm -rf conftest*
11150   ol_cv_c_volatile=no
11151 fi
11152 rm -f conftest*
11153 fi
11154
11155 echo "$ac_t""$ol_cv_c_volatile" 1>&6
11156   if test $ol_cv_c_volatile = yes; then
11157     : 
11158   else
11159     cat >> confdefs.h <<\EOF
11160 #define volatile 
11161 EOF
11162
11163   fi
11164  
11165
11166 if test $cross_compiling = yes ; then
11167         cat >> confdefs.h <<\EOF
11168 #define CROSS_COMPILING 1
11169 EOF
11170
11171
11172         cat >> confdefs.h <<\EOF
11173 #define LBER_INT_T long
11174 EOF
11175
11176         cat >> confdefs.h <<\EOF
11177 #define LBER_TAG_T long
11178 EOF
11179
11180         cat >> confdefs.h <<\EOF
11181 #define LBER_SOCKET_T int
11182 EOF
11183
11184
11185 else
11186         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
11187 echo "configure:11188: checking whether byte ordering is bigendian" >&5
11188 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
11189   echo $ac_n "(cached) $ac_c" 1>&6
11190 else
11191   ac_cv_c_bigendian=unknown
11192 # See if sys/param.h defines the BYTE_ORDER macro.
11193 cat > conftest.$ac_ext <<EOF
11194 #line 11195 "configure"
11195 #include "confdefs.h"
11196 #include <sys/types.h>
11197 #include <sys/param.h>
11198 int main() {
11199
11200 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
11201  bogus endian macros
11202 #endif
11203 ; return 0; }
11204 EOF
11205 if { (eval echo configure:11206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11206   rm -rf conftest*
11207   # It does; now see whether it defined to BIG_ENDIAN or not.
11208 cat > conftest.$ac_ext <<EOF
11209 #line 11210 "configure"
11210 #include "confdefs.h"
11211 #include <sys/types.h>
11212 #include <sys/param.h>
11213 int main() {
11214
11215 #if BYTE_ORDER != BIG_ENDIAN
11216  not big endian
11217 #endif
11218 ; return 0; }
11219 EOF
11220 if { (eval echo configure:11221: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11221   rm -rf conftest*
11222   ac_cv_c_bigendian=yes
11223 else
11224   echo "configure: failed program was:" >&5
11225   cat conftest.$ac_ext >&5
11226   rm -rf conftest*
11227   ac_cv_c_bigendian=no
11228 fi
11229 rm -f conftest*
11230 else
11231   echo "configure: failed program was:" >&5
11232   cat conftest.$ac_ext >&5
11233 fi
11234 rm -f conftest*
11235 if test $ac_cv_c_bigendian = unknown; then
11236 if test "$cross_compiling" = yes; then
11237     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11238 else
11239   cat > conftest.$ac_ext <<EOF
11240 #line 11241 "configure"
11241 #include "confdefs.h"
11242 main () {
11243   /* Are we little or big endian?  From Harbison&Steele.  */
11244   union
11245   {
11246     long l;
11247     char c[sizeof (long)];
11248   } u;
11249   u.l = 1;
11250   exit (u.c[sizeof (long) - 1] == 1);
11251 }
11252 EOF
11253 if { (eval echo configure:11254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11254 then
11255   ac_cv_c_bigendian=no
11256 else
11257   echo "configure: failed program was:" >&5
11258   cat conftest.$ac_ext >&5
11259   rm -fr conftest*
11260   ac_cv_c_bigendian=yes
11261 fi
11262 rm -fr conftest*
11263 fi
11264
11265 fi
11266 fi
11267
11268 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
11269 if test $ac_cv_c_bigendian = yes; then
11270   cat >> confdefs.h <<\EOF
11271 #define WORDS_BIGENDIAN 1
11272 EOF
11273
11274 fi
11275
11276         echo $ac_n "checking size of short""... $ac_c" 1>&6
11277 echo "configure:11278: checking size of short" >&5
11278 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
11279   echo $ac_n "(cached) $ac_c" 1>&6
11280 else
11281   if test "$cross_compiling" = yes; then
11282     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11283 else
11284   cat > conftest.$ac_ext <<EOF
11285 #line 11286 "configure"
11286 #include "confdefs.h"
11287 #include <stdio.h>
11288 main()
11289 {
11290   FILE *f=fopen("conftestval", "w");
11291   if (!f) exit(1);
11292   fprintf(f, "%d\n", sizeof(short));
11293   exit(0);
11294 }
11295 EOF
11296 if { (eval echo configure:11297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11297 then
11298   ac_cv_sizeof_short=`cat conftestval`
11299 else
11300   echo "configure: failed program was:" >&5
11301   cat conftest.$ac_ext >&5
11302   rm -fr conftest*
11303   ac_cv_sizeof_short=0
11304 fi
11305 rm -fr conftest*
11306 fi
11307
11308 fi
11309 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
11310 cat >> confdefs.h <<EOF
11311 #define SIZEOF_SHORT $ac_cv_sizeof_short
11312 EOF
11313
11314  
11315         echo $ac_n "checking size of int""... $ac_c" 1>&6
11316 echo "configure:11317: checking size of int" >&5
11317 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
11318   echo $ac_n "(cached) $ac_c" 1>&6
11319 else
11320   if test "$cross_compiling" = yes; then
11321     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11322 else
11323   cat > conftest.$ac_ext <<EOF
11324 #line 11325 "configure"
11325 #include "confdefs.h"
11326 #include <stdio.h>
11327 main()
11328 {
11329   FILE *f=fopen("conftestval", "w");
11330   if (!f) exit(1);
11331   fprintf(f, "%d\n", sizeof(int));
11332   exit(0);
11333 }
11334 EOF
11335 if { (eval echo configure:11336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11336 then
11337   ac_cv_sizeof_int=`cat conftestval`
11338 else
11339   echo "configure: failed program was:" >&5
11340   cat conftest.$ac_ext >&5
11341   rm -fr conftest*
11342   ac_cv_sizeof_int=0
11343 fi
11344 rm -fr conftest*
11345 fi
11346
11347 fi
11348 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
11349 cat >> confdefs.h <<EOF
11350 #define SIZEOF_INT $ac_cv_sizeof_int
11351 EOF
11352
11353  
11354         echo $ac_n "checking size of long""... $ac_c" 1>&6
11355 echo "configure:11356: checking size of long" >&5
11356 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
11357   echo $ac_n "(cached) $ac_c" 1>&6
11358 else
11359   if test "$cross_compiling" = yes; then
11360     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
11361 else
11362   cat > conftest.$ac_ext <<EOF
11363 #line 11364 "configure"
11364 #include "confdefs.h"
11365 #include <stdio.h>
11366 main()
11367 {
11368   FILE *f=fopen("conftestval", "w");
11369   if (!f) exit(1);
11370   fprintf(f, "%d\n", sizeof(long));
11371   exit(0);
11372 }
11373 EOF
11374 if { (eval echo configure:11375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11375 then
11376   ac_cv_sizeof_long=`cat conftestval`
11377 else
11378   echo "configure: failed program was:" >&5
11379   cat conftest.$ac_ext >&5
11380   rm -fr conftest*
11381   ac_cv_sizeof_long=0
11382 fi
11383 rm -fr conftest*
11384 fi
11385
11386 fi
11387 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
11388 cat >> confdefs.h <<EOF
11389 #define SIZEOF_LONG $ac_cv_sizeof_long
11390 EOF
11391
11392
11393
11394         if test "$ac_cv_sizeof_int" -lt 4 ; then
11395                 echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
11396
11397                 cat >> confdefs.h <<\EOF
11398 #define LBER_INT_T long
11399 EOF
11400
11401                 cat >> confdefs.h <<\EOF
11402 #define LBER_TAG_T long
11403 EOF
11404
11405                 cat >> confdefs.h <<\EOF
11406 #define LBER_SOCKET_T int
11407 EOF
11408
11409         else
11410                 cat >> confdefs.h <<\EOF
11411 #define LBER_INT_T int
11412 EOF
11413
11414                 cat >> confdefs.h <<\EOF
11415 #define LBER_TAG_T long
11416 EOF
11417
11418                 cat >> confdefs.h <<\EOF
11419 #define LBER_SOCKET_T int
11420 EOF
11421
11422         fi
11423 fi
11424
11425 cat >> confdefs.h <<\EOF
11426 #define LBER_LEN_T long
11427 EOF
11428
11429
11430 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
11431 echo "configure:11432: checking for 8-bit clean memcmp" >&5
11432 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
11433   echo $ac_n "(cached) $ac_c" 1>&6
11434 else
11435   if test "$cross_compiling" = yes; then
11436   ac_cv_func_memcmp_clean=no
11437 else
11438   cat > conftest.$ac_ext <<EOF
11439 #line 11440 "configure"
11440 #include "confdefs.h"
11441
11442 main()
11443 {
11444   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
11445   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
11446 }
11447
11448 EOF
11449 if { (eval echo configure:11450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
11450 then
11451   ac_cv_func_memcmp_clean=yes
11452 else
11453   echo "configure: failed program was:" >&5
11454   cat conftest.$ac_ext >&5
11455   rm -fr conftest*
11456   ac_cv_func_memcmp_clean=no
11457 fi
11458 rm -fr conftest*
11459 fi
11460
11461 fi
11462
11463 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
11464 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
11465
11466 echo $ac_n "checking for strftime""... $ac_c" 1>&6
11467 echo "configure:11468: checking for strftime" >&5
11468 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
11469   echo $ac_n "(cached) $ac_c" 1>&6
11470 else
11471   cat > conftest.$ac_ext <<EOF
11472 #line 11473 "configure"
11473 #include "confdefs.h"
11474 /* System header to define __stub macros and hopefully few prototypes,
11475     which can conflict with char strftime(); below.  */
11476 #include <assert.h>
11477 /* Override any gcc2 internal prototype to avoid an error.  */
11478 /* We use char because int might match the return type of a gcc2
11479     builtin and then its argument prototype would still apply.  */
11480 char strftime();
11481
11482 int main() {
11483
11484 /* The GNU C library defines this for functions which it implements
11485     to always fail with ENOSYS.  Some functions are actually named
11486     something starting with __ and the normal name is an alias.  */
11487 #if defined (__stub_strftime) || defined (__stub___strftime)
11488 choke me
11489 #else
11490 strftime();
11491 #endif
11492
11493 ; return 0; }
11494 EOF
11495 if { (eval echo configure:11496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11496   rm -rf conftest*
11497   eval "ac_cv_func_strftime=yes"
11498 else
11499   echo "configure: failed program was:" >&5
11500   cat conftest.$ac_ext >&5
11501   rm -rf conftest*
11502   eval "ac_cv_func_strftime=no"
11503 fi
11504 rm -f conftest*
11505 fi
11506
11507 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
11508   echo "$ac_t""yes" 1>&6
11509   cat >> confdefs.h <<\EOF
11510 #define HAVE_STRFTIME 1
11511 EOF
11512
11513 else
11514   echo "$ac_t""no" 1>&6
11515 # strftime is in -lintl on SCO UNIX.
11516 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
11517 echo "configure:11518: checking for strftime in -lintl" >&5
11518 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
11519 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
11520   echo $ac_n "(cached) $ac_c" 1>&6
11521 else
11522   ac_save_LIBS="$LIBS"
11523 LIBS="-lintl  $LIBS"
11524 cat > conftest.$ac_ext <<EOF
11525 #line 11526 "configure"
11526 #include "confdefs.h"
11527 /* Override any gcc2 internal prototype to avoid an error.  */
11528 /* We use char because int might match the return type of a gcc2
11529     builtin and then its argument prototype would still apply.  */
11530 char strftime();
11531
11532 int main() {
11533 strftime()
11534 ; return 0; }
11535 EOF
11536 if { (eval echo configure:11537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11537   rm -rf conftest*
11538   eval "ac_cv_lib_$ac_lib_var=yes"
11539 else
11540   echo "configure: failed program was:" >&5
11541   cat conftest.$ac_ext >&5
11542   rm -rf conftest*
11543   eval "ac_cv_lib_$ac_lib_var=no"
11544 fi
11545 rm -f conftest*
11546 LIBS="$ac_save_LIBS"
11547
11548 fi
11549 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
11550   echo "$ac_t""yes" 1>&6
11551   cat >> confdefs.h <<\EOF
11552 #define HAVE_STRFTIME 1
11553 EOF
11554
11555 LIBS="-lintl $LIBS"
11556 else
11557   echo "$ac_t""no" 1>&6
11558 fi
11559
11560 fi
11561
11562
11563 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
11564 echo "configure:11565: checking for vprintf" >&5
11565 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
11566   echo $ac_n "(cached) $ac_c" 1>&6
11567 else
11568   cat > conftest.$ac_ext <<EOF
11569 #line 11570 "configure"
11570 #include "confdefs.h"
11571 /* System header to define __stub macros and hopefully few prototypes,
11572     which can conflict with char vprintf(); below.  */
11573 #include <assert.h>
11574 /* Override any gcc2 internal prototype to avoid an error.  */
11575 /* We use char because int might match the return type of a gcc2
11576     builtin and then its argument prototype would still apply.  */
11577 char vprintf();
11578
11579 int main() {
11580
11581 /* The GNU C library defines this for functions which it implements
11582     to always fail with ENOSYS.  Some functions are actually named
11583     something starting with __ and the normal name is an alias.  */
11584 #if defined (__stub_vprintf) || defined (__stub___vprintf)
11585 choke me
11586 #else
11587 vprintf();
11588 #endif
11589
11590 ; return 0; }
11591 EOF
11592 if { (eval echo configure:11593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11593   rm -rf conftest*
11594   eval "ac_cv_func_vprintf=yes"
11595 else
11596   echo "configure: failed program was:" >&5
11597   cat conftest.$ac_ext >&5
11598   rm -rf conftest*
11599   eval "ac_cv_func_vprintf=no"
11600 fi
11601 rm -f conftest*
11602 fi
11603
11604 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
11605   echo "$ac_t""yes" 1>&6
11606   cat >> confdefs.h <<\EOF
11607 #define HAVE_VPRINTF 1
11608 EOF
11609
11610 else
11611   echo "$ac_t""no" 1>&6
11612 fi
11613
11614 if test "$ac_cv_func_vprintf" != yes; then
11615 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
11616 echo "configure:11617: checking for _doprnt" >&5
11617 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
11618   echo $ac_n "(cached) $ac_c" 1>&6
11619 else
11620   cat > conftest.$ac_ext <<EOF
11621 #line 11622 "configure"
11622 #include "confdefs.h"
11623 /* System header to define __stub macros and hopefully few prototypes,
11624     which can conflict with char _doprnt(); below.  */
11625 #include <assert.h>
11626 /* Override any gcc2 internal prototype to avoid an error.  */
11627 /* We use char because int might match the return type of a gcc2
11628     builtin and then its argument prototype would still apply.  */
11629 char _doprnt();
11630
11631 int main() {
11632
11633 /* The GNU C library defines this for functions which it implements
11634     to always fail with ENOSYS.  Some functions are actually named
11635     something starting with __ and the normal name is an alias.  */
11636 #if defined (__stub__doprnt) || defined (__stub____doprnt)
11637 choke me
11638 #else
11639 _doprnt();
11640 #endif
11641
11642 ; return 0; }
11643 EOF
11644 if { (eval echo configure:11645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11645   rm -rf conftest*
11646   eval "ac_cv_func__doprnt=yes"
11647 else
11648   echo "configure: failed program was:" >&5
11649   cat conftest.$ac_ext >&5
11650   rm -rf conftest*
11651   eval "ac_cv_func__doprnt=no"
11652 fi
11653 rm -f conftest*
11654 fi
11655
11656 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
11657   echo "$ac_t""yes" 1>&6
11658   cat >> confdefs.h <<\EOF
11659 #define HAVE_DOPRNT 1
11660 EOF
11661
11662 else
11663   echo "$ac_t""no" 1>&6
11664 fi
11665
11666 fi
11667
11668
11669 if test $ac_cv_func_vprintf = yes ; then
11670                 for ac_func in vsnprintf vsprintf
11671 do
11672 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11673 echo "configure:11674: checking for $ac_func" >&5
11674 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11675   echo $ac_n "(cached) $ac_c" 1>&6
11676 else
11677   cat > conftest.$ac_ext <<EOF
11678 #line 11679 "configure"
11679 #include "confdefs.h"
11680 /* System header to define __stub macros and hopefully few prototypes,
11681     which can conflict with char $ac_func(); below.  */
11682 #include <assert.h>
11683 /* Override any gcc2 internal prototype to avoid an error.  */
11684 /* We use char because int might match the return type of a gcc2
11685     builtin and then its argument prototype would still apply.  */
11686 char $ac_func();
11687
11688 int main() {
11689
11690 /* The GNU C library defines this for functions which it implements
11691     to always fail with ENOSYS.  Some functions are actually named
11692     something starting with __ and the normal name is an alias.  */
11693 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11694 choke me
11695 #else
11696 $ac_func();
11697 #endif
11698
11699 ; return 0; }
11700 EOF
11701 if { (eval echo configure:11702: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11702   rm -rf conftest*
11703   eval "ac_cv_func_$ac_func=yes"
11704 else
11705   echo "configure: failed program was:" >&5
11706   cat conftest.$ac_ext >&5
11707   rm -rf conftest*
11708   eval "ac_cv_func_$ac_func=no"
11709 fi
11710 rm -f conftest*
11711 fi
11712
11713 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11714   echo "$ac_t""yes" 1>&6
11715     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11716   cat >> confdefs.h <<EOF
11717 #define $ac_tr_func 1
11718 EOF
11719  
11720 else
11721   echo "$ac_t""no" 1>&6
11722 fi
11723 done
11724
11725 fi
11726
11727 for ac_func in \
11728         bcopy                   \
11729         closesocket             \
11730         endgrent                \
11731         endpwent                \
11732         flock                   \
11733         getdtablesize   \
11734         getgrgid                \
11735         gethostname             \
11736         getpass                 \
11737         getpwuid                \
11738         getpwnam                \
11739         getspnam                \
11740         gettimeofday    \
11741         initgroups              \
11742         lockf                   \
11743         memcpy                  \
11744         memmove                 \
11745         mkstemp                 \
11746         read                    \
11747         recv                    \
11748         recvfrom                \
11749         setpwfile               \
11750         setgid                  \
11751         setegid                 \
11752         setsid                  \
11753         setuid                  \
11754         seteuid                 \
11755         signal                  \
11756         sigset                  \
11757         snprintf                \
11758         strdup                  \
11759         strerror                \
11760         strpbrk                 \
11761         strrchr                 \
11762         strsep                  \
11763         strstr                  \
11764         strtol                  \
11765         strtoul                 \
11766         strspn                  \
11767         sysconf                 \
11768         waitpid                 \
11769         wait4                   \
11770         write                   \
11771         send                    \
11772         sendto                  \
11773
11774 do
11775 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11776 echo "configure:11777: checking for $ac_func" >&5
11777 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11778   echo $ac_n "(cached) $ac_c" 1>&6
11779 else
11780   cat > conftest.$ac_ext <<EOF
11781 #line 11782 "configure"
11782 #include "confdefs.h"
11783 /* System header to define __stub macros and hopefully few prototypes,
11784     which can conflict with char $ac_func(); below.  */
11785 #include <assert.h>
11786 /* Override any gcc2 internal prototype to avoid an error.  */
11787 /* We use char because int might match the return type of a gcc2
11788     builtin and then its argument prototype would still apply.  */
11789 char $ac_func();
11790
11791 int main() {
11792
11793 /* The GNU C library defines this for functions which it implements
11794     to always fail with ENOSYS.  Some functions are actually named
11795     something starting with __ and the normal name is an alias.  */
11796 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11797 choke me
11798 #else
11799 $ac_func();
11800 #endif
11801
11802 ; return 0; }
11803 EOF
11804 if { (eval echo configure:11805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11805   rm -rf conftest*
11806   eval "ac_cv_func_$ac_func=yes"
11807 else
11808   echo "configure: failed program was:" >&5
11809   cat conftest.$ac_ext >&5
11810   rm -rf conftest*
11811   eval "ac_cv_func_$ac_func=no"
11812 fi
11813 rm -f conftest*
11814 fi
11815
11816 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11817   echo "$ac_t""yes" 1>&6
11818     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11819   cat >> confdefs.h <<EOF
11820 #define $ac_tr_func 1
11821 EOF
11822  
11823 else
11824   echo "$ac_t""no" 1>&6
11825 fi
11826 done
11827
11828
11829 for ac_func in getopt tempnam
11830 do
11831 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11832 echo "configure:11833: checking for $ac_func" >&5
11833 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11834   echo $ac_n "(cached) $ac_c" 1>&6
11835 else
11836   cat > conftest.$ac_ext <<EOF
11837 #line 11838 "configure"
11838 #include "confdefs.h"
11839 /* System header to define __stub macros and hopefully few prototypes,
11840     which can conflict with char $ac_func(); below.  */
11841 #include <assert.h>
11842 /* Override any gcc2 internal prototype to avoid an error.  */
11843 /* We use char because int might match the return type of a gcc2
11844     builtin and then its argument prototype would still apply.  */
11845 char $ac_func();
11846
11847 int main() {
11848
11849 /* The GNU C library defines this for functions which it implements
11850     to always fail with ENOSYS.  Some functions are actually named
11851     something starting with __ and the normal name is an alias.  */
11852 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11853 choke me
11854 #else
11855 $ac_func();
11856 #endif
11857
11858 ; return 0; }
11859 EOF
11860 if { (eval echo configure:11861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11861   rm -rf conftest*
11862   eval "ac_cv_func_$ac_func=yes"
11863 else
11864   echo "configure: failed program was:" >&5
11865   cat conftest.$ac_ext >&5
11866   rm -rf conftest*
11867   eval "ac_cv_func_$ac_func=no"
11868 fi
11869 rm -f conftest*
11870 fi
11871
11872 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11873   echo "$ac_t""yes" 1>&6
11874     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11875   cat >> confdefs.h <<EOF
11876 #define $ac_tr_func 1
11877 EOF
11878  
11879 else
11880   echo "$ac_t""no" 1>&6
11881 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11882 fi
11883 done
11884
11885
11886
11887 # Check Configuration
11888
11889 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11890 echo "configure:11891: checking declaration of sys_errlist" >&5
11891 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11892   echo $ac_n "(cached) $ac_c" 1>&6
11893 else
11894   
11895         cat > conftest.$ac_ext <<EOF
11896 #line 11897 "configure"
11897 #include "confdefs.h"
11898
11899 #include <stdio.h>
11900 #include <sys/types.h>
11901 #include <errno.h> 
11902 int main() {
11903 char *c = (char *) *sys_errlist
11904 ; return 0; }
11905 EOF
11906 if { (eval echo configure:11907: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11907   rm -rf conftest*
11908   ol_cv_dcl_sys_errlist=yes
11909 else
11910   echo "configure: failed program was:" >&5
11911   cat conftest.$ac_ext >&5
11912   rm -rf conftest*
11913   ol_cv_dcl_sys_errlist=no
11914 fi
11915 rm -f conftest*
11916 fi
11917
11918 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11919 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11920 if test $ol_cv_dcl_sys_errlist = no ; then
11921         cat >> confdefs.h <<\EOF
11922 #define DECL_SYS_ERRLIST 1
11923 EOF
11924
11925         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11926 echo "configure:11927: checking existence of sys_errlist" >&5
11927         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11928   echo $ac_n "(cached) $ac_c" 1>&6
11929 else
11930   
11931                 cat > conftest.$ac_ext <<EOF
11932 #line 11933 "configure"
11933 #include "confdefs.h"
11934 #include <errno.h>
11935 int main() {
11936 char *c = (char *) *sys_errlist
11937 ; return 0; }
11938 EOF
11939 if { (eval echo configure:11940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11940   rm -rf conftest*
11941   ol_cv_have_sys_errlist=yes
11942 else
11943   echo "configure: failed program was:" >&5
11944   cat conftest.$ac_ext >&5
11945   rm -rf conftest*
11946   ol_cv_have_sys_errlist=no
11947 fi
11948 rm -f conftest*
11949 fi
11950
11951         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11952         if test $ol_cv_have_sys_errlist = yes ; then
11953                 cat >> confdefs.h <<\EOF
11954 #define HAVE_SYS_ERRLIST 1
11955 EOF
11956
11957         fi
11958 fi
11959
11960
11961
11962 if test "$ol_enable_debug" != no ; then
11963         cat >> confdefs.h <<\EOF
11964 #define LDAP_DEBUG 1
11965 EOF
11966
11967 fi
11968 if test "$ol_enable_syslog" = yes ; then
11969         cat >> confdefs.h <<\EOF
11970 #define LDAP_SYSLOG 1
11971 EOF
11972
11973 fi
11974 if test "$ol_enable_libui" = yes ; then
11975         cat >> confdefs.h <<\EOF
11976 #define LDAP_LIBUI 1
11977 EOF
11978
11979 fi
11980 if test "$ol_enable_cache" = no ; then
11981         cat >> confdefs.h <<\EOF
11982 #define LDAP_NOCACHE 1
11983 EOF
11984
11985 fi
11986 if test "$ol_enable_dns" != no ; then
11987         cat >> confdefs.h <<\EOF
11988 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11989 EOF
11990
11991 fi
11992 if test "$ol_enable_proctitle" != no ; then
11993         cat >> confdefs.h <<\EOF
11994 #define LDAP_PROCTITLE 1
11995 EOF
11996
11997 fi
11998 if test "$ol_enable_referrals" != no ; then
11999         cat >> confdefs.h <<\EOF
12000 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
12001 EOF
12002
12003 fi
12004 if test "$ol_enable_cldap" != no ; then
12005         cat >> confdefs.h <<\EOF
12006 #define LDAP_CONNECTIONLESS 1
12007 EOF
12008
12009 fi
12010
12011 if test "$ol_enable_crypt" != no ; then
12012         cat >> confdefs.h <<\EOF
12013 #define SLAPD_CRYPT 1
12014 EOF
12015
12016 fi
12017 if test "$ol_enable_cleartext" != no ; then
12018         cat >> confdefs.h <<\EOF
12019 #define SLAPD_CLEARTEXT 1
12020 EOF
12021
12022 fi
12023 if test "$ol_enable_phonetic" != no ; then
12024         cat >> confdefs.h <<\EOF
12025 #define SLAPD_PHONETIC 1
12026 EOF
12027
12028 fi
12029 if test "$ol_enable_rlookups" != no ; then
12030         cat >> confdefs.h <<\EOF
12031 #define SLAPD_RLOOKUPS 1
12032 EOF
12033
12034 fi
12035
12036 if test "$ol_link_modules" != no ; then
12037         cat >> confdefs.h <<\EOF
12038 #define SLAPD_MODULES 1
12039 EOF
12040
12041         BUILD_SLAPD=yes
12042 fi
12043
12044 if test "$ol_link_bdb2" != no ; then
12045         cat >> confdefs.h <<\EOF
12046 #define SLAPD_BDB2 1
12047 EOF
12048
12049         BUILD_SLAPD=yes
12050         BUILD_BDB2=yes
12051         if test "$ol_with_bdb2_module" != static ; then
12052                 cat >> confdefs.h <<\EOF
12053 #define SLAPD_BDB2_DYNAMIC 1
12054 EOF
12055
12056                 BUILD_BDB2_DYNAMIC=yes
12057         fi
12058 fi
12059
12060 if test "$ol_enable_ldap" != no ; then
12061         cat >> confdefs.h <<\EOF
12062 #define SLAPD_LDAP 1
12063 EOF
12064
12065         BUILD_SLAPD=yes
12066         BUILD_LDAP=yes
12067         if test "$ol_with_ldap_module" != static ; then
12068                 cat >> confdefs.h <<\EOF
12069 #define SLAPD_LDAP_DYNAMIC 1
12070 EOF
12071
12072                 BUILD_LDAP_DYNAMIC=yes
12073         fi
12074 fi
12075
12076 if test "$ol_link_ldbm" != no ; then
12077         cat >> confdefs.h <<\EOF
12078 #define SLAPD_LDBM 1
12079 EOF
12080
12081         BUILD_SLAPD=yes
12082         BUILD_LDBM=yes
12083         if test "$ol_with_ldbm_module" != static ; then
12084                 cat >> confdefs.h <<\EOF
12085 #define SLAPD_LDBM_DYNAMIC 1
12086 EOF
12087
12088                 BUILD_LDBM_DYNAMIC=yes
12089         fi
12090 fi
12091
12092 if test "$ol_enable_passwd" != no ; then
12093         cat >> confdefs.h <<\EOF
12094 #define SLAPD_PASSWD 1
12095 EOF
12096
12097         BUILD_SLAPD=yes
12098         BUILD_PASSWD=yes
12099         if test "$ol_with_passwd_module" != static ; then
12100                 cat >> confdefs.h <<\EOF
12101 #define SLAPD_PASSWD_DYNAMIC 1
12102 EOF
12103
12104                 BUILD_PASSWD_DYNAMIC=yes
12105         fi
12106 fi
12107
12108 if test "$ol_link_perl" != no ; then
12109         cat >> confdefs.h <<\EOF
12110 #define SLAPD_PERL 1
12111 EOF
12112
12113         BUILD_SLAPD=yes
12114         BUILD_PERL=yes
12115         if test "$ol_with_perl_module" != static ; then
12116                 cat >> confdefs.h <<\EOF
12117 #define SLAPD_PERL_DYNAMIC 1
12118 EOF
12119
12120                 BUILD_PERL_DYNAMIC=yes
12121         fi
12122 fi
12123
12124 if test "$ol_enable_shell" != no ; then
12125         cat >> confdefs.h <<\EOF
12126 #define SLAPD_SHELL 1
12127 EOF
12128
12129         BUILD_SLAPD=yes
12130         BUILD_SHELL=yes
12131         if test "$ol_with_shell_module" != static ; then
12132                 cat >> confdefs.h <<\EOF
12133 #define SLAPD_SHELL_DYNAMIC 1
12134 EOF
12135
12136                 BUILD_SHELL_DYNAMIC=yes
12137         fi
12138 fi
12139
12140 if test "$ol_enable_tcl" != no ; then
12141         cat >> confdefs.h <<\EOF
12142 #define SLAPD_TCL 1
12143 EOF
12144
12145         BUILD_SLAPD=yes
12146         BUILD_TCL=yes
12147         if test "$ol_with_tcl_module" != static; then
12148                 cat >> confdefs.h <<\EOF
12149 #define SLAPD_TCL_DYNAMIC 1
12150 EOF
12151
12152                 BUILD_TCL_DYNAMIC=yes
12153         fi
12154 fi
12155
12156 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
12157         $BUILD_SLAPD = yes ; then
12158         BUILD_SLURPD=yes
12159 fi
12160
12161 if test "$ol_link_isode" != no ; then
12162         BUILD_LDAPD=yes
12163 fi
12164
12165
12166
12167
12168   
12169   
12170   
12171   
12172   
12173   
12174   
12175   
12176   
12177   
12178   
12179   
12180   
12181   
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204 trap '' 1 2 15
12205
12206 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
12207
12208 test "x$prefix" = xNONE && prefix=$ac_default_prefix
12209 # Let make expand exec_prefix.
12210 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
12211
12212 # Any assignment to VPATH causes Sun make to only execute
12213 # the first set of double-colon rules, so remove it if not needed.
12214 # If there is a colon in the path, we need to keep it.
12215 if test "x$srcdir" = x.; then
12216   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
12217 fi
12218
12219 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
12220
12221 DEFS=-DHAVE_CONFIG_H
12222
12223 # Without the "./", some shells look in PATH for config.status.
12224 : ${CONFIG_STATUS=./config.status}
12225
12226 echo creating $CONFIG_STATUS
12227 rm -f $CONFIG_STATUS
12228 cat > $CONFIG_STATUS <<EOF
12229 #! /bin/sh
12230 # Generated automatically by configure.
12231 # Run this file to recreate the current configuration.
12232 # This directory was configured as follows,
12233 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
12234 #
12235 # $0 $ac_configure_args
12236 #
12237 # Compiler output produced by configure, useful for debugging
12238 # configure, is in ./config.log if it exists.
12239
12240 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
12241 for ac_option
12242 do
12243   case "\$ac_option" in
12244   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
12245     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
12246     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
12247   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
12248     echo "$CONFIG_STATUS generated by autoconf version 2.13"
12249     exit 0 ;;
12250   -help | --help | --hel | --he | --h)
12251     echo "\$ac_cs_usage"; exit 0 ;;
12252   *) echo "\$ac_cs_usage"; exit 1 ;;
12253   esac
12254 done
12255
12256 ac_given_srcdir=$srcdir
12257 ac_given_INSTALL="$INSTALL"
12258
12259 trap 'rm -fr `echo "\
12260 Makefile:build/top.mk:Makefile.in:build/dir.mk \
12261 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
12262 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
12263 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
12264 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
12265 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
12266 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
12267 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
12268 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
12269 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
12270 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
12271 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
12272 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
12273 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
12274 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
12275 include/Makefile:build/top.mk:include/Makefile.in \
12276 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
12277 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
12278 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12279 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12280 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
12281 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
12282 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
12283 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
12284 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
12285 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
12286 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
12287 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
12288 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
12289 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
12290 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
12291 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
12292 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
12293 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
12294 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
12295 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
12296 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
12297 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
12298 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
12299 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
12300 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
12301 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
12302  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
12303 EOF
12304 cat >> $CONFIG_STATUS <<EOF
12305
12306 # Protect against being on the right side of a sed subst in config.status.
12307 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
12308  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
12309 $ac_vpsub
12310 $extrasub
12311 s%@SHELL@%$SHELL%g
12312 s%@CFLAGS@%$CFLAGS%g
12313 s%@CPPFLAGS@%$CPPFLAGS%g
12314 s%@CXXFLAGS@%$CXXFLAGS%g
12315 s%@FFLAGS@%$FFLAGS%g
12316 s%@DEFS@%$DEFS%g
12317 s%@LDFLAGS@%$LDFLAGS%g
12318 s%@LIBS@%$LIBS%g
12319 s%@exec_prefix@%$exec_prefix%g
12320 s%@prefix@%$prefix%g
12321 s%@program_transform_name@%$program_transform_name%g
12322 s%@bindir@%$bindir%g
12323 s%@sbindir@%$sbindir%g
12324 s%@libexecdir@%$libexecdir%g
12325 s%@datadir@%$datadir%g
12326 s%@sysconfdir@%$sysconfdir%g
12327 s%@sharedstatedir@%$sharedstatedir%g
12328 s%@localstatedir@%$localstatedir%g
12329 s%@libdir@%$libdir%g
12330 s%@includedir@%$includedir%g
12331 s%@oldincludedir@%$oldincludedir%g
12332 s%@infodir@%$infodir%g
12333 s%@mandir@%$mandir%g
12334 s%@host@%$host%g
12335 s%@host_alias@%$host_alias%g
12336 s%@host_cpu@%$host_cpu%g
12337 s%@host_vendor@%$host_vendor%g
12338 s%@host_os@%$host_os%g
12339 s%@target@%$target%g
12340 s%@target_alias@%$target_alias%g
12341 s%@target_cpu@%$target_cpu%g
12342 s%@target_vendor@%$target_vendor%g
12343 s%@target_os@%$target_os%g
12344 s%@build@%$build%g
12345 s%@build_alias@%$build_alias%g
12346 s%@build_cpu@%$build_cpu%g
12347 s%@build_vendor@%$build_vendor%g
12348 s%@build_os@%$build_os%g
12349 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
12350 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
12351 s%@INSTALL_DATA@%$INSTALL_DATA%g
12352 s%@PACKAGE@%$PACKAGE%g
12353 s%@VERSION@%$VERSION%g
12354 s%@ACLOCAL@%$ACLOCAL%g
12355 s%@AUTOCONF@%$AUTOCONF%g
12356 s%@AUTOMAKE@%$AUTOMAKE%g
12357 s%@AUTOHEADER@%$AUTOHEADER%g
12358 s%@MAKEINFO@%$MAKEINFO%g
12359 s%@SET_MAKE@%$SET_MAKE%g
12360 s%@top_builddir@%$top_builddir%g
12361 s%@ldap_subdir@%$ldap_subdir%g
12362 s%@CC@%$CC%g
12363 s%@RANLIB@%$RANLIB%g
12364 s%@LD@%$LD%g
12365 s%@NM@%$NM%g
12366 s%@LN_S@%$LN_S%g
12367 s%@LIBTOOL@%$LIBTOOL%g
12368 s%@AWK@%$AWK%g
12369 s%@LN_H@%$LN_H%g
12370 s%@SENDMAIL@%$SENDMAIL%g
12371 s%@EDITOR@%$EDITOR%g
12372 s%@FINGER@%$FINGER%g
12373 s%@GLIBCONFIG@%$GLIBCONFIG%g
12374 s%@PERLBIN@%$PERLBIN%g
12375 s%@CPP@%$CPP%g
12376 s%@EXEEXT@%$EXEEXT%g
12377 s%@OBJEXT@%$OBJEXT%g
12378 s%@OL_MKDEP@%$OL_MKDEP%g
12379 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
12380 s%@PEPSY@%$PEPSY%g
12381 s%@LIBOBJS@%$LIBOBJS%g
12382 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
12383 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
12384 s%@BUILD_BDB2@%$BUILD_BDB2%g
12385 s%@BUILD_LDAP@%$BUILD_LDAP%g
12386 s%@BUILD_LDBM@%$BUILD_LDBM%g
12387 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
12388 s%@BUILD_PERL@%$BUILD_PERL%g
12389 s%@BUILD_SHELL@%$BUILD_SHELL%g
12390 s%@BUILD_TCL@%$BUILD_TCL%g
12391 s%@BUILD_BDB2_DYNAMIC@%$BUILD_BDB2_DYNAMIC%g
12392 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
12393 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
12394 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
12395 s%@BUILD_PERL_DYNAMIC@%$BUILD_PERL_DYNAMIC%g
12396 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
12397 s%@BUILD_TCL_DYNAMIC@%$BUILD_TCL_DYNAMIC%g
12398 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
12399 s%@LDAP_LIBS@%$LDAP_LIBS%g
12400 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
12401 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
12402 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
12403 s%@LDBM_LIBS@%$LDBM_LIBS%g
12404 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
12405 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
12406 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
12407 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
12408 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
12409 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
12410 s%@KRB_LIBS@%$KRB_LIBS%g
12411 s%@READLINE_LIBS@%$READLINE_LIBS%g
12412 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
12413 s%@TLS_LIBS@%$TLS_LIBS%g
12414
12415 CEOF
12416 EOF
12417
12418 cat >> $CONFIG_STATUS <<\EOF
12419
12420 # Split the substitutions into bite-sized pieces for seds with
12421 # small command number limits, like on Digital OSF/1 and HP-UX.
12422 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
12423 ac_file=1 # Number of current file.
12424 ac_beg=1 # First line for current file.
12425 ac_end=$ac_max_sed_cmds # Line after last line for current file.
12426 ac_more_lines=:
12427 ac_sed_cmds=""
12428 while $ac_more_lines; do
12429   if test $ac_beg -gt 1; then
12430     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
12431   else
12432     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
12433   fi
12434   if test ! -s conftest.s$ac_file; then
12435     ac_more_lines=false
12436     rm -f conftest.s$ac_file
12437   else
12438     if test -z "$ac_sed_cmds"; then
12439       ac_sed_cmds="sed -f conftest.s$ac_file"
12440     else
12441       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
12442     fi
12443     ac_file=`expr $ac_file + 1`
12444     ac_beg=$ac_end
12445     ac_end=`expr $ac_end + $ac_max_sed_cmds`
12446   fi
12447 done
12448 if test -z "$ac_sed_cmds"; then
12449   ac_sed_cmds=cat
12450 fi
12451 EOF
12452
12453 cat >> $CONFIG_STATUS <<EOF
12454
12455 CONFIG_FILES=\${CONFIG_FILES-"\
12456 Makefile:build/top.mk:Makefile.in:build/dir.mk \
12457 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
12458 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
12459 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
12460 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
12461 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
12462 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
12463 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
12464 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
12465 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
12466 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
12467 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
12468 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
12469 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
12470 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
12471 include/Makefile:build/top.mk:include/Makefile.in \
12472 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
12473 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
12474 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12475 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
12476 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
12477 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
12478 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
12479 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
12480 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
12481 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
12482 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
12483 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
12484 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/srv.mk \
12485 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
12486 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
12487 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
12488 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
12489 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
12490 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
12491 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
12492 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
12493 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
12494 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
12495 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
12496 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
12497 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
12498 "}
12499 EOF
12500 cat >> $CONFIG_STATUS <<\EOF
12501 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
12502   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12503   case "$ac_file" in
12504   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12505        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12506   *) ac_file_in="${ac_file}.in" ;;
12507   esac
12508
12509   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
12510
12511   # Remove last slash and all that follows it.  Not all systems have dirname.
12512   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12513   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12514     # The file is in a subdirectory.
12515     test ! -d "$ac_dir" && mkdir "$ac_dir"
12516     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
12517     # A "../" for each directory in $ac_dir_suffix.
12518     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
12519   else
12520     ac_dir_suffix= ac_dots=
12521   fi
12522
12523   case "$ac_given_srcdir" in
12524   .)  srcdir=.
12525       if test -z "$ac_dots"; then top_srcdir=.
12526       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
12527   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
12528   *) # Relative path.
12529     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
12530     top_srcdir="$ac_dots$ac_given_srcdir" ;;
12531   esac
12532
12533   case "$ac_given_INSTALL" in
12534   [/$]*) INSTALL="$ac_given_INSTALL" ;;
12535   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
12536   esac
12537
12538   echo creating "$ac_file"
12539   rm -f "$ac_file"
12540   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
12541   case "$ac_file" in
12542   *Makefile*) ac_comsub="1i\\
12543 # $configure_input" ;;
12544   *) ac_comsub= ;;
12545   esac
12546
12547   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12548   sed -e "$ac_comsub
12549 s%@configure_input@%$configure_input%g
12550 s%@srcdir@%$srcdir%g
12551 s%@top_srcdir@%$top_srcdir%g
12552 s%@INSTALL@%$INSTALL%g
12553 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
12554 fi; done
12555 rm -f conftest.s*
12556
12557 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12558 # NAME is the cpp macro being defined and VALUE is the value it is being given.
12559 #
12560 # ac_d sets the value in "#define NAME VALUE" lines.
12561 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
12562 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
12563 ac_dC='\3'
12564 ac_dD='%g'
12565 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
12566 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12567 ac_uB='\([      ]\)%\1#\2define\3'
12568 ac_uC=' '
12569 ac_uD='\4%g'
12570 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12571 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
12572 ac_eB='$%\1#\2define\3'
12573 ac_eC=' '
12574 ac_eD='%g'
12575
12576 if test "${CONFIG_HEADERS+set}" != set; then
12577 EOF
12578 cat >> $CONFIG_STATUS <<EOF
12579   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
12580 EOF
12581 cat >> $CONFIG_STATUS <<\EOF
12582 fi
12583 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
12584   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12585   case "$ac_file" in
12586   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
12587        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
12588   *) ac_file_in="${ac_file}.in" ;;
12589   esac
12590
12591   echo creating $ac_file
12592
12593   rm -f conftest.frag conftest.in conftest.out
12594   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
12595   cat $ac_file_inputs > conftest.in
12596
12597 EOF
12598
12599 # Transform confdefs.h into a sed script conftest.vals that substitutes
12600 # the proper values into config.h.in to produce config.h.  And first:
12601 # Protect against being on the right side of a sed subst in config.status.
12602 # Protect against being in an unquoted here document in config.status.
12603 rm -f conftest.vals
12604 cat > conftest.hdr <<\EOF
12605 s/[\\&%]/\\&/g
12606 s%[\\$`]%\\&%g
12607 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
12608 s%ac_d%ac_u%gp
12609 s%ac_u%ac_e%gp
12610 EOF
12611 sed -n -f conftest.hdr confdefs.h > conftest.vals
12612 rm -f conftest.hdr
12613
12614 # This sed command replaces #undef with comments.  This is necessary, for
12615 # example, in the case of _POSIX_SOURCE, which is predefined and required
12616 # on some systems where configure will not decide to define it.
12617 cat >> conftest.vals <<\EOF
12618 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
12619 EOF
12620
12621 # Break up conftest.vals because some shells have a limit on
12622 # the size of here documents, and old seds have small limits too.
12623
12624 rm -f conftest.tail
12625 while :
12626 do
12627   ac_lines=`grep -c . conftest.vals`
12628   # grep -c gives empty output for an empty file on some AIX systems.
12629   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
12630   # Write a limited-size here document to conftest.frag.
12631   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
12632   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
12633   echo 'CEOF
12634   sed -f conftest.frag conftest.in > conftest.out
12635   rm -f conftest.in
12636   mv conftest.out conftest.in
12637 ' >> $CONFIG_STATUS
12638   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
12639   rm -f conftest.vals
12640   mv conftest.tail conftest.vals
12641 done
12642 rm -f conftest.vals
12643
12644 cat >> $CONFIG_STATUS <<\EOF
12645   rm -f conftest.frag conftest.h
12646   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
12647   cat conftest.in >> conftest.h
12648   rm -f conftest.in
12649   if cmp -s $ac_file conftest.h 2>/dev/null; then
12650     echo "$ac_file is unchanged"
12651     rm -f conftest.h
12652   else
12653     # Remove last slash and all that follows it.  Not all systems have dirname.
12654       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
12655       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
12656       # The file is in a subdirectory.
12657       test ! -d "$ac_dir" && mkdir "$ac_dir"
12658     fi
12659     rm -f $ac_file
12660     mv conftest.h $ac_file
12661   fi
12662 fi; done
12663
12664 EOF
12665 cat >> $CONFIG_STATUS <<EOF
12666
12667 EOF
12668 cat >> $CONFIG_STATUS <<\EOF
12669
12670 date > stamp-h
12671 echo Please \"make depend\" to build dependencies
12672
12673 exit 0
12674 EOF
12675 chmod +x $CONFIG_STATUS
12676 rm -fr confdefs* $ac_clean_files
12677 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
12678