]> git.sur5r.net Git - openldap/blob - configure
Config files that use the NIS related schema.
[openldap] / configure
1 #! /bin/sh
2
3 # Guess values for system-dependent variables and create Makefiles.
4 # Generated automatically using autoconf version 2.13 
5 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
6 #
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Defaults:
11 ac_help=
12 ac_default_prefix=/usr/local
13 # Any additions from configure.in:
14 ac_default_prefix=/usr/local
15 ac_help="$ac_help
16   --with-subdir=DIR change default subdirectory used for installs"
17 ac_help="$ac_help
18   --enable-debug        enable debugging (yes)"
19 ac_help="$ac_help
20   --enable-syslog       enable syslog support (auto)"
21 ac_help="$ac_help
22   --enable-proctitle    enable proctitle support (yes)"
23 ac_help="$ac_help
24   --enable-cache        enable caching (yes)"
25 ac_help="$ac_help
26   --enable-dns          enable V2 DNS  extension (no)"
27 ac_help="$ac_help
28   --enable-referrals    enable V2 Referrals extension (yes)"
29 ac_help="$ac_help
30   --enable-cldap        enable connectionless ldap (no)"
31 ac_help="$ac_help
32   --enable-x-compile    enable cross compiling (no)"
33 ac_help="$ac_help
34   --enable-dmalloc      enable debug malloc support (no)"
35 ac_help="$ac_help
36   --with-kerberos       with Kerberos support (auto)"
37 ac_help="$ac_help
38   --with-readline  with readline support (auto)"
39 ac_help="$ac_help
40   --with-threads        use threads (auto)"
41 ac_help="$ac_help
42   --with-tls  with TLS/SSL support (auto)"
43 ac_help="$ac_help
44   --with-yielding-select        with implicitly yielding select (auto)"
45 ac_help="$ac_help
46 LDAPD Options:"
47 ac_help="$ac_help
48   --enable-ldapd        enable building ldapd (no)"
49 ac_help="$ac_help
50 SLAPD Options:"
51 ac_help="$ac_help
52   --enable-slapd        enable building slapd (yes)"
53 ac_help="$ac_help
54     --enable-aclgroups  enable ACL group support (auto)"
55 ac_help="$ac_help
56     --enable-cleartext  enable cleartext passwords (yes)"
57 ac_help="$ac_help
58     --enable-crypt      enable crypt(3) passwords (auto)"
59 ac_help="$ac_help
60     --enable-modules    enable dynamic module support (no)"
61 ac_help="$ac_help
62     --enable-phonetic   enable phonetic/soundex (no)"
63 ac_help="$ac_help
64     --enable-rlookups   enable reverse lookups (auto)"
65 ac_help="$ac_help
66     --enable-wrappers   enable tcp wrapper support (no)"
67 ac_help="$ac_help
68     --enable-bdb2       enable bdb2 backend (no)"
69 ac_help="$ac_help
70     --enable-ldbm       enable ldbm backend (yes)"
71 ac_help="$ac_help
72       --with-ldbm-api   use LDBM API (auto)"
73 ac_help="$ac_help
74       --with-ldbm-type  use LDBM type (auto)"
75 ac_help="$ac_help
76     --enable-passwd     enable passwd backend (no)"
77 ac_help="$ac_help
78     --enable-perl       enable perl backend (no)"
79 ac_help="$ac_help
80     --enable-shell      enable shell backend (no)"
81 ac_help="$ac_help
82     --enable-tcl        enable tcl backend (no)"
83 ac_help="$ac_help
84 SLURPD Options:"
85 ac_help="$ac_help
86   --enable-slurpd       enable building slurpd (auto)"
87 ac_help="$ac_help
88 Library Generation & Linking Options"
89 ac_help="$ac_help
90   --enable-static         build static libraries [default=yes]
91   --enable-static=PKGS    only build shared libraries if the current package
92                           appears as an element in the PKGS list"
93 ac_help="$ac_help
94   --enable-shared         build shared libraries [default=yes]
95   --enable-shared=PKGS    only build shared libraries if the current package
96                           appears as an element in the PKGS list"
97 ac_help="$ac_help
98   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
99
100 # Initialize some variables set by options.
101 # The variables have the same names as the options, with
102 # dashes changed to underlines.
103 build=NONE
104 cache_file=./config.cache
105 exec_prefix=NONE
106 host=NONE
107 no_create=
108 nonopt=NONE
109 no_recursion=
110 prefix=NONE
111 program_prefix=NONE
112 program_suffix=NONE
113 program_transform_name=s,x,x,
114 silent=
115 site=
116 srcdir=
117 target=NONE
118 verbose=
119 x_includes=NONE
120 x_libraries=NONE
121 bindir='${exec_prefix}/bin'
122 sbindir='${exec_prefix}/sbin'
123 libexecdir='${exec_prefix}/libexec'
124 datadir='${prefix}/share'
125 sysconfdir='${prefix}/etc'
126 sharedstatedir='${prefix}/com'
127 localstatedir='${prefix}/var'
128 libdir='${exec_prefix}/lib'
129 includedir='${prefix}/include'
130 oldincludedir='/usr/include'
131 infodir='${prefix}/info'
132 mandir='${prefix}/man'
133
134 # Initialize some other variables.
135 subdirs=
136 MFLAGS= MAKEFLAGS=
137 SHELL=${CONFIG_SHELL-/bin/sh}
138 # Maximum number of lines to put in a shell here document.
139 ac_max_here_lines=12
140
141 ac_prev=
142 for ac_option
143 do
144
145   # If the previous option needs an argument, assign it.
146   if test -n "$ac_prev"; then
147     eval "$ac_prev=\$ac_option"
148     ac_prev=
149     continue
150   fi
151
152   case "$ac_option" in
153   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
154   *) ac_optarg= ;;
155   esac
156
157   # Accept the important Cygnus configure options, so we can diagnose typos.
158
159   case "$ac_option" in
160
161   -bindir | --bindir | --bindi | --bind | --bin | --bi)
162     ac_prev=bindir ;;
163   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
164     bindir="$ac_optarg" ;;
165
166   -build | --build | --buil | --bui | --bu)
167     ac_prev=build ;;
168   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
169     build="$ac_optarg" ;;
170
171   -cache-file | --cache-file | --cache-fil | --cache-fi \
172   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
173     ac_prev=cache_file ;;
174   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
175   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
176     cache_file="$ac_optarg" ;;
177
178   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
179     ac_prev=datadir ;;
180   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
181   | --da=*)
182     datadir="$ac_optarg" ;;
183
184   -disable-* | --disable-*)
185     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
186     # Reject names that are not valid shell variable names.
187     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
188       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
189     fi
190     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
191     eval "enable_${ac_feature}=no" ;;
192
193   -enable-* | --enable-*)
194     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
195     # Reject names that are not valid shell variable names.
196     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
197       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
198     fi
199     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
200     case "$ac_option" in
201       *=*) ;;
202       *) ac_optarg=yes ;;
203     esac
204     eval "enable_${ac_feature}='$ac_optarg'" ;;
205
206   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
207   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
208   | --exec | --exe | --ex)
209     ac_prev=exec_prefix ;;
210   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
211   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
212   | --exec=* | --exe=* | --ex=*)
213     exec_prefix="$ac_optarg" ;;
214
215   -gas | --gas | --ga | --g)
216     # Obsolete; use --with-gas.
217     with_gas=yes ;;
218
219   -help | --help | --hel | --he)
220     # Omit some internal or obsolete options to make the list less imposing.
221     # This message is too long to be a string in the A/UX 3.1 sh.
222     cat << EOF
223 Usage: configure [options] [host]
224 Options: [defaults in brackets after descriptions]
225 Configuration:
226   --cache-file=FILE       cache test results in FILE
227   --help                  print this message
228   --no-create             do not create output files
229   --quiet, --silent       do not print \`checking...' messages
230   --version               print the version of autoconf that created configure
231 Directory and file names:
232   --prefix=PREFIX         install architecture-independent files in PREFIX
233                           [$ac_default_prefix]
234   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
235                           [same as prefix]
236   --bindir=DIR            user executables in DIR [EPREFIX/bin]
237   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
238   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
239   --datadir=DIR           read-only architecture-independent data in DIR
240                           [PREFIX/share]
241   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
242   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
243                           [PREFIX/com]
244   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
245   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
246   --includedir=DIR        C header files in DIR [PREFIX/include]
247   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
248   --infodir=DIR           info documentation in DIR [PREFIX/info]
249   --mandir=DIR            man documentation in DIR [PREFIX/man]
250   --srcdir=DIR            find the sources in DIR [configure dir or ..]
251   --program-prefix=PREFIX prepend PREFIX to installed program names
252   --program-suffix=SUFFIX append SUFFIX to installed program names
253   --program-transform-name=PROGRAM
254                           run sed PROGRAM on installed program names
255 EOF
256     cat << EOF
257 Host type:
258   --build=BUILD           configure for building on BUILD [BUILD=HOST]
259   --host=HOST             configure for HOST [guessed]
260   --target=TARGET         configure for TARGET [TARGET=HOST]
261 Features and packages:
262   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
263   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
264   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
265   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
266   --x-includes=DIR        X include files are in DIR
267   --x-libraries=DIR       X library files are in DIR
268 EOF
269     if test -n "$ac_help"; then
270       echo "--enable and --with options recognized:$ac_help"
271     fi
272     exit 0 ;;
273
274   -host | --host | --hos | --ho)
275     ac_prev=host ;;
276   -host=* | --host=* | --hos=* | --ho=*)
277     host="$ac_optarg" ;;
278
279   -includedir | --includedir | --includedi | --included | --include \
280   | --includ | --inclu | --incl | --inc)
281     ac_prev=includedir ;;
282   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
283   | --includ=* | --inclu=* | --incl=* | --inc=*)
284     includedir="$ac_optarg" ;;
285
286   -infodir | --infodir | --infodi | --infod | --info | --inf)
287     ac_prev=infodir ;;
288   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
289     infodir="$ac_optarg" ;;
290
291   -libdir | --libdir | --libdi | --libd)
292     ac_prev=libdir ;;
293   -libdir=* | --libdir=* | --libdi=* | --libd=*)
294     libdir="$ac_optarg" ;;
295
296   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
297   | --libexe | --libex | --libe)
298     ac_prev=libexecdir ;;
299   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
300   | --libexe=* | --libex=* | --libe=*)
301     libexecdir="$ac_optarg" ;;
302
303   -localstatedir | --localstatedir | --localstatedi | --localstated \
304   | --localstate | --localstat | --localsta | --localst \
305   | --locals | --local | --loca | --loc | --lo)
306     ac_prev=localstatedir ;;
307   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
308   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
309   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
310     localstatedir="$ac_optarg" ;;
311
312   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
313     ac_prev=mandir ;;
314   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
315     mandir="$ac_optarg" ;;
316
317   -nfp | --nfp | --nf)
318     # Obsolete; use --without-fp.
319     with_fp=no ;;
320
321   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
322   | --no-cr | --no-c)
323     no_create=yes ;;
324
325   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
326   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
327     no_recursion=yes ;;
328
329   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
330   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
331   | --oldin | --oldi | --old | --ol | --o)
332     ac_prev=oldincludedir ;;
333   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
334   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
335   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
336     oldincludedir="$ac_optarg" ;;
337
338   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
339     ac_prev=prefix ;;
340   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
341     prefix="$ac_optarg" ;;
342
343   -program-prefix | --program-prefix | --program-prefi | --program-pref \
344   | --program-pre | --program-pr | --program-p)
345     ac_prev=program_prefix ;;
346   -program-prefix=* | --program-prefix=* | --program-prefi=* \
347   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
348     program_prefix="$ac_optarg" ;;
349
350   -program-suffix | --program-suffix | --program-suffi | --program-suff \
351   | --program-suf | --program-su | --program-s)
352     ac_prev=program_suffix ;;
353   -program-suffix=* | --program-suffix=* | --program-suffi=* \
354   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
355     program_suffix="$ac_optarg" ;;
356
357   -program-transform-name | --program-transform-name \
358   | --program-transform-nam | --program-transform-na \
359   | --program-transform-n | --program-transform- \
360   | --program-transform | --program-transfor \
361   | --program-transfo | --program-transf \
362   | --program-trans | --program-tran \
363   | --progr-tra | --program-tr | --program-t)
364     ac_prev=program_transform_name ;;
365   -program-transform-name=* | --program-transform-name=* \
366   | --program-transform-nam=* | --program-transform-na=* \
367   | --program-transform-n=* | --program-transform-=* \
368   | --program-transform=* | --program-transfor=* \
369   | --program-transfo=* | --program-transf=* \
370   | --program-trans=* | --program-tran=* \
371   | --progr-tra=* | --program-tr=* | --program-t=*)
372     program_transform_name="$ac_optarg" ;;
373
374   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
375   | -silent | --silent | --silen | --sile | --sil)
376     silent=yes ;;
377
378   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
379     ac_prev=sbindir ;;
380   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
381   | --sbi=* | --sb=*)
382     sbindir="$ac_optarg" ;;
383
384   -sharedstatedir | --sharedstatedir | --sharedstatedi \
385   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
386   | --sharedst | --shareds | --shared | --share | --shar \
387   | --sha | --sh)
388     ac_prev=sharedstatedir ;;
389   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
390   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
391   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
392   | --sha=* | --sh=*)
393     sharedstatedir="$ac_optarg" ;;
394
395   -site | --site | --sit)
396     ac_prev=site ;;
397   -site=* | --site=* | --sit=*)
398     site="$ac_optarg" ;;
399
400   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
401     ac_prev=srcdir ;;
402   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
403     srcdir="$ac_optarg" ;;
404
405   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
406   | --syscon | --sysco | --sysc | --sys | --sy)
407     ac_prev=sysconfdir ;;
408   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
409   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
410     sysconfdir="$ac_optarg" ;;
411
412   -target | --target | --targe | --targ | --tar | --ta | --t)
413     ac_prev=target ;;
414   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
415     target="$ac_optarg" ;;
416
417   -v | -verbose | --verbose | --verbos | --verbo | --verb)
418     verbose=yes ;;
419
420   -version | --version | --versio | --versi | --vers)
421     echo "configure generated by autoconf version 2.13"
422     exit 0 ;;
423
424   -with-* | --with-*)
425     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
426     # Reject names that are not valid shell variable names.
427     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
428       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
429     fi
430     ac_package=`echo $ac_package| sed 's/-/_/g'`
431     case "$ac_option" in
432       *=*) ;;
433       *) ac_optarg=yes ;;
434     esac
435     eval "with_${ac_package}='$ac_optarg'" ;;
436
437   -without-* | --without-*)
438     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
439     # Reject names that are not valid shell variable names.
440     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
441       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
442     fi
443     ac_package=`echo $ac_package| sed 's/-/_/g'`
444     eval "with_${ac_package}=no" ;;
445
446   --x)
447     # Obsolete; use --with-x.
448     with_x=yes ;;
449
450   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
451   | --x-incl | --x-inc | --x-in | --x-i)
452     ac_prev=x_includes ;;
453   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
454   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
455     x_includes="$ac_optarg" ;;
456
457   -x-libraries | --x-libraries | --x-librarie | --x-librari \
458   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
459     ac_prev=x_libraries ;;
460   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
461   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
462     x_libraries="$ac_optarg" ;;
463
464   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
465     ;;
466
467   *)
468     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
469       echo "configure: warning: $ac_option: invalid host type" 1>&2
470     fi
471     if test "x$nonopt" != xNONE; then
472       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
473     fi
474     nonopt="$ac_option"
475     ;;
476
477   esac
478 done
479
480 if test -n "$ac_prev"; then
481   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
482 fi
483
484 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
485
486 # File descriptor usage:
487 # 0 standard input
488 # 1 file creation
489 # 2 errors and warnings
490 # 3 some systems may open it to /dev/tty
491 # 4 used on the Kubota Titan
492 # 6 checking for... messages and results
493 # 5 compiler messages saved in config.log
494 if test "$silent" = yes; then
495   exec 6>/dev/null
496 else
497   exec 6>&1
498 fi
499 exec 5>./config.log
500
501 echo "\
502 This file contains any messages produced by compilers while
503 running configure, to aid debugging if configure makes a mistake.
504 " 1>&5
505
506 # Strip out --no-create and --no-recursion so they do not pile up.
507 # Also quote any args containing shell metacharacters.
508 ac_configure_args=
509 for ac_arg
510 do
511   case "$ac_arg" in
512   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
513   | --no-cr | --no-c) ;;
514   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
515   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
516   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
517   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
518   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
519   esac
520 done
521
522 # NLS nuisances.
523 # Only set these to C if already set.  These must not be set unconditionally
524 # because not all systems understand e.g. LANG=C (notably SCO).
525 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
526 # Non-C LC_CTYPE values break the ctype check.
527 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
528 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
529 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
530 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
531
532 # confdefs.h avoids OS command line length limits that DEFS can exceed.
533 rm -rf conftest* confdefs.h
534 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
535 echo > confdefs.h
536
537 # A filename unique to this package, relative to the directory that
538 # configure is in, which we can look for to find out if srcdir is correct.
539 ac_unique_file=include/ldap.h
540
541 # Find the source files, if location was not specified.
542 if test -z "$srcdir"; then
543   ac_srcdir_defaulted=yes
544   # Try the directory containing this script, then its parent.
545   ac_prog=$0
546   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
547   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
548   srcdir=$ac_confdir
549   if test ! -r $srcdir/$ac_unique_file; then
550     srcdir=..
551   fi
552 else
553   ac_srcdir_defaulted=no
554 fi
555 if test ! -r $srcdir/$ac_unique_file; then
556   if test "$ac_srcdir_defaulted" = yes; then
557     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
558   else
559     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
560   fi
561 fi
562 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
563
564 # Prefer explicitly selected file to automatically selected ones.
565 if test -z "$CONFIG_SITE"; then
566   if test "x$prefix" != xNONE; then
567     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
568   else
569     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
570   fi
571 fi
572 for ac_site_file in $CONFIG_SITE; do
573   if test -r "$ac_site_file"; then
574     echo "loading site script $ac_site_file"
575     . "$ac_site_file"
576   fi
577 done
578
579
580 ac_ext=c
581 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
582 ac_cpp='$CPP $CPPFLAGS'
583 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
584 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
585 cross_compiling=$ac_cv_prog_cc_cross
586
587 ac_exeext=
588 ac_objext=o
589 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
590   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
591   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
592     ac_n= ac_c='
593 ' ac_t='        '
594   else
595     ac_n=-n ac_c= ac_t=
596   fi
597 else
598   ac_n= ac_c='\c' ac_t=
599 fi
600
601 ac_aux_dir=
602 for ac_dir in build $srcdir/build; do
603   if test -f $ac_dir/install-sh; then
604     ac_aux_dir=$ac_dir
605     ac_install_sh="$ac_aux_dir/install-sh -c"
606     break
607   elif test -f $ac_dir/install.sh; then
608     ac_aux_dir=$ac_dir
609     ac_install_sh="$ac_aux_dir/install.sh -c"
610     break
611   fi
612 done
613 if test -z "$ac_aux_dir"; then
614   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
615 fi
616 ac_config_guess=$ac_aux_dir/config.guess
617 ac_config_sub=$ac_aux_dir/config.sub
618 ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
619 # Find a good install program.  We prefer a C program (faster),
620 # so one script is as good as another.  But avoid the broken or
621 # incompatible versions:
622 # SysV /etc/install, /usr/sbin/install
623 # SunOS /usr/etc/install
624 # IRIX /sbin/install
625 # AIX /bin/install
626 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
627 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
628 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
629 # ./install, which can be erroneously created by make from ./install.sh.
630 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
631 echo "configure:632: checking for a BSD compatible install" >&5
632 if test -z "$INSTALL"; then
633 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
634   echo $ac_n "(cached) $ac_c" 1>&6
635 else
636     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
637   for ac_dir in $PATH; do
638     # Account for people who put trailing slashes in PATH elements.
639     case "$ac_dir/" in
640     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
641     *)
642       # OSF1 and SCO ODT 3.0 have their own names for install.
643       # Don't use installbsd from OSF since it installs stuff as root
644       # by default.
645       for ac_prog in ginstall scoinst install; do
646         if test -f $ac_dir/$ac_prog; then
647           if test $ac_prog = install &&
648             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
649             # AIX install.  It has an incompatible calling convention.
650             :
651           else
652             ac_cv_path_install="$ac_dir/$ac_prog -c"
653             break 2
654           fi
655         fi
656       done
657       ;;
658     esac
659   done
660   IFS="$ac_save_IFS"
661
662 fi
663   if test "${ac_cv_path_install+set}" = set; then
664     INSTALL="$ac_cv_path_install"
665   else
666     # As a last resort, use the slow shell script.  We don't cache a
667     # path for INSTALL within a source directory, because that will
668     # break other packages using the cache if that directory is
669     # removed, or if the path is relative.
670     INSTALL="$ac_install_sh"
671   fi
672 fi
673 echo "$ac_t""$INSTALL" 1>&6
674
675 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
676 # It thinks the first close brace ends the variable substitution.
677 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
678
679 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
680
681 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
682
683 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
684 echo "configure:685: checking whether build environment is sane" >&5
685 # Just in case
686 sleep 1
687 echo timestamp > conftestfile
688 # Do `set' in a subshell so we don't clobber the current shell's
689 # arguments.  Must try -L first in case configure is actually a
690 # symlink; some systems play weird games with the mod time of symlinks
691 # (eg FreeBSD returns the mod time of the symlink's containing
692 # directory).
693 if (
694    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
695    if test "$*" = "X"; then
696       # -L didn't work.
697       set X `ls -t $srcdir/configure conftestfile`
698    fi
699    if test "$*" != "X $srcdir/configure conftestfile" \
700       && test "$*" != "X conftestfile $srcdir/configure"; then
701
702       # If neither matched, then we have a broken ls.  This can happen
703       # if, for instance, CONFIG_SHELL is bash and it inherits a
704       # broken ls alias from the environment.  This has actually
705       # happened.  Such a system could not be considered "sane".
706       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
707 alias in your environment" 1>&2; exit 1; }
708    fi
709
710    test "$2" = conftestfile
711    )
712 then
713    # Ok.
714    :
715 else
716    { echo "configure: error: newly created file is older than distributed files!
717 Check your system clock" 1>&2; exit 1; }
718 fi
719 rm -f conftest*
720 echo "$ac_t""yes" 1>&6
721 if test "$program_transform_name" = s,x,x,; then
722   program_transform_name=
723 else
724   # Double any \ or $.  echo might interpret backslashes.
725   cat <<\EOF_SED > conftestsed
726 s,\\,\\\\,g; s,\$,$$,g
727 EOF_SED
728   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
729   rm -f conftestsed
730 fi
731 test "$program_prefix" != NONE &&
732   program_transform_name="s,^,${program_prefix},; $program_transform_name"
733 # Use a double $ so make ignores it.
734 test "$program_suffix" != NONE &&
735   program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
736
737 # sed with no file args requires a program.
738 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
739
740 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
741 echo "configure:742: checking whether ${MAKE-make} sets \${MAKE}" >&5
742 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
743 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
744   echo $ac_n "(cached) $ac_c" 1>&6
745 else
746   cat > conftestmake <<\EOF
747 all:
748         @echo 'ac_maketemp="${MAKE}"'
749 EOF
750 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
751 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
752 if test -n "$ac_maketemp"; then
753   eval ac_cv_prog_make_${ac_make}_set=yes
754 else
755   eval ac_cv_prog_make_${ac_make}_set=no
756 fi
757 rm -f conftestmake
758 fi
759 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
760   echo "$ac_t""yes" 1>&6
761   SET_MAKE=
762 else
763   echo "$ac_t""no" 1>&6
764   SET_MAKE="MAKE=${MAKE-make}"
765 fi
766
767
768 PACKAGE=OpenLDAP
769
770 VERSION=2.0-devel
771
772 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
773   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
774 fi
775 cat >> confdefs.h <<EOF
776 #define PACKAGE "$PACKAGE"
777 EOF
778
779 cat >> confdefs.h <<EOF
780 #define VERSION "$VERSION"
781 EOF
782
783
784
785 missing_dir=`cd $ac_aux_dir && pwd`
786 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
787 echo "configure:788: checking for working aclocal" >&5
788 # Run test in a subshell; some versions of sh will print an error if
789 # an executable is not found, even if stderr is redirected.
790 # Redirect stdin to placate older versions of autoconf.  Sigh.
791 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
792    ACLOCAL=aclocal
793    echo "$ac_t""found" 1>&6
794 else
795    ACLOCAL="$missing_dir/missing aclocal"
796    echo "$ac_t""missing" 1>&6
797 fi
798
799 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
800 echo "configure:801: checking for working autoconf" >&5
801 # Run test in a subshell; some versions of sh will print an error if
802 # an executable is not found, even if stderr is redirected.
803 # Redirect stdin to placate older versions of autoconf.  Sigh.
804 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
805    AUTOCONF=autoconf
806    echo "$ac_t""found" 1>&6
807 else
808    AUTOCONF="$missing_dir/missing autoconf"
809    echo "$ac_t""missing" 1>&6
810 fi
811
812 echo $ac_n "checking for working automake""... $ac_c" 1>&6
813 echo "configure:814: checking for working automake" >&5
814 # Run test in a subshell; some versions of sh will print an error if
815 # an executable is not found, even if stderr is redirected.
816 # Redirect stdin to placate older versions of autoconf.  Sigh.
817 if (automake --version) < /dev/null > /dev/null 2>&1; then
818    AUTOMAKE=automake
819    echo "$ac_t""found" 1>&6
820 else
821    AUTOMAKE="$missing_dir/missing automake"
822    echo "$ac_t""missing" 1>&6
823 fi
824
825 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
826 echo "configure:827: checking for working autoheader" >&5
827 # Run test in a subshell; some versions of sh will print an error if
828 # an executable is not found, even if stderr is redirected.
829 # Redirect stdin to placate older versions of autoconf.  Sigh.
830 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
831    AUTOHEADER=autoheader
832    echo "$ac_t""found" 1>&6
833 else
834    AUTOHEADER="$missing_dir/missing autoheader"
835    echo "$ac_t""missing" 1>&6
836 fi
837
838 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
839 echo "configure:840: checking for working makeinfo" >&5
840 # Run test in a subshell; some versions of sh will print an error if
841 # an executable is not found, even if stderr is redirected.
842 # Redirect stdin to placate older versions of autoconf.  Sigh.
843 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
844    MAKEINFO=makeinfo
845    echo "$ac_t""found" 1>&6
846 else
847    MAKEINFO="$missing_dir/missing makeinfo"
848    echo "$ac_t""missing" 1>&6
849 fi
850
851
852
853
854
855
856 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
857 echo "configure:858: checking configure arguments" >&5
858
859
860 top_builddir=`pwd`
861
862 ldap_subdir="openldap"
863
864 # Check whether --with-subdir or --without-subdir was given.
865 if test "${with_subdir+set}" = set; then
866   withval="$with_subdir"
867   
868         if test "$withval" = "no"; then
869                 ldap_subdir=""
870         elif test "$withval" != "yes"; then
871                 ldap_subdir="$withval"
872         fi
873
874 fi
875
876
877 # OpenLDAP --enable-debug
878         # Check whether --enable-debug or --disable-debug was given.
879 if test "${enable_debug+set}" = set; then
880   enableval="$enable_debug"
881   
882         ol_arg=invalid
883         for ol_val in auto yes no ; do
884                 if test "$enableval" = "$ol_val" ; then
885                         ol_arg="$ol_val"
886                 fi
887         done
888         if test "$ol_arg" = "invalid" ; then
889                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
890         fi
891         ol_enable_debug="$ol_arg"
892
893 else
894         ol_enable_debug="yes"
895 fi
896 # end --enable-debug
897 # OpenLDAP --enable-syslog
898         # Check whether --enable-syslog or --disable-syslog was given.
899 if test "${enable_syslog+set}" = set; then
900   enableval="$enable_syslog"
901   
902         ol_arg=invalid
903         for ol_val in auto yes no ; do
904                 if test "$enableval" = "$ol_val" ; then
905                         ol_arg="$ol_val"
906                 fi
907         done
908         if test "$ol_arg" = "invalid" ; then
909                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
910         fi
911         ol_enable_syslog="$ol_arg"
912
913 else
914         ol_enable_syslog="auto"
915 fi
916 # end --enable-syslog
917 # OpenLDAP --enable-proctitle
918         # Check whether --enable-proctitle or --disable-proctitle was given.
919 if test "${enable_proctitle+set}" = set; then
920   enableval="$enable_proctitle"
921   
922         ol_arg=invalid
923         for ol_val in auto yes no ; do
924                 if test "$enableval" = "$ol_val" ; then
925                         ol_arg="$ol_val"
926                 fi
927         done
928         if test "$ol_arg" = "invalid" ; then
929                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
930         fi
931         ol_enable_proctitle="$ol_arg"
932
933 else
934         ol_enable_proctitle="yes"
935 fi
936 # end --enable-proctitle
937 # OpenLDAP --enable-cache
938         # Check whether --enable-cache or --disable-cache was given.
939 if test "${enable_cache+set}" = set; then
940   enableval="$enable_cache"
941   
942         ol_arg=invalid
943         for ol_val in auto yes no ; do
944                 if test "$enableval" = "$ol_val" ; then
945                         ol_arg="$ol_val"
946                 fi
947         done
948         if test "$ol_arg" = "invalid" ; then
949                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
950         fi
951         ol_enable_cache="$ol_arg"
952
953 else
954         ol_enable_cache="yes"
955 fi
956 # end --enable-cache
957 # OpenLDAP --enable-dns
958         # Check whether --enable-dns or --disable-dns was given.
959 if test "${enable_dns+set}" = set; then
960   enableval="$enable_dns"
961   
962         ol_arg=invalid
963         for ol_val in auto yes no ; do
964                 if test "$enableval" = "$ol_val" ; then
965                         ol_arg="$ol_val"
966                 fi
967         done
968         if test "$ol_arg" = "invalid" ; then
969                 { echo "configure: error: bad value $enableval for --enable-dns" 1>&2; exit 1; }
970         fi
971         ol_enable_dns="$ol_arg"
972
973 else
974         ol_enable_dns="no"
975 fi
976 # end --enable-dns
977 # OpenLDAP --enable-referrals
978         # Check whether --enable-referrals or --disable-referrals was given.
979 if test "${enable_referrals+set}" = set; then
980   enableval="$enable_referrals"
981   
982         ol_arg=invalid
983         for ol_val in auto yes no ; do
984                 if test "$enableval" = "$ol_val" ; then
985                         ol_arg="$ol_val"
986                 fi
987         done
988         if test "$ol_arg" = "invalid" ; then
989                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
990         fi
991         ol_enable_referrals="$ol_arg"
992
993 else
994         ol_enable_referrals="yes"
995 fi
996 # end --enable-referrals
997 # OpenLDAP --enable-cldap
998         # Check whether --enable-cldap or --disable-cldap was given.
999 if test "${enable_cldap+set}" = set; then
1000   enableval="$enable_cldap"
1001   
1002         ol_arg=invalid
1003         for ol_val in auto yes no ; do
1004                 if test "$enableval" = "$ol_val" ; then
1005                         ol_arg="$ol_val"
1006                 fi
1007         done
1008         if test "$ol_arg" = "invalid" ; then
1009                 { echo "configure: error: bad value $enableval for --enable-cldap" 1>&2; exit 1; }
1010         fi
1011         ol_enable_cldap="$ol_arg"
1012
1013 else
1014         ol_enable_cldap="no"
1015 fi
1016 # end --enable-cldap
1017 # OpenLDAP --enable-x_compile
1018         # Check whether --enable-x_compile or --disable-x_compile was given.
1019 if test "${enable_x_compile+set}" = set; then
1020   enableval="$enable_x_compile"
1021   
1022         ol_arg=invalid
1023         for ol_val in yes no ; do
1024                 if test "$enableval" = "$ol_val" ; then
1025                         ol_arg="$ol_val"
1026                 fi
1027         done
1028         if test "$ol_arg" = "invalid" ; then
1029                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1030         fi
1031         ol_enable_x_compile="$ol_arg"
1032
1033 else
1034         ol_enable_x_compile="no"
1035 fi
1036 # end --enable-x_compile
1037
1038 # OpenLDAP --enable-dmalloc
1039         # Check whether --enable-dmalloc or --disable-dmalloc was given.
1040 if test "${enable_dmalloc+set}" = set; then
1041   enableval="$enable_dmalloc"
1042   
1043         ol_arg=invalid
1044         for ol_val in auto yes no ; do
1045                 if test "$enableval" = "$ol_val" ; then
1046                         ol_arg="$ol_val"
1047                 fi
1048         done
1049         if test "$ol_arg" = "invalid" ; then
1050                 { echo "configure: error: bad value $enableval for --enable-dmalloc" 1>&2; exit 1; }
1051         fi
1052         ol_enable_dmalloc="$ol_arg"
1053
1054 else
1055         ol_enable_dmalloc="no"
1056 fi
1057 # end --enable-dmalloc
1058
1059 # OpenLDAP --with-kerberos
1060         # Check whether --with-kerberos or --without-kerberos was given.
1061 if test "${with_kerberos+set}" = set; then
1062   withval="$with_kerberos"
1063   
1064         ol_arg=invalid
1065         for ol_val in auto k5 k4 afs yes no ; do
1066                 if test "$withval" = "$ol_val" ; then
1067                         ol_arg="$ol_val"
1068                 fi
1069         done
1070         if test "$ol_arg" = "invalid" ; then
1071                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1072         fi
1073         ol_with_kerberos="$ol_arg"
1074
1075 else
1076         ol_with_kerberos="auto"
1077 fi
1078 # end --with-kerberos
1079
1080 # OpenLDAP --with-readline
1081         # Check whether --with-readline or --without-readline was given.
1082 if test "${with_readline+set}" = set; then
1083   withval="$with_readline"
1084   
1085         ol_arg=invalid
1086         for ol_val in auto yes no  ; do
1087                 if test "$withval" = "$ol_val" ; then
1088                         ol_arg="$ol_val"
1089                 fi
1090         done
1091         if test "$ol_arg" = "invalid" ; then
1092                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1093         fi
1094         ol_with_readline="$ol_arg"
1095
1096 else
1097         ol_with_readline="auto"
1098 fi
1099 # end --with-readline
1100
1101 # OpenLDAP --with-threads
1102         # Check whether --with-threads or --without-threads was given.
1103 if test "${with_threads+set}" = set; then
1104   withval="$with_threads"
1105   
1106         ol_arg=invalid
1107         for ol_val in auto posix mach lwp yes no manual  ; do
1108                 if test "$withval" = "$ol_val" ; then
1109                         ol_arg="$ol_val"
1110                 fi
1111         done
1112         if test "$ol_arg" = "invalid" ; then
1113                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1114         fi
1115         ol_with_threads="$ol_arg"
1116
1117 else
1118         ol_with_threads="auto"
1119 fi
1120 # end --with-threads
1121
1122 # OpenLDAP --with-tls
1123         # Check whether --with-tls or --without-tls was given.
1124 if test "${with_tls+set}" = set; then
1125   withval="$with_tls"
1126   
1127         ol_arg=invalid
1128         for ol_val in auto ssleay openssl yes no  ; do
1129                 if test "$withval" = "$ol_val" ; then
1130                         ol_arg="$ol_val"
1131                 fi
1132         done
1133         if test "$ol_arg" = "invalid" ; then
1134                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1135         fi
1136         ol_with_tls="$ol_arg"
1137
1138 else
1139         ol_with_tls="auto"
1140 fi
1141 # end --with-tls
1142
1143 # OpenLDAP --with-yielding_select
1144         # Check whether --with-yielding_select or --without-yielding_select was given.
1145 if test "${with_yielding_select+set}" = set; then
1146   withval="$with_yielding_select"
1147   
1148         ol_arg=invalid
1149         for ol_val in auto yes no manual  ; do
1150                 if test "$withval" = "$ol_val" ; then
1151                         ol_arg="$ol_val"
1152                 fi
1153         done
1154         if test "$ol_arg" = "invalid" ; then
1155                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1156         fi
1157         ol_with_yielding_select="$ol_arg"
1158
1159 else
1160         ol_with_yielding_select="auto"
1161 fi
1162 # end --with-yielding_select
1163
1164
1165
1166 # Check whether --with-xxldapdoptions or --without-xxldapdoptions was given.
1167 if test "${with_xxldapdoptions+set}" = set; then
1168   withval="$with_xxldapdoptions"
1169   :
1170 fi
1171
1172 # OpenLDAP --enable-ldapd
1173         # Check whether --enable-ldapd or --disable-ldapd was given.
1174 if test "${enable_ldapd+set}" = set; then
1175   enableval="$enable_ldapd"
1176   
1177         ol_arg=invalid
1178         for ol_val in auto yes no ; do
1179                 if test "$enableval" = "$ol_val" ; then
1180                         ol_arg="$ol_val"
1181                 fi
1182         done
1183         if test "$ol_arg" = "invalid" ; then
1184                 { echo "configure: error: bad value $enableval for --enable-ldapd" 1>&2; exit 1; }
1185         fi
1186         ol_enable_ldapd="$ol_arg"
1187
1188 else
1189         ol_enable_ldapd="no"
1190 fi
1191 # end --enable-ldapd
1192
1193 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1194 if test "${with_xxslapdoptions+set}" = set; then
1195   withval="$with_xxslapdoptions"
1196   :
1197 fi
1198
1199 # OpenLDAP --enable-slapd
1200         # Check whether --enable-slapd or --disable-slapd was given.
1201 if test "${enable_slapd+set}" = set; then
1202   enableval="$enable_slapd"
1203   
1204         ol_arg=invalid
1205         for ol_val in auto yes no ; do
1206                 if test "$enableval" = "$ol_val" ; then
1207                         ol_arg="$ol_val"
1208                 fi
1209         done
1210         if test "$ol_arg" = "invalid" ; then
1211                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1212         fi
1213         ol_enable_slapd="$ol_arg"
1214
1215 else
1216         ol_enable_slapd="yes"
1217 fi
1218 # end --enable-slapd
1219 # OpenLDAP --enable-aclgroups
1220         # Check whether --enable-aclgroups or --disable-aclgroups was given.
1221 if test "${enable_aclgroups+set}" = set; then
1222   enableval="$enable_aclgroups"
1223   
1224         ol_arg=invalid
1225         for ol_val in auto yes no ; do
1226                 if test "$enableval" = "$ol_val" ; then
1227                         ol_arg="$ol_val"
1228                 fi
1229         done
1230         if test "$ol_arg" = "invalid" ; then
1231                 { echo "configure: error: bad value $enableval for --enable-aclgroups" 1>&2; exit 1; }
1232         fi
1233         ol_enable_aclgroups="$ol_arg"
1234
1235 else
1236         ol_enable_aclgroups="auto"
1237 fi
1238 # end --enable-aclgroups
1239 # OpenLDAP --enable-cleartext
1240         # Check whether --enable-cleartext or --disable-cleartext was given.
1241 if test "${enable_cleartext+set}" = set; then
1242   enableval="$enable_cleartext"
1243   
1244         ol_arg=invalid
1245         for ol_val in auto yes no ; do
1246                 if test "$enableval" = "$ol_val" ; then
1247                         ol_arg="$ol_val"
1248                 fi
1249         done
1250         if test "$ol_arg" = "invalid" ; then
1251                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1252         fi
1253         ol_enable_cleartext="$ol_arg"
1254
1255 else
1256         ol_enable_cleartext="yes"
1257 fi
1258 # end --enable-cleartext
1259 # OpenLDAP --enable-crypt
1260         # Check whether --enable-crypt or --disable-crypt was given.
1261 if test "${enable_crypt+set}" = set; then
1262   enableval="$enable_crypt"
1263   
1264         ol_arg=invalid
1265         for ol_val in auto yes no ; do
1266                 if test "$enableval" = "$ol_val" ; then
1267                         ol_arg="$ol_val"
1268                 fi
1269         done
1270         if test "$ol_arg" = "invalid" ; then
1271                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1272         fi
1273         ol_enable_crypt="$ol_arg"
1274
1275 else
1276         ol_enable_crypt="auto"
1277 fi
1278 # end --enable-crypt
1279 # OpenLDAP --enable-modules
1280         # Check whether --enable-modules or --disable-modules was given.
1281 if test "${enable_modules+set}" = set; then
1282   enableval="$enable_modules"
1283   
1284         ol_arg=invalid
1285         for ol_val in auto yes no ; do
1286                 if test "$enableval" = "$ol_val" ; then
1287                         ol_arg="$ol_val"
1288                 fi
1289         done
1290         if test "$ol_arg" = "invalid" ; then
1291                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1292         fi
1293         ol_enable_modules="$ol_arg"
1294
1295 else
1296         ol_enable_modules="no"
1297 fi
1298 # end --enable-modules
1299 # OpenLDAP --enable-phonetic
1300         # Check whether --enable-phonetic or --disable-phonetic was given.
1301 if test "${enable_phonetic+set}" = set; then
1302   enableval="$enable_phonetic"
1303   
1304         ol_arg=invalid
1305         for ol_val in auto yes no ; do
1306                 if test "$enableval" = "$ol_val" ; then
1307                         ol_arg="$ol_val"
1308                 fi
1309         done
1310         if test "$ol_arg" = "invalid" ; then
1311                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1312         fi
1313         ol_enable_phonetic="$ol_arg"
1314
1315 else
1316         ol_enable_phonetic="no"
1317 fi
1318 # end --enable-phonetic
1319 # OpenLDAP --enable-rlookups
1320         # Check whether --enable-rlookups or --disable-rlookups was given.
1321 if test "${enable_rlookups+set}" = set; then
1322   enableval="$enable_rlookups"
1323   
1324         ol_arg=invalid
1325         for ol_val in auto yes no ; do
1326                 if test "$enableval" = "$ol_val" ; then
1327                         ol_arg="$ol_val"
1328                 fi
1329         done
1330         if test "$ol_arg" = "invalid" ; then
1331                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1332         fi
1333         ol_enable_rlookups="$ol_arg"
1334
1335 else
1336         ol_enable_rlookups="auto"
1337 fi
1338 # end --enable-rlookups
1339 # OpenLDAP --enable-wrappers
1340         # Check whether --enable-wrappers or --disable-wrappers was given.
1341 if test "${enable_wrappers+set}" = set; then
1342   enableval="$enable_wrappers"
1343   
1344         ol_arg=invalid
1345         for ol_val in auto yes no ; do
1346                 if test "$enableval" = "$ol_val" ; then
1347                         ol_arg="$ol_val"
1348                 fi
1349         done
1350         if test "$ol_arg" = "invalid" ; then
1351                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1352         fi
1353         ol_enable_wrappers="$ol_arg"
1354
1355 else
1356         ol_enable_wrappers="no"
1357 fi
1358 # end --enable-wrappers
1359
1360 # OpenLDAP --enable-bdb2
1361         # Check whether --enable-bdb2 or --disable-bdb2 was given.
1362 if test "${enable_bdb2+set}" = set; then
1363   enableval="$enable_bdb2"
1364   
1365         ol_arg=invalid
1366         for ol_val in auto yes no ; do
1367                 if test "$enableval" = "$ol_val" ; then
1368                         ol_arg="$ol_val"
1369                 fi
1370         done
1371         if test "$ol_arg" = "invalid" ; then
1372                 { echo "configure: error: bad value $enableval for --enable-bdb2" 1>&2; exit 1; }
1373         fi
1374         ol_enable_bdb2="$ol_arg"
1375
1376 else
1377         ol_enable_bdb2="no"
1378 fi
1379 # end --enable-bdb2
1380 # OpenLDAP --enable-ldbm
1381         # Check whether --enable-ldbm or --disable-ldbm was given.
1382 if test "${enable_ldbm+set}" = set; then
1383   enableval="$enable_ldbm"
1384   
1385         ol_arg=invalid
1386         for ol_val in auto yes no ; do
1387                 if test "$enableval" = "$ol_val" ; then
1388                         ol_arg="$ol_val"
1389                 fi
1390         done
1391         if test "$ol_arg" = "invalid" ; then
1392                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1393         fi
1394         ol_enable_ldbm="$ol_arg"
1395
1396 else
1397         ol_enable_ldbm="yes"
1398 fi
1399 # end --enable-ldbm
1400 # OpenLDAP --with-ldbm_api
1401         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1402 if test "${with_ldbm_api+set}" = set; then
1403   withval="$with_ldbm_api"
1404   
1405         ol_arg=invalid
1406         for ol_val in auto db2 db mdbm gdbm ndbm manual ; do
1407                 if test "$withval" = "$ol_val" ; then
1408                         ol_arg="$ol_val"
1409                 fi
1410         done
1411         if test "$ol_arg" = "invalid" ; then
1412                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1413         fi
1414         ol_with_ldbm_api="$ol_arg"
1415
1416 else
1417         ol_with_ldbm_api="auto"
1418 fi
1419 # end --with-ldbm_api
1420
1421 # OpenLDAP --with-ldbm_type
1422         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1423 if test "${with_ldbm_type+set}" = set; then
1424   withval="$with_ldbm_type"
1425   
1426         ol_arg=invalid
1427         for ol_val in auto btree hash ; do
1428                 if test "$withval" = "$ol_val" ; then
1429                         ol_arg="$ol_val"
1430                 fi
1431         done
1432         if test "$ol_arg" = "invalid" ; then
1433                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1434         fi
1435         ol_with_ldbm_type="$ol_arg"
1436
1437 else
1438         ol_with_ldbm_type="auto"
1439 fi
1440 # end --with-ldbm_type
1441
1442
1443 # OpenLDAP --enable-passwd
1444         # Check whether --enable-passwd or --disable-passwd was given.
1445 if test "${enable_passwd+set}" = set; then
1446   enableval="$enable_passwd"
1447   
1448         ol_arg=invalid
1449         for ol_val in auto yes no ; do
1450                 if test "$enableval" = "$ol_val" ; then
1451                         ol_arg="$ol_val"
1452                 fi
1453         done
1454         if test "$ol_arg" = "invalid" ; then
1455                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1456         fi
1457         ol_enable_passwd="$ol_arg"
1458
1459 else
1460         ol_enable_passwd="no"
1461 fi
1462 # end --enable-passwd
1463 # OpenLDAP --enable-perl
1464         # Check whether --enable-perl or --disable-perl was given.
1465 if test "${enable_perl+set}" = set; then
1466   enableval="$enable_perl"
1467   
1468         ol_arg=invalid
1469         for ol_val in auto yes no ; do
1470                 if test "$enableval" = "$ol_val" ; then
1471                         ol_arg="$ol_val"
1472                 fi
1473         done
1474         if test "$ol_arg" = "invalid" ; then
1475                 { echo "configure: error: bad value $enableval for --enable-perl" 1>&2; exit 1; }
1476         fi
1477         ol_enable_perl="$ol_arg"
1478
1479 else
1480         ol_enable_perl="no"
1481 fi
1482 # end --enable-perl
1483 # OpenLDAP --enable-shell
1484         # Check whether --enable-shell or --disable-shell was given.
1485 if test "${enable_shell+set}" = set; then
1486   enableval="$enable_shell"
1487   
1488         ol_arg=invalid
1489         for ol_val in auto yes no ; do
1490                 if test "$enableval" = "$ol_val" ; then
1491                         ol_arg="$ol_val"
1492                 fi
1493         done
1494         if test "$ol_arg" = "invalid" ; then
1495                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1496         fi
1497         ol_enable_shell="$ol_arg"
1498
1499 else
1500         ol_enable_shell="no"
1501 fi
1502 # end --enable-shell
1503 # OpenLDAP --enable-tcl
1504         # Check whether --enable-tcl or --disable-tcl was given.
1505 if test "${enable_tcl+set}" = set; then
1506   enableval="$enable_tcl"
1507   
1508         ol_arg=invalid
1509         for ol_val in auto yes no ; do
1510                 if test "$enableval" = "$ol_val" ; then
1511                         ol_arg="$ol_val"
1512                 fi
1513         done
1514         if test "$ol_arg" = "invalid" ; then
1515                 { echo "configure: error: bad value $enableval for --enable-tcl" 1>&2; exit 1; }
1516         fi
1517         ol_enable_tcl="$ol_arg"
1518
1519 else
1520         ol_enable_tcl="no"
1521 fi
1522 # end --enable-tcl
1523
1524 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
1525 if test "${with_xxslurpdoptions+set}" = set; then
1526   withval="$with_xxslurpdoptions"
1527   :
1528 fi
1529
1530 # OpenLDAP --enable-slurpd
1531         # Check whether --enable-slurpd or --disable-slurpd was given.
1532 if test "${enable_slurpd+set}" = set; then
1533   enableval="$enable_slurpd"
1534   
1535         ol_arg=invalid
1536         for ol_val in auto yes no ; do
1537                 if test "$enableval" = "$ol_val" ; then
1538                         ol_arg="$ol_val"
1539                 fi
1540         done
1541         if test "$ol_arg" = "invalid" ; then
1542                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
1543         fi
1544         ol_enable_slurpd="$ol_arg"
1545
1546 else
1547         ol_enable_slurpd="auto"
1548 fi
1549 # end --enable-slurpd
1550
1551 # Check whether --with-xxliboptions or --without-xxliboptions was given.
1552 if test "${with_xxliboptions+set}" = set; then
1553   withval="$with_xxliboptions"
1554   :
1555 fi
1556
1557 # Check whether --enable-static or --disable-static was given.
1558 if test "${enable_static+set}" = set; then
1559   enableval="$enable_static"
1560   p=${PACKAGE-default}
1561 case "$enableval" in
1562 yes) enable_static=yes ;;
1563 no) enable_static=no ;;
1564 *)
1565   enable_static=no
1566   # Look at the argument we got.  We use all the common list separators.
1567   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1568   for pkg in $enableval; do
1569     if test "X$pkg" = "X$p"; then
1570       enable_static=yes
1571     fi
1572   done
1573   IFS="$ac_save_ifs"
1574   ;;
1575 esac
1576 else
1577   enable_static=yes
1578 fi
1579
1580 # Check whether --enable-shared or --disable-shared was given.
1581 if test "${enable_shared+set}" = set; then
1582   enableval="$enable_shared"
1583   p=${PACKAGE-default}
1584 case "$enableval" in
1585 yes) enable_shared=yes ;;
1586 no) enable_shared=no ;;
1587 *)
1588   enable_shared=no
1589   # Look at the argument we got.  We use all the common list separators.
1590   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
1591   for pkg in $enableval; do
1592     if test "X$pkg" = "X$p"; then
1593       enable_shared=yes
1594     fi
1595   done
1596   IFS="$ac_save_ifs"
1597   ;;
1598 esac
1599 else
1600   enable_shared=yes
1601 fi
1602
1603
1604 # validate options
1605 if test $ol_enable_dns = yes ; then
1606         if test $ol_enable_referrals = no ; then
1607                 { echo "configure: error: DNS requires --enable-referrals" 1>&2; exit 1; }
1608         fi
1609         if test $ol_enable_referrals = auto ; then
1610                 echo "configure: warning: DNS requires referrals, adding --enable-referrals" 1>&2
1611                 ol_enable_referrals=yes
1612         fi
1613 fi
1614
1615 if test $ol_enable_slapd = no ; then
1616                 if test $ol_enable_bdb2 = yes ; then
1617                 echo "configure: warning: slapd disabled, ignoring --enable_bdb2 argument" 1>&2
1618         fi
1619         if test $ol_enable_ldbm = yes ; then
1620                 echo "configure: warning: slapd disabled, ignoring --enable_ldbm argument" 1>&2
1621         fi
1622         if test $ol_enable_passwd = yes ; then
1623                 echo "configure: warning: slapd disabled, ignoring --enable_passwd argument" 1>&2
1624         fi
1625         if test $ol_enable_perl = yes ; then
1626                 echo "configure: warning: slapd disabled, ignoring --enable_perl argument" 1>&2
1627         fi
1628         if test $ol_enable_shell = yes ; then
1629                 echo "configure: warning: slapd disabled, ignoring --enable_shell argument" 1>&2
1630         fi
1631         if test $ol_enable_tcl = yes ; then
1632                 echo "configure: warning: slapd disabled, ignoring --enable_tcl argument" 1>&2
1633         fi
1634         if test $ol_enable_aclgroups = yes ; then
1635                 echo "configure: warning: slapd disabled, ignoring --enable_aclgroups argument" 1>&2
1636         fi
1637         if test $ol_enable_modules = yes ; then
1638                 echo "configure: warning: slapd disabled, ignoring --enable_modules argument" 1>&2
1639         fi
1640         if test $ol_enable_wrappers = yes ; then
1641                 echo "configure: warning: slapd disabled, ignoring --enable_wrappers argument" 1>&2
1642         fi
1643         if test $ol_enable_phonetic = yes ; then
1644                 echo "configure: warning: slapd disabled, ignoring --enable_phonetic argument" 1>&2
1645         fi
1646         if test $ol_enable_rlookups = yes ; then
1647                 echo "configure: warning: slapd disabled, ignoring --enable_rlookups argument" 1>&2
1648         fi
1649         if test $ol_with_ldbm_api != auto ; then
1650                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_api argument" 1>&2
1651         fi
1652         if test $ol_with_ldbm_type != auto ; then
1653                 echo "configure: warning: slapd disabled, ignoring --with_ldbm_type argument" 1>&2
1654         fi
1655         if test $ol_enable_slurpd = yes ; then
1656                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
1657         fi
1658
1659         # force settings to no
1660         ol_enable_bdb2=no
1661         ol_enable_ldbm=no
1662         ol_enable_passwd=no
1663         ol_enable_perl=no
1664         ol_enable_shell=no
1665         ol_enable_tcl=no
1666
1667         ol_enable_aclgroups=no
1668         ol_enable_modules=no
1669         ol_enable_phonetic=no
1670         ol_enable_rlookups=no
1671         ol_enable_wrappers=no
1672
1673         ol_with_ldbm_api=no
1674         ol_with_ldbm_type=no
1675
1676         ol_enable_slurpd=no
1677
1678 elif test $ol_enable_ldbm = no ; then
1679         
1680         if test $ol_with_ldbm_api != auto ; then
1681                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_api argument" 1>&2
1682         fi
1683
1684         if test $ol_with_ldbm_type != auto ; then
1685                 echo "configure: warning: LDBM disabled, ignoring --with_ldbm_type argument" 1>&2
1686         fi
1687
1688         if test $ol_enable_bdb2 = yes ; then
1689                 { echo "configure: error: BDB2 requires --enable-ldbm" 1>&2; exit 1; }
1690         fi
1691
1692         if test $ol_enable_modules != yes -a \
1693                 $ol_enable_passwd = no -a \
1694                 $ol_enable_perl = no -a \
1695                 $ol_enable_shell = no -a \
1696                 $ol_enable_tcl = no ; then
1697                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
1698         fi
1699
1700         ol_with_ldbm_api=no
1701         ol_with_ldbm_type=no
1702
1703 elif test $ol_enable_bdb2 = yes ; then
1704         
1705         if test $ol_with_ldbm_api != auto -a \
1706                 $ol_with_ldbm_api != db2 ; then
1707                 { echo "configure: error: BDB2 requires LDBM API DB2" 1>&2; exit 1; }
1708         fi
1709
1710         ol_with_ldbm_api=db2
1711
1712 else
1713         
1714         if test $ol_enable_bdb2 != no ; then
1715                 if test $ol_with_ldbm_api != auto -a \
1716                         $ol_with_ldbm_api != db2 ; then
1717                         echo "configure: warning: BDB2 requires LDBM api db2 or auto" 1>&2
1718                         ol_enable_bdb2=no
1719                 fi
1720         fi
1721
1722         if test $ol_with_ldbm_api = gdbm -a \
1723                 $ol_with_ldbm_type = btree ; then
1724                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
1725         fi
1726         if test $ol_with_ldbm_api = mdbm -a \
1727                 $ol_with_ldbm_type = btree ; then
1728                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
1729         fi
1730         if test $ol_with_ldbm_api = ndbm -a \
1731                 $ol_with_ldbm_type = btree ; then
1732                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
1733         fi
1734 fi
1735
1736 if test $ol_enable_slurpd = yes ; then
1737                 if test $ol_with_threads = no ; then
1738                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
1739         fi
1740 fi
1741
1742 echo "$ac_t""done" 1>&6
1743
1744 ## Initialize vars
1745 LDAP_LIBS=
1746 LDBM_LIBS=
1747 LTHREAD_LIBS=
1748 LUTIL_LIBS=
1749
1750 LDAPD_LIBS=
1751 SLAPD_LIBS=
1752 SLURPD_LIBS=
1753
1754 BUILD_LDAPD=no
1755 BUILD_SLAPD=no
1756 BUILD_SLURPD=no
1757
1758 BUILD_BDB2=no
1759 BUILD_LDBM=no
1760 BUILD_PASSWD=no
1761 BUILD_PERL=no
1762 BUILD_SHELL=no
1763 BUILD_TCL=no
1764 BUILD_THREAD=no
1765
1766 SLAPD_MODULES_LDFLAGS=
1767 SLAPD_MODULES_CPPFLAGS=
1768
1769 SLAPD_PERL_LDFLAGS=
1770 SLAPD_PERL_CPPFLAGS=
1771
1772 KRB_LIBS=
1773 READLINE_LIBS=
1774 TERMCAP_LIBS=
1775 TLS_LIBS=
1776
1777
1778 # Find a good install program.  We prefer a C program (faster),
1779 # so one script is as good as another.  But avoid the broken or
1780 # incompatible versions:
1781 # SysV /etc/install, /usr/sbin/install
1782 # SunOS /usr/etc/install
1783 # IRIX /sbin/install
1784 # AIX /bin/install
1785 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
1786 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
1787 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
1788 # ./install, which can be erroneously created by make from ./install.sh.
1789 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
1790 echo "configure:1791: checking for a BSD compatible install" >&5
1791 if test -z "$INSTALL"; then
1792 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
1793   echo $ac_n "(cached) $ac_c" 1>&6
1794 else
1795     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
1796   for ac_dir in $PATH; do
1797     # Account for people who put trailing slashes in PATH elements.
1798     case "$ac_dir/" in
1799     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
1800     *)
1801       # OSF1 and SCO ODT 3.0 have their own names for install.
1802       # Don't use installbsd from OSF since it installs stuff as root
1803       # by default.
1804       for ac_prog in ginstall scoinst install; do
1805         if test -f $ac_dir/$ac_prog; then
1806           if test $ac_prog = install &&
1807             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
1808             # AIX install.  It has an incompatible calling convention.
1809             :
1810           else
1811             ac_cv_path_install="$ac_dir/$ac_prog -c"
1812             break 2
1813           fi
1814         fi
1815       done
1816       ;;
1817     esac
1818   done
1819   IFS="$ac_save_IFS"
1820
1821 fi
1822   if test "${ac_cv_path_install+set}" = set; then
1823     INSTALL="$ac_cv_path_install"
1824   else
1825     # As a last resort, use the slow shell script.  We don't cache a
1826     # path for INSTALL within a source directory, because that will
1827     # break other packages using the cache if that directory is
1828     # removed, or if the path is relative.
1829     INSTALL="$ac_install_sh"
1830   fi
1831 fi
1832 echo "$ac_t""$INSTALL" 1>&6
1833
1834 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
1835 # It thinks the first close brace ends the variable substitution.
1836 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
1837
1838 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
1839
1840 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
1841
1842
1843 CC=${CC-"cc"}
1844
1845
1846 # Make sure we can run config.sub.
1847 if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
1848 else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
1849 fi
1850
1851 echo $ac_n "checking host system type""... $ac_c" 1>&6
1852 echo "configure:1853: checking host system type" >&5
1853
1854 host_alias=$host
1855 case "$host_alias" in
1856 NONE)
1857   case $nonopt in
1858   NONE)
1859     if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
1860     else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
1861     fi ;;
1862   *) host_alias=$nonopt ;;
1863   esac ;;
1864 esac
1865
1866 host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
1867 host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1868 host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1869 host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1870 echo "$ac_t""$host" 1>&6
1871
1872 # Extract the first word of "ranlib", so it can be a program name with args.
1873 set dummy ranlib; ac_word=$2
1874 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1875 echo "configure:1876: checking for $ac_word" >&5
1876 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
1877   echo $ac_n "(cached) $ac_c" 1>&6
1878 else
1879   if test -n "$RANLIB"; then
1880   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
1881 else
1882   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1883   ac_dummy="$PATH"
1884   for ac_dir in $ac_dummy; do
1885     test -z "$ac_dir" && ac_dir=.
1886     if test -f $ac_dir/$ac_word; then
1887       ac_cv_prog_RANLIB="ranlib"
1888       break
1889     fi
1890   done
1891   IFS="$ac_save_ifs"
1892   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
1893 fi
1894 fi
1895 RANLIB="$ac_cv_prog_RANLIB"
1896 if test -n "$RANLIB"; then
1897   echo "$ac_t""$RANLIB" 1>&6
1898 else
1899   echo "$ac_t""no" 1>&6
1900 fi
1901
1902 # Extract the first word of "gcc", so it can be a program name with args.
1903 set dummy gcc; ac_word=$2
1904 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1905 echo "configure:1906: checking for $ac_word" >&5
1906 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1907   echo $ac_n "(cached) $ac_c" 1>&6
1908 else
1909   if test -n "$CC"; then
1910   ac_cv_prog_CC="$CC" # Let the user override the test.
1911 else
1912   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1913   ac_dummy="$PATH"
1914   for ac_dir in $ac_dummy; do
1915     test -z "$ac_dir" && ac_dir=.
1916     if test -f $ac_dir/$ac_word; then
1917       ac_cv_prog_CC="gcc"
1918       break
1919     fi
1920   done
1921   IFS="$ac_save_ifs"
1922 fi
1923 fi
1924 CC="$ac_cv_prog_CC"
1925 if test -n "$CC"; then
1926   echo "$ac_t""$CC" 1>&6
1927 else
1928   echo "$ac_t""no" 1>&6
1929 fi
1930
1931 if test -z "$CC"; then
1932   # Extract the first word of "cc", so it can be a program name with args.
1933 set dummy cc; ac_word=$2
1934 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1935 echo "configure:1936: checking for $ac_word" >&5
1936 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1937   echo $ac_n "(cached) $ac_c" 1>&6
1938 else
1939   if test -n "$CC"; then
1940   ac_cv_prog_CC="$CC" # Let the user override the test.
1941 else
1942   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1943   ac_prog_rejected=no
1944   ac_dummy="$PATH"
1945   for ac_dir in $ac_dummy; do
1946     test -z "$ac_dir" && ac_dir=.
1947     if test -f $ac_dir/$ac_word; then
1948       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1949         ac_prog_rejected=yes
1950         continue
1951       fi
1952       ac_cv_prog_CC="cc"
1953       break
1954     fi
1955   done
1956   IFS="$ac_save_ifs"
1957 if test $ac_prog_rejected = yes; then
1958   # We found a bogon in the path, so make sure we never use it.
1959   set dummy $ac_cv_prog_CC
1960   shift
1961   if test $# -gt 0; then
1962     # We chose a different compiler from the bogus one.
1963     # However, it has the same basename, so the bogon will be chosen
1964     # first if we set CC to just the basename; use the full file name.
1965     shift
1966     set dummy "$ac_dir/$ac_word" "$@"
1967     shift
1968     ac_cv_prog_CC="$@"
1969   fi
1970 fi
1971 fi
1972 fi
1973 CC="$ac_cv_prog_CC"
1974 if test -n "$CC"; then
1975   echo "$ac_t""$CC" 1>&6
1976 else
1977   echo "$ac_t""no" 1>&6
1978 fi
1979
1980   if test -z "$CC"; then
1981     case "`uname -s`" in
1982     *win32* | *WIN32*)
1983       # Extract the first word of "cl", so it can be a program name with args.
1984 set dummy cl; ac_word=$2
1985 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1986 echo "configure:1987: checking for $ac_word" >&5
1987 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
1988   echo $ac_n "(cached) $ac_c" 1>&6
1989 else
1990   if test -n "$CC"; then
1991   ac_cv_prog_CC="$CC" # Let the user override the test.
1992 else
1993   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1994   ac_dummy="$PATH"
1995   for ac_dir in $ac_dummy; do
1996     test -z "$ac_dir" && ac_dir=.
1997     if test -f $ac_dir/$ac_word; then
1998       ac_cv_prog_CC="cl"
1999       break
2000     fi
2001   done
2002   IFS="$ac_save_ifs"
2003 fi
2004 fi
2005 CC="$ac_cv_prog_CC"
2006 if test -n "$CC"; then
2007   echo "$ac_t""$CC" 1>&6
2008 else
2009   echo "$ac_t""no" 1>&6
2010 fi
2011  ;;
2012     esac
2013   fi
2014   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2015 fi
2016
2017 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2018 echo "configure:2019: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
2019
2020 ac_ext=c
2021 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2022 ac_cpp='$CPP $CPPFLAGS'
2023 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2024 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2025 cross_compiling=$ac_cv_prog_cc_cross
2026
2027 cat > conftest.$ac_ext << EOF
2028
2029 #line 2030 "configure"
2030 #include "confdefs.h"
2031
2032 main(){return(0);}
2033 EOF
2034 if { (eval echo configure:2035: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2035   ac_cv_prog_cc_works=yes
2036   # If we can't run a trivial program, we are probably using a cross compiler.
2037   if (./conftest; exit) 2>/dev/null; then
2038     ac_cv_prog_cc_cross=no
2039   else
2040     ac_cv_prog_cc_cross=yes
2041   fi
2042 else
2043   echo "configure: failed program was:" >&5
2044   cat conftest.$ac_ext >&5
2045   ac_cv_prog_cc_works=no
2046 fi
2047 rm -fr conftest*
2048 ac_ext=c
2049 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2050 ac_cpp='$CPP $CPPFLAGS'
2051 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2052 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2053 cross_compiling=$ac_cv_prog_cc_cross
2054
2055 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2056 if test $ac_cv_prog_cc_works = no; then
2057   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2058 fi
2059 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2060 echo "configure:2061: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
2061 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2062 cross_compiling=$ac_cv_prog_cc_cross
2063
2064 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2065 echo "configure:2066: checking whether we are using GNU C" >&5
2066 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
2067   echo $ac_n "(cached) $ac_c" 1>&6
2068 else
2069   cat > conftest.c <<EOF
2070 #ifdef __GNUC__
2071   yes;
2072 #endif
2073 EOF
2074 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2075   ac_cv_prog_gcc=yes
2076 else
2077   ac_cv_prog_gcc=no
2078 fi
2079 fi
2080
2081 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2082
2083 if test $ac_cv_prog_gcc = yes; then
2084   GCC=yes
2085 else
2086   GCC=
2087 fi
2088
2089 ac_test_CFLAGS="${CFLAGS+set}"
2090 ac_save_CFLAGS="$CFLAGS"
2091 CFLAGS=
2092 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2093 echo "configure:2094: checking whether ${CC-cc} accepts -g" >&5
2094 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
2095   echo $ac_n "(cached) $ac_c" 1>&6
2096 else
2097   echo 'void f(){}' > conftest.c
2098 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2099   ac_cv_prog_cc_g=yes
2100 else
2101   ac_cv_prog_cc_g=no
2102 fi
2103 rm -f conftest*
2104
2105 fi
2106
2107 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2108 if test "$ac_test_CFLAGS" = set; then
2109   CFLAGS="$ac_save_CFLAGS"
2110 elif test $ac_cv_prog_cc_g = yes; then
2111   if test "$GCC" = yes; then
2112     CFLAGS="-g -O2"
2113   else
2114     CFLAGS="-g"
2115   fi
2116 else
2117   if test "$GCC" = yes; then
2118     CFLAGS="-O2"
2119   else
2120     CFLAGS=
2121   fi
2122 fi
2123
2124 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2125 if test "${with_gnu_ld+set}" = set; then
2126   withval="$with_gnu_ld"
2127   test "$withval" = no || with_gnu_ld=yes
2128 else
2129   with_gnu_ld=no
2130 fi
2131
2132
2133 ac_prog=ld
2134 if test "$ac_cv_prog_gcc" = yes; then
2135   # Check if gcc -print-prog-name=ld gives a path.
2136   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2137 echo "configure:2138: checking for ld used by GCC" >&5
2138   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2139   case "$ac_prog" in
2140   # Accept absolute paths.
2141   /* | A-Za-z:\\*)
2142     test -z "$LD" && LD="$ac_prog"
2143     ;;
2144   "")
2145     # If it fails, then pretend we aren't using GCC.
2146     ac_prog=ld
2147     ;;
2148   *)
2149     # If it is relative, then search for the first ld in PATH.
2150     with_gnu_ld=unknown
2151     ;;
2152   esac
2153 elif test "$with_gnu_ld" = yes; then
2154   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2155 echo "configure:2156: checking for GNU ld" >&5
2156 else
2157   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2158 echo "configure:2159: checking for non-GNU ld" >&5
2159 fi
2160 if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
2161   echo $ac_n "(cached) $ac_c" 1>&6
2162 else
2163   if test -z "$LD"; then
2164   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2165   for ac_dir in $PATH; do
2166     test -z "$ac_dir" && ac_dir=.
2167     if test -f "$ac_dir/$ac_prog"; then
2168       ac_cv_path_LD="$ac_dir/$ac_prog"
2169       # Check to see if the program is GNU ld.  I'd rather use --version,
2170       # but apparently some GNU ld's only accept -v.
2171       # Break only if it was the GNU/non-GNU ld that we prefer.
2172       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2173         test "$with_gnu_ld" != no && break
2174       else
2175         test "$with_gnu_ld" != yes && break
2176       fi
2177     fi
2178   done
2179   IFS="$ac_save_ifs"
2180 else
2181   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2182 fi
2183 fi
2184
2185 LD="$ac_cv_path_LD"
2186 if test -n "$LD"; then
2187   echo "$ac_t""$LD" 1>&6
2188 else
2189   echo "$ac_t""no" 1>&6
2190 fi
2191 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2192
2193 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2194 echo "configure:2195: checking if the linker ($LD) is GNU ld" >&5
2195 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then
2196   echo $ac_n "(cached) $ac_c" 1>&6
2197 else
2198   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2199 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2200   ac_cv_prog_gnu_ld=yes
2201 else
2202   ac_cv_prog_gnu_ld=no
2203 fi
2204 fi
2205
2206 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2207
2208
2209 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2210 echo "configure:2211: checking for BSD-compatible nm" >&5
2211 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then
2212   echo $ac_n "(cached) $ac_c" 1>&6
2213 else
2214   case "$NM" in
2215 /* | A-Za-z:\\*)
2216   ac_cv_path_NM="$NM" # Let the user override the test with a path.
2217   ;;
2218 *)
2219   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2220   for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
2221     test -z "$ac_dir" && ac_dir=.
2222     if test -f $ac_dir/nm; then
2223       # Check to see if the nm accepts a BSD-compat flag.
2224       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2225       #   nm: unknown option "B" ignored
2226       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2227         ac_cv_path_NM="$ac_dir/nm -B"
2228       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2229         ac_cv_path_NM="$ac_dir/nm -p"
2230       else
2231         ac_cv_path_NM="$ac_dir/nm"
2232       fi
2233       break
2234     fi
2235   done
2236   IFS="$ac_save_ifs"
2237   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2238   ;;
2239 esac
2240 fi
2241
2242 NM="$ac_cv_path_NM"
2243 echo "$ac_t""$NM" 1>&6
2244
2245
2246 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2247 echo "configure:2248: checking whether ln -s works" >&5
2248 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2249   echo $ac_n "(cached) $ac_c" 1>&6
2250 else
2251   rm -f conftestdata
2252 if ln -s X conftestdata 2>/dev/null
2253 then
2254   rm -f conftestdata
2255   ac_cv_prog_LN_S="ln -s"
2256 else
2257   ac_cv_prog_LN_S=ln
2258 fi
2259 fi
2260 LN_S="$ac_cv_prog_LN_S"
2261 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2262   echo "$ac_t""yes" 1>&6
2263 else
2264   echo "$ac_t""no" 1>&6
2265 fi
2266
2267 # Always use our own libtool.
2268 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
2269
2270 # Check for any special flags to pass to ltconfig.
2271 libtool_flags=
2272 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2273 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2274 test "$silent" = yes && libtool_flags="$libtool_flags --silent"
2275 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2276 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2277
2278 # Some flags need to be propagated to the compiler or linker for good
2279 # libtool support.
2280 case "$host" in
2281 *-*-irix6*)
2282   # Find out which ABI we are using.
2283   echo '#line 2284 "configure"' > conftest.$ac_ext
2284   if { (eval echo configure:2285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2285     case "`/usr/bin/file conftest.o`" in
2286     *32-bit*)
2287       LD="${LD-ld} -32"
2288       ;;
2289     *N32*)
2290       LD="${LD-ld} -n32"
2291       ;;
2292     *64-bit*)
2293       LD="${LD-ld} -64"
2294       ;;
2295     esac
2296   fi
2297   rm -rf conftest*
2298   ;;
2299
2300 *-*-sco3.2v5*)
2301   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2302   CFLAGS="$CFLAGS -belf"
2303   ;;
2304 esac
2305
2306 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
2307 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
2308 LD="$LD" NM="$NM" RANLIB="$RANLIB" LN_S="$LN_S" \
2309 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig \
2310 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $host \
2311 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
2312
2313
2314 for ac_prog in mawk gawk nawk awk
2315 do
2316 # Extract the first word of "$ac_prog", so it can be a program name with args.
2317 set dummy $ac_prog; ac_word=$2
2318 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2319 echo "configure:2320: checking for $ac_word" >&5
2320 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
2321   echo $ac_n "(cached) $ac_c" 1>&6
2322 else
2323   if test -n "$AWK"; then
2324   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2325 else
2326   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2327   ac_dummy="$PATH"
2328   for ac_dir in $ac_dummy; do
2329     test -z "$ac_dir" && ac_dir=.
2330     if test -f $ac_dir/$ac_word; then
2331       ac_cv_prog_AWK="$ac_prog"
2332       break
2333     fi
2334   done
2335   IFS="$ac_save_ifs"
2336 fi
2337 fi
2338 AWK="$ac_cv_prog_AWK"
2339 if test -n "$AWK"; then
2340   echo "$ac_t""$AWK" 1>&6
2341 else
2342   echo "$ac_t""no" 1>&6
2343 fi
2344
2345 test -n "$AWK" && break
2346 done
2347
2348 # test for ln hardlink support
2349 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
2350 echo "configure:2351: checking whether ln works" >&5
2351 if eval "test \"`echo '$''{'ol_cv_prog_LN_H'+set}'`\" = set"; then
2352   echo $ac_n "(cached) $ac_c" 1>&6
2353 else
2354   rm -f conftest.src conftest.dst
2355 echo "conftest" > conftest.src
2356 if ln conftest.src conftest.dst 2>/dev/null
2357 then
2358   ol_cv_prog_LN_H="ln"
2359 else
2360   ol_cv_prog_LN_H="cp"
2361 fi
2362 rm -f conftest.src conftest.dst
2363
2364 fi
2365 LN_H="$ol_cv_prog_LN_H"
2366 if test "$ol_cv_prog_LN_H" = "ln"; then
2367         echo "$ac_t""yes" 1>&6
2368 else
2369         echo "$ac_t""no" 1>&6
2370 fi
2371
2372 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2373 echo "configure:2374: checking whether ln -s works" >&5
2374 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
2375   echo $ac_n "(cached) $ac_c" 1>&6
2376 else
2377   rm -f conftestdata
2378 if ln -s X conftestdata 2>/dev/null
2379 then
2380   rm -f conftestdata
2381   ac_cv_prog_LN_S="ln -s"
2382 else
2383   ac_cv_prog_LN_S=ln
2384 fi
2385 fi
2386 LN_S="$ac_cv_prog_LN_S"
2387 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2388   echo "$ac_t""yes" 1>&6
2389 else
2390   echo "$ac_t""no" 1>&6
2391 fi
2392
2393
2394 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
2395         LN_S="$LN_H"
2396 fi
2397
2398 # Extract the first word of "sendmail", so it can be a program name with args.
2399 set dummy sendmail; 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_SENDMAIL'+set}'`\" = set"; then
2403   echo $ac_n "(cached) $ac_c" 1>&6
2404 else
2405   case "$SENDMAIL" in
2406   /*)
2407   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
2408   ;;
2409   ?:/*)                  
2410   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
2411   ;;
2412   *)
2413   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2414   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
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_SENDMAIL="$ac_dir/$ac_word"
2419       break
2420     fi
2421   done
2422   IFS="$ac_save_ifs"
2423   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
2424   ;;
2425 esac
2426 fi
2427 SENDMAIL="$ac_cv_path_SENDMAIL"
2428 if test -n "$SENDMAIL"; then
2429   echo "$ac_t""$SENDMAIL" 1>&6
2430 else
2431   echo "$ac_t""no" 1>&6
2432 fi
2433
2434 # Extract the first word of "vi", so it can be a program name with args.
2435 set dummy vi; ac_word=$2
2436 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2437 echo "configure:2438: checking for $ac_word" >&5
2438 if eval "test \"`echo '$''{'ac_cv_path_EDITOR'+set}'`\" = set"; then
2439   echo $ac_n "(cached) $ac_c" 1>&6
2440 else
2441   case "$EDITOR" in
2442   /*)
2443   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
2444   ;;
2445   ?:/*)                  
2446   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
2447   ;;
2448   *)
2449   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2450   ac_dummy="$PATH:/usr/ucb"
2451   for ac_dir in $ac_dummy; do 
2452     test -z "$ac_dir" && ac_dir=.
2453     if test -f $ac_dir/$ac_word; then
2454       ac_cv_path_EDITOR="$ac_dir/$ac_word"
2455       break
2456     fi
2457   done
2458   IFS="$ac_save_ifs"
2459   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
2460   ;;
2461 esac
2462 fi
2463 EDITOR="$ac_cv_path_EDITOR"
2464 if test -n "$EDITOR"; then
2465   echo "$ac_t""$EDITOR" 1>&6
2466 else
2467   echo "$ac_t""no" 1>&6
2468 fi
2469
2470 # Extract the first word of "finger", so it can be a program name with args.
2471 set dummy finger; ac_word=$2
2472 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2473 echo "configure:2474: checking for $ac_word" >&5
2474 if eval "test \"`echo '$''{'ac_cv_path_FINGER'+set}'`\" = set"; then
2475   echo $ac_n "(cached) $ac_c" 1>&6
2476 else
2477   case "$FINGER" in
2478   /*)
2479   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
2480   ;;
2481   ?:/*)                  
2482   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
2483   ;;
2484   *)
2485   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2486   ac_dummy="$PATH:/usr/ucb"
2487   for ac_dir in $ac_dummy; do 
2488     test -z "$ac_dir" && ac_dir=.
2489     if test -f $ac_dir/$ac_word; then
2490       ac_cv_path_FINGER="$ac_dir/$ac_word"
2491       break
2492     fi
2493   done
2494   IFS="$ac_save_ifs"
2495   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
2496   ;;
2497 esac
2498 fi
2499 FINGER="$ac_cv_path_FINGER"
2500 if test -n "$FINGER"; then
2501   echo "$ac_t""$FINGER" 1>&6
2502 else
2503   echo "$ac_t""no" 1>&6
2504 fi
2505
2506
2507 ol_link_modules=no
2508 if test $ol_enable_modules != no ; then
2509         # Extract the first word of "glib-config", so it can be a program name with args.
2510 set dummy glib-config; ac_word=$2
2511 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2512 echo "configure:2513: checking for $ac_word" >&5
2513 if eval "test \"`echo '$''{'ac_cv_path_GLIBCONFIG'+set}'`\" = set"; then
2514   echo $ac_n "(cached) $ac_c" 1>&6
2515 else
2516   case "$GLIBCONFIG" in
2517   /*)
2518   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a path.
2519   ;;
2520   ?:/*)                  
2521   ac_cv_path_GLIBCONFIG="$GLIBCONFIG" # Let the user override the test with a dos path.
2522   ;;
2523   *)
2524   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2525   ac_dummy="$PATH"
2526   for ac_dir in $ac_dummy; do 
2527     test -z "$ac_dir" && ac_dir=.
2528     if test -f $ac_dir/$ac_word; then
2529       ac_cv_path_GLIBCONFIG="$ac_dir/$ac_word"
2530       break
2531     fi
2532   done
2533   IFS="$ac_save_ifs"
2534   ;;
2535 esac
2536 fi
2537 GLIBCONFIG="$ac_cv_path_GLIBCONFIG"
2538 if test -n "$GLIBCONFIG"; then
2539   echo "$ac_t""$GLIBCONFIG" 1>&6
2540 else
2541   echo "$ac_t""no" 1>&6
2542 fi
2543
2544
2545         if test "no$GLIBCONFIG" = "no" ; then
2546                 if test $ol_enable_modules = yes ; then
2547                         { echo "configure: error: could not locate glib-config" 1>&2; exit 1; }
2548                 fi
2549
2550         else
2551                 SLAPD_MODULES_VERSION="`$GLIBCONFIG --version gmodule`"
2552                 SLAPD_MODULES_CPPFLAGS="`$GLIBCONFIG --cflags gmodule`"
2553                 SLAPD_MODULES_LDFLAGS="`$GLIBCONFIG --libs gmodule`"
2554
2555                                 ol_link_modules=yes
2556         fi
2557 fi
2558
2559 ol_link_perl=no
2560 if test $ol_enable_perl != no ; then
2561         # Extract the first word of "perl", so it can be a program name with args.
2562 set dummy perl; ac_word=$2
2563 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2564 echo "configure:2565: checking for $ac_word" >&5
2565 if eval "test \"`echo '$''{'ac_cv_path_PERLBIN'+set}'`\" = set"; then
2566   echo $ac_n "(cached) $ac_c" 1>&6
2567 else
2568   case "$PERLBIN" in
2569   /*)
2570   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a path.
2571   ;;
2572   ?:/*)                  
2573   ac_cv_path_PERLBIN="$PERLBIN" # Let the user override the test with a dos path.
2574   ;;
2575   *)
2576   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2577   ac_dummy="$PATH"
2578   for ac_dir in $ac_dummy; do 
2579     test -z "$ac_dir" && ac_dir=.
2580     if test -f $ac_dir/$ac_word; then
2581       ac_cv_path_PERLBIN="$ac_dir/$ac_word"
2582       break
2583     fi
2584   done
2585   IFS="$ac_save_ifs"
2586   test -z "$ac_cv_path_PERLBIN" && ac_cv_path_PERLBIN="/usr/bin/perl"
2587   ;;
2588 esac
2589 fi
2590 PERLBIN="$ac_cv_path_PERLBIN"
2591 if test -n "$PERLBIN"; then
2592   echo "$ac_t""$PERLBIN" 1>&6
2593 else
2594   echo "$ac_t""no" 1>&6
2595 fi
2596
2597
2598         if test "no$PERLBIN" = "no" ; then
2599                 if test $ol_enable_perl = yes ; then
2600                         { echo "configure: error: could not locate perl" 1>&2; exit 1; }
2601                 fi
2602
2603         else
2604                 SLAPD_PERL_LDFLAGS="`$PERLBIN -MExtUtils::Embed -e ldopts|sed -e s/-lc//`"
2605                 SLAPD_PERL_CPPFLAGS="`$PERLBIN -MExtUtils::Embed -e ccopts`"
2606
2607                                 ol_link_perl=yes
2608         fi
2609 fi
2610
2611 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
2612 echo "configure:2613: checking how to run the C preprocessor" >&5
2613 # On Suns, sometimes $CPP names a directory.
2614 if test -n "$CPP" && test -d "$CPP"; then
2615   CPP=
2616 fi
2617 if test -z "$CPP"; then
2618 if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
2619   echo $ac_n "(cached) $ac_c" 1>&6
2620 else
2621     # This must be in double quotes, not single quotes, because CPP may get
2622   # substituted into the Makefile and "${CC-cc}" will confuse make.
2623   CPP="${CC-cc} -E"
2624   # On the NeXT, cc -E runs the code through the compiler's parser,
2625   # not just through cpp.
2626   cat > conftest.$ac_ext <<EOF
2627 #line 2628 "configure"
2628 #include "confdefs.h"
2629 #include <assert.h>
2630 Syntax Error
2631 EOF
2632 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2633 { (eval echo configure:2634: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2634 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2635 if test -z "$ac_err"; then
2636   :
2637 else
2638   echo "$ac_err" >&5
2639   echo "configure: failed program was:" >&5
2640   cat conftest.$ac_ext >&5
2641   rm -rf conftest*
2642   CPP="${CC-cc} -E -traditional-cpp"
2643   cat > conftest.$ac_ext <<EOF
2644 #line 2645 "configure"
2645 #include "confdefs.h"
2646 #include <assert.h>
2647 Syntax Error
2648 EOF
2649 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2650 { (eval echo configure:2651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2651 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2652 if test -z "$ac_err"; then
2653   :
2654 else
2655   echo "$ac_err" >&5
2656   echo "configure: failed program was:" >&5
2657   cat conftest.$ac_ext >&5
2658   rm -rf conftest*
2659   CPP="${CC-cc} -nologo -E"
2660   cat > conftest.$ac_ext <<EOF
2661 #line 2662 "configure"
2662 #include "confdefs.h"
2663 #include <assert.h>
2664 Syntax Error
2665 EOF
2666 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2667 { (eval echo configure:2668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2668 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2669 if test -z "$ac_err"; then
2670   :
2671 else
2672   echo "$ac_err" >&5
2673   echo "configure: failed program was:" >&5
2674   cat conftest.$ac_ext >&5
2675   rm -rf conftest*
2676   CPP=/lib/cpp
2677 fi
2678 rm -f conftest*
2679 fi
2680 rm -f conftest*
2681 fi
2682 rm -f conftest*
2683   ac_cv_prog_CPP="$CPP"
2684 fi
2685   CPP="$ac_cv_prog_CPP"
2686 else
2687   ac_cv_prog_CPP="$CPP"
2688 fi
2689 echo "$ac_t""$CPP" 1>&6
2690
2691
2692 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
2693         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
2694
2695 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
2696         echo "configure: warning: programs compiled here do run here..." 1>&2
2697         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
2698
2699 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
2700         echo "configure: warning: programs compiled here do not run here..." 1>&2
2701         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
2702 fi
2703
2704 echo $ac_n "checking for AIX""... $ac_c" 1>&6
2705 echo "configure:2706: checking for AIX" >&5
2706 cat > conftest.$ac_ext <<EOF
2707 #line 2708 "configure"
2708 #include "confdefs.h"
2709 #ifdef _AIX
2710   yes
2711 #endif
2712
2713 EOF
2714 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
2715   egrep "yes" >/dev/null 2>&1; then
2716   rm -rf conftest*
2717   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
2718 #define _ALL_SOURCE 1
2719 EOF
2720
2721 else
2722   rm -rf conftest*
2723   echo "$ac_t""no" 1>&6
2724 fi
2725 rm -f conftest*
2726
2727
2728 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
2729 echo "configure:2730: checking for POSIXized ISC" >&5
2730 if test -d /etc/conf/kconfig.d &&
2731   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
2732 then
2733   echo "$ac_t""yes" 1>&6
2734   ISC=yes # If later tests want to check for ISC.
2735   cat >> confdefs.h <<\EOF
2736 #define _POSIX_SOURCE 1
2737 EOF
2738
2739   if test "$GCC" = yes; then
2740     CC="$CC -posix"
2741   else
2742     CC="$CC -Xp"
2743   fi
2744 else
2745   echo "$ac_t""no" 1>&6
2746   ISC=
2747 fi
2748
2749 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
2750 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
2751 echo "configure:2752: checking for minix/config.h" >&5
2752 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
2753   echo $ac_n "(cached) $ac_c" 1>&6
2754 else
2755   cat > conftest.$ac_ext <<EOF
2756 #line 2757 "configure"
2757 #include "confdefs.h"
2758 #include <minix/config.h>
2759 EOF
2760 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
2761 { (eval echo configure:2762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
2762 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
2763 if test -z "$ac_err"; then
2764   rm -rf conftest*
2765   eval "ac_cv_header_$ac_safe=yes"
2766 else
2767   echo "$ac_err" >&5
2768   echo "configure: failed program was:" >&5
2769   cat conftest.$ac_ext >&5
2770   rm -rf conftest*
2771   eval "ac_cv_header_$ac_safe=no"
2772 fi
2773 rm -f conftest*
2774 fi
2775 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
2776   echo "$ac_t""yes" 1>&6
2777   MINIX=yes
2778 else
2779   echo "$ac_t""no" 1>&6
2780 MINIX=
2781 fi
2782
2783 if test "$MINIX" = yes; then
2784   cat >> confdefs.h <<\EOF
2785 #define _POSIX_SOURCE 1
2786 EOF
2787
2788   cat >> confdefs.h <<\EOF
2789 #define _POSIX_1_SOURCE 2
2790 EOF
2791
2792   cat >> confdefs.h <<\EOF
2793 #define _MINIX 1
2794 EOF
2795
2796 fi
2797
2798
2799 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
2800 echo "configure:2801: checking for be_app in -lbe" >&5
2801 ac_lib_var=`echo be'_'be_app | sed 'y%./+-%__p_%'`
2802 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
2803   echo $ac_n "(cached) $ac_c" 1>&6
2804 else
2805   ac_save_LIBS="$LIBS"
2806 LIBS="-lbe -lroot $LIBS"
2807 cat > conftest.$ac_ext <<EOF
2808 #line 2809 "configure"
2809 #include "confdefs.h"
2810 /* Override any gcc2 internal prototype to avoid an error.  */
2811 /* We use char because int might match the return type of a gcc2
2812     builtin and then its argument prototype would still apply.  */
2813 char be_app();
2814
2815 int main() {
2816 be_app()
2817 ; return 0; }
2818 EOF
2819 if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2820   rm -rf conftest*
2821   eval "ac_cv_lib_$ac_lib_var=yes"
2822 else
2823   echo "configure: failed program was:" >&5
2824   cat conftest.$ac_ext >&5
2825   rm -rf conftest*
2826   eval "ac_cv_lib_$ac_lib_var=no"
2827 fi
2828 rm -f conftest*
2829 LIBS="$ac_save_LIBS"
2830
2831 fi
2832 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
2833   echo "$ac_t""yes" 1>&6
2834   LIBS="$LIBS -lbe -lroot"
2835 else
2836   echo "$ac_t""no" 1>&6
2837 :
2838 fi
2839
2840
2841 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
2842 echo "configure:2843: checking for Cygwin environment" >&5
2843 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
2844   echo $ac_n "(cached) $ac_c" 1>&6
2845 else
2846   cat > conftest.$ac_ext <<EOF
2847 #line 2848 "configure"
2848 #include "confdefs.h"
2849
2850 int main() {
2851
2852 #ifndef __CYGWIN__
2853 #define __CYGWIN__ __CYGWIN32__
2854 #endif
2855 return __CYGWIN__;
2856 ; return 0; }
2857 EOF
2858 if { (eval echo configure:2859: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2859   rm -rf conftest*
2860   ac_cv_cygwin=yes
2861 else
2862   echo "configure: failed program was:" >&5
2863   cat conftest.$ac_ext >&5
2864   rm -rf conftest*
2865   ac_cv_cygwin=no
2866 fi
2867 rm -f conftest*
2868 rm -f conftest*
2869 fi
2870
2871 echo "$ac_t""$ac_cv_cygwin" 1>&6
2872 CYGWIN=
2873 test "$ac_cv_cygwin" = yes && CYGWIN=yes
2874 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
2875 echo "configure:2876: checking for mingw32 environment" >&5
2876 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
2877   echo $ac_n "(cached) $ac_c" 1>&6
2878 else
2879   cat > conftest.$ac_ext <<EOF
2880 #line 2881 "configure"
2881 #include "confdefs.h"
2882
2883 int main() {
2884 return __MINGW32__;
2885 ; return 0; }
2886 EOF
2887 if { (eval echo configure:2888: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2888   rm -rf conftest*
2889   ac_cv_mingw32=yes
2890 else
2891   echo "configure: failed program was:" >&5
2892   cat conftest.$ac_ext >&5
2893   rm -rf conftest*
2894   ac_cv_mingw32=no
2895 fi
2896 rm -f conftest*
2897 rm -f conftest*
2898 fi
2899
2900 echo "$ac_t""$ac_cv_mingw32" 1>&6
2901 MINGW32=
2902 test "$ac_cv_mingw32" = yes && MINGW32=yes
2903
2904
2905 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
2906 echo "configure:2907: checking for executable suffix" >&5
2907 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
2908   echo $ac_n "(cached) $ac_c" 1>&6
2909 else
2910   if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
2911   ac_cv_exeext=.exe
2912 else
2913   rm -f conftest*
2914   echo 'int main () { return 0; }' > conftest.$ac_ext
2915   ac_cv_exeext=
2916   if { (eval echo configure:2917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
2917     for file in conftest.*; do
2918       case $file in
2919       *.c | *.o | *.obj) ;;
2920       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
2921       esac
2922     done
2923   else
2924     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
2925   fi
2926   rm -f conftest*
2927   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
2928 fi
2929 fi
2930
2931 EXEEXT=""
2932 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
2933 echo "$ac_t""${ac_cv_exeext}" 1>&6
2934 ac_exeext=$EXEEXT
2935
2936 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
2937 echo "configure:2938: checking for object suffix" >&5
2938 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
2939   echo $ac_n "(cached) $ac_c" 1>&6
2940 else
2941   rm -f conftest*
2942 echo 'int i = 1;' > conftest.$ac_ext
2943 if { (eval echo configure:2944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2944   for ac_file in conftest.*; do
2945     case $ac_file in
2946     *.c) ;;
2947     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
2948     esac
2949   done
2950 else
2951   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
2952 fi
2953 rm -f conftest*
2954 fi
2955
2956 echo "$ac_t""$ac_cv_objext" 1>&6
2957 OBJEXT=$ac_cv_objext
2958 ac_objext=$ac_cv_objext
2959
2960
2961
2962
2963
2964 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
2965 echo "configure:2966: checking for ${CC-cc} option to accept ANSI C" >&5
2966 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then
2967   echo $ac_n "(cached) $ac_c" 1>&6
2968 else
2969   am_cv_prog_cc_stdc=no
2970 ac_save_CC="$CC"
2971 # Don't try gcc -ansi; that turns off useful extensions and
2972 # breaks some systems' header files.
2973 # AIX                   -qlanglvl=ansi
2974 # Ultrix and OSF/1      -std1
2975 # HP-UX                 -Aa -D_HPUX_SOURCE
2976 # SVR4                  -Xc -D__EXTENSIONS__
2977 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2978 do
2979   CC="$ac_save_CC $ac_arg"
2980   cat > conftest.$ac_ext <<EOF
2981 #line 2982 "configure"
2982 #include "confdefs.h"
2983 #include <stdarg.h>
2984 #include <stdio.h>
2985 #include <sys/types.h>
2986 #include <sys/stat.h>
2987 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2988 struct buf { int x; };
2989 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2990 static char *e (p, i)
2991      char **p;
2992      int i;
2993 {
2994   return p[i];
2995 }
2996 static char *f (char * (*g) (char **, int), char **p, ...)
2997 {
2998   char *s;
2999   va_list v;
3000   va_start (v,p);
3001   s = g (p, va_arg (v,int));
3002   va_end (v);
3003   return s;
3004 }
3005 int test (int i, double x);
3006 struct s1 {int (*f) (int a);};
3007 struct s2 {int (*f) (double a);};
3008 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3009 int argc;
3010 char **argv;
3011
3012 int main() {
3013
3014 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3015
3016 ; return 0; }
3017 EOF
3018 if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3019   rm -rf conftest*
3020   am_cv_prog_cc_stdc="$ac_arg"; break
3021 else
3022   echo "configure: failed program was:" >&5
3023   cat conftest.$ac_ext >&5
3024 fi
3025 rm -f conftest*
3026 done
3027 CC="$ac_save_CC"
3028
3029 fi
3030
3031 if test -z "$am_cv_prog_cc_stdc"; then
3032   echo "$ac_t""none needed" 1>&6
3033 else
3034   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3035 fi
3036 case "x$am_cv_prog_cc_stdc" in
3037   x|xno) ;;
3038   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3039 esac
3040
3041 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3042         { echo "configure: error: OpenLDAP requires compiler to support STDC prototypes." 1>&2; exit 1; }
3043 fi
3044
3045
3046
3047
3048 echo $ac_n "checking for socket""... $ac_c" 1>&6
3049 echo "configure:3050: checking for socket" >&5
3050 if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
3051   echo $ac_n "(cached) $ac_c" 1>&6
3052 else
3053   cat > conftest.$ac_ext <<EOF
3054 #line 3055 "configure"
3055 #include "confdefs.h"
3056 /* System header to define __stub macros and hopefully few prototypes,
3057     which can conflict with char socket(); below.  */
3058 #include <assert.h>
3059 /* Override any gcc2 internal prototype to avoid an error.  */
3060 /* We use char because int might match the return type of a gcc2
3061     builtin and then its argument prototype would still apply.  */
3062 char socket();
3063
3064 int main() {
3065
3066 /* The GNU C library defines this for functions which it implements
3067     to always fail with ENOSYS.  Some functions are actually named
3068     something starting with __ and the normal name is an alias.  */
3069 #if defined (__stub_socket) || defined (__stub___socket)
3070 choke me
3071 #else
3072 socket();
3073 #endif
3074
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_func_socket=yes"
3080 else
3081   echo "configure: failed program was:" >&5
3082   cat conftest.$ac_ext >&5
3083   rm -rf conftest*
3084   eval "ac_cv_func_socket=no"
3085 fi
3086 rm -f conftest*
3087 fi
3088
3089 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
3090   echo "$ac_t""yes" 1>&6
3091   :
3092 else
3093   echo "$ac_t""no" 1>&6
3094         
3095         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
3096 echo "configure:3097: checking for main in -lsocket" >&5
3097 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'`
3098 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3099   echo $ac_n "(cached) $ac_c" 1>&6
3100 else
3101   ac_save_LIBS="$LIBS"
3102 LIBS="-lsocket  $LIBS"
3103 cat > conftest.$ac_ext <<EOF
3104 #line 3105 "configure"
3105 #include "confdefs.h"
3106
3107 int main() {
3108 main()
3109 ; return 0; }
3110 EOF
3111 if { (eval echo configure:3112: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3112   rm -rf conftest*
3113   eval "ac_cv_lib_$ac_lib_var=yes"
3114 else
3115   echo "configure: failed program was:" >&5
3116   cat conftest.$ac_ext >&5
3117   rm -rf conftest*
3118   eval "ac_cv_lib_$ac_lib_var=no"
3119 fi
3120 rm -f conftest*
3121 LIBS="$ac_save_LIBS"
3122
3123 fi
3124 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3125   echo "$ac_t""yes" 1>&6
3126     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3127     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3128   cat >> confdefs.h <<EOF
3129 #define $ac_tr_lib 1
3130 EOF
3131
3132   LIBS="-lsocket $LIBS"
3133
3134 else
3135   echo "$ac_t""no" 1>&6
3136 fi
3137
3138         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
3139 echo "configure:3140: checking for main in -lnet" >&5
3140 ac_lib_var=`echo net'_'main | sed 'y%./+-%__p_%'`
3141 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3142   echo $ac_n "(cached) $ac_c" 1>&6
3143 else
3144   ac_save_LIBS="$LIBS"
3145 LIBS="-lnet  $LIBS"
3146 cat > conftest.$ac_ext <<EOF
3147 #line 3148 "configure"
3148 #include "confdefs.h"
3149
3150 int main() {
3151 main()
3152 ; return 0; }
3153 EOF
3154 if { (eval echo configure:3155: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3155   rm -rf conftest*
3156   eval "ac_cv_lib_$ac_lib_var=yes"
3157 else
3158   echo "configure: failed program was:" >&5
3159   cat conftest.$ac_ext >&5
3160   rm -rf conftest*
3161   eval "ac_cv_lib_$ac_lib_var=no"
3162 fi
3163 rm -f conftest*
3164 LIBS="$ac_save_LIBS"
3165
3166 fi
3167 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3168   echo "$ac_t""yes" 1>&6
3169     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3170     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3171   cat >> confdefs.h <<EOF
3172 #define $ac_tr_lib 1
3173 EOF
3174
3175   LIBS="-lnet $LIBS"
3176
3177 else
3178   echo "$ac_t""no" 1>&6
3179 fi
3180
3181         echo $ac_n "checking for socket in -lnet""... $ac_c" 1>&6
3182 echo "configure:3183: checking for socket in -lnet" >&5
3183 ac_lib_var=`echo net'_'socket | sed 'y%./+-%__p_%'`
3184 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3185   echo $ac_n "(cached) $ac_c" 1>&6
3186 else
3187   ac_save_LIBS="$LIBS"
3188 LIBS="-lnet  $LIBS"
3189 cat > conftest.$ac_ext <<EOF
3190 #line 3191 "configure"
3191 #include "confdefs.h"
3192 /* Override any gcc2 internal prototype to avoid an error.  */
3193 /* We use char because int might match the return type of a gcc2
3194     builtin and then its argument prototype would still apply.  */
3195 char socket();
3196
3197 int main() {
3198 socket()
3199 ; return 0; }
3200 EOF
3201 if { (eval echo configure:3202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3202   rm -rf conftest*
3203   eval "ac_cv_lib_$ac_lib_var=yes"
3204 else
3205   echo "configure: failed program was:" >&5
3206   cat conftest.$ac_ext >&5
3207   rm -rf conftest*
3208   eval "ac_cv_lib_$ac_lib_var=no"
3209 fi
3210 rm -f conftest*
3211 LIBS="$ac_save_LIBS"
3212
3213 fi
3214 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3215   echo "$ac_t""yes" 1>&6
3216     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3217     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3218   cat >> confdefs.h <<EOF
3219 #define $ac_tr_lib 1
3220 EOF
3221
3222   LIBS="-lnet $LIBS"
3223
3224 else
3225   echo "$ac_t""no" 1>&6
3226 fi
3227
3228         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
3229 echo "configure:3230: checking for main in -lnsl_s" >&5
3230 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-%__p_%'`
3231 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3232   echo $ac_n "(cached) $ac_c" 1>&6
3233 else
3234   ac_save_LIBS="$LIBS"
3235 LIBS="-lnsl_s  $LIBS"
3236 cat > conftest.$ac_ext <<EOF
3237 #line 3238 "configure"
3238 #include "confdefs.h"
3239
3240 int main() {
3241 main()
3242 ; return 0; }
3243 EOF
3244 if { (eval echo configure:3245: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3245   rm -rf conftest*
3246   eval "ac_cv_lib_$ac_lib_var=yes"
3247 else
3248   echo "configure: failed program was:" >&5
3249   cat conftest.$ac_ext >&5
3250   rm -rf conftest*
3251   eval "ac_cv_lib_$ac_lib_var=no"
3252 fi
3253 rm -f conftest*
3254 LIBS="$ac_save_LIBS"
3255
3256 fi
3257 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3258   echo "$ac_t""yes" 1>&6
3259     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3260     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3261   cat >> confdefs.h <<EOF
3262 #define $ac_tr_lib 1
3263 EOF
3264
3265   LIBS="-lnsl_s $LIBS"
3266
3267 else
3268   echo "$ac_t""no" 1>&6
3269 fi
3270
3271         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
3272 echo "configure:3273: checking for main in -lnsl" >&5
3273 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
3274 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3275   echo $ac_n "(cached) $ac_c" 1>&6
3276 else
3277   ac_save_LIBS="$LIBS"
3278 LIBS="-lnsl  $LIBS"
3279 cat > conftest.$ac_ext <<EOF
3280 #line 3281 "configure"
3281 #include "confdefs.h"
3282
3283 int main() {
3284 main()
3285 ; return 0; }
3286 EOF
3287 if { (eval echo configure:3288: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3288   rm -rf conftest*
3289   eval "ac_cv_lib_$ac_lib_var=yes"
3290 else
3291   echo "configure: failed program was:" >&5
3292   cat conftest.$ac_ext >&5
3293   rm -rf conftest*
3294   eval "ac_cv_lib_$ac_lib_var=no"
3295 fi
3296 rm -f conftest*
3297 LIBS="$ac_save_LIBS"
3298
3299 fi
3300 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3301   echo "$ac_t""yes" 1>&6
3302     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3303     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3304   cat >> confdefs.h <<EOF
3305 #define $ac_tr_lib 1
3306 EOF
3307
3308   LIBS="-lnsl $LIBS"
3309
3310 else
3311   echo "$ac_t""no" 1>&6
3312 fi
3313
3314         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
3315 echo "configure:3316: checking for socket in -linet" >&5
3316 ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
3317 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3318   echo $ac_n "(cached) $ac_c" 1>&6
3319 else
3320   ac_save_LIBS="$LIBS"
3321 LIBS="-linet  $LIBS"
3322 cat > conftest.$ac_ext <<EOF
3323 #line 3324 "configure"
3324 #include "confdefs.h"
3325 /* Override any gcc2 internal prototype to avoid an error.  */
3326 /* We use char because int might match the return type of a gcc2
3327     builtin and then its argument prototype would still apply.  */
3328 char socket();
3329
3330 int main() {
3331 socket()
3332 ; return 0; }
3333 EOF
3334 if { (eval echo configure:3335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3335   rm -rf conftest*
3336   eval "ac_cv_lib_$ac_lib_var=yes"
3337 else
3338   echo "configure: failed program was:" >&5
3339   cat conftest.$ac_ext >&5
3340   rm -rf conftest*
3341   eval "ac_cv_lib_$ac_lib_var=no"
3342 fi
3343 rm -f conftest*
3344 LIBS="$ac_save_LIBS"
3345
3346 fi
3347 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3348   echo "$ac_t""yes" 1>&6
3349     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3350     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3351   cat >> confdefs.h <<EOF
3352 #define $ac_tr_lib 1
3353 EOF
3354
3355   LIBS="-linet $LIBS"
3356
3357 else
3358   echo "$ac_t""no" 1>&6
3359 fi
3360
3361         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
3362 echo "configure:3363: checking for main in -lgen" >&5
3363 ac_lib_var=`echo gen'_'main | sed 'y%./+-%__p_%'`
3364 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3365   echo $ac_n "(cached) $ac_c" 1>&6
3366 else
3367   ac_save_LIBS="$LIBS"
3368 LIBS="-lgen  $LIBS"
3369 cat > conftest.$ac_ext <<EOF
3370 #line 3371 "configure"
3371 #include "confdefs.h"
3372
3373 int main() {
3374 main()
3375 ; return 0; }
3376 EOF
3377 if { (eval echo configure:3378: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3378   rm -rf conftest*
3379   eval "ac_cv_lib_$ac_lib_var=yes"
3380 else
3381   echo "configure: failed program was:" >&5
3382   cat conftest.$ac_ext >&5
3383   rm -rf conftest*
3384   eval "ac_cv_lib_$ac_lib_var=no"
3385 fi
3386 rm -f conftest*
3387 LIBS="$ac_save_LIBS"
3388
3389 fi
3390 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3391   echo "$ac_t""yes" 1>&6
3392     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3393     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3394   cat >> confdefs.h <<EOF
3395 #define $ac_tr_lib 1
3396 EOF
3397
3398   LIBS="-lgen $LIBS"
3399
3400 else
3401   echo "$ac_t""no" 1>&6
3402 fi
3403
3404
3405 fi
3406
3407
3408 for ac_func in res_search
3409 do
3410 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3411 echo "configure:3412: checking for $ac_func" >&5
3412 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
3413   echo $ac_n "(cached) $ac_c" 1>&6
3414 else
3415   cat > conftest.$ac_ext <<EOF
3416 #line 3417 "configure"
3417 #include "confdefs.h"
3418 /* System header to define __stub macros and hopefully few prototypes,
3419     which can conflict with char $ac_func(); below.  */
3420 #include <assert.h>
3421 /* Override any gcc2 internal prototype to avoid an error.  */
3422 /* We use char because int might match the return type of a gcc2
3423     builtin and then its argument prototype would still apply.  */
3424 char $ac_func();
3425
3426 int main() {
3427
3428 /* The GNU C library defines this for functions which it implements
3429     to always fail with ENOSYS.  Some functions are actually named
3430     something starting with __ and the normal name is an alias.  */
3431 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3432 choke me
3433 #else
3434 $ac_func();
3435 #endif
3436
3437 ; return 0; }
3438 EOF
3439 if { (eval echo configure:3440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3440   rm -rf conftest*
3441   eval "ac_cv_func_$ac_func=yes"
3442 else
3443   echo "configure: failed program was:" >&5
3444   cat conftest.$ac_ext >&5
3445   rm -rf conftest*
3446   eval "ac_cv_func_$ac_func=no"
3447 fi
3448 rm -f conftest*
3449 fi
3450
3451 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3452   echo "$ac_t""yes" 1>&6
3453     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3454   cat >> confdefs.h <<EOF
3455 #define $ac_tr_func 1
3456 EOF
3457  
3458 else
3459   echo "$ac_t""no" 1>&6
3460 fi
3461 done
3462
3463 if test $ac_cv_func_res_search = "no" ; then 
3464         echo $ac_n "checking for res_search in -lbind""... $ac_c" 1>&6
3465 echo "configure:3466: checking for res_search in -lbind" >&5
3466 ac_lib_var=`echo bind'_'res_search | sed 'y%./+-%__p_%'`
3467 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3468   echo $ac_n "(cached) $ac_c" 1>&6
3469 else
3470   ac_save_LIBS="$LIBS"
3471 LIBS="-lbind  $LIBS"
3472 cat > conftest.$ac_ext <<EOF
3473 #line 3474 "configure"
3474 #include "confdefs.h"
3475 /* Override any gcc2 internal prototype to avoid an error.  */
3476 /* We use char because int might match the return type of a gcc2
3477     builtin and then its argument prototype would still apply.  */
3478 char res_search();
3479
3480 int main() {
3481 res_search()
3482 ; return 0; }
3483 EOF
3484 if { (eval echo configure:3485: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3485   rm -rf conftest*
3486   eval "ac_cv_lib_$ac_lib_var=yes"
3487 else
3488   echo "configure: failed program was:" >&5
3489   cat conftest.$ac_ext >&5
3490   rm -rf conftest*
3491   eval "ac_cv_lib_$ac_lib_var=no"
3492 fi
3493 rm -f conftest*
3494 LIBS="$ac_save_LIBS"
3495
3496 fi
3497 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3498   echo "$ac_t""yes" 1>&6
3499     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3500     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3501   cat >> confdefs.h <<EOF
3502 #define $ac_tr_lib 1
3503 EOF
3504
3505   LIBS="-lbind $LIBS"
3506
3507 else
3508   echo "$ac_t""no" 1>&6
3509 fi
3510
3511         if test "$ac_cv_lib_bind_res_search" = "yes" ; then
3512                 cat >> confdefs.h <<\EOF
3513 #define HAVE_RES_SEARCH 1
3514 EOF
3515
3516         else
3517                 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
3518 echo "configure:3519: checking for res_search in -lresolv" >&5
3519 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
3520 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3521   echo $ac_n "(cached) $ac_c" 1>&6
3522 else
3523   ac_save_LIBS="$LIBS"
3524 LIBS="-lresolv  $LIBS"
3525 cat > conftest.$ac_ext <<EOF
3526 #line 3527 "configure"
3527 #include "confdefs.h"
3528 /* Override any gcc2 internal prototype to avoid an error.  */
3529 /* We use char because int might match the return type of a gcc2
3530     builtin and then its argument prototype would still apply.  */
3531 char res_search();
3532
3533 int main() {
3534 res_search()
3535 ; return 0; }
3536 EOF
3537 if { (eval echo configure:3538: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3538   rm -rf conftest*
3539   eval "ac_cv_lib_$ac_lib_var=yes"
3540 else
3541   echo "configure: failed program was:" >&5
3542   cat conftest.$ac_ext >&5
3543   rm -rf conftest*
3544   eval "ac_cv_lib_$ac_lib_var=no"
3545 fi
3546 rm -f conftest*
3547 LIBS="$ac_save_LIBS"
3548
3549 fi
3550 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3551   echo "$ac_t""yes" 1>&6
3552     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3553     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3554   cat >> confdefs.h <<EOF
3555 #define $ac_tr_lib 1
3556 EOF
3557
3558   LIBS="-lresolv $LIBS"
3559
3560 else
3561   echo "$ac_t""no" 1>&6
3562 fi
3563
3564                 if test "$ac_cv_lib_resolv_res_search" = "yes" ; then
3565                         cat >> confdefs.h <<\EOF
3566 #define HAVE_RES_SEARCH 1
3567 EOF
3568
3569                 fi
3570         fi
3571 fi
3572
3573 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
3574 echo "configure:3575: checking for sigset in -lV3" >&5
3575 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-%__p_%'`
3576 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3577   echo $ac_n "(cached) $ac_c" 1>&6
3578 else
3579   ac_save_LIBS="$LIBS"
3580 LIBS="-lV3  $LIBS"
3581 cat > conftest.$ac_ext <<EOF
3582 #line 3583 "configure"
3583 #include "confdefs.h"
3584 /* Override any gcc2 internal prototype to avoid an error.  */
3585 /* We use char because int might match the return type of a gcc2
3586     builtin and then its argument prototype would still apply.  */
3587 char sigset();
3588
3589 int main() {
3590 sigset()
3591 ; return 0; }
3592 EOF
3593 if { (eval echo configure:3594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3594   rm -rf conftest*
3595   eval "ac_cv_lib_$ac_lib_var=yes"
3596 else
3597   echo "configure: failed program was:" >&5
3598   cat conftest.$ac_ext >&5
3599   rm -rf conftest*
3600   eval "ac_cv_lib_$ac_lib_var=no"
3601 fi
3602 rm -f conftest*
3603 LIBS="$ac_save_LIBS"
3604
3605 fi
3606 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3607   echo "$ac_t""yes" 1>&6
3608     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
3609     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
3610   cat >> confdefs.h <<EOF
3611 #define $ac_tr_lib 1
3612 EOF
3613
3614   LIBS="-lV3 $LIBS"
3615
3616 else
3617   echo "$ac_t""no" 1>&6
3618 fi
3619
3620
3621 echo $ac_n "checking for select""... $ac_c" 1>&6
3622 echo "configure:3623: checking for select" >&5
3623 if eval "test \"`echo '$''{'ac_cv_func_select'+set}'`\" = set"; then
3624   echo $ac_n "(cached) $ac_c" 1>&6
3625 else
3626   cat > conftest.$ac_ext <<EOF
3627 #line 3628 "configure"
3628 #include "confdefs.h"
3629 /* System header to define __stub macros and hopefully few prototypes,
3630     which can conflict with char select(); below.  */
3631 #include <assert.h>
3632 /* Override any gcc2 internal prototype to avoid an error.  */
3633 /* We use char because int might match the return type of a gcc2
3634     builtin and then its argument prototype would still apply.  */
3635 char select();
3636
3637 int main() {
3638
3639 /* The GNU C library defines this for functions which it implements
3640     to always fail with ENOSYS.  Some functions are actually named
3641     something starting with __ and the normal name is an alias.  */
3642 #if defined (__stub_select) || defined (__stub___select)
3643 choke me
3644 #else
3645 select();
3646 #endif
3647
3648 ; return 0; }
3649 EOF
3650 if { (eval echo configure:3651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3651   rm -rf conftest*
3652   eval "ac_cv_func_select=yes"
3653 else
3654   echo "configure: failed program was:" >&5
3655   cat conftest.$ac_ext >&5
3656   rm -rf conftest*
3657   eval "ac_cv_func_select=no"
3658 fi
3659 rm -f conftest*
3660 fi
3661
3662 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
3663   echo "$ac_t""yes" 1>&6
3664   :
3665 else
3666   echo "$ac_t""no" 1>&6
3667 { echo "configure: error: select() required." 1>&2; exit 1; }
3668 fi
3669
3670
3671 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
3672 echo "configure:3673: checking types of arguments for select()" >&5
3673  if eval "test \"`echo '$''{'ac_cv_func_select_arg234'+set}'`\" = set"; then
3674   echo $ac_n "(cached) $ac_c" 1>&6
3675 else
3676    if eval "test \"`echo '$''{'ac_cv_func_select_arg1'+set}'`\" = set"; then
3677   echo $ac_n "(cached) $ac_c" 1>&6
3678 else
3679     if eval "test \"`echo '$''{'ac_cv_func_select_arg5'+set}'`\" = set"; then
3680   echo $ac_n "(cached) $ac_c" 1>&6
3681 else
3682      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
3683      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
3684       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
3685        cat > conftest.$ac_ext <<EOF
3686 #line 3687 "configure"
3687 #include "confdefs.h"
3688 #ifdef HAVE_SYS_TYPES_H
3689 #include <sys/types.h>
3690 #endif
3691 #ifdef HAVE_SYS_TIME_H
3692 #include <sys/time.h>
3693 #endif
3694 #ifdef HAVE_SYS_SELECT_H
3695 #include <sys/select.h>
3696 #endif
3697 #ifdef HAVE_SYS_SOCKET_H
3698 #include <sys/socket.h>
3699 #endif
3700 extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
3701 int main() {
3702
3703 ; return 0; }
3704 EOF
3705 if { (eval echo configure:3706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3706   rm -rf conftest*
3707           ac_not_found=no ; break 3
3708 else
3709   echo "configure: failed program was:" >&5
3710   cat conftest.$ac_ext >&5
3711   rm -rf conftest*
3712   ac_not_found=yes
3713 fi
3714 rm -f conftest*
3715       done
3716      done
3717     done
3718    
3719 fi
3720   
3721 fi
3722  
3723 fi
3724  if test "$ac_not_found" = yes; then
3725   ac_cv_func_select_arg1=int 
3726   ac_cv_func_select_arg234='int *' 
3727   ac_cv_func_select_arg5='struct timeval *'
3728  fi
3729  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
3730  cat >> confdefs.h <<EOF
3731 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
3732 EOF
3733
3734  cat >> confdefs.h <<EOF
3735 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
3736 EOF
3737
3738  cat >> confdefs.h <<EOF
3739 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
3740 EOF
3741
3742
3743
3744 # ISODE tests
3745 ol_link_isode=no
3746 if test $ol_enable_ldapd != no ; then
3747                 echo $ac_n "checking for main in -lxtpp""... $ac_c" 1>&6
3748 echo "configure:3749: checking for main in -lxtpp" >&5
3749 ac_lib_var=`echo xtpp'_'main | sed 'y%./+-%__p_%'`
3750 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3751   echo $ac_n "(cached) $ac_c" 1>&6
3752 else
3753   ac_save_LIBS="$LIBS"
3754 LIBS="-lxtpp -lxtdsap -lxtisode -losi $LIBS"
3755 cat > conftest.$ac_ext <<EOF
3756 #line 3757 "configure"
3757 #include "confdefs.h"
3758
3759 int main() {
3760 main()
3761 ; return 0; }
3762 EOF
3763 if { (eval echo configure:3764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3764   rm -rf conftest*
3765   eval "ac_cv_lib_$ac_lib_var=yes"
3766 else
3767   echo "configure: failed program was:" >&5
3768   cat conftest.$ac_ext >&5
3769   rm -rf conftest*
3770   eval "ac_cv_lib_$ac_lib_var=no"
3771 fi
3772 rm -f conftest*
3773 LIBS="$ac_save_LIBS"
3774
3775 fi
3776 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3777   echo "$ac_t""yes" 1>&6
3778   
3779                 ol_link_isode=yes
3780                 cat >> confdefs.h <<\EOF
3781 #define HAVE_XTPP 1
3782 EOF
3783
3784                 LDAPD_LIBS="$LDAPD_LIBS -lxtpp -lxtdsap -lxtisode -losi"
3785                 
3786 else
3787   echo "$ac_t""no" 1>&6
3788 :
3789 fi
3790
3791         echo $ac_n "checking for main in -ldsap""... $ac_c" 1>&6
3792 echo "configure:3793: checking for main in -ldsap" >&5
3793 ac_lib_var=`echo dsap'_'main | sed 'y%./+-%__p_%'`
3794 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3795   echo $ac_n "(cached) $ac_c" 1>&6
3796 else
3797   ac_save_LIBS="$LIBS"
3798 LIBS="-ldsap -lisode $LIBS"
3799 cat > conftest.$ac_ext <<EOF
3800 #line 3801 "configure"
3801 #include "confdefs.h"
3802
3803 int main() {
3804 main()
3805 ; return 0; }
3806 EOF
3807 if { (eval echo configure:3808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3808   rm -rf conftest*
3809   eval "ac_cv_lib_$ac_lib_var=yes"
3810 else
3811   echo "configure: failed program was:" >&5
3812   cat conftest.$ac_ext >&5
3813   rm -rf conftest*
3814   eval "ac_cv_lib_$ac_lib_var=no"
3815 fi
3816 rm -f conftest*
3817 LIBS="$ac_save_LIBS"
3818
3819 fi
3820 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3821   echo "$ac_t""yes" 1>&6
3822   
3823                 ol_link_isode=yes
3824                 cat >> confdefs.h <<\EOF
3825 #define HAVE_DSAP 1
3826 EOF
3827
3828                 LDAPD_LIBS="$LDAPD_LIBS -ldsap"
3829                 
3830 else
3831   echo "$ac_t""no" 1>&6
3832 :
3833 fi
3834
3835         echo $ac_n "checking for main in -lisode""... $ac_c" 1>&6
3836 echo "configure:3837: checking for main in -lisode" >&5
3837 ac_lib_var=`echo isode'_'main | sed 'y%./+-%__p_%'`
3838 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3839   echo $ac_n "(cached) $ac_c" 1>&6
3840 else
3841   ac_save_LIBS="$LIBS"
3842 LIBS="-lisode  $LIBS"
3843 cat > conftest.$ac_ext <<EOF
3844 #line 3845 "configure"
3845 #include "confdefs.h"
3846
3847 int main() {
3848 main()
3849 ; return 0; }
3850 EOF
3851 if { (eval echo configure:3852: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3852   rm -rf conftest*
3853   eval "ac_cv_lib_$ac_lib_var=yes"
3854 else
3855   echo "configure: failed program was:" >&5
3856   cat conftest.$ac_ext >&5
3857   rm -rf conftest*
3858   eval "ac_cv_lib_$ac_lib_var=no"
3859 fi
3860 rm -f conftest*
3861 LIBS="$ac_save_LIBS"
3862
3863 fi
3864 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3865   echo "$ac_t""yes" 1>&6
3866   
3867                 ol_link_isode=yes
3868                 cat >> confdefs.h <<\EOF
3869 #define HAVE_ISODE 1
3870 EOF
3871
3872                 LDAPD_LIBS="$LDAPD_LIBS -lisode"
3873                 
3874 else
3875   echo "$ac_t""no" 1>&6
3876 :
3877 fi
3878
3879 fi
3880
3881 if test $ol_link_isode != no; then
3882         echo $ac_n "checking for main in -lpp""... $ac_c" 1>&6
3883 echo "configure:3884: checking for main in -lpp" >&5
3884 ac_lib_var=`echo pp'_'main | sed 'y%./+-%__p_%'`
3885 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
3886   echo $ac_n "(cached) $ac_c" 1>&6
3887 else
3888   ac_save_LIBS="$LIBS"
3889 LIBS="-lpp  $LIBS"
3890 cat > conftest.$ac_ext <<EOF
3891 #line 3892 "configure"
3892 #include "confdefs.h"
3893
3894 int main() {
3895 main()
3896 ; return 0; }
3897 EOF
3898 if { (eval echo configure:3899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3899   rm -rf conftest*
3900   eval "ac_cv_lib_$ac_lib_var=yes"
3901 else
3902   echo "configure: failed program was:" >&5
3903   cat conftest.$ac_ext >&5
3904   rm -rf conftest*
3905   eval "ac_cv_lib_$ac_lib_var=no"
3906 fi
3907 rm -f conftest*
3908 LIBS="$ac_save_LIBS"
3909
3910 fi
3911 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3912   echo "$ac_t""yes" 1>&6
3913   
3914                 cat >> confdefs.h <<\EOF
3915 #define HAVE_PP 1
3916 EOF
3917
3918                 LDAPD_LIBS="-lpp $LDAPD_LIBS"
3919                 
3920 else
3921   echo "$ac_t""no" 1>&6
3922 :
3923 fi
3924
3925
3926         # Extract the first word of "pepsy", so it can be a program name with args.
3927 set dummy pepsy; ac_word=$2
3928 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3929 echo "configure:3930: checking for $ac_word" >&5
3930 if eval "test \"`echo '$''{'ac_cv_path_PEPSY'+set}'`\" = set"; then
3931   echo $ac_n "(cached) $ac_c" 1>&6
3932 else
3933   case "$PEPSY" in
3934   /*)
3935   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a path.
3936   ;;
3937   ?:/*)                  
3938   ac_cv_path_PEPSY="$PEPSY" # Let the user override the test with a dos path.
3939   ;;
3940   *)
3941   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3942   ac_dummy="$PATH"
3943   for ac_dir in $ac_dummy; do 
3944     test -z "$ac_dir" && ac_dir=.
3945     if test -f $ac_dir/$ac_word; then
3946       ac_cv_path_PEPSY="$ac_dir/$ac_word"
3947       break
3948     fi
3949   done
3950   IFS="$ac_save_ifs"
3951   ;;
3952 esac
3953 fi
3954 PEPSY="$ac_cv_path_PEPSY"
3955 if test -n "$PEPSY"; then
3956   echo "$ac_t""$PEPSY" 1>&6
3957 else
3958   echo "$ac_t""no" 1>&6
3959 fi
3960
3961 fi
3962
3963 ol_link_kerberos=no
3964
3965 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 ; then
3966         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
3967 do
3968 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3969 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3970 echo "configure:3971: checking for $ac_hdr" >&5
3971 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
3972   echo $ac_n "(cached) $ac_c" 1>&6
3973 else
3974   cat > conftest.$ac_ext <<EOF
3975 #line 3976 "configure"
3976 #include "confdefs.h"
3977 #include <$ac_hdr>
3978 EOF
3979 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3980 { (eval echo configure:3981: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3981 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3982 if test -z "$ac_err"; then
3983   rm -rf conftest*
3984   eval "ac_cv_header_$ac_safe=yes"
3985 else
3986   echo "$ac_err" >&5
3987   echo "configure: failed program was:" >&5
3988   cat conftest.$ac_ext >&5
3989   rm -rf conftest*
3990   eval "ac_cv_header_$ac_safe=no"
3991 fi
3992 rm -f conftest*
3993 fi
3994 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3995   echo "$ac_t""yes" 1>&6
3996     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3997   cat >> confdefs.h <<EOF
3998 #define $ac_tr_hdr 1
3999 EOF
4000  
4001 else
4002   echo "$ac_t""no" 1>&6
4003 fi
4004 done
4005
4006
4007         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
4008                 echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
4009 echo "configure:4010: checking for main in -lkrb4" >&5
4010 ac_lib_var=`echo krb4'_'main | sed 'y%./+-%__p_%'`
4011 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4012   echo $ac_n "(cached) $ac_c" 1>&6
4013 else
4014   ac_save_LIBS="$LIBS"
4015 LIBS="-lkrb4 -lkrb5 -ldes425 $LIBS"
4016 cat > conftest.$ac_ext <<EOF
4017 #line 4018 "configure"
4018 #include "confdefs.h"
4019
4020 int main() {
4021 main()
4022 ; return 0; }
4023 EOF
4024 if { (eval echo configure:4025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4025   rm -rf conftest*
4026   eval "ac_cv_lib_$ac_lib_var=yes"
4027 else
4028   echo "configure: failed program was:" >&5
4029   cat conftest.$ac_ext >&5
4030   rm -rf conftest*
4031   eval "ac_cv_lib_$ac_lib_var=no"
4032 fi
4033 rm -f conftest*
4034 LIBS="$ac_save_LIBS"
4035
4036 fi
4037 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4038   echo "$ac_t""yes" 1>&6
4039   have_k5=yes
4040 else
4041   echo "$ac_t""no" 1>&6
4042 have_k5=no
4043 fi
4044
4045
4046                 if test $have_k5 = yes ; then
4047                         ol_with_kerberos=found
4048                         ol_link_kerberos=yes
4049
4050                         KRB_LIBS="-lkrb4 -lkrb5 -ldes425"
4051
4052                         LIBS="$KRB_LIBS $LIBS"
4053
4054                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
4055 echo "configure:4056: checking for des_debug in Kerberos libraries" >&5
4056 if eval "test \"`echo '$''{'ol_cv_var_des_debug'+set}'`\" = set"; then
4057   echo $ac_n "(cached) $ac_c" 1>&6
4058 else
4059   
4060                                                                 save_LIBS="$LIBS"
4061                                 LIBS="$KRB_LIBS $LIBS"
4062                                 cat > conftest.$ac_ext <<EOF
4063 #line 4064 "configure"
4064 #include "confdefs.h"
4065
4066 #include <kerberosIV/krb.h>
4067 #include <kerberosIV/des.h>
4068 extern int des_debug;
4069
4070 int main() {
4071
4072 des_debug = 1;
4073
4074 ; return 0; }
4075 EOF
4076 if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4077   rm -rf conftest*
4078   ol_cv_var_des_debug=yes
4079 else
4080   echo "configure: failed program was:" >&5
4081   cat conftest.$ac_ext >&5
4082   rm -rf conftest*
4083   ol_cv_var_des_debug=no
4084 fi
4085 rm -f conftest*
4086                                                                 LIBS="$save_LIBS"
4087                         
4088 fi
4089
4090 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
4091
4092                         if test $ol_cv_var_des_debug = yes ; then
4093                                 cat >> confdefs.h <<\EOF
4094 #define HAVE_DES_DEBUG 1
4095 EOF
4096
4097                         fi
4098
4099                         LIBS="$save_LIBS"
4100                 fi
4101         fi
4102 fi
4103
4104 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 ; then
4105         for ac_hdr in krb.h des.h
4106 do
4107 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4108 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4109 echo "configure:4110: checking for $ac_hdr" >&5
4110 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4111   echo $ac_n "(cached) $ac_c" 1>&6
4112 else
4113   cat > conftest.$ac_ext <<EOF
4114 #line 4115 "configure"
4115 #include "confdefs.h"
4116 #include <$ac_hdr>
4117 EOF
4118 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4119 { (eval echo configure:4120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4120 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4121 if test -z "$ac_err"; then
4122   rm -rf conftest*
4123   eval "ac_cv_header_$ac_safe=yes"
4124 else
4125   echo "$ac_err" >&5
4126   echo "configure: failed program was:" >&5
4127   cat conftest.$ac_ext >&5
4128   rm -rf conftest*
4129   eval "ac_cv_header_$ac_safe=no"
4130 fi
4131 rm -f conftest*
4132 fi
4133 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4134   echo "$ac_t""yes" 1>&6
4135     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4136   cat >> confdefs.h <<EOF
4137 #define $ac_tr_hdr 1
4138 EOF
4139  
4140 else
4141   echo "$ac_t""no" 1>&6
4142 fi
4143 done
4144
4145
4146         if test $ac_cv_header_krb_h = yes ; then
4147                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
4148 echo "configure:4149: checking for main in -lkrb" >&5
4149 ac_lib_var=`echo krb'_'main | sed 'y%./+-%__p_%'`
4150 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4151   echo $ac_n "(cached) $ac_c" 1>&6
4152 else
4153   ac_save_LIBS="$LIBS"
4154 LIBS="-lkrb -ldes $LIBS"
4155 cat > conftest.$ac_ext <<EOF
4156 #line 4157 "configure"
4157 #include "confdefs.h"
4158
4159 int main() {
4160 main()
4161 ; return 0; }
4162 EOF
4163 if { (eval echo configure:4164: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4164   rm -rf conftest*
4165   eval "ac_cv_lib_$ac_lib_var=yes"
4166 else
4167   echo "configure: failed program was:" >&5
4168   cat conftest.$ac_ext >&5
4169   rm -rf conftest*
4170   eval "ac_cv_lib_$ac_lib_var=no"
4171 fi
4172 rm -f conftest*
4173 LIBS="$ac_save_LIBS"
4174
4175 fi
4176 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4177   echo "$ac_t""yes" 1>&6
4178   have_k4=yes
4179 else
4180   echo "$ac_t""no" 1>&6
4181 have_k4=no
4182 fi
4183
4184
4185                 if test $have_k4 = yes ; then
4186                         ol_with_kerberos=found
4187                         ol_link_kerberos=yes
4188
4189                         KRB_LIBS="-lkrb -ldes"
4190                 fi
4191         fi
4192 fi
4193
4194 if test $ol_link_kerberos = yes ; then
4195         cat >> confdefs.h <<\EOF
4196 #define HAVE_KERBEROS 1
4197 EOF
4198
4199 fi
4200
4201 ol_link_tls=no
4202 if test $ol_with_tls != no ; then
4203         
4204         for ac_hdr in ssl.h
4205 do
4206 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4207 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4208 echo "configure:4209: checking for $ac_hdr" >&5
4209 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4210   echo $ac_n "(cached) $ac_c" 1>&6
4211 else
4212   cat > conftest.$ac_ext <<EOF
4213 #line 4214 "configure"
4214 #include "confdefs.h"
4215 #include <$ac_hdr>
4216 EOF
4217 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4218 { (eval echo configure:4219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4219 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4220 if test -z "$ac_err"; then
4221   rm -rf conftest*
4222   eval "ac_cv_header_$ac_safe=yes"
4223 else
4224   echo "$ac_err" >&5
4225   echo "configure: failed program was:" >&5
4226   cat conftest.$ac_ext >&5
4227   rm -rf conftest*
4228   eval "ac_cv_header_$ac_safe=no"
4229 fi
4230 rm -f conftest*
4231 fi
4232 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4233   echo "$ac_t""yes" 1>&6
4234     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4235   cat >> confdefs.h <<EOF
4236 #define $ac_tr_hdr 1
4237 EOF
4238  
4239 else
4240   echo "$ac_t""no" 1>&6
4241 fi
4242 done
4243
4244         
4245         if test $ac_cv_header_ssl_h = yes ; then
4246                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
4247 echo "configure:4248: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
4248 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-%__p_%'`
4249 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4250   echo $ac_n "(cached) $ac_c" 1>&6
4251 else
4252   ac_save_LIBS="$LIBS"
4253 LIBS="-lssl -lcrypto $LIBS"
4254 cat > conftest.$ac_ext <<EOF
4255 #line 4256 "configure"
4256 #include "confdefs.h"
4257 /* Override any gcc2 internal prototype to avoid an error.  */
4258 /* We use char because int might match the return type of a gcc2
4259     builtin and then its argument prototype would still apply.  */
4260 char SSLeay_add_ssl_algorithms();
4261
4262 int main() {
4263 SSLeay_add_ssl_algorithms()
4264 ; return 0; }
4265 EOF
4266 if { (eval echo configure:4267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4267   rm -rf conftest*
4268   eval "ac_cv_lib_$ac_lib_var=yes"
4269 else
4270   echo "configure: failed program was:" >&5
4271   cat conftest.$ac_ext >&5
4272   rm -rf conftest*
4273   eval "ac_cv_lib_$ac_lib_var=no"
4274 fi
4275 rm -f conftest*
4276 LIBS="$ac_save_LIBS"
4277
4278 fi
4279 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4280   echo "$ac_t""yes" 1>&6
4281   have_ssleay=yes
4282                         need_rsaref=no
4283 else
4284   echo "$ac_t""no" 1>&6
4285 have_ssleay=no
4286 fi
4287
4288                         
4289                 if test $have_ssleay = no ; then
4290                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
4291 echo "configure:4292: checking for ssl3_accept in -lssl" >&5
4292 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-%__p_%'`
4293 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
4294   echo $ac_n "(cached) $ac_c" 1>&6
4295 else
4296   ac_save_LIBS="$LIBS"
4297 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
4298 cat > conftest.$ac_ext <<EOF
4299 #line 4300 "configure"
4300 #include "confdefs.h"
4301 /* Override any gcc2 internal prototype to avoid an error.  */
4302 /* We use char because int might match the return type of a gcc2
4303     builtin and then its argument prototype would still apply.  */
4304 char ssl3_accept();
4305
4306 int main() {
4307 ssl3_accept()
4308 ; return 0; }
4309 EOF
4310 if { (eval echo configure:4311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4311   rm -rf conftest*
4312   eval "ac_cv_lib_$ac_lib_var=yes"
4313 else
4314   echo "configure: failed program was:" >&5
4315   cat conftest.$ac_ext >&5
4316   rm -rf conftest*
4317   eval "ac_cv_lib_$ac_lib_var=no"
4318 fi
4319 rm -f conftest*
4320 LIBS="$ac_save_LIBS"
4321
4322 fi
4323 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4324   echo "$ac_t""yes" 1>&6
4325   have_ssleay=yes
4326                                 need_rsaref=yes
4327 else
4328   echo "$ac_t""no" 1>&6
4329 have_ssleay=no
4330 fi
4331
4332                 fi
4333
4334                 if test $have_ssleay = yes ; then
4335                         ol_with_tls=found
4336                         ol_link_tls=yes
4337
4338                         cat >> confdefs.h <<\EOF
4339 #define HAVE_SSLEAY 1
4340 EOF
4341
4342
4343                         if test $need_rsaref = yes; then
4344                                 cat >> confdefs.h <<\EOF
4345 #define HAVE_RSAREF 1
4346 EOF
4347
4348
4349                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
4350                         else
4351                                 TLS_LIBS="-lssl -lcrypto"
4352                         fi
4353                 fi
4354         fi
4355 fi
4356
4357 if test $ol_link_tls = yes ; then
4358         cat >> confdefs.h <<\EOF
4359 #define HAVE_TLS 1
4360 EOF
4361
4362 fi      
4363
4364 for ac_func in \
4365         ctime_r                 \
4366         gethostbyname_r gethostbyaddr_r \
4367
4368 do
4369 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
4370 echo "configure:4371: checking for $ac_func" >&5
4371 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
4372   echo $ac_n "(cached) $ac_c" 1>&6
4373 else
4374   cat > conftest.$ac_ext <<EOF
4375 #line 4376 "configure"
4376 #include "confdefs.h"
4377 /* System header to define __stub macros and hopefully few prototypes,
4378     which can conflict with char $ac_func(); below.  */
4379 #include <assert.h>
4380 /* Override any gcc2 internal prototype to avoid an error.  */
4381 /* We use char because int might match the return type of a gcc2
4382     builtin and then its argument prototype would still apply.  */
4383 char $ac_func();
4384
4385 int main() {
4386
4387 /* The GNU C library defines this for functions which it implements
4388     to always fail with ENOSYS.  Some functions are actually named
4389     something starting with __ and the normal name is an alias.  */
4390 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4391 choke me
4392 #else
4393 $ac_func();
4394 #endif
4395
4396 ; return 0; }
4397 EOF
4398 if { (eval echo configure:4399: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4399   rm -rf conftest*
4400   eval "ac_cv_func_$ac_func=yes"
4401 else
4402   echo "configure: failed program was:" >&5
4403   cat conftest.$ac_ext >&5
4404   rm -rf conftest*
4405   eval "ac_cv_func_$ac_func=no"
4406 fi
4407 rm -f conftest*
4408 fi
4409
4410 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
4411   echo "$ac_t""yes" 1>&6
4412     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
4413   cat >> confdefs.h <<EOF
4414 #define $ac_tr_func 1
4415 EOF
4416  
4417 else
4418   echo "$ac_t""no" 1>&6
4419 fi
4420 done
4421
4422
4423 if test "$ac_cv_func_ctime_r" = no ; then
4424         ol_cv_func_ctime_r_nargs=0
4425 else
4426         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
4427 echo "configure:4428: checking number of arguments of ctime_r" >&5
4428 if eval "test \"`echo '$''{'ol_cv_func_ctime_r_nargs'+set}'`\" = set"; then
4429   echo $ac_n "(cached) $ac_c" 1>&6
4430 else
4431   cat > conftest.$ac_ext <<EOF
4432 #line 4433 "configure"
4433 #include "confdefs.h"
4434 #include <time.h>
4435 int main() {
4436 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
4437 ; return 0; }
4438 EOF
4439 if { (eval echo configure:4440: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4440   rm -rf conftest*
4441   ol_cv_func_ctime_r_nargs=3
4442 else
4443   echo "configure: failed program was:" >&5
4444   cat conftest.$ac_ext >&5
4445   rm -rf conftest*
4446   cat > conftest.$ac_ext <<EOF
4447 #line 4448 "configure"
4448 #include "confdefs.h"
4449 #include <time.h>
4450 int main() {
4451 time_t ti; char *buffer; ctime_r(&ti,buffer);
4452 ; return 0; }
4453 EOF
4454 if { (eval echo configure:4455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4455   rm -rf conftest*
4456   ol_cv_func_ctime_r_nargs=2
4457 else
4458   echo "configure: failed program was:" >&5
4459   cat conftest.$ac_ext >&5
4460   rm -rf conftest*
4461   ol_cv_func_ctime_r_nargs=0
4462 fi
4463 rm -f conftest*
4464 fi
4465 rm -f conftest*
4466 fi
4467
4468 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
4469   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
4470     cat >> confdefs.h <<EOF
4471 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
4472 EOF
4473
4474   fi
4475
4476 fi
4477
4478 if test "$ac_cv_func_gethostbyname_r" = yes ; then
4479         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
4480 echo "configure:4481: checking number of arguments of gethostbyname_r" >&5
4481 if eval "test \"`echo '$''{'ol_cv_func_gethostbyname_r_nargs'+set}'`\" = set"; then
4482   echo $ac_n "(cached) $ac_c" 1>&6
4483 else
4484   cat > conftest.$ac_ext <<EOF
4485 #line 4486 "configure"
4486 #include "confdefs.h"
4487 #include <sys/types.h>
4488 #include <sys/socket.h>
4489 #include <netinet/in.h>
4490 #include <netdb.h>
4491 #define BUFSIZE (sizeof(struct hostent)+10)
4492 int main() {
4493 struct hostent hent; char buffer[BUFSIZE];
4494                 int bufsize=BUFSIZE;int h_errno;
4495                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
4496                         buffer, bufsize, &h_errno);
4497 ; return 0; }
4498 EOF
4499 if { (eval echo configure:4500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4500   rm -rf conftest*
4501   ol_cv_func_gethostbyname_r_nargs=5
4502 else
4503   echo "configure: failed program was:" >&5
4504   cat conftest.$ac_ext >&5
4505   rm -rf conftest*
4506   cat > conftest.$ac_ext <<EOF
4507 #line 4508 "configure"
4508 #include "confdefs.h"
4509 #include <sys/types.h>
4510 #include <sys/socket.h>
4511 #include <netinet/in.h>
4512 #include <netdb.h>
4513 #define BUFSIZE (sizeof(struct hostent)+10)
4514 int main() {
4515 struct hostent hent;struct hostent *rhent;
4516                         char buffer[BUFSIZE];
4517                         int bufsize=BUFSIZE;int h_errno;
4518                         (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
4519                                 &rhent, &h_errno);
4520 ; return 0; }
4521 EOF
4522 if { (eval echo configure:4523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4523   rm -rf conftest*
4524   ol_cv_func_gethostbyname_r_nargs=6
4525 else
4526   echo "configure: failed program was:" >&5
4527   cat conftest.$ac_ext >&5
4528   rm -rf conftest*
4529   ol_cv_func_gethostbyname_r_nargs=0
4530 fi
4531 rm -f conftest*
4532 fi
4533 rm -f conftest*
4534 fi
4535
4536 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
4537   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
4538         cat >> confdefs.h <<EOF
4539 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
4540 EOF
4541
4542   fi
4543
4544 else
4545         ol_cv_func_gethostbyname_r_nargs=0
4546 fi
4547  
4548 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
4549         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
4550 echo "configure:4551: checking number of arguments of gethostbyaddr_r" >&5
4551 if eval "test \"`echo '$''{'ol_cv_func_gethostbyaddr_r_nargs'+set}'`\" = set"; then
4552   echo $ac_n "(cached) $ac_c" 1>&6
4553 else
4554   cat > conftest.$ac_ext <<EOF
4555 #line 4556 "configure"
4556 #include "confdefs.h"
4557 #include <sys/types.h>
4558 #include <sys/socket.h>
4559 #include <netinet/in.h>
4560 #include <netdb.h>
4561 #define BUFSIZE (sizeof(struct hostent)+10)
4562 int main() {
4563 struct hostent hent; char buffer[BUFSIZE]; 
4564             struct in_addr add;
4565             size_t alen=sizeof(struct in_addr);
4566             int bufsize=BUFSIZE;int h_errno;
4567                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
4568                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
4569 ; return 0; }
4570 EOF
4571 if { (eval echo configure:4572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4572   rm -rf conftest*
4573   ol_cv_func_gethostbyaddr_r_nargs=7
4574 else
4575   echo "configure: failed program was:" >&5
4576   cat conftest.$ac_ext >&5
4577   rm -rf conftest*
4578   cat > conftest.$ac_ext <<EOF
4579 #line 4580 "configure"
4580 #include "confdefs.h"
4581 #include <sys/types.h>
4582 #include <sys/socket.h>
4583 #include <netinet/in.h>
4584 #include <netdb.h>
4585 #define BUFSIZE (sizeof(struct hostent)+10)
4586 int main() {
4587 struct hostent hent;
4588                         struct hostent *rhent; char buffer[BUFSIZE]; 
4589                         struct in_addr add;
4590                         size_t alen=sizeof(struct in_addr);
4591                         int bufsize=BUFSIZE;int h_errno;
4592                         (void)gethostbyaddr_r( (void *)&(add.s_addr),
4593                                 alen, AF_INET, &hent, buffer, bufsize, 
4594                                 &rhent, &h_errno);
4595 ; return 0; }
4596 EOF
4597 if { (eval echo configure:4598: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4598   rm -rf conftest*
4599   ol_cv_func_gethostbyaddr_r_nargs=8
4600 else
4601   echo "configure: failed program was:" >&5
4602   cat conftest.$ac_ext >&5
4603   rm -rf conftest*
4604   ol_cv_func_gethostbyaddr_r_nargs=0
4605 fi
4606 rm -f conftest*
4607 fi
4608 rm -f conftest*
4609 fi
4610
4611 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
4612   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
4613     cat >> confdefs.h <<EOF
4614 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
4615 EOF
4616
4617   fi
4618
4619 else
4620         ol_cv_func_gethostbyaddr_r_nargs=0
4621 fi
4622
4623 if test "$ac_cv_func_ctime_r" = yes \
4624         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
4625         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
4626         -a "$ac_cv_func_gethostbyname_r" = yes \
4627         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
4628         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
4629         -a "$ac_cv_func_gethostbyaddr_r" = yes \
4630         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
4631         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
4632         ; then
4633  
4634         cat >> confdefs.h <<\EOF
4635 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
4636 EOF
4637
4638 fi
4639
4640 ol_link_threads=no
4641 if test $ol_with_threads = auto -o $ol_with_threads = yes \
4642         -o $ol_with_threads = posix ; then
4643
4644         for ac_hdr in pthread.h sched.h
4645 do
4646 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4647 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4648 echo "configure:4649: checking for $ac_hdr" >&5
4649 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
4650   echo $ac_n "(cached) $ac_c" 1>&6
4651 else
4652   cat > conftest.$ac_ext <<EOF
4653 #line 4654 "configure"
4654 #include "confdefs.h"
4655 #include <$ac_hdr>
4656 EOF
4657 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4658 { (eval echo configure:4659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4659 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4660 if test -z "$ac_err"; then
4661   rm -rf conftest*
4662   eval "ac_cv_header_$ac_safe=yes"
4663 else
4664   echo "$ac_err" >&5
4665   echo "configure: failed program was:" >&5
4666   cat conftest.$ac_ext >&5
4667   rm -rf conftest*
4668   eval "ac_cv_header_$ac_safe=no"
4669 fi
4670 rm -f conftest*
4671 fi
4672 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4673   echo "$ac_t""yes" 1>&6
4674     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4675   cat >> confdefs.h <<EOF
4676 #define $ac_tr_hdr 1
4677 EOF
4678  
4679 else
4680   echo "$ac_t""no" 1>&6
4681 fi
4682 done
4683
4684
4685         if test $ac_cv_header_pthread_h = yes ; then
4686                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
4687 echo "configure:4688: checking POSIX thread version" >&5
4688 if eval "test \"`echo '$''{'ol_cv_pthread_version'+set}'`\" = set"; then
4689   echo $ac_n "(cached) $ac_c" 1>&6
4690 else
4691   
4692         cat > conftest.$ac_ext <<EOF
4693 #line 4694 "configure"
4694 #include "confdefs.h"
4695
4696 #               include <pthread.h>
4697                 /* this check could be improved */
4698 #               ifdef PTHREAD_ONCE_INIT
4699                         pthread_version_final
4700 #               endif
4701         
4702 EOF
4703 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4704   egrep "pthread_version_final" >/dev/null 2>&1; then
4705   rm -rf conftest*
4706   ol_pthread_final=yes
4707 else
4708   rm -rf conftest*
4709   ol_pthread_final=no
4710 fi
4711 rm -f conftest*
4712
4713
4714         cat > conftest.$ac_ext <<EOF
4715 #line 4716 "configure"
4716 #include "confdefs.h"
4717
4718 #               include <pthread.h>
4719                 /* this check could be improved */
4720 #               ifdef pthread_once_init
4721                         pthread_version_draft4
4722 #               endif
4723         
4724 EOF
4725 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4726   egrep "pthread_version_draft4" >/dev/null 2>&1; then
4727   rm -rf conftest*
4728   ol_pthread_draft4=yes
4729 else
4730   rm -rf conftest*
4731   ol_pthread_draft4=no
4732 fi
4733 rm -f conftest*
4734
4735
4736         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
4737                 ol_cv_pthread_version=final
4738         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
4739                 ol_cv_pthread_version=draft4
4740         else
4741                 ol_cv_pthread_version=unknown
4742         fi
4743
4744 fi
4745
4746 echo "$ac_t""$ol_cv_pthread_version" 1>&6
4747
4748
4749                 if test $ol_cv_pthread_version = final ; then
4750                         cat >> confdefs.h <<\EOF
4751 #define HAVE_PTHREADS_FINAL 1
4752 EOF
4753
4754                 elif test $ol_cv_pthread_version = draft4 ; then
4755                         cat >> confdefs.h <<\EOF
4756 #define HAVE_PTHREADS_D4 1
4757 EOF
4758
4759                 else
4760                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
4761                 fi
4762
4763                 # consider threads found
4764                 ol_with_threads=found
4765
4766                 
4767         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
4768 echo "configure:4769: checking for LinuxThreads pthread.h" >&5
4769 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
4770   echo $ac_n "(cached) $ac_c" 1>&6
4771 else
4772   cat > conftest.$ac_ext <<EOF
4773 #line 4774 "configure"
4774 #include "confdefs.h"
4775 #include <pthread.h>
4776 EOF
4777 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4778   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
4779   rm -rf conftest*
4780   ol_cv_header_linux_threads=yes
4781 else
4782   rm -rf conftest*
4783   ol_cv_header_linux_threads=no
4784 fi
4785 rm -f conftest*
4786
4787                 
4788 fi
4789
4790 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
4791         if test $ol_cv_header_linux_threads = yes; then
4792                 cat >> confdefs.h <<\EOF
4793 #define HAVE_LINUX_THREADS 1
4794 EOF
4795
4796         fi
4797
4798
4799                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
4800                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
4801 echo "configure:4802: checking for pthread_create in default libraries" >&5
4802                 if eval "test \"`echo '$''{'ol_cv_pthread_create'+set}'`\" = set"; then
4803   echo $ac_n "(cached) $ac_c" 1>&6
4804 else
4805   
4806                 if test "$cross_compiling" = yes; then
4807                         ol_cv_pthread_create=yes
4808 else
4809   cat > conftest.$ac_ext <<EOF
4810 #line 4811 "configure"
4811 #include "confdefs.h"
4812
4813 #include <pthread.h>
4814 #ifndef NULL
4815 #define NULL (void*)0
4816 #endif
4817
4818 static void *task(p)
4819         void *p;
4820 {
4821         return (void *) (p == NULL);
4822 }
4823
4824 int main(argc, argv)
4825         int argc;
4826         char **argv;
4827 {
4828         pthread_t t;
4829         int status;
4830
4831         /* make sure pthread_create() isn't just a stub */
4832 #if HAVE_PTHREADS_D4
4833         status = pthread_create(&t, pthread_attr_default, task, NULL);
4834 #else
4835         status = pthread_create(&t, NULL, task, NULL);
4836 #endif
4837
4838         if( status ) return status;
4839
4840         /* make sure pthread_detach() isn't just a stub */
4841 #if HAVE_PTHREADS_D4
4842         status = pthread_detach( &t );
4843 #else
4844         status = pthread_detach( t );
4845 #endif
4846
4847         if( status ) return status;
4848
4849         return status;
4850 }
4851
4852 EOF
4853 if { (eval echo configure:4854: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4854 then
4855   ol_cv_pthread_create=yes
4856 else
4857   echo "configure: failed program was:" >&5
4858   cat conftest.$ac_ext >&5
4859   rm -fr conftest*
4860   ol_cv_pthread_create=no
4861 fi
4862 rm -fr conftest*
4863 fi
4864
4865 fi
4866
4867                 echo "$ac_t""$ol_cv_pthread_create" 1>&6
4868
4869                 if test $ol_cv_pthread_create != no ; then
4870                         ol_link_threads=posix
4871                         ol_link_pthreads=""
4872                 fi
4873                 
4874                 # Pthread try link: -mt (ol_cv_pthread_mt)
4875         if test "$ol_link_threads" = no ; then
4876                 # try -mt
4877                 echo $ac_n "checking for pthread link with -mt""... $ac_c" 1>&6
4878 echo "configure:4879: checking for pthread link with -mt" >&5
4879 if eval "test \"`echo '$''{'ol_cv_pthread_mt'+set}'`\" = set"; then
4880   echo $ac_n "(cached) $ac_c" 1>&6
4881 else
4882   
4883                         # save the flags
4884                         ol_LIBS="$LIBS"
4885                         LIBS="-mt $LIBS"
4886
4887                         cat > conftest.$ac_ext <<EOF
4888 #line 4889 "configure"
4889 #include "confdefs.h"
4890
4891 #include <pthread.h>
4892 #ifndef NULL
4893 #define NULL (void*)0
4894 #endif
4895
4896 int main() {
4897
4898         pthread_t t;
4899
4900 #if HAVE_PTHREADS_D4
4901         pthread_create(&t, pthread_attr_default, NULL, NULL);
4902         pthread_detach( &t );
4903 #else
4904         pthread_create(&t, NULL, NULL, NULL);
4905         pthread_detach( t );
4906 #endif
4907 #ifdef HAVE_LINUX_THREADS
4908         pthread_kill_other_threads_np();
4909 #endif
4910
4911 ; return 0; }
4912 EOF
4913 if { (eval echo configure:4914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4914   rm -rf conftest*
4915   ol_cv_pthread_mt=yes
4916 else
4917   echo "configure: failed program was:" >&5
4918   cat conftest.$ac_ext >&5
4919   rm -rf conftest*
4920   ol_cv_pthread_mt=no
4921 fi
4922 rm -f conftest*
4923
4924                 # restore the LIBS
4925                 LIBS="$ol_LIBS"
4926                 
4927 fi
4928
4929 echo "$ac_t""$ol_cv_pthread_mt" 1>&6
4930
4931                 if test $ol_cv_pthread_mt = yes ; then
4932                         ol_link_pthreads="-mt"
4933                         ol_link_threads=posix
4934                 fi
4935         fi
4936
4937                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
4938         if test "$ol_link_threads" = no ; then
4939                 # try -kthread
4940                 echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
4941 echo "configure:4942: checking for pthread link with -kthread" >&5
4942 if eval "test \"`echo '$''{'ol_cv_pthread_kthread'+set}'`\" = set"; then
4943   echo $ac_n "(cached) $ac_c" 1>&6
4944 else
4945   
4946                         # save the flags
4947                         ol_LIBS="$LIBS"
4948                         LIBS="-kthread $LIBS"
4949
4950                         cat > conftest.$ac_ext <<EOF
4951 #line 4952 "configure"
4952 #include "confdefs.h"
4953
4954 #include <pthread.h>
4955 #ifndef NULL
4956 #define NULL (void*)0
4957 #endif
4958
4959 int main() {
4960
4961         pthread_t t;
4962
4963 #if HAVE_PTHREADS_D4
4964         pthread_create(&t, pthread_attr_default, NULL, NULL);
4965         pthread_detach( &t );
4966 #else
4967         pthread_create(&t, NULL, NULL, NULL);
4968         pthread_detach( t );
4969 #endif
4970 #ifdef HAVE_LINUX_THREADS
4971         pthread_kill_other_threads_np();
4972 #endif
4973
4974 ; return 0; }
4975 EOF
4976 if { (eval echo configure:4977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4977   rm -rf conftest*
4978   ol_cv_pthread_kthread=yes
4979 else
4980   echo "configure: failed program was:" >&5
4981   cat conftest.$ac_ext >&5
4982   rm -rf conftest*
4983   ol_cv_pthread_kthread=no
4984 fi
4985 rm -f conftest*
4986
4987                 # restore the LIBS
4988                 LIBS="$ol_LIBS"
4989                 
4990 fi
4991
4992 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
4993
4994                 if test $ol_cv_pthread_kthread = yes ; then
4995                         ol_link_pthreads="-kthread"
4996                         ol_link_threads=posix
4997                 fi
4998         fi
4999
5000                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
5001         if test "$ol_link_threads" = no ; then
5002                 # try -pthread
5003                 echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
5004 echo "configure:5005: checking for pthread link with -pthread" >&5
5005 if eval "test \"`echo '$''{'ol_cv_pthread_pthread'+set}'`\" = set"; then
5006   echo $ac_n "(cached) $ac_c" 1>&6
5007 else
5008   
5009                         # save the flags
5010                         ol_LIBS="$LIBS"
5011                         LIBS="-pthread $LIBS"
5012
5013                         cat > conftest.$ac_ext <<EOF
5014 #line 5015 "configure"
5015 #include "confdefs.h"
5016
5017 #include <pthread.h>
5018 #ifndef NULL
5019 #define NULL (void*)0
5020 #endif
5021
5022 int main() {
5023
5024         pthread_t t;
5025
5026 #if HAVE_PTHREADS_D4
5027         pthread_create(&t, pthread_attr_default, NULL, NULL);
5028         pthread_detach( &t );
5029 #else
5030         pthread_create(&t, NULL, NULL, NULL);
5031         pthread_detach( t );
5032 #endif
5033 #ifdef HAVE_LINUX_THREADS
5034         pthread_kill_other_threads_np();
5035 #endif
5036
5037 ; return 0; }
5038 EOF
5039 if { (eval echo configure:5040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5040   rm -rf conftest*
5041   ol_cv_pthread_pthread=yes
5042 else
5043   echo "configure: failed program was:" >&5
5044   cat conftest.$ac_ext >&5
5045   rm -rf conftest*
5046   ol_cv_pthread_pthread=no
5047 fi
5048 rm -f conftest*
5049
5050                 # restore the LIBS
5051                 LIBS="$ol_LIBS"
5052                 
5053 fi
5054
5055 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
5056
5057                 if test $ol_cv_pthread_pthread = yes ; then
5058                         ol_link_pthreads="-pthread"
5059                         ol_link_threads=posix
5060                 fi
5061         fi
5062
5063                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
5064         if test "$ol_link_threads" = no ; then
5065                 # try -pthreads
5066                 echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
5067 echo "configure:5068: checking for pthread link with -pthreads" >&5
5068 if eval "test \"`echo '$''{'ol_cv_pthread_pthreads'+set}'`\" = set"; then
5069   echo $ac_n "(cached) $ac_c" 1>&6
5070 else
5071   
5072                         # save the flags
5073                         ol_LIBS="$LIBS"
5074                         LIBS="-pthreads $LIBS"
5075
5076                         cat > conftest.$ac_ext <<EOF
5077 #line 5078 "configure"
5078 #include "confdefs.h"
5079
5080 #include <pthread.h>
5081 #ifndef NULL
5082 #define NULL (void*)0
5083 #endif
5084
5085 int main() {
5086
5087         pthread_t t;
5088
5089 #if HAVE_PTHREADS_D4
5090         pthread_create(&t, pthread_attr_default, NULL, NULL);
5091         pthread_detach( &t );
5092 #else
5093         pthread_create(&t, NULL, NULL, NULL);
5094         pthread_detach( t );
5095 #endif
5096 #ifdef HAVE_LINUX_THREADS
5097         pthread_kill_other_threads_np();
5098 #endif
5099
5100 ; return 0; }
5101 EOF
5102 if { (eval echo configure:5103: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5103   rm -rf conftest*
5104   ol_cv_pthread_pthreads=yes
5105 else
5106   echo "configure: failed program was:" >&5
5107   cat conftest.$ac_ext >&5
5108   rm -rf conftest*
5109   ol_cv_pthread_pthreads=no
5110 fi
5111 rm -f conftest*
5112
5113                 # restore the LIBS
5114                 LIBS="$ol_LIBS"
5115                 
5116 fi
5117
5118 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
5119
5120                 if test $ol_cv_pthread_pthreads = yes ; then
5121                         ol_link_pthreads="-pthreads"
5122                         ol_link_threads=posix
5123                 fi
5124         fi
5125
5126                 # Pthread try link: -thread (ol_cv_pthread_thread)
5127         if test "$ol_link_threads" = no ; then
5128                 # try -thread
5129                 echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
5130 echo "configure:5131: checking for pthread link with -thread" >&5
5131 if eval "test \"`echo '$''{'ol_cv_pthread_thread'+set}'`\" = set"; then
5132   echo $ac_n "(cached) $ac_c" 1>&6
5133 else
5134   
5135                         # save the flags
5136                         ol_LIBS="$LIBS"
5137                         LIBS="-thread $LIBS"
5138
5139                         cat > conftest.$ac_ext <<EOF
5140 #line 5141 "configure"
5141 #include "confdefs.h"
5142
5143 #include <pthread.h>
5144 #ifndef NULL
5145 #define NULL (void*)0
5146 #endif
5147
5148 int main() {
5149
5150         pthread_t t;
5151
5152 #if HAVE_PTHREADS_D4
5153         pthread_create(&t, pthread_attr_default, NULL, NULL);
5154         pthread_detach( &t );
5155 #else
5156         pthread_create(&t, NULL, NULL, NULL);
5157         pthread_detach( t );
5158 #endif
5159 #ifdef HAVE_LINUX_THREADS
5160         pthread_kill_other_threads_np();
5161 #endif
5162
5163 ; return 0; }
5164 EOF
5165 if { (eval echo configure:5166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5166   rm -rf conftest*
5167   ol_cv_pthread_thread=yes
5168 else
5169   echo "configure: failed program was:" >&5
5170   cat conftest.$ac_ext >&5
5171   rm -rf conftest*
5172   ol_cv_pthread_thread=no
5173 fi
5174 rm -f conftest*
5175
5176                 # restore the LIBS
5177                 LIBS="$ol_LIBS"
5178                 
5179 fi
5180
5181 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
5182
5183                 if test $ol_cv_pthread_thread = yes ; then
5184                         ol_link_pthreads="-thread"
5185                         ol_link_threads=posix
5186                 fi
5187         fi
5188
5189
5190                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
5191         if test "$ol_link_threads" = no ; then
5192                 # try -lpthread -lmach -lexc -lc_r
5193                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
5194 echo "configure:5195: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
5195 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc_lc_r'+set}'`\" = set"; then
5196   echo $ac_n "(cached) $ac_c" 1>&6
5197 else
5198   
5199                         # save the flags
5200                         ol_LIBS="$LIBS"
5201                         LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
5202
5203                         cat > conftest.$ac_ext <<EOF
5204 #line 5205 "configure"
5205 #include "confdefs.h"
5206
5207 #include <pthread.h>
5208 #ifndef NULL
5209 #define NULL (void*)0
5210 #endif
5211
5212 int main() {
5213
5214         pthread_t t;
5215
5216 #if HAVE_PTHREADS_D4
5217         pthread_create(&t, pthread_attr_default, NULL, NULL);
5218         pthread_detach( &t );
5219 #else
5220         pthread_create(&t, NULL, NULL, NULL);
5221         pthread_detach( t );
5222 #endif
5223 #ifdef HAVE_LINUX_THREADS
5224         pthread_kill_other_threads_np();
5225 #endif
5226
5227 ; return 0; }
5228 EOF
5229 if { (eval echo configure:5230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5230   rm -rf conftest*
5231   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
5232 else
5233   echo "configure: failed program was:" >&5
5234   cat conftest.$ac_ext >&5
5235   rm -rf conftest*
5236   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
5237 fi
5238 rm -f conftest*
5239
5240                 # restore the LIBS
5241                 LIBS="$ol_LIBS"
5242                 
5243 fi
5244
5245 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
5246
5247                 if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
5248                         ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
5249                         ol_link_threads=posix
5250                 fi
5251         fi
5252
5253                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
5254         if test "$ol_link_threads" = no ; then
5255                 # try -lpthread -lmach -lexc
5256                 echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
5257 echo "configure:5258: checking for pthread link with -lpthread -lmach -lexc" >&5
5258 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread_lmach_lexc'+set}'`\" = set"; then
5259   echo $ac_n "(cached) $ac_c" 1>&6
5260 else
5261   
5262                         # save the flags
5263                         ol_LIBS="$LIBS"
5264                         LIBS="-lpthread -lmach -lexc $LIBS"
5265
5266                         cat > conftest.$ac_ext <<EOF
5267 #line 5268 "configure"
5268 #include "confdefs.h"
5269
5270 #include <pthread.h>
5271 #ifndef NULL
5272 #define NULL (void*)0
5273 #endif
5274
5275 int main() {
5276
5277         pthread_t t;
5278
5279 #if HAVE_PTHREADS_D4
5280         pthread_create(&t, pthread_attr_default, NULL, NULL);
5281         pthread_detach( &t );
5282 #else
5283         pthread_create(&t, NULL, NULL, NULL);
5284         pthread_detach( t );
5285 #endif
5286 #ifdef HAVE_LINUX_THREADS
5287         pthread_kill_other_threads_np();
5288 #endif
5289
5290 ; return 0; }
5291 EOF
5292 if { (eval echo configure:5293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5293   rm -rf conftest*
5294   ol_cv_pthread_lpthread_lmach_lexc=yes
5295 else
5296   echo "configure: failed program was:" >&5
5297   cat conftest.$ac_ext >&5
5298   rm -rf conftest*
5299   ol_cv_pthread_lpthread_lmach_lexc=no
5300 fi
5301 rm -f conftest*
5302
5303                 # restore the LIBS
5304                 LIBS="$ol_LIBS"
5305                 
5306 fi
5307
5308 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
5309
5310                 if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
5311                         ol_link_pthreads="-lpthread -lmach -lexc"
5312                         ol_link_threads=posix
5313                 fi
5314         fi
5315
5316
5317                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
5318         if test "$ol_link_threads" = no ; then
5319                 # try -lpthread -Wl,-woff,85
5320                 echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
5321 echo "configure:5322: checking for pthread link with -lpthread -Wl,-woff,85" >&5
5322 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthread_woff'+set}'`\" = set"; then
5323   echo $ac_n "(cached) $ac_c" 1>&6
5324 else
5325   
5326                         # save the flags
5327                         ol_LIBS="$LIBS"
5328                         LIBS="-lpthread -Wl,-woff,85 $LIBS"
5329
5330                         cat > conftest.$ac_ext <<EOF
5331 #line 5332 "configure"
5332 #include "confdefs.h"
5333
5334 #include <pthread.h>
5335 #ifndef NULL
5336 #define NULL (void*)0
5337 #endif
5338
5339 int main() {
5340
5341         pthread_t t;
5342
5343 #if HAVE_PTHREADS_D4
5344         pthread_create(&t, pthread_attr_default, NULL, NULL);
5345         pthread_detach( &t );
5346 #else
5347         pthread_create(&t, NULL, NULL, NULL);
5348         pthread_detach( t );
5349 #endif
5350 #ifdef HAVE_LINUX_THREADS
5351         pthread_kill_other_threads_np();
5352 #endif
5353
5354 ; return 0; }
5355 EOF
5356 if { (eval echo configure:5357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5357   rm -rf conftest*
5358   ol_cv_pthread_lib_lpthread_woff=yes
5359 else
5360   echo "configure: failed program was:" >&5
5361   cat conftest.$ac_ext >&5
5362   rm -rf conftest*
5363   ol_cv_pthread_lib_lpthread_woff=no
5364 fi
5365 rm -f conftest*
5366
5367                 # restore the LIBS
5368                 LIBS="$ol_LIBS"
5369                 
5370 fi
5371
5372 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
5373
5374                 if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
5375                         ol_link_pthreads="-lpthread -Wl,-woff,85"
5376                         ol_link_threads=posix
5377                 fi
5378         fi
5379
5380
5381                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
5382         if test "$ol_link_threads" = no ; then
5383                 # try -lpthread
5384                 echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
5385 echo "configure:5386: checking for pthread link with -lpthread" >&5
5386 if eval "test \"`echo '$''{'ol_cv_pthread_lpthread'+set}'`\" = set"; then
5387   echo $ac_n "(cached) $ac_c" 1>&6
5388 else
5389   
5390                         # save the flags
5391                         ol_LIBS="$LIBS"
5392                         LIBS="-lpthread $LIBS"
5393
5394                         cat > conftest.$ac_ext <<EOF
5395 #line 5396 "configure"
5396 #include "confdefs.h"
5397
5398 #include <pthread.h>
5399 #ifndef NULL
5400 #define NULL (void*)0
5401 #endif
5402
5403 int main() {
5404
5405         pthread_t t;
5406
5407 #if HAVE_PTHREADS_D4
5408         pthread_create(&t, pthread_attr_default, NULL, NULL);
5409         pthread_detach( &t );
5410 #else
5411         pthread_create(&t, NULL, NULL, NULL);
5412         pthread_detach( t );
5413 #endif
5414 #ifdef HAVE_LINUX_THREADS
5415         pthread_kill_other_threads_np();
5416 #endif
5417
5418 ; return 0; }
5419 EOF
5420 if { (eval echo configure:5421: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5421   rm -rf conftest*
5422   ol_cv_pthread_lpthread=yes
5423 else
5424   echo "configure: failed program was:" >&5
5425   cat conftest.$ac_ext >&5
5426   rm -rf conftest*
5427   ol_cv_pthread_lpthread=no
5428 fi
5429 rm -f conftest*
5430
5431                 # restore the LIBS
5432                 LIBS="$ol_LIBS"
5433                 
5434 fi
5435
5436 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
5437
5438                 if test $ol_cv_pthread_lpthread = yes ; then
5439                         ol_link_pthreads="-lpthread"
5440                         ol_link_threads=posix
5441                 fi
5442         fi
5443
5444                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
5445         if test "$ol_link_threads" = no ; then
5446                 # try -lc_r
5447                 echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
5448 echo "configure:5449: checking for pthread link with -lc_r" >&5
5449 if eval "test \"`echo '$''{'ol_cv_pthread_lc_r'+set}'`\" = set"; then
5450   echo $ac_n "(cached) $ac_c" 1>&6
5451 else
5452   
5453                         # save the flags
5454                         ol_LIBS="$LIBS"
5455                         LIBS="-lc_r $LIBS"
5456
5457                         cat > conftest.$ac_ext <<EOF
5458 #line 5459 "configure"
5459 #include "confdefs.h"
5460
5461 #include <pthread.h>
5462 #ifndef NULL
5463 #define NULL (void*)0
5464 #endif
5465
5466 int main() {
5467
5468         pthread_t t;
5469
5470 #if HAVE_PTHREADS_D4
5471         pthread_create(&t, pthread_attr_default, NULL, NULL);
5472         pthread_detach( &t );
5473 #else
5474         pthread_create(&t, NULL, NULL, NULL);
5475         pthread_detach( t );
5476 #endif
5477 #ifdef HAVE_LINUX_THREADS
5478         pthread_kill_other_threads_np();
5479 #endif
5480
5481 ; return 0; }
5482 EOF
5483 if { (eval echo configure:5484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5484   rm -rf conftest*
5485   ol_cv_pthread_lc_r=yes
5486 else
5487   echo "configure: failed program was:" >&5
5488   cat conftest.$ac_ext >&5
5489   rm -rf conftest*
5490   ol_cv_pthread_lc_r=no
5491 fi
5492 rm -f conftest*
5493
5494                 # restore the LIBS
5495                 LIBS="$ol_LIBS"
5496                 
5497 fi
5498
5499 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
5500
5501                 if test $ol_cv_pthread_lc_r = yes ; then
5502                         ol_link_pthreads="-lc_r"
5503                         ol_link_threads=posix
5504                 fi
5505         fi
5506
5507
5508                 # Pthread try link: -threads (ol_cv_pthread_threads)
5509         if test "$ol_link_threads" = no ; then
5510                 # try -threads
5511                 echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
5512 echo "configure:5513: checking for pthread link with -threads" >&5
5513 if eval "test \"`echo '$''{'ol_cv_pthread_threads'+set}'`\" = set"; then
5514   echo $ac_n "(cached) $ac_c" 1>&6
5515 else
5516   
5517                         # save the flags
5518                         ol_LIBS="$LIBS"
5519                         LIBS="-threads $LIBS"
5520
5521                         cat > conftest.$ac_ext <<EOF
5522 #line 5523 "configure"
5523 #include "confdefs.h"
5524
5525 #include <pthread.h>
5526 #ifndef NULL
5527 #define NULL (void*)0
5528 #endif
5529
5530 int main() {
5531
5532         pthread_t t;
5533
5534 #if HAVE_PTHREADS_D4
5535         pthread_create(&t, pthread_attr_default, NULL, NULL);
5536         pthread_detach( &t );
5537 #else
5538         pthread_create(&t, NULL, NULL, NULL);
5539         pthread_detach( t );
5540 #endif
5541 #ifdef HAVE_LINUX_THREADS
5542         pthread_kill_other_threads_np();
5543 #endif
5544
5545 ; return 0; }
5546 EOF
5547 if { (eval echo configure:5548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5548   rm -rf conftest*
5549   ol_cv_pthread_threads=yes
5550 else
5551   echo "configure: failed program was:" >&5
5552   cat conftest.$ac_ext >&5
5553   rm -rf conftest*
5554   ol_cv_pthread_threads=no
5555 fi
5556 rm -f conftest*
5557
5558                 # restore the LIBS
5559                 LIBS="$ol_LIBS"
5560                 
5561 fi
5562
5563 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
5564
5565                 if test $ol_cv_pthread_threads = yes ; then
5566                         ol_link_pthreads="-threads"
5567                         ol_link_threads=posix
5568                 fi
5569         fi
5570
5571
5572                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
5573         if test "$ol_link_threads" = no ; then
5574                 # try -lpthreads -lmach -lexc -lc_r
5575                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
5576 echo "configure:5577: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
5577 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc_lc_r'+set}'`\" = set"; then
5578   echo $ac_n "(cached) $ac_c" 1>&6
5579 else
5580   
5581                         # save the flags
5582                         ol_LIBS="$LIBS"
5583                         LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
5584
5585                         cat > conftest.$ac_ext <<EOF
5586 #line 5587 "configure"
5587 #include "confdefs.h"
5588
5589 #include <pthread.h>
5590 #ifndef NULL
5591 #define NULL (void*)0
5592 #endif
5593
5594 int main() {
5595
5596         pthread_t t;
5597
5598 #if HAVE_PTHREADS_D4
5599         pthread_create(&t, pthread_attr_default, NULL, NULL);
5600         pthread_detach( &t );
5601 #else
5602         pthread_create(&t, NULL, NULL, NULL);
5603         pthread_detach( t );
5604 #endif
5605 #ifdef HAVE_LINUX_THREADS
5606         pthread_kill_other_threads_np();
5607 #endif
5608
5609 ; return 0; }
5610 EOF
5611 if { (eval echo configure:5612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5612   rm -rf conftest*
5613   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
5614 else
5615   echo "configure: failed program was:" >&5
5616   cat conftest.$ac_ext >&5
5617   rm -rf conftest*
5618   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
5619 fi
5620 rm -f conftest*
5621
5622                 # restore the LIBS
5623                 LIBS="$ol_LIBS"
5624                 
5625 fi
5626
5627 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
5628
5629                 if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
5630                         ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
5631                         ol_link_threads=posix
5632                 fi
5633         fi
5634
5635                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
5636         if test "$ol_link_threads" = no ; then
5637                 # try -lpthreads -lmach -lexc
5638                 echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
5639 echo "configure:5640: checking for pthread link with -lpthreads -lmach -lexc" >&5
5640 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lmach_lexc'+set}'`\" = set"; then
5641   echo $ac_n "(cached) $ac_c" 1>&6
5642 else
5643   
5644                         # save the flags
5645                         ol_LIBS="$LIBS"
5646                         LIBS="-lpthreads -lmach -lexc $LIBS"
5647
5648                         cat > conftest.$ac_ext <<EOF
5649 #line 5650 "configure"
5650 #include "confdefs.h"
5651
5652 #include <pthread.h>
5653 #ifndef NULL
5654 #define NULL (void*)0
5655 #endif
5656
5657 int main() {
5658
5659         pthread_t t;
5660
5661 #if HAVE_PTHREADS_D4
5662         pthread_create(&t, pthread_attr_default, NULL, NULL);
5663         pthread_detach( &t );
5664 #else
5665         pthread_create(&t, NULL, NULL, NULL);
5666         pthread_detach( t );
5667 #endif
5668 #ifdef HAVE_LINUX_THREADS
5669         pthread_kill_other_threads_np();
5670 #endif
5671
5672 ; return 0; }
5673 EOF
5674 if { (eval echo configure:5675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5675   rm -rf conftest*
5676   ol_cv_pthread_lpthreads_lmach_lexc=yes
5677 else
5678   echo "configure: failed program was:" >&5
5679   cat conftest.$ac_ext >&5
5680   rm -rf conftest*
5681   ol_cv_pthread_lpthreads_lmach_lexc=no
5682 fi
5683 rm -f conftest*
5684
5685                 # restore the LIBS
5686                 LIBS="$ol_LIBS"
5687                 
5688 fi
5689
5690 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
5691
5692                 if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
5693                         ol_link_pthreads="-lpthreads -lmach -lexc"
5694                         ol_link_threads=posix
5695                 fi
5696         fi
5697
5698                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
5699         if test "$ol_link_threads" = no ; then
5700                 # try -lpthreads -lexc
5701                 echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
5702 echo "configure:5703: checking for pthread link with -lpthreads -lexc" >&5
5703 if eval "test \"`echo '$''{'ol_cv_pthread_lpthreads_lexc'+set}'`\" = set"; then
5704   echo $ac_n "(cached) $ac_c" 1>&6
5705 else
5706   
5707                         # save the flags
5708                         ol_LIBS="$LIBS"
5709                         LIBS="-lpthreads -lexc $LIBS"
5710
5711                         cat > conftest.$ac_ext <<EOF
5712 #line 5713 "configure"
5713 #include "confdefs.h"
5714
5715 #include <pthread.h>
5716 #ifndef NULL
5717 #define NULL (void*)0
5718 #endif
5719
5720 int main() {
5721
5722         pthread_t t;
5723
5724 #if HAVE_PTHREADS_D4
5725         pthread_create(&t, pthread_attr_default, NULL, NULL);
5726         pthread_detach( &t );
5727 #else
5728         pthread_create(&t, NULL, NULL, NULL);
5729         pthread_detach( t );
5730 #endif
5731 #ifdef HAVE_LINUX_THREADS
5732         pthread_kill_other_threads_np();
5733 #endif
5734
5735 ; return 0; }
5736 EOF
5737 if { (eval echo configure:5738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5738   rm -rf conftest*
5739   ol_cv_pthread_lpthreads_lexc=yes
5740 else
5741   echo "configure: failed program was:" >&5
5742   cat conftest.$ac_ext >&5
5743   rm -rf conftest*
5744   ol_cv_pthread_lpthreads_lexc=no
5745 fi
5746 rm -f conftest*
5747
5748                 # restore the LIBS
5749                 LIBS="$ol_LIBS"
5750                 
5751 fi
5752
5753 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
5754
5755                 if test $ol_cv_pthread_lpthreads_lexc = yes ; then
5756                         ol_link_pthreads="-lpthreads -lexc"
5757                         ol_link_threads=posix
5758                 fi
5759         fi
5760
5761
5762                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
5763         if test "$ol_link_threads" = no ; then
5764                 # try -lpthreads
5765                 echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
5766 echo "configure:5767: checking for pthread link with -lpthreads" >&5
5767 if eval "test \"`echo '$''{'ol_cv_pthread_lib_lpthreads'+set}'`\" = set"; then
5768   echo $ac_n "(cached) $ac_c" 1>&6
5769 else
5770   
5771                         # save the flags
5772                         ol_LIBS="$LIBS"
5773                         LIBS="-lpthreads $LIBS"
5774
5775                         cat > conftest.$ac_ext <<EOF
5776 #line 5777 "configure"
5777 #include "confdefs.h"
5778
5779 #include <pthread.h>
5780 #ifndef NULL
5781 #define NULL (void*)0
5782 #endif
5783
5784 int main() {
5785
5786         pthread_t t;
5787
5788 #if HAVE_PTHREADS_D4
5789         pthread_create(&t, pthread_attr_default, NULL, NULL);
5790         pthread_detach( &t );
5791 #else
5792         pthread_create(&t, NULL, NULL, NULL);
5793         pthread_detach( t );
5794 #endif
5795 #ifdef HAVE_LINUX_THREADS
5796         pthread_kill_other_threads_np();
5797 #endif
5798
5799 ; return 0; }
5800 EOF
5801 if { (eval echo configure:5802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5802   rm -rf conftest*
5803   ol_cv_pthread_lib_lpthreads=yes
5804 else
5805   echo "configure: failed program was:" >&5
5806   cat conftest.$ac_ext >&5
5807   rm -rf conftest*
5808   ol_cv_pthread_lib_lpthreads=no
5809 fi
5810 rm -f conftest*
5811
5812                 # restore the LIBS
5813                 LIBS="$ol_LIBS"
5814                 
5815 fi
5816
5817 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
5818
5819                 if test $ol_cv_pthread_lib_lpthreads = yes ; then
5820                         ol_link_pthreads="-lpthreads"
5821                         ol_link_threads=posix
5822                 fi
5823         fi
5824
5825
5826                 if test $ol_link_threads != no ; then
5827                         cat >> confdefs.h <<\EOF
5828 #define HAVE_PTHREADS 1
5829 EOF
5830
5831
5832                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
5833
5834                                                 save_CPPFLAGS="$CPPFLAGS"
5835                         save_LIBS="$LIBS"
5836                         LIBS="$LTHREAD_LIBS $LIBS"
5837
5838                                                                                                 for ac_func in sched_yield pthread_yield
5839 do
5840 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5841 echo "configure:5842: checking for $ac_func" >&5
5842 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5843   echo $ac_n "(cached) $ac_c" 1>&6
5844 else
5845   cat > conftest.$ac_ext <<EOF
5846 #line 5847 "configure"
5847 #include "confdefs.h"
5848 /* System header to define __stub macros and hopefully few prototypes,
5849     which can conflict with char $ac_func(); below.  */
5850 #include <assert.h>
5851 /* Override any gcc2 internal prototype to avoid an error.  */
5852 /* We use char because int might match the return type of a gcc2
5853     builtin and then its argument prototype would still apply.  */
5854 char $ac_func();
5855
5856 int main() {
5857
5858 /* The GNU C library defines this for functions which it implements
5859     to always fail with ENOSYS.  Some functions are actually named
5860     something starting with __ and the normal name is an alias.  */
5861 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5862 choke me
5863 #else
5864 $ac_func();
5865 #endif
5866
5867 ; return 0; }
5868 EOF
5869 if { (eval echo configure:5870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5870   rm -rf conftest*
5871   eval "ac_cv_func_$ac_func=yes"
5872 else
5873   echo "configure: failed program was:" >&5
5874   cat conftest.$ac_ext >&5
5875   rm -rf conftest*
5876   eval "ac_cv_func_$ac_func=no"
5877 fi
5878 rm -f conftest*
5879 fi
5880
5881 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5882   echo "$ac_t""yes" 1>&6
5883     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5884   cat >> confdefs.h <<EOF
5885 #define $ac_tr_func 1
5886 EOF
5887  
5888 else
5889   echo "$ac_t""no" 1>&6
5890 fi
5891 done
5892
5893
5894                         if test $ac_cv_func_sched_yield = no -a \
5895                                 $ac_cv_func_pthread_yield = no ; then
5896                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
5897 echo "configure:5898: checking for sched_yield in -lrt" >&5
5898 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-%__p_%'`
5899 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
5900   echo $ac_n "(cached) $ac_c" 1>&6
5901 else
5902   ac_save_LIBS="$LIBS"
5903 LIBS="-lrt  $LIBS"
5904 cat > conftest.$ac_ext <<EOF
5905 #line 5906 "configure"
5906 #include "confdefs.h"
5907 /* Override any gcc2 internal prototype to avoid an error.  */
5908 /* We use char because int might match the return type of a gcc2
5909     builtin and then its argument prototype would still apply.  */
5910 char sched_yield();
5911
5912 int main() {
5913 sched_yield()
5914 ; return 0; }
5915 EOF
5916 if { (eval echo configure:5917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5917   rm -rf conftest*
5918   eval "ac_cv_lib_$ac_lib_var=yes"
5919 else
5920   echo "configure: failed program was:" >&5
5921   cat conftest.$ac_ext >&5
5922   rm -rf conftest*
5923   eval "ac_cv_lib_$ac_lib_var=no"
5924 fi
5925 rm -f conftest*
5926 LIBS="$ac_save_LIBS"
5927
5928 fi
5929 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5930   echo "$ac_t""yes" 1>&6
5931   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
5932                                         cat >> confdefs.h <<\EOF
5933 #define HAVE_SCHED_YIELD 1
5934 EOF
5935
5936                                         ac_cv_func_sched_yield=yes
5937 else
5938   echo "$ac_t""no" 1>&6
5939 ac_cv_func_sched_yield=no
5940 fi
5941
5942                         fi
5943                         if test $ac_cv_func_sched_yield = no -a \
5944                                 $ac_cv_func_pthread_yield = no ; then
5945                                                                                                 for ac_func in thr_yield
5946 do
5947 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5948 echo "configure:5949: checking for $ac_func" >&5
5949 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
5950   echo $ac_n "(cached) $ac_c" 1>&6
5951 else
5952   cat > conftest.$ac_ext <<EOF
5953 #line 5954 "configure"
5954 #include "confdefs.h"
5955 /* System header to define __stub macros and hopefully few prototypes,
5956     which can conflict with char $ac_func(); below.  */
5957 #include <assert.h>
5958 /* Override any gcc2 internal prototype to avoid an error.  */
5959 /* We use char because int might match the return type of a gcc2
5960     builtin and then its argument prototype would still apply.  */
5961 char $ac_func();
5962
5963 int main() {
5964
5965 /* The GNU C library defines this for functions which it implements
5966     to always fail with ENOSYS.  Some functions are actually named
5967     something starting with __ and the normal name is an alias.  */
5968 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5969 choke me
5970 #else
5971 $ac_func();
5972 #endif
5973
5974 ; return 0; }
5975 EOF
5976 if { (eval echo configure:5977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5977   rm -rf conftest*
5978   eval "ac_cv_func_$ac_func=yes"
5979 else
5980   echo "configure: failed program was:" >&5
5981   cat conftest.$ac_ext >&5
5982   rm -rf conftest*
5983   eval "ac_cv_func_$ac_func=no"
5984 fi
5985 rm -f conftest*
5986 fi
5987
5988 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5989   echo "$ac_t""yes" 1>&6
5990     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5991   cat >> confdefs.h <<EOF
5992 #define $ac_tr_func 1
5993 EOF
5994  
5995 else
5996   echo "$ac_t""no" 1>&6
5997 fi
5998 done
5999
6000                         fi
6001                         if test $ac_cv_func_sched_yield = no -a \
6002                                 $ac_cv_func_pthread_yield = no -a \
6003                                 "$ac_cv_func_thr_yield" = no ; then
6004                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
6005                         fi
6006
6007                                                 for ac_func in pthread_kill
6008 do
6009 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6010 echo "configure:6011: checking for $ac_func" >&5
6011 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6012   echo $ac_n "(cached) $ac_c" 1>&6
6013 else
6014   cat > conftest.$ac_ext <<EOF
6015 #line 6016 "configure"
6016 #include "confdefs.h"
6017 /* System header to define __stub macros and hopefully few prototypes,
6018     which can conflict with char $ac_func(); below.  */
6019 #include <assert.h>
6020 /* Override any gcc2 internal prototype to avoid an error.  */
6021 /* We use char because int might match the return type of a gcc2
6022     builtin and then its argument prototype would still apply.  */
6023 char $ac_func();
6024
6025 int main() {
6026
6027 /* The GNU C library defines this for functions which it implements
6028     to always fail with ENOSYS.  Some functions are actually named
6029     something starting with __ and the normal name is an alias.  */
6030 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6031 choke me
6032 #else
6033 $ac_func();
6034 #endif
6035
6036 ; return 0; }
6037 EOF
6038 if { (eval echo configure:6039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6039   rm -rf conftest*
6040   eval "ac_cv_func_$ac_func=yes"
6041 else
6042   echo "configure: failed program was:" >&5
6043   cat conftest.$ac_ext >&5
6044   rm -rf conftest*
6045   eval "ac_cv_func_$ac_func=no"
6046 fi
6047 rm -f conftest*
6048 fi
6049
6050 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6051   echo "$ac_t""yes" 1>&6
6052     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6053   cat >> confdefs.h <<EOF
6054 #define $ac_tr_func 1
6055 EOF
6056  
6057 else
6058   echo "$ac_t""no" 1>&6
6059 fi
6060 done
6061
6062
6063                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
6064 echo "configure:6065: checking for pthread_detach with <pthread.h>" >&5
6065 if eval "test \"`echo '$''{'ol_cv_func_pthread_detach'+set}'`\" = set"; then
6066   echo $ac_n "(cached) $ac_c" 1>&6
6067 else
6068   
6069                                                                 cat > conftest.$ac_ext <<EOF
6070 #line 6071 "configure"
6071 #include "confdefs.h"
6072
6073 #include <pthread.h>
6074 #ifndef NULL
6075 #define NULL (void*)0
6076 #endif
6077
6078 int main() {
6079 pthread_detach(NULL);
6080 ; return 0; }
6081 EOF
6082 if { (eval echo configure:6083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6083   rm -rf conftest*
6084   ol_cv_func_pthread_detach=yes
6085 else
6086   echo "configure: failed program was:" >&5
6087   cat conftest.$ac_ext >&5
6088   rm -rf conftest*
6089   ol_cv_func_pthread_detach=no
6090 fi
6091 rm -f conftest*
6092                         
6093 fi
6094
6095 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
6096
6097                         if test $ol_cv_func_pthread_detach = no ; then
6098                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
6099                         fi
6100
6101                         cat >> confdefs.h <<\EOF
6102 #define HAVE_PTHREAD_DETACH 1
6103 EOF
6104
6105
6106                                                 for ac_func in \
6107                                 pthread_setconcurrency \
6108                                 pthread_getconcurrency \
6109                                 thr_setconcurrency \
6110                                 thr_getconcurrency \
6111                         
6112 do
6113 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6114 echo "configure:6115: checking for $ac_func" >&5
6115 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6116   echo $ac_n "(cached) $ac_c" 1>&6
6117 else
6118   cat > conftest.$ac_ext <<EOF
6119 #line 6120 "configure"
6120 #include "confdefs.h"
6121 /* System header to define __stub macros and hopefully few prototypes,
6122     which can conflict with char $ac_func(); below.  */
6123 #include <assert.h>
6124 /* Override any gcc2 internal prototype to avoid an error.  */
6125 /* We use char because int might match the return type of a gcc2
6126     builtin and then its argument prototype would still apply.  */
6127 char $ac_func();
6128
6129 int main() {
6130
6131 /* The GNU C library defines this for functions which it implements
6132     to always fail with ENOSYS.  Some functions are actually named
6133     something starting with __ and the normal name is an alias.  */
6134 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6135 choke me
6136 #else
6137 $ac_func();
6138 #endif
6139
6140 ; return 0; }
6141 EOF
6142 if { (eval echo configure:6143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6143   rm -rf conftest*
6144   eval "ac_cv_func_$ac_func=yes"
6145 else
6146   echo "configure: failed program was:" >&5
6147   cat conftest.$ac_ext >&5
6148   rm -rf conftest*
6149   eval "ac_cv_func_$ac_func=no"
6150 fi
6151 rm -f conftest*
6152 fi
6153
6154 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6155   echo "$ac_t""yes" 1>&6
6156     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6157   cat >> confdefs.h <<EOF
6158 #define $ac_tr_func 1
6159 EOF
6160  
6161 else
6162   echo "$ac_t""no" 1>&6
6163 fi
6164 done
6165
6166
6167                         
6168         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
6169 echo "configure:6170: checking for pthread_kill_other_threads_np" >&5
6170 if eval "test \"`echo '$''{'ac_cv_func_pthread_kill_other_threads_np'+set}'`\" = set"; then
6171   echo $ac_n "(cached) $ac_c" 1>&6
6172 else
6173   cat > conftest.$ac_ext <<EOF
6174 #line 6175 "configure"
6175 #include "confdefs.h"
6176 /* System header to define __stub macros and hopefully few prototypes,
6177     which can conflict with char pthread_kill_other_threads_np(); below.  */
6178 #include <assert.h>
6179 /* Override any gcc2 internal prototype to avoid an error.  */
6180 /* We use char because int might match the return type of a gcc2
6181     builtin and then its argument prototype would still apply.  */
6182 char pthread_kill_other_threads_np();
6183
6184 int main() {
6185
6186 /* The GNU C library defines this for functions which it implements
6187     to always fail with ENOSYS.  Some functions are actually named
6188     something starting with __ and the normal name is an alias.  */
6189 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
6190 choke me
6191 #else
6192 pthread_kill_other_threads_np();
6193 #endif
6194
6195 ; return 0; }
6196 EOF
6197 if { (eval echo configure:6198: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6198   rm -rf conftest*
6199   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
6200 else
6201   echo "configure: failed program was:" >&5
6202   cat conftest.$ac_ext >&5
6203   rm -rf conftest*
6204   eval "ac_cv_func_pthread_kill_other_threads_np=no"
6205 fi
6206 rm -f conftest*
6207 fi
6208
6209 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
6210   echo "$ac_t""yes" 1>&6
6211   :
6212 else
6213   echo "$ac_t""no" 1>&6
6214 fi
6215
6216         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
6217 echo "configure:6218: checking for LinuxThreads implementation" >&5
6218 if eval "test \"`echo '$''{'ol_cv_sys_linux_threads'+set}'`\" = set"; then
6219   echo $ac_n "(cached) $ac_c" 1>&6
6220 else
6221   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
6222 fi
6223
6224 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
6225
6226                         
6227         
6228         
6229         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
6230 echo "configure:6231: checking for LinuxThreads consistency" >&5
6231 if eval "test \"`echo '$''{'ol_cv_linux_threads'+set}'`\" = set"; then
6232   echo $ac_n "(cached) $ac_c" 1>&6
6233 else
6234   
6235                 if test $ol_cv_header_linux_threads = yes -a \
6236                         $ol_cv_sys_linux_threads = yes; then
6237                         ol_cv_linux_threads=yes
6238                 elif test $ol_cv_header_linux_threads = no -a \
6239                         $ol_cv_sys_linux_threads = no; then
6240                         ol_cv_linux_threads=no
6241                 else
6242                         ol_cv_linux_threads=error
6243                 fi
6244         
6245 fi
6246
6247 echo "$ac_t""$ol_cv_linux_threads" 1>&6
6248
6249
6250                         if test $ol_cv_linux_threads = error; then
6251                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
6252                         fi
6253
6254                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
6255 echo "configure:6256: checking if pthread_create() works" >&5
6256                         if eval "test \"`echo '$''{'ol_cv_pthread_create_works'+set}'`\" = set"; then
6257   echo $ac_n "(cached) $ac_c" 1>&6
6258 else
6259   
6260                         if test "$cross_compiling" = yes; then
6261                                 ol_cv_pthread_create_works=yes
6262 else
6263   cat > conftest.$ac_ext <<EOF
6264 #line 6265 "configure"
6265 #include "confdefs.h"
6266
6267 #include <pthread.h>
6268 #ifndef NULL
6269 #define NULL (void*)0
6270 #endif
6271
6272 static void *task(p)
6273         void *p;
6274 {
6275         return (void *) (p == NULL);
6276 }
6277
6278 int main(argc, argv)
6279         int argc;
6280         char **argv;
6281 {
6282         pthread_t t;
6283 #if HAVE_PTHREADS_D4
6284         exit(pthread_create(&t, pthread_attr_default, task, NULL));
6285 #else
6286         exit(pthread_create(&t, NULL, task, NULL));
6287 #endif
6288 }
6289
6290 EOF
6291 if { (eval echo configure:6292: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6292 then
6293   ol_cv_pthread_create_works=yes
6294 else
6295   echo "configure: failed program was:" >&5
6296   cat conftest.$ac_ext >&5
6297   rm -fr conftest*
6298   ol_cv_pthread_create_works=no
6299 fi
6300 rm -fr conftest*
6301 fi
6302
6303 fi
6304
6305                         echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
6306
6307                         if test $ol_cv_pthread_create_works = no ; then
6308                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
6309                         fi
6310
6311                                                 if test $ol_with_yielding_select = auto ; then
6312                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
6313 echo "configure:6314: checking if select yields when using pthreads" >&5
6314                                 if eval "test \"`echo '$''{'ol_cv_pthread_select_yields'+set}'`\" = set"; then
6315   echo $ac_n "(cached) $ac_c" 1>&6
6316 else
6317   
6318                                 if test "$cross_compiling" = yes; then
6319   
6320                                 { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
6321 else
6322   cat > conftest.$ac_ext <<EOF
6323 #line 6324 "configure"
6324 #include "confdefs.h"
6325
6326 #include <sys/types.h>
6327 #include <sys/time.h>
6328 #include <unistd.h>
6329 #include <pthread.h>
6330 #ifndef NULL
6331 #define NULL (void*) 0
6332 #endif
6333
6334 static int fildes[2];
6335
6336 static void *task(p)
6337         void *p;
6338 {
6339         int i;
6340         struct timeval tv;
6341
6342         fd_set rfds;
6343
6344         tv.tv_sec=10;
6345         tv.tv_usec=0;
6346
6347         FD_ZERO(&rfds);
6348         FD_SET(fildes[0], &rfds);
6349
6350         /* we're not interested in any fds */
6351         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
6352
6353         if(i < 0) {
6354                 perror("select");
6355                 exit(10);
6356         }
6357
6358         exit(0); /* if we exit here, the select blocked the whole process */
6359 }
6360
6361 int main(argc, argv)
6362         int argc;
6363         char **argv;
6364 {
6365         pthread_t t;
6366
6367         /* create a pipe to select */
6368         if(pipe(&fildes[0])) {
6369                 perror("select");
6370                 exit(1);
6371         }
6372
6373 #ifdef HAVE_PTHREAD_SETCONCURRENCY
6374         (void) pthread_setconcurrency(2);
6375 #else
6376 #ifdef HAVE_THR_SETCONCURRENCY
6377         /* Set Solaris LWP concurrency to 2 */
6378         thr_setconcurrency(2);
6379 #endif
6380 #endif
6381
6382 #if HAVE_PTHREADS_D4
6383         pthread_create(&t, pthread_attr_default, task, NULL);
6384 #else
6385         pthread_create(&t, NULL, task, NULL);
6386 #endif
6387
6388 #if HAVE_SCHED_YIELD
6389         sched_yield();  /* make sure task runs first */
6390 #else
6391 #ifdef HAVE_PTHREAD_YIELD
6392         pthread_yield();        /* make sure task runs first */
6393 #endif
6394 #endif
6395
6396         exit(2);
6397 }
6398 EOF
6399 if { (eval echo configure:6400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
6400 then
6401   ol_cv_pthread_select_yields=no
6402 else
6403   echo "configure: failed program was:" >&5
6404   cat conftest.$ac_ext >&5
6405   rm -fr conftest*
6406   ol_cv_pthread_select_yields=yes
6407 fi
6408 rm -fr conftest*
6409 fi
6410
6411 fi
6412
6413                                 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
6414
6415                                 if test $ol_cv_pthread_select_yields = yes ; then
6416                                         ol_with_yielding_select=yes
6417                                 fi
6418                         fi
6419
6420                                                 CPPFLAGS="$save_CPPFLAGS"
6421                         LIBS="$save_LIBS"
6422                 else
6423                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
6424                 fi
6425         fi
6426
6427         if test $ol_with_threads = posix ; then
6428                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
6429         fi
6430 fi
6431
6432 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6433         -o $ol_with_threads = mach ; then
6434
6435                 for ac_hdr in mach/cthreads.h
6436 do
6437 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6438 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6439 echo "configure:6440: checking for $ac_hdr" >&5
6440 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6441   echo $ac_n "(cached) $ac_c" 1>&6
6442 else
6443   cat > conftest.$ac_ext <<EOF
6444 #line 6445 "configure"
6445 #include "confdefs.h"
6446 #include <$ac_hdr>
6447 EOF
6448 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6449 { (eval echo configure:6450: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6450 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6451 if test -z "$ac_err"; then
6452   rm -rf conftest*
6453   eval "ac_cv_header_$ac_safe=yes"
6454 else
6455   echo "$ac_err" >&5
6456   echo "configure: failed program was:" >&5
6457   cat conftest.$ac_ext >&5
6458   rm -rf conftest*
6459   eval "ac_cv_header_$ac_safe=no"
6460 fi
6461 rm -f conftest*
6462 fi
6463 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6464   echo "$ac_t""yes" 1>&6
6465     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6466   cat >> confdefs.h <<EOF
6467 #define $ac_tr_hdr 1
6468 EOF
6469  
6470 else
6471   echo "$ac_t""no" 1>&6
6472 fi
6473 done
6474
6475         if test $ac_cv_header_mach_cthreads_h = yes ; then
6476                 ol_with_threads=found
6477
6478                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
6479 echo "configure:6480: checking for cthread_fork" >&5
6480 if eval "test \"`echo '$''{'ac_cv_func_cthread_fork'+set}'`\" = set"; then
6481   echo $ac_n "(cached) $ac_c" 1>&6
6482 else
6483   cat > conftest.$ac_ext <<EOF
6484 #line 6485 "configure"
6485 #include "confdefs.h"
6486 /* System header to define __stub macros and hopefully few prototypes,
6487     which can conflict with char cthread_fork(); below.  */
6488 #include <assert.h>
6489 /* Override any gcc2 internal prototype to avoid an error.  */
6490 /* We use char because int might match the return type of a gcc2
6491     builtin and then its argument prototype would still apply.  */
6492 char cthread_fork();
6493
6494 int main() {
6495
6496 /* The GNU C library defines this for functions which it implements
6497     to always fail with ENOSYS.  Some functions are actually named
6498     something starting with __ and the normal name is an alias.  */
6499 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
6500 choke me
6501 #else
6502 cthread_fork();
6503 #endif
6504
6505 ; return 0; }
6506 EOF
6507 if { (eval echo configure:6508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6508   rm -rf conftest*
6509   eval "ac_cv_func_cthread_fork=yes"
6510 else
6511   echo "configure: failed program was:" >&5
6512   cat conftest.$ac_ext >&5
6513   rm -rf conftest*
6514   eval "ac_cv_func_cthread_fork=no"
6515 fi
6516 rm -f conftest*
6517 fi
6518
6519 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
6520   echo "$ac_t""yes" 1>&6
6521   ol_link_threads=yes
6522 else
6523   echo "$ac_t""no" 1>&6
6524 fi
6525
6526
6527                 if test $ol_link_threads = no ; then
6528                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
6529 echo "configure:6530: checking for cthread_fork with -all_load" >&5
6530 if eval "test \"`echo '$''{'ol_cv_cthread_all_load'+set}'`\" = set"; then
6531   echo $ac_n "(cached) $ac_c" 1>&6
6532 else
6533   
6534                                                                 save_LIBS="$LIBS"
6535                                 LIBS="-all_load $LIBS"
6536                                 cat > conftest.$ac_ext <<EOF
6537 #line 6538 "configure"
6538 #include "confdefs.h"
6539 #include <mach/cthreads.h>
6540 int main() {
6541
6542                                         cthread_fork((void *)0, (void *)0);
6543                                         
6544 ; return 0; }
6545 EOF
6546 if { (eval echo configure:6547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6547   rm -rf conftest*
6548   ol_cv_cthread_all_load=yes
6549 else
6550   echo "configure: failed program was:" >&5
6551   cat conftest.$ac_ext >&5
6552   rm -rf conftest*
6553   ol_cv_cthread_all_load=no
6554 fi
6555 rm -f conftest*
6556                                                                 LIBS="$save_LIBS"
6557                         
6558 fi
6559
6560 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
6561
6562                         if test $ol_cv_cthread_all_load = yes ; then
6563                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
6564                                 ol_link_threads=mach
6565                         fi
6566                 fi
6567
6568                 if test $ol_link_threads != no ; then
6569                         : check for cthread specific functionality here
6570                         cat >> confdefs.h <<\EOF
6571 #define HAVE_MACH_CTHREADS 1
6572 EOF
6573
6574                 else
6575                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
6576                 fi
6577         fi
6578
6579         if test $ol_with_threads = mach ; then
6580                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
6581         fi
6582 fi
6583
6584 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6585         -o $ol_with_threads = lwp ; then
6586
6587                 for ac_hdr in thread.h synch.h
6588 do
6589 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6590 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6591 echo "configure:6592: checking for $ac_hdr" >&5
6592 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6593   echo $ac_n "(cached) $ac_c" 1>&6
6594 else
6595   cat > conftest.$ac_ext <<EOF
6596 #line 6597 "configure"
6597 #include "confdefs.h"
6598 #include <$ac_hdr>
6599 EOF
6600 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6601 { (eval echo configure:6602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6602 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6603 if test -z "$ac_err"; then
6604   rm -rf conftest*
6605   eval "ac_cv_header_$ac_safe=yes"
6606 else
6607   echo "$ac_err" >&5
6608   echo "configure: failed program was:" >&5
6609   cat conftest.$ac_ext >&5
6610   rm -rf conftest*
6611   eval "ac_cv_header_$ac_safe=no"
6612 fi
6613 rm -f conftest*
6614 fi
6615 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6616   echo "$ac_t""yes" 1>&6
6617     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6618   cat >> confdefs.h <<EOF
6619 #define $ac_tr_hdr 1
6620 EOF
6621  
6622 else
6623   echo "$ac_t""no" 1>&6
6624 fi
6625 done
6626
6627         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
6628                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
6629 echo "configure:6630: checking for thr_create in -lthread" >&5
6630 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-%__p_%'`
6631 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6632   echo $ac_n "(cached) $ac_c" 1>&6
6633 else
6634   ac_save_LIBS="$LIBS"
6635 LIBS="-lthread  $LIBS"
6636 cat > conftest.$ac_ext <<EOF
6637 #line 6638 "configure"
6638 #include "confdefs.h"
6639 /* Override any gcc2 internal prototype to avoid an error.  */
6640 /* We use char because int might match the return type of a gcc2
6641     builtin and then its argument prototype would still apply.  */
6642 char thr_create();
6643
6644 int main() {
6645 thr_create()
6646 ; return 0; }
6647 EOF
6648 if { (eval echo configure:6649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6649   rm -rf conftest*
6650   eval "ac_cv_lib_$ac_lib_var=yes"
6651 else
6652   echo "configure: failed program was:" >&5
6653   cat conftest.$ac_ext >&5
6654   rm -rf conftest*
6655   eval "ac_cv_lib_$ac_lib_var=no"
6656 fi
6657 rm -f conftest*
6658 LIBS="$ac_save_LIBS"
6659
6660 fi
6661 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6662   echo "$ac_t""yes" 1>&6
6663   have_thr=yes
6664 else
6665   echo "$ac_t""no" 1>&6
6666 have_thr=no
6667 fi
6668
6669
6670                 if test $have_thr = yes ; then
6671                         cat >> confdefs.h <<\EOF
6672 #define HAVE_THR 1
6673 EOF
6674
6675                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
6676                         ol_link_threads=thr
6677
6678                         if test $ol_with_yielding_select = auto ; then
6679                                 ol_with_yielding_select=yes
6680                         fi
6681
6682                                                 for ac_func in \
6683                                 thr_setconcurrency \
6684                                 thr_getconcurrency \
6685                         
6686 do
6687 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6688 echo "configure:6689: checking for $ac_func" >&5
6689 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6690   echo $ac_n "(cached) $ac_c" 1>&6
6691 else
6692   cat > conftest.$ac_ext <<EOF
6693 #line 6694 "configure"
6694 #include "confdefs.h"
6695 /* System header to define __stub macros and hopefully few prototypes,
6696     which can conflict with char $ac_func(); below.  */
6697 #include <assert.h>
6698 /* Override any gcc2 internal prototype to avoid an error.  */
6699 /* We use char because int might match the return type of a gcc2
6700     builtin and then its argument prototype would still apply.  */
6701 char $ac_func();
6702
6703 int main() {
6704
6705 /* The GNU C library defines this for functions which it implements
6706     to always fail with ENOSYS.  Some functions are actually named
6707     something starting with __ and the normal name is an alias.  */
6708 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6709 choke me
6710 #else
6711 $ac_func();
6712 #endif
6713
6714 ; return 0; }
6715 EOF
6716 if { (eval echo configure:6717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6717   rm -rf conftest*
6718   eval "ac_cv_func_$ac_func=yes"
6719 else
6720   echo "configure: failed program was:" >&5
6721   cat conftest.$ac_ext >&5
6722   rm -rf conftest*
6723   eval "ac_cv_func_$ac_func=no"
6724 fi
6725 rm -f conftest*
6726 fi
6727
6728 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6729   echo "$ac_t""yes" 1>&6
6730     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6731   cat >> confdefs.h <<EOF
6732 #define $ac_tr_func 1
6733 EOF
6734  
6735 else
6736   echo "$ac_t""no" 1>&6
6737 fi
6738 done
6739
6740                 fi
6741         fi
6742
6743                 for ac_hdr in lwp/lwp.h
6744 do
6745 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6746 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6747 echo "configure:6748: checking for $ac_hdr" >&5
6748 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6749   echo $ac_n "(cached) $ac_c" 1>&6
6750 else
6751   cat > conftest.$ac_ext <<EOF
6752 #line 6753 "configure"
6753 #include "confdefs.h"
6754 #include <$ac_hdr>
6755 EOF
6756 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6757 { (eval echo configure:6758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6758 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6759 if test -z "$ac_err"; then
6760   rm -rf conftest*
6761   eval "ac_cv_header_$ac_safe=yes"
6762 else
6763   echo "$ac_err" >&5
6764   echo "configure: failed program was:" >&5
6765   cat conftest.$ac_ext >&5
6766   rm -rf conftest*
6767   eval "ac_cv_header_$ac_safe=no"
6768 fi
6769 rm -f conftest*
6770 fi
6771 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6772   echo "$ac_t""yes" 1>&6
6773     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6774   cat >> confdefs.h <<EOF
6775 #define $ac_tr_hdr 1
6776 EOF
6777  
6778 else
6779   echo "$ac_t""no" 1>&6
6780 fi
6781 done
6782
6783         if test $ac_cv_header_lwp_lwp_h = yes ; then
6784                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
6785 echo "configure:6786: checking for lwp_create in -llwp" >&5
6786 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-%__p_%'`
6787 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
6788   echo $ac_n "(cached) $ac_c" 1>&6
6789 else
6790   ac_save_LIBS="$LIBS"
6791 LIBS="-llwp  $LIBS"
6792 cat > conftest.$ac_ext <<EOF
6793 #line 6794 "configure"
6794 #include "confdefs.h"
6795 /* Override any gcc2 internal prototype to avoid an error.  */
6796 /* We use char because int might match the return type of a gcc2
6797     builtin and then its argument prototype would still apply.  */
6798 char lwp_create();
6799
6800 int main() {
6801 lwp_create()
6802 ; return 0; }
6803 EOF
6804 if { (eval echo configure:6805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6805   rm -rf conftest*
6806   eval "ac_cv_lib_$ac_lib_var=yes"
6807 else
6808   echo "configure: failed program was:" >&5
6809   cat conftest.$ac_ext >&5
6810   rm -rf conftest*
6811   eval "ac_cv_lib_$ac_lib_var=no"
6812 fi
6813 rm -f conftest*
6814 LIBS="$ac_save_LIBS"
6815
6816 fi
6817 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6818   echo "$ac_t""yes" 1>&6
6819   have_lwp=yes
6820 else
6821   echo "$ac_t""no" 1>&6
6822 have_lwp=no
6823 fi
6824
6825
6826                 if test $have_lwp = yes ; then
6827                         cat >> confdefs.h <<\EOF
6828 #define HAVE_LWP 1
6829 EOF
6830
6831                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
6832                         ol_link_threads=lwp
6833
6834                         if test $ol_with_yielding_select = auto ; then
6835                                 ol_with_yielding_select=no
6836                         fi
6837                 fi
6838         fi
6839 fi
6840
6841 if test $ol_with_yielding_select = yes ; then
6842         cat >> confdefs.h <<\EOF
6843 #define HAVE_YIELDING_SELECT 1
6844 EOF
6845
6846 fi
6847
6848 if test $ol_with_threads = manual ; then
6849                 ol_link_threads=yes
6850
6851         echo "configure: warning: thread defines and link options must be set manually" 1>&2
6852
6853         for ac_hdr in pthread.h sched.h
6854 do
6855 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6856 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6857 echo "configure:6858: checking for $ac_hdr" >&5
6858 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6859   echo $ac_n "(cached) $ac_c" 1>&6
6860 else
6861   cat > conftest.$ac_ext <<EOF
6862 #line 6863 "configure"
6863 #include "confdefs.h"
6864 #include <$ac_hdr>
6865 EOF
6866 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6867 { (eval echo configure:6868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6868 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6869 if test -z "$ac_err"; then
6870   rm -rf conftest*
6871   eval "ac_cv_header_$ac_safe=yes"
6872 else
6873   echo "$ac_err" >&5
6874   echo "configure: failed program was:" >&5
6875   cat conftest.$ac_ext >&5
6876   rm -rf conftest*
6877   eval "ac_cv_header_$ac_safe=no"
6878 fi
6879 rm -f conftest*
6880 fi
6881 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6882   echo "$ac_t""yes" 1>&6
6883     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6884   cat >> confdefs.h <<EOF
6885 #define $ac_tr_hdr 1
6886 EOF
6887  
6888 else
6889   echo "$ac_t""no" 1>&6
6890 fi
6891 done
6892
6893         for ac_func in sched_yield pthread_yield
6894 do
6895 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6896 echo "configure:6897: checking for $ac_func" >&5
6897 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
6898   echo $ac_n "(cached) $ac_c" 1>&6
6899 else
6900   cat > conftest.$ac_ext <<EOF
6901 #line 6902 "configure"
6902 #include "confdefs.h"
6903 /* System header to define __stub macros and hopefully few prototypes,
6904     which can conflict with char $ac_func(); below.  */
6905 #include <assert.h>
6906 /* Override any gcc2 internal prototype to avoid an error.  */
6907 /* We use char because int might match the return type of a gcc2
6908     builtin and then its argument prototype would still apply.  */
6909 char $ac_func();
6910
6911 int main() {
6912
6913 /* The GNU C library defines this for functions which it implements
6914     to always fail with ENOSYS.  Some functions are actually named
6915     something starting with __ and the normal name is an alias.  */
6916 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6917 choke me
6918 #else
6919 $ac_func();
6920 #endif
6921
6922 ; return 0; }
6923 EOF
6924 if { (eval echo configure:6925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6925   rm -rf conftest*
6926   eval "ac_cv_func_$ac_func=yes"
6927 else
6928   echo "configure: failed program was:" >&5
6929   cat conftest.$ac_ext >&5
6930   rm -rf conftest*
6931   eval "ac_cv_func_$ac_func=no"
6932 fi
6933 rm -f conftest*
6934 fi
6935
6936 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6937   echo "$ac_t""yes" 1>&6
6938     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6939   cat >> confdefs.h <<EOF
6940 #define $ac_tr_func 1
6941 EOF
6942  
6943 else
6944   echo "$ac_t""no" 1>&6
6945 fi
6946 done
6947
6948         
6949         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6950 echo "configure:6951: checking for LinuxThreads pthread.h" >&5
6951 if eval "test \"`echo '$''{'ol_cv_header_linux_threads'+set}'`\" = set"; then
6952   echo $ac_n "(cached) $ac_c" 1>&6
6953 else
6954   cat > conftest.$ac_ext <<EOF
6955 #line 6956 "configure"
6956 #include "confdefs.h"
6957 #include <pthread.h>
6958 EOF
6959 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6960   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6961   rm -rf conftest*
6962   ol_cv_header_linux_threads=yes
6963 else
6964   rm -rf conftest*
6965   ol_cv_header_linux_threads=no
6966 fi
6967 rm -f conftest*
6968
6969                 
6970 fi
6971
6972 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6973         if test $ol_cv_header_linux_threads = yes; then
6974                 cat >> confdefs.h <<\EOF
6975 #define HAVE_LINUX_THREADS 1
6976 EOF
6977
6978         fi
6979
6980
6981         for ac_hdr in mach/cthreads.h
6982 do
6983 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6984 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6985 echo "configure:6986: checking for $ac_hdr" >&5
6986 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
6987   echo $ac_n "(cached) $ac_c" 1>&6
6988 else
6989   cat > conftest.$ac_ext <<EOF
6990 #line 6991 "configure"
6991 #include "confdefs.h"
6992 #include <$ac_hdr>
6993 EOF
6994 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6995 { (eval echo configure:6996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6996 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6997 if test -z "$ac_err"; then
6998   rm -rf conftest*
6999   eval "ac_cv_header_$ac_safe=yes"
7000 else
7001   echo "$ac_err" >&5
7002   echo "configure: failed program was:" >&5
7003   cat conftest.$ac_ext >&5
7004   rm -rf conftest*
7005   eval "ac_cv_header_$ac_safe=no"
7006 fi
7007 rm -f conftest*
7008 fi
7009 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7010   echo "$ac_t""yes" 1>&6
7011     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7012   cat >> confdefs.h <<EOF
7013 #define $ac_tr_hdr 1
7014 EOF
7015  
7016 else
7017   echo "$ac_t""no" 1>&6
7018 fi
7019 done
7020
7021         for ac_hdr in lwp/lwp.h
7022 do
7023 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7024 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7025 echo "configure:7026: checking for $ac_hdr" >&5
7026 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7027   echo $ac_n "(cached) $ac_c" 1>&6
7028 else
7029   cat > conftest.$ac_ext <<EOF
7030 #line 7031 "configure"
7031 #include "confdefs.h"
7032 #include <$ac_hdr>
7033 EOF
7034 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7035 { (eval echo configure:7036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7036 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7037 if test -z "$ac_err"; then
7038   rm -rf conftest*
7039   eval "ac_cv_header_$ac_safe=yes"
7040 else
7041   echo "$ac_err" >&5
7042   echo "configure: failed program was:" >&5
7043   cat conftest.$ac_ext >&5
7044   rm -rf conftest*
7045   eval "ac_cv_header_$ac_safe=no"
7046 fi
7047 rm -f conftest*
7048 fi
7049 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7050   echo "$ac_t""yes" 1>&6
7051     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7052   cat >> confdefs.h <<EOF
7053 #define $ac_tr_hdr 1
7054 EOF
7055  
7056 else
7057   echo "$ac_t""no" 1>&6
7058 fi
7059 done
7060
7061         for ac_hdr in thread.h synch.h
7062 do
7063 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7064 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7065 echo "configure:7066: checking for $ac_hdr" >&5
7066 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7067   echo $ac_n "(cached) $ac_c" 1>&6
7068 else
7069   cat > conftest.$ac_ext <<EOF
7070 #line 7071 "configure"
7071 #include "confdefs.h"
7072 #include <$ac_hdr>
7073 EOF
7074 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7075 { (eval echo configure:7076: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7076 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7077 if test -z "$ac_err"; then
7078   rm -rf conftest*
7079   eval "ac_cv_header_$ac_safe=yes"
7080 else
7081   echo "$ac_err" >&5
7082   echo "configure: failed program was:" >&5
7083   cat conftest.$ac_ext >&5
7084   rm -rf conftest*
7085   eval "ac_cv_header_$ac_safe=no"
7086 fi
7087 rm -f conftest*
7088 fi
7089 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7090   echo "$ac_t""yes" 1>&6
7091     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7092   cat >> confdefs.h <<EOF
7093 #define $ac_tr_hdr 1
7094 EOF
7095  
7096 else
7097   echo "$ac_t""no" 1>&6
7098 fi
7099 done
7100
7101 fi
7102
7103 if test $ol_link_threads != no ; then  
7104                         cat >> confdefs.h <<\EOF
7105 #define REENTRANT 1
7106 EOF
7107
7108         cat >> confdefs.h <<\EOF
7109 #define _REENTRANT 1
7110 EOF
7111
7112         cat >> confdefs.h <<\EOF
7113 #define THREAD_SAFE 1
7114 EOF
7115
7116         cat >> confdefs.h <<\EOF
7117 #define _THREAD_SAFE 1
7118 EOF
7119
7120         cat >> confdefs.h <<\EOF
7121 #define THREADSAFE 1
7122 EOF
7123
7124         cat >> confdefs.h <<\EOF
7125 #define _THREADSAFE 1
7126 EOF
7127
7128
7129                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
7130 echo "configure:7131: checking for thread specific errno" >&5
7131 if eval "test \"`echo '$''{'ol_cv_errno_thread_specific'+set}'`\" = set"; then
7132   echo $ac_n "(cached) $ac_c" 1>&6
7133 else
7134   
7135                 cat > conftest.$ac_ext <<EOF
7136 #line 7137 "configure"
7137 #include "confdefs.h"
7138 #include <errno.h>
7139 int main() {
7140 errno = 0;
7141 ; return 0; }
7142 EOF
7143 if { (eval echo configure:7144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7144   rm -rf conftest*
7145   ol_cv_errno_thread_specific=yes
7146 else
7147   echo "configure: failed program was:" >&5
7148   cat conftest.$ac_ext >&5
7149   rm -rf conftest*
7150   ol_cv_errno_thread_specific=no
7151 fi
7152 rm -f conftest*
7153         
7154 fi
7155
7156 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
7157
7158         if test $ol_cv_errno_thread_specific != yes ; then
7159                 LIBS="$LTHREAD_LIBS $LIBS"
7160                 LTHREAD_LIBS=""
7161         fi
7162
7163 fi  
7164
7165 if test $ol_link_threads = no ; then
7166         if test $ol_with_threads = yes ; then
7167                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
7168         fi
7169
7170         if test $ol_with_threads = auto ; then
7171                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
7172                 ol_with_threads=no
7173         fi
7174
7175         cat >> confdefs.h <<\EOF
7176 #define NO_THREADS 1
7177 EOF
7178
7179         LTHREAD_LIBS=""
7180 fi
7181
7182 if test $ol_link_threads != no ; then
7183         cat >> confdefs.h <<\EOF
7184 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
7185 EOF
7186
7187 fi
7188
7189
7190 ol_link_ldbm=no 
7191 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db2 ; then
7192         echo $ac_n "checking for DB2 library""... $ac_c" 1>&6
7193 echo "configure:7194: checking for DB2 library" >&5
7194 if eval "test \"`echo '$''{'ol_cv_lib_db2'+set}'`\" = set"; then
7195   echo $ac_n "(cached) $ac_c" 1>&6
7196 else
7197         ol_LIBS="$LIBS"
7198         echo $ac_n "checking for db_open in -ldb""... $ac_c" 1>&6
7199 echo "configure:7200: checking for db_open in -ldb" >&5
7200 ac_lib_var=`echo db'_'db_open | sed 'y%./+-%__p_%'`
7201 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7202   echo $ac_n "(cached) $ac_c" 1>&6
7203 else
7204   ac_save_LIBS="$LIBS"
7205 LIBS="-ldb  $LIBS"
7206 cat > conftest.$ac_ext <<EOF
7207 #line 7208 "configure"
7208 #include "confdefs.h"
7209 /* Override any gcc2 internal prototype to avoid an error.  */
7210 /* We use char because int might match the return type of a gcc2
7211     builtin and then its argument prototype would still apply.  */
7212 char db_open();
7213
7214 int main() {
7215 db_open()
7216 ; return 0; }
7217 EOF
7218 if { (eval echo configure:7219: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7219   rm -rf conftest*
7220   eval "ac_cv_lib_$ac_lib_var=yes"
7221 else
7222   echo "configure: failed program was:" >&5
7223   cat conftest.$ac_ext >&5
7224   rm -rf conftest*
7225   eval "ac_cv_lib_$ac_lib_var=no"
7226 fi
7227 rm -f conftest*
7228 LIBS="$ac_save_LIBS"
7229
7230 fi
7231 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7232   echo "$ac_t""yes" 1>&6
7233   ol_cv_lib_db2=-ldb
7234 else
7235   echo "$ac_t""no" 1>&6
7236 ol_cv_lib_db2=no
7237 fi
7238
7239         LIBS="$ol_LIBS"
7240
7241 fi
7242
7243 echo "$ac_t""$ol_cv_lib_db2" 1>&6
7244
7245 for ac_hdr in db.h
7246 do
7247 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7248 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7249 echo "configure:7250: checking for $ac_hdr" >&5
7250 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7251   echo $ac_n "(cached) $ac_c" 1>&6
7252 else
7253   cat > conftest.$ac_ext <<EOF
7254 #line 7255 "configure"
7255 #include "confdefs.h"
7256 #include <$ac_hdr>
7257 EOF
7258 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7259 { (eval echo configure:7260: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7260 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7261 if test -z "$ac_err"; then
7262   rm -rf conftest*
7263   eval "ac_cv_header_$ac_safe=yes"
7264 else
7265   echo "$ac_err" >&5
7266   echo "configure: failed program was:" >&5
7267   cat conftest.$ac_ext >&5
7268   rm -rf conftest*
7269   eval "ac_cv_header_$ac_safe=no"
7270 fi
7271 rm -f conftest*
7272 fi
7273 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7274   echo "$ac_t""yes" 1>&6
7275     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7276   cat >> confdefs.h <<EOF
7277 #define $ac_tr_hdr 1
7278 EOF
7279  
7280 else
7281   echo "$ac_t""no" 1>&6
7282 fi
7283 done
7284
7285 if test $ac_cv_header_db_h = yes ; then
7286         echo $ac_n "checking if db.h is DB2""... $ac_c" 1>&6
7287 echo "configure:7288: checking if db.h is DB2" >&5
7288 if eval "test \"`echo '$''{'ol_cv_header_db2'+set}'`\" = set"; then
7289   echo $ac_n "(cached) $ac_c" 1>&6
7290 else
7291   
7292                 cat > conftest.$ac_ext <<EOF
7293 #line 7294 "configure"
7294 #include "confdefs.h"
7295
7296 #                       include <db.h>
7297                         /* this check could be improved */
7298 #                       ifdef DB_VERSION_MAJOR
7299 #                               if DB_VERSION_MAJOR == 2
7300                                         __db_version_2
7301 #                               endif
7302 #                       endif
7303                 
7304 EOF
7305 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
7306   egrep "__db_version_2" >/dev/null 2>&1; then
7307   rm -rf conftest*
7308   ol_cv_header_db2=yes
7309 else
7310   rm -rf conftest*
7311   ol_cv_header_db2=no
7312 fi
7313 rm -f conftest*
7314
7315 fi
7316
7317 echo "$ac_t""$ol_cv_header_db2" 1>&6
7318 else
7319         ol_cv_header_db2=no
7320 fi
7321
7322
7323  
7324  echo $ac_n "checking for Berkeley DB2""... $ac_c" 1>&6
7325 echo "configure:7326: checking for Berkeley DB2" >&5
7326 if eval "test \"`echo '$''{'ol_cv_berkeley_db2'+set}'`\" = set"; then
7327   echo $ac_n "(cached) $ac_c" 1>&6
7328 else
7329   
7330         if test "$ol_cv_lib_db2" = no -o "$ol_cv_header_db2" = no ; then
7331                 ol_cv_berkeley_db2=no
7332         else
7333                 ol_cv_berkeley_db2=yes
7334         fi
7335
7336 fi
7337
7338 echo "$ac_t""$ol_cv_berkeley_db2" 1>&6
7339  if test $ol_cv_berkeley_db2 = yes ; then
7340         cat >> confdefs.h <<\EOF
7341 #define HAVE_BERKELEY_DB2 1
7342 EOF
7343
7344  fi
7345
7346
7347         if test $ol_cv_berkeley_db2 = yes ; then
7348                 ol_link_ldbm=db2
7349                 ol_with_ldbm_api=db2
7350
7351                 if test $ol_with_ldbm_type = hash ; then
7352                         cat >> confdefs.h <<\EOF
7353 #define LDBM_USE_DBHASH 1
7354 EOF
7355
7356                 else
7357                         cat >> confdefs.h <<\EOF
7358 #define LDBM_USE_DBBTREE 1
7359 EOF
7360
7361                 fi
7362
7363                                                 if test $ol_cv_lib_db2 != yes ; then
7364                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db2"
7365                 fi
7366         fi
7367 fi
7368
7369 ol_link_bdb2=no
7370 if test $ol_link_ldbm = db2 -a $ol_enable_bdb2 != no ; then
7371         ol_link_bdb2=yes
7372 fi
7373
7374 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = db ; then
7375         echo $ac_n "checking for Berkeley DB library""... $ac_c" 1>&6
7376 echo "configure:7377: checking for Berkeley DB library" >&5
7377 if eval "test \"`echo '$''{'ol_cv_lib_db'+set}'`\" = set"; then
7378   echo $ac_n "(cached) $ac_c" 1>&6
7379 else
7380   
7381         for ac_hdr in db1/db.h
7382 do
7383 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7384 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7385 echo "configure:7386: checking for $ac_hdr" >&5
7386 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7387   echo $ac_n "(cached) $ac_c" 1>&6
7388 else
7389   cat > conftest.$ac_ext <<EOF
7390 #line 7391 "configure"
7391 #include "confdefs.h"
7392 #include <$ac_hdr>
7393 EOF
7394 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7395 { (eval echo configure:7396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7396 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7397 if test -z "$ac_err"; then
7398   rm -rf conftest*
7399   eval "ac_cv_header_$ac_safe=yes"
7400 else
7401   echo "$ac_err" >&5
7402   echo "configure: failed program was:" >&5
7403   cat conftest.$ac_ext >&5
7404   rm -rf conftest*
7405   eval "ac_cv_header_$ac_safe=no"
7406 fi
7407 rm -f conftest*
7408 fi
7409 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7410   echo "$ac_t""yes" 1>&6
7411     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7412   cat >> confdefs.h <<EOF
7413 #define $ac_tr_hdr 1
7414 EOF
7415  
7416 else
7417   echo "$ac_t""no" 1>&6
7418 fi
7419 done
7420
7421         ol_LIBS="$LIBS"
7422         echo $ac_n "checking for dbopen""... $ac_c" 1>&6
7423 echo "configure:7424: checking for dbopen" >&5
7424 if eval "test \"`echo '$''{'ac_cv_func_dbopen'+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 dbopen(); 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 dbopen();
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_dbopen) || defined (__stub___dbopen)
7444 choke me
7445 #else
7446 dbopen();
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_dbopen=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_dbopen=no"
7459 fi
7460 rm -f conftest*
7461 fi
7462
7463 if eval "test \"`echo '$ac_cv_func_'dbopen`\" = yes"; then
7464   echo "$ac_t""yes" 1>&6
7465   ol_cv_lib_db=yes
7466 else
7467   echo "$ac_t""no" 1>&6
7468
7469                 echo $ac_n "checking for dbopen in -ldb1""... $ac_c" 1>&6
7470 echo "configure:7471: checking for dbopen in -ldb1" >&5
7471 ac_lib_var=`echo db1'_'dbopen | sed 'y%./+-%__p_%'`
7472 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7473   echo $ac_n "(cached) $ac_c" 1>&6
7474 else
7475   ac_save_LIBS="$LIBS"
7476 LIBS="-ldb1  $LIBS"
7477 cat > conftest.$ac_ext <<EOF
7478 #line 7479 "configure"
7479 #include "confdefs.h"
7480 /* Override any gcc2 internal prototype to avoid an error.  */
7481 /* We use char because int might match the return type of a gcc2
7482     builtin and then its argument prototype would still apply.  */
7483 char dbopen();
7484
7485 int main() {
7486 dbopen()
7487 ; return 0; }
7488 EOF
7489 if { (eval echo configure:7490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7490   rm -rf conftest*
7491   eval "ac_cv_lib_$ac_lib_var=yes"
7492 else
7493   echo "configure: failed program was:" >&5
7494   cat conftest.$ac_ext >&5
7495   rm -rf conftest*
7496   eval "ac_cv_lib_$ac_lib_var=no"
7497 fi
7498 rm -f conftest*
7499 LIBS="$ac_save_LIBS"
7500
7501 fi
7502 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7503   echo "$ac_t""yes" 1>&6
7504   ol_cv_lib_db=-ldb1
7505 else
7506   echo "$ac_t""no" 1>&6
7507
7508                         echo $ac_n "checking for dbopen in -ldb""... $ac_c" 1>&6
7509 echo "configure:7510: checking for dbopen in -ldb" >&5
7510 ac_lib_var=`echo db'_'dbopen | sed 'y%./+-%__p_%'`
7511 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7512   echo $ac_n "(cached) $ac_c" 1>&6
7513 else
7514   ac_save_LIBS="$LIBS"
7515 LIBS="-ldb  $LIBS"
7516 cat > conftest.$ac_ext <<EOF
7517 #line 7518 "configure"
7518 #include "confdefs.h"
7519 /* Override any gcc2 internal prototype to avoid an error.  */
7520 /* We use char because int might match the return type of a gcc2
7521     builtin and then its argument prototype would still apply.  */
7522 char dbopen();
7523
7524 int main() {
7525 dbopen()
7526 ; return 0; }
7527 EOF
7528 if { (eval echo configure:7529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7529   rm -rf conftest*
7530   eval "ac_cv_lib_$ac_lib_var=yes"
7531 else
7532   echo "configure: failed program was:" >&5
7533   cat conftest.$ac_ext >&5
7534   rm -rf conftest*
7535   eval "ac_cv_lib_$ac_lib_var=no"
7536 fi
7537 rm -f conftest*
7538 LIBS="$ac_save_LIBS"
7539
7540 fi
7541 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7542   echo "$ac_t""yes" 1>&6
7543   ol_cv_lib_db=-ldb
7544                         ol_cv_lib_db=no
7545 else
7546   echo "$ac_t""no" 1>&6
7547 fi
7548
7549                 
7550 fi
7551
7552         
7553 fi
7554
7555         LIBS="$ol_LIBS"
7556
7557 fi
7558
7559 echo "$ac_t""$ol_cv_lib_db" 1>&6
7560
7561
7562 for ac_hdr in db_185.h
7563 do
7564 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7565 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7566 echo "configure:7567: checking for $ac_hdr" >&5
7567 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7568   echo $ac_n "(cached) $ac_c" 1>&6
7569 else
7570   cat > conftest.$ac_ext <<EOF
7571 #line 7572 "configure"
7572 #include "confdefs.h"
7573 #include <$ac_hdr>
7574 EOF
7575 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7576 { (eval echo configure:7577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7577 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7578 if test -z "$ac_err"; then
7579   rm -rf conftest*
7580   eval "ac_cv_header_$ac_safe=yes"
7581 else
7582   echo "$ac_err" >&5
7583   echo "configure: failed program was:" >&5
7584   cat conftest.$ac_ext >&5
7585   rm -rf conftest*
7586   eval "ac_cv_header_$ac_safe=no"
7587 fi
7588 rm -f conftest*
7589 fi
7590 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7591   echo "$ac_t""yes" 1>&6
7592     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7593   cat >> confdefs.h <<EOF
7594 #define $ac_tr_hdr 1
7595 EOF
7596  
7597 else
7598   echo "$ac_t""no" 1>&6
7599 fi
7600 done
7601
7602 if test "$ol_cv_header_db2" = yes ; then
7603         
7604         ol_cv_header_db=$ac_cv_header_db_185_h
7605 else
7606         ol_cv_header_db=$ac_cv_header_db_h
7607 fi
7608
7609
7610  
7611  echo $ac_n "checking for Berkeley DB""... $ac_c" 1>&6
7612 echo "configure:7613: checking for Berkeley DB" >&5
7613 if eval "test \"`echo '$''{'ol_cv_berkeley_db'+set}'`\" = set"; then
7614   echo $ac_n "(cached) $ac_c" 1>&6
7615 else
7616   
7617         if test "$ol_cv_lib_db" = no -o "$ol_cv_header_db" = no ; then
7618                 ol_cv_berkeley_db=no
7619         else
7620                 ol_cv_berkeley_db=yes
7621         fi
7622
7623 fi
7624
7625 echo "$ac_t""$ol_cv_berkeley_db" 1>&6
7626  if test $ol_cv_berkeley_db = yes ; then
7627         cat >> confdefs.h <<\EOF
7628 #define HAVE_BERKELEY_DB 1
7629 EOF
7630
7631  fi
7632
7633
7634         if test $ol_cv_berkeley_db = yes ; then
7635                 ol_link_ldbm=db
7636                 ol_with_ldbm_api=db
7637
7638                 if test $ol_with_ldbm_type = hash ; then
7639                         cat >> confdefs.h <<\EOF
7640 #define LDBM_USE_DBHASH 1
7641 EOF
7642
7643                 else
7644                         cat >> confdefs.h <<\EOF
7645 #define LDBM_USE_DBBTREE 1
7646 EOF
7647
7648                 fi
7649
7650                                                 if test $ol_cv_lib_db != yes ; then
7651                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
7652                 fi
7653         fi
7654 fi
7655
7656 if test $ol_with_ldbm_api = manual ; then
7657                 ol_link_ldbm=yes
7658
7659         echo "configure: warning: LDBM defines and link options must be set manually" 1>&2
7660
7661         for ac_hdr in db.h db_185.h gdbm.h ndbm.h
7662 do
7663 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7664 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7665 echo "configure:7666: checking for $ac_hdr" >&5
7666 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7667   echo $ac_n "(cached) $ac_c" 1>&6
7668 else
7669   cat > conftest.$ac_ext <<EOF
7670 #line 7671 "configure"
7671 #include "confdefs.h"
7672 #include <$ac_hdr>
7673 EOF
7674 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7675 { (eval echo configure:7676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7676 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7677 if test -z "$ac_err"; then
7678   rm -rf conftest*
7679   eval "ac_cv_header_$ac_safe=yes"
7680 else
7681   echo "$ac_err" >&5
7682   echo "configure: failed program was:" >&5
7683   cat conftest.$ac_ext >&5
7684   rm -rf conftest*
7685   eval "ac_cv_header_$ac_safe=no"
7686 fi
7687 rm -f conftest*
7688 fi
7689 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7690   echo "$ac_t""yes" 1>&6
7691     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7692   cat >> confdefs.h <<EOF
7693 #define $ac_tr_hdr 1
7694 EOF
7695  
7696 else
7697   echo "$ac_t""no" 1>&6
7698 fi
7699 done
7700
7701 fi
7702
7703 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
7704         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
7705         ol_with_ldbm_api=none
7706 fi
7707
7708 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
7709         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
7710 echo "configure:7711: checking for MDBM library" >&5
7711 if eval "test \"`echo '$''{'ol_cv_lib_mdbm'+set}'`\" = set"; then
7712   echo $ac_n "(cached) $ac_c" 1>&6
7713 else
7714         ol_LIBS="$LIBS"
7715         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
7716 echo "configure:7717: checking for mdbm_set_chain" >&5
7717 if eval "test \"`echo '$''{'ac_cv_func_mdbm_set_chain'+set}'`\" = set"; then
7718   echo $ac_n "(cached) $ac_c" 1>&6
7719 else
7720   cat > conftest.$ac_ext <<EOF
7721 #line 7722 "configure"
7722 #include "confdefs.h"
7723 /* System header to define __stub macros and hopefully few prototypes,
7724     which can conflict with char mdbm_set_chain(); below.  */
7725 #include <assert.h>
7726 /* Override any gcc2 internal prototype to avoid an error.  */
7727 /* We use char because int might match the return type of a gcc2
7728     builtin and then its argument prototype would still apply.  */
7729 char mdbm_set_chain();
7730
7731 int main() {
7732
7733 /* The GNU C library defines this for functions which it implements
7734     to always fail with ENOSYS.  Some functions are actually named
7735     something starting with __ and the normal name is an alias.  */
7736 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
7737 choke me
7738 #else
7739 mdbm_set_chain();
7740 #endif
7741
7742 ; return 0; }
7743 EOF
7744 if { (eval echo configure:7745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7745   rm -rf conftest*
7746   eval "ac_cv_func_mdbm_set_chain=yes"
7747 else
7748   echo "configure: failed program was:" >&5
7749   cat conftest.$ac_ext >&5
7750   rm -rf conftest*
7751   eval "ac_cv_func_mdbm_set_chain=no"
7752 fi
7753 rm -f conftest*
7754 fi
7755
7756 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
7757   echo "$ac_t""yes" 1>&6
7758   ol_cv_lib_mdbm=yes
7759 else
7760   echo "$ac_t""no" 1>&6
7761
7762                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
7763 echo "configure:7764: checking for mdbm_set_chain in -lmdbm" >&5
7764 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-%__p_%'`
7765 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7766   echo $ac_n "(cached) $ac_c" 1>&6
7767 else
7768   ac_save_LIBS="$LIBS"
7769 LIBS="-lmdbm  $LIBS"
7770 cat > conftest.$ac_ext <<EOF
7771 #line 7772 "configure"
7772 #include "confdefs.h"
7773 /* Override any gcc2 internal prototype to avoid an error.  */
7774 /* We use char because int might match the return type of a gcc2
7775     builtin and then its argument prototype would still apply.  */
7776 char mdbm_set_chain();
7777
7778 int main() {
7779 mdbm_set_chain()
7780 ; return 0; }
7781 EOF
7782 if { (eval echo configure:7783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7783   rm -rf conftest*
7784   eval "ac_cv_lib_$ac_lib_var=yes"
7785 else
7786   echo "configure: failed program was:" >&5
7787   cat conftest.$ac_ext >&5
7788   rm -rf conftest*
7789   eval "ac_cv_lib_$ac_lib_var=no"
7790 fi
7791 rm -f conftest*
7792 LIBS="$ac_save_LIBS"
7793
7794 fi
7795 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7796   echo "$ac_t""yes" 1>&6
7797   ol_cv_lib_mdbm=-lmdbm
7798 else
7799   echo "$ac_t""no" 1>&6
7800 ol_cv_lib_mdbm=no
7801 fi
7802
7803         
7804 fi
7805
7806         LIBS="$ol_LIBS"
7807
7808 fi
7809
7810 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
7811
7812
7813  for ac_hdr in mdbm.h
7814 do
7815 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7816 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7817 echo "configure:7818: checking for $ac_hdr" >&5
7818 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7819   echo $ac_n "(cached) $ac_c" 1>&6
7820 else
7821   cat > conftest.$ac_ext <<EOF
7822 #line 7823 "configure"
7823 #include "confdefs.h"
7824 #include <$ac_hdr>
7825 EOF
7826 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
7827 { (eval echo configure:7828: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
7828 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
7829 if test -z "$ac_err"; then
7830   rm -rf conftest*
7831   eval "ac_cv_header_$ac_safe=yes"
7832 else
7833   echo "$ac_err" >&5
7834   echo "configure: failed program was:" >&5
7835   cat conftest.$ac_ext >&5
7836   rm -rf conftest*
7837   eval "ac_cv_header_$ac_safe=no"
7838 fi
7839 rm -f conftest*
7840 fi
7841 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
7842   echo "$ac_t""yes" 1>&6
7843     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
7844   cat >> confdefs.h <<EOF
7845 #define $ac_tr_hdr 1
7846 EOF
7847  
7848 else
7849   echo "$ac_t""no" 1>&6
7850 fi
7851 done
7852
7853  echo $ac_n "checking for db""... $ac_c" 1>&6
7854 echo "configure:7855: checking for db" >&5
7855 if eval "test \"`echo '$''{'ol_cv_mdbm'+set}'`\" = set"; then
7856   echo $ac_n "(cached) $ac_c" 1>&6
7857 else
7858   
7859         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
7860                 ol_cv_mdbm=no
7861         else
7862                 ol_cv_mdbm=yes
7863         fi
7864
7865 fi
7866
7867 echo "$ac_t""$ol_cv_mdbm" 1>&6
7868  if test $ol_cv_mdbm = yes ; then
7869         cat >> confdefs.h <<\EOF
7870 #define HAVE_MDBM 1
7871 EOF
7872
7873  fi
7874
7875
7876         if test $ol_cv_mdbm = yes ; then
7877                 ol_link_ldbm=mdbm
7878                 ol_with_ldbm_api=mdbm
7879                 if test $ol_cv_lib_mdbm != yes ; then
7880                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
7881                 fi
7882         fi
7883 fi
7884
7885 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
7886         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
7887 echo "configure:7888: checking for GDBM library" >&5
7888 if eval "test \"`echo '$''{'ol_cv_lib_gdbm'+set}'`\" = set"; then
7889   echo $ac_n "(cached) $ac_c" 1>&6
7890 else
7891         ol_LIBS="$LIBS"
7892         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
7893 echo "configure:7894: checking for gdbm_open" >&5
7894 if eval "test \"`echo '$''{'ac_cv_func_gdbm_open'+set}'`\" = set"; then
7895   echo $ac_n "(cached) $ac_c" 1>&6
7896 else
7897   cat > conftest.$ac_ext <<EOF
7898 #line 7899 "configure"
7899 #include "confdefs.h"
7900 /* System header to define __stub macros and hopefully few prototypes,
7901     which can conflict with char gdbm_open(); below.  */
7902 #include <assert.h>
7903 /* Override any gcc2 internal prototype to avoid an error.  */
7904 /* We use char because int might match the return type of a gcc2
7905     builtin and then its argument prototype would still apply.  */
7906 char gdbm_open();
7907
7908 int main() {
7909
7910 /* The GNU C library defines this for functions which it implements
7911     to always fail with ENOSYS.  Some functions are actually named
7912     something starting with __ and the normal name is an alias.  */
7913 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
7914 choke me
7915 #else
7916 gdbm_open();
7917 #endif
7918
7919 ; return 0; }
7920 EOF
7921 if { (eval echo configure:7922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7922   rm -rf conftest*
7923   eval "ac_cv_func_gdbm_open=yes"
7924 else
7925   echo "configure: failed program was:" >&5
7926   cat conftest.$ac_ext >&5
7927   rm -rf conftest*
7928   eval "ac_cv_func_gdbm_open=no"
7929 fi
7930 rm -f conftest*
7931 fi
7932
7933 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
7934   echo "$ac_t""yes" 1>&6
7935   ol_cv_lib_gdbm=yes
7936 else
7937   echo "$ac_t""no" 1>&6
7938
7939                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
7940 echo "configure:7941: checking for gdbm_open in -lgdbm" >&5
7941 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-%__p_%'`
7942 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
7943   echo $ac_n "(cached) $ac_c" 1>&6
7944 else
7945   ac_save_LIBS="$LIBS"
7946 LIBS="-lgdbm  $LIBS"
7947 cat > conftest.$ac_ext <<EOF
7948 #line 7949 "configure"
7949 #include "confdefs.h"
7950 /* Override any gcc2 internal prototype to avoid an error.  */
7951 /* We use char because int might match the return type of a gcc2
7952     builtin and then its argument prototype would still apply.  */
7953 char gdbm_open();
7954
7955 int main() {
7956 gdbm_open()
7957 ; return 0; }
7958 EOF
7959 if { (eval echo configure:7960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7960   rm -rf conftest*
7961   eval "ac_cv_lib_$ac_lib_var=yes"
7962 else
7963   echo "configure: failed program was:" >&5
7964   cat conftest.$ac_ext >&5
7965   rm -rf conftest*
7966   eval "ac_cv_lib_$ac_lib_var=no"
7967 fi
7968 rm -f conftest*
7969 LIBS="$ac_save_LIBS"
7970
7971 fi
7972 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
7973   echo "$ac_t""yes" 1>&6
7974   ol_cv_lib_gdbm=-lgdbm
7975 else
7976   echo "$ac_t""no" 1>&6
7977 ol_cv_lib_gdbm=no
7978 fi
7979
7980         
7981 fi
7982
7983         LIBS="$ol_LIBS"
7984
7985 fi
7986
7987 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
7988
7989
7990  for ac_hdr in gdbm.h
7991 do
7992 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
7993 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
7994 echo "configure:7995: checking for $ac_hdr" >&5
7995 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
7996   echo $ac_n "(cached) $ac_c" 1>&6
7997 else
7998   cat > conftest.$ac_ext <<EOF
7999 #line 8000 "configure"
8000 #include "confdefs.h"
8001 #include <$ac_hdr>
8002 EOF
8003 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8004 { (eval echo configure:8005: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8005 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8006 if test -z "$ac_err"; then
8007   rm -rf conftest*
8008   eval "ac_cv_header_$ac_safe=yes"
8009 else
8010   echo "$ac_err" >&5
8011   echo "configure: failed program was:" >&5
8012   cat conftest.$ac_ext >&5
8013   rm -rf conftest*
8014   eval "ac_cv_header_$ac_safe=no"
8015 fi
8016 rm -f conftest*
8017 fi
8018 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8019   echo "$ac_t""yes" 1>&6
8020     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8021   cat >> confdefs.h <<EOF
8022 #define $ac_tr_hdr 1
8023 EOF
8024  
8025 else
8026   echo "$ac_t""no" 1>&6
8027 fi
8028 done
8029
8030  echo $ac_n "checking for db""... $ac_c" 1>&6
8031 echo "configure:8032: checking for db" >&5
8032 if eval "test \"`echo '$''{'ol_cv_gdbm'+set}'`\" = set"; then
8033   echo $ac_n "(cached) $ac_c" 1>&6
8034 else
8035   
8036         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
8037                 ol_cv_gdbm=no
8038         else
8039                 ol_cv_gdbm=yes
8040         fi
8041
8042 fi
8043
8044 echo "$ac_t""$ol_cv_gdbm" 1>&6
8045  if test $ol_cv_gdbm = yes ; then
8046         cat >> confdefs.h <<\EOF
8047 #define HAVE_GDBM 1
8048 EOF
8049
8050  fi
8051
8052
8053         if test $ol_cv_gdbm = yes ; then
8054                 ol_link_ldbm=gdbm
8055                 ol_with_ldbm_api=gdbm
8056
8057                 if test $ol_cv_lib_gdbm != yes ; then
8058                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
8059                 fi
8060         fi
8061 fi
8062
8063 if test $ol_with_ldbm_api = auto ; then
8064         echo "configure: warning: skipping automatic checking for NDBM, must be manually enabled." 1>&2
8065 elif test $ol_with_ldbm_api = ndbm ; then
8066         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
8067 echo "configure:8068: checking for NDBM library" >&5
8068 if eval "test \"`echo '$''{'ol_cv_lib_ndbm'+set}'`\" = set"; then
8069   echo $ac_n "(cached) $ac_c" 1>&6
8070 else
8071         ol_LIBS="$LIBS"
8072         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
8073 echo "configure:8074: checking for dbm_open" >&5
8074 if eval "test \"`echo '$''{'ac_cv_func_dbm_open'+set}'`\" = set"; then
8075   echo $ac_n "(cached) $ac_c" 1>&6
8076 else
8077   cat > conftest.$ac_ext <<EOF
8078 #line 8079 "configure"
8079 #include "confdefs.h"
8080 /* System header to define __stub macros and hopefully few prototypes,
8081     which can conflict with char dbm_open(); below.  */
8082 #include <assert.h>
8083 /* Override any gcc2 internal prototype to avoid an error.  */
8084 /* We use char because int might match the return type of a gcc2
8085     builtin and then its argument prototype would still apply.  */
8086 char dbm_open();
8087
8088 int main() {
8089
8090 /* The GNU C library defines this for functions which it implements
8091     to always fail with ENOSYS.  Some functions are actually named
8092     something starting with __ and the normal name is an alias.  */
8093 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
8094 choke me
8095 #else
8096 dbm_open();
8097 #endif
8098
8099 ; return 0; }
8100 EOF
8101 if { (eval echo configure:8102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8102   rm -rf conftest*
8103   eval "ac_cv_func_dbm_open=yes"
8104 else
8105   echo "configure: failed program was:" >&5
8106   cat conftest.$ac_ext >&5
8107   rm -rf conftest*
8108   eval "ac_cv_func_dbm_open=no"
8109 fi
8110 rm -f conftest*
8111 fi
8112
8113 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
8114   echo "$ac_t""yes" 1>&6
8115   ol_cv_lib_ndbm=yes
8116 else
8117   echo "$ac_t""no" 1>&6
8118
8119                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
8120 echo "configure:8121: checking for dbm_open in -lndbm" >&5
8121 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-%__p_%'`
8122 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8123   echo $ac_n "(cached) $ac_c" 1>&6
8124 else
8125   ac_save_LIBS="$LIBS"
8126 LIBS="-lndbm  $LIBS"
8127 cat > conftest.$ac_ext <<EOF
8128 #line 8129 "configure"
8129 #include "confdefs.h"
8130 /* Override any gcc2 internal prototype to avoid an error.  */
8131 /* We use char because int might match the return type of a gcc2
8132     builtin and then its argument prototype would still apply.  */
8133 char dbm_open();
8134
8135 int main() {
8136 dbm_open()
8137 ; return 0; }
8138 EOF
8139 if { (eval echo configure:8140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8140   rm -rf conftest*
8141   eval "ac_cv_lib_$ac_lib_var=yes"
8142 else
8143   echo "configure: failed program was:" >&5
8144   cat conftest.$ac_ext >&5
8145   rm -rf conftest*
8146   eval "ac_cv_lib_$ac_lib_var=no"
8147 fi
8148 rm -f conftest*
8149 LIBS="$ac_save_LIBS"
8150
8151 fi
8152 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8153   echo "$ac_t""yes" 1>&6
8154   ol_cv_lib_ndbm=-lndbm
8155 else
8156   echo "$ac_t""no" 1>&6
8157
8158                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
8159 echo "configure:8160: checking for dbm_open in -ldbm" >&5
8160 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-%__p_%'`
8161 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8162   echo $ac_n "(cached) $ac_c" 1>&6
8163 else
8164   ac_save_LIBS="$LIBS"
8165 LIBS="-ldbm  $LIBS"
8166 cat > conftest.$ac_ext <<EOF
8167 #line 8168 "configure"
8168 #include "confdefs.h"
8169 /* Override any gcc2 internal prototype to avoid an error.  */
8170 /* We use char because int might match the return type of a gcc2
8171     builtin and then its argument prototype would still apply.  */
8172 char dbm_open();
8173
8174 int main() {
8175 dbm_open()
8176 ; return 0; }
8177 EOF
8178 if { (eval echo configure:8179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8179   rm -rf conftest*
8180   eval "ac_cv_lib_$ac_lib_var=yes"
8181 else
8182   echo "configure: failed program was:" >&5
8183   cat conftest.$ac_ext >&5
8184   rm -rf conftest*
8185   eval "ac_cv_lib_$ac_lib_var=no"
8186 fi
8187 rm -f conftest*
8188 LIBS="$ac_save_LIBS"
8189
8190 fi
8191 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8192   echo "$ac_t""yes" 1>&6
8193   ol_cv_lib_ndbm=-ldbm
8194 else
8195   echo "$ac_t""no" 1>&6
8196 ol_cv_lib_ndbm=no
8197 fi
8198                 
8199 fi
8200
8201         
8202 fi
8203
8204         LIBS="$ol_LIBS"
8205
8206 fi
8207
8208 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
8209
8210
8211  for ac_hdr in ndbm.h
8212 do
8213 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8214 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8215 echo "configure:8216: checking for $ac_hdr" >&5
8216 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8217   echo $ac_n "(cached) $ac_c" 1>&6
8218 else
8219   cat > conftest.$ac_ext <<EOF
8220 #line 8221 "configure"
8221 #include "confdefs.h"
8222 #include <$ac_hdr>
8223 EOF
8224 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8225 { (eval echo configure:8226: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8226 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8227 if test -z "$ac_err"; then
8228   rm -rf conftest*
8229   eval "ac_cv_header_$ac_safe=yes"
8230 else
8231   echo "$ac_err" >&5
8232   echo "configure: failed program was:" >&5
8233   cat conftest.$ac_ext >&5
8234   rm -rf conftest*
8235   eval "ac_cv_header_$ac_safe=no"
8236 fi
8237 rm -f conftest*
8238 fi
8239 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8240   echo "$ac_t""yes" 1>&6
8241     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8242   cat >> confdefs.h <<EOF
8243 #define $ac_tr_hdr 1
8244 EOF
8245  
8246 else
8247   echo "$ac_t""no" 1>&6
8248 fi
8249 done
8250
8251  echo $ac_n "checking for db""... $ac_c" 1>&6
8252 echo "configure:8253: checking for db" >&5
8253 if eval "test \"`echo '$''{'ol_cv_ndbm'+set}'`\" = set"; then
8254   echo $ac_n "(cached) $ac_c" 1>&6
8255 else
8256   
8257         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
8258                 ol_cv_ndbm=no
8259         else
8260                 ol_cv_ndbm=yes
8261         fi
8262
8263 fi
8264
8265 echo "$ac_t""$ol_cv_ndbm" 1>&6
8266  if test $ol_cv_ndbm = yes ; then
8267         cat >> confdefs.h <<\EOF
8268 #define HAVE_NDBM 1
8269 EOF
8270
8271  fi
8272
8273
8274         if test $ol_cv_ndbm = yes ; then
8275                 ol_link_ldbm=ndbm
8276                 ol_with_ldbm_api=ndbm
8277
8278                 if test $ol_cv_lib_ndbm != yes ; then
8279                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
8280                 fi
8281         fi
8282 fi
8283
8284 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
8285         echo "configure: warning: could not find suitable LDBM backend" 1>&2
8286         if test $ol_enable_ldbm = yes ; then
8287                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
8288         fi
8289
8290         echo "configure: warning: disabling LDBM" 1>&2
8291         ol_enable_ldbm=no
8292 fi
8293
8294 if test $ol_enable_wrappers != no ; then
8295         for ac_hdr in tcpd.h
8296 do
8297 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8298 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8299 echo "configure:8300: checking for $ac_hdr" >&5
8300 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8301   echo $ac_n "(cached) $ac_c" 1>&6
8302 else
8303   cat > conftest.$ac_ext <<EOF
8304 #line 8305 "configure"
8305 #include "confdefs.h"
8306 #include <$ac_hdr>
8307 EOF
8308 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8309 { (eval echo configure:8310: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8310 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8311 if test -z "$ac_err"; then
8312   rm -rf conftest*
8313   eval "ac_cv_header_$ac_safe=yes"
8314 else
8315   echo "$ac_err" >&5
8316   echo "configure: failed program was:" >&5
8317   cat conftest.$ac_ext >&5
8318   rm -rf conftest*
8319   eval "ac_cv_header_$ac_safe=no"
8320 fi
8321 rm -f conftest*
8322 fi
8323 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8324   echo "$ac_t""yes" 1>&6
8325     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8326   cat >> confdefs.h <<EOF
8327 #define $ac_tr_hdr 1
8328 EOF
8329  
8330 else
8331   echo "$ac_t""no" 1>&6
8332 fi
8333 done
8334
8335
8336         if test $ac_cv_header_tcpd_h != yes ; then
8337                 have_wrappers=no
8338         else
8339                 echo $ac_n "checking for main in -lwrap""... $ac_c" 1>&6
8340 echo "configure:8341: checking for main in -lwrap" >&5
8341 ac_lib_var=`echo wrap'_'main | sed 'y%./+-%__p_%'`
8342 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8343   echo $ac_n "(cached) $ac_c" 1>&6
8344 else
8345   ac_save_LIBS="$LIBS"
8346 LIBS="-lwrap  $LIBS"
8347 cat > conftest.$ac_ext <<EOF
8348 #line 8349 "configure"
8349 #include "confdefs.h"
8350
8351 int main() {
8352 main()
8353 ; return 0; }
8354 EOF
8355 if { (eval echo configure:8356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8356   rm -rf conftest*
8357   eval "ac_cv_lib_$ac_lib_var=yes"
8358 else
8359   echo "configure: failed program was:" >&5
8360   cat conftest.$ac_ext >&5
8361   rm -rf conftest*
8362   eval "ac_cv_lib_$ac_lib_var=no"
8363 fi
8364 rm -f conftest*
8365 LIBS="$ac_save_LIBS"
8366
8367 fi
8368 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8369   echo "$ac_t""yes" 1>&6
8370   have_wrappers=yes
8371 else
8372   echo "$ac_t""no" 1>&6
8373 have_wrappers=no
8374 fi
8375
8376         fi
8377
8378         if test $have_wrappers = yes ; then
8379                 cat >> confdefs.h <<\EOF
8380 #define HAVE_TCPD 1
8381 EOF
8382
8383                 SLAPD_LIBS="$SLAPD_LIBS -lwrap"
8384
8385                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
8386 echo "configure:8387: checking for main in -lnsl" >&5
8387 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'`
8388 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8389   echo $ac_n "(cached) $ac_c" 1>&6
8390 else
8391   ac_save_LIBS="$LIBS"
8392 LIBS="-lnsl  $LIBS"
8393 cat > conftest.$ac_ext <<EOF
8394 #line 8395 "configure"
8395 #include "confdefs.h"
8396
8397 int main() {
8398 main()
8399 ; return 0; }
8400 EOF
8401 if { (eval echo configure:8402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8402   rm -rf conftest*
8403   eval "ac_cv_lib_$ac_lib_var=yes"
8404 else
8405   echo "configure: failed program was:" >&5
8406   cat conftest.$ac_ext >&5
8407   rm -rf conftest*
8408   eval "ac_cv_lib_$ac_lib_var=no"
8409 fi
8410 rm -f conftest*
8411 LIBS="$ac_save_LIBS"
8412
8413 fi
8414 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8415   echo "$ac_t""yes" 1>&6
8416     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8417     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8418   cat >> confdefs.h <<EOF
8419 #define $ac_tr_lib 1
8420 EOF
8421
8422   LIBS="-lnsl $LIBS"
8423
8424 else
8425   echo "$ac_t""no" 1>&6
8426 fi
8427
8428         else
8429                 echo "configure: warning: could not find -lwrap" 1>&2
8430                 if test $ol_enable_wrappers = yes ; then
8431                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
8432                 fi
8433
8434                 echo "configure: warning: disabling wrappers support" 1>&2
8435                 ol_enable_wrappers=no
8436         fi
8437 fi
8438
8439 if test $ol_enable_syslog != no ; then
8440         echo $ac_n "checking for openlog""... $ac_c" 1>&6
8441 echo "configure:8442: checking for openlog" >&5
8442 if eval "test \"`echo '$''{'ac_cv_func_openlog'+set}'`\" = set"; then
8443   echo $ac_n "(cached) $ac_c" 1>&6
8444 else
8445   cat > conftest.$ac_ext <<EOF
8446 #line 8447 "configure"
8447 #include "confdefs.h"
8448 /* System header to define __stub macros and hopefully few prototypes,
8449     which can conflict with char openlog(); below.  */
8450 #include <assert.h>
8451 /* Override any gcc2 internal prototype to avoid an error.  */
8452 /* We use char because int might match the return type of a gcc2
8453     builtin and then its argument prototype would still apply.  */
8454 char openlog();
8455
8456 int main() {
8457
8458 /* The GNU C library defines this for functions which it implements
8459     to always fail with ENOSYS.  Some functions are actually named
8460     something starting with __ and the normal name is an alias.  */
8461 #if defined (__stub_openlog) || defined (__stub___openlog)
8462 choke me
8463 #else
8464 openlog();
8465 #endif
8466
8467 ; return 0; }
8468 EOF
8469 if { (eval echo configure:8470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8470   rm -rf conftest*
8471   eval "ac_cv_func_openlog=yes"
8472 else
8473   echo "configure: failed program was:" >&5
8474   cat conftest.$ac_ext >&5
8475   rm -rf conftest*
8476   eval "ac_cv_func_openlog=no"
8477 fi
8478 rm -f conftest*
8479 fi
8480
8481 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
8482   echo "$ac_t""yes" 1>&6
8483   :
8484 else
8485   echo "$ac_t""no" 1>&6
8486 fi
8487
8488         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
8489                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
8490         fi
8491         ol_enable_syslog=$ac_cv_func_openlog
8492 fi
8493
8494 if test $ol_enable_dmalloc != no ; then
8495         for ac_hdr in dmalloc.h
8496 do
8497 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8498 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8499 echo "configure:8500: checking for $ac_hdr" >&5
8500 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8501   echo $ac_n "(cached) $ac_c" 1>&6
8502 else
8503   cat > conftest.$ac_ext <<EOF
8504 #line 8505 "configure"
8505 #include "confdefs.h"
8506 #include <$ac_hdr>
8507 EOF
8508 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8509 { (eval echo configure:8510: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8510 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8511 if test -z "$ac_err"; then
8512   rm -rf conftest*
8513   eval "ac_cv_header_$ac_safe=yes"
8514 else
8515   echo "$ac_err" >&5
8516   echo "configure: failed program was:" >&5
8517   cat conftest.$ac_ext >&5
8518   rm -rf conftest*
8519   eval "ac_cv_header_$ac_safe=no"
8520 fi
8521 rm -f conftest*
8522 fi
8523 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8524   echo "$ac_t""yes" 1>&6
8525     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8526   cat >> confdefs.h <<EOF
8527 #define $ac_tr_hdr 1
8528 EOF
8529  
8530 else
8531   echo "$ac_t""no" 1>&6
8532 fi
8533 done
8534
8535         echo $ac_n "checking for dmalloc_shutdown in -ldmalloc""... $ac_c" 1>&6
8536 echo "configure:8537: checking for dmalloc_shutdown in -ldmalloc" >&5
8537 ac_lib_var=`echo dmalloc'_'dmalloc_shutdown | sed 'y%./+-%__p_%'`
8538 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8539   echo $ac_n "(cached) $ac_c" 1>&6
8540 else
8541   ac_save_LIBS="$LIBS"
8542 LIBS="-ldmalloc  $LIBS"
8543 cat > conftest.$ac_ext <<EOF
8544 #line 8545 "configure"
8545 #include "confdefs.h"
8546 /* Override any gcc2 internal prototype to avoid an error.  */
8547 /* We use char because int might match the return type of a gcc2
8548     builtin and then its argument prototype would still apply.  */
8549 char dmalloc_shutdown();
8550
8551 int main() {
8552 dmalloc_shutdown()
8553 ; return 0; }
8554 EOF
8555 if { (eval echo configure:8556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8556   rm -rf conftest*
8557   eval "ac_cv_lib_$ac_lib_var=yes"
8558 else
8559   echo "configure: failed program was:" >&5
8560   cat conftest.$ac_ext >&5
8561   rm -rf conftest*
8562   eval "ac_cv_lib_$ac_lib_var=no"
8563 fi
8564 rm -f conftest*
8565 LIBS="$ac_save_LIBS"
8566
8567 fi
8568 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8569   echo "$ac_t""yes" 1>&6
8570     ac_tr_lib=HAVE_LIB`echo dmalloc | sed -e 's/[^a-zA-Z0-9_]/_/g' \
8571     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
8572   cat >> confdefs.h <<EOF
8573 #define $ac_tr_lib 1
8574 EOF
8575
8576   LIBS="-ldmalloc $LIBS"
8577
8578 else
8579   echo "$ac_t""no" 1>&6
8580 fi
8581
8582 fi
8583
8584 if test $ol_enable_tcl != no ; then
8585         for ac_hdr in tcl.h
8586 do
8587 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8588 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8589 echo "configure:8590: checking for $ac_hdr" >&5
8590 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8591   echo $ac_n "(cached) $ac_c" 1>&6
8592 else
8593   cat > conftest.$ac_ext <<EOF
8594 #line 8595 "configure"
8595 #include "confdefs.h"
8596 #include <$ac_hdr>
8597 EOF
8598 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8599 { (eval echo configure:8600: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8600 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8601 if test -z "$ac_err"; then
8602   rm -rf conftest*
8603   eval "ac_cv_header_$ac_safe=yes"
8604 else
8605   echo "$ac_err" >&5
8606   echo "configure: failed program was:" >&5
8607   cat conftest.$ac_ext >&5
8608   rm -rf conftest*
8609   eval "ac_cv_header_$ac_safe=no"
8610 fi
8611 rm -f conftest*
8612 fi
8613 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8614   echo "$ac_t""yes" 1>&6
8615     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8616   cat >> confdefs.h <<EOF
8617 #define $ac_tr_hdr 1
8618 EOF
8619  
8620 else
8621   echo "$ac_t""no" 1>&6
8622 fi
8623 done
8624
8625
8626         if test $ac_cv_header_tcl_h != yes ; then
8627                 have_tcl=no
8628         else
8629                 echo $ac_n "checking for main in -ltcl""... $ac_c" 1>&6
8630 echo "configure:8631: checking for main in -ltcl" >&5
8631 ac_lib_var=`echo tcl'_'main | sed 'y%./+-%__p_%'`
8632 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8633   echo $ac_n "(cached) $ac_c" 1>&6
8634 else
8635   ac_save_LIBS="$LIBS"
8636 LIBS="-ltcl  $LIBS"
8637 cat > conftest.$ac_ext <<EOF
8638 #line 8639 "configure"
8639 #include "confdefs.h"
8640
8641 int main() {
8642 main()
8643 ; return 0; }
8644 EOF
8645 if { (eval echo configure:8646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8646   rm -rf conftest*
8647   eval "ac_cv_lib_$ac_lib_var=yes"
8648 else
8649   echo "configure: failed program was:" >&5
8650   cat conftest.$ac_ext >&5
8651   rm -rf conftest*
8652   eval "ac_cv_lib_$ac_lib_var=no"
8653 fi
8654 rm -f conftest*
8655 LIBS="$ac_save_LIBS"
8656
8657 fi
8658 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8659   echo "$ac_t""yes" 1>&6
8660   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl"
8661 else
8662   echo "$ac_t""no" 1>&6
8663 have_tcl=no
8664 fi
8665
8666
8667                 if test $have_tcl != yes; then
8668                         echo $ac_n "checking for main in -ltcl7.6""... $ac_c" 1>&6
8669 echo "configure:8670: checking for main in -ltcl7.6" >&5
8670 ac_lib_var=`echo tcl7.6'_'main | sed 'y%./+-%__p_%'`
8671 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8672   echo $ac_n "(cached) $ac_c" 1>&6
8673 else
8674   ac_save_LIBS="$LIBS"
8675 LIBS="-ltcl7.6  $LIBS"
8676 cat > conftest.$ac_ext <<EOF
8677 #line 8678 "configure"
8678 #include "confdefs.h"
8679
8680 int main() {
8681 main()
8682 ; return 0; }
8683 EOF
8684 if { (eval echo configure:8685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8685   rm -rf conftest*
8686   eval "ac_cv_lib_$ac_lib_var=yes"
8687 else
8688   echo "configure: failed program was:" >&5
8689   cat conftest.$ac_ext >&5
8690   rm -rf conftest*
8691   eval "ac_cv_lib_$ac_lib_var=no"
8692 fi
8693 rm -f conftest*
8694 LIBS="$ac_save_LIBS"
8695
8696 fi
8697 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8698   echo "$ac_t""yes" 1>&6
8699   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl7.6"
8700 else
8701   echo "$ac_t""no" 1>&6
8702 have_tcl=no
8703 fi
8704
8705                 fi
8706
8707                 if test $have_tcl != yes; then
8708                         echo $ac_n "checking for main in -ltcl8.0""... $ac_c" 1>&6
8709 echo "configure:8710: checking for main in -ltcl8.0" >&5
8710 ac_lib_var=`echo tcl8.0'_'main | sed 'y%./+-%__p_%'`
8711 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8712   echo $ac_n "(cached) $ac_c" 1>&6
8713 else
8714   ac_save_LIBS="$LIBS"
8715 LIBS="-ltcl8.0  $LIBS"
8716 cat > conftest.$ac_ext <<EOF
8717 #line 8718 "configure"
8718 #include "confdefs.h"
8719
8720 int main() {
8721 main()
8722 ; return 0; }
8723 EOF
8724 if { (eval echo configure:8725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8725   rm -rf conftest*
8726   eval "ac_cv_lib_$ac_lib_var=yes"
8727 else
8728   echo "configure: failed program was:" >&5
8729   cat conftest.$ac_ext >&5
8730   rm -rf conftest*
8731   eval "ac_cv_lib_$ac_lib_var=no"
8732 fi
8733 rm -f conftest*
8734 LIBS="$ac_save_LIBS"
8735
8736 fi
8737 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8738   echo "$ac_t""yes" 1>&6
8739   have_tcl=yes; SLAPD_LIBS="$SLAPD_LIBS -ltcl8.0"
8740 else
8741   echo "$ac_t""no" 1>&6
8742 have_tcl=no
8743 fi
8744
8745                 fi
8746         fi
8747
8748         if test $have_tcl != yes ; then
8749                 echo "configure: warning: could not find -ltcl" 1>&2
8750                 if test $ol_enable_tcl = yes ; then
8751                         { echo "configure: error: could not find tcl, select appropriate options or disable" 1>&2; exit 1; }
8752                 fi
8753
8754                 ol_enable_tcl=no
8755         fi
8756 fi
8757
8758 # ud needs termcap (should insert check here)
8759 ol_link_termcap=no
8760 for ac_hdr in termcap.h ncurses.h
8761 do
8762 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8763 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8764 echo "configure:8765: checking for $ac_hdr" >&5
8765 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8766   echo $ac_n "(cached) $ac_c" 1>&6
8767 else
8768   cat > conftest.$ac_ext <<EOF
8769 #line 8770 "configure"
8770 #include "confdefs.h"
8771 #include <$ac_hdr>
8772 EOF
8773 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8774 { (eval echo configure:8775: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8775 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8776 if test -z "$ac_err"; then
8777   rm -rf conftest*
8778   eval "ac_cv_header_$ac_safe=yes"
8779 else
8780   echo "$ac_err" >&5
8781   echo "configure: failed program was:" >&5
8782   cat conftest.$ac_ext >&5
8783   rm -rf conftest*
8784   eval "ac_cv_header_$ac_safe=no"
8785 fi
8786 rm -f conftest*
8787 fi
8788 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8789   echo "$ac_t""yes" 1>&6
8790     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8791   cat >> confdefs.h <<EOF
8792 #define $ac_tr_hdr 1
8793 EOF
8794  
8795 else
8796   echo "$ac_t""no" 1>&6
8797 fi
8798 done
8799
8800
8801 if test $ol_link_termcap = no ; then
8802         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
8803 echo "configure:8804: checking for tputs in -ltermcap" >&5
8804 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-%__p_%'`
8805 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8806   echo $ac_n "(cached) $ac_c" 1>&6
8807 else
8808   ac_save_LIBS="$LIBS"
8809 LIBS="-ltermcap  $LIBS"
8810 cat > conftest.$ac_ext <<EOF
8811 #line 8812 "configure"
8812 #include "confdefs.h"
8813 /* Override any gcc2 internal prototype to avoid an error.  */
8814 /* We use char because int might match the return type of a gcc2
8815     builtin and then its argument prototype would still apply.  */
8816 char tputs();
8817
8818 int main() {
8819 tputs()
8820 ; return 0; }
8821 EOF
8822 if { (eval echo configure:8823: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8823   rm -rf conftest*
8824   eval "ac_cv_lib_$ac_lib_var=yes"
8825 else
8826   echo "configure: failed program was:" >&5
8827   cat conftest.$ac_ext >&5
8828   rm -rf conftest*
8829   eval "ac_cv_lib_$ac_lib_var=no"
8830 fi
8831 rm -f conftest*
8832 LIBS="$ac_save_LIBS"
8833
8834 fi
8835 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8836   echo "$ac_t""yes" 1>&6
8837   have_termcap=yes
8838 else
8839   echo "$ac_t""no" 1>&6
8840 have_termcap=no
8841 fi
8842
8843         if test $have_termcap = yes ; then
8844                 cat >> confdefs.h <<\EOF
8845 #define HAVE_TERMCAP 1
8846 EOF
8847
8848                 ol_link_termcap=yes
8849                 TERMCAP_LIBS=-ltermcap
8850         fi
8851 fi
8852
8853 if test $ol_link_termcap = no ; then
8854         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
8855 echo "configure:8856: checking for initscr in -lncurses" >&5
8856 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'`
8857 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8858   echo $ac_n "(cached) $ac_c" 1>&6
8859 else
8860   ac_save_LIBS="$LIBS"
8861 LIBS="-lncurses  $LIBS"
8862 cat > conftest.$ac_ext <<EOF
8863 #line 8864 "configure"
8864 #include "confdefs.h"
8865 /* Override any gcc2 internal prototype to avoid an error.  */
8866 /* We use char because int might match the return type of a gcc2
8867     builtin and then its argument prototype would still apply.  */
8868 char initscr();
8869
8870 int main() {
8871 initscr()
8872 ; return 0; }
8873 EOF
8874 if { (eval echo configure:8875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8875   rm -rf conftest*
8876   eval "ac_cv_lib_$ac_lib_var=yes"
8877 else
8878   echo "configure: failed program was:" >&5
8879   cat conftest.$ac_ext >&5
8880   rm -rf conftest*
8881   eval "ac_cv_lib_$ac_lib_var=no"
8882 fi
8883 rm -f conftest*
8884 LIBS="$ac_save_LIBS"
8885
8886 fi
8887 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8888   echo "$ac_t""yes" 1>&6
8889   have_ncurses=yes
8890 else
8891   echo "$ac_t""no" 1>&6
8892 have_ncurses=no
8893 fi
8894
8895         if test $have_ncurses = yes ; then
8896                 cat >> confdefs.h <<\EOF
8897 #define HAVE_NCURSES 1
8898 EOF
8899
8900                 ol_link_termcap=yes
8901                 TERMCAP_LIBS=-lncurses
8902         fi
8903 fi
8904
8905 if test $ol_link_termcap = no ; then
8906         cat >> confdefs.h <<\EOF
8907 #define NO_TERMCAP 1
8908 EOF
8909
8910         TERMCAP_LIBS=
8911 fi
8912
8913 ol_link_readline=no
8914 if test $ol_with_readline != no ; then
8915         for ac_hdr in readline/readline.h readline/history.h
8916 do
8917 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
8918 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
8919 echo "configure:8920: checking for $ac_hdr" >&5
8920 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
8921   echo $ac_n "(cached) $ac_c" 1>&6
8922 else
8923   cat > conftest.$ac_ext <<EOF
8924 #line 8925 "configure"
8925 #include "confdefs.h"
8926 #include <$ac_hdr>
8927 EOF
8928 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
8929 { (eval echo configure:8930: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
8930 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
8931 if test -z "$ac_err"; then
8932   rm -rf conftest*
8933   eval "ac_cv_header_$ac_safe=yes"
8934 else
8935   echo "$ac_err" >&5
8936   echo "configure: failed program was:" >&5
8937   cat conftest.$ac_ext >&5
8938   rm -rf conftest*
8939   eval "ac_cv_header_$ac_safe=no"
8940 fi
8941 rm -f conftest*
8942 fi
8943 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
8944   echo "$ac_t""yes" 1>&6
8945     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
8946   cat >> confdefs.h <<EOF
8947 #define $ac_tr_hdr 1
8948 EOF
8949  
8950 else
8951   echo "$ac_t""no" 1>&6
8952 fi
8953 done
8954
8955
8956         if test $ac_cv_header_readline_readline_h = yes ; then
8957                 save_LIBS="$LIBS"
8958                 LIBS="$TERMCAP_LIBS $LIBS"
8959                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
8960 echo "configure:8961: checking for readline in -lreadline" >&5
8961 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
8962 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
8963   echo $ac_n "(cached) $ac_c" 1>&6
8964 else
8965   ac_save_LIBS="$LIBS"
8966 LIBS="-lreadline  $LIBS"
8967 cat > conftest.$ac_ext <<EOF
8968 #line 8969 "configure"
8969 #include "confdefs.h"
8970 /* Override any gcc2 internal prototype to avoid an error.  */
8971 /* We use char because int might match the return type of a gcc2
8972     builtin and then its argument prototype would still apply.  */
8973 char readline();
8974
8975 int main() {
8976 readline()
8977 ; return 0; }
8978 EOF
8979 if { (eval echo configure:8980: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8980   rm -rf conftest*
8981   eval "ac_cv_lib_$ac_lib_var=yes"
8982 else
8983   echo "configure: failed program was:" >&5
8984   cat conftest.$ac_ext >&5
8985   rm -rf conftest*
8986   eval "ac_cv_lib_$ac_lib_var=no"
8987 fi
8988 rm -f conftest*
8989 LIBS="$ac_save_LIBS"
8990
8991 fi
8992 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
8993   echo "$ac_t""yes" 1>&6
8994   have_readline=yes
8995 else
8996   echo "$ac_t""no" 1>&6
8997 have_readline=no
8998 fi
8999
9000                 LIBS="$save_LIBS"
9001                         
9002                 if test $have_readline = yes ; then
9003                         ol_with_readline=found
9004                         ol_link_readline=yes
9005
9006                         READLINE_LIBS="-lreadline"
9007                 fi
9008         fi
9009 fi
9010
9011 if test $ol_link_readline = yes ; then
9012         cat >> confdefs.h <<\EOF
9013 #define HAVE_READLINE 1
9014 EOF
9015
9016 fi
9017
9018
9019 # FreeBSD (and others) have crypt(3) in -lcrypt
9020 if test $ol_enable_crypt != no ; then
9021         echo $ac_n "checking for crypt""... $ac_c" 1>&6
9022 echo "configure:9023: checking for crypt" >&5
9023 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then
9024   echo $ac_n "(cached) $ac_c" 1>&6
9025 else
9026   cat > conftest.$ac_ext <<EOF
9027 #line 9028 "configure"
9028 #include "confdefs.h"
9029 /* System header to define __stub macros and hopefully few prototypes,
9030     which can conflict with char crypt(); below.  */
9031 #include <assert.h>
9032 /* Override any gcc2 internal prototype to avoid an error.  */
9033 /* We use char because int might match the return type of a gcc2
9034     builtin and then its argument prototype would still apply.  */
9035 char crypt();
9036
9037 int main() {
9038
9039 /* The GNU C library defines this for functions which it implements
9040     to always fail with ENOSYS.  Some functions are actually named
9041     something starting with __ and the normal name is an alias.  */
9042 #if defined (__stub_crypt) || defined (__stub___crypt)
9043 choke me
9044 #else
9045 crypt();
9046 #endif
9047
9048 ; return 0; }
9049 EOF
9050 if { (eval echo configure:9051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9051   rm -rf conftest*
9052   eval "ac_cv_func_crypt=yes"
9053 else
9054   echo "configure: failed program was:" >&5
9055   cat conftest.$ac_ext >&5
9056   rm -rf conftest*
9057   eval "ac_cv_func_crypt=no"
9058 fi
9059 rm -f conftest*
9060 fi
9061
9062 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
9063   echo "$ac_t""yes" 1>&6
9064   have_crypt=yes
9065 else
9066   echo "$ac_t""no" 1>&6
9067
9068                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
9069 echo "configure:9070: checking for crypt in -lcrypt" >&5
9070 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
9071 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9072   echo $ac_n "(cached) $ac_c" 1>&6
9073 else
9074   ac_save_LIBS="$LIBS"
9075 LIBS="-lcrypt  $LIBS"
9076 cat > conftest.$ac_ext <<EOF
9077 #line 9078 "configure"
9078 #include "confdefs.h"
9079 /* Override any gcc2 internal prototype to avoid an error.  */
9080 /* We use char because int might match the return type of a gcc2
9081     builtin and then its argument prototype would still apply.  */
9082 char crypt();
9083
9084 int main() {
9085 crypt()
9086 ; return 0; }
9087 EOF
9088 if { (eval echo configure:9089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9089   rm -rf conftest*
9090   eval "ac_cv_lib_$ac_lib_var=yes"
9091 else
9092   echo "configure: failed program was:" >&5
9093   cat conftest.$ac_ext >&5
9094   rm -rf conftest*
9095   eval "ac_cv_lib_$ac_lib_var=no"
9096 fi
9097 rm -f conftest*
9098 LIBS="$ac_save_LIBS"
9099
9100 fi
9101 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9102   echo "$ac_t""yes" 1>&6
9103   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
9104                         have_crypt=yes
9105 else
9106   echo "$ac_t""no" 1>&6
9107 have_crypt=no
9108 fi
9109
9110 fi
9111
9112
9113         if test $have_crypt = yes ; then
9114                 cat >> confdefs.h <<\EOF
9115 #define HAVE_CRYPT 1
9116 EOF
9117
9118         else
9119                 echo "configure: warning: could not find crypt" 1>&2
9120                 if test $ol_enable_crypt = yes ; then
9121                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
9122                 fi
9123
9124                 echo "configure: warning: disabling crypt support" 1>&2
9125                 ol_enable_crypt=no
9126         fi
9127 fi
9128
9129 # FreeBSD (and others) have setproctitle(3) in -lutil
9130 if test $ol_enable_proctitle != no ; then
9131         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
9132 echo "configure:9133: checking for setproctitle" >&5
9133 if eval "test \"`echo '$''{'ac_cv_func_setproctitle'+set}'`\" = set"; then
9134   echo $ac_n "(cached) $ac_c" 1>&6
9135 else
9136   cat > conftest.$ac_ext <<EOF
9137 #line 9138 "configure"
9138 #include "confdefs.h"
9139 /* System header to define __stub macros and hopefully few prototypes,
9140     which can conflict with char setproctitle(); below.  */
9141 #include <assert.h>
9142 /* Override any gcc2 internal prototype to avoid an error.  */
9143 /* We use char because int might match the return type of a gcc2
9144     builtin and then its argument prototype would still apply.  */
9145 char setproctitle();
9146
9147 int main() {
9148
9149 /* The GNU C library defines this for functions which it implements
9150     to always fail with ENOSYS.  Some functions are actually named
9151     something starting with __ and the normal name is an alias.  */
9152 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
9153 choke me
9154 #else
9155 setproctitle();
9156 #endif
9157
9158 ; return 0; }
9159 EOF
9160 if { (eval echo configure:9161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9161   rm -rf conftest*
9162   eval "ac_cv_func_setproctitle=yes"
9163 else
9164   echo "configure: failed program was:" >&5
9165   cat conftest.$ac_ext >&5
9166   rm -rf conftest*
9167   eval "ac_cv_func_setproctitle=no"
9168 fi
9169 rm -f conftest*
9170 fi
9171
9172 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
9173   echo "$ac_t""yes" 1>&6
9174   have_setproctitle=yes
9175 else
9176   echo "$ac_t""no" 1>&6
9177
9178                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
9179 echo "configure:9180: checking for setproctitle in -lutil" >&5
9180 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-%__p_%'`
9181 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9182   echo $ac_n "(cached) $ac_c" 1>&6
9183 else
9184   ac_save_LIBS="$LIBS"
9185 LIBS="-lutil  $LIBS"
9186 cat > conftest.$ac_ext <<EOF
9187 #line 9188 "configure"
9188 #include "confdefs.h"
9189 /* Override any gcc2 internal prototype to avoid an error.  */
9190 /* We use char because int might match the return type of a gcc2
9191     builtin and then its argument prototype would still apply.  */
9192 char setproctitle();
9193
9194 int main() {
9195 setproctitle()
9196 ; return 0; }
9197 EOF
9198 if { (eval echo configure:9199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9199   rm -rf conftest*
9200   eval "ac_cv_lib_$ac_lib_var=yes"
9201 else
9202   echo "configure: failed program was:" >&5
9203   cat conftest.$ac_ext >&5
9204   rm -rf conftest*
9205   eval "ac_cv_lib_$ac_lib_var=no"
9206 fi
9207 rm -f conftest*
9208 LIBS="$ac_save_LIBS"
9209
9210 fi
9211 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9212   echo "$ac_t""yes" 1>&6
9213   have_setproctitle=yes
9214                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
9215 else
9216   echo "$ac_t""no" 1>&6
9217 have_setproctitle=no
9218                         LIBOBJS="$LIBOBJS setproctitle.o"
9219 fi
9220
9221 fi
9222
9223
9224         if test $have_setproctitle = yes ; then
9225                 cat >> confdefs.h <<\EOF
9226 #define HAVE_SETPROCTITLE 1
9227 EOF
9228
9229         fi
9230 fi
9231
9232 # test for EBCDIC
9233 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
9234 echo "configure:9235: checking for EBCDIC" >&5
9235 if eval "test \"`echo '$''{'ol_cv_cpp_ebcdic'+set}'`\" = set"; then
9236   echo $ac_n "(cached) $ac_c" 1>&6
9237 else
9238   
9239         cat > conftest.$ac_ext <<EOF
9240 #line 9241 "configure"
9241 #include "confdefs.h"
9242
9243 #if !('M' == 0xd4)
9244 #include <__ASCII__/generate_error.h>
9245 #endif
9246
9247 EOF
9248 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9249 { (eval echo configure:9250: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9250 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9251 if test -z "$ac_err"; then
9252   rm -rf conftest*
9253   ol_cv_cpp_ebcdic=yes
9254 else
9255   echo "$ac_err" >&5
9256   echo "configure: failed program was:" >&5
9257   cat conftest.$ac_ext >&5
9258   rm -rf conftest*
9259   ol_cv_cpp_ebcdic=no
9260 fi
9261 rm -f conftest*
9262 fi
9263
9264 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
9265 if test $ol_cv_cpp_ebcdic = yes ; then
9266         cat >> confdefs.h <<\EOF
9267 #define HAVE_EBCDIC 1
9268 EOF
9269
9270 fi
9271
9272 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9273 echo "configure:9274: checking for ANSI C header files" >&5
9274 if eval "test \"`echo '$''{'ol_cv_header_stdc'+set}'`\" = set"; then
9275   echo $ac_n "(cached) $ac_c" 1>&6
9276 else
9277   cat > conftest.$ac_ext <<EOF
9278 #line 9279 "configure"
9279 #include "confdefs.h"
9280 #include <stdlib.h>
9281 #include <stdarg.h>
9282 #include <string.h>
9283 #include <float.h>
9284 EOF
9285 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9286 { (eval echo configure:9287: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9287 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9288 if test -z "$ac_err"; then
9289   rm -rf conftest*
9290   ol_cv_header_stdc=yes
9291 else
9292   echo "$ac_err" >&5
9293   echo "configure: failed program was:" >&5
9294   cat conftest.$ac_ext >&5
9295   rm -rf conftest*
9296   ol_cv_header_stdc=no
9297 fi
9298 rm -f conftest*
9299
9300 if test $ol_cv_header_stdc = yes; then
9301   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9302 cat > conftest.$ac_ext <<EOF
9303 #line 9304 "configure"
9304 #include "confdefs.h"
9305 #include <string.h>
9306 EOF
9307 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9308   egrep "memchr" >/dev/null 2>&1; then
9309   :
9310 else
9311   rm -rf conftest*
9312   ol_cv_header_stdc=no
9313 fi
9314 rm -f conftest*
9315
9316 fi
9317
9318 if test $ol_cv_header_stdc = yes; then
9319   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9320 cat > conftest.$ac_ext <<EOF
9321 #line 9322 "configure"
9322 #include "confdefs.h"
9323 #include <stdlib.h>
9324 EOF
9325 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9326   egrep "free" >/dev/null 2>&1; then
9327   :
9328 else
9329   rm -rf conftest*
9330   ol_cv_header_stdc=no
9331 fi
9332 rm -f conftest*
9333
9334 fi
9335
9336 if test $ol_cv_header_stdc = yes; then
9337   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9338 if test "$cross_compiling" = yes; then
9339   :
9340 else
9341   cat > conftest.$ac_ext <<EOF
9342 #line 9343 "configure"
9343 #include "confdefs.h"
9344 #include <ctype.h>
9345 #ifndef HAVE_EBCDIC
9346 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9347 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9348 #else
9349 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
9350                 || ('j' <= (c) && (c) <= 'r') \
9351                 || ('s' <= (c) && (c) <= 'z'))
9352 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
9353 #endif
9354 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9355 int main () { int i; for (i = 0; i < 256; i++)
9356 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9357 exit (0); }
9358
9359 EOF
9360 if { (eval echo configure:9361: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9361 then
9362   :
9363 else
9364   echo "configure: failed program was:" >&5
9365   cat conftest.$ac_ext >&5
9366   rm -fr conftest*
9367   ol_cv_header_stdc=no
9368 fi
9369 rm -fr conftest*
9370 fi
9371
9372 fi
9373 fi
9374
9375 echo "$ac_t""$ol_cv_header_stdc" 1>&6
9376 if test $ol_cv_header_stdc = yes; then
9377   cat >> confdefs.h <<\EOF
9378 #define STDC_HEADERS 1
9379 EOF
9380
9381 fi
9382 ac_cv_header_stdc=disable
9383
9384
9385 if test $ol_cv_header_stdc != yes; then
9386         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
9387 fi
9388
9389 ac_header_dirent=no
9390 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
9391 do
9392 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9393 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
9394 echo "configure:9395: checking for $ac_hdr that defines DIR" >&5
9395 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
9396   echo $ac_n "(cached) $ac_c" 1>&6
9397 else
9398   cat > conftest.$ac_ext <<EOF
9399 #line 9400 "configure"
9400 #include "confdefs.h"
9401 #include <sys/types.h>
9402 #include <$ac_hdr>
9403 int main() {
9404 DIR *dirp = 0;
9405 ; return 0; }
9406 EOF
9407 if { (eval echo configure:9408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9408   rm -rf conftest*
9409   eval "ac_cv_header_dirent_$ac_safe=yes"
9410 else
9411   echo "configure: failed program was:" >&5
9412   cat conftest.$ac_ext >&5
9413   rm -rf conftest*
9414   eval "ac_cv_header_dirent_$ac_safe=no"
9415 fi
9416 rm -f conftest*
9417 fi
9418 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
9419   echo "$ac_t""yes" 1>&6
9420     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9421   cat >> confdefs.h <<EOF
9422 #define $ac_tr_hdr 1
9423 EOF
9424  ac_header_dirent=$ac_hdr; break
9425 else
9426   echo "$ac_t""no" 1>&6
9427 fi
9428 done
9429 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
9430 if test $ac_header_dirent = dirent.h; then
9431 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
9432 echo "configure:9433: checking for opendir in -ldir" >&5
9433 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
9434 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9435   echo $ac_n "(cached) $ac_c" 1>&6
9436 else
9437   ac_save_LIBS="$LIBS"
9438 LIBS="-ldir  $LIBS"
9439 cat > conftest.$ac_ext <<EOF
9440 #line 9441 "configure"
9441 #include "confdefs.h"
9442 /* Override any gcc2 internal prototype to avoid an error.  */
9443 /* We use char because int might match the return type of a gcc2
9444     builtin and then its argument prototype would still apply.  */
9445 char opendir();
9446
9447 int main() {
9448 opendir()
9449 ; return 0; }
9450 EOF
9451 if { (eval echo configure:9452: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9452   rm -rf conftest*
9453   eval "ac_cv_lib_$ac_lib_var=yes"
9454 else
9455   echo "configure: failed program was:" >&5
9456   cat conftest.$ac_ext >&5
9457   rm -rf conftest*
9458   eval "ac_cv_lib_$ac_lib_var=no"
9459 fi
9460 rm -f conftest*
9461 LIBS="$ac_save_LIBS"
9462
9463 fi
9464 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9465   echo "$ac_t""yes" 1>&6
9466   LIBS="$LIBS -ldir"
9467 else
9468   echo "$ac_t""no" 1>&6
9469 fi
9470
9471 else
9472 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
9473 echo "configure:9474: checking for opendir in -lx" >&5
9474 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
9475 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
9476   echo $ac_n "(cached) $ac_c" 1>&6
9477 else
9478   ac_save_LIBS="$LIBS"
9479 LIBS="-lx  $LIBS"
9480 cat > conftest.$ac_ext <<EOF
9481 #line 9482 "configure"
9482 #include "confdefs.h"
9483 /* Override any gcc2 internal prototype to avoid an error.  */
9484 /* We use char because int might match the return type of a gcc2
9485     builtin and then its argument prototype would still apply.  */
9486 char opendir();
9487
9488 int main() {
9489 opendir()
9490 ; return 0; }
9491 EOF
9492 if { (eval echo configure:9493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9493   rm -rf conftest*
9494   eval "ac_cv_lib_$ac_lib_var=yes"
9495 else
9496   echo "configure: failed program was:" >&5
9497   cat conftest.$ac_ext >&5
9498   rm -rf conftest*
9499   eval "ac_cv_lib_$ac_lib_var=no"
9500 fi
9501 rm -f conftest*
9502 LIBS="$ac_save_LIBS"
9503
9504 fi
9505 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9506   echo "$ac_t""yes" 1>&6
9507   LIBS="$LIBS -lx"
9508 else
9509   echo "$ac_t""no" 1>&6
9510 fi
9511
9512 fi
9513
9514 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
9515 echo "configure:9516: checking for sys/wait.h that is POSIX.1 compatible" >&5
9516 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
9517   echo $ac_n "(cached) $ac_c" 1>&6
9518 else
9519   cat > conftest.$ac_ext <<EOF
9520 #line 9521 "configure"
9521 #include "confdefs.h"
9522 #include <sys/types.h>
9523 #include <sys/wait.h>
9524 #ifndef WEXITSTATUS
9525 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
9526 #endif
9527 #ifndef WIFEXITED
9528 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
9529 #endif
9530 int main() {
9531 int s;
9532 wait (&s);
9533 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
9534 ; return 0; }
9535 EOF
9536 if { (eval echo configure:9537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
9537   rm -rf conftest*
9538   ac_cv_header_sys_wait_h=yes
9539 else
9540   echo "configure: failed program was:" >&5
9541   cat conftest.$ac_ext >&5
9542   rm -rf conftest*
9543   ac_cv_header_sys_wait_h=no
9544 fi
9545 rm -f conftest*
9546 fi
9547
9548 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
9549 if test $ac_cv_header_sys_wait_h = yes; then
9550   cat >> confdefs.h <<\EOF
9551 #define HAVE_SYS_WAIT_H 1
9552 EOF
9553
9554 fi
9555
9556 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
9557 echo "configure:9558: checking POSIX termios" >&5
9558 if eval "test \"`echo '$''{'am_cv_sys_posix_termios'+set}'`\" = set"; then
9559   echo $ac_n "(cached) $ac_c" 1>&6
9560 else
9561   cat > conftest.$ac_ext <<EOF
9562 #line 9563 "configure"
9563 #include "confdefs.h"
9564 #include <sys/types.h>
9565 #include <unistd.h>
9566 #include <termios.h>
9567 int main() {
9568 /* SunOS 4.0.3 has termios.h but not the library calls.  */
9569    tcgetattr(0, 0);
9570 ; return 0; }
9571 EOF
9572 if { (eval echo configure:9573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9573   rm -rf conftest*
9574   am_cv_sys_posix_termios=yes
9575 else
9576   echo "configure: failed program was:" >&5
9577   cat conftest.$ac_ext >&5
9578   rm -rf conftest*
9579   am_cv_sys_posix_termios=no
9580 fi
9581 rm -f conftest*
9582 fi
9583
9584 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
9585
9586
9587  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
9588 echo "configure:9589: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
9589 if eval "test \"`echo '$''{'am_cv_sys_tiocgwinsz_needs_sys_ioctl_h'+set}'`\" = set"; then
9590   echo $ac_n "(cached) $ac_c" 1>&6
9591 else
9592   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
9593
9594   gwinsz_in_termios_h=no
9595   if test $am_cv_sys_posix_termios = yes; then
9596     cat > conftest.$ac_ext <<EOF
9597 #line 9598 "configure"
9598 #include "confdefs.h"
9599 #include <sys/types.h>
9600 #     include <termios.h>
9601 #     ifdef TIOCGWINSZ
9602         yes
9603 #     endif
9604     
9605 EOF
9606 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9607   egrep "yes" >/dev/null 2>&1; then
9608   rm -rf conftest*
9609   gwinsz_in_termios_h=yes
9610 fi
9611 rm -f conftest*
9612
9613   fi
9614
9615   if test $gwinsz_in_termios_h = no; then
9616     cat > conftest.$ac_ext <<EOF
9617 #line 9618 "configure"
9618 #include "confdefs.h"
9619 #include <sys/types.h>
9620 #     include <sys/ioctl.h>
9621 #     ifdef TIOCGWINSZ
9622         yes
9623 #     endif
9624     
9625 EOF
9626 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9627   egrep "yes" >/dev/null 2>&1; then
9628   rm -rf conftest*
9629   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
9630 fi
9631 rm -f conftest*
9632
9633   fi
9634   
9635 fi
9636
9637 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
9638   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
9639     cat >> confdefs.h <<\EOF
9640 #define GWINSZ_IN_SYS_IOCTL 1
9641 EOF
9642
9643   fi
9644
9645 if test $am_cv_sys_posix_termios = yes ; then
9646         cat >> confdefs.h <<\EOF
9647 #define HAVE_POSIX_TERMIOS 1
9648 EOF
9649
9650 fi
9651
9652 for ac_hdr in \
9653         arpa/inet.h             \
9654         arpa/nameser.h  \
9655         assert.h                \
9656         crypt.h                 \
9657         errno.h                 \
9658         fcntl.h                 \
9659         filio.h                 \
9660         getopt.h                \
9661         grp.h                   \
9662         libutil.h               \
9663         limits.h                \
9664         locale.h                \
9665         malloc.h                \
9666         memory.h                \
9667         regex.h                 \
9668         psap.h                  \
9669         pwd.h                   \
9670         resolv.h                \
9671         sgtty.h                 \
9672         stdarg.h                \
9673         stddef.h                \
9674         string.h                \
9675         strings.h               \
9676         sysexits.h              \
9677         sys/file.h              \
9678         sys/filio.h             \
9679         sys/errno.h             \
9680         sys/ioctl.h             \
9681         sys/param.h             \
9682         sys/resource.h  \
9683         sys/socket.h    \
9684         sys/syslog.h    \
9685         sys/time.h              \
9686         sys/types.h             \
9687         syslog.h                \
9688         termios.h               \
9689         unistd.h                \
9690
9691 do
9692 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
9693 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
9694 echo "configure:9695: checking for $ac_hdr" >&5
9695 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
9696   echo $ac_n "(cached) $ac_c" 1>&6
9697 else
9698   cat > conftest.$ac_ext <<EOF
9699 #line 9700 "configure"
9700 #include "confdefs.h"
9701 #include <$ac_hdr>
9702 EOF
9703 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9704 { (eval echo configure:9705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9705 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9706 if test -z "$ac_err"; then
9707   rm -rf conftest*
9708   eval "ac_cv_header_$ac_safe=yes"
9709 else
9710   echo "$ac_err" >&5
9711   echo "configure: failed program was:" >&5
9712   cat conftest.$ac_ext >&5
9713   rm -rf conftest*
9714   eval "ac_cv_header_$ac_safe=no"
9715 fi
9716 rm -f conftest*
9717 fi
9718 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
9719   echo "$ac_t""yes" 1>&6
9720     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
9721   cat >> confdefs.h <<EOF
9722 #define $ac_tr_hdr 1
9723 EOF
9724  
9725 else
9726   echo "$ac_t""no" 1>&6
9727 fi
9728 done
9729
9730
9731 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
9732 echo "configure:9733: checking for uid_t in sys/types.h" >&5
9733 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
9734   echo $ac_n "(cached) $ac_c" 1>&6
9735 else
9736   cat > conftest.$ac_ext <<EOF
9737 #line 9738 "configure"
9738 #include "confdefs.h"
9739 #include <sys/types.h>
9740 EOF
9741 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9742   egrep "uid_t" >/dev/null 2>&1; then
9743   rm -rf conftest*
9744   ac_cv_type_uid_t=yes
9745 else
9746   rm -rf conftest*
9747   ac_cv_type_uid_t=no
9748 fi
9749 rm -f conftest*
9750
9751 fi
9752
9753 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
9754 if test $ac_cv_type_uid_t = no; then
9755   cat >> confdefs.h <<\EOF
9756 #define uid_t int
9757 EOF
9758
9759   cat >> confdefs.h <<\EOF
9760 #define gid_t int
9761 EOF
9762
9763 fi
9764
9765 echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
9766 echo "configure:9767: checking type of array argument to getgroups" >&5
9767 if eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then
9768   echo $ac_n "(cached) $ac_c" 1>&6
9769 else
9770   if test "$cross_compiling" = yes; then
9771   ac_cv_type_getgroups=cross
9772 else
9773   cat > conftest.$ac_ext <<EOF
9774 #line 9775 "configure"
9775 #include "confdefs.h"
9776
9777 /* Thanks to Mike Rendell for this test.  */
9778 #include <sys/types.h>
9779 #define NGID 256
9780 #undef MAX
9781 #define MAX(x, y) ((x) > (y) ? (x) : (y))
9782 main()
9783 {
9784   gid_t gidset[NGID];
9785   int i, n;
9786   union { gid_t gval; long lval; }  val;
9787
9788   val.lval = -1;
9789   for (i = 0; i < NGID; i++)
9790     gidset[i] = val.gval;
9791   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
9792                  gidset);
9793   /* Exit non-zero if getgroups seems to require an array of ints.  This
9794      happens when gid_t is short but getgroups modifies an array of ints.  */
9795   exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
9796 }
9797
9798 EOF
9799 if { (eval echo configure:9800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9800 then
9801     ac_cv_type_getgroups=gid_t
9802 else
9803   echo "configure: failed program was:" >&5
9804   cat conftest.$ac_ext >&5
9805   rm -fr conftest*
9806   ac_cv_type_getgroups=int
9807 fi
9808 rm -fr conftest*
9809 fi
9810
9811 if test $ac_cv_type_getgroups = cross; then
9812         cat > conftest.$ac_ext <<EOF
9813 #line 9814 "configure"
9814 #include "confdefs.h"
9815 #include <unistd.h>
9816 EOF
9817 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9818   egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then
9819   rm -rf conftest*
9820   ac_cv_type_getgroups=gid_t
9821 else
9822   rm -rf conftest*
9823   ac_cv_type_getgroups=int
9824 fi
9825 rm -f conftest*
9826
9827 fi
9828 fi
9829
9830 echo "$ac_t""$ac_cv_type_getgroups" 1>&6
9831 cat >> confdefs.h <<EOF
9832 #define GETGROUPS_T $ac_cv_type_getgroups
9833 EOF
9834
9835  echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
9836 echo "configure:9837: checking for ANSI C header files" >&5
9837 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
9838   echo $ac_n "(cached) $ac_c" 1>&6
9839 else
9840   cat > conftest.$ac_ext <<EOF
9841 #line 9842 "configure"
9842 #include "confdefs.h"
9843 #include <stdlib.h>
9844 #include <stdarg.h>
9845 #include <string.h>
9846 #include <float.h>
9847 EOF
9848 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
9849 { (eval echo configure:9850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
9850 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
9851 if test -z "$ac_err"; then
9852   rm -rf conftest*
9853   ac_cv_header_stdc=yes
9854 else
9855   echo "$ac_err" >&5
9856   echo "configure: failed program was:" >&5
9857   cat conftest.$ac_ext >&5
9858   rm -rf conftest*
9859   ac_cv_header_stdc=no
9860 fi
9861 rm -f conftest*
9862
9863 if test $ac_cv_header_stdc = yes; then
9864   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
9865 cat > conftest.$ac_ext <<EOF
9866 #line 9867 "configure"
9867 #include "confdefs.h"
9868 #include <string.h>
9869 EOF
9870 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9871   egrep "memchr" >/dev/null 2>&1; then
9872   :
9873 else
9874   rm -rf conftest*
9875   ac_cv_header_stdc=no
9876 fi
9877 rm -f conftest*
9878
9879 fi
9880
9881 if test $ac_cv_header_stdc = yes; then
9882   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
9883 cat > conftest.$ac_ext <<EOF
9884 #line 9885 "configure"
9885 #include "confdefs.h"
9886 #include <stdlib.h>
9887 EOF
9888 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9889   egrep "free" >/dev/null 2>&1; then
9890   :
9891 else
9892   rm -rf conftest*
9893   ac_cv_header_stdc=no
9894 fi
9895 rm -f conftest*
9896
9897 fi
9898
9899 if test $ac_cv_header_stdc = yes; then
9900   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
9901 if test "$cross_compiling" = yes; then
9902   :
9903 else
9904   cat > conftest.$ac_ext <<EOF
9905 #line 9906 "configure"
9906 #include "confdefs.h"
9907 #include <ctype.h>
9908 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
9909 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
9910 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
9911 int main () { int i; for (i = 0; i < 256; i++)
9912 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
9913 exit (0); }
9914
9915 EOF
9916 if { (eval echo configure:9917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9917 then
9918   :
9919 else
9920   echo "configure: failed program was:" >&5
9921   cat conftest.$ac_ext >&5
9922   rm -fr conftest*
9923   ac_cv_header_stdc=no
9924 fi
9925 rm -fr conftest*
9926 fi
9927
9928 fi
9929 fi
9930
9931 echo "$ac_t""$ac_cv_header_stdc" 1>&6
9932 if test $ac_cv_header_stdc = yes; then
9933   cat >> confdefs.h <<\EOF
9934 #define STDC_HEADERS 1
9935 EOF
9936
9937 fi
9938
9939 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
9940 echo "configure:9941: checking for mode_t" >&5
9941 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
9942   echo $ac_n "(cached) $ac_c" 1>&6
9943 else
9944   cat > conftest.$ac_ext <<EOF
9945 #line 9946 "configure"
9946 #include "confdefs.h"
9947 #include <sys/types.h>
9948 #if STDC_HEADERS
9949 #include <stdlib.h>
9950 #include <stddef.h>
9951 #endif
9952 EOF
9953 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9954   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9955   rm -rf conftest*
9956   ac_cv_type_mode_t=yes
9957 else
9958   rm -rf conftest*
9959   ac_cv_type_mode_t=no
9960 fi
9961 rm -f conftest*
9962
9963 fi
9964 echo "$ac_t""$ac_cv_type_mode_t" 1>&6
9965 if test $ac_cv_type_mode_t = no; then
9966   cat >> confdefs.h <<\EOF
9967 #define mode_t int
9968 EOF
9969
9970 fi
9971
9972 echo $ac_n "checking for off_t""... $ac_c" 1>&6
9973 echo "configure:9974: checking for off_t" >&5
9974 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
9975   echo $ac_n "(cached) $ac_c" 1>&6
9976 else
9977   cat > conftest.$ac_ext <<EOF
9978 #line 9979 "configure"
9979 #include "confdefs.h"
9980 #include <sys/types.h>
9981 #if STDC_HEADERS
9982 #include <stdlib.h>
9983 #include <stddef.h>
9984 #endif
9985 EOF
9986 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
9987   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
9988   rm -rf conftest*
9989   ac_cv_type_off_t=yes
9990 else
9991   rm -rf conftest*
9992   ac_cv_type_off_t=no
9993 fi
9994 rm -f conftest*
9995
9996 fi
9997 echo "$ac_t""$ac_cv_type_off_t" 1>&6
9998 if test $ac_cv_type_off_t = no; then
9999   cat >> confdefs.h <<\EOF
10000 #define off_t long
10001 EOF
10002
10003 fi
10004
10005 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
10006 echo "configure:10007: checking for pid_t" >&5
10007 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
10008   echo $ac_n "(cached) $ac_c" 1>&6
10009 else
10010   cat > conftest.$ac_ext <<EOF
10011 #line 10012 "configure"
10012 #include "confdefs.h"
10013 #include <sys/types.h>
10014 #if STDC_HEADERS
10015 #include <stdlib.h>
10016 #include <stddef.h>
10017 #endif
10018 EOF
10019 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10020   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10021   rm -rf conftest*
10022   ac_cv_type_pid_t=yes
10023 else
10024   rm -rf conftest*
10025   ac_cv_type_pid_t=no
10026 fi
10027 rm -f conftest*
10028
10029 fi
10030 echo "$ac_t""$ac_cv_type_pid_t" 1>&6
10031 if test $ac_cv_type_pid_t = no; then
10032   cat >> confdefs.h <<\EOF
10033 #define pid_t int
10034 EOF
10035
10036 fi
10037
10038 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
10039 echo "configure:10040: checking for ptrdiff_t" >&5
10040 if eval "test \"`echo '$''{'am_cv_type_ptrdiff_t'+set}'`\" = set"; then
10041   echo $ac_n "(cached) $ac_c" 1>&6
10042 else
10043   cat > conftest.$ac_ext <<EOF
10044 #line 10045 "configure"
10045 #include "confdefs.h"
10046 #include <stddef.h>
10047 int main() {
10048 ptrdiff_t p
10049 ; return 0; }
10050 EOF
10051 if { (eval echo configure:10052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10052   rm -rf conftest*
10053   am_cv_type_ptrdiff_t=yes
10054 else
10055   echo "configure: failed program was:" >&5
10056   cat conftest.$ac_ext >&5
10057   rm -rf conftest*
10058   am_cv_type_ptrdiff_t=no
10059 fi
10060 rm -f conftest*
10061 fi
10062
10063 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
10064    if test $am_cv_type_ptrdiff_t = yes; then
10065      cat >> confdefs.h <<\EOF
10066 #define HAVE_PTRDIFF_T 1
10067 EOF
10068
10069    fi
10070
10071 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
10072 echo "configure:10073: checking return type of signal handlers" >&5
10073 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
10074   echo $ac_n "(cached) $ac_c" 1>&6
10075 else
10076   cat > conftest.$ac_ext <<EOF
10077 #line 10078 "configure"
10078 #include "confdefs.h"
10079 #include <sys/types.h>
10080 #include <signal.h>
10081 #ifdef signal
10082 #undef signal
10083 #endif
10084 #ifdef __cplusplus
10085 extern "C" void (*signal (int, void (*)(int)))(int);
10086 #else
10087 void (*signal ()) ();
10088 #endif
10089
10090 int main() {
10091 int i;
10092 ; return 0; }
10093 EOF
10094 if { (eval echo configure:10095: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10095   rm -rf conftest*
10096   ac_cv_type_signal=void
10097 else
10098   echo "configure: failed program was:" >&5
10099   cat conftest.$ac_ext >&5
10100   rm -rf conftest*
10101   ac_cv_type_signal=int
10102 fi
10103 rm -f conftest*
10104 fi
10105
10106 echo "$ac_t""$ac_cv_type_signal" 1>&6
10107 cat >> confdefs.h <<EOF
10108 #define RETSIGTYPE $ac_cv_type_signal
10109 EOF
10110
10111
10112 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
10113 echo "configure:10114: checking for sig_atomic_t" >&5
10114 if eval "test \"`echo '$''{'ol_cv_type_sig_atomic_t'+set}'`\" = set"; then
10115   echo $ac_n "(cached) $ac_c" 1>&6
10116 else
10117   cat > conftest.$ac_ext <<EOF
10118 #line 10119 "configure"
10119 #include "confdefs.h"
10120 #include <signal.h>
10121 int main() {
10122 sig_atomic_t atomic;
10123 ; return 0; }
10124 EOF
10125 if { (eval echo configure:10126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10126   rm -rf conftest*
10127   ol_cv_type_sig_atomic_t=yes
10128 else
10129   echo "configure: failed program was:" >&5
10130   cat conftest.$ac_ext >&5
10131   rm -rf conftest*
10132   ol_cv_type_sig_atomic_t=no
10133 fi
10134 rm -f conftest*
10135 fi
10136
10137 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
10138   if test $ol_cv_type_sig_atomic_t = no; then
10139     cat >> confdefs.h <<\EOF
10140 #define sig_atomic_t int
10141 EOF
10142
10143   fi
10144  
10145 echo $ac_n "checking for size_t""... $ac_c" 1>&6
10146 echo "configure:10147: checking for size_t" >&5
10147 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
10148   echo $ac_n "(cached) $ac_c" 1>&6
10149 else
10150   cat > conftest.$ac_ext <<EOF
10151 #line 10152 "configure"
10152 #include "confdefs.h"
10153 #include <sys/types.h>
10154 #if STDC_HEADERS
10155 #include <stdlib.h>
10156 #include <stddef.h>
10157 #endif
10158 EOF
10159 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10160   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
10161   rm -rf conftest*
10162   ac_cv_type_size_t=yes
10163 else
10164   rm -rf conftest*
10165   ac_cv_type_size_t=no
10166 fi
10167 rm -f conftest*
10168
10169 fi
10170 echo "$ac_t""$ac_cv_type_size_t" 1>&6
10171 if test $ac_cv_type_size_t = no; then
10172   cat >> confdefs.h <<\EOF
10173 #define size_t unsigned
10174 EOF
10175
10176 fi
10177
10178 echo $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6
10179 echo "configure:10180: checking for st_blksize in struct stat" >&5
10180 if eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then
10181   echo $ac_n "(cached) $ac_c" 1>&6
10182 else
10183   cat > conftest.$ac_ext <<EOF
10184 #line 10185 "configure"
10185 #include "confdefs.h"
10186 #include <sys/types.h>
10187 #include <sys/stat.h>
10188 int main() {
10189 struct stat s; s.st_blksize;
10190 ; return 0; }
10191 EOF
10192 if { (eval echo configure:10193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10193   rm -rf conftest*
10194   ac_cv_struct_st_blksize=yes
10195 else
10196   echo "configure: failed program was:" >&5
10197   cat conftest.$ac_ext >&5
10198   rm -rf conftest*
10199   ac_cv_struct_st_blksize=no
10200 fi
10201 rm -f conftest*
10202 fi
10203
10204 echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6
10205 if test $ac_cv_struct_st_blksize = yes; then
10206   cat >> confdefs.h <<\EOF
10207 #define HAVE_ST_BLKSIZE 1
10208 EOF
10209
10210 fi
10211
10212 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
10213 echo "configure:10214: checking whether time.h and sys/time.h may both be included" >&5
10214 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
10215   echo $ac_n "(cached) $ac_c" 1>&6
10216 else
10217   cat > conftest.$ac_ext <<EOF
10218 #line 10219 "configure"
10219 #include "confdefs.h"
10220 #include <sys/types.h>
10221 #include <sys/time.h>
10222 #include <time.h>
10223 int main() {
10224 struct tm *tp;
10225 ; return 0; }
10226 EOF
10227 if { (eval echo configure:10228: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10228   rm -rf conftest*
10229   ac_cv_header_time=yes
10230 else
10231   echo "configure: failed program was:" >&5
10232   cat conftest.$ac_ext >&5
10233   rm -rf conftest*
10234   ac_cv_header_time=no
10235 fi
10236 rm -f conftest*
10237 fi
10238
10239 echo "$ac_t""$ac_cv_header_time" 1>&6
10240 if test $ac_cv_header_time = yes; then
10241   cat >> confdefs.h <<\EOF
10242 #define TIME_WITH_SYS_TIME 1
10243 EOF
10244
10245 fi
10246
10247 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
10248 echo "configure:10249: checking whether struct tm is in sys/time.h or time.h" >&5
10249 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
10250   echo $ac_n "(cached) $ac_c" 1>&6
10251 else
10252   cat > conftest.$ac_ext <<EOF
10253 #line 10254 "configure"
10254 #include "confdefs.h"
10255 #include <sys/types.h>
10256 #include <time.h>
10257 int main() {
10258 struct tm *tp; tp->tm_sec;
10259 ; return 0; }
10260 EOF
10261 if { (eval echo configure:10262: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10262   rm -rf conftest*
10263   ac_cv_struct_tm=time.h
10264 else
10265   echo "configure: failed program was:" >&5
10266   cat conftest.$ac_ext >&5
10267   rm -rf conftest*
10268   ac_cv_struct_tm=sys/time.h
10269 fi
10270 rm -f conftest*
10271 fi
10272
10273 echo "$ac_t""$ac_cv_struct_tm" 1>&6
10274 if test $ac_cv_struct_tm = sys/time.h; then
10275   cat >> confdefs.h <<\EOF
10276 #define TM_IN_SYS_TIME 1
10277 EOF
10278
10279 fi
10280
10281 # test for pw_gecos in struct passwd
10282 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
10283 echo "configure:10284: checking struct passwd for pw_gecos" >&5
10284 if eval "test \"`echo '$''{'ol_cv_struct_passwd_pw_gecos'+set}'`\" = set"; then
10285   echo $ac_n "(cached) $ac_c" 1>&6
10286 else
10287   
10288         cat > conftest.$ac_ext <<EOF
10289 #line 10290 "configure"
10290 #include "confdefs.h"
10291 #include <pwd.h>
10292 int main() {
10293
10294         struct passwd pwd;
10295         pwd.pw_gecos = pwd.pw_name;
10296
10297 ; return 0; }
10298 EOF
10299 if { (eval echo configure:10300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10300   rm -rf conftest*
10301   ol_cv_struct_passwd_pw_gecos=yes
10302 else
10303   echo "configure: failed program was:" >&5
10304   cat conftest.$ac_ext >&5
10305   rm -rf conftest*
10306   ol_cv_struct_passwd_pw_gecos=no
10307 fi
10308 rm -f conftest*
10309 fi
10310
10311 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
10312 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
10313         cat >> confdefs.h <<\EOF
10314 #define HAVE_PW_GECOS 1
10315 EOF
10316
10317 fi
10318
10319
10320
10321 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
10322 echo "configure:10323: checking if toupper() requires islower()" >&5
10323 if eval "test \"`echo '$''{'ol_cv_c_upper_lower'+set}'`\" = set"; then
10324   echo $ac_n "(cached) $ac_c" 1>&6
10325 else
10326   
10327         if test "$cross_compiling" = yes; then
10328   ol_cv_c_upper_lower=safe
10329 else
10330   cat > conftest.$ac_ext <<EOF
10331 #line 10332 "configure"
10332 #include "confdefs.h"
10333
10334 #include <ctype.h>
10335 main()
10336 {
10337         if ('C' == toupper('C'))
10338                 exit(0);
10339         else
10340                 exit(1);
10341 }
10342 EOF
10343 if { (eval echo configure:10344: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10344 then
10345   ol_cv_c_upper_lower=no
10346 else
10347   echo "configure: failed program was:" >&5
10348   cat conftest.$ac_ext >&5
10349   rm -fr conftest*
10350   ol_cv_c_upper_lower=yes
10351 fi
10352 rm -fr conftest*
10353 fi
10354
10355 fi
10356
10357 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
10358 if test $ol_cv_c_upper_lower != no ; then
10359         cat >> confdefs.h <<\EOF
10360 #define C_UPPER_LOWER 1
10361 EOF
10362
10363 fi
10364
10365 echo $ac_n "checking for working const""... $ac_c" 1>&6
10366 echo "configure:10367: checking for working const" >&5
10367 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
10368   echo $ac_n "(cached) $ac_c" 1>&6
10369 else
10370   cat > conftest.$ac_ext <<EOF
10371 #line 10372 "configure"
10372 #include "confdefs.h"
10373
10374 int main() {
10375
10376 /* Ultrix mips cc rejects this.  */
10377 typedef int charset[2]; const charset x;
10378 /* SunOS 4.1.1 cc rejects this.  */
10379 char const *const *ccp;
10380 char **p;
10381 /* NEC SVR4.0.2 mips cc rejects this.  */
10382 struct point {int x, y;};
10383 static struct point const zero = {0,0};
10384 /* AIX XL C 1.02.0.0 rejects this.
10385    It does not let you subtract one const X* pointer from another in an arm
10386    of an if-expression whose if-part is not a constant expression */
10387 const char *g = "string";
10388 ccp = &g + (g ? g-g : 0);
10389 /* HPUX 7.0 cc rejects these. */
10390 ++ccp;
10391 p = (char**) ccp;
10392 ccp = (char const *const *) p;
10393 { /* SCO 3.2v4 cc rejects this.  */
10394   char *t;
10395   char const *s = 0 ? (char *) 0 : (char const *) 0;
10396
10397   *t++ = 0;
10398 }
10399 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
10400   int x[] = {25, 17};
10401   const int *foo = &x[0];
10402   ++foo;
10403 }
10404 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
10405   typedef const int *iptr;
10406   iptr p = 0;
10407   ++p;
10408 }
10409 { /* AIX XL C 1.02.0.0 rejects this saying
10410      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
10411   struct s { int j; const int *ap[3]; };
10412   struct s *b; b->j = 5;
10413 }
10414 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
10415   const int foo = 10;
10416 }
10417
10418 ; return 0; }
10419 EOF
10420 if { (eval echo configure:10421: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10421   rm -rf conftest*
10422   ac_cv_c_const=yes
10423 else
10424   echo "configure: failed program was:" >&5
10425   cat conftest.$ac_ext >&5
10426   rm -rf conftest*
10427   ac_cv_c_const=no
10428 fi
10429 rm -f conftest*
10430 fi
10431
10432 echo "$ac_t""$ac_cv_c_const" 1>&6
10433 if test $ac_cv_c_const = no; then
10434   cat >> confdefs.h <<\EOF
10435 #define const 
10436 EOF
10437
10438 fi
10439
10440 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
10441 echo "configure:10442: checking if compiler understands volatile" >&5
10442 if eval "test \"`echo '$''{'ol_cv_c_volatile'+set}'`\" = set"; then
10443   echo $ac_n "(cached) $ac_c" 1>&6
10444 else
10445   cat > conftest.$ac_ext <<EOF
10446 #line 10447 "configure"
10447 #include "confdefs.h"
10448 int x, y, z;
10449 int main() {
10450 volatile int a; int * volatile b = x ? &y : &z;
10451       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
10452       *b = 0;
10453 ; return 0; }
10454 EOF
10455 if { (eval echo configure:10456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10456   rm -rf conftest*
10457   ol_cv_c_volatile=yes
10458 else
10459   echo "configure: failed program was:" >&5
10460   cat conftest.$ac_ext >&5
10461   rm -rf conftest*
10462   ol_cv_c_volatile=no
10463 fi
10464 rm -f conftest*
10465 fi
10466
10467 echo "$ac_t""$ol_cv_c_volatile" 1>&6
10468   if test $ol_cv_c_volatile = yes; then
10469     : 
10470   else
10471     cat >> confdefs.h <<\EOF
10472 #define volatile 
10473 EOF
10474
10475   fi
10476  
10477
10478 if test $cross_compiling = yes ; then
10479         cat >> confdefs.h <<\EOF
10480 #define CROSS_COMPILING 1
10481 EOF
10482
10483 else
10484         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
10485 echo "configure:10486: checking whether byte ordering is bigendian" >&5
10486 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
10487   echo $ac_n "(cached) $ac_c" 1>&6
10488 else
10489   ac_cv_c_bigendian=unknown
10490 # See if sys/param.h defines the BYTE_ORDER macro.
10491 cat > conftest.$ac_ext <<EOF
10492 #line 10493 "configure"
10493 #include "confdefs.h"
10494 #include <sys/types.h>
10495 #include <sys/param.h>
10496 int main() {
10497
10498 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
10499  bogus endian macros
10500 #endif
10501 ; return 0; }
10502 EOF
10503 if { (eval echo configure:10504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10504   rm -rf conftest*
10505   # It does; now see whether it defined to BIG_ENDIAN or not.
10506 cat > conftest.$ac_ext <<EOF
10507 #line 10508 "configure"
10508 #include "confdefs.h"
10509 #include <sys/types.h>
10510 #include <sys/param.h>
10511 int main() {
10512
10513 #if BYTE_ORDER != BIG_ENDIAN
10514  not big endian
10515 #endif
10516 ; return 0; }
10517 EOF
10518 if { (eval echo configure:10519: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
10519   rm -rf conftest*
10520   ac_cv_c_bigendian=yes
10521 else
10522   echo "configure: failed program was:" >&5
10523   cat conftest.$ac_ext >&5
10524   rm -rf conftest*
10525   ac_cv_c_bigendian=no
10526 fi
10527 rm -f conftest*
10528 else
10529   echo "configure: failed program was:" >&5
10530   cat conftest.$ac_ext >&5
10531 fi
10532 rm -f conftest*
10533 if test $ac_cv_c_bigendian = unknown; then
10534 if test "$cross_compiling" = yes; then
10535     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10536 else
10537   cat > conftest.$ac_ext <<EOF
10538 #line 10539 "configure"
10539 #include "confdefs.h"
10540 main () {
10541   /* Are we little or big endian?  From Harbison&Steele.  */
10542   union
10543   {
10544     long l;
10545     char c[sizeof (long)];
10546   } u;
10547   u.l = 1;
10548   exit (u.c[sizeof (long) - 1] == 1);
10549 }
10550 EOF
10551 if { (eval echo configure:10552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10552 then
10553   ac_cv_c_bigendian=no
10554 else
10555   echo "configure: failed program was:" >&5
10556   cat conftest.$ac_ext >&5
10557   rm -fr conftest*
10558   ac_cv_c_bigendian=yes
10559 fi
10560 rm -fr conftest*
10561 fi
10562
10563 fi
10564 fi
10565
10566 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
10567 if test $ac_cv_c_bigendian = yes; then
10568   cat >> confdefs.h <<\EOF
10569 #define WORDS_BIGENDIAN 1
10570 EOF
10571
10572 fi
10573
10574         echo $ac_n "checking size of short""... $ac_c" 1>&6
10575 echo "configure:10576: checking size of short" >&5
10576 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
10577   echo $ac_n "(cached) $ac_c" 1>&6
10578 else
10579   if test "$cross_compiling" = yes; then
10580     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10581 else
10582   cat > conftest.$ac_ext <<EOF
10583 #line 10584 "configure"
10584 #include "confdefs.h"
10585 #include <stdio.h>
10586 main()
10587 {
10588   FILE *f=fopen("conftestval", "w");
10589   if (!f) exit(1);
10590   fprintf(f, "%d\n", sizeof(short));
10591   exit(0);
10592 }
10593 EOF
10594 if { (eval echo configure:10595: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10595 then
10596   ac_cv_sizeof_short=`cat conftestval`
10597 else
10598   echo "configure: failed program was:" >&5
10599   cat conftest.$ac_ext >&5
10600   rm -fr conftest*
10601   ac_cv_sizeof_short=0
10602 fi
10603 rm -fr conftest*
10604 fi
10605
10606 fi
10607 echo "$ac_t""$ac_cv_sizeof_short" 1>&6
10608 cat >> confdefs.h <<EOF
10609 #define SIZEOF_SHORT $ac_cv_sizeof_short
10610 EOF
10611
10612  
10613         echo $ac_n "checking size of int""... $ac_c" 1>&6
10614 echo "configure:10615: checking size of int" >&5
10615 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
10616   echo $ac_n "(cached) $ac_c" 1>&6
10617 else
10618   if test "$cross_compiling" = yes; then
10619     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10620 else
10621   cat > conftest.$ac_ext <<EOF
10622 #line 10623 "configure"
10623 #include "confdefs.h"
10624 #include <stdio.h>
10625 main()
10626 {
10627   FILE *f=fopen("conftestval", "w");
10628   if (!f) exit(1);
10629   fprintf(f, "%d\n", sizeof(int));
10630   exit(0);
10631 }
10632 EOF
10633 if { (eval echo configure:10634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10634 then
10635   ac_cv_sizeof_int=`cat conftestval`
10636 else
10637   echo "configure: failed program was:" >&5
10638   cat conftest.$ac_ext >&5
10639   rm -fr conftest*
10640   ac_cv_sizeof_int=0
10641 fi
10642 rm -fr conftest*
10643 fi
10644
10645 fi
10646 echo "$ac_t""$ac_cv_sizeof_int" 1>&6
10647 cat >> confdefs.h <<EOF
10648 #define SIZEOF_INT $ac_cv_sizeof_int
10649 EOF
10650
10651  
10652         echo $ac_n "checking size of long""... $ac_c" 1>&6
10653 echo "configure:10654: checking size of long" >&5
10654 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
10655   echo $ac_n "(cached) $ac_c" 1>&6
10656 else
10657   if test "$cross_compiling" = yes; then
10658     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
10659 else
10660   cat > conftest.$ac_ext <<EOF
10661 #line 10662 "configure"
10662 #include "confdefs.h"
10663 #include <stdio.h>
10664 main()
10665 {
10666   FILE *f=fopen("conftestval", "w");
10667   if (!f) exit(1);
10668   fprintf(f, "%d\n", sizeof(long));
10669   exit(0);
10670 }
10671 EOF
10672 if { (eval echo configure:10673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10673 then
10674   ac_cv_sizeof_long=`cat conftestval`
10675 else
10676   echo "configure: failed program was:" >&5
10677   cat conftest.$ac_ext >&5
10678   rm -fr conftest*
10679   ac_cv_sizeof_long=0
10680 fi
10681 rm -fr conftest*
10682 fi
10683
10684 fi
10685 echo "$ac_t""$ac_cv_sizeof_long" 1>&6
10686 cat >> confdefs.h <<EOF
10687 #define SIZEOF_LONG $ac_cv_sizeof_long
10688 EOF
10689
10690
10691 fi
10692
10693 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
10694 echo "configure:10695: checking for 8-bit clean memcmp" >&5
10695 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then
10696   echo $ac_n "(cached) $ac_c" 1>&6
10697 else
10698   if test "$cross_compiling" = yes; then
10699   ac_cv_func_memcmp_clean=no
10700 else
10701   cat > conftest.$ac_ext <<EOF
10702 #line 10703 "configure"
10703 #include "confdefs.h"
10704
10705 main()
10706 {
10707   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
10708   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
10709 }
10710
10711 EOF
10712 if { (eval echo configure:10713: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10713 then
10714   ac_cv_func_memcmp_clean=yes
10715 else
10716   echo "configure: failed program was:" >&5
10717   cat conftest.$ac_ext >&5
10718   rm -fr conftest*
10719   ac_cv_func_memcmp_clean=no
10720 fi
10721 rm -fr conftest*
10722 fi
10723
10724 fi
10725
10726 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
10727 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
10728
10729 echo $ac_n "checking for strftime""... $ac_c" 1>&6
10730 echo "configure:10731: checking for strftime" >&5
10731 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
10732   echo $ac_n "(cached) $ac_c" 1>&6
10733 else
10734   cat > conftest.$ac_ext <<EOF
10735 #line 10736 "configure"
10736 #include "confdefs.h"
10737 /* System header to define __stub macros and hopefully few prototypes,
10738     which can conflict with char strftime(); below.  */
10739 #include <assert.h>
10740 /* Override any gcc2 internal prototype to avoid an error.  */
10741 /* We use char because int might match the return type of a gcc2
10742     builtin and then its argument prototype would still apply.  */
10743 char strftime();
10744
10745 int main() {
10746
10747 /* The GNU C library defines this for functions which it implements
10748     to always fail with ENOSYS.  Some functions are actually named
10749     something starting with __ and the normal name is an alias.  */
10750 #if defined (__stub_strftime) || defined (__stub___strftime)
10751 choke me
10752 #else
10753 strftime();
10754 #endif
10755
10756 ; return 0; }
10757 EOF
10758 if { (eval echo configure:10759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10759   rm -rf conftest*
10760   eval "ac_cv_func_strftime=yes"
10761 else
10762   echo "configure: failed program was:" >&5
10763   cat conftest.$ac_ext >&5
10764   rm -rf conftest*
10765   eval "ac_cv_func_strftime=no"
10766 fi
10767 rm -f conftest*
10768 fi
10769
10770 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
10771   echo "$ac_t""yes" 1>&6
10772   cat >> confdefs.h <<\EOF
10773 #define HAVE_STRFTIME 1
10774 EOF
10775
10776 else
10777   echo "$ac_t""no" 1>&6
10778 # strftime is in -lintl on SCO UNIX.
10779 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
10780 echo "configure:10781: checking for strftime in -lintl" >&5
10781 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
10782 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
10783   echo $ac_n "(cached) $ac_c" 1>&6
10784 else
10785   ac_save_LIBS="$LIBS"
10786 LIBS="-lintl  $LIBS"
10787 cat > conftest.$ac_ext <<EOF
10788 #line 10789 "configure"
10789 #include "confdefs.h"
10790 /* Override any gcc2 internal prototype to avoid an error.  */
10791 /* We use char because int might match the return type of a gcc2
10792     builtin and then its argument prototype would still apply.  */
10793 char strftime();
10794
10795 int main() {
10796 strftime()
10797 ; return 0; }
10798 EOF
10799 if { (eval echo configure:10800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10800   rm -rf conftest*
10801   eval "ac_cv_lib_$ac_lib_var=yes"
10802 else
10803   echo "configure: failed program was:" >&5
10804   cat conftest.$ac_ext >&5
10805   rm -rf conftest*
10806   eval "ac_cv_lib_$ac_lib_var=no"
10807 fi
10808 rm -f conftest*
10809 LIBS="$ac_save_LIBS"
10810
10811 fi
10812 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10813   echo "$ac_t""yes" 1>&6
10814   cat >> confdefs.h <<\EOF
10815 #define HAVE_STRFTIME 1
10816 EOF
10817
10818 LIBS="-lintl $LIBS"
10819 else
10820   echo "$ac_t""no" 1>&6
10821 fi
10822
10823 fi
10824
10825
10826 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
10827 echo "configure:10828: checking for vprintf" >&5
10828 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
10829   echo $ac_n "(cached) $ac_c" 1>&6
10830 else
10831   cat > conftest.$ac_ext <<EOF
10832 #line 10833 "configure"
10833 #include "confdefs.h"
10834 /* System header to define __stub macros and hopefully few prototypes,
10835     which can conflict with char vprintf(); below.  */
10836 #include <assert.h>
10837 /* Override any gcc2 internal prototype to avoid an error.  */
10838 /* We use char because int might match the return type of a gcc2
10839     builtin and then its argument prototype would still apply.  */
10840 char vprintf();
10841
10842 int main() {
10843
10844 /* The GNU C library defines this for functions which it implements
10845     to always fail with ENOSYS.  Some functions are actually named
10846     something starting with __ and the normal name is an alias.  */
10847 #if defined (__stub_vprintf) || defined (__stub___vprintf)
10848 choke me
10849 #else
10850 vprintf();
10851 #endif
10852
10853 ; return 0; }
10854 EOF
10855 if { (eval echo configure:10856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10856   rm -rf conftest*
10857   eval "ac_cv_func_vprintf=yes"
10858 else
10859   echo "configure: failed program was:" >&5
10860   cat conftest.$ac_ext >&5
10861   rm -rf conftest*
10862   eval "ac_cv_func_vprintf=no"
10863 fi
10864 rm -f conftest*
10865 fi
10866
10867 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
10868   echo "$ac_t""yes" 1>&6
10869   cat >> confdefs.h <<\EOF
10870 #define HAVE_VPRINTF 1
10871 EOF
10872
10873 else
10874   echo "$ac_t""no" 1>&6
10875 fi
10876
10877 if test "$ac_cv_func_vprintf" != yes; then
10878 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
10879 echo "configure:10880: checking for _doprnt" >&5
10880 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
10881   echo $ac_n "(cached) $ac_c" 1>&6
10882 else
10883   cat > conftest.$ac_ext <<EOF
10884 #line 10885 "configure"
10885 #include "confdefs.h"
10886 /* System header to define __stub macros and hopefully few prototypes,
10887     which can conflict with char _doprnt(); below.  */
10888 #include <assert.h>
10889 /* Override any gcc2 internal prototype to avoid an error.  */
10890 /* We use char because int might match the return type of a gcc2
10891     builtin and then its argument prototype would still apply.  */
10892 char _doprnt();
10893
10894 int main() {
10895
10896 /* The GNU C library defines this for functions which it implements
10897     to always fail with ENOSYS.  Some functions are actually named
10898     something starting with __ and the normal name is an alias.  */
10899 #if defined (__stub__doprnt) || defined (__stub____doprnt)
10900 choke me
10901 #else
10902 _doprnt();
10903 #endif
10904
10905 ; return 0; }
10906 EOF
10907 if { (eval echo configure:10908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10908   rm -rf conftest*
10909   eval "ac_cv_func__doprnt=yes"
10910 else
10911   echo "configure: failed program was:" >&5
10912   cat conftest.$ac_ext >&5
10913   rm -rf conftest*
10914   eval "ac_cv_func__doprnt=no"
10915 fi
10916 rm -f conftest*
10917 fi
10918
10919 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
10920   echo "$ac_t""yes" 1>&6
10921   cat >> confdefs.h <<\EOF
10922 #define HAVE_DOPRNT 1
10923 EOF
10924
10925 else
10926   echo "$ac_t""no" 1>&6
10927 fi
10928
10929 fi
10930
10931
10932 if test $ac_cv_func_vprintf = yes ; then
10933                 for ac_func in vsnprintf vsprintf
10934 do
10935 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10936 echo "configure:10937: checking for $ac_func" >&5
10937 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
10938   echo $ac_n "(cached) $ac_c" 1>&6
10939 else
10940   cat > conftest.$ac_ext <<EOF
10941 #line 10942 "configure"
10942 #include "confdefs.h"
10943 /* System header to define __stub macros and hopefully few prototypes,
10944     which can conflict with char $ac_func(); below.  */
10945 #include <assert.h>
10946 /* Override any gcc2 internal prototype to avoid an error.  */
10947 /* We use char because int might match the return type of a gcc2
10948     builtin and then its argument prototype would still apply.  */
10949 char $ac_func();
10950
10951 int main() {
10952
10953 /* The GNU C library defines this for functions which it implements
10954     to always fail with ENOSYS.  Some functions are actually named
10955     something starting with __ and the normal name is an alias.  */
10956 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10957 choke me
10958 #else
10959 $ac_func();
10960 #endif
10961
10962 ; return 0; }
10963 EOF
10964 if { (eval echo configure:10965: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10965   rm -rf conftest*
10966   eval "ac_cv_func_$ac_func=yes"
10967 else
10968   echo "configure: failed program was:" >&5
10969   cat conftest.$ac_ext >&5
10970   rm -rf conftest*
10971   eval "ac_cv_func_$ac_func=no"
10972 fi
10973 rm -f conftest*
10974 fi
10975
10976 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10977   echo "$ac_t""yes" 1>&6
10978     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10979   cat >> confdefs.h <<EOF
10980 #define $ac_tr_func 1
10981 EOF
10982  
10983 else
10984   echo "$ac_t""no" 1>&6
10985 fi
10986 done
10987
10988 fi
10989
10990 for ac_func in \
10991         bcopy                   \
10992         endgrent                \
10993         endpwent                \
10994         flock                   \
10995         getdtablesize   \
10996         getgrgid                \
10997         gethostname             \
10998         getpass                 \
10999         getpwuid                \
11000         gettimeofday    \
11001         initgroups              \
11002         lockf                   \
11003         memcpy                  \
11004         memmove                 \
11005         mkstemp                 \
11006         recv                    \
11007         recvfrom                \
11008         setpwfile               \
11009         setgid                  \
11010         setegid                 \
11011         setsid                  \
11012         setuid                  \
11013         seteuid                 \
11014         signal                  \
11015         sigset                  \
11016         snprintf                \
11017         strdup                  \
11018         strerror                \
11019         strpbrk                 \
11020         strrchr                 \
11021         strsep                  \
11022         strstr                  \
11023         strtol                  \
11024         strtoul                 \
11025         strspn                  \
11026         sysconf                 \
11027         waitpid                 \
11028         wait4                   \
11029
11030 do
11031 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11032 echo "configure:11033: checking for $ac_func" >&5
11033 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11034   echo $ac_n "(cached) $ac_c" 1>&6
11035 else
11036   cat > conftest.$ac_ext <<EOF
11037 #line 11038 "configure"
11038 #include "confdefs.h"
11039 /* System header to define __stub macros and hopefully few prototypes,
11040     which can conflict with char $ac_func(); below.  */
11041 #include <assert.h>
11042 /* Override any gcc2 internal prototype to avoid an error.  */
11043 /* We use char because int might match the return type of a gcc2
11044     builtin and then its argument prototype would still apply.  */
11045 char $ac_func();
11046
11047 int main() {
11048
11049 /* The GNU C library defines this for functions which it implements
11050     to always fail with ENOSYS.  Some functions are actually named
11051     something starting with __ and the normal name is an alias.  */
11052 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11053 choke me
11054 #else
11055 $ac_func();
11056 #endif
11057
11058 ; return 0; }
11059 EOF
11060 if { (eval echo configure:11061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11061   rm -rf conftest*
11062   eval "ac_cv_func_$ac_func=yes"
11063 else
11064   echo "configure: failed program was:" >&5
11065   cat conftest.$ac_ext >&5
11066   rm -rf conftest*
11067   eval "ac_cv_func_$ac_func=no"
11068 fi
11069 rm -f conftest*
11070 fi
11071
11072 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11073   echo "$ac_t""yes" 1>&6
11074     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11075   cat >> confdefs.h <<EOF
11076 #define $ac_tr_func 1
11077 EOF
11078  
11079 else
11080   echo "$ac_t""no" 1>&6
11081 fi
11082 done
11083
11084
11085 for ac_func in getopt tempnam
11086 do
11087 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
11088 echo "configure:11089: checking for $ac_func" >&5
11089 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
11090   echo $ac_n "(cached) $ac_c" 1>&6
11091 else
11092   cat > conftest.$ac_ext <<EOF
11093 #line 11094 "configure"
11094 #include "confdefs.h"
11095 /* System header to define __stub macros and hopefully few prototypes,
11096     which can conflict with char $ac_func(); below.  */
11097 #include <assert.h>
11098 /* Override any gcc2 internal prototype to avoid an error.  */
11099 /* We use char because int might match the return type of a gcc2
11100     builtin and then its argument prototype would still apply.  */
11101 char $ac_func();
11102
11103 int main() {
11104
11105 /* The GNU C library defines this for functions which it implements
11106     to always fail with ENOSYS.  Some functions are actually named
11107     something starting with __ and the normal name is an alias.  */
11108 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
11109 choke me
11110 #else
11111 $ac_func();
11112 #endif
11113
11114 ; return 0; }
11115 EOF
11116 if { (eval echo configure:11117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11117   rm -rf conftest*
11118   eval "ac_cv_func_$ac_func=yes"
11119 else
11120   echo "configure: failed program was:" >&5
11121   cat conftest.$ac_ext >&5
11122   rm -rf conftest*
11123   eval "ac_cv_func_$ac_func=no"
11124 fi
11125 rm -f conftest*
11126 fi
11127
11128 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
11129   echo "$ac_t""yes" 1>&6
11130     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11131   cat >> confdefs.h <<EOF
11132 #define $ac_tr_func 1
11133 EOF
11134  
11135 else
11136   echo "$ac_t""no" 1>&6
11137 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
11138 fi
11139 done
11140
11141
11142
11143 # Check Configuration
11144
11145 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
11146 echo "configure:11147: checking declaration of sys_errlist" >&5
11147 if eval "test \"`echo '$''{'ol_cv_dcl_sys_errlist'+set}'`\" = set"; then
11148   echo $ac_n "(cached) $ac_c" 1>&6
11149 else
11150   
11151         cat > conftest.$ac_ext <<EOF
11152 #line 11153 "configure"
11153 #include "confdefs.h"
11154
11155 #include <stdio.h>
11156 #include <sys/types.h>
11157 #include <errno.h> 
11158 int main() {
11159 char *c = (char *) *sys_errlist
11160 ; return 0; }
11161 EOF
11162 if { (eval echo configure:11163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11163   rm -rf conftest*
11164   ol_cv_dcl_sys_errlist=yes
11165 else
11166   echo "configure: failed program was:" >&5
11167   cat conftest.$ac_ext >&5
11168   rm -rf conftest*
11169   ol_cv_dcl_sys_errlist=no
11170 fi
11171 rm -f conftest*
11172 fi
11173
11174 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
11175 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
11176 if test $ol_cv_dcl_sys_errlist = no ; then
11177         cat >> confdefs.h <<\EOF
11178 #define DECL_SYS_ERRLIST 1
11179 EOF
11180
11181         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
11182 echo "configure:11183: checking existence of sys_errlist" >&5
11183         if eval "test \"`echo '$''{'ol_cv_have_sys_errlist'+set}'`\" = set"; then
11184   echo $ac_n "(cached) $ac_c" 1>&6
11185 else
11186   
11187                 cat > conftest.$ac_ext <<EOF
11188 #line 11189 "configure"
11189 #include "confdefs.h"
11190 #include <errno.h>
11191 int main() {
11192 char *c = (char *) *sys_errlist
11193 ; return 0; }
11194 EOF
11195 if { (eval echo configure:11196: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11196   rm -rf conftest*
11197   ol_cv_have_sys_errlist=yes
11198 else
11199   echo "configure: failed program was:" >&5
11200   cat conftest.$ac_ext >&5
11201   rm -rf conftest*
11202   ol_cv_have_sys_errlist=no
11203 fi
11204 rm -f conftest*
11205 fi
11206
11207         echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
11208         if test $ol_cv_have_sys_errlist = yes ; then
11209                 cat >> confdefs.h <<\EOF
11210 #define HAVE_SYS_ERRLIST 1
11211 EOF
11212
11213         fi
11214 fi
11215
11216
11217
11218 echo $ac_n "checking strdup declaration""... $ac_c" 1>&6
11219 echo "configure:11220: checking strdup declaration" >&5
11220 if eval "test \"`echo '$''{'ol_cv_dcl_strdup'+set}'`\" = set"; then
11221   echo $ac_n "(cached) $ac_c" 1>&6
11222 else
11223   
11224         cat > conftest.$ac_ext <<EOF
11225 #line 11226 "configure"
11226 #include "confdefs.h"
11227
11228 #include <string.h> 
11229 int main() {
11230 extern char *strdup();
11231 ; return 0; }
11232 EOF
11233 if { (eval echo configure:11234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
11234   rm -rf conftest*
11235   ol_cv_dcl_strdup=yes
11236 else
11237   echo "configure: failed program was:" >&5
11238   cat conftest.$ac_ext >&5
11239   rm -rf conftest*
11240   ol_cv_dcl_strdup=no
11241 fi
11242 rm -f conftest*
11243 fi
11244
11245 echo "$ac_t""$ol_cv_dcl_strdup" 1>&6
11246 if test $ol_cv_dcl_strdup = yes ; then
11247         cat >> confdefs.h <<\EOF
11248 #define DECL_STRDUP 1
11249 EOF
11250
11251 fi
11252
11253
11254
11255 if test "$ol_enable_debug" != no ; then
11256         cat >> confdefs.h <<\EOF
11257 #define LDAP_DEBUG 1
11258 EOF
11259
11260 fi
11261 if test "$ol_enable_syslog" = yes ; then
11262         cat >> confdefs.h <<\EOF
11263 #define LDAP_SYSLOG 1
11264 EOF
11265
11266 fi
11267 if test "$ol_enable_libui" = yes ; then
11268         cat >> confdefs.h <<\EOF
11269 #define LDAP_LIBUI 1
11270 EOF
11271
11272 fi
11273 if test "$ol_enable_cache" = no ; then
11274         cat >> confdefs.h <<\EOF
11275 #define LDAP_NOCACHE 1
11276 EOF
11277
11278 fi
11279 if test "$ol_enable_dns" != no ; then
11280         cat >> confdefs.h <<\EOF
11281 #define LDAP_API_FEATURE_X_OPENLDAP_V2_DNS LDAP_VENDOR_VERSION
11282 EOF
11283
11284 fi
11285 if test "$ol_enable_proctitle" != no ; then
11286         cat >> confdefs.h <<\EOF
11287 #define LDAP_PROCTITLE 1
11288 EOF
11289
11290 fi
11291 if test "$ol_enable_referrals" != no ; then
11292         cat >> confdefs.h <<\EOF
11293 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
11294 EOF
11295
11296 fi
11297 if test "$ol_enable_cldap" != no ; then
11298         cat >> confdefs.h <<\EOF
11299 #define LDAP_CONNECTIONLESS 1
11300 EOF
11301
11302 fi
11303
11304 if test "$ol_enable_aclgroups" != no ; then
11305         cat >> confdefs.h <<\EOF
11306 #define SLAPD_ACLGROUPS 1
11307 EOF
11308
11309 fi
11310 if test "$ol_enable_crypt" != no ; then
11311         cat >> confdefs.h <<\EOF
11312 #define SLAPD_CRYPT 1
11313 EOF
11314
11315 fi
11316 if test "$ol_enable_cleartext" != no ; then
11317         cat >> confdefs.h <<\EOF
11318 #define SLAPD_CLEARTEXT 1
11319 EOF
11320
11321 fi
11322 if test "$ol_enable_phonetic" != no ; then
11323         cat >> confdefs.h <<\EOF
11324 #define SLAPD_PHONETIC 1
11325 EOF
11326
11327 fi
11328 if test "$ol_enable_rlookups" != no ; then
11329         cat >> confdefs.h <<\EOF
11330 #define SLAPD_RLOOKUPS 1
11331 EOF
11332
11333 fi
11334
11335 if test "$ol_link_modules" != no ; then
11336         cat >> confdefs.h <<\EOF
11337 #define SLAPD_MODULES 1
11338 EOF
11339
11340         BUILD_SLAPD=yes
11341 fi
11342
11343 if test "$ol_link_bdb2" != no ; then
11344         cat >> confdefs.h <<\EOF
11345 #define SLAPD_BDB2 1
11346 EOF
11347
11348         BUILD_SLAPD=yes
11349         BUILD_BDB2=yes
11350 fi
11351
11352 if test "$ol_link_ldbm" != no ; then
11353         cat >> confdefs.h <<\EOF
11354 #define SLAPD_LDBM 1
11355 EOF
11356
11357         BUILD_SLAPD=yes
11358         BUILD_LDBM=yes
11359 fi
11360
11361 if test "$ol_enable_passwd" != no ; then
11362         cat >> confdefs.h <<\EOF
11363 #define SLAPD_PASSWD 1
11364 EOF
11365
11366         BUILD_SLAPD=yes
11367         BUILD_PASSWD=yes
11368 fi
11369
11370 if test "$ol_link_perl" != no ; then
11371         cat >> confdefs.h <<\EOF
11372 #define SLAPD_PERL 1
11373 EOF
11374
11375         BUILD_SLAPD=yes
11376         BUILD_PERL=yes
11377 fi
11378
11379 if test "$ol_enable_shell" != no ; then
11380         cat >> confdefs.h <<\EOF
11381 #define SLAPD_SHELL 1
11382 EOF
11383
11384         BUILD_SLAPD=yes
11385         BUILD_SHELL=yes
11386 fi
11387
11388 if test "$ol_enable_tcl" != no ; then
11389         cat >> confdefs.h <<\EOF
11390 #define SLAPD_TCL 1
11391 EOF
11392
11393         BUILD_SLAPD=yes
11394         BUILD_TCL=yes
11395 fi
11396
11397 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
11398         $BUILD_SLAPD = yes ; then
11399         BUILD_SLURPD=yes
11400 fi
11401
11402 if test "$ol_link_isode" != no ; then
11403         BUILD_LDAPD=yes
11404 fi
11405
11406
11407
11408
11409   
11410   
11411   
11412   
11413   
11414   
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437 trap '' 1 2 15
11438
11439 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
11440
11441 test "x$prefix" = xNONE && prefix=$ac_default_prefix
11442 # Let make expand exec_prefix.
11443 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11444
11445 # Any assignment to VPATH causes Sun make to only execute
11446 # the first set of double-colon rules, so remove it if not needed.
11447 # If there is a colon in the path, we need to keep it.
11448 if test "x$srcdir" = x.; then
11449   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
11450 fi
11451
11452 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
11453
11454 DEFS=-DHAVE_CONFIG_H
11455
11456 # Without the "./", some shells look in PATH for config.status.
11457 : ${CONFIG_STATUS=./config.status}
11458
11459 echo creating $CONFIG_STATUS
11460 rm -f $CONFIG_STATUS
11461 cat > $CONFIG_STATUS <<EOF
11462 #! /bin/sh
11463 # Generated automatically by configure.
11464 # Run this file to recreate the current configuration.
11465 # This directory was configured as follows,
11466 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
11467 #
11468 # $0 $ac_configure_args
11469 #
11470 # Compiler output produced by configure, useful for debugging
11471 # configure, is in ./config.log if it exists.
11472
11473 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
11474 for ac_option
11475 do
11476   case "\$ac_option" in
11477   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11478     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
11479     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
11480   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
11481     echo "$CONFIG_STATUS generated by autoconf version 2.13"
11482     exit 0 ;;
11483   -help | --help | --hel | --he | --h)
11484     echo "\$ac_cs_usage"; exit 0 ;;
11485   *) echo "\$ac_cs_usage"; exit 1 ;;
11486   esac
11487 done
11488
11489 ac_given_srcdir=$srcdir
11490 ac_given_INSTALL="$INSTALL"
11491
11492 trap 'rm -fr `echo "\
11493 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11494 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11495 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11496 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11497 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11498 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11499 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11500 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11501 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11502 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11503 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11504 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11505 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11506 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11507 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11508 include/Makefile:build/top.mk:include/Makefile.in \
11509 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11510 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11511 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11512 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11513 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11514 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11515 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11516 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11517 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11518 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11519 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11520 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11521 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11522 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11523 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11524 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11525 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11526 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11527 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11528 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11529 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11530 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11531 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11532 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11533 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11534  include/portable.h include/ldap_features.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
11535 EOF
11536 cat >> $CONFIG_STATUS <<EOF
11537
11538 # Protect against being on the right side of a sed subst in config.status.
11539 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
11540  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
11541 $ac_vpsub
11542 $extrasub
11543 s%@SHELL@%$SHELL%g
11544 s%@CFLAGS@%$CFLAGS%g
11545 s%@CPPFLAGS@%$CPPFLAGS%g
11546 s%@CXXFLAGS@%$CXXFLAGS%g
11547 s%@FFLAGS@%$FFLAGS%g
11548 s%@DEFS@%$DEFS%g
11549 s%@LDFLAGS@%$LDFLAGS%g
11550 s%@LIBS@%$LIBS%g
11551 s%@exec_prefix@%$exec_prefix%g
11552 s%@prefix@%$prefix%g
11553 s%@program_transform_name@%$program_transform_name%g
11554 s%@bindir@%$bindir%g
11555 s%@sbindir@%$sbindir%g
11556 s%@libexecdir@%$libexecdir%g
11557 s%@datadir@%$datadir%g
11558 s%@sysconfdir@%$sysconfdir%g
11559 s%@sharedstatedir@%$sharedstatedir%g
11560 s%@localstatedir@%$localstatedir%g
11561 s%@libdir@%$libdir%g
11562 s%@includedir@%$includedir%g
11563 s%@oldincludedir@%$oldincludedir%g
11564 s%@infodir@%$infodir%g
11565 s%@mandir@%$mandir%g
11566 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
11567 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
11568 s%@INSTALL_DATA@%$INSTALL_DATA%g
11569 s%@PACKAGE@%$PACKAGE%g
11570 s%@VERSION@%$VERSION%g
11571 s%@ACLOCAL@%$ACLOCAL%g
11572 s%@AUTOCONF@%$AUTOCONF%g
11573 s%@AUTOMAKE@%$AUTOMAKE%g
11574 s%@AUTOHEADER@%$AUTOHEADER%g
11575 s%@MAKEINFO@%$MAKEINFO%g
11576 s%@SET_MAKE@%$SET_MAKE%g
11577 s%@top_builddir@%$top_builddir%g
11578 s%@ldap_subdir@%$ldap_subdir%g
11579 s%@host@%$host%g
11580 s%@host_alias@%$host_alias%g
11581 s%@host_cpu@%$host_cpu%g
11582 s%@host_vendor@%$host_vendor%g
11583 s%@host_os@%$host_os%g
11584 s%@RANLIB@%$RANLIB%g
11585 s%@CC@%$CC%g
11586 s%@LD@%$LD%g
11587 s%@NM@%$NM%g
11588 s%@LN_S@%$LN_S%g
11589 s%@LIBTOOL@%$LIBTOOL%g
11590 s%@AWK@%$AWK%g
11591 s%@LN_H@%$LN_H%g
11592 s%@SENDMAIL@%$SENDMAIL%g
11593 s%@EDITOR@%$EDITOR%g
11594 s%@FINGER@%$FINGER%g
11595 s%@GLIBCONFIG@%$GLIBCONFIG%g
11596 s%@PERLBIN@%$PERLBIN%g
11597 s%@CPP@%$CPP%g
11598 s%@EXEEXT@%$EXEEXT%g
11599 s%@OBJEXT@%$OBJEXT%g
11600 s%@PEPSY@%$PEPSY%g
11601 s%@LIBOBJS@%$LIBOBJS%g
11602 s%@BUILD_LDAPD@%$BUILD_LDAPD%g
11603 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
11604 s%@BUILD_BDB2@%$BUILD_BDB2%g
11605 s%@BUILD_LDBM@%$BUILD_LDBM%g
11606 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
11607 s%@BUILD_PERL@%$BUILD_PERL%g
11608 s%@BUILD_SHELL@%$BUILD_SHELL%g
11609 s%@BUILD_TCL@%$BUILD_TCL%g
11610 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
11611 s%@LDAP_LIBS@%$LDAP_LIBS%g
11612 s%@LDAPD_LIBS@%$LDAPD_LIBS%g
11613 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
11614 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
11615 s%@LDBM_LIBS@%$LDBM_LIBS%g
11616 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
11617 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
11618 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
11619 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
11620 s%@SLAPD_PERL_CPPFLAGS@%$SLAPD_PERL_CPPFLAGS%g
11621 s%@SLAPD_PERL_LDFLAGS@%$SLAPD_PERL_LDFLAGS%g
11622 s%@KRB_LIBS@%$KRB_LIBS%g
11623 s%@READLINE_LIBS@%$READLINE_LIBS%g
11624 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
11625 s%@TLS_LIBS@%$TLS_LIBS%g
11626
11627 CEOF
11628 EOF
11629
11630 cat >> $CONFIG_STATUS <<\EOF
11631
11632 # Split the substitutions into bite-sized pieces for seds with
11633 # small command number limits, like on Digital OSF/1 and HP-UX.
11634 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
11635 ac_file=1 # Number of current file.
11636 ac_beg=1 # First line for current file.
11637 ac_end=$ac_max_sed_cmds # Line after last line for current file.
11638 ac_more_lines=:
11639 ac_sed_cmds=""
11640 while $ac_more_lines; do
11641   if test $ac_beg -gt 1; then
11642     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
11643   else
11644     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
11645   fi
11646   if test ! -s conftest.s$ac_file; then
11647     ac_more_lines=false
11648     rm -f conftest.s$ac_file
11649   else
11650     if test -z "$ac_sed_cmds"; then
11651       ac_sed_cmds="sed -f conftest.s$ac_file"
11652     else
11653       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
11654     fi
11655     ac_file=`expr $ac_file + 1`
11656     ac_beg=$ac_end
11657     ac_end=`expr $ac_end + $ac_max_sed_cmds`
11658   fi
11659 done
11660 if test -z "$ac_sed_cmds"; then
11661   ac_sed_cmds=cat
11662 fi
11663 EOF
11664
11665 cat >> $CONFIG_STATUS <<EOF
11666
11667 CONFIG_FILES=\${CONFIG_FILES-"\
11668 Makefile:build/top.mk:Makefile.in:build/dir.mk \
11669 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
11670 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
11671 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
11672 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
11673 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
11674 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
11675 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
11676 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
11677 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
11678 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
11679 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
11680 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
11681 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
11682 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
11683 include/Makefile:build/top.mk:include/Makefile.in \
11684 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
11685 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
11686 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11687 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
11688 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
11689 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
11690 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
11691 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
11692 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
11693 servers/ldapd/Makefile:build/top.mk:servers/ldapd/Makefile.in:build/srv.mk \
11694 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
11695 servers/slapd/back-bdb2/Makefile:build/top.mk:servers/slapd/back-bdb2/Makefile.in:build/srv.mk \
11696 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/srv.mk \
11697 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/srv.mk \
11698 servers/slapd/back-perl/Makefile:build/top.mk:servers/slapd/back-perl/Makefile.in:build/srv.mk \
11699 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/srv.mk \
11700 servers/slapd/back-tcl/Makefile:build/top.mk:servers/slapd/back-tcl/Makefile.in:build/srv.mk \
11701 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
11702 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
11703 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
11704 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
11705 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
11706 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
11707 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
11708 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
11709 "}
11710 EOF
11711 cat >> $CONFIG_STATUS <<\EOF
11712 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
11713   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11714   case "$ac_file" in
11715   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11716        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11717   *) ac_file_in="${ac_file}.in" ;;
11718   esac
11719
11720   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
11721
11722   # Remove last slash and all that follows it.  Not all systems have dirname.
11723   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11724   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11725     # The file is in a subdirectory.
11726     test ! -d "$ac_dir" && mkdir "$ac_dir"
11727     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
11728     # A "../" for each directory in $ac_dir_suffix.
11729     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
11730   else
11731     ac_dir_suffix= ac_dots=
11732   fi
11733
11734   case "$ac_given_srcdir" in
11735   .)  srcdir=.
11736       if test -z "$ac_dots"; then top_srcdir=.
11737       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
11738   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
11739   *) # Relative path.
11740     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
11741     top_srcdir="$ac_dots$ac_given_srcdir" ;;
11742   esac
11743
11744   case "$ac_given_INSTALL" in
11745   [/$]*) INSTALL="$ac_given_INSTALL" ;;
11746   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
11747   esac
11748
11749   echo creating "$ac_file"
11750   rm -f "$ac_file"
11751   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
11752   case "$ac_file" in
11753   *Makefile*) ac_comsub="1i\\
11754 # $configure_input" ;;
11755   *) ac_comsub= ;;
11756   esac
11757
11758   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11759   sed -e "$ac_comsub
11760 s%@configure_input@%$configure_input%g
11761 s%@srcdir@%$srcdir%g
11762 s%@top_srcdir@%$top_srcdir%g
11763 s%@INSTALL@%$INSTALL%g
11764 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
11765 fi; done
11766 rm -f conftest.s*
11767
11768 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
11769 # NAME is the cpp macro being defined and VALUE is the value it is being given.
11770 #
11771 # ac_d sets the value in "#define NAME VALUE" lines.
11772 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
11773 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
11774 ac_dC='\3'
11775 ac_dD='%g'
11776 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
11777 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11778 ac_uB='\([      ]\)%\1#\2define\3'
11779 ac_uC=' '
11780 ac_uD='\4%g'
11781 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
11782 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
11783 ac_eB='$%\1#\2define\3'
11784 ac_eC=' '
11785 ac_eD='%g'
11786
11787 if test "${CONFIG_HEADERS+set}" != set; then
11788 EOF
11789 cat >> $CONFIG_STATUS <<EOF
11790   CONFIG_HEADERS="include/portable.h include/ldap_features.h"
11791 EOF
11792 cat >> $CONFIG_STATUS <<\EOF
11793 fi
11794 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
11795   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
11796   case "$ac_file" in
11797   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
11798        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
11799   *) ac_file_in="${ac_file}.in" ;;
11800   esac
11801
11802   echo creating $ac_file
11803
11804   rm -f conftest.frag conftest.in conftest.out
11805   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
11806   cat $ac_file_inputs > conftest.in
11807
11808 EOF
11809
11810 # Transform confdefs.h into a sed script conftest.vals that substitutes
11811 # the proper values into config.h.in to produce config.h.  And first:
11812 # Protect against being on the right side of a sed subst in config.status.
11813 # Protect against being in an unquoted here document in config.status.
11814 rm -f conftest.vals
11815 cat > conftest.hdr <<\EOF
11816 s/[\\&%]/\\&/g
11817 s%[\\$`]%\\&%g
11818 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
11819 s%ac_d%ac_u%gp
11820 s%ac_u%ac_e%gp
11821 EOF
11822 sed -n -f conftest.hdr confdefs.h > conftest.vals
11823 rm -f conftest.hdr
11824
11825 # This sed command replaces #undef with comments.  This is necessary, for
11826 # example, in the case of _POSIX_SOURCE, which is predefined and required
11827 # on some systems where configure will not decide to define it.
11828 cat >> conftest.vals <<\EOF
11829 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
11830 EOF
11831
11832 # Break up conftest.vals because some shells have a limit on
11833 # the size of here documents, and old seds have small limits too.
11834
11835 rm -f conftest.tail
11836 while :
11837 do
11838   ac_lines=`grep -c . conftest.vals`
11839   # grep -c gives empty output for an empty file on some AIX systems.
11840   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
11841   # Write a limited-size here document to conftest.frag.
11842   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
11843   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
11844   echo 'CEOF
11845   sed -f conftest.frag conftest.in > conftest.out
11846   rm -f conftest.in
11847   mv conftest.out conftest.in
11848 ' >> $CONFIG_STATUS
11849   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
11850   rm -f conftest.vals
11851   mv conftest.tail conftest.vals
11852 done
11853 rm -f conftest.vals
11854
11855 cat >> $CONFIG_STATUS <<\EOF
11856   rm -f conftest.frag conftest.h
11857   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
11858   cat conftest.in >> conftest.h
11859   rm -f conftest.in
11860   if cmp -s $ac_file conftest.h 2>/dev/null; then
11861     echo "$ac_file is unchanged"
11862     rm -f conftest.h
11863   else
11864     # Remove last slash and all that follows it.  Not all systems have dirname.
11865       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
11866       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
11867       # The file is in a subdirectory.
11868       test ! -d "$ac_dir" && mkdir "$ac_dir"
11869     fi
11870     rm -f $ac_file
11871     mv conftest.h $ac_file
11872   fi
11873 fi; done
11874
11875 EOF
11876 cat >> $CONFIG_STATUS <<EOF
11877
11878 EOF
11879 cat >> $CONFIG_STATUS <<\EOF
11880
11881 date > stamp-h
11882 echo Please \"make depend\" to build dependencies
11883
11884 exit 0
11885 EOF
11886 chmod +x $CONFIG_STATUS
11887 rm -fr confdefs* $ac_clean_files
11888 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
11889