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