]> git.sur5r.net Git - openldap/blob - configure
Added software to add the new rdn as an attribute to the entry.
[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-proctitle    enable proctitle support (yes)"
21 ac_help="$ac_help
22   --enable-cache        enable caching (yes)"
23 ac_help="$ac_help
24   --enable-dns          enable V2 DNS  extension (no)"
25 ac_help="$ac_help
26   --enable-referrals    enable V2 Referrals extension (yes)"
27 ac_help="$ac_help
28   --enable-cldap        enable connectionless ldap (no)"
29 ac_help="$ac_help
30   --enable-x-compile    enable cross compiling (no)"
31 ac_help="$ac_help
32   --enable-dmalloc      enable debug malloc support (no)"
33 ac_help="$ac_help
34   --with-kerberos       use Kerberos (auto)"
35 ac_help="$ac_help
36   --with-threads        use threads (auto)"
37 ac_help="$ac_help
38   --with-yielding-select        with implicitly yielding select (auto)"
39 ac_help="$ac_help
40   --with-tls  with TLS/SSL support (auto)"
41 ac_help="$ac_help
42 LDAPD Options:"
43 ac_help="$ac_help
44   --enable-ldapd        enable building ldapd (no)"
45 ac_help="$ac_help
46 SLAPD Options:"
47 ac_help="$ac_help
48   --enable-slapd        enable building slapd (yes)"
49 ac_help="$ac_help
50     --enable-aclgroups  enable ACL group support (auto)"
51 ac_help="$ac_help
52     --enable-cleartext  enable cleartext passwords (yes)"
53 ac_help="$ac_help
54     --enable-crypt      enable crypt(3) passwords (auto)"
55 ac_help="$ac_help
56     --enable-wrappers   enable tcp wrapper support (no)"
57 ac_help="$ac_help
58     --enable-phonetic   enable phonetic/soundex (no)"
59 ac_help="$ac_help
60     --enable-rlookups   enable reverse lookups (auto)"
61 ac_help="$ac_help
62     --enable-bdb2       enable bdb2 backend (no)"
63 ac_help="$ac_help
64     --enable-ldbm       enable ldbm backend (yes)"
65 ac_help="$ac_help
66       --with-ldbm-api   use LDBM API (auto)"
67 ac_help="$ac_help
68       --with-ldbm-type  use LDBM type (auto)"
69 ac_help="$ac_help
70     --enable-passwd     enable passwd backend (no)"
71 ac_help="$ac_help
72     --enable-perl       enable perl backend (no)"
73 ac_help="$ac_help
74     --enable-shell      enable shell backend (no)"
75 ac_help="$ac_help
76     --enable-tcl        enable tcl backend (no)"
77 ac_help="$ac_help
78 SLURPD Options:"
79 ac_help="$ac_help
80   --enable-slurpd       enable building slurpd (auto)"
81 ac_help="$ac_help
82 Library Generation & Linking Options"
83 ac_help="$ac_help
84   --enable-static         build static libraries [default=yes]
85   --enable-static=PKGS    only build shared libraries if the current package
86                           appears as an element in the PKGS list"
87 ac_help="$ac_help
88   --enable-shared         build shared libraries [default=yes]
89   --enable-shared=PKGS    only build shared libraries if the current package
90                           appears as an element in the PKGS list"
91 ac_help="$ac_help
92   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
93
94 # Initialize some variables set by options.
95 # The variables have the same names as the options, with
96 # dashes changed to underlines.
97 build=NONE
98 cache_file=./config.cache
99 exec_prefix=NONE
100 host=NONE
101 no_create=
102 nonopt=NONE
103 no_recursion=
104 prefix=NONE
105 program_prefix=NONE
106 program_suffix=NONE
107 program_transform_name=s,x,x,
108 silent=
109 site=
110 srcdir=
111 target=NONE
112 verbose=
113 x_includes=NONE
114 x_libraries=NONE
115 bindir='${exec_prefix}/bin'
116 sbindir='${exec_prefix}/sbin'
117 libexecdir='${exec_prefix}/libexec'
118 datadir='${prefix}/share'
119 sysconfdir='${prefix}/etc'
120 sharedstatedir='${prefix}/com'
121 localstatedir='${prefix}/var'
122 libdir='${exec_prefix}/lib'
123 includedir='${prefix}/include'
124 oldincludedir='/usr/include'
125 infodir='${prefix}/info'
126 mandir='${prefix}/man'
127
128 # Initialize some other variables.
129 subdirs=
130 MFLAGS= MAKEFLAGS=
131 SHELL=${CONFIG_SHELL-/bin/sh}
132 # Maximum number of lines to put in a shell here document.
133 ac_max_here_lines=12
134
135 ac_prev=
136 for ac_option
137 do
138
139   # If the previous option needs an argument, assign it.
140   if test -n "$ac_prev"; then
141     eval "$ac_prev=\$ac_option"
142     ac_prev=
143     continue
144   fi
145
146   case "$ac_option" in
147   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
148   *) ac_optarg= ;;
149   esac
150
151   # Accept the important Cygnus configure options, so we can diagnose typos.
152
153   case "$ac_option" in
154
155   -bindir | --bindir | --bindi | --bind | --bin | --bi)
156     ac_prev=bindir ;;
157   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
158     bindir="$ac_optarg" ;;
159
160   -build | --build | --buil | --bui | --bu)
161     ac_prev=build ;;
162   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
163     build="$ac_optarg" ;;
164
165   -cache-file | --cache-file | --cache-fil | --cache-fi \
166   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
167     ac_prev=cache_file ;;
168   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
169   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
170     cache_file="$ac_optarg" ;;
171
172   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
173     ac_prev=datadir ;;
174   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
175   | --da=*)
176     datadir="$ac_optarg" ;;
177
178   -disable-* | --disable-*)
179     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
180     # Reject names that are not valid shell variable names.
181     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
182       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
183     fi
184     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
185     eval "enable_${ac_feature}=no" ;;
186
187   -enable-* | --enable-*)
188     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
189     # Reject names that are not valid shell variable names.
190     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
191       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
192     fi
193     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
194     case "$ac_option" in
195       *=*) ;;
196       *) ac_optarg=yes ;;
197     esac
198     eval "enable_${ac_feature}='$ac_optarg'" ;;
199
200   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
201   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
202   | --exec | --exe | --ex)
203     ac_prev=exec_prefix ;;
204   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
205   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
206   | --exec=* | --exe=* | --ex=*)
207     exec_prefix="$ac_optarg" ;;
208
209   -gas | --gas | --ga | --g)
210     # Obsolete; use --with-gas.
211     with_gas=yes ;;
212
213   -help | --help | --hel | --he)
214     # Omit some internal or obsolete options to make the list less imposing.
215     # This message is too long to be a string in the A/UX 3.1 sh.
216     cat << EOF
217 Usage: configure [options] [host]
218 Options: [defaults in brackets after descriptions]
219 Configuration:
220   --cache-file=FILE       cache test results in FILE
221   --help                  print this message
222   --no-create             do not create output files
223   --quiet, --silent       do not print \`checking...' messages
224   --version               print the version of autoconf that created configure
225 Directory and file names:
226   --prefix=PREFIX         install architecture-independent files in PREFIX
227                           [$ac_default_prefix]
228   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
229                           [same as prefix]
230   --bindir=DIR            user executables in DIR [EPREFIX/bin]
231   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
232   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
233   --datadir=DIR           read-only architecture-independent data in DIR
234                           [PREFIX/share]
235   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
236   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
237                           [PREFIX/com]
238   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
239   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
240   --includedir=DIR        C header files in DIR [PREFIX/include]
241   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
242   --infodir=DIR           info documentation in DIR [PREFIX/info]
243   --mandir=DIR            man documentation in DIR [PREFIX/man]
244   --srcdir=DIR            find the sources in DIR [configure dir or ..]
245   --program-prefix=PREFIX prepend PREFIX to installed program names
246   --program-suffix=SUFFIX append SUFFIX to installed program names
247   --program-transform-name=PROGRAM
248                           run sed PROGRAM on installed program names
249 EOF
250     cat << EOF
251 Host type:
252   --build=BUILD           configure for building on BUILD [BUILD=HOST]
253   --host=HOST             configure for HOST [guessed]
254   --target=TARGET         configure for TARGET [TARGET=HOST]
255 Features and packages:
256   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
257   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
258   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
259   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
260   --x-includes=DIR        X include files are in DIR
261   --x-libraries=DIR       X library files are in DIR
262 EOF
263     if test -n "$ac_help"; then
264       echo "--enable and --with options recognized:$ac_help"
265     fi
266     exit 0 ;;
267
268   -host | --host | --hos | --ho)
269     ac_prev=host ;;
270   -host=* | --host=* | --hos=* | --ho=*)
271     host="$ac_optarg" ;;
272
273   -includedir | --includedir | --includedi | --included | --include \
274   | --includ | --inclu | --incl | --inc)
275     ac_prev=includedir ;;
276   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
277   | --includ=* | --inclu=* | --incl=* | --inc=*)
278     includedir="$ac_optarg" ;;
279
280   -infodir | --infodir | --infodi | --infod | --info | --inf)
281     ac_prev=infodir ;;
282   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
283     infodir="$ac_optarg" ;;
284
285   -libdir | --libdir | --libdi | --libd)
286     ac_prev=libdir ;;
287   -libdir=* | --libdir=* | --libdi=* | --libd=*)
288     libdir="$ac_optarg" ;;
289
290   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
291   | --libexe | --libex | --libe)
292     ac_prev=libexecdir ;;
293   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
294   | --libexe=* | --libex=* | --libe=*)
295     libexecdir="$ac_optarg" ;;
296
297   -localstatedir | --localstatedir | --localstatedi | --localstated \
298   | --localstate | --localstat | --localsta | --localst \
299   | --locals | --local | --loca | --loc | --lo)
300     ac_prev=localstatedir ;;
301   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
302   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
303   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
304     localstatedir="$ac_optarg" ;;
305
306   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
307     ac_prev=mandir ;;
308   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
309     mandir="$ac_optarg" ;;
310
311   -nfp | --nfp | --nf)
312     # Obsolete; use --without-fp.
313     with_fp=no ;;
314
315   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
316   | --no-cr | --no-c)
317     no_create=yes ;;
318
319   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
320   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
321     no_recursion=yes ;;
322
323   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
324   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
325   | --oldin | --oldi | --old | --ol | --o)
326     ac_prev=oldincludedir ;;
327   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
328   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
329   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
330     oldincludedir="$ac_optarg" ;;
331
332   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
333     ac_prev=prefix ;;
334   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
335     prefix="$ac_optarg" ;;
336
337   -program-prefix | --program-prefix | --program-prefi | --program-pref \
338   | --program-pre | --program-pr | --program-p)
339     ac_prev=program_prefix ;;
340   -program-prefix=* | --program-prefix=* | --program-prefi=* \
341   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
342     program_prefix="$ac_optarg" ;;
343
344   -program-suffix | --program-suffix | --program-suffi | --program-suff \
345   | --program-suf | --program-su | --program-s)
346     ac_prev=program_suffix ;;
347   -program-suffix=* | --program-suffix=* | --program-suffi=* \
348   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
349     program_suffix="$ac_optarg" ;;
350
351   -program-transform-name | --program-transform-name \
352   | --program-transform-nam | --program-transform-na \
353   | --program-transform-n | --program-transform- \
354   | --program-transform | --program-transfor \
355   | --program-transfo | --program-transf \
356   | --program-trans | --program-tran \
357   | --progr-tra | --program-tr | --program-t)
358     ac_prev=program_transform_name ;;
359   -program-transform-name=* | --program-transform-name=* \
360   | --program-transform-nam=* | --program-transform-na=* \
361   | --program-transform-n=* | --program-transform-=* \
362   | --program-transform=* | --program-transfor=* \
363   | --program-transfo=* | --program-transf=* \
364   | --program-trans=* | --program-tran=* \
365   | --progr-tra=* | --program-tr=* | --program-t=*)
366     program_transform_name="$ac_optarg" ;;
367
368   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
369   | -silent | --silent | --silen | --sile | --sil)
370     silent=yes ;;
371
372   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
373     ac_prev=sbindir ;;
374   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
375   | --sbi=* | --sb=*)
376     sbindir="$ac_optarg" ;;
377
378   -sharedstatedir | --sharedstatedir | --sharedstatedi \
379   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
380   | --sharedst | --shareds | --shared | --share | --shar \
381   | --sha | --sh)
382     ac_prev=sharedstatedir ;;
383   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
384   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
385   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
386   | --sha=* | --sh=*)
387     sharedstatedir="$ac_optarg" ;;
388
389   -site | --site | --sit)
390     ac_prev=site ;;
391   -site=* | --site=* | --sit=*)
392     site="$ac_optarg" ;;
393
394   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
395     ac_prev=srcdir ;;
396   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
397     srcdir="$ac_optarg" ;;
398
399   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
400   | --syscon | --sysco | --sysc | --sys | --sy)
401     ac_prev=sysconfdir ;;
402   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
403   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
404     sysconfdir="$ac_optarg" ;;
405
406   -target | --target | --targe | --targ | --tar | --ta | --t)
407     ac_prev=target ;;
408   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
409     target="$ac_optarg" ;;
410
411   -v | -verbose | --verbose | --verbos | --verbo | --verb)
412     verbose=yes ;;
413
414   -version | --version | --versio | --versi | --vers)
415     echo "configure generated by autoconf version 2.13"
416     exit 0 ;;
417
418   -with-* | --with-*)
419     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
420     # Reject names that are not valid shell variable names.
421     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
422       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
423     fi
424     ac_package=`echo $ac_package| sed 's/-/_/g'`
425     case "$ac_option" in
426       *=*) ;;
427       *) ac_optarg=yes ;;
428     esac
429     eval "with_${ac_package}='$ac_optarg'" ;;
430
431   -without-* | --without-*)
432     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
433     # Reject names that are not valid shell variable names.
434     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
435       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
436     fi
437     ac_package=`echo $ac_package| sed 's/-/_/g'`
438     eval "with_${ac_package}=no" ;;
439
440   --x)
441     # Obsolete; use --with-x.
442     with_x=yes ;;
443
444   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
445   | --x-incl | --x-inc | --x-in | --x-i)
446     ac_prev=x_includes ;;
447   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
448   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
449     x_includes="$ac_optarg" ;;
450
451   -x-libraries | --x-libraries | --x-librarie | --x-librari \
452   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
453     ac_prev=x_libraries ;;
454   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
455   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
456     x_libraries="$ac_optarg" ;;
457
458   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
459     ;;
460
461   *)
462     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
463       echo "configure: warning: $ac_option: invalid host type" 1>&2
464     fi
465     if test "x$nonopt" != xNONE; then
466       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
467     fi
468     nonopt="$ac_option"
469     ;;
470
471   esac
472 done
473
474 if test -n "$ac_prev"; then
475   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
476 fi
477
478 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
479
480 # File descriptor usage:
481 # 0 standard input
482 # 1 file creation
483 # 2 errors and warnings
484 # 3 some systems may open it to /dev/tty
485 # 4 used on the Kubota Titan
486 # 6 checking for... messages and results
487 # 5 compiler messages saved in config.log
488 if test "$silent" = yes; then
489   exec 6>/dev/null
490 else
491   exec 6>&1
492 fi
493 exec 5>./config.log
494
495 echo "\
496 This file contains any messages produced by compilers while
497 running configure, to aid debugging if configure makes a mistake.
498 " 1>&5
499
500 # Strip out --no-create and --no-recursion so they do not pile up.
501 # Also quote any args containing shell metacharacters.
502 ac_configure_args=
503 for ac_arg
504 do
505   case "$ac_arg" in
506   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
507   | --no-cr | --no-c) ;;
508   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
509   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
510   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
511   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
512   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
513   esac
514 done
515
516 # NLS nuisances.
517 # Only set these to C if already set.  These must not be set unconditionally
518 # because not all systems understand e.g. LANG=C (notably SCO).
519 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
520 # Non-C LC_CTYPE values break the ctype check.
521 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
522 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
523 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
524 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
525
526 # confdefs.h avoids OS command line length limits that DEFS can exceed.
527 rm -rf conftest* confdefs.h
528 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
529 echo > confdefs.h
530
531 # A filename unique to this package, relative to the directory that
532 # configure is in, which we can look for to find out if srcdir is correct.
533 ac_unique_file=include/ldap.h
534
535 # Find the source files, if location was not specified.
536 if test -z "$srcdir"; then
537   ac_srcdir_defaulted=yes
538   # Try the directory containing this script, then its parent.
539   ac_prog=$0
540   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
541   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
542   srcdir=$ac_confdir
543   if test ! -r $srcdir/$ac_unique_file; then
544     srcdir=..
545   fi
546 else
547   ac_srcdir_defaulted=no
548 fi
549 if test ! -r $srcdir/$ac_unique_file; then
550   if test "$ac_srcdir_defaulted" = yes; then
551     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
552   else
553     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
554   fi
555 fi
556 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
557
558 # Prefer explicitly selected file to automatically selected ones.
559 if test -z "$CONFIG_SITE"; then
560   if test "x$prefix" != xNONE; then
561     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
562   else
563     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
564   fi
565 fi
566 for ac_site_file in $CONFIG_SITE; do
567   if test -r "$ac_site_file"; then
568     echo "loading site script $ac_site_file"
569     . "$ac_site_file"
570   fi
571 done
572
573 if test -r "$cache_file"; then
574   echo "loading cache $cache_file"
575   . $cache_file
576 else
577   echo "creating cache $cache_file"
578   > $cache_file
579 fi
580
581 ac_ext=c
582 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
583 ac_cpp='$CPP $CPPFLAGS'
584 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
585 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
586 cross_compiling=$ac_cv_prog_cc_cross
587
588 ac_exeext=
589 ac_objext=o
590 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
591   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
592   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
593     ac_n= ac_c='
594 ' ac_t='        '
595   else
596     ac_n=-n ac_c= ac_t=
597   fi
598 else
599   ac_n= ac_c='\c' ac_t=
600 fi
601
602 ac_aux_dir=
603 for ac_dir in build $srcdir/build; do
604   if test -f $ac_dir/install-sh; then
605     ac_aux_dir=$ac_dir
606     ac_install_sh="$ac_aux_dir/install-sh -c"
607     break
608   elif test -f $ac_dir/install.sh; then
609     ac_aux_dir=$ac_dir
610     ac_install_sh="$ac_aux_dir/install.sh -c"
611     break
612   fi
613 done
614 if test -z "$ac_aux_dir"; then
615   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
616 fi
617 ac_config_guess=$ac_aux_dir/config.guess
618 ac_config_sub=$ac_aux_dir/config.sub
619 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
620 # Find a good install program.  We prefer a C program (faster),
621 # so one script is as good as another.  But avoid the broken or
622 # incompatible versions:
623 # SysV /etc/install, /usr/sbin/install
624 # SunOS /usr/etc/install
625 # IRIX /sbin/install
626 # AIX /bin/install
627 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
628 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
629 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
630 # ./install, which can be erroneously created by make from ./install.sh.
631 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
632 echo "configure:633: checking for a BSD compatible install" >&5
633 if test -z "$INSTALL"; then
634 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
635   echo $ac_n "(cached) $ac_c" 1>&6
636 else
637     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
638   for ac_dir in $PATH; do
639     # Account for people who put trailing slashes in PATH elements.
640     case "$ac_dir/" in
641     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
642     *)
643       # OSF1 and SCO ODT 3.0 have their own names for install.
644       # Don't use installbsd from OSF since it installs stuff as root
645       # by default.
646       for ac_prog in ginstall scoinst install; do
647         if test -f $ac_dir/$ac_prog; then
648           if test $ac_prog = install &&
649             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
650             # AIX install.  It has an incompatible calling convention.
651             :
652           else
653             ac_cv_path_install="$ac_dir/$ac_prog -c"
654             break 2
655           fi
656         fi
657       done
658       ;;
659     esac
660   done
661   IFS="$ac_save_IFS"
662
663 fi
664   if test "${ac_cv_path_install+set}" = set; then
665     INSTALL="$ac_cv_path_install"
666   else
667     # As a last resort, use the slow shell script.  We don't cache a
668     # path for INSTALL within a source directory, because that will
669     # break other packages using the cache if that directory is
670     # removed, or if the path is relative.
671     INSTALL="$ac_install_sh"
672   fi
673 fi
674 echo "$ac_t""$INSTALL" 1>&6
675
676 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
677 # It thinks the first close brace ends the variable substitution.
678 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
679
680 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
681
682 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
683
684 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
685 echo "configure:686: checking whether build environment is sane" >&5
686 # Just in case
687 sleep 1
688 echo timestamp > conftestfile
689 # Do `set' in a subshell so we don't clobber the current shell's
690 # arguments.  Must try -L first in case configure is actually a
691 # symlink; some systems play weird games with the mod time of symlinks
692 # (eg FreeBSD returns the mod time of the symlink's containing
693 # directory).
694 if (
695    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
696    if test "$*" = "X"; then
697       # -L didn't work.
698       set X `ls -t $srcdir/configure conftestfile`
699    fi
700    if test "$*" != "X $srcdir/configure conftestfile" \
701       && test "$*" != "X conftestfile $srcdir/configure"; then
702
703       # If neither matched, then we have a broken ls.  This can happen
704       # if, for instance, CONFIG_SHELL is bash and it inherits a
705       # broken ls alias from the environment.  This has actually
706       # happened.  Such a system could not be considered "sane".
707       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
708 alias in your environment" 1>&2; exit 1; }
709    fi
710
711    test "$2" = conftestfile
712    )
713 then
714    # Ok.
715    :
716 else
717    { echo "configure: error: newly created file is older than distributed files!
718 Check your system clock" 1>&2; exit 1; }
719 fi
720 rm -f conftest*
721 echo "$ac_t""yes" 1>&6
722 if test "$program_transform_name" = s,x,x,; then
723   program_transform_name=
724 else
725   # Double any \ or $.  echo might interpret backslashes.
726   cat <<\EOF_SED > conftestsed
727 s,\\,\\\\,g; s,\$,$$,g
728 EOF_SED
729   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
730   rm -f conftestsed
731 fi
732 test "$program_prefix" != NONE &&
733   program_transform_name="s,^,${program_prefix},; $program_transform_name"
734 # Use a double $ so make ignores it.
735 test "$program_suffix" != NONE &&
736   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
737
738 # sed with no file args requires a program.
739 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
740
741 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
742 echo "configure:743: checking whether ${MAKE-make} sets \${MAKE}" >&5
743 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
744 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
745   echo $ac_n "(cached) $ac_c" 1>&6
746 else
747   cat > conftestmake <<\EOF
748 all:
749         @echo 'ac_maketemp="${MAKE}"'
750 EOF
751 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
752 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
753 if test -n "$ac_maketemp"; then
754   eval ac_cv_prog_make_${ac_make}_set=yes
755 else
756   eval ac_cv_prog_make_${ac_make}_set=no
757 fi
758 rm -f conftestmake
759 fi
760 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
761   echo "$ac_t""yes" 1>&6
762   SET_MAKE=
763 else
764   echo "$ac_t""no" 1>&6
765   SET_MAKE="MAKE=${MAKE-make}"
766 fi
767
768
769 PACKAGE=OpenLDAP
770
771 VERSION=2.0-devel
772
773 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
774   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
775 fi
776
777
778
779 missing_dir=`cd $ac_aux_dir && pwd`
780 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
781 echo "configure:782: checking for working aclocal" >&5
782 # Run test in a subshell; some versions of sh will print an error if
783 # an executable is not found, even if stderr is redirected.
784 # Redirect stdin to placate older versions of autoconf.  Sigh.
785 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
786    ACLOCAL=aclocal
787    echo "$ac_t""found" 1>&6
788 else
789    ACLOCAL="$missing_dir/missing aclocal"
790    echo "$ac_t""missing" 1>&6
791 fi
792
793 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
794 echo "configure:795: checking for working autoconf" >&5
795 # Run test in a subshell; some versions of sh will print an error if
796 # an executable is not found, even if stderr is redirected.
797 # Redirect stdin to placate older versions of autoconf.  Sigh.
798 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
799    AUTOCONF=autoconf
800    echo "$ac_t""found" 1>&6
801 else
802    AUTOCONF="$missing_dir/missing autoconf"
803    echo "$ac_t""missing" 1>&6
804 fi
805
806 echo $ac_n "checking for working automake""... $ac_c" 1>&6
807 echo "configure:808: checking for working automake" >&5
808 # Run test in a subshell; some versions of sh will print an error if
809 # an executable is not found, even if stderr is redirected.
810 # Redirect stdin to placate older versions of autoconf.  Sigh.
811 if (automake --version) < /dev/null > /dev/null 2>&1; then
812    AUTOMAKE=automake
813    echo "$ac_t""found" 1>&6
814 else
815    AUTOMAKE="$missing_dir/missing automake"
816    echo "$ac_t""missing" 1>&6
817 fi
818
819 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
820 echo "configure:821: checking for working autoheader" >&5
821 # Run test in a subshell; some versions of sh will print an error if
822 # an executable is not found, even if stderr is redirected.
823 # Redirect stdin to placate older versions of autoconf.  Sigh.
824 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
825    AUTOHEADER=autoheader
826    echo "$ac_t""found" 1>&6
827 else
828    AUTOHEADER="$missing_dir/missing autoheader"
829    echo "$ac_t""missing" 1>&6
830 fi
831
832 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
833 echo "configure:834: checking for working makeinfo" >&5
834 # Run test in a subshell; some versions of sh will print an error if
835 # an executable is not found, even if stderr is redirected.
836 # Redirect stdin to placate older versions of autoconf.  Sigh.
837 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
838    MAKEINFO=makeinfo
839    echo "$ac_t""found" 1>&6
840 else
841    MAKEINFO="$missing_dir/missing makeinfo"
842    echo "$ac_t""missing" 1>&6
843 fi
844
845
846
847
848 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
849 echo "configure:850: checking configure arguments" >&5
850
851
852 top_builddir=`pwd`
853
854 ldap_subdir="openldap"
855
856 # Check whether --with-subdir or --without-subdir was given.
857 if test "${with_subdir+set}" = set; then
858   withval="$with_subdir"
859   
860         if test "$withval" = "no"; then
861                 ldap_subdir=""
862         elif test "$withval" != "yes"; then
863                 ldap_subdir="$withval"
864         fi
865
866 fi
867
868
869 # OpenLDAP --enable-debug
870         # Check whether --enable-debug or --disable-debug was given.
871 if test "${enable_debug+set}" = set; then
872   enableval="$enable_debug"
873   
874         ol_arg=invalid
875         for ol_val in auto yes no ; do
876                 if test "$enableval" = "$ol_val" ; then
877                         ol_arg="$ol_val"
878                 fi
879         done
880         if test "$ol_arg" = "invalid" ; then
881                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
882         fi
883         ol_enable_debug="$ol_arg"
884
885 else
886         ol_enable_debug="yes"
887 fi
888 # end --enable-debug
889 ol_enable_syslog=no
890 # OpenLDAP --enable-proctitle
891         # Check whether --enable-proctitle or --disable-proctitle was given.
892 if test "${enable_proctitle+set}" = set; then
893   enableval="$enable_proctitle"
894   
895         ol_arg=invalid
896         for ol_val in auto yes no ; do
897                 if test "$enableval" = "$ol_val" ; then
898                         ol_arg="$ol_val"
899                 fi
900         done
901         if test "$ol_arg" = "invalid" ; then
902                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
903         fi
904         ol_enable_proctitle="$ol_arg"
905
906 else
907         ol_enable_proctitle="yes"
908 fi
909 # end --enable-proctitle
910 # OpenLDAP --enable-cache
911         # Check whether --enable-cache or --disable-cache was given.
912 if test "${enable_cache+set}" = set; then
913   enableval="$enable_cache"
914   
915         ol_arg=invalid
916         for ol_val in auto yes no ; do
917                 if test "$enableval" = "$ol_val" ; then
918                         ol_arg="$ol_val"
919                 fi
920         done
921         if test "$ol_arg" = "invalid" ; then
922                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
923         fi
924         ol_enable_cache="$ol_arg"
925
926 else
927         ol_enable_cache="yes"
928 fi
929 # end --enable-cache
930 # OpenLDAP --enable-dns
931         # Check whether --enable-dns or --disable-dns was given.
932 if test "${enable_dns+set}" = set; then
933   enableval="$enable_dns"
934   
935         ol_arg=invalid
936         for ol_val in auto yes no ; do
937                 if test "$enableval" = "$ol_val" ; then
938                         ol_arg="$ol_val"
939                 fi
940         done
941         if test "$ol_arg" = "invalid" ; then
942                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
943         fi
944         ol_enable_dns="$ol_arg"
945
946 else
947         ol_enable_dns="no"
948 fi
949 # end --enable-dns
950 # OpenLDAP --enable-referrals
951         # Check whether --enable-referrals or --disable-referrals was given.
952 if test "${enable_referrals+set}" = set; then
953   enableval="$enable_referrals"
954   
955         ol_arg=invalid
956         for ol_val in auto yes no ; do
957                 if test "$enableval" = "$ol_val" ; then
958                         ol_arg="$ol_val"
959                 fi
960         done
961         if test "$ol_arg" = "invalid" ; then
962                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
963         fi
964         ol_enable_referrals="$ol_arg"
965
966 else
967         ol_enable_referrals="yes"
968 fi
969 # end --enable-referrals
970 # OpenLDAP --enable-cldap
971         # Check whether --enable-cldap or --disable-cldap was given.
972 if test "${enable_cldap+set}" = set; then
973   enableval="$enable_cldap"
974   
975         ol_arg=invalid
976         for ol_val in auto yes no ; do
977                 if test "$enableval" = "$ol_val" ; then
978                         ol_arg="$ol_val"
979                 fi
980         done
981         if test "$ol_arg" = "invalid" ; then
982                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
983         fi
984         ol_enable_cldap="$ol_arg"
985
986 else
987         ol_enable_cldap="no"
988 fi
989 # end --enable-cldap
990 # OpenLDAP --enable-x_compile
991         # Check whether --enable-x_compile or --disable-x_compile was given.
992 if test "${enable_x_compile+set}" = set; then
993   enableval="$enable_x_compile"
994   
995         ol_arg=invalid
996         for ol_val in yes no ; do
997                 if test "$enableval" = "$ol_val" ; then
998                         ol_arg="$ol_val"
999                 fi
1000         done
1001         if test "$ol_arg" = "invalid" ; then
1002                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1003         fi
1004         ol_enable_x_compile="$ol_arg"
1005
1006 else
1007         ol_enable_x_compile="no"
1008 fi
1009 # end --enable-x_compile
1010
1011 # OpenLDAP --enable-dmalloc
1012         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1013 if test "${enable_dmalloc+set}" = set; then
1014   enableval="$enable_dmalloc"
1015   
1016         ol_arg=invalid
1017         for ol_val in auto yes no ; do
1018                 if test "$enableval" = "$ol_val" ; then
1019                         ol_arg="$ol_val"
1020                 fi
1021         done
1022         if test "$ol_arg" = "invalid" ; then
1023                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1024         fi
1025         ol_enable_dmalloc="$ol_arg"
1026
1027 else
1028         ol_enable_dmalloc="no"
1029 fi
1030 # end --enable-dmalloc
1031
1032 # OpenLDAP --with-kerberos
1033         # Check whether --with-kerberos or --without-kerberos was given.
1034 if test "${with_kerberos+set}" = set; then
1035   withval="$with_kerberos"
1036   
1037         ol_arg=invalid
1038         for ol_val in auto k5 k4 afs yes no ; do
1039                 if test "$withval" = "$ol_val" ; then
1040                         ol_arg="$ol_val"
1041                 fi
1042         done
1043         if test "$ol_arg" = "invalid" ; then
1044                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1045         fi
1046         ol_with_kerberos="$ol_arg"
1047
1048 else
1049         ol_with_kerberos="auto"
1050 fi
1051 # end --with-kerberos
1052
1053 # OpenLDAP --with-threads
1054         # Check whether --with-threads or --without-threads was given.
1055 if test "${with_threads+set}" = set; then
1056   withval="$with_threads"
1057   
1058         ol_arg=invalid
1059         for ol_val in auto posix mach lwp yes no manual  ; do
1060                 if test "$withval" = "$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 $withval for --with-threads" 1>&2; exit 1; }
1066         fi
1067         ol_with_threads="$ol_arg"
1068
1069 else
1070         ol_with_threads="auto"
1071 fi
1072 # end --with-threads
1073
1074 # OpenLDAP --with-yielding_select
1075         # Check whether --with-yielding_select or --without-yielding_select was given.
1076 if test "${with_yielding_select+set}" = set; then
1077   withval="$with_yielding_select"
1078   
1079         ol_arg=invalid
1080         for ol_val in auto yes no manual  ; do
1081                 if test "$withval" = "$ol_val" ; then
1082                         ol_arg="$ol_val"
1083                 fi
1084         done
1085         if test "$ol_arg" = "invalid" ; then
1086                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1087         fi
1088         ol_with_yielding_select="$ol_arg"
1089
1090 else
1091         ol_with_yielding_select="auto"
1092 fi
1093 # end --with-yielding_select
1094
1095 # OpenLDAP --with-tls
1096         # Check whether --with-tls or --without-tls was given.
1097 if test "${with_tls+set}" = set; then
1098   withval="$with_tls"
1099   
1100         ol_arg=invalid
1101         for ol_val in auto ssleay openssl yes no  ; do
1102                 if test "$withval" = "$ol_val" ; then
1103                         ol_arg="$ol_val"
1104                 fi
1105         done
1106         if test "$ol_arg" = "invalid" ; then
1107                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1108         fi
1109         ol_with_tls="$ol_arg"
1110
1111 else
1112         ol_with_tls="auto"
1113 fi
1114 # end --with-tls
1115
1116
1117
1118 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1119 if test "${with_xxldapdoptions+set}" = set; then
1120   withval="$with_xxldapdoptions"
1121   :
1122 fi
1123
1124 # OpenLDAP --enable-ldapd
1125         # Check whether --enable-ldapd or --disable-ldapd was given.
1126 if test "${enable_ldapd+set}" = set; then
1127   enableval="$enable_ldapd"
1128   
1129         ol_arg=invalid
1130         for ol_val in auto yes no ; do
1131                 if test "$enableval" = "$ol_val" ; then
1132                         ol_arg="$ol_val"
1133                 fi
1134         done
1135         if test "$ol_arg" = "invalid" ; then
1136                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1137         fi
1138         ol_enable_ldapd="$ol_arg"
1139
1140 else
1141         ol_enable_ldapd="no"
1142 fi
1143 # end --enable-ldapd
1144
1145 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1146 if test "${with_xxslapdoptions+set}" = set; then
1147   withval="$with_xxslapdoptions"
1148   :
1149 fi
1150
1151 # OpenLDAP --enable-slapd
1152         # Check whether --enable-slapd or --disable-slapd was given.
1153 if test "${enable_slapd+set}" = set; then
1154   enableval="$enable_slapd"
1155   
1156         ol_arg=invalid
1157         for ol_val in auto yes no ; do
1158                 if test "$enableval" = "$ol_val" ; then
1159                         ol_arg="$ol_val"
1160                 fi
1161         done
1162         if test "$ol_arg" = "invalid" ; then
1163                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1164         fi
1165         ol_enable_slapd="$ol_arg"
1166
1167 else
1168         ol_enable_slapd="yes"
1169 fi
1170 # end --enable-slapd
1171 # OpenLDAP --enable-aclgroups
1172         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1173 if test "${enable_aclgroups+set}" = set; then
1174   enableval="$enable_aclgroups"
1175   
1176         ol_arg=invalid
1177         for ol_val in auto yes no ; do
1178                 if test "$enableval" = "$ol_val" ; then
1179                         ol_arg="$ol_val"
1180                 fi
1181         done
1182         if test "$ol_arg" = "invalid" ; then
1183                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1184         fi
1185         ol_enable_aclgroups="$ol_arg"
1186
1187 else
1188         ol_enable_aclgroups="auto"
1189 fi
1190 # end --enable-aclgroups
1191 # OpenLDAP --enable-cleartext
1192         # Check whether --enable-cleartext or --disable-cleartext was given.
1193 if test "${enable_cleartext+set}" = set; then
1194   enableval="$enable_cleartext"
1195   
1196         ol_arg=invalid
1197         for ol_val in auto yes no ; do
1198                 if test "$enableval" = "$ol_val" ; then
1199                         ol_arg="$ol_val"
1200                 fi
1201         done
1202         if test "$ol_arg" = "invalid" ; then
1203                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1204         fi
1205         ol_enable_cleartext="$ol_arg"
1206
1207 else
1208         ol_enable_cleartext="yes"
1209 fi
1210 # end --enable-cleartext
1211 # OpenLDAP --enable-crypt
1212         # Check whether --enable-crypt or --disable-crypt was given.
1213 if test "${enable_crypt+set}" = set; then
1214   enableval="$enable_crypt"
1215   
1216         ol_arg=invalid
1217         for ol_val in auto yes no ; do
1218                 if test "$enableval" = "$ol_val" ; then
1219                         ol_arg="$ol_val"
1220                 fi
1221         done
1222         if test "$ol_arg" = "invalid" ; then
1223                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1224         fi
1225         ol_enable_crypt="$ol_arg"
1226
1227 else
1228         ol_enable_crypt="auto"
1229 fi
1230 # end --enable-crypt
1231 # OpenLDAP --enable-wrappers
1232         # Check whether --enable-wrappers or --disable-wrappers was given.
1233 if test "${enable_wrappers+set}" = set; then
1234   enableval="$enable_wrappers"
1235   
1236         ol_arg=invalid
1237         for ol_val in auto yes no ; do
1238                 if test "$enableval" = "$ol_val" ; then
1239                         ol_arg="$ol_val"
1240                 fi
1241         done
1242         if test "$ol_arg" = "invalid" ; then
1243                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1244         fi
1245         ol_enable_wrappers="$ol_arg"
1246
1247 else
1248         ol_enable_wrappers="no"
1249 fi
1250 # end --enable-wrappers
1251 # OpenLDAP --enable-phonetic
1252         # Check whether --enable-phonetic or --disable-phonetic was given.
1253 if test "${enable_phonetic+set}" = set; then
1254   enableval="$enable_phonetic"
1255   
1256         ol_arg=invalid
1257         for ol_val in auto yes no ; do
1258                 if test "$enableval" = "$ol_val" ; then
1259                         ol_arg="$ol_val"
1260                 fi
1261         done
1262         if test "$ol_arg" = "invalid" ; then
1263                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1264         fi
1265         ol_enable_phonetic="$ol_arg"
1266
1267 else
1268         ol_enable_phonetic="no"
1269 fi
1270 # end --enable-phonetic
1271 # OpenLDAP --enable-rlookups
1272         # Check whether --enable-rlookups or --disable-rlookups was given.
1273 if test "${enable_rlookups+set}" = set; then
1274   enableval="$enable_rlookups"
1275   
1276         ol_arg=invalid
1277         for ol_val in auto yes no ; do
1278                 if test "$enableval" = "$ol_val" ; then
1279                         ol_arg="$ol_val"
1280                 fi
1281         done
1282         if test "$ol_arg" = "invalid" ; then
1283                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1284         fi
1285         ol_enable_rlookups="$ol_arg"
1286
1287 else
1288         ol_enable_rlookups="auto"
1289 fi
1290 # end --enable-rlookups
1291
1292 # OpenLDAP --enable-bdb2
1293         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1294 if test "${enable_bdb2+set}" = set; then
1295   enableval="$enable_bdb2"
1296   
1297         ol_arg=invalid
1298         for ol_val in auto yes no ; do
1299                 if test "$enableval" = "$ol_val" ; then
1300                         ol_arg="$ol_val"
1301                 fi
1302         done
1303         if test "$ol_arg" = "invalid" ; then
1304                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1305         fi
1306         ol_enable_bdb2="$ol_arg"
1307
1308 else
1309         ol_enable_bdb2="no"
1310 fi
1311 # end --enable-bdb2
1312 # OpenLDAP --enable-ldbm
1313         # Check whether --enable-ldbm or --disable-ldbm was given.
1314 if test "${enable_ldbm+set}" = set; then
1315   enableval="$enable_ldbm"
1316   
1317         ol_arg=invalid
1318         for ol_val in auto yes no ; do
1319                 if test "$enableval" = "$ol_val" ; then
1320                         ol_arg="$ol_val"
1321                 fi
1322         done
1323         if test "$ol_arg" = "invalid" ; then
1324                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1325         fi
1326         ol_enable_ldbm="$ol_arg"
1327
1328 else
1329         ol_enable_ldbm="yes"
1330 fi
1331 # end --enable-ldbm
1332 # OpenLDAP --with-ldbm_api
1333         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1334 if test "${with_ldbm_api+set}" = set; then
1335   withval="$with_ldbm_api"
1336   
1337         ol_arg=invalid
1338         for ol_val in auto db2 db gdbm ndbm manual ; do
1339                 if test "$withval" = "$ol_val" ; then
1340                         ol_arg="$ol_val"
1341                 fi
1342         done
1343         if test "$ol_arg" = "invalid" ; then
1344                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1345         fi
1346         ol_with_ldbm_api="$ol_arg"
1347
1348 else
1349         ol_with_ldbm_api="auto"
1350 fi
1351 # end --with-ldbm_api
1352
1353 # OpenLDAP --with-ldbm_type
1354         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1355 if test "${with_ldbm_type+set}" = set; then
1356   withval="$with_ldbm_type"
1357   
1358         ol_arg=invalid
1359         for ol_val in auto btree hash ; do
1360                 if test "$withval" = "$ol_val" ; then
1361                         ol_arg="$ol_val"
1362                 fi
1363         done
1364         if test "$ol_arg" = "invalid" ; then
1365                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1366         fi
1367         ol_with_ldbm_type="$ol_arg"
1368
1369 else
1370         ol_with_ldbm_type="auto"
1371 fi
1372 # end --with-ldbm_type
1373
1374
1375 # OpenLDAP --enable-passwd
1376         # Check whether --enable-passwd or --disable-passwd was given.
1377 if test "${enable_passwd+set}" = set; then
1378   enableval="$enable_passwd"
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-passwd" 1>&2; exit 1; }
1388         fi
1389         ol_enable_passwd="$ol_arg"
1390
1391 else
1392         ol_enable_passwd="no"
1393 fi
1394 # end --enable-passwd
1395 # OpenLDAP --enable-perl
1396         # Check whether --enable-perl or --disable-perl was given.
1397 if test "${enable_perl+set}" = set; then
1398   enableval="$enable_perl"
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-perl" 1>&2; exit 1; }
1408         fi
1409         ol_enable_perl="$ol_arg"
1410
1411 else
1412         ol_enable_perl="no"
1413 fi
1414 # end --enable-perl
1415 # OpenLDAP --enable-shell
1416         # Check whether --enable-shell or --disable-shell was given.
1417 if test "${enable_shell+set}" = set; then
1418   enableval="$enable_shell"
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-shell" 1>&2; exit 1; }
1428         fi
1429         ol_enable_shell="$ol_arg"
1430
1431 else
1432         ol_enable_shell="no"
1433 fi
1434 # end --enable-shell
1435 # OpenLDAP --enable-tcl
1436         # Check whether --enable-tcl or --disable-tcl was given.
1437 if test "${enable_tcl+set}" = set; then
1438   enableval="$enable_tcl"
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-tcl" 1>&2; exit 1; }
1448         fi
1449         ol_enable_tcl="$ol_arg"
1450
1451 else
1452         ol_enable_tcl="no"
1453 fi
1454 # end --enable-tcl
1455
1456 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1457 if test "${with_xxslurpdoptions+set}" = set; then
1458   withval="$with_xxslurpdoptions"
1459   :
1460 fi
1461
1462 # OpenLDAP --enable-slurpd
1463         # Check whether --enable-slurpd or --disable-slurpd was given.
1464 if test "${enable_slurpd+set}" = set; then
1465   enableval="$enable_slurpd"
1466   
1467         ol_arg=invalid
1468         for ol_val in auto yes no ; do
1469                 if test "$enableval" = "$ol_val" ; then
1470                         ol_arg="$ol_val"
1471                 fi
1472         done
1473         if test "$ol_arg" = "invalid" ; then
1474                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1475         fi
1476         ol_enable_slurpd="$ol_arg"
1477
1478 else
1479         ol_enable_slurpd="auto"
1480 fi
1481 # end --enable-slurpd
1482
1483 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1484 if test "${with_xxliboptions+set}" = set; then
1485   withval="$with_xxliboptions"
1486   :
1487 fi
1488
1489 # Check whether --enable-static or --disable-static was given.
1490 if test "${enable_static+set}" = set; then
1491   enableval="$enable_static"
1492   p=${PACKAGE-default}
1493 case "$enableval" in
1494 yes) enable_static=yes ;;
1495 no) enable_static=no ;;
1496 *)
1497   enable_static=no
1498   # Look at the argument we got.  We use all the common list separators.
1499   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1500   for pkg in $enableval; do
1501     if test "X$pkg" = "X$p"; then
1502       enable_static=yes
1503     fi
1504   done
1505   IFS="$ac_save_ifs"
1506   ;;
1507 esac
1508 else
1509   enable_static=yes
1510 fi
1511
1512 # Check whether --enable-shared or --disable-shared was given.
1513 if test "${enable_shared+set}" = set; then
1514   enableval="$enable_shared"
1515   p=${PACKAGE-default}
1516 case "$enableval" in
1517 yes) enable_shared=yes ;;
1518 no) enable_shared=no ;;
1519 *)
1520   enable_shared=no
1521   # Look at the argument we got.  We use all the common list separators.
1522   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1523   for pkg in $enableval; do
1524     if test "X$pkg" = "X$p"; then
1525       enable_shared=yes
1526     fi
1527   done
1528   IFS="$ac_save_ifs"
1529   ;;
1530 esac
1531 else
1532   enable_shared=yes
1533 fi
1534
1535
1536 # validate options
1537 if test $ol_enable_dns = yes ; then
1538         if test $ol_enable_referrals = no ; then
1539                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1540         fi
1541         if test $ol_enable_referrals = auto ; then
1542                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1543                 ol_enable_referrals=yes
1544         fi
1545 fi
1546
1547 if test $ol_enable_slapd = no ; then
1548                 if test $ol_enable_bdb2 = yes ; then
1549                 echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
1550         fi
1551         if test $ol_enable_ldbm = yes ; then
1552                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1553         fi
1554         if test $ol_enable_passwd = yes ; then
1555                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1556         fi
1557         if test $ol_enable_perl = yes ; then
1558                 echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
1559         fi
1560         if test $ol_enable_shell = yes ; then
1561                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1562         fi
1563         if test $ol_enable_tcl = yes ; then
1564                 echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
1565         fi
1566         if test $ol_enable_aclgroups = yes ; then
1567                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1568         fi
1569         if test $ol_enable_wrappers = yes ; then
1570                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1571         fi
1572         if test $ol_enable_phonetic = yes ; then
1573                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1574         fi
1575         if test $ol_enable_rlookups = yes ; then
1576                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1577         fi
1578         if test $ol_with_ldbm_api != auto ; then
1579                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1580         fi
1581         if test $ol_with_ldbm_type != auto ; then
1582                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1583         fi
1584         if test $ol_enable_slurpd = yes ; then
1585                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1586         fi
1587
1588         # force settings to no
1589         ol_enable_bdb2=no
1590         ol_enable_ldbm=no
1591         ol_enable_passwd=no
1592         ol_enable_perl=no
1593         ol_enable_shell=no
1594         ol_enable_tcl=no
1595         ol_enable_aclgroups=no
1596         ol_enable_wrappers=no
1597         ol_enable_phonetic=no
1598         ol_enable_rlookups=no
1599         ol_with_ldbm_api=no
1600         ol_with_ldbm_type=no
1601         ol_enable_slurpd=no
1602
1603 elif test $ol_enable_ldbm = no ; then
1604         
1605         if test $ol_with_ldbm_api != auto ; then
1606                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1607         fi
1608
1609         if test $ol_with_ldbm_type != auto ; then
1610                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1611         fi
1612
1613         if test $ol_enable_bdb2 = yes ; then
1614                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1615         fi
1616
1617         if test $ol_enable_passwd = no -a \
1618                 $ol_enable_perl = no -a \
1619                 $ol_enable_shell = no -a \
1620                 $ol_enable_tcl = no ; then
1621                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1622         fi
1623
1624         ol_with_ldbm_api=no
1625         ol_with_ldbm_type=no
1626
1627 elif test $ol_enable_bdb2 = yes ; then
1628         
1629         if test $ol_with_ldbm_api != auto -a \
1630                 $ol_with_ldbm_api != db2 ; then
1631                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1632         fi
1633
1634         ol_with_ldbm_api=db2
1635
1636 else
1637         
1638         if test $ol_enable_bdb2 != no ; then
1639                 if test $ol_with_ldbm_api != auto -a \
1640                         $ol_with_ldbm_api != db2 ; then
1641                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1642                         ol_enable_bdb2=no
1643                 fi
1644         fi
1645
1646         if test $ol_with_ldbm_api = gdbm -a \
1647                 $ol_with_ldbm_type = btree ; then
1648                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1649         fi
1650         if test $ol_with_ldbm_api = ndbm -a \
1651                 $ol_with_ldbm_type = btree ; then
1652                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1653         fi
1654 fi
1655
1656 if test $ol_enable_slurpd = yes ; then
1657                 if test $ol_with_threads = no ; then
1658                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1659         fi
1660 fi
1661
1662 echo "$ac_t""done" 1>&6
1663
1664
1665 # Make sure we can run config.sub.
1666 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1667 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1668 fi
1669
1670 echo $ac_n "checking host system type""... $ac_c" 1>&6
1671 echo "configure:1672: checking host system type" >&5
1672
1673 host_alias=$host
1674 case "$host_alias" in
1675 NONE)
1676   case $nonopt in
1677   NONE)
1678     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1679     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1680     fi ;;
1681   *) host_alias=$nonopt ;;
1682   esac ;;
1683 esac
1684
1685 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1686 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1687 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1688 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1689 echo "$ac_t""$host" 1>&6
1690
1691
1692 ## Initialize vars
1693 LDAP_LIBS=
1694 LDBM_LIBS=
1695 LTHREAD_LIBS=
1696 LUTIL_LIBS=
1697
1698 LDAPD_LIBS=
1699 SLAPD_LIBS=
1700 SLURPD_LIBS=
1701
1702 BUILD_LDAPD=no
1703 BUILD_SLAPD=no
1704 BUILD_SLURPD=no
1705
1706 BUILD_BDB2=no
1707 BUILD_LDBM=no
1708 BUILD_PASSWD=no
1709 BUILD_PERL=no
1710 BUILD_SHELL=no
1711 BUILD_TCL=no
1712 BUILD_THREAD=no
1713
1714 SLAPD_PERL_LDFLAGS=
1715 SLAPD_PERL_CPPFLAGS=
1716
1717 KRB_LIBS=
1718 TERMCAP_LIBS=
1719 TLS_LIBS=
1720
1721
1722 # Find a good install program.  We prefer a C program (faster),
1723 # so one script is as good as another.  But avoid the broken or
1724 # incompatible versions:
1725 # SysV /etc/install, /usr/sbin/install
1726 # SunOS /usr/etc/install
1727 # IRIX /sbin/install
1728 # AIX /bin/install
1729 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1730 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1731 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1732 # ./install, which can be erroneously created by make from ./install.sh.
1733 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1734 echo "configure:1735: checking for a BSD compatible install" >&5
1735 if test -z "$INSTALL"; then
1736 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1737   echo $ac_n "(cached) $ac_c" 1>&6
1738 else
1739     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1740   for ac_dir in $PATH; do
1741     # Account for people who put trailing slashes in PATH elements.
1742     case "$ac_dir/" in
1743     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1744     *)
1745       # OSF1 and SCO ODT 3.0 have their own names for install.
1746       # Don't use installbsd from OSF since it installs stuff as root
1747       # by default.
1748       for ac_prog in ginstall scoinst install; do
1749         if test -f $ac_dir/$ac_prog; then
1750           if test $ac_prog = install &&
1751             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1752             # AIX install.  It has an incompatible calling convention.
1753             :
1754           else
1755             ac_cv_path_install="$ac_dir/$ac_prog -c"
1756             break 2
1757           fi
1758         fi
1759       done
1760       ;;
1761     esac
1762   done
1763   IFS="$ac_save_IFS"
1764
1765 fi
1766   if test "${ac_cv_path_install+set}" = set; then
1767     INSTALL="$ac_cv_path_install"
1768   else
1769     # As a last resort, use the slow shell script.  We don't cache a
1770     # path for INSTALL within a source directory, because that will
1771     # break other packages using the cache if that directory is
1772     # removed, or if the path is relative.
1773     INSTALL="$ac_install_sh"
1774   fi
1775 fi
1776 echo "$ac_t""$INSTALL" 1>&6
1777
1778 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1779 # It thinks the first close brace ends the variable substitution.
1780 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1781
1782 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1783
1784 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1785
1786
1787 CC=${CC-"cc"}
1788 CFLAGS=${CFLAGS-""}
1789
1790 # Extract the first word of "ranlib", so it can be a program name with args.
1791 set dummy ranlib; ac_word=$2
1792 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1793 echo "configure:1794: checking for $ac_word" >&5
1794 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1795   echo $ac_n "(cached) $ac_c" 1>&6
1796 else
1797   if test -n "$RANLIB"; then
1798   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1799 else
1800   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1801   ac_dummy="$PATH"
1802   for ac_dir in $ac_dummy; do
1803     test -z "$ac_dir" && ac_dir=.
1804     if test -f $ac_dir/$ac_word; then
1805       ac_cv_prog_RANLIB="ranlib"
1806       break
1807     fi
1808   done
1809   IFS="$ac_save_ifs"
1810   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1811 fi
1812 fi
1813 RANLIB="$ac_cv_prog_RANLIB"
1814 if test -n "$RANLIB"; then
1815   echo "$ac_t""$RANLIB" 1>&6
1816 else
1817   echo "$ac_t""no" 1>&6
1818 fi
1819
1820 # Extract the first word of "gcc", so it can be a program name with args.
1821 set dummy gcc; ac_word=$2
1822 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1823 echo "configure:1824: checking for $ac_word" >&5
1824 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1825   echo $ac_n "(cached) $ac_c" 1>&6
1826 else
1827   if test -n "$CC"; then
1828   ac_cv_prog_CC="$CC" # Let the user override the test.
1829 else
1830   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1831   ac_dummy="$PATH"
1832   for ac_dir in $ac_dummy; do
1833     test -z "$ac_dir" && ac_dir=.
1834     if test -f $ac_dir/$ac_word; then
1835       ac_cv_prog_CC="gcc"
1836       break
1837     fi
1838   done
1839   IFS="$ac_save_ifs"
1840 fi
1841 fi
1842 CC="$ac_cv_prog_CC"
1843 if test -n "$CC"; then
1844   echo "$ac_t""$CC" 1>&6
1845 else
1846   echo "$ac_t""no" 1>&6
1847 fi
1848
1849 if test -z "$CC"; then
1850   # Extract the first word of "cc", so it can be a program name with args.
1851 set dummy cc; ac_word=$2
1852 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1853 echo "configure:1854: checking for $ac_word" >&5
1854 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1855   echo $ac_n "(cached) $ac_c" 1>&6
1856 else
1857   if test -n "$CC"; then
1858   ac_cv_prog_CC="$CC" # Let the user override the test.
1859 else
1860   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1861   ac_prog_rejected=no
1862   ac_dummy="$PATH"
1863   for ac_dir in $ac_dummy; do
1864     test -z "$ac_dir" && ac_dir=.
1865     if test -f $ac_dir/$ac_word; then
1866       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1867         ac_prog_rejected=yes
1868         continue
1869       fi
1870       ac_cv_prog_CC="cc"
1871       break
1872     fi
1873   done
1874   IFS="$ac_save_ifs"
1875 if test $ac_prog_rejected = yes; then
1876   # We found a bogon in the path, so make sure we never use it.
1877   set dummy $ac_cv_prog_CC
1878   shift
1879   if test $# -gt 0; then
1880     # We chose a different compiler from the bogus one.
1881     # However, it has the same basename, so the bogon will be chosen
1882     # first if we set CC to just the basename; use the full file name.
1883     shift
1884     set dummy "$ac_dir/$ac_word" "$@"
1885     shift
1886     ac_cv_prog_CC="$@"
1887   fi
1888 fi
1889 fi
1890 fi
1891 CC="$ac_cv_prog_CC"
1892 if test -n "$CC"; then
1893   echo "$ac_t""$CC" 1>&6
1894 else
1895   echo "$ac_t""no" 1>&6
1896 fi
1897
1898   if test -z "$CC"; then
1899     case "`uname -s`" in
1900     *win32* | *WIN32*)
1901       # Extract the first word of "cl", so it can be a program name with args.
1902 set dummy cl; ac_word=$2
1903 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1904 echo "configure:1905: checking for $ac_word" >&5
1905 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1906   echo $ac_n "(cached) $ac_c" 1>&6
1907 else
1908   if test -n "$CC"; then
1909   ac_cv_prog_CC="$CC" # Let the user override the test.
1910 else
1911   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1912   ac_dummy="$PATH"
1913   for ac_dir in $ac_dummy; do
1914     test -z "$ac_dir" && ac_dir=.
1915     if test -f $ac_dir/$ac_word; then
1916       ac_cv_prog_CC="cl"
1917       break
1918     fi
1919   done
1920   IFS="$ac_save_ifs"
1921 fi
1922 fi
1923 CC="$ac_cv_prog_CC"
1924 if test -n "$CC"; then
1925   echo "$ac_t""$CC" 1>&6
1926 else
1927   echo "$ac_t""no" 1>&6
1928 fi
1929  ;;
1930     esac
1931   fi
1932   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
1933 fi
1934
1935 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
1936 echo "configure:1937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
1937
1938 ac_ext=c
1939 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1940 ac_cpp='$CPP $CPPFLAGS'
1941 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1942 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1943 cross_compiling=$ac_cv_prog_cc_cross
1944
1945 cat > conftest.$ac_ext << EOF
1946
1947 #line 1948 "configure"
1948 #include "confdefs.h"
1949
1950 main(){return(0);}
1951 EOF
1952 if { (eval echo configure:1953: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
1953   ac_cv_prog_cc_works=yes
1954   # If we can't run a trivial program, we are probably using a cross compiler.
1955   if (./conftest; exit) 2>/dev/null; then
1956     ac_cv_prog_cc_cross=no
1957   else
1958     ac_cv_prog_cc_cross=yes
1959   fi
1960 else
1961   echo "configure: failed program was:" >&5
1962   cat conftest.$ac_ext >&5
1963   ac_cv_prog_cc_works=no
1964 fi
1965 rm -fr conftest*
1966 ac_ext=c
1967 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
1968 ac_cpp='$CPP $CPPFLAGS'
1969 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
1970 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
1971 cross_compiling=$ac_cv_prog_cc_cross
1972
1973 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
1974 if test $ac_cv_prog_cc_works = no; then
1975   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
1976 fi
1977 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
1978 echo "configure:1979: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
1979 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
1980 cross_compiling=$ac_cv_prog_cc_cross
1981
1982 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
1983 echo "configure:1984: checking whether we are using GNU C" >&5
1984 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
1985   echo $ac_n "(cached) $ac_c" 1>&6
1986 else
1987   cat > conftest.c <<EOF
1988 #ifdef __GNUC__
1989   yes;
1990 #endif
1991 EOF
1992 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
1993   ac_cv_prog_gcc=yes
1994 else
1995   ac_cv_prog_gcc=no
1996 fi
1997 fi
1998
1999 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2000
2001 if test $ac_cv_prog_gcc = yes; then
2002   GCC=yes
2003 else
2004   GCC=
2005 fi
2006
2007 ac_test_CFLAGS="${CFLAGS+set}"
2008 ac_save_CFLAGS="$CFLAGS"
2009 CFLAGS=
2010 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2011 echo "configure:2012: checking whether ${CC-cc} accepts -g" >&5
2012 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2013   echo $ac_n "(cached) $ac_c" 1>&6
2014 else
2015   echo 'void f(){}' > conftest.c
2016 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2017   ac_cv_prog_cc_g=yes
2018 else
2019   ac_cv_prog_cc_g=no
2020 fi
2021 rm -f conftest*
2022
2023 fi
2024
2025 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2026 if test "$ac_test_CFLAGS" = set; then
2027   CFLAGS="$ac_save_CFLAGS"
2028 elif test $ac_cv_prog_cc_g = yes; then
2029   if test "$GCC" = yes; then
2030     CFLAGS="-g -O2"
2031   else
2032     CFLAGS="-g"
2033   fi
2034 else
2035   if test "$GCC" = yes; then
2036     CFLAGS="-O2"
2037   else
2038     CFLAGS=
2039   fi
2040 fi
2041
2042 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2043 if test "${with_gnu_ld+set}" = set; then
2044   withval="$with_gnu_ld"
2045   test "$withval" = no || with_gnu_ld=yes
2046 else
2047   with_gnu_ld=no
2048 fi
2049
2050
2051 ac_prog=ld
2052 if test "$ac_cv_prog_gcc" = yes; then
2053   # Check if gcc -print-prog-name=ld gives a path.
2054   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2055 echo "configure:2056: checking for ld used by GCC" >&5
2056   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2057   case "$ac_prog" in
2058   # Accept absolute paths.
2059   /* | A-Za-z:\\*)
2060     test -z "$LD" && LD="$ac_prog"
2061     ;;
2062   "")
2063     # If it fails, then pretend we aren't using GCC.
2064     ac_prog=ld
2065     ;;
2066   *)
2067     # If it is relative, then search for the first ld in PATH.
2068     with_gnu_ld=unknown
2069     ;;
2070   esac
2071 elif test "$with_gnu_ld" = yes; then
2072   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2073 echo "configure:2074: checking for GNU ld" >&5
2074 else
2075   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2076 echo "configure:2077: checking for non-GNU ld" >&5
2077 fi
2078 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2079   echo $ac_n "(cached) $ac_c" 1>&6
2080 else
2081   if test -z "$LD"; then
2082   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2083   for ac_dir in $PATH; do
2084     test -z "$ac_dir" && ac_dir=.
2085     if test -f "$ac_dir/$ac_prog"; then
2086       ac_cv_path_LD="$ac_dir/$ac_prog"
2087       # Check to see if the program is GNU ld.  I'd rather use --version,
2088       # but apparently some GNU ld's only accept -v.
2089       # Break only if it was the GNU/non-GNU ld that we prefer.
2090       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2091         test "$with_gnu_ld" != no && break
2092       else
2093         test "$with_gnu_ld" != yes && break
2094       fi
2095     fi
2096   done
2097   IFS="$ac_save_ifs"
2098 else
2099   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2100 fi
2101 fi
2102
2103 LD="$ac_cv_path_LD"
2104 if test -n "$LD"; then
2105   echo "$ac_t""$LD" 1>&6
2106 else
2107   echo "$ac_t""no" 1>&6
2108 fi
2109 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2110
2111 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2112 echo "configure:2113: checking if the linker ($LD) is GNU ld" >&5
2113 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2114   echo $ac_n "(cached) $ac_c" 1>&6
2115 else
2116   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2117 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2118   ac_cv_prog_gnu_ld=yes
2119 else
2120   ac_cv_prog_gnu_ld=no
2121 fi
2122 fi
2123
2124 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2125
2126
2127 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2128 echo "configure:2129: checking for BSD-compatible nm" >&5
2129 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2130   echo $ac_n "(cached) $ac_c" 1>&6
2131 else
2132   case "$NM" in
2133 /* | A-Za-z:\\*)
2134   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2135   ;;
2136 *)
2137   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2138   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2139     test -z "$ac_dir" && ac_dir=.
2140     if test -f $ac_dir/nm; then
2141       # Check to see if the nm accepts a BSD-compat flag.
2142       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2143       #   nm: unknown option "B" ignored
2144       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2145         ac_cv_path_NM="$ac_dir/nm -B"
2146       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2147         ac_cv_path_NM="$ac_dir/nm -p"
2148       else
2149         ac_cv_path_NM="$ac_dir/nm"
2150       fi
2151       break
2152     fi
2153   done
2154   IFS="$ac_save_ifs"
2155   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2156   ;;
2157 esac
2158 fi
2159
2160 NM="$ac_cv_path_NM"
2161 echo "$ac_t""$NM" 1>&6
2162
2163
2164 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2165 echo "configure:2166: checking whether ln -s works" >&5
2166 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2167   echo $ac_n "(cached) $ac_c" 1>&6
2168 else
2169   rm -f conftestdata
2170 if ln -s X conftestdata 2>/dev/null
2171 then
2172   rm -f conftestdata
2173   ac_cv_prog_LN_S="ln -s"
2174 else
2175   ac_cv_prog_LN_S=ln
2176 fi
2177 fi
2178 LN_S="$ac_cv_prog_LN_S"
2179 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2180   echo "$ac_t""yes" 1>&6
2181 else
2182   echo "$ac_t""no" 1>&6
2183 fi
2184
2185 # Always use our own libtool.
2186 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2187
2188 # Check for any special flags to pass to ltconfig.
2189 libtool_flags=
2190 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2191 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2192 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2193 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2194 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2195
2196 # Some flags need to be propagated to the compiler or linker for good
2197 # libtool support.
2198 case "$host" in
2199 *-*-irix6*)
2200   # Find out which ABI we are using.
2201   echo '#line 2202 "configure"' > conftest.$ac_ext
2202   if { (eval echo configure:2203: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2203     case "`/usr/bin/file conftest.o`" in
2204     *32-bit*)
2205       LD="${LD-ld} -32"
2206       ;;
2207     *N32*)
2208       LD="${LD-ld} -n32"
2209       ;;
2210     *64-bit*)
2211       LD="${LD-ld} -64"
2212       ;;
2213     esac
2214   fi
2215   rm -rf conftest*
2216   ;;
2217
2218 *-*-sco3.2v5*)
2219   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2220   CFLAGS="$CFLAGS -belf"
2221   ;;
2222 esac
2223
2224 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2225 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2226 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2227 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2228 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2229 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2230
2231
2232 for ac_prog in mawk gawk nawk awk
2233 do
2234 # Extract the first word of "$ac_prog", so it can be a program name with args.
2235 set dummy $ac_prog; ac_word=$2
2236 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2237 echo "configure:2238: checking for $ac_word" >&5
2238 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2239   echo $ac_n "(cached) $ac_c" 1>&6
2240 else
2241   if test -n "$AWK"; then
2242   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2243 else
2244   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2245   ac_dummy="$PATH"
2246   for ac_dir in $ac_dummy; do
2247     test -z "$ac_dir" && ac_dir=.
2248     if test -f $ac_dir/$ac_word; then
2249       ac_cv_prog_AWK="$ac_prog"
2250       break
2251     fi
2252   done
2253   IFS="$ac_save_ifs"
2254 fi
2255 fi
2256 AWK="$ac_cv_prog_AWK"
2257 if test -n "$AWK"; then
2258   echo "$ac_t""$AWK" 1>&6
2259 else
2260   echo "$ac_t""no" 1>&6
2261 fi
2262
2263 test -n "$AWK" && break
2264 done
2265
2266 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2267 echo "configure:2268: checking whether ln -s works" >&5
2268 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2269   echo $ac_n "(cached) $ac_c" 1>&6
2270 else
2271   rm -f conftestdata
2272 if ln -s X conftestdata 2>/dev/null
2273 then
2274   rm -f conftestdata
2275   ac_cv_prog_LN_S="ln -s"
2276 else
2277   ac_cv_prog_LN_S=ln
2278 fi
2279 fi
2280 LN_S="$ac_cv_prog_LN_S"
2281 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2282   echo "$ac_t""yes" 1>&6
2283 else
2284   echo "$ac_t""no" 1>&6
2285 fi
2286
2287
2288 # Extract the first word of "sendmail", so it can be a program name with args.
2289 set dummy sendmail; ac_word=$2
2290 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2291 echo "configure:2292: checking for $ac_word" >&5
2292 if eval "test \"`echo '$''{'ac_cv_path_SENDMAIL'+set}'`\" = set"; then
2293   echo $ac_n "(cached) $ac_c" 1>&6
2294 else
2295   case "$SENDMAIL" in
2296   /*)
2297   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2298   ;;
2299   ?:/*)                  
2300   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2301   ;;
2302   *)
2303   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2304   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
2305   for ac_dir in $ac_dummy; do 
2306     test -z "$ac_dir" && ac_dir=.
2307     if test -f $ac_dir/$ac_word; then
2308       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
2309       break
2310     fi
2311   done
2312   IFS="$ac_save_ifs"
2313   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2314   ;;
2315 esac
2316 fi
2317 SENDMAIL="$ac_cv_path_SENDMAIL"
2318 if test -n "$SENDMAIL"; then
2319   echo "$ac_t""$SENDMAIL" 1>&6
2320 else
2321   echo "$ac_t""no" 1>&6
2322 fi
2323
2324 # Extract the first word of "vi", so it can be a program name with args.
2325 set dummy vi; ac_word=$2
2326 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2327 echo "configure:2328: checking for $ac_word" >&5
2328 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2329   echo $ac_n "(cached) $ac_c" 1>&6
2330 else
2331   case "$EDITOR" in
2332   /*)
2333   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2334   ;;
2335   ?:/*)                  
2336   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2337   ;;
2338   *)
2339   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2340   ac_dummy="$PATH:/usr/ucb"
2341   for ac_dir in $ac_dummy; do 
2342     test -z "$ac_dir" && ac_dir=.
2343     if test -f $ac_dir/$ac_word; then
2344       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2345       break
2346     fi
2347   done
2348   IFS="$ac_save_ifs"
2349   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2350   ;;
2351 esac
2352 fi
2353 EDITOR="$ac_cv_path_EDITOR"
2354 if test -n "$EDITOR"; then
2355   echo "$ac_t""$EDITOR" 1>&6
2356 else
2357   echo "$ac_t""no" 1>&6
2358 fi
2359
2360 # Extract the first word of "finger", so it can be a program name with args.
2361 set dummy finger; ac_word=$2
2362 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2363 echo "configure:2364: checking for $ac_word" >&5
2364 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2365   echo $ac_n "(cached) $ac_c" 1>&6
2366 else
2367   case "$FINGER" in
2368   /*)
2369   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2370   ;;
2371   ?:/*)                  
2372   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2373   ;;
2374   *)
2375   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2376   ac_dummy="$PATH:/usr/ucb"
2377   for ac_dir in $ac_dummy; do 
2378     test -z "$ac_dir" && ac_dir=.
2379     if test -f $ac_dir/$ac_word; then
2380       ac_cv_path_FINGER="$ac_dir/$ac_word"
2381       break
2382     fi
2383   done
2384   IFS="$ac_save_ifs"
2385   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2386   ;;
2387 esac
2388 fi
2389 FINGER="$ac_cv_path_FINGER"
2390 if test -n "$FINGER"; then
2391   echo "$ac_t""$FINGER" 1>&6
2392 else
2393   echo "$ac_t""no" 1>&6
2394 fi
2395
2396
2397 if test $ol_enable_perl = yes ; then
2398         # Extract the first word of "perl", so it can be a program name with args.
2399 set dummy perl; ac_word=$2
2400 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2401 echo "configure:2402: checking for $ac_word" >&5
2402 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2403   echo $ac_n "(cached) $ac_c" 1>&6
2404 else
2405   case "$PERLBIN" in
2406   /*)
2407   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2408   ;;
2409   ?:/*)                  
2410   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2411   ;;
2412   *)
2413   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2414   ac_dummy="$PATH"
2415   for ac_dir in $ac_dummy; do 
2416     test -z "$ac_dir" && ac_dir=.
2417     if test -f $ac_dir/$ac_word; then
2418       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2419       break
2420     fi
2421   done
2422   IFS="$ac_save_ifs"
2423   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2424   ;;
2425 esac
2426 fi
2427 PERLBIN="$ac_cv_path_PERLBIN"
2428 if test -n "$PERLBIN"; then
2429   echo "$ac_t""$PERLBIN" 1>&6
2430 else
2431   echo "$ac_t""no" 1>&6
2432 fi
2433
2434
2435         if test "no$PERLBIN" = "no" ; then
2436                 ol_enable_perl=no
2437         fi
2438
2439         SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2440         SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e perl_inc`"
2441 fi
2442
2443 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2444 echo "configure:2445: checking how to run the C preprocessor" >&5
2445 # On Suns, sometimes $CPP names a directory.
2446 if test -n "$CPP" && test -d "$CPP"; then
2447   CPP=
2448 fi
2449 if test -z "$CPP"; then
2450 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2451   echo $ac_n "(cached) $ac_c" 1>&6
2452 else
2453     # This must be in double quotes, not single quotes, because CPP may get
2454   # substituted into the Makefile and "${CC-cc}" will confuse make.
2455   CPP="${CC-cc} -E"
2456   # On the NeXT, cc -E runs the code through the compiler's parser,
2457   # not just through cpp.
2458   cat > conftest.$ac_ext <<EOF
2459 #line 2460 "configure"
2460 #include "confdefs.h"
2461 #include <assert.h>
2462 Syntax Error
2463 EOF
2464 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2465 { (eval echo configure:2466: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2466 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2467 if test -z "$ac_err"; then
2468   :
2469 else
2470   echo "$ac_err" >&5
2471   echo "configure: failed program was:" >&5
2472   cat conftest.$ac_ext >&5
2473   rm -rf conftest*
2474   CPP="${CC-cc} -E -traditional-cpp"
2475   cat > conftest.$ac_ext <<EOF
2476 #line 2477 "configure"
2477 #include "confdefs.h"
2478 #include <assert.h>
2479 Syntax Error
2480 EOF
2481 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2482 { (eval echo configure:2483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2483 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2484 if test -z "$ac_err"; then
2485   :
2486 else
2487   echo "$ac_err" >&5
2488   echo "configure: failed program was:" >&5
2489   cat conftest.$ac_ext >&5
2490   rm -rf conftest*
2491   CPP="${CC-cc} -nologo -E"
2492   cat > conftest.$ac_ext <<EOF
2493 #line 2494 "configure"
2494 #include "confdefs.h"
2495 #include <assert.h>
2496 Syntax Error
2497 EOF
2498 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2499 { (eval echo configure:2500: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2500 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2501 if test -z "$ac_err"; then
2502   :
2503 else
2504   echo "$ac_err" >&5
2505   echo "configure: failed program was:" >&5
2506   cat conftest.$ac_ext >&5
2507   rm -rf conftest*
2508   CPP=/lib/cpp
2509 fi
2510 rm -f conftest*
2511 fi
2512 rm -f conftest*
2513 fi
2514 rm -f conftest*
2515   ac_cv_prog_CPP="$CPP"
2516 fi
2517   CPP="$ac_cv_prog_CPP"
2518 else
2519   ac_cv_prog_CPP="$CPP"
2520 fi
2521 echo "$ac_t""$CPP" 1>&6
2522
2523
2524 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2525         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2526
2527 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2528         echo "configure: warning: programs compiled here do run here..." 1>&2
2529         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2530
2531 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2532         echo "configure: warning: programs compiled here do not run here..." 1>&2
2533         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2534 fi
2535
2536 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2537 echo "configure:2538: checking for AIX" >&5
2538 cat > conftest.$ac_ext <<EOF
2539 #line 2540 "configure"
2540 #include "confdefs.h"
2541 #ifdef _AIX
2542   yes
2543 #endif
2544
2545 EOF
2546 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2547   egrep "yes" >/dev/null 2>&1; then
2548   rm -rf conftest*
2549   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2550 #define _ALL_SOURCE 1
2551 EOF
2552
2553 else
2554   rm -rf conftest*
2555   echo "$ac_t""no" 1>&6
2556 fi
2557 rm -f conftest*
2558
2559
2560 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2561 echo "configure:2562: checking for POSIXized ISC" >&5
2562 if test -d /etc/conf/kconfig.d &&
2563   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2564 then
2565   echo "$ac_t""yes" 1>&6
2566   ISC=yes # If later tests want to check for ISC.
2567   cat >> confdefs.h <<\EOF
2568 #define _POSIX_SOURCE 1
2569 EOF
2570
2571   if test "$GCC" = yes; then
2572     CC="$CC -posix"
2573   else
2574     CC="$CC -Xp"
2575   fi
2576 else
2577   echo "$ac_t""no" 1>&6
2578   ISC=
2579 fi
2580
2581 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2582 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2583 echo "configure:2584: checking for minix/config.h" >&5
2584 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2585   echo $ac_n "(cached) $ac_c" 1>&6
2586 else
2587   cat > conftest.$ac_ext <<EOF
2588 #line 2589 "configure"
2589 #include "confdefs.h"
2590 #include <minix/config.h>
2591 EOF
2592 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2593 { (eval echo configure:2594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2594 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2595 if test -z "$ac_err"; then
2596   rm -rf conftest*
2597   eval "ac_cv_header_$ac_safe=yes"
2598 else
2599   echo "$ac_err" >&5
2600   echo "configure: failed program was:" >&5
2601   cat conftest.$ac_ext >&5
2602   rm -rf conftest*
2603   eval "ac_cv_header_$ac_safe=no"
2604 fi
2605 rm -f conftest*
2606 fi
2607 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2608   echo "$ac_t""yes" 1>&6
2609   MINIX=yes
2610 else
2611   echo "$ac_t""no" 1>&6
2612 MINIX=
2613 fi
2614
2615 if test "$MINIX" = yes; then
2616   cat >> confdefs.h <<\EOF
2617 #define _POSIX_SOURCE 1
2618 EOF
2619
2620   cat >> confdefs.h <<\EOF
2621 #define _POSIX_1_SOURCE 2
2622 EOF
2623
2624   cat >> confdefs.h <<\EOF
2625 #define _MINIX 1
2626 EOF
2627
2628 fi
2629
2630
2631 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2632 echo "configure:2633: checking for Cygwin environment" >&5
2633 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2634   echo $ac_n "(cached) $ac_c" 1>&6
2635 else
2636   cat > conftest.$ac_ext <<EOF
2637 #line 2638 "configure"
2638 #include "confdefs.h"
2639
2640 int main() {
2641
2642 #ifndef __CYGWIN__
2643 #define __CYGWIN__ __CYGWIN32__
2644 #endif
2645 return __CYGWIN__;
2646 ; return 0; }
2647 EOF
2648 if { (eval echo configure:2649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2649   rm -rf conftest*
2650   ac_cv_cygwin=yes
2651 else
2652   echo "configure: failed program was:" >&5
2653   cat conftest.$ac_ext >&5
2654   rm -rf conftest*
2655   ac_cv_cygwin=no
2656 fi
2657 rm -f conftest*
2658 rm -f conftest*
2659 fi
2660
2661 echo "$ac_t""$ac_cv_cygwin" 1>&6
2662 CYGWIN=
2663 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2664 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2665 echo "configure:2666: checking for mingw32 environment" >&5
2666 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2667   echo $ac_n "(cached) $ac_c" 1>&6
2668 else
2669   cat > conftest.$ac_ext <<EOF
2670 #line 2671 "configure"
2671 #include "confdefs.h"
2672
2673 int main() {
2674 return __MINGW32__;
2675 ; return 0; }
2676 EOF
2677 if { (eval echo configure:2678: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2678   rm -rf conftest*
2679   ac_cv_mingw32=yes
2680 else
2681   echo "configure: failed program was:" >&5
2682   cat conftest.$ac_ext >&5
2683   rm -rf conftest*
2684   ac_cv_mingw32=no
2685 fi
2686 rm -f conftest*
2687 rm -f conftest*
2688 fi
2689
2690 echo "$ac_t""$ac_cv_mingw32" 1>&6
2691 MINGW32=
2692 test "$ac_cv_mingw32" = yes && MINGW32=yes
2693
2694
2695 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2696 echo "configure:2697: checking for executable suffix" >&5
2697 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2698   echo $ac_n "(cached) $ac_c" 1>&6
2699 else
2700   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2701   ac_cv_exeext=.exe
2702 else
2703   rm -f conftest*
2704   echo 'int main () { return 0; }' > conftest.$ac_ext
2705   ac_cv_exeext=
2706   if { (eval echo configure:2707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2707     for file in conftest.*; do
2708       case $file in
2709       *.c | *.o | *.obj) ;;
2710       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2711       esac
2712     done
2713   else
2714     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2715   fi
2716   rm -f conftest*
2717   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2718 fi
2719 fi
2720
2721 EXEEXT=""
2722 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2723 echo "$ac_t""${ac_cv_exeext}" 1>&6
2724 ac_exeext=$EXEEXT
2725
2726 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2727 echo "configure:2728: checking for object suffix" >&5
2728 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2729   echo $ac_n "(cached) $ac_c" 1>&6
2730 else
2731   rm -f conftest*
2732 echo 'int i = 1;' > conftest.$ac_ext
2733 if { (eval echo configure:2734: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2734   for ac_file in conftest.*; do
2735     case $ac_file in
2736     *.c) ;;
2737     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2738     esac
2739   done
2740 else
2741   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2742 fi
2743 rm -f conftest*
2744 fi
2745
2746 echo "$ac_t""$ac_cv_objext" 1>&6
2747 OBJEXT=$ac_cv_objext
2748 ac_objext=$ac_cv_objext
2749
2750
2751
2752
2753
2754 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2755 echo "configure:2756: checking for ${CC-cc} option to accept ANSI C" >&5
2756 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2757   echo $ac_n "(cached) $ac_c" 1>&6
2758 else
2759   am_cv_prog_cc_stdc=no
2760 ac_save_CC="$CC"
2761 # Don't try gcc -ansi; that turns off useful extensions and
2762 # breaks some systems' header files.
2763 # AIX                   -qlanglvl=ansi
2764 # Ultrix and OSF/1      -std1
2765 # HP-UX                 -Aa -D_HPUX_SOURCE
2766 # SVR4                  -Xc -D__EXTENSIONS__
2767 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2768 do
2769   CC="$ac_save_CC $ac_arg"
2770   cat > conftest.$ac_ext <<EOF
2771 #line 2772 "configure"
2772 #include "confdefs.h"
2773 #include <stdarg.h>
2774 #include <stdio.h>
2775 #include <sys/types.h>
2776 #include <sys/stat.h>
2777 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2778 struct buf { int x; };
2779 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2780 static char *e (p, i)
2781      char **p;
2782      int i;
2783 {
2784   return p[i];
2785 }
2786 static char *f (char * (*g) (char **, int), char **p, ...)
2787 {
2788   char *s;
2789   va_list v;
2790   va_start (v,p);
2791   s = g (p, va_arg (v,int));
2792   va_end (v);
2793   return s;
2794 }
2795 int test (int i, double x);
2796 struct s1 {int (*f) (int a);};
2797 struct s2 {int (*f) (double a);};
2798 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2799 int argc;
2800 char **argv;
2801
2802 int main() {
2803
2804 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2805
2806 ; return 0; }
2807 EOF
2808 if { (eval echo configure:2809: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2809   rm -rf conftest*
2810   am_cv_prog_cc_stdc="$ac_arg"; break
2811 else
2812   echo "configure: failed program was:" >&5
2813   cat conftest.$ac_ext >&5
2814 fi
2815 rm -f conftest*
2816 done
2817 CC="$ac_save_CC"
2818
2819 fi
2820
2821 if test -z "$am_cv_prog_cc_stdc"; then
2822   echo "$ac_t""none needed" 1>&6
2823 else
2824   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
2825 fi
2826 case "x$am_cv_prog_cc_stdc" in
2827   x|xno) ;;
2828   *) CC="$CC $am_cv_prog_cc_stdc" ;;
2829 esac
2830
2831 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
2832         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
2833 fi
2834
2835
2836
2837
2838 echo $ac_n "checking for socket""... $ac_c" 1>&6
2839 echo "configure:2840: checking for socket" >&5
2840 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
2841   echo $ac_n "(cached) $ac_c" 1>&6
2842 else
2843   cat > conftest.$ac_ext <<EOF
2844 #line 2845 "configure"
2845 #include "confdefs.h"
2846 /* System header to define __stub macros and hopefully few prototypes,
2847     which can conflict with char socket(); below.  */
2848 #include <assert.h>
2849 /* Override any gcc2 internal prototype to avoid an error.  */
2850 /* We use char because int might match the return type of a gcc2
2851     builtin and then its argument prototype would still apply.  */
2852 char socket();
2853
2854 int main() {
2855
2856 /* The GNU C library defines this for functions which it implements
2857     to always fail with ENOSYS.  Some functions are actually named
2858     something starting with __ and the normal name is an alias.  */
2859 #if defined (__stub_socket) || defined (__stub___socket)
2860 choke me
2861 #else
2862 socket();
2863 #endif
2864
2865 ; return 0; }
2866 EOF
2867 if { (eval echo configure:2868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2868   rm -rf conftest*
2869   eval "ac_cv_func_socket=yes"
2870 else
2871   echo "configure: failed program was:" >&5
2872   cat conftest.$ac_ext >&5
2873   rm -rf conftest*
2874   eval "ac_cv_func_socket=no"
2875 fi
2876 rm -f conftest*
2877 fi
2878
2879 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
2880   echo "$ac_t""yes" 1>&6
2881   have_socket=yes
2882 else
2883   echo "$ac_t""no" 1>&6
2884         
2885         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
2886 echo "configure:2887: checking for main in -lsocket" >&5
2887 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
2888 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2889   echo $ac_n "(cached) $ac_c" 1>&6
2890 else
2891   ac_save_LIBS="$LIBS"
2892 LIBS="-lsocket  $LIBS"
2893 cat > conftest.$ac_ext <<EOF
2894 #line 2895 "configure"
2895 #include "confdefs.h"
2896
2897 int main() {
2898 main()
2899 ; return 0; }
2900 EOF
2901 if { (eval echo configure:2902: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2902   rm -rf conftest*
2903   eval "ac_cv_lib_$ac_lib_var=yes"
2904 else
2905   echo "configure: failed program was:" >&5
2906   cat conftest.$ac_ext >&5
2907   rm -rf conftest*
2908   eval "ac_cv_lib_$ac_lib_var=no"
2909 fi
2910 rm -f conftest*
2911 LIBS="$ac_save_LIBS"
2912
2913 fi
2914 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2915   echo "$ac_t""yes" 1>&6
2916     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2917     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2918   cat >> confdefs.h <<EOF
2919 #define $ac_tr_lib 1
2920 EOF
2921
2922   LIBS="-lsocket $LIBS"
2923
2924 else
2925   echo "$ac_t""no" 1>&6
2926 fi
2927
2928         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
2929 echo "configure:2930: checking for main in -lnet" >&5
2930 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
2931 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2932   echo $ac_n "(cached) $ac_c" 1>&6
2933 else
2934   ac_save_LIBS="$LIBS"
2935 LIBS="-lnet  $LIBS"
2936 cat > conftest.$ac_ext <<EOF
2937 #line 2938 "configure"
2938 #include "confdefs.h"
2939
2940 int main() {
2941 main()
2942 ; return 0; }
2943 EOF
2944 if { (eval echo configure:2945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2945   rm -rf conftest*
2946   eval "ac_cv_lib_$ac_lib_var=yes"
2947 else
2948   echo "configure: failed program was:" >&5
2949   cat conftest.$ac_ext >&5
2950   rm -rf conftest*
2951   eval "ac_cv_lib_$ac_lib_var=no"
2952 fi
2953 rm -f conftest*
2954 LIBS="$ac_save_LIBS"
2955
2956 fi
2957 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2958   echo "$ac_t""yes" 1>&6
2959     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
2960     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
2961   cat >> confdefs.h <<EOF
2962 #define $ac_tr_lib 1
2963 EOF
2964
2965   LIBS="-lnet $LIBS"
2966
2967 else
2968   echo "$ac_t""no" 1>&6
2969 fi
2970
2971         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
2972 echo "configure:2973: checking for main in -lnsl_s" >&5
2973 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
2974 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2975   echo $ac_n "(cached) $ac_c" 1>&6
2976 else
2977   ac_save_LIBS="$LIBS"
2978 LIBS="-lnsl_s  $LIBS"
2979 cat > conftest.$ac_ext <<EOF
2980 #line 2981 "configure"
2981 #include "confdefs.h"
2982
2983 int main() {
2984 main()
2985 ; return 0; }
2986 EOF
2987 if { (eval echo configure:2988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2988   rm -rf conftest*
2989   eval "ac_cv_lib_$ac_lib_var=yes"
2990 else
2991   echo "configure: failed program was:" >&5
2992   cat conftest.$ac_ext >&5
2993   rm -rf conftest*
2994   eval "ac_cv_lib_$ac_lib_var=no"
2995 fi
2996 rm -f conftest*
2997 LIBS="$ac_save_LIBS"
2998
2999 fi
3000 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3001   echo "$ac_t""yes" 1>&6
3002     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3003     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3004   cat >> confdefs.h <<EOF
3005 #define $ac_tr_lib 1
3006 EOF
3007
3008   LIBS="-lnsl_s $LIBS"
3009
3010 else
3011   echo "$ac_t""no" 1>&6
3012 fi
3013
3014         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3015 echo "configure:3016: checking for main in -lnsl" >&5
3016 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3017 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3018   echo $ac_n "(cached) $ac_c" 1>&6
3019 else
3020   ac_save_LIBS="$LIBS"
3021 LIBS="-lnsl  $LIBS"
3022 cat > conftest.$ac_ext <<EOF
3023 #line 3024 "configure"
3024 #include "confdefs.h"
3025
3026 int main() {
3027 main()
3028 ; return 0; }
3029 EOF
3030 if { (eval echo configure:3031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3031   rm -rf conftest*
3032   eval "ac_cv_lib_$ac_lib_var=yes"
3033 else
3034   echo "configure: failed program was:" >&5
3035   cat conftest.$ac_ext >&5
3036   rm -rf conftest*
3037   eval "ac_cv_lib_$ac_lib_var=no"
3038 fi
3039 rm -f conftest*
3040 LIBS="$ac_save_LIBS"
3041
3042 fi
3043 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3044   echo "$ac_t""yes" 1>&6
3045     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3046     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3047   cat >> confdefs.h <<EOF
3048 #define $ac_tr_lib 1
3049 EOF
3050
3051   LIBS="-lnsl $LIBS"
3052
3053 else
3054   echo "$ac_t""no" 1>&6
3055 fi
3056
3057         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3058 echo "configure:3059: checking for socket in -linet" >&5
3059 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3060 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3061   echo $ac_n "(cached) $ac_c" 1>&6
3062 else
3063   ac_save_LIBS="$LIBS"
3064 LIBS="-linet  $LIBS"
3065 cat > conftest.$ac_ext <<EOF
3066 #line 3067 "configure"
3067 #include "confdefs.h"
3068 /* Override any gcc2 internal prototype to avoid an error.  */
3069 /* We use char because int might match the return type of a gcc2
3070     builtin and then its argument prototype would still apply.  */
3071 char socket();
3072
3073 int main() {
3074 socket()
3075 ; return 0; }
3076 EOF
3077 if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3078   rm -rf conftest*
3079   eval "ac_cv_lib_$ac_lib_var=yes"
3080 else
3081   echo "configure: failed program was:" >&5
3082   cat conftest.$ac_ext >&5
3083   rm -rf conftest*
3084   eval "ac_cv_lib_$ac_lib_var=no"
3085 fi
3086 rm -f conftest*
3087 LIBS="$ac_save_LIBS"
3088
3089 fi
3090 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3091   echo "$ac_t""yes" 1>&6
3092     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3093     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3094   cat >> confdefs.h <<EOF
3095 #define $ac_tr_lib 1
3096 EOF
3097
3098   LIBS="-linet $LIBS"
3099
3100 else
3101   echo "$ac_t""no" 1>&6
3102 fi
3103
3104         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3105 echo "configure:3106: checking for main in -lgen" >&5
3106 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3107 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3108   echo $ac_n "(cached) $ac_c" 1>&6
3109 else
3110   ac_save_LIBS="$LIBS"
3111 LIBS="-lgen  $LIBS"
3112 cat > conftest.$ac_ext <<EOF
3113 #line 3114 "configure"
3114 #include "confdefs.h"
3115
3116 int main() {
3117 main()
3118 ; return 0; }
3119 EOF
3120 if { (eval echo configure:3121: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3121   rm -rf conftest*
3122   eval "ac_cv_lib_$ac_lib_var=yes"
3123 else
3124   echo "configure: failed program was:" >&5
3125   cat conftest.$ac_ext >&5
3126   rm -rf conftest*
3127   eval "ac_cv_lib_$ac_lib_var=no"
3128 fi
3129 rm -f conftest*
3130 LIBS="$ac_save_LIBS"
3131
3132 fi
3133 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3134   echo "$ac_t""yes" 1>&6
3135     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3136     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3137   cat >> confdefs.h <<EOF
3138 #define $ac_tr_lib 1
3139 EOF
3140
3141   LIBS="-lgen $LIBS"
3142
3143 else
3144   echo "$ac_t""no" 1>&6
3145 fi
3146
3147
3148 fi
3149
3150
3151 for ac_func in res_search
3152 do
3153 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3154 echo "configure:3155: checking for $ac_func" >&5
3155 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3156   echo $ac_n "(cached) $ac_c" 1>&6
3157 else
3158   cat > conftest.$ac_ext <<EOF
3159 #line 3160 "configure"
3160 #include "confdefs.h"
3161 /* System header to define __stub macros and hopefully few prototypes,
3162     which can conflict with char $ac_func(); below.  */
3163 #include <assert.h>
3164 /* Override any gcc2 internal prototype to avoid an error.  */
3165 /* We use char because int might match the return type of a gcc2
3166     builtin and then its argument prototype would still apply.  */
3167 char $ac_func();
3168
3169 int main() {
3170
3171 /* The GNU C library defines this for functions which it implements
3172     to always fail with ENOSYS.  Some functions are actually named
3173     something starting with __ and the normal name is an alias.  */
3174 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3175 choke me
3176 #else
3177 $ac_func();
3178 #endif
3179
3180 ; return 0; }
3181 EOF
3182 if { (eval echo configure:3183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3183   rm -rf conftest*
3184   eval "ac_cv_func_$ac_func=yes"
3185 else
3186   echo "configure: failed program was:" >&5
3187   cat conftest.$ac_ext >&5
3188   rm -rf conftest*
3189   eval "ac_cv_func_$ac_func=no"
3190 fi
3191 rm -f conftest*
3192 fi
3193
3194 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3195   echo "$ac_t""yes" 1>&6
3196     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3197   cat >> confdefs.h <<EOF
3198 #define $ac_tr_func 1
3199 EOF
3200  
3201 else
3202   echo "$ac_t""no" 1>&6
3203 fi
3204 done
3205
3206 if test $ac_cv_func_res_search = "no" ; then 
3207         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3208 echo "configure:3209: checking for res_search in -lbind" >&5
3209 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3210 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3211   echo $ac_n "(cached) $ac_c" 1>&6
3212 else
3213   ac_save_LIBS="$LIBS"
3214 LIBS="-lbind  $LIBS"
3215 cat > conftest.$ac_ext <<EOF
3216 #line 3217 "configure"
3217 #include "confdefs.h"
3218 /* Override any gcc2 internal prototype to avoid an error.  */
3219 /* We use char because int might match the return type of a gcc2
3220     builtin and then its argument prototype would still apply.  */
3221 char res_search();
3222
3223 int main() {
3224 res_search()
3225 ; return 0; }
3226 EOF
3227 if { (eval echo configure:3228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3228   rm -rf conftest*
3229   eval "ac_cv_lib_$ac_lib_var=yes"
3230 else
3231   echo "configure: failed program was:" >&5
3232   cat conftest.$ac_ext >&5
3233   rm -rf conftest*
3234   eval "ac_cv_lib_$ac_lib_var=no"
3235 fi
3236 rm -f conftest*
3237 LIBS="$ac_save_LIBS"
3238
3239 fi
3240 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3241   echo "$ac_t""yes" 1>&6
3242     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3243     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3244   cat >> confdefs.h <<EOF
3245 #define $ac_tr_lib 1
3246 EOF
3247
3248   LIBS="-lbind $LIBS"
3249
3250 else
3251   echo "$ac_t""no" 1>&6
3252 fi
3253
3254         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3255                 cat >> confdefs.h <<\EOF
3256 #define HAVE_RES_SEARCH 1
3257 EOF
3258
3259         else
3260                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3261 echo "configure:3262: checking for res_search in -lresolv" >&5
3262 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3263 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3264   echo $ac_n "(cached) $ac_c" 1>&6
3265 else
3266   ac_save_LIBS="$LIBS"
3267 LIBS="-lresolv  $LIBS"
3268 cat > conftest.$ac_ext <<EOF
3269 #line 3270 "configure"
3270 #include "confdefs.h"
3271 /* Override any gcc2 internal prototype to avoid an error.  */
3272 /* We use char because int might match the return type of a gcc2
3273     builtin and then its argument prototype would still apply.  */
3274 char res_search();
3275
3276 int main() {
3277 res_search()
3278 ; return 0; }
3279 EOF
3280 if { (eval echo configure:3281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3281   rm -rf conftest*
3282   eval "ac_cv_lib_$ac_lib_var=yes"
3283 else
3284   echo "configure: failed program was:" >&5
3285   cat conftest.$ac_ext >&5
3286   rm -rf conftest*
3287   eval "ac_cv_lib_$ac_lib_var=no"
3288 fi
3289 rm -f conftest*
3290 LIBS="$ac_save_LIBS"
3291
3292 fi
3293 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3294   echo "$ac_t""yes" 1>&6
3295     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3296     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3297   cat >> confdefs.h <<EOF
3298 #define $ac_tr_lib 1
3299 EOF
3300
3301   LIBS="-lresolv $LIBS"
3302
3303 else
3304   echo "$ac_t""no" 1>&6
3305 fi
3306
3307                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3308                         cat >> confdefs.h <<\EOF
3309 #define HAVE_RES_SEARCH 1
3310 EOF
3311
3312                 fi
3313         fi
3314 fi
3315
3316 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3317 echo "configure:3318: checking for sigset in -lV3" >&5
3318 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3319 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3320   echo $ac_n "(cached) $ac_c" 1>&6
3321 else
3322   ac_save_LIBS="$LIBS"
3323 LIBS="-lV3  $LIBS"
3324 cat > conftest.$ac_ext <<EOF
3325 #line 3326 "configure"
3326 #include "confdefs.h"
3327 /* Override any gcc2 internal prototype to avoid an error.  */
3328 /* We use char because int might match the return type of a gcc2
3329     builtin and then its argument prototype would still apply.  */
3330 char sigset();
3331
3332 int main() {
3333 sigset()
3334 ; return 0; }
3335 EOF
3336 if { (eval echo configure:3337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3337   rm -rf conftest*
3338   eval "ac_cv_lib_$ac_lib_var=yes"
3339 else
3340   echo "configure: failed program was:" >&5
3341   cat conftest.$ac_ext >&5
3342   rm -rf conftest*
3343   eval "ac_cv_lib_$ac_lib_var=no"
3344 fi
3345 rm -f conftest*
3346 LIBS="$ac_save_LIBS"
3347
3348 fi
3349 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3350   echo "$ac_t""yes" 1>&6
3351     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3352     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3353   cat >> confdefs.h <<EOF
3354 #define $ac_tr_lib 1
3355 EOF
3356
3357   LIBS="-lV3 $LIBS"
3358
3359 else
3360   echo "$ac_t""no" 1>&6
3361 fi
3362
3363
3364 # ISODE tests
3365 ol_link_isode=no
3366 if test $ol_enable_ldapd != no ; then
3367                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3368 echo "configure:3369: checking for main in -lxtpp" >&5
3369 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3370 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3371   echo $ac_n "(cached) $ac_c" 1>&6
3372 else
3373   ac_save_LIBS="$LIBS"
3374 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3375 cat > conftest.$ac_ext <<EOF
3376 #line 3377 "configure"
3377 #include "confdefs.h"
3378
3379 int main() {
3380 main()
3381 ; return 0; }
3382 EOF
3383 if { (eval echo configure:3384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3384   rm -rf conftest*
3385   eval "ac_cv_lib_$ac_lib_var=yes"
3386 else
3387   echo "configure: failed program was:" >&5
3388   cat conftest.$ac_ext >&5
3389   rm -rf conftest*
3390   eval "ac_cv_lib_$ac_lib_var=no"
3391 fi
3392 rm -f conftest*
3393 LIBS="$ac_save_LIBS"
3394
3395 fi
3396 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3397   echo "$ac_t""yes" 1>&6
3398   
3399                 ol_link_isode=yes
3400                 cat >> confdefs.h <<\EOF
3401 #define HAVE_XTPP 1
3402 EOF
3403
3404                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3405                 
3406 else
3407   echo "$ac_t""no" 1>&6
3408 :
3409 fi
3410
3411         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3412 echo "configure:3413: checking for main in -ldsap" >&5
3413 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3414 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3415   echo $ac_n "(cached) $ac_c" 1>&6
3416 else
3417   ac_save_LIBS="$LIBS"
3418 LIBS="-ldsap -lisode $LIBS"
3419 cat > conftest.$ac_ext <<EOF
3420 #line 3421 "configure"
3421 #include "confdefs.h"
3422
3423 int main() {
3424 main()
3425 ; return 0; }
3426 EOF
3427 if { (eval echo configure:3428: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3428   rm -rf conftest*
3429   eval "ac_cv_lib_$ac_lib_var=yes"
3430 else
3431   echo "configure: failed program was:" >&5
3432   cat conftest.$ac_ext >&5
3433   rm -rf conftest*
3434   eval "ac_cv_lib_$ac_lib_var=no"
3435 fi
3436 rm -f conftest*
3437 LIBS="$ac_save_LIBS"
3438
3439 fi
3440 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3441   echo "$ac_t""yes" 1>&6
3442   
3443                 ol_link_isode=yes
3444                 cat >> confdefs.h <<\EOF
3445 #define HAVE_DSAP 1
3446 EOF
3447
3448                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3449                 
3450 else
3451   echo "$ac_t""no" 1>&6
3452 :
3453 fi
3454
3455         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3456 echo "configure:3457: checking for main in -lisode" >&5
3457 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
3458 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3459   echo $ac_n "(cached) $ac_c" 1>&6
3460 else
3461   ac_save_LIBS="$LIBS"
3462 LIBS="-lisode  $LIBS"
3463 cat > conftest.$ac_ext <<EOF
3464 #line 3465 "configure"
3465 #include "confdefs.h"
3466
3467 int main() {
3468 main()
3469 ; return 0; }
3470 EOF
3471 if { (eval echo configure:3472: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3472   rm -rf conftest*
3473   eval "ac_cv_lib_$ac_lib_var=yes"
3474 else
3475   echo "configure: failed program was:" >&5
3476   cat conftest.$ac_ext >&5
3477   rm -rf conftest*
3478   eval "ac_cv_lib_$ac_lib_var=no"
3479 fi
3480 rm -f conftest*
3481 LIBS="$ac_save_LIBS"
3482
3483 fi
3484 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3485   echo "$ac_t""yes" 1>&6
3486   
3487                 ol_link_isode=yes
3488                 cat >> confdefs.h <<\EOF
3489 #define HAVE_ISODE 1
3490 EOF
3491
3492                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3493                 
3494 else
3495   echo "$ac_t""no" 1>&6
3496 :
3497 fi
3498
3499 fi
3500
3501 if test $ol_link_isode != no; then
3502         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3503 echo "configure:3504: checking for main in -lpp" >&5
3504 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3505 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3506   echo $ac_n "(cached) $ac_c" 1>&6
3507 else
3508   ac_save_LIBS="$LIBS"
3509 LIBS="-lpp  $LIBS"
3510 cat > conftest.$ac_ext <<EOF
3511 #line 3512 "configure"
3512 #include "confdefs.h"
3513
3514 int main() {
3515 main()
3516 ; return 0; }
3517 EOF
3518 if { (eval echo configure:3519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3519   rm -rf conftest*
3520   eval "ac_cv_lib_$ac_lib_var=yes"
3521 else
3522   echo "configure: failed program was:" >&5
3523   cat conftest.$ac_ext >&5
3524   rm -rf conftest*
3525   eval "ac_cv_lib_$ac_lib_var=no"
3526 fi
3527 rm -f conftest*
3528 LIBS="$ac_save_LIBS"
3529
3530 fi
3531 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3532   echo "$ac_t""yes" 1>&6
3533   
3534                 cat >> confdefs.h <<\EOF
3535 #define HAVE_PP 1
3536 EOF
3537
3538                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3539                 
3540 else
3541   echo "$ac_t""no" 1>&6
3542 :
3543 fi
3544
3545
3546         # Extract the first word of "pepsy", so it can be a program name with args.
3547 set dummy pepsy; ac_word=$2
3548 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3549 echo "configure:3550: checking for $ac_word" >&5
3550 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3551   echo $ac_n "(cached) $ac_c" 1>&6
3552 else
3553   case "$PEPSY" in
3554   /*)
3555   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3556   ;;
3557   ?:/*)                  
3558   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3559   ;;
3560   *)
3561   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3562   ac_dummy="$PATH"
3563   for ac_dir in $ac_dummy; do 
3564     test -z "$ac_dir" && ac_dir=.
3565     if test -f $ac_dir/$ac_word; then
3566       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3567       break
3568     fi
3569   done
3570   IFS="$ac_save_ifs"
3571   ;;
3572 esac
3573 fi
3574 PEPSY="$ac_cv_path_PEPSY"
3575 if test -n "$PEPSY"; then
3576   echo "$ac_t""$PEPSY" 1>&6
3577 else
3578   echo "$ac_t""no" 1>&6
3579 fi
3580
3581 fi
3582
3583 ol_link_kerberos=no
3584
3585 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3586         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3587 do
3588 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3589 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3590 echo "configure:3591: checking for $ac_hdr" >&5
3591 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3592   echo $ac_n "(cached) $ac_c" 1>&6
3593 else
3594   cat > conftest.$ac_ext <<EOF
3595 #line 3596 "configure"
3596 #include "confdefs.h"
3597 #include <$ac_hdr>
3598 EOF
3599 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3600 { (eval echo configure:3601: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3601 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3602 if test -z "$ac_err"; then
3603   rm -rf conftest*
3604   eval "ac_cv_header_$ac_safe=yes"
3605 else
3606   echo "$ac_err" >&5
3607   echo "configure: failed program was:" >&5
3608   cat conftest.$ac_ext >&5
3609   rm -rf conftest*
3610   eval "ac_cv_header_$ac_safe=no"
3611 fi
3612 rm -f conftest*
3613 fi
3614 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3615   echo "$ac_t""yes" 1>&6
3616     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3617   cat >> confdefs.h <<EOF
3618 #define $ac_tr_hdr 1
3619 EOF
3620  
3621 else
3622   echo "$ac_t""no" 1>&6
3623 fi
3624 done
3625
3626
3627         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
3628                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
3629 echo "configure:3630: checking for main in -lkrb4" >&5
3630 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
3631 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3632   echo $ac_n "(cached) $ac_c" 1>&6
3633 else
3634   ac_save_LIBS="$LIBS"
3635 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
3636 cat > conftest.$ac_ext <<EOF
3637 #line 3638 "configure"
3638 #include "confdefs.h"
3639
3640 int main() {
3641 main()
3642 ; return 0; }
3643 EOF
3644 if { (eval echo configure:3645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3645   rm -rf conftest*
3646   eval "ac_cv_lib_$ac_lib_var=yes"
3647 else
3648   echo "configure: failed program was:" >&5
3649   cat conftest.$ac_ext >&5
3650   rm -rf conftest*
3651   eval "ac_cv_lib_$ac_lib_var=no"
3652 fi
3653 rm -f conftest*
3654 LIBS="$ac_save_LIBS"
3655
3656 fi
3657 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3658   echo "$ac_t""yes" 1>&6
3659   have_k5=yes
3660 else
3661   echo "$ac_t""no" 1>&6
3662 have_k5=no
3663 fi
3664
3665
3666                 if test $have_k5 = yes ; then
3667                         ol_with_kerberos=found
3668                         ol_link_kerberos=yes
3669
3670                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
3671
3672                         LIBS="$KRB_LIBS $LIBS"
3673
3674                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
3675 echo "configure:3676: checking for des_debug in Kerberos libraries" >&5
3676 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679   
3680                                                                 save_LIBS="$LIBS"
3681                                 LIBS="$KRB_LIBS $LIBS"
3682                                 cat > conftest.$ac_ext <<EOF
3683 #line 3684 "configure"
3684 #include "confdefs.h"
3685
3686 #include <kerberosIV/krb.h>
3687 #include <kerberosIV/des.h>
3688 extern int des_debug;
3689
3690 int main() {
3691
3692 des_debug = 1;
3693
3694 ; return 0; }
3695 EOF
3696 if { (eval echo configure:3697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3697   rm -rf conftest*
3698   ol_cv_var_des_debug=yes
3699 else
3700   echo "configure: failed program was:" >&5
3701   cat conftest.$ac_ext >&5
3702   rm -rf conftest*
3703   ol_cv_var_des_debug=no
3704 fi
3705 rm -f conftest*
3706                                                                 LIBS="$save_LIBS"
3707                         
3708 fi
3709
3710 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
3711
3712                         if test $ol_cv_var_des_debug= yes ; then
3713                                 cat >> confdefs.h <<\EOF
3714 #define HAVE_DES_DEBUG 1
3715 EOF
3716
3717                         fi
3718
3719                         LIBS="$save_LIBS"
3720                 fi
3721         fi
3722 fi
3723
3724 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
3725         for ac_hdr in krb.h des.h
3726 do
3727 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3728 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3729 echo "configure:3730: checking for $ac_hdr" >&5
3730 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3731   echo $ac_n "(cached) $ac_c" 1>&6
3732 else
3733   cat > conftest.$ac_ext <<EOF
3734 #line 3735 "configure"
3735 #include "confdefs.h"
3736 #include <$ac_hdr>
3737 EOF
3738 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3739 { (eval echo configure:3740: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3740 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3741 if test -z "$ac_err"; then
3742   rm -rf conftest*
3743   eval "ac_cv_header_$ac_safe=yes"
3744 else
3745   echo "$ac_err" >&5
3746   echo "configure: failed program was:" >&5
3747   cat conftest.$ac_ext >&5
3748   rm -rf conftest*
3749   eval "ac_cv_header_$ac_safe=no"
3750 fi
3751 rm -f conftest*
3752 fi
3753 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3754   echo "$ac_t""yes" 1>&6
3755     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3756   cat >> confdefs.h <<EOF
3757 #define $ac_tr_hdr 1
3758 EOF
3759  
3760 else
3761   echo "$ac_t""no" 1>&6
3762 fi
3763 done
3764
3765
3766         if test $ac_cv_header_krb_h = yes ; then
3767                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
3768 echo "configure:3769: checking for main in -lkrb" >&5
3769 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
3770 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3771   echo $ac_n "(cached) $ac_c" 1>&6
3772 else
3773   ac_save_LIBS="$LIBS"
3774 LIBS="-lkrb -ldes $LIBS"
3775 cat > conftest.$ac_ext <<EOF
3776 #line 3777 "configure"
3777 #include "confdefs.h"
3778
3779 int main() {
3780 main()
3781 ; return 0; }
3782 EOF
3783 if { (eval echo configure:3784: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3784   rm -rf conftest*
3785   eval "ac_cv_lib_$ac_lib_var=yes"
3786 else
3787   echo "configure: failed program was:" >&5
3788   cat conftest.$ac_ext >&5
3789   rm -rf conftest*
3790   eval "ac_cv_lib_$ac_lib_var=no"
3791 fi
3792 rm -f conftest*
3793 LIBS="$ac_save_LIBS"
3794
3795 fi
3796 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3797   echo "$ac_t""yes" 1>&6
3798   have_k4=yes
3799 else
3800   echo "$ac_t""no" 1>&6
3801 have_k4=no
3802 fi
3803
3804
3805                 if test $have_k4 = yes ; then
3806                         ol_with_kerberos=found
3807                         ol_link_kerberos=yes
3808
3809                         KRB_LIBS="-lkrb -ldes"
3810                 fi
3811         fi
3812 fi
3813
3814 if test $ol_link_kerberos = yes ; then
3815         cat >> confdefs.h <<\EOF
3816 #define HAVE_KERBEROS 1
3817 EOF
3818
3819 fi
3820
3821 ol_link_tls=no
3822 if test $ol_with_tls != no ; then
3823         
3824         for ac_hdr in ssl.h
3825 do
3826 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3827 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3828 echo "configure:3829: checking for $ac_hdr" >&5
3829 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3830   echo $ac_n "(cached) $ac_c" 1>&6
3831 else
3832   cat > conftest.$ac_ext <<EOF
3833 #line 3834 "configure"
3834 #include "confdefs.h"
3835 #include <$ac_hdr>
3836 EOF
3837 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3838 { (eval echo configure:3839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3839 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3840 if test -z "$ac_err"; then
3841   rm -rf conftest*
3842   eval "ac_cv_header_$ac_safe=yes"
3843 else
3844   echo "$ac_err" >&5
3845   echo "configure: failed program was:" >&5
3846   cat conftest.$ac_ext >&5
3847   rm -rf conftest*
3848   eval "ac_cv_header_$ac_safe=no"
3849 fi
3850 rm -f conftest*
3851 fi
3852 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3853   echo "$ac_t""yes" 1>&6
3854     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3855   cat >> confdefs.h <<EOF
3856 #define $ac_tr_hdr 1
3857 EOF
3858  
3859 else
3860   echo "$ac_t""no" 1>&6
3861 fi
3862 done
3863
3864         
3865         if test $ac_cv_header_ssl_h = yes ; then
3866                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
3867 echo "configure:3868: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
3868 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
3869 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3870   echo $ac_n "(cached) $ac_c" 1>&6
3871 else
3872   ac_save_LIBS="$LIBS"
3873 LIBS="-lssl -lcrypto $LIBS"
3874 cat > conftest.$ac_ext <<EOF
3875 #line 3876 "configure"
3876 #include "confdefs.h"
3877 /* Override any gcc2 internal prototype to avoid an error.  */
3878 /* We use char because int might match the return type of a gcc2
3879     builtin and then its argument prototype would still apply.  */
3880 char SSLeay_add_ssl_algorithms();
3881
3882 int main() {
3883 SSLeay_add_ssl_algorithms()
3884 ; return 0; }
3885 EOF
3886 if { (eval echo configure:3887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3887   rm -rf conftest*
3888   eval "ac_cv_lib_$ac_lib_var=yes"
3889 else
3890   echo "configure: failed program was:" >&5
3891   cat conftest.$ac_ext >&5
3892   rm -rf conftest*
3893   eval "ac_cv_lib_$ac_lib_var=no"
3894 fi
3895 rm -f conftest*
3896 LIBS="$ac_save_LIBS"
3897
3898 fi
3899 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3900   echo "$ac_t""yes" 1>&6
3901   have_ssleay=yes
3902                         need_rsaref=no
3903 else
3904   echo "$ac_t""no" 1>&6
3905 have_ssleay=no
3906 fi
3907
3908                         
3909                 if test $have_ssleay = no ; then
3910                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
3911 echo "configure:3912: checking for ssl3_accept in -lssl" >&5
3912 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
3913 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3914   echo $ac_n "(cached) $ac_c" 1>&6
3915 else
3916   ac_save_LIBS="$LIBS"
3917 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
3918 cat > conftest.$ac_ext <<EOF
3919 #line 3920 "configure"
3920 #include "confdefs.h"
3921 /* Override any gcc2 internal prototype to avoid an error.  */
3922 /* We use char because int might match the return type of a gcc2
3923     builtin and then its argument prototype would still apply.  */
3924 char ssl3_accept();
3925
3926 int main() {
3927 ssl3_accept()
3928 ; return 0; }
3929 EOF
3930 if { (eval echo configure:3931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3931   rm -rf conftest*
3932   eval "ac_cv_lib_$ac_lib_var=yes"
3933 else
3934   echo "configure: failed program was:" >&5
3935   cat conftest.$ac_ext >&5
3936   rm -rf conftest*
3937   eval "ac_cv_lib_$ac_lib_var=no"
3938 fi
3939 rm -f conftest*
3940 LIBS="$ac_save_LIBS"
3941
3942 fi
3943 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3944   echo "$ac_t""yes" 1>&6
3945   have_ssleay=yes
3946                                 need_rsaref=yes
3947 else
3948   echo "$ac_t""no" 1>&6
3949 have_ssleay=no
3950 fi
3951
3952                 fi
3953
3954                 if test $have_ssleay = yes ; then
3955                         ol_with_tls=found
3956                         ol_link_tls=yes
3957
3958                         cat >> confdefs.h <<\EOF
3959 #define HAVE_SSLEAY 1
3960 EOF
3961
3962
3963                         if test $need_rsaref = yes; then
3964                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
3965                         else
3966                                 TLS_LIBS="-lssl -lcrypto"
3967                         fi
3968                 fi
3969         fi
3970 fi
3971
3972 if test $ol_link_tls = yes ; then
3973         cat >> confdefs.h <<\EOF
3974 #define HAVE_TLS 1
3975 EOF
3976
3977 fi      
3978
3979 for ac_func in \
3980         ctime_r                 \
3981         gethostbyname_r gethostbyaddr_r \
3982
3983 do
3984 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3985 echo "configure:3986: checking for $ac_func" >&5
3986 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3987   echo $ac_n "(cached) $ac_c" 1>&6
3988 else
3989   cat > conftest.$ac_ext <<EOF
3990 #line 3991 "configure"
3991 #include "confdefs.h"
3992 /* System header to define __stub macros and hopefully few prototypes,
3993     which can conflict with char $ac_func(); below.  */
3994 #include <assert.h>
3995 /* Override any gcc2 internal prototype to avoid an error.  */
3996 /* We use char because int might match the return type of a gcc2
3997     builtin and then its argument prototype would still apply.  */
3998 char $ac_func();
3999
4000 int main() {
4001
4002 /* The GNU C library defines this for functions which it implements
4003     to always fail with ENOSYS.  Some functions are actually named
4004     something starting with __ and the normal name is an alias.  */
4005 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4006 choke me
4007 #else
4008 $ac_func();
4009 #endif
4010
4011 ; return 0; }
4012 EOF
4013 if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4014   rm -rf conftest*
4015   eval "ac_cv_func_$ac_func=yes"
4016 else
4017   echo "configure: failed program was:" >&5
4018   cat conftest.$ac_ext >&5
4019   rm -rf conftest*
4020   eval "ac_cv_func_$ac_func=no"
4021 fi
4022 rm -f conftest*
4023 fi
4024
4025 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4026   echo "$ac_t""yes" 1>&6
4027     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4028   cat >> confdefs.h <<EOF
4029 #define $ac_tr_func 1
4030 EOF
4031  
4032 else
4033   echo "$ac_t""no" 1>&6
4034 fi
4035 done
4036
4037
4038 if test "$ac_cv_func_ctime_r" = no ; then
4039         ol_cv_func_ctime_r_nargs=0
4040 else
4041         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4042 echo "configure:4043: checking number of arguments of ctime_r" >&5
4043 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4044   echo $ac_n "(cached) $ac_c" 1>&6
4045 else
4046   cat > conftest.$ac_ext <<EOF
4047 #line 4048 "configure"
4048 #include "confdefs.h"
4049 #include <time.h>
4050 int main() {
4051 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4052 ; return 0; }
4053 EOF
4054 if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4055   rm -rf conftest*
4056   ol_cv_func_ctime_r_nargs=3
4057 else
4058   echo "configure: failed program was:" >&5
4059   cat conftest.$ac_ext >&5
4060   rm -rf conftest*
4061   cat > conftest.$ac_ext <<EOF
4062 #line 4063 "configure"
4063 #include "confdefs.h"
4064 #include <time.h>
4065 int main() {
4066 time_t ti; char *buffer; ctime_r(&ti,buffer);
4067 ; return 0; }
4068 EOF
4069 if { (eval echo configure:4070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4070   rm -rf conftest*
4071   ol_cv_func_ctime_r_nargs=2
4072 else
4073   echo "configure: failed program was:" >&5
4074   cat conftest.$ac_ext >&5
4075   rm -rf conftest*
4076   ol_cv_func_ctime_r_nargs=0
4077 fi
4078 rm -f conftest*
4079 fi
4080 rm -f conftest*
4081 fi
4082
4083 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4084   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4085     cat >> confdefs.h <<EOF
4086 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4087 EOF
4088
4089   fi
4090
4091 fi
4092
4093 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4094         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4095 echo "configure:4096: checking number of arguments of gethostbyname_r" >&5
4096 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4097   echo $ac_n "(cached) $ac_c" 1>&6
4098 else
4099   cat > conftest.$ac_ext <<EOF
4100 #line 4101 "configure"
4101 #include "confdefs.h"
4102 #include <sys/types.h>
4103 #include <sys/socket.h>
4104 #include <netinet/in.h>
4105 #include <netdb.h>
4106 #define BUFSIZE (sizeof(struct hostent)+10)
4107 int main() {
4108 struct hostent hent; char buffer[BUFSIZE];
4109                 int bufsize=BUFSIZE;int h_errno;
4110                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4111                         buffer, bufsize, &h_errno);
4112                 return 0;
4113 ; return 0; }
4114 EOF
4115 if { (eval echo configure:4116: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4116   rm -rf conftest*
4117   ol_cv_func_gethostbyname_r_nargs=5
4118 else
4119   echo "configure: failed program was:" >&5
4120   cat conftest.$ac_ext >&5
4121   rm -rf conftest*
4122   cat > conftest.$ac_ext <<EOF
4123 #line 4124 "configure"
4124 #include "confdefs.h"
4125 #include <sys/types.h>
4126 #include <sys/socket.h>
4127 #include <netinet/in.h>
4128 #include <netdb.h>
4129 #define BUFSIZE (sizeof(struct hostent)+10)
4130 int main() {
4131 struct hostent hent;struct hostent *rhent;
4132                         char buffer[BUFSIZE];
4133                         int bufsize=BUFSIZE;int h_errno;
4134                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4135                                 &rhent, &h_errno);
4136                         return 0;
4137 ; return 0; }
4138 EOF
4139 if { (eval echo configure:4140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4140   rm -rf conftest*
4141   ol_cv_func_gethostbyname_r_nargs=6
4142 else
4143   echo "configure: failed program was:" >&5
4144   cat conftest.$ac_ext >&5
4145   rm -rf conftest*
4146   ol_cv_func_gethostbyname_r_nargs=0
4147 fi
4148 rm -f conftest*
4149 fi
4150 rm -f conftest*
4151 fi
4152
4153 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4154   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4155         cat >> confdefs.h <<EOF
4156 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4157 EOF
4158
4159   fi
4160
4161 else
4162         ol_cv_func_gethostbyname_r_nargs=0
4163 fi
4164  
4165 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4166         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4167 echo "configure:4168: checking number of arguments of gethostbyaddr_r" >&5
4168 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4169   echo $ac_n "(cached) $ac_c" 1>&6
4170 else
4171   cat > conftest.$ac_ext <<EOF
4172 #line 4173 "configure"
4173 #include "confdefs.h"
4174 #include <sys/types.h>
4175 #include <sys/socket.h>
4176 #include <netinet/in.h>
4177 #include <netdb.h>
4178 #define BUFSIZE (sizeof(struct hostent)+10)
4179 int main() {
4180 struct hostent hent; char buffer[BUFSIZE]; 
4181             struct in_addr add={0x70707070};
4182             size_t alen=sizeof(struct in_addr);
4183             int bufsize=BUFSIZE;int h_errno;
4184                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4185                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4186                     return 0;
4187 ; return 0; }
4188 EOF
4189 if { (eval echo configure:4190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4190   rm -rf conftest*
4191   ol_cv_func_gethostbyaddr_r_nargs=7
4192 else
4193   echo "configure: failed program was:" >&5
4194   cat conftest.$ac_ext >&5
4195   rm -rf conftest*
4196   cat > conftest.$ac_ext <<EOF
4197 #line 4198 "configure"
4198 #include "confdefs.h"
4199 #include <sys/types.h>
4200 #include <sys/socket.h>
4201 #include <netinet/in.h>
4202 #include <netdb.h>
4203 #define BUFSIZE (sizeof(struct hostent)+10)
4204 int main() {
4205 struct hostent hent;
4206                         struct hostent *rhent; char buffer[BUFSIZE]; 
4207                         struct in_addr add={0x70707070};
4208                         size_t alen=sizeof(struct in_addr);
4209                         int bufsize=BUFSIZE;int h_errno;
4210                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4211                                 alen, AF_INET, &hent, buffer, bufsize, 
4212                                 &rhent, &h_errno);
4213                         return 0;
4214 ; return 0; }
4215 EOF
4216 if { (eval echo configure:4217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4217   rm -rf conftest*
4218   ol_cv_func_gethostbyaddr_r_nargs=8
4219 else
4220   echo "configure: failed program was:" >&5
4221   cat conftest.$ac_ext >&5
4222   rm -rf conftest*
4223   ol_cv_func_gethostbyaddr_r_nargs=0
4224 fi
4225 rm -f conftest*
4226 fi
4227 rm -f conftest*
4228 fi
4229
4230 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4231   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4232     cat >> confdefs.h <<EOF
4233 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4234 EOF
4235
4236   fi
4237
4238 else
4239         ol_cv_func_gethostbyaddr_r_nargs=0
4240 fi
4241
4242 if test "$ac_cv_func_ctime_r" = yes \
4243         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4244         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4245         -a "$ac_cv_func_gethostbyname_r" = yes \
4246         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4247         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4248         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4249         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4250         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4251         ; then
4252  
4253         cat >> confdefs.h <<\EOF
4254 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4255 EOF
4256
4257 fi
4258
4259 ol_link_threads=no
4260 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4261         -o $ol_with_threads = posix ; then
4262
4263         for ac_hdr in pthread.h sched.h
4264 do
4265 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4266 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4267 echo "configure:4268: checking for $ac_hdr" >&5
4268 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4269   echo $ac_n "(cached) $ac_c" 1>&6
4270 else
4271   cat > conftest.$ac_ext <<EOF
4272 #line 4273 "configure"
4273 #include "confdefs.h"
4274 #include <$ac_hdr>
4275 EOF
4276 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4277 { (eval echo configure:4278: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4278 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4279 if test -z "$ac_err"; then
4280   rm -rf conftest*
4281   eval "ac_cv_header_$ac_safe=yes"
4282 else
4283   echo "$ac_err" >&5
4284   echo "configure: failed program was:" >&5
4285   cat conftest.$ac_ext >&5
4286   rm -rf conftest*
4287   eval "ac_cv_header_$ac_safe=no"
4288 fi
4289 rm -f conftest*
4290 fi
4291 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4292   echo "$ac_t""yes" 1>&6
4293     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4294   cat >> confdefs.h <<EOF
4295 #define $ac_tr_hdr 1
4296 EOF
4297  
4298 else
4299   echo "$ac_t""no" 1>&6
4300 fi
4301 done
4302
4303
4304         if test $ac_cv_header_pthread_h = yes ; then
4305                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4306 echo "configure:4307: checking POSIX thread version" >&5
4307 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4308   echo $ac_n "(cached) $ac_c" 1>&6
4309 else
4310   
4311         cat > conftest.$ac_ext <<EOF
4312 #line 4313 "configure"
4313 #include "confdefs.h"
4314
4315 #               include <pthread.h>
4316                 /* this check could be improved */
4317 #               ifdef PTHREAD_ONCE_INIT
4318                         pthread_version_final
4319 #               endif
4320         
4321 EOF
4322 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4323   egrep "pthread_version_final" >/dev/null 2>&1; then
4324   rm -rf conftest*
4325   ol_pthread_final=yes
4326 else
4327   rm -rf conftest*
4328   ol_pthread_final=no
4329 fi
4330 rm -f conftest*
4331
4332
4333         cat > conftest.$ac_ext <<EOF
4334 #line 4335 "configure"
4335 #include "confdefs.h"
4336
4337 #               include <pthread.h>
4338                 /* this check could be improved */
4339 #               ifdef pthread_once_init
4340                         pthread_version_draft4
4341 #               endif
4342         
4343 EOF
4344 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4345   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4346   rm -rf conftest*
4347   ol_pthread_draft4=yes
4348 else
4349   rm -rf conftest*
4350   ol_pthread_draft4=no
4351 fi
4352 rm -f conftest*
4353
4354
4355         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4356                 ol_cv_pthread_version=final
4357         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4358                 ol_cv_pthread_version=draft4
4359         else
4360                 ol_cv_pthread_version=unknown
4361         fi
4362
4363 fi
4364
4365 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4366
4367
4368                 if test $ol_cv_pthread_version = final ; then
4369                         cat >> confdefs.h <<\EOF
4370 #define HAVE_PTHREADS_FINAL 1
4371 EOF
4372
4373                 elif test $ol_cv_pthread_version = draft4 ; then
4374                         cat >> confdefs.h <<\EOF
4375 #define HAVE_PTHREADS_D4 1
4376 EOF
4377
4378                 else
4379                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4380                 fi
4381
4382                 # consider threads found
4383                 ol_with_threads=found
4384
4385                 
4386 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
4387 echo "configure:4388: checking for LinuxThreads" >&5
4388 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
4389   echo $ac_n "(cached) $ac_c" 1>&6
4390 else
4391   
4392         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
4393         if test "$res" -gt 0 ; then
4394                 ol_cv_linux_threads=yes
4395         else
4396                 ol_cv_linux_threads=no
4397         fi
4398
4399 fi
4400
4401 echo "$ac_t""$ol_cv_linux_threads" 1>&6
4402
4403
4404                 if test $ol_cv_linux_threads = yes ; then
4405                         cat >> confdefs.h <<\EOF
4406 #define HAVE_LINUX_THREADS 1
4407 EOF
4408
4409                 fi
4410
4411                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4412                                 echo $ac_n "checking for pthread_create""... $ac_c" 1>&6
4413 echo "configure:4414: checking for pthread_create" >&5
4414 if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then
4415   echo $ac_n "(cached) $ac_c" 1>&6
4416 else
4417   cat > conftest.$ac_ext <<EOF
4418 #line 4419 "configure"
4419 #include "confdefs.h"
4420 /* System header to define __stub macros and hopefully few prototypes,
4421     which can conflict with char pthread_create(); below.  */
4422 #include <assert.h>
4423 /* Override any gcc2 internal prototype to avoid an error.  */
4424 /* We use char because int might match the return type of a gcc2
4425     builtin and then its argument prototype would still apply.  */
4426 char pthread_create();
4427
4428 int main() {
4429
4430 /* The GNU C library defines this for functions which it implements
4431     to always fail with ENOSYS.  Some functions are actually named
4432     something starting with __ and the normal name is an alias.  */
4433 #if defined (__stub_pthread_create) || defined (__stub___pthread_create)
4434 choke me
4435 #else
4436 pthread_create();
4437 #endif
4438
4439 ; return 0; }
4440 EOF
4441 if { (eval echo configure:4442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4442   rm -rf conftest*
4443   eval "ac_cv_func_pthread_create=yes"
4444 else
4445   echo "configure: failed program was:" >&5
4446   cat conftest.$ac_ext >&5
4447   rm -rf conftest*
4448   eval "ac_cv_func_pthread_create=no"
4449 fi
4450 rm -f conftest*
4451 fi
4452
4453 if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then
4454   echo "$ac_t""yes" 1>&6
4455   ol_link_threads=yes
4456 else
4457   echo "$ac_t""no" 1>&6
4458 fi
4459
4460
4461                 if test $ol_link_threads = no ; then
4462                                                 echo $ac_n "checking for pthread_create with -kthread""... $ac_c" 1>&6
4463 echo "configure:4464: checking for pthread_create with -kthread" >&5
4464 if eval "test \"`echo '$''{'ol_cv_kthread_flag'+set}'`\" = set"; then
4465   echo $ac_n "(cached) $ac_c" 1>&6
4466 else
4467   
4468                                                                 save_LIBS="$LIBS"
4469                                 LIBS="-kthread $LIBS"
4470                                 cat > conftest.$ac_ext <<EOF
4471 #line 4472 "configure"
4472 #include "confdefs.h"
4473 #include <pthread.h>
4474 int main() {
4475
4476 #if HAVE_PTHREADS_D4
4477         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4478 #else
4479         pthread_create(NULL,NULL,NULL,NULL);
4480 #endif
4481
4482 ; return 0; }
4483 EOF
4484 if { (eval echo configure:4485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4485   rm -rf conftest*
4486   ol_cv_kthread_flag=yes
4487 else
4488   echo "configure: failed program was:" >&5
4489   cat conftest.$ac_ext >&5
4490   rm -rf conftest*
4491   ol_cv_kthread_flag=no
4492 fi
4493 rm -f conftest*
4494                                                                 LIBS="$save_LIBS"
4495                         
4496 fi
4497
4498 echo "$ac_t""$ol_cv_kthread_flag" 1>&6
4499
4500                         if test $ol_cv_kthread_flag = yes ; then
4501                                 LTHREAD_LIBS="$LTHREAD_LIBS -kthread"
4502                                 ol_link_threads=posix
4503                         fi
4504                 fi
4505
4506                 if test $ol_link_threads = no ; then
4507                                                 echo $ac_n "checking for pthread_create with -pthread""... $ac_c" 1>&6
4508 echo "configure:4509: checking for pthread_create with -pthread" >&5
4509 if eval "test \"`echo '$''{'ol_cv_pthread_flag'+set}'`\" = set"; then
4510   echo $ac_n "(cached) $ac_c" 1>&6
4511 else
4512   
4513                                                                 save_LIBS="$LIBS"
4514                                 LIBS="-pthread $LIBS"
4515                                 cat > conftest.$ac_ext <<EOF
4516 #line 4517 "configure"
4517 #include "confdefs.h"
4518 #include <pthread.h>
4519 int main() {
4520
4521 #if HAVE_PTHREADS_D4
4522         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4523 #else
4524         pthread_create(NULL,NULL,NULL,NULL);
4525 #endif
4526
4527 ; return 0; }
4528 EOF
4529 if { (eval echo configure:4530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4530   rm -rf conftest*
4531   ol_cv_pthread_flag=yes
4532 else
4533   echo "configure: failed program was:" >&5
4534   cat conftest.$ac_ext >&5
4535   rm -rf conftest*
4536   ol_cv_pthread_flag=no
4537 fi
4538 rm -f conftest*
4539                                                                 LIBS="$save_LIBS"
4540                         
4541 fi
4542
4543 echo "$ac_t""$ol_cv_pthread_flag" 1>&6
4544
4545                         if test $ol_cv_pthread_flag = yes ; then
4546                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthread"
4547                                 ol_link_threads=posix
4548                         fi
4549                 fi
4550
4551                 if test $ol_link_threads = no ; then
4552                                                 echo $ac_n "checking for pthread_create with -pthreads""... $ac_c" 1>&6
4553 echo "configure:4554: checking for pthread_create with -pthreads" >&5
4554 if eval "test \"`echo '$''{'ol_cv_pthreads_flag'+set}'`\" = set"; then
4555   echo $ac_n "(cached) $ac_c" 1>&6
4556 else
4557   
4558                                                                 save_LIBS="$LIBS"
4559                                 LIBS="-pthreads $LIBS"
4560                                 cat > conftest.$ac_ext <<EOF
4561 #line 4562 "configure"
4562 #include "confdefs.h"
4563 #include <pthread.h>
4564 int main() {
4565
4566 #if HAVE_PTHREADS_D4
4567         pthread_create(NULL,pthread_attr_default,NULL,NULL);
4568 #else
4569         pthread_create(NULL,NULL,NULL,NULL);
4570 #endif
4571
4572 ; return 0; }
4573 EOF
4574 if { (eval echo configure:4575: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4575   rm -rf conftest*
4576   ol_cv_pthreads_flag=yes
4577 else
4578   echo "configure: failed program was:" >&5
4579   cat conftest.$ac_ext >&5
4580   rm -rf conftest*
4581   ol_cv_pthreads_flag=no
4582 fi
4583 rm -f conftest*
4584                                                                 LIBS="$save_LIBS"
4585                         
4586 fi
4587
4588 echo "$ac_t""$ol_cv_pthreads_flag" 1>&6
4589
4590                         if test $ol_cv_pthreads_flag = yes ; then
4591                                 LTHREAD_LIBS="$LTHREAD_LIBS -pthreads"
4592                                 ol_link_threads=posix
4593                         fi
4594                 fi
4595
4596                 if test $ol_link_threads = no ; then
4597                                                 echo $ac_n "checking for pthread_create with -thread""... $ac_c" 1>&6
4598 echo "configure:4599: checking for pthread_create with -thread" >&5
4599 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4600   echo $ac_n "(cached) $ac_c" 1>&6
4601 else
4602   
4603                                                                 save_LIBS="$LIBS"
4604                                 LIBS="-thread $LIBS"
4605                                 cat > conftest.$ac_ext <<EOF
4606 #line 4607 "configure"
4607 #include "confdefs.h"
4608 char pthread_create();
4609 int main() {
4610 pthread_create();
4611 ; return 0; }
4612 EOF
4613 if { (eval echo configure:4614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4614   rm -rf conftest*
4615   ol_cv_thread_flag=yes
4616 else
4617   echo "configure: failed program was:" >&5
4618   cat conftest.$ac_ext >&5
4619   rm -rf conftest*
4620   ol_cv_thread_flag=no
4621 fi
4622 rm -f conftest*
4623                                                                 LIBS="$save_LIBS"
4624                         
4625 fi
4626
4627 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4628
4629                         if test $ol_cv_thread_flag = yes ; then
4630                                 LTHREAD_LIBS="$LTHREAD_LIBS -thread"
4631                                 ol_link_threads=posix
4632                         fi
4633                 fi
4634
4635                 if test $ol_link_threads = no ; then
4636                                                 echo $ac_n "checking for pthread_create with -mt""... $ac_c" 1>&6
4637 echo "configure:4638: checking for pthread_create with -mt" >&5
4638 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
4639   echo $ac_n "(cached) $ac_c" 1>&6
4640 else
4641   
4642                                                                 save_LIBS="$LIBS"
4643                                 LIBS="-mt $LIBS"
4644                                 cat > conftest.$ac_ext <<EOF
4645 #line 4646 "configure"
4646 #include "confdefs.h"
4647 char pthread_create();
4648 int main() {
4649 pthread_create();
4650 ; return 0; }
4651 EOF
4652 if { (eval echo configure:4653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4653   rm -rf conftest*
4654   ol_cv_thread_flag=yes
4655 else
4656   echo "configure: failed program was:" >&5
4657   cat conftest.$ac_ext >&5
4658   rm -rf conftest*
4659   ol_cv_thread_flag=no
4660 fi
4661 rm -f conftest*
4662                                                                 LIBS="$save_LIBS"
4663                         
4664 fi
4665
4666 echo "$ac_t""$ol_cv_thread_flag" 1>&6
4667
4668                         if test $ol_cv_thread_flag = yes ; then
4669                                 LTHREAD_LIBS="$LTHREAD_LIBS -mt"
4670                                 ol_link_threads=posix
4671                         fi
4672                 fi
4673
4674                 if test $ol_link_threads = no ; then
4675                                                 save_LIBS="$LIBS"
4676                         echo $ac_n "checking for pthread_mutex_unlock in -lpthread""... $ac_c" 1>&6
4677 echo "configure:4678: checking for pthread_mutex_unlock in -lpthread" >&5
4678 ac_lib_var=`echo pthread'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
4679 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4680   echo $ac_n "(cached) $ac_c" 1>&6
4681 else
4682   ac_save_LIBS="$LIBS"
4683 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
4684 cat > conftest.$ac_ext <<EOF
4685 #line 4686 "configure"
4686 #include "confdefs.h"
4687 /* Override any gcc2 internal prototype to avoid an error.  */
4688 /* We use char because int might match the return type of a gcc2
4689     builtin and then its argument prototype would still apply.  */
4690 char pthread_mutex_unlock();
4691
4692 int main() {
4693 pthread_mutex_unlock()
4694 ; return 0; }
4695 EOF
4696 if { (eval echo configure:4697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4697   rm -rf conftest*
4698   eval "ac_cv_lib_$ac_lib_var=yes"
4699 else
4700   echo "configure: failed program was:" >&5
4701   cat conftest.$ac_ext >&5
4702   rm -rf conftest*
4703   eval "ac_cv_lib_$ac_lib_var=no"
4704 fi
4705 rm -f conftest*
4706 LIBS="$ac_save_LIBS"
4707
4708 fi
4709 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4710   echo "$ac_t""yes" 1>&6
4711   
4712                                 ol_link_threads=posix
4713                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc -lc_r"
4714                                 if test $ol_with_yielding_select = auto ; then
4715                                         ol_with_yielding_select=yes
4716                                 fi
4717                                 
4718 else
4719   echo "$ac_t""no" 1>&6
4720 :
4721 fi
4722
4723                         LIBS="$save_LIBS"
4724                 fi
4725
4726                 if test $ol_link_threads = no ; then
4727                                                 save_LIBS="$LIBS"
4728                         echo $ac_n "checking for pthread_mutex_lock in -lpthread""... $ac_c" 1>&6
4729 echo "configure:4730: checking for pthread_mutex_lock in -lpthread" >&5
4730 ac_lib_var=`echo pthread'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
4731 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4732   echo $ac_n "(cached) $ac_c" 1>&6
4733 else
4734   ac_save_LIBS="$LIBS"
4735 LIBS="-lpthread -lmach -lexc $LIBS"
4736 cat > conftest.$ac_ext <<EOF
4737 #line 4738 "configure"
4738 #include "confdefs.h"
4739 /* Override any gcc2 internal prototype to avoid an error.  */
4740 /* We use char because int might match the return type of a gcc2
4741     builtin and then its argument prototype would still apply.  */
4742 char pthread_mutex_lock();
4743
4744 int main() {
4745 pthread_mutex_lock()
4746 ; return 0; }
4747 EOF
4748 if { (eval echo configure:4749: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4749   rm -rf conftest*
4750   eval "ac_cv_lib_$ac_lib_var=yes"
4751 else
4752   echo "configure: failed program was:" >&5
4753   cat conftest.$ac_ext >&5
4754   rm -rf conftest*
4755   eval "ac_cv_lib_$ac_lib_var=no"
4756 fi
4757 rm -f conftest*
4758 LIBS="$ac_save_LIBS"
4759
4760 fi
4761 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4762   echo "$ac_t""yes" 1>&6
4763   
4764                                 ol_link_threads=posix
4765                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lmach -lexc"
4766                                 if test $ol_with_yielding_select = auto ; then
4767                                         ol_with_yielding_select=yes
4768                                 fi
4769                                 
4770 else
4771   echo "$ac_t""no" 1>&6
4772 :
4773 fi
4774
4775                         LIBS="$save_LIBS"
4776                 fi
4777
4778                 if test $ol_link_threads = no ; then
4779                                                 save_LIBS="$LIBS"
4780                         echo $ac_n "checking for pthread_mutex_trylock in -lpthread""... $ac_c" 1>&6
4781 echo "configure:4782: checking for pthread_mutex_trylock in -lpthread" >&5
4782 ac_lib_var=`echo pthread'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
4783 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4784   echo $ac_n "(cached) $ac_c" 1>&6
4785 else
4786   ac_save_LIBS="$LIBS"
4787 LIBS="-lpthread -lexc $LIBS"
4788 cat > conftest.$ac_ext <<EOF
4789 #line 4790 "configure"
4790 #include "confdefs.h"
4791 /* Override any gcc2 internal prototype to avoid an error.  */
4792 /* We use char because int might match the return type of a gcc2
4793     builtin and then its argument prototype would still apply.  */
4794 char pthread_mutex_trylock();
4795
4796 int main() {
4797 pthread_mutex_trylock()
4798 ; return 0; }
4799 EOF
4800 if { (eval echo configure:4801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4801   rm -rf conftest*
4802   eval "ac_cv_lib_$ac_lib_var=yes"
4803 else
4804   echo "configure: failed program was:" >&5
4805   cat conftest.$ac_ext >&5
4806   rm -rf conftest*
4807   eval "ac_cv_lib_$ac_lib_var=no"
4808 fi
4809 rm -f conftest*
4810 LIBS="$ac_save_LIBS"
4811
4812 fi
4813 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4814   echo "$ac_t""yes" 1>&6
4815   
4816                                 ol_link_threads=posix
4817                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread -lexc"
4818                                 if test $ol_with_yielding_select = auto ; then
4819                                         ol_with_yielding_select=yes
4820                                 fi
4821                                 
4822 else
4823   echo "$ac_t""no" 1>&6
4824 :
4825 fi
4826
4827                         LIBS="$save_LIBS"
4828                 fi
4829
4830                 if test $ol_link_threads = no ; then
4831                                                 save_LIBS="$LIBS"
4832                         echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
4833 echo "configure:4834: checking for pthread_create in -lpthread" >&5
4834 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
4835 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4836   echo $ac_n "(cached) $ac_c" 1>&6
4837 else
4838   ac_save_LIBS="$LIBS"
4839 LIBS="-lpthread  $LIBS"
4840 cat > conftest.$ac_ext <<EOF
4841 #line 4842 "configure"
4842 #include "confdefs.h"
4843 /* Override any gcc2 internal prototype to avoid an error.  */
4844 /* We use char because int might match the return type of a gcc2
4845     builtin and then its argument prototype would still apply.  */
4846 char pthread_create();
4847
4848 int main() {
4849 pthread_create()
4850 ; return 0; }
4851 EOF
4852 if { (eval echo configure:4853: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4853   rm -rf conftest*
4854   eval "ac_cv_lib_$ac_lib_var=yes"
4855 else
4856   echo "configure: failed program was:" >&5
4857   cat conftest.$ac_ext >&5
4858   rm -rf conftest*
4859   eval "ac_cv_lib_$ac_lib_var=no"
4860 fi
4861 rm -f conftest*
4862 LIBS="$ac_save_LIBS"
4863
4864 fi
4865 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4866   echo "$ac_t""yes" 1>&6
4867   
4868                                 ol_link_threads=posix
4869                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthread"
4870 else
4871   echo "$ac_t""no" 1>&6
4872 :
4873 fi
4874
4875                         LIBS="$save_LIBS"
4876                 fi
4877
4878                 if test $ol_link_threads = no ; then
4879                                                 save_LIBS="$LIBS"
4880                         echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
4881 echo "configure:4882: checking for pthread_create in -lc_r" >&5
4882 ac_lib_var=`echo c_r'_'pthread_create | sed 'y%./+-%__p_%'`
4883 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4884   echo $ac_n "(cached) $ac_c" 1>&6
4885 else
4886   ac_save_LIBS="$LIBS"
4887 LIBS="-lc_r  $LIBS"
4888 cat > conftest.$ac_ext <<EOF
4889 #line 4890 "configure"
4890 #include "confdefs.h"
4891 /* Override any gcc2 internal prototype to avoid an error.  */
4892 /* We use char because int might match the return type of a gcc2
4893     builtin and then its argument prototype would still apply.  */
4894 char pthread_create();
4895
4896 int main() {
4897 pthread_create()
4898 ; return 0; }
4899 EOF
4900 if { (eval echo configure:4901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4901   rm -rf conftest*
4902   eval "ac_cv_lib_$ac_lib_var=yes"
4903 else
4904   echo "configure: failed program was:" >&5
4905   cat conftest.$ac_ext >&5
4906   rm -rf conftest*
4907   eval "ac_cv_lib_$ac_lib_var=no"
4908 fi
4909 rm -f conftest*
4910 LIBS="$ac_save_LIBS"
4911
4912 fi
4913 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4914   echo "$ac_t""yes" 1>&6
4915   
4916                                 ol_link_threads=posix
4917                                 LTHREAD_LIBS="$LTHREAD_LIBS -lc_r"
4918 else
4919   echo "$ac_t""no" 1>&6
4920 :
4921 fi
4922
4923                         LIBS="$save_LIBS"
4924                 fi
4925
4926                 if test $ol_link_threads = no ; then
4927                                                 save_LIBS="$LIBS"
4928                         echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
4929 echo "configure:4930: checking for pthread_create in -lpthreads" >&5
4930 ac_lib_var=`echo pthreads'_'pthread_create | sed 'y%./+-%__p_%'`
4931 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4932   echo $ac_n "(cached) $ac_c" 1>&6
4933 else
4934   ac_save_LIBS="$LIBS"
4935 LIBS="-lpthreads  $LIBS"
4936 cat > conftest.$ac_ext <<EOF
4937 #line 4938 "configure"
4938 #include "confdefs.h"
4939 /* Override any gcc2 internal prototype to avoid an error.  */
4940 /* We use char because int might match the return type of a gcc2
4941     builtin and then its argument prototype would still apply.  */
4942 char pthread_create();
4943
4944 int main() {
4945 pthread_create()
4946 ; return 0; }
4947 EOF
4948 if { (eval echo configure:4949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4949   rm -rf conftest*
4950   eval "ac_cv_lib_$ac_lib_var=yes"
4951 else
4952   echo "configure: failed program was:" >&5
4953   cat conftest.$ac_ext >&5
4954   rm -rf conftest*
4955   eval "ac_cv_lib_$ac_lib_var=no"
4956 fi
4957 rm -f conftest*
4958 LIBS="$ac_save_LIBS"
4959
4960 fi
4961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4962   echo "$ac_t""yes" 1>&6
4963   
4964                                 ol_link_threads=posix
4965                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
4966 else
4967   echo "$ac_t""no" 1>&6
4968 :
4969 fi
4970
4971                         LIBS="$save_LIBS"
4972                 fi
4973
4974                                 if test $ol_link_threads = no ; then
4975                                                 save_LIBS="$LIBS"
4976                         echo $ac_n "checking for pthread_join in -lpthreads""... $ac_c" 1>&6
4977 echo "configure:4978: checking for pthread_join in -lpthreads" >&5
4978 ac_lib_var=`echo pthreads'_'pthread_join | sed 'y%./+-%__p_%'`
4979 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4980   echo $ac_n "(cached) $ac_c" 1>&6
4981 else
4982   ac_save_LIBS="$LIBS"
4983 LIBS="-lpthreads -Wl,-woff,85 $LIBS"
4984 cat > conftest.$ac_ext <<EOF
4985 #line 4986 "configure"
4986 #include "confdefs.h"
4987 /* Override any gcc2 internal prototype to avoid an error.  */
4988 /* We use char because int might match the return type of a gcc2
4989     builtin and then its argument prototype would still apply.  */
4990 char pthread_join();
4991
4992 int main() {
4993 pthread_join()
4994 ; return 0; }
4995 EOF
4996 if { (eval echo configure:4997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4997   rm -rf conftest*
4998   eval "ac_cv_lib_$ac_lib_var=yes"
4999 else
5000   echo "configure: failed program was:" >&5
5001   cat conftest.$ac_ext >&5
5002   rm -rf conftest*
5003   eval "ac_cv_lib_$ac_lib_var=no"
5004 fi
5005 rm -f conftest*
5006 LIBS="$ac_save_LIBS"
5007
5008 fi
5009 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5010   echo "$ac_t""yes" 1>&6
5011   
5012                                 ol_link_threads=posix
5013                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads"
5014                                 
5015 else
5016   echo "$ac_t""no" 1>&6
5017 :
5018 fi
5019
5020                         LIBS="$save_LIBS"
5021                 fi
5022
5023                 if test $ol_link_threads = no ; then
5024                                                 echo $ac_n "checking for pthread_create with -threads""... $ac_c" 1>&6
5025 echo "configure:5026: checking for pthread_create with -threads" >&5
5026 if eval "test \"`echo '$''{'ol_cv_thread_flag'+set}'`\" = set"; then
5027   echo $ac_n "(cached) $ac_c" 1>&6
5028 else
5029   
5030                                                                 save_LIBS="$LIBS"
5031                                 LIBS="-threads $LIBS"
5032                                 cat > conftest.$ac_ext <<EOF
5033 #line 5034 "configure"
5034 #include "confdefs.h"
5035 char pthread_create();
5036 int main() {
5037
5038                                         pthread_create();
5039                                         
5040 ; return 0; }
5041 EOF
5042 if { (eval echo configure:5043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5043   rm -rf conftest*
5044   ol_cv_thread_flag=yes
5045 else
5046   echo "configure: failed program was:" >&5
5047   cat conftest.$ac_ext >&5
5048   rm -rf conftest*
5049   ol_cv_thread_flag=no
5050 fi
5051 rm -f conftest*
5052                                                                 LIBS="$save_LIBS"
5053                         
5054 fi
5055
5056 echo "$ac_t""$ol_cv_thread_flag" 1>&6
5057
5058                         if test $ol_cv_thread_flag = yes ; then
5059                                 LTHREAD_LIBS="$LTHREAD_LIBS -threads"
5060                                 ol_link_threads=posix
5061                         fi
5062                 fi
5063
5064                 if test $ol_link_threads = no ; then
5065                                                 save_LIBS="$LIBS"
5066                         echo $ac_n "checking for pthread_mutex_unlock in -lpthreads""... $ac_c" 1>&6
5067 echo "configure:5068: checking for pthread_mutex_unlock in -lpthreads" >&5
5068 ac_lib_var=`echo pthreads'_'pthread_mutex_unlock | sed 'y%./+-%__p_%'`
5069 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5070   echo $ac_n "(cached) $ac_c" 1>&6
5071 else
5072   ac_save_LIBS="$LIBS"
5073 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5074 cat > conftest.$ac_ext <<EOF
5075 #line 5076 "configure"
5076 #include "confdefs.h"
5077 /* Override any gcc2 internal prototype to avoid an error.  */
5078 /* We use char because int might match the return type of a gcc2
5079     builtin and then its argument prototype would still apply.  */
5080 char pthread_mutex_unlock();
5081
5082 int main() {
5083 pthread_mutex_unlock()
5084 ; return 0; }
5085 EOF
5086 if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5087   rm -rf conftest*
5088   eval "ac_cv_lib_$ac_lib_var=yes"
5089 else
5090   echo "configure: failed program was:" >&5
5091   cat conftest.$ac_ext >&5
5092   rm -rf conftest*
5093   eval "ac_cv_lib_$ac_lib_var=no"
5094 fi
5095 rm -f conftest*
5096 LIBS="$ac_save_LIBS"
5097
5098 fi
5099 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5100   echo "$ac_t""yes" 1>&6
5101   
5102                                 ol_link_threads=posix
5103                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc -lc_r"
5104                                 if test $ol_with_yielding_select = auto ; then
5105                                         ol_with_yielding_select=yes
5106                                 fi
5107                                 
5108 else
5109   echo "$ac_t""no" 1>&6
5110 :
5111 fi
5112
5113                         LIBS="$save_LIBS"
5114                 fi
5115
5116                 if test $ol_link_threads = no ; then
5117                                                 save_LIBS="$LIBS"
5118                         echo $ac_n "checking for pthread_mutex_lock in -lpthreads""... $ac_c" 1>&6
5119 echo "configure:5120: checking for pthread_mutex_lock in -lpthreads" >&5
5120 ac_lib_var=`echo pthreads'_'pthread_mutex_lock | sed 'y%./+-%__p_%'`
5121 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5122   echo $ac_n "(cached) $ac_c" 1>&6
5123 else
5124   ac_save_LIBS="$LIBS"
5125 LIBS="-lpthreads -lmach -lexc $LIBS"
5126 cat > conftest.$ac_ext <<EOF
5127 #line 5128 "configure"
5128 #include "confdefs.h"
5129 /* Override any gcc2 internal prototype to avoid an error.  */
5130 /* We use char because int might match the return type of a gcc2
5131     builtin and then its argument prototype would still apply.  */
5132 char pthread_mutex_lock();
5133
5134 int main() {
5135 pthread_mutex_lock()
5136 ; return 0; }
5137 EOF
5138 if { (eval echo configure:5139: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5139   rm -rf conftest*
5140   eval "ac_cv_lib_$ac_lib_var=yes"
5141 else
5142   echo "configure: failed program was:" >&5
5143   cat conftest.$ac_ext >&5
5144   rm -rf conftest*
5145   eval "ac_cv_lib_$ac_lib_var=no"
5146 fi
5147 rm -f conftest*
5148 LIBS="$ac_save_LIBS"
5149
5150 fi
5151 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5152   echo "$ac_t""yes" 1>&6
5153   
5154                                 ol_link_threads=posix
5155                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lmach -lexc"
5156                                 if test $ol_with_yielding_select = auto ; then
5157                                         ol_with_yielding_select=yes
5158                                 fi
5159                                 
5160 else
5161   echo "$ac_t""no" 1>&6
5162 :
5163 fi
5164
5165                         LIBS="$save_LIBS"
5166                 fi
5167
5168                 if test $ol_link_threads = no ; then
5169                                                 save_LIBS="$LIBS"
5170                         echo $ac_n "checking for pthread_mutex_trylock in -lpthreads""... $ac_c" 1>&6
5171 echo "configure:5172: checking for pthread_mutex_trylock in -lpthreads" >&5
5172 ac_lib_var=`echo pthreads'_'pthread_mutex_trylock | sed 'y%./+-%__p_%'`
5173 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5174   echo $ac_n "(cached) $ac_c" 1>&6
5175 else
5176   ac_save_LIBS="$LIBS"
5177 LIBS="-lpthreads -lexc $LIBS"
5178 cat > conftest.$ac_ext <<EOF
5179 #line 5180 "configure"
5180 #include "confdefs.h"
5181 /* Override any gcc2 internal prototype to avoid an error.  */
5182 /* We use char because int might match the return type of a gcc2
5183     builtin and then its argument prototype would still apply.  */
5184 char pthread_mutex_trylock();
5185
5186 int main() {
5187 pthread_mutex_trylock()
5188 ; return 0; }
5189 EOF
5190 if { (eval echo configure:5191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5191   rm -rf conftest*
5192   eval "ac_cv_lib_$ac_lib_var=yes"
5193 else
5194   echo "configure: failed program was:" >&5
5195   cat conftest.$ac_ext >&5
5196   rm -rf conftest*
5197   eval "ac_cv_lib_$ac_lib_var=no"
5198 fi
5199 rm -f conftest*
5200 LIBS="$ac_save_LIBS"
5201
5202 fi
5203 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5204   echo "$ac_t""yes" 1>&6
5205   
5206                                 ol_link_threads=posix
5207                                 LTHREAD_LIBS="$LTHREAD_LIBS -lpthreads -lexc"
5208                                 if test $ol_with_yielding_select = auto ; then
5209                                         ol_with_yielding_select=yes
5210                                 fi
5211                                 
5212 else
5213   echo "$ac_t""no" 1>&6
5214 :
5215 fi
5216
5217                         LIBS="$save_LIBS"
5218                 fi
5219
5220                 if test $ol_link_threads != no ; then
5221                         cat >> confdefs.h <<\EOF
5222 #define HAVE_PTHREADS 1
5223 EOF
5224
5225
5226                                                 save_CPPFLAGS="$CPPFLAGS"
5227                         save_LIBS="$LIBS"
5228                         LIBS="$LTHREAD_LIBS $LIBS"
5229
5230                                                                                                 for ac_func in sched_yield pthread_yield
5231 do
5232 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5233 echo "configure:5234: checking for $ac_func" >&5
5234 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5235   echo $ac_n "(cached) $ac_c" 1>&6
5236 else
5237   cat > conftest.$ac_ext <<EOF
5238 #line 5239 "configure"
5239 #include "confdefs.h"
5240 /* System header to define __stub macros and hopefully few prototypes,
5241     which can conflict with char $ac_func(); below.  */
5242 #include <assert.h>
5243 /* Override any gcc2 internal prototype to avoid an error.  */
5244 /* We use char because int might match the return type of a gcc2
5245     builtin and then its argument prototype would still apply.  */
5246 char $ac_func();
5247
5248 int main() {
5249
5250 /* The GNU C library defines this for functions which it implements
5251     to always fail with ENOSYS.  Some functions are actually named
5252     something starting with __ and the normal name is an alias.  */
5253 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5254 choke me
5255 #else
5256 $ac_func();
5257 #endif
5258
5259 ; return 0; }
5260 EOF
5261 if { (eval echo configure:5262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5262   rm -rf conftest*
5263   eval "ac_cv_func_$ac_func=yes"
5264 else
5265   echo "configure: failed program was:" >&5
5266   cat conftest.$ac_ext >&5
5267   rm -rf conftest*
5268   eval "ac_cv_func_$ac_func=no"
5269 fi
5270 rm -f conftest*
5271 fi
5272
5273 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5274   echo "$ac_t""yes" 1>&6
5275     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5276   cat >> confdefs.h <<EOF
5277 #define $ac_tr_func 1
5278 EOF
5279  
5280 else
5281   echo "$ac_t""no" 1>&6
5282 fi
5283 done
5284
5285
5286                         if test $ac_cv_func_sched_yield = no -a \
5287                                 $ac_cv_func_pthread_yield = no ; then
5288                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5289 echo "configure:5290: checking for sched_yield in -lrt" >&5
5290 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5291 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5292   echo $ac_n "(cached) $ac_c" 1>&6
5293 else
5294   ac_save_LIBS="$LIBS"
5295 LIBS="-lrt  $LIBS"
5296 cat > conftest.$ac_ext <<EOF
5297 #line 5298 "configure"
5298 #include "confdefs.h"
5299 /* Override any gcc2 internal prototype to avoid an error.  */
5300 /* We use char because int might match the return type of a gcc2
5301     builtin and then its argument prototype would still apply.  */
5302 char sched_yield();
5303
5304 int main() {
5305 sched_yield()
5306 ; return 0; }
5307 EOF
5308 if { (eval echo configure:5309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5309   rm -rf conftest*
5310   eval "ac_cv_lib_$ac_lib_var=yes"
5311 else
5312   echo "configure: failed program was:" >&5
5313   cat conftest.$ac_ext >&5
5314   rm -rf conftest*
5315   eval "ac_cv_lib_$ac_lib_var=no"
5316 fi
5317 rm -f conftest*
5318 LIBS="$ac_save_LIBS"
5319
5320 fi
5321 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5322   echo "$ac_t""yes" 1>&6
5323   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5324                                         cat >> confdefs.h <<\EOF
5325 #define HAVE_SCHED_YIELD 1
5326 EOF
5327
5328                                         ac_cv_func_sched_yield=yes
5329 else
5330   echo "$ac_t""no" 1>&6
5331 ac_cv_func_sched_yield=no
5332 fi
5333
5334                         fi
5335                         if test $ac_cv_func_sched_yield = no -a \
5336                                 $ac_cv_func_pthread_yield = no ; then
5337                                                                                                 for ac_func in thr_yield
5338 do
5339 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5340 echo "configure:5341: checking for $ac_func" >&5
5341 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5342   echo $ac_n "(cached) $ac_c" 1>&6
5343 else
5344   cat > conftest.$ac_ext <<EOF
5345 #line 5346 "configure"
5346 #include "confdefs.h"
5347 /* System header to define __stub macros and hopefully few prototypes,
5348     which can conflict with char $ac_func(); below.  */
5349 #include <assert.h>
5350 /* Override any gcc2 internal prototype to avoid an error.  */
5351 /* We use char because int might match the return type of a gcc2
5352     builtin and then its argument prototype would still apply.  */
5353 char $ac_func();
5354
5355 int main() {
5356
5357 /* The GNU C library defines this for functions which it implements
5358     to always fail with ENOSYS.  Some functions are actually named
5359     something starting with __ and the normal name is an alias.  */
5360 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5361 choke me
5362 #else
5363 $ac_func();
5364 #endif
5365
5366 ; return 0; }
5367 EOF
5368 if { (eval echo configure:5369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5369   rm -rf conftest*
5370   eval "ac_cv_func_$ac_func=yes"
5371 else
5372   echo "configure: failed program was:" >&5
5373   cat conftest.$ac_ext >&5
5374   rm -rf conftest*
5375   eval "ac_cv_func_$ac_func=no"
5376 fi
5377 rm -f conftest*
5378 fi
5379
5380 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5381   echo "$ac_t""yes" 1>&6
5382     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5383   cat >> confdefs.h <<EOF
5384 #define $ac_tr_func 1
5385 EOF
5386  
5387 else
5388   echo "$ac_t""no" 1>&6
5389 fi
5390 done
5391
5392                         fi
5393                         if test $ac_cv_func_sched_yield = no -a \
5394                                 $ac_cv_func_pthread_yield = no -a \
5395                                 "$ac_cv_func_thr_yield" = no ; then
5396                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
5397                         fi
5398
5399                                                 for ac_func in pthread_kill
5400 do
5401 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5402 echo "configure:5403: checking for $ac_func" >&5
5403 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5404   echo $ac_n "(cached) $ac_c" 1>&6
5405 else
5406   cat > conftest.$ac_ext <<EOF
5407 #line 5408 "configure"
5408 #include "confdefs.h"
5409 /* System header to define __stub macros and hopefully few prototypes,
5410     which can conflict with char $ac_func(); below.  */
5411 #include <assert.h>
5412 /* Override any gcc2 internal prototype to avoid an error.  */
5413 /* We use char because int might match the return type of a gcc2
5414     builtin and then its argument prototype would still apply.  */
5415 char $ac_func();
5416
5417 int main() {
5418
5419 /* The GNU C library defines this for functions which it implements
5420     to always fail with ENOSYS.  Some functions are actually named
5421     something starting with __ and the normal name is an alias.  */
5422 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5423 choke me
5424 #else
5425 $ac_func();
5426 #endif
5427
5428 ; return 0; }
5429 EOF
5430 if { (eval echo configure:5431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5431   rm -rf conftest*
5432   eval "ac_cv_func_$ac_func=yes"
5433 else
5434   echo "configure: failed program was:" >&5
5435   cat conftest.$ac_ext >&5
5436   rm -rf conftest*
5437   eval "ac_cv_func_$ac_func=no"
5438 fi
5439 rm -f conftest*
5440 fi
5441
5442 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5443   echo "$ac_t""yes" 1>&6
5444     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5445   cat >> confdefs.h <<EOF
5446 #define $ac_tr_func 1
5447 EOF
5448  
5449 else
5450   echo "$ac_t""no" 1>&6
5451 fi
5452 done
5453
5454
5455                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
5456 echo "configure:5457: checking for pthread_detach with <pthread.h>" >&5
5457 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
5458   echo $ac_n "(cached) $ac_c" 1>&6
5459 else
5460   
5461                                                                 cat > conftest.$ac_ext <<EOF
5462 #line 5463 "configure"
5463 #include "confdefs.h"
5464 #include <pthread.h>
5465 int main() {
5466 pthread_detach(NULL);
5467 ; return 0; }
5468 EOF
5469 if { (eval echo configure:5470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5470   rm -rf conftest*
5471   ol_cv_func_pthread_detach=yes
5472 else
5473   echo "configure: failed program was:" >&5
5474   cat conftest.$ac_ext >&5
5475   rm -rf conftest*
5476   ol_cv_func_pthread_detach=no
5477 fi
5478 rm -f conftest*
5479                         
5480 fi
5481
5482 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
5483
5484                         if test $ol_cv_func_pthread_detach = no ; then
5485                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
5486                         fi
5487
5488                         cat >> confdefs.h <<\EOF
5489 #define HAVE_PTHREAD_DETACH 1
5490 EOF
5491
5492
5493                                                 for ac_func in \
5494                                 pthread_setconcurrency \
5495                                 pthread_getconcurrency \
5496                                 thr_setconcurrency \
5497                                 thr_getconcurrency \
5498                         
5499 do
5500 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5501 echo "configure:5502: checking for $ac_func" >&5
5502 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5503   echo $ac_n "(cached) $ac_c" 1>&6
5504 else
5505   cat > conftest.$ac_ext <<EOF
5506 #line 5507 "configure"
5507 #include "confdefs.h"
5508 /* System header to define __stub macros and hopefully few prototypes,
5509     which can conflict with char $ac_func(); below.  */
5510 #include <assert.h>
5511 /* Override any gcc2 internal prototype to avoid an error.  */
5512 /* We use char because int might match the return type of a gcc2
5513     builtin and then its argument prototype would still apply.  */
5514 char $ac_func();
5515
5516 int main() {
5517
5518 /* The GNU C library defines this for functions which it implements
5519     to always fail with ENOSYS.  Some functions are actually named
5520     something starting with __ and the normal name is an alias.  */
5521 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5522 choke me
5523 #else
5524 $ac_func();
5525 #endif
5526
5527 ; return 0; }
5528 EOF
5529 if { (eval echo configure:5530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5530   rm -rf conftest*
5531   eval "ac_cv_func_$ac_func=yes"
5532 else
5533   echo "configure: failed program was:" >&5
5534   cat conftest.$ac_ext >&5
5535   rm -rf conftest*
5536   eval "ac_cv_func_$ac_func=no"
5537 fi
5538 rm -f conftest*
5539 fi
5540
5541 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5542   echo "$ac_t""yes" 1>&6
5543     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5544   cat >> confdefs.h <<EOF
5545 #define $ac_tr_func 1
5546 EOF
5547  
5548 else
5549   echo "$ac_t""no" 1>&6
5550 fi
5551 done
5552
5553
5554                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
5555 echo "configure:5556: checking if pthread_create() works" >&5
5556                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
5557   echo $ac_n "(cached) $ac_c" 1>&6
5558 else
5559   
5560                         if test "$cross_compiling" = yes; then
5561                                 ol_cv_pthread_create_works=yes
5562 else
5563   cat > conftest.$ac_ext <<EOF
5564 #line 5565 "configure"
5565 #include "confdefs.h"
5566
5567 #include <pthread.h>
5568 #ifndef NULL
5569 #define NULL (void*)0
5570 #endif
5571
5572 static void *task(p)
5573         void *p;
5574 {
5575         return (void *) (p == NULL);
5576 }
5577
5578 int main(argc, argv)
5579         int argc;
5580         char **argv;
5581 {
5582         pthread_t t;
5583 #if HAVE_PTHREADS_D4
5584         exit(pthread_create(&t, pthread_attr_default, task, NULL));
5585 #else
5586         exit(pthread_create(&t, NULL, task, NULL));
5587 #endif
5588 }
5589
5590 EOF
5591 if { (eval echo configure:5592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5592 then
5593   ol_cv_pthread_create_works=yes
5594 else
5595   echo "configure: failed program was:" >&5
5596   cat conftest.$ac_ext >&5
5597   rm -fr conftest*
5598   ol_cv_pthread_create_works=no
5599 fi
5600 rm -fr conftest*
5601 fi
5602
5603 fi
5604
5605                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
5606
5607                         if test $ol_cv_pthread_create_works = no ; then
5608                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
5609                         fi
5610
5611                                                 if test $ol_with_yielding_select = auto ; then
5612                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
5613 echo "configure:5614: checking if select yields when using pthreads" >&5
5614                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
5615   echo $ac_n "(cached) $ac_c" 1>&6
5616 else
5617   
5618                                 if test "$cross_compiling" = yes; then
5619   
5620                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
5621 else
5622   cat > conftest.$ac_ext <<EOF
5623 #line 5624 "configure"
5624 #include "confdefs.h"
5625
5626 #include <sys/types.h>
5627 #include <sys/time.h>
5628 #include <unistd.h>
5629 #include <pthread.h>
5630 #ifndef NULL
5631 #define NULL (void*) 0
5632 #endif
5633
5634 static int fildes[2];
5635
5636 static void *task(p)
5637         void *p;
5638 {
5639         int i;
5640         struct timeval tv;
5641
5642         fd_set rfds;
5643
5644         tv.tv_sec=10;
5645         tv.tv_usec=0;
5646
5647         FD_ZERO(&rfds);
5648         FD_SET(fildes[0], &rfds);
5649
5650         /* we're not interested in any fds */
5651         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
5652
5653         if(i < 0) {
5654                 perror("select");
5655                 exit(10);
5656         }
5657
5658         exit(0); /* if we exit here, the select blocked the whole process */
5659 }
5660
5661 int main(argc, argv)
5662         int argc;
5663         char **argv;
5664 {
5665         pthread_t t;
5666
5667         /* create a pipe to select */
5668         if(pipe(&fildes[0])) {
5669                 perror("select");
5670                 exit(1);
5671         }
5672
5673 #ifdef HAVE_PTHREAD_SETCONCURRENCY
5674         (void) pthread_setconcurrency(2);
5675 #else
5676 #ifdef HAVE_THR_SETCONCURRENCY
5677         /* Set Solaris LWP concurrency to 2 */
5678         thr_setconcurrency(2);
5679 #endif
5680 #endif
5681
5682 #if HAVE_PTHREADS_D4
5683         pthread_create(&t, pthread_attr_default, task, NULL);
5684 #else
5685         pthread_create(&t, NULL, task, NULL);
5686 #endif
5687
5688 #if HAVE_SCHED_YIELD
5689         sched_yield();  /* make sure task runs first */
5690 #else
5691 #ifdef HAVE_PTHREAD_YIELD
5692         pthread_yield();        /* make sure task runs first */
5693 #endif
5694 #endif
5695
5696         exit(2);
5697 }
5698 EOF
5699 if { (eval echo configure:5700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5700 then
5701   ol_cv_pthread_select_yields=no
5702 else
5703   echo "configure: failed program was:" >&5
5704   cat conftest.$ac_ext >&5
5705   rm -fr conftest*
5706   ol_cv_pthread_select_yields=yes
5707 fi
5708 rm -fr conftest*
5709 fi
5710
5711 fi
5712
5713                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
5714
5715                                 if test $ol_cv_pthread_select_yields = yes ; then
5716                                         ol_with_yielding_select=yes
5717                                 fi
5718                         fi
5719
5720                                                 CPPFLAGS="$save_CPPFLAGS"
5721                         LIBS="$save_LIBS"
5722                 else
5723                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
5724                 fi
5725         fi
5726
5727         if test $ol_with_threads = posix ; then
5728                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
5729         fi
5730 fi
5731
5732 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5733         -o $ol_with_threads = mach ; then
5734
5735                 for ac_hdr in mach/cthreads.h
5736 do
5737 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5738 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5739 echo "configure:5740: checking for $ac_hdr" >&5
5740 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5741   echo $ac_n "(cached) $ac_c" 1>&6
5742 else
5743   cat > conftest.$ac_ext <<EOF
5744 #line 5745 "configure"
5745 #include "confdefs.h"
5746 #include <$ac_hdr>
5747 EOF
5748 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5749 { (eval echo configure:5750: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5750 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5751 if test -z "$ac_err"; then
5752   rm -rf conftest*
5753   eval "ac_cv_header_$ac_safe=yes"
5754 else
5755   echo "$ac_err" >&5
5756   echo "configure: failed program was:" >&5
5757   cat conftest.$ac_ext >&5
5758   rm -rf conftest*
5759   eval "ac_cv_header_$ac_safe=no"
5760 fi
5761 rm -f conftest*
5762 fi
5763 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5764   echo "$ac_t""yes" 1>&6
5765     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5766   cat >> confdefs.h <<EOF
5767 #define $ac_tr_hdr 1
5768 EOF
5769  
5770 else
5771   echo "$ac_t""no" 1>&6
5772 fi
5773 done
5774
5775         if test $ac_cv_header_mach_cthreads_h = yes ; then
5776                 ol_with_threads=found
5777
5778                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
5779 echo "configure:5780: checking for cthread_fork" >&5
5780 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
5781   echo $ac_n "(cached) $ac_c" 1>&6
5782 else
5783   cat > conftest.$ac_ext <<EOF
5784 #line 5785 "configure"
5785 #include "confdefs.h"
5786 /* System header to define __stub macros and hopefully few prototypes,
5787     which can conflict with char cthread_fork(); below.  */
5788 #include <assert.h>
5789 /* Override any gcc2 internal prototype to avoid an error.  */
5790 /* We use char because int might match the return type of a gcc2
5791     builtin and then its argument prototype would still apply.  */
5792 char cthread_fork();
5793
5794 int main() {
5795
5796 /* The GNU C library defines this for functions which it implements
5797     to always fail with ENOSYS.  Some functions are actually named
5798     something starting with __ and the normal name is an alias.  */
5799 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
5800 choke me
5801 #else
5802 cthread_fork();
5803 #endif
5804
5805 ; return 0; }
5806 EOF
5807 if { (eval echo configure:5808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5808   rm -rf conftest*
5809   eval "ac_cv_func_cthread_fork=yes"
5810 else
5811   echo "configure: failed program was:" >&5
5812   cat conftest.$ac_ext >&5
5813   rm -rf conftest*
5814   eval "ac_cv_func_cthread_fork=no"
5815 fi
5816 rm -f conftest*
5817 fi
5818
5819 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
5820   echo "$ac_t""yes" 1>&6
5821   ol_link_threads=yes
5822 else
5823   echo "$ac_t""no" 1>&6
5824 fi
5825
5826
5827                 if test $ol_link_threads = no ; then
5828                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
5829 echo "configure:5830: checking for cthread_fork with -all_load" >&5
5830 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
5831   echo $ac_n "(cached) $ac_c" 1>&6
5832 else
5833   
5834                                                                 save_LIBS="$LIBS"
5835                                 LIBS="-all_load $LIBS"
5836                                 cat > conftest.$ac_ext <<EOF
5837 #line 5838 "configure"
5838 #include "confdefs.h"
5839 #include <mach/cthreads.h>
5840 int main() {
5841
5842                                         cthread_fork((void *)0, (void *)0);
5843                                         
5844 ; return 0; }
5845 EOF
5846 if { (eval echo configure:5847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5847   rm -rf conftest*
5848   ol_cv_cthread_all_load=yes
5849 else
5850   echo "configure: failed program was:" >&5
5851   cat conftest.$ac_ext >&5
5852   rm -rf conftest*
5853   ol_cv_cthread_all_load=no
5854 fi
5855 rm -f conftest*
5856                                                                 LIBS="$save_LIBS"
5857                         
5858 fi
5859
5860 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
5861
5862                         if test $ol_cv_cthread_all_load = yes ; then
5863                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
5864                                 ol_link_threads=mach
5865                         fi
5866                 fi
5867
5868                 if test $ol_link_threads != no ; then
5869                         : check for cthread specific functionality here
5870                         cat >> confdefs.h <<\EOF
5871 #define HAVE_MACH_CTHREADS 1
5872 EOF
5873
5874                 else
5875                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
5876                 fi
5877         fi
5878
5879         if test $ol_with_threads = mach ; then
5880                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
5881         fi
5882 fi
5883
5884 if test $ol_with_threads = auto -o $ol_with_threads = yes \
5885         -o $ol_with_threads = lwp ; then
5886
5887                 for ac_hdr in thread.h synch.h
5888 do
5889 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5890 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5891 echo "configure:5892: checking for $ac_hdr" >&5
5892 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
5893   echo $ac_n "(cached) $ac_c" 1>&6
5894 else
5895   cat > conftest.$ac_ext <<EOF
5896 #line 5897 "configure"
5897 #include "confdefs.h"
5898 #include <$ac_hdr>
5899 EOF
5900 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5901 { (eval echo configure:5902: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5902 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5903 if test -z "$ac_err"; then
5904   rm -rf conftest*
5905   eval "ac_cv_header_$ac_safe=yes"
5906 else
5907   echo "$ac_err" >&5
5908   echo "configure: failed program was:" >&5
5909   cat conftest.$ac_ext >&5
5910   rm -rf conftest*
5911   eval "ac_cv_header_$ac_safe=no"
5912 fi
5913 rm -f conftest*
5914 fi
5915 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5916   echo "$ac_t""yes" 1>&6
5917     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5918   cat >> confdefs.h <<EOF
5919 #define $ac_tr_hdr 1
5920 EOF
5921  
5922 else
5923   echo "$ac_t""no" 1>&6
5924 fi
5925 done
5926
5927         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
5928                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
5929 echo "configure:5930: checking for thr_create in -lthread" >&5
5930 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
5931 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5932   echo $ac_n "(cached) $ac_c" 1>&6
5933 else
5934   ac_save_LIBS="$LIBS"
5935 LIBS="-lthread  $LIBS"
5936 cat > conftest.$ac_ext <<EOF
5937 #line 5938 "configure"
5938 #include "confdefs.h"
5939 /* Override any gcc2 internal prototype to avoid an error.  */
5940 /* We use char because int might match the return type of a gcc2
5941     builtin and then its argument prototype would still apply.  */
5942 char thr_create();
5943
5944 int main() {
5945 thr_create()
5946 ; return 0; }
5947 EOF
5948 if { (eval echo configure:5949: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5949   rm -rf conftest*
5950   eval "ac_cv_lib_$ac_lib_var=yes"
5951 else
5952   echo "configure: failed program was:" >&5
5953   cat conftest.$ac_ext >&5
5954   rm -rf conftest*
5955   eval "ac_cv_lib_$ac_lib_var=no"
5956 fi
5957 rm -f conftest*
5958 LIBS="$ac_save_LIBS"
5959
5960 fi
5961 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5962   echo "$ac_t""yes" 1>&6
5963   have_thr=yes
5964 else
5965   echo "$ac_t""no" 1>&6
5966 have_thr=no
5967 fi
5968
5969
5970                 if test $have_thr = yes ; then
5971                         cat >> confdefs.h <<\EOF
5972 #define HAVE_THR 1
5973 EOF
5974
5975                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
5976                         ol_link_threads=thr
5977
5978                         if test $ol_with_yielding_select = auto ; then
5979                                 ol_with_yielding_select=yes
5980                         fi
5981
5982                                                 for ac_func in \
5983                                 thr_setconcurrency \
5984                                 thr_getconcurrency \
5985                         
5986 do
5987 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5988 echo "configure:5989: checking for $ac_func" >&5
5989 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5990   echo $ac_n "(cached) $ac_c" 1>&6
5991 else
5992   cat > conftest.$ac_ext <<EOF
5993 #line 5994 "configure"
5994 #include "confdefs.h"
5995 /* System header to define __stub macros and hopefully few prototypes,
5996     which can conflict with char $ac_func(); below.  */
5997 #include <assert.h>
5998 /* Override any gcc2 internal prototype to avoid an error.  */
5999 /* We use char because int might match the return type of a gcc2
6000     builtin and then its argument prototype would still apply.  */
6001 char $ac_func();
6002
6003 int main() {
6004
6005 /* The GNU C library defines this for functions which it implements
6006     to always fail with ENOSYS.  Some functions are actually named
6007     something starting with __ and the normal name is an alias.  */
6008 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6009 choke me
6010 #else
6011 $ac_func();
6012 #endif
6013
6014 ; return 0; }
6015 EOF
6016 if { (eval echo configure:6017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6017   rm -rf conftest*
6018   eval "ac_cv_func_$ac_func=yes"
6019 else
6020   echo "configure: failed program was:" >&5
6021   cat conftest.$ac_ext >&5
6022   rm -rf conftest*
6023   eval "ac_cv_func_$ac_func=no"
6024 fi
6025 rm -f conftest*
6026 fi
6027
6028 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6029   echo "$ac_t""yes" 1>&6
6030     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6031   cat >> confdefs.h <<EOF
6032 #define $ac_tr_func 1
6033 EOF
6034  
6035 else
6036   echo "$ac_t""no" 1>&6
6037 fi
6038 done
6039
6040                 fi
6041         fi
6042
6043                 for ac_hdr in lwp/lwp.h
6044 do
6045 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6046 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6047 echo "configure:6048: checking for $ac_hdr" >&5
6048 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6049   echo $ac_n "(cached) $ac_c" 1>&6
6050 else
6051   cat > conftest.$ac_ext <<EOF
6052 #line 6053 "configure"
6053 #include "confdefs.h"
6054 #include <$ac_hdr>
6055 EOF
6056 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6057 { (eval echo configure:6058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6058 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6059 if test -z "$ac_err"; then
6060   rm -rf conftest*
6061   eval "ac_cv_header_$ac_safe=yes"
6062 else
6063   echo "$ac_err" >&5
6064   echo "configure: failed program was:" >&5
6065   cat conftest.$ac_ext >&5
6066   rm -rf conftest*
6067   eval "ac_cv_header_$ac_safe=no"
6068 fi
6069 rm -f conftest*
6070 fi
6071 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6072   echo "$ac_t""yes" 1>&6
6073     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6074   cat >> confdefs.h <<EOF
6075 #define $ac_tr_hdr 1
6076 EOF
6077  
6078 else
6079   echo "$ac_t""no" 1>&6
6080 fi
6081 done
6082
6083         if test $ac_cv_header_lwp_lwp_h = yes ; then
6084                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6085 echo "configure:6086: checking for lwp_create in -llwp" >&5
6086 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6087 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6088   echo $ac_n "(cached) $ac_c" 1>&6
6089 else
6090   ac_save_LIBS="$LIBS"
6091 LIBS="-llwp  $LIBS"
6092 cat > conftest.$ac_ext <<EOF
6093 #line 6094 "configure"
6094 #include "confdefs.h"
6095 /* Override any gcc2 internal prototype to avoid an error.  */
6096 /* We use char because int might match the return type of a gcc2
6097     builtin and then its argument prototype would still apply.  */
6098 char lwp_create();
6099
6100 int main() {
6101 lwp_create()
6102 ; return 0; }
6103 EOF
6104 if { (eval echo configure:6105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6105   rm -rf conftest*
6106   eval "ac_cv_lib_$ac_lib_var=yes"
6107 else
6108   echo "configure: failed program was:" >&5
6109   cat conftest.$ac_ext >&5
6110   rm -rf conftest*
6111   eval "ac_cv_lib_$ac_lib_var=no"
6112 fi
6113 rm -f conftest*
6114 LIBS="$ac_save_LIBS"
6115
6116 fi
6117 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6118   echo "$ac_t""yes" 1>&6
6119   have_lwp=yes
6120 else
6121   echo "$ac_t""no" 1>&6
6122 have_lwp=no
6123 fi
6124
6125
6126                 if test $have_lwp = yes ; then
6127                         cat >> confdefs.h <<\EOF
6128 #define HAVE_LWP 1
6129 EOF
6130
6131                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6132                         ol_link_threads=lwp
6133
6134                         if test $ol_with_yielding_select = auto ; then
6135                                 ol_with_yielding_select=no
6136                         fi
6137                 fi
6138         fi
6139 fi
6140
6141 if test $ol_with_yielding_select = yes ; then
6142         cat >> confdefs.h <<\EOF
6143 #define HAVE_YIELDING_SELECT 1
6144 EOF
6145
6146 fi
6147
6148 if test $ol_with_threads = manual ; then
6149                 ol_link_threads=yes
6150
6151         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6152
6153         for ac_hdr in pthread.h sched.h
6154 do
6155 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6156 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6157 echo "configure:6158: checking for $ac_hdr" >&5
6158 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6159   echo $ac_n "(cached) $ac_c" 1>&6
6160 else
6161   cat > conftest.$ac_ext <<EOF
6162 #line 6163 "configure"
6163 #include "confdefs.h"
6164 #include <$ac_hdr>
6165 EOF
6166 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6167 { (eval echo configure:6168: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6168 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6169 if test -z "$ac_err"; then
6170   rm -rf conftest*
6171   eval "ac_cv_header_$ac_safe=yes"
6172 else
6173   echo "$ac_err" >&5
6174   echo "configure: failed program was:" >&5
6175   cat conftest.$ac_ext >&5
6176   rm -rf conftest*
6177   eval "ac_cv_header_$ac_safe=no"
6178 fi
6179 rm -f conftest*
6180 fi
6181 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6182   echo "$ac_t""yes" 1>&6
6183     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6184   cat >> confdefs.h <<EOF
6185 #define $ac_tr_hdr 1
6186 EOF
6187  
6188 else
6189   echo "$ac_t""no" 1>&6
6190 fi
6191 done
6192
6193         for ac_func in sched_yield pthread_yield
6194 do
6195 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6196 echo "configure:6197: checking for $ac_func" >&5
6197 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6198   echo $ac_n "(cached) $ac_c" 1>&6
6199 else
6200   cat > conftest.$ac_ext <<EOF
6201 #line 6202 "configure"
6202 #include "confdefs.h"
6203 /* System header to define __stub macros and hopefully few prototypes,
6204     which can conflict with char $ac_func(); below.  */
6205 #include <assert.h>
6206 /* Override any gcc2 internal prototype to avoid an error.  */
6207 /* We use char because int might match the return type of a gcc2
6208     builtin and then its argument prototype would still apply.  */
6209 char $ac_func();
6210
6211 int main() {
6212
6213 /* The GNU C library defines this for functions which it implements
6214     to always fail with ENOSYS.  Some functions are actually named
6215     something starting with __ and the normal name is an alias.  */
6216 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6217 choke me
6218 #else
6219 $ac_func();
6220 #endif
6221
6222 ; return 0; }
6223 EOF
6224 if { (eval echo configure:6225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6225   rm -rf conftest*
6226   eval "ac_cv_func_$ac_func=yes"
6227 else
6228   echo "configure: failed program was:" >&5
6229   cat conftest.$ac_ext >&5
6230   rm -rf conftest*
6231   eval "ac_cv_func_$ac_func=no"
6232 fi
6233 rm -f conftest*
6234 fi
6235
6236 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6237   echo "$ac_t""yes" 1>&6
6238     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6239   cat >> confdefs.h <<EOF
6240 #define $ac_tr_func 1
6241 EOF
6242  
6243 else
6244   echo "$ac_t""no" 1>&6
6245 fi
6246 done
6247
6248         
6249 echo $ac_n "checking for LinuxThreads""... $ac_c" 1>&6
6250 echo "configure:6251: checking for LinuxThreads" >&5
6251 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6252   echo $ac_n "(cached) $ac_c" 1>&6
6253 else
6254   
6255         res=`grep Linuxthreads /usr/include/pthread.h 2>/dev/null | wc -l`
6256         if test "$res" -gt 0 ; then
6257                 ol_cv_linux_threads=yes
6258         else
6259                 ol_cv_linux_threads=no
6260         fi
6261
6262 fi
6263
6264 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6265
6266
6267         for ac_hdr in mach/cthreads.h
6268 do
6269 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6270 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6271 echo "configure:6272: checking for $ac_hdr" >&5
6272 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6273   echo $ac_n "(cached) $ac_c" 1>&6
6274 else
6275   cat > conftest.$ac_ext <<EOF
6276 #line 6277 "configure"
6277 #include "confdefs.h"
6278 #include <$ac_hdr>
6279 EOF
6280 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6281 { (eval echo configure:6282: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6282 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6283 if test -z "$ac_err"; then
6284   rm -rf conftest*
6285   eval "ac_cv_header_$ac_safe=yes"
6286 else
6287   echo "$ac_err" >&5
6288   echo "configure: failed program was:" >&5
6289   cat conftest.$ac_ext >&5
6290   rm -rf conftest*
6291   eval "ac_cv_header_$ac_safe=no"
6292 fi
6293 rm -f conftest*
6294 fi
6295 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6296   echo "$ac_t""yes" 1>&6
6297     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6298   cat >> confdefs.h <<EOF
6299 #define $ac_tr_hdr 1
6300 EOF
6301  
6302 else
6303   echo "$ac_t""no" 1>&6
6304 fi
6305 done
6306
6307         for ac_hdr in lwp/lwp.h
6308 do
6309 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6310 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6311 echo "configure:6312: checking for $ac_hdr" >&5
6312 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6313   echo $ac_n "(cached) $ac_c" 1>&6
6314 else
6315   cat > conftest.$ac_ext <<EOF
6316 #line 6317 "configure"
6317 #include "confdefs.h"
6318 #include <$ac_hdr>
6319 EOF
6320 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6321 { (eval echo configure:6322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6322 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6323 if test -z "$ac_err"; then
6324   rm -rf conftest*
6325   eval "ac_cv_header_$ac_safe=yes"
6326 else
6327   echo "$ac_err" >&5
6328   echo "configure: failed program was:" >&5
6329   cat conftest.$ac_ext >&5
6330   rm -rf conftest*
6331   eval "ac_cv_header_$ac_safe=no"
6332 fi
6333 rm -f conftest*
6334 fi
6335 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6336   echo "$ac_t""yes" 1>&6
6337     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6338   cat >> confdefs.h <<EOF
6339 #define $ac_tr_hdr 1
6340 EOF
6341  
6342 else
6343   echo "$ac_t""no" 1>&6
6344 fi
6345 done
6346
6347         for ac_hdr in thread.h synch.h
6348 do
6349 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6350 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6351 echo "configure:6352: checking for $ac_hdr" >&5
6352 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6353   echo $ac_n "(cached) $ac_c" 1>&6
6354 else
6355   cat > conftest.$ac_ext <<EOF
6356 #line 6357 "configure"
6357 #include "confdefs.h"
6358 #include <$ac_hdr>
6359 EOF
6360 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6361 { (eval echo configure:6362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6362 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6363 if test -z "$ac_err"; then
6364   rm -rf conftest*
6365   eval "ac_cv_header_$ac_safe=yes"
6366 else
6367   echo "$ac_err" >&5
6368   echo "configure: failed program was:" >&5
6369   cat conftest.$ac_ext >&5
6370   rm -rf conftest*
6371   eval "ac_cv_header_$ac_safe=no"
6372 fi
6373 rm -f conftest*
6374 fi
6375 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6376   echo "$ac_t""yes" 1>&6
6377     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6378   cat >> confdefs.h <<EOF
6379 #define $ac_tr_hdr 1
6380 EOF
6381  
6382 else
6383   echo "$ac_t""no" 1>&6
6384 fi
6385 done
6386
6387 fi
6388
6389 if test $ol_link_threads != no ; then  
6390                         cat >> confdefs.h <<\EOF
6391 #define REENTRANT 1
6392 EOF
6393
6394         cat >> confdefs.h <<\EOF
6395 #define _REENTRANT 1
6396 EOF
6397
6398         cat >> confdefs.h <<\EOF
6399 #define THREAD_SAFE 1
6400 EOF
6401
6402         cat >> confdefs.h <<\EOF
6403 #define _THREAD_SAFE 1
6404 EOF
6405
6406         cat >> confdefs.h <<\EOF
6407 #define THREADSAFE 1
6408 EOF
6409
6410         cat >> confdefs.h <<\EOF
6411 #define _THREADSAFE 1
6412 EOF
6413
6414
6415                                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
6416 echo "configure:6417: checking for thread specific errno" >&5
6417 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
6418   echo $ac_n "(cached) $ac_c" 1>&6
6419 else
6420   
6421                 cat > conftest.$ac_ext <<EOF
6422 #line 6423 "configure"
6423 #include "confdefs.h"
6424 #include <errno.h>
6425 int main() {
6426 int x = errno;
6427 ; return 0; }
6428 EOF
6429 if { (eval echo configure:6430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6430   rm -rf conftest*
6431   ol_cv_errno_thread_specific=yes
6432 else
6433   echo "configure: failed program was:" >&5
6434   cat conftest.$ac_ext >&5
6435   rm -rf conftest*
6436   ol_cv_errno_thread_specific=no
6437 fi
6438 rm -f conftest*
6439         
6440 fi
6441
6442 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
6443
6444         if test $ol_cv_errno_thread_specific != yes ; then
6445                 LIBS="$LTHREAD_LIBS $LIBS"
6446                 LTHREAD_LIBS=""
6447         fi
6448
6449 fi  
6450
6451 if test $ol_link_threads = no ; then
6452         if test $ol_with_threads = yes ; then
6453                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
6454         fi
6455
6456         if test $ol_with_threads = auto ; then
6457                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
6458                 ol_with_threads=no
6459         fi
6460
6461         cat >> confdefs.h <<\EOF
6462 #define NO_THREADS 1
6463 EOF
6464
6465         LTHREAD_LIBS=""
6466 fi
6467
6468 if test $ol_link_threads != no ; then
6469         cat >> confdefs.h <<\EOF
6470 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
6471 EOF
6472
6473 fi
6474
6475
6476 ol_link_ldbm=no 
6477 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
6478         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
6479 echo "configure:6480: checking for DB2 library" >&5
6480 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
6481   echo $ac_n "(cached) $ac_c" 1>&6
6482 else
6483         ol_LIBS="$LIBS"
6484         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
6485 echo "configure:6486: checking for db_open in -ldb" >&5
6486 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
6487 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6488   echo $ac_n "(cached) $ac_c" 1>&6
6489 else
6490   ac_save_LIBS="$LIBS"
6491 LIBS="-ldb  $LIBS"
6492 cat > conftest.$ac_ext <<EOF
6493 #line 6494 "configure"
6494 #include "confdefs.h"
6495 /* Override any gcc2 internal prototype to avoid an error.  */
6496 /* We use char because int might match the return type of a gcc2
6497     builtin and then its argument prototype would still apply.  */
6498 char db_open();
6499
6500 int main() {
6501 db_open()
6502 ; return 0; }
6503 EOF
6504 if { (eval echo configure:6505: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6505   rm -rf conftest*
6506   eval "ac_cv_lib_$ac_lib_var=yes"
6507 else
6508   echo "configure: failed program was:" >&5
6509   cat conftest.$ac_ext >&5
6510   rm -rf conftest*
6511   eval "ac_cv_lib_$ac_lib_var=no"
6512 fi
6513 rm -f conftest*
6514 LIBS="$ac_save_LIBS"
6515
6516 fi
6517 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6518   echo "$ac_t""yes" 1>&6
6519   ol_cv_lib_db2=-ldb
6520 else
6521   echo "$ac_t""no" 1>&6
6522 ol_cv_lib_db2=no
6523 fi
6524
6525         LIBS="$ol_LIBS"
6526
6527 fi
6528
6529 echo "$ac_t""$ol_cv_lib_db2" 1>&6
6530
6531 for ac_hdr in db.h
6532 do
6533 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6534 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6535 echo "configure:6536: checking for $ac_hdr" >&5
6536 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6537   echo $ac_n "(cached) $ac_c" 1>&6
6538 else
6539   cat > conftest.$ac_ext <<EOF
6540 #line 6541 "configure"
6541 #include "confdefs.h"
6542 #include <$ac_hdr>
6543 EOF
6544 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6545 { (eval echo configure:6546: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6546 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6547 if test -z "$ac_err"; then
6548   rm -rf conftest*
6549   eval "ac_cv_header_$ac_safe=yes"
6550 else
6551   echo "$ac_err" >&5
6552   echo "configure: failed program was:" >&5
6553   cat conftest.$ac_ext >&5
6554   rm -rf conftest*
6555   eval "ac_cv_header_$ac_safe=no"
6556 fi
6557 rm -f conftest*
6558 fi
6559 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6560   echo "$ac_t""yes" 1>&6
6561     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6562   cat >> confdefs.h <<EOF
6563 #define $ac_tr_hdr 1
6564 EOF
6565  
6566 else
6567   echo "$ac_t""no" 1>&6
6568 fi
6569 done
6570
6571 if test $ac_cv_header_db_h = yes ; then
6572         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
6573 echo "configure:6574: checking if db.h is DB2" >&5
6574 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
6575   echo $ac_n "(cached) $ac_c" 1>&6
6576 else
6577   
6578                 cat > conftest.$ac_ext <<EOF
6579 #line 6580 "configure"
6580 #include "confdefs.h"
6581
6582 #                       include <db.h>
6583                         /* this check could be improved */
6584 #                       ifdef DB_VERSION_MAJOR
6585 #                               if DB_VERSION_MAJOR == 2
6586                                         __db_version_2
6587 #                               endif
6588 #                       endif
6589                 
6590 EOF
6591 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6592   egrep "__db_version_2" >/dev/null 2>&1; then
6593   rm -rf conftest*
6594   ol_cv_header_db2=yes
6595 else
6596   rm -rf conftest*
6597   ol_cv_header_db2=no
6598 fi
6599 rm -f conftest*
6600
6601 fi
6602
6603 echo "$ac_t""$ol_cv_header_db2" 1>&6
6604 else
6605         ol_cv_header_db2=no
6606 fi
6607
6608
6609  
6610  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
6611 echo "configure:6612: checking for Berkeley DB2" >&5
6612 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
6613   echo $ac_n "(cached) $ac_c" 1>&6
6614 else
6615   
6616         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
6617                 ol_cv_berkeley_db2=no
6618         else
6619                 ol_cv_berkeley_db2=yes
6620         fi
6621
6622 fi
6623
6624 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
6625  if test $ol_cv_berkeley_db2 = yes ; then
6626         cat >> confdefs.h <<\EOF
6627 #define HAVE_BERKELEY_DB2 1
6628 EOF
6629
6630  fi
6631
6632
6633         if test $ol_cv_berkeley_db2 = yes ; then
6634                 ol_link_ldbm=db2
6635                 ol_with_ldbm_api=db2
6636
6637                 if test $ol_with_ldbm_type = hash ; then
6638                         cat >> confdefs.h <<\EOF
6639 #define LDBM_USE_DBHASH 1
6640 EOF
6641
6642                 else
6643                         cat >> confdefs.h <<\EOF
6644 #define LDBM_USE_DBBTREE 1
6645 EOF
6646
6647                 fi
6648
6649                                                 if test $ol_cv_lib_db2 != yes ; then
6650                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
6651                 fi
6652         fi
6653 fi
6654
6655 ol_link_bdb2=no
6656 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
6657         ol_link_bdb2=yes
6658 fi
6659
6660 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
6661         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
6662 echo "configure:6663: checking for Berkeley DB library" >&5
6663 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
6664   echo $ac_n "(cached) $ac_c" 1>&6
6665 else
6666         ol_LIBS="$LIBS"
6667         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
6668 echo "configure:6669: checking for dbopen" >&5
6669 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+set}'`\" = set"; then
6670   echo $ac_n "(cached) $ac_c" 1>&6
6671 else
6672   cat > conftest.$ac_ext <<EOF
6673 #line 6674 "configure"
6674 #include "confdefs.h"
6675 /* System header to define __stub macros and hopefully few prototypes,
6676     which can conflict with char dbopen(); below.  */
6677 #include <assert.h>
6678 /* Override any gcc2 internal prototype to avoid an error.  */
6679 /* We use char because int might match the return type of a gcc2
6680     builtin and then its argument prototype would still apply.  */
6681 char dbopen();
6682
6683 int main() {
6684
6685 /* The GNU C library defines this for functions which it implements
6686     to always fail with ENOSYS.  Some functions are actually named
6687     something starting with __ and the normal name is an alias.  */
6688 #if defined (__stub_dbopen) || defined (__stub___dbopen)
6689 choke me
6690 #else
6691 dbopen();
6692 #endif
6693
6694 ; return 0; }
6695 EOF
6696 if { (eval echo configure:6697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6697   rm -rf conftest*
6698   eval "ac_cv_func_dbopen=yes"
6699 else
6700   echo "configure: failed program was:" >&5
6701   cat conftest.$ac_ext >&5
6702   rm -rf conftest*
6703   eval "ac_cv_func_dbopen=no"
6704 fi
6705 rm -f conftest*
6706 fi
6707
6708 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
6709   echo "$ac_t""yes" 1>&6
6710   ol_cv_lib_db=yes
6711 else
6712   echo "$ac_t""no" 1>&6
6713
6714                 echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
6715 echo "configure:6716: checking for dbopen in -ldb" >&5
6716 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
6717 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6718   echo $ac_n "(cached) $ac_c" 1>&6
6719 else
6720   ac_save_LIBS="$LIBS"
6721 LIBS="-ldb  $LIBS"
6722 cat > conftest.$ac_ext <<EOF
6723 #line 6724 "configure"
6724 #include "confdefs.h"
6725 /* Override any gcc2 internal prototype to avoid an error.  */
6726 /* We use char because int might match the return type of a gcc2
6727     builtin and then its argument prototype would still apply.  */
6728 char dbopen();
6729
6730 int main() {
6731 dbopen()
6732 ; return 0; }
6733 EOF
6734 if { (eval echo configure:6735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6735   rm -rf conftest*
6736   eval "ac_cv_lib_$ac_lib_var=yes"
6737 else
6738   echo "configure: failed program was:" >&5
6739   cat conftest.$ac_ext >&5
6740   rm -rf conftest*
6741   eval "ac_cv_lib_$ac_lib_var=no"
6742 fi
6743 rm -f conftest*
6744 LIBS="$ac_save_LIBS"
6745
6746 fi
6747 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6748   echo "$ac_t""yes" 1>&6
6749   ol_cv_lib_db=-ldb
6750 else
6751   echo "$ac_t""no" 1>&6
6752 ol_cv_lib_db=no
6753 fi
6754
6755         
6756 fi
6757
6758         LIBS="$ol_LIBS"
6759
6760 fi
6761
6762 echo "$ac_t""$ol_cv_lib_db" 1>&6
6763
6764
6765 for ac_hdr in db_185.h
6766 do
6767 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6768 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6769 echo "configure:6770: checking for $ac_hdr" >&5
6770 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6771   echo $ac_n "(cached) $ac_c" 1>&6
6772 else
6773   cat > conftest.$ac_ext <<EOF
6774 #line 6775 "configure"
6775 #include "confdefs.h"
6776 #include <$ac_hdr>
6777 EOF
6778 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6779 { (eval echo configure:6780: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6780 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6781 if test -z "$ac_err"; then
6782   rm -rf conftest*
6783   eval "ac_cv_header_$ac_safe=yes"
6784 else
6785   echo "$ac_err" >&5
6786   echo "configure: failed program was:" >&5
6787   cat conftest.$ac_ext >&5
6788   rm -rf conftest*
6789   eval "ac_cv_header_$ac_safe=no"
6790 fi
6791 rm -f conftest*
6792 fi
6793 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6794   echo "$ac_t""yes" 1>&6
6795     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6796   cat >> confdefs.h <<EOF
6797 #define $ac_tr_hdr 1
6798 EOF
6799  
6800 else
6801   echo "$ac_t""no" 1>&6
6802 fi
6803 done
6804
6805 if test "$ol_cv_header_db2" = yes ; then
6806         
6807         ol_cv_header_db=$ac_cv_header_db_185_h
6808 else
6809         ol_cv_header_db=$ac_cv_header_db_h
6810 fi
6811
6812
6813  
6814  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
6815 echo "configure:6816: checking for Berkeley DB" >&5
6816 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
6817   echo $ac_n "(cached) $ac_c" 1>&6
6818 else
6819   
6820         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
6821                 ol_cv_berkeley_db=no
6822         else
6823                 ol_cv_berkeley_db=yes
6824         fi
6825
6826 fi
6827
6828 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
6829  if test $ol_cv_berkeley_db = yes ; then
6830         cat >> confdefs.h <<\EOF
6831 #define HAVE_BERKELEY_DB 1
6832 EOF
6833
6834  fi
6835
6836
6837         if test $ol_cv_berkeley_db = yes ; then
6838                 ol_link_ldbm=db
6839                 ol_with_ldbm_api=db
6840
6841                 if test $ol_with_ldbm_type = hash ; then
6842                         cat >> confdefs.h <<\EOF
6843 #define LDBM_USE_DBHASH 1
6844 EOF
6845
6846                 else
6847                         cat >> confdefs.h <<\EOF
6848 #define LDBM_USE_DBBTREE 1
6849 EOF
6850
6851                 fi
6852
6853                                                 if test $ol_cv_lib_db != yes ; then
6854                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
6855                 fi
6856         fi
6857 fi
6858
6859 if test $ol_with_ldbm_api = manual ; then
6860                 ol_link_ldbm=yes
6861
6862         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
6863
6864         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
6865 do
6866 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6867 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6868 echo "configure:6869: checking for $ac_hdr" >&5
6869 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6870   echo $ac_n "(cached) $ac_c" 1>&6
6871 else
6872   cat > conftest.$ac_ext <<EOF
6873 #line 6874 "configure"
6874 #include "confdefs.h"
6875 #include <$ac_hdr>
6876 EOF
6877 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6878 { (eval echo configure:6879: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6879 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6880 if test -z "$ac_err"; then
6881   rm -rf conftest*
6882   eval "ac_cv_header_$ac_safe=yes"
6883 else
6884   echo "$ac_err" >&5
6885   echo "configure: failed program was:" >&5
6886   cat conftest.$ac_ext >&5
6887   rm -rf conftest*
6888   eval "ac_cv_header_$ac_safe=no"
6889 fi
6890 rm -f conftest*
6891 fi
6892 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6893   echo "$ac_t""yes" 1>&6
6894     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6895   cat >> confdefs.h <<EOF
6896 #define $ac_tr_hdr 1
6897 EOF
6898  
6899 else
6900   echo "$ac_t""no" 1>&6
6901 fi
6902 done
6903
6904 fi
6905
6906 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
6907         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
6908         ol_with_ldbm_api=none
6909 fi
6910
6911 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
6912         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
6913 echo "configure:6914: checking for GDBM library" >&5
6914 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
6915   echo $ac_n "(cached) $ac_c" 1>&6
6916 else
6917         ol_LIBS="$LIBS"
6918         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
6919 echo "configure:6920: checking for gdbm_open" >&5
6920 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
6921   echo $ac_n "(cached) $ac_c" 1>&6
6922 else
6923   cat > conftest.$ac_ext <<EOF
6924 #line 6925 "configure"
6925 #include "confdefs.h"
6926 /* System header to define __stub macros and hopefully few prototypes,
6927     which can conflict with char gdbm_open(); below.  */
6928 #include <assert.h>
6929 /* Override any gcc2 internal prototype to avoid an error.  */
6930 /* We use char because int might match the return type of a gcc2
6931     builtin and then its argument prototype would still apply.  */
6932 char gdbm_open();
6933
6934 int main() {
6935
6936 /* The GNU C library defines this for functions which it implements
6937     to always fail with ENOSYS.  Some functions are actually named
6938     something starting with __ and the normal name is an alias.  */
6939 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
6940 choke me
6941 #else
6942 gdbm_open();
6943 #endif
6944
6945 ; return 0; }
6946 EOF
6947 if { (eval echo configure:6948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6948   rm -rf conftest*
6949   eval "ac_cv_func_gdbm_open=yes"
6950 else
6951   echo "configure: failed program was:" >&5
6952   cat conftest.$ac_ext >&5
6953   rm -rf conftest*
6954   eval "ac_cv_func_gdbm_open=no"
6955 fi
6956 rm -f conftest*
6957 fi
6958
6959 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
6960   echo "$ac_t""yes" 1>&6
6961   ol_cv_lib_gdbm=yes
6962 else
6963   echo "$ac_t""no" 1>&6
6964
6965                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
6966 echo "configure:6967: checking for gdbm_open in -lgdbm" >&5
6967 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
6968 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6969   echo $ac_n "(cached) $ac_c" 1>&6
6970 else
6971   ac_save_LIBS="$LIBS"
6972 LIBS="-lgdbm  $LIBS"
6973 cat > conftest.$ac_ext <<EOF
6974 #line 6975 "configure"
6975 #include "confdefs.h"
6976 /* Override any gcc2 internal prototype to avoid an error.  */
6977 /* We use char because int might match the return type of a gcc2
6978     builtin and then its argument prototype would still apply.  */
6979 char gdbm_open();
6980
6981 int main() {
6982 gdbm_open()
6983 ; return 0; }
6984 EOF
6985 if { (eval echo configure:6986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6986   rm -rf conftest*
6987   eval "ac_cv_lib_$ac_lib_var=yes"
6988 else
6989   echo "configure: failed program was:" >&5
6990   cat conftest.$ac_ext >&5
6991   rm -rf conftest*
6992   eval "ac_cv_lib_$ac_lib_var=no"
6993 fi
6994 rm -f conftest*
6995 LIBS="$ac_save_LIBS"
6996
6997 fi
6998 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6999   echo "$ac_t""yes" 1>&6
7000   ol_cv_lib_gdbm=-lgdbm
7001 else
7002   echo "$ac_t""no" 1>&6
7003 ol_cv_lib_gdbm=no
7004 fi
7005
7006         
7007 fi
7008
7009         LIBS="$ol_LIBS"
7010
7011 fi
7012
7013 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
7014
7015
7016  for ac_hdr in gdbm.h
7017 do
7018 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7019 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7020 echo "configure:7021: checking for $ac_hdr" >&5
7021 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7022   echo $ac_n "(cached) $ac_c" 1>&6
7023 else
7024   cat > conftest.$ac_ext <<EOF
7025 #line 7026 "configure"
7026 #include "confdefs.h"
7027 #include <$ac_hdr>
7028 EOF
7029 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7030 { (eval echo configure:7031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7031 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7032 if test -z "$ac_err"; then
7033   rm -rf conftest*
7034   eval "ac_cv_header_$ac_safe=yes"
7035 else
7036   echo "$ac_err" >&5
7037   echo "configure: failed program was:" >&5
7038   cat conftest.$ac_ext >&5
7039   rm -rf conftest*
7040   eval "ac_cv_header_$ac_safe=no"
7041 fi
7042 rm -f conftest*
7043 fi
7044 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7045   echo "$ac_t""yes" 1>&6
7046     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7047   cat >> confdefs.h <<EOF
7048 #define $ac_tr_hdr 1
7049 EOF
7050  
7051 else
7052   echo "$ac_t""no" 1>&6
7053 fi
7054 done
7055
7056  echo $ac_n "checking for db""... $ac_c" 1>&6
7057 echo "configure:7058: checking for db" >&5
7058 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
7059   echo $ac_n "(cached) $ac_c" 1>&6
7060 else
7061   
7062         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
7063                 ol_cv_gdbm=no
7064         else
7065                 ol_cv_gdbm=yes
7066         fi
7067
7068 fi
7069
7070 echo "$ac_t""$ol_cv_gdbm" 1>&6
7071  if test $ol_cv_gdbm = yes ; then
7072         cat >> confdefs.h <<\EOF
7073 #define HAVE_GDBM 1
7074 EOF
7075
7076  fi
7077
7078
7079         if test $ol_cv_gdbm = yes ; then
7080                 ol_link_ldbm=gdbm
7081                 ol_with_ldbm_api=gdbm
7082
7083                 if test $ol_cv_lib_gdbm != yes ; then
7084                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
7085                 fi
7086         fi
7087 fi
7088
7089 if test $ol_with_ldbm_api = auto ; then
7090         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
7091 elif test $ol_with_ldbm_api = ndbm ; then
7092         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
7093 echo "configure:7094: checking for NDBM library" >&5
7094 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
7095   echo $ac_n "(cached) $ac_c" 1>&6
7096 else
7097         ol_LIBS="$LIBS"
7098         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
7099 echo "configure:7100: checking for dbm_open" >&5
7100 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
7101   echo $ac_n "(cached) $ac_c" 1>&6
7102 else
7103   cat > conftest.$ac_ext <<EOF
7104 #line 7105 "configure"
7105 #include "confdefs.h"
7106 /* System header to define __stub macros and hopefully few prototypes,
7107     which can conflict with char dbm_open(); below.  */
7108 #include <assert.h>
7109 /* Override any gcc2 internal prototype to avoid an error.  */
7110 /* We use char because int might match the return type of a gcc2
7111     builtin and then its argument prototype would still apply.  */
7112 char dbm_open();
7113
7114 int main() {
7115
7116 /* The GNU C library defines this for functions which it implements
7117     to always fail with ENOSYS.  Some functions are actually named
7118     something starting with __ and the normal name is an alias.  */
7119 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
7120 choke me
7121 #else
7122 dbm_open();
7123 #endif
7124
7125 ; return 0; }
7126 EOF
7127 if { (eval echo configure:7128: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7128   rm -rf conftest*
7129   eval "ac_cv_func_dbm_open=yes"
7130 else
7131   echo "configure: failed program was:" >&5
7132   cat conftest.$ac_ext >&5
7133   rm -rf conftest*
7134   eval "ac_cv_func_dbm_open=no"
7135 fi
7136 rm -f conftest*
7137 fi
7138
7139 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
7140   echo "$ac_t""yes" 1>&6
7141   ol_cv_lib_ndbm=yes
7142 else
7143   echo "$ac_t""no" 1>&6
7144
7145                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
7146 echo "configure:7147: checking for dbm_open in -lndbm" >&5
7147 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
7148 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7149   echo $ac_n "(cached) $ac_c" 1>&6
7150 else
7151   ac_save_LIBS="$LIBS"
7152 LIBS="-lndbm  $LIBS"
7153 cat > conftest.$ac_ext <<EOF
7154 #line 7155 "configure"
7155 #include "confdefs.h"
7156 /* Override any gcc2 internal prototype to avoid an error.  */
7157 /* We use char because int might match the return type of a gcc2
7158     builtin and then its argument prototype would still apply.  */
7159 char dbm_open();
7160
7161 int main() {
7162 dbm_open()
7163 ; return 0; }
7164 EOF
7165 if { (eval echo configure:7166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7166   rm -rf conftest*
7167   eval "ac_cv_lib_$ac_lib_var=yes"
7168 else
7169   echo "configure: failed program was:" >&5
7170   cat conftest.$ac_ext >&5
7171   rm -rf conftest*
7172   eval "ac_cv_lib_$ac_lib_var=no"
7173 fi
7174 rm -f conftest*
7175 LIBS="$ac_save_LIBS"
7176
7177 fi
7178 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7179   echo "$ac_t""yes" 1>&6
7180   ol_cv_lib_ndbm=-lndbm
7181 else
7182   echo "$ac_t""no" 1>&6
7183
7184                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
7185 echo "configure:7186: checking for dbm_open in -ldbm" >&5
7186 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
7187 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7188   echo $ac_n "(cached) $ac_c" 1>&6
7189 else
7190   ac_save_LIBS="$LIBS"
7191 LIBS="-ldbm  $LIBS"
7192 cat > conftest.$ac_ext <<EOF
7193 #line 7194 "configure"
7194 #include "confdefs.h"
7195 /* Override any gcc2 internal prototype to avoid an error.  */
7196 /* We use char because int might match the return type of a gcc2
7197     builtin and then its argument prototype would still apply.  */
7198 char dbm_open();
7199
7200 int main() {
7201 dbm_open()
7202 ; return 0; }
7203 EOF
7204 if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7205   rm -rf conftest*
7206   eval "ac_cv_lib_$ac_lib_var=yes"
7207 else
7208   echo "configure: failed program was:" >&5
7209   cat conftest.$ac_ext >&5
7210   rm -rf conftest*
7211   eval "ac_cv_lib_$ac_lib_var=no"
7212 fi
7213 rm -f conftest*
7214 LIBS="$ac_save_LIBS"
7215
7216 fi
7217 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7218   echo "$ac_t""yes" 1>&6
7219   ol_cv_lib_ndbm=-ldbm
7220 else
7221   echo "$ac_t""no" 1>&6
7222 ol_cv_lib_ndbm=no
7223 fi
7224                 
7225 fi
7226
7227         
7228 fi
7229
7230         LIBS="$ol_LIBS"
7231
7232 fi
7233
7234 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
7235
7236
7237  for ac_hdr in ndbm.h
7238 do
7239 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7240 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7241 echo "configure:7242: checking for $ac_hdr" >&5
7242 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7243   echo $ac_n "(cached) $ac_c" 1>&6
7244 else
7245   cat > conftest.$ac_ext <<EOF
7246 #line 7247 "configure"
7247 #include "confdefs.h"
7248 #include <$ac_hdr>
7249 EOF
7250 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7251 { (eval echo configure:7252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7252 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7253 if test -z "$ac_err"; then
7254   rm -rf conftest*
7255   eval "ac_cv_header_$ac_safe=yes"
7256 else
7257   echo "$ac_err" >&5
7258   echo "configure: failed program was:" >&5
7259   cat conftest.$ac_ext >&5
7260   rm -rf conftest*
7261   eval "ac_cv_header_$ac_safe=no"
7262 fi
7263 rm -f conftest*
7264 fi
7265 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7266   echo "$ac_t""yes" 1>&6
7267     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7268   cat >> confdefs.h <<EOF
7269 #define $ac_tr_hdr 1
7270 EOF
7271  
7272 else
7273   echo "$ac_t""no" 1>&6
7274 fi
7275 done
7276
7277  echo $ac_n "checking for db""... $ac_c" 1>&6
7278 echo "configure:7279: checking for db" >&5
7279 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
7280   echo $ac_n "(cached) $ac_c" 1>&6
7281 else
7282   
7283         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
7284                 ol_cv_ndbm=no
7285         else
7286                 ol_cv_ndbm=yes
7287         fi
7288
7289 fi
7290
7291 echo "$ac_t""$ol_cv_ndbm" 1>&6
7292  if test $ol_cv_ndbm = yes ; then
7293         cat >> confdefs.h <<\EOF
7294 #define HAVE_NDBM 1
7295 EOF
7296
7297  fi
7298
7299
7300         if test $ol_cv_ndbm = yes ; then
7301                 ol_link_ldbm=ndbm
7302                 ol_with_ldbm_api=ndbm
7303
7304                 if test $ol_cv_lib_ndbm != yes ; then
7305                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
7306                 fi
7307         fi
7308 fi
7309
7310 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
7311         echo "configure: warning: could not find suitable LDBM backend" 1>&2
7312         if test $ol_enable_ldbm = yes ; then
7313                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
7314         fi
7315
7316         echo "configure: warning: disabling LDBM" 1>&2
7317         ol_enable_ldbm=no
7318 fi
7319
7320 if test $ol_enable_wrappers != no ; then
7321         for ac_hdr in tcpd.h
7322 do
7323 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7324 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7325 echo "configure:7326: checking for $ac_hdr" >&5
7326 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7327   echo $ac_n "(cached) $ac_c" 1>&6
7328 else
7329   cat > conftest.$ac_ext <<EOF
7330 #line 7331 "configure"
7331 #include "confdefs.h"
7332 #include <$ac_hdr>
7333 EOF
7334 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7335 { (eval echo configure:7336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7336 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7337 if test -z "$ac_err"; then
7338   rm -rf conftest*
7339   eval "ac_cv_header_$ac_safe=yes"
7340 else
7341   echo "$ac_err" >&5
7342   echo "configure: failed program was:" >&5
7343   cat conftest.$ac_ext >&5
7344   rm -rf conftest*
7345   eval "ac_cv_header_$ac_safe=no"
7346 fi
7347 rm -f conftest*
7348 fi
7349 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7350   echo "$ac_t""yes" 1>&6
7351     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7352   cat >> confdefs.h <<EOF
7353 #define $ac_tr_hdr 1
7354 EOF
7355  
7356 else
7357   echo "$ac_t""no" 1>&6
7358 fi
7359 done
7360
7361
7362         if test $ac_cv_header_tcpd_h != yes ; then
7363                 have_wrappers=no
7364         else
7365                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
7366 echo "configure:7367: checking for main in -lwrap" >&5
7367 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
7368 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7369   echo $ac_n "(cached) $ac_c" 1>&6
7370 else
7371   ac_save_LIBS="$LIBS"
7372 LIBS="-lwrap  $LIBS"
7373 cat > conftest.$ac_ext <<EOF
7374 #line 7375 "configure"
7375 #include "confdefs.h"
7376
7377 int main() {
7378 main()
7379 ; return 0; }
7380 EOF
7381 if { (eval echo configure:7382: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7382   rm -rf conftest*
7383   eval "ac_cv_lib_$ac_lib_var=yes"
7384 else
7385   echo "configure: failed program was:" >&5
7386   cat conftest.$ac_ext >&5
7387   rm -rf conftest*
7388   eval "ac_cv_lib_$ac_lib_var=no"
7389 fi
7390 rm -f conftest*
7391 LIBS="$ac_save_LIBS"
7392
7393 fi
7394 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7395   echo "$ac_t""yes" 1>&6
7396   have_wrappers=yes
7397 else
7398   echo "$ac_t""no" 1>&6
7399 have_wrappers=no
7400 fi
7401
7402         fi
7403
7404         if test $have_wrappers = yes ; then
7405                 cat >> confdefs.h <<\EOF
7406 #define HAVE_TCPD 1
7407 EOF
7408
7409                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
7410         else
7411                 echo "configure: warning: could not find -lwrap" 1>&2
7412                 if test $ol_enable_wrappers = yes ; then
7413                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
7414                 fi
7415
7416                 echo "configure: warning: disabling wrappers support" 1>&2
7417                 ol_enable_wrappers=no
7418         fi
7419 fi
7420
7421 if test $ol_enable_syslog != no ; then
7422         echo $ac_n "checking for openlog""... $ac_c" 1>&6
7423 echo "configure:7424: checking for openlog" >&5
7424 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
7425   echo $ac_n "(cached) $ac_c" 1>&6
7426 else
7427   cat > conftest.$ac_ext <<EOF
7428 #line 7429 "configure"
7429 #include "confdefs.h"
7430 /* System header to define __stub macros and hopefully few prototypes,
7431     which can conflict with char openlog(); below.  */
7432 #include <assert.h>
7433 /* Override any gcc2 internal prototype to avoid an error.  */
7434 /* We use char because int might match the return type of a gcc2
7435     builtin and then its argument prototype would still apply.  */
7436 char openlog();
7437
7438 int main() {
7439
7440 /* The GNU C library defines this for functions which it implements
7441     to always fail with ENOSYS.  Some functions are actually named
7442     something starting with __ and the normal name is an alias.  */
7443 #if defined (__stub_openlog) || defined (__stub___openlog)
7444 choke me
7445 #else
7446 openlog();
7447 #endif
7448
7449 ; return 0; }
7450 EOF
7451 if { (eval echo configure:7452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7452   rm -rf conftest*
7453   eval "ac_cv_func_openlog=yes"
7454 else
7455   echo "configure: failed program was:" >&5
7456   cat conftest.$ac_ext >&5
7457   rm -rf conftest*
7458   eval "ac_cv_func_openlog=no"
7459 fi
7460 rm -f conftest*
7461 fi
7462
7463 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
7464   echo "$ac_t""yes" 1>&6
7465   :
7466 else
7467   echo "$ac_t""no" 1>&6
7468 fi
7469
7470         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
7471                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
7472         fi
7473         ol_enable_syslog=$ac_cv_func_openlog
7474 fi
7475
7476 if test $ol_enable_dmalloc != no ; then
7477         for ac_hdr in dmalloc.h
7478 do
7479 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7480 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7481 echo "configure:7482: checking for $ac_hdr" >&5
7482 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7483   echo $ac_n "(cached) $ac_c" 1>&6
7484 else
7485   cat > conftest.$ac_ext <<EOF
7486 #line 7487 "configure"
7487 #include "confdefs.h"
7488 #include <$ac_hdr>
7489 EOF
7490 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7491 { (eval echo configure:7492: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7492 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7493 if test -z "$ac_err"; then
7494   rm -rf conftest*
7495   eval "ac_cv_header_$ac_safe=yes"
7496 else
7497   echo "$ac_err" >&5
7498   echo "configure: failed program was:" >&5
7499   cat conftest.$ac_ext >&5
7500   rm -rf conftest*
7501   eval "ac_cv_header_$ac_safe=no"
7502 fi
7503 rm -f conftest*
7504 fi
7505 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7506   echo "$ac_t""yes" 1>&6
7507     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7508   cat >> confdefs.h <<EOF
7509 #define $ac_tr_hdr 1
7510 EOF
7511  
7512 else
7513   echo "$ac_t""no" 1>&6
7514 fi
7515 done
7516
7517         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
7518 echo "configure:7519: checking for dmalloc_shutdown in -ldmalloc" >&5
7519 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
7520 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7521   echo $ac_n "(cached) $ac_c" 1>&6
7522 else
7523   ac_save_LIBS="$LIBS"
7524 LIBS="-ldmalloc  $LIBS"
7525 cat > conftest.$ac_ext <<EOF
7526 #line 7527 "configure"
7527 #include "confdefs.h"
7528 /* Override any gcc2 internal prototype to avoid an error.  */
7529 /* We use char because int might match the return type of a gcc2
7530     builtin and then its argument prototype would still apply.  */
7531 char dmalloc_shutdown();
7532
7533 int main() {
7534 dmalloc_shutdown()
7535 ; return 0; }
7536 EOF
7537 if { (eval echo configure:7538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7538   rm -rf conftest*
7539   eval "ac_cv_lib_$ac_lib_var=yes"
7540 else
7541   echo "configure: failed program was:" >&5
7542   cat conftest.$ac_ext >&5
7543   rm -rf conftest*
7544   eval "ac_cv_lib_$ac_lib_var=no"
7545 fi
7546 rm -f conftest*
7547 LIBS="$ac_save_LIBS"
7548
7549 fi
7550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7551   echo "$ac_t""yes" 1>&6
7552     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
7553     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
7554   cat >> confdefs.h <<EOF
7555 #define $ac_tr_lib 1
7556 EOF
7557
7558   LIBS="-ldmalloc $LIBS"
7559
7560 else
7561   echo "$ac_t""no" 1>&6
7562 fi
7563
7564 fi
7565
7566 if test $ol_enable_tcl != no ; then
7567         for ac_hdr in tcl.h
7568 do
7569 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7570 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7571 echo "configure:7572: checking for $ac_hdr" >&5
7572 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7573   echo $ac_n "(cached) $ac_c" 1>&6
7574 else
7575   cat > conftest.$ac_ext <<EOF
7576 #line 7577 "configure"
7577 #include "confdefs.h"
7578 #include <$ac_hdr>
7579 EOF
7580 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7581 { (eval echo configure:7582: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7582 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7583 if test -z "$ac_err"; then
7584   rm -rf conftest*
7585   eval "ac_cv_header_$ac_safe=yes"
7586 else
7587   echo "$ac_err" >&5
7588   echo "configure: failed program was:" >&5
7589   cat conftest.$ac_ext >&5
7590   rm -rf conftest*
7591   eval "ac_cv_header_$ac_safe=no"
7592 fi
7593 rm -f conftest*
7594 fi
7595 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7596   echo "$ac_t""yes" 1>&6
7597     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7598   cat >> confdefs.h <<EOF
7599 #define $ac_tr_hdr 1
7600 EOF
7601  
7602 else
7603   echo "$ac_t""no" 1>&6
7604 fi
7605 done
7606
7607
7608         if test $ac_cv_header_tcl_h != yes ; then
7609                 have_tcl=no
7610         else
7611                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
7612 echo "configure:7613: checking for main in -ltcl" >&5
7613 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
7614 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7615   echo $ac_n "(cached) $ac_c" 1>&6
7616 else
7617   ac_save_LIBS="$LIBS"
7618 LIBS="-ltcl  $LIBS"
7619 cat > conftest.$ac_ext <<EOF
7620 #line 7621 "configure"
7621 #include "confdefs.h"
7622
7623 int main() {
7624 main()
7625 ; return 0; }
7626 EOF
7627 if { (eval echo configure:7628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7628   rm -rf conftest*
7629   eval "ac_cv_lib_$ac_lib_var=yes"
7630 else
7631   echo "configure: failed program was:" >&5
7632   cat conftest.$ac_ext >&5
7633   rm -rf conftest*
7634   eval "ac_cv_lib_$ac_lib_var=no"
7635 fi
7636 rm -f conftest*
7637 LIBS="$ac_save_LIBS"
7638
7639 fi
7640 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7641   echo "$ac_t""yes" 1>&6
7642   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
7643 else
7644   echo "$ac_t""no" 1>&6
7645 have_tcl=no
7646 fi
7647
7648
7649                 if test $have_tcl != yes; then
7650                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
7651 echo "configure:7652: checking for main in -ltcl7.6" >&5
7652 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
7653 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7654   echo $ac_n "(cached) $ac_c" 1>&6
7655 else
7656   ac_save_LIBS="$LIBS"
7657 LIBS="-ltcl7.6  $LIBS"
7658 cat > conftest.$ac_ext <<EOF
7659 #line 7660 "configure"
7660 #include "confdefs.h"
7661
7662 int main() {
7663 main()
7664 ; return 0; }
7665 EOF
7666 if { (eval echo configure:7667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7667   rm -rf conftest*
7668   eval "ac_cv_lib_$ac_lib_var=yes"
7669 else
7670   echo "configure: failed program was:" >&5
7671   cat conftest.$ac_ext >&5
7672   rm -rf conftest*
7673   eval "ac_cv_lib_$ac_lib_var=no"
7674 fi
7675 rm -f conftest*
7676 LIBS="$ac_save_LIBS"
7677
7678 fi
7679 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7680   echo "$ac_t""yes" 1>&6
7681   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
7682 else
7683   echo "$ac_t""no" 1>&6
7684 have_tcl=no
7685 fi
7686
7687                 fi
7688
7689                 if test $have_tcl != yes; then
7690                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
7691 echo "configure:7692: checking for main in -ltcl8.0" >&5
7692 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
7693 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7694   echo $ac_n "(cached) $ac_c" 1>&6
7695 else
7696   ac_save_LIBS="$LIBS"
7697 LIBS="-ltcl8.0  $LIBS"
7698 cat > conftest.$ac_ext <<EOF
7699 #line 7700 "configure"
7700 #include "confdefs.h"
7701
7702 int main() {
7703 main()
7704 ; return 0; }
7705 EOF
7706 if { (eval echo configure:7707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7707   rm -rf conftest*
7708   eval "ac_cv_lib_$ac_lib_var=yes"
7709 else
7710   echo "configure: failed program was:" >&5
7711   cat conftest.$ac_ext >&5
7712   rm -rf conftest*
7713   eval "ac_cv_lib_$ac_lib_var=no"
7714 fi
7715 rm -f conftest*
7716 LIBS="$ac_save_LIBS"
7717
7718 fi
7719 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7720   echo "$ac_t""yes" 1>&6
7721   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
7722 else
7723   echo "$ac_t""no" 1>&6
7724 have_tcl=no
7725 fi
7726
7727                 fi
7728         fi
7729
7730         if test $have_tcl != yes ; then
7731                 echo "configure: warning: could not find -ltcl" 1>&2
7732                 if test $ol_enable_tcl = yes ; then
7733                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
7734                 fi
7735
7736                 ol_enable_tcl=no
7737         fi
7738 fi
7739
7740 # ud needs termcap (should insert check here)
7741 ol_link_termcap=no
7742 for ac_hdr in termcap.h ncurses.h
7743 do
7744 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7745 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7746 echo "configure:7747: checking for $ac_hdr" >&5
7747 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7748   echo $ac_n "(cached) $ac_c" 1>&6
7749 else
7750   cat > conftest.$ac_ext <<EOF
7751 #line 7752 "configure"
7752 #include "confdefs.h"
7753 #include <$ac_hdr>
7754 EOF
7755 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7756 { (eval echo configure:7757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7757 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7758 if test -z "$ac_err"; then
7759   rm -rf conftest*
7760   eval "ac_cv_header_$ac_safe=yes"
7761 else
7762   echo "$ac_err" >&5
7763   echo "configure: failed program was:" >&5
7764   cat conftest.$ac_ext >&5
7765   rm -rf conftest*
7766   eval "ac_cv_header_$ac_safe=no"
7767 fi
7768 rm -f conftest*
7769 fi
7770 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7771   echo "$ac_t""yes" 1>&6
7772     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7773   cat >> confdefs.h <<EOF
7774 #define $ac_tr_hdr 1
7775 EOF
7776  
7777 else
7778   echo "$ac_t""no" 1>&6
7779 fi
7780 done
7781
7782
7783 if test $ol_link_termcap = no ; then
7784         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
7785 echo "configure:7786: checking for tputs in -ltermcap" >&5
7786 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
7787 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7788   echo $ac_n "(cached) $ac_c" 1>&6
7789 else
7790   ac_save_LIBS="$LIBS"
7791 LIBS="-ltermcap  $LIBS"
7792 cat > conftest.$ac_ext <<EOF
7793 #line 7794 "configure"
7794 #include "confdefs.h"
7795 /* Override any gcc2 internal prototype to avoid an error.  */
7796 /* We use char because int might match the return type of a gcc2
7797     builtin and then its argument prototype would still apply.  */
7798 char tputs();
7799
7800 int main() {
7801 tputs()
7802 ; return 0; }
7803 EOF
7804 if { (eval echo configure:7805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7805   rm -rf conftest*
7806   eval "ac_cv_lib_$ac_lib_var=yes"
7807 else
7808   echo "configure: failed program was:" >&5
7809   cat conftest.$ac_ext >&5
7810   rm -rf conftest*
7811   eval "ac_cv_lib_$ac_lib_var=no"
7812 fi
7813 rm -f conftest*
7814 LIBS="$ac_save_LIBS"
7815
7816 fi
7817 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7818   echo "$ac_t""yes" 1>&6
7819   have_termcap=yes
7820 else
7821   echo "$ac_t""no" 1>&6
7822 have_termcap=no
7823 fi
7824
7825         if test $have_termcap = yes ; then
7826                 cat >> confdefs.h <<\EOF
7827 #define HAVE_TERMCAP 1
7828 EOF
7829
7830                 ol_link_termcap=yes
7831                 TERMCAP_LIBS=-ltermcap
7832         fi
7833 fi
7834
7835 if test $ol_link_termcap = no ; then
7836         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
7837 echo "configure:7838: checking for initscr in -lncurses" >&5
7838 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
7839 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7840   echo $ac_n "(cached) $ac_c" 1>&6
7841 else
7842   ac_save_LIBS="$LIBS"
7843 LIBS="-lncurses  $LIBS"
7844 cat > conftest.$ac_ext <<EOF
7845 #line 7846 "configure"
7846 #include "confdefs.h"
7847 /* Override any gcc2 internal prototype to avoid an error.  */
7848 /* We use char because int might match the return type of a gcc2
7849     builtin and then its argument prototype would still apply.  */
7850 char initscr();
7851
7852 int main() {
7853 initscr()
7854 ; return 0; }
7855 EOF
7856 if { (eval echo configure:7857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7857   rm -rf conftest*
7858   eval "ac_cv_lib_$ac_lib_var=yes"
7859 else
7860   echo "configure: failed program was:" >&5
7861   cat conftest.$ac_ext >&5
7862   rm -rf conftest*
7863   eval "ac_cv_lib_$ac_lib_var=no"
7864 fi
7865 rm -f conftest*
7866 LIBS="$ac_save_LIBS"
7867
7868 fi
7869 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7870   echo "$ac_t""yes" 1>&6
7871   have_ncurses=yes
7872 else
7873   echo "$ac_t""no" 1>&6
7874 have_ncurses=no
7875 fi
7876
7877         if test $have_ncurses = yes ; then
7878                 cat >> confdefs.h <<\EOF
7879 #define HAVE_NCURSES 1
7880 EOF
7881
7882                 ol_link_termcap=yes
7883                 TERMCAP_LIBS=-lncurses
7884         fi
7885 fi
7886
7887 if test $ol_link_termcap = no ; then
7888         cat >> confdefs.h <<\EOF
7889 #define NO_TERMCAP 1
7890 EOF
7891
7892         TERMCAP_LIBS=
7893 fi
7894
7895 # FreeBSD (and others) have crypt(3) in -lcrypt
7896 if test $ol_enable_crypt != no ; then
7897         echo $ac_n "checking for crypt""... $ac_c" 1>&6
7898 echo "configure:7899: checking for crypt" >&5
7899 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
7900   echo $ac_n "(cached) $ac_c" 1>&6
7901 else
7902   cat > conftest.$ac_ext <<EOF
7903 #line 7904 "configure"
7904 #include "confdefs.h"
7905 /* System header to define __stub macros and hopefully few prototypes,
7906     which can conflict with char crypt(); below.  */
7907 #include <assert.h>
7908 /* Override any gcc2 internal prototype to avoid an error.  */
7909 /* We use char because int might match the return type of a gcc2
7910     builtin and then its argument prototype would still apply.  */
7911 char crypt();
7912
7913 int main() {
7914
7915 /* The GNU C library defines this for functions which it implements
7916     to always fail with ENOSYS.  Some functions are actually named
7917     something starting with __ and the normal name is an alias.  */
7918 #if defined (__stub_crypt) || defined (__stub___crypt)
7919 choke me
7920 #else
7921 crypt();
7922 #endif
7923
7924 ; return 0; }
7925 EOF
7926 if { (eval echo configure:7927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7927   rm -rf conftest*
7928   eval "ac_cv_func_crypt=yes"
7929 else
7930   echo "configure: failed program was:" >&5
7931   cat conftest.$ac_ext >&5
7932   rm -rf conftest*
7933   eval "ac_cv_func_crypt=no"
7934 fi
7935 rm -f conftest*
7936 fi
7937
7938 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
7939   echo "$ac_t""yes" 1>&6
7940   have_crypt=yes
7941 else
7942   echo "$ac_t""no" 1>&6
7943
7944                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
7945 echo "configure:7946: checking for crypt in -lcrypt" >&5
7946 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
7947 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7948   echo $ac_n "(cached) $ac_c" 1>&6
7949 else
7950   ac_save_LIBS="$LIBS"
7951 LIBS="-lcrypt  $LIBS"
7952 cat > conftest.$ac_ext <<EOF
7953 #line 7954 "configure"
7954 #include "confdefs.h"
7955 /* Override any gcc2 internal prototype to avoid an error.  */
7956 /* We use char because int might match the return type of a gcc2
7957     builtin and then its argument prototype would still apply.  */
7958 char crypt();
7959
7960 int main() {
7961 crypt()
7962 ; return 0; }
7963 EOF
7964 if { (eval echo configure:7965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7965   rm -rf conftest*
7966   eval "ac_cv_lib_$ac_lib_var=yes"
7967 else
7968   echo "configure: failed program was:" >&5
7969   cat conftest.$ac_ext >&5
7970   rm -rf conftest*
7971   eval "ac_cv_lib_$ac_lib_var=no"
7972 fi
7973 rm -f conftest*
7974 LIBS="$ac_save_LIBS"
7975
7976 fi
7977 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7978   echo "$ac_t""yes" 1>&6
7979   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
7980                         have_crypt=yes
7981 else
7982   echo "$ac_t""no" 1>&6
7983 have_crypt=no
7984 fi
7985
7986 fi
7987
7988
7989         if test $have_crypt = yes ; then
7990                 cat >> confdefs.h <<\EOF
7991 #define HAVE_CRYPT 1
7992 EOF
7993
7994         else
7995                 echo "configure: warning: could not find crypt" 1>&2
7996                 if test $ol_enable_crypt = yes ; then
7997                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
7998                 fi
7999
8000                 echo "configure: warning: disabling crypt support" 1>&2
8001                 ol_enable_crypt=no
8002         fi
8003 fi
8004
8005 # FreeBSD (and others) have setproctitle(3) in -lutil
8006 if test $ol_enable_proctitle != no ; then
8007         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
8008 echo "configure:8009: checking for setproctitle" >&5
8009 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
8010   echo $ac_n "(cached) $ac_c" 1>&6
8011 else
8012   cat > conftest.$ac_ext <<EOF
8013 #line 8014 "configure"
8014 #include "confdefs.h"
8015 /* System header to define __stub macros and hopefully few prototypes,
8016     which can conflict with char setproctitle(); below.  */
8017 #include <assert.h>
8018 /* Override any gcc2 internal prototype to avoid an error.  */
8019 /* We use char because int might match the return type of a gcc2
8020     builtin and then its argument prototype would still apply.  */
8021 char setproctitle();
8022
8023 int main() {
8024
8025 /* The GNU C library defines this for functions which it implements
8026     to always fail with ENOSYS.  Some functions are actually named
8027     something starting with __ and the normal name is an alias.  */
8028 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
8029 choke me
8030 #else
8031 setproctitle();
8032 #endif
8033
8034 ; return 0; }
8035 EOF
8036 if { (eval echo configure:8037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8037   rm -rf conftest*
8038   eval "ac_cv_func_setproctitle=yes"
8039 else
8040   echo "configure: failed program was:" >&5
8041   cat conftest.$ac_ext >&5
8042   rm -rf conftest*
8043   eval "ac_cv_func_setproctitle=no"
8044 fi
8045 rm -f conftest*
8046 fi
8047
8048 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
8049   echo "$ac_t""yes" 1>&6
8050   have_setproctitle=yes
8051 else
8052   echo "$ac_t""no" 1>&6
8053
8054                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
8055 echo "configure:8056: checking for setproctitle in -lutil" >&5
8056 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
8057 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8058   echo $ac_n "(cached) $ac_c" 1>&6
8059 else
8060   ac_save_LIBS="$LIBS"
8061 LIBS="-lutil  $LIBS"
8062 cat > conftest.$ac_ext <<EOF
8063 #line 8064 "configure"
8064 #include "confdefs.h"
8065 /* Override any gcc2 internal prototype to avoid an error.  */
8066 /* We use char because int might match the return type of a gcc2
8067     builtin and then its argument prototype would still apply.  */
8068 char setproctitle();
8069
8070 int main() {
8071 setproctitle()
8072 ; return 0; }
8073 EOF
8074 if { (eval echo configure:8075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8075   rm -rf conftest*
8076   eval "ac_cv_lib_$ac_lib_var=yes"
8077 else
8078   echo "configure: failed program was:" >&5
8079   cat conftest.$ac_ext >&5
8080   rm -rf conftest*
8081   eval "ac_cv_lib_$ac_lib_var=no"
8082 fi
8083 rm -f conftest*
8084 LIBS="$ac_save_LIBS"
8085
8086 fi
8087 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8088   echo "$ac_t""yes" 1>&6
8089   have_setproctitle=yes
8090                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
8091 else
8092   echo "$ac_t""no" 1>&6
8093 have_setproctitle=no
8094                         LIBOBJS="$LIBOBJS setproctitle.o"
8095 fi
8096
8097 fi
8098
8099
8100         if test $have_setproctitle = yes ; then
8101                 cat >> confdefs.h <<\EOF
8102 #define HAVE_SETPROCTITLE 1
8103 EOF
8104
8105         fi
8106 fi
8107
8108 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
8109 echo "configure:8110: checking for ANSI C header files" >&5
8110 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
8111   echo $ac_n "(cached) $ac_c" 1>&6
8112 else
8113   cat > conftest.$ac_ext <<EOF
8114 #line 8115 "configure"
8115 #include "confdefs.h"
8116 #include <stdlib.h>
8117 #include <stdarg.h>
8118 #include <string.h>
8119 #include <float.h>
8120 EOF
8121 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8122 { (eval echo configure:8123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8123 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8124 if test -z "$ac_err"; then
8125   rm -rf conftest*
8126   ac_cv_header_stdc=yes
8127 else
8128   echo "$ac_err" >&5
8129   echo "configure: failed program was:" >&5
8130   cat conftest.$ac_ext >&5
8131   rm -rf conftest*
8132   ac_cv_header_stdc=no
8133 fi
8134 rm -f conftest*
8135
8136 if test $ac_cv_header_stdc = yes; then
8137   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8138 cat > conftest.$ac_ext <<EOF
8139 #line 8140 "configure"
8140 #include "confdefs.h"
8141 #include <string.h>
8142 EOF
8143 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8144   egrep "memchr" >/dev/null 2>&1; then
8145   :
8146 else
8147   rm -rf conftest*
8148   ac_cv_header_stdc=no
8149 fi
8150 rm -f conftest*
8151
8152 fi
8153
8154 if test $ac_cv_header_stdc = yes; then
8155   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8156 cat > conftest.$ac_ext <<EOF
8157 #line 8158 "configure"
8158 #include "confdefs.h"
8159 #include <stdlib.h>
8160 EOF
8161 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8162   egrep "free" >/dev/null 2>&1; then
8163   :
8164 else
8165   rm -rf conftest*
8166   ac_cv_header_stdc=no
8167 fi
8168 rm -f conftest*
8169
8170 fi
8171
8172 if test $ac_cv_header_stdc = yes; then
8173   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8174 if test "$cross_compiling" = yes; then
8175   :
8176 else
8177   cat > conftest.$ac_ext <<EOF
8178 #line 8179 "configure"
8179 #include "confdefs.h"
8180 #include <ctype.h>
8181 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8182 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8183 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8184 int main () { int i; for (i = 0; i < 256; i++)
8185 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
8186 exit (0); }
8187
8188 EOF
8189 if { (eval echo configure:8190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8190 then
8191   :
8192 else
8193   echo "configure: failed program was:" >&5
8194   cat conftest.$ac_ext >&5
8195   rm -fr conftest*
8196   ac_cv_header_stdc=no
8197 fi
8198 rm -fr conftest*
8199 fi
8200
8201 fi
8202 fi
8203
8204 echo "$ac_t""$ac_cv_header_stdc" 1>&6
8205 if test $ac_cv_header_stdc = yes; then
8206   cat >> confdefs.h <<\EOF
8207 #define STDC_HEADERS 1
8208 EOF
8209
8210 fi
8211
8212
8213 if test $ac_cv_header_stdc != yes; then
8214         echo "configure: warning: could not Standard C compliant headers" 1>&2
8215 fi
8216
8217 ac_header_dirent=no
8218 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
8219 do
8220 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8221 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
8222 echo "configure:8223: checking for $ac_hdr that defines DIR" >&5
8223 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
8224   echo $ac_n "(cached) $ac_c" 1>&6
8225 else
8226   cat > conftest.$ac_ext <<EOF
8227 #line 8228 "configure"
8228 #include "confdefs.h"
8229 #include <sys/types.h>
8230 #include <$ac_hdr>
8231 int main() {
8232 DIR *dirp = 0;
8233 ; return 0; }
8234 EOF
8235 if { (eval echo configure:8236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8236   rm -rf conftest*
8237   eval "ac_cv_header_dirent_$ac_safe=yes"
8238 else
8239   echo "configure: failed program was:" >&5
8240   cat conftest.$ac_ext >&5
8241   rm -rf conftest*
8242   eval "ac_cv_header_dirent_$ac_safe=no"
8243 fi
8244 rm -f conftest*
8245 fi
8246 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
8247   echo "$ac_t""yes" 1>&6
8248     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8249   cat >> confdefs.h <<EOF
8250 #define $ac_tr_hdr 1
8251 EOF
8252  ac_header_dirent=$ac_hdr; break
8253 else
8254   echo "$ac_t""no" 1>&6
8255 fi
8256 done
8257 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
8258 if test $ac_header_dirent = dirent.h; then
8259 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
8260 echo "configure:8261: checking for opendir in -ldir" >&5
8261 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
8262 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8263   echo $ac_n "(cached) $ac_c" 1>&6
8264 else
8265   ac_save_LIBS="$LIBS"
8266 LIBS="-ldir  $LIBS"
8267 cat > conftest.$ac_ext <<EOF
8268 #line 8269 "configure"
8269 #include "confdefs.h"
8270 /* Override any gcc2 internal prototype to avoid an error.  */
8271 /* We use char because int might match the return type of a gcc2
8272     builtin and then its argument prototype would still apply.  */
8273 char opendir();
8274
8275 int main() {
8276 opendir()
8277 ; return 0; }
8278 EOF
8279 if { (eval echo configure:8280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8280   rm -rf conftest*
8281   eval "ac_cv_lib_$ac_lib_var=yes"
8282 else
8283   echo "configure: failed program was:" >&5
8284   cat conftest.$ac_ext >&5
8285   rm -rf conftest*
8286   eval "ac_cv_lib_$ac_lib_var=no"
8287 fi
8288 rm -f conftest*
8289 LIBS="$ac_save_LIBS"
8290
8291 fi
8292 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8293   echo "$ac_t""yes" 1>&6
8294   LIBS="$LIBS -ldir"
8295 else
8296   echo "$ac_t""no" 1>&6
8297 fi
8298
8299 else
8300 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
8301 echo "configure:8302: checking for opendir in -lx" >&5
8302 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
8303 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8304   echo $ac_n "(cached) $ac_c" 1>&6
8305 else
8306   ac_save_LIBS="$LIBS"
8307 LIBS="-lx  $LIBS"
8308 cat > conftest.$ac_ext <<EOF
8309 #line 8310 "configure"
8310 #include "confdefs.h"
8311 /* Override any gcc2 internal prototype to avoid an error.  */
8312 /* We use char because int might match the return type of a gcc2
8313     builtin and then its argument prototype would still apply.  */
8314 char opendir();
8315
8316 int main() {
8317 opendir()
8318 ; return 0; }
8319 EOF
8320 if { (eval echo configure:8321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8321   rm -rf conftest*
8322   eval "ac_cv_lib_$ac_lib_var=yes"
8323 else
8324   echo "configure: failed program was:" >&5
8325   cat conftest.$ac_ext >&5
8326   rm -rf conftest*
8327   eval "ac_cv_lib_$ac_lib_var=no"
8328 fi
8329 rm -f conftest*
8330 LIBS="$ac_save_LIBS"
8331
8332 fi
8333 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8334   echo "$ac_t""yes" 1>&6
8335   LIBS="$LIBS -lx"
8336 else
8337   echo "$ac_t""no" 1>&6
8338 fi
8339
8340 fi
8341
8342 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
8343 echo "configure:8344: checking for sys/wait.h that is POSIX.1 compatible" >&5
8344 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
8345   echo $ac_n "(cached) $ac_c" 1>&6
8346 else
8347   cat > conftest.$ac_ext <<EOF
8348 #line 8349 "configure"
8349 #include "confdefs.h"
8350 #include <sys/types.h>
8351 #include <sys/wait.h>
8352 #ifndef WEXITSTATUS
8353 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
8354 #endif
8355 #ifndef WIFEXITED
8356 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
8357 #endif
8358 int main() {
8359 int s;
8360 wait (&s);
8361 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
8362 ; return 0; }
8363 EOF
8364 if { (eval echo configure:8365: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8365   rm -rf conftest*
8366   ac_cv_header_sys_wait_h=yes
8367 else
8368   echo "configure: failed program was:" >&5
8369   cat conftest.$ac_ext >&5
8370   rm -rf conftest*
8371   ac_cv_header_sys_wait_h=no
8372 fi
8373 rm -f conftest*
8374 fi
8375
8376 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
8377 if test $ac_cv_header_sys_wait_h = yes; then
8378   cat >> confdefs.h <<\EOF
8379 #define HAVE_SYS_WAIT_H 1
8380 EOF
8381
8382 fi
8383
8384 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
8385 echo "configure:8386: checking POSIX termios" >&5
8386 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
8387   echo $ac_n "(cached) $ac_c" 1>&6
8388 else
8389   cat > conftest.$ac_ext <<EOF
8390 #line 8391 "configure"
8391 #include "confdefs.h"
8392 #include <sys/types.h>
8393 #include <unistd.h>
8394 #include <termios.h>
8395 int main() {
8396 /* SunOS 4.0.3 has termios.h but not the library calls.  */
8397    tcgetattr(0, 0);
8398 ; return 0; }
8399 EOF
8400 if { (eval echo configure:8401: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8401   rm -rf conftest*
8402   am_cv_sys_posix_termios=yes
8403 else
8404   echo "configure: failed program was:" >&5
8405   cat conftest.$ac_ext >&5
8406   rm -rf conftest*
8407   am_cv_sys_posix_termios=no
8408 fi
8409 rm -f conftest*
8410 fi
8411
8412 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
8413
8414
8415  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
8416 echo "configure:8417: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
8417 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
8418   echo $ac_n "(cached) $ac_c" 1>&6
8419 else
8420   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8421
8422   gwinsz_in_termios_h=no
8423   if test $am_cv_sys_posix_termios = yes; then
8424     cat > conftest.$ac_ext <<EOF
8425 #line 8426 "configure"
8426 #include "confdefs.h"
8427 #include <sys/types.h>
8428 #     include <termios.h>
8429 #     ifdef TIOCGWINSZ
8430         yes
8431 #     endif
8432     
8433 EOF
8434 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8435   egrep "yes" >/dev/null 2>&1; then
8436   rm -rf conftest*
8437   gwinsz_in_termios_h=yes
8438 fi
8439 rm -f conftest*
8440
8441   fi
8442
8443   if test $gwinsz_in_termios_h = no; then
8444     cat > conftest.$ac_ext <<EOF
8445 #line 8446 "configure"
8446 #include "confdefs.h"
8447 #include <sys/types.h>
8448 #     include <sys/ioctl.h>
8449 #     ifdef TIOCGWINSZ
8450         yes
8451 #     endif
8452     
8453 EOF
8454 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8455   egrep "yes" >/dev/null 2>&1; then
8456   rm -rf conftest*
8457   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
8458 fi
8459 rm -f conftest*
8460
8461   fi
8462   
8463 fi
8464
8465 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
8466   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8467     cat >> confdefs.h <<\EOF
8468 #define GWINSZ_IN_SYS_IOCTL 1
8469 EOF
8470
8471   fi
8472
8473 if test $am_cv_sys_posix_termios = yes ; then
8474         cat >> confdefs.h <<\EOF
8475 #define HAVE_POSIX_TERMIOS 1
8476 EOF
8477
8478 fi
8479
8480 for ac_hdr in \
8481         arpa/nameser.h  \
8482         crypt.h                 \
8483         errno.h                 \
8484         fcntl.h                 \
8485         filio.h                 \
8486         getopt.h                \
8487         libutil.h               \
8488         limits.h                \
8489         locale.h                \
8490         malloc.h                \
8491         memory.h                \
8492         regex.h                 \
8493         psap.h                  \
8494         pwd.h                   \
8495         resolv.h                \
8496         sgtty.h                 \
8497         stdarg.h                \
8498         stddef.h                \
8499         string.h                \
8500         strings.h               \
8501         sysexits.h              \
8502         sys/file.h              \
8503         sys/filio.h             \
8504         sys/errno.h             \
8505         sys/ioctl.h             \
8506         sys/param.h             \
8507         sys/resource.h  \
8508         sys/socket.h    \
8509         sys/syslog.h    \
8510         sys/time.h              \
8511         sys/types.h             \
8512         syslog.h                \
8513         termios.h               \
8514         unistd.h                \
8515
8516 do
8517 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8518 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8519 echo "configure:8520: checking for $ac_hdr" >&5
8520 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8521   echo $ac_n "(cached) $ac_c" 1>&6
8522 else
8523   cat > conftest.$ac_ext <<EOF
8524 #line 8525 "configure"
8525 #include "confdefs.h"
8526 #include <$ac_hdr>
8527 EOF
8528 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8529 { (eval echo configure:8530: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8530 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8531 if test -z "$ac_err"; then
8532   rm -rf conftest*
8533   eval "ac_cv_header_$ac_safe=yes"
8534 else
8535   echo "$ac_err" >&5
8536   echo "configure: failed program was:" >&5
8537   cat conftest.$ac_ext >&5
8538   rm -rf conftest*
8539   eval "ac_cv_header_$ac_safe=no"
8540 fi
8541 rm -f conftest*
8542 fi
8543 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8544   echo "$ac_t""yes" 1>&6
8545     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8546   cat >> confdefs.h <<EOF
8547 #define $ac_tr_hdr 1
8548 EOF
8549  
8550 else
8551   echo "$ac_t""no" 1>&6
8552 fi
8553 done
8554
8555
8556 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
8557 echo "configure:8558: checking for uid_t in sys/types.h" >&5
8558 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
8559   echo $ac_n "(cached) $ac_c" 1>&6
8560 else
8561   cat > conftest.$ac_ext <<EOF
8562 #line 8563 "configure"
8563 #include "confdefs.h"
8564 #include <sys/types.h>
8565 EOF
8566 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8567   egrep "uid_t" >/dev/null 2>&1; then
8568   rm -rf conftest*
8569   ac_cv_type_uid_t=yes
8570 else
8571   rm -rf conftest*
8572   ac_cv_type_uid_t=no
8573 fi
8574 rm -f conftest*
8575
8576 fi
8577
8578 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
8579 if test $ac_cv_type_uid_t = no; then
8580   cat >> confdefs.h <<\EOF
8581 #define uid_t int
8582 EOF
8583
8584   cat >> confdefs.h <<\EOF
8585 #define gid_t int
8586 EOF
8587
8588 fi
8589
8590 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
8591 echo "configure:8592: checking type of array argument to getgroups" >&5
8592 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
8593   echo $ac_n "(cached) $ac_c" 1>&6
8594 else
8595   if test "$cross_compiling" = yes; then
8596   ac_cv_type_getgroups=cross
8597 else
8598   cat > conftest.$ac_ext <<EOF
8599 #line 8600 "configure"
8600 #include "confdefs.h"
8601
8602 /* Thanks to Mike Rendell for this test.  */
8603 #include <sys/types.h>
8604 #define NGID 256
8605 #undef MAX
8606 #define MAX(x, y) ((x) > (y) ? (x) : (y))
8607 main()
8608 {
8609   gid_t gidset[NGID];
8610   int i, n;
8611   union { gid_t gval; long lval; }  val;
8612
8613   val.lval = -1;
8614   for (i = 0; i < NGID; i++)
8615     gidset[i] = val.gval;
8616   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
8617                  gidset);
8618   /* Exit non-zero if getgroups seems to require an array of ints.  This
8619      happens when gid_t is short but getgroups modifies an array of ints.  */
8620   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
8621 }
8622
8623 EOF
8624 if { (eval echo configure:8625: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8625 then
8626     ac_cv_type_getgroups=gid_t
8627 else
8628   echo "configure: failed program was:" >&5
8629   cat conftest.$ac_ext >&5
8630   rm -fr conftest*
8631   ac_cv_type_getgroups=int
8632 fi
8633 rm -fr conftest*
8634 fi
8635
8636 if test $ac_cv_type_getgroups = cross; then
8637         cat > conftest.$ac_ext <<EOF
8638 #line 8639 "configure"
8639 #include "confdefs.h"
8640 #include <unistd.h>
8641 EOF
8642 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8643   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
8644   rm -rf conftest*
8645   ac_cv_type_getgroups=gid_t
8646 else
8647   rm -rf conftest*
8648   ac_cv_type_getgroups=int
8649 fi
8650 rm -f conftest*
8651
8652 fi
8653 fi
8654
8655 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
8656 cat >> confdefs.h <<EOF
8657 #define GETGROUPS_T $ac_cv_type_getgroups
8658 EOF
8659
8660  echo $ac_n "checking for mode_t""... $ac_c" 1>&6
8661 echo "configure:8662: checking for mode_t" >&5
8662 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
8663   echo $ac_n "(cached) $ac_c" 1>&6
8664 else
8665   cat > conftest.$ac_ext <<EOF
8666 #line 8667 "configure"
8667 #include "confdefs.h"
8668 #include <sys/types.h>
8669 #if STDC_HEADERS
8670 #include <stdlib.h>
8671 #include <stddef.h>
8672 #endif
8673 EOF
8674 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8675   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8676   rm -rf conftest*
8677   ac_cv_type_mode_t=yes
8678 else
8679   rm -rf conftest*
8680   ac_cv_type_mode_t=no
8681 fi
8682 rm -f conftest*
8683
8684 fi
8685 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
8686 if test $ac_cv_type_mode_t = no; then
8687   cat >> confdefs.h <<\EOF
8688 #define mode_t int
8689 EOF
8690
8691 fi
8692
8693 echo $ac_n "checking for off_t""... $ac_c" 1>&6
8694 echo "configure:8695: checking for off_t" >&5
8695 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
8696   echo $ac_n "(cached) $ac_c" 1>&6
8697 else
8698   cat > conftest.$ac_ext <<EOF
8699 #line 8700 "configure"
8700 #include "confdefs.h"
8701 #include <sys/types.h>
8702 #if STDC_HEADERS
8703 #include <stdlib.h>
8704 #include <stddef.h>
8705 #endif
8706 EOF
8707 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8708   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8709   rm -rf conftest*
8710   ac_cv_type_off_t=yes
8711 else
8712   rm -rf conftest*
8713   ac_cv_type_off_t=no
8714 fi
8715 rm -f conftest*
8716
8717 fi
8718 echo "$ac_t""$ac_cv_type_off_t" 1>&6
8719 if test $ac_cv_type_off_t = no; then
8720   cat >> confdefs.h <<\EOF
8721 #define off_t long
8722 EOF
8723
8724 fi
8725
8726 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
8727 echo "configure:8728: checking for pid_t" >&5
8728 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
8729   echo $ac_n "(cached) $ac_c" 1>&6
8730 else
8731   cat > conftest.$ac_ext <<EOF
8732 #line 8733 "configure"
8733 #include "confdefs.h"
8734 #include <sys/types.h>
8735 #if STDC_HEADERS
8736 #include <stdlib.h>
8737 #include <stddef.h>
8738 #endif
8739 EOF
8740 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8741   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8742   rm -rf conftest*
8743   ac_cv_type_pid_t=yes
8744 else
8745   rm -rf conftest*
8746   ac_cv_type_pid_t=no
8747 fi
8748 rm -f conftest*
8749
8750 fi
8751 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
8752 if test $ac_cv_type_pid_t = no; then
8753   cat >> confdefs.h <<\EOF
8754 #define pid_t int
8755 EOF
8756
8757 fi
8758
8759 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
8760 echo "configure:8761: checking for ptrdiff_t" >&5
8761 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
8762   echo $ac_n "(cached) $ac_c" 1>&6
8763 else
8764   cat > conftest.$ac_ext <<EOF
8765 #line 8766 "configure"
8766 #include "confdefs.h"
8767 #include <stddef.h>
8768 int main() {
8769 ptrdiff_t p
8770 ; return 0; }
8771 EOF
8772 if { (eval echo configure:8773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8773   rm -rf conftest*
8774   am_cv_type_ptrdiff_t=yes
8775 else
8776   echo "configure: failed program was:" >&5
8777   cat conftest.$ac_ext >&5
8778   rm -rf conftest*
8779   am_cv_type_ptrdiff_t=no
8780 fi
8781 rm -f conftest*
8782 fi
8783
8784 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
8785    if test $am_cv_type_ptrdiff_t = yes; then
8786      cat >> confdefs.h <<\EOF
8787 #define HAVE_PTRDIFF_T 1
8788 EOF
8789
8790    fi
8791
8792 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
8793 echo "configure:8794: checking return type of signal handlers" >&5
8794 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
8795   echo $ac_n "(cached) $ac_c" 1>&6
8796 else
8797   cat > conftest.$ac_ext <<EOF
8798 #line 8799 "configure"
8799 #include "confdefs.h"
8800 #include <sys/types.h>
8801 #include <signal.h>
8802 #ifdef signal
8803 #undef signal
8804 #endif
8805 #ifdef __cplusplus
8806 extern "C" void (*signal (int, void (*)(int)))(int);
8807 #else
8808 void (*signal ()) ();
8809 #endif
8810
8811 int main() {
8812 int i;
8813 ; return 0; }
8814 EOF
8815 if { (eval echo configure:8816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8816   rm -rf conftest*
8817   ac_cv_type_signal=void
8818 else
8819   echo "configure: failed program was:" >&5
8820   cat conftest.$ac_ext >&5
8821   rm -rf conftest*
8822   ac_cv_type_signal=int
8823 fi
8824 rm -f conftest*
8825 fi
8826
8827 echo "$ac_t""$ac_cv_type_signal" 1>&6
8828 cat >> confdefs.h <<EOF
8829 #define RETSIGTYPE $ac_cv_type_signal
8830 EOF
8831
8832
8833 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
8834 echo "configure:8835: checking for sig_atomic_t" >&5
8835 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
8836   echo $ac_n "(cached) $ac_c" 1>&6
8837 else
8838   cat > conftest.$ac_ext <<EOF
8839 #line 8840 "configure"
8840 #include "confdefs.h"
8841 #include <signal.h>
8842 int main() {
8843 sig_atomic_t atomic;
8844 ; return 0; }
8845 EOF
8846 if { (eval echo configure:8847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8847   rm -rf conftest*
8848   ol_cv_type_sig_atomic_t=yes
8849 else
8850   echo "configure: failed program was:" >&5
8851   cat conftest.$ac_ext >&5
8852   rm -rf conftest*
8853   ol_cv_type_sig_atomic_t=no
8854 fi
8855 rm -f conftest*
8856 fi
8857
8858 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
8859   if test $ol_cv_type_sig_atomic_t = no; then
8860     cat >> confdefs.h <<\EOF
8861 #define sig_atomic_t int
8862 EOF
8863
8864   fi
8865  
8866 echo $ac_n "checking for size_t""... $ac_c" 1>&6
8867 echo "configure:8868: checking for size_t" >&5
8868 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
8869   echo $ac_n "(cached) $ac_c" 1>&6
8870 else
8871   cat > conftest.$ac_ext <<EOF
8872 #line 8873 "configure"
8873 #include "confdefs.h"
8874 #include <sys/types.h>
8875 #if STDC_HEADERS
8876 #include <stdlib.h>
8877 #include <stddef.h>
8878 #endif
8879 EOF
8880 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
8881   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
8882   rm -rf conftest*
8883   ac_cv_type_size_t=yes
8884 else
8885   rm -rf conftest*
8886   ac_cv_type_size_t=no
8887 fi
8888 rm -f conftest*
8889
8890 fi
8891 echo "$ac_t""$ac_cv_type_size_t" 1>&6
8892 if test $ac_cv_type_size_t = no; then
8893   cat >> confdefs.h <<\EOF
8894 #define size_t unsigned
8895 EOF
8896
8897 fi
8898
8899 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
8900 echo "configure:8901: checking for st_blksize in struct stat" >&5
8901 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
8902   echo $ac_n "(cached) $ac_c" 1>&6
8903 else
8904   cat > conftest.$ac_ext <<EOF
8905 #line 8906 "configure"
8906 #include "confdefs.h"
8907 #include <sys/types.h>
8908 #include <sys/stat.h>
8909 int main() {
8910 struct stat s; s.st_blksize;
8911 ; return 0; }
8912 EOF
8913 if { (eval echo configure:8914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8914   rm -rf conftest*
8915   ac_cv_struct_st_blksize=yes
8916 else
8917   echo "configure: failed program was:" >&5
8918   cat conftest.$ac_ext >&5
8919   rm -rf conftest*
8920   ac_cv_struct_st_blksize=no
8921 fi
8922 rm -f conftest*
8923 fi
8924
8925 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
8926 if test $ac_cv_struct_st_blksize = yes; then
8927   cat >> confdefs.h <<\EOF
8928 #define HAVE_ST_BLKSIZE 1
8929 EOF
8930
8931 fi
8932
8933 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
8934 echo "configure:8935: checking whether time.h and sys/time.h may both be included" >&5
8935 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
8936   echo $ac_n "(cached) $ac_c" 1>&6
8937 else
8938   cat > conftest.$ac_ext <<EOF
8939 #line 8940 "configure"
8940 #include "confdefs.h"
8941 #include <sys/types.h>
8942 #include <sys/time.h>
8943 #include <time.h>
8944 int main() {
8945 struct tm *tp;
8946 ; return 0; }
8947 EOF
8948 if { (eval echo configure:8949: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8949   rm -rf conftest*
8950   ac_cv_header_time=yes
8951 else
8952   echo "configure: failed program was:" >&5
8953   cat conftest.$ac_ext >&5
8954   rm -rf conftest*
8955   ac_cv_header_time=no
8956 fi
8957 rm -f conftest*
8958 fi
8959
8960 echo "$ac_t""$ac_cv_header_time" 1>&6
8961 if test $ac_cv_header_time = yes; then
8962   cat >> confdefs.h <<\EOF
8963 #define TIME_WITH_SYS_TIME 1
8964 EOF
8965
8966 fi
8967
8968 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
8969 echo "configure:8970: checking whether struct tm is in sys/time.h or time.h" >&5
8970 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
8971   echo $ac_n "(cached) $ac_c" 1>&6
8972 else
8973   cat > conftest.$ac_ext <<EOF
8974 #line 8975 "configure"
8975 #include "confdefs.h"
8976 #include <sys/types.h>
8977 #include <time.h>
8978 int main() {
8979 struct tm *tp; tp->tm_sec;
8980 ; return 0; }
8981 EOF
8982 if { (eval echo configure:8983: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
8983   rm -rf conftest*
8984   ac_cv_struct_tm=time.h
8985 else
8986   echo "configure: failed program was:" >&5
8987   cat conftest.$ac_ext >&5
8988   rm -rf conftest*
8989   ac_cv_struct_tm=sys/time.h
8990 fi
8991 rm -f conftest*
8992 fi
8993
8994 echo "$ac_t""$ac_cv_struct_tm" 1>&6
8995 if test $ac_cv_struct_tm = sys/time.h; then
8996   cat >> confdefs.h <<\EOF
8997 #define TM_IN_SYS_TIME 1
8998 EOF
8999
9000 fi
9001
9002
9003
9004 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
9005 echo "configure:9006: checking if toupper() requires islower()" >&5
9006 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
9007   echo $ac_n "(cached) $ac_c" 1>&6
9008 else
9009   
9010         if test "$cross_compiling" = yes; then
9011   ol_cv_c_upper_lower=safe
9012 else
9013   cat > conftest.$ac_ext <<EOF
9014 #line 9015 "configure"
9015 #include "confdefs.h"
9016
9017 #include <ctype.h>
9018 main()
9019 {
9020         if ('C' == toupper('C'))
9021                 exit(0);
9022         else
9023                 exit(1);
9024 }
9025 EOF
9026 if { (eval echo configure:9027: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9027 then
9028   ol_cv_c_upper_lower=no
9029 else
9030   echo "configure: failed program was:" >&5
9031   cat conftest.$ac_ext >&5
9032   rm -fr conftest*
9033   ol_cv_c_upper_lower=yes
9034 fi
9035 rm -fr conftest*
9036 fi
9037
9038 fi
9039
9040 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
9041 if test $ol_cv_c_upper_lower != no ; then
9042         cat >> confdefs.h <<\EOF
9043 #define C_UPPER_LOWER 1
9044 EOF
9045
9046 fi
9047
9048 echo $ac_n "checking for working const""... $ac_c" 1>&6
9049 echo "configure:9050: checking for working const" >&5
9050 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
9051   echo $ac_n "(cached) $ac_c" 1>&6
9052 else
9053   cat > conftest.$ac_ext <<EOF
9054 #line 9055 "configure"
9055 #include "confdefs.h"
9056
9057 int main() {
9058
9059 /* Ultrix mips cc rejects this.  */
9060 typedef int charset[2]; const charset x;
9061 /* SunOS 4.1.1 cc rejects this.  */
9062 char const *const *ccp;
9063 char **p;
9064 /* NEC SVR4.0.2 mips cc rejects this.  */
9065 struct point {int x, y;};
9066 static struct point const zero = {0,0};
9067 /* AIX XL C 1.02.0.0 rejects this.
9068    It does not let you subtract one const X* pointer from another in an arm
9069    of an if-expression whose if-part is not a constant expression */
9070 const char *g = "string";
9071 ccp = &g + (g ? g-g : 0);
9072 /* HPUX 7.0 cc rejects these. */
9073 ++ccp;
9074 p = (char**) ccp;
9075 ccp = (char const *const *) p;
9076 { /* SCO 3.2v4 cc rejects this.  */
9077   char *t;
9078   char const *s = 0 ? (char *) 0 : (char const *) 0;
9079
9080   *t++ = 0;
9081 }
9082 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
9083   int x[] = {25, 17};
9084   const int *foo = &x[0];
9085   ++foo;
9086 }
9087 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
9088   typedef const int *iptr;
9089   iptr p = 0;
9090   ++p;
9091 }
9092 { /* AIX XL C 1.02.0.0 rejects this saying
9093      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
9094   struct s { int j; const int *ap[3]; };
9095   struct s *b; b->j = 5;
9096 }
9097 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
9098   const int foo = 10;
9099 }
9100
9101 ; return 0; }
9102 EOF
9103 if { (eval echo configure:9104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9104   rm -rf conftest*
9105   ac_cv_c_const=yes
9106 else
9107   echo "configure: failed program was:" >&5
9108   cat conftest.$ac_ext >&5
9109   rm -rf conftest*
9110   ac_cv_c_const=no
9111 fi
9112 rm -f conftest*
9113 fi
9114
9115 echo "$ac_t""$ac_cv_c_const" 1>&6
9116 if test $ac_cv_c_const = no; then
9117   cat >> confdefs.h <<\EOF
9118 #define const 
9119 EOF
9120
9121 fi
9122
9123 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
9124 echo "configure:9125: checking if compiler understands volatile" >&5
9125 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
9126   echo $ac_n "(cached) $ac_c" 1>&6
9127 else
9128   cat > conftest.$ac_ext <<EOF
9129 #line 9130 "configure"
9130 #include "confdefs.h"
9131 int x, y, z;
9132 int main() {
9133 volatile int a; int * volatile b = x ? &y : &z;
9134       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
9135       *b = 0;
9136 ; return 0; }
9137 EOF
9138 if { (eval echo configure:9139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9139   rm -rf conftest*
9140   ol_cv_c_volatile=yes
9141 else
9142   echo "configure: failed program was:" >&5
9143   cat conftest.$ac_ext >&5
9144   rm -rf conftest*
9145   ol_cv_c_volatile=no
9146 fi
9147 rm -f conftest*
9148 fi
9149
9150 echo "$ac_t""$ol_cv_c_volatile" 1>&6
9151   if test $ol_cv_c_volatile = yes; then
9152     : 
9153   else
9154     cat >> confdefs.h <<\EOF
9155 #define volatile 
9156 EOF
9157
9158   fi
9159  
9160
9161 if test $cross_compiling = yes ; then
9162         cat >> confdefs.h <<\EOF
9163 #define CROSS_COMPILING 1
9164 EOF
9165
9166 else
9167         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
9168 echo "configure:9169: checking whether byte ordering is bigendian" >&5
9169 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
9170   echo $ac_n "(cached) $ac_c" 1>&6
9171 else
9172   ac_cv_c_bigendian=unknown
9173 # See if sys/param.h defines the BYTE_ORDER macro.
9174 cat > conftest.$ac_ext <<EOF
9175 #line 9176 "configure"
9176 #include "confdefs.h"
9177 #include <sys/types.h>
9178 #include <sys/param.h>
9179 int main() {
9180
9181 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
9182  bogus endian macros
9183 #endif
9184 ; return 0; }
9185 EOF
9186 if { (eval echo configure:9187: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9187   rm -rf conftest*
9188   # It does; now see whether it defined to BIG_ENDIAN or not.
9189 cat > conftest.$ac_ext <<EOF
9190 #line 9191 "configure"
9191 #include "confdefs.h"
9192 #include <sys/types.h>
9193 #include <sys/param.h>
9194 int main() {
9195
9196 #if BYTE_ORDER != BIG_ENDIAN
9197  not big endian
9198 #endif
9199 ; return 0; }
9200 EOF
9201 if { (eval echo configure:9202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9202   rm -rf conftest*
9203   ac_cv_c_bigendian=yes
9204 else
9205   echo "configure: failed program was:" >&5
9206   cat conftest.$ac_ext >&5
9207   rm -rf conftest*
9208   ac_cv_c_bigendian=no
9209 fi
9210 rm -f conftest*
9211 else
9212   echo "configure: failed program was:" >&5
9213   cat conftest.$ac_ext >&5
9214 fi
9215 rm -f conftest*
9216 if test $ac_cv_c_bigendian = unknown; then
9217 if test "$cross_compiling" = yes; then
9218     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9219 else
9220   cat > conftest.$ac_ext <<EOF
9221 #line 9222 "configure"
9222 #include "confdefs.h"
9223 main () {
9224   /* Are we little or big endian?  From Harbison&Steele.  */
9225   union
9226   {
9227     long l;
9228     char c[sizeof (long)];
9229   } u;
9230   u.l = 1;
9231   exit (u.c[sizeof (long) - 1] == 1);
9232 }
9233 EOF
9234 if { (eval echo configure:9235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9235 then
9236   ac_cv_c_bigendian=no
9237 else
9238   echo "configure: failed program was:" >&5
9239   cat conftest.$ac_ext >&5
9240   rm -fr conftest*
9241   ac_cv_c_bigendian=yes
9242 fi
9243 rm -fr conftest*
9244 fi
9245
9246 fi
9247 fi
9248
9249 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
9250 if test $ac_cv_c_bigendian = yes; then
9251   cat >> confdefs.h <<\EOF
9252 #define WORDS_BIGENDIAN 1
9253 EOF
9254
9255 fi
9256
9257         echo $ac_n "checking size of short""... $ac_c" 1>&6
9258 echo "configure:9259: checking size of short" >&5
9259 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
9260   echo $ac_n "(cached) $ac_c" 1>&6
9261 else
9262   if test "$cross_compiling" = yes; then
9263     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9264 else
9265   cat > conftest.$ac_ext <<EOF
9266 #line 9267 "configure"
9267 #include "confdefs.h"
9268 #include <stdio.h>
9269 main()
9270 {
9271   FILE *f=fopen("conftestval", "w");
9272   if (!f) exit(1);
9273   fprintf(f, "%d\n", sizeof(short));
9274   exit(0);
9275 }
9276 EOF
9277 if { (eval echo configure:9278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9278 then
9279   ac_cv_sizeof_short=`cat conftestval`
9280 else
9281   echo "configure: failed program was:" >&5
9282   cat conftest.$ac_ext >&5
9283   rm -fr conftest*
9284   ac_cv_sizeof_short=0
9285 fi
9286 rm -fr conftest*
9287 fi
9288
9289 fi
9290 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
9291 cat >> confdefs.h <<EOF
9292 #define SIZEOF_SHORT $ac_cv_sizeof_short
9293 EOF
9294
9295  
9296         echo $ac_n "checking size of int""... $ac_c" 1>&6
9297 echo "configure:9298: checking size of int" >&5
9298 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
9299   echo $ac_n "(cached) $ac_c" 1>&6
9300 else
9301   if test "$cross_compiling" = yes; then
9302     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9303 else
9304   cat > conftest.$ac_ext <<EOF
9305 #line 9306 "configure"
9306 #include "confdefs.h"
9307 #include <stdio.h>
9308 main()
9309 {
9310   FILE *f=fopen("conftestval", "w");
9311   if (!f) exit(1);
9312   fprintf(f, "%d\n", sizeof(int));
9313   exit(0);
9314 }
9315 EOF
9316 if { (eval echo configure:9317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9317 then
9318   ac_cv_sizeof_int=`cat conftestval`
9319 else
9320   echo "configure: failed program was:" >&5
9321   cat conftest.$ac_ext >&5
9322   rm -fr conftest*
9323   ac_cv_sizeof_int=0
9324 fi
9325 rm -fr conftest*
9326 fi
9327
9328 fi
9329 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
9330 cat >> confdefs.h <<EOF
9331 #define SIZEOF_INT $ac_cv_sizeof_int
9332 EOF
9333
9334  
9335         echo $ac_n "checking size of long""... $ac_c" 1>&6
9336 echo "configure:9337: checking size of long" >&5
9337 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
9338   echo $ac_n "(cached) $ac_c" 1>&6
9339 else
9340   if test "$cross_compiling" = yes; then
9341     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
9342 else
9343   cat > conftest.$ac_ext <<EOF
9344 #line 9345 "configure"
9345 #include "confdefs.h"
9346 #include <stdio.h>
9347 main()
9348 {
9349   FILE *f=fopen("conftestval", "w");
9350   if (!f) exit(1);
9351   fprintf(f, "%d\n", sizeof(long));
9352   exit(0);
9353 }
9354 EOF
9355 if { (eval echo configure:9356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9356 then
9357   ac_cv_sizeof_long=`cat conftestval`
9358 else
9359   echo "configure: failed program was:" >&5
9360   cat conftest.$ac_ext >&5
9361   rm -fr conftest*
9362   ac_cv_sizeof_long=0
9363 fi
9364 rm -fr conftest*
9365 fi
9366
9367 fi
9368 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
9369 cat >> confdefs.h <<EOF
9370 #define SIZEOF_LONG $ac_cv_sizeof_long
9371 EOF
9372
9373
9374 fi
9375
9376 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
9377 echo "configure:9378: checking for 8-bit clean memcmp" >&5
9378 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
9379   echo $ac_n "(cached) $ac_c" 1>&6
9380 else
9381   if test "$cross_compiling" = yes; then
9382   ac_cv_func_memcmp_clean=no
9383 else
9384   cat > conftest.$ac_ext <<EOF
9385 #line 9386 "configure"
9386 #include "confdefs.h"
9387
9388 main()
9389 {
9390   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
9391   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
9392 }
9393
9394 EOF
9395 if { (eval echo configure:9396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9396 then
9397   ac_cv_func_memcmp_clean=yes
9398 else
9399   echo "configure: failed program was:" >&5
9400   cat conftest.$ac_ext >&5
9401   rm -fr conftest*
9402   ac_cv_func_memcmp_clean=no
9403 fi
9404 rm -fr conftest*
9405 fi
9406
9407 fi
9408
9409 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
9410 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
9411
9412 echo $ac_n "checking for strftime""... $ac_c" 1>&6
9413 echo "configure:9414: checking for strftime" >&5
9414 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
9415   echo $ac_n "(cached) $ac_c" 1>&6
9416 else
9417   cat > conftest.$ac_ext <<EOF
9418 #line 9419 "configure"
9419 #include "confdefs.h"
9420 /* System header to define __stub macros and hopefully few prototypes,
9421     which can conflict with char strftime(); below.  */
9422 #include <assert.h>
9423 /* Override any gcc2 internal prototype to avoid an error.  */
9424 /* We use char because int might match the return type of a gcc2
9425     builtin and then its argument prototype would still apply.  */
9426 char strftime();
9427
9428 int main() {
9429
9430 /* The GNU C library defines this for functions which it implements
9431     to always fail with ENOSYS.  Some functions are actually named
9432     something starting with __ and the normal name is an alias.  */
9433 #if defined (__stub_strftime) || defined (__stub___strftime)
9434 choke me
9435 #else
9436 strftime();
9437 #endif
9438
9439 ; return 0; }
9440 EOF
9441 if { (eval echo configure:9442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9442   rm -rf conftest*
9443   eval "ac_cv_func_strftime=yes"
9444 else
9445   echo "configure: failed program was:" >&5
9446   cat conftest.$ac_ext >&5
9447   rm -rf conftest*
9448   eval "ac_cv_func_strftime=no"
9449 fi
9450 rm -f conftest*
9451 fi
9452
9453 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
9454   echo "$ac_t""yes" 1>&6
9455   cat >> confdefs.h <<\EOF
9456 #define HAVE_STRFTIME 1
9457 EOF
9458
9459 else
9460   echo "$ac_t""no" 1>&6
9461 # strftime is in -lintl on SCO UNIX.
9462 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
9463 echo "configure:9464: checking for strftime in -lintl" >&5
9464 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
9465 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9466   echo $ac_n "(cached) $ac_c" 1>&6
9467 else
9468   ac_save_LIBS="$LIBS"
9469 LIBS="-lintl  $LIBS"
9470 cat > conftest.$ac_ext <<EOF
9471 #line 9472 "configure"
9472 #include "confdefs.h"
9473 /* Override any gcc2 internal prototype to avoid an error.  */
9474 /* We use char because int might match the return type of a gcc2
9475     builtin and then its argument prototype would still apply.  */
9476 char strftime();
9477
9478 int main() {
9479 strftime()
9480 ; return 0; }
9481 EOF
9482 if { (eval echo configure:9483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9483   rm -rf conftest*
9484   eval "ac_cv_lib_$ac_lib_var=yes"
9485 else
9486   echo "configure: failed program was:" >&5
9487   cat conftest.$ac_ext >&5
9488   rm -rf conftest*
9489   eval "ac_cv_lib_$ac_lib_var=no"
9490 fi
9491 rm -f conftest*
9492 LIBS="$ac_save_LIBS"
9493
9494 fi
9495 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9496   echo "$ac_t""yes" 1>&6
9497   cat >> confdefs.h <<\EOF
9498 #define HAVE_STRFTIME 1
9499 EOF
9500
9501 LIBS="-lintl $LIBS"
9502 else
9503   echo "$ac_t""no" 1>&6
9504 fi
9505
9506 fi
9507
9508 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
9509 echo "configure:9510: checking for vprintf" >&5
9510 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
9511   echo $ac_n "(cached) $ac_c" 1>&6
9512 else
9513   cat > conftest.$ac_ext <<EOF
9514 #line 9515 "configure"
9515 #include "confdefs.h"
9516 /* System header to define __stub macros and hopefully few prototypes,
9517     which can conflict with char vprintf(); below.  */
9518 #include <assert.h>
9519 /* Override any gcc2 internal prototype to avoid an error.  */
9520 /* We use char because int might match the return type of a gcc2
9521     builtin and then its argument prototype would still apply.  */
9522 char vprintf();
9523
9524 int main() {
9525
9526 /* The GNU C library defines this for functions which it implements
9527     to always fail with ENOSYS.  Some functions are actually named
9528     something starting with __ and the normal name is an alias.  */
9529 #if defined (__stub_vprintf) || defined (__stub___vprintf)
9530 choke me
9531 #else
9532 vprintf();
9533 #endif
9534
9535 ; return 0; }
9536 EOF
9537 if { (eval echo configure:9538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9538   rm -rf conftest*
9539   eval "ac_cv_func_vprintf=yes"
9540 else
9541   echo "configure: failed program was:" >&5
9542   cat conftest.$ac_ext >&5
9543   rm -rf conftest*
9544   eval "ac_cv_func_vprintf=no"
9545 fi
9546 rm -f conftest*
9547 fi
9548
9549 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
9550   echo "$ac_t""yes" 1>&6
9551   cat >> confdefs.h <<\EOF
9552 #define HAVE_VPRINTF 1
9553 EOF
9554
9555 else
9556   echo "$ac_t""no" 1>&6
9557 fi
9558
9559 if test "$ac_cv_func_vprintf" != yes; then
9560 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
9561 echo "configure:9562: checking for _doprnt" >&5
9562 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
9563   echo $ac_n "(cached) $ac_c" 1>&6
9564 else
9565   cat > conftest.$ac_ext <<EOF
9566 #line 9567 "configure"
9567 #include "confdefs.h"
9568 /* System header to define __stub macros and hopefully few prototypes,
9569     which can conflict with char _doprnt(); below.  */
9570 #include <assert.h>
9571 /* Override any gcc2 internal prototype to avoid an error.  */
9572 /* We use char because int might match the return type of a gcc2
9573     builtin and then its argument prototype would still apply.  */
9574 char _doprnt();
9575
9576 int main() {
9577
9578 /* The GNU C library defines this for functions which it implements
9579     to always fail with ENOSYS.  Some functions are actually named
9580     something starting with __ and the normal name is an alias.  */
9581 #if defined (__stub__doprnt) || defined (__stub____doprnt)
9582 choke me
9583 #else
9584 _doprnt();
9585 #endif
9586
9587 ; return 0; }
9588 EOF
9589 if { (eval echo configure:9590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9590   rm -rf conftest*
9591   eval "ac_cv_func__doprnt=yes"
9592 else
9593   echo "configure: failed program was:" >&5
9594   cat conftest.$ac_ext >&5
9595   rm -rf conftest*
9596   eval "ac_cv_func__doprnt=no"
9597 fi
9598 rm -f conftest*
9599 fi
9600
9601 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
9602   echo "$ac_t""yes" 1>&6
9603   cat >> confdefs.h <<\EOF
9604 #define HAVE_DOPRNT 1
9605 EOF
9606
9607 else
9608   echo "$ac_t""no" 1>&6
9609 fi
9610
9611 fi
9612
9613
9614 if test $ac_cv_func_vprintf = yes ; then
9615                 for ac_func in vsnprintf vsprintf
9616 do
9617 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9618 echo "configure:9619: checking for $ac_func" >&5
9619 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9620   echo $ac_n "(cached) $ac_c" 1>&6
9621 else
9622   cat > conftest.$ac_ext <<EOF
9623 #line 9624 "configure"
9624 #include "confdefs.h"
9625 /* System header to define __stub macros and hopefully few prototypes,
9626     which can conflict with char $ac_func(); below.  */
9627 #include <assert.h>
9628 /* Override any gcc2 internal prototype to avoid an error.  */
9629 /* We use char because int might match the return type of a gcc2
9630     builtin and then its argument prototype would still apply.  */
9631 char $ac_func();
9632
9633 int main() {
9634
9635 /* The GNU C library defines this for functions which it implements
9636     to always fail with ENOSYS.  Some functions are actually named
9637     something starting with __ and the normal name is an alias.  */
9638 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9639 choke me
9640 #else
9641 $ac_func();
9642 #endif
9643
9644 ; return 0; }
9645 EOF
9646 if { (eval echo configure:9647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9647   rm -rf conftest*
9648   eval "ac_cv_func_$ac_func=yes"
9649 else
9650   echo "configure: failed program was:" >&5
9651   cat conftest.$ac_ext >&5
9652   rm -rf conftest*
9653   eval "ac_cv_func_$ac_func=no"
9654 fi
9655 rm -f conftest*
9656 fi
9657
9658 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9659   echo "$ac_t""yes" 1>&6
9660     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9661   cat >> confdefs.h <<EOF
9662 #define $ac_tr_func 1
9663 EOF
9664  
9665 else
9666   echo "$ac_t""no" 1>&6
9667 fi
9668 done
9669
9670 fi
9671
9672 for ac_func in \
9673         bcopy                   \
9674         flock                   \
9675         getdtablesize   \
9676         gethostname             \
9677         getpwuid                \
9678         gettimeofday    \
9679         lockf                   \
9680         memcpy                  \
9681         memmove                 \
9682         mkstemp                 \
9683         select                  \
9684         setpwfile               \
9685         setsid                  \
9686         signal                  \
9687         sigset                  \
9688         snprintf                \
9689         socket                  \
9690         strdup                  \
9691         strerror                \
9692         strpbrk                 \
9693         strrchr                 \
9694         strsep                  \
9695         strstr                  \
9696         strtol                  \
9697         strtoul                 \
9698         strspn                  \
9699         sysconf                 \
9700         waitpid                 \
9701
9702 do
9703 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9704 echo "configure:9705: checking for $ac_func" >&5
9705 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9706   echo $ac_n "(cached) $ac_c" 1>&6
9707 else
9708   cat > conftest.$ac_ext <<EOF
9709 #line 9710 "configure"
9710 #include "confdefs.h"
9711 /* System header to define __stub macros and hopefully few prototypes,
9712     which can conflict with char $ac_func(); below.  */
9713 #include <assert.h>
9714 /* Override any gcc2 internal prototype to avoid an error.  */
9715 /* We use char because int might match the return type of a gcc2
9716     builtin and then its argument prototype would still apply.  */
9717 char $ac_func();
9718
9719 int main() {
9720
9721 /* The GNU C library defines this for functions which it implements
9722     to always fail with ENOSYS.  Some functions are actually named
9723     something starting with __ and the normal name is an alias.  */
9724 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9725 choke me
9726 #else
9727 $ac_func();
9728 #endif
9729
9730 ; return 0; }
9731 EOF
9732 if { (eval echo configure:9733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9733   rm -rf conftest*
9734   eval "ac_cv_func_$ac_func=yes"
9735 else
9736   echo "configure: failed program was:" >&5
9737   cat conftest.$ac_ext >&5
9738   rm -rf conftest*
9739   eval "ac_cv_func_$ac_func=no"
9740 fi
9741 rm -f conftest*
9742 fi
9743
9744 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9745   echo "$ac_t""yes" 1>&6
9746     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9747   cat >> confdefs.h <<EOF
9748 #define $ac_tr_func 1
9749 EOF
9750  
9751 else
9752   echo "$ac_t""no" 1>&6
9753 fi
9754 done
9755
9756
9757 for ac_func in getopt tempnam
9758 do
9759 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9760 echo "configure:9761: checking for $ac_func" >&5
9761 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
9762   echo $ac_n "(cached) $ac_c" 1>&6
9763 else
9764   cat > conftest.$ac_ext <<EOF
9765 #line 9766 "configure"
9766 #include "confdefs.h"
9767 /* System header to define __stub macros and hopefully few prototypes,
9768     which can conflict with char $ac_func(); below.  */
9769 #include <assert.h>
9770 /* Override any gcc2 internal prototype to avoid an error.  */
9771 /* We use char because int might match the return type of a gcc2
9772     builtin and then its argument prototype would still apply.  */
9773 char $ac_func();
9774
9775 int main() {
9776
9777 /* The GNU C library defines this for functions which it implements
9778     to always fail with ENOSYS.  Some functions are actually named
9779     something starting with __ and the normal name is an alias.  */
9780 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9781 choke me
9782 #else
9783 $ac_func();
9784 #endif
9785
9786 ; return 0; }
9787 EOF
9788 if { (eval echo configure:9789: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9789   rm -rf conftest*
9790   eval "ac_cv_func_$ac_func=yes"
9791 else
9792   echo "configure: failed program was:" >&5
9793   cat conftest.$ac_ext >&5
9794   rm -rf conftest*
9795   eval "ac_cv_func_$ac_func=no"
9796 fi
9797 rm -f conftest*
9798 fi
9799
9800 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9801   echo "$ac_t""yes" 1>&6
9802     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9803   cat >> confdefs.h <<EOF
9804 #define $ac_tr_func 1
9805 EOF
9806  
9807 else
9808   echo "$ac_t""no" 1>&6
9809 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
9810 fi
9811 done
9812
9813
9814
9815 # Check Configuration
9816
9817 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
9818 echo "configure:9819: checking declaration of sys_errlist" >&5
9819 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
9820   echo $ac_n "(cached) $ac_c" 1>&6
9821 else
9822   
9823         cat > conftest.$ac_ext <<EOF
9824 #line 9825 "configure"
9825 #include "confdefs.h"
9826
9827 #include <stdio.h>
9828 #include <sys/types.h>
9829 #include <errno.h> 
9830 int main() {
9831 char *c = (char *) *sys_errlist
9832 ; return 0; }
9833 EOF
9834 if { (eval echo configure:9835: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9835   rm -rf conftest*
9836   ol_cv_dcl_sys_errlist=yes
9837 else
9838   echo "configure: failed program was:" >&5
9839   cat conftest.$ac_ext >&5
9840   rm -rf conftest*
9841   ol_cv_dcl_sys_errlist=no
9842 fi
9843 rm -f conftest*
9844 fi
9845
9846 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
9847 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
9848 if test $ol_cv_dcl_sys_errlist = no ; then
9849         cat >> confdefs.h <<\EOF
9850 #define DECL_SYS_ERRLIST 1
9851 EOF
9852
9853         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
9854 echo "configure:9855: checking existence of sys_errlist" >&5
9855         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
9856   echo $ac_n "(cached) $ac_c" 1>&6
9857 else
9858   
9859                 cat > conftest.$ac_ext <<EOF
9860 #line 9861 "configure"
9861 #include "confdefs.h"
9862 #include <errno.h>
9863 int main() {
9864 char *c = (char *) *sys_errlist
9865 ; return 0; }
9866 EOF
9867 if { (eval echo configure:9868: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9868   rm -rf conftest*
9869   ol_cv_have_sys_errlist=yes
9870 else
9871   echo "configure: failed program was:" >&5
9872   cat conftest.$ac_ext >&5
9873   rm -rf conftest*
9874   ol_cv_have_sys_errlist=no
9875 fi
9876 rm -f conftest*
9877 fi
9878
9879         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
9880 fi
9881
9882
9883
9884 if test "$ol_enable_debug" != no ; then
9885         cat >> confdefs.h <<\EOF
9886 #define LDAP_DEBUG 1
9887 EOF
9888
9889 fi
9890 if test "$ol_enable_syslog" = yes ; then
9891         cat >> confdefs.h <<\EOF
9892 #define LDAP_SYSLOG 1
9893 EOF
9894
9895 fi
9896 if test "$ol_enable_libui" = yes ; then
9897         cat >> confdefs.h <<\EOF
9898 #define LDAP_LIBUI 1
9899 EOF
9900
9901 fi
9902 if test "$ol_enable_cache" = no ; then
9903         cat >> confdefs.h <<\EOF
9904 #define LDAP_NOCACHE 1
9905 EOF
9906
9907 fi
9908 if test "$ol_enable_dns" != no ; then
9909         cat >> confdefs.h <<\EOF
9910 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
9911 EOF
9912
9913 fi
9914 if test "$ol_enable_proctitle" != no ; then
9915         cat >> confdefs.h <<\EOF
9916 #define LDAP_PROCTITLE 1
9917 EOF
9918
9919 fi
9920 if test "$ol_enable_referrals" != no ; then
9921         cat >> confdefs.h <<\EOF
9922 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
9923 EOF
9924
9925 fi
9926 if test "$ol_enable_cldap" != no ; then
9927         cat >> confdefs.h <<\EOF
9928 #define LDAP_CONNECTIONLESS 1
9929 EOF
9930
9931 fi
9932
9933 if test "$ol_enable_aclgroups" != no ; then
9934         cat >> confdefs.h <<\EOF
9935 #define SLAPD_ACLGROUPS 1
9936 EOF
9937
9938 fi
9939 if test "$ol_enable_crypt" != no ; then
9940         cat >> confdefs.h <<\EOF
9941 #define SLAPD_CRYPT 1
9942 EOF
9943
9944 fi
9945 if test "$ol_enable_cleartext" != no ; then
9946         cat >> confdefs.h <<\EOF
9947 #define SLAPD_CLEARTEXT 1
9948 EOF
9949
9950 fi
9951 if test "$ol_enable_phonetic" != no ; then
9952         cat >> confdefs.h <<\EOF
9953 #define SLAPD_PHONETIC 1
9954 EOF
9955
9956 fi
9957 if test "$ol_enable_rlookups" != no ; then
9958         cat >> confdefs.h <<\EOF
9959 #define SLAPD_RLOOKUPS 1
9960 EOF
9961
9962 fi
9963
9964 if test "$ol_link_bdb2" != no ; then
9965         cat >> confdefs.h <<\EOF
9966 #define SLAPD_BDB2 1
9967 EOF
9968
9969         BUILD_SLAPD=yes
9970         BUILD_BDB2=yes
9971 fi
9972
9973 if test "$ol_link_ldbm" != no ; then
9974         cat >> confdefs.h <<\EOF
9975 #define SLAPD_LDBM 1
9976 EOF
9977
9978         BUILD_SLAPD=yes
9979         BUILD_LDBM=yes
9980 fi
9981
9982 if test "$ol_enable_passwd" != no ; then
9983         cat >> confdefs.h <<\EOF
9984 #define SLAPD_PASSWD 1
9985 EOF
9986
9987         BUILD_SLAPD=yes
9988         BUILD_PASSWD=yes
9989 fi
9990
9991 if test "$ol_enable_perl" != no ; then
9992         cat >> confdefs.h <<\EOF
9993 #define SLAPD_PERL 1
9994 EOF
9995
9996         BUILD_SLAPD=yes
9997         BUILD_PERL=yes
9998 fi
9999
10000 if test "$ol_enable_shell" != no ; then
10001         cat >> confdefs.h <<\EOF
10002 #define SLAPD_SHELL 1
10003 EOF
10004
10005         BUILD_SLAPD=yes
10006         BUILD_SHELL=yes
10007 fi
10008
10009 if test "$ol_enable_tcl" != no ; then
10010         cat >> confdefs.h <<\EOF
10011 #define SLAPD_TCL 1
10012 EOF
10013
10014         BUILD_SLAPD=yes
10015         BUILD_TCL=yes
10016 fi
10017
10018 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
10019         $BUILD_SLAPD = yes ; then
10020         BUILD_SLURPD=yes
10021 fi
10022
10023 if test "$ol_link_isode" != no ; then
10024         BUILD_LDAPD=yes
10025 fi
10026
10027
10028
10029
10030   
10031   
10032   
10033   
10034   
10035   
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054 trap '' 1 2 15
10055 cat > confcache <<\EOF
10056 # This file is a shell script that caches the results of configure
10057 # tests run on this system so they can be shared between configure
10058 # scripts and configure runs.  It is not useful on other systems.
10059 # If it contains results you don't want to keep, you may remove or edit it.
10060 #
10061 # By default, configure uses ./config.cache as the cache file,
10062 # creating it if it does not exist already.  You can give configure
10063 # the --cache-file=FILE option to use a different cache file; that is
10064 # what configure does when it calls configure scripts in
10065 # subdirectories, so they share the cache.
10066 # Giving --cache-file=/dev/null disables caching, for debugging configure.
10067 # config.status only pays attention to the cache file if you give it the
10068 # --recheck option to rerun configure.
10069 #
10070 EOF
10071 # The following way of writing the cache mishandles newlines in values,
10072 # but we know of no workaround that is simple, portable, and efficient.
10073 # So, don't put newlines in cache variables' values.
10074 # Ultrix sh set writes to stderr and can't be redirected directly,
10075 # and sets the high bit in the cache file unless we assign to the vars.
10076 (set) 2>&1 |
10077   case `(ac_space=' '; set | grep ac_space) 2>&1` in
10078   *ac_space=\ *)
10079     # `set' does not quote correctly, so add quotes (double-quote substitution
10080     # turns \\\\ into \\, and sed turns \\ into \).
10081     sed -n \
10082       -e "s/'/'\\\\''/g" \
10083       -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
10084     ;;
10085   *)
10086     # `set' quotes correctly as required by POSIX, so do not add quotes.
10087     sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
10088     ;;
10089   esac >> confcache
10090 if cmp -s $cache_file confcache; then
10091   :
10092 else
10093   if test -w $cache_file; then
10094     echo "updating cache $cache_file"
10095     cat confcache > $cache_file
10096   else
10097     echo "not updating unwritable cache $cache_file"
10098   fi
10099 fi
10100 rm -f confcache
10101
10102 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
10103
10104 test "x$prefix" = xNONE && prefix=$ac_default_prefix
10105 # Let make expand exec_prefix.
10106 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
10107
10108 # Any assignment to VPATH causes Sun make to only execute
10109 # the first set of double-colon rules, so remove it if not needed.
10110 # If there is a colon in the path, we need to keep it.
10111 if test "x$srcdir" = x.; then
10112   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
10113 fi
10114
10115 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
10116
10117 DEFS=-DHAVE_CONFIG_H
10118
10119 # Without the "./", some shells look in PATH for config.status.
10120 : ${CONFIG_STATUS=./config.status}
10121
10122 echo creating $CONFIG_STATUS
10123 rm -f $CONFIG_STATUS
10124 cat > $CONFIG_STATUS <<EOF
10125 #! /bin/sh
10126 # Generated automatically by configure.
10127 # Run this file to recreate the current configuration.
10128 # This directory was configured as follows,
10129 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
10130 #
10131 # $0 $ac_configure_args
10132 #
10133 # Compiler output produced by configure, useful for debugging
10134 # configure, is in ./config.log if it exists.
10135
10136 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
10137 for ac_option
10138 do
10139   case "\$ac_option" in
10140   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
10141     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
10142     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
10143   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
10144     echo "$CONFIG_STATUS generated by autoconf version 2.13"
10145     exit 0 ;;
10146   -help | --help | --hel | --he | --h)
10147     echo "\$ac_cs_usage"; exit 0 ;;
10148   *) echo "\$ac_cs_usage"; exit 1 ;;
10149   esac
10150 done
10151
10152 ac_given_srcdir=$srcdir
10153 ac_given_INSTALL="$INSTALL"
10154
10155 trap 'rm -fr `echo "\
10156 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10157 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10158 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10159 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10160 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10161 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10162 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10163 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10164 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10165 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10166 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10167 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10168 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10169 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10170 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10171 include/Makefile:build/top.mk:include/Makefile.in \
10172 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10173 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10174 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10175 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10176 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10177 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10178 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10179 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10180 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10181 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10182 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10183 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10184 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10185 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10186 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10187 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10188 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10189 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10190 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10191 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10192 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10193 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10194  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
10195 EOF
10196 cat >> $CONFIG_STATUS <<EOF
10197
10198 # Protect against being on the right side of a sed subst in config.status.
10199 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
10200  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
10201 $ac_vpsub
10202 $extrasub
10203 s%@SHELL@%$SHELL%g
10204 s%@CFLAGS@%$CFLAGS%g
10205 s%@CPPFLAGS@%$CPPFLAGS%g
10206 s%@CXXFLAGS@%$CXXFLAGS%g
10207 s%@FFLAGS@%$FFLAGS%g
10208 s%@DEFS@%$DEFS%g
10209 s%@LDFLAGS@%$LDFLAGS%g
10210 s%@LIBS@%$LIBS%g
10211 s%@exec_prefix@%$exec_prefix%g
10212 s%@prefix@%$prefix%g
10213 s%@program_transform_name@%$program_transform_name%g
10214 s%@bindir@%$bindir%g
10215 s%@sbindir@%$sbindir%g
10216 s%@libexecdir@%$libexecdir%g
10217 s%@datadir@%$datadir%g
10218 s%@sysconfdir@%$sysconfdir%g
10219 s%@sharedstatedir@%$sharedstatedir%g
10220 s%@localstatedir@%$localstatedir%g
10221 s%@libdir@%$libdir%g
10222 s%@includedir@%$includedir%g
10223 s%@oldincludedir@%$oldincludedir%g
10224 s%@infodir@%$infodir%g
10225 s%@mandir@%$mandir%g
10226 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
10227 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
10228 s%@INSTALL_DATA@%$INSTALL_DATA%g
10229 s%@PACKAGE@%$PACKAGE%g
10230 s%@VERSION@%$VERSION%g
10231 s%@ACLOCAL@%$ACLOCAL%g
10232 s%@AUTOCONF@%$AUTOCONF%g
10233 s%@AUTOMAKE@%$AUTOMAKE%g
10234 s%@AUTOHEADER@%$AUTOHEADER%g
10235 s%@MAKEINFO@%$MAKEINFO%g
10236 s%@SET_MAKE@%$SET_MAKE%g
10237 s%@top_builddir@%$top_builddir%g
10238 s%@ldap_subdir@%$ldap_subdir%g
10239 s%@host@%$host%g
10240 s%@host_alias@%$host_alias%g
10241 s%@host_cpu@%$host_cpu%g
10242 s%@host_vendor@%$host_vendor%g
10243 s%@host_os@%$host_os%g
10244 s%@RANLIB@%$RANLIB%g
10245 s%@CC@%$CC%g
10246 s%@LD@%$LD%g
10247 s%@NM@%$NM%g
10248 s%@LN_S@%$LN_S%g
10249 s%@LIBTOOL@%$LIBTOOL%g
10250 s%@AWK@%$AWK%g
10251 s%@SENDMAIL@%$SENDMAIL%g
10252 s%@EDITOR@%$EDITOR%g
10253 s%@FINGER@%$FINGER%g
10254 s%@PERLBIN@%$PERLBIN%g
10255 s%@CPP@%$CPP%g
10256 s%@EXEEXT@%$EXEEXT%g
10257 s%@OBJEXT@%$OBJEXT%g
10258 s%@PEPSY@%$PEPSY%g
10259 s%@LIBOBJS@%$LIBOBJS%g
10260 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
10261 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
10262 s%@BUILD_BDB2@%$BUILD_BDB2%g
10263 s%@BUILD_LDBM@%$BUILD_LDBM%g
10264 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
10265 s%@BUILD_PERL@%$BUILD_PERL%g
10266 s%@BUILD_SHELL@%$BUILD_SHELL%g
10267 s%@BUILD_TCL@%$BUILD_TCL%g
10268 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
10269 s%@LDAP_LIBS@%$LDAP_LIBS%g
10270 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
10271 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
10272 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
10273 s%@LDBM_LIBS@%$LDBM_LIBS%g
10274 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
10275 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
10276 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
10277 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
10278 s%@KRB_LIBS@%$KRB_LIBS%g
10279 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
10280 s%@TLS_LIBS@%$TLS_LIBS%g
10281
10282 CEOF
10283 EOF
10284
10285 cat >> $CONFIG_STATUS <<\EOF
10286
10287 # Split the substitutions into bite-sized pieces for seds with
10288 # small command number limits, like on Digital OSF/1 and HP-UX.
10289 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
10290 ac_file=1 # Number of current file.
10291 ac_beg=1 # First line for current file.
10292 ac_end=$ac_max_sed_cmds # Line after last line for current file.
10293 ac_more_lines=:
10294 ac_sed_cmds=""
10295 while $ac_more_lines; do
10296   if test $ac_beg -gt 1; then
10297     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
10298   else
10299     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
10300   fi
10301   if test ! -s conftest.s$ac_file; then
10302     ac_more_lines=false
10303     rm -f conftest.s$ac_file
10304   else
10305     if test -z "$ac_sed_cmds"; then
10306       ac_sed_cmds="sed -f conftest.s$ac_file"
10307     else
10308       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
10309     fi
10310     ac_file=`expr $ac_file + 1`
10311     ac_beg=$ac_end
10312     ac_end=`expr $ac_end + $ac_max_sed_cmds`
10313   fi
10314 done
10315 if test -z "$ac_sed_cmds"; then
10316   ac_sed_cmds=cat
10317 fi
10318 EOF
10319
10320 cat >> $CONFIG_STATUS <<EOF
10321
10322 CONFIG_FILES=\${CONFIG_FILES-"\
10323 Makefile:build/top.mk:Makefile.in:build/dir.mk \
10324 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
10325 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
10326 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
10327 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
10328 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
10329 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
10330 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
10331 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
10332 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
10333 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
10334 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
10335 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
10336 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
10337 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
10338 include/Makefile:build/top.mk:include/Makefile.in \
10339 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
10340 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
10341 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10342 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
10343 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
10344 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
10345 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
10346 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
10347 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
10348 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
10349 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
10350 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
10351 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
10352 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
10353 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
10354 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
10355 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
10356 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
10357 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
10358 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
10359 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
10360 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
10361 "}
10362 EOF
10363 cat >> $CONFIG_STATUS <<\EOF
10364 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
10365   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10366   case "$ac_file" in
10367   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10368        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10369   *) ac_file_in="${ac_file}.in" ;;
10370   esac
10371
10372   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
10373
10374   # Remove last slash and all that follows it.  Not all systems have dirname.
10375   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10376   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10377     # The file is in a subdirectory.
10378     test ! -d "$ac_dir" && mkdir "$ac_dir"
10379     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
10380     # A "../" for each directory in $ac_dir_suffix.
10381     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
10382   else
10383     ac_dir_suffix= ac_dots=
10384   fi
10385
10386   case "$ac_given_srcdir" in
10387   .)  srcdir=.
10388       if test -z "$ac_dots"; then top_srcdir=.
10389       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
10390   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
10391   *) # Relative path.
10392     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
10393     top_srcdir="$ac_dots$ac_given_srcdir" ;;
10394   esac
10395
10396   case "$ac_given_INSTALL" in
10397   [/$]*) INSTALL="$ac_given_INSTALL" ;;
10398   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
10399   esac
10400
10401   echo creating "$ac_file"
10402   rm -f "$ac_file"
10403   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
10404   case "$ac_file" in
10405   *Makefile*) ac_comsub="1i\\
10406 # $configure_input" ;;
10407   *) ac_comsub= ;;
10408   esac
10409
10410   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10411   sed -e "$ac_comsub
10412 s%@configure_input@%$configure_input%g
10413 s%@srcdir@%$srcdir%g
10414 s%@top_srcdir@%$top_srcdir%g
10415 s%@INSTALL@%$INSTALL%g
10416 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
10417 fi; done
10418 rm -f conftest.s*
10419
10420 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
10421 # NAME is the cpp macro being defined and VALUE is the value it is being given.
10422 #
10423 # ac_d sets the value in "#define NAME VALUE" lines.
10424 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
10425 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
10426 ac_dC='\3'
10427 ac_dD='%g'
10428 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
10429 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10430 ac_uB='\([      ]\)%\1#\2define\3'
10431 ac_uC=' '
10432 ac_uD='\4%g'
10433 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
10434 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
10435 ac_eB='$%\1#\2define\3'
10436 ac_eC=' '
10437 ac_eD='%g'
10438
10439 if test "${CONFIG_HEADERS+set}" != set; then
10440 EOF
10441 cat >> $CONFIG_STATUS <<EOF
10442   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
10443 EOF
10444 cat >> $CONFIG_STATUS <<\EOF
10445 fi
10446 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
10447   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
10448   case "$ac_file" in
10449   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
10450        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
10451   *) ac_file_in="${ac_file}.in" ;;
10452   esac
10453
10454   echo creating $ac_file
10455
10456   rm -f conftest.frag conftest.in conftest.out
10457   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
10458   cat $ac_file_inputs > conftest.in
10459
10460 EOF
10461
10462 # Transform confdefs.h into a sed script conftest.vals that substitutes
10463 # the proper values into config.h.in to produce config.h.  And first:
10464 # Protect against being on the right side of a sed subst in config.status.
10465 # Protect against being in an unquoted here document in config.status.
10466 rm -f conftest.vals
10467 cat > conftest.hdr <<\EOF
10468 s/[\\&%]/\\&/g
10469 s%[\\$`]%\\&%g
10470 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
10471 s%ac_d%ac_u%gp
10472 s%ac_u%ac_e%gp
10473 EOF
10474 sed -n -f conftest.hdr confdefs.h > conftest.vals
10475 rm -f conftest.hdr
10476
10477 # This sed command replaces #undef with comments.  This is necessary, for
10478 # example, in the case of _POSIX_SOURCE, which is predefined and required
10479 # on some systems where configure will not decide to define it.
10480 cat >> conftest.vals <<\EOF
10481 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
10482 EOF
10483
10484 # Break up conftest.vals because some shells have a limit on
10485 # the size of here documents, and old seds have small limits too.
10486
10487 rm -f conftest.tail
10488 while :
10489 do
10490   ac_lines=`grep -c . conftest.vals`
10491   # grep -c gives empty output for an empty file on some AIX systems.
10492   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
10493   # Write a limited-size here document to conftest.frag.
10494   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
10495   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
10496   echo 'CEOF
10497   sed -f conftest.frag conftest.in > conftest.out
10498   rm -f conftest.in
10499   mv conftest.out conftest.in
10500 ' >> $CONFIG_STATUS
10501   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
10502   rm -f conftest.vals
10503   mv conftest.tail conftest.vals
10504 done
10505 rm -f conftest.vals
10506
10507 cat >> $CONFIG_STATUS <<\EOF
10508   rm -f conftest.frag conftest.h
10509   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
10510   cat conftest.in >> conftest.h
10511   rm -f conftest.in
10512   if cmp -s $ac_file conftest.h 2>/dev/null; then
10513     echo "$ac_file is unchanged"
10514     rm -f conftest.h
10515   else
10516     # Remove last slash and all that follows it.  Not all systems have dirname.
10517       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
10518       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
10519       # The file is in a subdirectory.
10520       test ! -d "$ac_dir" && mkdir "$ac_dir"
10521     fi
10522     rm -f $ac_file
10523     mv conftest.h $ac_file
10524   fi
10525 fi; done
10526
10527 EOF
10528 cat >> $CONFIG_STATUS <<EOF
10529
10530 EOF
10531 cat >> $CONFIG_STATUS <<\EOF
10532
10533 date > stamp-h
10534 echo Please \"make depend\" to build dependencies
10535
10536 exit 0
10537 EOF
10538 chmod +x $CONFIG_STATUS
10539 rm -fr confdefs* $ac_clean_files
10540 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
10541