]> git.sur5r.net Git - openldap/blob - configure
Update to latest devel codes
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP: pkg/ldap/configure.in,v 1.314 2000/06/09 21:09:52 kurt Exp  
4
5 # Copyright 1998-2000 The OpenLDAP Foundation.  All Rights Reserved.
6
7 # Redistribution and use in source and binary forms are permitted only
8 # as authorized by the OpenLDAP Public License.  A copy of this
9 # license is available at http://www.OpenLDAP.org/license.html or
10 # in file LICENSE in the top-level directory of the distribution.
11
12 echo "Copyright 1998-2000 The OpenLDAP Foundation,  All Rights Reserved."
13 echo "Copying restrictions apply, see COPYRIGHT file."
14
15 # Guess values for system-dependent variables and create Makefiles.
16 # Generated automatically using autoconf version 2.13.1 
17 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
18 #
19 # This configure script is free software; the Free Software Foundation
20 # gives unlimited permission to copy, distribute and modify it.
21
22 # Defaults:
23 ac_help=
24 ac_default_prefix=/usr/local
25 # Any additions from configure.in:
26 ac_default_prefix=/usr/local
27 ac_help="$ac_help
28   --with-subdir=DIR change default subdirectory used for installs"
29 ac_help="$ac_help
30   --enable-debug        enable debugging (yes)"
31 ac_help="$ac_help
32   --enable-syslog       enable syslog support (auto)"
33 ac_help="$ac_help
34   --enable-proctitle    enable proctitle support (yes)"
35 ac_help="$ac_help
36   --enable-cache        enable caching (yes)"
37 ac_help="$ac_help
38   --enable-referrals    enable V2 Referrals extension (yes)"
39 ac_help="$ac_help
40   --enable-kbind        enable V2 Kerberos IV bind (auto)"
41 ac_help="$ac_help
42   --enable-cldap        enable connectionless ldap (no)"
43 ac_help="$ac_help
44   --enable-ipv6         enable IPv6 support (auto)"
45 ac_help="$ac_help
46   --enable-unix         enable UNIX domain socket support (auto)"
47 ac_help="$ac_help
48   --enable-x-compile    enable cross compiling (no)"
49 ac_help="$ac_help
50   --with-cyrus-sasl     with Cyrus SASL support (auto)"
51 ac_help="$ac_help
52   --with-fetch          with fetch URL support (auto)"
53 ac_help="$ac_help
54   --with-kerberos       with support (auto)"
55 ac_help="$ac_help
56   --with-readline       with readline support (auto)"
57 ac_help="$ac_help
58   --with-threads        use threads (auto)"
59 ac_help="$ac_help
60   --with-tls            with TLS/SSL support (auto)"
61 ac_help="$ac_help
62   --with-yielding-select        with implicitly yielding select (auto)"
63 ac_help="$ac_help
64 SLAPD (Standalone LDAP Daemon) Options:"
65 ac_help="$ac_help
66   --enable-slapd        enable building slapd (yes)"
67 ac_help="$ac_help
68     --enable-cleartext  enable cleartext passwords (yes)"
69 ac_help="$ac_help
70     --enable-crypt      enable crypt(3) passwords (auto)"
71 ac_help="$ac_help
72     --enable-kpasswd    enable kerberos password verification (no)"
73 ac_help="$ac_help
74     --enable-spasswd    enable (Cyrus) SASL password verification (no)"
75 ac_help="$ac_help
76     --enable-modules    enable dynamic module support (no)"
77 ac_help="$ac_help
78     --enable-multimaster        enable multimaster replication (no)"
79 ac_help="$ac_help
80     --enable-phonetic   enable phonetic/soundex (no)"
81 ac_help="$ac_help
82     --enable-quipu      build quipu migration tools (no)"
83 ac_help="$ac_help
84     --enable-rlookups   enable reverse lookups (auto)"
85 ac_help="$ac_help
86     --enable-aci        enable per-object ACIs (no)"
87 ac_help="$ac_help
88     --enable-wrappers   enable tcp wrapper support (no)"
89 ac_help="$ac_help
90     --enable-dynamic    enable linking built binaries with dynamic libs (no)"
91 ac_help="$ac_help
92     --enable-dnssrv     enable dnssrv backend (no)"
93 ac_help="$ac_help
94       --with-dnssrv-module      module type (static)"
95 ac_help="$ac_help
96     --enable-ldap       enable ldap backend (no)"
97 ac_help="$ac_help
98       --with-ldap-module        module type (static)"
99 ac_help="$ac_help
100     --enable-ldbm       enable ldbm backend (yes)"
101 ac_help="$ac_help
102       --with-ldbm-api   use LDBM API (auto)"
103 ac_help="$ac_help
104       --with-ldbm-module        module type (static)"
105 ac_help="$ac_help
106       --with-ldbm-type  use LDBM type (auto)"
107 ac_help="$ac_help
108     --enable-passwd     enable passwd backend (no)"
109 ac_help="$ac_help
110       --with-passwd-module      module type (static)"
111 ac_help="$ac_help
112     --enable-shell      enable shell backend (no)"
113 ac_help="$ac_help
114       --with-shell-module       module type (static)"
115 ac_help="$ac_help
116 SLURPD (Replication Daemon) Options:"
117 ac_help="$ac_help
118   --enable-slurpd       enable building slurpd (auto)"
119 ac_help="$ac_help
120 Library Generation & Linking Options"
121 ac_help="$ac_help
122   --enable-static[=PKGS]  build static libraries [default=yes]"
123 ac_help="$ac_help
124   --enable-shared[=PKGS]  build shared libraries [default=yes]"
125 ac_help="$ac_help
126   --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
127 ac_help="$ac_help
128   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
129 ac_help="$ac_help
130   --disable-libtool-lock  avoid locking (might break parallel builds)"
131
132 # Initialize some variables set by options.
133 # The variables have the same names as the options, with
134 # dashes changed to underlines.
135 build=NONE
136 cache_file=./config.cache
137 exec_prefix=NONE
138 host=NONE
139 no_create=
140 nonopt=NONE
141 no_recursion=
142 prefix=NONE
143 program_prefix=NONE
144 program_suffix=NONE
145 program_transform_name=s,x,x,
146 silent=
147 site=
148 srcdir=
149 target=NONE
150 verbose=
151 x_includes=NONE
152 x_libraries=NONE
153 bindir='${exec_prefix}/bin'
154 sbindir='${exec_prefix}/sbin'
155 libexecdir='${exec_prefix}/libexec'
156 datadir='${prefix}/share'
157 sysconfdir='${prefix}/etc'
158 sharedstatedir='${prefix}/com'
159 localstatedir='${prefix}/var'
160 libdir='${exec_prefix}/lib'
161 includedir='${prefix}/include'
162 oldincludedir='/usr/include'
163 infodir='${prefix}/info'
164 mandir='${prefix}/man'
165
166 # Initialize some other variables.
167 subdirs=
168 MFLAGS= MAKEFLAGS=
169 SHELL=${CONFIG_SHELL-/bin/sh}
170 # Maximum number of lines to put in a shell here document.
171 ac_max_here_lines=12
172
173 ac_prev=
174 for ac_option
175 do
176
177   # If the previous option needs an argument, assign it.
178   if test -n "$ac_prev"; then
179     eval "$ac_prev=\$ac_option"
180     ac_prev=
181     continue
182   fi
183
184   case "$ac_option" in
185   -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
186   *) ac_optarg= ;;
187   esac
188
189   # Accept the important Cygnus configure options, so we can diagnose typos.
190
191   case "$ac_option" in
192
193   -bindir | --bindir | --bindi | --bind | --bin | --bi)
194     ac_prev=bindir ;;
195   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
196     bindir="$ac_optarg" ;;
197
198   -build | --build | --buil | --bui | --bu)
199     ac_prev=build ;;
200   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
201     build="$ac_optarg" ;;
202
203   -cache-file | --cache-file | --cache-fil | --cache-fi \
204   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
205     ac_prev=cache_file ;;
206   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
207   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
208     cache_file="$ac_optarg" ;;
209
210   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
211     ac_prev=datadir ;;
212   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
213   | --da=*)
214     datadir="$ac_optarg" ;;
215
216   -disable-* | --disable-*)
217     ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
218     # Reject names that are not valid shell variable names.
219     if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
220       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
221     fi
222     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
223     eval "enable_${ac_feature}=no" ;;
224
225   -enable-* | --enable-*)
226     ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
227     # Reject names that are not valid shell variable names.
228     if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
229       { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
230     fi
231     ac_feature=`echo $ac_feature| sed 's/-/_/g'`
232     case "$ac_option" in
233       *=*) ;;
234       *) ac_optarg=yes ;;
235     esac
236     eval "enable_${ac_feature}='$ac_optarg'" ;;
237
238   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
239   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
240   | --exec | --exe | --ex)
241     ac_prev=exec_prefix ;;
242   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
243   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
244   | --exec=* | --exe=* | --ex=*)
245     exec_prefix="$ac_optarg" ;;
246
247   -gas | --gas | --ga | --g)
248     # Obsolete; use --with-gas.
249     with_gas=yes ;;
250
251   -help | --help | --hel | --he)
252     # Omit some internal or obsolete options to make the list less imposing.
253     # This message is too long to be a string in the A/UX 3.1 sh.
254     cat << EOF
255 Usage: configure [options] [host]
256 Options: [defaults in brackets after descriptions]
257 Configuration:
258   --cache-file=FILE       cache test results in FILE
259   --help                  print this message
260   --no-create             do not create output files
261   --quiet, --silent       do not print \`checking...' messages
262   --version               print the version of autoconf that created configure
263 Directory and file names:
264   --prefix=PREFIX         install architecture-independent files in PREFIX
265                           [$ac_default_prefix]
266   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
267                           [same as prefix]
268   --bindir=DIR            user executables in DIR [EPREFIX/bin]
269   --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
270   --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
271   --datadir=DIR           read-only architecture-independent data in DIR
272                           [PREFIX/share]
273   --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
274   --sharedstatedir=DIR    modifiable architecture-independent data in DIR
275                           [PREFIX/com]
276   --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
277   --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
278   --includedir=DIR        C header files in DIR [PREFIX/include]
279   --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
280   --infodir=DIR           info documentation in DIR [PREFIX/info]
281   --mandir=DIR            man documentation in DIR [PREFIX/man]
282   --srcdir=DIR            find the sources in DIR [configure dir or ..]
283   --program-prefix=PREFIX prepend PREFIX to installed program names
284   --program-suffix=SUFFIX append SUFFIX to installed program names
285   --program-transform-name=PROGRAM
286                           run sed PROGRAM on installed program names
287 EOF
288     cat << EOF
289 Host type:
290   --build=BUILD           configure for building on BUILD [BUILD=HOST]
291   --host=HOST             configure for HOST [guessed]
292   --target=TARGET         configure for TARGET [TARGET=HOST]
293 Features and packages:
294   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
295   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
296   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
297   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
298   --x-includes=DIR        X include files are in DIR
299   --x-libraries=DIR       X library files are in DIR
300 EOF
301     if test -n "$ac_help"; then
302       echo "--enable and --with options recognized:$ac_help"
303     fi
304     exit 0 ;;
305
306   -host | --host | --hos | --ho)
307     ac_prev=host ;;
308   -host=* | --host=* | --hos=* | --ho=*)
309     host="$ac_optarg" ;;
310
311   -includedir | --includedir | --includedi | --included | --include \
312   | --includ | --inclu | --incl | --inc)
313     ac_prev=includedir ;;
314   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
315   | --includ=* | --inclu=* | --incl=* | --inc=*)
316     includedir="$ac_optarg" ;;
317
318   -infodir | --infodir | --infodi | --infod | --info | --inf)
319     ac_prev=infodir ;;
320   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
321     infodir="$ac_optarg" ;;
322
323   -libdir | --libdir | --libdi | --libd)
324     ac_prev=libdir ;;
325   -libdir=* | --libdir=* | --libdi=* | --libd=*)
326     libdir="$ac_optarg" ;;
327
328   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
329   | --libexe | --libex | --libe)
330     ac_prev=libexecdir ;;
331   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
332   | --libexe=* | --libex=* | --libe=*)
333     libexecdir="$ac_optarg" ;;
334
335   -localstatedir | --localstatedir | --localstatedi | --localstated \
336   | --localstate | --localstat | --localsta | --localst \
337   | --locals | --local | --loca | --loc | --lo)
338     ac_prev=localstatedir ;;
339   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
340   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
341   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
342     localstatedir="$ac_optarg" ;;
343
344   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
345     ac_prev=mandir ;;
346   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
347     mandir="$ac_optarg" ;;
348
349   -nfp | --nfp | --nf)
350     # Obsolete; use --without-fp.
351     with_fp=no ;;
352
353   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
354   | --no-cr | --no-c)
355     no_create=yes ;;
356
357   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
358   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
359     no_recursion=yes ;;
360
361   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
362   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
363   | --oldin | --oldi | --old | --ol | --o)
364     ac_prev=oldincludedir ;;
365   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
366   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
367   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
368     oldincludedir="$ac_optarg" ;;
369
370   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
371     ac_prev=prefix ;;
372   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
373     prefix="$ac_optarg" ;;
374
375   -program-prefix | --program-prefix | --program-prefi | --program-pref \
376   | --program-pre | --program-pr | --program-p)
377     ac_prev=program_prefix ;;
378   -program-prefix=* | --program-prefix=* | --program-prefi=* \
379   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
380     program_prefix="$ac_optarg" ;;
381
382   -program-suffix | --program-suffix | --program-suffi | --program-suff \
383   | --program-suf | --program-su | --program-s)
384     ac_prev=program_suffix ;;
385   -program-suffix=* | --program-suffix=* | --program-suffi=* \
386   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
387     program_suffix="$ac_optarg" ;;
388
389   -program-transform-name | --program-transform-name \
390   | --program-transform-nam | --program-transform-na \
391   | --program-transform-n | --program-transform- \
392   | --program-transform | --program-transfor \
393   | --program-transfo | --program-transf \
394   | --program-trans | --program-tran \
395   | --progr-tra | --program-tr | --program-t)
396     ac_prev=program_transform_name ;;
397   -program-transform-name=* | --program-transform-name=* \
398   | --program-transform-nam=* | --program-transform-na=* \
399   | --program-transform-n=* | --program-transform-=* \
400   | --program-transform=* | --program-transfor=* \
401   | --program-transfo=* | --program-transf=* \
402   | --program-trans=* | --program-tran=* \
403   | --progr-tra=* | --program-tr=* | --program-t=*)
404     program_transform_name="$ac_optarg" ;;
405
406   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
407   | -silent | --silent | --silen | --sile | --sil)
408     silent=yes ;;
409
410   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
411     ac_prev=sbindir ;;
412   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
413   | --sbi=* | --sb=*)
414     sbindir="$ac_optarg" ;;
415
416   -sharedstatedir | --sharedstatedir | --sharedstatedi \
417   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
418   | --sharedst | --shareds | --shared | --share | --shar \
419   | --sha | --sh)
420     ac_prev=sharedstatedir ;;
421   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
422   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
423   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
424   | --sha=* | --sh=*)
425     sharedstatedir="$ac_optarg" ;;
426
427   -site | --site | --sit)
428     ac_prev=site ;;
429   -site=* | --site=* | --sit=*)
430     site="$ac_optarg" ;;
431
432   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
433     ac_prev=srcdir ;;
434   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
435     srcdir="$ac_optarg" ;;
436
437   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
438   | --syscon | --sysco | --sysc | --sys | --sy)
439     ac_prev=sysconfdir ;;
440   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
441   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
442     sysconfdir="$ac_optarg" ;;
443
444   -target | --target | --targe | --targ | --tar | --ta | --t)
445     ac_prev=target ;;
446   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
447     target="$ac_optarg" ;;
448
449   -v | -verbose | --verbose | --verbos | --verbo | --verb)
450     verbose=yes ;;
451
452   -version | --version | --versio | --versi | --vers)
453     echo "configure generated by autoconf version 2.13.1"
454     exit 0 ;;
455
456   -with-* | --with-*)
457     ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
458     # Reject names that are not valid shell variable names.
459     if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
460       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
461     fi
462     ac_package=`echo $ac_package| sed 's/-/_/g'`
463     case "$ac_option" in
464       *=*) ;;
465       *) ac_optarg=yes ;;
466     esac
467     eval "with_${ac_package}='$ac_optarg'" ;;
468
469   -without-* | --without-*)
470     ac_package=`echo $ac_option|sed -e 's/-*without-//'`
471     # Reject names that are not valid shell variable names.
472     if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
473       { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
474     fi
475     ac_package=`echo $ac_package| sed 's/-/_/g'`
476     eval "with_${ac_package}=no" ;;
477
478   --x)
479     # Obsolete; use --with-x.
480     with_x=yes ;;
481
482   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
483   | --x-incl | --x-inc | --x-in | --x-i)
484     ac_prev=x_includes ;;
485   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
486   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
487     x_includes="$ac_optarg" ;;
488
489   -x-libraries | --x-libraries | --x-librarie | --x-librari \
490   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
491     ac_prev=x_libraries ;;
492   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
493   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
494     x_libraries="$ac_optarg" ;;
495
496   -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
497     ;;
498
499   *)
500     if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
501       echo "configure: warning: $ac_option: invalid host type" 1>&2
502     fi
503     if test "x$nonopt" != xNONE; then
504       { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
505     fi
506     nonopt="$ac_option"
507     ;;
508
509   esac
510 done
511
512 if test -n "$ac_prev"; then
513   { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
514 fi
515
516 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
517
518 # File descriptor usage:
519 # 0 standard input
520 # 1 file creation
521 # 2 errors and warnings
522 # 3 some systems may open it to /dev/tty
523 # 4 used on the Kubota Titan
524 # 6 checking for... messages and results
525 # 5 compiler messages saved in config.log
526 if test "$silent" = yes; then
527   exec 6>/dev/null
528 else
529   exec 6>&1
530 fi
531 exec 5>./config.log
532
533 echo "\
534 This file contains any messages produced by compilers while
535 running configure, to aid debugging if configure makes a mistake.
536 " 1>&5
537
538 # Strip out --no-create and --no-recursion so they do not pile up.
539 # Also quote any args containing shell metacharacters.
540 ac_configure_args=
541 for ac_arg
542 do
543   case "$ac_arg" in
544   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
545   | --no-cr | --no-c) ;;
546   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
547   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
548   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
549   ac_configure_args="$ac_configure_args '$ac_arg'" ;;
550   *) ac_configure_args="$ac_configure_args $ac_arg" ;;
551   esac
552 done
553
554 # NLS nuisances.
555 # Only set these to C if already set.  These must not be set unconditionally
556 # because not all systems understand e.g. LANG=C (notably SCO).
557 # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
558 # Non-C LC_CTYPE values break the ctype check.
559 if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
560 if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
561 if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
562 if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
563
564 # confdefs.h avoids OS command line length limits that DEFS can exceed.
565 rm -rf conftest* confdefs.h
566 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
567 echo > confdefs.h
568
569 # A filename unique to this package, relative to the directory that
570 # configure is in, which we can look for to find out if srcdir is correct.
571 ac_unique_file=build/version
572
573 # Find the source files, if location was not specified.
574 if test -z "$srcdir"; then
575   ac_srcdir_defaulted=yes
576   # Try the directory containing this script, then its parent.
577   ac_prog=$0
578   ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
579   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
580   srcdir=$ac_confdir
581   if test ! -r $srcdir/$ac_unique_file; then
582     srcdir=..
583   fi
584 else
585   ac_srcdir_defaulted=no
586 fi
587 if test ! -r $srcdir/$ac_unique_file; then
588   if test "$ac_srcdir_defaulted" = yes; then
589     { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
590   else
591     { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
592   fi
593 fi
594 srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
595
596 # Prefer explicitly selected file to automatically selected ones.
597 if test -z "$CONFIG_SITE"; then
598   if test "x$prefix" != xNONE; then
599     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
600   else
601     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
602   fi
603 fi
604 for ac_site_file in $CONFIG_SITE; do
605   if test -r "$ac_site_file"; then
606     echo "loading site script $ac_site_file"
607     . "$ac_site_file"
608   fi
609 done
610
611
612 ac_ext=c
613 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
614 ac_cpp='$CPP $CPPFLAGS'
615 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
616 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
617 cross_compiling=$ac_cv_prog_cc_cross
618
619 ac_exeext=
620 ac_objext=o
621 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
622   # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
623   if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
624     ac_n= ac_c='
625 ' ac_t='        '
626   else
627     ac_n=-n ac_c= ac_t=
628   fi
629 else
630   ac_n= ac_c='\c' ac_t=
631 fi
632
633
634 # set unset (borrowed from autoconf 2.14a)
635 if (unset FOO) >/dev/null 2>&1; then
636   ol_unset=unset
637 else
638   ol_unset=false
639 fi
640 # unset CDPATH
641 $ol_unset CDPATH || test "${CDPATH+set}" != set || CDPATH=: && export CDPATH
642
643 ac_aux_dir=
644 for ac_dir in build $srcdir/build; do
645   if test -f $ac_dir/install-sh; then
646     ac_aux_dir=$ac_dir
647     ac_install_sh="$ac_aux_dir/install-sh -c"
648     break
649   elif test -f $ac_dir/install.sh; then
650     ac_aux_dir=$ac_dir
651     ac_install_sh="$ac_aux_dir/install.sh -c"
652     break
653   elif test -f $ac_dir/shtool; then
654     ac_aux_dir=$ac_dir
655     ac_install_sh="$ac_aux_dir/shtool install -c"
656     break
657   fi
658 done
659 if test -z "$ac_aux_dir"; then
660   { echo "configure: error: can not find install-sh or install.sh in build $srcdir/build" 1>&2; exit 1; }
661 fi
662 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
663 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
664 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
665
666 OL_VERSION=`cat $ac_aux_dir/version`
667 if test -z "$OL_VERSION"; then
668         { echo "configure: error: could not determine version" 1>&2; exit 1; }
669 fi
670
671 echo "Configuring OpenLDAP $OL_VERSION ..."
672
673
674 echo $ac_n "checking host system type""... $ac_c" 1>&6
675 echo "configure:676: checking host system type" >&5
676 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
677
678 # Make sure we can run config.sub.
679   if $ac_config_sub sun4 >/dev/null 2>&1; then :
680     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
681   fi
682
683   ac_cv_host_alias=$host
684   case "$ac_cv_host_alias" in
685   NONE)
686     case $nonopt in
687     NONE)
688       if ac_cv_host_alias=`$ac_config_guess`; then :
689       else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
690       fi ;;
691     *) ac_cv_host_alias=$nonopt ;;
692     esac ;;
693   esac
694
695   ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
696   ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
697   ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
698   ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
699 else
700   echo $ac_n "(cached) $ac_c" 1>&6
701 fi
702
703 echo "$ac_t""$ac_cv_host" 1>&6
704
705 host=$ac_cv_host
706 host_alias=$ac_cv_host_alias
707 host_cpu=$ac_cv_host_cpu
708 host_vendor=$ac_cv_host_vendor
709 host_os=$ac_cv_host_os
710
711
712
713
714
715 echo $ac_n "checking target system type""... $ac_c" 1>&6
716 echo "configure:717: checking target system type" >&5
717 if test "x$ac_cv_target" = "x" || (test "x$target" != "xNONE" && test "x$target" != "x$ac_cv_target_alias"); then
718
719 # Make sure we can run config.sub.
720   if $ac_config_sub sun4 >/dev/null 2>&1; then :
721     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
722   fi
723
724   ac_cv_target_alias=$target
725   case "$ac_cv_target_alias" in
726   NONE)
727     case $nonopt in
728     NONE)
729       ac_cv_target_alias=$host_alias ;;
730
731     *) ac_cv_target_alias=$nonopt ;;
732     esac ;;
733   esac
734
735   ac_cv_target=`$ac_config_sub $ac_cv_target_alias`
736   ac_cv_target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
737   ac_cv_target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
738   ac_cv_target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
739 else
740   echo $ac_n "(cached) $ac_c" 1>&6
741 fi
742
743 echo "$ac_t""$ac_cv_target" 1>&6
744
745 target=$ac_cv_target
746 target_alias=$ac_cv_target_alias
747 target_cpu=$ac_cv_target_cpu
748 target_vendor=$ac_cv_target_vendor
749 target_os=$ac_cv_target_os
750
751
752
753
754
755 echo $ac_n "checking build system type""... $ac_c" 1>&6
756 echo "configure:757: checking build system type" >&5
757 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
758
759 # Make sure we can run config.sub.
760   if $ac_config_sub sun4 >/dev/null 2>&1; then :
761     else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
762   fi
763
764   ac_cv_build_alias=$build
765   case "$ac_cv_build_alias" in
766   NONE)
767     case $nonopt in
768     NONE)
769       ac_cv_build_alias=$host_alias ;;
770
771     *) ac_cv_build_alias=$nonopt ;;
772     esac ;;
773   esac
774
775   ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
776   ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
777   ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
778   ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
779 else
780   echo $ac_n "(cached) $ac_c" 1>&6
781 fi
782
783 echo "$ac_t""$ac_cv_build" 1>&6
784
785 build=$ac_cv_build
786 build_alias=$ac_cv_build_alias
787 build_cpu=$ac_cv_build_cpu
788 build_vendor=$ac_cv_build_vendor
789 build_os=$ac_cv_build_os
790
791
792
793
794
795 # Do some error checking and defaulting for the host and target type.
796 # The inputs are:
797 #    configure --host=HOST --target=TARGET --build=BUILD NONOPT
798 #
799 # The rules are:
800 # 1. You are not allowed to specify --host, --target, and nonopt at the
801 #    same time.
802 # 2. Host defaults to nonopt.
803 # 3. If nonopt is not specified, then host defaults to the current host,
804 #    as determined by config.guess.
805 # 4. Target and build default to nonopt.
806 # 5. If nonopt is not specified, then target and build default to host.
807
808 # The aliases save the names the user supplied, while $host etc.
809 # will get canonicalized.
810 case $host---$target---$nonopt in
811 NONE---*---* | *---NONE---* | *---*---NONE) ;;
812 *) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
813 esac
814
815 test "$host_alias" != "$target_alias" &&
816   test "$program_prefix$program_suffix$program_transform_name" = \
817     NONENONEs,x,x, &&
818   program_prefix=${target_alias}-
819
820
821 # Find a good install program.  We prefer a C program (faster),
822 # so one script is as good as another.  But avoid the broken or
823 # incompatible versions:
824 # SysV /etc/install, /usr/sbin/install
825 # SunOS /usr/etc/install
826 # IRIX /sbin/install
827 # AIX /bin/install
828 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
829 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
830 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
831 # ./install, which can be erroneously created by make from ./install.sh.
832 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
833 echo "configure:834: checking for a BSD compatible install" >&5
834 if test -z "$INSTALL"; then
835 if eval "test \"\${ac_cv_path_install+set}\" = set"; then
836   echo $ac_n "(cached) $ac_c" 1>&6
837 else
838     IFS="${IFS=         }"; ac_save_IFS="$IFS"; IFS=":"
839   for ac_dir in $PATH; do
840     # Account for people who put trailing slashes in PATH elements.
841     case "$ac_dir/" in
842     /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
843     *)
844       # OSF1 and SCO ODT 3.0 have their own names for install.
845       # Don't use installbsd from OSF since it installs stuff as root
846       # by default.
847       for ac_prog in ginstall scoinst install; do
848         if test -f $ac_dir/$ac_prog; then
849           if test $ac_prog = install &&
850             grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
851             # AIX install.  It has an incompatible calling convention.
852             :
853           elif test $ac_prog = install &&
854             grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
855             # program-specific install script used by HP pwplus--don't use.
856             :
857           else
858             ac_cv_path_install="$ac_dir/$ac_prog -c"
859             break 2
860           fi
861         fi
862       done
863       ;;
864     esac
865   done
866   IFS="$ac_save_IFS"
867
868 fi
869   if test "${ac_cv_path_install+set}" = set; then
870     INSTALL="$ac_cv_path_install"
871   else
872     # As a last resort, use the slow shell script.  We don't cache a
873     # path for INSTALL within a source directory, because that will
874     # break other packages using the cache if that directory is
875     # removed, or if the path is relative.
876     INSTALL="$ac_install_sh"
877   fi
878 fi
879 echo "$ac_t""$INSTALL" 1>&6
880
881 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
882 # It thinks the first close brace ends the variable substitution.
883 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
884
885 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
886
887 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
888
889 echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
890 echo "configure:891: checking whether build environment is sane" >&5
891 # Just in case
892 sleep 1
893 echo timestamp > conftestfile
894 # Do `set' in a subshell so we don't clobber the current shell's
895 # arguments.  Must try -L first in case configure is actually a
896 # symlink; some systems play weird games with the mod time of symlinks
897 # (eg FreeBSD returns the mod time of the symlink's containing
898 # directory).
899 if (
900    set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
901    if test "$*" = "X"; then
902       # -L didn't work.
903       set X `ls -t $srcdir/configure conftestfile`
904    fi
905    if test "$*" != "X $srcdir/configure conftestfile" \
906       && test "$*" != "X conftestfile $srcdir/configure"; then
907
908       # If neither matched, then we have a broken ls.  This can happen
909       # if, for instance, CONFIG_SHELL is bash and it inherits a
910       # broken ls alias from the environment.  This has actually
911       # happened.  Such a system could not be considered "sane".
912       { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
913 alias in your environment" 1>&2; exit 1; }
914    fi
915
916    test "$2" = conftestfile
917    )
918 then
919    # Ok.
920    :
921 else
922    { echo "configure: error: newly created file is older than distributed files!
923 Check your system clock" 1>&2; exit 1; }
924 fi
925 rm -f conftest*
926 echo "$ac_t""yes" 1>&6
927 if test "$program_transform_name" = s,x,x,; then
928   program_transform_name=
929 else
930   # Double any \ or $.  echo might interpret backslashes.
931   cat <<\EOF_SED > conftestsed
932 s,\\,\\\\,g; s,\$,$$,g
933 EOF_SED
934   program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
935   rm -f conftestsed
936 fi
937 test "$program_prefix" != NONE &&
938   program_transform_name="s,^,${program_prefix},;$program_transform_name"
939 # Use a double $ so make ignores it.
940 test "$program_suffix" != NONE &&
941   program_transform_name="s,\$\$,${program_suffix},;$program_transform_name"
942
943 # sed with no file args requires a program.
944 test "$program_transform_name" = "" && program_transform_name="s,x,x,"
945
946 for ac_prog in mawk gawk nawk awk
947 do
948 # Extract the first word of "$ac_prog", so it can be a program name with args.
949 set dummy $ac_prog; ac_word=$2
950 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
951 echo "configure:952: checking for $ac_word" >&5
952 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
953   echo $ac_n "(cached) $ac_c" 1>&6
954 else
955   if test -n "$AWK"; then
956   ac_cv_prog_AWK="$AWK" # Let the user override the test.
957 else
958   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
959   ac_dummy="$PATH"
960   for ac_dir in $ac_dummy; do
961     test -z "$ac_dir" && ac_dir=.
962     if test -f $ac_dir/$ac_word; then
963       ac_cv_prog_AWK="$ac_prog"
964       break
965     fi
966   done
967   IFS="$ac_save_ifs"
968 fi
969 fi
970 AWK="$ac_cv_prog_AWK"
971 if test -n "$AWK"; then
972   echo "$ac_t""$AWK" 1>&6
973 else
974   echo "$ac_t""no" 1>&6
975 fi
976
977 test -n "$AWK" && break
978 done
979
980 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
981 echo "configure:982: checking whether ${MAKE-make} sets \${MAKE}" >&5
982 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
983 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
984   echo $ac_n "(cached) $ac_c" 1>&6
985 else
986   cat > conftestmake <<\EOF
987 all:
988         @echo 'ac_maketemp="${MAKE}"'
989 EOF
990 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
991 eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
992 if test -n "$ac_maketemp"; then
993   eval ac_cv_prog_make_${ac_make}_set=yes
994 else
995   eval ac_cv_prog_make_${ac_make}_set=no
996 fi
997 rm -f conftestmake
998 fi
999 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1000   echo "$ac_t""yes" 1>&6
1001   SET_MAKE=
1002 else
1003   echo "$ac_t""no" 1>&6
1004   SET_MAKE="MAKE=${MAKE-make}"
1005 fi
1006
1007
1008
1009 PACKAGE=OpenLDAP
1010
1011 VERSION=$OL_VERSION
1012
1013 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
1014   { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
1015 fi
1016
1017
1018
1019 missing_dir=`cd $ac_aux_dir && pwd`
1020 echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
1021 echo "configure:1022: checking for working aclocal" >&5
1022 # Run test in a subshell; some versions of sh will print an error if
1023 # an executable is not found, even if stderr is redirected.
1024 # Redirect stdin to placate older versions of autoconf.  Sigh.
1025 if (aclocal --version) < /dev/null > /dev/null 2>&1; then
1026    ACLOCAL=aclocal
1027    echo "$ac_t""found" 1>&6
1028 else
1029    ACLOCAL="$missing_dir/missing aclocal"
1030    echo "$ac_t""missing" 1>&6
1031 fi
1032
1033 echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
1034 echo "configure:1035: checking for working autoconf" >&5
1035 # Run test in a subshell; some versions of sh will print an error if
1036 # an executable is not found, even if stderr is redirected.
1037 # Redirect stdin to placate older versions of autoconf.  Sigh.
1038 if (autoconf --version) < /dev/null > /dev/null 2>&1; then
1039    AUTOCONF=autoconf
1040    echo "$ac_t""found" 1>&6
1041 else
1042    AUTOCONF="$missing_dir/missing autoconf"
1043    echo "$ac_t""missing" 1>&6
1044 fi
1045
1046 echo $ac_n "checking for working automake""... $ac_c" 1>&6
1047 echo "configure:1048: checking for working automake" >&5
1048 # Run test in a subshell; some versions of sh will print an error if
1049 # an executable is not found, even if stderr is redirected.
1050 # Redirect stdin to placate older versions of autoconf.  Sigh.
1051 if (automake --version) < /dev/null > /dev/null 2>&1; then
1052    AUTOMAKE=automake
1053    echo "$ac_t""found" 1>&6
1054 else
1055    AUTOMAKE="$missing_dir/missing automake"
1056    echo "$ac_t""missing" 1>&6
1057 fi
1058
1059 echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
1060 echo "configure:1061: checking for working autoheader" >&5
1061 # Run test in a subshell; some versions of sh will print an error if
1062 # an executable is not found, even if stderr is redirected.
1063 # Redirect stdin to placate older versions of autoconf.  Sigh.
1064 if (autoheader --version) < /dev/null > /dev/null 2>&1; then
1065    AUTOHEADER=autoheader
1066    echo "$ac_t""found" 1>&6
1067 else
1068    AUTOHEADER="$missing_dir/missing autoheader"
1069    echo "$ac_t""missing" 1>&6
1070 fi
1071
1072 echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
1073 echo "configure:1074: checking for working makeinfo" >&5
1074 # Run test in a subshell; some versions of sh will print an error if
1075 # an executable is not found, even if stderr is redirected.
1076 # Redirect stdin to placate older versions of autoconf.  Sigh.
1077 if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
1078    MAKEINFO=makeinfo
1079    echo "$ac_t""found" 1>&6
1080 else
1081    MAKEINFO="$missing_dir/missing makeinfo"
1082    echo "$ac_t""missing" 1>&6
1083 fi
1084
1085 install_sh="$missing_dir/install-sh"
1086 test -f "$install_sh" || install_sh="$missing_dir/install.sh"
1087
1088 for ac_prog in gnutar gtar tar
1089 do
1090 # Extract the first word of "$ac_prog", so it can be a program name with args.
1091 set dummy $ac_prog; ac_word=$2
1092 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1093 echo "configure:1094: checking for $ac_word" >&5
1094 if eval "test \"\${ac_cv_prog_AMTAR+set}\" = set"; then
1095   echo $ac_n "(cached) $ac_c" 1>&6
1096 else
1097   if test -n "$AMTAR"; then
1098   ac_cv_prog_AMTAR="$AMTAR" # Let the user override the test.
1099 else
1100   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
1101   ac_dummy="$PATH"
1102   for ac_dir in $ac_dummy; do
1103     test -z "$ac_dir" && ac_dir=.
1104     if test -f $ac_dir/$ac_word; then
1105       ac_cv_prog_AMTAR="$ac_prog"
1106       break
1107     fi
1108   done
1109   IFS="$ac_save_ifs"
1110 fi
1111 fi
1112 AMTAR="$ac_cv_prog_AMTAR"
1113 if test -n "$AMTAR"; then
1114   echo "$ac_t""$AMTAR" 1>&6
1115 else
1116   echo "$ac_t""no" 1>&6
1117 fi
1118
1119 test -n "$AMTAR" && break
1120 done
1121
1122
1123 AMTARFLAGS=
1124 if test -n "$AMTAR"; then
1125   if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
1126         AMTARFLAGS=o
1127   fi
1128 fi
1129
1130
1131
1132 cat >> confdefs.h <<EOF
1133 #define OPENLDAP_PACKAGE "$PACKAGE"
1134 EOF
1135
1136 cat >> confdefs.h <<EOF
1137 #define OPENLDAP_VERSION "$VERSION"
1138 EOF
1139
1140
1141
1142
1143 echo $ac_n "checking configure arguments""... $ac_c" 1>&6
1144 echo "configure:1145: checking configure arguments" >&5
1145
1146
1147 top_builddir=`pwd`
1148
1149 ldap_subdir="/openldap"
1150
1151 # Check whether --with-subdir or --without-subdir was given.
1152 if test "${with_subdir+set}" = set; then
1153   withval="$with_subdir"
1154   case "$withval" in
1155         no) ldap_subdir=""
1156                 ;;
1157         yes)
1158                 ;;
1159         /*|\\*)
1160                 ldap_subdir="$withval"
1161                 ;;
1162         *)
1163                 ldap_subdir="/$withval"
1164                 ;;
1165 esac
1166
1167 fi
1168
1169
1170 # OpenLDAP --enable-debug
1171         # Check whether --enable-debug or --disable-debug was given.
1172 if test "${enable_debug+set}" = set; then
1173   enableval="$enable_debug"
1174   
1175         ol_arg=invalid
1176         for ol_val in auto yes no ; do
1177                 if test "$enableval" = "$ol_val" ; then
1178                         ol_arg="$ol_val"
1179                 fi
1180         done
1181         if test "$ol_arg" = "invalid" ; then
1182                 { echo "configure: error: bad value $enableval for --enable-debug" 1>&2; exit 1; }
1183         fi
1184         ol_enable_debug="$ol_arg"
1185
1186 else
1187         ol_enable_debug="yes"
1188 fi
1189 # end --enable-debug
1190 # OpenLDAP --enable-syslog
1191         # Check whether --enable-syslog or --disable-syslog was given.
1192 if test "${enable_syslog+set}" = set; then
1193   enableval="$enable_syslog"
1194   
1195         ol_arg=invalid
1196         for ol_val in auto yes no ; do
1197                 if test "$enableval" = "$ol_val" ; then
1198                         ol_arg="$ol_val"
1199                 fi
1200         done
1201         if test "$ol_arg" = "invalid" ; then
1202                 { echo "configure: error: bad value $enableval for --enable-syslog" 1>&2; exit 1; }
1203         fi
1204         ol_enable_syslog="$ol_arg"
1205
1206 else
1207         ol_enable_syslog="auto"
1208 fi
1209 # end --enable-syslog
1210 # OpenLDAP --enable-proctitle
1211         # Check whether --enable-proctitle or --disable-proctitle was given.
1212 if test "${enable_proctitle+set}" = set; then
1213   enableval="$enable_proctitle"
1214   
1215         ol_arg=invalid
1216         for ol_val in auto yes no ; do
1217                 if test "$enableval" = "$ol_val" ; then
1218                         ol_arg="$ol_val"
1219                 fi
1220         done
1221         if test "$ol_arg" = "invalid" ; then
1222                 { echo "configure: error: bad value $enableval for --enable-proctitle" 1>&2; exit 1; }
1223         fi
1224         ol_enable_proctitle="$ol_arg"
1225
1226 else
1227         ol_enable_proctitle="yes"
1228 fi
1229 # end --enable-proctitle
1230 # OpenLDAP --enable-cache
1231         # Check whether --enable-cache or --disable-cache was given.
1232 if test "${enable_cache+set}" = set; then
1233   enableval="$enable_cache"
1234   
1235         ol_arg=invalid
1236         for ol_val in auto yes no ; do
1237                 if test "$enableval" = "$ol_val" ; then
1238                         ol_arg="$ol_val"
1239                 fi
1240         done
1241         if test "$ol_arg" = "invalid" ; then
1242                 { echo "configure: error: bad value $enableval for --enable-cache" 1>&2; exit 1; }
1243         fi
1244         ol_enable_cache="$ol_arg"
1245
1246 else
1247         ol_enable_cache="yes"
1248 fi
1249 # end --enable-cache
1250 # OpenLDAP --enable-referrals
1251         # Check whether --enable-referrals or --disable-referrals was given.
1252 if test "${enable_referrals+set}" = set; then
1253   enableval="$enable_referrals"
1254   
1255         ol_arg=invalid
1256         for ol_val in auto yes no ; do
1257                 if test "$enableval" = "$ol_val" ; then
1258                         ol_arg="$ol_val"
1259                 fi
1260         done
1261         if test "$ol_arg" = "invalid" ; then
1262                 { echo "configure: error: bad value $enableval for --enable-referrals" 1>&2; exit 1; }
1263         fi
1264         ol_enable_referrals="$ol_arg"
1265
1266 else
1267         ol_enable_referrals="yes"
1268 fi
1269 # end --enable-referrals
1270 # OpenLDAP --enable-kbind
1271         # Check whether --enable-kbind or --disable-kbind was given.
1272 if test "${enable_kbind+set}" = set; then
1273   enableval="$enable_kbind"
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-kbind" 1>&2; exit 1; }
1283         fi
1284         ol_enable_kbind="$ol_arg"
1285
1286 else
1287         ol_enable_kbind="auto"
1288 fi
1289 # end --enable-kbind
1290 # OpenLDAP --enable-cldap
1291         # Check whether --enable-cldap or --disable-cldap was given.
1292 if test "${enable_cldap+set}" = set; then
1293   enableval="$enable_cldap"
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-cldap" 1>&2; exit 1; }
1303         fi
1304         ol_enable_cldap="$ol_arg"
1305
1306 else
1307         ol_enable_cldap="no"
1308 fi
1309 # end --enable-cldap
1310 # OpenLDAP --enable-ipv6
1311         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1312 if test "${enable_ipv6+set}" = set; then
1313   enableval="$enable_ipv6"
1314   
1315         ol_arg=invalid
1316         for ol_val in auto yes no ; do
1317                 if test "$enableval" = "$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 $enableval for --enable-ipv6" 1>&2; exit 1; }
1323         fi
1324         ol_enable_ipv6="$ol_arg"
1325
1326 else
1327         ol_enable_ipv6="auto"
1328 fi
1329 # end --enable-ipv6
1330 # OpenLDAP --enable-unix
1331         # Check whether --enable-unix or --disable-unix was given.
1332 if test "${enable_unix+set}" = set; then
1333   enableval="$enable_unix"
1334   
1335         ol_arg=invalid
1336         for ol_val in auto yes no ; do
1337                 if test "$enableval" = "$ol_val" ; then
1338                         ol_arg="$ol_val"
1339                 fi
1340         done
1341         if test "$ol_arg" = "invalid" ; then
1342                 { echo "configure: error: bad value $enableval for --enable-unix" 1>&2; exit 1; }
1343         fi
1344         ol_enable_unix="$ol_arg"
1345
1346 else
1347         ol_enable_unix="auto"
1348 fi
1349 # end --enable-unix
1350 # OpenLDAP --enable-x_compile
1351         # Check whether --enable-x_compile or --disable-x_compile was given.
1352 if test "${enable_x_compile+set}" = set; then
1353   enableval="$enable_x_compile"
1354   
1355         ol_arg=invalid
1356         for ol_val in yes no ; do
1357                 if test "$enableval" = "$ol_val" ; then
1358                         ol_arg="$ol_val"
1359                 fi
1360         done
1361         if test "$ol_arg" = "invalid" ; then
1362                 { echo "configure: error: bad value $enableval for --enable-x_compile" 1>&2; exit 1; }
1363         fi
1364         ol_enable_x_compile="$ol_arg"
1365
1366 else
1367         ol_enable_x_compile="no"
1368 fi
1369 # end --enable-x_compile
1370
1371
1372 # OpenLDAP --with-cyrus_sasl
1373         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1374 if test "${with_cyrus_sasl+set}" = set; then
1375   withval="$with_cyrus_sasl"
1376   
1377         ol_arg=invalid
1378         for ol_val in auto yes no  ; do
1379                 if test "$withval" = "$ol_val" ; then
1380                         ol_arg="$ol_val"
1381                 fi
1382         done
1383         if test "$ol_arg" = "invalid" ; then
1384                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1385         fi
1386         ol_with_cyrus_sasl="$ol_arg"
1387
1388 else
1389         ol_with_cyrus_sasl="auto"
1390 fi
1391 # end --with-cyrus_sasl
1392
1393 # OpenLDAP --with-fetch
1394         # Check whether --with-fetch or --without-fetch was given.
1395 if test "${with_fetch+set}" = set; then
1396   withval="$with_fetch"
1397   
1398         ol_arg=invalid
1399         for ol_val in auto yes no  ; do
1400                 if test "$withval" = "$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 $withval for --with-fetch" 1>&2; exit 1; }
1406         fi
1407         ol_with_fetch="$ol_arg"
1408
1409 else
1410         ol_with_fetch="auto"
1411 fi
1412 # end --with-fetch
1413
1414 # OpenLDAP --with-kerberos
1415         # Check whether --with-kerberos or --without-kerberos was given.
1416 if test "${with_kerberos+set}" = set; then
1417   withval="$with_kerberos"
1418   
1419         ol_arg=invalid
1420         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1421                 if test "$withval" = "$ol_val" ; then
1422                         ol_arg="$ol_val"
1423                 fi
1424         done
1425         if test "$ol_arg" = "invalid" ; then
1426                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1427         fi
1428         ol_with_kerberos="$ol_arg"
1429
1430 else
1431         ol_with_kerberos="auto"
1432 fi
1433 # end --with-kerberos
1434
1435 # OpenLDAP --with-readline
1436         # Check whether --with-readline or --without-readline was given.
1437 if test "${with_readline+set}" = set; then
1438   withval="$with_readline"
1439   
1440         ol_arg=invalid
1441         for ol_val in auto yes no  ; do
1442                 if test "$withval" = "$ol_val" ; then
1443                         ol_arg="$ol_val"
1444                 fi
1445         done
1446         if test "$ol_arg" = "invalid" ; then
1447                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1448         fi
1449         ol_with_readline="$ol_arg"
1450
1451 else
1452         ol_with_readline="auto"
1453 fi
1454 # end --with-readline
1455
1456 # OpenLDAP --with-threads
1457         # Check whether --with-threads or --without-threads was given.
1458 if test "${with_threads+set}" = set; then
1459   withval="$with_threads"
1460   
1461         ol_arg=invalid
1462         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1463                 if test "$withval" = "$ol_val" ; then
1464                         ol_arg="$ol_val"
1465                 fi
1466         done
1467         if test "$ol_arg" = "invalid" ; then
1468                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1469         fi
1470         ol_with_threads="$ol_arg"
1471
1472 else
1473         ol_with_threads="auto"
1474 fi
1475 # end --with-threads
1476
1477 # OpenLDAP --with-tls
1478         # Check whether --with-tls or --without-tls was given.
1479 if test "${with_tls+set}" = set; then
1480   withval="$with_tls"
1481   
1482         ol_arg=invalid
1483         for ol_val in auto ssleay openssl yes no  ; do
1484                 if test "$withval" = "$ol_val" ; then
1485                         ol_arg="$ol_val"
1486                 fi
1487         done
1488         if test "$ol_arg" = "invalid" ; then
1489                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1490         fi
1491         ol_with_tls="$ol_arg"
1492
1493 else
1494         ol_with_tls="auto"
1495 fi
1496 # end --with-tls
1497
1498 # OpenLDAP --with-yielding_select
1499         # Check whether --with-yielding_select or --without-yielding_select was given.
1500 if test "${with_yielding_select+set}" = set; then
1501   withval="$with_yielding_select"
1502   
1503         ol_arg=invalid
1504         for ol_val in auto yes no manual  ; do
1505                 if test "$withval" = "$ol_val" ; then
1506                         ol_arg="$ol_val"
1507                 fi
1508         done
1509         if test "$ol_arg" = "invalid" ; then
1510                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1511         fi
1512         ol_with_yielding_select="$ol_arg"
1513
1514 else
1515         ol_with_yielding_select="auto"
1516 fi
1517 # end --with-yielding_select
1518
1519
1520
1521 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1522 if test "${with_xxslapdoptions+set}" = set; then
1523   withval="$with_xxslapdoptions"
1524   :
1525 fi
1526
1527 # OpenLDAP --enable-slapd
1528         # Check whether --enable-slapd or --disable-slapd was given.
1529 if test "${enable_slapd+set}" = set; then
1530   enableval="$enable_slapd"
1531   
1532         ol_arg=invalid
1533         for ol_val in auto yes no ; do
1534                 if test "$enableval" = "$ol_val" ; then
1535                         ol_arg="$ol_val"
1536                 fi
1537         done
1538         if test "$ol_arg" = "invalid" ; then
1539                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1540         fi
1541         ol_enable_slapd="$ol_arg"
1542
1543 else
1544         ol_enable_slapd="yes"
1545 fi
1546 # end --enable-slapd
1547 # OpenLDAP --enable-cleartext
1548         # Check whether --enable-cleartext or --disable-cleartext was given.
1549 if test "${enable_cleartext+set}" = set; then
1550   enableval="$enable_cleartext"
1551   
1552         ol_arg=invalid
1553         for ol_val in auto yes no ; do
1554                 if test "$enableval" = "$ol_val" ; then
1555                         ol_arg="$ol_val"
1556                 fi
1557         done
1558         if test "$ol_arg" = "invalid" ; then
1559                 { echo "configure: error: bad value $enableval for --enable-cleartext" 1>&2; exit 1; }
1560         fi
1561         ol_enable_cleartext="$ol_arg"
1562
1563 else
1564         ol_enable_cleartext="yes"
1565 fi
1566 # end --enable-cleartext
1567 # OpenLDAP --enable-crypt
1568         # Check whether --enable-crypt or --disable-crypt was given.
1569 if test "${enable_crypt+set}" = set; then
1570   enableval="$enable_crypt"
1571   
1572         ol_arg=invalid
1573         for ol_val in auto yes no ; do
1574                 if test "$enableval" = "$ol_val" ; then
1575                         ol_arg="$ol_val"
1576                 fi
1577         done
1578         if test "$ol_arg" = "invalid" ; then
1579                 { echo "configure: error: bad value $enableval for --enable-crypt" 1>&2; exit 1; }
1580         fi
1581         ol_enable_crypt="$ol_arg"
1582
1583 else
1584         ol_enable_crypt="auto"
1585 fi
1586 # end --enable-crypt
1587 # OpenLDAP --enable-kpasswd
1588         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1589 if test "${enable_kpasswd+set}" = set; then
1590   enableval="$enable_kpasswd"
1591   
1592         ol_arg=invalid
1593         for ol_val in auto yes no ; do
1594                 if test "$enableval" = "$ol_val" ; then
1595                         ol_arg="$ol_val"
1596                 fi
1597         done
1598         if test "$ol_arg" = "invalid" ; then
1599                 { echo "configure: error: bad value $enableval for --enable-kpasswd" 1>&2; exit 1; }
1600         fi
1601         ol_enable_kpasswd="$ol_arg"
1602
1603 else
1604         ol_enable_kpasswd="no"
1605 fi
1606 # end --enable-kpasswd
1607 # OpenLDAP --enable-spasswd
1608         # Check whether --enable-spasswd or --disable-spasswd was given.
1609 if test "${enable_spasswd+set}" = set; then
1610   enableval="$enable_spasswd"
1611   
1612         ol_arg=invalid
1613         for ol_val in auto yes no ; do
1614                 if test "$enableval" = "$ol_val" ; then
1615                         ol_arg="$ol_val"
1616                 fi
1617         done
1618         if test "$ol_arg" = "invalid" ; then
1619                 { echo "configure: error: bad value $enableval for --enable-spasswd" 1>&2; exit 1; }
1620         fi
1621         ol_enable_spasswd="$ol_arg"
1622
1623 else
1624         ol_enable_spasswd="no"
1625 fi
1626 # end --enable-spasswd
1627 # OpenLDAP --enable-modules
1628         # Check whether --enable-modules or --disable-modules was given.
1629 if test "${enable_modules+set}" = set; then
1630   enableval="$enable_modules"
1631   
1632         ol_arg=invalid
1633         for ol_val in auto yes no ; do
1634                 if test "$enableval" = "$ol_val" ; then
1635                         ol_arg="$ol_val"
1636                 fi
1637         done
1638         if test "$ol_arg" = "invalid" ; then
1639                 { echo "configure: error: bad value $enableval for --enable-modules" 1>&2; exit 1; }
1640         fi
1641         ol_enable_modules="$ol_arg"
1642
1643 else
1644         ol_enable_modules="no"
1645 fi
1646 # end --enable-modules
1647 # OpenLDAP --enable-multimaster
1648         # Check whether --enable-multimaster or --disable-multimaster was given.
1649 if test "${enable_multimaster+set}" = set; then
1650   enableval="$enable_multimaster"
1651   
1652         ol_arg=invalid
1653         for ol_val in auto yes no ; do
1654                 if test "$enableval" = "$ol_val" ; then
1655                         ol_arg="$ol_val"
1656                 fi
1657         done
1658         if test "$ol_arg" = "invalid" ; then
1659                 { echo "configure: error: bad value $enableval for --enable-multimaster" 1>&2; exit 1; }
1660         fi
1661         ol_enable_multimaster="$ol_arg"
1662
1663 else
1664         ol_enable_multimaster="no"
1665 fi
1666 # end --enable-multimaster
1667 # OpenLDAP --enable-phonetic
1668         # Check whether --enable-phonetic or --disable-phonetic was given.
1669 if test "${enable_phonetic+set}" = set; then
1670   enableval="$enable_phonetic"
1671   
1672         ol_arg=invalid
1673         for ol_val in auto yes no ; do
1674                 if test "$enableval" = "$ol_val" ; then
1675                         ol_arg="$ol_val"
1676                 fi
1677         done
1678         if test "$ol_arg" = "invalid" ; then
1679                 { echo "configure: error: bad value $enableval for --enable-phonetic" 1>&2; exit 1; }
1680         fi
1681         ol_enable_phonetic="$ol_arg"
1682
1683 else
1684         ol_enable_phonetic="no"
1685 fi
1686 # end --enable-phonetic
1687 # OpenLDAP --enable-quipu
1688         # Check whether --enable-quipu or --disable-quipu was given.
1689 if test "${enable_quipu+set}" = set; then
1690   enableval="$enable_quipu"
1691   
1692         ol_arg=invalid
1693         for ol_val in auto yes no ; do
1694                 if test "$enableval" = "$ol_val" ; then
1695                         ol_arg="$ol_val"
1696                 fi
1697         done
1698         if test "$ol_arg" = "invalid" ; then
1699                 { echo "configure: error: bad value $enableval for --enable-quipu" 1>&2; exit 1; }
1700         fi
1701         ol_enable_quipu="$ol_arg"
1702
1703 else
1704         ol_enable_quipu="no"
1705 fi
1706 # end --enable-quipu
1707 # OpenLDAP --enable-rlookups
1708         # Check whether --enable-rlookups or --disable-rlookups was given.
1709 if test "${enable_rlookups+set}" = set; then
1710   enableval="$enable_rlookups"
1711   
1712         ol_arg=invalid
1713         for ol_val in auto yes no ; do
1714                 if test "$enableval" = "$ol_val" ; then
1715                         ol_arg="$ol_val"
1716                 fi
1717         done
1718         if test "$ol_arg" = "invalid" ; then
1719                 { echo "configure: error: bad value $enableval for --enable-rlookups" 1>&2; exit 1; }
1720         fi
1721         ol_enable_rlookups="$ol_arg"
1722
1723 else
1724         ol_enable_rlookups="auto"
1725 fi
1726 # end --enable-rlookups
1727 # OpenLDAP --enable-aci
1728         # Check whether --enable-aci or --disable-aci was given.
1729 if test "${enable_aci+set}" = set; then
1730   enableval="$enable_aci"
1731   
1732         ol_arg=invalid
1733         for ol_val in auto yes no ; do
1734                 if test "$enableval" = "$ol_val" ; then
1735                         ol_arg="$ol_val"
1736                 fi
1737         done
1738         if test "$ol_arg" = "invalid" ; then
1739                 { echo "configure: error: bad value $enableval for --enable-aci" 1>&2; exit 1; }
1740         fi
1741         ol_enable_aci="$ol_arg"
1742
1743 else
1744         ol_enable_aci="no"
1745 fi
1746 # end --enable-aci
1747 # OpenLDAP --enable-wrappers
1748         # Check whether --enable-wrappers or --disable-wrappers was given.
1749 if test "${enable_wrappers+set}" = set; then
1750   enableval="$enable_wrappers"
1751   
1752         ol_arg=invalid
1753         for ol_val in auto yes no ; do
1754                 if test "$enableval" = "$ol_val" ; then
1755                         ol_arg="$ol_val"
1756                 fi
1757         done
1758         if test "$ol_arg" = "invalid" ; then
1759                 { echo "configure: error: bad value $enableval for --enable-wrappers" 1>&2; exit 1; }
1760         fi
1761         ol_enable_wrappers="$ol_arg"
1762
1763 else
1764         ol_enable_wrappers="no"
1765 fi
1766 # end --enable-wrappers
1767 # OpenLDAP --enable-dynamic
1768         # Check whether --enable-dynamic or --disable-dynamic was given.
1769 if test "${enable_dynamic+set}" = set; then
1770   enableval="$enable_dynamic"
1771   
1772         ol_arg=invalid
1773         for ol_val in auto yes no ; do
1774                 if test "$enableval" = "$ol_val" ; then
1775                         ol_arg="$ol_val"
1776                 fi
1777         done
1778         if test "$ol_arg" = "invalid" ; then
1779                 { echo "configure: error: bad value $enableval for --enable-dynamic" 1>&2; exit 1; }
1780         fi
1781         ol_enable_dynamic="$ol_arg"
1782
1783 else
1784         ol_enable_dynamic="no"
1785 fi
1786 # end --enable-dynamic
1787
1788 # OpenLDAP --enable-dnssrv
1789         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1790 if test "${enable_dnssrv+set}" = set; then
1791   enableval="$enable_dnssrv"
1792   
1793         ol_arg=invalid
1794         for ol_val in auto yes no ; do
1795                 if test "$enableval" = "$ol_val" ; then
1796                         ol_arg="$ol_val"
1797                 fi
1798         done
1799         if test "$ol_arg" = "invalid" ; then
1800                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1801         fi
1802         ol_enable_dnssrv="$ol_arg"
1803
1804 else
1805         ol_enable_dnssrv="no"
1806 fi
1807 # end --enable-dnssrv
1808 # OpenLDAP --with-dnssrv_module
1809         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1810 if test "${with_dnssrv_module+set}" = set; then
1811   withval="$with_dnssrv_module"
1812   
1813         ol_arg=invalid
1814         for ol_val in static dynamic ; do
1815                 if test "$withval" = "$ol_val" ; then
1816                         ol_arg="$ol_val"
1817                 fi
1818         done
1819         if test "$ol_arg" = "invalid" ; then
1820                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1821         fi
1822         ol_with_dnssrv_module="$ol_arg"
1823
1824 else
1825         ol_with_dnssrv_module="static"
1826 fi
1827 # end --with-dnssrv_module
1828
1829 # OpenLDAP --enable-ldap
1830         # Check whether --enable-ldap or --disable-ldap was given.
1831 if test "${enable_ldap+set}" = set; then
1832   enableval="$enable_ldap"
1833   
1834         ol_arg=invalid
1835         for ol_val in auto yes no ; do
1836                 if test "$enableval" = "$ol_val" ; then
1837                         ol_arg="$ol_val"
1838                 fi
1839         done
1840         if test "$ol_arg" = "invalid" ; then
1841                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1842         fi
1843         ol_enable_ldap="$ol_arg"
1844
1845 else
1846         ol_enable_ldap="no"
1847 fi
1848 # end --enable-ldap
1849 # OpenLDAP --with-ldap_module
1850         # Check whether --with-ldap_module or --without-ldap_module was given.
1851 if test "${with_ldap_module+set}" = set; then
1852   withval="$with_ldap_module"
1853   
1854         ol_arg=invalid
1855         for ol_val in static dynamic ; do
1856                 if test "$withval" = "$ol_val" ; then
1857                         ol_arg="$ol_val"
1858                 fi
1859         done
1860         if test "$ol_arg" = "invalid" ; then
1861                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1862         fi
1863         ol_with_ldap_module="$ol_arg"
1864
1865 else
1866         ol_with_ldap_module="static"
1867 fi
1868 # end --with-ldap_module
1869
1870 # OpenLDAP --enable-ldbm
1871         # Check whether --enable-ldbm or --disable-ldbm was given.
1872 if test "${enable_ldbm+set}" = set; then
1873   enableval="$enable_ldbm"
1874   
1875         ol_arg=invalid
1876         for ol_val in auto yes no ; do
1877                 if test "$enableval" = "$ol_val" ; then
1878                         ol_arg="$ol_val"
1879                 fi
1880         done
1881         if test "$ol_arg" = "invalid" ; then
1882                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1883         fi
1884         ol_enable_ldbm="$ol_arg"
1885
1886 else
1887         ol_enable_ldbm="yes"
1888 fi
1889 # end --enable-ldbm
1890 # OpenLDAP --with-ldbm_api
1891         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1892 if test "${with_ldbm_api+set}" = set; then
1893   withval="$with_ldbm_api"
1894   
1895         ol_arg=invalid
1896         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1897                 if test "$withval" = "$ol_val" ; then
1898                         ol_arg="$ol_val"
1899                 fi
1900         done
1901         if test "$ol_arg" = "invalid" ; then
1902                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1903         fi
1904         ol_with_ldbm_api="$ol_arg"
1905
1906 else
1907         ol_with_ldbm_api="auto"
1908 fi
1909 # end --with-ldbm_api
1910
1911 # OpenLDAP --with-ldbm_module
1912         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1913 if test "${with_ldbm_module+set}" = set; then
1914   withval="$with_ldbm_module"
1915   
1916         ol_arg=invalid
1917         for ol_val in static dynamic ; do
1918                 if test "$withval" = "$ol_val" ; then
1919                         ol_arg="$ol_val"
1920                 fi
1921         done
1922         if test "$ol_arg" = "invalid" ; then
1923                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1924         fi
1925         ol_with_ldbm_module="$ol_arg"
1926
1927 else
1928         ol_with_ldbm_module="static"
1929 fi
1930 # end --with-ldbm_module
1931
1932 # OpenLDAP --with-ldbm_type
1933         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1934 if test "${with_ldbm_type+set}" = set; then
1935   withval="$with_ldbm_type"
1936   
1937         ol_arg=invalid
1938         for ol_val in auto btree hash ; do
1939                 if test "$withval" = "$ol_val" ; then
1940                         ol_arg="$ol_val"
1941                 fi
1942         done
1943         if test "$ol_arg" = "invalid" ; then
1944                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1945         fi
1946         ol_with_ldbm_type="$ol_arg"
1947
1948 else
1949         ol_with_ldbm_type="auto"
1950 fi
1951 # end --with-ldbm_type
1952
1953 # OpenLDAP --enable-passwd
1954         # Check whether --enable-passwd or --disable-passwd was given.
1955 if test "${enable_passwd+set}" = set; then
1956   enableval="$enable_passwd"
1957   
1958         ol_arg=invalid
1959         for ol_val in auto yes no ; do
1960                 if test "$enableval" = "$ol_val" ; then
1961                         ol_arg="$ol_val"
1962                 fi
1963         done
1964         if test "$ol_arg" = "invalid" ; then
1965                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1966         fi
1967         ol_enable_passwd="$ol_arg"
1968
1969 else
1970         ol_enable_passwd="no"
1971 fi
1972 # end --enable-passwd
1973 # OpenLDAP --with-passwd_module
1974         # Check whether --with-passwd_module or --without-passwd_module was given.
1975 if test "${with_passwd_module+set}" = set; then
1976   withval="$with_passwd_module"
1977   
1978         ol_arg=invalid
1979         for ol_val in static dynamic ; do
1980                 if test "$withval" = "$ol_val" ; then
1981                         ol_arg="$ol_val"
1982                 fi
1983         done
1984         if test "$ol_arg" = "invalid" ; then
1985                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1986         fi
1987         ol_with_passwd_module="$ol_arg"
1988
1989 else
1990         ol_with_passwd_module="static"
1991 fi
1992 # end --with-passwd_module
1993
1994 # OpenLDAP --enable-shell
1995         # Check whether --enable-shell or --disable-shell was given.
1996 if test "${enable_shell+set}" = set; then
1997   enableval="$enable_shell"
1998   
1999         ol_arg=invalid
2000         for ol_val in auto yes no ; do
2001                 if test "$enableval" = "$ol_val" ; then
2002                         ol_arg="$ol_val"
2003                 fi
2004         done
2005         if test "$ol_arg" = "invalid" ; then
2006                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
2007         fi
2008         ol_enable_shell="$ol_arg"
2009
2010 else
2011         ol_enable_shell="no"
2012 fi
2013 # end --enable-shell
2014 # OpenLDAP --with-shell_module
2015         # Check whether --with-shell_module or --without-shell_module was given.
2016 if test "${with_shell_module+set}" = set; then
2017   withval="$with_shell_module"
2018   
2019         ol_arg=invalid
2020         for ol_val in static dynamic ; do
2021                 if test "$withval" = "$ol_val" ; then
2022                         ol_arg="$ol_val"
2023                 fi
2024         done
2025         if test "$ol_arg" = "invalid" ; then
2026                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
2027         fi
2028         ol_with_shell_module="$ol_arg"
2029
2030 else
2031         ol_with_shell_module="static"
2032 fi
2033 # end --with-shell_module
2034
2035
2036 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2037 if test "${with_xxslurpdoptions+set}" = set; then
2038   withval="$with_xxslurpdoptions"
2039   :
2040 fi
2041
2042 # OpenLDAP --enable-slurpd
2043         # Check whether --enable-slurpd or --disable-slurpd was given.
2044 if test "${enable_slurpd+set}" = set; then
2045   enableval="$enable_slurpd"
2046   
2047         ol_arg=invalid
2048         for ol_val in auto yes no ; do
2049                 if test "$enableval" = "$ol_val" ; then
2050                         ol_arg="$ol_val"
2051                 fi
2052         done
2053         if test "$ol_arg" = "invalid" ; then
2054                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2055         fi
2056         ol_enable_slurpd="$ol_arg"
2057
2058 else
2059         ol_enable_slurpd="auto"
2060 fi
2061 # end --enable-slurpd
2062
2063 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2064 if test "${with_xxliboptions+set}" = set; then
2065   withval="$with_xxliboptions"
2066   :
2067 fi
2068
2069 # Check whether --enable-static or --disable-static was given.
2070 if test "${enable_static+set}" = set; then
2071   enableval="$enable_static"
2072   p=${PACKAGE-default}
2073 case "$enableval" in
2074 yes) enable_static=yes ;;
2075 no) enable_static=no ;;
2076 *)
2077   enable_static=no
2078   # Look at the argument we got.  We use all the common list separators.
2079   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2080   for pkg in $enableval; do
2081     if test "X$pkg" = "X$p"; then
2082       enable_static=yes
2083     fi
2084   done
2085   IFS="$ac_save_ifs"
2086   ;;
2087 esac
2088 else
2089   enable_static=yes
2090 fi
2091
2092 # Check whether --enable-shared or --disable-shared was given.
2093 if test "${enable_shared+set}" = set; then
2094   enableval="$enable_shared"
2095   p=${PACKAGE-default}
2096 case "$enableval" in
2097 yes) enable_shared=yes ;;
2098 no) enable_shared=no ;;
2099 *)
2100   enable_shared=no
2101   # Look at the argument we got.  We use all the common list separators.
2102   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2103   for pkg in $enableval; do
2104     if test "X$pkg" = "X$p"; then
2105       enable_shared=yes
2106     fi
2107   done
2108   IFS="$ac_save_ifs"
2109   ;;
2110 esac
2111 else
2112   enable_shared=yes
2113 fi
2114
2115
2116
2117 # validate options
2118 if test $ol_enable_slapd = no ; then
2119                 if test $ol_enable_dnssrv = yes ; then
2120                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2121         fi
2122         if test $ol_enable_ldap = yes ; then
2123                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2124         fi
2125         if test $ol_enable_ldbm = yes ; then
2126                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2127         fi
2128         if test $ol_enable_passwd = yes ; then
2129                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2130         fi
2131         if test $ol_enable_shell = yes ; then
2132                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2133         fi
2134         if test $ol_enable_modules = yes ; then
2135                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2136         fi
2137         if test $ol_enable_multimaster = yes ; then
2138                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2139         fi
2140         if test $ol_enable_wrappers = yes ; then
2141                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2142         fi
2143         if test $ol_enable_phonetic = yes ; then
2144                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2145         fi
2146         if test $ol_enable_quipu = yes ; then
2147                 echo "configure: warning: slapd disabled, ignoring --enable-quipu argument" 1>&2
2148         fi
2149         if test $ol_enable_rlookups = yes ; then
2150                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2151         fi
2152         if test $ol_enable_aci = yes ; then
2153                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2154         fi
2155         if test $ol_with_ldbm_api != auto ; then
2156                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2157         fi
2158         if test $ol_with_ldbm_type != auto ; then
2159                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2160         fi
2161         if test $ol_with_dnssrv_module != static ; then
2162                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2163         fi
2164         if test $ol_with_ldap_module != static ; then
2165                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2166         fi
2167         if test $ol_with_ldbm_module != static ; then
2168                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2169         fi
2170         if test $ol_with_passwd_module != static ; then
2171                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2172         fi
2173         if test $ol_with_shell_module != static ; then
2174                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2175         fi
2176         if test $ol_enable_slurpd = yes ; then
2177                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2178         fi
2179
2180         # force settings to no
2181         ol_enable_dnssrv=no
2182         ol_enable_ldap=no
2183         ol_enable_ldbm=no
2184         ol_enable_passwd=no
2185         ol_enable_shell=no
2186
2187         ol_enable_modules=no
2188         ol_enable_multimaster=no
2189         ol_enable_phonetic=no
2190         ol_enable_quipu=no
2191         ol_enable_rlookups=no
2192         ol_enable_aci=no
2193         ol_enable_wrappers=no
2194         ol_enable_dynamic=no
2195
2196         ol_with_ldbm_api=no
2197         ol_with_ldbm_type=no
2198
2199         ol_with_dnssrv_module=static
2200         ol_with_ldap_module=static
2201         ol_with_ldbm_module=static
2202         ol_with_passwd_module=static
2203         ol_with_shell_module=static
2204
2205         ol_enable_slurpd=no
2206
2207 elif test $ol_enable_ldbm = no ; then
2208         
2209         if test $ol_with_ldbm_api != auto ; then
2210                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2211         fi
2212
2213         if test $ol_with_ldbm_type != auto ; then
2214                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2215         fi
2216
2217         if test $ol_with_ldbm_module != static ; then
2218                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2219         fi
2220
2221         if test $ol_enable_modules != yes -a \
2222                 $ol_enable_dnssrv = no -a \
2223                 $ol_enable_ldap = no -a \
2224                 $ol_enable_passwd = no -a \
2225                 $ol_enable_shell = no ; then
2226                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2227         fi
2228
2229         ol_with_ldbm_api=no
2230         ol_with_ldbm_type=no
2231         ol_with_ldbm_module=static
2232
2233 else
2234                 if test $ol_with_ldbm_api = gdbm -a \
2235                 $ol_with_ldbm_type = btree ; then
2236                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2237         fi
2238         if test $ol_with_ldbm_api = mdbm -a \
2239                 $ol_with_ldbm_type = btree ; then
2240                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2241         fi
2242         if test $ol_with_ldbm_api = ndbm -a \
2243                 $ol_with_ldbm_type = btree ; then
2244                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2245         fi
2246 fi
2247
2248 if test $ol_enable_slurpd = yes ; then
2249                 if test $ol_with_threads = no ; then
2250                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2251         fi
2252 fi
2253
2254 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2255         if test $ol_with_kerberos = no ; then
2256                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2257         fi
2258 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2259         if test $ol_with_kerberos != auto ; then
2260                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2261         else
2262                 ol_with_kerberos=no
2263         fi
2264 fi
2265
2266 if test $ol_enable_spasswd = yes ; then
2267         if test $ol_with_cyrus_sasl = no ; then
2268                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2269         fi
2270         ol_link_spasswd=yes
2271 fi
2272
2273 echo "$ac_t""done" 1>&6
2274
2275 LDAP_LIBS=
2276 LDIF_LIBS=
2277 LDBM_LIBS=
2278 LTHREAD_LIBS=
2279 LUTIL_LIBS=
2280
2281 QUIPU_LIBS=
2282 SLAPD_LIBS=
2283 SLURPD_LIBS=
2284
2285 BUILD_SLAPD=no
2286 BUILD_SLURPD=no
2287
2288 BUILD_QUIPU=no
2289 BUILD_THREAD=no
2290
2291 BUILD_DNSSRV=no
2292 BUILD_LDAP=no
2293 BUILD_LDBM=no
2294 BUILD_PASSWD=no
2295 BUILD_SHELL=no
2296
2297 BUILD_DNSSRV_DYNAMIC=static
2298 BUILD_LDAP_DYNAMIC=static
2299 BUILD_LDBM_DYNAMIC=static
2300 BUILD_PASSWD_DYNAMIC=static
2301 BUILD_SHELL_DYNAMIC=static
2302
2303 SLAPD_MODULES_LDFLAGS=
2304 SLAPD_MODULES_CPPFLAGS=
2305 SLAPD_MODULES_LIST=
2306
2307 KRB4_LIBS=
2308 KRB5_LIBS=
2309 READLINE_LIBS=
2310 SASL_LIBS=
2311 TERMCAP_LIBS=
2312 TLS_LIBS=
2313 MODULES_LIBS=
2314 AUTH_LIBS=
2315
2316
2317
2318 cat >> confdefs.h <<\EOF
2319 #define HAVE_MKVERSION 1
2320 EOF
2321
2322
2323
2324
2325 ol_aix_threads=no
2326 case "$target" in
2327 *-*-aix*)       if test -z "$CC" ; then
2328                 case "$ol_with_threads" in
2329                 auto | yes |  posix) ol_aix_threads=yes ;;
2330                 esac
2331         fi
2332 ;;
2333 esac
2334
2335 if test $ol_aix_threads = yes ; then
2336         if test -z "${CC}" ; then
2337                 for ac_prog in cc_r xlc_r cc
2338 do
2339 # Extract the first word of "$ac_prog", so it can be a program name with args.
2340 set dummy $ac_prog; ac_word=$2
2341 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2342 echo "configure:2343: checking for $ac_word" >&5
2343 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2344   echo $ac_n "(cached) $ac_c" 1>&6
2345 else
2346   if test -n "$CC"; then
2347   ac_cv_prog_CC="$CC" # Let the user override the test.
2348 else
2349   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2350   ac_dummy="$PATH"
2351   for ac_dir in $ac_dummy; do
2352     test -z "$ac_dir" && ac_dir=.
2353     if test -f $ac_dir/$ac_word; then
2354       ac_cv_prog_CC="$ac_prog"
2355       break
2356     fi
2357   done
2358   IFS="$ac_save_ifs"
2359 fi
2360 fi
2361 CC="$ac_cv_prog_CC"
2362 if test -n "$CC"; then
2363   echo "$ac_t""$CC" 1>&6
2364 else
2365   echo "$ac_t""no" 1>&6
2366 fi
2367
2368 test -n "$CC" && break
2369 done
2370
2371
2372                 if test "$CC" = cc ; then
2373                                                 if test $ol_with_threads != auto ; then
2374                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2375                         else
2376                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2377                         fi
2378                         ol_with_threads=no
2379                 fi
2380         fi
2381
2382         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2383                 ol_with_threads=posix
2384                 ol_cv_pthread_create=yes
2385         fi
2386 fi
2387
2388 if test -z "${CC}"; then
2389         for ac_prog in cc
2390 do
2391 # Extract the first word of "$ac_prog", so it can be a program name with args.
2392 set dummy $ac_prog; ac_word=$2
2393 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2394 echo "configure:2395: checking for $ac_word" >&5
2395 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2396   echo $ac_n "(cached) $ac_c" 1>&6
2397 else
2398   if test -n "$CC"; then
2399   ac_cv_prog_CC="$CC" # Let the user override the test.
2400 else
2401   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2402   ac_dummy="$PATH"
2403   for ac_dir in $ac_dummy; do
2404     test -z "$ac_dir" && ac_dir=.
2405     if test -f $ac_dir/$ac_word; then
2406       ac_cv_prog_CC="$ac_prog"
2407       break
2408     fi
2409   done
2410   IFS="$ac_save_ifs"
2411 fi
2412 fi
2413 CC="$ac_cv_prog_CC"
2414 if test -n "$CC"; then
2415   echo "$ac_t""$CC" 1>&6
2416 else
2417   echo "$ac_t""no" 1>&6
2418 fi
2419
2420 test -n "$CC" && break
2421 done
2422
2423 fi
2424
2425
2426
2427
2428 # Check whether --enable-fast-install or --disable-fast-install was given.
2429 if test "${enable_fast_install+set}" = set; then
2430   enableval="$enable_fast_install"
2431   p=${PACKAGE-default}
2432 case "$enableval" in
2433 yes) enable_fast_install=yes ;;
2434 no) enable_fast_install=no ;;
2435 *)
2436   enable_fast_install=no
2437   # Look at the argument we got.  We use all the common list separators.
2438   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2439   for pkg in $enableval; do
2440     if test "X$pkg" = "X$p"; then
2441       enable_fast_install=yes
2442     fi
2443   done
2444   IFS="$ac_save_ifs"
2445   ;;
2446 esac
2447 else
2448   enable_fast_install=yes
2449 fi
2450
2451 # Extract the first word of "ranlib", so it can be a program name with args.
2452 set dummy ranlib; ac_word=$2
2453 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2454 echo "configure:2455: checking for $ac_word" >&5
2455 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2456   echo $ac_n "(cached) $ac_c" 1>&6
2457 else
2458   if test -n "$RANLIB"; then
2459   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2460 else
2461   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2462   ac_dummy="$PATH"
2463   for ac_dir in $ac_dummy; do
2464     test -z "$ac_dir" && ac_dir=.
2465     if test -f $ac_dir/$ac_word; then
2466       ac_cv_prog_RANLIB="ranlib"
2467       break
2468     fi
2469   done
2470   IFS="$ac_save_ifs"
2471   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2472 fi
2473 fi
2474 RANLIB="$ac_cv_prog_RANLIB"
2475 if test -n "$RANLIB"; then
2476   echo "$ac_t""$RANLIB" 1>&6
2477 else
2478   echo "$ac_t""no" 1>&6
2479 fi
2480
2481 # Extract the first word of "gcc", so it can be a program name with args.
2482 set dummy gcc; ac_word=$2
2483 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2484 echo "configure:2485: checking for $ac_word" >&5
2485 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2486   echo $ac_n "(cached) $ac_c" 1>&6
2487 else
2488   if test -n "$CC"; then
2489   ac_cv_prog_CC="$CC" # Let the user override the test.
2490 else
2491   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2492   ac_dummy="$PATH"
2493   for ac_dir in $ac_dummy; do
2494     test -z "$ac_dir" && ac_dir=.
2495     if test -f $ac_dir/$ac_word; then
2496       ac_cv_prog_CC="gcc"
2497       break
2498     fi
2499   done
2500   IFS="$ac_save_ifs"
2501 fi
2502 fi
2503 CC="$ac_cv_prog_CC"
2504 if test -n "$CC"; then
2505   echo "$ac_t""$CC" 1>&6
2506 else
2507   echo "$ac_t""no" 1>&6
2508 fi
2509
2510 if test -z "$CC"; then
2511   # Extract the first word of "cc", so it can be a program name with args.
2512 set dummy cc; ac_word=$2
2513 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2514 echo "configure:2515: checking for $ac_word" >&5
2515 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2516   echo $ac_n "(cached) $ac_c" 1>&6
2517 else
2518   if test -n "$CC"; then
2519   ac_cv_prog_CC="$CC" # Let the user override the test.
2520 else
2521   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2522   ac_prog_rejected=no
2523   ac_dummy="$PATH"
2524   for ac_dir in $ac_dummy; do
2525     test -z "$ac_dir" && ac_dir=.
2526     if test -f $ac_dir/$ac_word; then
2527       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2528         ac_prog_rejected=yes
2529         continue
2530       fi
2531       ac_cv_prog_CC="cc"
2532       break
2533     fi
2534   done
2535   IFS="$ac_save_ifs"
2536 if test $ac_prog_rejected = yes; then
2537   # We found a bogon in the path, so make sure we never use it.
2538   set dummy $ac_cv_prog_CC
2539   shift
2540   if test $# -gt 0; then
2541     # We chose a different compiler from the bogus one.
2542     # However, it has the same basename, so the bogon will be chosen
2543     # first if we set CC to just the basename; use the full file name.
2544     shift
2545     set dummy "$ac_dir/$ac_word" "$@"
2546     shift
2547     ac_cv_prog_CC="$@"
2548   fi
2549 fi
2550 fi
2551 fi
2552 CC="$ac_cv_prog_CC"
2553 if test -n "$CC"; then
2554   echo "$ac_t""$CC" 1>&6
2555 else
2556   echo "$ac_t""no" 1>&6
2557 fi
2558
2559   if test -z "$CC"; then
2560     case "`uname -s`" in
2561     *win32* | *WIN32* | *CYGWIN*)
2562       # Extract the first word of "cl", so it can be a program name with args.
2563 set dummy cl; ac_word=$2
2564 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2565 echo "configure:2566: checking for $ac_word" >&5
2566 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2567   echo $ac_n "(cached) $ac_c" 1>&6
2568 else
2569   if test -n "$CC"; then
2570   ac_cv_prog_CC="$CC" # Let the user override the test.
2571 else
2572   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2573   ac_dummy="$PATH"
2574   for ac_dir in $ac_dummy; do
2575     test -z "$ac_dir" && ac_dir=.
2576     if test -f $ac_dir/$ac_word; then
2577       ac_cv_prog_CC="cl"
2578       break
2579     fi
2580   done
2581   IFS="$ac_save_ifs"
2582 fi
2583 fi
2584 CC="$ac_cv_prog_CC"
2585 if test -n "$CC"; then
2586   echo "$ac_t""$CC" 1>&6
2587 else
2588   echo "$ac_t""no" 1>&6
2589 fi
2590  ;;
2591     esac
2592   fi
2593   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2594 fi
2595
2596 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2597 echo "configure:2598: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2598
2599 ac_ext=c
2600 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2601 ac_cpp='$CPP $CPPFLAGS'
2602 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2603 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2604 cross_compiling=$ac_cv_prog_cc_cross
2605
2606 cat > conftest.$ac_ext << EOF
2607
2608 #line 2609 "configure"
2609 #include "confdefs.h"
2610
2611 main(){return(0);}
2612 EOF
2613 if { (eval echo configure:2614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2614   ac_cv_prog_cc_works=yes
2615   # If we can't run a trivial program, we are probably using a cross compiler.
2616   if (./conftest; exit) 2>/dev/null; then
2617     ac_cv_prog_cc_cross=no
2618   else
2619     ac_cv_prog_cc_cross=yes
2620   fi
2621 else
2622   echo "configure: failed program was:" >&5
2623   cat conftest.$ac_ext >&5
2624   ac_cv_prog_cc_works=no
2625 fi
2626 rm -fr conftest*
2627 ac_ext=c
2628 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2629 ac_cpp='$CPP $CPPFLAGS'
2630 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2631 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2632 cross_compiling=$ac_cv_prog_cc_cross
2633
2634 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2635 if test $ac_cv_prog_cc_works = no; then
2636   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2637 fi
2638 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2639 echo "configure:2640: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2640 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2641 cross_compiling=$ac_cv_prog_cc_cross
2642
2643 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2644 echo "configure:2645: checking whether we are using GNU C" >&5
2645 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2646   echo $ac_n "(cached) $ac_c" 1>&6
2647 else
2648   cat > conftest.c <<EOF
2649 #ifdef __GNUC__
2650   yes;
2651 #endif
2652 EOF
2653 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2654: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2654   ac_cv_prog_gcc=yes
2655 else
2656   ac_cv_prog_gcc=no
2657 fi
2658 fi
2659
2660 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2661
2662 if test $ac_cv_prog_gcc = yes; then
2663   GCC=yes
2664 else
2665   GCC=
2666 fi
2667
2668 ac_test_CFLAGS="${CFLAGS+set}"
2669 ac_save_CFLAGS="$CFLAGS"
2670 CFLAGS=
2671 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2672 echo "configure:2673: checking whether ${CC-cc} accepts -g" >&5
2673 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2674   echo $ac_n "(cached) $ac_c" 1>&6
2675 else
2676   echo 'void f(){}' > conftest.c
2677 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2678   ac_cv_prog_cc_g=yes
2679 else
2680   ac_cv_prog_cc_g=no
2681 fi
2682 rm -f conftest*
2683
2684 fi
2685
2686 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2687 if test "$ac_test_CFLAGS" = set; then
2688   CFLAGS="$ac_save_CFLAGS"
2689 elif test $ac_cv_prog_cc_g = yes; then
2690   if test "$GCC" = yes; then
2691     CFLAGS="-g -O2"
2692   else
2693     CFLAGS="-g"
2694   fi
2695 else
2696   if test "$GCC" = yes; then
2697     CFLAGS="-O2"
2698   else
2699     CFLAGS=
2700   fi
2701 fi
2702
2703 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2704 if test "${with_gnu_ld+set}" = set; then
2705   withval="$with_gnu_ld"
2706   test "$withval" = no || with_gnu_ld=yes
2707 else
2708   with_gnu_ld=no
2709 fi
2710
2711 ac_prog=ld
2712 if test "$ac_cv_prog_gcc" = yes; then
2713   # Check if gcc -print-prog-name=ld gives a path.
2714   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2715 echo "configure:2716: checking for ld used by GCC" >&5
2716   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2717   case "$ac_prog" in
2718     # Accept absolute paths.
2719     [\\/]* | [A-Za-z]:[\\/]*)
2720       re_direlt='/[^/][^/]*/\.\./'
2721       # Canonicalize the path of ld
2722       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2723       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2724         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2725       done
2726       test -z "$LD" && LD="$ac_prog"
2727       ;;
2728   "")
2729     # If it fails, then pretend we aren't using GCC.
2730     ac_prog=ld
2731     ;;
2732   *)
2733     # If it is relative, then search for the first ld in PATH.
2734     with_gnu_ld=unknown
2735     ;;
2736   esac
2737 elif test "$with_gnu_ld" = yes; then
2738   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2739 echo "configure:2740: checking for GNU ld" >&5
2740 else
2741   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2742 echo "configure:2743: checking for non-GNU ld" >&5
2743 fi
2744 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2745   echo $ac_n "(cached) $ac_c" 1>&6
2746 else
2747   if test -z "$LD"; then
2748   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2749   for ac_dir in $PATH; do
2750     test -z "$ac_dir" && ac_dir=.
2751     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2752       ac_cv_path_LD="$ac_dir/$ac_prog"
2753       # Check to see if the program is GNU ld.  I'd rather use --version,
2754       # but apparently some GNU ld's only accept -v.
2755       # Break only if it was the GNU/non-GNU ld that we prefer.
2756       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2757         test "$with_gnu_ld" != no && break
2758       else
2759         test "$with_gnu_ld" != yes && break
2760       fi
2761     fi
2762   done
2763   IFS="$ac_save_ifs"
2764 else
2765   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2766 fi
2767 fi
2768
2769 LD="$ac_cv_path_LD"
2770 if test -n "$LD"; then
2771   echo "$ac_t""$LD" 1>&6
2772 else
2773   echo "$ac_t""no" 1>&6
2774 fi
2775 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2776 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2777 echo "configure:2778: checking if the linker ($LD) is GNU ld" >&5
2778 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2779   echo $ac_n "(cached) $ac_c" 1>&6
2780 else
2781   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2782 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2783   ac_cv_prog_gnu_ld=yes
2784 else
2785   ac_cv_prog_gnu_ld=no
2786 fi
2787 fi
2788
2789 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2790
2791
2792 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2793 echo "configure:2794: checking for BSD-compatible nm" >&5
2794 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2795   echo $ac_n "(cached) $ac_c" 1>&6
2796 else
2797   if test -n "$NM"; then
2798   # Let the user override the test.
2799   ac_cv_path_NM="$NM"
2800 else
2801   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2802   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2803     test -z "$ac_dir" && ac_dir=.
2804     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2805       # Check to see if the nm accepts a BSD-compat flag.
2806       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2807       #   nm: unknown option "B" ignored
2808       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2809         ac_cv_path_NM="$ac_dir/nm -B"
2810         break
2811       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2812         ac_cv_path_NM="$ac_dir/nm -p"
2813         break
2814       else
2815         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2816         continue # so that we can try to find one that supports BSD flags
2817       fi
2818     fi
2819   done
2820   IFS="$ac_save_ifs"
2821   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2822 fi
2823 fi
2824
2825 NM="$ac_cv_path_NM"
2826 echo "$ac_t""$NM" 1>&6
2827
2828 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2829 echo "configure:2830: checking whether ln -s works" >&5
2830 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2831   echo $ac_n "(cached) $ac_c" 1>&6
2832 else
2833   rm -f conftestdata
2834 if ln -s X conftestdata 2>/dev/null
2835 then
2836   rm -f conftestdata
2837   ac_cv_prog_LN_S="ln -s"
2838 else
2839   ac_cv_prog_LN_S=ln
2840 fi
2841 fi
2842 LN_S="$ac_cv_prog_LN_S"
2843 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2844   echo "$ac_t""yes" 1>&6
2845 else
2846   echo "$ac_t""no" 1>&6
2847 fi
2848
2849 if test $host != $build; then
2850   ac_tool_prefix=${host_alias}-
2851 else
2852   ac_tool_prefix=
2853 fi
2854
2855
2856 case "$target" in
2857 NONE) lt_target="$host" ;;
2858 *) lt_target="$target" ;;
2859 esac
2860
2861 # Check for any special flags to pass to ltconfig.
2862 libtool_flags="--cache-file=$cache_file"
2863 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2864 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2865 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2866 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2867 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2868 libtool_flags="$libtool_flags --enable-dlopen"
2869 libtool_flags="$libtool_flags --enable-win32-dll"
2870 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2871 if test "${enable_libtool_lock+set}" = set; then
2872   enableval="$enable_libtool_lock"
2873   :
2874 fi
2875
2876 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2877 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2878
2879 # Some flags need to be propagated to the compiler or linker for good
2880 # libtool support.
2881 case "$lt_target" in
2882 *-*-irix6*)
2883   # Find out which ABI we are using.
2884   echo '#line 2885 "configure"' > conftest.$ac_ext
2885   if { (eval echo configure:2886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2886     case "`/usr/bin/file conftest.o`" in
2887     *32-bit*)
2888       LD="${LD-ld} -32"
2889       ;;
2890     *N32*)
2891       LD="${LD-ld} -n32"
2892       ;;
2893     *64-bit*)
2894       LD="${LD-ld} -64"
2895       ;;
2896     esac
2897   fi
2898   rm -rf conftest*
2899   ;;
2900
2901 *-*-sco3.2v5*)
2902   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2903   SAVE_CFLAGS="$CFLAGS"
2904   CFLAGS="$CFLAGS -belf"
2905   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2906 echo "configure:2907: checking whether the C compiler needs -belf" >&5
2907 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2908   echo $ac_n "(cached) $ac_c" 1>&6
2909 else
2910   cat > conftest.$ac_ext <<EOF
2911 #line 2912 "configure"
2912 #include "confdefs.h"
2913
2914 int main() {
2915
2916 ; return 0; }
2917 EOF
2918 if { (eval echo configure:2919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2919   rm -rf conftest*
2920   lt_cv_cc_needs_belf=yes
2921 else
2922   echo "configure: failed program was:" >&5
2923   cat conftest.$ac_ext >&5
2924   rm -rf conftest*
2925   lt_cv_cc_needs_belf=no
2926 fi
2927 rm -f conftest*
2928 fi
2929
2930 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2931   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2932     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2933     CFLAGS="$SAVE_CFLAGS"
2934   fi
2935   ;;
2936
2937 *-*-cygwin* | *-*-mingw*)
2938   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2939 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2940 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2941 echo "configure:2942: checking for $ac_word" >&5
2942 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2943   echo $ac_n "(cached) $ac_c" 1>&6
2944 else
2945   if test -n "$DLLTOOL"; then
2946   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2947 else
2948   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2949   ac_dummy="$PATH"
2950   for ac_dir in $ac_dummy; do
2951     test -z "$ac_dir" && ac_dir=.
2952     if test -f $ac_dir/$ac_word; then
2953       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2954       break
2955     fi
2956   done
2957   IFS="$ac_save_ifs"
2958 fi
2959 fi
2960 DLLTOOL="$ac_cv_prog_DLLTOOL"
2961 if test -n "$DLLTOOL"; then
2962   echo "$ac_t""$DLLTOOL" 1>&6
2963 else
2964   echo "$ac_t""no" 1>&6
2965 fi
2966
2967
2968 if test -z "$ac_cv_prog_DLLTOOL"; then
2969 if test -n "$ac_tool_prefix"; then
2970   # Extract the first word of "dlltool", so it can be a program name with args.
2971 set dummy dlltool; ac_word=$2
2972 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2973 echo "configure:2974: checking for $ac_word" >&5
2974 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2975   echo $ac_n "(cached) $ac_c" 1>&6
2976 else
2977   if test -n "$DLLTOOL"; then
2978   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2979 else
2980   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2981   ac_dummy="$PATH"
2982   for ac_dir in $ac_dummy; do
2983     test -z "$ac_dir" && ac_dir=.
2984     if test -f $ac_dir/$ac_word; then
2985       ac_cv_prog_DLLTOOL="dlltool"
2986       break
2987     fi
2988   done
2989   IFS="$ac_save_ifs"
2990   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
2991 fi
2992 fi
2993 DLLTOOL="$ac_cv_prog_DLLTOOL"
2994 if test -n "$DLLTOOL"; then
2995   echo "$ac_t""$DLLTOOL" 1>&6
2996 else
2997   echo "$ac_t""no" 1>&6
2998 fi
2999
3000 else
3001   DLLTOOL="false"
3002 fi
3003 fi
3004
3005   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3006 set dummy ${ac_tool_prefix}as; ac_word=$2
3007 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3008 echo "configure:3009: checking for $ac_word" >&5
3009 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3010   echo $ac_n "(cached) $ac_c" 1>&6
3011 else
3012   if test -n "$AS"; then
3013   ac_cv_prog_AS="$AS" # Let the user override the test.
3014 else
3015   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3016   ac_dummy="$PATH"
3017   for ac_dir in $ac_dummy; do
3018     test -z "$ac_dir" && ac_dir=.
3019     if test -f $ac_dir/$ac_word; then
3020       ac_cv_prog_AS="${ac_tool_prefix}as"
3021       break
3022     fi
3023   done
3024   IFS="$ac_save_ifs"
3025 fi
3026 fi
3027 AS="$ac_cv_prog_AS"
3028 if test -n "$AS"; then
3029   echo "$ac_t""$AS" 1>&6
3030 else
3031   echo "$ac_t""no" 1>&6
3032 fi
3033
3034
3035 if test -z "$ac_cv_prog_AS"; then
3036 if test -n "$ac_tool_prefix"; then
3037   # Extract the first word of "as", so it can be a program name with args.
3038 set dummy as; ac_word=$2
3039 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3040 echo "configure:3041: checking for $ac_word" >&5
3041 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3042   echo $ac_n "(cached) $ac_c" 1>&6
3043 else
3044   if test -n "$AS"; then
3045   ac_cv_prog_AS="$AS" # Let the user override the test.
3046 else
3047   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3048   ac_dummy="$PATH"
3049   for ac_dir in $ac_dummy; do
3050     test -z "$ac_dir" && ac_dir=.
3051     if test -f $ac_dir/$ac_word; then
3052       ac_cv_prog_AS="as"
3053       break
3054     fi
3055   done
3056   IFS="$ac_save_ifs"
3057   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3058 fi
3059 fi
3060 AS="$ac_cv_prog_AS"
3061 if test -n "$AS"; then
3062   echo "$ac_t""$AS" 1>&6
3063 else
3064   echo "$ac_t""no" 1>&6
3065 fi
3066
3067 else
3068   AS="false"
3069 fi
3070 fi
3071
3072   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3073 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3074 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3075 echo "configure:3076: checking for $ac_word" >&5
3076 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3077   echo $ac_n "(cached) $ac_c" 1>&6
3078 else
3079   if test -n "$OBJDUMP"; then
3080   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3081 else
3082   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3083   ac_dummy="$PATH"
3084   for ac_dir in $ac_dummy; do
3085     test -z "$ac_dir" && ac_dir=.
3086     if test -f $ac_dir/$ac_word; then
3087       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3088       break
3089     fi
3090   done
3091   IFS="$ac_save_ifs"
3092 fi
3093 fi
3094 OBJDUMP="$ac_cv_prog_OBJDUMP"
3095 if test -n "$OBJDUMP"; then
3096   echo "$ac_t""$OBJDUMP" 1>&6
3097 else
3098   echo "$ac_t""no" 1>&6
3099 fi
3100
3101
3102 if test -z "$ac_cv_prog_OBJDUMP"; then
3103 if test -n "$ac_tool_prefix"; then
3104   # Extract the first word of "objdump", so it can be a program name with args.
3105 set dummy objdump; ac_word=$2
3106 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3107 echo "configure:3108: checking for $ac_word" >&5
3108 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3109   echo $ac_n "(cached) $ac_c" 1>&6
3110 else
3111   if test -n "$OBJDUMP"; then
3112   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3113 else
3114   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3115   ac_dummy="$PATH"
3116   for ac_dir in $ac_dummy; do
3117     test -z "$ac_dir" && ac_dir=.
3118     if test -f $ac_dir/$ac_word; then
3119       ac_cv_prog_OBJDUMP="objdump"
3120       break
3121     fi
3122   done
3123   IFS="$ac_save_ifs"
3124   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3125 fi
3126 fi
3127 OBJDUMP="$ac_cv_prog_OBJDUMP"
3128 if test -n "$OBJDUMP"; then
3129   echo "$ac_t""$OBJDUMP" 1>&6
3130 else
3131   echo "$ac_t""no" 1>&6
3132 fi
3133
3134 else
3135   OBJDUMP="false"
3136 fi
3137 fi
3138
3139   ;;
3140
3141 esac
3142
3143
3144 # Save cache, so that ltconfig can load it
3145
3146
3147 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3148 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3149 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3150 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3151 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3152 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3153 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3154 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3155
3156 # Reload cache, that may have been modified by ltconfig
3157
3158
3159 # This can be used to rebuild libtool when needed
3160 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3161
3162 # Always use our own libtool.
3163 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3164
3165 # Redirect the config.log output again, so that the ltconfig log is not
3166 # clobbered by the next message.
3167 exec 5>>./config.log
3168
3169
3170 for ac_prog in mawk gawk nawk awk
3171 do
3172 # Extract the first word of "$ac_prog", so it can be a program name with args.
3173 set dummy $ac_prog; ac_word=$2
3174 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3175 echo "configure:3176: checking for $ac_word" >&5
3176 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3177   echo $ac_n "(cached) $ac_c" 1>&6
3178 else
3179   if test -n "$AWK"; then
3180   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3181 else
3182   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3183   ac_dummy="$PATH"
3184   for ac_dir in $ac_dummy; do
3185     test -z "$ac_dir" && ac_dir=.
3186     if test -f $ac_dir/$ac_word; then
3187       ac_cv_prog_AWK="$ac_prog"
3188       break
3189     fi
3190   done
3191   IFS="$ac_save_ifs"
3192 fi
3193 fi
3194 AWK="$ac_cv_prog_AWK"
3195 if test -n "$AWK"; then
3196   echo "$ac_t""$AWK" 1>&6
3197 else
3198   echo "$ac_t""no" 1>&6
3199 fi
3200
3201 test -n "$AWK" && break
3202 done
3203
3204 # test for ln hardlink support
3205 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3206 echo "configure:3207: checking whether ln works" >&5
3207 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3208   echo $ac_n "(cached) $ac_c" 1>&6
3209 else
3210   rm -f conftest.src conftest.dst
3211 echo "conftest" > conftest.src
3212 if ln conftest.src conftest.dst 2>/dev/null
3213 then
3214   ol_cv_prog_LN_H="ln"
3215 else
3216   ol_cv_prog_LN_H="cp"
3217 fi
3218 rm -f conftest.src conftest.dst
3219
3220 fi
3221 LN_H="$ol_cv_prog_LN_H"
3222 if test "$ol_cv_prog_LN_H" = "ln"; then
3223         echo "$ac_t""yes" 1>&6
3224 else
3225         echo "$ac_t""no" 1>&6
3226 fi
3227
3228 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3229 echo "configure:3230: checking whether ln -s works" >&5
3230 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3231   echo $ac_n "(cached) $ac_c" 1>&6
3232 else
3233   rm -f conftestdata
3234 if ln -s X conftestdata 2>/dev/null
3235 then
3236   rm -f conftestdata
3237   ac_cv_prog_LN_S="ln -s"
3238 else
3239   ac_cv_prog_LN_S=ln
3240 fi
3241 fi
3242 LN_S="$ac_cv_prog_LN_S"
3243 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3244   echo "$ac_t""yes" 1>&6
3245 else
3246   echo "$ac_t""no" 1>&6
3247 fi
3248
3249
3250 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3251         LN_S="$LN_H"
3252 fi
3253
3254 # Extract the first word of "sendmail", so it can be a program name with args.
3255 set dummy sendmail; ac_word=$2
3256 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3257 echo "configure:3258: checking for $ac_word" >&5
3258 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3259   echo $ac_n "(cached) $ac_c" 1>&6
3260 else
3261   case "$SENDMAIL" in
3262   /*)
3263   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3264   ;;
3265   ?:/*)
3266   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3267   ;;
3268   *)
3269   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3270   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3271   for ac_dir in $ac_dummy; do 
3272     test -z "$ac_dir" && ac_dir=.
3273     if test -f $ac_dir/$ac_word; then
3274       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3275       break
3276     fi
3277   done
3278   IFS="$ac_save_ifs"
3279   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3280   ;;
3281 esac
3282 fi
3283 SENDMAIL="$ac_cv_path_SENDMAIL"
3284 if test -n "$SENDMAIL"; then
3285   echo "$ac_t""$SENDMAIL" 1>&6
3286 else
3287   echo "$ac_t""no" 1>&6
3288 fi
3289
3290 # Extract the first word of "vi", so it can be a program name with args.
3291 set dummy vi; ac_word=$2
3292 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3293 echo "configure:3294: checking for $ac_word" >&5
3294 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3295   echo $ac_n "(cached) $ac_c" 1>&6
3296 else
3297   case "$EDITOR" in
3298   /*)
3299   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3300   ;;
3301   ?:/*)
3302   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3303   ;;
3304   *)
3305   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3306   ac_dummy="$PATH:/usr/ucb"
3307   for ac_dir in $ac_dummy; do 
3308     test -z "$ac_dir" && ac_dir=.
3309     if test -f $ac_dir/$ac_word; then
3310       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3311       break
3312     fi
3313   done
3314   IFS="$ac_save_ifs"
3315   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3316   ;;
3317 esac
3318 fi
3319 EDITOR="$ac_cv_path_EDITOR"
3320 if test -n "$EDITOR"; then
3321   echo "$ac_t""$EDITOR" 1>&6
3322 else
3323   echo "$ac_t""no" 1>&6
3324 fi
3325
3326 # Extract the first word of "finger", so it can be a program name with args.
3327 set dummy finger; ac_word=$2
3328 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3329 echo "configure:3330: checking for $ac_word" >&5
3330 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3331   echo $ac_n "(cached) $ac_c" 1>&6
3332 else
3333   case "$FINGER" in
3334   /*)
3335   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3336   ;;
3337   ?:/*)
3338   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3339   ;;
3340   *)
3341   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3342   ac_dummy="$PATH:/usr/ucb"
3343   for ac_dir in $ac_dummy; do 
3344     test -z "$ac_dir" && ac_dir=.
3345     if test -f $ac_dir/$ac_word; then
3346       ac_cv_path_FINGER="$ac_dir/$ac_word"
3347       break
3348     fi
3349   done
3350   IFS="$ac_save_ifs"
3351   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3352   ;;
3353 esac
3354 fi
3355 FINGER="$ac_cv_path_FINGER"
3356 if test -n "$FINGER"; then
3357   echo "$ac_t""$FINGER" 1>&6
3358 else
3359   echo "$ac_t""no" 1>&6
3360 fi
3361
3362
3363 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3364 echo "configure:3365: checking how to run the C preprocessor" >&5
3365 # On Suns, sometimes $CPP names a directory.
3366 if test -n "$CPP" && test -d "$CPP"; then
3367   CPP=
3368 fi
3369 if test -z "$CPP"; then
3370 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3371   echo $ac_n "(cached) $ac_c" 1>&6
3372 else
3373     # This must be in double quotes, not single quotes, because CPP may get
3374   # substituted into the Makefile and "${CC-cc}" will confuse make.
3375   CPP="${CC-cc} -E"
3376   # On the NeXT, cc -E runs the code through the compiler's parser,
3377   # not just through cpp.
3378   cat > conftest.$ac_ext <<EOF
3379 #line 3380 "configure"
3380 #include "confdefs.h"
3381 #include <assert.h>
3382 Syntax Error
3383 EOF
3384 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3385 { (eval echo configure:3386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3386 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3387 if test -z "$ac_err"; then
3388   :
3389 else
3390   echo "$ac_err" >&5
3391   echo "configure: failed program was:" >&5
3392   cat conftest.$ac_ext >&5
3393   rm -rf conftest*
3394   CPP="${CC-cc} -E -traditional-cpp"
3395   cat > conftest.$ac_ext <<EOF
3396 #line 3397 "configure"
3397 #include "confdefs.h"
3398 #include <assert.h>
3399 Syntax Error
3400 EOF
3401 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3402 { (eval echo configure:3403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3403 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3404 if test -z "$ac_err"; then
3405   :
3406 else
3407   echo "$ac_err" >&5
3408   echo "configure: failed program was:" >&5
3409   cat conftest.$ac_ext >&5
3410   rm -rf conftest*
3411   CPP="${CC-cc} -nologo -E"
3412   cat > conftest.$ac_ext <<EOF
3413 #line 3414 "configure"
3414 #include "confdefs.h"
3415 #include <assert.h>
3416 Syntax Error
3417 EOF
3418 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3419 { (eval echo configure:3420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3420 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3421 if test -z "$ac_err"; then
3422   :
3423 else
3424   echo "$ac_err" >&5
3425   echo "configure: failed program was:" >&5
3426   cat conftest.$ac_ext >&5
3427   rm -rf conftest*
3428   CPP=/lib/cpp
3429 fi
3430 rm -f conftest*
3431 fi
3432 rm -f conftest*
3433 fi
3434 rm -f conftest*
3435   ac_cv_prog_CPP="$CPP"
3436 fi
3437   CPP="$ac_cv_prog_CPP"
3438 else
3439   ac_cv_prog_CPP="$CPP"
3440 fi
3441 echo "$ac_t""$CPP" 1>&6
3442
3443
3444 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3445         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3446
3447 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3448         echo "configure: warning: programs compiled here do run here..." 1>&2
3449         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3450
3451 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3452         echo "configure: warning: programs compiled here do not run here..." 1>&2
3453         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3454 fi
3455
3456 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3457 echo "configure:3458: checking for AIX" >&5
3458 cat > conftest.$ac_ext <<EOF
3459 #line 3460 "configure"
3460 #include "confdefs.h"
3461 #ifdef _AIX
3462   yes
3463 #endif
3464
3465 EOF
3466 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3467   egrep "yes" >/dev/null 2>&1; then
3468   rm -rf conftest*
3469   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3470 #define _ALL_SOURCE 1
3471 EOF
3472
3473 else
3474   rm -rf conftest*
3475   echo "$ac_t""no" 1>&6
3476 fi
3477 rm -f conftest*
3478
3479
3480 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3481 echo "configure:3482: checking for POSIXized ISC" >&5
3482 if test -d /etc/conf/kconfig.d &&
3483   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3484 then
3485   echo "$ac_t""yes" 1>&6
3486   ISC=yes # If later tests want to check for ISC.
3487   cat >> confdefs.h <<\EOF
3488 #define _POSIX_SOURCE 1
3489 EOF
3490
3491   if test "$GCC" = yes; then
3492     CC="$CC -posix"
3493   else
3494     CC="$CC -Xp"
3495   fi
3496 else
3497   echo "$ac_t""no" 1>&6
3498   ISC=
3499 fi
3500
3501 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3502 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3503 echo "configure:3504: checking for minix/config.h" >&5
3504 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3505   echo $ac_n "(cached) $ac_c" 1>&6
3506 else
3507   cat > conftest.$ac_ext <<EOF
3508 #line 3509 "configure"
3509 #include "confdefs.h"
3510 #include <minix/config.h>
3511 EOF
3512 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3513 { (eval echo configure:3514: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3514 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3515 if test -z "$ac_err"; then
3516   rm -rf conftest*
3517   eval "ac_cv_header_$ac_safe=yes"
3518 else
3519   echo "$ac_err" >&5
3520   echo "configure: failed program was:" >&5
3521   cat conftest.$ac_ext >&5
3522   rm -rf conftest*
3523   eval "ac_cv_header_$ac_safe=no"
3524 fi
3525 rm -f conftest*
3526 fi
3527 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3528   echo "$ac_t""yes" 1>&6
3529   MINIX=yes
3530 else
3531   echo "$ac_t""no" 1>&6
3532 MINIX=
3533 fi
3534
3535 if test "$MINIX" = yes; then
3536   cat >> confdefs.h <<\EOF
3537 #define _POSIX_SOURCE 1
3538 EOF
3539
3540   cat >> confdefs.h <<\EOF
3541 #define _POSIX_1_SOURCE 2
3542 EOF
3543
3544   cat >> confdefs.h <<\EOF
3545 #define _MINIX 1
3546 EOF
3547
3548 fi
3549
3550
3551 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3552 echo "configure:3553: checking for Cygwin environment" >&5
3553 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3554   echo $ac_n "(cached) $ac_c" 1>&6
3555 else
3556   cat > conftest.$ac_ext <<EOF
3557 #line 3558 "configure"
3558 #include "confdefs.h"
3559
3560 int main() {
3561
3562 #ifndef __CYGWIN__
3563 #define __CYGWIN__ __CYGWIN32__
3564 #endif
3565 return __CYGWIN__;
3566 ; return 0; }
3567 EOF
3568 if { (eval echo configure:3569: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3569   rm -rf conftest*
3570   ac_cv_cygwin=yes
3571 else
3572   echo "configure: failed program was:" >&5
3573   cat conftest.$ac_ext >&5
3574   rm -rf conftest*
3575   ac_cv_cygwin=no
3576 fi
3577 rm -f conftest*
3578 fi
3579
3580 echo "$ac_t""$ac_cv_cygwin" 1>&6
3581 CYGWIN=
3582 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3583 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3584 echo "configure:3585: checking for mingw32 environment" >&5
3585 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3586   echo $ac_n "(cached) $ac_c" 1>&6
3587 else
3588   cat > conftest.$ac_ext <<EOF
3589 #line 3590 "configure"
3590 #include "confdefs.h"
3591
3592 int main() {
3593 return __MINGW32__;
3594 ; return 0; }
3595 EOF
3596 if { (eval echo configure:3597: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3597   rm -rf conftest*
3598   ac_cv_mingw32=yes
3599 else
3600   echo "configure: failed program was:" >&5
3601   cat conftest.$ac_ext >&5
3602   rm -rf conftest*
3603   ac_cv_mingw32=no
3604 fi
3605 rm -f conftest*
3606 fi
3607
3608 echo "$ac_t""$ac_cv_mingw32" 1>&6
3609 MINGW32=
3610 test "$ac_cv_mingw32" = yes && MINGW32=yes
3611 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3612 echo "configure:3613: checking for EMX OS/2 environment" >&5
3613 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3614   echo $ac_n "(cached) $ac_c" 1>&6
3615 else
3616   cat > conftest.$ac_ext <<EOF
3617 #line 3618 "configure"
3618 #include "confdefs.h"
3619
3620 int main() {
3621 return __EMX__;
3622 ; return 0; }
3623 EOF
3624 if { (eval echo configure:3625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3625   rm -rf conftest*
3626   ac_cv_emxos2=yes
3627 else
3628   echo "configure: failed program was:" >&5
3629   cat conftest.$ac_ext >&5
3630   rm -rf conftest*
3631   ac_cv_emxos2=no
3632 fi
3633 rm -f conftest*
3634 fi
3635
3636 echo "$ac_t""$ac_cv_emxos2" 1>&6
3637 EMXOS2=
3638 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3639
3640
3641
3642 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3643 echo "configure:3644: checking for executable suffix" >&5
3644 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3645   echo $ac_n "(cached) $ac_c" 1>&6
3646 else
3647   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3648   ac_cv_exeext=.exe
3649 else
3650   rm -f conftest*
3651   echo 'int main () { return 0; }' > conftest.$ac_ext
3652   ac_cv_exeext=
3653   if { (eval echo configure:3654: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3654     for file in conftest.*; do
3655       case $file in
3656       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3657       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3658       esac
3659     done
3660   else
3661     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3662   fi
3663   rm -f conftest*
3664   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3665 fi
3666 fi
3667
3668 EXEEXT=""
3669 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3670 echo "$ac_t""${ac_cv_exeext}" 1>&6
3671 ac_exeext=$EXEEXT
3672
3673 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3674 echo "configure:3675: checking for object suffix" >&5
3675 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3676   echo $ac_n "(cached) $ac_c" 1>&6
3677 else
3678   rm -f conftest*
3679 echo 'int i = 1;' > conftest.$ac_ext
3680 if { (eval echo configure:3681: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3681   for ac_file in conftest.*; do
3682     case $ac_file in
3683     *.c) ;;
3684     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3685     esac
3686   done
3687 else
3688   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3689 fi
3690 rm -f conftest*
3691 fi
3692
3693 echo "$ac_t""$ac_cv_objext" 1>&6
3694 OBJEXT=$ac_cv_objext
3695 ac_objext=$ac_cv_objext
3696
3697
3698 cat >> confdefs.h <<EOF
3699 #define EXEEXT "${EXEEXT}"
3700 EOF
3701
3702
3703 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3704 echo "configure:3705: checking for be_app in -lbe" >&5
3705 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3706 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3707   echo $ac_n "(cached) $ac_c" 1>&6
3708 else
3709   ac_save_LIBS="$LIBS"
3710 LIBS="-lbe -lroot -lnet $LIBS"
3711 cat > conftest.$ac_ext <<EOF
3712 #line 3713 "configure"
3713 #include "confdefs.h"
3714 /* Override any gcc2 internal prototype to avoid an error.  */
3715 /* We use char because int might match the return type of a gcc2
3716     builtin and then its argument prototype would still apply.  */
3717 char be_app();
3718
3719 int main() {
3720 be_app()
3721 ; return 0; }
3722 EOF
3723 if { (eval echo configure:3724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3724   rm -rf conftest*
3725   eval "ac_cv_lib_$ac_lib_var=yes"
3726 else
3727   echo "configure: failed program was:" >&5
3728   cat conftest.$ac_ext >&5
3729   rm -rf conftest*
3730   eval "ac_cv_lib_$ac_lib_var=no"
3731 fi
3732 rm -f conftest*
3733 LIBS="$ac_save_LIBS"
3734
3735 fi
3736 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3737   echo "$ac_t""yes" 1>&6
3738   LIBS="$LIBS -lbe -lroot -lnet"
3739 else
3740   echo "$ac_t""no" 1>&6
3741 :
3742 fi
3743
3744
3745
3746
3747
3748 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3749 echo "configure:3750: checking for ${CC-cc} option to accept ANSI C" >&5
3750 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3751   echo $ac_n "(cached) $ac_c" 1>&6
3752 else
3753   am_cv_prog_cc_stdc=no
3754 ac_save_CC="$CC"
3755 # Don't try gcc -ansi; that turns off useful extensions and
3756 # breaks some systems' header files.
3757 # AIX                   -qlanglvl=ansi
3758 # Ultrix and OSF/1      -std1
3759 # HP-UX 10.20 and later -Ae
3760 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3761 # SVR4                  -Xc -D__EXTENSIONS__
3762 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3763 do
3764   CC="$ac_save_CC $ac_arg"
3765   cat > conftest.$ac_ext <<EOF
3766 #line 3767 "configure"
3767 #include "confdefs.h"
3768 #include <stdarg.h>
3769 #include <stdio.h>
3770 #include <sys/types.h>
3771 #include <sys/stat.h>
3772 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3773 struct buf { int x; };
3774 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3775 static char *e (p, i)
3776      char **p;
3777      int i;
3778 {
3779   return p[i];
3780 }
3781 static char *f (char * (*g) (char **, int), char **p, ...)
3782 {
3783   char *s;
3784   va_list v;
3785   va_start (v,p);
3786   s = g (p, va_arg (v,int));
3787   va_end (v);
3788   return s;
3789 }
3790 int test (int i, double x);
3791 struct s1 {int (*f) (int a);};
3792 struct s2 {int (*f) (double a);};
3793 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3794 int argc;
3795 char **argv;
3796
3797 int main() {
3798
3799 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3800
3801 ; return 0; }
3802 EOF
3803 if { (eval echo configure:3804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3804   rm -rf conftest*
3805   am_cv_prog_cc_stdc="$ac_arg"; break
3806 else
3807   echo "configure: failed program was:" >&5
3808   cat conftest.$ac_ext >&5
3809 fi
3810 rm -f conftest*
3811 done
3812 CC="$ac_save_CC"
3813
3814 fi
3815
3816 if test -z "$am_cv_prog_cc_stdc"; then
3817   echo "$ac_t""none needed" 1>&6
3818 else
3819   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3820 fi
3821 case "x$am_cv_prog_cc_stdc" in
3822   x|xno) ;;
3823   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3824 esac
3825
3826 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3827         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3828 fi
3829
3830 # test for make depend flag
3831 OL_MKDEP=
3832 OL_MKDEP_FLAGS=
3833 if test -z "${MKDEP}"; then
3834         OL_MKDEP="${CC-cc}"
3835         if test -z "${MKDEP_FLAGS}"; then
3836                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3837 echo "configure:3838: checking for ${OL_MKDEP} depend flag" >&5
3838 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3839   echo $ac_n "(cached) $ac_c" 1>&6
3840 else
3841   
3842                         ol_cv_mkdep=no
3843                         for flag in "-M" "-xM"; do
3844                                 cat > conftest.c <<EOF
3845  noCode;
3846 EOF
3847                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3848: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3848                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3849                                 then
3850                                         if test ! -f conftest."${ac_object}" ; then
3851                                                 ol_cv_mkdep=$flag
3852                                                 OL_MKDEP_FLAGS="$flag"
3853                                                 break
3854                                         fi
3855                                 fi
3856                         done
3857                         rm -f conftest*
3858                 
3859 fi
3860
3861 echo "$ac_t""$ol_cv_mkdep" 1>&6
3862         else
3863                 cc_cv_mkdep=yes
3864                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3865         fi
3866 else
3867         cc_cv_mkdep=yes
3868         OL_MKDEP="${MKDEP}"
3869         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3870 fi
3871
3872
3873
3874 if test "${ol_cv_mkdep}" = no ; then
3875         # this will soon become an error
3876         echo "configure: warning: do not know how to generate dependencies" 1>&2
3877 fi
3878
3879 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3880 echo "configure:3881: checking for afopen in -ls" >&5
3881 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3882 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3883   echo $ac_n "(cached) $ac_c" 1>&6
3884 else
3885   ac_save_LIBS="$LIBS"
3886 LIBS="-ls  $LIBS"
3887 cat > conftest.$ac_ext <<EOF
3888 #line 3889 "configure"
3889 #include "confdefs.h"
3890 /* Override any gcc2 internal prototype to avoid an error.  */
3891 /* We use char because int might match the return type of a gcc2
3892     builtin and then its argument prototype would still apply.  */
3893 char afopen();
3894
3895 int main() {
3896 afopen()
3897 ; return 0; }
3898 EOF
3899 if { (eval echo configure:3900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3900   rm -rf conftest*
3901   eval "ac_cv_lib_$ac_lib_var=yes"
3902 else
3903   echo "configure: failed program was:" >&5
3904   cat conftest.$ac_ext >&5
3905   rm -rf conftest*
3906   eval "ac_cv_lib_$ac_lib_var=no"
3907 fi
3908 rm -f conftest*
3909 LIBS="$ac_save_LIBS"
3910
3911 fi
3912 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3913   echo "$ac_t""yes" 1>&6
3914   
3915         AUTH_LIBS=-ls
3916         cat >> confdefs.h <<\EOF
3917 #define HAVE_AIX_SECURITY 1
3918 EOF
3919
3920
3921 else
3922   echo "$ac_t""no" 1>&6
3923 fi
3924
3925
3926
3927 for ac_func in getaddrinfo 
3928 do
3929 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
3930 echo "configure:3931: checking for $ac_func" >&5
3931 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
3932   echo $ac_n "(cached) $ac_c" 1>&6
3933 else
3934   cat > conftest.$ac_ext <<EOF
3935 #line 3936 "configure"
3936 #include "confdefs.h"
3937 /* System header to define __stub macros and hopefully few prototypes,
3938     which can conflict with char $ac_func(); below.  */
3939 #include <assert.h>
3940 /* Override any gcc2 internal prototype to avoid an error.  */
3941 /* We use char because int might match the return type of a gcc2
3942     builtin and then its argument prototype would still apply.  */
3943 char $ac_func();
3944 char (*f)();
3945
3946 int main() {
3947
3948 /* The GNU C library defines this for functions which it implements
3949     to always fail with ENOSYS.  Some functions are actually named
3950     something starting with __ and the normal name is an alias.  */
3951 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3952 choke me
3953 #else
3954 f = $ac_func;
3955 #endif
3956
3957 ; return 0; }
3958 EOF
3959 if { (eval echo configure:3960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3960   rm -rf conftest*
3961   eval "ac_cv_func_$ac_func=yes"
3962 else
3963   echo "configure: failed program was:" >&5
3964   cat conftest.$ac_ext >&5
3965   rm -rf conftest*
3966   eval "ac_cv_func_$ac_func=no"
3967 fi
3968 rm -f conftest*
3969 fi
3970
3971 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
3972   echo "$ac_t""yes" 1>&6
3973     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
3974   cat >> confdefs.h <<EOF
3975 #define $ac_tr_func 1
3976 EOF
3977  
3978 else
3979   echo "$ac_t""no" 1>&6
3980 fi
3981 done
3982
3983
3984 if test $ac_cv_func_getaddrinfo = no ; then
3985         if test $ol_enable_ipv6 = yes ; then
3986                 { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
3987         fi
3988         ol_enable_ipv6=no
3989 fi
3990
3991 if test $ol_enable_unix != no ; then
3992         for ac_hdr in sys/un.h 
3993 do
3994 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3995 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3996 echo "configure:3997: checking for $ac_hdr" >&5
3997 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3998   echo $ac_n "(cached) $ac_c" 1>&6
3999 else
4000   cat > conftest.$ac_ext <<EOF
4001 #line 4002 "configure"
4002 #include "confdefs.h"
4003 #include <$ac_hdr>
4004 EOF
4005 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4006 { (eval echo configure:4007: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4007 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4008 if test -z "$ac_err"; then
4009   rm -rf conftest*
4010   eval "ac_cv_header_$ac_safe=yes"
4011 else
4012   echo "$ac_err" >&5
4013   echo "configure: failed program was:" >&5
4014   cat conftest.$ac_ext >&5
4015   rm -rf conftest*
4016   eval "ac_cv_header_$ac_safe=no"
4017 fi
4018 rm -f conftest*
4019 fi
4020 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4021   echo "$ac_t""yes" 1>&6
4022     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4023   cat >> confdefs.h <<EOF
4024 #define $ac_tr_hdr 1
4025 EOF
4026  
4027 else
4028   echo "$ac_t""no" 1>&6
4029 fi
4030 done
4031
4032
4033         if test $ol_enable_unix = auto ; then
4034                 ol_enable_unix=$ac_cv_header_sys_un_h
4035         elif test $ac_cv_header_sys_un_h = no ; then
4036                 { echo "configure: error: UNIX domain support requires sys/un.h" 1>&2; exit 1; }
4037         fi
4038 fi
4039
4040 ol_link_modules=no
4041 if test $ol_enable_modules != no ; then
4042         for ac_hdr in ltdl.h
4043 do
4044 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4045 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4046 echo "configure:4047: checking for $ac_hdr" >&5
4047 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4048   echo $ac_n "(cached) $ac_c" 1>&6
4049 else
4050   cat > conftest.$ac_ext <<EOF
4051 #line 4052 "configure"
4052 #include "confdefs.h"
4053 #include <$ac_hdr>
4054 EOF
4055 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4056 { (eval echo configure:4057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4057 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4058 if test -z "$ac_err"; then
4059   rm -rf conftest*
4060   eval "ac_cv_header_$ac_safe=yes"
4061 else
4062   echo "$ac_err" >&5
4063   echo "configure: failed program was:" >&5
4064   cat conftest.$ac_ext >&5
4065   rm -rf conftest*
4066   eval "ac_cv_header_$ac_safe=no"
4067 fi
4068 rm -f conftest*
4069 fi
4070 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4071   echo "$ac_t""yes" 1>&6
4072     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4073   cat >> confdefs.h <<EOF
4074 #define $ac_tr_hdr 1
4075 EOF
4076  
4077 else
4078   echo "$ac_t""no" 1>&6
4079 fi
4080 done
4081
4082
4083         if test $ac_cv_header_ltdl_h = no ; then
4084                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
4085         fi
4086
4087         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
4088 echo "configure:4089: checking for lt_dlinit in -lltdl" >&5
4089 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
4090 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4091   echo $ac_n "(cached) $ac_c" 1>&6
4092 else
4093   ac_save_LIBS="$LIBS"
4094 LIBS="-lltdl  $LIBS"
4095 cat > conftest.$ac_ext <<EOF
4096 #line 4097 "configure"
4097 #include "confdefs.h"
4098 /* Override any gcc2 internal prototype to avoid an error.  */
4099 /* We use char because int might match the return type of a gcc2
4100     builtin and then its argument prototype would still apply.  */
4101 char lt_dlinit();
4102
4103 int main() {
4104 lt_dlinit()
4105 ; return 0; }
4106 EOF
4107 if { (eval echo configure:4108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4108   rm -rf conftest*
4109   eval "ac_cv_lib_$ac_lib_var=yes"
4110 else
4111   echo "configure: failed program was:" >&5
4112   cat conftest.$ac_ext >&5
4113   rm -rf conftest*
4114   eval "ac_cv_lib_$ac_lib_var=no"
4115 fi
4116 rm -f conftest*
4117 LIBS="$ac_save_LIBS"
4118
4119 fi
4120 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4121   echo "$ac_t""yes" 1>&6
4122   
4123             MODULES_LIBS=-lltdl
4124             cat >> confdefs.h <<\EOF
4125 #define HAVE_LIBLTDL 1
4126 EOF
4127
4128         
4129 else
4130   echo "$ac_t""no" 1>&6
4131 fi
4132
4133
4134         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4135                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4136         fi
4137         ol_link_modules=yes
4138 else
4139         ol_with_dnssrv_module=static
4140         ol_with_ldap_module=static
4141         ol_with_ldbm_module=static
4142         ol_with_passwd_module=static
4143         ol_with_shell_module=static
4144 fi
4145
4146 # test for EBCDIC
4147 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4148 echo "configure:4149: checking for EBCDIC" >&5
4149 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4150   echo $ac_n "(cached) $ac_c" 1>&6
4151 else
4152   
4153         cat > conftest.$ac_ext <<EOF
4154 #line 4155 "configure"
4155 #include "confdefs.h"
4156
4157 #if !('M' == 0xd4)
4158 #include <__ASCII__/generate_error.h>
4159 #endif
4160
4161 EOF
4162 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4163 { (eval echo configure:4164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4164 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4165 if test -z "$ac_err"; then
4166   rm -rf conftest*
4167   ol_cv_cpp_ebcdic=yes
4168 else
4169   echo "$ac_err" >&5
4170   echo "configure: failed program was:" >&5
4171   cat conftest.$ac_ext >&5
4172   rm -rf conftest*
4173   ol_cv_cpp_ebcdic=no
4174 fi
4175 rm -f conftest*
4176 fi
4177
4178 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4179 if test $ol_cv_cpp_ebcdic = yes ; then
4180         cat >> confdefs.h <<\EOF
4181 #define HAVE_EBCDIC 1
4182 EOF
4183
4184 fi
4185
4186 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4187 echo "configure:4188: checking for ANSI C header files" >&5
4188 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4189   echo $ac_n "(cached) $ac_c" 1>&6
4190 else
4191   cat > conftest.$ac_ext <<EOF
4192 #line 4193 "configure"
4193 #include "confdefs.h"
4194 #include <stdlib.h>
4195 #include <stdarg.h>
4196 #include <string.h>
4197 #include <float.h>
4198 EOF
4199 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4200 { (eval echo configure:4201: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4201 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4202 if test -z "$ac_err"; then
4203   rm -rf conftest*
4204   ol_cv_header_stdc=yes
4205 else
4206   echo "$ac_err" >&5
4207   echo "configure: failed program was:" >&5
4208   cat conftest.$ac_ext >&5
4209   rm -rf conftest*
4210   ol_cv_header_stdc=no
4211 fi
4212 rm -f conftest*
4213
4214 if test $ol_cv_header_stdc = yes; then
4215   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4216 cat > conftest.$ac_ext <<EOF
4217 #line 4218 "configure"
4218 #include "confdefs.h"
4219 #include <string.h>
4220 EOF
4221 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4222   egrep "memchr" >/dev/null 2>&1; then
4223   :
4224 else
4225   rm -rf conftest*
4226   ol_cv_header_stdc=no
4227 fi
4228 rm -f conftest*
4229
4230 fi
4231
4232 if test $ol_cv_header_stdc = yes; then
4233   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4234 cat > conftest.$ac_ext <<EOF
4235 #line 4236 "configure"
4236 #include "confdefs.h"
4237 #include <stdlib.h>
4238 EOF
4239 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4240   egrep "free" >/dev/null 2>&1; then
4241   :
4242 else
4243   rm -rf conftest*
4244   ol_cv_header_stdc=no
4245 fi
4246 rm -f conftest*
4247
4248 fi
4249
4250 if test $ol_cv_header_stdc = yes; then
4251   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4252 if test "$cross_compiling" = yes; then
4253   :
4254 else
4255   cat > conftest.$ac_ext <<EOF
4256 #line 4257 "configure"
4257 #include "confdefs.h"
4258 #include <ctype.h>
4259 #ifndef HAVE_EBCDIC
4260 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4261 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4262 #else
4263 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4264                 || ('j' <= (c) && (c) <= 'r') \
4265                 || ('s' <= (c) && (c) <= 'z'))
4266 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4267 #endif
4268 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4269 int main () { int i; for (i = 0; i < 256; i++)
4270 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4271 exit (0); }
4272
4273 EOF
4274 if { (eval echo configure:4275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4275 then
4276   :
4277 else
4278   echo "configure: failed program was:" >&5
4279   cat conftest.$ac_ext >&5
4280   rm -fr conftest*
4281   ol_cv_header_stdc=no
4282 fi
4283 rm -fr conftest*
4284 fi
4285
4286 fi
4287 fi
4288
4289 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4290 if test $ol_cv_header_stdc = yes; then
4291   cat >> confdefs.h <<\EOF
4292 #define STDC_HEADERS 1
4293 EOF
4294
4295 fi
4296 ac_cv_header_stdc=disable
4297
4298
4299 if test $ol_cv_header_stdc != yes; then
4300         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4301 fi
4302
4303 ac_header_dirent=no
4304 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4305 do
4306 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4307 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4308 echo "configure:4309: checking for $ac_hdr that defines DIR" >&5
4309 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4310   echo $ac_n "(cached) $ac_c" 1>&6
4311 else
4312   cat > conftest.$ac_ext <<EOF
4313 #line 4314 "configure"
4314 #include "confdefs.h"
4315 #include <sys/types.h>
4316 #include <$ac_hdr>
4317 int main() {
4318 DIR *dirp = 0;
4319 ; return 0; }
4320 EOF
4321 if { (eval echo configure:4322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4322   rm -rf conftest*
4323   eval "ac_cv_header_dirent_$ac_safe=yes"
4324 else
4325   echo "configure: failed program was:" >&5
4326   cat conftest.$ac_ext >&5
4327   rm -rf conftest*
4328   eval "ac_cv_header_dirent_$ac_safe=no"
4329 fi
4330 rm -f conftest*
4331 fi
4332 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4333   echo "$ac_t""yes" 1>&6
4334     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4335   cat >> confdefs.h <<EOF
4336 #define $ac_tr_hdr 1
4337 EOF
4338  ac_header_dirent=$ac_hdr; break
4339 else
4340   echo "$ac_t""no" 1>&6
4341 fi
4342 done
4343 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4344 if test $ac_header_dirent = dirent.h; then
4345 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4346 echo "configure:4347: checking for opendir in -ldir" >&5
4347 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4348 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4349   echo $ac_n "(cached) $ac_c" 1>&6
4350 else
4351   ac_save_LIBS="$LIBS"
4352 LIBS="-ldir  $LIBS"
4353 cat > conftest.$ac_ext <<EOF
4354 #line 4355 "configure"
4355 #include "confdefs.h"
4356 /* Override any gcc2 internal prototype to avoid an error.  */
4357 /* We use char because int might match the return type of a gcc2
4358     builtin and then its argument prototype would still apply.  */
4359 char opendir();
4360
4361 int main() {
4362 opendir()
4363 ; return 0; }
4364 EOF
4365 if { (eval echo configure:4366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4366   rm -rf conftest*
4367   eval "ac_cv_lib_$ac_lib_var=yes"
4368 else
4369   echo "configure: failed program was:" >&5
4370   cat conftest.$ac_ext >&5
4371   rm -rf conftest*
4372   eval "ac_cv_lib_$ac_lib_var=no"
4373 fi
4374 rm -f conftest*
4375 LIBS="$ac_save_LIBS"
4376
4377 fi
4378 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4379   echo "$ac_t""yes" 1>&6
4380   LIBS="$LIBS -ldir"
4381 else
4382   echo "$ac_t""no" 1>&6
4383 fi
4384
4385 else
4386 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4387 echo "configure:4388: checking for opendir in -lx" >&5
4388 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4389 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4390   echo $ac_n "(cached) $ac_c" 1>&6
4391 else
4392   ac_save_LIBS="$LIBS"
4393 LIBS="-lx  $LIBS"
4394 cat > conftest.$ac_ext <<EOF
4395 #line 4396 "configure"
4396 #include "confdefs.h"
4397 /* Override any gcc2 internal prototype to avoid an error.  */
4398 /* We use char because int might match the return type of a gcc2
4399     builtin and then its argument prototype would still apply.  */
4400 char opendir();
4401
4402 int main() {
4403 opendir()
4404 ; return 0; }
4405 EOF
4406 if { (eval echo configure:4407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4407   rm -rf conftest*
4408   eval "ac_cv_lib_$ac_lib_var=yes"
4409 else
4410   echo "configure: failed program was:" >&5
4411   cat conftest.$ac_ext >&5
4412   rm -rf conftest*
4413   eval "ac_cv_lib_$ac_lib_var=no"
4414 fi
4415 rm -f conftest*
4416 LIBS="$ac_save_LIBS"
4417
4418 fi
4419 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4420   echo "$ac_t""yes" 1>&6
4421   LIBS="$LIBS -lx"
4422 else
4423   echo "$ac_t""no" 1>&6
4424 fi
4425
4426 fi
4427
4428 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4429 echo "configure:4430: checking for sys/wait.h that is POSIX.1 compatible" >&5
4430 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4431   echo $ac_n "(cached) $ac_c" 1>&6
4432 else
4433   cat > conftest.$ac_ext <<EOF
4434 #line 4435 "configure"
4435 #include "confdefs.h"
4436 #include <sys/types.h>
4437 #include <sys/wait.h>
4438 #ifndef WEXITSTATUS
4439 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4440 #endif
4441 #ifndef WIFEXITED
4442 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4443 #endif
4444 int main() {
4445 int s;
4446 wait (&s);
4447 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4448 ; return 0; }
4449 EOF
4450 if { (eval echo configure:4451: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4451   rm -rf conftest*
4452   ac_cv_header_sys_wait_h=yes
4453 else
4454   echo "configure: failed program was:" >&5
4455   cat conftest.$ac_ext >&5
4456   rm -rf conftest*
4457   ac_cv_header_sys_wait_h=no
4458 fi
4459 rm -f conftest*
4460 fi
4461
4462 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4463 if test $ac_cv_header_sys_wait_h = yes; then
4464   cat >> confdefs.h <<\EOF
4465 #define HAVE_SYS_WAIT_H 1
4466 EOF
4467
4468 fi
4469
4470 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4471 echo "configure:4472: checking POSIX termios" >&5
4472 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4473   echo $ac_n "(cached) $ac_c" 1>&6
4474 else
4475   cat > conftest.$ac_ext <<EOF
4476 #line 4477 "configure"
4477 #include "confdefs.h"
4478 #include <sys/types.h>
4479 #include <unistd.h>
4480 #include <termios.h>
4481 int main() {
4482 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4483    tcgetattr(0, 0);
4484 ; return 0; }
4485 EOF
4486 if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4487   rm -rf conftest*
4488   am_cv_sys_posix_termios=yes
4489 else
4490   echo "configure: failed program was:" >&5
4491   cat conftest.$ac_ext >&5
4492   rm -rf conftest*
4493   am_cv_sys_posix_termios=no
4494 fi
4495 rm -f conftest*
4496 fi
4497
4498 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4499
4500
4501  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4502 echo "configure:4503: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4503 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4504   echo $ac_n "(cached) $ac_c" 1>&6
4505 else
4506   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4507
4508   gwinsz_in_termios_h=no
4509   if test $am_cv_sys_posix_termios = yes; then
4510     cat > conftest.$ac_ext <<EOF
4511 #line 4512 "configure"
4512 #include "confdefs.h"
4513 #include <sys/types.h>
4514 #     include <termios.h>
4515 #     ifdef TIOCGWINSZ
4516         yes
4517 #     endif
4518     
4519 EOF
4520 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4521   egrep "yes" >/dev/null 2>&1; then
4522   rm -rf conftest*
4523   gwinsz_in_termios_h=yes
4524 fi
4525 rm -f conftest*
4526
4527   fi
4528
4529   if test $gwinsz_in_termios_h = no; then
4530     cat > conftest.$ac_ext <<EOF
4531 #line 4532 "configure"
4532 #include "confdefs.h"
4533 #include <sys/types.h>
4534 #     include <sys/ioctl.h>
4535 #     ifdef TIOCGWINSZ
4536         yes
4537 #     endif
4538     
4539 EOF
4540 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4541   egrep "yes" >/dev/null 2>&1; then
4542   rm -rf conftest*
4543   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4544 fi
4545 rm -f conftest*
4546
4547   fi
4548   
4549 fi
4550
4551 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4552   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4553     cat >> confdefs.h <<\EOF
4554 #define GWINSZ_IN_SYS_IOCTL 1
4555 EOF
4556
4557   fi
4558
4559 if test $am_cv_sys_posix_termios = yes ; then
4560         cat >> confdefs.h <<\EOF
4561 #define HAVE_POSIX_TERMIOS 1
4562 EOF
4563
4564 fi
4565
4566 for ac_hdr in \
4567         arpa/inet.h             \
4568         arpa/nameser.h  \
4569         assert.h                \
4570         conio.h                 \
4571         crypt.h                 \
4572         direct.h                \
4573         errno.h                 \
4574         fcntl.h                 \
4575         filio.h                 \
4576         getopt.h                \
4577         grp.h                   \
4578         io.h                    \
4579         libutil.h               \
4580         limits.h                \
4581         locale.h                \
4582         netinet/tcp.h   \
4583         malloc.h                \
4584         memory.h                \
4585         psap.h                  \
4586         pwd.h                   \
4587         process.h               \
4588         resolv.h                \
4589         sgtty.h                 \
4590         shadow.h                \
4591         stddef.h                \
4592         string.h                \
4593         strings.h               \
4594         sysexits.h              \
4595         sys/file.h              \
4596         sys/filio.h             \
4597         sys/errno.h             \
4598         sys/ioctl.h             \
4599         sys/param.h             \
4600         sys/resource.h  \
4601         sys/select.h    \
4602         sys/socket.h    \
4603         sys/syslog.h    \
4604         sys/time.h              \
4605         sys/types.h             \
4606         syslog.h                \
4607         termios.h               \
4608         unistd.h                \
4609         winsock.h               \
4610
4611 do
4612 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4613 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4614 echo "configure:4615: checking for $ac_hdr" >&5
4615 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4616   echo $ac_n "(cached) $ac_c" 1>&6
4617 else
4618   cat > conftest.$ac_ext <<EOF
4619 #line 4620 "configure"
4620 #include "confdefs.h"
4621 #include <$ac_hdr>
4622 EOF
4623 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4624 { (eval echo configure:4625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4625 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4626 if test -z "$ac_err"; then
4627   rm -rf conftest*
4628   eval "ac_cv_header_$ac_safe=yes"
4629 else
4630   echo "$ac_err" >&5
4631   echo "configure: failed program was:" >&5
4632   cat conftest.$ac_ext >&5
4633   rm -rf conftest*
4634   eval "ac_cv_header_$ac_safe=no"
4635 fi
4636 rm -f conftest*
4637 fi
4638 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4639   echo "$ac_t""yes" 1>&6
4640     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4641   cat >> confdefs.h <<EOF
4642 #define $ac_tr_hdr 1
4643 EOF
4644  
4645 else
4646   echo "$ac_t""no" 1>&6
4647 fi
4648 done
4649
4650
4651
4652
4653 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4654 echo "configure:4655: checking for sigset in -lV3" >&5
4655 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4656 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4657   echo $ac_n "(cached) $ac_c" 1>&6
4658 else
4659   ac_save_LIBS="$LIBS"
4660 LIBS="-lV3  $LIBS"
4661 cat > conftest.$ac_ext <<EOF
4662 #line 4663 "configure"
4663 #include "confdefs.h"
4664 /* Override any gcc2 internal prototype to avoid an error.  */
4665 /* We use char because int might match the return type of a gcc2
4666     builtin and then its argument prototype would still apply.  */
4667 char sigset();
4668
4669 int main() {
4670 sigset()
4671 ; return 0; }
4672 EOF
4673 if { (eval echo configure:4674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4674   rm -rf conftest*
4675   eval "ac_cv_lib_$ac_lib_var=yes"
4676 else
4677   echo "configure: failed program was:" >&5
4678   cat conftest.$ac_ext >&5
4679   rm -rf conftest*
4680   eval "ac_cv_lib_$ac_lib_var=no"
4681 fi
4682 rm -f conftest*
4683 LIBS="$ac_save_LIBS"
4684
4685 fi
4686 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4687   echo "$ac_t""yes" 1>&6
4688     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4689     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4690   cat >> confdefs.h <<EOF
4691 #define $ac_tr_lib 1
4692 EOF
4693
4694   LIBS="-lV3 $LIBS"
4695
4696 else
4697   echo "$ac_t""no" 1>&6
4698 fi
4699
4700
4701 if test $ac_cv_header_winsock_h = yes; then
4702         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4703 echo "configure:4704: checking for winsock" >&5
4704 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4705   echo $ac_n "(cached) $ac_c" 1>&6
4706 else
4707   cat > conftest.$ac_ext <<EOF
4708 #line 4709 "configure"
4709 #include "confdefs.h"
4710 #include <winsock.h>
4711 int main() {
4712
4713                         socket(0,0,0);
4714                         select(0,NULL,NULL,NULL,NULL);
4715                         closesocket(0);
4716                         gethostname(NULL,0);
4717         
4718 ; return 0; }
4719 EOF
4720 if { (eval echo configure:4721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4721   rm -rf conftest*
4722   ol_cv_winsock=yes
4723 else
4724   echo "configure: failed program was:" >&5
4725   cat conftest.$ac_ext >&5
4726   rm -rf conftest*
4727   ol_cv_winsock=no
4728 fi
4729 rm -f conftest*]
4730 fi
4731
4732 echo "$ac_t""$ol_cv_winsock" 1>&6
4733
4734         if test $ol_cv_winsock = yes ; then
4735                 cat >> confdefs.h <<\EOF
4736 #define HAVE_WINSOCK 1
4737 EOF
4738
4739                 ac_cv_func_socket=yes
4740                 ac_cv_func_select=yes
4741                 ac_cv_func_closesocket=yes
4742                 ac_cv_func_gethostname=yes
4743         fi
4744 fi
4745
4746
4747 echo $ac_n "checking for socket""... $ac_c" 1>&6
4748 echo "configure:4749: checking for socket" >&5
4749 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4750   echo $ac_n "(cached) $ac_c" 1>&6
4751 else
4752   cat > conftest.$ac_ext <<EOF
4753 #line 4754 "configure"
4754 #include "confdefs.h"
4755 /* System header to define __stub macros and hopefully few prototypes,
4756     which can conflict with char socket(); below.  */
4757 #include <assert.h>
4758 /* Override any gcc2 internal prototype to avoid an error.  */
4759 /* We use char because int might match the return type of a gcc2
4760     builtin and then its argument prototype would still apply.  */
4761 char socket();
4762 char (*f)();
4763
4764 int main() {
4765
4766 /* The GNU C library defines this for functions which it implements
4767     to always fail with ENOSYS.  Some functions are actually named
4768     something starting with __ and the normal name is an alias.  */
4769 #if defined (__stub_socket) || defined (__stub___socket)
4770 choke me
4771 #else
4772 f = socket;
4773 #endif
4774
4775 ; return 0; }
4776 EOF
4777 if { (eval echo configure:4778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4778   rm -rf conftest*
4779   eval "ac_cv_func_socket=yes"
4780 else
4781   echo "configure: failed program was:" >&5
4782   cat conftest.$ac_ext >&5
4783   rm -rf conftest*
4784   eval "ac_cv_func_socket=no"
4785 fi
4786 rm -f conftest*
4787 fi
4788
4789 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4790   echo "$ac_t""yes" 1>&6
4791   :
4792 else
4793   echo "$ac_t""no" 1>&6
4794         
4795         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4796 echo "configure:4797: checking for main in -lsocket" >&5
4797 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4798 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4799   echo $ac_n "(cached) $ac_c" 1>&6
4800 else
4801   ac_save_LIBS="$LIBS"
4802 LIBS="-lsocket  $LIBS"
4803 cat > conftest.$ac_ext <<EOF
4804 #line 4805 "configure"
4805 #include "confdefs.h"
4806
4807 int main() {
4808 main()
4809 ; return 0; }
4810 EOF
4811 if { (eval echo configure:4812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4812   rm -rf conftest*
4813   eval "ac_cv_lib_$ac_lib_var=yes"
4814 else
4815   echo "configure: failed program was:" >&5
4816   cat conftest.$ac_ext >&5
4817   rm -rf conftest*
4818   eval "ac_cv_lib_$ac_lib_var=no"
4819 fi
4820 rm -f conftest*
4821 LIBS="$ac_save_LIBS"
4822
4823 fi
4824 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4825   echo "$ac_t""yes" 1>&6
4826     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4827     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4828   cat >> confdefs.h <<EOF
4829 #define $ac_tr_lib 1
4830 EOF
4831
4832   LIBS="-lsocket $LIBS"
4833
4834 else
4835   echo "$ac_t""no" 1>&6
4836 fi
4837
4838         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4839 echo "configure:4840: checking for main in -lnet" >&5
4840 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4841 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4842   echo $ac_n "(cached) $ac_c" 1>&6
4843 else
4844   ac_save_LIBS="$LIBS"
4845 LIBS="-lnet  $LIBS"
4846 cat > conftest.$ac_ext <<EOF
4847 #line 4848 "configure"
4848 #include "confdefs.h"
4849
4850 int main() {
4851 main()
4852 ; return 0; }
4853 EOF
4854 if { (eval echo configure:4855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4855   rm -rf conftest*
4856   eval "ac_cv_lib_$ac_lib_var=yes"
4857 else
4858   echo "configure: failed program was:" >&5
4859   cat conftest.$ac_ext >&5
4860   rm -rf conftest*
4861   eval "ac_cv_lib_$ac_lib_var=no"
4862 fi
4863 rm -f conftest*
4864 LIBS="$ac_save_LIBS"
4865
4866 fi
4867 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4868   echo "$ac_t""yes" 1>&6
4869     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4870     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4871   cat >> confdefs.h <<EOF
4872 #define $ac_tr_lib 1
4873 EOF
4874
4875   LIBS="-lnet $LIBS"
4876
4877 else
4878   echo "$ac_t""no" 1>&6
4879 fi
4880
4881         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4882 echo "configure:4883: checking for main in -lnsl_s" >&5
4883 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4884 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4885   echo $ac_n "(cached) $ac_c" 1>&6
4886 else
4887   ac_save_LIBS="$LIBS"
4888 LIBS="-lnsl_s  $LIBS"
4889 cat > conftest.$ac_ext <<EOF
4890 #line 4891 "configure"
4891 #include "confdefs.h"
4892
4893 int main() {
4894 main()
4895 ; return 0; }
4896 EOF
4897 if { (eval echo configure:4898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4898   rm -rf conftest*
4899   eval "ac_cv_lib_$ac_lib_var=yes"
4900 else
4901   echo "configure: failed program was:" >&5
4902   cat conftest.$ac_ext >&5
4903   rm -rf conftest*
4904   eval "ac_cv_lib_$ac_lib_var=no"
4905 fi
4906 rm -f conftest*
4907 LIBS="$ac_save_LIBS"
4908
4909 fi
4910 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4911   echo "$ac_t""yes" 1>&6
4912     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4913     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4914   cat >> confdefs.h <<EOF
4915 #define $ac_tr_lib 1
4916 EOF
4917
4918   LIBS="-lnsl_s $LIBS"
4919
4920 else
4921   echo "$ac_t""no" 1>&6
4922 fi
4923
4924         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4925 echo "configure:4926: checking for main in -lnsl" >&5
4926 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4927 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4928   echo $ac_n "(cached) $ac_c" 1>&6
4929 else
4930   ac_save_LIBS="$LIBS"
4931 LIBS="-lnsl  $LIBS"
4932 cat > conftest.$ac_ext <<EOF
4933 #line 4934 "configure"
4934 #include "confdefs.h"
4935
4936 int main() {
4937 main()
4938 ; return 0; }
4939 EOF
4940 if { (eval echo configure:4941: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4941   rm -rf conftest*
4942   eval "ac_cv_lib_$ac_lib_var=yes"
4943 else
4944   echo "configure: failed program was:" >&5
4945   cat conftest.$ac_ext >&5
4946   rm -rf conftest*
4947   eval "ac_cv_lib_$ac_lib_var=no"
4948 fi
4949 rm -f conftest*
4950 LIBS="$ac_save_LIBS"
4951
4952 fi
4953 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4954   echo "$ac_t""yes" 1>&6
4955     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4956     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4957   cat >> confdefs.h <<EOF
4958 #define $ac_tr_lib 1
4959 EOF
4960
4961   LIBS="-lnsl $LIBS"
4962
4963 else
4964   echo "$ac_t""no" 1>&6
4965 fi
4966
4967         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4968 echo "configure:4969: checking for socket in -linet" >&5
4969 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4970 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4971   echo $ac_n "(cached) $ac_c" 1>&6
4972 else
4973   ac_save_LIBS="$LIBS"
4974 LIBS="-linet  $LIBS"
4975 cat > conftest.$ac_ext <<EOF
4976 #line 4977 "configure"
4977 #include "confdefs.h"
4978 /* Override any gcc2 internal prototype to avoid an error.  */
4979 /* We use char because int might match the return type of a gcc2
4980     builtin and then its argument prototype would still apply.  */
4981 char socket();
4982
4983 int main() {
4984 socket()
4985 ; return 0; }
4986 EOF
4987 if { (eval echo configure:4988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4988   rm -rf conftest*
4989   eval "ac_cv_lib_$ac_lib_var=yes"
4990 else
4991   echo "configure: failed program was:" >&5
4992   cat conftest.$ac_ext >&5
4993   rm -rf conftest*
4994   eval "ac_cv_lib_$ac_lib_var=no"
4995 fi
4996 rm -f conftest*
4997 LIBS="$ac_save_LIBS"
4998
4999 fi
5000 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5001   echo "$ac_t""yes" 1>&6
5002     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5003     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5004   cat >> confdefs.h <<EOF
5005 #define $ac_tr_lib 1
5006 EOF
5007
5008   LIBS="-linet $LIBS"
5009
5010 else
5011   echo "$ac_t""no" 1>&6
5012 fi
5013
5014         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
5015 echo "configure:5016: checking for main in -lgen" >&5
5016 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
5017 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5018   echo $ac_n "(cached) $ac_c" 1>&6
5019 else
5020   ac_save_LIBS="$LIBS"
5021 LIBS="-lgen  $LIBS"
5022 cat > conftest.$ac_ext <<EOF
5023 #line 5024 "configure"
5024 #include "confdefs.h"
5025
5026 int main() {
5027 main()
5028 ; return 0; }
5029 EOF
5030 if { (eval echo configure:5031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5031   rm -rf conftest*
5032   eval "ac_cv_lib_$ac_lib_var=yes"
5033 else
5034   echo "configure: failed program was:" >&5
5035   cat conftest.$ac_ext >&5
5036   rm -rf conftest*
5037   eval "ac_cv_lib_$ac_lib_var=no"
5038 fi
5039 rm -f conftest*
5040 LIBS="$ac_save_LIBS"
5041
5042 fi
5043 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5044   echo "$ac_t""yes" 1>&6
5045     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5046     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5047   cat >> confdefs.h <<EOF
5048 #define $ac_tr_lib 1
5049 EOF
5050
5051   LIBS="-lgen $LIBS"
5052
5053 else
5054   echo "$ac_t""no" 1>&6
5055 fi
5056
5057
5058 fi
5059
5060
5061 echo $ac_n "checking for select""... $ac_c" 1>&6
5062 echo "configure:5063: checking for select" >&5
5063 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
5064   echo $ac_n "(cached) $ac_c" 1>&6
5065 else
5066   cat > conftest.$ac_ext <<EOF
5067 #line 5068 "configure"
5068 #include "confdefs.h"
5069 /* System header to define __stub macros and hopefully few prototypes,
5070     which can conflict with char select(); below.  */
5071 #include <assert.h>
5072 /* Override any gcc2 internal prototype to avoid an error.  */
5073 /* We use char because int might match the return type of a gcc2
5074     builtin and then its argument prototype would still apply.  */
5075 char select();
5076 char (*f)();
5077
5078 int main() {
5079
5080 /* The GNU C library defines this for functions which it implements
5081     to always fail with ENOSYS.  Some functions are actually named
5082     something starting with __ and the normal name is an alias.  */
5083 #if defined (__stub_select) || defined (__stub___select)
5084 choke me
5085 #else
5086 f = select;
5087 #endif
5088
5089 ; return 0; }
5090 EOF
5091 if { (eval echo configure:5092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5092   rm -rf conftest*
5093   eval "ac_cv_func_select=yes"
5094 else
5095   echo "configure: failed program was:" >&5
5096   cat conftest.$ac_ext >&5
5097   rm -rf conftest*
5098   eval "ac_cv_func_select=no"
5099 fi
5100 rm -f conftest*
5101 fi
5102
5103 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5104   echo "$ac_t""yes" 1>&6
5105   :
5106 else
5107   echo "$ac_t""no" 1>&6
5108 { echo "configure: error: select() required." 1>&2; exit 1; }
5109 fi
5110
5111
5112 if test "${ac_cv_header_winsock_h}" != yes; then
5113                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5114 echo "configure:5115: checking types of arguments for select()" >&5
5115  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5116   echo $ac_n "(cached) $ac_c" 1>&6
5117 else
5118    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5119   echo $ac_n "(cached) $ac_c" 1>&6
5120 else
5121     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5122   echo $ac_n "(cached) $ac_c" 1>&6
5123 else
5124      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5125      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5126       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5127        cat > conftest.$ac_ext <<EOF
5128 #line 5129 "configure"
5129 #include "confdefs.h"
5130 #ifdef HAVE_SYS_TYPES_H
5131 #include <sys/types.h>
5132 #endif
5133 #ifdef HAVE_SYS_TIME_H
5134 #include <sys/time.h>
5135 #endif
5136 #ifdef HAVE_SYS_SELECT_H
5137 #include <sys/select.h>
5138 #endif
5139 #ifdef HAVE_SYS_SOCKET_H
5140 #include <sys/socket.h>
5141 #endif
5142 extern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);
5143 int main() {
5144
5145 ; return 0; }
5146 EOF
5147 if { (eval echo configure:5148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5148   rm -rf conftest*
5149           ac_not_found=no ; break 3
5150 else
5151   echo "configure: failed program was:" >&5
5152   cat conftest.$ac_ext >&5
5153   rm -rf conftest*
5154   ac_not_found=yes
5155 fi
5156 rm -f conftest*
5157       done
5158      done
5159     done
5160    
5161 fi
5162   
5163 fi
5164  
5165 fi
5166  if test "$ac_not_found" = yes; then
5167   ac_cv_func_select_arg1=int 
5168   ac_cv_func_select_arg234='int *' 
5169   ac_cv_func_select_arg5='struct timeval *'
5170  fi
5171  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5172  cat >> confdefs.h <<EOF
5173 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5174 EOF
5175
5176  cat >> confdefs.h <<EOF
5177 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5178 EOF
5179
5180  cat >> confdefs.h <<EOF
5181 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5182 EOF
5183
5184
5185 fi
5186
5187
5188 for ac_hdr in regex.h 
5189 do
5190 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5191 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5192 echo "configure:5193: checking for $ac_hdr" >&5
5193 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5194   echo $ac_n "(cached) $ac_c" 1>&6
5195 else
5196   cat > conftest.$ac_ext <<EOF
5197 #line 5198 "configure"
5198 #include "confdefs.h"
5199 #include <$ac_hdr>
5200 EOF
5201 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5202 { (eval echo configure:5203: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5203 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5204 if test -z "$ac_err"; then
5205   rm -rf conftest*
5206   eval "ac_cv_header_$ac_safe=yes"
5207 else
5208   echo "$ac_err" >&5
5209   echo "configure: failed program was:" >&5
5210   cat conftest.$ac_ext >&5
5211   rm -rf conftest*
5212   eval "ac_cv_header_$ac_safe=no"
5213 fi
5214 rm -f conftest*
5215 fi
5216 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5217   echo "$ac_t""yes" 1>&6
5218     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5219   cat >> confdefs.h <<EOF
5220 #define $ac_tr_hdr 1
5221 EOF
5222  
5223 else
5224   echo "$ac_t""no" 1>&6
5225 fi
5226 done
5227
5228 if test "$ac_cv_header_regex_h" != yes ; then
5229         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5230 fi
5231 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5232 echo "configure:5233: checking for regfree" >&5
5233 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5234   echo $ac_n "(cached) $ac_c" 1>&6
5235 else
5236   cat > conftest.$ac_ext <<EOF
5237 #line 5238 "configure"
5238 #include "confdefs.h"
5239 /* System header to define __stub macros and hopefully few prototypes,
5240     which can conflict with char regfree(); below.  */
5241 #include <assert.h>
5242 /* Override any gcc2 internal prototype to avoid an error.  */
5243 /* We use char because int might match the return type of a gcc2
5244     builtin and then its argument prototype would still apply.  */
5245 char regfree();
5246 char (*f)();
5247
5248 int main() {
5249
5250 /* The GNU C library defines this for functions which it implements
5251     to always fail with ENOSYS.  Some functions are actually named
5252     something starting with __ and the normal name is an alias.  */
5253 #if defined (__stub_regfree) || defined (__stub___regfree)
5254 choke me
5255 #else
5256 f = regfree;
5257 #endif
5258
5259 ; return 0; }
5260 EOF
5261 if { (eval echo configure:5262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5262   rm -rf conftest*
5263   eval "ac_cv_func_regfree=yes"
5264 else
5265   echo "configure: failed program was:" >&5
5266   cat conftest.$ac_ext >&5
5267   rm -rf conftest*
5268   eval "ac_cv_func_regfree=no"
5269 fi
5270 rm -f conftest*
5271 fi
5272
5273 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5274   echo "$ac_t""yes" 1>&6
5275   :
5276 else
5277   echo "$ac_t""no" 1>&6
5278 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5279 fi
5280
5281
5282
5283 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5284 echo "configure:5285: checking for compatible POSIX regex" >&5
5285 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5286   echo $ac_n "(cached) $ac_c" 1>&6
5287 else
5288   
5289         if test "$cross_compiling" = yes; then
5290   ol_cv_c_posix_regex=cross
5291 else
5292   cat > conftest.$ac_ext <<EOF
5293 #line 5294 "configure"
5294 #include "confdefs.h"
5295
5296 #include <sys/types.h>
5297 #include <regex.h>
5298 static char *pattern, *string;
5299 main()
5300 {
5301         int rc;
5302         regex_t re;
5303
5304         pattern = "^A";
5305
5306         if(regcomp(&re, pattern, 0)) {
5307                 return -1;
5308         }
5309         
5310         string = "ALL MATCH";
5311         
5312         rc = regexec(&re, string, 0, (void*)0, 0);
5313
5314         regfree(&re);
5315
5316         return rc;
5317 }
5318 EOF
5319 if { (eval echo configure:5320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5320 then
5321   ol_cv_c_posix_regex=yes
5322 else
5323   echo "configure: failed program was:" >&5
5324   cat conftest.$ac_ext >&5
5325   rm -fr conftest*
5326   ol_cv_c_posix_regex=no
5327 fi
5328 rm -fr conftest*
5329 fi
5330
5331 fi
5332
5333 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5334
5335 if test "$ol_cv_c_posix_regex" = no ; then
5336         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5337 fi
5338
5339 ol_link_dnssrv=no
5340 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5341 echo "configure:5342: checking for res_query" >&5
5342 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5343   echo $ac_n "(cached) $ac_c" 1>&6
5344 else
5345   cat > conftest.$ac_ext <<EOF
5346 #line 5347 "configure"
5347 #include "confdefs.h"
5348 /* System header to define __stub macros and hopefully few prototypes,
5349     which can conflict with char res_query(); below.  */
5350 #include <assert.h>
5351 /* Override any gcc2 internal prototype to avoid an error.  */
5352 /* We use char because int might match the return type of a gcc2
5353     builtin and then its argument prototype would still apply.  */
5354 char res_query();
5355 char (*f)();
5356
5357 int main() {
5358
5359 /* The GNU C library defines this for functions which it implements
5360     to always fail with ENOSYS.  Some functions are actually named
5361     something starting with __ and the normal name is an alias.  */
5362 #if defined (__stub_res_query) || defined (__stub___res_query)
5363 choke me
5364 #else
5365 f = res_query;
5366 #endif
5367
5368 ; return 0; }
5369 EOF
5370 if { (eval echo configure:5371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5371   rm -rf conftest*
5372   eval "ac_cv_func_res_query=yes"
5373 else
5374   echo "configure: failed program was:" >&5
5375   cat conftest.$ac_ext >&5
5376   rm -rf conftest*
5377   eval "ac_cv_func_res_query=no"
5378 fi
5379 rm -f conftest*
5380 fi
5381
5382 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5383   echo "$ac_t""yes" 1>&6
5384   :
5385 else
5386   echo "$ac_t""no" 1>&6
5387 fi
5388
5389 if test $ac_cv_func_res_query = no ; then 
5390         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5391 echo "configure:5392: checking for res_query in -lbind" >&5
5392 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5393 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5394   echo $ac_n "(cached) $ac_c" 1>&6
5395 else
5396   ac_save_LIBS="$LIBS"
5397 LIBS="-lbind  $LIBS"
5398 cat > conftest.$ac_ext <<EOF
5399 #line 5400 "configure"
5400 #include "confdefs.h"
5401 /* Override any gcc2 internal prototype to avoid an error.  */
5402 /* We use char because int might match the return type of a gcc2
5403     builtin and then its argument prototype would still apply.  */
5404 char res_query();
5405
5406 int main() {
5407 res_query()
5408 ; return 0; }
5409 EOF
5410 if { (eval echo configure:5411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5411   rm -rf conftest*
5412   eval "ac_cv_lib_$ac_lib_var=yes"
5413 else
5414   echo "configure: failed program was:" >&5
5415   cat conftest.$ac_ext >&5
5416   rm -rf conftest*
5417   eval "ac_cv_lib_$ac_lib_var=no"
5418 fi
5419 rm -f conftest*
5420 LIBS="$ac_save_LIBS"
5421
5422 fi
5423 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5424   echo "$ac_t""yes" 1>&6
5425     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5426     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5427   cat >> confdefs.h <<EOF
5428 #define $ac_tr_lib 1
5429 EOF
5430
5431   LIBS="-lbind $LIBS"
5432
5433 else
5434   echo "$ac_t""no" 1>&6
5435 fi
5436
5437         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5438 fi
5439
5440 if test $ac_cv_func_res_query = no ; then 
5441         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5442 echo "configure:5443: checking for __res_query in -lbind" >&5
5443 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5444 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5445   echo $ac_n "(cached) $ac_c" 1>&6
5446 else
5447   ac_save_LIBS="$LIBS"
5448 LIBS="-lbind  $LIBS"
5449 cat > conftest.$ac_ext <<EOF
5450 #line 5451 "configure"
5451 #include "confdefs.h"
5452 /* Override any gcc2 internal prototype to avoid an error.  */
5453 /* We use char because int might match the return type of a gcc2
5454     builtin and then its argument prototype would still apply.  */
5455 char __res_query();
5456
5457 int main() {
5458 __res_query()
5459 ; return 0; }
5460 EOF
5461 if { (eval echo configure:5462: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5462   rm -rf conftest*
5463   eval "ac_cv_lib_$ac_lib_var=yes"
5464 else
5465   echo "configure: failed program was:" >&5
5466   cat conftest.$ac_ext >&5
5467   rm -rf conftest*
5468   eval "ac_cv_lib_$ac_lib_var=no"
5469 fi
5470 rm -f conftest*
5471 LIBS="$ac_save_LIBS"
5472
5473 fi
5474 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5475   echo "$ac_t""yes" 1>&6
5476     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5477     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5478   cat >> confdefs.h <<EOF
5479 #define $ac_tr_lib 1
5480 EOF
5481
5482   LIBS="-lbind $LIBS"
5483
5484 else
5485   echo "$ac_t""no" 1>&6
5486 fi
5487
5488         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5489 fi
5490
5491 if test $ac_cv_func_res_query = no ; then 
5492         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5493 echo "configure:5494: checking for res_query in -lresolv" >&5
5494 ac_lib_var=`echo resolv'_'res_query | sed 'y%./+-:%__p__%'`
5495 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5496   echo $ac_n "(cached) $ac_c" 1>&6
5497 else
5498   ac_save_LIBS="$LIBS"
5499 LIBS="-lresolv  $LIBS"
5500 cat > conftest.$ac_ext <<EOF
5501 #line 5502 "configure"
5502 #include "confdefs.h"
5503 /* Override any gcc2 internal prototype to avoid an error.  */
5504 /* We use char because int might match the return type of a gcc2
5505     builtin and then its argument prototype would still apply.  */
5506 char res_query();
5507
5508 int main() {
5509 res_query()
5510 ; return 0; }
5511 EOF
5512 if { (eval echo configure:5513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5513   rm -rf conftest*
5514   eval "ac_cv_lib_$ac_lib_var=yes"
5515 else
5516   echo "configure: failed program was:" >&5
5517   cat conftest.$ac_ext >&5
5518   rm -rf conftest*
5519   eval "ac_cv_lib_$ac_lib_var=no"
5520 fi
5521 rm -f conftest*
5522 LIBS="$ac_save_LIBS"
5523
5524 fi
5525 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5526   echo "$ac_t""yes" 1>&6
5527     ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5528     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5529   cat >> confdefs.h <<EOF
5530 #define $ac_tr_lib 1
5531 EOF
5532
5533   LIBS="-lresolv $LIBS"
5534
5535 else
5536   echo "$ac_t""no" 1>&6
5537 fi
5538
5539         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5540 fi
5541
5542 if test "$ac_cv_func_res_query" = yes ; then
5543         cat >> confdefs.h <<\EOF
5544 #define HAVE_RES_QUERY 1
5545 EOF
5546
5547
5548         if test $ol_enable_dnssrv != no ; then
5549                 ol_link_dnssrv=yes
5550         fi
5551 fi
5552
5553 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5554         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5555 fi
5556
5557 if test $ol_enable_quipu != no ; then
5558         for ac_hdr in quipu/commonarg.h
5559 do
5560 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5561 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5562 echo "configure:5563: checking for $ac_hdr" >&5
5563 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5564   echo $ac_n "(cached) $ac_c" 1>&6
5565 else
5566   cat > conftest.$ac_ext <<EOF
5567 #line 5568 "configure"
5568 #include "confdefs.h"
5569 #include <$ac_hdr>
5570 EOF
5571 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5572 { (eval echo configure:5573: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5573 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5574 if test -z "$ac_err"; then
5575   rm -rf conftest*
5576   eval "ac_cv_header_$ac_safe=yes"
5577 else
5578   echo "$ac_err" >&5
5579   echo "configure: failed program was:" >&5
5580   cat conftest.$ac_ext >&5
5581   rm -rf conftest*
5582   eval "ac_cv_header_$ac_safe=no"
5583 fi
5584 rm -f conftest*
5585 fi
5586 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5587   echo "$ac_t""yes" 1>&6
5588     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5589   cat >> confdefs.h <<EOF
5590 #define $ac_tr_hdr 1
5591 EOF
5592  
5593 else
5594   echo "$ac_t""no" 1>&6
5595 fi
5596 done
5597
5598
5599         if test $ac_cv_header_quipu_commonarg_h = yes ; then
5600                 BUILD_QUIPU=yes
5601         elif test $ol_enable_quipu = auto ; then
5602                 echo "configure: warning: no quipu for --enable-quipu=auto, disabling" 1>&2
5603         else
5604                 { echo "configure: error: no quipu for --enable-quipu=$ol_enable_quipu" 1>&2; exit 1; }
5605         fi
5606 fi
5607
5608 ol_link_kbind=no
5609 ol_link_kpasswd=no
5610 ol_link_krb5=no
5611 ol_link_krb4=no
5612
5613 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k5 \
5614         -o $ol_with_kerberos = k5only -o $ol_with_kerberos = k425 ; then
5615
5616         for ac_hdr in krb5.h
5617 do
5618 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5619 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5620 echo "configure:5621: checking for $ac_hdr" >&5
5621 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5622   echo $ac_n "(cached) $ac_c" 1>&6
5623 else
5624   cat > conftest.$ac_ext <<EOF
5625 #line 5626 "configure"
5626 #include "confdefs.h"
5627 #include <$ac_hdr>
5628 EOF
5629 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5630 { (eval echo configure:5631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5631 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5632 if test -z "$ac_err"; then
5633   rm -rf conftest*
5634   eval "ac_cv_header_$ac_safe=yes"
5635 else
5636   echo "$ac_err" >&5
5637   echo "configure: failed program was:" >&5
5638   cat conftest.$ac_ext >&5
5639   rm -rf conftest*
5640   eval "ac_cv_header_$ac_safe=no"
5641 fi
5642 rm -f conftest*
5643 fi
5644 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5645   echo "$ac_t""yes" 1>&6
5646     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5647   cat >> confdefs.h <<EOF
5648 #define $ac_tr_hdr 1
5649 EOF
5650  
5651 else
5652   echo "$ac_t""no" 1>&6
5653 fi
5654 done
5655
5656
5657         if test $ac_cv_header_krb5_h = yes ; then
5658                                 for ac_hdr in heim_err.h
5659 do
5660 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5661 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5662 echo "configure:5663: checking for $ac_hdr" >&5
5663 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5664   echo $ac_n "(cached) $ac_c" 1>&6
5665 else
5666   cat > conftest.$ac_ext <<EOF
5667 #line 5668 "configure"
5668 #include "confdefs.h"
5669 #include <$ac_hdr>
5670 EOF
5671 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5672 { (eval echo configure:5673: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5673 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5674 if test -z "$ac_err"; then
5675   rm -rf conftest*
5676   eval "ac_cv_header_$ac_safe=yes"
5677 else
5678   echo "$ac_err" >&5
5679   echo "configure: failed program was:" >&5
5680   cat conftest.$ac_ext >&5
5681   rm -rf conftest*
5682   eval "ac_cv_header_$ac_safe=no"
5683 fi
5684 rm -f conftest*
5685 fi
5686 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5687   echo "$ac_t""yes" 1>&6
5688     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5689   cat >> confdefs.h <<EOF
5690 #define $ac_tr_hdr 1
5691 EOF
5692  
5693 else
5694   echo "$ac_t""no" 1>&6
5695 fi
5696 done
5697
5698                 if test $ac_cv_header_heim_err_h = yes ; then
5699                         krb5_impl=heimdal
5700                 else
5701                         krb5_impl=mit
5702                 fi
5703
5704                 if test $krb5_impl = mit; then
5705                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5706 echo "configure:5707: checking for main in -lkrb5" >&5
5707 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5708 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5709   echo $ac_n "(cached) $ac_c" 1>&6
5710 else
5711   ac_save_LIBS="$LIBS"
5712 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
5713 cat > conftest.$ac_ext <<EOF
5714 #line 5715 "configure"
5715 #include "confdefs.h"
5716
5717 int main() {
5718 main()
5719 ; return 0; }
5720 EOF
5721 if { (eval echo configure:5722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5722   rm -rf conftest*
5723   eval "ac_cv_lib_$ac_lib_var=yes"
5724 else
5725   echo "configure: failed program was:" >&5
5726   cat conftest.$ac_ext >&5
5727   rm -rf conftest*
5728   eval "ac_cv_lib_$ac_lib_var=no"
5729 fi
5730 rm -f conftest*
5731 LIBS="$ac_save_LIBS"
5732
5733 fi
5734 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5735   echo "$ac_t""yes" 1>&6
5736   have_krb5=yes
5737                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
5738 else
5739   echo "$ac_t""no" 1>&6
5740 have_krb5=no
5741 fi
5742
5743
5744                 elif test $krb5_impl = heimdal; then
5745                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5746 echo "configure:5747: checking for main in -lkrb5" >&5
5747 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5748 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5749   echo $ac_n "(cached) $ac_c" 1>&6
5750 else
5751   ac_save_LIBS="$LIBS"
5752 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5753 cat > conftest.$ac_ext <<EOF
5754 #line 5755 "configure"
5755 #include "confdefs.h"
5756
5757 int main() {
5758 main()
5759 ; return 0; }
5760 EOF
5761 if { (eval echo configure:5762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5762   rm -rf conftest*
5763   eval "ac_cv_lib_$ac_lib_var=yes"
5764 else
5765   echo "configure: failed program was:" >&5
5766   cat conftest.$ac_ext >&5
5767   rm -rf conftest*
5768   eval "ac_cv_lib_$ac_lib_var=no"
5769 fi
5770 rm -f conftest*
5771 LIBS="$ac_save_LIBS"
5772
5773 fi
5774 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5775   echo "$ac_t""yes" 1>&6
5776   have_krb5=yes
5777                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
5778 else
5779   echo "$ac_t""no" 1>&6
5780 have_krb5=no
5781 fi
5782
5783
5784                         cat >> confdefs.h <<\EOF
5785 #define HAVE_HEIMDAL_KERBEROS 1
5786 EOF
5787
5788                 else
5789                         have_krb5=no
5790                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5791                 fi
5792
5793                 if test $have_krb5 = yes ; then
5794                         ol_link_krb5=yes
5795
5796                         cat >> confdefs.h <<\EOF
5797 #define HAVE_KRB5 1
5798 EOF
5799
5800
5801                         if test $ol_enable_kpasswd != no ; then
5802                                 ol_link_kpasswd=yes;
5803                         fi
5804
5805                         if test $ol_with_kerberos = k5only ; then
5806                                 ol_with_kerberos=found
5807                         fi
5808
5809                 elif test $ol_with_kerberos != auto ; then
5810                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
5811                 fi
5812
5813         fi
5814 fi
5815
5816 if test $ol_link_krb5 = yes -a \
5817         \( $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
5818
5819         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5820 do
5821 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5822 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5823 echo "configure:5824: checking for $ac_hdr" >&5
5824 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5825   echo $ac_n "(cached) $ac_c" 1>&6
5826 else
5827   cat > conftest.$ac_ext <<EOF
5828 #line 5829 "configure"
5829 #include "confdefs.h"
5830 #include <$ac_hdr>
5831 EOF
5832 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5833 { (eval echo configure:5834: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5834 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5835 if test -z "$ac_err"; then
5836   rm -rf conftest*
5837   eval "ac_cv_header_$ac_safe=yes"
5838 else
5839   echo "$ac_err" >&5
5840   echo "configure: failed program was:" >&5
5841   cat conftest.$ac_ext >&5
5842   rm -rf conftest*
5843   eval "ac_cv_header_$ac_safe=no"
5844 fi
5845 rm -f conftest*
5846 fi
5847 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5848   echo "$ac_t""yes" 1>&6
5849     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5850   cat >> confdefs.h <<EOF
5851 #define $ac_tr_hdr 1
5852 EOF
5853  
5854 else
5855   echo "$ac_t""no" 1>&6
5856 fi
5857 done
5858
5859
5860         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5861                 if test $krb5_impl = mit; then
5862                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5863 echo "configure:5864: checking for main in -lkrb4" >&5
5864 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5865 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5866   echo $ac_n "(cached) $ac_c" 1>&6
5867 else
5868   ac_save_LIBS="$LIBS"
5869 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
5870 cat > conftest.$ac_ext <<EOF
5871 #line 5872 "configure"
5872 #include "confdefs.h"
5873
5874 int main() {
5875 main()
5876 ; return 0; }
5877 EOF
5878 if { (eval echo configure:5879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5879   rm -rf conftest*
5880   eval "ac_cv_lib_$ac_lib_var=yes"
5881 else
5882   echo "configure: failed program was:" >&5
5883   cat conftest.$ac_ext >&5
5884   rm -rf conftest*
5885   eval "ac_cv_lib_$ac_lib_var=no"
5886 fi
5887 rm -f conftest*
5888 LIBS="$ac_save_LIBS"
5889
5890 fi
5891 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5892   echo "$ac_t""yes" 1>&6
5893   have_k425=yes
5894                                 KRB4_LIBS="-lkrb4 -ldes425"
5895 else
5896   echo "$ac_t""no" 1>&6
5897 have_k425=no
5898 fi
5899
5900
5901                 elif test $krb5_impl = heimdal; then
5902                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5903 echo "configure:5904: checking for main in -lkrb4" >&5
5904 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5905 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5906   echo $ac_n "(cached) $ac_c" 1>&6
5907 else
5908   ac_save_LIBS="$LIBS"
5909 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5910 cat > conftest.$ac_ext <<EOF
5911 #line 5912 "configure"
5912 #include "confdefs.h"
5913
5914 int main() {
5915 main()
5916 ; return 0; }
5917 EOF
5918 if { (eval echo configure:5919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5919   rm -rf conftest*
5920   eval "ac_cv_lib_$ac_lib_var=yes"
5921 else
5922   echo "configure: failed program was:" >&5
5923   cat conftest.$ac_ext >&5
5924   rm -rf conftest*
5925   eval "ac_cv_lib_$ac_lib_var=no"
5926 fi
5927 rm -f conftest*
5928 LIBS="$ac_save_LIBS"
5929
5930 fi
5931 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5932   echo "$ac_t""yes" 1>&6
5933   have_k425=yes
5934                                 KRB4_LIBS="-lkrb4"
5935 else
5936   echo "$ac_t""no" 1>&6
5937 have_k425=no
5938 fi
5939
5940
5941                 else
5942                         have_425=no
5943                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5944                 fi
5945
5946                 if test $have_k425 = yes ; then
5947                         ol_with_kerberos=found
5948                         ol_link_krb4=yes
5949
5950                         cat >> confdefs.h <<\EOF
5951 #define HAVE_KRB425 1
5952 EOF
5953
5954                         cat >> confdefs.h <<\EOF
5955 #define HAVE_KRB4 1
5956 EOF
5957
5958
5959                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5960 echo "configure:5961: checking for des_debug in Kerberos libraries" >&5
5961 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5962   echo $ac_n "(cached) $ac_c" 1>&6
5963 else
5964   
5965                                                                 save_LIBS="$LIBS"
5966                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
5967                                 cat > conftest.$ac_ext <<EOF
5968 #line 5969 "configure"
5969 #include "confdefs.h"
5970
5971 #include <kerberosIV/krb.h>
5972 #include <kerberosIV/des.h>
5973 extern int des_debug;
5974
5975 int main() {
5976
5977 des_debug = 1;
5978
5979 ; return 0; }
5980 EOF
5981 if { (eval echo configure:5982: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5982   rm -rf conftest*
5983   ol_cv_var_des_debug=yes
5984 else
5985   echo "configure: failed program was:" >&5
5986   cat conftest.$ac_ext >&5
5987   rm -rf conftest*
5988   ol_cv_var_des_debug=no
5989 fi
5990 rm -f conftest*
5991                                                                 LIBS="$save_LIBS"
5992                         
5993 fi
5994
5995 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5996
5997                         if test $ol_cv_var_des_debug = yes ; then
5998                                 cat >> confdefs.h <<\EOF
5999 #define HAVE_DES_DEBUG 1
6000 EOF
6001
6002                         fi
6003
6004                         LIBS="$save_LIBS"
6005                 fi
6006         fi
6007 fi
6008
6009 if test $ol_link_krb5 = yes ; then
6010         ol_with_kerberos=found
6011 fi
6012
6013 if test $ol_with_kerberos = auto -o $ol_with_kerberos = k4 \
6014         -o $ol_with_kerberos = kth ; then
6015
6016         for ac_hdr in krb.h des.h krb-archaeology.h 
6017 do
6018 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6019 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6020 echo "configure:6021: checking for $ac_hdr" >&5
6021 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6022   echo $ac_n "(cached) $ac_c" 1>&6
6023 else
6024   cat > conftest.$ac_ext <<EOF
6025 #line 6026 "configure"
6026 #include "confdefs.h"
6027 #include <$ac_hdr>
6028 EOF
6029 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6030 { (eval echo configure:6031: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6031 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6032 if test -z "$ac_err"; then
6033   rm -rf conftest*
6034   eval "ac_cv_header_$ac_safe=yes"
6035 else
6036   echo "$ac_err" >&5
6037   echo "configure: failed program was:" >&5
6038   cat conftest.$ac_ext >&5
6039   rm -rf conftest*
6040   eval "ac_cv_header_$ac_safe=no"
6041 fi
6042 rm -f conftest*
6043 fi
6044 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6045   echo "$ac_t""yes" 1>&6
6046     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6047   cat >> confdefs.h <<EOF
6048 #define $ac_tr_hdr 1
6049 EOF
6050  
6051 else
6052   echo "$ac_t""no" 1>&6
6053 fi
6054 done
6055
6056
6057         if test $ac_cv_header_krb_h = yes ; then
6058                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6059 echo "configure:6060: checking for main in -lkrb" >&5
6060 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6061 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6062   echo $ac_n "(cached) $ac_c" 1>&6
6063 else
6064   ac_save_LIBS="$LIBS"
6065 LIBS="-lkrb -ldes $LIBS"
6066 cat > conftest.$ac_ext <<EOF
6067 #line 6068 "configure"
6068 #include "confdefs.h"
6069
6070 int main() {
6071 main()
6072 ; return 0; }
6073 EOF
6074 if { (eval echo configure:6075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6075   rm -rf conftest*
6076   eval "ac_cv_lib_$ac_lib_var=yes"
6077 else
6078   echo "configure: failed program was:" >&5
6079   cat conftest.$ac_ext >&5
6080   rm -rf conftest*
6081   eval "ac_cv_lib_$ac_lib_var=no"
6082 fi
6083 rm -f conftest*
6084 LIBS="$ac_save_LIBS"
6085
6086 fi
6087 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6088   echo "$ac_t""yes" 1>&6
6089   have_k4=yes
6090 else
6091   echo "$ac_t""no" 1>&6
6092 have_k4=no
6093 fi
6094
6095
6096                 if test $have_k4 = yes ; then
6097                         ol_with_kerberos=found
6098                         ol_link_krb4=yes
6099
6100                         cat >> confdefs.h <<\EOF
6101 #define HAVE_KRB4 1
6102 EOF
6103
6104
6105                         KRB4_LIBS="-lkrb -ldes"
6106
6107                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6108                                 cat >> confdefs.h <<\EOF
6109 #define HAVE_KTH_KERBEROS 1
6110 EOF
6111
6112                         fi
6113                 fi
6114         fi
6115 fi
6116
6117 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6118         ol_link_kpasswd=yes;
6119 fi
6120
6121 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6122         cat >> confdefs.h <<\EOF
6123 #define HAVE_KERBEROS 1
6124 EOF
6125
6126
6127 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6128         { echo "configure: error: Kerberos detection failed." 1>&2; exit 1; }
6129 fi
6130
6131 ol_link_tls=no
6132 if test $ol_with_tls != no ; then
6133         
6134         for ac_hdr in openssl/ssl.h ssl.h
6135 do
6136 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6137 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6138 echo "configure:6139: checking for $ac_hdr" >&5
6139 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6140   echo $ac_n "(cached) $ac_c" 1>&6
6141 else
6142   cat > conftest.$ac_ext <<EOF
6143 #line 6144 "configure"
6144 #include "confdefs.h"
6145 #include <$ac_hdr>
6146 EOF
6147 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6148 { (eval echo configure:6149: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6149 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6150 if test -z "$ac_err"; then
6151   rm -rf conftest*
6152   eval "ac_cv_header_$ac_safe=yes"
6153 else
6154   echo "$ac_err" >&5
6155   echo "configure: failed program was:" >&5
6156   cat conftest.$ac_ext >&5
6157   rm -rf conftest*
6158   eval "ac_cv_header_$ac_safe=no"
6159 fi
6160 rm -f conftest*
6161 fi
6162 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6163   echo "$ac_t""yes" 1>&6
6164     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6165   cat >> confdefs.h <<EOF
6166 #define $ac_tr_hdr 1
6167 EOF
6168  
6169 else
6170   echo "$ac_t""no" 1>&6
6171 fi
6172 done
6173
6174         
6175         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6176                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6177 echo "configure:6178: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6178 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6179 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6180   echo $ac_n "(cached) $ac_c" 1>&6
6181 else
6182   ac_save_LIBS="$LIBS"
6183 LIBS="-lssl -lcrypto $LIBS"
6184 cat > conftest.$ac_ext <<EOF
6185 #line 6186 "configure"
6186 #include "confdefs.h"
6187 /* Override any gcc2 internal prototype to avoid an error.  */
6188 /* We use char because int might match the return type of a gcc2
6189     builtin and then its argument prototype would still apply.  */
6190 char SSLeay_add_ssl_algorithms();
6191
6192 int main() {
6193 SSLeay_add_ssl_algorithms()
6194 ; return 0; }
6195 EOF
6196 if { (eval echo configure:6197: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6197   rm -rf conftest*
6198   eval "ac_cv_lib_$ac_lib_var=yes"
6199 else
6200   echo "configure: failed program was:" >&5
6201   cat conftest.$ac_ext >&5
6202   rm -rf conftest*
6203   eval "ac_cv_lib_$ac_lib_var=no"
6204 fi
6205 rm -f conftest*
6206 LIBS="$ac_save_LIBS"
6207
6208 fi
6209 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6210   echo "$ac_t""yes" 1>&6
6211   have_ssleay=yes
6212                         need_rsaref=no
6213 else
6214   echo "$ac_t""no" 1>&6
6215 have_ssleay=no
6216 fi
6217
6218                         
6219                 if test $have_ssleay = no ; then
6220                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6221 echo "configure:6222: checking for SSL_library_init in -lssl" >&5
6222 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6223 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6224   echo $ac_n "(cached) $ac_c" 1>&6
6225 else
6226   ac_save_LIBS="$LIBS"
6227 LIBS="-lssl -lcrypto $LIBS"
6228 cat > conftest.$ac_ext <<EOF
6229 #line 6230 "configure"
6230 #include "confdefs.h"
6231 /* Override any gcc2 internal prototype to avoid an error.  */
6232 /* We use char because int might match the return type of a gcc2
6233     builtin and then its argument prototype would still apply.  */
6234 char SSL_library_init();
6235
6236 int main() {
6237 SSL_library_init()
6238 ; return 0; }
6239 EOF
6240 if { (eval echo configure:6241: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6241   rm -rf conftest*
6242   eval "ac_cv_lib_$ac_lib_var=yes"
6243 else
6244   echo "configure: failed program was:" >&5
6245   cat conftest.$ac_ext >&5
6246   rm -rf conftest*
6247   eval "ac_cv_lib_$ac_lib_var=no"
6248 fi
6249 rm -f conftest*
6250 LIBS="$ac_save_LIBS"
6251
6252 fi
6253 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6254   echo "$ac_t""yes" 1>&6
6255   have_ssleay=yes
6256                                 need_rsaref=no
6257 else
6258   echo "$ac_t""no" 1>&6
6259 have_ssleay=no
6260 fi
6261
6262                 fi
6263
6264                 if test $have_ssleay = no ; then
6265                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6266 echo "configure:6267: checking for ssl3_accept in -lssl" >&5
6267 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6268 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6269   echo $ac_n "(cached) $ac_c" 1>&6
6270 else
6271   ac_save_LIBS="$LIBS"
6272 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6273 cat > conftest.$ac_ext <<EOF
6274 #line 6275 "configure"
6275 #include "confdefs.h"
6276 /* Override any gcc2 internal prototype to avoid an error.  */
6277 /* We use char because int might match the return type of a gcc2
6278     builtin and then its argument prototype would still apply.  */
6279 char ssl3_accept();
6280
6281 int main() {
6282 ssl3_accept()
6283 ; return 0; }
6284 EOF
6285 if { (eval echo configure:6286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6286   rm -rf conftest*
6287   eval "ac_cv_lib_$ac_lib_var=yes"
6288 else
6289   echo "configure: failed program was:" >&5
6290   cat conftest.$ac_ext >&5
6291   rm -rf conftest*
6292   eval "ac_cv_lib_$ac_lib_var=no"
6293 fi
6294 rm -f conftest*
6295 LIBS="$ac_save_LIBS"
6296
6297 fi
6298 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6299   echo "$ac_t""yes" 1>&6
6300   have_ssleay=yes
6301                                 need_rsaref=yes
6302 else
6303   echo "$ac_t""no" 1>&6
6304 have_ssleay=no
6305 fi
6306
6307                 fi
6308
6309                 if test $have_ssleay = yes ; then
6310                         ol_with_tls=found
6311                         ol_link_tls=yes
6312
6313                         cat >> confdefs.h <<\EOF
6314 #define HAVE_SSLEAY 1
6315 EOF
6316
6317
6318                         if test $need_rsaref = yes; then
6319                                 cat >> confdefs.h <<\EOF
6320 #define HAVE_RSAREF 1
6321 EOF
6322
6323
6324                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6325                         else
6326                                 TLS_LIBS="-lssl -lcrypto"
6327                         fi
6328                 fi
6329         fi
6330 fi
6331
6332 if test $ol_link_tls = yes ; then
6333         cat >> confdefs.h <<\EOF
6334 #define HAVE_TLS 1
6335 EOF
6336
6337 fi      
6338
6339 for ac_func in \
6340         ctime_r                 \
6341         gethostbyname_r gethostbyaddr_r \
6342
6343 do
6344 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6345 echo "configure:6346: checking for $ac_func" >&5
6346 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6347   echo $ac_n "(cached) $ac_c" 1>&6
6348 else
6349   cat > conftest.$ac_ext <<EOF
6350 #line 6351 "configure"
6351 #include "confdefs.h"
6352 /* System header to define __stub macros and hopefully few prototypes,
6353     which can conflict with char $ac_func(); below.  */
6354 #include <assert.h>
6355 /* Override any gcc2 internal prototype to avoid an error.  */
6356 /* We use char because int might match the return type of a gcc2
6357     builtin and then its argument prototype would still apply.  */
6358 char $ac_func();
6359 char (*f)();
6360
6361 int main() {
6362
6363 /* The GNU C library defines this for functions which it implements
6364     to always fail with ENOSYS.  Some functions are actually named
6365     something starting with __ and the normal name is an alias.  */
6366 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6367 choke me
6368 #else
6369 f = $ac_func;
6370 #endif
6371
6372 ; return 0; }
6373 EOF
6374 if { (eval echo configure:6375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6375   rm -rf conftest*
6376   eval "ac_cv_func_$ac_func=yes"
6377 else
6378   echo "configure: failed program was:" >&5
6379   cat conftest.$ac_ext >&5
6380   rm -rf conftest*
6381   eval "ac_cv_func_$ac_func=no"
6382 fi
6383 rm -f conftest*
6384 fi
6385
6386 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6387   echo "$ac_t""yes" 1>&6
6388     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6389   cat >> confdefs.h <<EOF
6390 #define $ac_tr_func 1
6391 EOF
6392  
6393 else
6394   echo "$ac_t""no" 1>&6
6395 fi
6396 done
6397
6398
6399 if test "$ac_cv_func_ctime_r" = no ; then
6400         ol_cv_func_ctime_r_nargs=0
6401 else
6402         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6403 echo "configure:6404: checking number of arguments of ctime_r" >&5
6404 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6405   echo $ac_n "(cached) $ac_c" 1>&6
6406 else
6407   cat > conftest.$ac_ext <<EOF
6408 #line 6409 "configure"
6409 #include "confdefs.h"
6410 #include <time.h>
6411 int main() {
6412 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6413 ; return 0; }
6414 EOF
6415 if { (eval echo configure:6416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6416   rm -rf conftest*
6417   ol_cv_func_ctime_r_nargs3=yes
6418 else
6419   echo "configure: failed program was:" >&5
6420   cat conftest.$ac_ext >&5
6421   rm -rf conftest*
6422   ol_cv_func_ctime_r_nargs3=no
6423 fi
6424 rm -f conftest*
6425
6426         cat > conftest.$ac_ext <<EOF
6427 #line 6428 "configure"
6428 #include "confdefs.h"
6429 #include <time.h>
6430 int main() {
6431 time_t ti; char *buffer; ctime_r(&ti,buffer);
6432 ; return 0; }
6433 EOF
6434 if { (eval echo configure:6435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6435   rm -rf conftest*
6436   ol_cv_func_ctime_r_nargs2=yes
6437 else
6438   echo "configure: failed program was:" >&5
6439   cat conftest.$ac_ext >&5
6440   rm -rf conftest*
6441   ol_cv_func_ctime_r_nargs2=no
6442 fi
6443 rm -f conftest*
6444
6445         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6446                 $ol_cv_func_ctime_r_nargs2 = no ; then
6447
6448                 ol_cv_func_ctime_r_nargs=3
6449
6450         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6451                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6452
6453                 ol_cv_func_ctime_r_nargs=2
6454
6455         else
6456                 ol_cv_func_ctime_r_nargs=0
6457         fi
6458   
6459 fi
6460
6461 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6462
6463   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6464         cat >> confdefs.h <<EOF
6465 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6466 EOF
6467
6468   fi
6469
6470 fi
6471
6472 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6473         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6474 echo "configure:6475: checking number of arguments of gethostbyname_r" >&5
6475 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6476   echo $ac_n "(cached) $ac_c" 1>&6
6477 else
6478   cat > conftest.$ac_ext <<EOF
6479 #line 6480 "configure"
6480 #include "confdefs.h"
6481 #include <sys/types.h>
6482 #include <sys/socket.h>
6483 #include <netinet/in.h>
6484 #include <netdb.h>
6485 #define BUFSIZE (sizeof(struct hostent)+10)
6486 int main() {
6487 struct hostent hent; char buffer[BUFSIZE];
6488                 int bufsize=BUFSIZE;int h_errno;
6489                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6490                         buffer, bufsize, &h_errno);
6491 ; return 0; }
6492 EOF
6493 if { (eval echo configure:6494: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6494   rm -rf conftest*
6495   ol_cv_func_gethostbyname_r_nargs5=yes
6496 else
6497   echo "configure: failed program was:" >&5
6498   cat conftest.$ac_ext >&5
6499   rm -rf conftest*
6500   ol_cv_func_gethostbyname_r_nargs5=no
6501 fi
6502 rm -f conftest*
6503
6504         cat > conftest.$ac_ext <<EOF
6505 #line 6506 "configure"
6506 #include "confdefs.h"
6507 #include <sys/types.h>
6508 #include <sys/socket.h>
6509 #include <netinet/in.h>
6510 #include <netdb.h>
6511 #define BUFSIZE (sizeof(struct hostent)+10)
6512 int main() {
6513 struct hostent hent;struct hostent *rhent;
6514                 char buffer[BUFSIZE];
6515                 int bufsize=BUFSIZE;int h_errno;
6516                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6517                         &rhent, &h_errno);
6518 ; return 0; }
6519 EOF
6520 if { (eval echo configure:6521: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6521   rm -rf conftest*
6522   ol_cv_func_gethostbyname_r_nargs6=yes
6523 else
6524   echo "configure: failed program was:" >&5
6525   cat conftest.$ac_ext >&5
6526   rm -rf conftest*
6527   ol_cv_func_gethostbyname_r_nargs6=no
6528 fi
6529 rm -f conftest*
6530
6531         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6532                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6533
6534                 ol_cv_func_gethostbyname_r_nargs=5
6535
6536         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6537                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6538
6539                 ol_cv_func_gethostbyname_r_nargs=6
6540
6541         else
6542                 ol_cv_func_gethostbyname_r_nargs=0
6543         fi
6544   
6545 fi
6546
6547 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6548   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6549         cat >> confdefs.h <<EOF
6550 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6551 EOF
6552
6553   fi
6554
6555 else
6556         ol_cv_func_gethostbyname_r_nargs=0
6557 fi
6558  
6559 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6560         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6561 echo "configure:6562: checking number of arguments of gethostbyaddr_r" >&5
6562 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6563   echo $ac_n "(cached) $ac_c" 1>&6
6564 else
6565   cat > conftest.$ac_ext <<EOF
6566 #line 6567 "configure"
6567 #include "confdefs.h"
6568 #include <sys/types.h>
6569 #include <sys/socket.h>
6570 #include <netinet/in.h>
6571 #include <netdb.h>
6572 #define BUFSIZE (sizeof(struct hostent)+10)
6573 int main() {
6574 struct hostent hent; char buffer[BUFSIZE]; 
6575             struct in_addr add;
6576             size_t alen=sizeof(struct in_addr);
6577             int bufsize=BUFSIZE;int h_errno;
6578                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6579                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6580 ; return 0; }
6581 EOF
6582 if { (eval echo configure:6583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6583   rm -rf conftest*
6584   ol_cv_func_gethostbyaddr_r_nargs7=yes
6585 else
6586   echo "configure: failed program was:" >&5
6587   cat conftest.$ac_ext >&5
6588   rm -rf conftest*
6589   ol_cv_func_gethostbyaddr_r_nargs7=no
6590 fi
6591 rm -f conftest*
6592
6593         cat > conftest.$ac_ext <<EOF
6594 #line 6595 "configure"
6595 #include "confdefs.h"
6596 #include <sys/types.h>
6597 #include <sys/socket.h>
6598 #include <netinet/in.h>
6599 #include <netdb.h>
6600 #define BUFSIZE (sizeof(struct hostent)+10)
6601 int main() {
6602 struct hostent hent;
6603                 struct hostent *rhent; char buffer[BUFSIZE]; 
6604                 struct in_addr add;
6605                 size_t alen=sizeof(struct in_addr);
6606                 int bufsize=BUFSIZE;int h_errno;
6607                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6608                         alen, AF_INET, &hent, buffer, bufsize, 
6609                         &rhent, &h_errno);
6610 ; return 0; }
6611 EOF
6612 if { (eval echo configure:6613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6613   rm -rf conftest*
6614   ol_cv_func_gethostbyaddr_r_nargs8=yes
6615 else
6616   echo "configure: failed program was:" >&5
6617   cat conftest.$ac_ext >&5
6618   rm -rf conftest*
6619   ol_cv_func_gethostbyaddr_r_nargs8=no
6620 fi
6621 rm -f conftest*
6622
6623         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6624                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6625
6626                 ol_cv_func_gethostbyaddr_r_nargs=7
6627
6628         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6629                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6630
6631                 ol_cv_func_gethostbyaddr_r_nargs=8
6632
6633         else
6634                 ol_cv_func_gethostbyaddr_r_nargs=0
6635         fi
6636   
6637 fi
6638
6639 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6640   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6641     cat >> confdefs.h <<EOF
6642 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6643 EOF
6644
6645   fi
6646
6647 else
6648         ol_cv_func_gethostbyaddr_r_nargs=0
6649 fi
6650
6651 if test "$ac_cv_func_ctime_r" = yes \
6652         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6653         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6654         -a "$ac_cv_func_gethostbyname_r" = yes \
6655         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6656         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6657         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6658         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6659         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6660         ; then
6661  
6662         cat >> confdefs.h <<\EOF
6663 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6664 EOF
6665
6666 fi
6667
6668 ol_link_threads=no
6669
6670 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6671         -o $ol_with_threads = nt ; then
6672
6673         
6674         echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
6675 echo "configure:6676: checking for NT Threads" >&5
6676 if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
6677   echo $ac_n "(cached) $ac_c" 1>&6
6678 else
6679   
6680                 echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6681 echo "configure:6682: checking for _beginthread" >&5
6682 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6683   echo $ac_n "(cached) $ac_c" 1>&6
6684 else
6685   cat > conftest.$ac_ext <<EOF
6686 #line 6687 "configure"
6687 #include "confdefs.h"
6688 /* System header to define __stub macros and hopefully few prototypes,
6689     which can conflict with char _beginthread(); below.  */
6690 #include <assert.h>
6691 /* Override any gcc2 internal prototype to avoid an error.  */
6692 /* We use char because int might match the return type of a gcc2
6693     builtin and then its argument prototype would still apply.  */
6694 char _beginthread();
6695 char (*f)();
6696
6697 int main() {
6698
6699 /* The GNU C library defines this for functions which it implements
6700     to always fail with ENOSYS.  Some functions are actually named
6701     something starting with __ and the normal name is an alias.  */
6702 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6703 choke me
6704 #else
6705 f = _beginthread;
6706 #endif
6707
6708 ; return 0; }
6709 EOF
6710 if { (eval echo configure:6711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6711   rm -rf conftest*
6712   eval "ac_cv_func__beginthread=yes"
6713 else
6714   echo "configure: failed program was:" >&5
6715   cat conftest.$ac_ext >&5
6716   rm -rf conftest*
6717   eval "ac_cv_func__beginthread=no"
6718 fi
6719 rm -f conftest*
6720 fi
6721
6722 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6723   echo "$ac_t""yes" 1>&6
6724   ol_cv_nt_threads=yes
6725 else
6726   echo "$ac_t""no" 1>&6
6727 ol_cv_nt_threads=no
6728 fi
6729
6730         
6731 fi
6732
6733 echo "$ac_t""$ol_cv_nt_threads" 1>&6
6734
6735         if test $ol_cv_nt_threads = yes ; then
6736                 cat >> confdefs.h <<\EOF
6737 #define HAVE_NT_THREADS 1
6738 EOF
6739
6740         fi
6741
6742
6743         if test "$ol_cv_nt_threads" = yes ; then
6744         ol_link_threads=nt
6745         ol_with_threads=found
6746         ol_with_yielding_select=yes
6747
6748                 cat >> confdefs.h <<\EOF
6749 #define HAVE_NT_SERVICE_MANAGER 1
6750 EOF
6751
6752                 cat >> confdefs.h <<\EOF
6753 #define HAVE_NT_EVENT_LOG 1
6754 EOF
6755
6756         fi
6757
6758         if test $ol_with_threads = nt ; then
6759                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
6760         fi
6761 fi
6762
6763 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6764         -o $ol_with_threads = posix ; then
6765
6766         for ac_hdr in pthread.h
6767 do
6768 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6769 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6770 echo "configure:6771: checking for $ac_hdr" >&5
6771 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6772   echo $ac_n "(cached) $ac_c" 1>&6
6773 else
6774   cat > conftest.$ac_ext <<EOF
6775 #line 6776 "configure"
6776 #include "confdefs.h"
6777 #include <$ac_hdr>
6778 EOF
6779 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6780 { (eval echo configure:6781: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6781 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6782 if test -z "$ac_err"; then
6783   rm -rf conftest*
6784   eval "ac_cv_header_$ac_safe=yes"
6785 else
6786   echo "$ac_err" >&5
6787   echo "configure: failed program was:" >&5
6788   cat conftest.$ac_ext >&5
6789   rm -rf conftest*
6790   eval "ac_cv_header_$ac_safe=no"
6791 fi
6792 rm -f conftest*
6793 fi
6794 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6795   echo "$ac_t""yes" 1>&6
6796     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6797   cat >> confdefs.h <<EOF
6798 #define $ac_tr_hdr 1
6799 EOF
6800  
6801 else
6802   echo "$ac_t""no" 1>&6
6803 fi
6804 done
6805
6806
6807         if test $ac_cv_header_pthread_h = yes ; then
6808                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6809 echo "configure:6810: checking POSIX thread version" >&5
6810 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6811   echo $ac_n "(cached) $ac_c" 1>&6
6812 else
6813   
6814         cat > conftest.$ac_ext <<EOF
6815 #line 6816 "configure"
6816 #include "confdefs.h"
6817
6818 #               include <pthread.h>
6819                 /* this check could be improved */
6820 #               ifdef PTHREAD_ONCE_INIT
6821                         pthread_version_final;
6822 #               endif
6823         
6824 EOF
6825 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6826   egrep "pthread_version_final" >/dev/null 2>&1; then
6827   rm -rf conftest*
6828   ol_pthread_final=yes
6829 else
6830   rm -rf conftest*
6831   ol_pthread_final=no
6832 fi
6833 rm -f conftest*
6834
6835
6836         cat > conftest.$ac_ext <<EOF
6837 #line 6838 "configure"
6838 #include "confdefs.h"
6839
6840 #               include <pthread.h>
6841                 /* this check could be improved */
6842 #               ifdef pthread_once_init
6843                         pthread_version_draft4;
6844 #               endif
6845         
6846 EOF
6847 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6848   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6849   rm -rf conftest*
6850   ol_pthread_draft4=yes
6851 else
6852   rm -rf conftest*
6853   ol_pthread_draft4=no
6854 fi
6855 rm -f conftest*
6856
6857
6858         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6859                 ol_cv_pthread_version=final
6860         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6861                 ol_cv_pthread_version=draft4
6862         else
6863                 ol_cv_pthread_version=unknown
6864         fi
6865
6866 fi
6867
6868 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6869
6870
6871                 if test $ol_cv_pthread_version = final ; then
6872                         cat >> confdefs.h <<\EOF
6873 #define HAVE_PTHREADS_FINAL 1
6874 EOF
6875
6876                 elif test $ol_cv_pthread_version = draft4 ; then
6877                         cat >> confdefs.h <<\EOF
6878 #define HAVE_PTHREADS_D4 1
6879 EOF
6880
6881                 else
6882                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6883                 fi
6884
6885                 # consider threads found
6886                 ol_with_threads=found
6887
6888                 
6889         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6890 echo "configure:6891: checking for LinuxThreads pthread.h" >&5
6891 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6892   echo $ac_n "(cached) $ac_c" 1>&6
6893 else
6894   cat > conftest.$ac_ext <<EOF
6895 #line 6896 "configure"
6896 #include "confdefs.h"
6897 #include <pthread.h>
6898 EOF
6899 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6900   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6901   rm -rf conftest*
6902   ol_cv_header_linux_threads=yes
6903 else
6904   rm -rf conftest*
6905   ol_cv_header_linux_threads=no
6906 fi
6907 rm -f conftest*
6908
6909                 
6910 fi
6911
6912 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6913         if test $ol_cv_header_linux_threads = yes; then
6914                 cat >> confdefs.h <<\EOF
6915 #define HAVE_LINUX_THREADS 1
6916 EOF
6917
6918         fi
6919
6920                 
6921         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6922 echo "configure:6923: checking for GNU Pth pthread.h" >&5
6923 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6924   echo $ac_n "(cached) $ac_c" 1>&6
6925 else
6926   cat > conftest.$ac_ext <<EOF
6927 #line 6928 "configure"
6928 #include "confdefs.h"
6929 #include <pthread.h>
6930 #ifdef _POSIX_THREAD_IS_GNU_PTH
6931         __gnu_pth__;
6932 #endif
6933
6934 EOF
6935 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6936   egrep "__gnu_pth__" >/dev/null 2>&1; then
6937   rm -rf conftest*
6938   ol_cv_header_gnu_pth_pthread_h=yes
6939 else
6940   rm -rf conftest*
6941   ol_cv_header_gnu_pth_pthread_h=no
6942 fi
6943 rm -f conftest*
6944
6945                 
6946 fi
6947
6948 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6949
6950
6951                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6952                         for ac_hdr in sched.h
6953 do
6954 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6955 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6956 echo "configure:6957: checking for $ac_hdr" >&5
6957 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6958   echo $ac_n "(cached) $ac_c" 1>&6
6959 else
6960   cat > conftest.$ac_ext <<EOF
6961 #line 6962 "configure"
6962 #include "confdefs.h"
6963 #include <$ac_hdr>
6964 EOF
6965 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6966 { (eval echo configure:6967: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6967 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6968 if test -z "$ac_err"; then
6969   rm -rf conftest*
6970   eval "ac_cv_header_$ac_safe=yes"
6971 else
6972   echo "$ac_err" >&5
6973   echo "configure: failed program was:" >&5
6974   cat conftest.$ac_ext >&5
6975   rm -rf conftest*
6976   eval "ac_cv_header_$ac_safe=no"
6977 fi
6978 rm -f conftest*
6979 fi
6980 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6981   echo "$ac_t""yes" 1>&6
6982     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6983   cat >> confdefs.h <<EOF
6984 #define $ac_tr_hdr 1
6985 EOF
6986  
6987 else
6988   echo "$ac_t""no" 1>&6
6989 fi
6990 done
6991
6992                 fi
6993
6994                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
6995                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
6996 echo "configure:6997: checking for pthread_create in default libraries" >&5
6997 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
6998   echo $ac_n "(cached) $ac_c" 1>&6
6999 else
7000   
7001                 if test "$cross_compiling" = yes; then
7002   cat > conftest.$ac_ext <<EOF
7003 #line 7004 "configure"
7004 #include "confdefs.h"
7005 /* pthread test headers */
7006 #include <pthread.h>
7007 #ifndef NULL
7008 #define NULL (void*)0
7009 #endif
7010
7011 static void *task(p)
7012         void *p;
7013 {
7014         return (void *) (p == NULL);
7015 }
7016
7017 int main() {
7018
7019         /* pthread test function */
7020         pthread_t t;
7021         int status;
7022 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7023         /* This system (e.g. AIX) defaults detached; must override */
7024         pthread_attr_t attr;
7025
7026         status = pthread_attr_init(&attr);
7027         if( status ) exit( status );
7028
7029         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7030         if( status ) exit( status );
7031
7032 #define ATTR    &attr
7033 #else
7034 #if HAVE_PTHREADS_D4
7035 #define ATTR    pthread_attr_default
7036 #else
7037 #define ATTR    NULL
7038 #endif
7039 #endif
7040         /* make sure pthread_create() isn't just a stub */
7041         status = pthread_create(&t, ATTR, task, NULL);
7042         if( status ) exit( status );
7043
7044         /* make sure pthread_detach() isn't just a stub */
7045 #if HAVE_PTHREADS_D4
7046         status = pthread_detach( &t );
7047 #else
7048         status = pthread_detach( t );
7049 #endif
7050
7051 #ifdef HAVE_LINUX_THREADS
7052         pthread_kill_other_threads_np();
7053 #endif
7054
7055         exit( status );
7056
7057 ; return 0; }
7058 EOF
7059 if { (eval echo configure:7060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7060   rm -rf conftest*
7061   ol_cv_pthread_create=yes
7062 else
7063   echo "configure: failed program was:" >&5
7064   cat conftest.$ac_ext >&5
7065   rm -rf conftest*
7066   ol_cv_pthread_create=no
7067 fi
7068 rm -f conftest*
7069 else
7070   cat > conftest.$ac_ext <<EOF
7071 #line 7072 "configure"
7072 #include "confdefs.h"
7073 /* pthread test headers */
7074 #include <pthread.h>
7075 #ifndef NULL
7076 #define NULL (void*)0
7077 #endif
7078
7079 static void *task(p)
7080         void *p;
7081 {
7082         return (void *) (p == NULL);
7083 }
7084
7085
7086 int main(argc, argv)
7087         int argc;
7088         char **argv;
7089 {
7090
7091         /* pthread test function */
7092         pthread_t t;
7093         int status;
7094 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7095         /* This system (e.g. AIX) defaults detached; must override */
7096         pthread_attr_t attr;
7097
7098         status = pthread_attr_init(&attr);
7099         if( status ) exit( status );
7100
7101         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7102         if( status ) exit( status );
7103
7104 #define ATTR    &attr
7105 #else
7106 #if HAVE_PTHREADS_D4
7107 #define ATTR    pthread_attr_default
7108 #else
7109 #define ATTR    NULL
7110 #endif
7111 #endif
7112         /* make sure pthread_create() isn't just a stub */
7113         status = pthread_create(&t, ATTR, task, NULL);
7114         if( status ) exit( status );
7115
7116         /* make sure pthread_detach() isn't just a stub */
7117 #if HAVE_PTHREADS_D4
7118         status = pthread_detach( &t );
7119 #else
7120         status = pthread_detach( t );
7121 #endif
7122
7123 #ifdef HAVE_LINUX_THREADS
7124         pthread_kill_other_threads_np();
7125 #endif
7126
7127         exit( status );
7128
7129 }
7130
7131 EOF
7132 if { (eval echo configure:7133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7133 then
7134   ol_cv_pthread_create=yes
7135 else
7136   echo "configure: failed program was:" >&5
7137   cat conftest.$ac_ext >&5
7138   rm -fr conftest*
7139   ol_cv_pthread_create=no
7140 fi
7141 rm -fr conftest*
7142 fi
7143
7144 fi
7145
7146 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7147
7148                 if test $ol_cv_pthread_create != no ; then
7149                         ol_link_threads=posix
7150                         ol_link_pthreads=""
7151                 fi
7152                 
7153                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7154 if test "$ol_link_threads" = no ; then
7155         # try -kthread
7156         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7157 echo "configure:7158: checking for pthread link with -kthread" >&5
7158 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7159   echo $ac_n "(cached) $ac_c" 1>&6
7160 else
7161   
7162                 # save the flags
7163                 ol_LIBS="$LIBS"
7164                 LIBS="-kthread $LIBS"
7165
7166                 if test "$cross_compiling" = yes; then
7167   cat > conftest.$ac_ext <<EOF
7168 #line 7169 "configure"
7169 #include "confdefs.h"
7170 /* pthread test headers */
7171 #include <pthread.h>
7172 #ifndef NULL
7173 #define NULL (void*)0
7174 #endif
7175
7176 static void *task(p)
7177         void *p;
7178 {
7179         return (void *) (p == NULL);
7180 }
7181
7182 int main() {
7183
7184         /* pthread test function */
7185         pthread_t t;
7186         int status;
7187 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7188         /* This system (e.g. AIX) defaults detached; must override */
7189         pthread_attr_t attr;
7190
7191         status = pthread_attr_init(&attr);
7192         if( status ) exit( status );
7193
7194         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7195         if( status ) exit( status );
7196
7197 #define ATTR    &attr
7198 #else
7199 #if HAVE_PTHREADS_D4
7200 #define ATTR    pthread_attr_default
7201 #else
7202 #define ATTR    NULL
7203 #endif
7204 #endif
7205         /* make sure pthread_create() isn't just a stub */
7206         status = pthread_create(&t, ATTR, task, NULL);
7207         if( status ) exit( status );
7208
7209         /* make sure pthread_detach() isn't just a stub */
7210 #if HAVE_PTHREADS_D4
7211         status = pthread_detach( &t );
7212 #else
7213         status = pthread_detach( t );
7214 #endif
7215
7216 #ifdef HAVE_LINUX_THREADS
7217         pthread_kill_other_threads_np();
7218 #endif
7219
7220         exit( status );
7221
7222 ; return 0; }
7223 EOF
7224 if { (eval echo configure:7225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7225   rm -rf conftest*
7226   ol_cv_pthread_kthread=yes
7227 else
7228   echo "configure: failed program was:" >&5
7229   cat conftest.$ac_ext >&5
7230   rm -rf conftest*
7231   ol_cv_pthread_kthread=no
7232 fi
7233 rm -f conftest*
7234 else
7235   cat > conftest.$ac_ext <<EOF
7236 #line 7237 "configure"
7237 #include "confdefs.h"
7238 /* pthread test headers */
7239 #include <pthread.h>
7240 #ifndef NULL
7241 #define NULL (void*)0
7242 #endif
7243
7244 static void *task(p)
7245         void *p;
7246 {
7247         return (void *) (p == NULL);
7248 }
7249
7250
7251 int main(argc, argv)
7252         int argc;
7253         char **argv;
7254 {
7255
7256         /* pthread test function */
7257         pthread_t t;
7258         int status;
7259 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7260         /* This system (e.g. AIX) defaults detached; must override */
7261         pthread_attr_t attr;
7262
7263         status = pthread_attr_init(&attr);
7264         if( status ) exit( status );
7265
7266         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7267         if( status ) exit( status );
7268
7269 #define ATTR    &attr
7270 #else
7271 #if HAVE_PTHREADS_D4
7272 #define ATTR    pthread_attr_default
7273 #else
7274 #define ATTR    NULL
7275 #endif
7276 #endif
7277         /* make sure pthread_create() isn't just a stub */
7278         status = pthread_create(&t, ATTR, task, NULL);
7279         if( status ) exit( status );
7280
7281         /* make sure pthread_detach() isn't just a stub */
7282 #if HAVE_PTHREADS_D4
7283         status = pthread_detach( &t );
7284 #else
7285         status = pthread_detach( t );
7286 #endif
7287
7288 #ifdef HAVE_LINUX_THREADS
7289         pthread_kill_other_threads_np();
7290 #endif
7291
7292         exit( status );
7293
7294 }
7295
7296 EOF
7297 if { (eval echo configure:7298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7298 then
7299   ol_cv_pthread_kthread=yes
7300 else
7301   echo "configure: failed program was:" >&5
7302   cat conftest.$ac_ext >&5
7303   rm -fr conftest*
7304   ol_cv_pthread_kthread=no
7305 fi
7306 rm -fr conftest*
7307 fi
7308
7309
7310                 # restore the LIBS
7311                 LIBS="$ol_LIBS"
7312         
7313 fi
7314
7315 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7316
7317         if test $ol_cv_pthread_kthread = yes ; then
7318                 ol_link_pthreads="-kthread"
7319                 ol_link_threads=posix
7320         fi
7321 fi
7322
7323                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7324 if test "$ol_link_threads" = no ; then
7325         # try -pthread
7326         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7327 echo "configure:7328: checking for pthread link with -pthread" >&5
7328 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7329   echo $ac_n "(cached) $ac_c" 1>&6
7330 else
7331   
7332                 # save the flags
7333                 ol_LIBS="$LIBS"
7334                 LIBS="-pthread $LIBS"
7335
7336                 if test "$cross_compiling" = yes; then
7337   cat > conftest.$ac_ext <<EOF
7338 #line 7339 "configure"
7339 #include "confdefs.h"
7340 /* pthread test headers */
7341 #include <pthread.h>
7342 #ifndef NULL
7343 #define NULL (void*)0
7344 #endif
7345
7346 static void *task(p)
7347         void *p;
7348 {
7349         return (void *) (p == NULL);
7350 }
7351
7352 int main() {
7353
7354         /* pthread test function */
7355         pthread_t t;
7356         int status;
7357 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7358         /* This system (e.g. AIX) defaults detached; must override */
7359         pthread_attr_t attr;
7360
7361         status = pthread_attr_init(&attr);
7362         if( status ) exit( status );
7363
7364         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7365         if( status ) exit( status );
7366
7367 #define ATTR    &attr
7368 #else
7369 #if HAVE_PTHREADS_D4
7370 #define ATTR    pthread_attr_default
7371 #else
7372 #define ATTR    NULL
7373 #endif
7374 #endif
7375         /* make sure pthread_create() isn't just a stub */
7376         status = pthread_create(&t, ATTR, task, NULL);
7377         if( status ) exit( status );
7378
7379         /* make sure pthread_detach() isn't just a stub */
7380 #if HAVE_PTHREADS_D4
7381         status = pthread_detach( &t );
7382 #else
7383         status = pthread_detach( t );
7384 #endif
7385
7386 #ifdef HAVE_LINUX_THREADS
7387         pthread_kill_other_threads_np();
7388 #endif
7389
7390         exit( status );
7391
7392 ; return 0; }
7393 EOF
7394 if { (eval echo configure:7395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7395   rm -rf conftest*
7396   ol_cv_pthread_pthread=yes
7397 else
7398   echo "configure: failed program was:" >&5
7399   cat conftest.$ac_ext >&5
7400   rm -rf conftest*
7401   ol_cv_pthread_pthread=no
7402 fi
7403 rm -f conftest*
7404 else
7405   cat > conftest.$ac_ext <<EOF
7406 #line 7407 "configure"
7407 #include "confdefs.h"
7408 /* pthread test headers */
7409 #include <pthread.h>
7410 #ifndef NULL
7411 #define NULL (void*)0
7412 #endif
7413
7414 static void *task(p)
7415         void *p;
7416 {
7417         return (void *) (p == NULL);
7418 }
7419
7420
7421 int main(argc, argv)
7422         int argc;
7423         char **argv;
7424 {
7425
7426         /* pthread test function */
7427         pthread_t t;
7428         int status;
7429 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7430         /* This system (e.g. AIX) defaults detached; must override */
7431         pthread_attr_t attr;
7432
7433         status = pthread_attr_init(&attr);
7434         if( status ) exit( status );
7435
7436         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7437         if( status ) exit( status );
7438
7439 #define ATTR    &attr
7440 #else
7441 #if HAVE_PTHREADS_D4
7442 #define ATTR    pthread_attr_default
7443 #else
7444 #define ATTR    NULL
7445 #endif
7446 #endif
7447         /* make sure pthread_create() isn't just a stub */
7448         status = pthread_create(&t, ATTR, task, NULL);
7449         if( status ) exit( status );
7450
7451         /* make sure pthread_detach() isn't just a stub */
7452 #if HAVE_PTHREADS_D4
7453         status = pthread_detach( &t );
7454 #else
7455         status = pthread_detach( t );
7456 #endif
7457
7458 #ifdef HAVE_LINUX_THREADS
7459         pthread_kill_other_threads_np();
7460 #endif
7461
7462         exit( status );
7463
7464 }
7465
7466 EOF
7467 if { (eval echo configure:7468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7468 then
7469   ol_cv_pthread_pthread=yes
7470 else
7471   echo "configure: failed program was:" >&5
7472   cat conftest.$ac_ext >&5
7473   rm -fr conftest*
7474   ol_cv_pthread_pthread=no
7475 fi
7476 rm -fr conftest*
7477 fi
7478
7479
7480                 # restore the LIBS
7481                 LIBS="$ol_LIBS"
7482         
7483 fi
7484
7485 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7486
7487         if test $ol_cv_pthread_pthread = yes ; then
7488                 ol_link_pthreads="-pthread"
7489                 ol_link_threads=posix
7490         fi
7491 fi
7492
7493                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7494 if test "$ol_link_threads" = no ; then
7495         # try -pthreads
7496         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7497 echo "configure:7498: checking for pthread link with -pthreads" >&5
7498 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7499   echo $ac_n "(cached) $ac_c" 1>&6
7500 else
7501   
7502                 # save the flags
7503                 ol_LIBS="$LIBS"
7504                 LIBS="-pthreads $LIBS"
7505
7506                 if test "$cross_compiling" = yes; then
7507   cat > conftest.$ac_ext <<EOF
7508 #line 7509 "configure"
7509 #include "confdefs.h"
7510 /* pthread test headers */
7511 #include <pthread.h>
7512 #ifndef NULL
7513 #define NULL (void*)0
7514 #endif
7515
7516 static void *task(p)
7517         void *p;
7518 {
7519         return (void *) (p == NULL);
7520 }
7521
7522 int main() {
7523
7524         /* pthread test function */
7525         pthread_t t;
7526         int status;
7527 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7528         /* This system (e.g. AIX) defaults detached; must override */
7529         pthread_attr_t attr;
7530
7531         status = pthread_attr_init(&attr);
7532         if( status ) exit( status );
7533
7534         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7535         if( status ) exit( status );
7536
7537 #define ATTR    &attr
7538 #else
7539 #if HAVE_PTHREADS_D4
7540 #define ATTR    pthread_attr_default
7541 #else
7542 #define ATTR    NULL
7543 #endif
7544 #endif
7545         /* make sure pthread_create() isn't just a stub */
7546         status = pthread_create(&t, ATTR, task, NULL);
7547         if( status ) exit( status );
7548
7549         /* make sure pthread_detach() isn't just a stub */
7550 #if HAVE_PTHREADS_D4
7551         status = pthread_detach( &t );
7552 #else
7553         status = pthread_detach( t );
7554 #endif
7555
7556 #ifdef HAVE_LINUX_THREADS
7557         pthread_kill_other_threads_np();
7558 #endif
7559
7560         exit( status );
7561
7562 ; return 0; }
7563 EOF
7564 if { (eval echo configure:7565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7565   rm -rf conftest*
7566   ol_cv_pthread_pthreads=yes
7567 else
7568   echo "configure: failed program was:" >&5
7569   cat conftest.$ac_ext >&5
7570   rm -rf conftest*
7571   ol_cv_pthread_pthreads=no
7572 fi
7573 rm -f conftest*
7574 else
7575   cat > conftest.$ac_ext <<EOF
7576 #line 7577 "configure"
7577 #include "confdefs.h"
7578 /* pthread test headers */
7579 #include <pthread.h>
7580 #ifndef NULL
7581 #define NULL (void*)0
7582 #endif
7583
7584 static void *task(p)
7585         void *p;
7586 {
7587         return (void *) (p == NULL);
7588 }
7589
7590
7591 int main(argc, argv)
7592         int argc;
7593         char **argv;
7594 {
7595
7596         /* pthread test function */
7597         pthread_t t;
7598         int status;
7599 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7600         /* This system (e.g. AIX) defaults detached; must override */
7601         pthread_attr_t attr;
7602
7603         status = pthread_attr_init(&attr);
7604         if( status ) exit( status );
7605
7606         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7607         if( status ) exit( status );
7608
7609 #define ATTR    &attr
7610 #else
7611 #if HAVE_PTHREADS_D4
7612 #define ATTR    pthread_attr_default
7613 #else
7614 #define ATTR    NULL
7615 #endif
7616 #endif
7617         /* make sure pthread_create() isn't just a stub */
7618         status = pthread_create(&t, ATTR, task, NULL);
7619         if( status ) exit( status );
7620
7621         /* make sure pthread_detach() isn't just a stub */
7622 #if HAVE_PTHREADS_D4
7623         status = pthread_detach( &t );
7624 #else
7625         status = pthread_detach( t );
7626 #endif
7627
7628 #ifdef HAVE_LINUX_THREADS
7629         pthread_kill_other_threads_np();
7630 #endif
7631
7632         exit( status );
7633
7634 }
7635
7636 EOF
7637 if { (eval echo configure:7638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7638 then
7639   ol_cv_pthread_pthreads=yes
7640 else
7641   echo "configure: failed program was:" >&5
7642   cat conftest.$ac_ext >&5
7643   rm -fr conftest*
7644   ol_cv_pthread_pthreads=no
7645 fi
7646 rm -fr conftest*
7647 fi
7648
7649
7650                 # restore the LIBS
7651                 LIBS="$ol_LIBS"
7652         
7653 fi
7654
7655 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7656
7657         if test $ol_cv_pthread_pthreads = yes ; then
7658                 ol_link_pthreads="-pthreads"
7659                 ol_link_threads=posix
7660         fi
7661 fi
7662
7663                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7664 if test "$ol_link_threads" = no ; then
7665         # try -mthreads
7666         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7667 echo "configure:7668: checking for pthread link with -mthreads" >&5
7668 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7669   echo $ac_n "(cached) $ac_c" 1>&6
7670 else
7671   
7672                 # save the flags
7673                 ol_LIBS="$LIBS"
7674                 LIBS="-mthreads $LIBS"
7675
7676                 if test "$cross_compiling" = yes; then
7677   cat > conftest.$ac_ext <<EOF
7678 #line 7679 "configure"
7679 #include "confdefs.h"
7680 /* pthread test headers */
7681 #include <pthread.h>
7682 #ifndef NULL
7683 #define NULL (void*)0
7684 #endif
7685
7686 static void *task(p)
7687         void *p;
7688 {
7689         return (void *) (p == NULL);
7690 }
7691
7692 int main() {
7693
7694         /* pthread test function */
7695         pthread_t t;
7696         int status;
7697 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7698         /* This system (e.g. AIX) defaults detached; must override */
7699         pthread_attr_t attr;
7700
7701         status = pthread_attr_init(&attr);
7702         if( status ) exit( status );
7703
7704         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7705         if( status ) exit( status );
7706
7707 #define ATTR    &attr
7708 #else
7709 #if HAVE_PTHREADS_D4
7710 #define ATTR    pthread_attr_default
7711 #else
7712 #define ATTR    NULL
7713 #endif
7714 #endif
7715         /* make sure pthread_create() isn't just a stub */
7716         status = pthread_create(&t, ATTR, task, NULL);
7717         if( status ) exit( status );
7718
7719         /* make sure pthread_detach() isn't just a stub */
7720 #if HAVE_PTHREADS_D4
7721         status = pthread_detach( &t );
7722 #else
7723         status = pthread_detach( t );
7724 #endif
7725
7726 #ifdef HAVE_LINUX_THREADS
7727         pthread_kill_other_threads_np();
7728 #endif
7729
7730         exit( status );
7731
7732 ; return 0; }
7733 EOF
7734 if { (eval echo configure:7735: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7735   rm -rf conftest*
7736   ol_cv_pthread_mthreads=yes
7737 else
7738   echo "configure: failed program was:" >&5
7739   cat conftest.$ac_ext >&5
7740   rm -rf conftest*
7741   ol_cv_pthread_mthreads=no
7742 fi
7743 rm -f conftest*
7744 else
7745   cat > conftest.$ac_ext <<EOF
7746 #line 7747 "configure"
7747 #include "confdefs.h"
7748 /* pthread test headers */
7749 #include <pthread.h>
7750 #ifndef NULL
7751 #define NULL (void*)0
7752 #endif
7753
7754 static void *task(p)
7755         void *p;
7756 {
7757         return (void *) (p == NULL);
7758 }
7759
7760
7761 int main(argc, argv)
7762         int argc;
7763         char **argv;
7764 {
7765
7766         /* pthread test function */
7767         pthread_t t;
7768         int status;
7769 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7770         /* This system (e.g. AIX) defaults detached; must override */
7771         pthread_attr_t attr;
7772
7773         status = pthread_attr_init(&attr);
7774         if( status ) exit( status );
7775
7776         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7777         if( status ) exit( status );
7778
7779 #define ATTR    &attr
7780 #else
7781 #if HAVE_PTHREADS_D4
7782 #define ATTR    pthread_attr_default
7783 #else
7784 #define ATTR    NULL
7785 #endif
7786 #endif
7787         /* make sure pthread_create() isn't just a stub */
7788         status = pthread_create(&t, ATTR, task, NULL);
7789         if( status ) exit( status );
7790
7791         /* make sure pthread_detach() isn't just a stub */
7792 #if HAVE_PTHREADS_D4
7793         status = pthread_detach( &t );
7794 #else
7795         status = pthread_detach( t );
7796 #endif
7797
7798 #ifdef HAVE_LINUX_THREADS
7799         pthread_kill_other_threads_np();
7800 #endif
7801
7802         exit( status );
7803
7804 }
7805
7806 EOF
7807 if { (eval echo configure:7808: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7808 then
7809   ol_cv_pthread_mthreads=yes
7810 else
7811   echo "configure: failed program was:" >&5
7812   cat conftest.$ac_ext >&5
7813   rm -fr conftest*
7814   ol_cv_pthread_mthreads=no
7815 fi
7816 rm -fr conftest*
7817 fi
7818
7819
7820                 # restore the LIBS
7821                 LIBS="$ol_LIBS"
7822         
7823 fi
7824
7825 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7826
7827         if test $ol_cv_pthread_mthreads = yes ; then
7828                 ol_link_pthreads="-mthreads"
7829                 ol_link_threads=posix
7830         fi
7831 fi
7832
7833                 # Pthread try link: -thread (ol_cv_pthread_thread)
7834 if test "$ol_link_threads" = no ; then
7835         # try -thread
7836         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7837 echo "configure:7838: checking for pthread link with -thread" >&5
7838 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7839   echo $ac_n "(cached) $ac_c" 1>&6
7840 else
7841   
7842                 # save the flags
7843                 ol_LIBS="$LIBS"
7844                 LIBS="-thread $LIBS"
7845
7846                 if test "$cross_compiling" = yes; then
7847   cat > conftest.$ac_ext <<EOF
7848 #line 7849 "configure"
7849 #include "confdefs.h"
7850 /* pthread test headers */
7851 #include <pthread.h>
7852 #ifndef NULL
7853 #define NULL (void*)0
7854 #endif
7855
7856 static void *task(p)
7857         void *p;
7858 {
7859         return (void *) (p == NULL);
7860 }
7861
7862 int main() {
7863
7864         /* pthread test function */
7865         pthread_t t;
7866         int status;
7867 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7868         /* This system (e.g. AIX) defaults detached; must override */
7869         pthread_attr_t attr;
7870
7871         status = pthread_attr_init(&attr);
7872         if( status ) exit( status );
7873
7874         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7875         if( status ) exit( status );
7876
7877 #define ATTR    &attr
7878 #else
7879 #if HAVE_PTHREADS_D4
7880 #define ATTR    pthread_attr_default
7881 #else
7882 #define ATTR    NULL
7883 #endif
7884 #endif
7885         /* make sure pthread_create() isn't just a stub */
7886         status = pthread_create(&t, ATTR, task, NULL);
7887         if( status ) exit( status );
7888
7889         /* make sure pthread_detach() isn't just a stub */
7890 #if HAVE_PTHREADS_D4
7891         status = pthread_detach( &t );
7892 #else
7893         status = pthread_detach( t );
7894 #endif
7895
7896 #ifdef HAVE_LINUX_THREADS
7897         pthread_kill_other_threads_np();
7898 #endif
7899
7900         exit( status );
7901
7902 ; return 0; }
7903 EOF
7904 if { (eval echo configure:7905: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7905   rm -rf conftest*
7906   ol_cv_pthread_thread=yes
7907 else
7908   echo "configure: failed program was:" >&5
7909   cat conftest.$ac_ext >&5
7910   rm -rf conftest*
7911   ol_cv_pthread_thread=no
7912 fi
7913 rm -f conftest*
7914 else
7915   cat > conftest.$ac_ext <<EOF
7916 #line 7917 "configure"
7917 #include "confdefs.h"
7918 /* pthread test headers */
7919 #include <pthread.h>
7920 #ifndef NULL
7921 #define NULL (void*)0
7922 #endif
7923
7924 static void *task(p)
7925         void *p;
7926 {
7927         return (void *) (p == NULL);
7928 }
7929
7930
7931 int main(argc, argv)
7932         int argc;
7933         char **argv;
7934 {
7935
7936         /* pthread test function */
7937         pthread_t t;
7938         int status;
7939 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7940         /* This system (e.g. AIX) defaults detached; must override */
7941         pthread_attr_t attr;
7942
7943         status = pthread_attr_init(&attr);
7944         if( status ) exit( status );
7945
7946         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7947         if( status ) exit( status );
7948
7949 #define ATTR    &attr
7950 #else
7951 #if HAVE_PTHREADS_D4
7952 #define ATTR    pthread_attr_default
7953 #else
7954 #define ATTR    NULL
7955 #endif
7956 #endif
7957         /* make sure pthread_create() isn't just a stub */
7958         status = pthread_create(&t, ATTR, task, NULL);
7959         if( status ) exit( status );
7960
7961         /* make sure pthread_detach() isn't just a stub */
7962 #if HAVE_PTHREADS_D4
7963         status = pthread_detach( &t );
7964 #else
7965         status = pthread_detach( t );
7966 #endif
7967
7968 #ifdef HAVE_LINUX_THREADS
7969         pthread_kill_other_threads_np();
7970 #endif
7971
7972         exit( status );
7973
7974 }
7975
7976 EOF
7977 if { (eval echo configure:7978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7978 then
7979   ol_cv_pthread_thread=yes
7980 else
7981   echo "configure: failed program was:" >&5
7982   cat conftest.$ac_ext >&5
7983   rm -fr conftest*
7984   ol_cv_pthread_thread=no
7985 fi
7986 rm -fr conftest*
7987 fi
7988
7989
7990                 # restore the LIBS
7991                 LIBS="$ol_LIBS"
7992         
7993 fi
7994
7995 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
7996
7997         if test $ol_cv_pthread_thread = yes ; then
7998                 ol_link_pthreads="-thread"
7999                 ol_link_threads=posix
8000         fi
8001 fi
8002
8003
8004                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8005 if test "$ol_link_threads" = no ; then
8006         # try -lpthread -lmach -lexc -lc_r
8007         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8008 echo "configure:8009: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8009 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8010   echo $ac_n "(cached) $ac_c" 1>&6
8011 else
8012   
8013                 # save the flags
8014                 ol_LIBS="$LIBS"
8015                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8016
8017                 if test "$cross_compiling" = yes; then
8018   cat > conftest.$ac_ext <<EOF
8019 #line 8020 "configure"
8020 #include "confdefs.h"
8021 /* pthread test headers */
8022 #include <pthread.h>
8023 #ifndef NULL
8024 #define NULL (void*)0
8025 #endif
8026
8027 static void *task(p)
8028         void *p;
8029 {
8030         return (void *) (p == NULL);
8031 }
8032
8033 int main() {
8034
8035         /* pthread test function */
8036         pthread_t t;
8037         int status;
8038 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8039         /* This system (e.g. AIX) defaults detached; must override */
8040         pthread_attr_t attr;
8041
8042         status = pthread_attr_init(&attr);
8043         if( status ) exit( status );
8044
8045         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8046         if( status ) exit( status );
8047
8048 #define ATTR    &attr
8049 #else
8050 #if HAVE_PTHREADS_D4
8051 #define ATTR    pthread_attr_default
8052 #else
8053 #define ATTR    NULL
8054 #endif
8055 #endif
8056         /* make sure pthread_create() isn't just a stub */
8057         status = pthread_create(&t, ATTR, task, NULL);
8058         if( status ) exit( status );
8059
8060         /* make sure pthread_detach() isn't just a stub */
8061 #if HAVE_PTHREADS_D4
8062         status = pthread_detach( &t );
8063 #else
8064         status = pthread_detach( t );
8065 #endif
8066
8067 #ifdef HAVE_LINUX_THREADS
8068         pthread_kill_other_threads_np();
8069 #endif
8070
8071         exit( status );
8072
8073 ; return 0; }
8074 EOF
8075 if { (eval echo configure:8076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8076   rm -rf conftest*
8077   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8078 else
8079   echo "configure: failed program was:" >&5
8080   cat conftest.$ac_ext >&5
8081   rm -rf conftest*
8082   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8083 fi
8084 rm -f conftest*
8085 else
8086   cat > conftest.$ac_ext <<EOF
8087 #line 8088 "configure"
8088 #include "confdefs.h"
8089 /* pthread test headers */
8090 #include <pthread.h>
8091 #ifndef NULL
8092 #define NULL (void*)0
8093 #endif
8094
8095 static void *task(p)
8096         void *p;
8097 {
8098         return (void *) (p == NULL);
8099 }
8100
8101
8102 int main(argc, argv)
8103         int argc;
8104         char **argv;
8105 {
8106
8107         /* pthread test function */
8108         pthread_t t;
8109         int status;
8110 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8111         /* This system (e.g. AIX) defaults detached; must override */
8112         pthread_attr_t attr;
8113
8114         status = pthread_attr_init(&attr);
8115         if( status ) exit( status );
8116
8117         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8118         if( status ) exit( status );
8119
8120 #define ATTR    &attr
8121 #else
8122 #if HAVE_PTHREADS_D4
8123 #define ATTR    pthread_attr_default
8124 #else
8125 #define ATTR    NULL
8126 #endif
8127 #endif
8128         /* make sure pthread_create() isn't just a stub */
8129         status = pthread_create(&t, ATTR, task, NULL);
8130         if( status ) exit( status );
8131
8132         /* make sure pthread_detach() isn't just a stub */
8133 #if HAVE_PTHREADS_D4
8134         status = pthread_detach( &t );
8135 #else
8136         status = pthread_detach( t );
8137 #endif
8138
8139 #ifdef HAVE_LINUX_THREADS
8140         pthread_kill_other_threads_np();
8141 #endif
8142
8143         exit( status );
8144
8145 }
8146
8147 EOF
8148 if { (eval echo configure:8149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8149 then
8150   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8151 else
8152   echo "configure: failed program was:" >&5
8153   cat conftest.$ac_ext >&5
8154   rm -fr conftest*
8155   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8156 fi
8157 rm -fr conftest*
8158 fi
8159
8160
8161                 # restore the LIBS
8162                 LIBS="$ol_LIBS"
8163         
8164 fi
8165
8166 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8167
8168         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8169                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8170                 ol_link_threads=posix
8171         fi
8172 fi
8173
8174                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8175 if test "$ol_link_threads" = no ; then
8176         # try -lpthread -lmach -lexc
8177         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8178 echo "configure:8179: checking for pthread link with -lpthread -lmach -lexc" >&5
8179 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8180   echo $ac_n "(cached) $ac_c" 1>&6
8181 else
8182   
8183                 # save the flags
8184                 ol_LIBS="$LIBS"
8185                 LIBS="-lpthread -lmach -lexc $LIBS"
8186
8187                 if test "$cross_compiling" = yes; then
8188   cat > conftest.$ac_ext <<EOF
8189 #line 8190 "configure"
8190 #include "confdefs.h"
8191 /* pthread test headers */
8192 #include <pthread.h>
8193 #ifndef NULL
8194 #define NULL (void*)0
8195 #endif
8196
8197 static void *task(p)
8198         void *p;
8199 {
8200         return (void *) (p == NULL);
8201 }
8202
8203 int main() {
8204
8205         /* pthread test function */
8206         pthread_t t;
8207         int status;
8208 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8209         /* This system (e.g. AIX) defaults detached; must override */
8210         pthread_attr_t attr;
8211
8212         status = pthread_attr_init(&attr);
8213         if( status ) exit( status );
8214
8215         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8216         if( status ) exit( status );
8217
8218 #define ATTR    &attr
8219 #else
8220 #if HAVE_PTHREADS_D4
8221 #define ATTR    pthread_attr_default
8222 #else
8223 #define ATTR    NULL
8224 #endif
8225 #endif
8226         /* make sure pthread_create() isn't just a stub */
8227         status = pthread_create(&t, ATTR, task, NULL);
8228         if( status ) exit( status );
8229
8230         /* make sure pthread_detach() isn't just a stub */
8231 #if HAVE_PTHREADS_D4
8232         status = pthread_detach( &t );
8233 #else
8234         status = pthread_detach( t );
8235 #endif
8236
8237 #ifdef HAVE_LINUX_THREADS
8238         pthread_kill_other_threads_np();
8239 #endif
8240
8241         exit( status );
8242
8243 ; return 0; }
8244 EOF
8245 if { (eval echo configure:8246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8246   rm -rf conftest*
8247   ol_cv_pthread_lpthread_lmach_lexc=yes
8248 else
8249   echo "configure: failed program was:" >&5
8250   cat conftest.$ac_ext >&5
8251   rm -rf conftest*
8252   ol_cv_pthread_lpthread_lmach_lexc=no
8253 fi
8254 rm -f conftest*
8255 else
8256   cat > conftest.$ac_ext <<EOF
8257 #line 8258 "configure"
8258 #include "confdefs.h"
8259 /* pthread test headers */
8260 #include <pthread.h>
8261 #ifndef NULL
8262 #define NULL (void*)0
8263 #endif
8264
8265 static void *task(p)
8266         void *p;
8267 {
8268         return (void *) (p == NULL);
8269 }
8270
8271
8272 int main(argc, argv)
8273         int argc;
8274         char **argv;
8275 {
8276
8277         /* pthread test function */
8278         pthread_t t;
8279         int status;
8280 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8281         /* This system (e.g. AIX) defaults detached; must override */
8282         pthread_attr_t attr;
8283
8284         status = pthread_attr_init(&attr);
8285         if( status ) exit( status );
8286
8287         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8288         if( status ) exit( status );
8289
8290 #define ATTR    &attr
8291 #else
8292 #if HAVE_PTHREADS_D4
8293 #define ATTR    pthread_attr_default
8294 #else
8295 #define ATTR    NULL
8296 #endif
8297 #endif
8298         /* make sure pthread_create() isn't just a stub */
8299         status = pthread_create(&t, ATTR, task, NULL);
8300         if( status ) exit( status );
8301
8302         /* make sure pthread_detach() isn't just a stub */
8303 #if HAVE_PTHREADS_D4
8304         status = pthread_detach( &t );
8305 #else
8306         status = pthread_detach( t );
8307 #endif
8308
8309 #ifdef HAVE_LINUX_THREADS
8310         pthread_kill_other_threads_np();
8311 #endif
8312
8313         exit( status );
8314
8315 }
8316
8317 EOF
8318 if { (eval echo configure:8319: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8319 then
8320   ol_cv_pthread_lpthread_lmach_lexc=yes
8321 else
8322   echo "configure: failed program was:" >&5
8323   cat conftest.$ac_ext >&5
8324   rm -fr conftest*
8325   ol_cv_pthread_lpthread_lmach_lexc=no
8326 fi
8327 rm -fr conftest*
8328 fi
8329
8330
8331                 # restore the LIBS
8332                 LIBS="$ol_LIBS"
8333         
8334 fi
8335
8336 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8337
8338         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8339                 ol_link_pthreads="-lpthread -lmach -lexc"
8340                 ol_link_threads=posix
8341         fi
8342 fi
8343
8344
8345                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8346 if test "$ol_link_threads" = no ; then
8347         # try -lpthread -Wl,-woff,85
8348         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8349 echo "configure:8350: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8350 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8351   echo $ac_n "(cached) $ac_c" 1>&6
8352 else
8353   
8354                 # save the flags
8355                 ol_LIBS="$LIBS"
8356                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8357
8358                 if test "$cross_compiling" = yes; then
8359   cat > conftest.$ac_ext <<EOF
8360 #line 8361 "configure"
8361 #include "confdefs.h"
8362 /* pthread test headers */
8363 #include <pthread.h>
8364 #ifndef NULL
8365 #define NULL (void*)0
8366 #endif
8367
8368 static void *task(p)
8369         void *p;
8370 {
8371         return (void *) (p == NULL);
8372 }
8373
8374 int main() {
8375
8376         /* pthread test function */
8377         pthread_t t;
8378         int status;
8379 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8380         /* This system (e.g. AIX) defaults detached; must override */
8381         pthread_attr_t attr;
8382
8383         status = pthread_attr_init(&attr);
8384         if( status ) exit( status );
8385
8386         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8387         if( status ) exit( status );
8388
8389 #define ATTR    &attr
8390 #else
8391 #if HAVE_PTHREADS_D4
8392 #define ATTR    pthread_attr_default
8393 #else
8394 #define ATTR    NULL
8395 #endif
8396 #endif
8397         /* make sure pthread_create() isn't just a stub */
8398         status = pthread_create(&t, ATTR, task, NULL);
8399         if( status ) exit( status );
8400
8401         /* make sure pthread_detach() isn't just a stub */
8402 #if HAVE_PTHREADS_D4
8403         status = pthread_detach( &t );
8404 #else
8405         status = pthread_detach( t );
8406 #endif
8407
8408 #ifdef HAVE_LINUX_THREADS
8409         pthread_kill_other_threads_np();
8410 #endif
8411
8412         exit( status );
8413
8414 ; return 0; }
8415 EOF
8416 if { (eval echo configure:8417: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8417   rm -rf conftest*
8418   ol_cv_pthread_lib_lpthread_woff=yes
8419 else
8420   echo "configure: failed program was:" >&5
8421   cat conftest.$ac_ext >&5
8422   rm -rf conftest*
8423   ol_cv_pthread_lib_lpthread_woff=no
8424 fi
8425 rm -f conftest*
8426 else
8427   cat > conftest.$ac_ext <<EOF
8428 #line 8429 "configure"
8429 #include "confdefs.h"
8430 /* pthread test headers */
8431 #include <pthread.h>
8432 #ifndef NULL
8433 #define NULL (void*)0
8434 #endif
8435
8436 static void *task(p)
8437         void *p;
8438 {
8439         return (void *) (p == NULL);
8440 }
8441
8442
8443 int main(argc, argv)
8444         int argc;
8445         char **argv;
8446 {
8447
8448         /* pthread test function */
8449         pthread_t t;
8450         int status;
8451 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8452         /* This system (e.g. AIX) defaults detached; must override */
8453         pthread_attr_t attr;
8454
8455         status = pthread_attr_init(&attr);
8456         if( status ) exit( status );
8457
8458         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8459         if( status ) exit( status );
8460
8461 #define ATTR    &attr
8462 #else
8463 #if HAVE_PTHREADS_D4
8464 #define ATTR    pthread_attr_default
8465 #else
8466 #define ATTR    NULL
8467 #endif
8468 #endif
8469         /* make sure pthread_create() isn't just a stub */
8470         status = pthread_create(&t, ATTR, task, NULL);
8471         if( status ) exit( status );
8472
8473         /* make sure pthread_detach() isn't just a stub */
8474 #if HAVE_PTHREADS_D4
8475         status = pthread_detach( &t );
8476 #else
8477         status = pthread_detach( t );
8478 #endif
8479
8480 #ifdef HAVE_LINUX_THREADS
8481         pthread_kill_other_threads_np();
8482 #endif
8483
8484         exit( status );
8485
8486 }
8487
8488 EOF
8489 if { (eval echo configure:8490: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8490 then
8491   ol_cv_pthread_lib_lpthread_woff=yes
8492 else
8493   echo "configure: failed program was:" >&5
8494   cat conftest.$ac_ext >&5
8495   rm -fr conftest*
8496   ol_cv_pthread_lib_lpthread_woff=no
8497 fi
8498 rm -fr conftest*
8499 fi
8500
8501
8502                 # restore the LIBS
8503                 LIBS="$ol_LIBS"
8504         
8505 fi
8506
8507 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
8508
8509         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
8510                 ol_link_pthreads="-lpthread -Wl,-woff,85"
8511                 ol_link_threads=posix
8512         fi
8513 fi
8514
8515
8516                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
8517 if test "$ol_link_threads" = no ; then
8518         # try -lpthread
8519         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
8520 echo "configure:8521: checking for pthread link with -lpthread" >&5
8521 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
8522   echo $ac_n "(cached) $ac_c" 1>&6
8523 else
8524   
8525                 # save the flags
8526                 ol_LIBS="$LIBS"
8527                 LIBS="-lpthread $LIBS"
8528
8529                 if test "$cross_compiling" = yes; then
8530   cat > conftest.$ac_ext <<EOF
8531 #line 8532 "configure"
8532 #include "confdefs.h"
8533 /* pthread test headers */
8534 #include <pthread.h>
8535 #ifndef NULL
8536 #define NULL (void*)0
8537 #endif
8538
8539 static void *task(p)
8540         void *p;
8541 {
8542         return (void *) (p == NULL);
8543 }
8544
8545 int main() {
8546
8547         /* pthread test function */
8548         pthread_t t;
8549         int status;
8550 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8551         /* This system (e.g. AIX) defaults detached; must override */
8552         pthread_attr_t attr;
8553
8554         status = pthread_attr_init(&attr);
8555         if( status ) exit( status );
8556
8557         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8558         if( status ) exit( status );
8559
8560 #define ATTR    &attr
8561 #else
8562 #if HAVE_PTHREADS_D4
8563 #define ATTR    pthread_attr_default
8564 #else
8565 #define ATTR    NULL
8566 #endif
8567 #endif
8568         /* make sure pthread_create() isn't just a stub */
8569         status = pthread_create(&t, ATTR, task, NULL);
8570         if( status ) exit( status );
8571
8572         /* make sure pthread_detach() isn't just a stub */
8573 #if HAVE_PTHREADS_D4
8574         status = pthread_detach( &t );
8575 #else
8576         status = pthread_detach( t );
8577 #endif
8578
8579 #ifdef HAVE_LINUX_THREADS
8580         pthread_kill_other_threads_np();
8581 #endif
8582
8583         exit( status );
8584
8585 ; return 0; }
8586 EOF
8587 if { (eval echo configure:8588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8588   rm -rf conftest*
8589   ol_cv_pthread_lpthread=yes
8590 else
8591   echo "configure: failed program was:" >&5
8592   cat conftest.$ac_ext >&5
8593   rm -rf conftest*
8594   ol_cv_pthread_lpthread=no
8595 fi
8596 rm -f conftest*
8597 else
8598   cat > conftest.$ac_ext <<EOF
8599 #line 8600 "configure"
8600 #include "confdefs.h"
8601 /* pthread test headers */
8602 #include <pthread.h>
8603 #ifndef NULL
8604 #define NULL (void*)0
8605 #endif
8606
8607 static void *task(p)
8608         void *p;
8609 {
8610         return (void *) (p == NULL);
8611 }
8612
8613
8614 int main(argc, argv)
8615         int argc;
8616         char **argv;
8617 {
8618
8619         /* pthread test function */
8620         pthread_t t;
8621         int status;
8622 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8623         /* This system (e.g. AIX) defaults detached; must override */
8624         pthread_attr_t attr;
8625
8626         status = pthread_attr_init(&attr);
8627         if( status ) exit( status );
8628
8629         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8630         if( status ) exit( status );
8631
8632 #define ATTR    &attr
8633 #else
8634 #if HAVE_PTHREADS_D4
8635 #define ATTR    pthread_attr_default
8636 #else
8637 #define ATTR    NULL
8638 #endif
8639 #endif
8640         /* make sure pthread_create() isn't just a stub */
8641         status = pthread_create(&t, ATTR, task, NULL);
8642         if( status ) exit( status );
8643
8644         /* make sure pthread_detach() isn't just a stub */
8645 #if HAVE_PTHREADS_D4
8646         status = pthread_detach( &t );
8647 #else
8648         status = pthread_detach( t );
8649 #endif
8650
8651 #ifdef HAVE_LINUX_THREADS
8652         pthread_kill_other_threads_np();
8653 #endif
8654
8655         exit( status );
8656
8657 }
8658
8659 EOF
8660 if { (eval echo configure:8661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8661 then
8662   ol_cv_pthread_lpthread=yes
8663 else
8664   echo "configure: failed program was:" >&5
8665   cat conftest.$ac_ext >&5
8666   rm -fr conftest*
8667   ol_cv_pthread_lpthread=no
8668 fi
8669 rm -fr conftest*
8670 fi
8671
8672
8673                 # restore the LIBS
8674                 LIBS="$ol_LIBS"
8675         
8676 fi
8677
8678 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
8679
8680         if test $ol_cv_pthread_lpthread = yes ; then
8681                 ol_link_pthreads="-lpthread"
8682                 ol_link_threads=posix
8683         fi
8684 fi
8685
8686                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
8687 if test "$ol_link_threads" = no ; then
8688         # try -lc_r
8689         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
8690 echo "configure:8691: checking for pthread link with -lc_r" >&5
8691 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
8692   echo $ac_n "(cached) $ac_c" 1>&6
8693 else
8694   
8695                 # save the flags
8696                 ol_LIBS="$LIBS"
8697                 LIBS="-lc_r $LIBS"
8698
8699                 if test "$cross_compiling" = yes; then
8700   cat > conftest.$ac_ext <<EOF
8701 #line 8702 "configure"
8702 #include "confdefs.h"
8703 /* pthread test headers */
8704 #include <pthread.h>
8705 #ifndef NULL
8706 #define NULL (void*)0
8707 #endif
8708
8709 static void *task(p)
8710         void *p;
8711 {
8712         return (void *) (p == NULL);
8713 }
8714
8715 int main() {
8716
8717         /* pthread test function */
8718         pthread_t t;
8719         int status;
8720 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8721         /* This system (e.g. AIX) defaults detached; must override */
8722         pthread_attr_t attr;
8723
8724         status = pthread_attr_init(&attr);
8725         if( status ) exit( status );
8726
8727         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8728         if( status ) exit( status );
8729
8730 #define ATTR    &attr
8731 #else
8732 #if HAVE_PTHREADS_D4
8733 #define ATTR    pthread_attr_default
8734 #else
8735 #define ATTR    NULL
8736 #endif
8737 #endif
8738         /* make sure pthread_create() isn't just a stub */
8739         status = pthread_create(&t, ATTR, task, NULL);
8740         if( status ) exit( status );
8741
8742         /* make sure pthread_detach() isn't just a stub */
8743 #if HAVE_PTHREADS_D4
8744         status = pthread_detach( &t );
8745 #else
8746         status = pthread_detach( t );
8747 #endif
8748
8749 #ifdef HAVE_LINUX_THREADS
8750         pthread_kill_other_threads_np();
8751 #endif
8752
8753         exit( status );
8754
8755 ; return 0; }
8756 EOF
8757 if { (eval echo configure:8758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8758   rm -rf conftest*
8759   ol_cv_pthread_lc_r=yes
8760 else
8761   echo "configure: failed program was:" >&5
8762   cat conftest.$ac_ext >&5
8763   rm -rf conftest*
8764   ol_cv_pthread_lc_r=no
8765 fi
8766 rm -f conftest*
8767 else
8768   cat > conftest.$ac_ext <<EOF
8769 #line 8770 "configure"
8770 #include "confdefs.h"
8771 /* pthread test headers */
8772 #include <pthread.h>
8773 #ifndef NULL
8774 #define NULL (void*)0
8775 #endif
8776
8777 static void *task(p)
8778         void *p;
8779 {
8780         return (void *) (p == NULL);
8781 }
8782
8783
8784 int main(argc, argv)
8785         int argc;
8786         char **argv;
8787 {
8788
8789         /* pthread test function */
8790         pthread_t t;
8791         int status;
8792 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8793         /* This system (e.g. AIX) defaults detached; must override */
8794         pthread_attr_t attr;
8795
8796         status = pthread_attr_init(&attr);
8797         if( status ) exit( status );
8798
8799         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8800         if( status ) exit( status );
8801
8802 #define ATTR    &attr
8803 #else
8804 #if HAVE_PTHREADS_D4
8805 #define ATTR    pthread_attr_default
8806 #else
8807 #define ATTR    NULL
8808 #endif
8809 #endif
8810         /* make sure pthread_create() isn't just a stub */
8811         status = pthread_create(&t, ATTR, task, NULL);
8812         if( status ) exit( status );
8813
8814         /* make sure pthread_detach() isn't just a stub */
8815 #if HAVE_PTHREADS_D4
8816         status = pthread_detach( &t );
8817 #else
8818         status = pthread_detach( t );
8819 #endif
8820
8821 #ifdef HAVE_LINUX_THREADS
8822         pthread_kill_other_threads_np();
8823 #endif
8824
8825         exit( status );
8826
8827 }
8828
8829 EOF
8830 if { (eval echo configure:8831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8831 then
8832   ol_cv_pthread_lc_r=yes
8833 else
8834   echo "configure: failed program was:" >&5
8835   cat conftest.$ac_ext >&5
8836   rm -fr conftest*
8837   ol_cv_pthread_lc_r=no
8838 fi
8839 rm -fr conftest*
8840 fi
8841
8842
8843                 # restore the LIBS
8844                 LIBS="$ol_LIBS"
8845         
8846 fi
8847
8848 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8849
8850         if test $ol_cv_pthread_lc_r = yes ; then
8851                 ol_link_pthreads="-lc_r"
8852                 ol_link_threads=posix
8853         fi
8854 fi
8855
8856
8857                 # Pthread try link: -threads (ol_cv_pthread_threads)
8858 if test "$ol_link_threads" = no ; then
8859         # try -threads
8860         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8861 echo "configure:8862: checking for pthread link with -threads" >&5
8862 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8863   echo $ac_n "(cached) $ac_c" 1>&6
8864 else
8865   
8866                 # save the flags
8867                 ol_LIBS="$LIBS"
8868                 LIBS="-threads $LIBS"
8869
8870                 if test "$cross_compiling" = yes; then
8871   cat > conftest.$ac_ext <<EOF
8872 #line 8873 "configure"
8873 #include "confdefs.h"
8874 /* pthread test headers */
8875 #include <pthread.h>
8876 #ifndef NULL
8877 #define NULL (void*)0
8878 #endif
8879
8880 static void *task(p)
8881         void *p;
8882 {
8883         return (void *) (p == NULL);
8884 }
8885
8886 int main() {
8887
8888         /* pthread test function */
8889         pthread_t t;
8890         int status;
8891 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8892         /* This system (e.g. AIX) defaults detached; must override */
8893         pthread_attr_t attr;
8894
8895         status = pthread_attr_init(&attr);
8896         if( status ) exit( status );
8897
8898         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8899         if( status ) exit( status );
8900
8901 #define ATTR    &attr
8902 #else
8903 #if HAVE_PTHREADS_D4
8904 #define ATTR    pthread_attr_default
8905 #else
8906 #define ATTR    NULL
8907 #endif
8908 #endif
8909         /* make sure pthread_create() isn't just a stub */
8910         status = pthread_create(&t, ATTR, task, NULL);
8911         if( status ) exit( status );
8912
8913         /* make sure pthread_detach() isn't just a stub */
8914 #if HAVE_PTHREADS_D4
8915         status = pthread_detach( &t );
8916 #else
8917         status = pthread_detach( t );
8918 #endif
8919
8920 #ifdef HAVE_LINUX_THREADS
8921         pthread_kill_other_threads_np();
8922 #endif
8923
8924         exit( status );
8925
8926 ; return 0; }
8927 EOF
8928 if { (eval echo configure:8929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8929   rm -rf conftest*
8930   ol_cv_pthread_threads=yes
8931 else
8932   echo "configure: failed program was:" >&5
8933   cat conftest.$ac_ext >&5
8934   rm -rf conftest*
8935   ol_cv_pthread_threads=no
8936 fi
8937 rm -f conftest*
8938 else
8939   cat > conftest.$ac_ext <<EOF
8940 #line 8941 "configure"
8941 #include "confdefs.h"
8942 /* pthread test headers */
8943 #include <pthread.h>
8944 #ifndef NULL
8945 #define NULL (void*)0
8946 #endif
8947
8948 static void *task(p)
8949         void *p;
8950 {
8951         return (void *) (p == NULL);
8952 }
8953
8954
8955 int main(argc, argv)
8956         int argc;
8957         char **argv;
8958 {
8959
8960         /* pthread test function */
8961         pthread_t t;
8962         int status;
8963 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8964         /* This system (e.g. AIX) defaults detached; must override */
8965         pthread_attr_t attr;
8966
8967         status = pthread_attr_init(&attr);
8968         if( status ) exit( status );
8969
8970         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8971         if( status ) exit( status );
8972
8973 #define ATTR    &attr
8974 #else
8975 #if HAVE_PTHREADS_D4
8976 #define ATTR    pthread_attr_default
8977 #else
8978 #define ATTR    NULL
8979 #endif
8980 #endif
8981         /* make sure pthread_create() isn't just a stub */
8982         status = pthread_create(&t, ATTR, task, NULL);
8983         if( status ) exit( status );
8984
8985         /* make sure pthread_detach() isn't just a stub */
8986 #if HAVE_PTHREADS_D4
8987         status = pthread_detach( &t );
8988 #else
8989         status = pthread_detach( t );
8990 #endif
8991
8992 #ifdef HAVE_LINUX_THREADS
8993         pthread_kill_other_threads_np();
8994 #endif
8995
8996         exit( status );
8997
8998 }
8999
9000 EOF
9001 if { (eval echo configure:9002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9002 then
9003   ol_cv_pthread_threads=yes
9004 else
9005   echo "configure: failed program was:" >&5
9006   cat conftest.$ac_ext >&5
9007   rm -fr conftest*
9008   ol_cv_pthread_threads=no
9009 fi
9010 rm -fr conftest*
9011 fi
9012
9013
9014                 # restore the LIBS
9015                 LIBS="$ol_LIBS"
9016         
9017 fi
9018
9019 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9020
9021         if test $ol_cv_pthread_threads = yes ; then
9022                 ol_link_pthreads="-threads"
9023                 ol_link_threads=posix
9024         fi
9025 fi
9026
9027
9028                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9029 if test "$ol_link_threads" = no ; then
9030         # try -lpthreads -lmach -lexc -lc_r
9031         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9032 echo "configure:9033: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9033 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9034   echo $ac_n "(cached) $ac_c" 1>&6
9035 else
9036   
9037                 # save the flags
9038                 ol_LIBS="$LIBS"
9039                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9040
9041                 if test "$cross_compiling" = yes; then
9042   cat > conftest.$ac_ext <<EOF
9043 #line 9044 "configure"
9044 #include "confdefs.h"
9045 /* pthread test headers */
9046 #include <pthread.h>
9047 #ifndef NULL
9048 #define NULL (void*)0
9049 #endif
9050
9051 static void *task(p)
9052         void *p;
9053 {
9054         return (void *) (p == NULL);
9055 }
9056
9057 int main() {
9058
9059         /* pthread test function */
9060         pthread_t t;
9061         int status;
9062 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9063         /* This system (e.g. AIX) defaults detached; must override */
9064         pthread_attr_t attr;
9065
9066         status = pthread_attr_init(&attr);
9067         if( status ) exit( status );
9068
9069         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9070         if( status ) exit( status );
9071
9072 #define ATTR    &attr
9073 #else
9074 #if HAVE_PTHREADS_D4
9075 #define ATTR    pthread_attr_default
9076 #else
9077 #define ATTR    NULL
9078 #endif
9079 #endif
9080         /* make sure pthread_create() isn't just a stub */
9081         status = pthread_create(&t, ATTR, task, NULL);
9082         if( status ) exit( status );
9083
9084         /* make sure pthread_detach() isn't just a stub */
9085 #if HAVE_PTHREADS_D4
9086         status = pthread_detach( &t );
9087 #else
9088         status = pthread_detach( t );
9089 #endif
9090
9091 #ifdef HAVE_LINUX_THREADS
9092         pthread_kill_other_threads_np();
9093 #endif
9094
9095         exit( status );
9096
9097 ; return 0; }
9098 EOF
9099 if { (eval echo configure:9100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9100   rm -rf conftest*
9101   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9102 else
9103   echo "configure: failed program was:" >&5
9104   cat conftest.$ac_ext >&5
9105   rm -rf conftest*
9106   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9107 fi
9108 rm -f conftest*
9109 else
9110   cat > conftest.$ac_ext <<EOF
9111 #line 9112 "configure"
9112 #include "confdefs.h"
9113 /* pthread test headers */
9114 #include <pthread.h>
9115 #ifndef NULL
9116 #define NULL (void*)0
9117 #endif
9118
9119 static void *task(p)
9120         void *p;
9121 {
9122         return (void *) (p == NULL);
9123 }
9124
9125
9126 int main(argc, argv)
9127         int argc;
9128         char **argv;
9129 {
9130
9131         /* pthread test function */
9132         pthread_t t;
9133         int status;
9134 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9135         /* This system (e.g. AIX) defaults detached; must override */
9136         pthread_attr_t attr;
9137
9138         status = pthread_attr_init(&attr);
9139         if( status ) exit( status );
9140
9141         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9142         if( status ) exit( status );
9143
9144 #define ATTR    &attr
9145 #else
9146 #if HAVE_PTHREADS_D4
9147 #define ATTR    pthread_attr_default
9148 #else
9149 #define ATTR    NULL
9150 #endif
9151 #endif
9152         /* make sure pthread_create() isn't just a stub */
9153         status = pthread_create(&t, ATTR, task, NULL);
9154         if( status ) exit( status );
9155
9156         /* make sure pthread_detach() isn't just a stub */
9157 #if HAVE_PTHREADS_D4
9158         status = pthread_detach( &t );
9159 #else
9160         status = pthread_detach( t );
9161 #endif
9162
9163 #ifdef HAVE_LINUX_THREADS
9164         pthread_kill_other_threads_np();
9165 #endif
9166
9167         exit( status );
9168
9169 }
9170
9171 EOF
9172 if { (eval echo configure:9173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9173 then
9174   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9175 else
9176   echo "configure: failed program was:" >&5
9177   cat conftest.$ac_ext >&5
9178   rm -fr conftest*
9179   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9180 fi
9181 rm -fr conftest*
9182 fi
9183
9184
9185                 # restore the LIBS
9186                 LIBS="$ol_LIBS"
9187         
9188 fi
9189
9190 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9191
9192         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9193                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9194                 ol_link_threads=posix
9195         fi
9196 fi
9197
9198                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9199 if test "$ol_link_threads" = no ; then
9200         # try -lpthreads -lmach -lexc
9201         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9202 echo "configure:9203: checking for pthread link with -lpthreads -lmach -lexc" >&5
9203 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9204   echo $ac_n "(cached) $ac_c" 1>&6
9205 else
9206   
9207                 # save the flags
9208                 ol_LIBS="$LIBS"
9209                 LIBS="-lpthreads -lmach -lexc $LIBS"
9210
9211                 if test "$cross_compiling" = yes; then
9212   cat > conftest.$ac_ext <<EOF
9213 #line 9214 "configure"
9214 #include "confdefs.h"
9215 /* pthread test headers */
9216 #include <pthread.h>
9217 #ifndef NULL
9218 #define NULL (void*)0
9219 #endif
9220
9221 static void *task(p)
9222         void *p;
9223 {
9224         return (void *) (p == NULL);
9225 }
9226
9227 int main() {
9228
9229         /* pthread test function */
9230         pthread_t t;
9231         int status;
9232 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9233         /* This system (e.g. AIX) defaults detached; must override */
9234         pthread_attr_t attr;
9235
9236         status = pthread_attr_init(&attr);
9237         if( status ) exit( status );
9238
9239         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9240         if( status ) exit( status );
9241
9242 #define ATTR    &attr
9243 #else
9244 #if HAVE_PTHREADS_D4
9245 #define ATTR    pthread_attr_default
9246 #else
9247 #define ATTR    NULL
9248 #endif
9249 #endif
9250         /* make sure pthread_create() isn't just a stub */
9251         status = pthread_create(&t, ATTR, task, NULL);
9252         if( status ) exit( status );
9253
9254         /* make sure pthread_detach() isn't just a stub */
9255 #if HAVE_PTHREADS_D4
9256         status = pthread_detach( &t );
9257 #else
9258         status = pthread_detach( t );
9259 #endif
9260
9261 #ifdef HAVE_LINUX_THREADS
9262         pthread_kill_other_threads_np();
9263 #endif
9264
9265         exit( status );
9266
9267 ; return 0; }
9268 EOF
9269 if { (eval echo configure:9270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9270   rm -rf conftest*
9271   ol_cv_pthread_lpthreads_lmach_lexc=yes
9272 else
9273   echo "configure: failed program was:" >&5
9274   cat conftest.$ac_ext >&5
9275   rm -rf conftest*
9276   ol_cv_pthread_lpthreads_lmach_lexc=no
9277 fi
9278 rm -f conftest*
9279 else
9280   cat > conftest.$ac_ext <<EOF
9281 #line 9282 "configure"
9282 #include "confdefs.h"
9283 /* pthread test headers */
9284 #include <pthread.h>
9285 #ifndef NULL
9286 #define NULL (void*)0
9287 #endif
9288
9289 static void *task(p)
9290         void *p;
9291 {
9292         return (void *) (p == NULL);
9293 }
9294
9295
9296 int main(argc, argv)
9297         int argc;
9298         char **argv;
9299 {
9300
9301         /* pthread test function */
9302         pthread_t t;
9303         int status;
9304 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9305         /* This system (e.g. AIX) defaults detached; must override */
9306         pthread_attr_t attr;
9307
9308         status = pthread_attr_init(&attr);
9309         if( status ) exit( status );
9310
9311         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9312         if( status ) exit( status );
9313
9314 #define ATTR    &attr
9315 #else
9316 #if HAVE_PTHREADS_D4
9317 #define ATTR    pthread_attr_default
9318 #else
9319 #define ATTR    NULL
9320 #endif
9321 #endif
9322         /* make sure pthread_create() isn't just a stub */
9323         status = pthread_create(&t, ATTR, task, NULL);
9324         if( status ) exit( status );
9325
9326         /* make sure pthread_detach() isn't just a stub */
9327 #if HAVE_PTHREADS_D4
9328         status = pthread_detach( &t );
9329 #else
9330         status = pthread_detach( t );
9331 #endif
9332
9333 #ifdef HAVE_LINUX_THREADS
9334         pthread_kill_other_threads_np();
9335 #endif
9336
9337         exit( status );
9338
9339 }
9340
9341 EOF
9342 if { (eval echo configure:9343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9343 then
9344   ol_cv_pthread_lpthreads_lmach_lexc=yes
9345 else
9346   echo "configure: failed program was:" >&5
9347   cat conftest.$ac_ext >&5
9348   rm -fr conftest*
9349   ol_cv_pthread_lpthreads_lmach_lexc=no
9350 fi
9351 rm -fr conftest*
9352 fi
9353
9354
9355                 # restore the LIBS
9356                 LIBS="$ol_LIBS"
9357         
9358 fi
9359
9360 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9361
9362         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
9363                 ol_link_pthreads="-lpthreads -lmach -lexc"
9364                 ol_link_threads=posix
9365         fi
9366 fi
9367
9368                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
9369 if test "$ol_link_threads" = no ; then
9370         # try -lpthreads -lexc
9371         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
9372 echo "configure:9373: checking for pthread link with -lpthreads -lexc" >&5
9373 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
9374   echo $ac_n "(cached) $ac_c" 1>&6
9375 else
9376   
9377                 # save the flags
9378                 ol_LIBS="$LIBS"
9379                 LIBS="-lpthreads -lexc $LIBS"
9380
9381                 if test "$cross_compiling" = yes; then
9382   cat > conftest.$ac_ext <<EOF
9383 #line 9384 "configure"
9384 #include "confdefs.h"
9385 /* pthread test headers */
9386 #include <pthread.h>
9387 #ifndef NULL
9388 #define NULL (void*)0
9389 #endif
9390
9391 static void *task(p)
9392         void *p;
9393 {
9394         return (void *) (p == NULL);
9395 }
9396
9397 int main() {
9398
9399         /* pthread test function */
9400         pthread_t t;
9401         int status;
9402 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9403         /* This system (e.g. AIX) defaults detached; must override */
9404         pthread_attr_t attr;
9405
9406         status = pthread_attr_init(&attr);
9407         if( status ) exit( status );
9408
9409         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9410         if( status ) exit( status );
9411
9412 #define ATTR    &attr
9413 #else
9414 #if HAVE_PTHREADS_D4
9415 #define ATTR    pthread_attr_default
9416 #else
9417 #define ATTR    NULL
9418 #endif
9419 #endif
9420         /* make sure pthread_create() isn't just a stub */
9421         status = pthread_create(&t, ATTR, task, NULL);
9422         if( status ) exit( status );
9423
9424         /* make sure pthread_detach() isn't just a stub */
9425 #if HAVE_PTHREADS_D4
9426         status = pthread_detach( &t );
9427 #else
9428         status = pthread_detach( t );
9429 #endif
9430
9431 #ifdef HAVE_LINUX_THREADS
9432         pthread_kill_other_threads_np();
9433 #endif
9434
9435         exit( status );
9436
9437 ; return 0; }
9438 EOF
9439 if { (eval echo configure:9440: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9440   rm -rf conftest*
9441   ol_cv_pthread_lpthreads_lexc=yes
9442 else
9443   echo "configure: failed program was:" >&5
9444   cat conftest.$ac_ext >&5
9445   rm -rf conftest*
9446   ol_cv_pthread_lpthreads_lexc=no
9447 fi
9448 rm -f conftest*
9449 else
9450   cat > conftest.$ac_ext <<EOF
9451 #line 9452 "configure"
9452 #include "confdefs.h"
9453 /* pthread test headers */
9454 #include <pthread.h>
9455 #ifndef NULL
9456 #define NULL (void*)0
9457 #endif
9458
9459 static void *task(p)
9460         void *p;
9461 {
9462         return (void *) (p == NULL);
9463 }
9464
9465
9466 int main(argc, argv)
9467         int argc;
9468         char **argv;
9469 {
9470
9471         /* pthread test function */
9472         pthread_t t;
9473         int status;
9474 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9475         /* This system (e.g. AIX) defaults detached; must override */
9476         pthread_attr_t attr;
9477
9478         status = pthread_attr_init(&attr);
9479         if( status ) exit( status );
9480
9481         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9482         if( status ) exit( status );
9483
9484 #define ATTR    &attr
9485 #else
9486 #if HAVE_PTHREADS_D4
9487 #define ATTR    pthread_attr_default
9488 #else
9489 #define ATTR    NULL
9490 #endif
9491 #endif
9492         /* make sure pthread_create() isn't just a stub */
9493         status = pthread_create(&t, ATTR, task, NULL);
9494         if( status ) exit( status );
9495
9496         /* make sure pthread_detach() isn't just a stub */
9497 #if HAVE_PTHREADS_D4
9498         status = pthread_detach( &t );
9499 #else
9500         status = pthread_detach( t );
9501 #endif
9502
9503 #ifdef HAVE_LINUX_THREADS
9504         pthread_kill_other_threads_np();
9505 #endif
9506
9507         exit( status );
9508
9509 }
9510
9511 EOF
9512 if { (eval echo configure:9513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9513 then
9514   ol_cv_pthread_lpthreads_lexc=yes
9515 else
9516   echo "configure: failed program was:" >&5
9517   cat conftest.$ac_ext >&5
9518   rm -fr conftest*
9519   ol_cv_pthread_lpthreads_lexc=no
9520 fi
9521 rm -fr conftest*
9522 fi
9523
9524
9525                 # restore the LIBS
9526                 LIBS="$ol_LIBS"
9527         
9528 fi
9529
9530 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
9531
9532         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
9533                 ol_link_pthreads="-lpthreads -lexc"
9534                 ol_link_threads=posix
9535         fi
9536 fi
9537
9538
9539                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
9540 if test "$ol_link_threads" = no ; then
9541         # try -lpthreads
9542         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
9543 echo "configure:9544: checking for pthread link with -lpthreads" >&5
9544 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
9545   echo $ac_n "(cached) $ac_c" 1>&6
9546 else
9547   
9548                 # save the flags
9549                 ol_LIBS="$LIBS"
9550                 LIBS="-lpthreads $LIBS"
9551
9552                 if test "$cross_compiling" = yes; then
9553   cat > conftest.$ac_ext <<EOF
9554 #line 9555 "configure"
9555 #include "confdefs.h"
9556 /* pthread test headers */
9557 #include <pthread.h>
9558 #ifndef NULL
9559 #define NULL (void*)0
9560 #endif
9561
9562 static void *task(p)
9563         void *p;
9564 {
9565         return (void *) (p == NULL);
9566 }
9567
9568 int main() {
9569
9570         /* pthread test function */
9571         pthread_t t;
9572         int status;
9573 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9574         /* This system (e.g. AIX) defaults detached; must override */
9575         pthread_attr_t attr;
9576
9577         status = pthread_attr_init(&attr);
9578         if( status ) exit( status );
9579
9580         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9581         if( status ) exit( status );
9582
9583 #define ATTR    &attr
9584 #else
9585 #if HAVE_PTHREADS_D4
9586 #define ATTR    pthread_attr_default
9587 #else
9588 #define ATTR    NULL
9589 #endif
9590 #endif
9591         /* make sure pthread_create() isn't just a stub */
9592         status = pthread_create(&t, ATTR, task, NULL);
9593         if( status ) exit( status );
9594
9595         /* make sure pthread_detach() isn't just a stub */
9596 #if HAVE_PTHREADS_D4
9597         status = pthread_detach( &t );
9598 #else
9599         status = pthread_detach( t );
9600 #endif
9601
9602 #ifdef HAVE_LINUX_THREADS
9603         pthread_kill_other_threads_np();
9604 #endif
9605
9606         exit( status );
9607
9608 ; return 0; }
9609 EOF
9610 if { (eval echo configure:9611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9611   rm -rf conftest*
9612   ol_cv_pthread_lib_lpthreads=yes
9613 else
9614   echo "configure: failed program was:" >&5
9615   cat conftest.$ac_ext >&5
9616   rm -rf conftest*
9617   ol_cv_pthread_lib_lpthreads=no
9618 fi
9619 rm -f conftest*
9620 else
9621   cat > conftest.$ac_ext <<EOF
9622 #line 9623 "configure"
9623 #include "confdefs.h"
9624 /* pthread test headers */
9625 #include <pthread.h>
9626 #ifndef NULL
9627 #define NULL (void*)0
9628 #endif
9629
9630 static void *task(p)
9631         void *p;
9632 {
9633         return (void *) (p == NULL);
9634 }
9635
9636
9637 int main(argc, argv)
9638         int argc;
9639         char **argv;
9640 {
9641
9642         /* pthread test function */
9643         pthread_t t;
9644         int status;
9645 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9646         /* This system (e.g. AIX) defaults detached; must override */
9647         pthread_attr_t attr;
9648
9649         status = pthread_attr_init(&attr);
9650         if( status ) exit( status );
9651
9652         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9653         if( status ) exit( status );
9654
9655 #define ATTR    &attr
9656 #else
9657 #if HAVE_PTHREADS_D4
9658 #define ATTR    pthread_attr_default
9659 #else
9660 #define ATTR    NULL
9661 #endif
9662 #endif
9663         /* make sure pthread_create() isn't just a stub */
9664         status = pthread_create(&t, ATTR, task, NULL);
9665         if( status ) exit( status );
9666
9667         /* make sure pthread_detach() isn't just a stub */
9668 #if HAVE_PTHREADS_D4
9669         status = pthread_detach( &t );
9670 #else
9671         status = pthread_detach( t );
9672 #endif
9673
9674 #ifdef HAVE_LINUX_THREADS
9675         pthread_kill_other_threads_np();
9676 #endif
9677
9678         exit( status );
9679
9680 }
9681
9682 EOF
9683 if { (eval echo configure:9684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9684 then
9685   ol_cv_pthread_lib_lpthreads=yes
9686 else
9687   echo "configure: failed program was:" >&5
9688   cat conftest.$ac_ext >&5
9689   rm -fr conftest*
9690   ol_cv_pthread_lib_lpthreads=no
9691 fi
9692 rm -fr conftest*
9693 fi
9694
9695
9696                 # restore the LIBS
9697                 LIBS="$ol_LIBS"
9698         
9699 fi
9700
9701 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
9702
9703         if test $ol_cv_pthread_lib_lpthreads = yes ; then
9704                 ol_link_pthreads="-lpthreads"
9705                 ol_link_threads=posix
9706         fi
9707 fi
9708
9709
9710                 if test $ol_link_threads != no ; then
9711                         cat >> confdefs.h <<\EOF
9712 #define HAVE_PTHREADS 1
9713 EOF
9714
9715
9716                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
9717
9718                                                 save_CPPFLAGS="$CPPFLAGS"
9719                         save_LIBS="$LIBS"
9720                         LIBS="$LTHREAD_LIBS $LIBS"
9721
9722                                                                                                 for ac_func in sched_yield pthread_yield
9723 do
9724 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9725 echo "configure:9726: checking for $ac_func" >&5
9726 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9727   echo $ac_n "(cached) $ac_c" 1>&6
9728 else
9729   cat > conftest.$ac_ext <<EOF
9730 #line 9731 "configure"
9731 #include "confdefs.h"
9732 /* System header to define __stub macros and hopefully few prototypes,
9733     which can conflict with char $ac_func(); below.  */
9734 #include <assert.h>
9735 /* Override any gcc2 internal prototype to avoid an error.  */
9736 /* We use char because int might match the return type of a gcc2
9737     builtin and then its argument prototype would still apply.  */
9738 char $ac_func();
9739 char (*f)();
9740
9741 int main() {
9742
9743 /* The GNU C library defines this for functions which it implements
9744     to always fail with ENOSYS.  Some functions are actually named
9745     something starting with __ and the normal name is an alias.  */
9746 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9747 choke me
9748 #else
9749 f = $ac_func;
9750 #endif
9751
9752 ; return 0; }
9753 EOF
9754 if { (eval echo configure:9755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9755   rm -rf conftest*
9756   eval "ac_cv_func_$ac_func=yes"
9757 else
9758   echo "configure: failed program was:" >&5
9759   cat conftest.$ac_ext >&5
9760   rm -rf conftest*
9761   eval "ac_cv_func_$ac_func=no"
9762 fi
9763 rm -f conftest*
9764 fi
9765
9766 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9767   echo "$ac_t""yes" 1>&6
9768     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9769   cat >> confdefs.h <<EOF
9770 #define $ac_tr_func 1
9771 EOF
9772  
9773 else
9774   echo "$ac_t""no" 1>&6
9775 fi
9776 done
9777
9778
9779                         if test $ac_cv_func_sched_yield = no -a \
9780                                 $ac_cv_func_pthread_yield = no ; then
9781                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
9782 echo "configure:9783: checking for sched_yield in -lrt" >&5
9783 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
9784 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9785   echo $ac_n "(cached) $ac_c" 1>&6
9786 else
9787   ac_save_LIBS="$LIBS"
9788 LIBS="-lrt  $LIBS"
9789 cat > conftest.$ac_ext <<EOF
9790 #line 9791 "configure"
9791 #include "confdefs.h"
9792 /* Override any gcc2 internal prototype to avoid an error.  */
9793 /* We use char because int might match the return type of a gcc2
9794     builtin and then its argument prototype would still apply.  */
9795 char sched_yield();
9796
9797 int main() {
9798 sched_yield()
9799 ; return 0; }
9800 EOF
9801 if { (eval echo configure:9802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9802   rm -rf conftest*
9803   eval "ac_cv_lib_$ac_lib_var=yes"
9804 else
9805   echo "configure: failed program was:" >&5
9806   cat conftest.$ac_ext >&5
9807   rm -rf conftest*
9808   eval "ac_cv_lib_$ac_lib_var=no"
9809 fi
9810 rm -f conftest*
9811 LIBS="$ac_save_LIBS"
9812
9813 fi
9814 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9815   echo "$ac_t""yes" 1>&6
9816   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
9817                                         cat >> confdefs.h <<\EOF
9818 #define HAVE_SCHED_YIELD 1
9819 EOF
9820
9821                                         ac_cv_func_sched_yield=yes
9822 else
9823   echo "$ac_t""no" 1>&6
9824 ac_cv_func_sched_yield=no
9825 fi
9826
9827                         fi
9828                         if test $ac_cv_func_sched_yield = no -a \
9829                                 $ac_cv_func_pthread_yield = no ; then
9830                                                                                                 for ac_func in thr_yield
9831 do
9832 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9833 echo "configure:9834: checking for $ac_func" >&5
9834 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9835   echo $ac_n "(cached) $ac_c" 1>&6
9836 else
9837   cat > conftest.$ac_ext <<EOF
9838 #line 9839 "configure"
9839 #include "confdefs.h"
9840 /* System header to define __stub macros and hopefully few prototypes,
9841     which can conflict with char $ac_func(); below.  */
9842 #include <assert.h>
9843 /* Override any gcc2 internal prototype to avoid an error.  */
9844 /* We use char because int might match the return type of a gcc2
9845     builtin and then its argument prototype would still apply.  */
9846 char $ac_func();
9847 char (*f)();
9848
9849 int main() {
9850
9851 /* The GNU C library defines this for functions which it implements
9852     to always fail with ENOSYS.  Some functions are actually named
9853     something starting with __ and the normal name is an alias.  */
9854 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9855 choke me
9856 #else
9857 f = $ac_func;
9858 #endif
9859
9860 ; return 0; }
9861 EOF
9862 if { (eval echo configure:9863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9863   rm -rf conftest*
9864   eval "ac_cv_func_$ac_func=yes"
9865 else
9866   echo "configure: failed program was:" >&5
9867   cat conftest.$ac_ext >&5
9868   rm -rf conftest*
9869   eval "ac_cv_func_$ac_func=no"
9870 fi
9871 rm -f conftest*
9872 fi
9873
9874 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9875   echo "$ac_t""yes" 1>&6
9876     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9877   cat >> confdefs.h <<EOF
9878 #define $ac_tr_func 1
9879 EOF
9880  
9881 else
9882   echo "$ac_t""no" 1>&6
9883 fi
9884 done
9885
9886                         fi
9887                         if test $ac_cv_func_sched_yield = no -a \
9888                                 $ac_cv_func_pthread_yield = no -a \
9889                                 "$ac_cv_func_thr_yield" = no ; then
9890                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9891                         fi
9892
9893                                                 for ac_func in pthread_kill pthread_rwlock_destroy
9894 do
9895 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9896 echo "configure:9897: checking for $ac_func" >&5
9897 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9898   echo $ac_n "(cached) $ac_c" 1>&6
9899 else
9900   cat > conftest.$ac_ext <<EOF
9901 #line 9902 "configure"
9902 #include "confdefs.h"
9903 /* System header to define __stub macros and hopefully few prototypes,
9904     which can conflict with char $ac_func(); below.  */
9905 #include <assert.h>
9906 /* Override any gcc2 internal prototype to avoid an error.  */
9907 /* We use char because int might match the return type of a gcc2
9908     builtin and then its argument prototype would still apply.  */
9909 char $ac_func();
9910 char (*f)();
9911
9912 int main() {
9913
9914 /* The GNU C library defines this for functions which it implements
9915     to always fail with ENOSYS.  Some functions are actually named
9916     something starting with __ and the normal name is an alias.  */
9917 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9918 choke me
9919 #else
9920 f = $ac_func;
9921 #endif
9922
9923 ; return 0; }
9924 EOF
9925 if { (eval echo configure:9926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9926   rm -rf conftest*
9927   eval "ac_cv_func_$ac_func=yes"
9928 else
9929   echo "configure: failed program was:" >&5
9930   cat conftest.$ac_ext >&5
9931   rm -rf conftest*
9932   eval "ac_cv_func_$ac_func=no"
9933 fi
9934 rm -f conftest*
9935 fi
9936
9937 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9938   echo "$ac_t""yes" 1>&6
9939     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9940   cat >> confdefs.h <<EOF
9941 #define $ac_tr_func 1
9942 EOF
9943  
9944 else
9945   echo "$ac_t""no" 1>&6
9946 fi
9947 done
9948
9949
9950                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9951 echo "configure:9952: checking for pthread_detach with <pthread.h>" >&5
9952 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9953   echo $ac_n "(cached) $ac_c" 1>&6
9954 else
9955   
9956                                                                 cat > conftest.$ac_ext <<EOF
9957 #line 9958 "configure"
9958 #include "confdefs.h"
9959
9960 #include <pthread.h>
9961 #ifndef NULL
9962 #define NULL (void*)0
9963 #endif
9964
9965 int main() {
9966 pthread_detach(NULL);
9967 ; return 0; }
9968 EOF
9969 if { (eval echo configure:9970: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9970   rm -rf conftest*
9971   ol_cv_func_pthread_detach=yes
9972 else
9973   echo "configure: failed program was:" >&5
9974   cat conftest.$ac_ext >&5
9975   rm -rf conftest*
9976   ol_cv_func_pthread_detach=no
9977 fi
9978 rm -f conftest*
9979                         
9980 fi
9981
9982 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9983
9984                         if test $ol_cv_func_pthread_detach = no ; then
9985                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9986                         fi
9987
9988                         cat >> confdefs.h <<\EOF
9989 #define HAVE_PTHREAD_DETACH 1
9990 EOF
9991
9992
9993                                                 for ac_func in \
9994                                 pthread_setconcurrency \
9995                                 pthread_getconcurrency \
9996                                 thr_setconcurrency \
9997                                 thr_getconcurrency \
9998                         
9999 do
10000 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10001 echo "configure:10002: checking for $ac_func" >&5
10002 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10003   echo $ac_n "(cached) $ac_c" 1>&6
10004 else
10005   cat > conftest.$ac_ext <<EOF
10006 #line 10007 "configure"
10007 #include "confdefs.h"
10008 /* System header to define __stub macros and hopefully few prototypes,
10009     which can conflict with char $ac_func(); below.  */
10010 #include <assert.h>
10011 /* Override any gcc2 internal prototype to avoid an error.  */
10012 /* We use char because int might match the return type of a gcc2
10013     builtin and then its argument prototype would still apply.  */
10014 char $ac_func();
10015 char (*f)();
10016
10017 int main() {
10018
10019 /* The GNU C library defines this for functions which it implements
10020     to always fail with ENOSYS.  Some functions are actually named
10021     something starting with __ and the normal name is an alias.  */
10022 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10023 choke me
10024 #else
10025 f = $ac_func;
10026 #endif
10027
10028 ; return 0; }
10029 EOF
10030 if { (eval echo configure:10031: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10031   rm -rf conftest*
10032   eval "ac_cv_func_$ac_func=yes"
10033 else
10034   echo "configure: failed program was:" >&5
10035   cat conftest.$ac_ext >&5
10036   rm -rf conftest*
10037   eval "ac_cv_func_$ac_func=no"
10038 fi
10039 rm -f conftest*
10040 fi
10041
10042 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10043   echo "$ac_t""yes" 1>&6
10044     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10045   cat >> confdefs.h <<EOF
10046 #define $ac_tr_func 1
10047 EOF
10048  
10049 else
10050   echo "$ac_t""no" 1>&6
10051 fi
10052 done
10053
10054
10055                         
10056         echo $ac_n "checking for pthread_kill_other_threads_np""... $ac_c" 1>&6
10057 echo "configure:10058: checking for pthread_kill_other_threads_np" >&5
10058 if eval "test \"\${ac_cv_func_pthread_kill_other_threads_np+set}\" = set"; then
10059   echo $ac_n "(cached) $ac_c" 1>&6
10060 else
10061   cat > conftest.$ac_ext <<EOF
10062 #line 10063 "configure"
10063 #include "confdefs.h"
10064 /* System header to define __stub macros and hopefully few prototypes,
10065     which can conflict with char pthread_kill_other_threads_np(); below.  */
10066 #include <assert.h>
10067 /* Override any gcc2 internal prototype to avoid an error.  */
10068 /* We use char because int might match the return type of a gcc2
10069     builtin and then its argument prototype would still apply.  */
10070 char pthread_kill_other_threads_np();
10071 char (*f)();
10072
10073 int main() {
10074
10075 /* The GNU C library defines this for functions which it implements
10076     to always fail with ENOSYS.  Some functions are actually named
10077     something starting with __ and the normal name is an alias.  */
10078 #if defined (__stub_pthread_kill_other_threads_np) || defined (__stub___pthread_kill_other_threads_np)
10079 choke me
10080 #else
10081 f = pthread_kill_other_threads_np;
10082 #endif
10083
10084 ; return 0; }
10085 EOF
10086 if { (eval echo configure:10087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10087   rm -rf conftest*
10088   eval "ac_cv_func_pthread_kill_other_threads_np=yes"
10089 else
10090   echo "configure: failed program was:" >&5
10091   cat conftest.$ac_ext >&5
10092   rm -rf conftest*
10093   eval "ac_cv_func_pthread_kill_other_threads_np=no"
10094 fi
10095 rm -f conftest*
10096 fi
10097
10098 if eval "test \"`echo '$ac_cv_func_'pthread_kill_other_threads_np`\" = yes"; then
10099   echo "$ac_t""yes" 1>&6
10100   :
10101 else
10102   echo "$ac_t""no" 1>&6
10103 fi
10104
10105         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10106 echo "configure:10107: checking for LinuxThreads implementation" >&5
10107 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10108   echo $ac_n "(cached) $ac_c" 1>&6
10109 else
10110   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10111 fi
10112
10113 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10114
10115                         
10116         
10117         
10118         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10119 echo "configure:10120: checking for LinuxThreads consistency" >&5
10120 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10121   echo $ac_n "(cached) $ac_c" 1>&6
10122 else
10123   
10124                 if test $ol_cv_header_linux_threads = yes -a \
10125                         $ol_cv_sys_linux_threads = yes; then
10126                         ol_cv_linux_threads=yes
10127                 elif test $ol_cv_header_linux_threads = no -a \
10128                         $ol_cv_sys_linux_threads = no; then
10129                         ol_cv_linux_threads=no
10130                 else
10131                         ol_cv_linux_threads=error
10132                 fi
10133         
10134 fi
10135
10136 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10137
10138
10139                         if test $ol_cv_linux_threads = error; then
10140                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10141                         fi
10142
10143                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10144 echo "configure:10145: checking if pthread_create() works" >&5
10145 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10146   echo $ac_n "(cached) $ac_c" 1>&6
10147 else
10148   
10149                         if test "$cross_compiling" = yes; then
10150                                 ol_cv_pthread_create_works=yes
10151 else
10152   cat > conftest.$ac_ext <<EOF
10153 #line 10154 "configure"
10154 #include "confdefs.h"
10155 /* pthread test headers */
10156 #include <pthread.h>
10157 #ifndef NULL
10158 #define NULL (void*)0
10159 #endif
10160
10161 static void *task(p)
10162         void *p;
10163 {
10164         return (void *) (p == NULL);
10165 }
10166
10167
10168 int main(argc, argv)
10169         int argc;
10170         char **argv;
10171 {
10172
10173         /* pthread test function */
10174         pthread_t t;
10175         int status;
10176 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10177         /* This system (e.g. AIX) defaults detached; must override */
10178         pthread_attr_t attr;
10179
10180         status = pthread_attr_init(&attr);
10181         if( status ) exit( status );
10182
10183         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10184         if( status ) exit( status );
10185
10186 #define ATTR    &attr
10187 #else
10188 #if HAVE_PTHREADS_D4
10189 #define ATTR    pthread_attr_default
10190 #else
10191 #define ATTR    NULL
10192 #endif
10193 #endif
10194         /* make sure pthread_create() isn't just a stub */
10195         status = pthread_create(&t, ATTR, task, NULL);
10196         if( status ) exit( status );
10197
10198         /* make sure pthread_detach() isn't just a stub */
10199 #if HAVE_PTHREADS_D4
10200         status = pthread_detach( &t );
10201 #else
10202         status = pthread_detach( t );
10203 #endif
10204
10205 #ifdef HAVE_LINUX_THREADS
10206         pthread_kill_other_threads_np();
10207 #endif
10208
10209         exit( status );
10210
10211 }
10212
10213 EOF
10214 if { (eval echo configure:10215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10215 then
10216   ol_cv_pthread_create_works=yes
10217 else
10218   echo "configure: failed program was:" >&5
10219   cat conftest.$ac_ext >&5
10220   rm -fr conftest*
10221   ol_cv_pthread_create_works=no
10222 fi
10223 rm -fr conftest*
10224 fi
10225
10226 fi
10227
10228 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10229
10230                         if test $ol_cv_pthread_create_works = no ; then
10231                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10232                         fi
10233
10234                                                 if test $ol_with_yielding_select = auto ; then
10235                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10236 echo "configure:10237: checking if select yields when using pthreads" >&5
10237 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10238   echo $ac_n "(cached) $ac_c" 1>&6
10239 else
10240   
10241                                 if test "$cross_compiling" = yes; then
10242   ol_cv_pthread_select_yields=cross
10243 else
10244   cat > conftest.$ac_ext <<EOF
10245 #line 10246 "configure"
10246 #include "confdefs.h"
10247
10248 #include <sys/types.h>
10249 #include <sys/time.h>
10250 #include <unistd.h>
10251 #include <pthread.h>
10252 #ifndef NULL
10253 #define NULL (void*) 0
10254 #endif
10255
10256 static int fildes[2];
10257
10258 static void *task(p)
10259         void *p;
10260 {
10261         int i;
10262         struct timeval tv;
10263
10264         fd_set rfds;
10265
10266         tv.tv_sec=10;
10267         tv.tv_usec=0;
10268
10269         FD_ZERO(&rfds);
10270         FD_SET(fildes[0], &rfds);
10271
10272         /* we're not interested in any fds */
10273         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10274
10275         if(i < 0) {
10276                 perror("select");
10277                 exit(10);
10278         }
10279
10280         exit(0); /* if we exit here, the select blocked the whole process */
10281 }
10282
10283 int main(argc, argv)
10284         int argc;
10285         char **argv;
10286 {
10287         pthread_t t;
10288
10289         /* create a pipe to select */
10290         if(pipe(&fildes[0])) {
10291                 perror("select");
10292                 exit(1);
10293         }
10294
10295 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10296         (void) pthread_setconcurrency(2);
10297 #else
10298 #ifdef HAVE_THR_SETCONCURRENCY
10299         /* Set Solaris LWP concurrency to 2 */
10300         thr_setconcurrency(2);
10301 #endif
10302 #endif
10303
10304 #if HAVE_PTHREADS_D4
10305         pthread_create(&t, pthread_attr_default, task, NULL);
10306 #else
10307         pthread_create(&t, NULL, task, NULL);
10308 #endif
10309
10310 #if HAVE_SCHED_YIELD
10311         sched_yield();  /* make sure task runs first */
10312 #else
10313 #ifdef HAVE_PTHREAD_YIELD
10314         pthread_yield();        /* make sure task runs first */
10315 #endif
10316 #endif
10317
10318         exit(2);
10319 }
10320 EOF
10321 if { (eval echo configure:10322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10322 then
10323   ol_cv_pthread_select_yields=no
10324 else
10325   echo "configure: failed program was:" >&5
10326   cat conftest.$ac_ext >&5
10327   rm -fr conftest*
10328   ol_cv_pthread_select_yields=yes
10329 fi
10330 rm -fr conftest*
10331 fi
10332
10333 fi
10334
10335 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
10336
10337                                 if test $ol_cv_pthread_select_yields = cross ; then
10338                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
10339                                 fi
10340
10341                                 if test $ol_cv_pthread_select_yields = yes ; then
10342                                         ol_with_yielding_select=yes
10343                                 fi
10344                         fi
10345
10346                                                 CPPFLAGS="$save_CPPFLAGS"
10347                         LIBS="$save_LIBS"
10348                 else
10349                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
10350                 fi
10351         fi
10352
10353         if test $ol_with_threads = posix ; then
10354                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
10355         fi
10356 fi
10357
10358 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10359         -o $ol_with_threads = mach ; then
10360
10361                 for ac_hdr in mach/cthreads.h
10362 do
10363 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10364 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10365 echo "configure:10366: checking for $ac_hdr" >&5
10366 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10367   echo $ac_n "(cached) $ac_c" 1>&6
10368 else
10369   cat > conftest.$ac_ext <<EOF
10370 #line 10371 "configure"
10371 #include "confdefs.h"
10372 #include <$ac_hdr>
10373 EOF
10374 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10375 { (eval echo configure:10376: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10376 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10377 if test -z "$ac_err"; then
10378   rm -rf conftest*
10379   eval "ac_cv_header_$ac_safe=yes"
10380 else
10381   echo "$ac_err" >&5
10382   echo "configure: failed program was:" >&5
10383   cat conftest.$ac_ext >&5
10384   rm -rf conftest*
10385   eval "ac_cv_header_$ac_safe=no"
10386 fi
10387 rm -f conftest*
10388 fi
10389 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10390   echo "$ac_t""yes" 1>&6
10391     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10392   cat >> confdefs.h <<EOF
10393 #define $ac_tr_hdr 1
10394 EOF
10395  
10396 else
10397   echo "$ac_t""no" 1>&6
10398 fi
10399 done
10400
10401         if test $ac_cv_header_mach_cthreads_h = yes ; then
10402                 ol_with_threads=found
10403
10404                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
10405 echo "configure:10406: checking for cthread_fork" >&5
10406 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
10407   echo $ac_n "(cached) $ac_c" 1>&6
10408 else
10409   cat > conftest.$ac_ext <<EOF
10410 #line 10411 "configure"
10411 #include "confdefs.h"
10412 /* System header to define __stub macros and hopefully few prototypes,
10413     which can conflict with char cthread_fork(); below.  */
10414 #include <assert.h>
10415 /* Override any gcc2 internal prototype to avoid an error.  */
10416 /* We use char because int might match the return type of a gcc2
10417     builtin and then its argument prototype would still apply.  */
10418 char cthread_fork();
10419 char (*f)();
10420
10421 int main() {
10422
10423 /* The GNU C library defines this for functions which it implements
10424     to always fail with ENOSYS.  Some functions are actually named
10425     something starting with __ and the normal name is an alias.  */
10426 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
10427 choke me
10428 #else
10429 f = cthread_fork;
10430 #endif
10431
10432 ; return 0; }
10433 EOF
10434 if { (eval echo configure:10435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10435   rm -rf conftest*
10436   eval "ac_cv_func_cthread_fork=yes"
10437 else
10438   echo "configure: failed program was:" >&5
10439   cat conftest.$ac_ext >&5
10440   rm -rf conftest*
10441   eval "ac_cv_func_cthread_fork=no"
10442 fi
10443 rm -f conftest*
10444 fi
10445
10446 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
10447   echo "$ac_t""yes" 1>&6
10448   ol_link_threads=yes
10449 else
10450   echo "$ac_t""no" 1>&6
10451 fi
10452
10453
10454                 if test $ol_link_threads = no ; then
10455                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
10456 echo "configure:10457: checking for cthread_fork with -all_load" >&5
10457 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
10458   echo $ac_n "(cached) $ac_c" 1>&6
10459 else
10460   
10461                                                                 save_LIBS="$LIBS"
10462                                 LIBS="-all_load $LIBS"
10463                                 cat > conftest.$ac_ext <<EOF
10464 #line 10465 "configure"
10465 #include "confdefs.h"
10466 #include <mach/cthreads.h>
10467 int main() {
10468
10469                                         cthread_fork((void *)0, (void *)0);
10470                                         
10471 ; return 0; }
10472 EOF
10473 if { (eval echo configure:10474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10474   rm -rf conftest*
10475   ol_cv_cthread_all_load=yes
10476 else
10477   echo "configure: failed program was:" >&5
10478   cat conftest.$ac_ext >&5
10479   rm -rf conftest*
10480   ol_cv_cthread_all_load=no
10481 fi
10482 rm -f conftest*
10483                                                                 LIBS="$save_LIBS"
10484                         
10485 fi
10486
10487 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
10488
10489                         if test $ol_cv_cthread_all_load = yes ; then
10490                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
10491                                 ol_link_threads=mach
10492                         fi
10493                 fi
10494
10495                 if test $ol_link_threads != no ; then
10496                         : check for cthread specific functionality here
10497                         cat >> confdefs.h <<\EOF
10498 #define HAVE_MACH_CTHREADS 1
10499 EOF
10500
10501                 else
10502                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
10503                 fi
10504         fi
10505
10506         if test $ol_with_threads = mach ; then
10507                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
10508         fi
10509 fi
10510
10511 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10512         -o $ol_with_threads = pth ; then
10513
10514         for ac_hdr in pth.h
10515 do
10516 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10517 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10518 echo "configure:10519: checking for $ac_hdr" >&5
10519 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10520   echo $ac_n "(cached) $ac_c" 1>&6
10521 else
10522   cat > conftest.$ac_ext <<EOF
10523 #line 10524 "configure"
10524 #include "confdefs.h"
10525 #include <$ac_hdr>
10526 EOF
10527 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10528 { (eval echo configure:10529: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10529 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10530 if test -z "$ac_err"; then
10531   rm -rf conftest*
10532   eval "ac_cv_header_$ac_safe=yes"
10533 else
10534   echo "$ac_err" >&5
10535   echo "configure: failed program was:" >&5
10536   cat conftest.$ac_ext >&5
10537   rm -rf conftest*
10538   eval "ac_cv_header_$ac_safe=no"
10539 fi
10540 rm -f conftest*
10541 fi
10542 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10543   echo "$ac_t""yes" 1>&6
10544     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10545   cat >> confdefs.h <<EOF
10546 #define $ac_tr_hdr 1
10547 EOF
10548  
10549 else
10550   echo "$ac_t""no" 1>&6
10551 fi
10552 done
10553
10554
10555         if test $ac_cv_header_pth_h = yes ; then
10556                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
10557 echo "configure:10558: checking for pth_version in -lpth" >&5
10558 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
10559 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10560   echo $ac_n "(cached) $ac_c" 1>&6
10561 else
10562   ac_save_LIBS="$LIBS"
10563 LIBS="-lpth  $LIBS"
10564 cat > conftest.$ac_ext <<EOF
10565 #line 10566 "configure"
10566 #include "confdefs.h"
10567 /* Override any gcc2 internal prototype to avoid an error.  */
10568 /* We use char because int might match the return type of a gcc2
10569     builtin and then its argument prototype would still apply.  */
10570 char pth_version();
10571
10572 int main() {
10573 pth_version()
10574 ; return 0; }
10575 EOF
10576 if { (eval echo configure:10577: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10577   rm -rf conftest*
10578   eval "ac_cv_lib_$ac_lib_var=yes"
10579 else
10580   echo "configure: failed program was:" >&5
10581   cat conftest.$ac_ext >&5
10582   rm -rf conftest*
10583   eval "ac_cv_lib_$ac_lib_var=no"
10584 fi
10585 rm -f conftest*
10586 LIBS="$ac_save_LIBS"
10587
10588 fi
10589 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10590   echo "$ac_t""yes" 1>&6
10591   have_pth=yes
10592 else
10593   echo "$ac_t""no" 1>&6
10594 have_pth=no
10595 fi
10596
10597
10598                 if test $have_pth = yes ; then
10599                         cat >> confdefs.h <<\EOF
10600 #define HAVE_GNU_PTH 1
10601 EOF
10602
10603                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
10604                         ol_link_threads=pth
10605
10606                         if test $ol_with_yielding_select = auto ; then
10607                                 ol_with_yielding_select=yes
10608                         fi
10609                 fi
10610         fi
10611 fi
10612
10613 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10614         -o $ol_with_threads = lwp ; then
10615
10616                 for ac_hdr in thread.h synch.h
10617 do
10618 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10619 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10620 echo "configure:10621: checking for $ac_hdr" >&5
10621 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10622   echo $ac_n "(cached) $ac_c" 1>&6
10623 else
10624   cat > conftest.$ac_ext <<EOF
10625 #line 10626 "configure"
10626 #include "confdefs.h"
10627 #include <$ac_hdr>
10628 EOF
10629 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10630 { (eval echo configure:10631: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10631 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10632 if test -z "$ac_err"; then
10633   rm -rf conftest*
10634   eval "ac_cv_header_$ac_safe=yes"
10635 else
10636   echo "$ac_err" >&5
10637   echo "configure: failed program was:" >&5
10638   cat conftest.$ac_ext >&5
10639   rm -rf conftest*
10640   eval "ac_cv_header_$ac_safe=no"
10641 fi
10642 rm -f conftest*
10643 fi
10644 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10645   echo "$ac_t""yes" 1>&6
10646     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10647   cat >> confdefs.h <<EOF
10648 #define $ac_tr_hdr 1
10649 EOF
10650  
10651 else
10652   echo "$ac_t""no" 1>&6
10653 fi
10654 done
10655
10656         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
10657                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
10658 echo "configure:10659: checking for thr_create in -lthread" >&5
10659 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
10660 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10661   echo $ac_n "(cached) $ac_c" 1>&6
10662 else
10663   ac_save_LIBS="$LIBS"
10664 LIBS="-lthread  $LIBS"
10665 cat > conftest.$ac_ext <<EOF
10666 #line 10667 "configure"
10667 #include "confdefs.h"
10668 /* Override any gcc2 internal prototype to avoid an error.  */
10669 /* We use char because int might match the return type of a gcc2
10670     builtin and then its argument prototype would still apply.  */
10671 char thr_create();
10672
10673 int main() {
10674 thr_create()
10675 ; return 0; }
10676 EOF
10677 if { (eval echo configure:10678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10678   rm -rf conftest*
10679   eval "ac_cv_lib_$ac_lib_var=yes"
10680 else
10681   echo "configure: failed program was:" >&5
10682   cat conftest.$ac_ext >&5
10683   rm -rf conftest*
10684   eval "ac_cv_lib_$ac_lib_var=no"
10685 fi
10686 rm -f conftest*
10687 LIBS="$ac_save_LIBS"
10688
10689 fi
10690 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10691   echo "$ac_t""yes" 1>&6
10692   have_thr=yes
10693 else
10694   echo "$ac_t""no" 1>&6
10695 have_thr=no
10696 fi
10697
10698
10699                 if test $have_thr = yes ; then
10700                         cat >> confdefs.h <<\EOF
10701 #define HAVE_THR 1
10702 EOF
10703
10704                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
10705                         ol_link_threads=thr
10706
10707                         if test $ol_with_yielding_select = auto ; then
10708                                 ol_with_yielding_select=yes
10709                         fi
10710
10711                                                 for ac_func in \
10712                                 thr_setconcurrency \
10713                                 thr_getconcurrency \
10714                         
10715 do
10716 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10717 echo "configure:10718: checking for $ac_func" >&5
10718 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10719   echo $ac_n "(cached) $ac_c" 1>&6
10720 else
10721   cat > conftest.$ac_ext <<EOF
10722 #line 10723 "configure"
10723 #include "confdefs.h"
10724 /* System header to define __stub macros and hopefully few prototypes,
10725     which can conflict with char $ac_func(); below.  */
10726 #include <assert.h>
10727 /* Override any gcc2 internal prototype to avoid an error.  */
10728 /* We use char because int might match the return type of a gcc2
10729     builtin and then its argument prototype would still apply.  */
10730 char $ac_func();
10731 char (*f)();
10732
10733 int main() {
10734
10735 /* The GNU C library defines this for functions which it implements
10736     to always fail with ENOSYS.  Some functions are actually named
10737     something starting with __ and the normal name is an alias.  */
10738 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10739 choke me
10740 #else
10741 f = $ac_func;
10742 #endif
10743
10744 ; return 0; }
10745 EOF
10746 if { (eval echo configure:10747: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10747   rm -rf conftest*
10748   eval "ac_cv_func_$ac_func=yes"
10749 else
10750   echo "configure: failed program was:" >&5
10751   cat conftest.$ac_ext >&5
10752   rm -rf conftest*
10753   eval "ac_cv_func_$ac_func=no"
10754 fi
10755 rm -f conftest*
10756 fi
10757
10758 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10759   echo "$ac_t""yes" 1>&6
10760     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10761   cat >> confdefs.h <<EOF
10762 #define $ac_tr_func 1
10763 EOF
10764  
10765 else
10766   echo "$ac_t""no" 1>&6
10767 fi
10768 done
10769
10770                 fi
10771         fi
10772
10773                 for ac_hdr in lwp/lwp.h
10774 do
10775 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10776 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10777 echo "configure:10778: checking for $ac_hdr" >&5
10778 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10779   echo $ac_n "(cached) $ac_c" 1>&6
10780 else
10781   cat > conftest.$ac_ext <<EOF
10782 #line 10783 "configure"
10783 #include "confdefs.h"
10784 #include <$ac_hdr>
10785 EOF
10786 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10787 { (eval echo configure:10788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10788 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10789 if test -z "$ac_err"; then
10790   rm -rf conftest*
10791   eval "ac_cv_header_$ac_safe=yes"
10792 else
10793   echo "$ac_err" >&5
10794   echo "configure: failed program was:" >&5
10795   cat conftest.$ac_ext >&5
10796   rm -rf conftest*
10797   eval "ac_cv_header_$ac_safe=no"
10798 fi
10799 rm -f conftest*
10800 fi
10801 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10802   echo "$ac_t""yes" 1>&6
10803     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10804   cat >> confdefs.h <<EOF
10805 #define $ac_tr_hdr 1
10806 EOF
10807  
10808 else
10809   echo "$ac_t""no" 1>&6
10810 fi
10811 done
10812
10813         if test $ac_cv_header_lwp_lwp_h = yes ; then
10814                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
10815 echo "configure:10816: checking for lwp_create in -llwp" >&5
10816 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
10817 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10818   echo $ac_n "(cached) $ac_c" 1>&6
10819 else
10820   ac_save_LIBS="$LIBS"
10821 LIBS="-llwp  $LIBS"
10822 cat > conftest.$ac_ext <<EOF
10823 #line 10824 "configure"
10824 #include "confdefs.h"
10825 /* Override any gcc2 internal prototype to avoid an error.  */
10826 /* We use char because int might match the return type of a gcc2
10827     builtin and then its argument prototype would still apply.  */
10828 char lwp_create();
10829
10830 int main() {
10831 lwp_create()
10832 ; return 0; }
10833 EOF
10834 if { (eval echo configure:10835: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10835   rm -rf conftest*
10836   eval "ac_cv_lib_$ac_lib_var=yes"
10837 else
10838   echo "configure: failed program was:" >&5
10839   cat conftest.$ac_ext >&5
10840   rm -rf conftest*
10841   eval "ac_cv_lib_$ac_lib_var=no"
10842 fi
10843 rm -f conftest*
10844 LIBS="$ac_save_LIBS"
10845
10846 fi
10847 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10848   echo "$ac_t""yes" 1>&6
10849   have_lwp=yes
10850 else
10851   echo "$ac_t""no" 1>&6
10852 have_lwp=no
10853 fi
10854
10855
10856                 if test $have_lwp = yes ; then
10857                         cat >> confdefs.h <<\EOF
10858 #define HAVE_LWP 1
10859 EOF
10860
10861                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
10862                         ol_link_threads=lwp
10863
10864                         if test $ol_with_yielding_select = auto ; then
10865                                 ol_with_yielding_select=no
10866                         fi
10867                 fi
10868         fi
10869 fi
10870
10871 if test $ol_with_yielding_select = yes ; then
10872         cat >> confdefs.h <<\EOF
10873 #define HAVE_YIELDING_SELECT 1
10874 EOF
10875
10876 fi
10877
10878 if test $ol_with_threads = manual ; then
10879                 ol_link_threads=yes
10880
10881         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10882
10883         for ac_hdr in pthread.h sched.h
10884 do
10885 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10886 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10887 echo "configure:10888: checking for $ac_hdr" >&5
10888 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10889   echo $ac_n "(cached) $ac_c" 1>&6
10890 else
10891   cat > conftest.$ac_ext <<EOF
10892 #line 10893 "configure"
10893 #include "confdefs.h"
10894 #include <$ac_hdr>
10895 EOF
10896 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10897 { (eval echo configure:10898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10898 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10899 if test -z "$ac_err"; then
10900   rm -rf conftest*
10901   eval "ac_cv_header_$ac_safe=yes"
10902 else
10903   echo "$ac_err" >&5
10904   echo "configure: failed program was:" >&5
10905   cat conftest.$ac_ext >&5
10906   rm -rf conftest*
10907   eval "ac_cv_header_$ac_safe=no"
10908 fi
10909 rm -f conftest*
10910 fi
10911 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10912   echo "$ac_t""yes" 1>&6
10913     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10914   cat >> confdefs.h <<EOF
10915 #define $ac_tr_hdr 1
10916 EOF
10917  
10918 else
10919   echo "$ac_t""no" 1>&6
10920 fi
10921 done
10922
10923         for ac_func in sched_yield pthread_yield
10924 do
10925 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10926 echo "configure:10927: checking for $ac_func" >&5
10927 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10928   echo $ac_n "(cached) $ac_c" 1>&6
10929 else
10930   cat > conftest.$ac_ext <<EOF
10931 #line 10932 "configure"
10932 #include "confdefs.h"
10933 /* System header to define __stub macros and hopefully few prototypes,
10934     which can conflict with char $ac_func(); below.  */
10935 #include <assert.h>
10936 /* Override any gcc2 internal prototype to avoid an error.  */
10937 /* We use char because int might match the return type of a gcc2
10938     builtin and then its argument prototype would still apply.  */
10939 char $ac_func();
10940 char (*f)();
10941
10942 int main() {
10943
10944 /* The GNU C library defines this for functions which it implements
10945     to always fail with ENOSYS.  Some functions are actually named
10946     something starting with __ and the normal name is an alias.  */
10947 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10948 choke me
10949 #else
10950 f = $ac_func;
10951 #endif
10952
10953 ; return 0; }
10954 EOF
10955 if { (eval echo configure:10956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10956   rm -rf conftest*
10957   eval "ac_cv_func_$ac_func=yes"
10958 else
10959   echo "configure: failed program was:" >&5
10960   cat conftest.$ac_ext >&5
10961   rm -rf conftest*
10962   eval "ac_cv_func_$ac_func=no"
10963 fi
10964 rm -f conftest*
10965 fi
10966
10967 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10968   echo "$ac_t""yes" 1>&6
10969     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10970   cat >> confdefs.h <<EOF
10971 #define $ac_tr_func 1
10972 EOF
10973  
10974 else
10975   echo "$ac_t""no" 1>&6
10976 fi
10977 done
10978
10979         
10980         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
10981 echo "configure:10982: checking for LinuxThreads pthread.h" >&5
10982 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
10983   echo $ac_n "(cached) $ac_c" 1>&6
10984 else
10985   cat > conftest.$ac_ext <<EOF
10986 #line 10987 "configure"
10987 #include "confdefs.h"
10988 #include <pthread.h>
10989 EOF
10990 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
10991   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
10992   rm -rf conftest*
10993   ol_cv_header_linux_threads=yes
10994 else
10995   rm -rf conftest*
10996   ol_cv_header_linux_threads=no
10997 fi
10998 rm -f conftest*
10999
11000                 
11001 fi
11002
11003 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11004         if test $ol_cv_header_linux_threads = yes; then
11005                 cat >> confdefs.h <<\EOF
11006 #define HAVE_LINUX_THREADS 1
11007 EOF
11008
11009         fi
11010
11011
11012         for ac_hdr in mach/cthreads.h
11013 do
11014 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11015 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11016 echo "configure:11017: checking for $ac_hdr" >&5
11017 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11018   echo $ac_n "(cached) $ac_c" 1>&6
11019 else
11020   cat > conftest.$ac_ext <<EOF
11021 #line 11022 "configure"
11022 #include "confdefs.h"
11023 #include <$ac_hdr>
11024 EOF
11025 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11026 { (eval echo configure:11027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11027 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11028 if test -z "$ac_err"; then
11029   rm -rf conftest*
11030   eval "ac_cv_header_$ac_safe=yes"
11031 else
11032   echo "$ac_err" >&5
11033   echo "configure: failed program was:" >&5
11034   cat conftest.$ac_ext >&5
11035   rm -rf conftest*
11036   eval "ac_cv_header_$ac_safe=no"
11037 fi
11038 rm -f conftest*
11039 fi
11040 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11041   echo "$ac_t""yes" 1>&6
11042     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11043   cat >> confdefs.h <<EOF
11044 #define $ac_tr_hdr 1
11045 EOF
11046  
11047 else
11048   echo "$ac_t""no" 1>&6
11049 fi
11050 done
11051
11052         for ac_hdr in lwp/lwp.h
11053 do
11054 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11055 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11056 echo "configure:11057: checking for $ac_hdr" >&5
11057 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11058   echo $ac_n "(cached) $ac_c" 1>&6
11059 else
11060   cat > conftest.$ac_ext <<EOF
11061 #line 11062 "configure"
11062 #include "confdefs.h"
11063 #include <$ac_hdr>
11064 EOF
11065 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11066 { (eval echo configure:11067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11067 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11068 if test -z "$ac_err"; then
11069   rm -rf conftest*
11070   eval "ac_cv_header_$ac_safe=yes"
11071 else
11072   echo "$ac_err" >&5
11073   echo "configure: failed program was:" >&5
11074   cat conftest.$ac_ext >&5
11075   rm -rf conftest*
11076   eval "ac_cv_header_$ac_safe=no"
11077 fi
11078 rm -f conftest*
11079 fi
11080 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11081   echo "$ac_t""yes" 1>&6
11082     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11083   cat >> confdefs.h <<EOF
11084 #define $ac_tr_hdr 1
11085 EOF
11086  
11087 else
11088   echo "$ac_t""no" 1>&6
11089 fi
11090 done
11091
11092         for ac_hdr in thread.h synch.h
11093 do
11094 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11095 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11096 echo "configure:11097: checking for $ac_hdr" >&5
11097 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11098   echo $ac_n "(cached) $ac_c" 1>&6
11099 else
11100   cat > conftest.$ac_ext <<EOF
11101 #line 11102 "configure"
11102 #include "confdefs.h"
11103 #include <$ac_hdr>
11104 EOF
11105 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11106 { (eval echo configure:11107: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11107 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11108 if test -z "$ac_err"; then
11109   rm -rf conftest*
11110   eval "ac_cv_header_$ac_safe=yes"
11111 else
11112   echo "$ac_err" >&5
11113   echo "configure: failed program was:" >&5
11114   cat conftest.$ac_ext >&5
11115   rm -rf conftest*
11116   eval "ac_cv_header_$ac_safe=no"
11117 fi
11118 rm -f conftest*
11119 fi
11120 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11121   echo "$ac_t""yes" 1>&6
11122     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11123   cat >> confdefs.h <<EOF
11124 #define $ac_tr_hdr 1
11125 EOF
11126  
11127 else
11128   echo "$ac_t""no" 1>&6
11129 fi
11130 done
11131
11132 fi
11133
11134 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11135                         cat >> confdefs.h <<\EOF
11136 #define REENTRANT 1
11137 EOF
11138
11139         cat >> confdefs.h <<\EOF
11140 #define _REENTRANT 1
11141 EOF
11142
11143         cat >> confdefs.h <<\EOF
11144 #define THREAD_SAFE 1
11145 EOF
11146
11147         cat >> confdefs.h <<\EOF
11148 #define _THREAD_SAFE 1
11149 EOF
11150
11151         cat >> confdefs.h <<\EOF
11152 #define THREADSAFE 1
11153 EOF
11154
11155         cat >> confdefs.h <<\EOF
11156 #define _THREADSAFE 1
11157 EOF
11158
11159         cat >> confdefs.h <<\EOF
11160 #define _SGI_MP_SOURCE 1
11161 EOF
11162
11163
11164                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11165 echo "configure:11166: checking for thread specific errno" >&5
11166 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11167   echo $ac_n "(cached) $ac_c" 1>&6
11168 else
11169   
11170                 cat > conftest.$ac_ext <<EOF
11171 #line 11172 "configure"
11172 #include "confdefs.h"
11173 #include <errno.h>
11174 int main() {
11175 errno = 0;
11176 ; return 0; }
11177 EOF
11178 if { (eval echo configure:11179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11179   rm -rf conftest*
11180   ol_cv_errno_thread_specific=yes
11181 else
11182   echo "configure: failed program was:" >&5
11183   cat conftest.$ac_ext >&5
11184   rm -rf conftest*
11185   ol_cv_errno_thread_specific=no
11186 fi
11187 rm -f conftest*
11188         
11189 fi
11190
11191 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11192
11193                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11194 echo "configure:11195: checking for thread specific h_errno" >&5
11195 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11196   echo $ac_n "(cached) $ac_c" 1>&6
11197 else
11198   
11199                 cat > conftest.$ac_ext <<EOF
11200 #line 11201 "configure"
11201 #include "confdefs.h"
11202 #include <netdb.h>
11203 int main() {
11204 h_errno = 0;
11205 ; return 0; }
11206 EOF
11207 if { (eval echo configure:11208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11208   rm -rf conftest*
11209   ol_cv_h_errno_thread_specific=yes
11210 else
11211   echo "configure: failed program was:" >&5
11212   cat conftest.$ac_ext >&5
11213   rm -rf conftest*
11214   ol_cv_h_errno_thread_specific=no
11215 fi
11216 rm -f conftest*
11217         
11218 fi
11219
11220 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11221
11222         if test $ol_cv_errno_thread_specific != yes \
11223                 -o $ol_cv_h_errno_thread_specific != yes ; then
11224                 LIBS="$LTHREAD_LIBS $LIBS"
11225                 LTHREAD_LIBS=""
11226         fi
11227
11228 fi  
11229
11230 if test $ol_link_threads = no ; then
11231         if test $ol_with_threads = yes ; then
11232                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11233         fi
11234
11235         if test $ol_with_threads = auto ; then
11236                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11237                 ol_with_threads=no
11238         fi
11239
11240         cat >> confdefs.h <<\EOF
11241 #define NO_THREADS 1
11242 EOF
11243
11244         LTHREAD_LIBS=""
11245 fi
11246
11247 if test $ol_link_threads != no ; then
11248         cat >> confdefs.h <<\EOF
11249 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11250 EOF
11251
11252 fi
11253
11254 ol_link_ldbm=no 
11255
11256 if test $ol_with_ldbm_api = auto \
11257         -o $ol_with_ldbm_api = berkeley \
11258         -o $ol_with_ldbm_api = bcompat ; then
11259
11260         if test $ol_with_ldbm_api = bcompat; then \
11261                 ol_cv_berkeley_db=no
11262 for ac_hdr in db_185.h db.h
11263 do
11264 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11265 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11266 echo "configure:11267: checking for $ac_hdr" >&5
11267 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11268   echo $ac_n "(cached) $ac_c" 1>&6
11269 else
11270   cat > conftest.$ac_ext <<EOF
11271 #line 11272 "configure"
11272 #include "confdefs.h"
11273 #include <$ac_hdr>
11274 EOF
11275 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11276 { (eval echo configure:11277: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11277 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11278 if test -z "$ac_err"; then
11279   rm -rf conftest*
11280   eval "ac_cv_header_$ac_safe=yes"
11281 else
11282   echo "$ac_err" >&5
11283   echo "configure: failed program was:" >&5
11284   cat conftest.$ac_ext >&5
11285   rm -rf conftest*
11286   eval "ac_cv_header_$ac_safe=no"
11287 fi
11288 rm -f conftest*
11289 fi
11290 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11291   echo "$ac_t""yes" 1>&6
11292     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11293   cat >> confdefs.h <<EOF
11294 #define $ac_tr_hdr 1
11295 EOF
11296  
11297 else
11298   echo "$ac_t""no" 1>&6
11299 fi
11300 done
11301
11302 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11303         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11304 echo "configure:11305: checking if Berkeley DB header compatibility" >&5
11305 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11306   echo $ac_n "(cached) $ac_c" 1>&6
11307 else
11308   
11309                 cat > conftest.$ac_ext <<EOF
11310 #line 11311 "configure"
11311 #include "confdefs.h"
11312
11313 #if HAVE_DB_185_H
11314 #       include <db_185.h>
11315 #else
11316 #       include <db.h>
11317 #endif
11318
11319  /* this check could be improved */
11320 #ifndef DB_VERSION_MAJOR
11321 #       define DB_VERSION_MAJOR 1
11322 #endif
11323
11324 #if DB_VERSION_MAJOR == 1 
11325         __db_version_1
11326 #endif
11327
11328 EOF
11329 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11330   egrep "__db_version_1" >/dev/null 2>&1; then
11331   rm -rf conftest*
11332   ol_cv_header_db1=yes
11333 else
11334   rm -rf conftest*
11335   ol_cv_header_db1=no
11336 fi
11337 rm -f conftest*
11338
11339 fi
11340
11341 echo "$ac_t""$ol_cv_header_db1" 1>&6
11342
11343         if test ol_cv_header_db1=yes ; then
11344                 ol_cv_lib_db=no
11345 if test $ol_cv_lib_db = no ; then
11346         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11347 echo "configure:11348: checking for Berkeley DB link (default)" >&5
11348 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11349   echo $ac_n "(cached) $ac_c" 1>&6
11350 else
11351   
11352         ol_DB_LIB=
11353         ol_LIBS=$LIBS
11354         LIBS="$ol_DB_LIB $LIBS"
11355
11356         cat > conftest.$ac_ext <<EOF
11357 #line 11358 "configure"
11358 #include "confdefs.h"
11359
11360 #ifdef HAVE_DB_185_H
11361 # include <db_185.h>
11362 #else
11363 # include <db.h>
11364 #endif
11365
11366 #ifndef DB_VERSION_MAJOR
11367 # define DB_VERSION_MAJOR 1
11368 #endif
11369
11370 #ifndef NULL
11371 #define NULL ((void*)0)
11372 #endif
11373
11374 int main() {
11375
11376 #if DB_VERSION_MAJOR > 2
11377         db_env_create( NULL, 0 );
11378 #elif DB_VERSION_MAJOR > 1
11379         db_appexit( NULL );
11380 #else
11381         (void) dbopen( NULL, 0, 0, 0, NULL);
11382 #endif
11383
11384 ; return 0; }
11385 EOF
11386 if { (eval echo configure:11387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11387   rm -rf conftest*
11388   ol_cv_db_none=yes
11389 else
11390   echo "configure: failed program was:" >&5
11391   cat conftest.$ac_ext >&5
11392   rm -rf conftest*
11393   ol_cv_db_none=no
11394 fi
11395 rm -f conftest*
11396
11397         LIBS="$ol_LIBS"
11398
11399 fi
11400
11401 echo "$ac_t""$ol_cv_db_none" 1>&6
11402
11403         if test $ol_cv_db_none = yes ; then
11404                 ol_cv_lib_db=yes
11405         fi
11406 fi
11407
11408 if test $ol_cv_lib_db = no ; then
11409         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11410 echo "configure:11411: checking for Berkeley DB link (-ldb)" >&5
11411 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11412   echo $ac_n "(cached) $ac_c" 1>&6
11413 else
11414   
11415         ol_DB_LIB=-ldb
11416         ol_LIBS=$LIBS
11417         LIBS="$ol_DB_LIB $LIBS"
11418
11419         cat > conftest.$ac_ext <<EOF
11420 #line 11421 "configure"
11421 #include "confdefs.h"
11422
11423 #ifdef HAVE_DB_185_H
11424 # include <db_185.h>
11425 #else
11426 # include <db.h>
11427 #endif
11428
11429 #ifndef DB_VERSION_MAJOR
11430 # define DB_VERSION_MAJOR 1
11431 #endif
11432
11433 #ifndef NULL
11434 #define NULL ((void*)0)
11435 #endif
11436
11437 int main() {
11438
11439 #if DB_VERSION_MAJOR > 2
11440         db_env_create( NULL, 0 );
11441 #elif DB_VERSION_MAJOR > 1
11442         db_appexit( NULL );
11443 #else
11444         (void) dbopen( NULL, 0, 0, 0, NULL);
11445 #endif
11446
11447 ; return 0; }
11448 EOF
11449 if { (eval echo configure:11450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11450   rm -rf conftest*
11451   ol_cv_db_db=yes
11452 else
11453   echo "configure: failed program was:" >&5
11454   cat conftest.$ac_ext >&5
11455   rm -rf conftest*
11456   ol_cv_db_db=no
11457 fi
11458 rm -f conftest*
11459
11460         LIBS="$ol_LIBS"
11461
11462 fi
11463
11464 echo "$ac_t""$ol_cv_db_db" 1>&6
11465
11466         if test $ol_cv_db_db = yes ; then
11467                 ol_cv_lib_db=-ldb
11468         fi
11469 fi
11470
11471 if test $ol_cv_lib_db = no ; then
11472         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11473 echo "configure:11474: checking for Berkeley DB link (-ldb3)" >&5
11474 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11475   echo $ac_n "(cached) $ac_c" 1>&6
11476 else
11477   
11478         ol_DB_LIB=-ldb3
11479         ol_LIBS=$LIBS
11480         LIBS="$ol_DB_LIB $LIBS"
11481
11482         cat > conftest.$ac_ext <<EOF
11483 #line 11484 "configure"
11484 #include "confdefs.h"
11485
11486 #ifdef HAVE_DB_185_H
11487 # include <db_185.h>
11488 #else
11489 # include <db.h>
11490 #endif
11491
11492 #ifndef DB_VERSION_MAJOR
11493 # define DB_VERSION_MAJOR 1
11494 #endif
11495
11496 #ifndef NULL
11497 #define NULL ((void*)0)
11498 #endif
11499
11500 int main() {
11501
11502 #if DB_VERSION_MAJOR > 2
11503         db_env_create( NULL, 0 );
11504 #elif DB_VERSION_MAJOR > 1
11505         db_appexit( NULL );
11506 #else
11507         (void) dbopen( NULL, 0, 0, 0, NULL);
11508 #endif
11509
11510 ; return 0; }
11511 EOF
11512 if { (eval echo configure:11513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11513   rm -rf conftest*
11514   ol_cv_db_db3=yes
11515 else
11516   echo "configure: failed program was:" >&5
11517   cat conftest.$ac_ext >&5
11518   rm -rf conftest*
11519   ol_cv_db_db3=no
11520 fi
11521 rm -f conftest*
11522
11523         LIBS="$ol_LIBS"
11524
11525 fi
11526
11527 echo "$ac_t""$ol_cv_db_db3" 1>&6
11528
11529         if test $ol_cv_db_db3 = yes ; then
11530                 ol_cv_lib_db=-ldb3
11531         fi
11532 fi
11533
11534 if test $ol_cv_lib_db = no ; then
11535         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11536 echo "configure:11537: checking for Berkeley DB link (-ldb2)" >&5
11537 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11538   echo $ac_n "(cached) $ac_c" 1>&6
11539 else
11540   
11541         ol_DB_LIB=-ldb2
11542         ol_LIBS=$LIBS
11543         LIBS="$ol_DB_LIB $LIBS"
11544
11545         cat > conftest.$ac_ext <<EOF
11546 #line 11547 "configure"
11547 #include "confdefs.h"
11548
11549 #ifdef HAVE_DB_185_H
11550 # include <db_185.h>
11551 #else
11552 # include <db.h>
11553 #endif
11554
11555 #ifndef DB_VERSION_MAJOR
11556 # define DB_VERSION_MAJOR 1
11557 #endif
11558
11559 #ifndef NULL
11560 #define NULL ((void*)0)
11561 #endif
11562
11563 int main() {
11564
11565 #if DB_VERSION_MAJOR > 2
11566         db_env_create( NULL, 0 );
11567 #elif DB_VERSION_MAJOR > 1
11568         db_appexit( NULL );
11569 #else
11570         (void) dbopen( NULL, 0, 0, 0, NULL);
11571 #endif
11572
11573 ; return 0; }
11574 EOF
11575 if { (eval echo configure:11576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11576   rm -rf conftest*
11577   ol_cv_db_db2=yes
11578 else
11579   echo "configure: failed program was:" >&5
11580   cat conftest.$ac_ext >&5
11581   rm -rf conftest*
11582   ol_cv_db_db2=no
11583 fi
11584 rm -f conftest*
11585
11586         LIBS="$ol_LIBS"
11587
11588 fi
11589
11590 echo "$ac_t""$ol_cv_db_db2" 1>&6
11591
11592         if test $ol_cv_db_db2 = yes ; then
11593                 ol_cv_lib_db=-ldb2
11594         fi
11595 fi
11596
11597 if test $ol_cv_lib_db = no ; then
11598         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11599 echo "configure:11600: checking for Berkeley DB link (-ldb1)" >&5
11600 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11601   echo $ac_n "(cached) $ac_c" 1>&6
11602 else
11603   
11604         ol_DB_LIB=-ldb1
11605         ol_LIBS=$LIBS
11606         LIBS="$ol_DB_LIB $LIBS"
11607
11608         cat > conftest.$ac_ext <<EOF
11609 #line 11610 "configure"
11610 #include "confdefs.h"
11611
11612 #ifdef HAVE_DB_185_H
11613 # include <db_185.h>
11614 #else
11615 # include <db.h>
11616 #endif
11617
11618 #ifndef DB_VERSION_MAJOR
11619 # define DB_VERSION_MAJOR 1
11620 #endif
11621
11622 #ifndef NULL
11623 #define NULL ((void*)0)
11624 #endif
11625
11626 int main() {
11627
11628 #if DB_VERSION_MAJOR > 2
11629         db_env_create( NULL, 0 );
11630 #elif DB_VERSION_MAJOR > 1
11631         db_appexit( NULL );
11632 #else
11633         (void) dbopen( NULL, 0, 0, 0, NULL);
11634 #endif
11635
11636 ; return 0; }
11637 EOF
11638 if { (eval echo configure:11639: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11639   rm -rf conftest*
11640   ol_cv_db_db1=yes
11641 else
11642   echo "configure: failed program was:" >&5
11643   cat conftest.$ac_ext >&5
11644   rm -rf conftest*
11645   ol_cv_db_db1=no
11646 fi
11647 rm -f conftest*
11648
11649         LIBS="$ol_LIBS"
11650
11651 fi
11652
11653 echo "$ac_t""$ol_cv_db_db1" 1>&6
11654
11655         if test $ol_cv_db_db1 = yes ; then
11656                 ol_cv_lib_db=-ldb1
11657         fi
11658 fi
11659
11660
11661                 if test "$ol_cv_lib_db" != no ; then
11662                         ol_cv_berkeley_db=yes
11663                 fi
11664         fi
11665 fi
11666
11667         else
11668                 ol_cv_berkeley_db=no
11669 for ac_hdr in db.h
11670 do
11671 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11672 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11673 echo "configure:11674: checking for $ac_hdr" >&5
11674 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11675   echo $ac_n "(cached) $ac_c" 1>&6
11676 else
11677   cat > conftest.$ac_ext <<EOF
11678 #line 11679 "configure"
11679 #include "confdefs.h"
11680 #include <$ac_hdr>
11681 EOF
11682 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11683 { (eval echo configure:11684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11684 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11685 if test -z "$ac_err"; then
11686   rm -rf conftest*
11687   eval "ac_cv_header_$ac_safe=yes"
11688 else
11689   echo "$ac_err" >&5
11690   echo "configure: failed program was:" >&5
11691   cat conftest.$ac_ext >&5
11692   rm -rf conftest*
11693   eval "ac_cv_header_$ac_safe=no"
11694 fi
11695 rm -f conftest*
11696 fi
11697 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11698   echo "$ac_t""yes" 1>&6
11699     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11700   cat >> confdefs.h <<EOF
11701 #define $ac_tr_hdr 1
11702 EOF
11703  
11704 else
11705   echo "$ac_t""no" 1>&6
11706 fi
11707 done
11708
11709 if test $ac_cv_header_db_h = yes; then
11710         ol_cv_lib_db=no
11711 if test $ol_cv_lib_db = no ; then
11712         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11713 echo "configure:11714: checking for Berkeley DB link (default)" >&5
11714 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11715   echo $ac_n "(cached) $ac_c" 1>&6
11716 else
11717   
11718         ol_DB_LIB=
11719         ol_LIBS=$LIBS
11720         LIBS="$ol_DB_LIB $LIBS"
11721
11722         cat > conftest.$ac_ext <<EOF
11723 #line 11724 "configure"
11724 #include "confdefs.h"
11725
11726 #ifdef HAVE_DB_185_H
11727 # include <db_185.h>
11728 #else
11729 # include <db.h>
11730 #endif
11731
11732 #ifndef DB_VERSION_MAJOR
11733 # define DB_VERSION_MAJOR 1
11734 #endif
11735
11736 #ifndef NULL
11737 #define NULL ((void*)0)
11738 #endif
11739
11740 int main() {
11741
11742 #if DB_VERSION_MAJOR > 2
11743         db_env_create( NULL, 0 );
11744 #elif DB_VERSION_MAJOR > 1
11745         db_appexit( NULL );
11746 #else
11747         (void) dbopen( NULL, 0, 0, 0, NULL);
11748 #endif
11749
11750 ; return 0; }
11751 EOF
11752 if { (eval echo configure:11753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11753   rm -rf conftest*
11754   ol_cv_db_none=yes
11755 else
11756   echo "configure: failed program was:" >&5
11757   cat conftest.$ac_ext >&5
11758   rm -rf conftest*
11759   ol_cv_db_none=no
11760 fi
11761 rm -f conftest*
11762
11763         LIBS="$ol_LIBS"
11764
11765 fi
11766
11767 echo "$ac_t""$ol_cv_db_none" 1>&6
11768
11769         if test $ol_cv_db_none = yes ; then
11770                 ol_cv_lib_db=yes
11771         fi
11772 fi
11773
11774 if test $ol_cv_lib_db = no ; then
11775         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11776 echo "configure:11777: checking for Berkeley DB link (-ldb)" >&5
11777 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11778   echo $ac_n "(cached) $ac_c" 1>&6
11779 else
11780   
11781         ol_DB_LIB=-ldb
11782         ol_LIBS=$LIBS
11783         LIBS="$ol_DB_LIB $LIBS"
11784
11785         cat > conftest.$ac_ext <<EOF
11786 #line 11787 "configure"
11787 #include "confdefs.h"
11788
11789 #ifdef HAVE_DB_185_H
11790 # include <db_185.h>
11791 #else
11792 # include <db.h>
11793 #endif
11794
11795 #ifndef DB_VERSION_MAJOR
11796 # define DB_VERSION_MAJOR 1
11797 #endif
11798
11799 #ifndef NULL
11800 #define NULL ((void*)0)
11801 #endif
11802
11803 int main() {
11804
11805 #if DB_VERSION_MAJOR > 2
11806         db_env_create( NULL, 0 );
11807 #elif DB_VERSION_MAJOR > 1
11808         db_appexit( NULL );
11809 #else
11810         (void) dbopen( NULL, 0, 0, 0, NULL);
11811 #endif
11812
11813 ; return 0; }
11814 EOF
11815 if { (eval echo configure:11816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11816   rm -rf conftest*
11817   ol_cv_db_db=yes
11818 else
11819   echo "configure: failed program was:" >&5
11820   cat conftest.$ac_ext >&5
11821   rm -rf conftest*
11822   ol_cv_db_db=no
11823 fi
11824 rm -f conftest*
11825
11826         LIBS="$ol_LIBS"
11827
11828 fi
11829
11830 echo "$ac_t""$ol_cv_db_db" 1>&6
11831
11832         if test $ol_cv_db_db = yes ; then
11833                 ol_cv_lib_db=-ldb
11834         fi
11835 fi
11836
11837 if test $ol_cv_lib_db = no ; then
11838         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11839 echo "configure:11840: checking for Berkeley DB link (-ldb3)" >&5
11840 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11841   echo $ac_n "(cached) $ac_c" 1>&6
11842 else
11843   
11844         ol_DB_LIB=-ldb3
11845         ol_LIBS=$LIBS
11846         LIBS="$ol_DB_LIB $LIBS"
11847
11848         cat > conftest.$ac_ext <<EOF
11849 #line 11850 "configure"
11850 #include "confdefs.h"
11851
11852 #ifdef HAVE_DB_185_H
11853 # include <db_185.h>
11854 #else
11855 # include <db.h>
11856 #endif
11857
11858 #ifndef DB_VERSION_MAJOR
11859 # define DB_VERSION_MAJOR 1
11860 #endif
11861
11862 #ifndef NULL
11863 #define NULL ((void*)0)
11864 #endif
11865
11866 int main() {
11867
11868 #if DB_VERSION_MAJOR > 2
11869         db_env_create( NULL, 0 );
11870 #elif DB_VERSION_MAJOR > 1
11871         db_appexit( NULL );
11872 #else
11873         (void) dbopen( NULL, 0, 0, 0, NULL);
11874 #endif
11875
11876 ; return 0; }
11877 EOF
11878 if { (eval echo configure:11879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11879   rm -rf conftest*
11880   ol_cv_db_db3=yes
11881 else
11882   echo "configure: failed program was:" >&5
11883   cat conftest.$ac_ext >&5
11884   rm -rf conftest*
11885   ol_cv_db_db3=no
11886 fi
11887 rm -f conftest*
11888
11889         LIBS="$ol_LIBS"
11890
11891 fi
11892
11893 echo "$ac_t""$ol_cv_db_db3" 1>&6
11894
11895         if test $ol_cv_db_db3 = yes ; then
11896                 ol_cv_lib_db=-ldb3
11897         fi
11898 fi
11899
11900 if test $ol_cv_lib_db = no ; then
11901         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11902 echo "configure:11903: checking for Berkeley DB link (-ldb2)" >&5
11903 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11904   echo $ac_n "(cached) $ac_c" 1>&6
11905 else
11906   
11907         ol_DB_LIB=-ldb2
11908         ol_LIBS=$LIBS
11909         LIBS="$ol_DB_LIB $LIBS"
11910
11911         cat > conftest.$ac_ext <<EOF
11912 #line 11913 "configure"
11913 #include "confdefs.h"
11914
11915 #ifdef HAVE_DB_185_H
11916 # include <db_185.h>
11917 #else
11918 # include <db.h>
11919 #endif
11920
11921 #ifndef DB_VERSION_MAJOR
11922 # define DB_VERSION_MAJOR 1
11923 #endif
11924
11925 #ifndef NULL
11926 #define NULL ((void*)0)
11927 #endif
11928
11929 int main() {
11930
11931 #if DB_VERSION_MAJOR > 2
11932         db_env_create( NULL, 0 );
11933 #elif DB_VERSION_MAJOR > 1
11934         db_appexit( NULL );
11935 #else
11936         (void) dbopen( NULL, 0, 0, 0, NULL);
11937 #endif
11938
11939 ; return 0; }
11940 EOF
11941 if { (eval echo configure:11942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11942   rm -rf conftest*
11943   ol_cv_db_db2=yes
11944 else
11945   echo "configure: failed program was:" >&5
11946   cat conftest.$ac_ext >&5
11947   rm -rf conftest*
11948   ol_cv_db_db2=no
11949 fi
11950 rm -f conftest*
11951
11952         LIBS="$ol_LIBS"
11953
11954 fi
11955
11956 echo "$ac_t""$ol_cv_db_db2" 1>&6
11957
11958         if test $ol_cv_db_db2 = yes ; then
11959                 ol_cv_lib_db=-ldb2
11960         fi
11961 fi
11962
11963 if test $ol_cv_lib_db = no ; then
11964         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11965 echo "configure:11966: checking for Berkeley DB link (-ldb1)" >&5
11966 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11967   echo $ac_n "(cached) $ac_c" 1>&6
11968 else
11969   
11970         ol_DB_LIB=-ldb1
11971         ol_LIBS=$LIBS
11972         LIBS="$ol_DB_LIB $LIBS"
11973
11974         cat > conftest.$ac_ext <<EOF
11975 #line 11976 "configure"
11976 #include "confdefs.h"
11977
11978 #ifdef HAVE_DB_185_H
11979 # include <db_185.h>
11980 #else
11981 # include <db.h>
11982 #endif
11983
11984 #ifndef DB_VERSION_MAJOR
11985 # define DB_VERSION_MAJOR 1
11986 #endif
11987
11988 #ifndef NULL
11989 #define NULL ((void*)0)
11990 #endif
11991
11992 int main() {
11993
11994 #if DB_VERSION_MAJOR > 2
11995         db_env_create( NULL, 0 );
11996 #elif DB_VERSION_MAJOR > 1
11997         db_appexit( NULL );
11998 #else
11999         (void) dbopen( NULL, 0, 0, 0, NULL);
12000 #endif
12001
12002 ; return 0; }
12003 EOF
12004 if { (eval echo configure:12005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12005   rm -rf conftest*
12006   ol_cv_db_db1=yes
12007 else
12008   echo "configure: failed program was:" >&5
12009   cat conftest.$ac_ext >&5
12010   rm -rf conftest*
12011   ol_cv_db_db1=no
12012 fi
12013 rm -f conftest*
12014
12015         LIBS="$ol_LIBS"
12016
12017 fi
12018
12019 echo "$ac_t""$ol_cv_db_db1" 1>&6
12020
12021         if test $ol_cv_db_db1 = yes ; then
12022                 ol_cv_lib_db=-ldb1
12023         fi
12024 fi
12025
12026
12027         if test "$ol_cv_lib_db" != no ; then
12028                 ol_cv_berkeley_db=yes
12029                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12030 echo "configure:12031: checking for Berkeley DB thread support" >&5
12031 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12032   echo $ac_n "(cached) $ac_c" 1>&6
12033 else
12034   
12035         ol_LIBS="$LIBS"
12036         if test $ol_cv_lib_db != yes ; then
12037                 LIBS="$ol_cv_lib_db"
12038         fi
12039
12040         if test "$cross_compiling" = yes; then
12041   ol_cv_berkeley_db_thread=cross
12042 else
12043   cat > conftest.$ac_ext <<EOF
12044 #line 12045 "configure"
12045 #include "confdefs.h"
12046
12047 #ifdef HAVE_DB_185_H
12048         choke me;
12049 #else
12050 #include <db.h>
12051 #endif
12052 #ifndef NULL
12053 #define NULL ((void *)0)
12054 #endif
12055 main()
12056 {
12057         int rc;
12058         u_int32_t flags = DB_CREATE | DB_THREAD;
12059
12060
12061 #if DB_VERSION_MAJOR > 2
12062         DB_ENV *env = NULL;
12063
12064         rc = db_env_create( &env, 0 );
12065
12066         if( rc == 0 ) {
12067                 rc = env->open( env, NULL, NULL, flags, 0 );
12068         }
12069
12070 #else
12071         DB_ENV env;
12072         memset( &env, '\0', sizeof(env) );
12073
12074         rc = db_appinit( NULL, NULL, &env, flags );
12075
12076         if( rc == 0 ) {
12077                 db_appexit( &env );
12078         }
12079 #endif
12080
12081         return rc;
12082 }
12083 EOF
12084 if { (eval echo configure:12085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12085 then
12086   ol_cv_berkeley_db_thread=yes
12087 else
12088   echo "configure: failed program was:" >&5
12089   cat conftest.$ac_ext >&5
12090   rm -fr conftest*
12091   ol_cv_berkeley_db_thread=no
12092 fi
12093 rm -fr conftest*
12094 fi
12095
12096
12097         LIBS="$ol_LIBS"
12098
12099         if test $ol_cv_berkeley_db_thread != no ; then
12100                 cat >> confdefs.h <<\EOF
12101 #define HAVE_BERKELEY_DB_THREAD 1
12102 EOF
12103
12104         fi
12105
12106 fi
12107
12108 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12109         fi
12110 fi
12111
12112         fi
12113
12114         if test $ol_cv_berkeley_db != no ; then
12115                 cat >> confdefs.h <<\EOF
12116 #define HAVE_BERKELEY_DB 1
12117 EOF
12118
12119
12120                 ol_link_ldbm=berkeley
12121                 ol_with_ldbm_api=db
12122
12123                 if test $ol_with_ldbm_type = hash ; then
12124                         cat >> confdefs.h <<\EOF
12125 #define LDBM_USE_DBHASH 1
12126 EOF
12127
12128                 else
12129                         cat >> confdefs.h <<\EOF
12130 #define LDBM_USE_DBBTREE 1
12131 EOF
12132
12133                 fi
12134
12135                                                 if test $ol_cv_lib_db != yes ; then
12136                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12137                 fi
12138         fi
12139 fi
12140
12141 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12142         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12143         ol_with_ldbm_api=none
12144 fi
12145
12146 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12147         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12148 echo "configure:12149: checking for MDBM library" >&5
12149 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12150   echo $ac_n "(cached) $ac_c" 1>&6
12151 else
12152         ol_LIBS="$LIBS"
12153         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12154 echo "configure:12155: checking for mdbm_set_chain" >&5
12155 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12156   echo $ac_n "(cached) $ac_c" 1>&6
12157 else
12158   cat > conftest.$ac_ext <<EOF
12159 #line 12160 "configure"
12160 #include "confdefs.h"
12161 /* System header to define __stub macros and hopefully few prototypes,
12162     which can conflict with char mdbm_set_chain(); below.  */
12163 #include <assert.h>
12164 /* Override any gcc2 internal prototype to avoid an error.  */
12165 /* We use char because int might match the return type of a gcc2
12166     builtin and then its argument prototype would still apply.  */
12167 char mdbm_set_chain();
12168 char (*f)();
12169
12170 int main() {
12171
12172 /* The GNU C library defines this for functions which it implements
12173     to always fail with ENOSYS.  Some functions are actually named
12174     something starting with __ and the normal name is an alias.  */
12175 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12176 choke me
12177 #else
12178 f = mdbm_set_chain;
12179 #endif
12180
12181 ; return 0; }
12182 EOF
12183 if { (eval echo configure:12184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12184   rm -rf conftest*
12185   eval "ac_cv_func_mdbm_set_chain=yes"
12186 else
12187   echo "configure: failed program was:" >&5
12188   cat conftest.$ac_ext >&5
12189   rm -rf conftest*
12190   eval "ac_cv_func_mdbm_set_chain=no"
12191 fi
12192 rm -f conftest*
12193 fi
12194
12195 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12196   echo "$ac_t""yes" 1>&6
12197   ol_cv_lib_mdbm=yes
12198 else
12199   echo "$ac_t""no" 1>&6
12200
12201                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12202 echo "configure:12203: checking for mdbm_set_chain in -lmdbm" >&5
12203 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12204 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12205   echo $ac_n "(cached) $ac_c" 1>&6
12206 else
12207   ac_save_LIBS="$LIBS"
12208 LIBS="-lmdbm  $LIBS"
12209 cat > conftest.$ac_ext <<EOF
12210 #line 12211 "configure"
12211 #include "confdefs.h"
12212 /* Override any gcc2 internal prototype to avoid an error.  */
12213 /* We use char because int might match the return type of a gcc2
12214     builtin and then its argument prototype would still apply.  */
12215 char mdbm_set_chain();
12216
12217 int main() {
12218 mdbm_set_chain()
12219 ; return 0; }
12220 EOF
12221 if { (eval echo configure:12222: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12222   rm -rf conftest*
12223   eval "ac_cv_lib_$ac_lib_var=yes"
12224 else
12225   echo "configure: failed program was:" >&5
12226   cat conftest.$ac_ext >&5
12227   rm -rf conftest*
12228   eval "ac_cv_lib_$ac_lib_var=no"
12229 fi
12230 rm -f conftest*
12231 LIBS="$ac_save_LIBS"
12232
12233 fi
12234 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12235   echo "$ac_t""yes" 1>&6
12236   ol_cv_lib_mdbm=-lmdbm
12237 else
12238   echo "$ac_t""no" 1>&6
12239 ol_cv_lib_mdbm=no
12240 fi
12241
12242         
12243 fi
12244
12245         LIBS="$ol_LIBS"
12246
12247 fi
12248
12249 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12250
12251
12252  for ac_hdr in mdbm.h
12253 do
12254 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12255 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12256 echo "configure:12257: checking for $ac_hdr" >&5
12257 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12258   echo $ac_n "(cached) $ac_c" 1>&6
12259 else
12260   cat > conftest.$ac_ext <<EOF
12261 #line 12262 "configure"
12262 #include "confdefs.h"
12263 #include <$ac_hdr>
12264 EOF
12265 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12266 { (eval echo configure:12267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12267 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12268 if test -z "$ac_err"; then
12269   rm -rf conftest*
12270   eval "ac_cv_header_$ac_safe=yes"
12271 else
12272   echo "$ac_err" >&5
12273   echo "configure: failed program was:" >&5
12274   cat conftest.$ac_ext >&5
12275   rm -rf conftest*
12276   eval "ac_cv_header_$ac_safe=no"
12277 fi
12278 rm -f conftest*
12279 fi
12280 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12281   echo "$ac_t""yes" 1>&6
12282     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12283   cat >> confdefs.h <<EOF
12284 #define $ac_tr_hdr 1
12285 EOF
12286  
12287 else
12288   echo "$ac_t""no" 1>&6
12289 fi
12290 done
12291
12292  echo $ac_n "checking for db""... $ac_c" 1>&6
12293 echo "configure:12294: checking for db" >&5
12294 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12295   echo $ac_n "(cached) $ac_c" 1>&6
12296 else
12297   
12298         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12299                 ol_cv_mdbm=no
12300         else
12301                 ol_cv_mdbm=yes
12302         fi
12303
12304 fi
12305
12306 echo "$ac_t""$ol_cv_mdbm" 1>&6
12307  if test $ol_cv_mdbm = yes ; then
12308         cat >> confdefs.h <<\EOF
12309 #define HAVE_MDBM 1
12310 EOF
12311
12312  fi
12313
12314
12315         if test $ol_cv_mdbm = yes ; then
12316                 ol_link_ldbm=mdbm
12317                 ol_with_ldbm_api=mdbm
12318                 if test $ol_cv_lib_mdbm != yes ; then
12319                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
12320                 fi
12321         fi
12322 fi
12323
12324 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
12325         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
12326 echo "configure:12327: checking for GDBM library" >&5
12327 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
12328   echo $ac_n "(cached) $ac_c" 1>&6
12329 else
12330         ol_LIBS="$LIBS"
12331         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
12332 echo "configure:12333: checking for gdbm_open" >&5
12333 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
12334   echo $ac_n "(cached) $ac_c" 1>&6
12335 else
12336   cat > conftest.$ac_ext <<EOF
12337 #line 12338 "configure"
12338 #include "confdefs.h"
12339 /* System header to define __stub macros and hopefully few prototypes,
12340     which can conflict with char gdbm_open(); below.  */
12341 #include <assert.h>
12342 /* Override any gcc2 internal prototype to avoid an error.  */
12343 /* We use char because int might match the return type of a gcc2
12344     builtin and then its argument prototype would still apply.  */
12345 char gdbm_open();
12346 char (*f)();
12347
12348 int main() {
12349
12350 /* The GNU C library defines this for functions which it implements
12351     to always fail with ENOSYS.  Some functions are actually named
12352     something starting with __ and the normal name is an alias.  */
12353 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
12354 choke me
12355 #else
12356 f = gdbm_open;
12357 #endif
12358
12359 ; return 0; }
12360 EOF
12361 if { (eval echo configure:12362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12362   rm -rf conftest*
12363   eval "ac_cv_func_gdbm_open=yes"
12364 else
12365   echo "configure: failed program was:" >&5
12366   cat conftest.$ac_ext >&5
12367   rm -rf conftest*
12368   eval "ac_cv_func_gdbm_open=no"
12369 fi
12370 rm -f conftest*
12371 fi
12372
12373 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
12374   echo "$ac_t""yes" 1>&6
12375   ol_cv_lib_gdbm=yes
12376 else
12377   echo "$ac_t""no" 1>&6
12378
12379                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
12380 echo "configure:12381: checking for gdbm_open in -lgdbm" >&5
12381 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
12382 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12383   echo $ac_n "(cached) $ac_c" 1>&6
12384 else
12385   ac_save_LIBS="$LIBS"
12386 LIBS="-lgdbm  $LIBS"
12387 cat > conftest.$ac_ext <<EOF
12388 #line 12389 "configure"
12389 #include "confdefs.h"
12390 /* Override any gcc2 internal prototype to avoid an error.  */
12391 /* We use char because int might match the return type of a gcc2
12392     builtin and then its argument prototype would still apply.  */
12393 char gdbm_open();
12394
12395 int main() {
12396 gdbm_open()
12397 ; return 0; }
12398 EOF
12399 if { (eval echo configure:12400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12400   rm -rf conftest*
12401   eval "ac_cv_lib_$ac_lib_var=yes"
12402 else
12403   echo "configure: failed program was:" >&5
12404   cat conftest.$ac_ext >&5
12405   rm -rf conftest*
12406   eval "ac_cv_lib_$ac_lib_var=no"
12407 fi
12408 rm -f conftest*
12409 LIBS="$ac_save_LIBS"
12410
12411 fi
12412 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12413   echo "$ac_t""yes" 1>&6
12414   ol_cv_lib_gdbm=-lgdbm
12415 else
12416   echo "$ac_t""no" 1>&6
12417 ol_cv_lib_gdbm=no
12418 fi
12419
12420         
12421 fi
12422
12423         LIBS="$ol_LIBS"
12424
12425 fi
12426
12427 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
12428
12429
12430  for ac_hdr in gdbm.h
12431 do
12432 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12433 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12434 echo "configure:12435: checking for $ac_hdr" >&5
12435 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12436   echo $ac_n "(cached) $ac_c" 1>&6
12437 else
12438   cat > conftest.$ac_ext <<EOF
12439 #line 12440 "configure"
12440 #include "confdefs.h"
12441 #include <$ac_hdr>
12442 EOF
12443 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12444 { (eval echo configure:12445: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12445 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12446 if test -z "$ac_err"; then
12447   rm -rf conftest*
12448   eval "ac_cv_header_$ac_safe=yes"
12449 else
12450   echo "$ac_err" >&5
12451   echo "configure: failed program was:" >&5
12452   cat conftest.$ac_ext >&5
12453   rm -rf conftest*
12454   eval "ac_cv_header_$ac_safe=no"
12455 fi
12456 rm -f conftest*
12457 fi
12458 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12459   echo "$ac_t""yes" 1>&6
12460     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12461   cat >> confdefs.h <<EOF
12462 #define $ac_tr_hdr 1
12463 EOF
12464  
12465 else
12466   echo "$ac_t""no" 1>&6
12467 fi
12468 done
12469
12470  echo $ac_n "checking for db""... $ac_c" 1>&6
12471 echo "configure:12472: checking for db" >&5
12472 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
12473   echo $ac_n "(cached) $ac_c" 1>&6
12474 else
12475   
12476         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
12477                 ol_cv_gdbm=no
12478         else
12479                 ol_cv_gdbm=yes
12480         fi
12481
12482 fi
12483
12484 echo "$ac_t""$ol_cv_gdbm" 1>&6
12485  if test $ol_cv_gdbm = yes ; then
12486         cat >> confdefs.h <<\EOF
12487 #define HAVE_GDBM 1
12488 EOF
12489
12490  fi
12491
12492
12493         if test $ol_cv_gdbm = yes ; then
12494                 ol_link_ldbm=gdbm
12495                 ol_with_ldbm_api=gdbm
12496
12497                 if test $ol_cv_lib_gdbm != yes ; then
12498                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
12499                 fi
12500         fi
12501 fi
12502
12503 if test $ol_with_ldbm_api = ndbm ; then
12504         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
12505 echo "configure:12506: checking for NDBM library" >&5
12506 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
12507   echo $ac_n "(cached) $ac_c" 1>&6
12508 else
12509         ol_LIBS="$LIBS"
12510         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12511 echo "configure:12512: checking for dbm_open" >&5
12512 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
12513   echo $ac_n "(cached) $ac_c" 1>&6
12514 else
12515   cat > conftest.$ac_ext <<EOF
12516 #line 12517 "configure"
12517 #include "confdefs.h"
12518 /* System header to define __stub macros and hopefully few prototypes,
12519     which can conflict with char dbm_open(); below.  */
12520 #include <assert.h>
12521 /* Override any gcc2 internal prototype to avoid an error.  */
12522 /* We use char because int might match the return type of a gcc2
12523     builtin and then its argument prototype would still apply.  */
12524 char dbm_open();
12525 char (*f)();
12526
12527 int main() {
12528
12529 /* The GNU C library defines this for functions which it implements
12530     to always fail with ENOSYS.  Some functions are actually named
12531     something starting with __ and the normal name is an alias.  */
12532 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12533 choke me
12534 #else
12535 f = dbm_open;
12536 #endif
12537
12538 ; return 0; }
12539 EOF
12540 if { (eval echo configure:12541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12541   rm -rf conftest*
12542   eval "ac_cv_func_dbm_open=yes"
12543 else
12544   echo "configure: failed program was:" >&5
12545   cat conftest.$ac_ext >&5
12546   rm -rf conftest*
12547   eval "ac_cv_func_dbm_open=no"
12548 fi
12549 rm -f conftest*
12550 fi
12551
12552 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12553   echo "$ac_t""yes" 1>&6
12554   ol_cv_lib_ndbm=yes
12555 else
12556   echo "$ac_t""no" 1>&6
12557
12558                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
12559 echo "configure:12560: checking for dbm_open in -lndbm" >&5
12560 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12561 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12562   echo $ac_n "(cached) $ac_c" 1>&6
12563 else
12564   ac_save_LIBS="$LIBS"
12565 LIBS="-lndbm  $LIBS"
12566 cat > conftest.$ac_ext <<EOF
12567 #line 12568 "configure"
12568 #include "confdefs.h"
12569 /* Override any gcc2 internal prototype to avoid an error.  */
12570 /* We use char because int might match the return type of a gcc2
12571     builtin and then its argument prototype would still apply.  */
12572 char dbm_open();
12573
12574 int main() {
12575 dbm_open()
12576 ; return 0; }
12577 EOF
12578 if { (eval echo configure:12579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12579   rm -rf conftest*
12580   eval "ac_cv_lib_$ac_lib_var=yes"
12581 else
12582   echo "configure: failed program was:" >&5
12583   cat conftest.$ac_ext >&5
12584   rm -rf conftest*
12585   eval "ac_cv_lib_$ac_lib_var=no"
12586 fi
12587 rm -f conftest*
12588 LIBS="$ac_save_LIBS"
12589
12590 fi
12591 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12592   echo "$ac_t""yes" 1>&6
12593   ol_cv_lib_ndbm=-lndbm
12594 else
12595   echo "$ac_t""no" 1>&6
12596
12597                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12598 echo "configure:12599: checking for dbm_open in -ldbm" >&5
12599 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12600 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12601   echo $ac_n "(cached) $ac_c" 1>&6
12602 else
12603   ac_save_LIBS="$LIBS"
12604 LIBS="-ldbm  $LIBS"
12605 cat > conftest.$ac_ext <<EOF
12606 #line 12607 "configure"
12607 #include "confdefs.h"
12608 /* Override any gcc2 internal prototype to avoid an error.  */
12609 /* We use char because int might match the return type of a gcc2
12610     builtin and then its argument prototype would still apply.  */
12611 char dbm_open();
12612
12613 int main() {
12614 dbm_open()
12615 ; return 0; }
12616 EOF
12617 if { (eval echo configure:12618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12618   rm -rf conftest*
12619   eval "ac_cv_lib_$ac_lib_var=yes"
12620 else
12621   echo "configure: failed program was:" >&5
12622   cat conftest.$ac_ext >&5
12623   rm -rf conftest*
12624   eval "ac_cv_lib_$ac_lib_var=no"
12625 fi
12626 rm -f conftest*
12627 LIBS="$ac_save_LIBS"
12628
12629 fi
12630 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12631   echo "$ac_t""yes" 1>&6
12632   ol_cv_lib_ndbm=-ldbm
12633 else
12634   echo "$ac_t""no" 1>&6
12635 ol_cv_lib_ndbm=no
12636 fi
12637                 
12638 fi
12639
12640         
12641 fi
12642
12643         LIBS="$ol_LIBS"
12644
12645 fi
12646
12647 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
12648
12649
12650  for ac_hdr in ndbm.h
12651 do
12652 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12653 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12654 echo "configure:12655: checking for $ac_hdr" >&5
12655 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12656   echo $ac_n "(cached) $ac_c" 1>&6
12657 else
12658   cat > conftest.$ac_ext <<EOF
12659 #line 12660 "configure"
12660 #include "confdefs.h"
12661 #include <$ac_hdr>
12662 EOF
12663 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12664 { (eval echo configure:12665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12665 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12666 if test -z "$ac_err"; then
12667   rm -rf conftest*
12668   eval "ac_cv_header_$ac_safe=yes"
12669 else
12670   echo "$ac_err" >&5
12671   echo "configure: failed program was:" >&5
12672   cat conftest.$ac_ext >&5
12673   rm -rf conftest*
12674   eval "ac_cv_header_$ac_safe=no"
12675 fi
12676 rm -f conftest*
12677 fi
12678 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12679   echo "$ac_t""yes" 1>&6
12680     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12681   cat >> confdefs.h <<EOF
12682 #define $ac_tr_hdr 1
12683 EOF
12684  
12685 else
12686   echo "$ac_t""no" 1>&6
12687 fi
12688 done
12689
12690  echo $ac_n "checking for db""... $ac_c" 1>&6
12691 echo "configure:12692: checking for db" >&5
12692 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
12693   echo $ac_n "(cached) $ac_c" 1>&6
12694 else
12695   
12696         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
12697                 ol_cv_ndbm=no
12698         else
12699                 ol_cv_ndbm=yes
12700         fi
12701
12702 fi
12703
12704 echo "$ac_t""$ol_cv_ndbm" 1>&6
12705  if test $ol_cv_ndbm = yes ; then
12706         cat >> confdefs.h <<\EOF
12707 #define HAVE_NDBM 1
12708 EOF
12709
12710  fi
12711
12712
12713         if test $ol_cv_ndbm = yes ; then
12714                 ol_link_ldbm=ndbm
12715                 ol_with_ldbm_api=ndbm
12716
12717                 if test $ol_cv_lib_ndbm != yes ; then
12718                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
12719                 fi
12720         fi
12721 fi
12722
12723 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
12724         echo "configure: warning: could not find suitable LDBM backend" 1>&2
12725         if test $ol_enable_ldbm = yes ; then
12726                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
12727         fi
12728
12729         echo "configure: warning: disabling LDBM" 1>&2
12730         ol_enable_ldbm=no
12731 fi
12732
12733 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
12734         LINK_BINS_DYNAMIC="yes"
12735 else
12736         LINK_BINS_DYNAMIC="no"
12737 fi
12738
12739 if test $ol_enable_wrappers != no ; then
12740         for ac_hdr in tcpd.h
12741 do
12742 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12743 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12744 echo "configure:12745: checking for $ac_hdr" >&5
12745 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12746   echo $ac_n "(cached) $ac_c" 1>&6
12747 else
12748   cat > conftest.$ac_ext <<EOF
12749 #line 12750 "configure"
12750 #include "confdefs.h"
12751 #include <$ac_hdr>
12752 EOF
12753 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12754 { (eval echo configure:12755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12755 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12756 if test -z "$ac_err"; then
12757   rm -rf conftest*
12758   eval "ac_cv_header_$ac_safe=yes"
12759 else
12760   echo "$ac_err" >&5
12761   echo "configure: failed program was:" >&5
12762   cat conftest.$ac_ext >&5
12763   rm -rf conftest*
12764   eval "ac_cv_header_$ac_safe=no"
12765 fi
12766 rm -f conftest*
12767 fi
12768 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12769   echo "$ac_t""yes" 1>&6
12770     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12771   cat >> confdefs.h <<EOF
12772 #define $ac_tr_hdr 1
12773 EOF
12774  
12775 else
12776   echo "$ac_t""no" 1>&6
12777 fi
12778 done
12779
12780
12781         if test $ac_cv_header_tcpd_h != yes ; then
12782                 have_wrappers=no
12783         else
12784                 cat > conftest.$ac_ext <<EOF
12785 #line 12786 "configure"
12786 #include "confdefs.h"
12787
12788 int allow_severity = 0;
12789 int deny_severity  = 0;
12790                 
12791 int main() {
12792 hosts_access()
12793 ; return 0; }
12794 EOF
12795 if { (eval echo configure:12796: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12796   rm -rf conftest*
12797   have_wrappers=yes
12798 else
12799   echo "configure: failed program was:" >&5
12800   cat conftest.$ac_ext >&5
12801   rm -rf conftest*
12802   have_wrappers=no
12803 fi
12804 rm -f conftest*
12805         fi
12806
12807         if test $have_wrappers = yes ; then
12808                 cat >> confdefs.h <<\EOF
12809 #define HAVE_TCPD 1
12810 EOF
12811
12812                 WRAP_LIBS="-lwrap"
12813
12814                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
12815 echo "configure:12816: checking for main in -lnsl" >&5
12816 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
12817 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12818   echo $ac_n "(cached) $ac_c" 1>&6
12819 else
12820   ac_save_LIBS="$LIBS"
12821 LIBS="-lnsl  $LIBS"
12822 cat > conftest.$ac_ext <<EOF
12823 #line 12824 "configure"
12824 #include "confdefs.h"
12825
12826 int main() {
12827 main()
12828 ; return 0; }
12829 EOF
12830 if { (eval echo configure:12831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12831   rm -rf conftest*
12832   eval "ac_cv_lib_$ac_lib_var=yes"
12833 else
12834   echo "configure: failed program was:" >&5
12835   cat conftest.$ac_ext >&5
12836   rm -rf conftest*
12837   eval "ac_cv_lib_$ac_lib_var=no"
12838 fi
12839 rm -f conftest*
12840 LIBS="$ac_save_LIBS"
12841
12842 fi
12843 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12844   echo "$ac_t""yes" 1>&6
12845     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
12846     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
12847   cat >> confdefs.h <<EOF
12848 #define $ac_tr_lib 1
12849 EOF
12850
12851   LIBS="-lnsl $LIBS"
12852
12853 else
12854   echo "$ac_t""no" 1>&6
12855 fi
12856
12857         else
12858                 echo "configure: warning: could not find -lwrap" 1>&2
12859                 if test $ol_enable_wrappers = yes ; then
12860                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
12861                 fi
12862
12863                 echo "configure: warning: disabling wrappers support" 1>&2
12864                 ol_enable_wrappers=no
12865                 WRAP_LIBS=""
12866         fi
12867 fi
12868
12869 if test $ol_enable_syslog != no ; then
12870         echo $ac_n "checking for openlog""... $ac_c" 1>&6
12871 echo "configure:12872: checking for openlog" >&5
12872 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
12873   echo $ac_n "(cached) $ac_c" 1>&6
12874 else
12875   cat > conftest.$ac_ext <<EOF
12876 #line 12877 "configure"
12877 #include "confdefs.h"
12878 /* System header to define __stub macros and hopefully few prototypes,
12879     which can conflict with char openlog(); below.  */
12880 #include <assert.h>
12881 /* Override any gcc2 internal prototype to avoid an error.  */
12882 /* We use char because int might match the return type of a gcc2
12883     builtin and then its argument prototype would still apply.  */
12884 char openlog();
12885 char (*f)();
12886
12887 int main() {
12888
12889 /* The GNU C library defines this for functions which it implements
12890     to always fail with ENOSYS.  Some functions are actually named
12891     something starting with __ and the normal name is an alias.  */
12892 #if defined (__stub_openlog) || defined (__stub___openlog)
12893 choke me
12894 #else
12895 f = openlog;
12896 #endif
12897
12898 ; return 0; }
12899 EOF
12900 if { (eval echo configure:12901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12901   rm -rf conftest*
12902   eval "ac_cv_func_openlog=yes"
12903 else
12904   echo "configure: failed program was:" >&5
12905   cat conftest.$ac_ext >&5
12906   rm -rf conftest*
12907   eval "ac_cv_func_openlog=no"
12908 fi
12909 rm -f conftest*
12910 fi
12911
12912 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
12913   echo "$ac_t""yes" 1>&6
12914   :
12915 else
12916   echo "$ac_t""no" 1>&6
12917 fi
12918
12919         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
12920                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
12921         fi
12922         ol_enable_syslog=$ac_cv_func_openlog
12923 fi
12924
12925 ol_link_termcap=no
12926 for ac_hdr in termcap.h ncurses.h
12927 do
12928 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12929 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12930 echo "configure:12931: checking for $ac_hdr" >&5
12931 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12932   echo $ac_n "(cached) $ac_c" 1>&6
12933 else
12934   cat > conftest.$ac_ext <<EOF
12935 #line 12936 "configure"
12936 #include "confdefs.h"
12937 #include <$ac_hdr>
12938 EOF
12939 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12940 { (eval echo configure:12941: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12941 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12942 if test -z "$ac_err"; then
12943   rm -rf conftest*
12944   eval "ac_cv_header_$ac_safe=yes"
12945 else
12946   echo "$ac_err" >&5
12947   echo "configure: failed program was:" >&5
12948   cat conftest.$ac_ext >&5
12949   rm -rf conftest*
12950   eval "ac_cv_header_$ac_safe=no"
12951 fi
12952 rm -f conftest*
12953 fi
12954 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12955   echo "$ac_t""yes" 1>&6
12956     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12957   cat >> confdefs.h <<EOF
12958 #define $ac_tr_hdr 1
12959 EOF
12960  
12961 else
12962   echo "$ac_t""no" 1>&6
12963 fi
12964 done
12965
12966
12967 if test $ol_link_termcap = no ; then
12968         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
12969 echo "configure:12970: checking for tputs in -ltermcap" >&5
12970 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
12971 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12972   echo $ac_n "(cached) $ac_c" 1>&6
12973 else
12974   ac_save_LIBS="$LIBS"
12975 LIBS="-ltermcap  $LIBS"
12976 cat > conftest.$ac_ext <<EOF
12977 #line 12978 "configure"
12978 #include "confdefs.h"
12979 /* Override any gcc2 internal prototype to avoid an error.  */
12980 /* We use char because int might match the return type of a gcc2
12981     builtin and then its argument prototype would still apply.  */
12982 char tputs();
12983
12984 int main() {
12985 tputs()
12986 ; return 0; }
12987 EOF
12988 if { (eval echo configure:12989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12989   rm -rf conftest*
12990   eval "ac_cv_lib_$ac_lib_var=yes"
12991 else
12992   echo "configure: failed program was:" >&5
12993   cat conftest.$ac_ext >&5
12994   rm -rf conftest*
12995   eval "ac_cv_lib_$ac_lib_var=no"
12996 fi
12997 rm -f conftest*
12998 LIBS="$ac_save_LIBS"
12999
13000 fi
13001 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13002   echo "$ac_t""yes" 1>&6
13003   have_termcap=yes
13004 else
13005   echo "$ac_t""no" 1>&6
13006 have_termcap=no
13007 fi
13008
13009         if test $have_termcap = yes ; then
13010                 cat >> confdefs.h <<\EOF
13011 #define HAVE_TERMCAP 1
13012 EOF
13013
13014                 ol_link_termcap=yes
13015                 TERMCAP_LIBS=-ltermcap
13016         fi
13017 fi
13018
13019 if test $ol_link_termcap = no ; then
13020         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13021 echo "configure:13022: checking for initscr in -lncurses" >&5
13022 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13023 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13024   echo $ac_n "(cached) $ac_c" 1>&6
13025 else
13026   ac_save_LIBS="$LIBS"
13027 LIBS="-lncurses  $LIBS"
13028 cat > conftest.$ac_ext <<EOF
13029 #line 13030 "configure"
13030 #include "confdefs.h"
13031 /* Override any gcc2 internal prototype to avoid an error.  */
13032 /* We use char because int might match the return type of a gcc2
13033     builtin and then its argument prototype would still apply.  */
13034 char initscr();
13035
13036 int main() {
13037 initscr()
13038 ; return 0; }
13039 EOF
13040 if { (eval echo configure:13041: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13041   rm -rf conftest*
13042   eval "ac_cv_lib_$ac_lib_var=yes"
13043 else
13044   echo "configure: failed program was:" >&5
13045   cat conftest.$ac_ext >&5
13046   rm -rf conftest*
13047   eval "ac_cv_lib_$ac_lib_var=no"
13048 fi
13049 rm -f conftest*
13050 LIBS="$ac_save_LIBS"
13051
13052 fi
13053 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13054   echo "$ac_t""yes" 1>&6
13055   have_ncurses=yes
13056 else
13057   echo "$ac_t""no" 1>&6
13058 have_ncurses=no
13059 fi
13060
13061         if test $have_ncurses = yes ; then
13062                 cat >> confdefs.h <<\EOF
13063 #define HAVE_NCURSES 1
13064 EOF
13065
13066                 ol_link_termcap=yes
13067                 TERMCAP_LIBS=-lncurses
13068         fi
13069 fi
13070
13071 if test $ol_link_termcap = no ; then
13072         cat >> confdefs.h <<\EOF
13073 #define NO_TERMCAP 1
13074 EOF
13075
13076         TERMCAP_LIBS=
13077 fi
13078
13079 ol_link_sasl=no
13080 ol_link_spasswd=no
13081 if test $ol_with_cyrus_sasl != no ; then
13082         ac_safe=`echo "sasl.h" | sed 'y%./+-%__p_%'`
13083 echo $ac_n "checking for sasl.h""... $ac_c" 1>&6
13084 echo "configure:13085: checking for sasl.h" >&5
13085 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13086   echo $ac_n "(cached) $ac_c" 1>&6
13087 else
13088   cat > conftest.$ac_ext <<EOF
13089 #line 13090 "configure"
13090 #include "confdefs.h"
13091 #include <sasl.h>
13092 EOF
13093 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13094 { (eval echo configure:13095: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13095 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13096 if test -z "$ac_err"; then
13097   rm -rf conftest*
13098   eval "ac_cv_header_$ac_safe=yes"
13099 else
13100   echo "$ac_err" >&5
13101   echo "configure: failed program was:" >&5
13102   cat conftest.$ac_ext >&5
13103   rm -rf conftest*
13104   eval "ac_cv_header_$ac_safe=no"
13105 fi
13106 rm -f conftest*
13107 fi
13108 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13109   echo "$ac_t""yes" 1>&6
13110   :
13111 else
13112   echo "$ac_t""no" 1>&6
13113 fi
13114
13115
13116         if test $ac_cv_header_sasl_h = yes ; then
13117                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
13118 echo "configure:13119: checking for sasl_client_init in -lsasl" >&5
13119 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
13120 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13121   echo $ac_n "(cached) $ac_c" 1>&6
13122 else
13123   ac_save_LIBS="$LIBS"
13124 LIBS="-lsasl  $LIBS"
13125 cat > conftest.$ac_ext <<EOF
13126 #line 13127 "configure"
13127 #include "confdefs.h"
13128 /* Override any gcc2 internal prototype to avoid an error.  */
13129 /* We use char because int might match the return type of a gcc2
13130     builtin and then its argument prototype would still apply.  */
13131 char sasl_client_init();
13132
13133 int main() {
13134 sasl_client_init()
13135 ; return 0; }
13136 EOF
13137 if { (eval echo configure:13138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13138   rm -rf conftest*
13139   eval "ac_cv_lib_$ac_lib_var=yes"
13140 else
13141   echo "configure: failed program was:" >&5
13142   cat conftest.$ac_ext >&5
13143   rm -rf conftest*
13144   eval "ac_cv_lib_$ac_lib_var=no"
13145 fi
13146 rm -f conftest*
13147 LIBS="$ac_save_LIBS"
13148
13149 fi
13150 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13151   echo "$ac_t""yes" 1>&6
13152   have_cyrus_sasl=yes
13153 else
13154   echo "$ac_t""no" 1>&6
13155 have_cyrus_sasl=no
13156 fi
13157
13158
13159                 if test $have_cyrus_sasl != no ; then
13160                         SASL_LIBS="-lsasl"
13161                         cat >> confdefs.h <<\EOF
13162 #define HAVE_CYRUS_SASL 1
13163 EOF
13164
13165                         ol_link_sasl=yes
13166                 fi
13167         fi
13168
13169         if test $ol_link_sasl = no -a $ol_with_cyrus_sasl = yes ; then
13170                 { echo "configure: error: no suitable API for --with-cyrus-sasl=$ol_with_cyrus_sasl" 1>&2; exit 1; }
13171         fi
13172 fi
13173
13174 if test $cross_compiling != yes ; then
13175         dev=no
13176         if test -r /dev/urandom ; then
13177                 dev="/dev/urandom";
13178         elif test -r /idev/urandom ; then
13179                 dev="/idev/urandom";
13180         elif test -r /dev/srandom ; then
13181                 dev="/dev/srandom";
13182         elif test -r /dev/random ; then
13183                 dev="/dev/random";
13184         elif test -r /idev/random ; then
13185                 dev="/idev/random";
13186         fi
13187
13188         if test $dev != no ; then
13189                 cat >> confdefs.h <<EOF
13190 #define URANDOM_DEVICE "$dev"
13191 EOF
13192
13193         fi
13194 fi
13195
13196 ol_link_fetch=no
13197 if test $ol_with_fetch != no ; then
13198         ol_LIBS=$LIBS
13199 LIBS="-lfetch -lcom_err $LIBS"
13200 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
13201 echo "configure:13202: checking fetch(3) library" >&5
13202 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
13203   echo $ac_n "(cached) $ac_c" 1>&6
13204 else
13205   
13206         cat > conftest.$ac_ext <<EOF
13207 #line 13208 "configure"
13208 #include "confdefs.h"
13209
13210 #include <sys/param.h>
13211 #include <stdio.h>
13212 #include <fetch.h>
13213 int main() {
13214 struct url *u = fetchParseURL("file:///"); 
13215 ; return 0; }
13216 EOF
13217 if { (eval echo configure:13218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13218   rm -rf conftest*
13219   ol_cv_lib_fetch=yes
13220 else
13221   echo "configure: failed program was:" >&5
13222   cat conftest.$ac_ext >&5
13223   rm -rf conftest*
13224   ol_cv_lib_fetch=no
13225 fi
13226 rm -f conftest*
13227 fi
13228
13229 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
13230 LIBS=$ol_LIBS
13231 if test $ol_cv_lib_fetch != no ; then
13232         ol_link_fetch="-lfetch -lcom_err"
13233         cat >> confdefs.h <<\EOF
13234 #define HAVE_FETCH 1
13235 EOF
13236
13237 fi
13238
13239
13240         if test $ol_cv_lib_fetch != no ; then
13241                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
13242                 ol_link_fetch=freebsd
13243
13244         elif test $ol_with_fetch != auto ; then
13245                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
13246         fi 
13247 fi
13248
13249 ol_link_readline=no
13250 if test $ol_with_readline != no ; then
13251         for ac_hdr in readline/readline.h readline/history.h
13252 do
13253 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13254 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13255 echo "configure:13256: checking for $ac_hdr" >&5
13256 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13257   echo $ac_n "(cached) $ac_c" 1>&6
13258 else
13259   cat > conftest.$ac_ext <<EOF
13260 #line 13261 "configure"
13261 #include "confdefs.h"
13262 #include <$ac_hdr>
13263 EOF
13264 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13265 { (eval echo configure:13266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13266 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13267 if test -z "$ac_err"; then
13268   rm -rf conftest*
13269   eval "ac_cv_header_$ac_safe=yes"
13270 else
13271   echo "$ac_err" >&5
13272   echo "configure: failed program was:" >&5
13273   cat conftest.$ac_ext >&5
13274   rm -rf conftest*
13275   eval "ac_cv_header_$ac_safe=no"
13276 fi
13277 rm -f conftest*
13278 fi
13279 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13280   echo "$ac_t""yes" 1>&6
13281     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13282   cat >> confdefs.h <<EOF
13283 #define $ac_tr_hdr 1
13284 EOF
13285  
13286 else
13287   echo "$ac_t""no" 1>&6
13288 fi
13289 done
13290
13291
13292         if test $ac_cv_header_readline_readline_h = yes ; then
13293                 save_LIBS="$LIBS"
13294                 LIBS="$TERMCAP_LIBS $LIBS"
13295                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
13296 echo "configure:13297: checking for readline in -lreadline" >&5
13297 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
13298 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13299   echo $ac_n "(cached) $ac_c" 1>&6
13300 else
13301   ac_save_LIBS="$LIBS"
13302 LIBS="-lreadline  $LIBS"
13303 cat > conftest.$ac_ext <<EOF
13304 #line 13305 "configure"
13305 #include "confdefs.h"
13306 /* Override any gcc2 internal prototype to avoid an error.  */
13307 /* We use char because int might match the return type of a gcc2
13308     builtin and then its argument prototype would still apply.  */
13309 char readline();
13310
13311 int main() {
13312 readline()
13313 ; return 0; }
13314 EOF
13315 if { (eval echo configure:13316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13316   rm -rf conftest*
13317   eval "ac_cv_lib_$ac_lib_var=yes"
13318 else
13319   echo "configure: failed program was:" >&5
13320   cat conftest.$ac_ext >&5
13321   rm -rf conftest*
13322   eval "ac_cv_lib_$ac_lib_var=no"
13323 fi
13324 rm -f conftest*
13325 LIBS="$ac_save_LIBS"
13326
13327 fi
13328 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13329   echo "$ac_t""yes" 1>&6
13330   have_readline=yes
13331 else
13332   echo "$ac_t""no" 1>&6
13333 have_readline=no
13334 fi
13335
13336                 LIBS="$save_LIBS"
13337                         
13338                 if test $have_readline = yes ; then
13339                         ol_with_readline=found
13340                         ol_link_readline=yes
13341
13342                         READLINE_LIBS="-lreadline"
13343                 fi
13344         fi
13345 fi
13346
13347 if test $ol_link_readline = yes ; then
13348         cat >> confdefs.h <<\EOF
13349 #define HAVE_READLINE 1
13350 EOF
13351
13352 fi
13353
13354
13355 if test $ol_enable_crypt != no ; then
13356         echo $ac_n "checking for crypt""... $ac_c" 1>&6
13357 echo "configure:13358: checking for crypt" >&5
13358 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
13359   echo $ac_n "(cached) $ac_c" 1>&6
13360 else
13361   cat > conftest.$ac_ext <<EOF
13362 #line 13363 "configure"
13363 #include "confdefs.h"
13364 /* System header to define __stub macros and hopefully few prototypes,
13365     which can conflict with char crypt(); below.  */
13366 #include <assert.h>
13367 /* Override any gcc2 internal prototype to avoid an error.  */
13368 /* We use char because int might match the return type of a gcc2
13369     builtin and then its argument prototype would still apply.  */
13370 char crypt();
13371 char (*f)();
13372
13373 int main() {
13374
13375 /* The GNU C library defines this for functions which it implements
13376     to always fail with ENOSYS.  Some functions are actually named
13377     something starting with __ and the normal name is an alias.  */
13378 #if defined (__stub_crypt) || defined (__stub___crypt)
13379 choke me
13380 #else
13381 f = crypt;
13382 #endif
13383
13384 ; return 0; }
13385 EOF
13386 if { (eval echo configure:13387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13387   rm -rf conftest*
13388   eval "ac_cv_func_crypt=yes"
13389 else
13390   echo "configure: failed program was:" >&5
13391   cat conftest.$ac_ext >&5
13392   rm -rf conftest*
13393   eval "ac_cv_func_crypt=no"
13394 fi
13395 rm -f conftest*
13396 fi
13397
13398 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
13399   echo "$ac_t""yes" 1>&6
13400   have_crypt=yes
13401 else
13402   echo "$ac_t""no" 1>&6
13403
13404                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
13405 echo "configure:13406: checking for crypt in -lcrypt" >&5
13406 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
13407 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13408   echo $ac_n "(cached) $ac_c" 1>&6
13409 else
13410   ac_save_LIBS="$LIBS"
13411 LIBS="-lcrypt  $LIBS"
13412 cat > conftest.$ac_ext <<EOF
13413 #line 13414 "configure"
13414 #include "confdefs.h"
13415 /* Override any gcc2 internal prototype to avoid an error.  */
13416 /* We use char because int might match the return type of a gcc2
13417     builtin and then its argument prototype would still apply.  */
13418 char crypt();
13419
13420 int main() {
13421 crypt()
13422 ; return 0; }
13423 EOF
13424 if { (eval echo configure:13425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13425   rm -rf conftest*
13426   eval "ac_cv_lib_$ac_lib_var=yes"
13427 else
13428   echo "configure: failed program was:" >&5
13429   cat conftest.$ac_ext >&5
13430   rm -rf conftest*
13431   eval "ac_cv_lib_$ac_lib_var=no"
13432 fi
13433 rm -f conftest*
13434 LIBS="$ac_save_LIBS"
13435
13436 fi
13437 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13438   echo "$ac_t""yes" 1>&6
13439   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
13440                         have_crypt=yes
13441 else
13442   echo "$ac_t""no" 1>&6
13443 have_crypt=no
13444 fi
13445
13446 fi
13447
13448
13449         if test $have_crypt = yes ; then
13450                 cat >> confdefs.h <<\EOF
13451 #define HAVE_CRYPT 1
13452 EOF
13453
13454         else
13455                 echo "configure: warning: could not find crypt" 1>&2
13456                 if test $ol_enable_crypt = yes ; then
13457                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
13458                 fi
13459
13460                 echo "configure: warning: disabling crypt support" 1>&2
13461                 ol_enable_crypt=no
13462         fi
13463 fi
13464
13465 if test $ol_enable_proctitle != no ; then
13466         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
13467 echo "configure:13468: checking for setproctitle" >&5
13468 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
13469   echo $ac_n "(cached) $ac_c" 1>&6
13470 else
13471   cat > conftest.$ac_ext <<EOF
13472 #line 13473 "configure"
13473 #include "confdefs.h"
13474 /* System header to define __stub macros and hopefully few prototypes,
13475     which can conflict with char setproctitle(); below.  */
13476 #include <assert.h>
13477 /* Override any gcc2 internal prototype to avoid an error.  */
13478 /* We use char because int might match the return type of a gcc2
13479     builtin and then its argument prototype would still apply.  */
13480 char setproctitle();
13481 char (*f)();
13482
13483 int main() {
13484
13485 /* The GNU C library defines this for functions which it implements
13486     to always fail with ENOSYS.  Some functions are actually named
13487     something starting with __ and the normal name is an alias.  */
13488 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
13489 choke me
13490 #else
13491 f = setproctitle;
13492 #endif
13493
13494 ; return 0; }
13495 EOF
13496 if { (eval echo configure:13497: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13497   rm -rf conftest*
13498   eval "ac_cv_func_setproctitle=yes"
13499 else
13500   echo "configure: failed program was:" >&5
13501   cat conftest.$ac_ext >&5
13502   rm -rf conftest*
13503   eval "ac_cv_func_setproctitle=no"
13504 fi
13505 rm -f conftest*
13506 fi
13507
13508 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
13509   echo "$ac_t""yes" 1>&6
13510   have_setproctitle=yes
13511 else
13512   echo "$ac_t""no" 1>&6
13513
13514                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
13515 echo "configure:13516: checking for setproctitle in -lutil" >&5
13516 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
13517 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13518   echo $ac_n "(cached) $ac_c" 1>&6
13519 else
13520   ac_save_LIBS="$LIBS"
13521 LIBS="-lutil  $LIBS"
13522 cat > conftest.$ac_ext <<EOF
13523 #line 13524 "configure"
13524 #include "confdefs.h"
13525 /* Override any gcc2 internal prototype to avoid an error.  */
13526 /* We use char because int might match the return type of a gcc2
13527     builtin and then its argument prototype would still apply.  */
13528 char setproctitle();
13529
13530 int main() {
13531 setproctitle()
13532 ; return 0; }
13533 EOF
13534 if { (eval echo configure:13535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13535   rm -rf conftest*
13536   eval "ac_cv_lib_$ac_lib_var=yes"
13537 else
13538   echo "configure: failed program was:" >&5
13539   cat conftest.$ac_ext >&5
13540   rm -rf conftest*
13541   eval "ac_cv_lib_$ac_lib_var=no"
13542 fi
13543 rm -f conftest*
13544 LIBS="$ac_save_LIBS"
13545
13546 fi
13547 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13548   echo "$ac_t""yes" 1>&6
13549   have_setproctitle=yes
13550                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
13551 else
13552   echo "$ac_t""no" 1>&6
13553 have_setproctitle=no
13554                         LIBOBJS="$LIBOBJS setproctitle.o"
13555                         LIBSRCS="$LIBSRCS setproctitle.c"
13556 fi
13557
13558 fi
13559
13560
13561         if test $have_setproctitle = yes ; then
13562                 cat >> confdefs.h <<\EOF
13563 #define HAVE_SETPROCTITLE 1
13564 EOF
13565
13566         fi
13567 fi
13568
13569 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
13570 echo "configure:13571: checking for ANSI C header files" >&5
13571 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
13572   echo $ac_n "(cached) $ac_c" 1>&6
13573 else
13574   cat > conftest.$ac_ext <<EOF
13575 #line 13576 "configure"
13576 #include "confdefs.h"
13577 #include <stdlib.h>
13578 #include <stdarg.h>
13579 #include <string.h>
13580 #include <float.h>
13581 EOF
13582 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13583 { (eval echo configure:13584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13584 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13585 if test -z "$ac_err"; then
13586   rm -rf conftest*
13587   ac_cv_header_stdc=yes
13588 else
13589   echo "$ac_err" >&5
13590   echo "configure: failed program was:" >&5
13591   cat conftest.$ac_ext >&5
13592   rm -rf conftest*
13593   ac_cv_header_stdc=no
13594 fi
13595 rm -f conftest*
13596
13597 if test $ac_cv_header_stdc = yes; then
13598   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13599 cat > conftest.$ac_ext <<EOF
13600 #line 13601 "configure"
13601 #include "confdefs.h"
13602 #include <string.h>
13603 EOF
13604 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13605   egrep "memchr" >/dev/null 2>&1; then
13606   :
13607 else
13608   rm -rf conftest*
13609   ac_cv_header_stdc=no
13610 fi
13611 rm -f conftest*
13612
13613 fi
13614
13615 if test $ac_cv_header_stdc = yes; then
13616   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13617 cat > conftest.$ac_ext <<EOF
13618 #line 13619 "configure"
13619 #include "confdefs.h"
13620 #include <stdlib.h>
13621 EOF
13622 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13623   egrep "free" >/dev/null 2>&1; then
13624   :
13625 else
13626   rm -rf conftest*
13627   ac_cv_header_stdc=no
13628 fi
13629 rm -f conftest*
13630
13631 fi
13632
13633 if test $ac_cv_header_stdc = yes; then
13634   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13635 if test "$cross_compiling" = yes; then
13636   :
13637 else
13638   cat > conftest.$ac_ext <<EOF
13639 #line 13640 "configure"
13640 #include "confdefs.h"
13641 #include <ctype.h>
13642 #if ((' ' & 0x0FF) == 0x020)
13643 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13644 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13645 #else
13646 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13647  || ('j' <= (c) && (c) <= 'r') \
13648  || ('s' <= (c) && (c) <= 'z'))
13649 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13650 #endif
13651 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13652 int main () { int i; for (i = 0; i < 256; i++)
13653 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
13654 exit (0); }
13655
13656 EOF
13657 if { (eval echo configure:13658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13658 then
13659   :
13660 else
13661   echo "configure: failed program was:" >&5
13662   cat conftest.$ac_ext >&5
13663   rm -fr conftest*
13664   ac_cv_header_stdc=no
13665 fi
13666 rm -fr conftest*
13667 fi
13668
13669 fi
13670 fi
13671
13672 echo "$ac_t""$ac_cv_header_stdc" 1>&6
13673 if test $ac_cv_header_stdc = yes; then
13674   cat >> confdefs.h <<\EOF
13675 #define STDC_HEADERS 1
13676 EOF
13677
13678 fi
13679
13680 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
13681 echo "configure:13682: checking for mode_t" >&5
13682 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
13683   echo $ac_n "(cached) $ac_c" 1>&6
13684 else
13685   cat > conftest.$ac_ext <<EOF
13686 #line 13687 "configure"
13687 #include "confdefs.h"
13688 #include <sys/types.h>
13689 #if STDC_HEADERS
13690 #include <stdlib.h>
13691 #include <stddef.h>
13692 #endif
13693
13694 EOF
13695 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13696   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13697   rm -rf conftest*
13698   eval "ac_cv_type_mode_t=yes"
13699 else
13700   rm -rf conftest*
13701   eval "ac_cv_type_mode_t=no"
13702 fi
13703 rm -f conftest*
13704
13705 fi
13706 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
13707   echo "$ac_t""yes" 1>&6
13708 else
13709   echo "$ac_t""no" 1>&6
13710   cat >> confdefs.h <<EOF
13711 #define mode_t int
13712 EOF
13713
13714 fi
13715
13716 echo $ac_n "checking for off_t""... $ac_c" 1>&6
13717 echo "configure:13718: checking for off_t" >&5
13718 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
13719   echo $ac_n "(cached) $ac_c" 1>&6
13720 else
13721   cat > conftest.$ac_ext <<EOF
13722 #line 13723 "configure"
13723 #include "confdefs.h"
13724 #include <sys/types.h>
13725 #if STDC_HEADERS
13726 #include <stdlib.h>
13727 #include <stddef.h>
13728 #endif
13729
13730 EOF
13731 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13732   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13733   rm -rf conftest*
13734   eval "ac_cv_type_off_t=yes"
13735 else
13736   rm -rf conftest*
13737   eval "ac_cv_type_off_t=no"
13738 fi
13739 rm -f conftest*
13740
13741 fi
13742 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
13743   echo "$ac_t""yes" 1>&6
13744 else
13745   echo "$ac_t""no" 1>&6
13746   cat >> confdefs.h <<EOF
13747 #define off_t long
13748 EOF
13749
13750 fi
13751
13752 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
13753 echo "configure:13754: checking for pid_t" >&5
13754 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
13755   echo $ac_n "(cached) $ac_c" 1>&6
13756 else
13757   cat > conftest.$ac_ext <<EOF
13758 #line 13759 "configure"
13759 #include "confdefs.h"
13760 #include <sys/types.h>
13761 #if STDC_HEADERS
13762 #include <stdlib.h>
13763 #include <stddef.h>
13764 #endif
13765
13766 EOF
13767 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13768   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13769   rm -rf conftest*
13770   eval "ac_cv_type_pid_t=yes"
13771 else
13772   rm -rf conftest*
13773   eval "ac_cv_type_pid_t=no"
13774 fi
13775 rm -f conftest*
13776
13777 fi
13778 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
13779   echo "$ac_t""yes" 1>&6
13780 else
13781   echo "$ac_t""no" 1>&6
13782   cat >> confdefs.h <<EOF
13783 #define pid_t int
13784 EOF
13785
13786 fi
13787
13788 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
13789 echo "configure:13790: checking for ptrdiff_t" >&5
13790 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
13791   echo $ac_n "(cached) $ac_c" 1>&6
13792 else
13793   cat > conftest.$ac_ext <<EOF
13794 #line 13795 "configure"
13795 #include "confdefs.h"
13796 #include <stddef.h>
13797 int main() {
13798 ptrdiff_t p
13799 ; return 0; }
13800 EOF
13801 if { (eval echo configure:13802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13802   rm -rf conftest*
13803   am_cv_type_ptrdiff_t=yes
13804 else
13805   echo "configure: failed program was:" >&5
13806   cat conftest.$ac_ext >&5
13807   rm -rf conftest*
13808   am_cv_type_ptrdiff_t=no
13809 fi
13810 rm -f conftest*
13811 fi
13812
13813 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
13814    if test $am_cv_type_ptrdiff_t = yes; then
13815      cat >> confdefs.h <<\EOF
13816 #define HAVE_PTRDIFF_T 1
13817 EOF
13818
13819    fi
13820
13821 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
13822 echo "configure:13823: checking return type of signal handlers" >&5
13823 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
13824   echo $ac_n "(cached) $ac_c" 1>&6
13825 else
13826   cat > conftest.$ac_ext <<EOF
13827 #line 13828 "configure"
13828 #include "confdefs.h"
13829 #include <sys/types.h>
13830 #include <signal.h>
13831 #ifdef signal
13832 #undef signal
13833 #endif
13834 #ifdef __cplusplus
13835 extern "C" void (*signal (int, void (*)(int)))(int);
13836 #else
13837 void (*signal ()) ();
13838 #endif
13839
13840 int main() {
13841 int i;
13842 ; return 0; }
13843 EOF
13844 if { (eval echo configure:13845: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13845   rm -rf conftest*
13846   ac_cv_type_signal=void
13847 else
13848   echo "configure: failed program was:" >&5
13849   cat conftest.$ac_ext >&5
13850   rm -rf conftest*
13851   ac_cv_type_signal=int
13852 fi
13853 rm -f conftest*
13854 fi
13855
13856 echo "$ac_t""$ac_cv_type_signal" 1>&6
13857 cat >> confdefs.h <<EOF
13858 #define RETSIGTYPE $ac_cv_type_signal
13859 EOF
13860
13861
13862 echo $ac_n "checking for size_t""... $ac_c" 1>&6
13863 echo "configure:13864: checking for size_t" >&5
13864 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
13865   echo $ac_n "(cached) $ac_c" 1>&6
13866 else
13867   cat > conftest.$ac_ext <<EOF
13868 #line 13869 "configure"
13869 #include "confdefs.h"
13870 #include <sys/types.h>
13871 #if STDC_HEADERS
13872 #include <stdlib.h>
13873 #include <stddef.h>
13874 #endif
13875
13876 EOF
13877 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13878   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13879   rm -rf conftest*
13880   eval "ac_cv_type_size_t=yes"
13881 else
13882   rm -rf conftest*
13883   eval "ac_cv_type_size_t=no"
13884 fi
13885 rm -f conftest*
13886
13887 fi
13888 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
13889   echo "$ac_t""yes" 1>&6
13890 else
13891   echo "$ac_t""no" 1>&6
13892   cat >> confdefs.h <<EOF
13893 #define size_t unsigned
13894 EOF
13895
13896 fi
13897
13898
13899 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
13900 echo "configure:13901: checking for ssize_t" >&5
13901 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
13902   echo $ac_n "(cached) $ac_c" 1>&6
13903 else
13904   cat > conftest.$ac_ext <<EOF
13905 #line 13906 "configure"
13906 #include "confdefs.h"
13907 #include <sys/types.h>
13908 #if STDC_HEADERS
13909 #include <stdlib.h>
13910 #include <stddef.h>
13911 #endif
13912
13913 EOF
13914 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13915   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13916   rm -rf conftest*
13917   eval "ac_cv_type_ssize_t=yes"
13918 else
13919   rm -rf conftest*
13920   eval "ac_cv_type_ssize_t=no"
13921 fi
13922 rm -f conftest*
13923
13924 fi
13925 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
13926   echo "$ac_t""yes" 1>&6
13927 else
13928   echo "$ac_t""no" 1>&6
13929   cat >> confdefs.h <<EOF
13930 #define ssize_t signed int
13931 EOF
13932
13933 fi
13934
13935 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
13936 echo "configure:13937: checking for caddr_t" >&5
13937 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
13938   echo $ac_n "(cached) $ac_c" 1>&6
13939 else
13940   cat > conftest.$ac_ext <<EOF
13941 #line 13942 "configure"
13942 #include "confdefs.h"
13943 #include <sys/types.h>
13944 #if STDC_HEADERS
13945 #include <stdlib.h>
13946 #include <stddef.h>
13947 #endif
13948
13949 EOF
13950 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13951   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13952   rm -rf conftest*
13953   eval "ac_cv_type_caddr_t=yes"
13954 else
13955   rm -rf conftest*
13956   eval "ac_cv_type_caddr_t=no"
13957 fi
13958 rm -f conftest*
13959
13960 fi
13961 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
13962   echo "$ac_t""yes" 1>&6
13963 else
13964   echo "$ac_t""no" 1>&6
13965   cat >> confdefs.h <<EOF
13966 #define caddr_t char *
13967 EOF
13968
13969 fi
13970
13971
13972 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
13973 echo "configure:13974: checking for socklen_t" >&5
13974 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
13975   echo $ac_n "(cached) $ac_c" 1>&6
13976 else
13977   cat > conftest.$ac_ext <<EOF
13978 #line 13979 "configure"
13979 #include "confdefs.h"
13980
13981 #ifdef HAVE_SYS_TYPES_H
13982 #include <sys/types.h>
13983 #endif
13984 #ifdef HAVE_SYS_SOCKET_H
13985 #include <sys/socket.h>
13986 #endif
13987
13988 int main() {
13989 socklen_t len;
13990 ; return 0; }
13991 EOF
13992 if { (eval echo configure:13993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13993   rm -rf conftest*
13994   ol_cv_type_socklen_t=yes
13995 else
13996   echo "configure: failed program was:" >&5
13997   cat conftest.$ac_ext >&5
13998   rm -rf conftest*
13999   ol_cv_type_socklen_t=no
14000 fi
14001 rm -f conftest*
14002 fi
14003
14004 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
14005   if test $ol_cv_type_socklen_t = no; then
14006     cat >> confdefs.h <<\EOF
14007 #define socklen_t int
14008 EOF
14009
14010   fi
14011  
14012 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
14013 echo "configure:14014: checking for member st_blksize in aggregate type struct stat" >&5
14014 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
14015   echo $ac_n "(cached) $ac_c" 1>&6
14016 else
14017   cat > conftest.$ac_ext <<EOF
14018 #line 14019 "configure"
14019 #include "confdefs.h"
14020 #include <sys/types.h>
14021 #include <sys/stat.h>
14022 int main() {
14023 struct stat foo; foo.st_blksize;
14024 ; return 0; }
14025 EOF
14026 if { (eval echo configure:14027: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14027   rm -rf conftest*
14028   ac_cv_c_struct_member_st_blksize=yes
14029 else
14030   echo "configure: failed program was:" >&5
14031   cat conftest.$ac_ext >&5
14032   rm -rf conftest*
14033   ac_cv_c_struct_member_st_blksize=no
14034 fi
14035 rm -f conftest*
14036 fi
14037
14038 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
14039 st_blksize="$ac_cv_c_struct_member_st_blksize"
14040 if test $ac_cv_c_struct_member_st_blksize = yes; then
14041   cat >> confdefs.h <<\EOF
14042 #define HAVE_ST_BLKSIZE 1
14043 EOF
14044
14045 fi
14046
14047 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
14048 echo "configure:14049: checking whether time.h and sys/time.h may both be included" >&5
14049 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
14050   echo $ac_n "(cached) $ac_c" 1>&6
14051 else
14052   cat > conftest.$ac_ext <<EOF
14053 #line 14054 "configure"
14054 #include "confdefs.h"
14055 #include <sys/types.h>
14056 #include <sys/time.h>
14057 #include <time.h>
14058 int main() {
14059 struct tm *tp;
14060 ; return 0; }
14061 EOF
14062 if { (eval echo configure:14063: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14063   rm -rf conftest*
14064   ac_cv_header_time=yes
14065 else
14066   echo "configure: failed program was:" >&5
14067   cat conftest.$ac_ext >&5
14068   rm -rf conftest*
14069   ac_cv_header_time=no
14070 fi
14071 rm -f conftest*
14072 fi
14073
14074 echo "$ac_t""$ac_cv_header_time" 1>&6
14075 if test $ac_cv_header_time = yes; then
14076   cat >> confdefs.h <<\EOF
14077 #define TIME_WITH_SYS_TIME 1
14078 EOF
14079
14080 fi
14081
14082 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
14083 echo "configure:14084: checking whether struct tm is in sys/time.h or time.h" >&5
14084 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
14085   echo $ac_n "(cached) $ac_c" 1>&6
14086 else
14087   cat > conftest.$ac_ext <<EOF
14088 #line 14089 "configure"
14089 #include "confdefs.h"
14090 #include <sys/types.h>
14091 #include <time.h>
14092 int main() {
14093 struct tm *tp; tp->tm_sec;
14094 ; return 0; }
14095 EOF
14096 if { (eval echo configure:14097: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14097   rm -rf conftest*
14098   ac_cv_struct_tm=time.h
14099 else
14100   echo "configure: failed program was:" >&5
14101   cat conftest.$ac_ext >&5
14102   rm -rf conftest*
14103   ac_cv_struct_tm=sys/time.h
14104 fi
14105 rm -f conftest*
14106 fi
14107
14108 echo "$ac_t""$ac_cv_struct_tm" 1>&6
14109 if test $ac_cv_struct_tm = sys/time.h; then
14110   cat >> confdefs.h <<\EOF
14111 #define TM_IN_SYS_TIME 1
14112 EOF
14113
14114 fi
14115
14116 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
14117 echo "configure:14118: checking for uid_t in sys/types.h" >&5
14118 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
14119   echo $ac_n "(cached) $ac_c" 1>&6
14120 else
14121   cat > conftest.$ac_ext <<EOF
14122 #line 14123 "configure"
14123 #include "confdefs.h"
14124 #include <sys/types.h>
14125 EOF
14126 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14127   egrep "uid_t" >/dev/null 2>&1; then
14128   rm -rf conftest*
14129   ac_cv_type_uid_t=yes
14130 else
14131   rm -rf conftest*
14132   ac_cv_type_uid_t=no
14133 fi
14134 rm -f conftest*
14135
14136 fi
14137
14138 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
14139 if test $ac_cv_type_uid_t = no; then
14140   cat >> confdefs.h <<\EOF
14141 #define uid_t int
14142 EOF
14143
14144   cat >> confdefs.h <<\EOF
14145 #define gid_t int
14146 EOF
14147
14148 fi
14149
14150 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
14151 echo "configure:14152: checking for sig_atomic_t" >&5
14152 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
14153   echo $ac_n "(cached) $ac_c" 1>&6
14154 else
14155   cat > conftest.$ac_ext <<EOF
14156 #line 14157 "configure"
14157 #include "confdefs.h"
14158 #include <signal.h>
14159 int main() {
14160 sig_atomic_t atomic;
14161 ; return 0; }
14162 EOF
14163 if { (eval echo configure:14164: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14164   rm -rf conftest*
14165   ol_cv_type_sig_atomic_t=yes
14166 else
14167   echo "configure: failed program was:" >&5
14168   cat conftest.$ac_ext >&5
14169   rm -rf conftest*
14170   ol_cv_type_sig_atomic_t=no
14171 fi
14172 rm -f conftest*
14173 fi
14174
14175 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
14176   if test $ol_cv_type_sig_atomic_t = no; then
14177     cat >> confdefs.h <<\EOF
14178 #define sig_atomic_t int
14179 EOF
14180
14181   fi
14182  
14183
14184
14185 # test for pw_gecos in struct passwd
14186 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
14187 echo "configure:14188: checking struct passwd for pw_gecos" >&5
14188 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
14189   echo $ac_n "(cached) $ac_c" 1>&6
14190 else
14191   
14192         cat > conftest.$ac_ext <<EOF
14193 #line 14194 "configure"
14194 #include "confdefs.h"
14195 #include <pwd.h>
14196 int main() {
14197
14198         struct passwd pwd;
14199         pwd.pw_gecos = pwd.pw_name;
14200
14201 ; return 0; }
14202 EOF
14203 if { (eval echo configure:14204: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14204   rm -rf conftest*
14205   ol_cv_struct_passwd_pw_gecos=yes
14206 else
14207   echo "configure: failed program was:" >&5
14208   cat conftest.$ac_ext >&5
14209   rm -rf conftest*
14210   ol_cv_struct_passwd_pw_gecos=no
14211 fi
14212 rm -f conftest*
14213 fi
14214
14215 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
14216 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
14217         cat >> confdefs.h <<\EOF
14218 #define HAVE_PW_GECOS 1
14219 EOF
14220
14221 fi
14222
14223 # test for pw_passwd in struct passwd
14224 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
14225 echo "configure:14226: checking struct passwd for pw_passwd" >&5
14226 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
14227   echo $ac_n "(cached) $ac_c" 1>&6
14228 else
14229   
14230         cat > conftest.$ac_ext <<EOF
14231 #line 14232 "configure"
14232 #include "confdefs.h"
14233 #include <pwd.h>
14234 int main() {
14235
14236         struct passwd pwd;
14237         pwd.pw_passwd = pwd.pw_name;
14238
14239 ; return 0; }
14240 EOF
14241 if { (eval echo configure:14242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14242   rm -rf conftest*
14243   ol_cv_struct_passwd_pw_passwd=yes
14244 else
14245   echo "configure: failed program was:" >&5
14246   cat conftest.$ac_ext >&5
14247   rm -rf conftest*
14248   ol_cv_struct_passwd_pw_passwd=no
14249 fi
14250 rm -f conftest*
14251 fi
14252
14253 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
14254 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
14255         cat >> confdefs.h <<\EOF
14256 #define HAVE_PW_PASSWD 1
14257 EOF
14258
14259 fi
14260
14261
14262 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
14263 echo "configure:14264: checking if toupper() requires islower()" >&5
14264 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
14265   echo $ac_n "(cached) $ac_c" 1>&6
14266 else
14267   
14268         if test "$cross_compiling" = yes; then
14269   ol_cv_c_upper_lower=safe
14270 else
14271   cat > conftest.$ac_ext <<EOF
14272 #line 14273 "configure"
14273 #include "confdefs.h"
14274
14275 #include <ctype.h>
14276 main()
14277 {
14278         if ('C' == toupper('C'))
14279                 exit(0);
14280         else
14281                 exit(1);
14282 }
14283 EOF
14284 if { (eval echo configure:14285: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14285 then
14286   ol_cv_c_upper_lower=no
14287 else
14288   echo "configure: failed program was:" >&5
14289   cat conftest.$ac_ext >&5
14290   rm -fr conftest*
14291   ol_cv_c_upper_lower=yes
14292 fi
14293 rm -fr conftest*
14294 fi
14295
14296 fi
14297
14298 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
14299 if test $ol_cv_c_upper_lower != no ; then
14300         cat >> confdefs.h <<\EOF
14301 #define C_UPPER_LOWER 1
14302 EOF
14303
14304 fi
14305
14306 echo $ac_n "checking for working const""... $ac_c" 1>&6
14307 echo "configure:14308: checking for working const" >&5
14308 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
14309   echo $ac_n "(cached) $ac_c" 1>&6
14310 else
14311   cat > conftest.$ac_ext <<EOF
14312 #line 14313 "configure"
14313 #include "confdefs.h"
14314
14315 int main() {
14316
14317 /* Ultrix mips cc rejects this.  */
14318 typedef int charset[2]; const charset x;
14319 /* SunOS 4.1.1 cc rejects this.  */
14320 char const *const *ccp;
14321 char **p;
14322 /* NEC SVR4.0.2 mips cc rejects this.  */
14323 struct point {int x, y;};
14324 static struct point const zero = {0,0};
14325 /* AIX XL C 1.02.0.0 rejects this.
14326    It does not let you subtract one const X* pointer from another in an arm
14327    of an if-expression whose if-part is not a constant expression */
14328 const char *g = "string";
14329 ccp = &g + (g ? g-g : 0);
14330 /* HPUX 7.0 cc rejects these. */
14331 ++ccp;
14332 p = (char**) ccp;
14333 ccp = (char const *const *) p;
14334 { /* SCO 3.2v4 cc rejects this.  */
14335   char *t;
14336   char const *s = 0 ? (char *) 0 : (char const *) 0;
14337
14338   *t++ = 0;
14339 }
14340 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14341   int x[] = {25, 17};
14342   const int *foo = &x[0];
14343   ++foo;
14344 }
14345 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14346   typedef const int *iptr;
14347   iptr p = 0;
14348   ++p;
14349 }
14350 { /* AIX XL C 1.02.0.0 rejects this saying
14351      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14352   struct s { int j; const int *ap[3]; };
14353   struct s *b; b->j = 5;
14354 }
14355 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14356   const int foo = 10;
14357 }
14358
14359 ; return 0; }
14360 EOF
14361 if { (eval echo configure:14362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14362   rm -rf conftest*
14363   ac_cv_c_const=yes
14364 else
14365   echo "configure: failed program was:" >&5
14366   cat conftest.$ac_ext >&5
14367   rm -rf conftest*
14368   ac_cv_c_const=no
14369 fi
14370 rm -f conftest*
14371 fi
14372
14373 echo "$ac_t""$ac_cv_c_const" 1>&6
14374 if test $ac_cv_c_const = no; then
14375   cat >> confdefs.h <<\EOF
14376 #define const 
14377 EOF
14378
14379 fi
14380
14381 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
14382 echo "configure:14383: checking if compiler understands volatile" >&5
14383 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
14384   echo $ac_n "(cached) $ac_c" 1>&6
14385 else
14386   cat > conftest.$ac_ext <<EOF
14387 #line 14388 "configure"
14388 #include "confdefs.h"
14389 int x, y, z;
14390 int main() {
14391 volatile int a; int * volatile b = x ? &y : &z;
14392       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
14393       *b = 0;
14394 ; return 0; }
14395 EOF
14396 if { (eval echo configure:14397: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14397   rm -rf conftest*
14398   ol_cv_c_volatile=yes
14399 else
14400   echo "configure: failed program was:" >&5
14401   cat conftest.$ac_ext >&5
14402   rm -rf conftest*
14403   ol_cv_c_volatile=no
14404 fi
14405 rm -f conftest*
14406 fi
14407
14408 echo "$ac_t""$ol_cv_c_volatile" 1>&6
14409   if test $ol_cv_c_volatile = yes; then
14410     : 
14411   else
14412     cat >> confdefs.h <<\EOF
14413 #define volatile 
14414 EOF
14415
14416   fi
14417  
14418
14419 if test $cross_compiling = yes ; then
14420         cat >> confdefs.h <<\EOF
14421 #define CROSS_COMPILING 1
14422 EOF
14423
14424 else
14425         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
14426 echo "configure:14427: checking whether byte ordering is bigendian" >&5
14427 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
14428   echo $ac_n "(cached) $ac_c" 1>&6
14429 else
14430   ac_cv_c_bigendian=unknown
14431 # See if sys/param.h defines the BYTE_ORDER macro.
14432 cat > conftest.$ac_ext <<EOF
14433 #line 14434 "configure"
14434 #include "confdefs.h"
14435 #include <sys/types.h>
14436 #include <sys/param.h>
14437 int main() {
14438
14439 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
14440  bogus endian macros
14441 #endif
14442 ; return 0; }
14443 EOF
14444 if { (eval echo configure:14445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14445   rm -rf conftest*
14446   # It does; now see whether it defined to BIG_ENDIAN or not.
14447 cat > conftest.$ac_ext <<EOF
14448 #line 14449 "configure"
14449 #include "confdefs.h"
14450 #include <sys/types.h>
14451 #include <sys/param.h>
14452 int main() {
14453
14454 #if BYTE_ORDER != BIG_ENDIAN
14455  not big endian
14456 #endif
14457 ; return 0; }
14458 EOF
14459 if { (eval echo configure:14460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14460   rm -rf conftest*
14461   ac_cv_c_bigendian=yes
14462 else
14463   echo "configure: failed program was:" >&5
14464   cat conftest.$ac_ext >&5
14465   rm -rf conftest*
14466   ac_cv_c_bigendian=no
14467 fi
14468 rm -f conftest*
14469 else
14470   echo "configure: failed program was:" >&5
14471   cat conftest.$ac_ext >&5
14472 fi
14473 rm -f conftest*
14474 if test $ac_cv_c_bigendian = unknown; then
14475 if test "$cross_compiling" = yes; then
14476     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
14477 else
14478   cat > conftest.$ac_ext <<EOF
14479 #line 14480 "configure"
14480 #include "confdefs.h"
14481 main () {
14482   /* Are we little or big endian?  From Harbison&Steele.  */
14483   union
14484   {
14485     long l;
14486     char c[sizeof (long)];
14487   } u;
14488   u.l = 1;
14489   exit (u.c[sizeof (long) - 1] == 1);
14490 }
14491 EOF
14492 if { (eval echo configure:14493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14493 then
14494   ac_cv_c_bigendian=no
14495 else
14496   echo "configure: failed program was:" >&5
14497   cat conftest.$ac_ext >&5
14498   rm -fr conftest*
14499   ac_cv_c_bigendian=yes
14500 fi
14501 rm -fr conftest*
14502 fi
14503
14504 fi
14505 fi
14506
14507 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
14508 if test $ac_cv_c_bigendian = yes; then
14509   cat >> confdefs.h <<\EOF
14510 #define WORDS_BIGENDIAN 1
14511 EOF
14512
14513 fi
14514
14515 fi
14516
14517 echo $ac_n "checking size of short""... $ac_c" 1>&6
14518 echo "configure:14519: checking size of short" >&5 
14519 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
14520   echo $ac_n "(cached) $ac_c" 1>&6
14521 else
14522   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14523   cat > conftest.$ac_ext <<EOF
14524 #line 14525 "configure"
14525 #include "confdefs.h"
14526 #include "confdefs.h" 
14527 #include <sys/types.h> 
14528  
14529
14530 int main() {
14531 switch (0) case 0: case (sizeof (short) == $ac_size):;
14532 ; return 0; }
14533 EOF
14534 if { (eval echo configure:14535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14535   rm -rf conftest*
14536   ac_cv_sizeof_short=$ac_size
14537 else
14538   echo "configure: failed program was:" >&5
14539   cat conftest.$ac_ext >&5
14540 fi
14541 rm -f conftest* 
14542   if test x$ac_cv_sizeof_short != x ; then break; fi 
14543 done 
14544
14545 fi
14546  
14547 if test x$ac_cv_sizeof_short = x ; then 
14548   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
14549 fi 
14550 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
14551 cat >> confdefs.h <<EOF
14552 #define SIZEOF_SHORT $ac_cv_sizeof_short
14553 EOF
14554  
14555  
14556 echo $ac_n "checking size of int""... $ac_c" 1>&6
14557 echo "configure:14558: checking size of int" >&5 
14558 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
14559   echo $ac_n "(cached) $ac_c" 1>&6
14560 else
14561   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14562   cat > conftest.$ac_ext <<EOF
14563 #line 14564 "configure"
14564 #include "confdefs.h"
14565 #include "confdefs.h" 
14566 #include <sys/types.h> 
14567  
14568
14569 int main() {
14570 switch (0) case 0: case (sizeof (int) == $ac_size):;
14571 ; return 0; }
14572 EOF
14573 if { (eval echo configure:14574: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14574   rm -rf conftest*
14575   ac_cv_sizeof_int=$ac_size
14576 else
14577   echo "configure: failed program was:" >&5
14578   cat conftest.$ac_ext >&5
14579 fi
14580 rm -f conftest* 
14581   if test x$ac_cv_sizeof_int != x ; then break; fi 
14582 done 
14583
14584 fi
14585  
14586 if test x$ac_cv_sizeof_int = x ; then 
14587   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
14588 fi 
14589 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
14590 cat >> confdefs.h <<EOF
14591 #define SIZEOF_INT $ac_cv_sizeof_int
14592 EOF
14593  
14594  
14595 echo $ac_n "checking size of long""... $ac_c" 1>&6
14596 echo "configure:14597: checking size of long" >&5 
14597 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
14598   echo $ac_n "(cached) $ac_c" 1>&6
14599 else
14600   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14601   cat > conftest.$ac_ext <<EOF
14602 #line 14603 "configure"
14603 #include "confdefs.h"
14604 #include "confdefs.h" 
14605 #include <sys/types.h> 
14606  
14607
14608 int main() {
14609 switch (0) case 0: case (sizeof (long) == $ac_size):;
14610 ; return 0; }
14611 EOF
14612 if { (eval echo configure:14613: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14613   rm -rf conftest*
14614   ac_cv_sizeof_long=$ac_size
14615 else
14616   echo "configure: failed program was:" >&5
14617   cat conftest.$ac_ext >&5
14618 fi
14619 rm -f conftest* 
14620   if test x$ac_cv_sizeof_long != x ; then break; fi 
14621 done 
14622
14623 fi
14624  
14625 if test x$ac_cv_sizeof_long = x ; then 
14626   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
14627 fi 
14628 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
14629 cat >> confdefs.h <<EOF
14630 #define SIZEOF_LONG $ac_cv_sizeof_long
14631 EOF
14632  
14633
14634
14635 if test "$ac_cv_sizeof_int" -lt 4 ; then
14636         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
14637
14638         cat >> confdefs.h <<\EOF
14639 #define LBER_INT_T long
14640 EOF
14641
14642 else
14643         cat >> confdefs.h <<\EOF
14644 #define LBER_INT_T int
14645 EOF
14646
14647 fi
14648
14649 cat >> confdefs.h <<\EOF
14650 #define LBER_LEN_T long
14651 EOF
14652
14653 cat >> confdefs.h <<\EOF
14654 #define LBER_SOCKET_T int
14655 EOF
14656
14657 cat >> confdefs.h <<\EOF
14658 #define LBER_TAG_T long
14659 EOF
14660
14661
14662 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
14663 echo "configure:14664: checking for 8-bit clean memcmp" >&5
14664 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
14665   echo $ac_n "(cached) $ac_c" 1>&6
14666 else
14667   if test "$cross_compiling" = yes; then
14668   ac_cv_func_memcmp_clean=no
14669 else
14670   cat > conftest.$ac_ext <<EOF
14671 #line 14672 "configure"
14672 #include "confdefs.h"
14673
14674 main()
14675 {
14676   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
14677   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
14678 }
14679
14680 EOF
14681 if { (eval echo configure:14682: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14682 then
14683   ac_cv_func_memcmp_clean=yes
14684 else
14685   echo "configure: failed program was:" >&5
14686   cat conftest.$ac_ext >&5
14687   rm -fr conftest*
14688   ac_cv_func_memcmp_clean=no
14689 fi
14690 rm -fr conftest*
14691 fi
14692
14693 fi
14694
14695 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
14696 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
14697
14698 echo $ac_n "checking for strftime""... $ac_c" 1>&6
14699 echo "configure:14700: checking for strftime" >&5
14700 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
14701   echo $ac_n "(cached) $ac_c" 1>&6
14702 else
14703   cat > conftest.$ac_ext <<EOF
14704 #line 14705 "configure"
14705 #include "confdefs.h"
14706 /* System header to define __stub macros and hopefully few prototypes,
14707     which can conflict with char strftime(); below.  */
14708 #include <assert.h>
14709 /* Override any gcc2 internal prototype to avoid an error.  */
14710 /* We use char because int might match the return type of a gcc2
14711     builtin and then its argument prototype would still apply.  */
14712 char strftime();
14713 char (*f)();
14714
14715 int main() {
14716
14717 /* The GNU C library defines this for functions which it implements
14718     to always fail with ENOSYS.  Some functions are actually named
14719     something starting with __ and the normal name is an alias.  */
14720 #if defined (__stub_strftime) || defined (__stub___strftime)
14721 choke me
14722 #else
14723 f = strftime;
14724 #endif
14725
14726 ; return 0; }
14727 EOF
14728 if { (eval echo configure:14729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14729   rm -rf conftest*
14730   eval "ac_cv_func_strftime=yes"
14731 else
14732   echo "configure: failed program was:" >&5
14733   cat conftest.$ac_ext >&5
14734   rm -rf conftest*
14735   eval "ac_cv_func_strftime=no"
14736 fi
14737 rm -f conftest*
14738 fi
14739
14740 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
14741   echo "$ac_t""yes" 1>&6
14742   cat >> confdefs.h <<\EOF
14743 #define HAVE_STRFTIME 1
14744 EOF
14745
14746 else
14747   echo "$ac_t""no" 1>&6
14748 # strftime is in -lintl on SCO UNIX.
14749 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
14750 echo "configure:14751: checking for strftime in -lintl" >&5
14751 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
14752 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14753   echo $ac_n "(cached) $ac_c" 1>&6
14754 else
14755   ac_save_LIBS="$LIBS"
14756 LIBS="-lintl  $LIBS"
14757 cat > conftest.$ac_ext <<EOF
14758 #line 14759 "configure"
14759 #include "confdefs.h"
14760 /* Override any gcc2 internal prototype to avoid an error.  */
14761 /* We use char because int might match the return type of a gcc2
14762     builtin and then its argument prototype would still apply.  */
14763 char strftime();
14764
14765 int main() {
14766 strftime()
14767 ; return 0; }
14768 EOF
14769 if { (eval echo configure:14770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14770   rm -rf conftest*
14771   eval "ac_cv_lib_$ac_lib_var=yes"
14772 else
14773   echo "configure: failed program was:" >&5
14774   cat conftest.$ac_ext >&5
14775   rm -rf conftest*
14776   eval "ac_cv_lib_$ac_lib_var=no"
14777 fi
14778 rm -f conftest*
14779 LIBS="$ac_save_LIBS"
14780
14781 fi
14782 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14783   echo "$ac_t""yes" 1>&6
14784   cat >> confdefs.h <<\EOF
14785 #define HAVE_STRFTIME 1
14786 EOF
14787
14788 LIBS="-lintl $LIBS"
14789 else
14790   echo "$ac_t""no" 1>&6
14791 fi
14792
14793 fi
14794
14795
14796 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
14797 echo "configure:14798: checking for inet_aton()" >&5
14798 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
14799   echo $ac_n "(cached) $ac_c" 1>&6
14800 else
14801   cat > conftest.$ac_ext <<EOF
14802 #line 14803 "configure"
14803 #include "confdefs.h"
14804
14805 #ifdef HAVE_SYS_TYPES_H
14806 #       include <sys/types.h>
14807 #endif
14808 #ifdef HAVE_SYS_SOCKET_H
14809 #       include <sys/socket.h>
14810 #       ifdef HAVE_SYS_SELECT_H
14811 #               include <sys/select.h>
14812 #       endif
14813 #       include <netinet/in.h>
14814 #       ifdef HAVE_ARPA_INET_H
14815 #               include <arpa/inet.h>
14816 #       endif
14817 #endif
14818
14819 int main() {
14820 struct in_addr in;
14821 int rc = inet_aton( "255.255.255.255", &in );
14822 ; return 0; }
14823 EOF
14824 if { (eval echo configure:14825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14825   rm -rf conftest*
14826   ol_cv_func_inet_aton=yes
14827 else
14828   echo "configure: failed program was:" >&5
14829   cat conftest.$ac_ext >&5
14830   rm -rf conftest*
14831   ol_cv_func_inet_aton=no
14832 fi
14833 rm -f conftest*
14834 fi
14835
14836 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
14837   if test $ol_cv_func_inet_aton != no; then
14838     cat >> confdefs.h <<\EOF
14839 #define HAVE_INET_ATON 1
14840 EOF
14841
14842   fi
14843  
14844
14845 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
14846 echo "configure:14847: checking for _spawnlp" >&5
14847 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
14848   echo $ac_n "(cached) $ac_c" 1>&6
14849 else
14850   cat > conftest.$ac_ext <<EOF
14851 #line 14852 "configure"
14852 #include "confdefs.h"
14853 /* System header to define __stub macros and hopefully few prototypes,
14854     which can conflict with char _spawnlp(); below.  */
14855 #include <assert.h>
14856 /* Override any gcc2 internal prototype to avoid an error.  */
14857 /* We use char because int might match the return type of a gcc2
14858     builtin and then its argument prototype would still apply.  */
14859 char _spawnlp();
14860 char (*f)();
14861
14862 int main() {
14863
14864 /* The GNU C library defines this for functions which it implements
14865     to always fail with ENOSYS.  Some functions are actually named
14866     something starting with __ and the normal name is an alias.  */
14867 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
14868 choke me
14869 #else
14870 f = _spawnlp;
14871 #endif
14872
14873 ; return 0; }
14874 EOF
14875 if { (eval echo configure:14876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14876   rm -rf conftest*
14877   eval "ac_cv_func__spawnlp=yes"
14878 else
14879   echo "configure: failed program was:" >&5
14880   cat conftest.$ac_ext >&5
14881   rm -rf conftest*
14882   eval "ac_cv_func__spawnlp=no"
14883 fi
14884 rm -f conftest*
14885 fi
14886
14887 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
14888   echo "$ac_t""yes" 1>&6
14889   cat >> confdefs.h <<\EOF
14890 #define HAVE_SPAWNLP 1
14891 EOF
14892
14893 else
14894   echo "$ac_t""no" 1>&6
14895 fi
14896
14897
14898 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
14899 echo "configure:14900: checking for _snprintf" >&5
14900 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
14901   echo $ac_n "(cached) $ac_c" 1>&6
14902 else
14903   cat > conftest.$ac_ext <<EOF
14904 #line 14905 "configure"
14905 #include "confdefs.h"
14906 /* System header to define __stub macros and hopefully few prototypes,
14907     which can conflict with char _snprintf(); below.  */
14908 #include <assert.h>
14909 /* Override any gcc2 internal prototype to avoid an error.  */
14910 /* We use char because int might match the return type of a gcc2
14911     builtin and then its argument prototype would still apply.  */
14912 char _snprintf();
14913 char (*f)();
14914
14915 int main() {
14916
14917 /* The GNU C library defines this for functions which it implements
14918     to always fail with ENOSYS.  Some functions are actually named
14919     something starting with __ and the normal name is an alias.  */
14920 #if defined (__stub__snprintf) || defined (__stub____snprintf)
14921 choke me
14922 #else
14923 f = _snprintf;
14924 #endif
14925
14926 ; return 0; }
14927 EOF
14928 if { (eval echo configure:14929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14929   rm -rf conftest*
14930   eval "ac_cv_func__snprintf=yes"
14931 else
14932   echo "configure: failed program was:" >&5
14933   cat conftest.$ac_ext >&5
14934   rm -rf conftest*
14935   eval "ac_cv_func__snprintf=no"
14936 fi
14937 rm -f conftest*
14938 fi
14939
14940 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
14941   echo "$ac_t""yes" 1>&6
14942   ac_cv_func_snprintf=yes
14943         cat >> confdefs.h <<\EOF
14944 #define snprintf _snprintf
14945 EOF
14946
14947
14948 else
14949   echo "$ac_t""no" 1>&6
14950 fi
14951
14952
14953 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
14954 echo "configure:14955: checking for _vsnprintf" >&5
14955 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
14956   echo $ac_n "(cached) $ac_c" 1>&6
14957 else
14958   cat > conftest.$ac_ext <<EOF
14959 #line 14960 "configure"
14960 #include "confdefs.h"
14961 /* System header to define __stub macros and hopefully few prototypes,
14962     which can conflict with char _vsnprintf(); below.  */
14963 #include <assert.h>
14964 /* Override any gcc2 internal prototype to avoid an error.  */
14965 /* We use char because int might match the return type of a gcc2
14966     builtin and then its argument prototype would still apply.  */
14967 char _vsnprintf();
14968 char (*f)();
14969
14970 int main() {
14971
14972 /* The GNU C library defines this for functions which it implements
14973     to always fail with ENOSYS.  Some functions are actually named
14974     something starting with __ and the normal name is an alias.  */
14975 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
14976 choke me
14977 #else
14978 f = _vsnprintf;
14979 #endif
14980
14981 ; return 0; }
14982 EOF
14983 if { (eval echo configure:14984: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14984   rm -rf conftest*
14985   eval "ac_cv_func__vsnprintf=yes"
14986 else
14987   echo "configure: failed program was:" >&5
14988   cat conftest.$ac_ext >&5
14989   rm -rf conftest*
14990   eval "ac_cv_func__vsnprintf=no"
14991 fi
14992 rm -f conftest*
14993 fi
14994
14995 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
14996   echo "$ac_t""yes" 1>&6
14997   ac_cv_func_vsnprintf=yes
14998         cat >> confdefs.h <<\EOF
14999 #define vsnprintf _vsnprintf
15000 EOF
15001
15002
15003 else
15004   echo "$ac_t""no" 1>&6
15005 fi
15006
15007
15008 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
15009 echo "configure:15010: checking for vprintf" >&5
15010 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
15011   echo $ac_n "(cached) $ac_c" 1>&6
15012 else
15013   cat > conftest.$ac_ext <<EOF
15014 #line 15015 "configure"
15015 #include "confdefs.h"
15016 /* System header to define __stub macros and hopefully few prototypes,
15017     which can conflict with char vprintf(); below.  */
15018 #include <assert.h>
15019 /* Override any gcc2 internal prototype to avoid an error.  */
15020 /* We use char because int might match the return type of a gcc2
15021     builtin and then its argument prototype would still apply.  */
15022 char vprintf();
15023 char (*f)();
15024
15025 int main() {
15026
15027 /* The GNU C library defines this for functions which it implements
15028     to always fail with ENOSYS.  Some functions are actually named
15029     something starting with __ and the normal name is an alias.  */
15030 #if defined (__stub_vprintf) || defined (__stub___vprintf)
15031 choke me
15032 #else
15033 f = vprintf;
15034 #endif
15035
15036 ; return 0; }
15037 EOF
15038 if { (eval echo configure:15039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15039   rm -rf conftest*
15040   eval "ac_cv_func_vprintf=yes"
15041 else
15042   echo "configure: failed program was:" >&5
15043   cat conftest.$ac_ext >&5
15044   rm -rf conftest*
15045   eval "ac_cv_func_vprintf=no"
15046 fi
15047 rm -f conftest*
15048 fi
15049
15050 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
15051   echo "$ac_t""yes" 1>&6
15052   cat >> confdefs.h <<\EOF
15053 #define HAVE_VPRINTF 1
15054 EOF
15055
15056 else
15057   echo "$ac_t""no" 1>&6
15058 fi
15059
15060 if test "$ac_cv_func_vprintf" != yes; then
15061 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
15062 echo "configure:15063: checking for _doprnt" >&5
15063 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
15064   echo $ac_n "(cached) $ac_c" 1>&6
15065 else
15066   cat > conftest.$ac_ext <<EOF
15067 #line 15068 "configure"
15068 #include "confdefs.h"
15069 /* System header to define __stub macros and hopefully few prototypes,
15070     which can conflict with char _doprnt(); below.  */
15071 #include <assert.h>
15072 /* Override any gcc2 internal prototype to avoid an error.  */
15073 /* We use char because int might match the return type of a gcc2
15074     builtin and then its argument prototype would still apply.  */
15075 char _doprnt();
15076 char (*f)();
15077
15078 int main() {
15079
15080 /* The GNU C library defines this for functions which it implements
15081     to always fail with ENOSYS.  Some functions are actually named
15082     something starting with __ and the normal name is an alias.  */
15083 #if defined (__stub__doprnt) || defined (__stub____doprnt)
15084 choke me
15085 #else
15086 f = _doprnt;
15087 #endif
15088
15089 ; return 0; }
15090 EOF
15091 if { (eval echo configure:15092: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15092   rm -rf conftest*
15093   eval "ac_cv_func__doprnt=yes"
15094 else
15095   echo "configure: failed program was:" >&5
15096   cat conftest.$ac_ext >&5
15097   rm -rf conftest*
15098   eval "ac_cv_func__doprnt=no"
15099 fi
15100 rm -f conftest*
15101 fi
15102
15103 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
15104   echo "$ac_t""yes" 1>&6
15105   cat >> confdefs.h <<\EOF
15106 #define HAVE_DOPRNT 1
15107 EOF
15108
15109 else
15110   echo "$ac_t""no" 1>&6
15111 fi
15112
15113 fi
15114
15115
15116 if test $ac_cv_func_vprintf = yes ; then
15117                 for ac_func in vsnprintf vsprintf
15118 do
15119 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15120 echo "configure:15121: checking for $ac_func" >&5
15121 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15122   echo $ac_n "(cached) $ac_c" 1>&6
15123 else
15124   cat > conftest.$ac_ext <<EOF
15125 #line 15126 "configure"
15126 #include "confdefs.h"
15127 /* System header to define __stub macros and hopefully few prototypes,
15128     which can conflict with char $ac_func(); below.  */
15129 #include <assert.h>
15130 /* Override any gcc2 internal prototype to avoid an error.  */
15131 /* We use char because int might match the return type of a gcc2
15132     builtin and then its argument prototype would still apply.  */
15133 char $ac_func();
15134 char (*f)();
15135
15136 int main() {
15137
15138 /* The GNU C library defines this for functions which it implements
15139     to always fail with ENOSYS.  Some functions are actually named
15140     something starting with __ and the normal name is an alias.  */
15141 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15142 choke me
15143 #else
15144 f = $ac_func;
15145 #endif
15146
15147 ; return 0; }
15148 EOF
15149 if { (eval echo configure:15150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15150   rm -rf conftest*
15151   eval "ac_cv_func_$ac_func=yes"
15152 else
15153   echo "configure: failed program was:" >&5
15154   cat conftest.$ac_ext >&5
15155   rm -rf conftest*
15156   eval "ac_cv_func_$ac_func=no"
15157 fi
15158 rm -f conftest*
15159 fi
15160
15161 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15162   echo "$ac_t""yes" 1>&6
15163     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15164   cat >> confdefs.h <<EOF
15165 #define $ac_tr_func 1
15166 EOF
15167  
15168 else
15169   echo "$ac_t""no" 1>&6
15170 fi
15171 done
15172
15173 fi
15174
15175 for ac_func in \
15176         bcopy                   \
15177         closesocket             \
15178         chroot                  \
15179         endgrent                \
15180         endpwent                \
15181         flock                   \
15182         getdtablesize   \
15183         getgrgid                \
15184         gethostname             \
15185         getpass                 \
15186         getpassphrase   \
15187         getpwuid                \
15188         getpwnam                \
15189         getspnam                \
15190         gettimeofday    \
15191         initgroups              \
15192         lockf                   \
15193         memcpy                  \
15194         memmove                 \
15195         mkstemp                 \
15196         pipe                    \
15197         read                    \
15198         recv                    \
15199         recvfrom                \
15200         setpwfile               \
15201         setgid                  \
15202         setegid                 \
15203         setsid                  \
15204         setuid                  \
15205         seteuid                 \
15206         sigaction               \
15207         signal                  \
15208         sigset                  \
15209         snprintf                \
15210         strdup                  \
15211         strerror                \
15212         strpbrk                 \
15213         strrchr                 \
15214         strsep                  \
15215         strstr                  \
15216         strtol                  \
15217         strtoul                 \
15218         strspn                  \
15219         sysconf                 \
15220         waitpid                 \
15221         wait4                   \
15222         write                   \
15223         send                    \
15224         sendto                  \
15225
15226 do
15227 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15228 echo "configure:15229: checking for $ac_func" >&5
15229 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15230   echo $ac_n "(cached) $ac_c" 1>&6
15231 else
15232   cat > conftest.$ac_ext <<EOF
15233 #line 15234 "configure"
15234 #include "confdefs.h"
15235 /* System header to define __stub macros and hopefully few prototypes,
15236     which can conflict with char $ac_func(); below.  */
15237 #include <assert.h>
15238 /* Override any gcc2 internal prototype to avoid an error.  */
15239 /* We use char because int might match the return type of a gcc2
15240     builtin and then its argument prototype would still apply.  */
15241 char $ac_func();
15242 char (*f)();
15243
15244 int main() {
15245
15246 /* The GNU C library defines this for functions which it implements
15247     to always fail with ENOSYS.  Some functions are actually named
15248     something starting with __ and the normal name is an alias.  */
15249 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15250 choke me
15251 #else
15252 f = $ac_func;
15253 #endif
15254
15255 ; return 0; }
15256 EOF
15257 if { (eval echo configure:15258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15258   rm -rf conftest*
15259   eval "ac_cv_func_$ac_func=yes"
15260 else
15261   echo "configure: failed program was:" >&5
15262   cat conftest.$ac_ext >&5
15263   rm -rf conftest*
15264   eval "ac_cv_func_$ac_func=no"
15265 fi
15266 rm -f conftest*
15267 fi
15268
15269 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15270   echo "$ac_t""yes" 1>&6
15271     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15272   cat >> confdefs.h <<EOF
15273 #define $ac_tr_func 1
15274 EOF
15275  
15276 else
15277   echo "$ac_t""no" 1>&6
15278 fi
15279 done
15280
15281
15282 for ac_func in getopt tempnam
15283 do
15284 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15285 echo "configure:15286: checking for $ac_func" >&5
15286 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15287   echo $ac_n "(cached) $ac_c" 1>&6
15288 else
15289   cat > conftest.$ac_ext <<EOF
15290 #line 15291 "configure"
15291 #include "confdefs.h"
15292 /* System header to define __stub macros and hopefully few prototypes,
15293     which can conflict with char $ac_func(); below.  */
15294 #include <assert.h>
15295 /* Override any gcc2 internal prototype to avoid an error.  */
15296 /* We use char because int might match the return type of a gcc2
15297     builtin and then its argument prototype would still apply.  */
15298 char $ac_func();
15299 char (*f)();
15300
15301 int main() {
15302
15303 /* The GNU C library defines this for functions which it implements
15304     to always fail with ENOSYS.  Some functions are actually named
15305     something starting with __ and the normal name is an alias.  */
15306 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15307 choke me
15308 #else
15309 f = $ac_func;
15310 #endif
15311
15312 ; return 0; }
15313 EOF
15314 if { (eval echo configure:15315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15315   rm -rf conftest*
15316   eval "ac_cv_func_$ac_func=yes"
15317 else
15318   echo "configure: failed program was:" >&5
15319   cat conftest.$ac_ext >&5
15320   rm -rf conftest*
15321   eval "ac_cv_func_$ac_func=no"
15322 fi
15323 rm -f conftest*
15324 fi
15325
15326 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15327   echo "$ac_t""yes" 1>&6
15328     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15329   cat >> confdefs.h <<EOF
15330 #define $ac_tr_func 1
15331 EOF
15332  
15333 else
15334   echo "$ac_t""no" 1>&6
15335 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
15336 fi
15337 done
15338
15339
15340
15341 if test "$ac_cv_func_getopt" != yes; then
15342     LIBSRCS="$LIBSRCS getopt.c"
15343 fi
15344
15345 if test "$ac_cv_func_tempnam" != yes; then
15346     LIBSRCS="$LIBSRCS tempnam.c"
15347 fi
15348
15349 # Check Configuration
15350 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
15351 echo "configure:15352: checking declaration of sys_errlist" >&5
15352 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
15353   echo $ac_n "(cached) $ac_c" 1>&6
15354 else
15355   
15356         cat > conftest.$ac_ext <<EOF
15357 #line 15358 "configure"
15358 #include "confdefs.h"
15359
15360 #include <stdio.h>
15361 #include <sys/types.h>
15362 #include <errno.h>
15363 #ifdef WINNT
15364 #include <stdlib.h>
15365 #endif 
15366 int main() {
15367 char *c = (char *) *sys_errlist
15368 ; return 0; }
15369 EOF
15370 if { (eval echo configure:15371: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15371   rm -rf conftest*
15372   ol_cv_dcl_sys_errlist=yes
15373         ol_cv_have_sys_errlist=yes
15374 else
15375   echo "configure: failed program was:" >&5
15376   cat conftest.$ac_ext >&5
15377   rm -rf conftest*
15378   ol_cv_dcl_sys_errlist=no
15379 fi
15380 rm -f conftest*
15381 fi
15382
15383 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
15384 #
15385 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
15386 if test $ol_cv_dcl_sys_errlist = no ; then
15387         cat >> confdefs.h <<\EOF
15388 #define DECL_SYS_ERRLIST 1
15389 EOF
15390
15391
15392         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
15393 echo "configure:15394: checking existence of sys_errlist" >&5
15394 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
15395   echo $ac_n "(cached) $ac_c" 1>&6
15396 else
15397   
15398                 cat > conftest.$ac_ext <<EOF
15399 #line 15400 "configure"
15400 #include "confdefs.h"
15401 #include <errno.h>
15402 int main() {
15403 char *c = (char *) *sys_errlist
15404 ; return 0; }
15405 EOF
15406 if { (eval echo configure:15407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15407   rm -rf conftest*
15408   ol_cv_have_sys_errlist=yes
15409 else
15410   echo "configure: failed program was:" >&5
15411   cat conftest.$ac_ext >&5
15412   rm -rf conftest*
15413   ol_cv_have_sys_errlist=no
15414 fi
15415 rm -f conftest*
15416 fi
15417
15418 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
15419 fi
15420 if test $ol_cv_have_sys_errlist = yes ; then
15421         cat >> confdefs.h <<\EOF
15422 #define HAVE_SYS_ERRLIST 1
15423 EOF
15424
15425 fi
15426
15427
15428
15429 if test "$ol_enable_debug" != no ; then
15430         cat >> confdefs.h <<\EOF
15431 #define LDAP_DEBUG 1
15432 EOF
15433
15434 fi
15435 if test "$ol_enable_syslog" = yes ; then
15436         cat >> confdefs.h <<\EOF
15437 #define LDAP_SYSLOG 1
15438 EOF
15439
15440 fi
15441 if test "$ol_enable_libui" = yes ; then
15442         cat >> confdefs.h <<\EOF
15443 #define LDAP_LIBUI 1
15444 EOF
15445
15446 fi
15447 if test "$ol_enable_cache" = no ; then
15448         cat >> confdefs.h <<\EOF
15449 #define LDAP_NOCACHE 1
15450 EOF
15451
15452 fi
15453 if test "$ol_link_kbind" != no ; then
15454         cat >> confdefs.h <<\EOF
15455 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
15456 EOF
15457
15458 fi
15459 if test "$ol_enable_proctitle" != no ; then
15460         cat >> confdefs.h <<\EOF
15461 #define LDAP_PROCTITLE 1
15462 EOF
15463
15464 fi
15465 if test "$ol_enable_referrals" != no ; then
15466         cat >> confdefs.h <<\EOF
15467 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
15468 EOF
15469
15470 fi
15471 if test "$ol_enable_cldap" != no ; then
15472         cat >> confdefs.h <<\EOF
15473 #define LDAP_CONNECTIONLESS 1
15474 EOF
15475
15476 fi
15477 if test "$ol_enable_unix" != no; then
15478         cat >> confdefs.h <<\EOF
15479 #define LDAP_PF_UNIX 1
15480 EOF
15481
15482 fi
15483 if test "$ol_enable_ipv6" != no; then
15484         cat >> confdefs.h <<\EOF
15485 #define LDAP_PF_INET6 1
15486 EOF
15487
15488 fi
15489 if test "$ol_enable_cleartext" != no ; then
15490         cat >> confdefs.h <<\EOF
15491 #define SLAPD_CLEARTEXT 1
15492 EOF
15493
15494 fi
15495 if test "$ol_enable_crypt" != no ; then
15496         cat >> confdefs.h <<\EOF
15497 #define SLAPD_CRYPT 1
15498 EOF
15499
15500 fi
15501 if test "$ol_link_kpasswd" != no ; then
15502         cat >> confdefs.h <<\EOF
15503 #define SLAPD_KPASSWD 1
15504 EOF
15505
15506 fi
15507 if test "$ol_link_spasswd" != no ; then
15508         cat >> confdefs.h <<\EOF
15509 #define SLAPD_SPASSWD 1
15510 EOF
15511
15512 fi
15513 if test "$ol_enable_multimaster" != no ; then
15514         cat >> confdefs.h <<\EOF
15515 #define SLAPD_MULTIMASTER 1
15516 EOF
15517
15518 fi
15519 if test "$ol_enable_phonetic" != no ; then
15520         cat >> confdefs.h <<\EOF
15521 #define SLAPD_PHONETIC 1
15522 EOF
15523
15524 fi
15525 if test "$ol_enable_rlookups" != no ; then
15526         cat >> confdefs.h <<\EOF
15527 #define SLAPD_RLOOKUPS 1
15528 EOF
15529
15530 fi
15531 if test "$ol_enable_aci" != no ; then
15532         cat >> confdefs.h <<\EOF
15533 #define SLAPD_ACI_ENABLED 1
15534 EOF
15535
15536 fi
15537
15538 if test "$ol_link_modules" != no ; then
15539         cat >> confdefs.h <<\EOF
15540 #define SLAPD_MODULES 1
15541 EOF
15542
15543         BUILD_SLAPD=yes
15544         SLAPD_MODULES_LDFLAGS="-dlopen self"
15545 fi
15546
15547 if test "$ol_link_dnssrv" != no ; then
15548         cat >> confdefs.h <<\EOF
15549 #define SLAPD_DNSSRV 1
15550 EOF
15551
15552         BUILD_SLAPD=yes
15553         BUILD_DNSSRV=yes
15554         if test "$ol_with_dnssrv_module" != static ; then
15555                 cat >> confdefs.h <<\EOF
15556 #define SLAPD_DNSSRV_DYNAMIC 1
15557 EOF
15558
15559                 BUILD_DNSSRV=mod
15560                 BUILD_DNSSRV_DYNAMIC=shared
15561                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
15562         fi
15563 fi
15564
15565 if test "$ol_enable_ldap" != no ; then
15566         cat >> confdefs.h <<\EOF
15567 #define SLAPD_LDAP 1
15568 EOF
15569
15570         BUILD_SLAPD=yes
15571         BUILD_LDAP=yes
15572         if test "$ol_with_ldap_module" != static ; then
15573                 cat >> confdefs.h <<\EOF
15574 #define SLAPD_LDAP_DYNAMIC 1
15575 EOF
15576
15577                 BUILD_LDAP=mod
15578                 BUILD_LDAP_DYNAMIC=shared
15579                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
15580         fi
15581 fi
15582
15583 if test "$ol_link_ldbm" != no ; then
15584         cat >> confdefs.h <<\EOF
15585 #define SLAPD_LDBM 1
15586 EOF
15587
15588         BUILD_SLAPD=yes
15589         BUILD_LDBM=yes
15590         if test "$ol_with_ldbm_module" != static ; then
15591                 cat >> confdefs.h <<\EOF
15592 #define SLAPD_LDBM_DYNAMIC 1
15593 EOF
15594
15595                 BUILD_LDBM=mod
15596                 BUILD_LDBM_DYNAMIC=shared
15597                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
15598         fi
15599 fi
15600
15601 if test "$ol_enable_passwd" != no ; then
15602         cat >> confdefs.h <<\EOF
15603 #define SLAPD_PASSWD 1
15604 EOF
15605
15606         BUILD_SLAPD=yes
15607         BUILD_PASSWD=yes
15608         if test "$ol_with_passwd_module" != static ; then
15609                 cat >> confdefs.h <<\EOF
15610 #define SLAPD_PASSWD_DYNAMIC 1
15611 EOF
15612
15613                 BUILD_PASSWD=mod
15614                 BUILD_PASSWD_DYNAMIC=shared
15615                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
15616         fi
15617 fi
15618
15619 if test "$ol_enable_shell" != no ; then
15620         cat >> confdefs.h <<\EOF
15621 #define SLAPD_SHELL 1
15622 EOF
15623
15624         BUILD_SLAPD=yes
15625         BUILD_SHELL=yes
15626         if test "$ol_with_shell_module" != static ; then
15627                 cat >> confdefs.h <<\EOF
15628 #define SLAPD_SHELL_DYNAMIC 1
15629 EOF
15630
15631                 BUILD_SHELL=mod
15632                 BUILD_SHELL_DYNAMIC=shared
15633                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
15634         fi
15635 fi
15636
15637 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
15638         $BUILD_SLAPD = yes ; then
15639         BUILD_SLURPD=yes
15640 fi
15641
15642
15643 if test "$LINK_BINS_DYNAMIC" = yes; then
15644     LIB_LINKAGE=DYN
15645     LT_LIB_LINKAGE=shared
15646 else
15647     LIB_LINKAGE=STAT
15648     LT_LIB_LINKAGE=static
15649 fi
15650
15651 if test "$ac_cv_mingw32" = yes ; then
15652     PLAT=NT
15653     DYN_EXT=dll
15654 else
15655     PLAT=UNIX
15656     DYN_EXT=so
15657 fi
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667   
15668   
15669   
15670   
15671   
15672   
15673   
15674   
15675   
15676   
15677   
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705 trap '' 1 2 15
15706
15707 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
15708
15709 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15710 # Let make expand exec_prefix.
15711 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15712
15713 # Any assignment to VPATH causes Sun make to only execute
15714 # the first set of double-colon rules, so remove it if not needed.
15715 # If there is a colon in the path, we need to keep it.
15716 if test "x$srcdir" = x.; then
15717   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
15718 fi
15719
15720 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
15721
15722 DEFS=-DHAVE_CONFIG_H
15723
15724 # Without the "./", some shells look in PATH for config.status.
15725 : ${CONFIG_STATUS=./config.status}
15726
15727 echo creating $CONFIG_STATUS
15728 rm -f $CONFIG_STATUS
15729 cat > $CONFIG_STATUS <<EOF
15730 #! /bin/sh
15731 # Generated automatically by configure.
15732 # Run this file to recreate the current configuration.
15733 # This directory was configured as follows,
15734 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15735 #
15736 # $0 $ac_configure_args
15737 #
15738 # Compiler output produced by configure, useful for debugging
15739 # configure, is in ./config.log if it exists.
15740
15741 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
15742 for ac_option
15743 do
15744   case "\$ac_option" in
15745   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15746     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
15747     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
15748   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
15749     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
15750     exit 0 ;;
15751   -help | --help | --hel | --he | --h)
15752     echo "\$ac_cs_usage"; exit 0 ;;
15753   *) echo "\$ac_cs_usage"; exit 1 ;;
15754   esac
15755 done
15756
15757 ac_given_srcdir=$srcdir
15758 ac_given_INSTALL="$INSTALL"
15759
15760 trap 'rm -fr `echo "\
15761 Makefile:build/top.mk:Makefile.in:build/dir.mk \
15762 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
15763 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
15764 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
15765 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
15766 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
15767 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
15768 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
15769 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
15770 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
15771 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
15772 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
15773 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
15774 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
15775 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
15776 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
15777 include/Makefile:build/top.mk:include/Makefile.in \
15778 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
15779 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
15780 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15781 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15782 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
15783 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
15784 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
15785 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
15786 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
15787 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
15788 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
15789 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
15790 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
15791 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
15792 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
15793 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
15794 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
15795 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
15796 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
15797 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
15798 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
15799 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
15800 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
15801 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
15802  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
15803 EOF
15804 cat >> $CONFIG_STATUS <<EOF
15805
15806 # Protect against being on the right side of a sed subst in config.status.
15807 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
15808  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
15809 $ac_vpsub
15810 $extrasub
15811 s%@SHELL@%$SHELL%g
15812 s%@CFLAGS@%$CFLAGS%g
15813 s%@CPPFLAGS@%$CPPFLAGS%g
15814 s%@CXXFLAGS@%$CXXFLAGS%g
15815 s%@FFLAGS@%$FFLAGS%g
15816 s%@DEFS@%$DEFS%g
15817 s%@LDFLAGS@%$LDFLAGS%g
15818 s%@LIBS@%$LIBS%g
15819 s%@exec_prefix@%$exec_prefix%g
15820 s%@prefix@%$prefix%g
15821 s%@program_transform_name@%$program_transform_name%g
15822 s%@bindir@%$bindir%g
15823 s%@sbindir@%$sbindir%g
15824 s%@libexecdir@%$libexecdir%g
15825 s%@datadir@%$datadir%g
15826 s%@sysconfdir@%$sysconfdir%g
15827 s%@sharedstatedir@%$sharedstatedir%g
15828 s%@localstatedir@%$localstatedir%g
15829 s%@libdir@%$libdir%g
15830 s%@includedir@%$includedir%g
15831 s%@oldincludedir@%$oldincludedir%g
15832 s%@infodir@%$infodir%g
15833 s%@mandir@%$mandir%g
15834 s%@host@%$host%g
15835 s%@host_alias@%$host_alias%g
15836 s%@host_cpu@%$host_cpu%g
15837 s%@host_vendor@%$host_vendor%g
15838 s%@host_os@%$host_os%g
15839 s%@target@%$target%g
15840 s%@target_alias@%$target_alias%g
15841 s%@target_cpu@%$target_cpu%g
15842 s%@target_vendor@%$target_vendor%g
15843 s%@target_os@%$target_os%g
15844 s%@build@%$build%g
15845 s%@build_alias@%$build_alias%g
15846 s%@build_cpu@%$build_cpu%g
15847 s%@build_vendor@%$build_vendor%g
15848 s%@build_os@%$build_os%g
15849 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
15850 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
15851 s%@INSTALL_DATA@%$INSTALL_DATA%g
15852 s%@PACKAGE@%$PACKAGE%g
15853 s%@VERSION@%$VERSION%g
15854 s%@ACLOCAL@%$ACLOCAL%g
15855 s%@AUTOCONF@%$AUTOCONF%g
15856 s%@AUTOMAKE@%$AUTOMAKE%g
15857 s%@AUTOHEADER@%$AUTOHEADER%g
15858 s%@MAKEINFO@%$MAKEINFO%g
15859 s%@install_sh@%$install_sh%g
15860 s%@AMTAR@%$AMTAR%g
15861 s%@AWK@%$AWK%g
15862 s%@AMTARFLAGS@%$AMTARFLAGS%g
15863 s%@SET_MAKE@%$SET_MAKE%g
15864 s%@top_builddir@%$top_builddir%g
15865 s%@ldap_subdir@%$ldap_subdir%g
15866 s%@CC@%$CC%g
15867 s%@RANLIB@%$RANLIB%g
15868 s%@LN_S@%$LN_S%g
15869 s%@DLLTOOL@%$DLLTOOL%g
15870 s%@AS@%$AS%g
15871 s%@OBJDUMP@%$OBJDUMP%g
15872 s%@LIBTOOL@%$LIBTOOL%g
15873 s%@LN_H@%$LN_H%g
15874 s%@SENDMAIL@%$SENDMAIL%g
15875 s%@EDITOR@%$EDITOR%g
15876 s%@FINGER@%$FINGER%g
15877 s%@CPP@%$CPP%g
15878 s%@EXEEXT@%$EXEEXT%g
15879 s%@OBJEXT@%$OBJEXT%g
15880 s%@OL_MKDEP@%$OL_MKDEP%g
15881 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
15882 s%@LIBOBJS@%$LIBOBJS%g
15883 s%@LIBSRCS@%$LIBSRCS%g
15884 s%@PLAT@%$PLAT%g
15885 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
15886 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
15887 s%@DYN_EXT@%$DYN_EXT%g
15888 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
15889 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
15890 s%@BUILD_LDAP@%$BUILD_LDAP%g
15891 s%@BUILD_LDBM@%$BUILD_LDBM%g
15892 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
15893 s%@BUILD_QUIPU@%$BUILD_QUIPU%g
15894 s%@BUILD_SHELL@%$BUILD_SHELL%g
15895 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
15896 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
15897 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
15898 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
15899 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
15900 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
15901 s%@LDAP_LIBS@%$LDAP_LIBS%g
15902 s%@LDIF_LIBS@%$LDIF_LIBS%g
15903 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
15904 s%@QUIPU_LIBS@%$QUIPU_LIBS%g
15905 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
15906 s%@LDBM_LIBS@%$LDBM_LIBS%g
15907 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
15908 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
15909 s%@WRAP_LIBS@%$WRAP_LIBS%g
15910 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
15911 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
15912 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
15913 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
15914 s%@KRB4_LIBS@%$KRB4_LIBS%g
15915 s%@KRB5_LIBS@%$KRB5_LIBS%g
15916 s%@READLINE_LIBS@%$READLINE_LIBS%g
15917 s%@SASL_LIBS@%$SASL_LIBS%g
15918 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
15919 s%@TLS_LIBS@%$TLS_LIBS%g
15920 s%@MODULES_LIBS@%$MODULES_LIBS%g
15921 s%@AUTH_LIBS@%$AUTH_LIBS%g
15922
15923 CEOF
15924 EOF
15925
15926 cat >> $CONFIG_STATUS <<\EOF
15927
15928 # Split the substitutions into bite-sized pieces for seds with
15929 # small command number limits, like on Digital OSF/1 and HP-UX.
15930 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
15931 ac_file=1 # Number of current file.
15932 ac_beg=1 # First line for current file.
15933 ac_end=$ac_max_sed_cmds # Line after last line for current file.
15934 ac_more_lines=:
15935 ac_sed_cmds=""
15936 while $ac_more_lines; do
15937   if test $ac_beg -gt 1; then
15938     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
15939   else
15940     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
15941   fi
15942   if test ! -s conftest.s$ac_file; then
15943     ac_more_lines=false
15944     rm -f conftest.s$ac_file
15945   else
15946     if test -z "$ac_sed_cmds"; then
15947       ac_sed_cmds="sed -f conftest.s$ac_file"
15948     else
15949       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
15950     fi
15951     ac_file=`expr $ac_file + 1`
15952     ac_beg=$ac_end
15953     ac_end=`expr $ac_end + $ac_max_sed_cmds`
15954   fi
15955 done
15956 if test -z "$ac_sed_cmds"; then
15957   ac_sed_cmds=cat
15958 fi
15959 EOF
15960
15961 cat >> $CONFIG_STATUS <<EOF
15962
15963 CONFIG_FILES=\${CONFIG_FILES-"\
15964 Makefile:build/top.mk:Makefile.in:build/dir.mk \
15965 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
15966 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
15967 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
15968 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
15969 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
15970 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
15971 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
15972 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
15973 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
15974 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
15975 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
15976 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
15977 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
15978 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
15979 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
15980 include/Makefile:build/top.mk:include/Makefile.in \
15981 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
15982 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
15983 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15984 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15985 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
15986 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
15987 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
15988 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
15989 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
15990 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
15991 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
15992 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
15993 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
15994 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
15995 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
15996 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
15997 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
15998 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
15999 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16000 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16001 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16002 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16003 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16004 contrib/web_ldap/Makefile:build/top.mk:contrib/web_ldap/Makefile.in:build/rules.mk \
16005 "}
16006 EOF
16007 cat >> $CONFIG_STATUS <<\EOF
16008 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
16009   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16010   case "$ac_file" in
16011   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16012        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16013   *) ac_file_in="${ac_file}.in" ;;
16014   esac
16015
16016   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
16017
16018   # Remove last slash and all that follows it.  Not all systems have dirname.
16019   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16020   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16021     # The file is in a subdirectory.
16022     test ! -d "$ac_dir" && mkdir "$ac_dir"
16023     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
16024     # A "../" for each directory in $ac_dir_suffix.
16025     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
16026   else
16027     ac_dir_suffix= ac_dots=
16028   fi
16029
16030   case "$ac_given_srcdir" in
16031   .)  srcdir=.
16032       if test -z "$ac_dots"; then top_srcdir=.
16033       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
16034   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
16035   *) # Relative path.
16036     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
16037     top_srcdir="$ac_dots$ac_given_srcdir" ;;
16038   esac
16039
16040   case "$ac_given_INSTALL" in
16041   [/$]*) INSTALL="$ac_given_INSTALL" ;;
16042   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
16043   esac
16044
16045   echo creating "$ac_file"
16046   rm -f "$ac_file"
16047   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
16048   case "$ac_file" in
16049   *[Mm]akefile*) ac_comsub="1i\\
16050 # $configure_input" ;;
16051   *) ac_comsub= ;;
16052   esac
16053
16054   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16055   sed -e "$ac_comsub
16056 s%@configure_input@%$configure_input%g
16057 s%@srcdir@%$srcdir%g
16058 s%@top_srcdir@%$top_srcdir%g
16059 s%@INSTALL@%$INSTALL%g
16060 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
16061 fi; done
16062 rm -f conftest.s*
16063
16064 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16065 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16066 #
16067 # ac_d sets the value in "#define NAME VALUE" lines.
16068 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16069 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
16070 ac_dC='\3'
16071 ac_dD='%g'
16072 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16073 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16074 ac_uB='\([      ]\)%\1#\2define\3'
16075 ac_uC=' '
16076 ac_uD='\4%g'
16077 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16078 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16079 ac_eB='$%\1#\2define\3'
16080 ac_eC=' '
16081 ac_eD='%g'
16082
16083 if test "${CONFIG_HEADERS+set}" != set; then
16084 EOF
16085 cat >> $CONFIG_STATUS <<EOF
16086   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
16087 EOF
16088 cat >> $CONFIG_STATUS <<\EOF
16089 fi
16090 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
16091   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16092   case "$ac_file" in
16093   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16094        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16095   *) ac_file_in="${ac_file}.in" ;;
16096   esac
16097
16098   echo creating $ac_file
16099
16100   rm -f conftest.frag conftest.in conftest.out
16101   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16102   cat $ac_file_inputs > conftest.in
16103
16104 EOF
16105
16106 # Transform confdefs.h into a sed script conftest.vals that substitutes
16107 # the proper values into config.h.in to produce config.h.  And first:
16108 # Protect against being on the right side of a sed subst in config.status.
16109 # Protect against being in an unquoted here document in config.status.
16110 rm -f conftest.vals
16111 cat > conftest.hdr <<\EOF
16112 s/[\\&%]/\\&/g
16113 s%[\\$`]%\\&%g
16114 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
16115 s%ac_d%ac_u%gp
16116 s%ac_u%ac_e%gp
16117 EOF
16118 sed -n -f conftest.hdr confdefs.h > conftest.vals
16119 rm -f conftest.hdr
16120
16121 # This sed command replaces #undef with comments.  This is necessary, for
16122 # example, in the case of _POSIX_SOURCE, which is predefined and required
16123 # on some systems where configure will not decide to define it.
16124 cat >> conftest.vals <<\EOF
16125 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
16126 EOF
16127
16128 # Break up conftest.vals because some shells have a limit on
16129 # the size of here documents, and old seds have small limits too.
16130
16131 rm -f conftest.tail
16132 while :
16133 do
16134   ac_lines=`grep -c . conftest.vals`
16135   # grep -c gives empty output for an empty file on some AIX systems.
16136   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
16137   # Write a limited-size here document to conftest.frag.
16138   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
16139   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
16140   echo 'CEOF
16141   sed -f conftest.frag conftest.in > conftest.out
16142   rm -f conftest.in
16143   mv conftest.out conftest.in
16144 ' >> $CONFIG_STATUS
16145   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16146   rm -f conftest.vals
16147   mv conftest.tail conftest.vals
16148 done
16149 rm -f conftest.vals
16150
16151 cat >> $CONFIG_STATUS <<\EOF
16152   rm -f conftest.frag conftest.h
16153   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
16154   cat conftest.in >> conftest.h
16155   rm -f conftest.in
16156   if cmp -s $ac_file conftest.h 2>/dev/null; then
16157     echo "$ac_file is unchanged"
16158     rm -f conftest.h
16159   else
16160     # Remove last slash and all that follows it.  Not all systems have dirname.
16161       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16162       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16163       # The file is in a subdirectory.
16164       test ! -d "$ac_dir" && mkdir "$ac_dir"
16165     fi
16166     rm -f $ac_file
16167     mv conftest.h $ac_file
16168   fi
16169 fi; done
16170
16171 EOF
16172 cat >> $CONFIG_STATUS <<EOF
16173
16174 EOF
16175 cat >> $CONFIG_STATUS <<\EOF
16176
16177 date > stamp-h
16178 echo Please \"make depend\" to build dependencies
16179
16180 exit 0
16181 EOF
16182 chmod +x $CONFIG_STATUS
16183 rm -fr confdefs* $ac_clean_files
16184 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
16185