]> git.sur5r.net Git - openldap/blob - configure
Forced commit:
[openldap] / configure
1 #! /bin/sh
2 # $OpenLDAP$
3 # from OpenLDAP 
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 "Restrictions apply, see COPYRIGHT and LICENSE files."
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 (no)"
41 ac_help="$ac_help
42   --enable-ipv6           enable IPv6 support (auto)"
43 ac_help="$ac_help
44   --enable-local          enable AF_LOCAL (AF_UNIX) socket support (auto)"
45 ac_help="$ac_help
46   --enable-x-compile      enable cross compiling (no)"
47 ac_help="$ac_help
48   --with-cyrus-sasl       with Cyrus SASL support (auto)"
49 ac_help="$ac_help
50   --with-fetch            with fetch URL support (auto)"
51 ac_help="$ac_help
52   --with-kerberos         with support (auto)"
53 ac_help="$ac_help
54   --with-readline         with readline support (auto)"
55 ac_help="$ac_help
56   --with-threads          with threads (auto)"
57 ac_help="$ac_help
58   --with-tls              with TLS/SSL support (auto)"
59 ac_help="$ac_help
60   --with-yielding-select  with implicitly yielding select (auto)"
61 ac_help="$ac_help
62 SLAPD (Standalone LDAP Daemon) Options:"
63 ac_help="$ac_help
64   --enable-slapd          enable building slapd (yes)"
65 ac_help="$ac_help
66     --enable-cleartext    enable cleartext passwords (yes)"
67 ac_help="$ac_help
68     --enable-crypt        enable crypt(3) passwords (auto)"
69 ac_help="$ac_help
70     --enable-kpasswd      enable kerberos password verification (no)"
71 ac_help="$ac_help
72     --enable-spasswd      enable (Cyrus) SASL password verification (no)"
73 ac_help="$ac_help
74     --enable-modules      enable dynamic module support (no)"
75 ac_help="$ac_help
76     --enable-multimaster  enable multimaster replication (no)"
77 ac_help="$ac_help
78     --enable-phonetic     enable phonetic/soundex (no)"
79 ac_help="$ac_help
80     --enable-rlookups     enable reverse lookups (auto)"
81 ac_help="$ac_help
82     --enable-aci          enable per-object ACIs (no)"
83 ac_help="$ac_help
84     --enable-wrappers     enable tcp wrapper support (no)"
85 ac_help="$ac_help
86     --enable-dynamic      enable linking built binaries with dynamic libs (no)"
87 ac_help="$ac_help
88     --enable-dnssrv       enable dnssrv backend (no)"
89 ac_help="$ac_help
90     --with-dnssrv-module  module type (static)"
91 ac_help="$ac_help
92     --enable-ldap         enable ldap backend (no)"
93 ac_help="$ac_help
94     --with-ldap-module    module type (static)"
95 ac_help="$ac_help
96     --enable-ldbm         enable ldbm backend (yes)"
97 ac_help="$ac_help
98     --with-ldbm-api       with LDBM API (auto)"
99 ac_help="$ac_help
100     --with-ldbm-module    module type (static)"
101 ac_help="$ac_help
102     --with-ldbm-type      use LDBM type (auto)"
103 ac_help="$ac_help
104     --enable-passwd       enable passwd backend (no)"
105 ac_help="$ac_help
106     --with-passwd-module  module type (static)"
107 ac_help="$ac_help
108     --enable-shell        enable shell backend (no)"
109 ac_help="$ac_help
110     --with-shell-module   module type (static)"
111 ac_help="$ac_help
112     --enable-sql          enable sql backend (no)"
113 ac_help="$ac_help
114     --with-sql-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="no"
1288 fi
1289 # end --enable-kbind
1290 # OpenLDAP --enable-ipv6
1291         # Check whether --enable-ipv6 or --disable-ipv6 was given.
1292 if test "${enable_ipv6+set}" = set; then
1293   enableval="$enable_ipv6"
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-ipv6" 1>&2; exit 1; }
1303         fi
1304         ol_enable_ipv6="$ol_arg"
1305
1306 else
1307         ol_enable_ipv6="auto"
1308 fi
1309 # end --enable-ipv6
1310 # OpenLDAP --enable-local
1311         # Check whether --enable-local or --disable-local was given.
1312 if test "${enable_local+set}" = set; then
1313   enableval="$enable_local"
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-local" 1>&2; exit 1; }
1323         fi
1324         ol_enable_local="$ol_arg"
1325
1326 else
1327         ol_enable_local="auto"
1328 fi
1329 # end --enable-local
1330 # OpenLDAP --enable-x_compile
1331         # Check whether --enable-x_compile or --disable-x_compile was given.
1332 if test "${enable_x_compile+set}" = set; then
1333   enableval="$enable_x_compile"
1334   
1335         ol_arg=invalid
1336         for ol_val in 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-x_compile" 1>&2; exit 1; }
1343         fi
1344         ol_enable_x_compile="$ol_arg"
1345
1346 else
1347         ol_enable_x_compile="no"
1348 fi
1349 # end --enable-x_compile
1350
1351
1352 # OpenLDAP --with-cyrus_sasl
1353         # Check whether --with-cyrus_sasl or --without-cyrus_sasl was given.
1354 if test "${with_cyrus_sasl+set}" = set; then
1355   withval="$with_cyrus_sasl"
1356   
1357         ol_arg=invalid
1358         for ol_val in auto yes no  ; do
1359                 if test "$withval" = "$ol_val" ; then
1360                         ol_arg="$ol_val"
1361                 fi
1362         done
1363         if test "$ol_arg" = "invalid" ; then
1364                 { echo "configure: error: bad value $withval for --with-cyrus_sasl" 1>&2; exit 1; }
1365         fi
1366         ol_with_cyrus_sasl="$ol_arg"
1367
1368 else
1369         ol_with_cyrus_sasl="auto"
1370 fi
1371 # end --with-cyrus_sasl
1372
1373 # OpenLDAP --with-fetch
1374         # Check whether --with-fetch or --without-fetch was given.
1375 if test "${with_fetch+set}" = set; then
1376   withval="$with_fetch"
1377   
1378         ol_arg=invalid
1379         for ol_val in auto yes no  ; do
1380                 if test "$withval" = "$ol_val" ; then
1381                         ol_arg="$ol_val"
1382                 fi
1383         done
1384         if test "$ol_arg" = "invalid" ; then
1385                 { echo "configure: error: bad value $withval for --with-fetch" 1>&2; exit 1; }
1386         fi
1387         ol_with_fetch="$ol_arg"
1388
1389 else
1390         ol_with_fetch="auto"
1391 fi
1392 # end --with-fetch
1393
1394 # OpenLDAP --with-kerberos
1395         # Check whether --with-kerberos or --without-kerberos was given.
1396 if test "${with_kerberos+set}" = set; then
1397   withval="$with_kerberos"
1398   
1399         ol_arg=invalid
1400         for ol_val in auto k5 k5only k425 kth k4 afs yes no ; do
1401                 if test "$withval" = "$ol_val" ; then
1402                         ol_arg="$ol_val"
1403                 fi
1404         done
1405         if test "$ol_arg" = "invalid" ; then
1406                 { echo "configure: error: bad value $withval for --with-kerberos" 1>&2; exit 1; }
1407         fi
1408         ol_with_kerberos="$ol_arg"
1409
1410 else
1411         ol_with_kerberos="auto"
1412 fi
1413 # end --with-kerberos
1414
1415 # OpenLDAP --with-readline
1416         # Check whether --with-readline or --without-readline was given.
1417 if test "${with_readline+set}" = set; then
1418   withval="$with_readline"
1419   
1420         ol_arg=invalid
1421         for ol_val in auto yes no  ; do
1422                 if test "$withval" = "$ol_val" ; then
1423                         ol_arg="$ol_val"
1424                 fi
1425         done
1426         if test "$ol_arg" = "invalid" ; then
1427                 { echo "configure: error: bad value $withval for --with-readline" 1>&2; exit 1; }
1428         fi
1429         ol_with_readline="$ol_arg"
1430
1431 else
1432         ol_with_readline="auto"
1433 fi
1434 # end --with-readline
1435
1436 # OpenLDAP --with-threads
1437         # Check whether --with-threads or --without-threads was given.
1438 if test "${with_threads+set}" = set; then
1439   withval="$with_threads"
1440   
1441         ol_arg=invalid
1442         for ol_val in auto nt posix mach pth lwp yes no manual  ; do
1443                 if test "$withval" = "$ol_val" ; then
1444                         ol_arg="$ol_val"
1445                 fi
1446         done
1447         if test "$ol_arg" = "invalid" ; then
1448                 { echo "configure: error: bad value $withval for --with-threads" 1>&2; exit 1; }
1449         fi
1450         ol_with_threads="$ol_arg"
1451
1452 else
1453         ol_with_threads="auto"
1454 fi
1455 # end --with-threads
1456
1457 # OpenLDAP --with-tls
1458         # Check whether --with-tls or --without-tls was given.
1459 if test "${with_tls+set}" = set; then
1460   withval="$with_tls"
1461   
1462         ol_arg=invalid
1463         for ol_val in auto ssleay openssl yes no  ; do
1464                 if test "$withval" = "$ol_val" ; then
1465                         ol_arg="$ol_val"
1466                 fi
1467         done
1468         if test "$ol_arg" = "invalid" ; then
1469                 { echo "configure: error: bad value $withval for --with-tls" 1>&2; exit 1; }
1470         fi
1471         ol_with_tls="$ol_arg"
1472
1473 else
1474         ol_with_tls="auto"
1475 fi
1476 # end --with-tls
1477
1478 # OpenLDAP --with-yielding_select
1479         # Check whether --with-yielding_select or --without-yielding_select was given.
1480 if test "${with_yielding_select+set}" = set; then
1481   withval="$with_yielding_select"
1482   
1483         ol_arg=invalid
1484         for ol_val in auto yes no manual  ; do
1485                 if test "$withval" = "$ol_val" ; then
1486                         ol_arg="$ol_val"
1487                 fi
1488         done
1489         if test "$ol_arg" = "invalid" ; then
1490                 { echo "configure: error: bad value $withval for --with-yielding_select" 1>&2; exit 1; }
1491         fi
1492         ol_with_yielding_select="$ol_arg"
1493
1494 else
1495         ol_with_yielding_select="auto"
1496 fi
1497 # end --with-yielding_select
1498
1499
1500
1501 # Check whether --with-xxslapdoptions or --without-xxslapdoptions was given.
1502 if test "${with_xxslapdoptions+set}" = set; then
1503   withval="$with_xxslapdoptions"
1504   :
1505 fi
1506
1507 # OpenLDAP --enable-slapd
1508         # Check whether --enable-slapd or --disable-slapd was given.
1509 if test "${enable_slapd+set}" = set; then
1510   enableval="$enable_slapd"
1511   
1512         ol_arg=invalid
1513         for ol_val in auto yes no ; do
1514                 if test "$enableval" = "$ol_val" ; then
1515                         ol_arg="$ol_val"
1516                 fi
1517         done
1518         if test "$ol_arg" = "invalid" ; then
1519                 { echo "configure: error: bad value $enableval for --enable-slapd" 1>&2; exit 1; }
1520         fi
1521         ol_enable_slapd="$ol_arg"
1522
1523 else
1524         ol_enable_slapd="yes"
1525 fi
1526 # end --enable-slapd
1527 # OpenLDAP --enable-cleartext
1528         # Check whether --enable-cleartext or --disable-cleartext was given.
1529 if test "${enable_cleartext+set}" = set; then
1530   enableval="$enable_cleartext"
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-cleartext" 1>&2; exit 1; }
1540         fi
1541         ol_enable_cleartext="$ol_arg"
1542
1543 else
1544         ol_enable_cleartext="yes"
1545 fi
1546 # end --enable-cleartext
1547 # OpenLDAP --enable-crypt
1548         # Check whether --enable-crypt or --disable-crypt was given.
1549 if test "${enable_crypt+set}" = set; then
1550   enableval="$enable_crypt"
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-crypt" 1>&2; exit 1; }
1560         fi
1561         ol_enable_crypt="$ol_arg"
1562
1563 else
1564         ol_enable_crypt="auto"
1565 fi
1566 # end --enable-crypt
1567 # OpenLDAP --enable-kpasswd
1568         # Check whether --enable-kpasswd or --disable-kpasswd was given.
1569 if test "${enable_kpasswd+set}" = set; then
1570   enableval="$enable_kpasswd"
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-kpasswd" 1>&2; exit 1; }
1580         fi
1581         ol_enable_kpasswd="$ol_arg"
1582
1583 else
1584         ol_enable_kpasswd="no"
1585 fi
1586 # end --enable-kpasswd
1587 # OpenLDAP --enable-spasswd
1588         # Check whether --enable-spasswd or --disable-spasswd was given.
1589 if test "${enable_spasswd+set}" = set; then
1590   enableval="$enable_spasswd"
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-spasswd" 1>&2; exit 1; }
1600         fi
1601         ol_enable_spasswd="$ol_arg"
1602
1603 else
1604         ol_enable_spasswd="no"
1605 fi
1606 # end --enable-spasswd
1607 # OpenLDAP --enable-modules
1608         # Check whether --enable-modules or --disable-modules was given.
1609 if test "${enable_modules+set}" = set; then
1610   enableval="$enable_modules"
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-modules" 1>&2; exit 1; }
1620         fi
1621         ol_enable_modules="$ol_arg"
1622
1623 else
1624         ol_enable_modules="no"
1625 fi
1626 # end --enable-modules
1627 # OpenLDAP --enable-multimaster
1628         # Check whether --enable-multimaster or --disable-multimaster was given.
1629 if test "${enable_multimaster+set}" = set; then
1630   enableval="$enable_multimaster"
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-multimaster" 1>&2; exit 1; }
1640         fi
1641         ol_enable_multimaster="$ol_arg"
1642
1643 else
1644         ol_enable_multimaster="no"
1645 fi
1646 # end --enable-multimaster
1647 # OpenLDAP --enable-phonetic
1648         # Check whether --enable-phonetic or --disable-phonetic was given.
1649 if test "${enable_phonetic+set}" = set; then
1650   enableval="$enable_phonetic"
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-phonetic" 1>&2; exit 1; }
1660         fi
1661         ol_enable_phonetic="$ol_arg"
1662
1663 else
1664         ol_enable_phonetic="no"
1665 fi
1666 # end --enable-phonetic
1667 # OpenLDAP --enable-rlookups
1668         # Check whether --enable-rlookups or --disable-rlookups was given.
1669 if test "${enable_rlookups+set}" = set; then
1670   enableval="$enable_rlookups"
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-rlookups" 1>&2; exit 1; }
1680         fi
1681         ol_enable_rlookups="$ol_arg"
1682
1683 else
1684         ol_enable_rlookups="auto"
1685 fi
1686 # end --enable-rlookups
1687 # OpenLDAP --enable-aci
1688         # Check whether --enable-aci or --disable-aci was given.
1689 if test "${enable_aci+set}" = set; then
1690   enableval="$enable_aci"
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-aci" 1>&2; exit 1; }
1700         fi
1701         ol_enable_aci="$ol_arg"
1702
1703 else
1704         ol_enable_aci="no"
1705 fi
1706 # end --enable-aci
1707 # OpenLDAP --enable-wrappers
1708         # Check whether --enable-wrappers or --disable-wrappers was given.
1709 if test "${enable_wrappers+set}" = set; then
1710   enableval="$enable_wrappers"
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-wrappers" 1>&2; exit 1; }
1720         fi
1721         ol_enable_wrappers="$ol_arg"
1722
1723 else
1724         ol_enable_wrappers="no"
1725 fi
1726 # end --enable-wrappers
1727 # OpenLDAP --enable-dynamic
1728         # Check whether --enable-dynamic or --disable-dynamic was given.
1729 if test "${enable_dynamic+set}" = set; then
1730   enableval="$enable_dynamic"
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-dynamic" 1>&2; exit 1; }
1740         fi
1741         ol_enable_dynamic="$ol_arg"
1742
1743 else
1744         ol_enable_dynamic="no"
1745 fi
1746 # end --enable-dynamic
1747
1748 # OpenLDAP --enable-dnssrv
1749         # Check whether --enable-dnssrv or --disable-dnssrv was given.
1750 if test "${enable_dnssrv+set}" = set; then
1751   enableval="$enable_dnssrv"
1752   
1753         ol_arg=invalid
1754         for ol_val in auto yes no ; do
1755                 if test "$enableval" = "$ol_val" ; then
1756                         ol_arg="$ol_val"
1757                 fi
1758         done
1759         if test "$ol_arg" = "invalid" ; then
1760                 { echo "configure: error: bad value $enableval for --enable-dnssrv" 1>&2; exit 1; }
1761         fi
1762         ol_enable_dnssrv="$ol_arg"
1763
1764 else
1765         ol_enable_dnssrv="no"
1766 fi
1767 # end --enable-dnssrv
1768 # OpenLDAP --with-dnssrv_module
1769         # Check whether --with-dnssrv_module or --without-dnssrv_module was given.
1770 if test "${with_dnssrv_module+set}" = set; then
1771   withval="$with_dnssrv_module"
1772   
1773         ol_arg=invalid
1774         for ol_val in static dynamic ; do
1775                 if test "$withval" = "$ol_val" ; then
1776                         ol_arg="$ol_val"
1777                 fi
1778         done
1779         if test "$ol_arg" = "invalid" ; then
1780                 { echo "configure: error: bad value $withval for --with-dnssrv_module" 1>&2; exit 1; }
1781         fi
1782         ol_with_dnssrv_module="$ol_arg"
1783
1784 else
1785         ol_with_dnssrv_module="static"
1786 fi
1787 # end --with-dnssrv_module
1788
1789 # OpenLDAP --enable-ldap
1790         # Check whether --enable-ldap or --disable-ldap was given.
1791 if test "${enable_ldap+set}" = set; then
1792   enableval="$enable_ldap"
1793   
1794         ol_arg=invalid
1795         for ol_val in auto yes no ; do
1796                 if test "$enableval" = "$ol_val" ; then
1797                         ol_arg="$ol_val"
1798                 fi
1799         done
1800         if test "$ol_arg" = "invalid" ; then
1801                 { echo "configure: error: bad value $enableval for --enable-ldap" 1>&2; exit 1; }
1802         fi
1803         ol_enable_ldap="$ol_arg"
1804
1805 else
1806         ol_enable_ldap="no"
1807 fi
1808 # end --enable-ldap
1809 # OpenLDAP --with-ldap_module
1810         # Check whether --with-ldap_module or --without-ldap_module was given.
1811 if test "${with_ldap_module+set}" = set; then
1812   withval="$with_ldap_module"
1813   
1814         ol_arg=invalid
1815         for ol_val in static dynamic ; do
1816                 if test "$withval" = "$ol_val" ; then
1817                         ol_arg="$ol_val"
1818                 fi
1819         done
1820         if test "$ol_arg" = "invalid" ; then
1821                 { echo "configure: error: bad value $withval for --with-ldap_module" 1>&2; exit 1; }
1822         fi
1823         ol_with_ldap_module="$ol_arg"
1824
1825 else
1826         ol_with_ldap_module="static"
1827 fi
1828 # end --with-ldap_module
1829
1830 # OpenLDAP --enable-ldbm
1831         # Check whether --enable-ldbm or --disable-ldbm was given.
1832 if test "${enable_ldbm+set}" = set; then
1833   enableval="$enable_ldbm"
1834   
1835         ol_arg=invalid
1836         for ol_val in auto yes no ; do
1837                 if test "$enableval" = "$ol_val" ; then
1838                         ol_arg="$ol_val"
1839                 fi
1840         done
1841         if test "$ol_arg" = "invalid" ; then
1842                 { echo "configure: error: bad value $enableval for --enable-ldbm" 1>&2; exit 1; }
1843         fi
1844         ol_enable_ldbm="$ol_arg"
1845
1846 else
1847         ol_enable_ldbm="yes"
1848 fi
1849 # end --enable-ldbm
1850 # OpenLDAP --with-ldbm_api
1851         # Check whether --with-ldbm_api or --without-ldbm_api was given.
1852 if test "${with_ldbm_api+set}" = set; then
1853   withval="$with_ldbm_api"
1854   
1855         ol_arg=invalid
1856         for ol_val in auto berkeley bcompat mdbm gdbm ; do
1857                 if test "$withval" = "$ol_val" ; then
1858                         ol_arg="$ol_val"
1859                 fi
1860         done
1861         if test "$ol_arg" = "invalid" ; then
1862                 { echo "configure: error: bad value $withval for --with-ldbm_api" 1>&2; exit 1; }
1863         fi
1864         ol_with_ldbm_api="$ol_arg"
1865
1866 else
1867         ol_with_ldbm_api="auto"
1868 fi
1869 # end --with-ldbm_api
1870
1871 # OpenLDAP --with-ldbm_module
1872         # Check whether --with-ldbm_module or --without-ldbm_module was given.
1873 if test "${with_ldbm_module+set}" = set; then
1874   withval="$with_ldbm_module"
1875   
1876         ol_arg=invalid
1877         for ol_val in static dynamic ; do
1878                 if test "$withval" = "$ol_val" ; then
1879                         ol_arg="$ol_val"
1880                 fi
1881         done
1882         if test "$ol_arg" = "invalid" ; then
1883                 { echo "configure: error: bad value $withval for --with-ldbm_module" 1>&2; exit 1; }
1884         fi
1885         ol_with_ldbm_module="$ol_arg"
1886
1887 else
1888         ol_with_ldbm_module="static"
1889 fi
1890 # end --with-ldbm_module
1891
1892 # OpenLDAP --with-ldbm_type
1893         # Check whether --with-ldbm_type or --without-ldbm_type was given.
1894 if test "${with_ldbm_type+set}" = set; then
1895   withval="$with_ldbm_type"
1896   
1897         ol_arg=invalid
1898         for ol_val in auto btree hash ; do
1899                 if test "$withval" = "$ol_val" ; then
1900                         ol_arg="$ol_val"
1901                 fi
1902         done
1903         if test "$ol_arg" = "invalid" ; then
1904                 { echo "configure: error: bad value $withval for --with-ldbm_type" 1>&2; exit 1; }
1905         fi
1906         ol_with_ldbm_type="$ol_arg"
1907
1908 else
1909         ol_with_ldbm_type="auto"
1910 fi
1911 # end --with-ldbm_type
1912
1913 # OpenLDAP --enable-passwd
1914         # Check whether --enable-passwd or --disable-passwd was given.
1915 if test "${enable_passwd+set}" = set; then
1916   enableval="$enable_passwd"
1917   
1918         ol_arg=invalid
1919         for ol_val in auto yes no ; do
1920                 if test "$enableval" = "$ol_val" ; then
1921                         ol_arg="$ol_val"
1922                 fi
1923         done
1924         if test "$ol_arg" = "invalid" ; then
1925                 { echo "configure: error: bad value $enableval for --enable-passwd" 1>&2; exit 1; }
1926         fi
1927         ol_enable_passwd="$ol_arg"
1928
1929 else
1930         ol_enable_passwd="no"
1931 fi
1932 # end --enable-passwd
1933 # OpenLDAP --with-passwd_module
1934         # Check whether --with-passwd_module or --without-passwd_module was given.
1935 if test "${with_passwd_module+set}" = set; then
1936   withval="$with_passwd_module"
1937   
1938         ol_arg=invalid
1939         for ol_val in static dynamic ; do
1940                 if test "$withval" = "$ol_val" ; then
1941                         ol_arg="$ol_val"
1942                 fi
1943         done
1944         if test "$ol_arg" = "invalid" ; then
1945                 { echo "configure: error: bad value $withval for --with-passwd_module" 1>&2; exit 1; }
1946         fi
1947         ol_with_passwd_module="$ol_arg"
1948
1949 else
1950         ol_with_passwd_module="static"
1951 fi
1952 # end --with-passwd_module
1953
1954 # OpenLDAP --enable-shell
1955         # Check whether --enable-shell or --disable-shell was given.
1956 if test "${enable_shell+set}" = set; then
1957   enableval="$enable_shell"
1958   
1959         ol_arg=invalid
1960         for ol_val in auto yes no ; do
1961                 if test "$enableval" = "$ol_val" ; then
1962                         ol_arg="$ol_val"
1963                 fi
1964         done
1965         if test "$ol_arg" = "invalid" ; then
1966                 { echo "configure: error: bad value $enableval for --enable-shell" 1>&2; exit 1; }
1967         fi
1968         ol_enable_shell="$ol_arg"
1969
1970 else
1971         ol_enable_shell="no"
1972 fi
1973 # end --enable-shell
1974 # OpenLDAP --with-shell_module
1975         # Check whether --with-shell_module or --without-shell_module was given.
1976 if test "${with_shell_module+set}" = set; then
1977   withval="$with_shell_module"
1978   
1979         ol_arg=invalid
1980         for ol_val in static dynamic ; do
1981                 if test "$withval" = "$ol_val" ; then
1982                         ol_arg="$ol_val"
1983                 fi
1984         done
1985         if test "$ol_arg" = "invalid" ; then
1986                 { echo "configure: error: bad value $withval for --with-shell_module" 1>&2; exit 1; }
1987         fi
1988         ol_with_shell_module="$ol_arg"
1989
1990 else
1991         ol_with_shell_module="static"
1992 fi
1993 # end --with-shell_module
1994
1995 # OpenLDAP --enable-sql
1996         # Check whether --enable-sql or --disable-sql was given.
1997 if test "${enable_sql+set}" = set; then
1998   enableval="$enable_sql"
1999   
2000         ol_arg=invalid
2001         for ol_val in auto yes no ; do
2002                 if test "$enableval" = "$ol_val" ; then
2003                         ol_arg="$ol_val"
2004                 fi
2005         done
2006         if test "$ol_arg" = "invalid" ; then
2007                 { echo "configure: error: bad value $enableval for --enable-sql" 1>&2; exit 1; }
2008         fi
2009         ol_enable_sql="$ol_arg"
2010
2011 else
2012         ol_enable_sql="no"
2013 fi
2014 # end --enable-sql
2015 # OpenLDAP --with-sql_module
2016         # Check whether --with-sql_module or --without-sql_module was given.
2017 if test "${with_sql_module+set}" = set; then
2018   withval="$with_sql_module"
2019   
2020         ol_arg=invalid
2021         for ol_val in static dynamic ; do
2022                 if test "$withval" = "$ol_val" ; then
2023                         ol_arg="$ol_val"
2024                 fi
2025         done
2026         if test "$ol_arg" = "invalid" ; then
2027                 { echo "configure: error: bad value $withval for --with-sql_module" 1>&2; exit 1; }
2028         fi
2029         ol_with_sql_module="$ol_arg"
2030
2031 else
2032         ol_with_sql_module="static"
2033 fi
2034 # end --with-sql_module
2035
2036
2037 # Check whether --with-xxslurpdoptions or --without-xxslurpdoptions was given.
2038 if test "${with_xxslurpdoptions+set}" = set; then
2039   withval="$with_xxslurpdoptions"
2040   :
2041 fi
2042
2043 # OpenLDAP --enable-slurpd
2044         # Check whether --enable-slurpd or --disable-slurpd was given.
2045 if test "${enable_slurpd+set}" = set; then
2046   enableval="$enable_slurpd"
2047   
2048         ol_arg=invalid
2049         for ol_val in auto yes no ; do
2050                 if test "$enableval" = "$ol_val" ; then
2051                         ol_arg="$ol_val"
2052                 fi
2053         done
2054         if test "$ol_arg" = "invalid" ; then
2055                 { echo "configure: error: bad value $enableval for --enable-slurpd" 1>&2; exit 1; }
2056         fi
2057         ol_enable_slurpd="$ol_arg"
2058
2059 else
2060         ol_enable_slurpd="auto"
2061 fi
2062 # end --enable-slurpd
2063
2064 # Check whether --with-xxliboptions or --without-xxliboptions was given.
2065 if test "${with_xxliboptions+set}" = set; then
2066   withval="$with_xxliboptions"
2067   :
2068 fi
2069
2070 # Check whether --enable-static or --disable-static was given.
2071 if test "${enable_static+set}" = set; then
2072   enableval="$enable_static"
2073   p=${PACKAGE-default}
2074 case "$enableval" in
2075 yes) enable_static=yes ;;
2076 no) enable_static=no ;;
2077 *)
2078   enable_static=no
2079   # Look at the argument we got.  We use all the common list separators.
2080   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2081   for pkg in $enableval; do
2082     if test "X$pkg" = "X$p"; then
2083       enable_static=yes
2084     fi
2085   done
2086   IFS="$ac_save_ifs"
2087   ;;
2088 esac
2089 else
2090   enable_static=yes
2091 fi
2092
2093 # Check whether --enable-shared or --disable-shared was given.
2094 if test "${enable_shared+set}" = set; then
2095   enableval="$enable_shared"
2096   p=${PACKAGE-default}
2097 case "$enableval" in
2098 yes) enable_shared=yes ;;
2099 no) enable_shared=no ;;
2100 *)
2101   enable_shared=no
2102   # Look at the argument we got.  We use all the common list separators.
2103   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2104   for pkg in $enableval; do
2105     if test "X$pkg" = "X$p"; then
2106       enable_shared=yes
2107     fi
2108   done
2109   IFS="$ac_save_ifs"
2110   ;;
2111 esac
2112 else
2113   enable_shared=yes
2114 fi
2115
2116
2117
2118 # validate options
2119 if test $ol_enable_slapd = no ; then
2120                 if test $ol_enable_dnssrv = yes ; then
2121                 echo "configure: warning: slapd disabled, ignoring --enable-dnssrv argument" 1>&2
2122         fi
2123         if test $ol_enable_ldap = yes ; then
2124                 echo "configure: warning: slapd disabled, ignoring --enable-ldap argument" 1>&2
2125         fi
2126         if test $ol_enable_ldbm = yes ; then
2127                 echo "configure: warning: slapd disabled, ignoring --enable-ldbm argument" 1>&2
2128         fi
2129         if test $ol_enable_passwd = yes ; then
2130                 echo "configure: warning: slapd disabled, ignoring --enable-passwd argument" 1>&2
2131         fi
2132         if test $ol_enable_shell = yes ; then
2133                 echo "configure: warning: slapd disabled, ignoring --enable-shell argument" 1>&2
2134         fi
2135         if test $ol_enable_sql = yes ; then
2136                 echo "configure: warning: slapd disabled, ignoring --enable-sql argument" 1>&2
2137         fi
2138         if test $ol_enable_modules = yes ; then
2139                 echo "configure: warning: slapd disabled, ignoring --enable-modules argument" 1>&2
2140         fi
2141         if test $ol_enable_multimaster = yes ; then
2142                 echo "configure: warning: slapd disabled, ignoring --enable-multimaster argument" 1>&2
2143         fi
2144         if test $ol_enable_wrappers = yes ; then
2145                 echo "configure: warning: slapd disabled, ignoring --enable-wrappers argument" 1>&2
2146         fi
2147         if test $ol_enable_phonetic = yes ; then
2148                 echo "configure: warning: slapd disabled, ignoring --enable-phonetic argument" 1>&2
2149         fi
2150         if test $ol_enable_rlookups = yes ; then
2151                 echo "configure: warning: slapd disabled, ignoring --enable-rlookups argument" 1>&2
2152         fi
2153         if test $ol_enable_aci = yes ; then
2154                 echo "configure: warning: slapd disabled, ignoring --enable-aci argument" 1>&2
2155         fi
2156         if test $ol_with_ldbm_api != auto ; then
2157                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-api argument" 1>&2
2158         fi
2159         if test $ol_with_ldbm_type != auto ; then
2160                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-type argument" 1>&2
2161         fi
2162         if test $ol_with_dnssrv_module != static ; then
2163                 echo "configure: warning: slapd disabled, ignoring --with-dnssrv-module argument" 1>&2
2164         fi
2165         if test $ol_with_ldap_module != static ; then
2166                 echo "configure: warning: slapd disabled, ignoring --with-ldap-module argument" 1>&2
2167         fi
2168         if test $ol_with_ldbm_module != static ; then
2169                 echo "configure: warning: slapd disabled, ignoring --with-ldbm-module argument" 1>&2
2170         fi
2171         if test $ol_with_passwd_module != static ; then
2172                 echo "configure: warning: slapd disabled, ignoring --with-passwd-module argument" 1>&2
2173         fi
2174         if test $ol_with_shell_module != static ; then
2175                 echo "configure: warning: slapd disabled, ignoring --with-shell-module argument" 1>&2
2176         fi
2177         if test $ol_with_sql_module != static ; then
2178                 echo "configure: warning: slapd disabled, ignoring --with-sql-module argument" 1>&2
2179         fi
2180         if test $ol_enable_slurpd = yes ; then
2181                 { echo "configure: error: slurpd requires slapd" 1>&2; exit 1; }
2182         fi
2183
2184         # force settings to no
2185         ol_enable_dnssrv=no
2186         ol_enable_ldap=no
2187         ol_enable_ldbm=no
2188         ol_enable_passwd=no
2189         ol_enable_shell=no
2190         ol_enable_sql=no
2191
2192         ol_enable_modules=no
2193         ol_enable_multimaster=no
2194         ol_enable_phonetic=no
2195         ol_enable_rlookups=no
2196         ol_enable_aci=no
2197         ol_enable_wrappers=no
2198         ol_enable_dynamic=no
2199
2200         ol_with_ldbm_api=no
2201         ol_with_ldbm_type=no
2202
2203         ol_with_dnssrv_module=static
2204         ol_with_ldap_module=static
2205         ol_with_ldbm_module=static
2206         ol_with_passwd_module=static
2207         ol_with_shell_module=static
2208         ol_with_sql_module=static
2209
2210         ol_enable_slurpd=no
2211
2212 elif test $ol_enable_ldbm = no ; then
2213         
2214         if test $ol_with_ldbm_api != auto ; then
2215                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-api argument" 1>&2
2216         fi
2217
2218         if test $ol_with_ldbm_type != auto ; then
2219                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-type argument" 1>&2
2220         fi
2221
2222         if test $ol_with_ldbm_module != static ; then
2223                 echo "configure: warning: LDBM disabled, ignoring --with-ldbm-module argument" 1>&2
2224         fi
2225
2226         if test $ol_enable_modules != yes -a \
2227                 $ol_enable_dnssrv = no -a \
2228                 $ol_enable_ldap = no -a \
2229                 $ol_enable_passwd = no -a \
2230                 $ol_enable_shell = no -a \
2231                 $ol_enable_sql = no ; then
2232                 { echo "configure: error: slapd requires a backend" 1>&2; exit 1; }
2233         fi
2234
2235         ol_with_ldbm_api=no
2236         ol_with_ldbm_type=no
2237         ol_with_ldbm_module=static
2238
2239 else
2240                 if test $ol_with_ldbm_api = gdbm -a \
2241                 $ol_with_ldbm_type = btree ; then
2242                 { echo "configure: error: GDBM only supports LDBM type hash" 1>&2; exit 1; }
2243         fi
2244         if test $ol_with_ldbm_api = mdbm -a \
2245                 $ol_with_ldbm_type = btree ; then
2246                 { echo "configure: error: MDBM only supports LDBM type hash" 1>&2; exit 1; }
2247         fi
2248         if test $ol_with_ldbm_api = ndbm -a \
2249                 $ol_with_ldbm_type = btree ; then
2250                 { echo "configure: error: NDBM only supports LDBM type hash" 1>&2; exit 1; }
2251         fi
2252 fi
2253
2254 if test $ol_enable_slurpd = yes ; then
2255                 if test $ol_with_threads = no ; then
2256                 { echo "configure: error: slurpd requires threads" 1>&2; exit 1; }
2257         fi
2258 fi
2259
2260 if test $ol_enable_kbind = yes -o $ol_enable_kpasswd = yes ; then
2261         if test $ol_with_kerberos = no ; then
2262                 { echo "configure: error: options require --with-kerberos" 1>&2; exit 1; }
2263         fi
2264         ol_with_kerberos=yes
2265 elif test $ol_enable_kbind = no -o $ol_enable_kpasswd = no ; then
2266         if test $ol_with_kerberos != no -a $ol_with_kerberos != auto ; then
2267                 echo "configure: warning: Kerberos detection enabled unnecessarily" 1>&2;
2268         fi
2269         ol_with_kerberos=no
2270 fi
2271
2272 if test $ol_enable_spasswd = yes ; then
2273         if test $ol_with_cyrus_sasl = no ; then
2274                 { echo "configure: error: options require --with-cyrus-sasl" 1>&2; exit 1; }
2275         fi
2276         ol_with_cyrus_sasl=yes
2277 fi
2278
2279 echo "$ac_t""done" 1>&6
2280
2281 LDAP_LIBS=
2282 LDIF_LIBS=
2283 LDBM_LIBS=
2284 LTHREAD_LIBS=
2285 LUTIL_LIBS=
2286
2287 SLAPD_LIBS=
2288 SLURPD_LIBS=
2289
2290 BUILD_SLAPD=no
2291 BUILD_SLURPD=no
2292
2293 BUILD_THREAD=no
2294
2295 BUILD_DNSSRV=no
2296 BUILD_LDAP=no
2297 BUILD_LDBM=no
2298 BUILD_PASSWD=no
2299 BUILD_SHELL=no
2300 BUILD_SQL=no
2301
2302 BUILD_DNSSRV_DYNAMIC=static
2303 BUILD_LDAP_DYNAMIC=static
2304 BUILD_LDBM_DYNAMIC=static
2305 BUILD_PASSWD_DYNAMIC=static
2306 BUILD_SHELL_DYNAMIC=static
2307 BUILD_SQL_DYNAMIC=static
2308
2309 SLAPD_MODULES_LDFLAGS=
2310 SLAPD_MODULES_CPPFLAGS=
2311 SLAPD_MODULES_LIST=
2312
2313 SLAPD_SQL_LDFLAGS=
2314 SLAPD_SQL_LIBS=
2315 SLAPD_SQL_INCLUDES=
2316
2317 KRB4_LIBS=
2318 KRB5_LIBS=
2319 READLINE_LIBS=
2320 SASL_LIBS=
2321 TERMCAP_LIBS=
2322 TLS_LIBS=
2323 MODULES_LIBS=
2324 AUTH_LIBS=
2325
2326
2327
2328 cat >> confdefs.h <<\EOF
2329 #define HAVE_MKVERSION 1
2330 EOF
2331
2332
2333
2334
2335 ol_aix_threads=no
2336 case "$target" in
2337 *-*-aix*)       if test -z "$CC" ; then
2338                 case "$ol_with_threads" in
2339                 auto | yes |  posix) ol_aix_threads=yes ;;
2340                 esac
2341         fi
2342 ;;
2343 esac
2344
2345 if test $ol_aix_threads = yes ; then
2346         if test -z "${CC}" ; then
2347                 for ac_prog in cc_r xlc_r cc
2348 do
2349 # Extract the first word of "$ac_prog", so it can be a program name with args.
2350 set dummy $ac_prog; ac_word=$2
2351 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2352 echo "configure:2353: checking for $ac_word" >&5
2353 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2354   echo $ac_n "(cached) $ac_c" 1>&6
2355 else
2356   if test -n "$CC"; then
2357   ac_cv_prog_CC="$CC" # Let the user override the test.
2358 else
2359   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2360   ac_dummy="$PATH"
2361   for ac_dir in $ac_dummy; do
2362     test -z "$ac_dir" && ac_dir=.
2363     if test -f $ac_dir/$ac_word; then
2364       ac_cv_prog_CC="$ac_prog"
2365       break
2366     fi
2367   done
2368   IFS="$ac_save_ifs"
2369 fi
2370 fi
2371 CC="$ac_cv_prog_CC"
2372 if test -n "$CC"; then
2373   echo "$ac_t""$CC" 1>&6
2374 else
2375   echo "$ac_t""no" 1>&6
2376 fi
2377
2378 test -n "$CC" && break
2379 done
2380
2381
2382                 if test "$CC" = cc ; then
2383                                                 if test $ol_with_threads != auto ; then
2384                                 { echo "configure: error: --with-threads requires cc_r (or other suitable compiler) on AIX" 1>&2; exit 1; }
2385                         else
2386                                 echo "configure: warning: disabling threads, no cc_r on AIX" 1>&2
2387                         fi
2388                         ol_with_threads=no
2389                 fi
2390         fi
2391
2392         if test "${CC}" = "cc_r" -o "${CC}" = "xlc_r" ; then
2393                 ol_with_threads=posix
2394                 ol_cv_pthread_create=yes
2395         fi
2396 fi
2397
2398 if test -z "${CC}"; then
2399         for ac_prog in cc
2400 do
2401 # Extract the first word of "$ac_prog", so it can be a program name with args.
2402 set dummy $ac_prog; ac_word=$2
2403 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2404 echo "configure:2405: checking for $ac_word" >&5
2405 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2406   echo $ac_n "(cached) $ac_c" 1>&6
2407 else
2408   if test -n "$CC"; then
2409   ac_cv_prog_CC="$CC" # Let the user override the test.
2410 else
2411   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2412   ac_dummy="$PATH"
2413   for ac_dir in $ac_dummy; do
2414     test -z "$ac_dir" && ac_dir=.
2415     if test -f $ac_dir/$ac_word; then
2416       ac_cv_prog_CC="$ac_prog"
2417       break
2418     fi
2419   done
2420   IFS="$ac_save_ifs"
2421 fi
2422 fi
2423 CC="$ac_cv_prog_CC"
2424 if test -n "$CC"; then
2425   echo "$ac_t""$CC" 1>&6
2426 else
2427   echo "$ac_t""no" 1>&6
2428 fi
2429
2430 test -n "$CC" && break
2431 done
2432
2433 fi
2434
2435
2436
2437
2438 # Check whether --enable-fast-install or --disable-fast-install was given.
2439 if test "${enable_fast_install+set}" = set; then
2440   enableval="$enable_fast_install"
2441   p=${PACKAGE-default}
2442 case "$enableval" in
2443 yes) enable_fast_install=yes ;;
2444 no) enable_fast_install=no ;;
2445 *)
2446   enable_fast_install=no
2447   # Look at the argument we got.  We use all the common list separators.
2448   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
2449   for pkg in $enableval; do
2450     if test "X$pkg" = "X$p"; then
2451       enable_fast_install=yes
2452     fi
2453   done
2454   IFS="$ac_save_ifs"
2455   ;;
2456 esac
2457 else
2458   enable_fast_install=yes
2459 fi
2460
2461 # Extract the first word of "ranlib", so it can be a program name with args.
2462 set dummy ranlib; ac_word=$2
2463 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2464 echo "configure:2465: checking for $ac_word" >&5
2465 if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
2466   echo $ac_n "(cached) $ac_c" 1>&6
2467 else
2468   if test -n "$RANLIB"; then
2469   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2470 else
2471   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2472   ac_dummy="$PATH"
2473   for ac_dir in $ac_dummy; do
2474     test -z "$ac_dir" && ac_dir=.
2475     if test -f $ac_dir/$ac_word; then
2476       ac_cv_prog_RANLIB="ranlib"
2477       break
2478     fi
2479   done
2480   IFS="$ac_save_ifs"
2481   test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
2482 fi
2483 fi
2484 RANLIB="$ac_cv_prog_RANLIB"
2485 if test -n "$RANLIB"; then
2486   echo "$ac_t""$RANLIB" 1>&6
2487 else
2488   echo "$ac_t""no" 1>&6
2489 fi
2490
2491 # Extract the first word of "gcc", so it can be a program name with args.
2492 set dummy gcc; ac_word=$2
2493 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2494 echo "configure:2495: checking for $ac_word" >&5
2495 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2496   echo $ac_n "(cached) $ac_c" 1>&6
2497 else
2498   if test -n "$CC"; then
2499   ac_cv_prog_CC="$CC" # Let the user override the test.
2500 else
2501   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2502   ac_dummy="$PATH"
2503   for ac_dir in $ac_dummy; do
2504     test -z "$ac_dir" && ac_dir=.
2505     if test -f $ac_dir/$ac_word; then
2506       ac_cv_prog_CC="gcc"
2507       break
2508     fi
2509   done
2510   IFS="$ac_save_ifs"
2511 fi
2512 fi
2513 CC="$ac_cv_prog_CC"
2514 if test -n "$CC"; then
2515   echo "$ac_t""$CC" 1>&6
2516 else
2517   echo "$ac_t""no" 1>&6
2518 fi
2519
2520 if test -z "$CC"; then
2521   # Extract the first word of "cc", so it can be a program name with args.
2522 set dummy cc; ac_word=$2
2523 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2524 echo "configure:2525: checking for $ac_word" >&5
2525 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2526   echo $ac_n "(cached) $ac_c" 1>&6
2527 else
2528   if test -n "$CC"; then
2529   ac_cv_prog_CC="$CC" # Let the user override the test.
2530 else
2531   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2532   ac_prog_rejected=no
2533   ac_dummy="$PATH"
2534   for ac_dir in $ac_dummy; do
2535     test -z "$ac_dir" && ac_dir=.
2536     if test -f $ac_dir/$ac_word; then
2537       if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
2538         ac_prog_rejected=yes
2539         continue
2540       fi
2541       ac_cv_prog_CC="cc"
2542       break
2543     fi
2544   done
2545   IFS="$ac_save_ifs"
2546 if test $ac_prog_rejected = yes; then
2547   # We found a bogon in the path, so make sure we never use it.
2548   set dummy $ac_cv_prog_CC
2549   shift
2550   if test $# -gt 0; then
2551     # We chose a different compiler from the bogus one.
2552     # However, it has the same basename, so the bogon will be chosen
2553     # first if we set CC to just the basename; use the full file name.
2554     shift
2555     set dummy "$ac_dir/$ac_word" "$@"
2556     shift
2557     ac_cv_prog_CC="$@"
2558   fi
2559 fi
2560 fi
2561 fi
2562 CC="$ac_cv_prog_CC"
2563 if test -n "$CC"; then
2564   echo "$ac_t""$CC" 1>&6
2565 else
2566   echo "$ac_t""no" 1>&6
2567 fi
2568
2569   if test -z "$CC"; then
2570     case "`uname -s`" in
2571     *win32* | *WIN32* | *CYGWIN*)
2572       # Extract the first word of "cl", so it can be a program name with args.
2573 set dummy cl; ac_word=$2
2574 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2575 echo "configure:2576: checking for $ac_word" >&5
2576 if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
2577   echo $ac_n "(cached) $ac_c" 1>&6
2578 else
2579   if test -n "$CC"; then
2580   ac_cv_prog_CC="$CC" # Let the user override the test.
2581 else
2582   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2583   ac_dummy="$PATH"
2584   for ac_dir in $ac_dummy; do
2585     test -z "$ac_dir" && ac_dir=.
2586     if test -f $ac_dir/$ac_word; then
2587       ac_cv_prog_CC="cl"
2588       break
2589     fi
2590   done
2591   IFS="$ac_save_ifs"
2592 fi
2593 fi
2594 CC="$ac_cv_prog_CC"
2595 if test -n "$CC"; then
2596   echo "$ac_t""$CC" 1>&6
2597 else
2598   echo "$ac_t""no" 1>&6
2599 fi
2600  ;;
2601     esac
2602   fi
2603   test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
2604 fi
2605
2606 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works""... $ac_c" 1>&6
2607 echo "configure:2608: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" >&5
2608
2609 ac_ext=c
2610 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2611 ac_cpp='$CPP $CPPFLAGS'
2612 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2613 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2614 cross_compiling=$ac_cv_prog_cc_cross
2615
2616 cat > conftest.$ac_ext << EOF
2617
2618 #line 2619 "configure"
2619 #include "confdefs.h"
2620
2621 main(){return(0);}
2622 EOF
2623 if { (eval echo configure:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2624   ac_cv_prog_cc_works=yes
2625   # If we can't run a trivial program, we are probably using a cross compiler.
2626   if (./conftest; exit) 2>/dev/null; then
2627     ac_cv_prog_cc_cross=no
2628   else
2629     ac_cv_prog_cc_cross=yes
2630   fi
2631 else
2632   echo "configure: failed program was:" >&5
2633   cat conftest.$ac_ext >&5
2634   ac_cv_prog_cc_works=no
2635 fi
2636 rm -fr conftest*
2637 ac_ext=c
2638 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
2639 ac_cpp='$CPP $CPPFLAGS'
2640 ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
2641 ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
2642 cross_compiling=$ac_cv_prog_cc_cross
2643
2644 echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
2645 if test $ac_cv_prog_cc_works = no; then
2646   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
2647 fi
2648 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
2649 echo "configure:2650: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" >&5
2650 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
2651 cross_compiling=$ac_cv_prog_cc_cross
2652
2653 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
2654 echo "configure:2655: checking whether we are using GNU C" >&5
2655 if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
2656   echo $ac_n "(cached) $ac_c" 1>&6
2657 else
2658   cat > conftest.c <<EOF
2659 #ifdef __GNUC__
2660   yes;
2661 #endif
2662 EOF
2663 if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
2664   ac_cv_prog_gcc=yes
2665 else
2666   ac_cv_prog_gcc=no
2667 fi
2668 fi
2669
2670 echo "$ac_t""$ac_cv_prog_gcc" 1>&6
2671
2672 if test $ac_cv_prog_gcc = yes; then
2673   GCC=yes
2674 else
2675   GCC=
2676 fi
2677
2678 ac_test_CFLAGS="${CFLAGS+set}"
2679 ac_save_CFLAGS="$CFLAGS"
2680 CFLAGS=
2681 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
2682 echo "configure:2683: checking whether ${CC-cc} accepts -g" >&5
2683 if eval "test \"\${ac_cv_prog_cc_g+set}\" = set"; then
2684   echo $ac_n "(cached) $ac_c" 1>&6
2685 else
2686   echo 'void f(){}' > conftest.c
2687 if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
2688   ac_cv_prog_cc_g=yes
2689 else
2690   ac_cv_prog_cc_g=no
2691 fi
2692 rm -f conftest*
2693
2694 fi
2695
2696 echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
2697 if test "$ac_test_CFLAGS" = set; then
2698   CFLAGS="$ac_save_CFLAGS"
2699 elif test $ac_cv_prog_cc_g = yes; then
2700   if test "$GCC" = yes; then
2701     CFLAGS="-g -O2"
2702   else
2703     CFLAGS="-g"
2704   fi
2705 else
2706   if test "$GCC" = yes; then
2707     CFLAGS="-O2"
2708   else
2709     CFLAGS=
2710   fi
2711 fi
2712
2713 # Check whether --with-gnu-ld or --without-gnu-ld was given.
2714 if test "${with_gnu_ld+set}" = set; then
2715   withval="$with_gnu_ld"
2716   test "$withval" = no || with_gnu_ld=yes
2717 else
2718   with_gnu_ld=no
2719 fi
2720
2721 ac_prog=ld
2722 if test "$ac_cv_prog_gcc" = yes; then
2723   # Check if gcc -print-prog-name=ld gives a path.
2724   echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
2725 echo "configure:2726: checking for ld used by GCC" >&5
2726   ac_prog=`($CC -print-prog-name=ld) 2>&5`
2727   case "$ac_prog" in
2728     # Accept absolute paths.
2729     [\\/]* | [A-Za-z]:[\\/]*)
2730       re_direlt='/[^/][^/]*/\.\./'
2731       # Canonicalize the path of ld
2732       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2733       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2734         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2735       done
2736       test -z "$LD" && LD="$ac_prog"
2737       ;;
2738   "")
2739     # If it fails, then pretend we aren't using GCC.
2740     ac_prog=ld
2741     ;;
2742   *)
2743     # If it is relative, then search for the first ld in PATH.
2744     with_gnu_ld=unknown
2745     ;;
2746   esac
2747 elif test "$with_gnu_ld" = yes; then
2748   echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
2749 echo "configure:2750: checking for GNU ld" >&5
2750 else
2751   echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
2752 echo "configure:2753: checking for non-GNU ld" >&5
2753 fi
2754 if eval "test \"\${ac_cv_path_LD+set}\" = set"; then
2755   echo $ac_n "(cached) $ac_c" 1>&6
2756 else
2757   if test -z "$LD"; then
2758   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2759   for ac_dir in $PATH; do
2760     test -z "$ac_dir" && ac_dir=.
2761     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2762       ac_cv_path_LD="$ac_dir/$ac_prog"
2763       # Check to see if the program is GNU ld.  I'd rather use --version,
2764       # but apparently some GNU ld's only accept -v.
2765       # Break only if it was the GNU/non-GNU ld that we prefer.
2766       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2767         test "$with_gnu_ld" != no && break
2768       else
2769         test "$with_gnu_ld" != yes && break
2770       fi
2771     fi
2772   done
2773   IFS="$ac_save_ifs"
2774 else
2775   ac_cv_path_LD="$LD" # Let the user override the test with a path.
2776 fi
2777 fi
2778
2779 LD="$ac_cv_path_LD"
2780 if test -n "$LD"; then
2781   echo "$ac_t""$LD" 1>&6
2782 else
2783   echo "$ac_t""no" 1>&6
2784 fi
2785 test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
2786 echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
2787 echo "configure:2788: checking if the linker ($LD) is GNU ld" >&5
2788 if eval "test \"\${ac_cv_prog_gnu_ld+set}\" = set"; then
2789   echo $ac_n "(cached) $ac_c" 1>&6
2790 else
2791   # I'd rather use --version here, but apparently some GNU ld's only accept -v.
2792 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2793   ac_cv_prog_gnu_ld=yes
2794 else
2795   ac_cv_prog_gnu_ld=no
2796 fi
2797 fi
2798
2799 echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
2800
2801
2802 echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
2803 echo "configure:2804: checking for BSD-compatible nm" >&5
2804 if eval "test \"\${ac_cv_path_NM+set}\" = set"; then
2805   echo $ac_n "(cached) $ac_c" 1>&6
2806 else
2807   if test -n "$NM"; then
2808   # Let the user override the test.
2809   ac_cv_path_NM="$NM"
2810 else
2811   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2812   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
2813     test -z "$ac_dir" && ac_dir=.
2814     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
2815       # Check to see if the nm accepts a BSD-compat flag.
2816       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
2817       #   nm: unknown option "B" ignored
2818       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2819         ac_cv_path_NM="$ac_dir/nm -B"
2820         break
2821       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
2822         ac_cv_path_NM="$ac_dir/nm -p"
2823         break
2824       else
2825         ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
2826         continue # so that we can try to find one that supports BSD flags
2827       fi
2828     fi
2829   done
2830   IFS="$ac_save_ifs"
2831   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
2832 fi
2833 fi
2834
2835 NM="$ac_cv_path_NM"
2836 echo "$ac_t""$NM" 1>&6
2837
2838 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
2839 echo "configure:2840: checking whether ln -s works" >&5
2840 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
2841   echo $ac_n "(cached) $ac_c" 1>&6
2842 else
2843   rm -f conftestdata
2844 if ln -s X conftestdata 2>/dev/null
2845 then
2846   rm -f conftestdata
2847   ac_cv_prog_LN_S="ln -s"
2848 else
2849   ac_cv_prog_LN_S=ln
2850 fi
2851 fi
2852 LN_S="$ac_cv_prog_LN_S"
2853 if test "$ac_cv_prog_LN_S" = "ln -s"; then
2854   echo "$ac_t""yes" 1>&6
2855 else
2856   echo "$ac_t""no" 1>&6
2857 fi
2858
2859 if test $host != $build; then
2860   ac_tool_prefix=${host_alias}-
2861 else
2862   ac_tool_prefix=
2863 fi
2864
2865
2866 case "$target" in
2867 NONE) lt_target="$host" ;;
2868 *) lt_target="$target" ;;
2869 esac
2870
2871 # Check for any special flags to pass to ltconfig.
2872 libtool_flags="--cache-file=$cache_file"
2873 test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
2874 test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
2875 test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
2876 test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
2877 test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
2878 libtool_flags="$libtool_flags --enable-dlopen"
2879 libtool_flags="$libtool_flags --enable-win32-dll"
2880 # Check whether --enable-libtool-lock or --disable-libtool-lock was given.
2881 if test "${enable_libtool_lock+set}" = set; then
2882   enableval="$enable_libtool_lock"
2883   :
2884 fi
2885
2886 test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
2887 test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
2888
2889 # Some flags need to be propagated to the compiler or linker for good
2890 # libtool support.
2891 case "$lt_target" in
2892 *-*-irix6*)
2893   # Find out which ABI we are using.
2894   echo '#line 2895 "configure"' > conftest.$ac_ext
2895   if { (eval echo configure:2896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
2896     case "`/usr/bin/file conftest.o`" in
2897     *32-bit*)
2898       LD="${LD-ld} -32"
2899       ;;
2900     *N32*)
2901       LD="${LD-ld} -n32"
2902       ;;
2903     *64-bit*)
2904       LD="${LD-ld} -64"
2905       ;;
2906     esac
2907   fi
2908   rm -rf conftest*
2909   ;;
2910
2911 *-*-sco3.2v5*)
2912   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
2913   SAVE_CFLAGS="$CFLAGS"
2914   CFLAGS="$CFLAGS -belf"
2915   echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
2916 echo "configure:2917: checking whether the C compiler needs -belf" >&5
2917 if eval "test \"\${lt_cv_cc_needs_belf+set}\" = set"; then
2918   echo $ac_n "(cached) $ac_c" 1>&6
2919 else
2920   cat > conftest.$ac_ext <<EOF
2921 #line 2922 "configure"
2922 #include "confdefs.h"
2923
2924 int main() {
2925
2926 ; return 0; }
2927 EOF
2928 if { (eval echo configure:2929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
2929   rm -rf conftest*
2930   lt_cv_cc_needs_belf=yes
2931 else
2932   echo "configure: failed program was:" >&5
2933   cat conftest.$ac_ext >&5
2934   rm -rf conftest*
2935   lt_cv_cc_needs_belf=no
2936 fi
2937 rm -f conftest*
2938 fi
2939
2940 echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6
2941   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
2942     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
2943     CFLAGS="$SAVE_CFLAGS"
2944   fi
2945   ;;
2946
2947 *-*-cygwin* | *-*-mingw*)
2948   # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
2949 set dummy ${ac_tool_prefix}dlltool; ac_word=$2
2950 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2951 echo "configure:2952: checking for $ac_word" >&5
2952 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2953   echo $ac_n "(cached) $ac_c" 1>&6
2954 else
2955   if test -n "$DLLTOOL"; then
2956   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2957 else
2958   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2959   ac_dummy="$PATH"
2960   for ac_dir in $ac_dummy; do
2961     test -z "$ac_dir" && ac_dir=.
2962     if test -f $ac_dir/$ac_word; then
2963       ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
2964       break
2965     fi
2966   done
2967   IFS="$ac_save_ifs"
2968 fi
2969 fi
2970 DLLTOOL="$ac_cv_prog_DLLTOOL"
2971 if test -n "$DLLTOOL"; then
2972   echo "$ac_t""$DLLTOOL" 1>&6
2973 else
2974   echo "$ac_t""no" 1>&6
2975 fi
2976
2977
2978 if test -z "$ac_cv_prog_DLLTOOL"; then
2979 if test -n "$ac_tool_prefix"; then
2980   # Extract the first word of "dlltool", so it can be a program name with args.
2981 set dummy dlltool; ac_word=$2
2982 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
2983 echo "configure:2984: checking for $ac_word" >&5
2984 if eval "test \"\${ac_cv_prog_DLLTOOL+set}\" = set"; then
2985   echo $ac_n "(cached) $ac_c" 1>&6
2986 else
2987   if test -n "$DLLTOOL"; then
2988   ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
2989 else
2990   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
2991   ac_dummy="$PATH"
2992   for ac_dir in $ac_dummy; do
2993     test -z "$ac_dir" && ac_dir=.
2994     if test -f $ac_dir/$ac_word; then
2995       ac_cv_prog_DLLTOOL="dlltool"
2996       break
2997     fi
2998   done
2999   IFS="$ac_save_ifs"
3000   test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
3001 fi
3002 fi
3003 DLLTOOL="$ac_cv_prog_DLLTOOL"
3004 if test -n "$DLLTOOL"; then
3005   echo "$ac_t""$DLLTOOL" 1>&6
3006 else
3007   echo "$ac_t""no" 1>&6
3008 fi
3009
3010 else
3011   DLLTOOL="false"
3012 fi
3013 fi
3014
3015   # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
3016 set dummy ${ac_tool_prefix}as; ac_word=$2
3017 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3018 echo "configure:3019: checking for $ac_word" >&5
3019 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3020   echo $ac_n "(cached) $ac_c" 1>&6
3021 else
3022   if test -n "$AS"; then
3023   ac_cv_prog_AS="$AS" # Let the user override the test.
3024 else
3025   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3026   ac_dummy="$PATH"
3027   for ac_dir in $ac_dummy; do
3028     test -z "$ac_dir" && ac_dir=.
3029     if test -f $ac_dir/$ac_word; then
3030       ac_cv_prog_AS="${ac_tool_prefix}as"
3031       break
3032     fi
3033   done
3034   IFS="$ac_save_ifs"
3035 fi
3036 fi
3037 AS="$ac_cv_prog_AS"
3038 if test -n "$AS"; then
3039   echo "$ac_t""$AS" 1>&6
3040 else
3041   echo "$ac_t""no" 1>&6
3042 fi
3043
3044
3045 if test -z "$ac_cv_prog_AS"; then
3046 if test -n "$ac_tool_prefix"; then
3047   # Extract the first word of "as", so it can be a program name with args.
3048 set dummy as; ac_word=$2
3049 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3050 echo "configure:3051: checking for $ac_word" >&5
3051 if eval "test \"\${ac_cv_prog_AS+set}\" = set"; then
3052   echo $ac_n "(cached) $ac_c" 1>&6
3053 else
3054   if test -n "$AS"; then
3055   ac_cv_prog_AS="$AS" # Let the user override the test.
3056 else
3057   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3058   ac_dummy="$PATH"
3059   for ac_dir in $ac_dummy; do
3060     test -z "$ac_dir" && ac_dir=.
3061     if test -f $ac_dir/$ac_word; then
3062       ac_cv_prog_AS="as"
3063       break
3064     fi
3065   done
3066   IFS="$ac_save_ifs"
3067   test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
3068 fi
3069 fi
3070 AS="$ac_cv_prog_AS"
3071 if test -n "$AS"; then
3072   echo "$ac_t""$AS" 1>&6
3073 else
3074   echo "$ac_t""no" 1>&6
3075 fi
3076
3077 else
3078   AS="false"
3079 fi
3080 fi
3081
3082   # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
3083 set dummy ${ac_tool_prefix}objdump; ac_word=$2
3084 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3085 echo "configure:3086: checking for $ac_word" >&5
3086 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3087   echo $ac_n "(cached) $ac_c" 1>&6
3088 else
3089   if test -n "$OBJDUMP"; then
3090   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3091 else
3092   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3093   ac_dummy="$PATH"
3094   for ac_dir in $ac_dummy; do
3095     test -z "$ac_dir" && ac_dir=.
3096     if test -f $ac_dir/$ac_word; then
3097       ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
3098       break
3099     fi
3100   done
3101   IFS="$ac_save_ifs"
3102 fi
3103 fi
3104 OBJDUMP="$ac_cv_prog_OBJDUMP"
3105 if test -n "$OBJDUMP"; then
3106   echo "$ac_t""$OBJDUMP" 1>&6
3107 else
3108   echo "$ac_t""no" 1>&6
3109 fi
3110
3111
3112 if test -z "$ac_cv_prog_OBJDUMP"; then
3113 if test -n "$ac_tool_prefix"; then
3114   # Extract the first word of "objdump", so it can be a program name with args.
3115 set dummy objdump; ac_word=$2
3116 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3117 echo "configure:3118: checking for $ac_word" >&5
3118 if eval "test \"\${ac_cv_prog_OBJDUMP+set}\" = set"; then
3119   echo $ac_n "(cached) $ac_c" 1>&6
3120 else
3121   if test -n "$OBJDUMP"; then
3122   ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
3123 else
3124   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3125   ac_dummy="$PATH"
3126   for ac_dir in $ac_dummy; do
3127     test -z "$ac_dir" && ac_dir=.
3128     if test -f $ac_dir/$ac_word; then
3129       ac_cv_prog_OBJDUMP="objdump"
3130       break
3131     fi
3132   done
3133   IFS="$ac_save_ifs"
3134   test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
3135 fi
3136 fi
3137 OBJDUMP="$ac_cv_prog_OBJDUMP"
3138 if test -n "$OBJDUMP"; then
3139   echo "$ac_t""$OBJDUMP" 1>&6
3140 else
3141   echo "$ac_t""no" 1>&6
3142 fi
3143
3144 else
3145   OBJDUMP="false"
3146 fi
3147 fi
3148
3149   ;;
3150
3151 esac
3152
3153
3154 # Save cache, so that ltconfig can load it
3155
3156
3157 # Actually configure libtool.  ac_aux_dir is where install-sh is found.
3158 CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
3159 LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
3160 LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
3161 DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
3162 ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
3163 $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
3164 || { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
3165
3166 # Reload cache, that may have been modified by ltconfig
3167
3168
3169 # This can be used to rebuild libtool when needed
3170 LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
3171
3172 # Always use our own libtool.
3173 LIBTOOL='$(SHELL) $(top_builddir)/libtool'
3174
3175 # Redirect the config.log output again, so that the ltconfig log is not
3176 # clobbered by the next message.
3177 exec 5>>./config.log
3178
3179
3180 for ac_prog in mawk gawk nawk awk
3181 do
3182 # Extract the first word of "$ac_prog", so it can be a program name with args.
3183 set dummy $ac_prog; ac_word=$2
3184 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3185 echo "configure:3186: checking for $ac_word" >&5
3186 if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
3187   echo $ac_n "(cached) $ac_c" 1>&6
3188 else
3189   if test -n "$AWK"; then
3190   ac_cv_prog_AWK="$AWK" # Let the user override the test.
3191 else
3192   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3193   ac_dummy="$PATH"
3194   for ac_dir in $ac_dummy; do
3195     test -z "$ac_dir" && ac_dir=.
3196     if test -f $ac_dir/$ac_word; then
3197       ac_cv_prog_AWK="$ac_prog"
3198       break
3199     fi
3200   done
3201   IFS="$ac_save_ifs"
3202 fi
3203 fi
3204 AWK="$ac_cv_prog_AWK"
3205 if test -n "$AWK"; then
3206   echo "$ac_t""$AWK" 1>&6
3207 else
3208   echo "$ac_t""no" 1>&6
3209 fi
3210
3211 test -n "$AWK" && break
3212 done
3213
3214 # test for ln hardlink support
3215 echo $ac_n "checking whether ln works""... $ac_c" 1>&6
3216 echo "configure:3217: checking whether ln works" >&5
3217 if eval "test \"\${ol_cv_prog_LN_H+set}\" = set"; then
3218   echo $ac_n "(cached) $ac_c" 1>&6
3219 else
3220   rm -f conftest.src conftest.dst
3221 echo "conftest" > conftest.src
3222 if ln conftest.src conftest.dst 2>/dev/null
3223 then
3224   ol_cv_prog_LN_H="ln"
3225 else
3226   ol_cv_prog_LN_H="cp"
3227 fi
3228 rm -f conftest.src conftest.dst
3229
3230 fi
3231 LN_H="$ol_cv_prog_LN_H"
3232 if test "$ol_cv_prog_LN_H" = "ln"; then
3233         echo "$ac_t""yes" 1>&6
3234 else
3235         echo "$ac_t""no" 1>&6
3236 fi
3237
3238 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
3239 echo "configure:3240: checking whether ln -s works" >&5
3240 if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
3241   echo $ac_n "(cached) $ac_c" 1>&6
3242 else
3243   rm -f conftestdata
3244 if ln -s X conftestdata 2>/dev/null
3245 then
3246   rm -f conftestdata
3247   ac_cv_prog_LN_S="ln -s"
3248 else
3249   ac_cv_prog_LN_S=ln
3250 fi
3251 fi
3252 LN_S="$ac_cv_prog_LN_S"
3253 if test "$ac_cv_prog_LN_S" = "ln -s"; then
3254   echo "$ac_t""yes" 1>&6
3255 else
3256   echo "$ac_t""no" 1>&6
3257 fi
3258
3259
3260 if test "$LN_H" = "cp" -a "$LN_S" = "ln"; then
3261         LN_S="$LN_H"
3262 fi
3263
3264 # Extract the first word of "sendmail", so it can be a program name with args.
3265 set dummy sendmail; ac_word=$2
3266 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3267 echo "configure:3268: checking for $ac_word" >&5
3268 if eval "test \"\${ac_cv_path_SENDMAIL+set}\" = set"; then
3269   echo $ac_n "(cached) $ac_c" 1>&6
3270 else
3271   case "$SENDMAIL" in
3272   /*)
3273   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a path.
3274   ;;
3275   ?:/*)
3276   ac_cv_path_SENDMAIL="$SENDMAIL" # Let the user override the test with a dos path.
3277   ;;
3278   *)
3279   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3280   ac_dummy="$PATH:/usr/libexec:/usr/lib:/usr/sbin:/usr/etc:/etc"
3281   for ac_dir in $ac_dummy; do 
3282     test -z "$ac_dir" && ac_dir=.
3283     if test -f $ac_dir/$ac_word; then
3284       ac_cv_path_SENDMAIL="$ac_dir/$ac_word"
3285       break
3286     fi
3287   done
3288   IFS="$ac_save_ifs"
3289   test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="/usr/lib/sendmail"
3290   ;;
3291 esac
3292 fi
3293 SENDMAIL="$ac_cv_path_SENDMAIL"
3294 if test -n "$SENDMAIL"; then
3295   echo "$ac_t""$SENDMAIL" 1>&6
3296 else
3297   echo "$ac_t""no" 1>&6
3298 fi
3299
3300 # Extract the first word of "vi", so it can be a program name with args.
3301 set dummy vi; ac_word=$2
3302 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3303 echo "configure:3304: checking for $ac_word" >&5
3304 if eval "test \"\${ac_cv_path_EDITOR+set}\" = set"; then
3305   echo $ac_n "(cached) $ac_c" 1>&6
3306 else
3307   case "$EDITOR" in
3308   /*)
3309   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a path.
3310   ;;
3311   ?:/*)
3312   ac_cv_path_EDITOR="$EDITOR" # Let the user override the test with a dos path.
3313   ;;
3314   *)
3315   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3316   ac_dummy="$PATH:/usr/ucb"
3317   for ac_dir in $ac_dummy; do 
3318     test -z "$ac_dir" && ac_dir=.
3319     if test -f $ac_dir/$ac_word; then
3320       ac_cv_path_EDITOR="$ac_dir/$ac_word"
3321       break
3322     fi
3323   done
3324   IFS="$ac_save_ifs"
3325   test -z "$ac_cv_path_EDITOR" && ac_cv_path_EDITOR="/usr/ucb/vi"
3326   ;;
3327 esac
3328 fi
3329 EDITOR="$ac_cv_path_EDITOR"
3330 if test -n "$EDITOR"; then
3331   echo "$ac_t""$EDITOR" 1>&6
3332 else
3333   echo "$ac_t""no" 1>&6
3334 fi
3335
3336 # Extract the first word of "finger", so it can be a program name with args.
3337 set dummy finger; ac_word=$2
3338 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
3339 echo "configure:3340: checking for $ac_word" >&5
3340 if eval "test \"\${ac_cv_path_FINGER+set}\" = set"; then
3341   echo $ac_n "(cached) $ac_c" 1>&6
3342 else
3343   case "$FINGER" in
3344   /*)
3345   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a path.
3346   ;;
3347   ?:/*)
3348   ac_cv_path_FINGER="$FINGER" # Let the user override the test with a dos path.
3349   ;;
3350   *)
3351   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
3352   ac_dummy="$PATH:/usr/ucb"
3353   for ac_dir in $ac_dummy; do 
3354     test -z "$ac_dir" && ac_dir=.
3355     if test -f $ac_dir/$ac_word; then
3356       ac_cv_path_FINGER="$ac_dir/$ac_word"
3357       break
3358     fi
3359   done
3360   IFS="$ac_save_ifs"
3361   test -z "$ac_cv_path_FINGER" && ac_cv_path_FINGER="/usr/ucb/finger"
3362   ;;
3363 esac
3364 fi
3365 FINGER="$ac_cv_path_FINGER"
3366 if test -n "$FINGER"; then
3367   echo "$ac_t""$FINGER" 1>&6
3368 else
3369   echo "$ac_t""no" 1>&6
3370 fi
3371
3372
3373 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
3374 echo "configure:3375: checking how to run the C preprocessor" >&5
3375 # On Suns, sometimes $CPP names a directory.
3376 if test -n "$CPP" && test -d "$CPP"; then
3377   CPP=
3378 fi
3379 if test -z "$CPP"; then
3380 if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
3381   echo $ac_n "(cached) $ac_c" 1>&6
3382 else
3383     # This must be in double quotes, not single quotes, because CPP may get
3384   # substituted into the Makefile and "${CC-cc}" will confuse make.
3385   CPP="${CC-cc} -E"
3386   # On the NeXT, cc -E runs the code through the compiler's parser,
3387   # not just through cpp.
3388   cat > conftest.$ac_ext <<EOF
3389 #line 3390 "configure"
3390 #include "confdefs.h"
3391 #include <assert.h>
3392 Syntax Error
3393 EOF
3394 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3395 { (eval echo configure:3396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3396 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3397 if test -z "$ac_err"; then
3398   :
3399 else
3400   echo "$ac_err" >&5
3401   echo "configure: failed program was:" >&5
3402   cat conftest.$ac_ext >&5
3403   rm -rf conftest*
3404   CPP="${CC-cc} -E -traditional-cpp"
3405   cat > conftest.$ac_ext <<EOF
3406 #line 3407 "configure"
3407 #include "confdefs.h"
3408 #include <assert.h>
3409 Syntax Error
3410 EOF
3411 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3412 { (eval echo configure:3413: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3413 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3414 if test -z "$ac_err"; then
3415   :
3416 else
3417   echo "$ac_err" >&5
3418   echo "configure: failed program was:" >&5
3419   cat conftest.$ac_ext >&5
3420   rm -rf conftest*
3421   CPP="${CC-cc} -nologo -E"
3422   cat > conftest.$ac_ext <<EOF
3423 #line 3424 "configure"
3424 #include "confdefs.h"
3425 #include <assert.h>
3426 Syntax Error
3427 EOF
3428 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3429 { (eval echo configure:3430: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3430 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3431 if test -z "$ac_err"; then
3432   :
3433 else
3434   echo "$ac_err" >&5
3435   echo "configure: failed program was:" >&5
3436   cat conftest.$ac_ext >&5
3437   rm -rf conftest*
3438   CPP=/lib/cpp
3439 fi
3440 rm -f conftest*
3441 fi
3442 rm -f conftest*
3443 fi
3444 rm -f conftest*
3445   ac_cv_prog_CPP="$CPP"
3446 fi
3447   CPP="$ac_cv_prog_CPP"
3448 else
3449   ac_cv_prog_CPP="$CPP"
3450 fi
3451 echo "$ac_t""$CPP" 1>&6
3452
3453
3454 if test $cross_compiling = yes -a $ol_enable_x_compile = yes; then
3455         echo "configure: warning: cross compiling....  some functionality will be removed." 1>&2
3456
3457 elif test $cross_compiling = no -a $ol_enable_x_compile = yes; then
3458         echo "configure: warning: programs compiled here do run here..." 1>&2
3459         { echo "configure: error:   if not cross compiling, use --disable-x-compile." 1>&2; exit 1; }
3460
3461 elif test $cross_compiling = yes -a $ol_enable_x_compile = no; then
3462         echo "configure: warning: programs compiled here do not run here..." 1>&2
3463         { echo "configure: error:   if cross compiling,  add --enable-x-compile." 1>&2; exit 1; }
3464 fi
3465
3466 echo $ac_n "checking for AIX""... $ac_c" 1>&6
3467 echo "configure:3468: checking for AIX" >&5
3468 cat > conftest.$ac_ext <<EOF
3469 #line 3470 "configure"
3470 #include "confdefs.h"
3471 #ifdef _AIX
3472   yes
3473 #endif
3474
3475 EOF
3476 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
3477   egrep "yes" >/dev/null 2>&1; then
3478   rm -rf conftest*
3479   echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF
3480 #define _ALL_SOURCE 1
3481 EOF
3482
3483 else
3484   rm -rf conftest*
3485   echo "$ac_t""no" 1>&6
3486 fi
3487 rm -f conftest*
3488
3489
3490 echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
3491 echo "configure:3492: checking for POSIXized ISC" >&5
3492 if test -d /etc/conf/kconfig.d &&
3493   grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
3494 then
3495   echo "$ac_t""yes" 1>&6
3496   ISC=yes # If later tests want to check for ISC.
3497   cat >> confdefs.h <<\EOF
3498 #define _POSIX_SOURCE 1
3499 EOF
3500
3501   if test "$GCC" = yes; then
3502     CC="$CC -posix"
3503   else
3504     CC="$CC -Xp"
3505   fi
3506 else
3507   echo "$ac_t""no" 1>&6
3508   ISC=
3509 fi
3510
3511 ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
3512 echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
3513 echo "configure:3514: checking for minix/config.h" >&5
3514 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3515   echo $ac_n "(cached) $ac_c" 1>&6
3516 else
3517   cat > conftest.$ac_ext <<EOF
3518 #line 3519 "configure"
3519 #include "confdefs.h"
3520 #include <minix/config.h>
3521 EOF
3522 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3523 { (eval echo configure:3524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3524 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3525 if test -z "$ac_err"; then
3526   rm -rf conftest*
3527   eval "ac_cv_header_$ac_safe=yes"
3528 else
3529   echo "$ac_err" >&5
3530   echo "configure: failed program was:" >&5
3531   cat conftest.$ac_ext >&5
3532   rm -rf conftest*
3533   eval "ac_cv_header_$ac_safe=no"
3534 fi
3535 rm -f conftest*
3536 fi
3537 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3538   echo "$ac_t""yes" 1>&6
3539   MINIX=yes
3540 else
3541   echo "$ac_t""no" 1>&6
3542 MINIX=
3543 fi
3544
3545 if test "$MINIX" = yes; then
3546   cat >> confdefs.h <<\EOF
3547 #define _POSIX_SOURCE 1
3548 EOF
3549
3550   cat >> confdefs.h <<\EOF
3551 #define _POSIX_1_SOURCE 2
3552 EOF
3553
3554   cat >> confdefs.h <<\EOF
3555 #define _MINIX 1
3556 EOF
3557
3558 fi
3559
3560
3561 echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
3562 echo "configure:3563: checking for Cygwin environment" >&5
3563 if eval "test \"\${ac_cv_cygwin+set}\" = set"; then
3564   echo $ac_n "(cached) $ac_c" 1>&6
3565 else
3566   cat > conftest.$ac_ext <<EOF
3567 #line 3568 "configure"
3568 #include "confdefs.h"
3569
3570 int main() {
3571
3572 #ifndef __CYGWIN__
3573 #define __CYGWIN__ __CYGWIN32__
3574 #endif
3575 return __CYGWIN__;
3576 ; return 0; }
3577 EOF
3578 if { (eval echo configure:3579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3579   rm -rf conftest*
3580   ac_cv_cygwin=yes
3581 else
3582   echo "configure: failed program was:" >&5
3583   cat conftest.$ac_ext >&5
3584   rm -rf conftest*
3585   ac_cv_cygwin=no
3586 fi
3587 rm -f conftest*
3588 fi
3589
3590 echo "$ac_t""$ac_cv_cygwin" 1>&6
3591 CYGWIN=
3592 test "$ac_cv_cygwin" = yes && CYGWIN=yes
3593 echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
3594 echo "configure:3595: checking for mingw32 environment" >&5
3595 if eval "test \"\${ac_cv_mingw32+set}\" = set"; then
3596   echo $ac_n "(cached) $ac_c" 1>&6
3597 else
3598   cat > conftest.$ac_ext <<EOF
3599 #line 3600 "configure"
3600 #include "confdefs.h"
3601
3602 int main() {
3603 return __MINGW32__;
3604 ; return 0; }
3605 EOF
3606 if { (eval echo configure:3607: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3607   rm -rf conftest*
3608   ac_cv_mingw32=yes
3609 else
3610   echo "configure: failed program was:" >&5
3611   cat conftest.$ac_ext >&5
3612   rm -rf conftest*
3613   ac_cv_mingw32=no
3614 fi
3615 rm -f conftest*
3616 fi
3617
3618 echo "$ac_t""$ac_cv_mingw32" 1>&6
3619 MINGW32=
3620 test "$ac_cv_mingw32" = yes && MINGW32=yes
3621 echo $ac_n "checking for EMX OS/2 environment""... $ac_c" 1>&6
3622 echo "configure:3623: checking for EMX OS/2 environment" >&5
3623 if eval "test \"\${ac_cv_emxos2+set}\" = set"; then
3624   echo $ac_n "(cached) $ac_c" 1>&6
3625 else
3626   cat > conftest.$ac_ext <<EOF
3627 #line 3628 "configure"
3628 #include "confdefs.h"
3629
3630 int main() {
3631 return __EMX__;
3632 ; return 0; }
3633 EOF
3634 if { (eval echo configure:3635: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3635   rm -rf conftest*
3636   ac_cv_emxos2=yes
3637 else
3638   echo "configure: failed program was:" >&5
3639   cat conftest.$ac_ext >&5
3640   rm -rf conftest*
3641   ac_cv_emxos2=no
3642 fi
3643 rm -f conftest*
3644 fi
3645
3646 echo "$ac_t""$ac_cv_emxos2" 1>&6
3647 EMXOS2=
3648 test "$ac_cv_emxos2" = yes && EMXOS2=yes
3649
3650
3651
3652 echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
3653 echo "configure:3654: checking for executable suffix" >&5
3654 if eval "test \"\${ac_cv_exeext+set}\" = set"; then
3655   echo $ac_n "(cached) $ac_c" 1>&6
3656 else
3657   if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then
3658   ac_cv_exeext=.exe
3659 else
3660   rm -f conftest*
3661   echo 'int main () { return 0; }' > conftest.$ac_ext
3662   ac_cv_exeext=
3663   if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
3664     for file in conftest.*; do
3665       case $file in
3666       *.c | *.C | *.o | *.obj | *.xcoff) ;;
3667       *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
3668       esac
3669     done
3670   else
3671     { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
3672   fi
3673   rm -f conftest*
3674   test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
3675 fi
3676 fi
3677
3678 EXEEXT=""
3679 test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
3680 echo "$ac_t""${ac_cv_exeext}" 1>&6
3681 ac_exeext=$EXEEXT
3682
3683 echo $ac_n "checking for object suffix""... $ac_c" 1>&6
3684 echo "configure:3685: checking for object suffix" >&5
3685 if eval "test \"\${ac_cv_objext+set}\" = set"; then
3686   echo $ac_n "(cached) $ac_c" 1>&6
3687 else
3688   rm -f conftest*
3689 echo 'int i = 1;' > conftest.$ac_ext
3690 if { (eval echo configure:3691: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3691   for ac_file in conftest.*; do
3692     case $ac_file in
3693     *.c) ;;
3694     *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
3695     esac
3696   done
3697 else
3698   { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
3699 fi
3700 rm -f conftest*
3701 fi
3702
3703 echo "$ac_t""$ac_cv_objext" 1>&6
3704 OBJEXT=$ac_cv_objext
3705 ac_objext=$ac_cv_objext
3706
3707
3708 cat >> confdefs.h <<EOF
3709 #define EXEEXT "${EXEEXT}"
3710 EOF
3711
3712
3713 echo $ac_n "checking for be_app in -lbe""... $ac_c" 1>&6
3714 echo "configure:3715: checking for be_app in -lbe" >&5
3715 ac_lib_var=`echo be'_'be_app | sed 'y%./+-:%__p__%'`
3716 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3717   echo $ac_n "(cached) $ac_c" 1>&6
3718 else
3719   ac_save_LIBS="$LIBS"
3720 LIBS="-lbe -lroot -lnet $LIBS"
3721 cat > conftest.$ac_ext <<EOF
3722 #line 3723 "configure"
3723 #include "confdefs.h"
3724 /* Override any gcc2 internal prototype to avoid an error.  */
3725 /* We use char because int might match the return type of a gcc2
3726     builtin and then its argument prototype would still apply.  */
3727 char be_app();
3728
3729 int main() {
3730 be_app()
3731 ; return 0; }
3732 EOF
3733 if { (eval echo configure:3734: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3734   rm -rf conftest*
3735   eval "ac_cv_lib_$ac_lib_var=yes"
3736 else
3737   echo "configure: failed program was:" >&5
3738   cat conftest.$ac_ext >&5
3739   rm -rf conftest*
3740   eval "ac_cv_lib_$ac_lib_var=no"
3741 fi
3742 rm -f conftest*
3743 LIBS="$ac_save_LIBS"
3744
3745 fi
3746 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3747   echo "$ac_t""yes" 1>&6
3748   LIBS="$LIBS -lbe -lroot -lnet"
3749 else
3750   echo "$ac_t""no" 1>&6
3751 :
3752 fi
3753
3754
3755
3756
3757
3758 echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6
3759 echo "configure:3760: checking for ${CC-cc} option to accept ANSI C" >&5
3760 if eval "test \"\${am_cv_prog_cc_stdc+set}\" = set"; then
3761   echo $ac_n "(cached) $ac_c" 1>&6
3762 else
3763   am_cv_prog_cc_stdc=no
3764 ac_save_CC="$CC"
3765 # Don't try gcc -ansi; that turns off useful extensions and
3766 # breaks some systems' header files.
3767 # AIX                   -qlanglvl=ansi
3768 # Ultrix and OSF/1      -std1
3769 # HP-UX 10.20 and later -Ae
3770 # HP-UX older versions  -Aa -D_HPUX_SOURCE
3771 # SVR4                  -Xc -D__EXTENSIONS__
3772 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3773 do
3774   CC="$ac_save_CC $ac_arg"
3775   cat > conftest.$ac_ext <<EOF
3776 #line 3777 "configure"
3777 #include "confdefs.h"
3778 #include <stdarg.h>
3779 #include <stdio.h>
3780 #include <sys/types.h>
3781 #include <sys/stat.h>
3782 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
3783 struct buf { int x; };
3784 FILE * (*rcsopen) (struct buf *, struct stat *, int);
3785 static char *e (p, i)
3786      char **p;
3787      int i;
3788 {
3789   return p[i];
3790 }
3791 static char *f (char * (*g) (char **, int), char **p, ...)
3792 {
3793   char *s;
3794   va_list v;
3795   va_start (v,p);
3796   s = g (p, va_arg (v,int));
3797   va_end (v);
3798   return s;
3799 }
3800 int test (int i, double x);
3801 struct s1 {int (*f) (int a);};
3802 struct s2 {int (*f) (double a);};
3803 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
3804 int argc;
3805 char **argv;
3806
3807 int main() {
3808
3809 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
3810
3811 ; return 0; }
3812 EOF
3813 if { (eval echo configure:3814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
3814   rm -rf conftest*
3815   am_cv_prog_cc_stdc="$ac_arg"; break
3816 else
3817   echo "configure: failed program was:" >&5
3818   cat conftest.$ac_ext >&5
3819 fi
3820 rm -f conftest*
3821 done
3822 CC="$ac_save_CC"
3823
3824 fi
3825
3826 if test -z "$am_cv_prog_cc_stdc"; then
3827   echo "$ac_t""none needed" 1>&6
3828 else
3829   echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6
3830 fi
3831 case "x$am_cv_prog_cc_stdc" in
3832   x|xno) ;;
3833   *) CC="$CC $am_cv_prog_cc_stdc" ;;
3834 esac
3835
3836 if test "X${am_cv_prog_cc_stdc}" = "Xno" ; then
3837         { echo "configure: error: OpenLDAP requires compiler to support STDC constructs." 1>&2; exit 1; }
3838 fi
3839
3840 # test for make depend flag
3841 OL_MKDEP=
3842 OL_MKDEP_FLAGS=
3843 if test -z "${MKDEP}"; then
3844         OL_MKDEP="${CC-cc}"
3845         if test -z "${MKDEP_FLAGS}"; then
3846                 echo $ac_n "checking for ${OL_MKDEP} depend flag""... $ac_c" 1>&6
3847 echo "configure:3848: checking for ${OL_MKDEP} depend flag" >&5
3848 if eval "test \"\${ol_cv_mkdep+set}\" = set"; then
3849   echo $ac_n "(cached) $ac_c" 1>&6
3850 else
3851   
3852                         ol_cv_mkdep=no
3853                         for flag in "-M" "-xM"; do
3854                                 cat > conftest.c <<EOF
3855  noCode;
3856 EOF
3857                                 if { ac_try='$OL_MKDEP $flag conftest.c'; { (eval echo configure:3858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } \
3858                                         | egrep '^conftest\.'"${ac_objext}" >/dev/null 2>&1
3859                                 then
3860                                         if test ! -f conftest."${ac_object}" ; then
3861                                                 ol_cv_mkdep=$flag
3862                                                 OL_MKDEP_FLAGS="$flag"
3863                                                 break
3864                                         fi
3865                                 fi
3866                         done
3867                         rm -f conftest*
3868                 
3869 fi
3870
3871 echo "$ac_t""$ol_cv_mkdep" 1>&6
3872         else
3873                 cc_cv_mkdep=yes
3874                 OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3875         fi
3876 else
3877         cc_cv_mkdep=yes
3878         OL_MKDEP="${MKDEP}"
3879         OL_MKDEP_FLAGS="${MKDEP_FLAGS}"
3880 fi
3881
3882
3883
3884 if test "${ol_cv_mkdep}" = no ; then
3885         # this will soon become an error
3886         echo "configure: warning: do not know how to generate dependencies" 1>&2
3887 fi
3888
3889 echo $ac_n "checking for afopen in -ls""... $ac_c" 1>&6
3890 echo "configure:3891: checking for afopen in -ls" >&5
3891 ac_lib_var=`echo s'_'afopen | sed 'y%./+-:%__p__%'`
3892 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3893   echo $ac_n "(cached) $ac_c" 1>&6
3894 else
3895   ac_save_LIBS="$LIBS"
3896 LIBS="-ls  $LIBS"
3897 cat > conftest.$ac_ext <<EOF
3898 #line 3899 "configure"
3899 #include "confdefs.h"
3900 /* Override any gcc2 internal prototype to avoid an error.  */
3901 /* We use char because int might match the return type of a gcc2
3902     builtin and then its argument prototype would still apply.  */
3903 char afopen();
3904
3905 int main() {
3906 afopen()
3907 ; return 0; }
3908 EOF
3909 if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
3910   rm -rf conftest*
3911   eval "ac_cv_lib_$ac_lib_var=yes"
3912 else
3913   echo "configure: failed program was:" >&5
3914   cat conftest.$ac_ext >&5
3915   rm -rf conftest*
3916   eval "ac_cv_lib_$ac_lib_var=no"
3917 fi
3918 rm -f conftest*
3919 LIBS="$ac_save_LIBS"
3920
3921 fi
3922 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
3923   echo "$ac_t""yes" 1>&6
3924   
3925         AUTH_LIBS=-ls
3926         cat >> confdefs.h <<\EOF
3927 #define HAVE_AIX_SECURITY 1
3928 EOF
3929
3930
3931 else
3932   echo "$ac_t""no" 1>&6
3933 fi
3934
3935
3936
3937 ol_link_modules=no
3938 if test $ol_enable_modules != no ; then
3939         for ac_hdr in ltdl.h
3940 do
3941 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
3942 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
3943 echo "configure:3944: checking for $ac_hdr" >&5
3944 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
3945   echo $ac_n "(cached) $ac_c" 1>&6
3946 else
3947   cat > conftest.$ac_ext <<EOF
3948 #line 3949 "configure"
3949 #include "confdefs.h"
3950 #include <$ac_hdr>
3951 EOF
3952 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
3953 { (eval echo configure:3954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
3954 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
3955 if test -z "$ac_err"; then
3956   rm -rf conftest*
3957   eval "ac_cv_header_$ac_safe=yes"
3958 else
3959   echo "$ac_err" >&5
3960   echo "configure: failed program was:" >&5
3961   cat conftest.$ac_ext >&5
3962   rm -rf conftest*
3963   eval "ac_cv_header_$ac_safe=no"
3964 fi
3965 rm -f conftest*
3966 fi
3967 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
3968   echo "$ac_t""yes" 1>&6
3969     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
3970   cat >> confdefs.h <<EOF
3971 #define $ac_tr_hdr 1
3972 EOF
3973  
3974 else
3975   echo "$ac_t""no" 1>&6
3976 fi
3977 done
3978
3979
3980         if test $ac_cv_header_ltdl_h = no ; then
3981                 { echo "configure: error: could not locate libtool ltdl.h" 1>&2; exit 1; }
3982         fi
3983
3984         echo $ac_n "checking for lt_dlinit in -lltdl""... $ac_c" 1>&6
3985 echo "configure:3986: checking for lt_dlinit in -lltdl" >&5
3986 ac_lib_var=`echo ltdl'_'lt_dlinit | sed 'y%./+-:%__p__%'`
3987 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
3988   echo $ac_n "(cached) $ac_c" 1>&6
3989 else
3990   ac_save_LIBS="$LIBS"
3991 LIBS="-lltdl  $LIBS"
3992 cat > conftest.$ac_ext <<EOF
3993 #line 3994 "configure"
3994 #include "confdefs.h"
3995 /* Override any gcc2 internal prototype to avoid an error.  */
3996 /* We use char because int might match the return type of a gcc2
3997     builtin and then its argument prototype would still apply.  */
3998 char lt_dlinit();
3999
4000 int main() {
4001 lt_dlinit()
4002 ; return 0; }
4003 EOF
4004 if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4005   rm -rf conftest*
4006   eval "ac_cv_lib_$ac_lib_var=yes"
4007 else
4008   echo "configure: failed program was:" >&5
4009   cat conftest.$ac_ext >&5
4010   rm -rf conftest*
4011   eval "ac_cv_lib_$ac_lib_var=no"
4012 fi
4013 rm -f conftest*
4014 LIBS="$ac_save_LIBS"
4015
4016 fi
4017 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4018   echo "$ac_t""yes" 1>&6
4019   
4020             MODULES_LIBS=-lltdl
4021             cat >> confdefs.h <<\EOF
4022 #define HAVE_LIBLTDL 1
4023 EOF
4024
4025         
4026 else
4027   echo "$ac_t""no" 1>&6
4028 fi
4029
4030
4031         if test "$ac_cv_lib_ltdl_lt_dlinit" = no ; then
4032                 { echo "configure: error: could not locate libtool -lltdl" 1>&2; exit 1; }
4033         fi
4034         ol_link_modules=yes
4035 else
4036         ol_with_dnssrv_module=static
4037         ol_with_ldap_module=static
4038         ol_with_ldbm_module=static
4039         ol_with_passwd_module=static
4040         ol_with_shell_module=static
4041         ol_with_sql_module=static
4042 fi
4043
4044 # test for EBCDIC
4045 echo $ac_n "checking for EBCDIC""... $ac_c" 1>&6
4046 echo "configure:4047: checking for EBCDIC" >&5
4047 if eval "test \"\${ol_cv_cpp_ebcdic+set}\" = set"; then
4048   echo $ac_n "(cached) $ac_c" 1>&6
4049 else
4050   
4051         cat > conftest.$ac_ext <<EOF
4052 #line 4053 "configure"
4053 #include "confdefs.h"
4054
4055 #if !('M' == 0xd4)
4056 #include <__ASCII__/generate_error.h>
4057 #endif
4058
4059 EOF
4060 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4061 { (eval echo configure:4062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4062 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4063 if test -z "$ac_err"; then
4064   rm -rf conftest*
4065   ol_cv_cpp_ebcdic=yes
4066 else
4067   echo "$ac_err" >&5
4068   echo "configure: failed program was:" >&5
4069   cat conftest.$ac_ext >&5
4070   rm -rf conftest*
4071   ol_cv_cpp_ebcdic=no
4072 fi
4073 rm -f conftest*
4074 fi
4075
4076 echo "$ac_t""$ol_cv_cpp_ebcdic" 1>&6
4077 if test $ol_cv_cpp_ebcdic = yes ; then
4078         cat >> confdefs.h <<\EOF
4079 #define HAVE_EBCDIC 1
4080 EOF
4081
4082 fi
4083
4084 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
4085 echo "configure:4086: checking for ANSI C header files" >&5
4086 if eval "test \"\${ol_cv_header_stdc+set}\" = set"; then
4087   echo $ac_n "(cached) $ac_c" 1>&6
4088 else
4089   cat > conftest.$ac_ext <<EOF
4090 #line 4091 "configure"
4091 #include "confdefs.h"
4092 #include <stdlib.h>
4093 #include <stdarg.h>
4094 #include <string.h>
4095 #include <float.h>
4096 EOF
4097 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4098 { (eval echo configure:4099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4099 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4100 if test -z "$ac_err"; then
4101   rm -rf conftest*
4102   ol_cv_header_stdc=yes
4103 else
4104   echo "$ac_err" >&5
4105   echo "configure: failed program was:" >&5
4106   cat conftest.$ac_ext >&5
4107   rm -rf conftest*
4108   ol_cv_header_stdc=no
4109 fi
4110 rm -f conftest*
4111
4112 if test $ol_cv_header_stdc = yes; then
4113   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
4114 cat > conftest.$ac_ext <<EOF
4115 #line 4116 "configure"
4116 #include "confdefs.h"
4117 #include <string.h>
4118 EOF
4119 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4120   egrep "memchr" >/dev/null 2>&1; then
4121   :
4122 else
4123   rm -rf conftest*
4124   ol_cv_header_stdc=no
4125 fi
4126 rm -f conftest*
4127
4128 fi
4129
4130 if test $ol_cv_header_stdc = yes; then
4131   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
4132 cat > conftest.$ac_ext <<EOF
4133 #line 4134 "configure"
4134 #include "confdefs.h"
4135 #include <stdlib.h>
4136 EOF
4137 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4138   egrep "free" >/dev/null 2>&1; then
4139   :
4140 else
4141   rm -rf conftest*
4142   ol_cv_header_stdc=no
4143 fi
4144 rm -f conftest*
4145
4146 fi
4147
4148 if test $ol_cv_header_stdc = yes; then
4149   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
4150 if test "$cross_compiling" = yes; then
4151   :
4152 else
4153   cat > conftest.$ac_ext <<EOF
4154 #line 4155 "configure"
4155 #include "confdefs.h"
4156 #include <ctype.h>
4157 #ifndef HAVE_EBCDIC
4158 #       define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
4159 #       define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
4160 #else
4161 #       define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
4162                 || ('j' <= (c) && (c) <= 'r') \
4163                 || ('s' <= (c) && (c) <= 'z'))
4164 #       define TOUPPER(c)       (ISLOWER(c) ? ((c) | 0x40) : (c))
4165 #endif
4166 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
4167 int main () { int i; for (i = 0; i < 256; i++)
4168 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
4169 exit (0); }
4170
4171 EOF
4172 if { (eval echo configure:4173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
4173 then
4174   :
4175 else
4176   echo "configure: failed program was:" >&5
4177   cat conftest.$ac_ext >&5
4178   rm -fr conftest*
4179   ol_cv_header_stdc=no
4180 fi
4181 rm -fr conftest*
4182 fi
4183
4184 fi
4185 fi
4186
4187 echo "$ac_t""$ol_cv_header_stdc" 1>&6
4188 if test $ol_cv_header_stdc = yes; then
4189   cat >> confdefs.h <<\EOF
4190 #define STDC_HEADERS 1
4191 EOF
4192
4193 fi
4194 ac_cv_header_stdc=disable
4195
4196
4197 if test $ol_cv_header_stdc != yes; then
4198         echo "configure: warning: could not locate Standard C compliant headers" 1>&2
4199 fi
4200
4201 ac_header_dirent=no
4202 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
4203 do
4204 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4205 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
4206 echo "configure:4207: checking for $ac_hdr that defines DIR" >&5
4207 if eval "test \"\${ac_cv_header_dirent_$ac_safe+set}\" = set"; then
4208   echo $ac_n "(cached) $ac_c" 1>&6
4209 else
4210   cat > conftest.$ac_ext <<EOF
4211 #line 4212 "configure"
4212 #include "confdefs.h"
4213 #include <sys/types.h>
4214 #include <$ac_hdr>
4215 int main() {
4216 DIR *dirp = 0;
4217 ; return 0; }
4218 EOF
4219 if { (eval echo configure:4220: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4220   rm -rf conftest*
4221   eval "ac_cv_header_dirent_$ac_safe=yes"
4222 else
4223   echo "configure: failed program was:" >&5
4224   cat conftest.$ac_ext >&5
4225   rm -rf conftest*
4226   eval "ac_cv_header_dirent_$ac_safe=no"
4227 fi
4228 rm -f conftest*
4229 fi
4230 if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then
4231   echo "$ac_t""yes" 1>&6
4232     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4233   cat >> confdefs.h <<EOF
4234 #define $ac_tr_hdr 1
4235 EOF
4236  ac_header_dirent=$ac_hdr; break
4237 else
4238   echo "$ac_t""no" 1>&6
4239 fi
4240 done
4241 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
4242 if test $ac_header_dirent = dirent.h; then
4243 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
4244 echo "configure:4245: checking for opendir in -ldir" >&5
4245 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-:%__p__%'`
4246 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4247   echo $ac_n "(cached) $ac_c" 1>&6
4248 else
4249   ac_save_LIBS="$LIBS"
4250 LIBS="-ldir  $LIBS"
4251 cat > conftest.$ac_ext <<EOF
4252 #line 4253 "configure"
4253 #include "confdefs.h"
4254 /* Override any gcc2 internal prototype to avoid an error.  */
4255 /* We use char because int might match the return type of a gcc2
4256     builtin and then its argument prototype would still apply.  */
4257 char opendir();
4258
4259 int main() {
4260 opendir()
4261 ; return 0; }
4262 EOF
4263 if { (eval echo configure:4264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4264   rm -rf conftest*
4265   eval "ac_cv_lib_$ac_lib_var=yes"
4266 else
4267   echo "configure: failed program was:" >&5
4268   cat conftest.$ac_ext >&5
4269   rm -rf conftest*
4270   eval "ac_cv_lib_$ac_lib_var=no"
4271 fi
4272 rm -f conftest*
4273 LIBS="$ac_save_LIBS"
4274
4275 fi
4276 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4277   echo "$ac_t""yes" 1>&6
4278   LIBS="$LIBS -ldir"
4279 else
4280   echo "$ac_t""no" 1>&6
4281 fi
4282
4283 else
4284 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
4285 echo "configure:4286: checking for opendir in -lx" >&5
4286 ac_lib_var=`echo x'_'opendir | sed 'y%./+-:%__p__%'`
4287 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4288   echo $ac_n "(cached) $ac_c" 1>&6
4289 else
4290   ac_save_LIBS="$LIBS"
4291 LIBS="-lx  $LIBS"
4292 cat > conftest.$ac_ext <<EOF
4293 #line 4294 "configure"
4294 #include "confdefs.h"
4295 /* Override any gcc2 internal prototype to avoid an error.  */
4296 /* We use char because int might match the return type of a gcc2
4297     builtin and then its argument prototype would still apply.  */
4298 char opendir();
4299
4300 int main() {
4301 opendir()
4302 ; return 0; }
4303 EOF
4304 if { (eval echo configure:4305: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4305   rm -rf conftest*
4306   eval "ac_cv_lib_$ac_lib_var=yes"
4307 else
4308   echo "configure: failed program was:" >&5
4309   cat conftest.$ac_ext >&5
4310   rm -rf conftest*
4311   eval "ac_cv_lib_$ac_lib_var=no"
4312 fi
4313 rm -f conftest*
4314 LIBS="$ac_save_LIBS"
4315
4316 fi
4317 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4318   echo "$ac_t""yes" 1>&6
4319   LIBS="$LIBS -lx"
4320 else
4321   echo "$ac_t""no" 1>&6
4322 fi
4323
4324 fi
4325
4326 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
4327 echo "configure:4328: checking for sys/wait.h that is POSIX.1 compatible" >&5
4328 if eval "test \"\${ac_cv_header_sys_wait_h+set}\" = set"; then
4329   echo $ac_n "(cached) $ac_c" 1>&6
4330 else
4331   cat > conftest.$ac_ext <<EOF
4332 #line 4333 "configure"
4333 #include "confdefs.h"
4334 #include <sys/types.h>
4335 #include <sys/wait.h>
4336 #ifndef WEXITSTATUS
4337 #define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
4338 #endif
4339 #ifndef WIFEXITED
4340 #define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
4341 #endif
4342 int main() {
4343 int s;
4344 wait (&s);
4345 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
4346 ; return 0; }
4347 EOF
4348 if { (eval echo configure:4349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
4349   rm -rf conftest*
4350   ac_cv_header_sys_wait_h=yes
4351 else
4352   echo "configure: failed program was:" >&5
4353   cat conftest.$ac_ext >&5
4354   rm -rf conftest*
4355   ac_cv_header_sys_wait_h=no
4356 fi
4357 rm -f conftest*
4358 fi
4359
4360 echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6
4361 if test $ac_cv_header_sys_wait_h = yes; then
4362   cat >> confdefs.h <<\EOF
4363 #define HAVE_SYS_WAIT_H 1
4364 EOF
4365
4366 fi
4367
4368 echo $ac_n "checking POSIX termios""... $ac_c" 1>&6
4369 echo "configure:4370: checking POSIX termios" >&5
4370 if eval "test \"\${am_cv_sys_posix_termios+set}\" = set"; then
4371   echo $ac_n "(cached) $ac_c" 1>&6
4372 else
4373   cat > conftest.$ac_ext <<EOF
4374 #line 4375 "configure"
4375 #include "confdefs.h"
4376 #include <sys/types.h>
4377 #include <unistd.h>
4378 #include <termios.h>
4379 int main() {
4380 /* SunOS 4.0.3 has termios.h but not the library calls.  */
4381    tcgetattr(0, 0);
4382 ; return 0; }
4383 EOF
4384 if { (eval echo configure:4385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4385   rm -rf conftest*
4386   am_cv_sys_posix_termios=yes
4387 else
4388   echo "configure: failed program was:" >&5
4389   cat conftest.$ac_ext >&5
4390   rm -rf conftest*
4391   am_cv_sys_posix_termios=no
4392 fi
4393 rm -f conftest*
4394 fi
4395
4396 echo "$ac_t""$am_cv_sys_posix_termios" 1>&6
4397
4398
4399  echo $ac_n "checking whether use of TIOCGWINSZ requires sys/ioctl.h""... $ac_c" 1>&6
4400 echo "configure:4401: checking whether use of TIOCGWINSZ requires sys/ioctl.h" >&5
4401 if eval "test \"\${am_cv_sys_tiocgwinsz_needs_sys_ioctl_h+set}\" = set"; then
4402   echo $ac_n "(cached) $ac_c" 1>&6
4403 else
4404   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
4405
4406   gwinsz_in_termios_h=no
4407   if test $am_cv_sys_posix_termios = yes; then
4408     cat > conftest.$ac_ext <<EOF
4409 #line 4410 "configure"
4410 #include "confdefs.h"
4411 #include <sys/types.h>
4412 #     include <termios.h>
4413 #     ifdef TIOCGWINSZ
4414         yes
4415 #     endif
4416     
4417 EOF
4418 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4419   egrep "yes" >/dev/null 2>&1; then
4420   rm -rf conftest*
4421   gwinsz_in_termios_h=yes
4422 fi
4423 rm -f conftest*
4424
4425   fi
4426
4427   if test $gwinsz_in_termios_h = no; then
4428     cat > conftest.$ac_ext <<EOF
4429 #line 4430 "configure"
4430 #include "confdefs.h"
4431 #include <sys/types.h>
4432 #     include <sys/ioctl.h>
4433 #     ifdef TIOCGWINSZ
4434         yes
4435 #     endif
4436     
4437 EOF
4438 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4439   egrep "yes" >/dev/null 2>&1; then
4440   rm -rf conftest*
4441   am_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes
4442 fi
4443 rm -f conftest*
4444
4445   fi
4446   
4447 fi
4448
4449 echo "$ac_t""$am_cv_sys_tiocgwinsz_needs_sys_ioctl_h" 1>&6
4450   if test $am_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
4451     cat >> confdefs.h <<\EOF
4452 #define GWINSZ_IN_SYS_IOCTL 1
4453 EOF
4454
4455   fi
4456
4457 if test $am_cv_sys_posix_termios = yes ; then
4458         cat >> confdefs.h <<\EOF
4459 #define HAVE_POSIX_TERMIOS 1
4460 EOF
4461
4462 fi
4463
4464 for ac_hdr in \
4465         arpa/inet.h             \
4466         arpa/nameser.h  \
4467         assert.h                \
4468         conio.h                 \
4469         crypt.h                 \
4470         direct.h                \
4471         errno.h                 \
4472         fcntl.h                 \
4473         filio.h                 \
4474         getopt.h                \
4475         grp.h                   \
4476         io.h                    \
4477         libutil.h               \
4478         limits.h                \
4479         locale.h                \
4480         netinet/tcp.h   \
4481         malloc.h                \
4482         memory.h                \
4483         psap.h                  \
4484         pwd.h                   \
4485         process.h               \
4486         resolv.h                \
4487         sgtty.h                 \
4488         shadow.h                \
4489         stddef.h                \
4490         string.h                \
4491         strings.h               \
4492         sysexits.h              \
4493         sys/file.h              \
4494         sys/filio.h             \
4495         sys/errno.h             \
4496         sys/ioctl.h             \
4497         sys/param.h             \
4498         sys/resource.h  \
4499         sys/select.h    \
4500         sys/socket.h    \
4501         sys/syslog.h    \
4502         sys/time.h              \
4503         sys/types.h             \
4504         syslog.h                \
4505         termios.h               \
4506         unistd.h                \
4507         winsock.h               \
4508
4509 do
4510 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
4511 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
4512 echo "configure:4513: checking for $ac_hdr" >&5
4513 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
4514   echo $ac_n "(cached) $ac_c" 1>&6
4515 else
4516   cat > conftest.$ac_ext <<EOF
4517 #line 4518 "configure"
4518 #include "confdefs.h"
4519 #include <$ac_hdr>
4520 EOF
4521 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
4522 { (eval echo configure:4523: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
4523 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
4524 if test -z "$ac_err"; then
4525   rm -rf conftest*
4526   eval "ac_cv_header_$ac_safe=yes"
4527 else
4528   echo "$ac_err" >&5
4529   echo "configure: failed program was:" >&5
4530   cat conftest.$ac_ext >&5
4531   rm -rf conftest*
4532   eval "ac_cv_header_$ac_safe=no"
4533 fi
4534 rm -f conftest*
4535 fi
4536 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
4537   echo "$ac_t""yes" 1>&6
4538     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
4539   cat >> confdefs.h <<EOF
4540 #define $ac_tr_hdr 1
4541 EOF
4542  
4543 else
4544   echo "$ac_t""no" 1>&6
4545 fi
4546 done
4547
4548
4549
4550
4551 echo $ac_n "checking for sigset in -lV3""... $ac_c" 1>&6
4552 echo "configure:4553: checking for sigset in -lV3" >&5
4553 ac_lib_var=`echo V3'_'sigset | sed 'y%./+-:%__p__%'`
4554 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4555   echo $ac_n "(cached) $ac_c" 1>&6
4556 else
4557   ac_save_LIBS="$LIBS"
4558 LIBS="-lV3  $LIBS"
4559 cat > conftest.$ac_ext <<EOF
4560 #line 4561 "configure"
4561 #include "confdefs.h"
4562 /* Override any gcc2 internal prototype to avoid an error.  */
4563 /* We use char because int might match the return type of a gcc2
4564     builtin and then its argument prototype would still apply.  */
4565 char sigset();
4566
4567 int main() {
4568 sigset()
4569 ; return 0; }
4570 EOF
4571 if { (eval echo configure:4572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4572   rm -rf conftest*
4573   eval "ac_cv_lib_$ac_lib_var=yes"
4574 else
4575   echo "configure: failed program was:" >&5
4576   cat conftest.$ac_ext >&5
4577   rm -rf conftest*
4578   eval "ac_cv_lib_$ac_lib_var=no"
4579 fi
4580 rm -f conftest*
4581 LIBS="$ac_save_LIBS"
4582
4583 fi
4584 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4585   echo "$ac_t""yes" 1>&6
4586     ac_tr_lib=HAVE_LIB`echo V3 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4587     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4588   cat >> confdefs.h <<EOF
4589 #define $ac_tr_lib 1
4590 EOF
4591
4592   LIBS="-lV3 $LIBS"
4593
4594 else
4595   echo "$ac_t""no" 1>&6
4596 fi
4597
4598
4599 if test $ac_cv_header_winsock_h = yes; then
4600         echo $ac_n "checking for winsock""... $ac_c" 1>&6
4601 echo "configure:4602: checking for winsock" >&5
4602 if eval "test \"\${ol_cv_winsock+set}\" = set"; then
4603   echo $ac_n "(cached) $ac_c" 1>&6
4604 else
4605   cat > conftest.$ac_ext <<EOF
4606 #line 4607 "configure"
4607 #include "confdefs.h"
4608 #include <winsock.h>
4609 int main() {
4610
4611                         socket(0,0,0);
4612                         select(0,NULL,NULL,NULL,NULL);
4613                         closesocket(0);
4614                         gethostname(NULL,0);
4615         
4616 ; return 0; }
4617 EOF
4618 if { (eval echo configure:4619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4619   rm -rf conftest*
4620   ol_cv_winsock=yes
4621 else
4622   echo "configure: failed program was:" >&5
4623   cat conftest.$ac_ext >&5
4624   rm -rf conftest*
4625   ol_cv_winsock=no
4626 fi
4627 rm -f conftest*]
4628 fi
4629
4630 echo "$ac_t""$ol_cv_winsock" 1>&6
4631
4632         if test $ol_cv_winsock = yes ; then
4633                 cat >> confdefs.h <<\EOF
4634 #define HAVE_WINSOCK 1
4635 EOF
4636
4637                 ac_cv_func_socket=yes
4638                 ac_cv_func_select=yes
4639                 ac_cv_func_closesocket=yes
4640                 ac_cv_func_gethostname=yes
4641         fi
4642 fi
4643
4644
4645 echo $ac_n "checking for socket""... $ac_c" 1>&6
4646 echo "configure:4647: checking for socket" >&5
4647 if eval "test \"\${ac_cv_func_socket+set}\" = set"; then
4648   echo $ac_n "(cached) $ac_c" 1>&6
4649 else
4650   cat > conftest.$ac_ext <<EOF
4651 #line 4652 "configure"
4652 #include "confdefs.h"
4653 /* System header to define __stub macros and hopefully few prototypes,
4654     which can conflict with char socket(); below.  */
4655 #include <assert.h>
4656 /* Override any gcc2 internal prototype to avoid an error.  */
4657 /* We use char because int might match the return type of a gcc2
4658     builtin and then its argument prototype would still apply.  */
4659 char socket();
4660 char (*f)();
4661
4662 int main() {
4663
4664 /* The GNU C library defines this for functions which it implements
4665     to always fail with ENOSYS.  Some functions are actually named
4666     something starting with __ and the normal name is an alias.  */
4667 #if defined (__stub_socket) || defined (__stub___socket)
4668 choke me
4669 #else
4670 f = socket;
4671 #endif
4672
4673 ; return 0; }
4674 EOF
4675 if { (eval echo configure:4676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4676   rm -rf conftest*
4677   eval "ac_cv_func_socket=yes"
4678 else
4679   echo "configure: failed program was:" >&5
4680   cat conftest.$ac_ext >&5
4681   rm -rf conftest*
4682   eval "ac_cv_func_socket=no"
4683 fi
4684 rm -f conftest*
4685 fi
4686
4687 if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
4688   echo "$ac_t""yes" 1>&6
4689   :
4690 else
4691   echo "$ac_t""no" 1>&6
4692         
4693         echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6
4694 echo "configure:4695: checking for main in -lsocket" >&5
4695 ac_lib_var=`echo socket'_'main | sed 'y%./+-:%__p__%'`
4696 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4697   echo $ac_n "(cached) $ac_c" 1>&6
4698 else
4699   ac_save_LIBS="$LIBS"
4700 LIBS="-lsocket  $LIBS"
4701 cat > conftest.$ac_ext <<EOF
4702 #line 4703 "configure"
4703 #include "confdefs.h"
4704
4705 int main() {
4706 main()
4707 ; return 0; }
4708 EOF
4709 if { (eval echo configure:4710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4710   rm -rf conftest*
4711   eval "ac_cv_lib_$ac_lib_var=yes"
4712 else
4713   echo "configure: failed program was:" >&5
4714   cat conftest.$ac_ext >&5
4715   rm -rf conftest*
4716   eval "ac_cv_lib_$ac_lib_var=no"
4717 fi
4718 rm -f conftest*
4719 LIBS="$ac_save_LIBS"
4720
4721 fi
4722 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4723   echo "$ac_t""yes" 1>&6
4724     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4725     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4726   cat >> confdefs.h <<EOF
4727 #define $ac_tr_lib 1
4728 EOF
4729
4730   LIBS="-lsocket $LIBS"
4731
4732 else
4733   echo "$ac_t""no" 1>&6
4734 fi
4735
4736         echo $ac_n "checking for main in -lnet""... $ac_c" 1>&6
4737 echo "configure:4738: checking for main in -lnet" >&5
4738 ac_lib_var=`echo net'_'main | sed 'y%./+-:%__p__%'`
4739 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4740   echo $ac_n "(cached) $ac_c" 1>&6
4741 else
4742   ac_save_LIBS="$LIBS"
4743 LIBS="-lnet  $LIBS"
4744 cat > conftest.$ac_ext <<EOF
4745 #line 4746 "configure"
4746 #include "confdefs.h"
4747
4748 int main() {
4749 main()
4750 ; return 0; }
4751 EOF
4752 if { (eval echo configure:4753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4753   rm -rf conftest*
4754   eval "ac_cv_lib_$ac_lib_var=yes"
4755 else
4756   echo "configure: failed program was:" >&5
4757   cat conftest.$ac_ext >&5
4758   rm -rf conftest*
4759   eval "ac_cv_lib_$ac_lib_var=no"
4760 fi
4761 rm -f conftest*
4762 LIBS="$ac_save_LIBS"
4763
4764 fi
4765 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4766   echo "$ac_t""yes" 1>&6
4767     ac_tr_lib=HAVE_LIB`echo net | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4768     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4769   cat >> confdefs.h <<EOF
4770 #define $ac_tr_lib 1
4771 EOF
4772
4773   LIBS="-lnet $LIBS"
4774
4775 else
4776   echo "$ac_t""no" 1>&6
4777 fi
4778
4779         echo $ac_n "checking for main in -lnsl_s""... $ac_c" 1>&6
4780 echo "configure:4781: checking for main in -lnsl_s" >&5
4781 ac_lib_var=`echo nsl_s'_'main | sed 'y%./+-:%__p__%'`
4782 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4783   echo $ac_n "(cached) $ac_c" 1>&6
4784 else
4785   ac_save_LIBS="$LIBS"
4786 LIBS="-lnsl_s  $LIBS"
4787 cat > conftest.$ac_ext <<EOF
4788 #line 4789 "configure"
4789 #include "confdefs.h"
4790
4791 int main() {
4792 main()
4793 ; return 0; }
4794 EOF
4795 if { (eval echo configure:4796: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4796   rm -rf conftest*
4797   eval "ac_cv_lib_$ac_lib_var=yes"
4798 else
4799   echo "configure: failed program was:" >&5
4800   cat conftest.$ac_ext >&5
4801   rm -rf conftest*
4802   eval "ac_cv_lib_$ac_lib_var=no"
4803 fi
4804 rm -f conftest*
4805 LIBS="$ac_save_LIBS"
4806
4807 fi
4808 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4809   echo "$ac_t""yes" 1>&6
4810     ac_tr_lib=HAVE_LIB`echo nsl_s | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4811     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4812   cat >> confdefs.h <<EOF
4813 #define $ac_tr_lib 1
4814 EOF
4815
4816   LIBS="-lnsl_s $LIBS"
4817
4818 else
4819   echo "$ac_t""no" 1>&6
4820 fi
4821
4822         echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
4823 echo "configure:4824: checking for main in -lnsl" >&5
4824 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
4825 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4826   echo $ac_n "(cached) $ac_c" 1>&6
4827 else
4828   ac_save_LIBS="$LIBS"
4829 LIBS="-lnsl  $LIBS"
4830 cat > conftest.$ac_ext <<EOF
4831 #line 4832 "configure"
4832 #include "confdefs.h"
4833
4834 int main() {
4835 main()
4836 ; return 0; }
4837 EOF
4838 if { (eval echo configure:4839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4839   rm -rf conftest*
4840   eval "ac_cv_lib_$ac_lib_var=yes"
4841 else
4842   echo "configure: failed program was:" >&5
4843   cat conftest.$ac_ext >&5
4844   rm -rf conftest*
4845   eval "ac_cv_lib_$ac_lib_var=no"
4846 fi
4847 rm -f conftest*
4848 LIBS="$ac_save_LIBS"
4849
4850 fi
4851 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4852   echo "$ac_t""yes" 1>&6
4853     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4854     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4855   cat >> confdefs.h <<EOF
4856 #define $ac_tr_lib 1
4857 EOF
4858
4859   LIBS="-lnsl $LIBS"
4860
4861 else
4862   echo "$ac_t""no" 1>&6
4863 fi
4864
4865         echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
4866 echo "configure:4867: checking for socket in -linet" >&5
4867 ac_lib_var=`echo inet'_'socket | sed 'y%./+-:%__p__%'`
4868 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4869   echo $ac_n "(cached) $ac_c" 1>&6
4870 else
4871   ac_save_LIBS="$LIBS"
4872 LIBS="-linet  $LIBS"
4873 cat > conftest.$ac_ext <<EOF
4874 #line 4875 "configure"
4875 #include "confdefs.h"
4876 /* Override any gcc2 internal prototype to avoid an error.  */
4877 /* We use char because int might match the return type of a gcc2
4878     builtin and then its argument prototype would still apply.  */
4879 char socket();
4880
4881 int main() {
4882 socket()
4883 ; return 0; }
4884 EOF
4885 if { (eval echo configure:4886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4886   rm -rf conftest*
4887   eval "ac_cv_lib_$ac_lib_var=yes"
4888 else
4889   echo "configure: failed program was:" >&5
4890   cat conftest.$ac_ext >&5
4891   rm -rf conftest*
4892   eval "ac_cv_lib_$ac_lib_var=no"
4893 fi
4894 rm -f conftest*
4895 LIBS="$ac_save_LIBS"
4896
4897 fi
4898 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4899   echo "$ac_t""yes" 1>&6
4900     ac_tr_lib=HAVE_LIB`echo inet | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4901     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4902   cat >> confdefs.h <<EOF
4903 #define $ac_tr_lib 1
4904 EOF
4905
4906   LIBS="-linet $LIBS"
4907
4908 else
4909   echo "$ac_t""no" 1>&6
4910 fi
4911
4912         echo $ac_n "checking for main in -lgen""... $ac_c" 1>&6
4913 echo "configure:4914: checking for main in -lgen" >&5
4914 ac_lib_var=`echo gen'_'main | sed 'y%./+-:%__p__%'`
4915 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
4916   echo $ac_n "(cached) $ac_c" 1>&6
4917 else
4918   ac_save_LIBS="$LIBS"
4919 LIBS="-lgen  $LIBS"
4920 cat > conftest.$ac_ext <<EOF
4921 #line 4922 "configure"
4922 #include "confdefs.h"
4923
4924 int main() {
4925 main()
4926 ; return 0; }
4927 EOF
4928 if { (eval echo configure:4929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4929   rm -rf conftest*
4930   eval "ac_cv_lib_$ac_lib_var=yes"
4931 else
4932   echo "configure: failed program was:" >&5
4933   cat conftest.$ac_ext >&5
4934   rm -rf conftest*
4935   eval "ac_cv_lib_$ac_lib_var=no"
4936 fi
4937 rm -f conftest*
4938 LIBS="$ac_save_LIBS"
4939
4940 fi
4941 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
4942   echo "$ac_t""yes" 1>&6
4943     ac_tr_lib=HAVE_LIB`echo gen | sed -e 's/[^a-zA-Z0-9_]/_/g' \
4944     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
4945   cat >> confdefs.h <<EOF
4946 #define $ac_tr_lib 1
4947 EOF
4948
4949   LIBS="-lgen $LIBS"
4950
4951 else
4952   echo "$ac_t""no" 1>&6
4953 fi
4954
4955
4956 fi
4957
4958
4959 echo $ac_n "checking for select""... $ac_c" 1>&6
4960 echo "configure:4961: checking for select" >&5
4961 if eval "test \"\${ac_cv_func_select+set}\" = set"; then
4962   echo $ac_n "(cached) $ac_c" 1>&6
4963 else
4964   cat > conftest.$ac_ext <<EOF
4965 #line 4966 "configure"
4966 #include "confdefs.h"
4967 /* System header to define __stub macros and hopefully few prototypes,
4968     which can conflict with char select(); below.  */
4969 #include <assert.h>
4970 /* Override any gcc2 internal prototype to avoid an error.  */
4971 /* We use char because int might match the return type of a gcc2
4972     builtin and then its argument prototype would still apply.  */
4973 char select();
4974 char (*f)();
4975
4976 int main() {
4977
4978 /* The GNU C library defines this for functions which it implements
4979     to always fail with ENOSYS.  Some functions are actually named
4980     something starting with __ and the normal name is an alias.  */
4981 #if defined (__stub_select) || defined (__stub___select)
4982 choke me
4983 #else
4984 f = select;
4985 #endif
4986
4987 ; return 0; }
4988 EOF
4989 if { (eval echo configure:4990: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
4990   rm -rf conftest*
4991   eval "ac_cv_func_select=yes"
4992 else
4993   echo "configure: failed program was:" >&5
4994   cat conftest.$ac_ext >&5
4995   rm -rf conftest*
4996   eval "ac_cv_func_select=no"
4997 fi
4998 rm -f conftest*
4999 fi
5000
5001 if eval "test \"`echo '$ac_cv_func_'select`\" = yes"; then
5002   echo "$ac_t""yes" 1>&6
5003   :
5004 else
5005   echo "$ac_t""no" 1>&6
5006 { echo "configure: error: select() required." 1>&2; exit 1; }
5007 fi
5008
5009
5010 if test "${ac_cv_header_winsock_h}" != yes; then
5011                 echo $ac_n "checking types of arguments for select()""... $ac_c" 1>&6
5012 echo "configure:5013: checking types of arguments for select()" >&5
5013  if eval "test \"\${ac_cv_func_select_arg234+set}\" = set"; then
5014   echo $ac_n "(cached) $ac_c" 1>&6
5015 else
5016    if eval "test \"\${ac_cv_func_select_arg1+set}\" = set"; then
5017   echo $ac_n "(cached) $ac_c" 1>&6
5018 else
5019     if eval "test \"\${ac_cv_func_select_arg5+set}\" = set"; then
5020   echo $ac_n "(cached) $ac_c" 1>&6
5021 else
5022      for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do
5023      for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do
5024       for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do
5025        cat > conftest.$ac_ext <<EOF
5026 #line 5027 "configure"
5027 #include "confdefs.h"
5028 #ifdef HAVE_SYS_TYPES_H
5029 #include <sys/types.h>
5030 #endif
5031 #ifdef HAVE_SYS_TIME_H
5032 #include <sys/time.h>
5033 #endif
5034 #ifdef HAVE_SYS_SELECT_H
5035 #include <sys/select.h>
5036 #endif
5037 #ifdef HAVE_SYS_SOCKET_H
5038 #include <sys/socket.h>
5039 #endif
5040 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);
5041 int main() {
5042
5043 ; return 0; }
5044 EOF
5045 if { (eval echo configure:5046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
5046   rm -rf conftest*
5047           ac_not_found=no ; break 3
5048 else
5049   echo "configure: failed program was:" >&5
5050   cat conftest.$ac_ext >&5
5051   rm -rf conftest*
5052   ac_not_found=yes
5053 fi
5054 rm -f conftest*
5055       done
5056      done
5057     done
5058    
5059 fi
5060   
5061 fi
5062  
5063 fi
5064  if test "$ac_not_found" = yes; then
5065   ac_cv_func_select_arg1=int 
5066   ac_cv_func_select_arg234='int *' 
5067   ac_cv_func_select_arg5='struct timeval *'
5068  fi
5069  echo "$ac_t""$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5" 1>&6
5070  cat >> confdefs.h <<EOF
5071 #define SELECT_TYPE_ARG1 $ac_cv_func_select_arg1
5072 EOF
5073
5074  cat >> confdefs.h <<EOF
5075 #define SELECT_TYPE_ARG234 ($ac_cv_func_select_arg234)
5076 EOF
5077
5078  cat >> confdefs.h <<EOF
5079 #define SELECT_TYPE_ARG5 ($ac_cv_func_select_arg5)
5080 EOF
5081
5082
5083 fi
5084
5085
5086 for ac_hdr in regex.h 
5087 do
5088 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5089 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5090 echo "configure:5091: checking for $ac_hdr" >&5
5091 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5092   echo $ac_n "(cached) $ac_c" 1>&6
5093 else
5094   cat > conftest.$ac_ext <<EOF
5095 #line 5096 "configure"
5096 #include "confdefs.h"
5097 #include <$ac_hdr>
5098 EOF
5099 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5100 { (eval echo configure:5101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5101 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5102 if test -z "$ac_err"; then
5103   rm -rf conftest*
5104   eval "ac_cv_header_$ac_safe=yes"
5105 else
5106   echo "$ac_err" >&5
5107   echo "configure: failed program was:" >&5
5108   cat conftest.$ac_ext >&5
5109   rm -rf conftest*
5110   eval "ac_cv_header_$ac_safe=no"
5111 fi
5112 rm -f conftest*
5113 fi
5114 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5115   echo "$ac_t""yes" 1>&6
5116     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5117   cat >> confdefs.h <<EOF
5118 #define $ac_tr_hdr 1
5119 EOF
5120  
5121 else
5122   echo "$ac_t""no" 1>&6
5123 fi
5124 done
5125
5126 if test "$ac_cv_header_regex_h" != yes ; then
5127         { echo "configure: error: POSIX regex.h required." 1>&2; exit 1; }
5128 fi
5129 echo $ac_n "checking for regfree""... $ac_c" 1>&6
5130 echo "configure:5131: checking for regfree" >&5
5131 if eval "test \"\${ac_cv_func_regfree+set}\" = set"; then
5132   echo $ac_n "(cached) $ac_c" 1>&6
5133 else
5134   cat > conftest.$ac_ext <<EOF
5135 #line 5136 "configure"
5136 #include "confdefs.h"
5137 /* System header to define __stub macros and hopefully few prototypes,
5138     which can conflict with char regfree(); below.  */
5139 #include <assert.h>
5140 /* Override any gcc2 internal prototype to avoid an error.  */
5141 /* We use char because int might match the return type of a gcc2
5142     builtin and then its argument prototype would still apply.  */
5143 char regfree();
5144 char (*f)();
5145
5146 int main() {
5147
5148 /* The GNU C library defines this for functions which it implements
5149     to always fail with ENOSYS.  Some functions are actually named
5150     something starting with __ and the normal name is an alias.  */
5151 #if defined (__stub_regfree) || defined (__stub___regfree)
5152 choke me
5153 #else
5154 f = regfree;
5155 #endif
5156
5157 ; return 0; }
5158 EOF
5159 if { (eval echo configure:5160: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5160   rm -rf conftest*
5161   eval "ac_cv_func_regfree=yes"
5162 else
5163   echo "configure: failed program was:" >&5
5164   cat conftest.$ac_ext >&5
5165   rm -rf conftest*
5166   eval "ac_cv_func_regfree=no"
5167 fi
5168 rm -f conftest*
5169 fi
5170
5171 if eval "test \"`echo '$ac_cv_func_'regfree`\" = yes"; then
5172   echo "$ac_t""yes" 1>&6
5173   :
5174 else
5175   echo "$ac_t""no" 1>&6
5176 { echo "configure: error: POSIX regex required." 1>&2; exit 1; }
5177 fi
5178
5179
5180
5181 echo $ac_n "checking for compatible POSIX regex""... $ac_c" 1>&6
5182 echo "configure:5183: checking for compatible POSIX regex" >&5
5183 if eval "test \"\${ol_cv_c_posix_regex+set}\" = set"; then
5184   echo $ac_n "(cached) $ac_c" 1>&6
5185 else
5186   
5187         if test "$cross_compiling" = yes; then
5188   ol_cv_c_posix_regex=cross
5189 else
5190   cat > conftest.$ac_ext <<EOF
5191 #line 5192 "configure"
5192 #include "confdefs.h"
5193
5194 #include <sys/types.h>
5195 #include <regex.h>
5196 static char *pattern, *string;
5197 main()
5198 {
5199         int rc;
5200         regex_t re;
5201
5202         pattern = "^A";
5203
5204         if(regcomp(&re, pattern, 0)) {
5205                 return -1;
5206         }
5207         
5208         string = "ALL MATCH";
5209         
5210         rc = regexec(&re, string, 0, (void*)0, 0);
5211
5212         regfree(&re);
5213
5214         return rc;
5215 }
5216 EOF
5217 if { (eval echo configure:5218: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
5218 then
5219   ol_cv_c_posix_regex=yes
5220 else
5221   echo "configure: failed program was:" >&5
5222   cat conftest.$ac_ext >&5
5223   rm -fr conftest*
5224   ol_cv_c_posix_regex=no
5225 fi
5226 rm -fr conftest*
5227 fi
5228
5229 fi
5230
5231 echo "$ac_t""$ol_cv_c_posix_regex" 1>&6
5232
5233 if test "$ol_cv_c_posix_regex" = no ; then
5234         { echo "configure: error: broken POSIX regex!" 1>&2; exit 1; }
5235 fi
5236
5237 ol_link_dnssrv=no
5238 echo $ac_n "checking for res_query""... $ac_c" 1>&6
5239 echo "configure:5240: checking for res_query" >&5
5240 if eval "test \"\${ac_cv_func_res_query+set}\" = set"; then
5241   echo $ac_n "(cached) $ac_c" 1>&6
5242 else
5243   cat > conftest.$ac_ext <<EOF
5244 #line 5245 "configure"
5245 #include "confdefs.h"
5246 /* System header to define __stub macros and hopefully few prototypes,
5247     which can conflict with char res_query(); below.  */
5248 #include <assert.h>
5249 /* Override any gcc2 internal prototype to avoid an error.  */
5250 /* We use char because int might match the return type of a gcc2
5251     builtin and then its argument prototype would still apply.  */
5252 char res_query();
5253 char (*f)();
5254
5255 int main() {
5256
5257 /* The GNU C library defines this for functions which it implements
5258     to always fail with ENOSYS.  Some functions are actually named
5259     something starting with __ and the normal name is an alias.  */
5260 #if defined (__stub_res_query) || defined (__stub___res_query)
5261 choke me
5262 #else
5263 f = res_query;
5264 #endif
5265
5266 ; return 0; }
5267 EOF
5268 if { (eval echo configure:5269: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5269   rm -rf conftest*
5270   eval "ac_cv_func_res_query=yes"
5271 else
5272   echo "configure: failed program was:" >&5
5273   cat conftest.$ac_ext >&5
5274   rm -rf conftest*
5275   eval "ac_cv_func_res_query=no"
5276 fi
5277 rm -f conftest*
5278 fi
5279
5280 if eval "test \"`echo '$ac_cv_func_'res_query`\" = yes"; then
5281   echo "$ac_t""yes" 1>&6
5282   :
5283 else
5284   echo "$ac_t""no" 1>&6
5285 fi
5286
5287 if test $ac_cv_func_res_query = no ; then 
5288         echo $ac_n "checking for res_query in -lbind""... $ac_c" 1>&6
5289 echo "configure:5290: checking for res_query in -lbind" >&5
5290 ac_lib_var=`echo bind'_'res_query | sed 'y%./+-:%__p__%'`
5291 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5292   echo $ac_n "(cached) $ac_c" 1>&6
5293 else
5294   ac_save_LIBS="$LIBS"
5295 LIBS="-lbind  $LIBS"
5296 cat > conftest.$ac_ext <<EOF
5297 #line 5298 "configure"
5298 #include "confdefs.h"
5299 /* Override any gcc2 internal prototype to avoid an error.  */
5300 /* We use char because int might match the return type of a gcc2
5301     builtin and then its argument prototype would still apply.  */
5302 char res_query();
5303
5304 int main() {
5305 res_query()
5306 ; return 0; }
5307 EOF
5308 if { (eval echo configure:5309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5309   rm -rf conftest*
5310   eval "ac_cv_lib_$ac_lib_var=yes"
5311 else
5312   echo "configure: failed program was:" >&5
5313   cat conftest.$ac_ext >&5
5314   rm -rf conftest*
5315   eval "ac_cv_lib_$ac_lib_var=no"
5316 fi
5317 rm -f conftest*
5318 LIBS="$ac_save_LIBS"
5319
5320 fi
5321 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5322   echo "$ac_t""yes" 1>&6
5323     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5324     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5325   cat >> confdefs.h <<EOF
5326 #define $ac_tr_lib 1
5327 EOF
5328
5329   LIBS="-lbind $LIBS"
5330
5331 else
5332   echo "$ac_t""no" 1>&6
5333 fi
5334
5335         ac_cv_func_res_query=$ac_cv_lib_bind_res_query
5336 fi
5337
5338 if test $ac_cv_func_res_query = no ; then 
5339         echo $ac_n "checking for __res_query in -lbind""... $ac_c" 1>&6
5340 echo "configure:5341: checking for __res_query in -lbind" >&5
5341 ac_lib_var=`echo bind'_'__res_query | sed 'y%./+-:%__p__%'`
5342 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5343   echo $ac_n "(cached) $ac_c" 1>&6
5344 else
5345   ac_save_LIBS="$LIBS"
5346 LIBS="-lbind  $LIBS"
5347 cat > conftest.$ac_ext <<EOF
5348 #line 5349 "configure"
5349 #include "confdefs.h"
5350 /* Override any gcc2 internal prototype to avoid an error.  */
5351 /* We use char because int might match the return type of a gcc2
5352     builtin and then its argument prototype would still apply.  */
5353 char __res_query();
5354
5355 int main() {
5356 __res_query()
5357 ; return 0; }
5358 EOF
5359 if { (eval echo configure:5360: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5360   rm -rf conftest*
5361   eval "ac_cv_lib_$ac_lib_var=yes"
5362 else
5363   echo "configure: failed program was:" >&5
5364   cat conftest.$ac_ext >&5
5365   rm -rf conftest*
5366   eval "ac_cv_lib_$ac_lib_var=no"
5367 fi
5368 rm -f conftest*
5369 LIBS="$ac_save_LIBS"
5370
5371 fi
5372 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5373   echo "$ac_t""yes" 1>&6
5374     ac_tr_lib=HAVE_LIB`echo bind | sed -e 's/[^a-zA-Z0-9_]/_/g' \
5375     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
5376   cat >> confdefs.h <<EOF
5377 #define $ac_tr_lib 1
5378 EOF
5379
5380   LIBS="-lbind $LIBS"
5381
5382 else
5383   echo "$ac_t""no" 1>&6
5384 fi
5385
5386         ac_cv_func_res_query=$ac_cv_lib_bind___res_query
5387 fi
5388
5389 if test $ac_cv_func_res_query = no ; then 
5390         echo $ac_n "checking for res_query in -lresolv""... $ac_c" 1>&6
5391 echo "configure:5392: checking for res_query in -lresolv" >&5
5392 ac_lib_var=`echo resolv'_'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="-lresolv  $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 resolv | 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="-lresolv $LIBS"
5432
5433 else
5434   echo "$ac_t""no" 1>&6
5435 fi
5436
5437         ac_cv_func_res_query=$ac_cv_lib_resolv_res_query
5438 fi
5439
5440 if test "$ac_cv_func_res_query" = yes ; then
5441         cat >> confdefs.h <<\EOF
5442 #define HAVE_RES_QUERY 1
5443 EOF
5444
5445
5446         if test $ol_enable_dnssrv != no ; then
5447                 ol_link_dnssrv=yes
5448         fi
5449 fi
5450
5451 if test "$ol_enable_dnssrv" = yes -a "$ol_link_dnssrv" = no ; then
5452         { echo "configure: error: DNSSRV requires res_query()" 1>&2; exit 1; }
5453 fi
5454
5455 for ac_func in getaddrinfo 
5456 do
5457 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
5458 echo "configure:5459: checking for $ac_func" >&5
5459 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
5460   echo $ac_n "(cached) $ac_c" 1>&6
5461 else
5462   cat > conftest.$ac_ext <<EOF
5463 #line 5464 "configure"
5464 #include "confdefs.h"
5465 /* System header to define __stub macros and hopefully few prototypes,
5466     which can conflict with char $ac_func(); below.  */
5467 #include <assert.h>
5468 /* Override any gcc2 internal prototype to avoid an error.  */
5469 /* We use char because int might match the return type of a gcc2
5470     builtin and then its argument prototype would still apply.  */
5471 char $ac_func();
5472 char (*f)();
5473
5474 int main() {
5475
5476 /* The GNU C library defines this for functions which it implements
5477     to always fail with ENOSYS.  Some functions are actually named
5478     something starting with __ and the normal name is an alias.  */
5479 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5480 choke me
5481 #else
5482 f = $ac_func;
5483 #endif
5484
5485 ; return 0; }
5486 EOF
5487 if { (eval echo configure:5488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5488   rm -rf conftest*
5489   eval "ac_cv_func_$ac_func=yes"
5490 else
5491   echo "configure: failed program was:" >&5
5492   cat conftest.$ac_ext >&5
5493   rm -rf conftest*
5494   eval "ac_cv_func_$ac_func=no"
5495 fi
5496 rm -f conftest*
5497 fi
5498
5499 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
5500   echo "$ac_t""yes" 1>&6
5501     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
5502   cat >> confdefs.h <<EOF
5503 #define $ac_tr_func 1
5504 EOF
5505  
5506 else
5507   echo "$ac_t""no" 1>&6
5508 fi
5509 done
5510
5511
5512 ol_link_ipv6=no
5513 if test $ac_cv_func_getaddrinfo = no ; then
5514         if test $ol_enable_ipv6 = yes ; then
5515                 { echo "configure: error: IPv6 support requires getaddrinfo()" 1>&2; exit 1; }
5516         fi
5517 else
5518         echo $ac_n "checking INET6_ADDRSTRLEN""... $ac_c" 1>&6
5519 echo "configure:5520: checking INET6_ADDRSTRLEN" >&5
5520 if eval "test \"\${ol_cv_inet6_addrstrlen+set}\" = set"; then
5521   echo $ac_n "(cached) $ac_c" 1>&6
5522 else
5523   
5524                 cat > conftest.$ac_ext <<EOF
5525 #line 5526 "configure"
5526 #include "confdefs.h"
5527
5528 #                       include <netinet/in.h>
5529 #                       ifdef INET6_ADDRSTRLEN
5530                                 __has_inet6_addrstrlen__;
5531 #                       endif
5532                 
5533 EOF
5534 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5535   egrep "__has_inet6_addrstrlen__" >/dev/null 2>&1; then
5536   rm -rf conftest*
5537   ol_cv_inet6_addrstrlen=yes
5538 else
5539   rm -rf conftest*
5540   ol_cv_inet6_addrstrlen=no
5541 fi
5542 rm -f conftest*
5543
5544 fi
5545
5546 echo "$ac_t""$ol_cv_inet6_addrstrlen" 1>&6
5547
5548         if test $ol_cv_inet6_addrstrlen = yes ; then
5549                 ol_link_ipv6=yes
5550         elif test $ol_enable_ipv6 = yes ; then
5551                 { echo "configure: error: IPv6 support requires INET6_ADDRSTRLEN" 1>&2; exit 1; }
5552         fi
5553 fi
5554
5555 if test $ol_enable_local != no ; then
5556         for ac_hdr in sys/un.h 
5557 do
5558 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5559 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5560 echo "configure:5561: checking for $ac_hdr" >&5
5561 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5562   echo $ac_n "(cached) $ac_c" 1>&6
5563 else
5564   cat > conftest.$ac_ext <<EOF
5565 #line 5566 "configure"
5566 #include "confdefs.h"
5567 #include <$ac_hdr>
5568 EOF
5569 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5570 { (eval echo configure:5571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5571 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5572 if test -z "$ac_err"; then
5573   rm -rf conftest*
5574   eval "ac_cv_header_$ac_safe=yes"
5575 else
5576   echo "$ac_err" >&5
5577   echo "configure: failed program was:" >&5
5578   cat conftest.$ac_ext >&5
5579   rm -rf conftest*
5580   eval "ac_cv_header_$ac_safe=no"
5581 fi
5582 rm -f conftest*
5583 fi
5584 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5585   echo "$ac_t""yes" 1>&6
5586     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5587   cat >> confdefs.h <<EOF
5588 #define $ac_tr_hdr 1
5589 EOF
5590  
5591 else
5592   echo "$ac_t""no" 1>&6
5593 fi
5594 done
5595
5596
5597         if test $ol_enable_local = auto ; then
5598                 ol_enable_local=$ac_cv_header_sys_un_h
5599         elif test $ac_cv_header_sys_un_h = no ; then
5600                 { echo "configure: error: AF_LOCAL domain support requires sys/un.h" 1>&2; exit 1; }
5601         fi
5602 fi
5603
5604 ol_link_kbind=no
5605 ol_link_kpasswd=no
5606 ol_link_krb5=no
5607 ol_link_krb4=no
5608
5609 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
5610         -o $ol_with_kerberos = k5 -o $ol_with_kerberos = k5only \
5611         -o $ol_with_kerberos = k425 ; then
5612
5613         for ac_hdr in krb5.h
5614 do
5615 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5616 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5617 echo "configure:5618: checking for $ac_hdr" >&5
5618 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5619   echo $ac_n "(cached) $ac_c" 1>&6
5620 else
5621   cat > conftest.$ac_ext <<EOF
5622 #line 5623 "configure"
5623 #include "confdefs.h"
5624 #include <$ac_hdr>
5625 EOF
5626 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5627 { (eval echo configure:5628: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5628 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5629 if test -z "$ac_err"; then
5630   rm -rf conftest*
5631   eval "ac_cv_header_$ac_safe=yes"
5632 else
5633   echo "$ac_err" >&5
5634   echo "configure: failed program was:" >&5
5635   cat conftest.$ac_ext >&5
5636   rm -rf conftest*
5637   eval "ac_cv_header_$ac_safe=no"
5638 fi
5639 rm -f conftest*
5640 fi
5641 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5642   echo "$ac_t""yes" 1>&6
5643     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5644   cat >> confdefs.h <<EOF
5645 #define $ac_tr_hdr 1
5646 EOF
5647  
5648 else
5649   echo "$ac_t""no" 1>&6
5650 fi
5651 done
5652
5653
5654         if test $ac_cv_header_krb5_h = yes ; then
5655                                 for ac_hdr in heim_err.h
5656 do
5657 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5658 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5659 echo "configure:5660: checking for $ac_hdr" >&5
5660 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5661   echo $ac_n "(cached) $ac_c" 1>&6
5662 else
5663   cat > conftest.$ac_ext <<EOF
5664 #line 5665 "configure"
5665 #include "confdefs.h"
5666 #include <$ac_hdr>
5667 EOF
5668 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5669 { (eval echo configure:5670: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5670 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5671 if test -z "$ac_err"; then
5672   rm -rf conftest*
5673   eval "ac_cv_header_$ac_safe=yes"
5674 else
5675   echo "$ac_err" >&5
5676   echo "configure: failed program was:" >&5
5677   cat conftest.$ac_ext >&5
5678   rm -rf conftest*
5679   eval "ac_cv_header_$ac_safe=no"
5680 fi
5681 rm -f conftest*
5682 fi
5683 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5684   echo "$ac_t""yes" 1>&6
5685     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5686   cat >> confdefs.h <<EOF
5687 #define $ac_tr_hdr 1
5688 EOF
5689  
5690 else
5691   echo "$ac_t""no" 1>&6
5692 fi
5693 done
5694
5695                 if test $ac_cv_header_heim_err_h = yes ; then
5696                         krb5_impl=heimdal
5697                 else
5698                         krb5_impl=mit
5699                 fi
5700
5701                 if test $krb5_impl = mit; then
5702                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5703 echo "configure:5704: checking for main in -lkrb5" >&5
5704 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5705 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5706   echo $ac_n "(cached) $ac_c" 1>&6
5707 else
5708   ac_save_LIBS="$LIBS"
5709 LIBS="-lkrb5 -lcrypto -lcom_err $LIBS"
5710 cat > conftest.$ac_ext <<EOF
5711 #line 5712 "configure"
5712 #include "confdefs.h"
5713
5714 int main() {
5715 main()
5716 ; return 0; }
5717 EOF
5718 if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5719   rm -rf conftest*
5720   eval "ac_cv_lib_$ac_lib_var=yes"
5721 else
5722   echo "configure: failed program was:" >&5
5723   cat conftest.$ac_ext >&5
5724   rm -rf conftest*
5725   eval "ac_cv_lib_$ac_lib_var=no"
5726 fi
5727 rm -f conftest*
5728 LIBS="$ac_save_LIBS"
5729
5730 fi
5731 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5732   echo "$ac_t""yes" 1>&6
5733   have_krb5=yes
5734                                 KRB5_LIBS="-lkrb5 -lcrypto -lcom_err"
5735 else
5736   echo "$ac_t""no" 1>&6
5737 have_krb5=no
5738 fi
5739
5740
5741                 elif test $krb5_impl = heimdal; then
5742                         echo $ac_n "checking for main in -lkrb5""... $ac_c" 1>&6
5743 echo "configure:5744: checking for main in -lkrb5" >&5
5744 ac_lib_var=`echo krb5'_'main | sed 'y%./+-:%__p__%'`
5745 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5746   echo $ac_n "(cached) $ac_c" 1>&6
5747 else
5748   ac_save_LIBS="$LIBS"
5749 LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5750 cat > conftest.$ac_ext <<EOF
5751 #line 5752 "configure"
5752 #include "confdefs.h"
5753
5754 int main() {
5755 main()
5756 ; return 0; }
5757 EOF
5758 if { (eval echo configure:5759: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5759   rm -rf conftest*
5760   eval "ac_cv_lib_$ac_lib_var=yes"
5761 else
5762   echo "configure: failed program was:" >&5
5763   cat conftest.$ac_ext >&5
5764   rm -rf conftest*
5765   eval "ac_cv_lib_$ac_lib_var=no"
5766 fi
5767 rm -f conftest*
5768 LIBS="$ac_save_LIBS"
5769
5770 fi
5771 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5772   echo "$ac_t""yes" 1>&6
5773   have_krb5=yes
5774                                 KRB5_LIBS="-lkrb5 -ldes -lasn1 -lroken -lcom_err"
5775 else
5776   echo "$ac_t""no" 1>&6
5777 have_krb5=no
5778 fi
5779
5780
5781                         cat >> confdefs.h <<\EOF
5782 #define HAVE_HEIMDAL_KERBEROS 1
5783 EOF
5784
5785                 else
5786                         have_krb5=no
5787                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5788                 fi
5789
5790                 if test $have_krb5 = yes ; then
5791                         ol_link_krb5=yes
5792
5793                         cat >> confdefs.h <<\EOF
5794 #define HAVE_KRB5 1
5795 EOF
5796
5797
5798                         if test $ol_enable_kpasswd != no ; then
5799                                 ol_link_kpasswd=yes;
5800                         fi
5801
5802                         if test $ol_with_kerberos = k5only ; then
5803                                 ol_with_kerberos=found
5804                         fi
5805
5806                 elif test $ol_with_kerberos != auto ; then
5807                         { echo "configure: error: Required Kerberos 5 support not available" 1>&2; exit 1; }
5808                 fi
5809
5810         fi
5811 fi
5812
5813 if test $ol_link_krb5 = yes -a \( $ol_with_kerberos = yes -o \
5814         $ol_with_kerberos = auto -o $ol_with_kerberos = k425 \) ; then
5815
5816         for ac_hdr in kerberosIV/krb.h kerberosIV/des.h
5817 do
5818 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
5819 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
5820 echo "configure:5821: checking for $ac_hdr" >&5
5821 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
5822   echo $ac_n "(cached) $ac_c" 1>&6
5823 else
5824   cat > conftest.$ac_ext <<EOF
5825 #line 5826 "configure"
5826 #include "confdefs.h"
5827 #include <$ac_hdr>
5828 EOF
5829 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
5830 { (eval echo configure:5831: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
5831 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
5832 if test -z "$ac_err"; then
5833   rm -rf conftest*
5834   eval "ac_cv_header_$ac_safe=yes"
5835 else
5836   echo "$ac_err" >&5
5837   echo "configure: failed program was:" >&5
5838   cat conftest.$ac_ext >&5
5839   rm -rf conftest*
5840   eval "ac_cv_header_$ac_safe=no"
5841 fi
5842 rm -f conftest*
5843 fi
5844 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
5845   echo "$ac_t""yes" 1>&6
5846     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
5847   cat >> confdefs.h <<EOF
5848 #define $ac_tr_hdr 1
5849 EOF
5850  
5851 else
5852   echo "$ac_t""no" 1>&6
5853 fi
5854 done
5855
5856
5857         if test $ac_cv_header_kerberosIV_krb_h = yes ; then
5858                 if test $krb5_impl = mit; then
5859                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5860 echo "configure:5861: checking for main in -lkrb4" >&5
5861 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5862 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5863   echo $ac_n "(cached) $ac_c" 1>&6
5864 else
5865   ac_save_LIBS="$LIBS"
5866 LIBS="-lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err $LIBS"
5867 cat > conftest.$ac_ext <<EOF
5868 #line 5869 "configure"
5869 #include "confdefs.h"
5870
5871 int main() {
5872 main()
5873 ; return 0; }
5874 EOF
5875 if { (eval echo configure:5876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5876   rm -rf conftest*
5877   eval "ac_cv_lib_$ac_lib_var=yes"
5878 else
5879   echo "configure: failed program was:" >&5
5880   cat conftest.$ac_ext >&5
5881   rm -rf conftest*
5882   eval "ac_cv_lib_$ac_lib_var=no"
5883 fi
5884 rm -f conftest*
5885 LIBS="$ac_save_LIBS"
5886
5887 fi
5888 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5889   echo "$ac_t""yes" 1>&6
5890   have_k425=yes
5891                                 KRB4_LIBS="-lkrb4 -ldes425"
5892 else
5893   echo "$ac_t""no" 1>&6
5894 have_k425=no
5895 fi
5896
5897
5898                 elif test $krb5_impl = heimdal; then
5899                         echo $ac_n "checking for main in -lkrb4""... $ac_c" 1>&6
5900 echo "configure:5901: checking for main in -lkrb4" >&5
5901 ac_lib_var=`echo krb4'_'main | sed 'y%./+-:%__p__%'`
5902 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
5903   echo $ac_n "(cached) $ac_c" 1>&6
5904 else
5905   ac_save_LIBS="$LIBS"
5906 LIBS="-lkrb4 -lkrb5 -ldes -lasn1 -lroken -lcom_err $LIBS"
5907 cat > conftest.$ac_ext <<EOF
5908 #line 5909 "configure"
5909 #include "confdefs.h"
5910
5911 int main() {
5912 main()
5913 ; return 0; }
5914 EOF
5915 if { (eval echo configure:5916: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5916   rm -rf conftest*
5917   eval "ac_cv_lib_$ac_lib_var=yes"
5918 else
5919   echo "configure: failed program was:" >&5
5920   cat conftest.$ac_ext >&5
5921   rm -rf conftest*
5922   eval "ac_cv_lib_$ac_lib_var=no"
5923 fi
5924 rm -f conftest*
5925 LIBS="$ac_save_LIBS"
5926
5927 fi
5928 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
5929   echo "$ac_t""yes" 1>&6
5930   have_k425=yes
5931                                 KRB4_LIBS="-lkrb4"
5932 else
5933   echo "$ac_t""no" 1>&6
5934 have_k425=no
5935 fi
5936
5937
5938                 else
5939                         have_425=no
5940                         echo "configure: warning: Unrecongized Kerberos5 Implementation" 1>&2
5941                 fi
5942
5943                 if test $have_k425 = yes ; then
5944                         ol_with_kerberos=found
5945                         ol_link_krb4=yes
5946
5947                         cat >> confdefs.h <<\EOF
5948 #define HAVE_KRB425 1
5949 EOF
5950
5951                         cat >> confdefs.h <<\EOF
5952 #define HAVE_KRB4 1
5953 EOF
5954
5955
5956                         echo $ac_n "checking for des_debug in Kerberos libraries""... $ac_c" 1>&6
5957 echo "configure:5958: checking for des_debug in Kerberos libraries" >&5
5958 if eval "test \"\${ol_cv_var_des_debug+set}\" = set"; then
5959   echo $ac_n "(cached) $ac_c" 1>&6
5960 else
5961   
5962                                                                 save_LIBS="$LIBS"
5963                                 LIBS="$KRB4_LIBS $KRB5_LIBS $LIBS"
5964                                 cat > conftest.$ac_ext <<EOF
5965 #line 5966 "configure"
5966 #include "confdefs.h"
5967
5968 #include <kerberosIV/krb.h>
5969 #include <kerberosIV/des.h>
5970 extern int des_debug;
5971
5972 int main() {
5973
5974 des_debug = 1;
5975
5976 ; return 0; }
5977 EOF
5978 if { (eval echo configure:5979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
5979   rm -rf conftest*
5980   ol_cv_var_des_debug=yes
5981 else
5982   echo "configure: failed program was:" >&5
5983   cat conftest.$ac_ext >&5
5984   rm -rf conftest*
5985   ol_cv_var_des_debug=no
5986 fi
5987 rm -f conftest*
5988                                                                 LIBS="$save_LIBS"
5989                         
5990 fi
5991
5992 echo "$ac_t""$ol_cv_var_des_debug" 1>&6
5993
5994                         if test $ol_cv_var_des_debug = yes ; then
5995                                 cat >> confdefs.h <<\EOF
5996 #define HAVE_DES_DEBUG 1
5997 EOF
5998
5999                         fi
6000
6001                         LIBS="$save_LIBS"
6002                 fi
6003         fi
6004 fi
6005
6006 if test $ol_link_krb5 = yes ; then
6007         ol_with_kerberos=found
6008 fi
6009
6010 if test $ol_with_kerberos = yes -o $ol_with_kerberos = auto \
6011         -o $ol_with_kerberos = k4 -o $ol_with_kerberos = kth ; then
6012
6013         for ac_hdr in krb.h des.h krb-archaeology.h 
6014 do
6015 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6016 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6017 echo "configure:6018: checking for $ac_hdr" >&5
6018 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6019   echo $ac_n "(cached) $ac_c" 1>&6
6020 else
6021   cat > conftest.$ac_ext <<EOF
6022 #line 6023 "configure"
6023 #include "confdefs.h"
6024 #include <$ac_hdr>
6025 EOF
6026 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6027 { (eval echo configure:6028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6028 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6029 if test -z "$ac_err"; then
6030   rm -rf conftest*
6031   eval "ac_cv_header_$ac_safe=yes"
6032 else
6033   echo "$ac_err" >&5
6034   echo "configure: failed program was:" >&5
6035   cat conftest.$ac_ext >&5
6036   rm -rf conftest*
6037   eval "ac_cv_header_$ac_safe=no"
6038 fi
6039 rm -f conftest*
6040 fi
6041 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6042   echo "$ac_t""yes" 1>&6
6043     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6044   cat >> confdefs.h <<EOF
6045 #define $ac_tr_hdr 1
6046 EOF
6047  
6048 else
6049   echo "$ac_t""no" 1>&6
6050 fi
6051 done
6052
6053
6054         if test $ac_cv_header_krb_h = yes ; then
6055                 echo $ac_n "checking for main in -lkrb""... $ac_c" 1>&6
6056 echo "configure:6057: checking for main in -lkrb" >&5
6057 ac_lib_var=`echo krb'_'main | sed 'y%./+-:%__p__%'`
6058 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6059   echo $ac_n "(cached) $ac_c" 1>&6
6060 else
6061   ac_save_LIBS="$LIBS"
6062 LIBS="-lkrb -ldes $LIBS"
6063 cat > conftest.$ac_ext <<EOF
6064 #line 6065 "configure"
6065 #include "confdefs.h"
6066
6067 int main() {
6068 main()
6069 ; return 0; }
6070 EOF
6071 if { (eval echo configure:6072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6072   rm -rf conftest*
6073   eval "ac_cv_lib_$ac_lib_var=yes"
6074 else
6075   echo "configure: failed program was:" >&5
6076   cat conftest.$ac_ext >&5
6077   rm -rf conftest*
6078   eval "ac_cv_lib_$ac_lib_var=no"
6079 fi
6080 rm -f conftest*
6081 LIBS="$ac_save_LIBS"
6082
6083 fi
6084 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6085   echo "$ac_t""yes" 1>&6
6086   have_k4=yes
6087 else
6088   echo "$ac_t""no" 1>&6
6089 have_k4=no
6090 fi
6091
6092
6093                 if test $have_k4 = yes ; then
6094                         ol_with_kerberos=found
6095                         ol_link_krb4=yes
6096
6097                         cat >> confdefs.h <<\EOF
6098 #define HAVE_KRB4 1
6099 EOF
6100
6101
6102                         KRB4_LIBS="-lkrb -ldes"
6103
6104                         if test $ac_cv_header_krb_archaeology_h = yes ; then
6105                                 cat >> confdefs.h <<\EOF
6106 #define HAVE_KTH_KERBEROS 1
6107 EOF
6108
6109                         fi
6110                 fi
6111         fi
6112 fi
6113
6114 if test $ol_link_krb4 = yes -a $ol_enable_kpasswd != no ; then
6115         ol_link_kpasswd=yes
6116 fi
6117
6118 if test $ol_link_krb4 = yes -a $ol_enable_kbind != no ; then
6119         ol_link_kbind=yes
6120
6121 elif test $ol_enable_kbind = yes ; then
6122         { echo "configure: error: Kerberos IV detection failed" 1>&2; exit 1; }
6123 fi
6124
6125 if test $ol_link_krb4 = yes -o $ol_link_krb5 = yes ; then
6126         cat >> confdefs.h <<\EOF
6127 #define HAVE_KERBEROS 1
6128 EOF
6129
6130
6131 elif test $ol_with_kerberos != auto -a $ol_with_kerberos != no ; then
6132         { echo "configure: error: Kerberos detection failed" 1>&2; exit 1; }
6133 fi
6134
6135 ol_link_tls=no
6136 if test $ol_with_tls != no ; then
6137         for ac_hdr in openssl/ssl.h ssl.h
6138 do
6139 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6140 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6141 echo "configure:6142: checking for $ac_hdr" >&5
6142 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6143   echo $ac_n "(cached) $ac_c" 1>&6
6144 else
6145   cat > conftest.$ac_ext <<EOF
6146 #line 6147 "configure"
6147 #include "confdefs.h"
6148 #include <$ac_hdr>
6149 EOF
6150 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6151 { (eval echo configure:6152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6152 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6153 if test -z "$ac_err"; then
6154   rm -rf conftest*
6155   eval "ac_cv_header_$ac_safe=yes"
6156 else
6157   echo "$ac_err" >&5
6158   echo "configure: failed program was:" >&5
6159   cat conftest.$ac_ext >&5
6160   rm -rf conftest*
6161   eval "ac_cv_header_$ac_safe=no"
6162 fi
6163 rm -f conftest*
6164 fi
6165 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6166   echo "$ac_t""yes" 1>&6
6167     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6168   cat >> confdefs.h <<EOF
6169 #define $ac_tr_hdr 1
6170 EOF
6171  
6172 else
6173   echo "$ac_t""no" 1>&6
6174 fi
6175 done
6176
6177         
6178         if test $ac_cv_header_openssl_ssl_h = yes -o $ac_cv_header_ssl_h = yes ; then
6179                 echo $ac_n "checking for SSLeay_add_ssl_algorithms in -lssl""... $ac_c" 1>&6
6180 echo "configure:6181: checking for SSLeay_add_ssl_algorithms in -lssl" >&5
6181 ac_lib_var=`echo ssl'_'SSLeay_add_ssl_algorithms | sed 'y%./+-:%__p__%'`
6182 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6183   echo $ac_n "(cached) $ac_c" 1>&6
6184 else
6185   ac_save_LIBS="$LIBS"
6186 LIBS="-lssl -lcrypto $LIBS"
6187 cat > conftest.$ac_ext <<EOF
6188 #line 6189 "configure"
6189 #include "confdefs.h"
6190 /* Override any gcc2 internal prototype to avoid an error.  */
6191 /* We use char because int might match the return type of a gcc2
6192     builtin and then its argument prototype would still apply.  */
6193 char SSLeay_add_ssl_algorithms();
6194
6195 int main() {
6196 SSLeay_add_ssl_algorithms()
6197 ; return 0; }
6198 EOF
6199 if { (eval echo configure:6200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6200   rm -rf conftest*
6201   eval "ac_cv_lib_$ac_lib_var=yes"
6202 else
6203   echo "configure: failed program was:" >&5
6204   cat conftest.$ac_ext >&5
6205   rm -rf conftest*
6206   eval "ac_cv_lib_$ac_lib_var=no"
6207 fi
6208 rm -f conftest*
6209 LIBS="$ac_save_LIBS"
6210
6211 fi
6212 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6213   echo "$ac_t""yes" 1>&6
6214   have_ssleay=yes
6215                         need_rsaref=no
6216 else
6217   echo "$ac_t""no" 1>&6
6218 have_ssleay=no
6219 fi
6220
6221                         
6222                 if test $have_ssleay = no ; then
6223                         echo $ac_n "checking for SSL_library_init in -lssl""... $ac_c" 1>&6
6224 echo "configure:6225: checking for SSL_library_init in -lssl" >&5
6225 ac_lib_var=`echo ssl'_'SSL_library_init | sed 'y%./+-:%__p__%'`
6226 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6227   echo $ac_n "(cached) $ac_c" 1>&6
6228 else
6229   ac_save_LIBS="$LIBS"
6230 LIBS="-lssl -lcrypto $LIBS"
6231 cat > conftest.$ac_ext <<EOF
6232 #line 6233 "configure"
6233 #include "confdefs.h"
6234 /* Override any gcc2 internal prototype to avoid an error.  */
6235 /* We use char because int might match the return type of a gcc2
6236     builtin and then its argument prototype would still apply.  */
6237 char SSL_library_init();
6238
6239 int main() {
6240 SSL_library_init()
6241 ; return 0; }
6242 EOF
6243 if { (eval echo configure:6244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6244   rm -rf conftest*
6245   eval "ac_cv_lib_$ac_lib_var=yes"
6246 else
6247   echo "configure: failed program was:" >&5
6248   cat conftest.$ac_ext >&5
6249   rm -rf conftest*
6250   eval "ac_cv_lib_$ac_lib_var=no"
6251 fi
6252 rm -f conftest*
6253 LIBS="$ac_save_LIBS"
6254
6255 fi
6256 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6257   echo "$ac_t""yes" 1>&6
6258   have_ssleay=yes
6259                                 need_rsaref=no
6260 else
6261   echo "$ac_t""no" 1>&6
6262 have_ssleay=no
6263 fi
6264
6265                 fi
6266
6267                 if test $have_ssleay = no ; then
6268                         echo $ac_n "checking for ssl3_accept in -lssl""... $ac_c" 1>&6
6269 echo "configure:6270: checking for ssl3_accept in -lssl" >&5
6270 ac_lib_var=`echo ssl'_'ssl3_accept | sed 'y%./+-:%__p__%'`
6271 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
6272   echo $ac_n "(cached) $ac_c" 1>&6
6273 else
6274   ac_save_LIBS="$LIBS"
6275 LIBS="-lssl -lcrypto -lRSAglue -lrsaref $LIBS"
6276 cat > conftest.$ac_ext <<EOF
6277 #line 6278 "configure"
6278 #include "confdefs.h"
6279 /* Override any gcc2 internal prototype to avoid an error.  */
6280 /* We use char because int might match the return type of a gcc2
6281     builtin and then its argument prototype would still apply.  */
6282 char ssl3_accept();
6283
6284 int main() {
6285 ssl3_accept()
6286 ; return 0; }
6287 EOF
6288 if { (eval echo configure:6289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6289   rm -rf conftest*
6290   eval "ac_cv_lib_$ac_lib_var=yes"
6291 else
6292   echo "configure: failed program was:" >&5
6293   cat conftest.$ac_ext >&5
6294   rm -rf conftest*
6295   eval "ac_cv_lib_$ac_lib_var=no"
6296 fi
6297 rm -f conftest*
6298 LIBS="$ac_save_LIBS"
6299
6300 fi
6301 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
6302   echo "$ac_t""yes" 1>&6
6303   have_ssleay=yes
6304                                 need_rsaref=yes
6305 else
6306   echo "$ac_t""no" 1>&6
6307 have_ssleay=no
6308 fi
6309
6310                 fi
6311
6312                 if test $have_ssleay = yes ; then
6313                         ol_with_tls=found
6314                         ol_link_tls=yes
6315
6316                         cat >> confdefs.h <<\EOF
6317 #define HAVE_SSLEAY 1
6318 EOF
6319
6320
6321                         if test $need_rsaref = yes; then
6322                                 cat >> confdefs.h <<\EOF
6323 #define HAVE_RSAREF 1
6324 EOF
6325
6326
6327                                 TLS_LIBS="-lssl -lcrypto -lRSAglue -lrsaref"
6328                         else
6329                                 TLS_LIBS="-lssl -lcrypto"
6330                         fi
6331                 fi
6332         fi
6333
6334 else
6335         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6336 fi
6337
6338 if test $ol_link_tls = yes ; then
6339         cat >> confdefs.h <<\EOF
6340 #define HAVE_TLS 1
6341 EOF
6342
6343
6344 elif test $ol_with_tls = auto ; then
6345         echo "configure: warning: Could not locate TLS/SSL package" 1>&2
6346         echo "configure: warning: TLS privacy protection not supported!" 1>&2
6347
6348 elif test $ol_with_tls != no ; then
6349         { echo "configure: error: Could not locate TLS/SSL package" 1>&2; exit 1; }
6350 fi
6351
6352 for ac_func in \
6353         ctime_r                 \
6354         gethostbyname_r gethostbyaddr_r \
6355
6356 do
6357 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
6358 echo "configure:6359: checking for $ac_func" >&5
6359 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
6360   echo $ac_n "(cached) $ac_c" 1>&6
6361 else
6362   cat > conftest.$ac_ext <<EOF
6363 #line 6364 "configure"
6364 #include "confdefs.h"
6365 /* System header to define __stub macros and hopefully few prototypes,
6366     which can conflict with char $ac_func(); below.  */
6367 #include <assert.h>
6368 /* Override any gcc2 internal prototype to avoid an error.  */
6369 /* We use char because int might match the return type of a gcc2
6370     builtin and then its argument prototype would still apply.  */
6371 char $ac_func();
6372 char (*f)();
6373
6374 int main() {
6375
6376 /* The GNU C library defines this for functions which it implements
6377     to always fail with ENOSYS.  Some functions are actually named
6378     something starting with __ and the normal name is an alias.  */
6379 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6380 choke me
6381 #else
6382 f = $ac_func;
6383 #endif
6384
6385 ; return 0; }
6386 EOF
6387 if { (eval echo configure:6388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6388   rm -rf conftest*
6389   eval "ac_cv_func_$ac_func=yes"
6390 else
6391   echo "configure: failed program was:" >&5
6392   cat conftest.$ac_ext >&5
6393   rm -rf conftest*
6394   eval "ac_cv_func_$ac_func=no"
6395 fi
6396 rm -f conftest*
6397 fi
6398
6399 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
6400   echo "$ac_t""yes" 1>&6
6401     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
6402   cat >> confdefs.h <<EOF
6403 #define $ac_tr_func 1
6404 EOF
6405  
6406 else
6407   echo "$ac_t""no" 1>&6
6408 fi
6409 done
6410
6411
6412 if test "$ac_cv_func_ctime_r" = no ; then
6413         ol_cv_func_ctime_r_nargs=0
6414 else
6415         echo $ac_n "checking number of arguments of ctime_r""... $ac_c" 1>&6
6416 echo "configure:6417: checking number of arguments of ctime_r" >&5
6417 if eval "test \"\${ol_cv_func_ctime_r_nargs+set}\" = set"; then
6418   echo $ac_n "(cached) $ac_c" 1>&6
6419 else
6420   cat > conftest.$ac_ext <<EOF
6421 #line 6422 "configure"
6422 #include "confdefs.h"
6423 #include <time.h>
6424 int main() {
6425 time_t ti; char *buffer; ctime_r(&ti,buffer,32);
6426 ; return 0; }
6427 EOF
6428 if { (eval echo configure:6429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6429   rm -rf conftest*
6430   ol_cv_func_ctime_r_nargs3=yes
6431 else
6432   echo "configure: failed program was:" >&5
6433   cat conftest.$ac_ext >&5
6434   rm -rf conftest*
6435   ol_cv_func_ctime_r_nargs3=no
6436 fi
6437 rm -f conftest*
6438
6439         cat > conftest.$ac_ext <<EOF
6440 #line 6441 "configure"
6441 #include "confdefs.h"
6442 #include <time.h>
6443 int main() {
6444 time_t ti; char *buffer; ctime_r(&ti,buffer);
6445 ; return 0; }
6446 EOF
6447 if { (eval echo configure:6448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6448   rm -rf conftest*
6449   ol_cv_func_ctime_r_nargs2=yes
6450 else
6451   echo "configure: failed program was:" >&5
6452   cat conftest.$ac_ext >&5
6453   rm -rf conftest*
6454   ol_cv_func_ctime_r_nargs2=no
6455 fi
6456 rm -f conftest*
6457
6458         if test $ol_cv_func_ctime_r_nargs3 = yes -a \
6459                 $ol_cv_func_ctime_r_nargs2 = no ; then
6460
6461                 ol_cv_func_ctime_r_nargs=3
6462
6463         elif test $ol_cv_func_ctime_r_nargs3 = no -a \
6464                 $ol_cv_func_ctime_r_nargs2 = yes ; then
6465
6466                 ol_cv_func_ctime_r_nargs=2
6467
6468         else
6469                 ol_cv_func_ctime_r_nargs=0
6470         fi
6471   
6472 fi
6473
6474 echo "$ac_t""$ol_cv_func_ctime_r_nargs" 1>&6
6475
6476   if test $ol_cv_func_ctime_r_nargs -gt 1 ; then
6477         cat >> confdefs.h <<EOF
6478 #define CTIME_R_NARGS $ol_cv_func_ctime_r_nargs
6479 EOF
6480
6481   fi
6482
6483 fi
6484
6485 if test "$ac_cv_func_gethostbyname_r" = yes ; then
6486         echo $ac_n "checking number of arguments of gethostbyname_r""... $ac_c" 1>&6
6487 echo "configure:6488: checking number of arguments of gethostbyname_r" >&5
6488 if eval "test \"\${ol_cv_func_gethostbyname_r_nargs+set}\" = set"; then
6489   echo $ac_n "(cached) $ac_c" 1>&6
6490 else
6491   cat > conftest.$ac_ext <<EOF
6492 #line 6493 "configure"
6493 #include "confdefs.h"
6494 #include <sys/types.h>
6495 #include <sys/socket.h>
6496 #include <netinet/in.h>
6497 #include <netdb.h>
6498 #define BUFSIZE (sizeof(struct hostent)+10)
6499 int main() {
6500 struct hostent hent; char buffer[BUFSIZE];
6501                 int bufsize=BUFSIZE;int h_errno;
6502                 (void)gethostbyname_r("segovia.cs.purdue.edu", &hent,
6503                         buffer, bufsize, &h_errno);
6504 ; return 0; }
6505 EOF
6506 if { (eval echo configure:6507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6507   rm -rf conftest*
6508   ol_cv_func_gethostbyname_r_nargs5=yes
6509 else
6510   echo "configure: failed program was:" >&5
6511   cat conftest.$ac_ext >&5
6512   rm -rf conftest*
6513   ol_cv_func_gethostbyname_r_nargs5=no
6514 fi
6515 rm -f conftest*
6516
6517         cat > conftest.$ac_ext <<EOF
6518 #line 6519 "configure"
6519 #include "confdefs.h"
6520 #include <sys/types.h>
6521 #include <sys/socket.h>
6522 #include <netinet/in.h>
6523 #include <netdb.h>
6524 #define BUFSIZE (sizeof(struct hostent)+10)
6525 int main() {
6526 struct hostent hent;struct hostent *rhent;
6527                 char buffer[BUFSIZE];
6528                 int bufsize=BUFSIZE;int h_errno;
6529                 (void)gethostbyname_r("localhost", &hent, buffer, bufsize,
6530                         &rhent, &h_errno);
6531 ; return 0; }
6532 EOF
6533 if { (eval echo configure:6534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6534   rm -rf conftest*
6535   ol_cv_func_gethostbyname_r_nargs6=yes
6536 else
6537   echo "configure: failed program was:" >&5
6538   cat conftest.$ac_ext >&5
6539   rm -rf conftest*
6540   ol_cv_func_gethostbyname_r_nargs6=no
6541 fi
6542 rm -f conftest*
6543
6544         if test $ol_cv_func_gethostbyname_r_nargs5 = yes -a \
6545                 $ol_cv_func_gethostbyname_r_nargs6 = no ; then
6546
6547                 ol_cv_func_gethostbyname_r_nargs=5
6548
6549         elif test $ol_cv_func_gethostbyname_r_nargs5 = no -a \
6550                 $ol_cv_func_gethostbyname_r_nargs6 = yes ; then
6551
6552                 ol_cv_func_gethostbyname_r_nargs=6
6553
6554         else
6555                 ol_cv_func_gethostbyname_r_nargs=0
6556         fi
6557   
6558 fi
6559
6560 echo "$ac_t""$ol_cv_func_gethostbyname_r_nargs" 1>&6
6561   if test $ol_cv_func_gethostbyname_r_nargs -gt 1 ; then
6562         cat >> confdefs.h <<EOF
6563 #define GETHOSTBYNAME_R_NARGS $ol_cv_func_gethostbyname_r_nargs
6564 EOF
6565
6566   fi
6567
6568 else
6569         ol_cv_func_gethostbyname_r_nargs=0
6570 fi
6571  
6572 if test "$ac_cv_func_gethostbyaddr_r" = yes ; then
6573         echo $ac_n "checking number of arguments of gethostbyaddr_r""... $ac_c" 1>&6
6574 echo "configure:6575: checking number of arguments of gethostbyaddr_r" >&5
6575 if eval "test \"\${ol_cv_func_gethostbyaddr_r_nargs+set}\" = set"; then
6576   echo $ac_n "(cached) $ac_c" 1>&6
6577 else
6578   cat > conftest.$ac_ext <<EOF
6579 #line 6580 "configure"
6580 #include "confdefs.h"
6581 #include <sys/types.h>
6582 #include <sys/socket.h>
6583 #include <netinet/in.h>
6584 #include <netdb.h>
6585 #define BUFSIZE (sizeof(struct hostent)+10)
6586 int main() {
6587 struct hostent hent; char buffer[BUFSIZE]; 
6588             struct in_addr add;
6589             size_t alen=sizeof(struct in_addr);
6590             int bufsize=BUFSIZE;int h_errno;
6591                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6592                         alen, AF_INET, &hent, buffer, bufsize, &h_errno);
6593 ; return 0; }
6594 EOF
6595 if { (eval echo configure:6596: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6596   rm -rf conftest*
6597   ol_cv_func_gethostbyaddr_r_nargs7=yes
6598 else
6599   echo "configure: failed program was:" >&5
6600   cat conftest.$ac_ext >&5
6601   rm -rf conftest*
6602   ol_cv_func_gethostbyaddr_r_nargs7=no
6603 fi
6604 rm -f conftest*
6605
6606         cat > conftest.$ac_ext <<EOF
6607 #line 6608 "configure"
6608 #include "confdefs.h"
6609 #include <sys/types.h>
6610 #include <sys/socket.h>
6611 #include <netinet/in.h>
6612 #include <netdb.h>
6613 #define BUFSIZE (sizeof(struct hostent)+10)
6614 int main() {
6615 struct hostent hent;
6616                 struct hostent *rhent; char buffer[BUFSIZE]; 
6617                 struct in_addr add;
6618                 size_t alen=sizeof(struct in_addr);
6619                 int bufsize=BUFSIZE;int h_errno;
6620                 (void)gethostbyaddr_r( (void *)&(add.s_addr),
6621                         alen, AF_INET, &hent, buffer, bufsize, 
6622                         &rhent, &h_errno);
6623 ; return 0; }
6624 EOF
6625 if { (eval echo configure:6626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
6626   rm -rf conftest*
6627   ol_cv_func_gethostbyaddr_r_nargs8=yes
6628 else
6629   echo "configure: failed program was:" >&5
6630   cat conftest.$ac_ext >&5
6631   rm -rf conftest*
6632   ol_cv_func_gethostbyaddr_r_nargs8=no
6633 fi
6634 rm -f conftest*
6635
6636         if test $ol_cv_func_gethostbyaddr_r_nargs7 = yes -a \
6637                 $ol_cv_func_gethostbyaddr_r_nargs8 = no ; then
6638
6639                 ol_cv_func_gethostbyaddr_r_nargs=7
6640
6641         elif test $ol_cv_func_gethostbyaddr_r_nargs7 = no -a \
6642                 $ol_cv_func_gethostbyaddr_r_nargs8 = yes ; then
6643
6644                 ol_cv_func_gethostbyaddr_r_nargs=8
6645
6646         else
6647                 ol_cv_func_gethostbyaddr_r_nargs=0
6648         fi
6649   
6650 fi
6651
6652 echo "$ac_t""$ol_cv_func_gethostbyaddr_r_nargs" 1>&6
6653   if test $ol_cv_func_gethostbyaddr_r_nargs -gt 1 ; then
6654     cat >> confdefs.h <<EOF
6655 #define GETHOSTBYADDR_R_NARGS $ol_cv_func_gethostbyaddr_r_nargs
6656 EOF
6657
6658   fi
6659
6660 else
6661         ol_cv_func_gethostbyaddr_r_nargs=0
6662 fi
6663
6664 if test "$ac_cv_func_ctime_r" = yes \
6665         -a "$ol_cv_func_ctime_r_nargs" -ge 2 \
6666         -a "$ol_cv_func_ctime_r_nargs" -le 3 \
6667         -a "$ac_cv_func_gethostbyname_r" = yes \
6668         -a "$ol_cv_func_gethostbyname_r_nargs" -ge 5 \
6669         -a "$ol_cv_func_gethostbyname_r_nargs" -le 6 \
6670         -a "$ac_cv_func_gethostbyaddr_r" = yes \
6671         -a "$ol_cv_func_gethostbyaddr_r_nargs" -ge 5 \
6672         -a "$ol_cv_func_gethostbyaddr_r_nargs" -le 6 \
6673         ; then
6674  
6675         cat >> confdefs.h <<\EOF
6676 #define LDAP_API_FEATURE_X_OPENLDAP_REENTRANT 1
6677 EOF
6678
6679 fi
6680
6681 ol_link_threads=no
6682
6683 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6684         -o $ol_with_threads = nt ; then
6685
6686         
6687         echo $ac_n "checking for NT Threads""... $ac_c" 1>&6
6688 echo "configure:6689: checking for NT Threads" >&5
6689 if eval "test \"\${ol_cv_nt_threads+set}\" = set"; then
6690   echo $ac_n "(cached) $ac_c" 1>&6
6691 else
6692   
6693                 echo $ac_n "checking for _beginthread""... $ac_c" 1>&6
6694 echo "configure:6695: checking for _beginthread" >&5
6695 if eval "test \"\${ac_cv_func__beginthread+set}\" = set"; then
6696   echo $ac_n "(cached) $ac_c" 1>&6
6697 else
6698   cat > conftest.$ac_ext <<EOF
6699 #line 6700 "configure"
6700 #include "confdefs.h"
6701 /* System header to define __stub macros and hopefully few prototypes,
6702     which can conflict with char _beginthread(); below.  */
6703 #include <assert.h>
6704 /* Override any gcc2 internal prototype to avoid an error.  */
6705 /* We use char because int might match the return type of a gcc2
6706     builtin and then its argument prototype would still apply.  */
6707 char _beginthread();
6708 char (*f)();
6709
6710 int main() {
6711
6712 /* The GNU C library defines this for functions which it implements
6713     to always fail with ENOSYS.  Some functions are actually named
6714     something starting with __ and the normal name is an alias.  */
6715 #if defined (__stub__beginthread) || defined (__stub____beginthread)
6716 choke me
6717 #else
6718 f = _beginthread;
6719 #endif
6720
6721 ; return 0; }
6722 EOF
6723 if { (eval echo configure:6724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
6724   rm -rf conftest*
6725   eval "ac_cv_func__beginthread=yes"
6726 else
6727   echo "configure: failed program was:" >&5
6728   cat conftest.$ac_ext >&5
6729   rm -rf conftest*
6730   eval "ac_cv_func__beginthread=no"
6731 fi
6732 rm -f conftest*
6733 fi
6734
6735 if eval "test \"`echo '$ac_cv_func_'_beginthread`\" = yes"; then
6736   echo "$ac_t""yes" 1>&6
6737   ol_cv_nt_threads=yes
6738 else
6739   echo "$ac_t""no" 1>&6
6740 ol_cv_nt_threads=no
6741 fi
6742
6743         
6744 fi
6745
6746 echo "$ac_t""$ol_cv_nt_threads" 1>&6
6747
6748         if test $ol_cv_nt_threads = yes ; then
6749                 cat >> confdefs.h <<\EOF
6750 #define HAVE_NT_THREADS 1
6751 EOF
6752
6753         fi
6754
6755
6756         if test "$ol_cv_nt_threads" = yes ; then
6757         ol_link_threads=nt
6758         ol_with_threads=found
6759         ol_with_yielding_select=yes
6760
6761                 cat >> confdefs.h <<\EOF
6762 #define HAVE_NT_SERVICE_MANAGER 1
6763 EOF
6764
6765                 cat >> confdefs.h <<\EOF
6766 #define HAVE_NT_EVENT_LOG 1
6767 EOF
6768
6769         fi
6770
6771         if test $ol_with_threads = nt ; then
6772                 { echo "configure: error: could not locate NT Threads" 1>&2; exit 1; }
6773         fi
6774 fi
6775
6776 if test $ol_with_threads = auto -o $ol_with_threads = yes \
6777         -o $ol_with_threads = posix ; then
6778
6779         for ac_hdr in pthread.h
6780 do
6781 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6782 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6783 echo "configure:6784: checking for $ac_hdr" >&5
6784 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6785   echo $ac_n "(cached) $ac_c" 1>&6
6786 else
6787   cat > conftest.$ac_ext <<EOF
6788 #line 6789 "configure"
6789 #include "confdefs.h"
6790 #include <$ac_hdr>
6791 EOF
6792 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6793 { (eval echo configure:6794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6794 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6795 if test -z "$ac_err"; then
6796   rm -rf conftest*
6797   eval "ac_cv_header_$ac_safe=yes"
6798 else
6799   echo "$ac_err" >&5
6800   echo "configure: failed program was:" >&5
6801   cat conftest.$ac_ext >&5
6802   rm -rf conftest*
6803   eval "ac_cv_header_$ac_safe=no"
6804 fi
6805 rm -f conftest*
6806 fi
6807 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6808   echo "$ac_t""yes" 1>&6
6809     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6810   cat >> confdefs.h <<EOF
6811 #define $ac_tr_hdr 1
6812 EOF
6813  
6814 else
6815   echo "$ac_t""no" 1>&6
6816 fi
6817 done
6818
6819
6820         if test $ac_cv_header_pthread_h = yes ; then
6821                 echo $ac_n "checking POSIX thread version""... $ac_c" 1>&6
6822 echo "configure:6823: checking POSIX thread version" >&5
6823 if eval "test \"\${ol_cv_pthread_version+set}\" = set"; then
6824   echo $ac_n "(cached) $ac_c" 1>&6
6825 else
6826   
6827         cat > conftest.$ac_ext <<EOF
6828 #line 6829 "configure"
6829 #include "confdefs.h"
6830
6831 #               include <pthread.h>
6832                 /* this check could be improved */
6833 #               ifdef PTHREAD_ONCE_INIT
6834                         pthread_version_final;
6835 #               endif
6836         
6837 EOF
6838 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6839   egrep "pthread_version_final" >/dev/null 2>&1; then
6840   rm -rf conftest*
6841   ol_pthread_final=yes
6842 else
6843   rm -rf conftest*
6844   ol_pthread_final=no
6845 fi
6846 rm -f conftest*
6847
6848
6849         cat > conftest.$ac_ext <<EOF
6850 #line 6851 "configure"
6851 #include "confdefs.h"
6852
6853 #               include <pthread.h>
6854                 /* this check could be improved */
6855 #               ifdef pthread_once_init
6856                         pthread_version_draft4;
6857 #               endif
6858         
6859 EOF
6860 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6861   egrep "pthread_version_draft4" >/dev/null 2>&1; then
6862   rm -rf conftest*
6863   ol_pthread_draft4=yes
6864 else
6865   rm -rf conftest*
6866   ol_pthread_draft4=no
6867 fi
6868 rm -f conftest*
6869
6870
6871         if test $ol_pthread_final = yes -a $ol_pthread_draft4 = no; then
6872                 ol_cv_pthread_version=final
6873         elif test $ol_pthread_final = no -a $ol_pthread_draft4 = yes; then
6874                 ol_cv_pthread_version=draft4
6875         else
6876                 ol_cv_pthread_version=unknown
6877         fi
6878
6879 fi
6880
6881 echo "$ac_t""$ol_cv_pthread_version" 1>&6
6882
6883
6884                 if test $ol_cv_pthread_version = final ; then
6885                         cat >> confdefs.h <<\EOF
6886 #define HAVE_PTHREADS_FINAL 1
6887 EOF
6888
6889                 elif test $ol_cv_pthread_version = draft4 ; then
6890                         cat >> confdefs.h <<\EOF
6891 #define HAVE_PTHREADS_D4 1
6892 EOF
6893
6894                 else
6895                         { echo "configure: error: unknown pthread version" 1>&2; exit 1; }
6896                 fi
6897
6898                 # consider threads found
6899                 ol_with_threads=found
6900
6901                 
6902         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
6903 echo "configure:6904: checking for LinuxThreads pthread.h" >&5
6904 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
6905   echo $ac_n "(cached) $ac_c" 1>&6
6906 else
6907   cat > conftest.$ac_ext <<EOF
6908 #line 6909 "configure"
6909 #include "confdefs.h"
6910 #include <pthread.h>
6911 EOF
6912 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6913   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
6914   rm -rf conftest*
6915   ol_cv_header_linux_threads=yes
6916 else
6917   rm -rf conftest*
6918   ol_cv_header_linux_threads=no
6919 fi
6920 rm -f conftest*
6921
6922                 
6923 fi
6924
6925 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
6926         if test $ol_cv_header_linux_threads = yes; then
6927                 cat >> confdefs.h <<\EOF
6928 #define HAVE_LINUX_THREADS 1
6929 EOF
6930
6931         fi
6932
6933                 
6934         echo $ac_n "checking for GNU Pth pthread.h""... $ac_c" 1>&6
6935 echo "configure:6936: checking for GNU Pth pthread.h" >&5
6936 if eval "test \"\${ol_cv_header_gnu_pth_pthread_h+set}\" = set"; then
6937   echo $ac_n "(cached) $ac_c" 1>&6
6938 else
6939   cat > conftest.$ac_ext <<EOF
6940 #line 6941 "configure"
6941 #include "confdefs.h"
6942 #include <pthread.h>
6943 #ifdef _POSIX_THREAD_IS_GNU_PTH
6944         __gnu_pth__;
6945 #endif
6946
6947 EOF
6948 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6949   egrep "__gnu_pth__" >/dev/null 2>&1; then
6950   rm -rf conftest*
6951   ol_cv_header_gnu_pth_pthread_h=yes
6952 else
6953   rm -rf conftest*
6954   ol_cv_header_gnu_pth_pthread_h=no
6955 fi
6956 rm -f conftest*
6957
6958                 
6959 fi
6960
6961 echo "$ac_t""$ol_cv_header_gnu_pth_pthread_h" 1>&6
6962
6963
6964                 if test $ol_cv_header_gnu_pth_pthread_h = no ; then
6965                         for ac_hdr in sched.h
6966 do
6967 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
6968 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
6969 echo "configure:6970: checking for $ac_hdr" >&5
6970 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
6971   echo $ac_n "(cached) $ac_c" 1>&6
6972 else
6973   cat > conftest.$ac_ext <<EOF
6974 #line 6975 "configure"
6975 #include "confdefs.h"
6976 #include <$ac_hdr>
6977 EOF
6978 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
6979 { (eval echo configure:6980: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
6980 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
6981 if test -z "$ac_err"; then
6982   rm -rf conftest*
6983   eval "ac_cv_header_$ac_safe=yes"
6984 else
6985   echo "$ac_err" >&5
6986   echo "configure: failed program was:" >&5
6987   cat conftest.$ac_ext >&5
6988   rm -rf conftest*
6989   eval "ac_cv_header_$ac_safe=no"
6990 fi
6991 rm -f conftest*
6992 fi
6993 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
6994   echo "$ac_t""yes" 1>&6
6995     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
6996   cat >> confdefs.h <<EOF
6997 #define $ac_tr_hdr 1
6998 EOF
6999  
7000 else
7001   echo "$ac_t""no" 1>&6
7002 fi
7003 done
7004
7005                 fi
7006
7007                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
7008                                 echo $ac_n "checking for pthread_create in default libraries""... $ac_c" 1>&6
7009 echo "configure:7010: checking for pthread_create in default libraries" >&5
7010 if eval "test \"\${ol_cv_pthread_create+set}\" = set"; then
7011   echo $ac_n "(cached) $ac_c" 1>&6
7012 else
7013   
7014                 if test "$cross_compiling" = yes; then
7015   cat > conftest.$ac_ext <<EOF
7016 #line 7017 "configure"
7017 #include "confdefs.h"
7018 /* pthread test headers */
7019 #include <pthread.h>
7020 #ifndef NULL
7021 #define NULL (void*)0
7022 #endif
7023
7024 static void *task(p)
7025         void *p;
7026 {
7027         return (void *) (p == NULL);
7028 }
7029
7030 int main() {
7031
7032         /* pthread test function */
7033         pthread_t t;
7034         int status;
7035 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7036         /* This system (e.g. AIX) defaults detached; must override */
7037         pthread_attr_t attr;
7038
7039         status = pthread_attr_init(&attr);
7040         if( status ) exit( status );
7041
7042         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7043         if( status ) exit( status );
7044
7045 #define ATTR    &attr
7046 #else
7047 #if HAVE_PTHREADS_D4
7048 #define ATTR    pthread_attr_default
7049 #else
7050 #define ATTR    NULL
7051 #endif
7052 #endif
7053         /* make sure pthread_create() isn't just a stub */
7054         status = pthread_create(&t, ATTR, task, NULL);
7055         if( status ) exit( status );
7056
7057         /* make sure pthread_detach() isn't just a stub */
7058 #if HAVE_PTHREADS_D4
7059         status = pthread_detach( &t );
7060 #else
7061         status = pthread_detach( t );
7062 #endif
7063
7064 #ifdef HAVE_LINUX_THREADS
7065         pthread_kill_other_threads_np();
7066 #endif
7067
7068         exit( status );
7069
7070 ; return 0; }
7071 EOF
7072 if { (eval echo configure:7073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7073   rm -rf conftest*
7074   ol_cv_pthread_create=yes
7075 else
7076   echo "configure: failed program was:" >&5
7077   cat conftest.$ac_ext >&5
7078   rm -rf conftest*
7079   ol_cv_pthread_create=no
7080 fi
7081 rm -f conftest*
7082 else
7083   cat > conftest.$ac_ext <<EOF
7084 #line 7085 "configure"
7085 #include "confdefs.h"
7086 /* pthread test headers */
7087 #include <pthread.h>
7088 #ifndef NULL
7089 #define NULL (void*)0
7090 #endif
7091
7092 static void *task(p)
7093         void *p;
7094 {
7095         return (void *) (p == NULL);
7096 }
7097
7098
7099 int main(argc, argv)
7100         int argc;
7101         char **argv;
7102 {
7103
7104         /* pthread test function */
7105         pthread_t t;
7106         int status;
7107 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7108         /* This system (e.g. AIX) defaults detached; must override */
7109         pthread_attr_t attr;
7110
7111         status = pthread_attr_init(&attr);
7112         if( status ) exit( status );
7113
7114         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7115         if( status ) exit( status );
7116
7117 #define ATTR    &attr
7118 #else
7119 #if HAVE_PTHREADS_D4
7120 #define ATTR    pthread_attr_default
7121 #else
7122 #define ATTR    NULL
7123 #endif
7124 #endif
7125         /* make sure pthread_create() isn't just a stub */
7126         status = pthread_create(&t, ATTR, task, NULL);
7127         if( status ) exit( status );
7128
7129         /* make sure pthread_detach() isn't just a stub */
7130 #if HAVE_PTHREADS_D4
7131         status = pthread_detach( &t );
7132 #else
7133         status = pthread_detach( t );
7134 #endif
7135
7136 #ifdef HAVE_LINUX_THREADS
7137         pthread_kill_other_threads_np();
7138 #endif
7139
7140         exit( status );
7141
7142 }
7143
7144 EOF
7145 if { (eval echo configure:7146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7146 then
7147   ol_cv_pthread_create=yes
7148 else
7149   echo "configure: failed program was:" >&5
7150   cat conftest.$ac_ext >&5
7151   rm -fr conftest*
7152   ol_cv_pthread_create=no
7153 fi
7154 rm -fr conftest*
7155 fi
7156
7157 fi
7158
7159 echo "$ac_t""$ol_cv_pthread_create" 1>&6
7160
7161                 if test $ol_cv_pthread_create != no ; then
7162                         ol_link_threads=posix
7163                         ol_link_pthreads=""
7164                 fi
7165                 
7166                 # Pthread try link: -kthread (ol_cv_pthread_kthread)
7167 if test "$ol_link_threads" = no ; then
7168         # try -kthread
7169         echo $ac_n "checking for pthread link with -kthread""... $ac_c" 1>&6
7170 echo "configure:7171: checking for pthread link with -kthread" >&5
7171 if eval "test \"\${ol_cv_pthread_kthread+set}\" = set"; then
7172   echo $ac_n "(cached) $ac_c" 1>&6
7173 else
7174   
7175                 # save the flags
7176                 ol_LIBS="$LIBS"
7177                 LIBS="-kthread $LIBS"
7178
7179                 if test "$cross_compiling" = yes; then
7180   cat > conftest.$ac_ext <<EOF
7181 #line 7182 "configure"
7182 #include "confdefs.h"
7183 /* pthread test headers */
7184 #include <pthread.h>
7185 #ifndef NULL
7186 #define NULL (void*)0
7187 #endif
7188
7189 static void *task(p)
7190         void *p;
7191 {
7192         return (void *) (p == NULL);
7193 }
7194
7195 int main() {
7196
7197         /* pthread test function */
7198         pthread_t t;
7199         int status;
7200 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7201         /* This system (e.g. AIX) defaults detached; must override */
7202         pthread_attr_t attr;
7203
7204         status = pthread_attr_init(&attr);
7205         if( status ) exit( status );
7206
7207         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7208         if( status ) exit( status );
7209
7210 #define ATTR    &attr
7211 #else
7212 #if HAVE_PTHREADS_D4
7213 #define ATTR    pthread_attr_default
7214 #else
7215 #define ATTR    NULL
7216 #endif
7217 #endif
7218         /* make sure pthread_create() isn't just a stub */
7219         status = pthread_create(&t, ATTR, task, NULL);
7220         if( status ) exit( status );
7221
7222         /* make sure pthread_detach() isn't just a stub */
7223 #if HAVE_PTHREADS_D4
7224         status = pthread_detach( &t );
7225 #else
7226         status = pthread_detach( t );
7227 #endif
7228
7229 #ifdef HAVE_LINUX_THREADS
7230         pthread_kill_other_threads_np();
7231 #endif
7232
7233         exit( status );
7234
7235 ; return 0; }
7236 EOF
7237 if { (eval echo configure:7238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7238   rm -rf conftest*
7239   ol_cv_pthread_kthread=yes
7240 else
7241   echo "configure: failed program was:" >&5
7242   cat conftest.$ac_ext >&5
7243   rm -rf conftest*
7244   ol_cv_pthread_kthread=no
7245 fi
7246 rm -f conftest*
7247 else
7248   cat > conftest.$ac_ext <<EOF
7249 #line 7250 "configure"
7250 #include "confdefs.h"
7251 /* pthread test headers */
7252 #include <pthread.h>
7253 #ifndef NULL
7254 #define NULL (void*)0
7255 #endif
7256
7257 static void *task(p)
7258         void *p;
7259 {
7260         return (void *) (p == NULL);
7261 }
7262
7263
7264 int main(argc, argv)
7265         int argc;
7266         char **argv;
7267 {
7268
7269         /* pthread test function */
7270         pthread_t t;
7271         int status;
7272 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7273         /* This system (e.g. AIX) defaults detached; must override */
7274         pthread_attr_t attr;
7275
7276         status = pthread_attr_init(&attr);
7277         if( status ) exit( status );
7278
7279         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7280         if( status ) exit( status );
7281
7282 #define ATTR    &attr
7283 #else
7284 #if HAVE_PTHREADS_D4
7285 #define ATTR    pthread_attr_default
7286 #else
7287 #define ATTR    NULL
7288 #endif
7289 #endif
7290         /* make sure pthread_create() isn't just a stub */
7291         status = pthread_create(&t, ATTR, task, NULL);
7292         if( status ) exit( status );
7293
7294         /* make sure pthread_detach() isn't just a stub */
7295 #if HAVE_PTHREADS_D4
7296         status = pthread_detach( &t );
7297 #else
7298         status = pthread_detach( t );
7299 #endif
7300
7301 #ifdef HAVE_LINUX_THREADS
7302         pthread_kill_other_threads_np();
7303 #endif
7304
7305         exit( status );
7306
7307 }
7308
7309 EOF
7310 if { (eval echo configure:7311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7311 then
7312   ol_cv_pthread_kthread=yes
7313 else
7314   echo "configure: failed program was:" >&5
7315   cat conftest.$ac_ext >&5
7316   rm -fr conftest*
7317   ol_cv_pthread_kthread=no
7318 fi
7319 rm -fr conftest*
7320 fi
7321
7322
7323                 # restore the LIBS
7324                 LIBS="$ol_LIBS"
7325         
7326 fi
7327
7328 echo "$ac_t""$ol_cv_pthread_kthread" 1>&6
7329
7330         if test $ol_cv_pthread_kthread = yes ; then
7331                 ol_link_pthreads="-kthread"
7332                 ol_link_threads=posix
7333         fi
7334 fi
7335
7336                 # Pthread try link: -pthread (ol_cv_pthread_pthread)
7337 if test "$ol_link_threads" = no ; then
7338         # try -pthread
7339         echo $ac_n "checking for pthread link with -pthread""... $ac_c" 1>&6
7340 echo "configure:7341: checking for pthread link with -pthread" >&5
7341 if eval "test \"\${ol_cv_pthread_pthread+set}\" = set"; then
7342   echo $ac_n "(cached) $ac_c" 1>&6
7343 else
7344   
7345                 # save the flags
7346                 ol_LIBS="$LIBS"
7347                 LIBS="-pthread $LIBS"
7348
7349                 if test "$cross_compiling" = yes; then
7350   cat > conftest.$ac_ext <<EOF
7351 #line 7352 "configure"
7352 #include "confdefs.h"
7353 /* pthread test headers */
7354 #include <pthread.h>
7355 #ifndef NULL
7356 #define NULL (void*)0
7357 #endif
7358
7359 static void *task(p)
7360         void *p;
7361 {
7362         return (void *) (p == NULL);
7363 }
7364
7365 int main() {
7366
7367         /* pthread test function */
7368         pthread_t t;
7369         int status;
7370 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7371         /* This system (e.g. AIX) defaults detached; must override */
7372         pthread_attr_t attr;
7373
7374         status = pthread_attr_init(&attr);
7375         if( status ) exit( status );
7376
7377         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7378         if( status ) exit( status );
7379
7380 #define ATTR    &attr
7381 #else
7382 #if HAVE_PTHREADS_D4
7383 #define ATTR    pthread_attr_default
7384 #else
7385 #define ATTR    NULL
7386 #endif
7387 #endif
7388         /* make sure pthread_create() isn't just a stub */
7389         status = pthread_create(&t, ATTR, task, NULL);
7390         if( status ) exit( status );
7391
7392         /* make sure pthread_detach() isn't just a stub */
7393 #if HAVE_PTHREADS_D4
7394         status = pthread_detach( &t );
7395 #else
7396         status = pthread_detach( t );
7397 #endif
7398
7399 #ifdef HAVE_LINUX_THREADS
7400         pthread_kill_other_threads_np();
7401 #endif
7402
7403         exit( status );
7404
7405 ; return 0; }
7406 EOF
7407 if { (eval echo configure:7408: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7408   rm -rf conftest*
7409   ol_cv_pthread_pthread=yes
7410 else
7411   echo "configure: failed program was:" >&5
7412   cat conftest.$ac_ext >&5
7413   rm -rf conftest*
7414   ol_cv_pthread_pthread=no
7415 fi
7416 rm -f conftest*
7417 else
7418   cat > conftest.$ac_ext <<EOF
7419 #line 7420 "configure"
7420 #include "confdefs.h"
7421 /* pthread test headers */
7422 #include <pthread.h>
7423 #ifndef NULL
7424 #define NULL (void*)0
7425 #endif
7426
7427 static void *task(p)
7428         void *p;
7429 {
7430         return (void *) (p == NULL);
7431 }
7432
7433
7434 int main(argc, argv)
7435         int argc;
7436         char **argv;
7437 {
7438
7439         /* pthread test function */
7440         pthread_t t;
7441         int status;
7442 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7443         /* This system (e.g. AIX) defaults detached; must override */
7444         pthread_attr_t attr;
7445
7446         status = pthread_attr_init(&attr);
7447         if( status ) exit( status );
7448
7449         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7450         if( status ) exit( status );
7451
7452 #define ATTR    &attr
7453 #else
7454 #if HAVE_PTHREADS_D4
7455 #define ATTR    pthread_attr_default
7456 #else
7457 #define ATTR    NULL
7458 #endif
7459 #endif
7460         /* make sure pthread_create() isn't just a stub */
7461         status = pthread_create(&t, ATTR, task, NULL);
7462         if( status ) exit( status );
7463
7464         /* make sure pthread_detach() isn't just a stub */
7465 #if HAVE_PTHREADS_D4
7466         status = pthread_detach( &t );
7467 #else
7468         status = pthread_detach( t );
7469 #endif
7470
7471 #ifdef HAVE_LINUX_THREADS
7472         pthread_kill_other_threads_np();
7473 #endif
7474
7475         exit( status );
7476
7477 }
7478
7479 EOF
7480 if { (eval echo configure:7481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7481 then
7482   ol_cv_pthread_pthread=yes
7483 else
7484   echo "configure: failed program was:" >&5
7485   cat conftest.$ac_ext >&5
7486   rm -fr conftest*
7487   ol_cv_pthread_pthread=no
7488 fi
7489 rm -fr conftest*
7490 fi
7491
7492
7493                 # restore the LIBS
7494                 LIBS="$ol_LIBS"
7495         
7496 fi
7497
7498 echo "$ac_t""$ol_cv_pthread_pthread" 1>&6
7499
7500         if test $ol_cv_pthread_pthread = yes ; then
7501                 ol_link_pthreads="-pthread"
7502                 ol_link_threads=posix
7503         fi
7504 fi
7505
7506                 # Pthread try link: -pthreads (ol_cv_pthread_pthreads)
7507 if test "$ol_link_threads" = no ; then
7508         # try -pthreads
7509         echo $ac_n "checking for pthread link with -pthreads""... $ac_c" 1>&6
7510 echo "configure:7511: checking for pthread link with -pthreads" >&5
7511 if eval "test \"\${ol_cv_pthread_pthreads+set}\" = set"; then
7512   echo $ac_n "(cached) $ac_c" 1>&6
7513 else
7514   
7515                 # save the flags
7516                 ol_LIBS="$LIBS"
7517                 LIBS="-pthreads $LIBS"
7518
7519                 if test "$cross_compiling" = yes; then
7520   cat > conftest.$ac_ext <<EOF
7521 #line 7522 "configure"
7522 #include "confdefs.h"
7523 /* pthread test headers */
7524 #include <pthread.h>
7525 #ifndef NULL
7526 #define NULL (void*)0
7527 #endif
7528
7529 static void *task(p)
7530         void *p;
7531 {
7532         return (void *) (p == NULL);
7533 }
7534
7535 int main() {
7536
7537         /* pthread test function */
7538         pthread_t t;
7539         int status;
7540 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7541         /* This system (e.g. AIX) defaults detached; must override */
7542         pthread_attr_t attr;
7543
7544         status = pthread_attr_init(&attr);
7545         if( status ) exit( status );
7546
7547         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7548         if( status ) exit( status );
7549
7550 #define ATTR    &attr
7551 #else
7552 #if HAVE_PTHREADS_D4
7553 #define ATTR    pthread_attr_default
7554 #else
7555 #define ATTR    NULL
7556 #endif
7557 #endif
7558         /* make sure pthread_create() isn't just a stub */
7559         status = pthread_create(&t, ATTR, task, NULL);
7560         if( status ) exit( status );
7561
7562         /* make sure pthread_detach() isn't just a stub */
7563 #if HAVE_PTHREADS_D4
7564         status = pthread_detach( &t );
7565 #else
7566         status = pthread_detach( t );
7567 #endif
7568
7569 #ifdef HAVE_LINUX_THREADS
7570         pthread_kill_other_threads_np();
7571 #endif
7572
7573         exit( status );
7574
7575 ; return 0; }
7576 EOF
7577 if { (eval echo configure:7578: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7578   rm -rf conftest*
7579   ol_cv_pthread_pthreads=yes
7580 else
7581   echo "configure: failed program was:" >&5
7582   cat conftest.$ac_ext >&5
7583   rm -rf conftest*
7584   ol_cv_pthread_pthreads=no
7585 fi
7586 rm -f conftest*
7587 else
7588   cat > conftest.$ac_ext <<EOF
7589 #line 7590 "configure"
7590 #include "confdefs.h"
7591 /* pthread test headers */
7592 #include <pthread.h>
7593 #ifndef NULL
7594 #define NULL (void*)0
7595 #endif
7596
7597 static void *task(p)
7598         void *p;
7599 {
7600         return (void *) (p == NULL);
7601 }
7602
7603
7604 int main(argc, argv)
7605         int argc;
7606         char **argv;
7607 {
7608
7609         /* pthread test function */
7610         pthread_t t;
7611         int status;
7612 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7613         /* This system (e.g. AIX) defaults detached; must override */
7614         pthread_attr_t attr;
7615
7616         status = pthread_attr_init(&attr);
7617         if( status ) exit( status );
7618
7619         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7620         if( status ) exit( status );
7621
7622 #define ATTR    &attr
7623 #else
7624 #if HAVE_PTHREADS_D4
7625 #define ATTR    pthread_attr_default
7626 #else
7627 #define ATTR    NULL
7628 #endif
7629 #endif
7630         /* make sure pthread_create() isn't just a stub */
7631         status = pthread_create(&t, ATTR, task, NULL);
7632         if( status ) exit( status );
7633
7634         /* make sure pthread_detach() isn't just a stub */
7635 #if HAVE_PTHREADS_D4
7636         status = pthread_detach( &t );
7637 #else
7638         status = pthread_detach( t );
7639 #endif
7640
7641 #ifdef HAVE_LINUX_THREADS
7642         pthread_kill_other_threads_np();
7643 #endif
7644
7645         exit( status );
7646
7647 }
7648
7649 EOF
7650 if { (eval echo configure:7651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7651 then
7652   ol_cv_pthread_pthreads=yes
7653 else
7654   echo "configure: failed program was:" >&5
7655   cat conftest.$ac_ext >&5
7656   rm -fr conftest*
7657   ol_cv_pthread_pthreads=no
7658 fi
7659 rm -fr conftest*
7660 fi
7661
7662
7663                 # restore the LIBS
7664                 LIBS="$ol_LIBS"
7665         
7666 fi
7667
7668 echo "$ac_t""$ol_cv_pthread_pthreads" 1>&6
7669
7670         if test $ol_cv_pthread_pthreads = yes ; then
7671                 ol_link_pthreads="-pthreads"
7672                 ol_link_threads=posix
7673         fi
7674 fi
7675
7676                 # Pthread try link: -mthreads (ol_cv_pthread_mthreads)
7677 if test "$ol_link_threads" = no ; then
7678         # try -mthreads
7679         echo $ac_n "checking for pthread link with -mthreads""... $ac_c" 1>&6
7680 echo "configure:7681: checking for pthread link with -mthreads" >&5
7681 if eval "test \"\${ol_cv_pthread_mthreads+set}\" = set"; then
7682   echo $ac_n "(cached) $ac_c" 1>&6
7683 else
7684   
7685                 # save the flags
7686                 ol_LIBS="$LIBS"
7687                 LIBS="-mthreads $LIBS"
7688
7689                 if test "$cross_compiling" = yes; then
7690   cat > conftest.$ac_ext <<EOF
7691 #line 7692 "configure"
7692 #include "confdefs.h"
7693 /* pthread test headers */
7694 #include <pthread.h>
7695 #ifndef NULL
7696 #define NULL (void*)0
7697 #endif
7698
7699 static void *task(p)
7700         void *p;
7701 {
7702         return (void *) (p == NULL);
7703 }
7704
7705 int main() {
7706
7707         /* pthread test function */
7708         pthread_t t;
7709         int status;
7710 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7711         /* This system (e.g. AIX) defaults detached; must override */
7712         pthread_attr_t attr;
7713
7714         status = pthread_attr_init(&attr);
7715         if( status ) exit( status );
7716
7717         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7718         if( status ) exit( status );
7719
7720 #define ATTR    &attr
7721 #else
7722 #if HAVE_PTHREADS_D4
7723 #define ATTR    pthread_attr_default
7724 #else
7725 #define ATTR    NULL
7726 #endif
7727 #endif
7728         /* make sure pthread_create() isn't just a stub */
7729         status = pthread_create(&t, ATTR, task, NULL);
7730         if( status ) exit( status );
7731
7732         /* make sure pthread_detach() isn't just a stub */
7733 #if HAVE_PTHREADS_D4
7734         status = pthread_detach( &t );
7735 #else
7736         status = pthread_detach( t );
7737 #endif
7738
7739 #ifdef HAVE_LINUX_THREADS
7740         pthread_kill_other_threads_np();
7741 #endif
7742
7743         exit( status );
7744
7745 ; return 0; }
7746 EOF
7747 if { (eval echo configure:7748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7748   rm -rf conftest*
7749   ol_cv_pthread_mthreads=yes
7750 else
7751   echo "configure: failed program was:" >&5
7752   cat conftest.$ac_ext >&5
7753   rm -rf conftest*
7754   ol_cv_pthread_mthreads=no
7755 fi
7756 rm -f conftest*
7757 else
7758   cat > conftest.$ac_ext <<EOF
7759 #line 7760 "configure"
7760 #include "confdefs.h"
7761 /* pthread test headers */
7762 #include <pthread.h>
7763 #ifndef NULL
7764 #define NULL (void*)0
7765 #endif
7766
7767 static void *task(p)
7768         void *p;
7769 {
7770         return (void *) (p == NULL);
7771 }
7772
7773
7774 int main(argc, argv)
7775         int argc;
7776         char **argv;
7777 {
7778
7779         /* pthread test function */
7780         pthread_t t;
7781         int status;
7782 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7783         /* This system (e.g. AIX) defaults detached; must override */
7784         pthread_attr_t attr;
7785
7786         status = pthread_attr_init(&attr);
7787         if( status ) exit( status );
7788
7789         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7790         if( status ) exit( status );
7791
7792 #define ATTR    &attr
7793 #else
7794 #if HAVE_PTHREADS_D4
7795 #define ATTR    pthread_attr_default
7796 #else
7797 #define ATTR    NULL
7798 #endif
7799 #endif
7800         /* make sure pthread_create() isn't just a stub */
7801         status = pthread_create(&t, ATTR, task, NULL);
7802         if( status ) exit( status );
7803
7804         /* make sure pthread_detach() isn't just a stub */
7805 #if HAVE_PTHREADS_D4
7806         status = pthread_detach( &t );
7807 #else
7808         status = pthread_detach( t );
7809 #endif
7810
7811 #ifdef HAVE_LINUX_THREADS
7812         pthread_kill_other_threads_np();
7813 #endif
7814
7815         exit( status );
7816
7817 }
7818
7819 EOF
7820 if { (eval echo configure:7821: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7821 then
7822   ol_cv_pthread_mthreads=yes
7823 else
7824   echo "configure: failed program was:" >&5
7825   cat conftest.$ac_ext >&5
7826   rm -fr conftest*
7827   ol_cv_pthread_mthreads=no
7828 fi
7829 rm -fr conftest*
7830 fi
7831
7832
7833                 # restore the LIBS
7834                 LIBS="$ol_LIBS"
7835         
7836 fi
7837
7838 echo "$ac_t""$ol_cv_pthread_mthreads" 1>&6
7839
7840         if test $ol_cv_pthread_mthreads = yes ; then
7841                 ol_link_pthreads="-mthreads"
7842                 ol_link_threads=posix
7843         fi
7844 fi
7845
7846                 # Pthread try link: -thread (ol_cv_pthread_thread)
7847 if test "$ol_link_threads" = no ; then
7848         # try -thread
7849         echo $ac_n "checking for pthread link with -thread""... $ac_c" 1>&6
7850 echo "configure:7851: checking for pthread link with -thread" >&5
7851 if eval "test \"\${ol_cv_pthread_thread+set}\" = set"; then
7852   echo $ac_n "(cached) $ac_c" 1>&6
7853 else
7854   
7855                 # save the flags
7856                 ol_LIBS="$LIBS"
7857                 LIBS="-thread $LIBS"
7858
7859                 if test "$cross_compiling" = yes; then
7860   cat > conftest.$ac_ext <<EOF
7861 #line 7862 "configure"
7862 #include "confdefs.h"
7863 /* pthread test headers */
7864 #include <pthread.h>
7865 #ifndef NULL
7866 #define NULL (void*)0
7867 #endif
7868
7869 static void *task(p)
7870         void *p;
7871 {
7872         return (void *) (p == NULL);
7873 }
7874
7875 int main() {
7876
7877         /* pthread test function */
7878         pthread_t t;
7879         int status;
7880 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7881         /* This system (e.g. AIX) defaults detached; must override */
7882         pthread_attr_t attr;
7883
7884         status = pthread_attr_init(&attr);
7885         if( status ) exit( status );
7886
7887         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7888         if( status ) exit( status );
7889
7890 #define ATTR    &attr
7891 #else
7892 #if HAVE_PTHREADS_D4
7893 #define ATTR    pthread_attr_default
7894 #else
7895 #define ATTR    NULL
7896 #endif
7897 #endif
7898         /* make sure pthread_create() isn't just a stub */
7899         status = pthread_create(&t, ATTR, task, NULL);
7900         if( status ) exit( status );
7901
7902         /* make sure pthread_detach() isn't just a stub */
7903 #if HAVE_PTHREADS_D4
7904         status = pthread_detach( &t );
7905 #else
7906         status = pthread_detach( t );
7907 #endif
7908
7909 #ifdef HAVE_LINUX_THREADS
7910         pthread_kill_other_threads_np();
7911 #endif
7912
7913         exit( status );
7914
7915 ; return 0; }
7916 EOF
7917 if { (eval echo configure:7918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
7918   rm -rf conftest*
7919   ol_cv_pthread_thread=yes
7920 else
7921   echo "configure: failed program was:" >&5
7922   cat conftest.$ac_ext >&5
7923   rm -rf conftest*
7924   ol_cv_pthread_thread=no
7925 fi
7926 rm -f conftest*
7927 else
7928   cat > conftest.$ac_ext <<EOF
7929 #line 7930 "configure"
7930 #include "confdefs.h"
7931 /* pthread test headers */
7932 #include <pthread.h>
7933 #ifndef NULL
7934 #define NULL (void*)0
7935 #endif
7936
7937 static void *task(p)
7938         void *p;
7939 {
7940         return (void *) (p == NULL);
7941 }
7942
7943
7944 int main(argc, argv)
7945         int argc;
7946         char **argv;
7947 {
7948
7949         /* pthread test function */
7950         pthread_t t;
7951         int status;
7952 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
7953         /* This system (e.g. AIX) defaults detached; must override */
7954         pthread_attr_t attr;
7955
7956         status = pthread_attr_init(&attr);
7957         if( status ) exit( status );
7958
7959         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
7960         if( status ) exit( status );
7961
7962 #define ATTR    &attr
7963 #else
7964 #if HAVE_PTHREADS_D4
7965 #define ATTR    pthread_attr_default
7966 #else
7967 #define ATTR    NULL
7968 #endif
7969 #endif
7970         /* make sure pthread_create() isn't just a stub */
7971         status = pthread_create(&t, ATTR, task, NULL);
7972         if( status ) exit( status );
7973
7974         /* make sure pthread_detach() isn't just a stub */
7975 #if HAVE_PTHREADS_D4
7976         status = pthread_detach( &t );
7977 #else
7978         status = pthread_detach( t );
7979 #endif
7980
7981 #ifdef HAVE_LINUX_THREADS
7982         pthread_kill_other_threads_np();
7983 #endif
7984
7985         exit( status );
7986
7987 }
7988
7989 EOF
7990 if { (eval echo configure:7991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
7991 then
7992   ol_cv_pthread_thread=yes
7993 else
7994   echo "configure: failed program was:" >&5
7995   cat conftest.$ac_ext >&5
7996   rm -fr conftest*
7997   ol_cv_pthread_thread=no
7998 fi
7999 rm -fr conftest*
8000 fi
8001
8002
8003                 # restore the LIBS
8004                 LIBS="$ol_LIBS"
8005         
8006 fi
8007
8008 echo "$ac_t""$ol_cv_pthread_thread" 1>&6
8009
8010         if test $ol_cv_pthread_thread = yes ; then
8011                 ol_link_pthreads="-thread"
8012                 ol_link_threads=posix
8013         fi
8014 fi
8015
8016
8017                 # Pthread try link: -lpthread -lmach -lexc -lc_r (ol_cv_pthread_lpthread_lmach_lexc_lc_r)
8018 if test "$ol_link_threads" = no ; then
8019         # try -lpthread -lmach -lexc -lc_r
8020         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc -lc_r""... $ac_c" 1>&6
8021 echo "configure:8022: checking for pthread link with -lpthread -lmach -lexc -lc_r" >&5
8022 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc_lc_r+set}\" = set"; then
8023   echo $ac_n "(cached) $ac_c" 1>&6
8024 else
8025   
8026                 # save the flags
8027                 ol_LIBS="$LIBS"
8028                 LIBS="-lpthread -lmach -lexc -lc_r $LIBS"
8029
8030                 if test "$cross_compiling" = yes; then
8031   cat > conftest.$ac_ext <<EOF
8032 #line 8033 "configure"
8033 #include "confdefs.h"
8034 /* pthread test headers */
8035 #include <pthread.h>
8036 #ifndef NULL
8037 #define NULL (void*)0
8038 #endif
8039
8040 static void *task(p)
8041         void *p;
8042 {
8043         return (void *) (p == NULL);
8044 }
8045
8046 int main() {
8047
8048         /* pthread test function */
8049         pthread_t t;
8050         int status;
8051 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8052         /* This system (e.g. AIX) defaults detached; must override */
8053         pthread_attr_t attr;
8054
8055         status = pthread_attr_init(&attr);
8056         if( status ) exit( status );
8057
8058         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8059         if( status ) exit( status );
8060
8061 #define ATTR    &attr
8062 #else
8063 #if HAVE_PTHREADS_D4
8064 #define ATTR    pthread_attr_default
8065 #else
8066 #define ATTR    NULL
8067 #endif
8068 #endif
8069         /* make sure pthread_create() isn't just a stub */
8070         status = pthread_create(&t, ATTR, task, NULL);
8071         if( status ) exit( status );
8072
8073         /* make sure pthread_detach() isn't just a stub */
8074 #if HAVE_PTHREADS_D4
8075         status = pthread_detach( &t );
8076 #else
8077         status = pthread_detach( t );
8078 #endif
8079
8080 #ifdef HAVE_LINUX_THREADS
8081         pthread_kill_other_threads_np();
8082 #endif
8083
8084         exit( status );
8085
8086 ; return 0; }
8087 EOF
8088 if { (eval echo configure:8089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8089   rm -rf conftest*
8090   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8091 else
8092   echo "configure: failed program was:" >&5
8093   cat conftest.$ac_ext >&5
8094   rm -rf conftest*
8095   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8096 fi
8097 rm -f conftest*
8098 else
8099   cat > conftest.$ac_ext <<EOF
8100 #line 8101 "configure"
8101 #include "confdefs.h"
8102 /* pthread test headers */
8103 #include <pthread.h>
8104 #ifndef NULL
8105 #define NULL (void*)0
8106 #endif
8107
8108 static void *task(p)
8109         void *p;
8110 {
8111         return (void *) (p == NULL);
8112 }
8113
8114
8115 int main(argc, argv)
8116         int argc;
8117         char **argv;
8118 {
8119
8120         /* pthread test function */
8121         pthread_t t;
8122         int status;
8123 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8124         /* This system (e.g. AIX) defaults detached; must override */
8125         pthread_attr_t attr;
8126
8127         status = pthread_attr_init(&attr);
8128         if( status ) exit( status );
8129
8130         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8131         if( status ) exit( status );
8132
8133 #define ATTR    &attr
8134 #else
8135 #if HAVE_PTHREADS_D4
8136 #define ATTR    pthread_attr_default
8137 #else
8138 #define ATTR    NULL
8139 #endif
8140 #endif
8141         /* make sure pthread_create() isn't just a stub */
8142         status = pthread_create(&t, ATTR, task, NULL);
8143         if( status ) exit( status );
8144
8145         /* make sure pthread_detach() isn't just a stub */
8146 #if HAVE_PTHREADS_D4
8147         status = pthread_detach( &t );
8148 #else
8149         status = pthread_detach( t );
8150 #endif
8151
8152 #ifdef HAVE_LINUX_THREADS
8153         pthread_kill_other_threads_np();
8154 #endif
8155
8156         exit( status );
8157
8158 }
8159
8160 EOF
8161 if { (eval echo configure:8162: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8162 then
8163   ol_cv_pthread_lpthread_lmach_lexc_lc_r=yes
8164 else
8165   echo "configure: failed program was:" >&5
8166   cat conftest.$ac_ext >&5
8167   rm -fr conftest*
8168   ol_cv_pthread_lpthread_lmach_lexc_lc_r=no
8169 fi
8170 rm -fr conftest*
8171 fi
8172
8173
8174                 # restore the LIBS
8175                 LIBS="$ol_LIBS"
8176         
8177 fi
8178
8179 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc_lc_r" 1>&6
8180
8181         if test $ol_cv_pthread_lpthread_lmach_lexc_lc_r = yes ; then
8182                 ol_link_pthreads="-lpthread -lmach -lexc -lc_r"
8183                 ol_link_threads=posix
8184         fi
8185 fi
8186
8187                 # Pthread try link: -lpthread -lmach -lexc (ol_cv_pthread_lpthread_lmach_lexc)
8188 if test "$ol_link_threads" = no ; then
8189         # try -lpthread -lmach -lexc
8190         echo $ac_n "checking for pthread link with -lpthread -lmach -lexc""... $ac_c" 1>&6
8191 echo "configure:8192: checking for pthread link with -lpthread -lmach -lexc" >&5
8192 if eval "test \"\${ol_cv_pthread_lpthread_lmach_lexc+set}\" = set"; then
8193   echo $ac_n "(cached) $ac_c" 1>&6
8194 else
8195   
8196                 # save the flags
8197                 ol_LIBS="$LIBS"
8198                 LIBS="-lpthread -lmach -lexc $LIBS"
8199
8200                 if test "$cross_compiling" = yes; then
8201   cat > conftest.$ac_ext <<EOF
8202 #line 8203 "configure"
8203 #include "confdefs.h"
8204 /* pthread test headers */
8205 #include <pthread.h>
8206 #ifndef NULL
8207 #define NULL (void*)0
8208 #endif
8209
8210 static void *task(p)
8211         void *p;
8212 {
8213         return (void *) (p == NULL);
8214 }
8215
8216 int main() {
8217
8218         /* pthread test function */
8219         pthread_t t;
8220         int status;
8221 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8222         /* This system (e.g. AIX) defaults detached; must override */
8223         pthread_attr_t attr;
8224
8225         status = pthread_attr_init(&attr);
8226         if( status ) exit( status );
8227
8228         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8229         if( status ) exit( status );
8230
8231 #define ATTR    &attr
8232 #else
8233 #if HAVE_PTHREADS_D4
8234 #define ATTR    pthread_attr_default
8235 #else
8236 #define ATTR    NULL
8237 #endif
8238 #endif
8239         /* make sure pthread_create() isn't just a stub */
8240         status = pthread_create(&t, ATTR, task, NULL);
8241         if( status ) exit( status );
8242
8243         /* make sure pthread_detach() isn't just a stub */
8244 #if HAVE_PTHREADS_D4
8245         status = pthread_detach( &t );
8246 #else
8247         status = pthread_detach( t );
8248 #endif
8249
8250 #ifdef HAVE_LINUX_THREADS
8251         pthread_kill_other_threads_np();
8252 #endif
8253
8254         exit( status );
8255
8256 ; return 0; }
8257 EOF
8258 if { (eval echo configure:8259: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8259   rm -rf conftest*
8260   ol_cv_pthread_lpthread_lmach_lexc=yes
8261 else
8262   echo "configure: failed program was:" >&5
8263   cat conftest.$ac_ext >&5
8264   rm -rf conftest*
8265   ol_cv_pthread_lpthread_lmach_lexc=no
8266 fi
8267 rm -f conftest*
8268 else
8269   cat > conftest.$ac_ext <<EOF
8270 #line 8271 "configure"
8271 #include "confdefs.h"
8272 /* pthread test headers */
8273 #include <pthread.h>
8274 #ifndef NULL
8275 #define NULL (void*)0
8276 #endif
8277
8278 static void *task(p)
8279         void *p;
8280 {
8281         return (void *) (p == NULL);
8282 }
8283
8284
8285 int main(argc, argv)
8286         int argc;
8287         char **argv;
8288 {
8289
8290         /* pthread test function */
8291         pthread_t t;
8292         int status;
8293 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8294         /* This system (e.g. AIX) defaults detached; must override */
8295         pthread_attr_t attr;
8296
8297         status = pthread_attr_init(&attr);
8298         if( status ) exit( status );
8299
8300         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8301         if( status ) exit( status );
8302
8303 #define ATTR    &attr
8304 #else
8305 #if HAVE_PTHREADS_D4
8306 #define ATTR    pthread_attr_default
8307 #else
8308 #define ATTR    NULL
8309 #endif
8310 #endif
8311         /* make sure pthread_create() isn't just a stub */
8312         status = pthread_create(&t, ATTR, task, NULL);
8313         if( status ) exit( status );
8314
8315         /* make sure pthread_detach() isn't just a stub */
8316 #if HAVE_PTHREADS_D4
8317         status = pthread_detach( &t );
8318 #else
8319         status = pthread_detach( t );
8320 #endif
8321
8322 #ifdef HAVE_LINUX_THREADS
8323         pthread_kill_other_threads_np();
8324 #endif
8325
8326         exit( status );
8327
8328 }
8329
8330 EOF
8331 if { (eval echo configure:8332: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8332 then
8333   ol_cv_pthread_lpthread_lmach_lexc=yes
8334 else
8335   echo "configure: failed program was:" >&5
8336   cat conftest.$ac_ext >&5
8337   rm -fr conftest*
8338   ol_cv_pthread_lpthread_lmach_lexc=no
8339 fi
8340 rm -fr conftest*
8341 fi
8342
8343
8344                 # restore the LIBS
8345                 LIBS="$ol_LIBS"
8346         
8347 fi
8348
8349 echo "$ac_t""$ol_cv_pthread_lpthread_lmach_lexc" 1>&6
8350
8351         if test $ol_cv_pthread_lpthread_lmach_lexc = yes ; then
8352                 ol_link_pthreads="-lpthread -lmach -lexc"
8353                 ol_link_threads=posix
8354         fi
8355 fi
8356
8357
8358                 # Pthread try link: -lpthread -Wl,-woff,85 (ol_cv_pthread_lib_lpthread_woff)
8359 if test "$ol_link_threads" = no ; then
8360         # try -lpthread -Wl,-woff,85
8361         echo $ac_n "checking for pthread link with -lpthread -Wl,-woff,85""... $ac_c" 1>&6
8362 echo "configure:8363: checking for pthread link with -lpthread -Wl,-woff,85" >&5
8363 if eval "test \"\${ol_cv_pthread_lib_lpthread_woff+set}\" = set"; then
8364   echo $ac_n "(cached) $ac_c" 1>&6
8365 else
8366   
8367                 # save the flags
8368                 ol_LIBS="$LIBS"
8369                 LIBS="-lpthread -Wl,-woff,85 $LIBS"
8370
8371                 if test "$cross_compiling" = yes; then
8372   cat > conftest.$ac_ext <<EOF
8373 #line 8374 "configure"
8374 #include "confdefs.h"
8375 /* pthread test headers */
8376 #include <pthread.h>
8377 #ifndef NULL
8378 #define NULL (void*)0
8379 #endif
8380
8381 static void *task(p)
8382         void *p;
8383 {
8384         return (void *) (p == NULL);
8385 }
8386
8387 int main() {
8388
8389         /* pthread test function */
8390         pthread_t t;
8391         int status;
8392 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8393         /* This system (e.g. AIX) defaults detached; must override */
8394         pthread_attr_t attr;
8395
8396         status = pthread_attr_init(&attr);
8397         if( status ) exit( status );
8398
8399         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8400         if( status ) exit( status );
8401
8402 #define ATTR    &attr
8403 #else
8404 #if HAVE_PTHREADS_D4
8405 #define ATTR    pthread_attr_default
8406 #else
8407 #define ATTR    NULL
8408 #endif
8409 #endif
8410         /* make sure pthread_create() isn't just a stub */
8411         status = pthread_create(&t, ATTR, task, NULL);
8412         if( status ) exit( status );
8413
8414         /* make sure pthread_detach() isn't just a stub */
8415 #if HAVE_PTHREADS_D4
8416         status = pthread_detach( &t );
8417 #else
8418         status = pthread_detach( t );
8419 #endif
8420
8421 #ifdef HAVE_LINUX_THREADS
8422         pthread_kill_other_threads_np();
8423 #endif
8424
8425         exit( status );
8426
8427 ; return 0; }
8428 EOF
8429 if { (eval echo configure:8430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8430   rm -rf conftest*
8431   ol_cv_pthread_lib_lpthread_woff=yes
8432 else
8433   echo "configure: failed program was:" >&5
8434   cat conftest.$ac_ext >&5
8435   rm -rf conftest*
8436   ol_cv_pthread_lib_lpthread_woff=no
8437 fi
8438 rm -f conftest*
8439 else
8440   cat > conftest.$ac_ext <<EOF
8441 #line 8442 "configure"
8442 #include "confdefs.h"
8443 /* pthread test headers */
8444 #include <pthread.h>
8445 #ifndef NULL
8446 #define NULL (void*)0
8447 #endif
8448
8449 static void *task(p)
8450         void *p;
8451 {
8452         return (void *) (p == NULL);
8453 }
8454
8455
8456 int main(argc, argv)
8457         int argc;
8458         char **argv;
8459 {
8460
8461         /* pthread test function */
8462         pthread_t t;
8463         int status;
8464 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8465         /* This system (e.g. AIX) defaults detached; must override */
8466         pthread_attr_t attr;
8467
8468         status = pthread_attr_init(&attr);
8469         if( status ) exit( status );
8470
8471         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8472         if( status ) exit( status );
8473
8474 #define ATTR    &attr
8475 #else
8476 #if HAVE_PTHREADS_D4
8477 #define ATTR    pthread_attr_default
8478 #else
8479 #define ATTR    NULL
8480 #endif
8481 #endif
8482         /* make sure pthread_create() isn't just a stub */
8483         status = pthread_create(&t, ATTR, task, NULL);
8484         if( status ) exit( status );
8485
8486         /* make sure pthread_detach() isn't just a stub */
8487 #if HAVE_PTHREADS_D4
8488         status = pthread_detach( &t );
8489 #else
8490         status = pthread_detach( t );
8491 #endif
8492
8493 #ifdef HAVE_LINUX_THREADS
8494         pthread_kill_other_threads_np();
8495 #endif
8496
8497         exit( status );
8498
8499 }
8500
8501 EOF
8502 if { (eval echo configure:8503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8503 then
8504   ol_cv_pthread_lib_lpthread_woff=yes
8505 else
8506   echo "configure: failed program was:" >&5
8507   cat conftest.$ac_ext >&5
8508   rm -fr conftest*
8509   ol_cv_pthread_lib_lpthread_woff=no
8510 fi
8511 rm -fr conftest*
8512 fi
8513
8514
8515                 # restore the LIBS
8516                 LIBS="$ol_LIBS"
8517         
8518 fi
8519
8520 echo "$ac_t""$ol_cv_pthread_lib_lpthread_woff" 1>&6
8521
8522         if test $ol_cv_pthread_lib_lpthread_woff = yes ; then
8523                 ol_link_pthreads="-lpthread -Wl,-woff,85"
8524                 ol_link_threads=posix
8525         fi
8526 fi
8527
8528
8529                 # Pthread try link: -lpthread (ol_cv_pthread_lpthread)
8530 if test "$ol_link_threads" = no ; then
8531         # try -lpthread
8532         echo $ac_n "checking for pthread link with -lpthread""... $ac_c" 1>&6
8533 echo "configure:8534: checking for pthread link with -lpthread" >&5
8534 if eval "test \"\${ol_cv_pthread_lpthread+set}\" = set"; then
8535   echo $ac_n "(cached) $ac_c" 1>&6
8536 else
8537   
8538                 # save the flags
8539                 ol_LIBS="$LIBS"
8540                 LIBS="-lpthread $LIBS"
8541
8542                 if test "$cross_compiling" = yes; then
8543   cat > conftest.$ac_ext <<EOF
8544 #line 8545 "configure"
8545 #include "confdefs.h"
8546 /* pthread test headers */
8547 #include <pthread.h>
8548 #ifndef NULL
8549 #define NULL (void*)0
8550 #endif
8551
8552 static void *task(p)
8553         void *p;
8554 {
8555         return (void *) (p == NULL);
8556 }
8557
8558 int main() {
8559
8560         /* pthread test function */
8561         pthread_t t;
8562         int status;
8563 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8564         /* This system (e.g. AIX) defaults detached; must override */
8565         pthread_attr_t attr;
8566
8567         status = pthread_attr_init(&attr);
8568         if( status ) exit( status );
8569
8570         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8571         if( status ) exit( status );
8572
8573 #define ATTR    &attr
8574 #else
8575 #if HAVE_PTHREADS_D4
8576 #define ATTR    pthread_attr_default
8577 #else
8578 #define ATTR    NULL
8579 #endif
8580 #endif
8581         /* make sure pthread_create() isn't just a stub */
8582         status = pthread_create(&t, ATTR, task, NULL);
8583         if( status ) exit( status );
8584
8585         /* make sure pthread_detach() isn't just a stub */
8586 #if HAVE_PTHREADS_D4
8587         status = pthread_detach( &t );
8588 #else
8589         status = pthread_detach( t );
8590 #endif
8591
8592 #ifdef HAVE_LINUX_THREADS
8593         pthread_kill_other_threads_np();
8594 #endif
8595
8596         exit( status );
8597
8598 ; return 0; }
8599 EOF
8600 if { (eval echo configure:8601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8601   rm -rf conftest*
8602   ol_cv_pthread_lpthread=yes
8603 else
8604   echo "configure: failed program was:" >&5
8605   cat conftest.$ac_ext >&5
8606   rm -rf conftest*
8607   ol_cv_pthread_lpthread=no
8608 fi
8609 rm -f conftest*
8610 else
8611   cat > conftest.$ac_ext <<EOF
8612 #line 8613 "configure"
8613 #include "confdefs.h"
8614 /* pthread test headers */
8615 #include <pthread.h>
8616 #ifndef NULL
8617 #define NULL (void*)0
8618 #endif
8619
8620 static void *task(p)
8621         void *p;
8622 {
8623         return (void *) (p == NULL);
8624 }
8625
8626
8627 int main(argc, argv)
8628         int argc;
8629         char **argv;
8630 {
8631
8632         /* pthread test function */
8633         pthread_t t;
8634         int status;
8635 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8636         /* This system (e.g. AIX) defaults detached; must override */
8637         pthread_attr_t attr;
8638
8639         status = pthread_attr_init(&attr);
8640         if( status ) exit( status );
8641
8642         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8643         if( status ) exit( status );
8644
8645 #define ATTR    &attr
8646 #else
8647 #if HAVE_PTHREADS_D4
8648 #define ATTR    pthread_attr_default
8649 #else
8650 #define ATTR    NULL
8651 #endif
8652 #endif
8653         /* make sure pthread_create() isn't just a stub */
8654         status = pthread_create(&t, ATTR, task, NULL);
8655         if( status ) exit( status );
8656
8657         /* make sure pthread_detach() isn't just a stub */
8658 #if HAVE_PTHREADS_D4
8659         status = pthread_detach( &t );
8660 #else
8661         status = pthread_detach( t );
8662 #endif
8663
8664 #ifdef HAVE_LINUX_THREADS
8665         pthread_kill_other_threads_np();
8666 #endif
8667
8668         exit( status );
8669
8670 }
8671
8672 EOF
8673 if { (eval echo configure:8674: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8674 then
8675   ol_cv_pthread_lpthread=yes
8676 else
8677   echo "configure: failed program was:" >&5
8678   cat conftest.$ac_ext >&5
8679   rm -fr conftest*
8680   ol_cv_pthread_lpthread=no
8681 fi
8682 rm -fr conftest*
8683 fi
8684
8685
8686                 # restore the LIBS
8687                 LIBS="$ol_LIBS"
8688         
8689 fi
8690
8691 echo "$ac_t""$ol_cv_pthread_lpthread" 1>&6
8692
8693         if test $ol_cv_pthread_lpthread = yes ; then
8694                 ol_link_pthreads="-lpthread"
8695                 ol_link_threads=posix
8696         fi
8697 fi
8698
8699                 # Pthread try link: -lc_r (ol_cv_pthread_lc_r)
8700 if test "$ol_link_threads" = no ; then
8701         # try -lc_r
8702         echo $ac_n "checking for pthread link with -lc_r""... $ac_c" 1>&6
8703 echo "configure:8704: checking for pthread link with -lc_r" >&5
8704 if eval "test \"\${ol_cv_pthread_lc_r+set}\" = set"; then
8705   echo $ac_n "(cached) $ac_c" 1>&6
8706 else
8707   
8708                 # save the flags
8709                 ol_LIBS="$LIBS"
8710                 LIBS="-lc_r $LIBS"
8711
8712                 if test "$cross_compiling" = yes; then
8713   cat > conftest.$ac_ext <<EOF
8714 #line 8715 "configure"
8715 #include "confdefs.h"
8716 /* pthread test headers */
8717 #include <pthread.h>
8718 #ifndef NULL
8719 #define NULL (void*)0
8720 #endif
8721
8722 static void *task(p)
8723         void *p;
8724 {
8725         return (void *) (p == NULL);
8726 }
8727
8728 int main() {
8729
8730         /* pthread test function */
8731         pthread_t t;
8732         int status;
8733 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8734         /* This system (e.g. AIX) defaults detached; must override */
8735         pthread_attr_t attr;
8736
8737         status = pthread_attr_init(&attr);
8738         if( status ) exit( status );
8739
8740         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8741         if( status ) exit( status );
8742
8743 #define ATTR    &attr
8744 #else
8745 #if HAVE_PTHREADS_D4
8746 #define ATTR    pthread_attr_default
8747 #else
8748 #define ATTR    NULL
8749 #endif
8750 #endif
8751         /* make sure pthread_create() isn't just a stub */
8752         status = pthread_create(&t, ATTR, task, NULL);
8753         if( status ) exit( status );
8754
8755         /* make sure pthread_detach() isn't just a stub */
8756 #if HAVE_PTHREADS_D4
8757         status = pthread_detach( &t );
8758 #else
8759         status = pthread_detach( t );
8760 #endif
8761
8762 #ifdef HAVE_LINUX_THREADS
8763         pthread_kill_other_threads_np();
8764 #endif
8765
8766         exit( status );
8767
8768 ; return 0; }
8769 EOF
8770 if { (eval echo configure:8771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8771   rm -rf conftest*
8772   ol_cv_pthread_lc_r=yes
8773 else
8774   echo "configure: failed program was:" >&5
8775   cat conftest.$ac_ext >&5
8776   rm -rf conftest*
8777   ol_cv_pthread_lc_r=no
8778 fi
8779 rm -f conftest*
8780 else
8781   cat > conftest.$ac_ext <<EOF
8782 #line 8783 "configure"
8783 #include "confdefs.h"
8784 /* pthread test headers */
8785 #include <pthread.h>
8786 #ifndef NULL
8787 #define NULL (void*)0
8788 #endif
8789
8790 static void *task(p)
8791         void *p;
8792 {
8793         return (void *) (p == NULL);
8794 }
8795
8796
8797 int main(argc, argv)
8798         int argc;
8799         char **argv;
8800 {
8801
8802         /* pthread test function */
8803         pthread_t t;
8804         int status;
8805 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8806         /* This system (e.g. AIX) defaults detached; must override */
8807         pthread_attr_t attr;
8808
8809         status = pthread_attr_init(&attr);
8810         if( status ) exit( status );
8811
8812         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8813         if( status ) exit( status );
8814
8815 #define ATTR    &attr
8816 #else
8817 #if HAVE_PTHREADS_D4
8818 #define ATTR    pthread_attr_default
8819 #else
8820 #define ATTR    NULL
8821 #endif
8822 #endif
8823         /* make sure pthread_create() isn't just a stub */
8824         status = pthread_create(&t, ATTR, task, NULL);
8825         if( status ) exit( status );
8826
8827         /* make sure pthread_detach() isn't just a stub */
8828 #if HAVE_PTHREADS_D4
8829         status = pthread_detach( &t );
8830 #else
8831         status = pthread_detach( t );
8832 #endif
8833
8834 #ifdef HAVE_LINUX_THREADS
8835         pthread_kill_other_threads_np();
8836 #endif
8837
8838         exit( status );
8839
8840 }
8841
8842 EOF
8843 if { (eval echo configure:8844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
8844 then
8845   ol_cv_pthread_lc_r=yes
8846 else
8847   echo "configure: failed program was:" >&5
8848   cat conftest.$ac_ext >&5
8849   rm -fr conftest*
8850   ol_cv_pthread_lc_r=no
8851 fi
8852 rm -fr conftest*
8853 fi
8854
8855
8856                 # restore the LIBS
8857                 LIBS="$ol_LIBS"
8858         
8859 fi
8860
8861 echo "$ac_t""$ol_cv_pthread_lc_r" 1>&6
8862
8863         if test $ol_cv_pthread_lc_r = yes ; then
8864                 ol_link_pthreads="-lc_r"
8865                 ol_link_threads=posix
8866         fi
8867 fi
8868
8869
8870                 # Pthread try link: -threads (ol_cv_pthread_threads)
8871 if test "$ol_link_threads" = no ; then
8872         # try -threads
8873         echo $ac_n "checking for pthread link with -threads""... $ac_c" 1>&6
8874 echo "configure:8875: checking for pthread link with -threads" >&5
8875 if eval "test \"\${ol_cv_pthread_threads+set}\" = set"; then
8876   echo $ac_n "(cached) $ac_c" 1>&6
8877 else
8878   
8879                 # save the flags
8880                 ol_LIBS="$LIBS"
8881                 LIBS="-threads $LIBS"
8882
8883                 if test "$cross_compiling" = yes; then
8884   cat > conftest.$ac_ext <<EOF
8885 #line 8886 "configure"
8886 #include "confdefs.h"
8887 /* pthread test headers */
8888 #include <pthread.h>
8889 #ifndef NULL
8890 #define NULL (void*)0
8891 #endif
8892
8893 static void *task(p)
8894         void *p;
8895 {
8896         return (void *) (p == NULL);
8897 }
8898
8899 int main() {
8900
8901         /* pthread test function */
8902         pthread_t t;
8903         int status;
8904 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8905         /* This system (e.g. AIX) defaults detached; must override */
8906         pthread_attr_t attr;
8907
8908         status = pthread_attr_init(&attr);
8909         if( status ) exit( status );
8910
8911         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8912         if( status ) exit( status );
8913
8914 #define ATTR    &attr
8915 #else
8916 #if HAVE_PTHREADS_D4
8917 #define ATTR    pthread_attr_default
8918 #else
8919 #define ATTR    NULL
8920 #endif
8921 #endif
8922         /* make sure pthread_create() isn't just a stub */
8923         status = pthread_create(&t, ATTR, task, NULL);
8924         if( status ) exit( status );
8925
8926         /* make sure pthread_detach() isn't just a stub */
8927 #if HAVE_PTHREADS_D4
8928         status = pthread_detach( &t );
8929 #else
8930         status = pthread_detach( t );
8931 #endif
8932
8933 #ifdef HAVE_LINUX_THREADS
8934         pthread_kill_other_threads_np();
8935 #endif
8936
8937         exit( status );
8938
8939 ; return 0; }
8940 EOF
8941 if { (eval echo configure:8942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
8942   rm -rf conftest*
8943   ol_cv_pthread_threads=yes
8944 else
8945   echo "configure: failed program was:" >&5
8946   cat conftest.$ac_ext >&5
8947   rm -rf conftest*
8948   ol_cv_pthread_threads=no
8949 fi
8950 rm -f conftest*
8951 else
8952   cat > conftest.$ac_ext <<EOF
8953 #line 8954 "configure"
8954 #include "confdefs.h"
8955 /* pthread test headers */
8956 #include <pthread.h>
8957 #ifndef NULL
8958 #define NULL (void*)0
8959 #endif
8960
8961 static void *task(p)
8962         void *p;
8963 {
8964         return (void *) (p == NULL);
8965 }
8966
8967
8968 int main(argc, argv)
8969         int argc;
8970         char **argv;
8971 {
8972
8973         /* pthread test function */
8974         pthread_t t;
8975         int status;
8976 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
8977         /* This system (e.g. AIX) defaults detached; must override */
8978         pthread_attr_t attr;
8979
8980         status = pthread_attr_init(&attr);
8981         if( status ) exit( status );
8982
8983         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
8984         if( status ) exit( status );
8985
8986 #define ATTR    &attr
8987 #else
8988 #if HAVE_PTHREADS_D4
8989 #define ATTR    pthread_attr_default
8990 #else
8991 #define ATTR    NULL
8992 #endif
8993 #endif
8994         /* make sure pthread_create() isn't just a stub */
8995         status = pthread_create(&t, ATTR, task, NULL);
8996         if( status ) exit( status );
8997
8998         /* make sure pthread_detach() isn't just a stub */
8999 #if HAVE_PTHREADS_D4
9000         status = pthread_detach( &t );
9001 #else
9002         status = pthread_detach( t );
9003 #endif
9004
9005 #ifdef HAVE_LINUX_THREADS
9006         pthread_kill_other_threads_np();
9007 #endif
9008
9009         exit( status );
9010
9011 }
9012
9013 EOF
9014 if { (eval echo configure:9015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9015 then
9016   ol_cv_pthread_threads=yes
9017 else
9018   echo "configure: failed program was:" >&5
9019   cat conftest.$ac_ext >&5
9020   rm -fr conftest*
9021   ol_cv_pthread_threads=no
9022 fi
9023 rm -fr conftest*
9024 fi
9025
9026
9027                 # restore the LIBS
9028                 LIBS="$ol_LIBS"
9029         
9030 fi
9031
9032 echo "$ac_t""$ol_cv_pthread_threads" 1>&6
9033
9034         if test $ol_cv_pthread_threads = yes ; then
9035                 ol_link_pthreads="-threads"
9036                 ol_link_threads=posix
9037         fi
9038 fi
9039
9040
9041                 # Pthread try link: -lpthreads -lmach -lexc -lc_r (ol_cv_pthread_lpthreads_lmach_lexc_lc_r)
9042 if test "$ol_link_threads" = no ; then
9043         # try -lpthreads -lmach -lexc -lc_r
9044         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc -lc_r""... $ac_c" 1>&6
9045 echo "configure:9046: checking for pthread link with -lpthreads -lmach -lexc -lc_r" >&5
9046 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc_lc_r+set}\" = set"; then
9047   echo $ac_n "(cached) $ac_c" 1>&6
9048 else
9049   
9050                 # save the flags
9051                 ol_LIBS="$LIBS"
9052                 LIBS="-lpthreads -lmach -lexc -lc_r $LIBS"
9053
9054                 if test "$cross_compiling" = yes; then
9055   cat > conftest.$ac_ext <<EOF
9056 #line 9057 "configure"
9057 #include "confdefs.h"
9058 /* pthread test headers */
9059 #include <pthread.h>
9060 #ifndef NULL
9061 #define NULL (void*)0
9062 #endif
9063
9064 static void *task(p)
9065         void *p;
9066 {
9067         return (void *) (p == NULL);
9068 }
9069
9070 int main() {
9071
9072         /* pthread test function */
9073         pthread_t t;
9074         int status;
9075 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9076         /* This system (e.g. AIX) defaults detached; must override */
9077         pthread_attr_t attr;
9078
9079         status = pthread_attr_init(&attr);
9080         if( status ) exit( status );
9081
9082         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9083         if( status ) exit( status );
9084
9085 #define ATTR    &attr
9086 #else
9087 #if HAVE_PTHREADS_D4
9088 #define ATTR    pthread_attr_default
9089 #else
9090 #define ATTR    NULL
9091 #endif
9092 #endif
9093         /* make sure pthread_create() isn't just a stub */
9094         status = pthread_create(&t, ATTR, task, NULL);
9095         if( status ) exit( status );
9096
9097         /* make sure pthread_detach() isn't just a stub */
9098 #if HAVE_PTHREADS_D4
9099         status = pthread_detach( &t );
9100 #else
9101         status = pthread_detach( t );
9102 #endif
9103
9104 #ifdef HAVE_LINUX_THREADS
9105         pthread_kill_other_threads_np();
9106 #endif
9107
9108         exit( status );
9109
9110 ; return 0; }
9111 EOF
9112 if { (eval echo configure:9113: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9113   rm -rf conftest*
9114   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9115 else
9116   echo "configure: failed program was:" >&5
9117   cat conftest.$ac_ext >&5
9118   rm -rf conftest*
9119   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9120 fi
9121 rm -f conftest*
9122 else
9123   cat > conftest.$ac_ext <<EOF
9124 #line 9125 "configure"
9125 #include "confdefs.h"
9126 /* pthread test headers */
9127 #include <pthread.h>
9128 #ifndef NULL
9129 #define NULL (void*)0
9130 #endif
9131
9132 static void *task(p)
9133         void *p;
9134 {
9135         return (void *) (p == NULL);
9136 }
9137
9138
9139 int main(argc, argv)
9140         int argc;
9141         char **argv;
9142 {
9143
9144         /* pthread test function */
9145         pthread_t t;
9146         int status;
9147 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9148         /* This system (e.g. AIX) defaults detached; must override */
9149         pthread_attr_t attr;
9150
9151         status = pthread_attr_init(&attr);
9152         if( status ) exit( status );
9153
9154         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9155         if( status ) exit( status );
9156
9157 #define ATTR    &attr
9158 #else
9159 #if HAVE_PTHREADS_D4
9160 #define ATTR    pthread_attr_default
9161 #else
9162 #define ATTR    NULL
9163 #endif
9164 #endif
9165         /* make sure pthread_create() isn't just a stub */
9166         status = pthread_create(&t, ATTR, task, NULL);
9167         if( status ) exit( status );
9168
9169         /* make sure pthread_detach() isn't just a stub */
9170 #if HAVE_PTHREADS_D4
9171         status = pthread_detach( &t );
9172 #else
9173         status = pthread_detach( t );
9174 #endif
9175
9176 #ifdef HAVE_LINUX_THREADS
9177         pthread_kill_other_threads_np();
9178 #endif
9179
9180         exit( status );
9181
9182 }
9183
9184 EOF
9185 if { (eval echo configure:9186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9186 then
9187   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=yes
9188 else
9189   echo "configure: failed program was:" >&5
9190   cat conftest.$ac_ext >&5
9191   rm -fr conftest*
9192   ol_cv_pthread_lpthreads_lmach_lexc_lc_r=no
9193 fi
9194 rm -fr conftest*
9195 fi
9196
9197
9198                 # restore the LIBS
9199                 LIBS="$ol_LIBS"
9200         
9201 fi
9202
9203 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc_lc_r" 1>&6
9204
9205         if test $ol_cv_pthread_lpthreads_lmach_lexc_lc_r = yes ; then
9206                 ol_link_pthreads="-lpthreads -lmach -lexc -lc_r"
9207                 ol_link_threads=posix
9208         fi
9209 fi
9210
9211                 # Pthread try link: -lpthreads -lmach -lexc (ol_cv_pthread_lpthreads_lmach_lexc)
9212 if test "$ol_link_threads" = no ; then
9213         # try -lpthreads -lmach -lexc
9214         echo $ac_n "checking for pthread link with -lpthreads -lmach -lexc""... $ac_c" 1>&6
9215 echo "configure:9216: checking for pthread link with -lpthreads -lmach -lexc" >&5
9216 if eval "test \"\${ol_cv_pthread_lpthreads_lmach_lexc+set}\" = set"; then
9217   echo $ac_n "(cached) $ac_c" 1>&6
9218 else
9219   
9220                 # save the flags
9221                 ol_LIBS="$LIBS"
9222                 LIBS="-lpthreads -lmach -lexc $LIBS"
9223
9224                 if test "$cross_compiling" = yes; then
9225   cat > conftest.$ac_ext <<EOF
9226 #line 9227 "configure"
9227 #include "confdefs.h"
9228 /* pthread test headers */
9229 #include <pthread.h>
9230 #ifndef NULL
9231 #define NULL (void*)0
9232 #endif
9233
9234 static void *task(p)
9235         void *p;
9236 {
9237         return (void *) (p == NULL);
9238 }
9239
9240 int main() {
9241
9242         /* pthread test function */
9243         pthread_t t;
9244         int status;
9245 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9246         /* This system (e.g. AIX) defaults detached; must override */
9247         pthread_attr_t attr;
9248
9249         status = pthread_attr_init(&attr);
9250         if( status ) exit( status );
9251
9252         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9253         if( status ) exit( status );
9254
9255 #define ATTR    &attr
9256 #else
9257 #if HAVE_PTHREADS_D4
9258 #define ATTR    pthread_attr_default
9259 #else
9260 #define ATTR    NULL
9261 #endif
9262 #endif
9263         /* make sure pthread_create() isn't just a stub */
9264         status = pthread_create(&t, ATTR, task, NULL);
9265         if( status ) exit( status );
9266
9267         /* make sure pthread_detach() isn't just a stub */
9268 #if HAVE_PTHREADS_D4
9269         status = pthread_detach( &t );
9270 #else
9271         status = pthread_detach( t );
9272 #endif
9273
9274 #ifdef HAVE_LINUX_THREADS
9275         pthread_kill_other_threads_np();
9276 #endif
9277
9278         exit( status );
9279
9280 ; return 0; }
9281 EOF
9282 if { (eval echo configure:9283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9283   rm -rf conftest*
9284   ol_cv_pthread_lpthreads_lmach_lexc=yes
9285 else
9286   echo "configure: failed program was:" >&5
9287   cat conftest.$ac_ext >&5
9288   rm -rf conftest*
9289   ol_cv_pthread_lpthreads_lmach_lexc=no
9290 fi
9291 rm -f conftest*
9292 else
9293   cat > conftest.$ac_ext <<EOF
9294 #line 9295 "configure"
9295 #include "confdefs.h"
9296 /* pthread test headers */
9297 #include <pthread.h>
9298 #ifndef NULL
9299 #define NULL (void*)0
9300 #endif
9301
9302 static void *task(p)
9303         void *p;
9304 {
9305         return (void *) (p == NULL);
9306 }
9307
9308
9309 int main(argc, argv)
9310         int argc;
9311         char **argv;
9312 {
9313
9314         /* pthread test function */
9315         pthread_t t;
9316         int status;
9317 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9318         /* This system (e.g. AIX) defaults detached; must override */
9319         pthread_attr_t attr;
9320
9321         status = pthread_attr_init(&attr);
9322         if( status ) exit( status );
9323
9324         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9325         if( status ) exit( status );
9326
9327 #define ATTR    &attr
9328 #else
9329 #if HAVE_PTHREADS_D4
9330 #define ATTR    pthread_attr_default
9331 #else
9332 #define ATTR    NULL
9333 #endif
9334 #endif
9335         /* make sure pthread_create() isn't just a stub */
9336         status = pthread_create(&t, ATTR, task, NULL);
9337         if( status ) exit( status );
9338
9339         /* make sure pthread_detach() isn't just a stub */
9340 #if HAVE_PTHREADS_D4
9341         status = pthread_detach( &t );
9342 #else
9343         status = pthread_detach( t );
9344 #endif
9345
9346 #ifdef HAVE_LINUX_THREADS
9347         pthread_kill_other_threads_np();
9348 #endif
9349
9350         exit( status );
9351
9352 }
9353
9354 EOF
9355 if { (eval echo configure:9356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9356 then
9357   ol_cv_pthread_lpthreads_lmach_lexc=yes
9358 else
9359   echo "configure: failed program was:" >&5
9360   cat conftest.$ac_ext >&5
9361   rm -fr conftest*
9362   ol_cv_pthread_lpthreads_lmach_lexc=no
9363 fi
9364 rm -fr conftest*
9365 fi
9366
9367
9368                 # restore the LIBS
9369                 LIBS="$ol_LIBS"
9370         
9371 fi
9372
9373 echo "$ac_t""$ol_cv_pthread_lpthreads_lmach_lexc" 1>&6
9374
9375         if test $ol_cv_pthread_lpthreads_lmach_lexc = yes ; then
9376                 ol_link_pthreads="-lpthreads -lmach -lexc"
9377                 ol_link_threads=posix
9378         fi
9379 fi
9380
9381                 # Pthread try link: -lpthreads -lexc (ol_cv_pthread_lpthreads_lexc)
9382 if test "$ol_link_threads" = no ; then
9383         # try -lpthreads -lexc
9384         echo $ac_n "checking for pthread link with -lpthreads -lexc""... $ac_c" 1>&6
9385 echo "configure:9386: checking for pthread link with -lpthreads -lexc" >&5
9386 if eval "test \"\${ol_cv_pthread_lpthreads_lexc+set}\" = set"; then
9387   echo $ac_n "(cached) $ac_c" 1>&6
9388 else
9389   
9390                 # save the flags
9391                 ol_LIBS="$LIBS"
9392                 LIBS="-lpthreads -lexc $LIBS"
9393
9394                 if test "$cross_compiling" = yes; then
9395   cat > conftest.$ac_ext <<EOF
9396 #line 9397 "configure"
9397 #include "confdefs.h"
9398 /* pthread test headers */
9399 #include <pthread.h>
9400 #ifndef NULL
9401 #define NULL (void*)0
9402 #endif
9403
9404 static void *task(p)
9405         void *p;
9406 {
9407         return (void *) (p == NULL);
9408 }
9409
9410 int main() {
9411
9412         /* pthread test function */
9413         pthread_t t;
9414         int status;
9415 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9416         /* This system (e.g. AIX) defaults detached; must override */
9417         pthread_attr_t attr;
9418
9419         status = pthread_attr_init(&attr);
9420         if( status ) exit( status );
9421
9422         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9423         if( status ) exit( status );
9424
9425 #define ATTR    &attr
9426 #else
9427 #if HAVE_PTHREADS_D4
9428 #define ATTR    pthread_attr_default
9429 #else
9430 #define ATTR    NULL
9431 #endif
9432 #endif
9433         /* make sure pthread_create() isn't just a stub */
9434         status = pthread_create(&t, ATTR, task, NULL);
9435         if( status ) exit( status );
9436
9437         /* make sure pthread_detach() isn't just a stub */
9438 #if HAVE_PTHREADS_D4
9439         status = pthread_detach( &t );
9440 #else
9441         status = pthread_detach( t );
9442 #endif
9443
9444 #ifdef HAVE_LINUX_THREADS
9445         pthread_kill_other_threads_np();
9446 #endif
9447
9448         exit( status );
9449
9450 ; return 0; }
9451 EOF
9452 if { (eval echo configure:9453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9453   rm -rf conftest*
9454   ol_cv_pthread_lpthreads_lexc=yes
9455 else
9456   echo "configure: failed program was:" >&5
9457   cat conftest.$ac_ext >&5
9458   rm -rf conftest*
9459   ol_cv_pthread_lpthreads_lexc=no
9460 fi
9461 rm -f conftest*
9462 else
9463   cat > conftest.$ac_ext <<EOF
9464 #line 9465 "configure"
9465 #include "confdefs.h"
9466 /* pthread test headers */
9467 #include <pthread.h>
9468 #ifndef NULL
9469 #define NULL (void*)0
9470 #endif
9471
9472 static void *task(p)
9473         void *p;
9474 {
9475         return (void *) (p == NULL);
9476 }
9477
9478
9479 int main(argc, argv)
9480         int argc;
9481         char **argv;
9482 {
9483
9484         /* pthread test function */
9485         pthread_t t;
9486         int status;
9487 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9488         /* This system (e.g. AIX) defaults detached; must override */
9489         pthread_attr_t attr;
9490
9491         status = pthread_attr_init(&attr);
9492         if( status ) exit( status );
9493
9494         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9495         if( status ) exit( status );
9496
9497 #define ATTR    &attr
9498 #else
9499 #if HAVE_PTHREADS_D4
9500 #define ATTR    pthread_attr_default
9501 #else
9502 #define ATTR    NULL
9503 #endif
9504 #endif
9505         /* make sure pthread_create() isn't just a stub */
9506         status = pthread_create(&t, ATTR, task, NULL);
9507         if( status ) exit( status );
9508
9509         /* make sure pthread_detach() isn't just a stub */
9510 #if HAVE_PTHREADS_D4
9511         status = pthread_detach( &t );
9512 #else
9513         status = pthread_detach( t );
9514 #endif
9515
9516 #ifdef HAVE_LINUX_THREADS
9517         pthread_kill_other_threads_np();
9518 #endif
9519
9520         exit( status );
9521
9522 }
9523
9524 EOF
9525 if { (eval echo configure:9526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9526 then
9527   ol_cv_pthread_lpthreads_lexc=yes
9528 else
9529   echo "configure: failed program was:" >&5
9530   cat conftest.$ac_ext >&5
9531   rm -fr conftest*
9532   ol_cv_pthread_lpthreads_lexc=no
9533 fi
9534 rm -fr conftest*
9535 fi
9536
9537
9538                 # restore the LIBS
9539                 LIBS="$ol_LIBS"
9540         
9541 fi
9542
9543 echo "$ac_t""$ol_cv_pthread_lpthreads_lexc" 1>&6
9544
9545         if test $ol_cv_pthread_lpthreads_lexc = yes ; then
9546                 ol_link_pthreads="-lpthreads -lexc"
9547                 ol_link_threads=posix
9548         fi
9549 fi
9550
9551
9552                 # Pthread try link: -lpthreads (ol_cv_pthread_lib_lpthreads)
9553 if test "$ol_link_threads" = no ; then
9554         # try -lpthreads
9555         echo $ac_n "checking for pthread link with -lpthreads""... $ac_c" 1>&6
9556 echo "configure:9557: checking for pthread link with -lpthreads" >&5
9557 if eval "test \"\${ol_cv_pthread_lib_lpthreads+set}\" = set"; then
9558   echo $ac_n "(cached) $ac_c" 1>&6
9559 else
9560   
9561                 # save the flags
9562                 ol_LIBS="$LIBS"
9563                 LIBS="-lpthreads $LIBS"
9564
9565                 if test "$cross_compiling" = yes; then
9566   cat > conftest.$ac_ext <<EOF
9567 #line 9568 "configure"
9568 #include "confdefs.h"
9569 /* pthread test headers */
9570 #include <pthread.h>
9571 #ifndef NULL
9572 #define NULL (void*)0
9573 #endif
9574
9575 static void *task(p)
9576         void *p;
9577 {
9578         return (void *) (p == NULL);
9579 }
9580
9581 int main() {
9582
9583         /* pthread test function */
9584         pthread_t t;
9585         int status;
9586 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9587         /* This system (e.g. AIX) defaults detached; must override */
9588         pthread_attr_t attr;
9589
9590         status = pthread_attr_init(&attr);
9591         if( status ) exit( status );
9592
9593         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9594         if( status ) exit( status );
9595
9596 #define ATTR    &attr
9597 #else
9598 #if HAVE_PTHREADS_D4
9599 #define ATTR    pthread_attr_default
9600 #else
9601 #define ATTR    NULL
9602 #endif
9603 #endif
9604         /* make sure pthread_create() isn't just a stub */
9605         status = pthread_create(&t, ATTR, task, NULL);
9606         if( status ) exit( status );
9607
9608         /* make sure pthread_detach() isn't just a stub */
9609 #if HAVE_PTHREADS_D4
9610         status = pthread_detach( &t );
9611 #else
9612         status = pthread_detach( t );
9613 #endif
9614
9615 #ifdef HAVE_LINUX_THREADS
9616         pthread_kill_other_threads_np();
9617 #endif
9618
9619         exit( status );
9620
9621 ; return 0; }
9622 EOF
9623 if { (eval echo configure:9624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9624   rm -rf conftest*
9625   ol_cv_pthread_lib_lpthreads=yes
9626 else
9627   echo "configure: failed program was:" >&5
9628   cat conftest.$ac_ext >&5
9629   rm -rf conftest*
9630   ol_cv_pthread_lib_lpthreads=no
9631 fi
9632 rm -f conftest*
9633 else
9634   cat > conftest.$ac_ext <<EOF
9635 #line 9636 "configure"
9636 #include "confdefs.h"
9637 /* pthread test headers */
9638 #include <pthread.h>
9639 #ifndef NULL
9640 #define NULL (void*)0
9641 #endif
9642
9643 static void *task(p)
9644         void *p;
9645 {
9646         return (void *) (p == NULL);
9647 }
9648
9649
9650 int main(argc, argv)
9651         int argc;
9652         char **argv;
9653 {
9654
9655         /* pthread test function */
9656         pthread_t t;
9657         int status;
9658 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
9659         /* This system (e.g. AIX) defaults detached; must override */
9660         pthread_attr_t attr;
9661
9662         status = pthread_attr_init(&attr);
9663         if( status ) exit( status );
9664
9665         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
9666         if( status ) exit( status );
9667
9668 #define ATTR    &attr
9669 #else
9670 #if HAVE_PTHREADS_D4
9671 #define ATTR    pthread_attr_default
9672 #else
9673 #define ATTR    NULL
9674 #endif
9675 #endif
9676         /* make sure pthread_create() isn't just a stub */
9677         status = pthread_create(&t, ATTR, task, NULL);
9678         if( status ) exit( status );
9679
9680         /* make sure pthread_detach() isn't just a stub */
9681 #if HAVE_PTHREADS_D4
9682         status = pthread_detach( &t );
9683 #else
9684         status = pthread_detach( t );
9685 #endif
9686
9687 #ifdef HAVE_LINUX_THREADS
9688         pthread_kill_other_threads_np();
9689 #endif
9690
9691         exit( status );
9692
9693 }
9694
9695 EOF
9696 if { (eval echo configure:9697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
9697 then
9698   ol_cv_pthread_lib_lpthreads=yes
9699 else
9700   echo "configure: failed program was:" >&5
9701   cat conftest.$ac_ext >&5
9702   rm -fr conftest*
9703   ol_cv_pthread_lib_lpthreads=no
9704 fi
9705 rm -fr conftest*
9706 fi
9707
9708
9709                 # restore the LIBS
9710                 LIBS="$ol_LIBS"
9711         
9712 fi
9713
9714 echo "$ac_t""$ol_cv_pthread_lib_lpthreads" 1>&6
9715
9716         if test $ol_cv_pthread_lib_lpthreads = yes ; then
9717                 ol_link_pthreads="-lpthreads"
9718                 ol_link_threads=posix
9719         fi
9720 fi
9721
9722
9723                 if test $ol_link_threads != no ; then
9724                         cat >> confdefs.h <<\EOF
9725 #define HAVE_PTHREADS 1
9726 EOF
9727
9728
9729                         LTHREAD_LIBS="$LTHREAD_LIBS $ol_link_pthreads"
9730
9731                                                 save_CPPFLAGS="$CPPFLAGS"
9732                         save_LIBS="$LIBS"
9733                         LIBS="$LTHREAD_LIBS $LIBS"
9734
9735                                                                                                 for ac_func in sched_yield pthread_yield
9736 do
9737 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9738 echo "configure:9739: checking for $ac_func" >&5
9739 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9740   echo $ac_n "(cached) $ac_c" 1>&6
9741 else
9742   cat > conftest.$ac_ext <<EOF
9743 #line 9744 "configure"
9744 #include "confdefs.h"
9745 /* System header to define __stub macros and hopefully few prototypes,
9746     which can conflict with char $ac_func(); below.  */
9747 #include <assert.h>
9748 /* Override any gcc2 internal prototype to avoid an error.  */
9749 /* We use char because int might match the return type of a gcc2
9750     builtin and then its argument prototype would still apply.  */
9751 char $ac_func();
9752 char (*f)();
9753
9754 int main() {
9755
9756 /* The GNU C library defines this for functions which it implements
9757     to always fail with ENOSYS.  Some functions are actually named
9758     something starting with __ and the normal name is an alias.  */
9759 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9760 choke me
9761 #else
9762 f = $ac_func;
9763 #endif
9764
9765 ; return 0; }
9766 EOF
9767 if { (eval echo configure:9768: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9768   rm -rf conftest*
9769   eval "ac_cv_func_$ac_func=yes"
9770 else
9771   echo "configure: failed program was:" >&5
9772   cat conftest.$ac_ext >&5
9773   rm -rf conftest*
9774   eval "ac_cv_func_$ac_func=no"
9775 fi
9776 rm -f conftest*
9777 fi
9778
9779 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9780   echo "$ac_t""yes" 1>&6
9781     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9782   cat >> confdefs.h <<EOF
9783 #define $ac_tr_func 1
9784 EOF
9785  
9786 else
9787   echo "$ac_t""no" 1>&6
9788 fi
9789 done
9790
9791
9792                         if test $ac_cv_func_sched_yield = no -a \
9793                                 $ac_cv_func_pthread_yield = no ; then
9794                                                                 echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
9795 echo "configure:9796: checking for sched_yield in -lrt" >&5
9796 ac_lib_var=`echo rt'_'sched_yield | sed 'y%./+-:%__p__%'`
9797 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
9798   echo $ac_n "(cached) $ac_c" 1>&6
9799 else
9800   ac_save_LIBS="$LIBS"
9801 LIBS="-lrt  $LIBS"
9802 cat > conftest.$ac_ext <<EOF
9803 #line 9804 "configure"
9804 #include "confdefs.h"
9805 /* Override any gcc2 internal prototype to avoid an error.  */
9806 /* We use char because int might match the return type of a gcc2
9807     builtin and then its argument prototype would still apply.  */
9808 char sched_yield();
9809
9810 int main() {
9811 sched_yield()
9812 ; return 0; }
9813 EOF
9814 if { (eval echo configure:9815: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9815   rm -rf conftest*
9816   eval "ac_cv_lib_$ac_lib_var=yes"
9817 else
9818   echo "configure: failed program was:" >&5
9819   cat conftest.$ac_ext >&5
9820   rm -rf conftest*
9821   eval "ac_cv_lib_$ac_lib_var=no"
9822 fi
9823 rm -f conftest*
9824 LIBS="$ac_save_LIBS"
9825
9826 fi
9827 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
9828   echo "$ac_t""yes" 1>&6
9829   LTHREAD_LIBS="$LTHREAD_LIBS -lrt"
9830                                         cat >> confdefs.h <<\EOF
9831 #define HAVE_SCHED_YIELD 1
9832 EOF
9833
9834                                         ac_cv_func_sched_yield=yes
9835 else
9836   echo "$ac_t""no" 1>&6
9837 ac_cv_func_sched_yield=no
9838 fi
9839
9840                         fi
9841                         if test $ac_cv_func_sched_yield = no -a \
9842                                 $ac_cv_func_pthread_yield = no ; then
9843                                                                                                 for ac_func in thr_yield
9844 do
9845 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9846 echo "configure:9847: checking for $ac_func" >&5
9847 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9848   echo $ac_n "(cached) $ac_c" 1>&6
9849 else
9850   cat > conftest.$ac_ext <<EOF
9851 #line 9852 "configure"
9852 #include "confdefs.h"
9853 /* System header to define __stub macros and hopefully few prototypes,
9854     which can conflict with char $ac_func(); below.  */
9855 #include <assert.h>
9856 /* Override any gcc2 internal prototype to avoid an error.  */
9857 /* We use char because int might match the return type of a gcc2
9858     builtin and then its argument prototype would still apply.  */
9859 char $ac_func();
9860 char (*f)();
9861
9862 int main() {
9863
9864 /* The GNU C library defines this for functions which it implements
9865     to always fail with ENOSYS.  Some functions are actually named
9866     something starting with __ and the normal name is an alias.  */
9867 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9868 choke me
9869 #else
9870 f = $ac_func;
9871 #endif
9872
9873 ; return 0; }
9874 EOF
9875 if { (eval echo configure:9876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9876   rm -rf conftest*
9877   eval "ac_cv_func_$ac_func=yes"
9878 else
9879   echo "configure: failed program was:" >&5
9880   cat conftest.$ac_ext >&5
9881   rm -rf conftest*
9882   eval "ac_cv_func_$ac_func=no"
9883 fi
9884 rm -f conftest*
9885 fi
9886
9887 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9888   echo "$ac_t""yes" 1>&6
9889     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9890   cat >> confdefs.h <<EOF
9891 #define $ac_tr_func 1
9892 EOF
9893  
9894 else
9895   echo "$ac_t""no" 1>&6
9896 fi
9897 done
9898
9899                         fi
9900                         if test $ac_cv_func_sched_yield = no -a \
9901                                 $ac_cv_func_pthread_yield = no -a \
9902                                 "$ac_cv_func_thr_yield" = no ; then
9903                                 echo "configure: warning: could not locate sched_yield() or pthread_yield()" 1>&2
9904                         fi
9905
9906                                                 for ac_func in pthread_kill pthread_rwlock_destroy
9907 do
9908 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
9909 echo "configure:9910: checking for $ac_func" >&5
9910 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
9911   echo $ac_n "(cached) $ac_c" 1>&6
9912 else
9913   cat > conftest.$ac_ext <<EOF
9914 #line 9915 "configure"
9915 #include "confdefs.h"
9916 /* System header to define __stub macros and hopefully few prototypes,
9917     which can conflict with char $ac_func(); below.  */
9918 #include <assert.h>
9919 /* Override any gcc2 internal prototype to avoid an error.  */
9920 /* We use char because int might match the return type of a gcc2
9921     builtin and then its argument prototype would still apply.  */
9922 char $ac_func();
9923 char (*f)();
9924
9925 int main() {
9926
9927 /* The GNU C library defines this for functions which it implements
9928     to always fail with ENOSYS.  Some functions are actually named
9929     something starting with __ and the normal name is an alias.  */
9930 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9931 choke me
9932 #else
9933 f = $ac_func;
9934 #endif
9935
9936 ; return 0; }
9937 EOF
9938 if { (eval echo configure:9939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9939   rm -rf conftest*
9940   eval "ac_cv_func_$ac_func=yes"
9941 else
9942   echo "configure: failed program was:" >&5
9943   cat conftest.$ac_ext >&5
9944   rm -rf conftest*
9945   eval "ac_cv_func_$ac_func=no"
9946 fi
9947 rm -f conftest*
9948 fi
9949
9950 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
9951   echo "$ac_t""yes" 1>&6
9952     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
9953   cat >> confdefs.h <<EOF
9954 #define $ac_tr_func 1
9955 EOF
9956  
9957 else
9958   echo "$ac_t""no" 1>&6
9959 fi
9960 done
9961
9962
9963                                                                         echo $ac_n "checking for pthread_detach with <pthread.h>""... $ac_c" 1>&6
9964 echo "configure:9965: checking for pthread_detach with <pthread.h>" >&5
9965 if eval "test \"\${ol_cv_func_pthread_detach+set}\" = set"; then
9966   echo $ac_n "(cached) $ac_c" 1>&6
9967 else
9968   
9969                                                                 cat > conftest.$ac_ext <<EOF
9970 #line 9971 "configure"
9971 #include "confdefs.h"
9972
9973 #include <pthread.h>
9974 #ifndef NULL
9975 #define NULL (void*)0
9976 #endif
9977
9978 int main() {
9979 pthread_detach(NULL);
9980 ; return 0; }
9981 EOF
9982 if { (eval echo configure:9983: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
9983   rm -rf conftest*
9984   ol_cv_func_pthread_detach=yes
9985 else
9986   echo "configure: failed program was:" >&5
9987   cat conftest.$ac_ext >&5
9988   rm -rf conftest*
9989   ol_cv_func_pthread_detach=no
9990 fi
9991 rm -f conftest*
9992                         
9993 fi
9994
9995 echo "$ac_t""$ol_cv_func_pthread_detach" 1>&6
9996
9997                         if test $ol_cv_func_pthread_detach = no ; then
9998                                 { echo "configure: error: could not locate pthread_detach()" 1>&2; exit 1; }
9999                         fi
10000
10001                         cat >> confdefs.h <<\EOF
10002 #define HAVE_PTHREAD_DETACH 1
10003 EOF
10004
10005
10006                                                 for ac_func in \
10007                                 pthread_setconcurrency \
10008                                 pthread_getconcurrency \
10009                                 thr_setconcurrency \
10010                                 thr_getconcurrency \
10011                         
10012 do
10013 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10014 echo "configure:10015: checking for $ac_func" >&5
10015 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10016   echo $ac_n "(cached) $ac_c" 1>&6
10017 else
10018   cat > conftest.$ac_ext <<EOF
10019 #line 10020 "configure"
10020 #include "confdefs.h"
10021 /* System header to define __stub macros and hopefully few prototypes,
10022     which can conflict with char $ac_func(); below.  */
10023 #include <assert.h>
10024 /* Override any gcc2 internal prototype to avoid an error.  */
10025 /* We use char because int might match the return type of a gcc2
10026     builtin and then its argument prototype would still apply.  */
10027 char $ac_func();
10028 char (*f)();
10029
10030 int main() {
10031
10032 /* The GNU C library defines this for functions which it implements
10033     to always fail with ENOSYS.  Some functions are actually named
10034     something starting with __ and the normal name is an alias.  */
10035 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10036 choke me
10037 #else
10038 f = $ac_func;
10039 #endif
10040
10041 ; return 0; }
10042 EOF
10043 if { (eval echo configure:10044: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10044   rm -rf conftest*
10045   eval "ac_cv_func_$ac_func=yes"
10046 else
10047   echo "configure: failed program was:" >&5
10048   cat conftest.$ac_ext >&5
10049   rm -rf conftest*
10050   eval "ac_cv_func_$ac_func=no"
10051 fi
10052 rm -f conftest*
10053 fi
10054
10055 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10056   echo "$ac_t""yes" 1>&6
10057     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10058   cat >> confdefs.h <<EOF
10059 #define $ac_tr_func 1
10060 EOF
10061  
10062 else
10063   echo "$ac_t""no" 1>&6
10064 fi
10065 done
10066
10067
10068                         
10069         for ac_func in pthread_kill_other_threads_np
10070 do
10071 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10072 echo "configure:10073: checking for $ac_func" >&5
10073 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10074   echo $ac_n "(cached) $ac_c" 1>&6
10075 else
10076   cat > conftest.$ac_ext <<EOF
10077 #line 10078 "configure"
10078 #include "confdefs.h"
10079 /* System header to define __stub macros and hopefully few prototypes,
10080     which can conflict with char $ac_func(); below.  */
10081 #include <assert.h>
10082 /* Override any gcc2 internal prototype to avoid an error.  */
10083 /* We use char because int might match the return type of a gcc2
10084     builtin and then its argument prototype would still apply.  */
10085 char $ac_func();
10086 char (*f)();
10087
10088 int main() {
10089
10090 /* The GNU C library defines this for functions which it implements
10091     to always fail with ENOSYS.  Some functions are actually named
10092     something starting with __ and the normal name is an alias.  */
10093 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10094 choke me
10095 #else
10096 f = $ac_func;
10097 #endif
10098
10099 ; return 0; }
10100 EOF
10101 if { (eval echo configure:10102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10102   rm -rf conftest*
10103   eval "ac_cv_func_$ac_func=yes"
10104 else
10105   echo "configure: failed program was:" >&5
10106   cat conftest.$ac_ext >&5
10107   rm -rf conftest*
10108   eval "ac_cv_func_$ac_func=no"
10109 fi
10110 rm -f conftest*
10111 fi
10112
10113 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10114   echo "$ac_t""yes" 1>&6
10115     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10116   cat >> confdefs.h <<EOF
10117 #define $ac_tr_func 1
10118 EOF
10119  
10120 else
10121   echo "$ac_t""no" 1>&6
10122 fi
10123 done
10124
10125         echo $ac_n "checking for LinuxThreads implementation""... $ac_c" 1>&6
10126 echo "configure:10127: checking for LinuxThreads implementation" >&5
10127 if eval "test \"\${ol_cv_sys_linux_threads+set}\" = set"; then
10128   echo $ac_n "(cached) $ac_c" 1>&6
10129 else
10130   ol_cv_sys_linux_threads=$ac_cv_func_pthread_kill_other_threads_np
10131 fi
10132
10133 echo "$ac_t""$ol_cv_sys_linux_threads" 1>&6
10134
10135                         
10136         
10137         
10138         echo $ac_n "checking for LinuxThreads consistency""... $ac_c" 1>&6
10139 echo "configure:10140: checking for LinuxThreads consistency" >&5
10140 if eval "test \"\${ol_cv_linux_threads+set}\" = set"; then
10141   echo $ac_n "(cached) $ac_c" 1>&6
10142 else
10143   
10144                 if test $ol_cv_header_linux_threads = yes -a \
10145                         $ol_cv_sys_linux_threads = yes; then
10146                         ol_cv_linux_threads=yes
10147                 elif test $ol_cv_header_linux_threads = no -a \
10148                         $ol_cv_sys_linux_threads = no; then
10149                         ol_cv_linux_threads=no
10150                 else
10151                         ol_cv_linux_threads=error
10152                 fi
10153         
10154 fi
10155
10156 echo "$ac_t""$ol_cv_linux_threads" 1>&6
10157
10158
10159                         if test $ol_cv_linux_threads = error; then
10160                                 { echo "configure: error: LinuxThreads header/library mismatch" 1>&2; exit 1; };
10161                         fi
10162
10163                         echo $ac_n "checking if pthread_create() works""... $ac_c" 1>&6
10164 echo "configure:10165: checking if pthread_create() works" >&5
10165 if eval "test \"\${ol_cv_pthread_create_works+set}\" = set"; then
10166   echo $ac_n "(cached) $ac_c" 1>&6
10167 else
10168   
10169                         if test "$cross_compiling" = yes; then
10170                                 ol_cv_pthread_create_works=yes
10171 else
10172   cat > conftest.$ac_ext <<EOF
10173 #line 10174 "configure"
10174 #include "confdefs.h"
10175 /* pthread test headers */
10176 #include <pthread.h>
10177 #ifndef NULL
10178 #define NULL (void*)0
10179 #endif
10180
10181 static void *task(p)
10182         void *p;
10183 {
10184         return (void *) (p == NULL);
10185 }
10186
10187
10188 int main(argc, argv)
10189         int argc;
10190         char **argv;
10191 {
10192
10193         /* pthread test function */
10194         pthread_t t;
10195         int status;
10196 #if HAVE_PTHREADS_FINAL && defined(PTHREAD_CREATE_UNDETACHED)
10197         /* This system (e.g. AIX) defaults detached; must override */
10198         pthread_attr_t attr;
10199
10200         status = pthread_attr_init(&attr);
10201         if( status ) exit( status );
10202
10203         status = pthread_attr_setdetachstate(&attr,PTHREAD_CREATE_UNDETACHED);
10204         if( status ) exit( status );
10205
10206 #define ATTR    &attr
10207 #else
10208 #if HAVE_PTHREADS_D4
10209 #define ATTR    pthread_attr_default
10210 #else
10211 #define ATTR    NULL
10212 #endif
10213 #endif
10214         /* make sure pthread_create() isn't just a stub */
10215         status = pthread_create(&t, ATTR, task, NULL);
10216         if( status ) exit( status );
10217
10218         /* make sure pthread_detach() isn't just a stub */
10219 #if HAVE_PTHREADS_D4
10220         status = pthread_detach( &t );
10221 #else
10222         status = pthread_detach( t );
10223 #endif
10224
10225 #ifdef HAVE_LINUX_THREADS
10226         pthread_kill_other_threads_np();
10227 #endif
10228
10229         exit( status );
10230
10231 }
10232
10233 EOF
10234 if { (eval echo configure:10235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10235 then
10236   ol_cv_pthread_create_works=yes
10237 else
10238   echo "configure: failed program was:" >&5
10239   cat conftest.$ac_ext >&5
10240   rm -fr conftest*
10241   ol_cv_pthread_create_works=no
10242 fi
10243 rm -fr conftest*
10244 fi
10245
10246 fi
10247
10248 echo "$ac_t""$ol_cv_pthread_create_works" 1>&6
10249
10250                         if test $ol_cv_pthread_create_works = no ; then
10251                                 { echo "configure: error: pthread_create is not usable, check environment settings" 1>&2; exit 1; }
10252                         fi
10253
10254                                                 if test $ol_with_yielding_select = auto ; then
10255                                 echo $ac_n "checking if select yields when using pthreads""... $ac_c" 1>&6
10256 echo "configure:10257: checking if select yields when using pthreads" >&5
10257 if eval "test \"\${ol_cv_pthread_select_yields+set}\" = set"; then
10258   echo $ac_n "(cached) $ac_c" 1>&6
10259 else
10260   
10261                                 if test "$cross_compiling" = yes; then
10262   ol_cv_pthread_select_yields=cross
10263 else
10264   cat > conftest.$ac_ext <<EOF
10265 #line 10266 "configure"
10266 #include "confdefs.h"
10267
10268 #include <sys/types.h>
10269 #include <sys/time.h>
10270 #include <unistd.h>
10271 #include <pthread.h>
10272 #ifndef NULL
10273 #define NULL (void*) 0
10274 #endif
10275
10276 static int fildes[2];
10277
10278 static void *task(p)
10279         void *p;
10280 {
10281         int i;
10282         struct timeval tv;
10283
10284         fd_set rfds;
10285
10286         tv.tv_sec=10;
10287         tv.tv_usec=0;
10288
10289         FD_ZERO(&rfds);
10290         FD_SET(fildes[0], &rfds);
10291
10292         /* we're not interested in any fds */
10293         i = select(FD_SETSIZE, &rfds, NULL, NULL, &tv);
10294
10295         if(i < 0) {
10296                 perror("select");
10297                 exit(10);
10298         }
10299
10300         exit(0); /* if we exit here, the select blocked the whole process */
10301 }
10302
10303 int main(argc, argv)
10304         int argc;
10305         char **argv;
10306 {
10307         pthread_t t;
10308
10309         /* create a pipe to select */
10310         if(pipe(&fildes[0])) {
10311                 perror("select");
10312                 exit(1);
10313         }
10314
10315 #ifdef HAVE_PTHREAD_SETCONCURRENCY
10316         (void) pthread_setconcurrency(2);
10317 #else
10318 #ifdef HAVE_THR_SETCONCURRENCY
10319         /* Set Solaris LWP concurrency to 2 */
10320         thr_setconcurrency(2);
10321 #endif
10322 #endif
10323
10324 #if HAVE_PTHREADS_D4
10325         pthread_create(&t, pthread_attr_default, task, NULL);
10326 #else
10327         pthread_create(&t, NULL, task, NULL);
10328 #endif
10329
10330 #if HAVE_SCHED_YIELD
10331         sched_yield();  /* make sure task runs first */
10332 #else
10333 #ifdef HAVE_PTHREAD_YIELD
10334         pthread_yield();        /* make sure task runs first */
10335 #endif
10336 #endif
10337
10338         exit(2);
10339 }
10340 EOF
10341 if { (eval echo configure:10342: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
10342 then
10343   ol_cv_pthread_select_yields=no
10344 else
10345   echo "configure: failed program was:" >&5
10346   cat conftest.$ac_ext >&5
10347   rm -fr conftest*
10348   ol_cv_pthread_select_yields=yes
10349 fi
10350 rm -fr conftest*
10351 fi
10352
10353 fi
10354
10355 echo "$ac_t""$ol_cv_pthread_select_yields" 1>&6
10356
10357                                 if test $ol_cv_pthread_select_yields = cross ; then
10358                                         { echo "configure: error: crossing compiling: use --with-yielding_select=yes|no|manual" 1>&2; exit 1; }
10359                                 fi
10360
10361                                 if test $ol_cv_pthread_select_yields = yes ; then
10362                                         ol_with_yielding_select=yes
10363                                 fi
10364                         fi
10365
10366                                                 CPPFLAGS="$save_CPPFLAGS"
10367                         LIBS="$save_LIBS"
10368                 else
10369                         { echo "configure: error: could not link with POSIX Threads" 1>&2; exit 1; }
10370                 fi
10371         fi
10372
10373         if test $ol_with_threads = posix ; then
10374                 { echo "configure: error: could not locate POSIX Threads" 1>&2; exit 1; }
10375         fi
10376 fi
10377
10378 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10379         -o $ol_with_threads = mach ; then
10380
10381                 for ac_hdr in mach/cthreads.h
10382 do
10383 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10384 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10385 echo "configure:10386: checking for $ac_hdr" >&5
10386 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10387   echo $ac_n "(cached) $ac_c" 1>&6
10388 else
10389   cat > conftest.$ac_ext <<EOF
10390 #line 10391 "configure"
10391 #include "confdefs.h"
10392 #include <$ac_hdr>
10393 EOF
10394 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10395 { (eval echo configure:10396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10396 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10397 if test -z "$ac_err"; then
10398   rm -rf conftest*
10399   eval "ac_cv_header_$ac_safe=yes"
10400 else
10401   echo "$ac_err" >&5
10402   echo "configure: failed program was:" >&5
10403   cat conftest.$ac_ext >&5
10404   rm -rf conftest*
10405   eval "ac_cv_header_$ac_safe=no"
10406 fi
10407 rm -f conftest*
10408 fi
10409 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10410   echo "$ac_t""yes" 1>&6
10411     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10412   cat >> confdefs.h <<EOF
10413 #define $ac_tr_hdr 1
10414 EOF
10415  
10416 else
10417   echo "$ac_t""no" 1>&6
10418 fi
10419 done
10420
10421         if test $ac_cv_header_mach_cthreads_h = yes ; then
10422                 ol_with_threads=found
10423
10424                                 echo $ac_n "checking for cthread_fork""... $ac_c" 1>&6
10425 echo "configure:10426: checking for cthread_fork" >&5
10426 if eval "test \"\${ac_cv_func_cthread_fork+set}\" = set"; then
10427   echo $ac_n "(cached) $ac_c" 1>&6
10428 else
10429   cat > conftest.$ac_ext <<EOF
10430 #line 10431 "configure"
10431 #include "confdefs.h"
10432 /* System header to define __stub macros and hopefully few prototypes,
10433     which can conflict with char cthread_fork(); below.  */
10434 #include <assert.h>
10435 /* Override any gcc2 internal prototype to avoid an error.  */
10436 /* We use char because int might match the return type of a gcc2
10437     builtin and then its argument prototype would still apply.  */
10438 char cthread_fork();
10439 char (*f)();
10440
10441 int main() {
10442
10443 /* The GNU C library defines this for functions which it implements
10444     to always fail with ENOSYS.  Some functions are actually named
10445     something starting with __ and the normal name is an alias.  */
10446 #if defined (__stub_cthread_fork) || defined (__stub___cthread_fork)
10447 choke me
10448 #else
10449 f = cthread_fork;
10450 #endif
10451
10452 ; return 0; }
10453 EOF
10454 if { (eval echo configure:10455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10455   rm -rf conftest*
10456   eval "ac_cv_func_cthread_fork=yes"
10457 else
10458   echo "configure: failed program was:" >&5
10459   cat conftest.$ac_ext >&5
10460   rm -rf conftest*
10461   eval "ac_cv_func_cthread_fork=no"
10462 fi
10463 rm -f conftest*
10464 fi
10465
10466 if eval "test \"`echo '$ac_cv_func_'cthread_fork`\" = yes"; then
10467   echo "$ac_t""yes" 1>&6
10468   ol_link_threads=yes
10469 else
10470   echo "$ac_t""no" 1>&6
10471 fi
10472
10473
10474                 if test $ol_link_threads = no ; then
10475                                                                         echo $ac_n "checking for cthread_fork with -all_load""... $ac_c" 1>&6
10476 echo "configure:10477: checking for cthread_fork with -all_load" >&5
10477 if eval "test \"\${ol_cv_cthread_all_load+set}\" = set"; then
10478   echo $ac_n "(cached) $ac_c" 1>&6
10479 else
10480   
10481                                                                 save_LIBS="$LIBS"
10482                                 LIBS="-all_load $LIBS"
10483                                 cat > conftest.$ac_ext <<EOF
10484 #line 10485 "configure"
10485 #include "confdefs.h"
10486 #include <mach/cthreads.h>
10487 int main() {
10488
10489                                         cthread_fork((void *)0, (void *)0);
10490                                         
10491 ; return 0; }
10492 EOF
10493 if { (eval echo configure:10494: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10494   rm -rf conftest*
10495   ol_cv_cthread_all_load=yes
10496 else
10497   echo "configure: failed program was:" >&5
10498   cat conftest.$ac_ext >&5
10499   rm -rf conftest*
10500   ol_cv_cthread_all_load=no
10501 fi
10502 rm -f conftest*
10503                                                                 LIBS="$save_LIBS"
10504                         
10505 fi
10506
10507 echo "$ac_t""$ol_cv_cthread_all_load" 1>&6
10508
10509                         if test $ol_cv_cthread_all_load = yes ; then
10510                                 LTHREAD_LIBS="$LTHREAD_LIBS -all_load"
10511                                 ol_link_threads=mach
10512                         fi
10513                 fi
10514
10515                 if test $ol_link_threads != no ; then
10516                         : check for cthread specific functionality here
10517                         cat >> confdefs.h <<\EOF
10518 #define HAVE_MACH_CTHREADS 1
10519 EOF
10520
10521                 else
10522                         { echo "configure: error: could not link with Mach CThreads" 1>&2; exit 1; }
10523                 fi
10524         fi
10525
10526         if test $ol_with_threads = mach ; then
10527                 { echo "configure: error: could not locate Mach CThreads" 1>&2; exit 1; }
10528         fi
10529 fi
10530
10531 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10532         -o $ol_with_threads = pth ; then
10533
10534         for ac_hdr in pth.h
10535 do
10536 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10537 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10538 echo "configure:10539: checking for $ac_hdr" >&5
10539 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10540   echo $ac_n "(cached) $ac_c" 1>&6
10541 else
10542   cat > conftest.$ac_ext <<EOF
10543 #line 10544 "configure"
10544 #include "confdefs.h"
10545 #include <$ac_hdr>
10546 EOF
10547 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10548 { (eval echo configure:10549: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10549 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10550 if test -z "$ac_err"; then
10551   rm -rf conftest*
10552   eval "ac_cv_header_$ac_safe=yes"
10553 else
10554   echo "$ac_err" >&5
10555   echo "configure: failed program was:" >&5
10556   cat conftest.$ac_ext >&5
10557   rm -rf conftest*
10558   eval "ac_cv_header_$ac_safe=no"
10559 fi
10560 rm -f conftest*
10561 fi
10562 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10563   echo "$ac_t""yes" 1>&6
10564     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10565   cat >> confdefs.h <<EOF
10566 #define $ac_tr_hdr 1
10567 EOF
10568  
10569 else
10570   echo "$ac_t""no" 1>&6
10571 fi
10572 done
10573
10574
10575         if test $ac_cv_header_pth_h = yes ; then
10576                 echo $ac_n "checking for pth_version in -lpth""... $ac_c" 1>&6
10577 echo "configure:10578: checking for pth_version in -lpth" >&5
10578 ac_lib_var=`echo pth'_'pth_version | sed 'y%./+-:%__p__%'`
10579 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10580   echo $ac_n "(cached) $ac_c" 1>&6
10581 else
10582   ac_save_LIBS="$LIBS"
10583 LIBS="-lpth  $LIBS"
10584 cat > conftest.$ac_ext <<EOF
10585 #line 10586 "configure"
10586 #include "confdefs.h"
10587 /* Override any gcc2 internal prototype to avoid an error.  */
10588 /* We use char because int might match the return type of a gcc2
10589     builtin and then its argument prototype would still apply.  */
10590 char pth_version();
10591
10592 int main() {
10593 pth_version()
10594 ; return 0; }
10595 EOF
10596 if { (eval echo configure:10597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10597   rm -rf conftest*
10598   eval "ac_cv_lib_$ac_lib_var=yes"
10599 else
10600   echo "configure: failed program was:" >&5
10601   cat conftest.$ac_ext >&5
10602   rm -rf conftest*
10603   eval "ac_cv_lib_$ac_lib_var=no"
10604 fi
10605 rm -f conftest*
10606 LIBS="$ac_save_LIBS"
10607
10608 fi
10609 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10610   echo "$ac_t""yes" 1>&6
10611   have_pth=yes
10612 else
10613   echo "$ac_t""no" 1>&6
10614 have_pth=no
10615 fi
10616
10617
10618                 if test $have_pth = yes ; then
10619                         cat >> confdefs.h <<\EOF
10620 #define HAVE_GNU_PTH 1
10621 EOF
10622
10623                         LTHREAD_LIBS="$LTHREAD_LIBS -lpth"
10624                         ol_link_threads=pth
10625
10626                         if test $ol_with_yielding_select = auto ; then
10627                                 ol_with_yielding_select=yes
10628                         fi
10629                 fi
10630         fi
10631 fi
10632
10633 if test $ol_with_threads = auto -o $ol_with_threads = yes \
10634         -o $ol_with_threads = lwp ; then
10635
10636                 for ac_hdr in thread.h synch.h
10637 do
10638 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10639 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10640 echo "configure:10641: checking for $ac_hdr" >&5
10641 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10642   echo $ac_n "(cached) $ac_c" 1>&6
10643 else
10644   cat > conftest.$ac_ext <<EOF
10645 #line 10646 "configure"
10646 #include "confdefs.h"
10647 #include <$ac_hdr>
10648 EOF
10649 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10650 { (eval echo configure:10651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10651 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10652 if test -z "$ac_err"; then
10653   rm -rf conftest*
10654   eval "ac_cv_header_$ac_safe=yes"
10655 else
10656   echo "$ac_err" >&5
10657   echo "configure: failed program was:" >&5
10658   cat conftest.$ac_ext >&5
10659   rm -rf conftest*
10660   eval "ac_cv_header_$ac_safe=no"
10661 fi
10662 rm -f conftest*
10663 fi
10664 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10665   echo "$ac_t""yes" 1>&6
10666     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10667   cat >> confdefs.h <<EOF
10668 #define $ac_tr_hdr 1
10669 EOF
10670  
10671 else
10672   echo "$ac_t""no" 1>&6
10673 fi
10674 done
10675
10676         if test $ac_cv_header_thread_h = yes -a $ac_cv_header_synch_h = yes ; then
10677                 echo $ac_n "checking for thr_create in -lthread""... $ac_c" 1>&6
10678 echo "configure:10679: checking for thr_create in -lthread" >&5
10679 ac_lib_var=`echo thread'_'thr_create | sed 'y%./+-:%__p__%'`
10680 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10681   echo $ac_n "(cached) $ac_c" 1>&6
10682 else
10683   ac_save_LIBS="$LIBS"
10684 LIBS="-lthread  $LIBS"
10685 cat > conftest.$ac_ext <<EOF
10686 #line 10687 "configure"
10687 #include "confdefs.h"
10688 /* Override any gcc2 internal prototype to avoid an error.  */
10689 /* We use char because int might match the return type of a gcc2
10690     builtin and then its argument prototype would still apply.  */
10691 char thr_create();
10692
10693 int main() {
10694 thr_create()
10695 ; return 0; }
10696 EOF
10697 if { (eval echo configure:10698: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10698   rm -rf conftest*
10699   eval "ac_cv_lib_$ac_lib_var=yes"
10700 else
10701   echo "configure: failed program was:" >&5
10702   cat conftest.$ac_ext >&5
10703   rm -rf conftest*
10704   eval "ac_cv_lib_$ac_lib_var=no"
10705 fi
10706 rm -f conftest*
10707 LIBS="$ac_save_LIBS"
10708
10709 fi
10710 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10711   echo "$ac_t""yes" 1>&6
10712   have_thr=yes
10713 else
10714   echo "$ac_t""no" 1>&6
10715 have_thr=no
10716 fi
10717
10718
10719                 if test $have_thr = yes ; then
10720                         cat >> confdefs.h <<\EOF
10721 #define HAVE_THR 1
10722 EOF
10723
10724                         LTHREAD_LIBS="$LTHREAD_LIBS -lthread"
10725                         ol_link_threads=thr
10726
10727                         if test $ol_with_yielding_select = auto ; then
10728                                 ol_with_yielding_select=yes
10729                         fi
10730
10731                                                 for ac_func in \
10732                                 thr_setconcurrency \
10733                                 thr_getconcurrency \
10734                         
10735 do
10736 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10737 echo "configure:10738: checking for $ac_func" >&5
10738 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10739   echo $ac_n "(cached) $ac_c" 1>&6
10740 else
10741   cat > conftest.$ac_ext <<EOF
10742 #line 10743 "configure"
10743 #include "confdefs.h"
10744 /* System header to define __stub macros and hopefully few prototypes,
10745     which can conflict with char $ac_func(); below.  */
10746 #include <assert.h>
10747 /* Override any gcc2 internal prototype to avoid an error.  */
10748 /* We use char because int might match the return type of a gcc2
10749     builtin and then its argument prototype would still apply.  */
10750 char $ac_func();
10751 char (*f)();
10752
10753 int main() {
10754
10755 /* The GNU C library defines this for functions which it implements
10756     to always fail with ENOSYS.  Some functions are actually named
10757     something starting with __ and the normal name is an alias.  */
10758 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10759 choke me
10760 #else
10761 f = $ac_func;
10762 #endif
10763
10764 ; return 0; }
10765 EOF
10766 if { (eval echo configure:10767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10767   rm -rf conftest*
10768   eval "ac_cv_func_$ac_func=yes"
10769 else
10770   echo "configure: failed program was:" >&5
10771   cat conftest.$ac_ext >&5
10772   rm -rf conftest*
10773   eval "ac_cv_func_$ac_func=no"
10774 fi
10775 rm -f conftest*
10776 fi
10777
10778 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10779   echo "$ac_t""yes" 1>&6
10780     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10781   cat >> confdefs.h <<EOF
10782 #define $ac_tr_func 1
10783 EOF
10784  
10785 else
10786   echo "$ac_t""no" 1>&6
10787 fi
10788 done
10789
10790                 fi
10791         fi
10792
10793                 for ac_hdr in lwp/lwp.h
10794 do
10795 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10796 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10797 echo "configure:10798: checking for $ac_hdr" >&5
10798 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10799   echo $ac_n "(cached) $ac_c" 1>&6
10800 else
10801   cat > conftest.$ac_ext <<EOF
10802 #line 10803 "configure"
10803 #include "confdefs.h"
10804 #include <$ac_hdr>
10805 EOF
10806 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10807 { (eval echo configure:10808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10808 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10809 if test -z "$ac_err"; then
10810   rm -rf conftest*
10811   eval "ac_cv_header_$ac_safe=yes"
10812 else
10813   echo "$ac_err" >&5
10814   echo "configure: failed program was:" >&5
10815   cat conftest.$ac_ext >&5
10816   rm -rf conftest*
10817   eval "ac_cv_header_$ac_safe=no"
10818 fi
10819 rm -f conftest*
10820 fi
10821 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10822   echo "$ac_t""yes" 1>&6
10823     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10824   cat >> confdefs.h <<EOF
10825 #define $ac_tr_hdr 1
10826 EOF
10827  
10828 else
10829   echo "$ac_t""no" 1>&6
10830 fi
10831 done
10832
10833         if test $ac_cv_header_lwp_lwp_h = yes ; then
10834                 echo $ac_n "checking for lwp_create in -llwp""... $ac_c" 1>&6
10835 echo "configure:10836: checking for lwp_create in -llwp" >&5
10836 ac_lib_var=`echo lwp'_'lwp_create | sed 'y%./+-:%__p__%'`
10837 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
10838   echo $ac_n "(cached) $ac_c" 1>&6
10839 else
10840   ac_save_LIBS="$LIBS"
10841 LIBS="-llwp  $LIBS"
10842 cat > conftest.$ac_ext <<EOF
10843 #line 10844 "configure"
10844 #include "confdefs.h"
10845 /* Override any gcc2 internal prototype to avoid an error.  */
10846 /* We use char because int might match the return type of a gcc2
10847     builtin and then its argument prototype would still apply.  */
10848 char lwp_create();
10849
10850 int main() {
10851 lwp_create()
10852 ; return 0; }
10853 EOF
10854 if { (eval echo configure:10855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10855   rm -rf conftest*
10856   eval "ac_cv_lib_$ac_lib_var=yes"
10857 else
10858   echo "configure: failed program was:" >&5
10859   cat conftest.$ac_ext >&5
10860   rm -rf conftest*
10861   eval "ac_cv_lib_$ac_lib_var=no"
10862 fi
10863 rm -f conftest*
10864 LIBS="$ac_save_LIBS"
10865
10866 fi
10867 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
10868   echo "$ac_t""yes" 1>&6
10869   have_lwp=yes
10870 else
10871   echo "$ac_t""no" 1>&6
10872 have_lwp=no
10873 fi
10874
10875
10876                 if test $have_lwp = yes ; then
10877                         cat >> confdefs.h <<\EOF
10878 #define HAVE_LWP 1
10879 EOF
10880
10881                         LTHREAD_LIBS="$LTHREAD_LIBS -llwp"
10882                         ol_link_threads=lwp
10883
10884                         if test $ol_with_yielding_select = auto ; then
10885                                 ol_with_yielding_select=no
10886                         fi
10887                 fi
10888         fi
10889 fi
10890
10891 if test $ol_with_yielding_select = yes ; then
10892         cat >> confdefs.h <<\EOF
10893 #define HAVE_YIELDING_SELECT 1
10894 EOF
10895
10896 fi
10897
10898 if test $ol_with_threads = manual ; then
10899                 ol_link_threads=yes
10900
10901         echo "configure: warning: thread defines and link options must be set manually" 1>&2
10902
10903         for ac_hdr in pthread.h sched.h
10904 do
10905 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
10906 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
10907 echo "configure:10908: checking for $ac_hdr" >&5
10908 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
10909   echo $ac_n "(cached) $ac_c" 1>&6
10910 else
10911   cat > conftest.$ac_ext <<EOF
10912 #line 10913 "configure"
10913 #include "confdefs.h"
10914 #include <$ac_hdr>
10915 EOF
10916 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
10917 { (eval echo configure:10918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
10918 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
10919 if test -z "$ac_err"; then
10920   rm -rf conftest*
10921   eval "ac_cv_header_$ac_safe=yes"
10922 else
10923   echo "$ac_err" >&5
10924   echo "configure: failed program was:" >&5
10925   cat conftest.$ac_ext >&5
10926   rm -rf conftest*
10927   eval "ac_cv_header_$ac_safe=no"
10928 fi
10929 rm -f conftest*
10930 fi
10931 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
10932   echo "$ac_t""yes" 1>&6
10933     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
10934   cat >> confdefs.h <<EOF
10935 #define $ac_tr_hdr 1
10936 EOF
10937  
10938 else
10939   echo "$ac_t""no" 1>&6
10940 fi
10941 done
10942
10943         for ac_func in sched_yield pthread_yield
10944 do
10945 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
10946 echo "configure:10947: checking for $ac_func" >&5
10947 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
10948   echo $ac_n "(cached) $ac_c" 1>&6
10949 else
10950   cat > conftest.$ac_ext <<EOF
10951 #line 10952 "configure"
10952 #include "confdefs.h"
10953 /* System header to define __stub macros and hopefully few prototypes,
10954     which can conflict with char $ac_func(); below.  */
10955 #include <assert.h>
10956 /* Override any gcc2 internal prototype to avoid an error.  */
10957 /* We use char because int might match the return type of a gcc2
10958     builtin and then its argument prototype would still apply.  */
10959 char $ac_func();
10960 char (*f)();
10961
10962 int main() {
10963
10964 /* The GNU C library defines this for functions which it implements
10965     to always fail with ENOSYS.  Some functions are actually named
10966     something starting with __ and the normal name is an alias.  */
10967 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
10968 choke me
10969 #else
10970 f = $ac_func;
10971 #endif
10972
10973 ; return 0; }
10974 EOF
10975 if { (eval echo configure:10976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
10976   rm -rf conftest*
10977   eval "ac_cv_func_$ac_func=yes"
10978 else
10979   echo "configure: failed program was:" >&5
10980   cat conftest.$ac_ext >&5
10981   rm -rf conftest*
10982   eval "ac_cv_func_$ac_func=no"
10983 fi
10984 rm -f conftest*
10985 fi
10986
10987 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
10988   echo "$ac_t""yes" 1>&6
10989     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
10990   cat >> confdefs.h <<EOF
10991 #define $ac_tr_func 1
10992 EOF
10993  
10994 else
10995   echo "$ac_t""no" 1>&6
10996 fi
10997 done
10998
10999         
11000         echo $ac_n "checking for LinuxThreads pthread.h""... $ac_c" 1>&6
11001 echo "configure:11002: checking for LinuxThreads pthread.h" >&5
11002 if eval "test \"\${ol_cv_header_linux_threads+set}\" = set"; then
11003   echo $ac_n "(cached) $ac_c" 1>&6
11004 else
11005   cat > conftest.$ac_ext <<EOF
11006 #line 11007 "configure"
11007 #include "confdefs.h"
11008 #include <pthread.h>
11009 EOF
11010 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11011   egrep "pthread_kill_other_threads_np" >/dev/null 2>&1; then
11012   rm -rf conftest*
11013   ol_cv_header_linux_threads=yes
11014 else
11015   rm -rf conftest*
11016   ol_cv_header_linux_threads=no
11017 fi
11018 rm -f conftest*
11019
11020                 
11021 fi
11022
11023 echo "$ac_t""$ol_cv_header_linux_threads" 1>&6
11024         if test $ol_cv_header_linux_threads = yes; then
11025                 cat >> confdefs.h <<\EOF
11026 #define HAVE_LINUX_THREADS 1
11027 EOF
11028
11029         fi
11030
11031
11032         for ac_hdr in mach/cthreads.h
11033 do
11034 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11035 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11036 echo "configure:11037: checking for $ac_hdr" >&5
11037 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11038   echo $ac_n "(cached) $ac_c" 1>&6
11039 else
11040   cat > conftest.$ac_ext <<EOF
11041 #line 11042 "configure"
11042 #include "confdefs.h"
11043 #include <$ac_hdr>
11044 EOF
11045 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11046 { (eval echo configure:11047: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11047 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11048 if test -z "$ac_err"; then
11049   rm -rf conftest*
11050   eval "ac_cv_header_$ac_safe=yes"
11051 else
11052   echo "$ac_err" >&5
11053   echo "configure: failed program was:" >&5
11054   cat conftest.$ac_ext >&5
11055   rm -rf conftest*
11056   eval "ac_cv_header_$ac_safe=no"
11057 fi
11058 rm -f conftest*
11059 fi
11060 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11061   echo "$ac_t""yes" 1>&6
11062     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11063   cat >> confdefs.h <<EOF
11064 #define $ac_tr_hdr 1
11065 EOF
11066  
11067 else
11068   echo "$ac_t""no" 1>&6
11069 fi
11070 done
11071
11072         for ac_hdr in lwp/lwp.h
11073 do
11074 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11075 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11076 echo "configure:11077: checking for $ac_hdr" >&5
11077 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11078   echo $ac_n "(cached) $ac_c" 1>&6
11079 else
11080   cat > conftest.$ac_ext <<EOF
11081 #line 11082 "configure"
11082 #include "confdefs.h"
11083 #include <$ac_hdr>
11084 EOF
11085 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11086 { (eval echo configure:11087: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11087 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11088 if test -z "$ac_err"; then
11089   rm -rf conftest*
11090   eval "ac_cv_header_$ac_safe=yes"
11091 else
11092   echo "$ac_err" >&5
11093   echo "configure: failed program was:" >&5
11094   cat conftest.$ac_ext >&5
11095   rm -rf conftest*
11096   eval "ac_cv_header_$ac_safe=no"
11097 fi
11098 rm -f conftest*
11099 fi
11100 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11101   echo "$ac_t""yes" 1>&6
11102     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11103   cat >> confdefs.h <<EOF
11104 #define $ac_tr_hdr 1
11105 EOF
11106  
11107 else
11108   echo "$ac_t""no" 1>&6
11109 fi
11110 done
11111
11112         for ac_hdr in thread.h synch.h
11113 do
11114 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11115 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11116 echo "configure:11117: checking for $ac_hdr" >&5
11117 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11118   echo $ac_n "(cached) $ac_c" 1>&6
11119 else
11120   cat > conftest.$ac_ext <<EOF
11121 #line 11122 "configure"
11122 #include "confdefs.h"
11123 #include <$ac_hdr>
11124 EOF
11125 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11126 { (eval echo configure:11127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11127 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11128 if test -z "$ac_err"; then
11129   rm -rf conftest*
11130   eval "ac_cv_header_$ac_safe=yes"
11131 else
11132   echo "$ac_err" >&5
11133   echo "configure: failed program was:" >&5
11134   cat conftest.$ac_ext >&5
11135   rm -rf conftest*
11136   eval "ac_cv_header_$ac_safe=no"
11137 fi
11138 rm -f conftest*
11139 fi
11140 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11141   echo "$ac_t""yes" 1>&6
11142     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11143   cat >> confdefs.h <<EOF
11144 #define $ac_tr_hdr 1
11145 EOF
11146  
11147 else
11148   echo "$ac_t""no" 1>&6
11149 fi
11150 done
11151
11152 fi
11153
11154 if test $ol_link_threads != no -a $ol_link_threads != nt ; then  
11155                         cat >> confdefs.h <<\EOF
11156 #define REENTRANT 1
11157 EOF
11158
11159         cat >> confdefs.h <<\EOF
11160 #define _REENTRANT 1
11161 EOF
11162
11163         cat >> confdefs.h <<\EOF
11164 #define THREAD_SAFE 1
11165 EOF
11166
11167         cat >> confdefs.h <<\EOF
11168 #define _THREAD_SAFE 1
11169 EOF
11170
11171         cat >> confdefs.h <<\EOF
11172 #define THREADSAFE 1
11173 EOF
11174
11175         cat >> confdefs.h <<\EOF
11176 #define _THREADSAFE 1
11177 EOF
11178
11179         cat >> confdefs.h <<\EOF
11180 #define _SGI_MP_SOURCE 1
11181 EOF
11182
11183
11184                         echo $ac_n "checking for thread specific errno""... $ac_c" 1>&6
11185 echo "configure:11186: checking for thread specific errno" >&5
11186 if eval "test \"\${ol_cv_errno_thread_specific+set}\" = set"; then
11187   echo $ac_n "(cached) $ac_c" 1>&6
11188 else
11189   
11190                 cat > conftest.$ac_ext <<EOF
11191 #line 11192 "configure"
11192 #include "confdefs.h"
11193 #include <errno.h>
11194 int main() {
11195 errno = 0;
11196 ; return 0; }
11197 EOF
11198 if { (eval echo configure:11199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11199   rm -rf conftest*
11200   ol_cv_errno_thread_specific=yes
11201 else
11202   echo "configure: failed program was:" >&5
11203   cat conftest.$ac_ext >&5
11204   rm -rf conftest*
11205   ol_cv_errno_thread_specific=no
11206 fi
11207 rm -f conftest*
11208         
11209 fi
11210
11211 echo "$ac_t""$ol_cv_errno_thread_specific" 1>&6
11212
11213                         echo $ac_n "checking for thread specific h_errno""... $ac_c" 1>&6
11214 echo "configure:11215: checking for thread specific h_errno" >&5
11215 if eval "test \"\${ol_cv_h_errno_thread_specific+set}\" = set"; then
11216   echo $ac_n "(cached) $ac_c" 1>&6
11217 else
11218   
11219                 cat > conftest.$ac_ext <<EOF
11220 #line 11221 "configure"
11221 #include "confdefs.h"
11222 #include <netdb.h>
11223 int main() {
11224 h_errno = 0;
11225 ; return 0; }
11226 EOF
11227 if { (eval echo configure:11228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11228   rm -rf conftest*
11229   ol_cv_h_errno_thread_specific=yes
11230 else
11231   echo "configure: failed program was:" >&5
11232   cat conftest.$ac_ext >&5
11233   rm -rf conftest*
11234   ol_cv_h_errno_thread_specific=no
11235 fi
11236 rm -f conftest*
11237         
11238 fi
11239
11240 echo "$ac_t""$ol_cv_h_errno_thread_specific" 1>&6
11241
11242         if test $ol_cv_errno_thread_specific != yes \
11243                 -o $ol_cv_h_errno_thread_specific != yes ; then
11244                 LIBS="$LTHREAD_LIBS $LIBS"
11245                 LTHREAD_LIBS=""
11246         fi
11247
11248 fi  
11249
11250 if test $ol_link_threads = no ; then
11251         if test $ol_with_threads = yes ; then
11252                 { echo "configure: error: no suitable thread support" 1>&2; exit 1; }
11253         fi
11254
11255         if test $ol_with_threads = auto ; then
11256                 echo "configure: warning: no suitable thread support, disabling threads" 1>&2
11257                 ol_with_threads=no
11258         fi
11259
11260         cat >> confdefs.h <<\EOF
11261 #define NO_THREADS 1
11262 EOF
11263
11264         LTHREAD_LIBS=""
11265 fi
11266
11267 if test $ol_link_threads != no ; then
11268         cat >> confdefs.h <<\EOF
11269 #define LDAP_API_FEATURE_X_OPENLDAP_THREAD_SAFE 1
11270 EOF
11271
11272 fi
11273
11274 ol_link_ldbm=no 
11275
11276 if test $ol_with_ldbm_api = auto \
11277         -o $ol_with_ldbm_api = berkeley \
11278         -o $ol_with_ldbm_api = bcompat ; then
11279
11280         if test $ol_with_ldbm_api = bcompat; then \
11281                 ol_cv_berkeley_db=no
11282 for ac_hdr in db_185.h db.h
11283 do
11284 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11285 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11286 echo "configure:11287: checking for $ac_hdr" >&5
11287 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11288   echo $ac_n "(cached) $ac_c" 1>&6
11289 else
11290   cat > conftest.$ac_ext <<EOF
11291 #line 11292 "configure"
11292 #include "confdefs.h"
11293 #include <$ac_hdr>
11294 EOF
11295 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11296 { (eval echo configure:11297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11297 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11298 if test -z "$ac_err"; then
11299   rm -rf conftest*
11300   eval "ac_cv_header_$ac_safe=yes"
11301 else
11302   echo "$ac_err" >&5
11303   echo "configure: failed program was:" >&5
11304   cat conftest.$ac_ext >&5
11305   rm -rf conftest*
11306   eval "ac_cv_header_$ac_safe=no"
11307 fi
11308 rm -f conftest*
11309 fi
11310 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11311   echo "$ac_t""yes" 1>&6
11312     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11313   cat >> confdefs.h <<EOF
11314 #define $ac_tr_hdr 1
11315 EOF
11316  
11317 else
11318   echo "$ac_t""no" 1>&6
11319 fi
11320 done
11321
11322 if test $ac_cv_header_db_185_h = yes -o $ac_cv_header_db_h = yes; then
11323         echo $ac_n "checking if Berkeley DB header compatibility""... $ac_c" 1>&6
11324 echo "configure:11325: checking if Berkeley DB header compatibility" >&5
11325 if eval "test \"\${ol_cv_header_db1+set}\" = set"; then
11326   echo $ac_n "(cached) $ac_c" 1>&6
11327 else
11328   
11329                 cat > conftest.$ac_ext <<EOF
11330 #line 11331 "configure"
11331 #include "confdefs.h"
11332
11333 #if HAVE_DB_185_H
11334 #       include <db_185.h>
11335 #else
11336 #       include <db.h>
11337 #endif
11338
11339  /* this check could be improved */
11340 #ifndef DB_VERSION_MAJOR
11341 #       define DB_VERSION_MAJOR 1
11342 #endif
11343
11344 #if DB_VERSION_MAJOR == 1 
11345         __db_version_1
11346 #endif
11347
11348 EOF
11349 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
11350   egrep "__db_version_1" >/dev/null 2>&1; then
11351   rm -rf conftest*
11352   ol_cv_header_db1=yes
11353 else
11354   rm -rf conftest*
11355   ol_cv_header_db1=no
11356 fi
11357 rm -f conftest*
11358
11359 fi
11360
11361 echo "$ac_t""$ol_cv_header_db1" 1>&6
11362
11363         if test ol_cv_header_db1=yes ; then
11364                 ol_cv_lib_db=no
11365 if test $ol_cv_lib_db = no ; then
11366         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11367 echo "configure:11368: checking for Berkeley DB link (default)" >&5
11368 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11369   echo $ac_n "(cached) $ac_c" 1>&6
11370 else
11371   
11372         ol_DB_LIB=
11373         ol_LIBS=$LIBS
11374         LIBS="$ol_DB_LIB $LIBS"
11375
11376         cat > conftest.$ac_ext <<EOF
11377 #line 11378 "configure"
11378 #include "confdefs.h"
11379
11380 #ifdef HAVE_DB_185_H
11381 # include <db_185.h>
11382 #else
11383 # include <db.h>
11384 #endif
11385
11386 #ifndef DB_VERSION_MAJOR
11387 # define DB_VERSION_MAJOR 1
11388 #endif
11389
11390 #ifndef NULL
11391 #define NULL ((void*)0)
11392 #endif
11393
11394 int main() {
11395
11396 #if DB_VERSION_MAJOR > 2
11397         db_env_create( NULL, 0 );
11398 #elif DB_VERSION_MAJOR > 1
11399         db_appexit( NULL );
11400 #else
11401         (void) dbopen( NULL, 0, 0, 0, NULL);
11402 #endif
11403
11404 ; return 0; }
11405 EOF
11406 if { (eval echo configure:11407: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11407   rm -rf conftest*
11408   ol_cv_db_none=yes
11409 else
11410   echo "configure: failed program was:" >&5
11411   cat conftest.$ac_ext >&5
11412   rm -rf conftest*
11413   ol_cv_db_none=no
11414 fi
11415 rm -f conftest*
11416
11417         LIBS="$ol_LIBS"
11418
11419 fi
11420
11421 echo "$ac_t""$ol_cv_db_none" 1>&6
11422
11423         if test $ol_cv_db_none = yes ; then
11424                 ol_cv_lib_db=yes
11425         fi
11426 fi
11427
11428 if test $ol_cv_lib_db = no ; then
11429         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11430 echo "configure:11431: checking for Berkeley DB link (-ldb)" >&5
11431 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11432   echo $ac_n "(cached) $ac_c" 1>&6
11433 else
11434   
11435         ol_DB_LIB=-ldb
11436         ol_LIBS=$LIBS
11437         LIBS="$ol_DB_LIB $LIBS"
11438
11439         cat > conftest.$ac_ext <<EOF
11440 #line 11441 "configure"
11441 #include "confdefs.h"
11442
11443 #ifdef HAVE_DB_185_H
11444 # include <db_185.h>
11445 #else
11446 # include <db.h>
11447 #endif
11448
11449 #ifndef DB_VERSION_MAJOR
11450 # define DB_VERSION_MAJOR 1
11451 #endif
11452
11453 #ifndef NULL
11454 #define NULL ((void*)0)
11455 #endif
11456
11457 int main() {
11458
11459 #if DB_VERSION_MAJOR > 2
11460         db_env_create( NULL, 0 );
11461 #elif DB_VERSION_MAJOR > 1
11462         db_appexit( NULL );
11463 #else
11464         (void) dbopen( NULL, 0, 0, 0, NULL);
11465 #endif
11466
11467 ; return 0; }
11468 EOF
11469 if { (eval echo configure:11470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11470   rm -rf conftest*
11471   ol_cv_db_db=yes
11472 else
11473   echo "configure: failed program was:" >&5
11474   cat conftest.$ac_ext >&5
11475   rm -rf conftest*
11476   ol_cv_db_db=no
11477 fi
11478 rm -f conftest*
11479
11480         LIBS="$ol_LIBS"
11481
11482 fi
11483
11484 echo "$ac_t""$ol_cv_db_db" 1>&6
11485
11486         if test $ol_cv_db_db = yes ; then
11487                 ol_cv_lib_db=-ldb
11488         fi
11489 fi
11490
11491 if test $ol_cv_lib_db = no ; then
11492         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11493 echo "configure:11494: checking for Berkeley DB link (-ldb3)" >&5
11494 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11495   echo $ac_n "(cached) $ac_c" 1>&6
11496 else
11497   
11498         ol_DB_LIB=-ldb3
11499         ol_LIBS=$LIBS
11500         LIBS="$ol_DB_LIB $LIBS"
11501
11502         cat > conftest.$ac_ext <<EOF
11503 #line 11504 "configure"
11504 #include "confdefs.h"
11505
11506 #ifdef HAVE_DB_185_H
11507 # include <db_185.h>
11508 #else
11509 # include <db.h>
11510 #endif
11511
11512 #ifndef DB_VERSION_MAJOR
11513 # define DB_VERSION_MAJOR 1
11514 #endif
11515
11516 #ifndef NULL
11517 #define NULL ((void*)0)
11518 #endif
11519
11520 int main() {
11521
11522 #if DB_VERSION_MAJOR > 2
11523         db_env_create( NULL, 0 );
11524 #elif DB_VERSION_MAJOR > 1
11525         db_appexit( NULL );
11526 #else
11527         (void) dbopen( NULL, 0, 0, 0, NULL);
11528 #endif
11529
11530 ; return 0; }
11531 EOF
11532 if { (eval echo configure:11533: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11533   rm -rf conftest*
11534   ol_cv_db_db3=yes
11535 else
11536   echo "configure: failed program was:" >&5
11537   cat conftest.$ac_ext >&5
11538   rm -rf conftest*
11539   ol_cv_db_db3=no
11540 fi
11541 rm -f conftest*
11542
11543         LIBS="$ol_LIBS"
11544
11545 fi
11546
11547 echo "$ac_t""$ol_cv_db_db3" 1>&6
11548
11549         if test $ol_cv_db_db3 = yes ; then
11550                 ol_cv_lib_db=-ldb3
11551         fi
11552 fi
11553
11554 if test $ol_cv_lib_db = no ; then
11555         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11556 echo "configure:11557: checking for Berkeley DB link (-ldb2)" >&5
11557 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11558   echo $ac_n "(cached) $ac_c" 1>&6
11559 else
11560   
11561         ol_DB_LIB=-ldb2
11562         ol_LIBS=$LIBS
11563         LIBS="$ol_DB_LIB $LIBS"
11564
11565         cat > conftest.$ac_ext <<EOF
11566 #line 11567 "configure"
11567 #include "confdefs.h"
11568
11569 #ifdef HAVE_DB_185_H
11570 # include <db_185.h>
11571 #else
11572 # include <db.h>
11573 #endif
11574
11575 #ifndef DB_VERSION_MAJOR
11576 # define DB_VERSION_MAJOR 1
11577 #endif
11578
11579 #ifndef NULL
11580 #define NULL ((void*)0)
11581 #endif
11582
11583 int main() {
11584
11585 #if DB_VERSION_MAJOR > 2
11586         db_env_create( NULL, 0 );
11587 #elif DB_VERSION_MAJOR > 1
11588         db_appexit( NULL );
11589 #else
11590         (void) dbopen( NULL, 0, 0, 0, NULL);
11591 #endif
11592
11593 ; return 0; }
11594 EOF
11595 if { (eval echo configure:11596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11596   rm -rf conftest*
11597   ol_cv_db_db2=yes
11598 else
11599   echo "configure: failed program was:" >&5
11600   cat conftest.$ac_ext >&5
11601   rm -rf conftest*
11602   ol_cv_db_db2=no
11603 fi
11604 rm -f conftest*
11605
11606         LIBS="$ol_LIBS"
11607
11608 fi
11609
11610 echo "$ac_t""$ol_cv_db_db2" 1>&6
11611
11612         if test $ol_cv_db_db2 = yes ; then
11613                 ol_cv_lib_db=-ldb2
11614         fi
11615 fi
11616
11617 if test $ol_cv_lib_db = no ; then
11618         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11619 echo "configure:11620: checking for Berkeley DB link (-ldb1)" >&5
11620 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11621   echo $ac_n "(cached) $ac_c" 1>&6
11622 else
11623   
11624         ol_DB_LIB=-ldb1
11625         ol_LIBS=$LIBS
11626         LIBS="$ol_DB_LIB $LIBS"
11627
11628         cat > conftest.$ac_ext <<EOF
11629 #line 11630 "configure"
11630 #include "confdefs.h"
11631
11632 #ifdef HAVE_DB_185_H
11633 # include <db_185.h>
11634 #else
11635 # include <db.h>
11636 #endif
11637
11638 #ifndef DB_VERSION_MAJOR
11639 # define DB_VERSION_MAJOR 1
11640 #endif
11641
11642 #ifndef NULL
11643 #define NULL ((void*)0)
11644 #endif
11645
11646 int main() {
11647
11648 #if DB_VERSION_MAJOR > 2
11649         db_env_create( NULL, 0 );
11650 #elif DB_VERSION_MAJOR > 1
11651         db_appexit( NULL );
11652 #else
11653         (void) dbopen( NULL, 0, 0, 0, NULL);
11654 #endif
11655
11656 ; return 0; }
11657 EOF
11658 if { (eval echo configure:11659: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11659   rm -rf conftest*
11660   ol_cv_db_db1=yes
11661 else
11662   echo "configure: failed program was:" >&5
11663   cat conftest.$ac_ext >&5
11664   rm -rf conftest*
11665   ol_cv_db_db1=no
11666 fi
11667 rm -f conftest*
11668
11669         LIBS="$ol_LIBS"
11670
11671 fi
11672
11673 echo "$ac_t""$ol_cv_db_db1" 1>&6
11674
11675         if test $ol_cv_db_db1 = yes ; then
11676                 ol_cv_lib_db=-ldb1
11677         fi
11678 fi
11679
11680
11681                 if test "$ol_cv_lib_db" != no ; then
11682                         ol_cv_berkeley_db=yes
11683                 fi
11684         fi
11685 fi
11686
11687         else
11688                 ol_cv_berkeley_db=no
11689 for ac_hdr in db.h
11690 do
11691 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
11692 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
11693 echo "configure:11694: checking for $ac_hdr" >&5
11694 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
11695   echo $ac_n "(cached) $ac_c" 1>&6
11696 else
11697   cat > conftest.$ac_ext <<EOF
11698 #line 11699 "configure"
11699 #include "confdefs.h"
11700 #include <$ac_hdr>
11701 EOF
11702 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
11703 { (eval echo configure:11704: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
11704 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
11705 if test -z "$ac_err"; then
11706   rm -rf conftest*
11707   eval "ac_cv_header_$ac_safe=yes"
11708 else
11709   echo "$ac_err" >&5
11710   echo "configure: failed program was:" >&5
11711   cat conftest.$ac_ext >&5
11712   rm -rf conftest*
11713   eval "ac_cv_header_$ac_safe=no"
11714 fi
11715 rm -f conftest*
11716 fi
11717 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
11718   echo "$ac_t""yes" 1>&6
11719     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
11720   cat >> confdefs.h <<EOF
11721 #define $ac_tr_hdr 1
11722 EOF
11723  
11724 else
11725   echo "$ac_t""no" 1>&6
11726 fi
11727 done
11728
11729 if test $ac_cv_header_db_h = yes; then
11730         ol_cv_lib_db=no
11731 if test $ol_cv_lib_db = no ; then
11732         echo $ac_n "checking for Berkeley DB link (default)""... $ac_c" 1>&6
11733 echo "configure:11734: checking for Berkeley DB link (default)" >&5
11734 if eval "test \"\${ol_cv_db_none+set}\" = set"; then
11735   echo $ac_n "(cached) $ac_c" 1>&6
11736 else
11737   
11738         ol_DB_LIB=
11739         ol_LIBS=$LIBS
11740         LIBS="$ol_DB_LIB $LIBS"
11741
11742         cat > conftest.$ac_ext <<EOF
11743 #line 11744 "configure"
11744 #include "confdefs.h"
11745
11746 #ifdef HAVE_DB_185_H
11747 # include <db_185.h>
11748 #else
11749 # include <db.h>
11750 #endif
11751
11752 #ifndef DB_VERSION_MAJOR
11753 # define DB_VERSION_MAJOR 1
11754 #endif
11755
11756 #ifndef NULL
11757 #define NULL ((void*)0)
11758 #endif
11759
11760 int main() {
11761
11762 #if DB_VERSION_MAJOR > 2
11763         db_env_create( NULL, 0 );
11764 #elif DB_VERSION_MAJOR > 1
11765         db_appexit( NULL );
11766 #else
11767         (void) dbopen( NULL, 0, 0, 0, NULL);
11768 #endif
11769
11770 ; return 0; }
11771 EOF
11772 if { (eval echo configure:11773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11773   rm -rf conftest*
11774   ol_cv_db_none=yes
11775 else
11776   echo "configure: failed program was:" >&5
11777   cat conftest.$ac_ext >&5
11778   rm -rf conftest*
11779   ol_cv_db_none=no
11780 fi
11781 rm -f conftest*
11782
11783         LIBS="$ol_LIBS"
11784
11785 fi
11786
11787 echo "$ac_t""$ol_cv_db_none" 1>&6
11788
11789         if test $ol_cv_db_none = yes ; then
11790                 ol_cv_lib_db=yes
11791         fi
11792 fi
11793
11794 if test $ol_cv_lib_db = no ; then
11795         echo $ac_n "checking for Berkeley DB link (-ldb)""... $ac_c" 1>&6
11796 echo "configure:11797: checking for Berkeley DB link (-ldb)" >&5
11797 if eval "test \"\${ol_cv_db_db+set}\" = set"; then
11798   echo $ac_n "(cached) $ac_c" 1>&6
11799 else
11800   
11801         ol_DB_LIB=-ldb
11802         ol_LIBS=$LIBS
11803         LIBS="$ol_DB_LIB $LIBS"
11804
11805         cat > conftest.$ac_ext <<EOF
11806 #line 11807 "configure"
11807 #include "confdefs.h"
11808
11809 #ifdef HAVE_DB_185_H
11810 # include <db_185.h>
11811 #else
11812 # include <db.h>
11813 #endif
11814
11815 #ifndef DB_VERSION_MAJOR
11816 # define DB_VERSION_MAJOR 1
11817 #endif
11818
11819 #ifndef NULL
11820 #define NULL ((void*)0)
11821 #endif
11822
11823 int main() {
11824
11825 #if DB_VERSION_MAJOR > 2
11826         db_env_create( NULL, 0 );
11827 #elif DB_VERSION_MAJOR > 1
11828         db_appexit( NULL );
11829 #else
11830         (void) dbopen( NULL, 0, 0, 0, NULL);
11831 #endif
11832
11833 ; return 0; }
11834 EOF
11835 if { (eval echo configure:11836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11836   rm -rf conftest*
11837   ol_cv_db_db=yes
11838 else
11839   echo "configure: failed program was:" >&5
11840   cat conftest.$ac_ext >&5
11841   rm -rf conftest*
11842   ol_cv_db_db=no
11843 fi
11844 rm -f conftest*
11845
11846         LIBS="$ol_LIBS"
11847
11848 fi
11849
11850 echo "$ac_t""$ol_cv_db_db" 1>&6
11851
11852         if test $ol_cv_db_db = yes ; then
11853                 ol_cv_lib_db=-ldb
11854         fi
11855 fi
11856
11857 if test $ol_cv_lib_db = no ; then
11858         echo $ac_n "checking for Berkeley DB link (-ldb3)""... $ac_c" 1>&6
11859 echo "configure:11860: checking for Berkeley DB link (-ldb3)" >&5
11860 if eval "test \"\${ol_cv_db_db3+set}\" = set"; then
11861   echo $ac_n "(cached) $ac_c" 1>&6
11862 else
11863   
11864         ol_DB_LIB=-ldb3
11865         ol_LIBS=$LIBS
11866         LIBS="$ol_DB_LIB $LIBS"
11867
11868         cat > conftest.$ac_ext <<EOF
11869 #line 11870 "configure"
11870 #include "confdefs.h"
11871
11872 #ifdef HAVE_DB_185_H
11873 # include <db_185.h>
11874 #else
11875 # include <db.h>
11876 #endif
11877
11878 #ifndef DB_VERSION_MAJOR
11879 # define DB_VERSION_MAJOR 1
11880 #endif
11881
11882 #ifndef NULL
11883 #define NULL ((void*)0)
11884 #endif
11885
11886 int main() {
11887
11888 #if DB_VERSION_MAJOR > 2
11889         db_env_create( NULL, 0 );
11890 #elif DB_VERSION_MAJOR > 1
11891         db_appexit( NULL );
11892 #else
11893         (void) dbopen( NULL, 0, 0, 0, NULL);
11894 #endif
11895
11896 ; return 0; }
11897 EOF
11898 if { (eval echo configure:11899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11899   rm -rf conftest*
11900   ol_cv_db_db3=yes
11901 else
11902   echo "configure: failed program was:" >&5
11903   cat conftest.$ac_ext >&5
11904   rm -rf conftest*
11905   ol_cv_db_db3=no
11906 fi
11907 rm -f conftest*
11908
11909         LIBS="$ol_LIBS"
11910
11911 fi
11912
11913 echo "$ac_t""$ol_cv_db_db3" 1>&6
11914
11915         if test $ol_cv_db_db3 = yes ; then
11916                 ol_cv_lib_db=-ldb3
11917         fi
11918 fi
11919
11920 if test $ol_cv_lib_db = no ; then
11921         echo $ac_n "checking for Berkeley DB link (-ldb2)""... $ac_c" 1>&6
11922 echo "configure:11923: checking for Berkeley DB link (-ldb2)" >&5
11923 if eval "test \"\${ol_cv_db_db2+set}\" = set"; then
11924   echo $ac_n "(cached) $ac_c" 1>&6
11925 else
11926   
11927         ol_DB_LIB=-ldb2
11928         ol_LIBS=$LIBS
11929         LIBS="$ol_DB_LIB $LIBS"
11930
11931         cat > conftest.$ac_ext <<EOF
11932 #line 11933 "configure"
11933 #include "confdefs.h"
11934
11935 #ifdef HAVE_DB_185_H
11936 # include <db_185.h>
11937 #else
11938 # include <db.h>
11939 #endif
11940
11941 #ifndef DB_VERSION_MAJOR
11942 # define DB_VERSION_MAJOR 1
11943 #endif
11944
11945 #ifndef NULL
11946 #define NULL ((void*)0)
11947 #endif
11948
11949 int main() {
11950
11951 #if DB_VERSION_MAJOR > 2
11952         db_env_create( NULL, 0 );
11953 #elif DB_VERSION_MAJOR > 1
11954         db_appexit( NULL );
11955 #else
11956         (void) dbopen( NULL, 0, 0, 0, NULL);
11957 #endif
11958
11959 ; return 0; }
11960 EOF
11961 if { (eval echo configure:11962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
11962   rm -rf conftest*
11963   ol_cv_db_db2=yes
11964 else
11965   echo "configure: failed program was:" >&5
11966   cat conftest.$ac_ext >&5
11967   rm -rf conftest*
11968   ol_cv_db_db2=no
11969 fi
11970 rm -f conftest*
11971
11972         LIBS="$ol_LIBS"
11973
11974 fi
11975
11976 echo "$ac_t""$ol_cv_db_db2" 1>&6
11977
11978         if test $ol_cv_db_db2 = yes ; then
11979                 ol_cv_lib_db=-ldb2
11980         fi
11981 fi
11982
11983 if test $ol_cv_lib_db = no ; then
11984         echo $ac_n "checking for Berkeley DB link (-ldb1)""... $ac_c" 1>&6
11985 echo "configure:11986: checking for Berkeley DB link (-ldb1)" >&5
11986 if eval "test \"\${ol_cv_db_db1+set}\" = set"; then
11987   echo $ac_n "(cached) $ac_c" 1>&6
11988 else
11989   
11990         ol_DB_LIB=-ldb1
11991         ol_LIBS=$LIBS
11992         LIBS="$ol_DB_LIB $LIBS"
11993
11994         cat > conftest.$ac_ext <<EOF
11995 #line 11996 "configure"
11996 #include "confdefs.h"
11997
11998 #ifdef HAVE_DB_185_H
11999 # include <db_185.h>
12000 #else
12001 # include <db.h>
12002 #endif
12003
12004 #ifndef DB_VERSION_MAJOR
12005 # define DB_VERSION_MAJOR 1
12006 #endif
12007
12008 #ifndef NULL
12009 #define NULL ((void*)0)
12010 #endif
12011
12012 int main() {
12013
12014 #if DB_VERSION_MAJOR > 2
12015         db_env_create( NULL, 0 );
12016 #elif DB_VERSION_MAJOR > 1
12017         db_appexit( NULL );
12018 #else
12019         (void) dbopen( NULL, 0, 0, 0, NULL);
12020 #endif
12021
12022 ; return 0; }
12023 EOF
12024 if { (eval echo configure:12025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12025   rm -rf conftest*
12026   ol_cv_db_db1=yes
12027 else
12028   echo "configure: failed program was:" >&5
12029   cat conftest.$ac_ext >&5
12030   rm -rf conftest*
12031   ol_cv_db_db1=no
12032 fi
12033 rm -f conftest*
12034
12035         LIBS="$ol_LIBS"
12036
12037 fi
12038
12039 echo "$ac_t""$ol_cv_db_db1" 1>&6
12040
12041         if test $ol_cv_db_db1 = yes ; then
12042                 ol_cv_lib_db=-ldb1
12043         fi
12044 fi
12045
12046
12047         if test "$ol_cv_lib_db" != no ; then
12048                 ol_cv_berkeley_db=yes
12049                 echo $ac_n "checking for Berkeley DB thread support""... $ac_c" 1>&6
12050 echo "configure:12051: checking for Berkeley DB thread support" >&5
12051 if eval "test \"\${ol_cv_berkeley_db_thread+set}\" = set"; then
12052   echo $ac_n "(cached) $ac_c" 1>&6
12053 else
12054   
12055         ol_LIBS="$LIBS"
12056         if test $ol_cv_lib_db != yes ; then
12057                 LIBS="$ol_cv_lib_db"
12058         fi
12059
12060         if test "$cross_compiling" = yes; then
12061   ol_cv_berkeley_db_thread=cross
12062 else
12063   cat > conftest.$ac_ext <<EOF
12064 #line 12065 "configure"
12065 #include "confdefs.h"
12066
12067 #ifdef HAVE_DB_185_H
12068         choke me;
12069 #else
12070 #include <db.h>
12071 #endif
12072 #ifndef NULL
12073 #define NULL ((void *)0)
12074 #endif
12075 main()
12076 {
12077         int rc;
12078         u_int32_t flags = DB_CREATE | DB_THREAD;
12079
12080 #if DB_VERSION_MAJOR > 2
12081         DB_ENV *env = NULL;
12082
12083         rc = db_env_create( &env, 0 );
12084
12085         if( rc == 0 ) {
12086 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12087                 rc = env->open( env, NULL, flags, 0 );
12088 #else
12089                 rc = env->open( env, NULL, NULL, flags, 0 );
12090 #endif
12091         }
12092
12093 #else
12094         DB_ENV env;
12095         memset( &env, '\0', sizeof(env) );
12096
12097         rc = db_appinit( NULL, NULL, &env, flags );
12098
12099         if( rc == 0 ) {
12100                 db_appexit( &env );
12101         }
12102 #endif
12103 #if DB_VERSION_MAJOR > 2
12104 #if (DB_VERSION_MAJOR > 3) || (DB_VERSION_MINOR >= 1)
12105         env->remove( env, NULL, DB_FORCE);
12106 #else
12107         env->remove( env, NULL, NULL, DB_FORCE);
12108 #endif
12109 #endif
12110
12111         return rc;
12112 }
12113 EOF
12114 if { (eval echo configure:12115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
12115 then
12116   ol_cv_berkeley_db_thread=yes
12117 else
12118   echo "configure: failed program was:" >&5
12119   cat conftest.$ac_ext >&5
12120   rm -fr conftest*
12121   ol_cv_berkeley_db_thread=no
12122 fi
12123 rm -fr conftest*
12124 fi
12125
12126
12127         LIBS="$ol_LIBS"
12128
12129         if test $ol_cv_berkeley_db_thread != no ; then
12130                 cat >> confdefs.h <<\EOF
12131 #define HAVE_BERKELEY_DB_THREAD 1
12132 EOF
12133
12134         fi
12135
12136 fi
12137
12138 echo "$ac_t""$ol_cv_berkeley_db_thread" 1>&6
12139         fi
12140 fi
12141
12142         fi
12143
12144         if test $ol_cv_berkeley_db != no ; then
12145                 cat >> confdefs.h <<\EOF
12146 #define HAVE_BERKELEY_DB 1
12147 EOF
12148
12149
12150                 ol_link_ldbm=berkeley
12151                 ol_with_ldbm_api=db
12152
12153                 if test $ol_with_ldbm_type = hash ; then
12154                         cat >> confdefs.h <<\EOF
12155 #define LDBM_USE_DBHASH 1
12156 EOF
12157
12158                 else
12159                         cat >> confdefs.h <<\EOF
12160 #define LDBM_USE_DBBTREE 1
12161 EOF
12162
12163                 fi
12164
12165                                                 if test $ol_cv_lib_db != yes ; then
12166                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_db"
12167                 fi
12168         fi
12169 fi
12170
12171 if test $ol_link_ldbm = no -a $ol_with_ldbm_type = btree ; then
12172         echo "configure: warning: Could not find LDBM with BTREE support" 1>&2
12173         ol_with_ldbm_api=none
12174 fi
12175
12176 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = mdbm ; then
12177         echo $ac_n "checking for MDBM library""... $ac_c" 1>&6
12178 echo "configure:12179: checking for MDBM library" >&5
12179 if eval "test \"\${ol_cv_lib_mdbm+set}\" = set"; then
12180   echo $ac_n "(cached) $ac_c" 1>&6
12181 else
12182         ol_LIBS="$LIBS"
12183         echo $ac_n "checking for mdbm_set_chain""... $ac_c" 1>&6
12184 echo "configure:12185: checking for mdbm_set_chain" >&5
12185 if eval "test \"\${ac_cv_func_mdbm_set_chain+set}\" = set"; then
12186   echo $ac_n "(cached) $ac_c" 1>&6
12187 else
12188   cat > conftest.$ac_ext <<EOF
12189 #line 12190 "configure"
12190 #include "confdefs.h"
12191 /* System header to define __stub macros and hopefully few prototypes,
12192     which can conflict with char mdbm_set_chain(); below.  */
12193 #include <assert.h>
12194 /* Override any gcc2 internal prototype to avoid an error.  */
12195 /* We use char because int might match the return type of a gcc2
12196     builtin and then its argument prototype would still apply.  */
12197 char mdbm_set_chain();
12198 char (*f)();
12199
12200 int main() {
12201
12202 /* The GNU C library defines this for functions which it implements
12203     to always fail with ENOSYS.  Some functions are actually named
12204     something starting with __ and the normal name is an alias.  */
12205 #if defined (__stub_mdbm_set_chain) || defined (__stub___mdbm_set_chain)
12206 choke me
12207 #else
12208 f = mdbm_set_chain;
12209 #endif
12210
12211 ; return 0; }
12212 EOF
12213 if { (eval echo configure:12214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12214   rm -rf conftest*
12215   eval "ac_cv_func_mdbm_set_chain=yes"
12216 else
12217   echo "configure: failed program was:" >&5
12218   cat conftest.$ac_ext >&5
12219   rm -rf conftest*
12220   eval "ac_cv_func_mdbm_set_chain=no"
12221 fi
12222 rm -f conftest*
12223 fi
12224
12225 if eval "test \"`echo '$ac_cv_func_'mdbm_set_chain`\" = yes"; then
12226   echo "$ac_t""yes" 1>&6
12227   ol_cv_lib_mdbm=yes
12228 else
12229   echo "$ac_t""no" 1>&6
12230
12231                 echo $ac_n "checking for mdbm_set_chain in -lmdbm""... $ac_c" 1>&6
12232 echo "configure:12233: checking for mdbm_set_chain in -lmdbm" >&5
12233 ac_lib_var=`echo mdbm'_'mdbm_set_chain | sed 'y%./+-:%__p__%'`
12234 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12235   echo $ac_n "(cached) $ac_c" 1>&6
12236 else
12237   ac_save_LIBS="$LIBS"
12238 LIBS="-lmdbm  $LIBS"
12239 cat > conftest.$ac_ext <<EOF
12240 #line 12241 "configure"
12241 #include "confdefs.h"
12242 /* Override any gcc2 internal prototype to avoid an error.  */
12243 /* We use char because int might match the return type of a gcc2
12244     builtin and then its argument prototype would still apply.  */
12245 char mdbm_set_chain();
12246
12247 int main() {
12248 mdbm_set_chain()
12249 ; return 0; }
12250 EOF
12251 if { (eval echo configure:12252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12252   rm -rf conftest*
12253   eval "ac_cv_lib_$ac_lib_var=yes"
12254 else
12255   echo "configure: failed program was:" >&5
12256   cat conftest.$ac_ext >&5
12257   rm -rf conftest*
12258   eval "ac_cv_lib_$ac_lib_var=no"
12259 fi
12260 rm -f conftest*
12261 LIBS="$ac_save_LIBS"
12262
12263 fi
12264 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12265   echo "$ac_t""yes" 1>&6
12266   ol_cv_lib_mdbm=-lmdbm
12267 else
12268   echo "$ac_t""no" 1>&6
12269 ol_cv_lib_mdbm=no
12270 fi
12271
12272         
12273 fi
12274
12275         LIBS="$ol_LIBS"
12276
12277 fi
12278
12279 echo "$ac_t""$ol_cv_lib_mdbm" 1>&6
12280
12281
12282  for ac_hdr in mdbm.h
12283 do
12284 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12285 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12286 echo "configure:12287: checking for $ac_hdr" >&5
12287 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12288   echo $ac_n "(cached) $ac_c" 1>&6
12289 else
12290   cat > conftest.$ac_ext <<EOF
12291 #line 12292 "configure"
12292 #include "confdefs.h"
12293 #include <$ac_hdr>
12294 EOF
12295 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12296 { (eval echo configure:12297: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12297 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12298 if test -z "$ac_err"; then
12299   rm -rf conftest*
12300   eval "ac_cv_header_$ac_safe=yes"
12301 else
12302   echo "$ac_err" >&5
12303   echo "configure: failed program was:" >&5
12304   cat conftest.$ac_ext >&5
12305   rm -rf conftest*
12306   eval "ac_cv_header_$ac_safe=no"
12307 fi
12308 rm -f conftest*
12309 fi
12310 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12311   echo "$ac_t""yes" 1>&6
12312     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12313   cat >> confdefs.h <<EOF
12314 #define $ac_tr_hdr 1
12315 EOF
12316  
12317 else
12318   echo "$ac_t""no" 1>&6
12319 fi
12320 done
12321
12322  echo $ac_n "checking for db""... $ac_c" 1>&6
12323 echo "configure:12324: checking for db" >&5
12324 if eval "test \"\${ol_cv_mdbm+set}\" = set"; then
12325   echo $ac_n "(cached) $ac_c" 1>&6
12326 else
12327   
12328         if test $ol_cv_lib_mdbm = no -o $ac_cv_header_mdbm_h = no ; then
12329                 ol_cv_mdbm=no
12330         else
12331                 ol_cv_mdbm=yes
12332         fi
12333
12334 fi
12335
12336 echo "$ac_t""$ol_cv_mdbm" 1>&6
12337  if test $ol_cv_mdbm = yes ; then
12338         cat >> confdefs.h <<\EOF
12339 #define HAVE_MDBM 1
12340 EOF
12341
12342  fi
12343
12344
12345         if test $ol_cv_mdbm = yes ; then
12346                 ol_link_ldbm=mdbm
12347                 ol_with_ldbm_api=mdbm
12348                 if test $ol_cv_lib_mdbm != yes ; then
12349                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_mdbm"
12350                 fi
12351         fi
12352 fi
12353
12354 if test $ol_with_ldbm_api = auto -o $ol_with_ldbm_api = gdbm ; then
12355         echo $ac_n "checking for GDBM library""... $ac_c" 1>&6
12356 echo "configure:12357: checking for GDBM library" >&5
12357 if eval "test \"\${ol_cv_lib_gdbm+set}\" = set"; then
12358   echo $ac_n "(cached) $ac_c" 1>&6
12359 else
12360         ol_LIBS="$LIBS"
12361         echo $ac_n "checking for gdbm_open""... $ac_c" 1>&6
12362 echo "configure:12363: checking for gdbm_open" >&5
12363 if eval "test \"\${ac_cv_func_gdbm_open+set}\" = set"; then
12364   echo $ac_n "(cached) $ac_c" 1>&6
12365 else
12366   cat > conftest.$ac_ext <<EOF
12367 #line 12368 "configure"
12368 #include "confdefs.h"
12369 /* System header to define __stub macros and hopefully few prototypes,
12370     which can conflict with char gdbm_open(); below.  */
12371 #include <assert.h>
12372 /* Override any gcc2 internal prototype to avoid an error.  */
12373 /* We use char because int might match the return type of a gcc2
12374     builtin and then its argument prototype would still apply.  */
12375 char gdbm_open();
12376 char (*f)();
12377
12378 int main() {
12379
12380 /* The GNU C library defines this for functions which it implements
12381     to always fail with ENOSYS.  Some functions are actually named
12382     something starting with __ and the normal name is an alias.  */
12383 #if defined (__stub_gdbm_open) || defined (__stub___gdbm_open)
12384 choke me
12385 #else
12386 f = gdbm_open;
12387 #endif
12388
12389 ; return 0; }
12390 EOF
12391 if { (eval echo configure:12392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12392   rm -rf conftest*
12393   eval "ac_cv_func_gdbm_open=yes"
12394 else
12395   echo "configure: failed program was:" >&5
12396   cat conftest.$ac_ext >&5
12397   rm -rf conftest*
12398   eval "ac_cv_func_gdbm_open=no"
12399 fi
12400 rm -f conftest*
12401 fi
12402
12403 if eval "test \"`echo '$ac_cv_func_'gdbm_open`\" = yes"; then
12404   echo "$ac_t""yes" 1>&6
12405   ol_cv_lib_gdbm=yes
12406 else
12407   echo "$ac_t""no" 1>&6
12408
12409                 echo $ac_n "checking for gdbm_open in -lgdbm""... $ac_c" 1>&6
12410 echo "configure:12411: checking for gdbm_open in -lgdbm" >&5
12411 ac_lib_var=`echo gdbm'_'gdbm_open | sed 'y%./+-:%__p__%'`
12412 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12413   echo $ac_n "(cached) $ac_c" 1>&6
12414 else
12415   ac_save_LIBS="$LIBS"
12416 LIBS="-lgdbm  $LIBS"
12417 cat > conftest.$ac_ext <<EOF
12418 #line 12419 "configure"
12419 #include "confdefs.h"
12420 /* Override any gcc2 internal prototype to avoid an error.  */
12421 /* We use char because int might match the return type of a gcc2
12422     builtin and then its argument prototype would still apply.  */
12423 char gdbm_open();
12424
12425 int main() {
12426 gdbm_open()
12427 ; return 0; }
12428 EOF
12429 if { (eval echo configure:12430: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12430   rm -rf conftest*
12431   eval "ac_cv_lib_$ac_lib_var=yes"
12432 else
12433   echo "configure: failed program was:" >&5
12434   cat conftest.$ac_ext >&5
12435   rm -rf conftest*
12436   eval "ac_cv_lib_$ac_lib_var=no"
12437 fi
12438 rm -f conftest*
12439 LIBS="$ac_save_LIBS"
12440
12441 fi
12442 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12443   echo "$ac_t""yes" 1>&6
12444   ol_cv_lib_gdbm=-lgdbm
12445 else
12446   echo "$ac_t""no" 1>&6
12447 ol_cv_lib_gdbm=no
12448 fi
12449
12450         
12451 fi
12452
12453         LIBS="$ol_LIBS"
12454
12455 fi
12456
12457 echo "$ac_t""$ol_cv_lib_gdbm" 1>&6
12458
12459
12460  for ac_hdr in gdbm.h
12461 do
12462 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12463 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12464 echo "configure:12465: checking for $ac_hdr" >&5
12465 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12466   echo $ac_n "(cached) $ac_c" 1>&6
12467 else
12468   cat > conftest.$ac_ext <<EOF
12469 #line 12470 "configure"
12470 #include "confdefs.h"
12471 #include <$ac_hdr>
12472 EOF
12473 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12474 { (eval echo configure:12475: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12475 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12476 if test -z "$ac_err"; then
12477   rm -rf conftest*
12478   eval "ac_cv_header_$ac_safe=yes"
12479 else
12480   echo "$ac_err" >&5
12481   echo "configure: failed program was:" >&5
12482   cat conftest.$ac_ext >&5
12483   rm -rf conftest*
12484   eval "ac_cv_header_$ac_safe=no"
12485 fi
12486 rm -f conftest*
12487 fi
12488 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12489   echo "$ac_t""yes" 1>&6
12490     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12491   cat >> confdefs.h <<EOF
12492 #define $ac_tr_hdr 1
12493 EOF
12494  
12495 else
12496   echo "$ac_t""no" 1>&6
12497 fi
12498 done
12499
12500  echo $ac_n "checking for db""... $ac_c" 1>&6
12501 echo "configure:12502: checking for db" >&5
12502 if eval "test \"\${ol_cv_gdbm+set}\" = set"; then
12503   echo $ac_n "(cached) $ac_c" 1>&6
12504 else
12505   
12506         if test $ol_cv_lib_gdbm = no -o $ac_cv_header_gdbm_h = no ; then
12507                 ol_cv_gdbm=no
12508         else
12509                 ol_cv_gdbm=yes
12510         fi
12511
12512 fi
12513
12514 echo "$ac_t""$ol_cv_gdbm" 1>&6
12515  if test $ol_cv_gdbm = yes ; then
12516         cat >> confdefs.h <<\EOF
12517 #define HAVE_GDBM 1
12518 EOF
12519
12520  fi
12521
12522
12523         if test $ol_cv_gdbm = yes ; then
12524                 ol_link_ldbm=gdbm
12525                 ol_with_ldbm_api=gdbm
12526
12527                 if test $ol_cv_lib_gdbm != yes ; then
12528                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_gdbm"
12529                 fi
12530         fi
12531 fi
12532
12533 if test $ol_with_ldbm_api = ndbm ; then
12534         echo $ac_n "checking for NDBM library""... $ac_c" 1>&6
12535 echo "configure:12536: checking for NDBM library" >&5
12536 if eval "test \"\${ol_cv_lib_ndbm+set}\" = set"; then
12537   echo $ac_n "(cached) $ac_c" 1>&6
12538 else
12539         ol_LIBS="$LIBS"
12540         echo $ac_n "checking for dbm_open""... $ac_c" 1>&6
12541 echo "configure:12542: checking for dbm_open" >&5
12542 if eval "test \"\${ac_cv_func_dbm_open+set}\" = set"; then
12543   echo $ac_n "(cached) $ac_c" 1>&6
12544 else
12545   cat > conftest.$ac_ext <<EOF
12546 #line 12547 "configure"
12547 #include "confdefs.h"
12548 /* System header to define __stub macros and hopefully few prototypes,
12549     which can conflict with char dbm_open(); below.  */
12550 #include <assert.h>
12551 /* Override any gcc2 internal prototype to avoid an error.  */
12552 /* We use char because int might match the return type of a gcc2
12553     builtin and then its argument prototype would still apply.  */
12554 char dbm_open();
12555 char (*f)();
12556
12557 int main() {
12558
12559 /* The GNU C library defines this for functions which it implements
12560     to always fail with ENOSYS.  Some functions are actually named
12561     something starting with __ and the normal name is an alias.  */
12562 #if defined (__stub_dbm_open) || defined (__stub___dbm_open)
12563 choke me
12564 #else
12565 f = dbm_open;
12566 #endif
12567
12568 ; return 0; }
12569 EOF
12570 if { (eval echo configure:12571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12571   rm -rf conftest*
12572   eval "ac_cv_func_dbm_open=yes"
12573 else
12574   echo "configure: failed program was:" >&5
12575   cat conftest.$ac_ext >&5
12576   rm -rf conftest*
12577   eval "ac_cv_func_dbm_open=no"
12578 fi
12579 rm -f conftest*
12580 fi
12581
12582 if eval "test \"`echo '$ac_cv_func_'dbm_open`\" = yes"; then
12583   echo "$ac_t""yes" 1>&6
12584   ol_cv_lib_ndbm=yes
12585 else
12586   echo "$ac_t""no" 1>&6
12587
12588                 echo $ac_n "checking for dbm_open in -lndbm""... $ac_c" 1>&6
12589 echo "configure:12590: checking for dbm_open in -lndbm" >&5
12590 ac_lib_var=`echo ndbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12591 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12592   echo $ac_n "(cached) $ac_c" 1>&6
12593 else
12594   ac_save_LIBS="$LIBS"
12595 LIBS="-lndbm  $LIBS"
12596 cat > conftest.$ac_ext <<EOF
12597 #line 12598 "configure"
12598 #include "confdefs.h"
12599 /* Override any gcc2 internal prototype to avoid an error.  */
12600 /* We use char because int might match the return type of a gcc2
12601     builtin and then its argument prototype would still apply.  */
12602 char dbm_open();
12603
12604 int main() {
12605 dbm_open()
12606 ; return 0; }
12607 EOF
12608 if { (eval echo configure:12609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12609   rm -rf conftest*
12610   eval "ac_cv_lib_$ac_lib_var=yes"
12611 else
12612   echo "configure: failed program was:" >&5
12613   cat conftest.$ac_ext >&5
12614   rm -rf conftest*
12615   eval "ac_cv_lib_$ac_lib_var=no"
12616 fi
12617 rm -f conftest*
12618 LIBS="$ac_save_LIBS"
12619
12620 fi
12621 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12622   echo "$ac_t""yes" 1>&6
12623   ol_cv_lib_ndbm=-lndbm
12624 else
12625   echo "$ac_t""no" 1>&6
12626
12627                         echo $ac_n "checking for dbm_open in -ldbm""... $ac_c" 1>&6
12628 echo "configure:12629: checking for dbm_open in -ldbm" >&5
12629 ac_lib_var=`echo dbm'_'dbm_open | sed 'y%./+-:%__p__%'`
12630 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12631   echo $ac_n "(cached) $ac_c" 1>&6
12632 else
12633   ac_save_LIBS="$LIBS"
12634 LIBS="-ldbm  $LIBS"
12635 cat > conftest.$ac_ext <<EOF
12636 #line 12637 "configure"
12637 #include "confdefs.h"
12638 /* Override any gcc2 internal prototype to avoid an error.  */
12639 /* We use char because int might match the return type of a gcc2
12640     builtin and then its argument prototype would still apply.  */
12641 char dbm_open();
12642
12643 int main() {
12644 dbm_open()
12645 ; return 0; }
12646 EOF
12647 if { (eval echo configure:12648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12648   rm -rf conftest*
12649   eval "ac_cv_lib_$ac_lib_var=yes"
12650 else
12651   echo "configure: failed program was:" >&5
12652   cat conftest.$ac_ext >&5
12653   rm -rf conftest*
12654   eval "ac_cv_lib_$ac_lib_var=no"
12655 fi
12656 rm -f conftest*
12657 LIBS="$ac_save_LIBS"
12658
12659 fi
12660 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12661   echo "$ac_t""yes" 1>&6
12662   ol_cv_lib_ndbm=-ldbm
12663 else
12664   echo "$ac_t""no" 1>&6
12665 ol_cv_lib_ndbm=no
12666 fi
12667                 
12668 fi
12669
12670         
12671 fi
12672
12673         LIBS="$ol_LIBS"
12674
12675 fi
12676
12677 echo "$ac_t""$ol_cv_lib_ndbm" 1>&6
12678
12679
12680  for ac_hdr in ndbm.h
12681 do
12682 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12683 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12684 echo "configure:12685: checking for $ac_hdr" >&5
12685 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12686   echo $ac_n "(cached) $ac_c" 1>&6
12687 else
12688   cat > conftest.$ac_ext <<EOF
12689 #line 12690 "configure"
12690 #include "confdefs.h"
12691 #include <$ac_hdr>
12692 EOF
12693 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12694 { (eval echo configure:12695: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12695 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12696 if test -z "$ac_err"; then
12697   rm -rf conftest*
12698   eval "ac_cv_header_$ac_safe=yes"
12699 else
12700   echo "$ac_err" >&5
12701   echo "configure: failed program was:" >&5
12702   cat conftest.$ac_ext >&5
12703   rm -rf conftest*
12704   eval "ac_cv_header_$ac_safe=no"
12705 fi
12706 rm -f conftest*
12707 fi
12708 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12709   echo "$ac_t""yes" 1>&6
12710     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12711   cat >> confdefs.h <<EOF
12712 #define $ac_tr_hdr 1
12713 EOF
12714  
12715 else
12716   echo "$ac_t""no" 1>&6
12717 fi
12718 done
12719
12720  echo $ac_n "checking for db""... $ac_c" 1>&6
12721 echo "configure:12722: checking for db" >&5
12722 if eval "test \"\${ol_cv_ndbm+set}\" = set"; then
12723   echo $ac_n "(cached) $ac_c" 1>&6
12724 else
12725   
12726         if test $ol_cv_lib_ndbm = no -o $ac_cv_header_ndbm_h = no ; then
12727                 ol_cv_ndbm=no
12728         else
12729                 ol_cv_ndbm=yes
12730         fi
12731
12732 fi
12733
12734 echo "$ac_t""$ol_cv_ndbm" 1>&6
12735  if test $ol_cv_ndbm = yes ; then
12736         cat >> confdefs.h <<\EOF
12737 #define HAVE_NDBM 1
12738 EOF
12739
12740  fi
12741
12742
12743         if test $ol_cv_ndbm = yes ; then
12744                 ol_link_ldbm=ndbm
12745                 ol_with_ldbm_api=ndbm
12746
12747                 if test $ol_cv_lib_ndbm != yes ; then
12748                         LDBM_LIBS="$LDBM_LIBS $ol_cv_lib_ndbm"
12749                 fi
12750         fi
12751 fi
12752
12753 if test $ol_link_ldbm = no -a $ol_enable_ldbm != no ; then
12754         echo "configure: warning: could not find suitable LDBM backend" 1>&2
12755         if test $ol_enable_ldbm = yes ; then
12756                 { echo "configure: error: select appropriate LDBM options or disable" 1>&2; exit 1; }
12757         fi
12758
12759         echo "configure: warning: disabling LDBM" 1>&2
12760         ol_enable_ldbm=no
12761 fi
12762
12763 if test $ol_enable_dynamic = yes -a $enable_shared = yes ; then
12764         LINK_BINS_DYNAMIC="yes"
12765 else
12766         LINK_BINS_DYNAMIC="no"
12767 fi
12768
12769 if test $ol_enable_wrappers != no ; then
12770         for ac_hdr in tcpd.h
12771 do
12772 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
12773 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
12774 echo "configure:12775: checking for $ac_hdr" >&5
12775 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
12776   echo $ac_n "(cached) $ac_c" 1>&6
12777 else
12778   cat > conftest.$ac_ext <<EOF
12779 #line 12780 "configure"
12780 #include "confdefs.h"
12781 #include <$ac_hdr>
12782 EOF
12783 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
12784 { (eval echo configure:12785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
12785 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
12786 if test -z "$ac_err"; then
12787   rm -rf conftest*
12788   eval "ac_cv_header_$ac_safe=yes"
12789 else
12790   echo "$ac_err" >&5
12791   echo "configure: failed program was:" >&5
12792   cat conftest.$ac_ext >&5
12793   rm -rf conftest*
12794   eval "ac_cv_header_$ac_safe=no"
12795 fi
12796 rm -f conftest*
12797 fi
12798 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
12799   echo "$ac_t""yes" 1>&6
12800     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
12801   cat >> confdefs.h <<EOF
12802 #define $ac_tr_hdr 1
12803 EOF
12804  
12805 else
12806   echo "$ac_t""no" 1>&6
12807 fi
12808 done
12809
12810
12811         if test $ac_cv_header_tcpd_h != yes ; then
12812                 have_wrappers=no
12813         else
12814                 cat > conftest.$ac_ext <<EOF
12815 #line 12816 "configure"
12816 #include "confdefs.h"
12817
12818 int allow_severity = 0;
12819 int deny_severity  = 0;
12820                 
12821 int main() {
12822 hosts_access()
12823 ; return 0; }
12824 EOF
12825 if { (eval echo configure:12826: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
12826   rm -rf conftest*
12827   have_wrappers=yes
12828 else
12829   echo "configure: failed program was:" >&5
12830   cat conftest.$ac_ext >&5
12831   rm -rf conftest*
12832   have_wrappers=no
12833 fi
12834 rm -f conftest*
12835         fi
12836
12837         if test $have_wrappers = yes ; then
12838                 cat >> confdefs.h <<\EOF
12839 #define HAVE_TCPD 1
12840 EOF
12841
12842                 WRAP_LIBS="-lwrap"
12843
12844                                                 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6
12845 echo "configure:12846: checking for main in -lnsl" >&5
12846 ac_lib_var=`echo nsl'_'main | sed 'y%./+-:%__p__%'`
12847 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12848   echo $ac_n "(cached) $ac_c" 1>&6
12849 else
12850   ac_save_LIBS="$LIBS"
12851 LIBS="-lnsl  $LIBS"
12852 cat > conftest.$ac_ext <<EOF
12853 #line 12854 "configure"
12854 #include "confdefs.h"
12855
12856 int main() {
12857 main()
12858 ; return 0; }
12859 EOF
12860 if { (eval echo configure:12861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12861   rm -rf conftest*
12862   eval "ac_cv_lib_$ac_lib_var=yes"
12863 else
12864   echo "configure: failed program was:" >&5
12865   cat conftest.$ac_ext >&5
12866   rm -rf conftest*
12867   eval "ac_cv_lib_$ac_lib_var=no"
12868 fi
12869 rm -f conftest*
12870 LIBS="$ac_save_LIBS"
12871
12872 fi
12873 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12874   echo "$ac_t""yes" 1>&6
12875     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
12876     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
12877   cat >> confdefs.h <<EOF
12878 #define $ac_tr_lib 1
12879 EOF
12880
12881   LIBS="-lnsl $LIBS"
12882
12883 else
12884   echo "$ac_t""no" 1>&6
12885 fi
12886
12887         else
12888                 echo "configure: warning: could not find -lwrap" 1>&2
12889                 if test $ol_enable_wrappers = yes ; then
12890                         { echo "configure: error: could not find wrappers" 1>&2; exit 1; }
12891                 fi
12892
12893                 echo "configure: warning: disabling wrappers support" 1>&2
12894                 ol_enable_wrappers=no
12895                 WRAP_LIBS=""
12896         fi
12897 fi
12898
12899 if test $ol_enable_syslog != no ; then
12900         echo $ac_n "checking for openlog""... $ac_c" 1>&6
12901 echo "configure:12902: checking for openlog" >&5
12902 if eval "test \"\${ac_cv_func_openlog+set}\" = set"; then
12903   echo $ac_n "(cached) $ac_c" 1>&6
12904 else
12905   cat > conftest.$ac_ext <<EOF
12906 #line 12907 "configure"
12907 #include "confdefs.h"
12908 /* System header to define __stub macros and hopefully few prototypes,
12909     which can conflict with char openlog(); below.  */
12910 #include <assert.h>
12911 /* Override any gcc2 internal prototype to avoid an error.  */
12912 /* We use char because int might match the return type of a gcc2
12913     builtin and then its argument prototype would still apply.  */
12914 char openlog();
12915 char (*f)();
12916
12917 int main() {
12918
12919 /* The GNU C library defines this for functions which it implements
12920     to always fail with ENOSYS.  Some functions are actually named
12921     something starting with __ and the normal name is an alias.  */
12922 #if defined (__stub_openlog) || defined (__stub___openlog)
12923 choke me
12924 #else
12925 f = openlog;
12926 #endif
12927
12928 ; return 0; }
12929 EOF
12930 if { (eval echo configure:12931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12931   rm -rf conftest*
12932   eval "ac_cv_func_openlog=yes"
12933 else
12934   echo "configure: failed program was:" >&5
12935   cat conftest.$ac_ext >&5
12936   rm -rf conftest*
12937   eval "ac_cv_func_openlog=no"
12938 fi
12939 rm -f conftest*
12940 fi
12941
12942 if eval "test \"`echo '$ac_cv_func_'openlog`\" = yes"; then
12943   echo "$ac_t""yes" 1>&6
12944   :
12945 else
12946   echo "$ac_t""no" 1>&6
12947 fi
12948
12949         if test $ac_cv_func_openlog = no -a $ol_enable_syslog = yes; then
12950                 { echo "configure: error: could not find syslog" 1>&2; exit 1; }
12951         fi
12952         ol_enable_syslog=$ac_cv_func_openlog
12953 fi
12954
12955 ol_link_sql=no
12956 if test $ol_enable_sql != no ; then
12957         echo $ac_n "checking for SQLDriverConnect in -liodbc""... $ac_c" 1>&6
12958 echo "configure:12959: checking for SQLDriverConnect in -liodbc" >&5
12959 ac_lib_var=`echo iodbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
12960 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
12961   echo $ac_n "(cached) $ac_c" 1>&6
12962 else
12963   ac_save_LIBS="$LIBS"
12964 LIBS="-liodbc  $LIBS"
12965 cat > conftest.$ac_ext <<EOF
12966 #line 12967 "configure"
12967 #include "confdefs.h"
12968 /* Override any gcc2 internal prototype to avoid an error.  */
12969 /* We use char because int might match the return type of a gcc2
12970     builtin and then its argument prototype would still apply.  */
12971 char SQLDriverConnect();
12972
12973 int main() {
12974 SQLDriverConnect()
12975 ; return 0; }
12976 EOF
12977 if { (eval echo configure:12978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
12978   rm -rf conftest*
12979   eval "ac_cv_lib_$ac_lib_var=yes"
12980 else
12981   echo "configure: failed program was:" >&5
12982   cat conftest.$ac_ext >&5
12983   rm -rf conftest*
12984   eval "ac_cv_lib_$ac_lib_var=no"
12985 fi
12986 rm -f conftest*
12987 LIBS="$ac_save_LIBS"
12988
12989 fi
12990 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
12991   echo "$ac_t""yes" 1>&6
12992   have_iodbc=yes
12993 else
12994   echo "$ac_t""no" 1>&6
12995 have_iodbc=no
12996 fi
12997
12998         if test $have_iodbc = yes ; then
12999                 ol_link_sql="-liodbc"
13000         else
13001                 echo $ac_n "checking for SQLDriverConnect in -lodbc""... $ac_c" 1>&6
13002 echo "configure:13003: checking for SQLDriverConnect in -lodbc" >&5
13003 ac_lib_var=`echo odbc'_'SQLDriverConnect | sed 'y%./+-:%__p__%'`
13004 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13005   echo $ac_n "(cached) $ac_c" 1>&6
13006 else
13007   ac_save_LIBS="$LIBS"
13008 LIBS="-lodbc  $LIBS"
13009 cat > conftest.$ac_ext <<EOF
13010 #line 13011 "configure"
13011 #include "confdefs.h"
13012 /* Override any gcc2 internal prototype to avoid an error.  */
13013 /* We use char because int might match the return type of a gcc2
13014     builtin and then its argument prototype would still apply.  */
13015 char SQLDriverConnect();
13016
13017 int main() {
13018 SQLDriverConnect()
13019 ; return 0; }
13020 EOF
13021 if { (eval echo configure:13022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13022   rm -rf conftest*
13023   eval "ac_cv_lib_$ac_lib_var=yes"
13024 else
13025   echo "configure: failed program was:" >&5
13026   cat conftest.$ac_ext >&5
13027   rm -rf conftest*
13028   eval "ac_cv_lib_$ac_lib_var=no"
13029 fi
13030 rm -f conftest*
13031 LIBS="$ac_save_LIBS"
13032
13033 fi
13034 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13035   echo "$ac_t""yes" 1>&6
13036   have_odbc=yes
13037 else
13038   echo "$ac_t""no" 1>&6
13039 have_odbc=no
13040 fi
13041
13042                 if test $have_odbc = yes ; then
13043                         ol_link_sql="-lodbc"
13044                 fi
13045         fi
13046
13047         if test $ol_link_sql != no ; then
13048                 SLAPD_SQL_LIBS="$ol_link_sql"
13049
13050         elif test $ol_enable_sql != auto ; then
13051                 { echo "configure: error: could not locate suitable ODBC library" 1>&2; exit 1; }
13052         fi
13053 fi
13054
13055 ol_link_termcap=no
13056 for ac_hdr in termcap.h ncurses.h
13057 do
13058 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13059 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13060 echo "configure:13061: checking for $ac_hdr" >&5
13061 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13062   echo $ac_n "(cached) $ac_c" 1>&6
13063 else
13064   cat > conftest.$ac_ext <<EOF
13065 #line 13066 "configure"
13066 #include "confdefs.h"
13067 #include <$ac_hdr>
13068 EOF
13069 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13070 { (eval echo configure:13071: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13071 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13072 if test -z "$ac_err"; then
13073   rm -rf conftest*
13074   eval "ac_cv_header_$ac_safe=yes"
13075 else
13076   echo "$ac_err" >&5
13077   echo "configure: failed program was:" >&5
13078   cat conftest.$ac_ext >&5
13079   rm -rf conftest*
13080   eval "ac_cv_header_$ac_safe=no"
13081 fi
13082 rm -f conftest*
13083 fi
13084 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13085   echo "$ac_t""yes" 1>&6
13086     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13087   cat >> confdefs.h <<EOF
13088 #define $ac_tr_hdr 1
13089 EOF
13090  
13091 else
13092   echo "$ac_t""no" 1>&6
13093 fi
13094 done
13095
13096
13097 if test $ol_link_termcap = no ; then
13098         echo $ac_n "checking for tputs in -ltermcap""... $ac_c" 1>&6
13099 echo "configure:13100: checking for tputs in -ltermcap" >&5
13100 ac_lib_var=`echo termcap'_'tputs | sed 'y%./+-:%__p__%'`
13101 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13102   echo $ac_n "(cached) $ac_c" 1>&6
13103 else
13104   ac_save_LIBS="$LIBS"
13105 LIBS="-ltermcap  $LIBS"
13106 cat > conftest.$ac_ext <<EOF
13107 #line 13108 "configure"
13108 #include "confdefs.h"
13109 /* Override any gcc2 internal prototype to avoid an error.  */
13110 /* We use char because int might match the return type of a gcc2
13111     builtin and then its argument prototype would still apply.  */
13112 char tputs();
13113
13114 int main() {
13115 tputs()
13116 ; return 0; }
13117 EOF
13118 if { (eval echo configure:13119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13119   rm -rf conftest*
13120   eval "ac_cv_lib_$ac_lib_var=yes"
13121 else
13122   echo "configure: failed program was:" >&5
13123   cat conftest.$ac_ext >&5
13124   rm -rf conftest*
13125   eval "ac_cv_lib_$ac_lib_var=no"
13126 fi
13127 rm -f conftest*
13128 LIBS="$ac_save_LIBS"
13129
13130 fi
13131 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13132   echo "$ac_t""yes" 1>&6
13133   have_termcap=yes
13134 else
13135   echo "$ac_t""no" 1>&6
13136 have_termcap=no
13137 fi
13138
13139         if test $have_termcap = yes ; then
13140                 cat >> confdefs.h <<\EOF
13141 #define HAVE_TERMCAP 1
13142 EOF
13143
13144                 ol_link_termcap=yes
13145                 TERMCAP_LIBS=-ltermcap
13146         fi
13147 fi
13148
13149 if test $ol_link_termcap = no ; then
13150         echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6
13151 echo "configure:13152: checking for initscr in -lncurses" >&5
13152 ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-:%__p__%'`
13153 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13154   echo $ac_n "(cached) $ac_c" 1>&6
13155 else
13156   ac_save_LIBS="$LIBS"
13157 LIBS="-lncurses  $LIBS"
13158 cat > conftest.$ac_ext <<EOF
13159 #line 13160 "configure"
13160 #include "confdefs.h"
13161 /* Override any gcc2 internal prototype to avoid an error.  */
13162 /* We use char because int might match the return type of a gcc2
13163     builtin and then its argument prototype would still apply.  */
13164 char initscr();
13165
13166 int main() {
13167 initscr()
13168 ; return 0; }
13169 EOF
13170 if { (eval echo configure:13171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13171   rm -rf conftest*
13172   eval "ac_cv_lib_$ac_lib_var=yes"
13173 else
13174   echo "configure: failed program was:" >&5
13175   cat conftest.$ac_ext >&5
13176   rm -rf conftest*
13177   eval "ac_cv_lib_$ac_lib_var=no"
13178 fi
13179 rm -f conftest*
13180 LIBS="$ac_save_LIBS"
13181
13182 fi
13183 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13184   echo "$ac_t""yes" 1>&6
13185   have_ncurses=yes
13186 else
13187   echo "$ac_t""no" 1>&6
13188 have_ncurses=no
13189 fi
13190
13191         if test $have_ncurses = yes ; then
13192                 cat >> confdefs.h <<\EOF
13193 #define HAVE_NCURSES 1
13194 EOF
13195
13196                 ol_link_termcap=yes
13197                 TERMCAP_LIBS=-lncurses
13198         fi
13199 fi
13200
13201 if test $ol_link_termcap = no ; then
13202         cat >> confdefs.h <<\EOF
13203 #define NO_TERMCAP 1
13204 EOF
13205
13206         TERMCAP_LIBS=
13207 fi
13208
13209 ol_link_sasl=no
13210 ol_link_spasswd=no
13211 if test $ol_with_cyrus_sasl != no ; then
13212         for ac_hdr in sasl.h
13213 do
13214 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13215 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13216 echo "configure:13217: checking for $ac_hdr" >&5
13217 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13218   echo $ac_n "(cached) $ac_c" 1>&6
13219 else
13220   cat > conftest.$ac_ext <<EOF
13221 #line 13222 "configure"
13222 #include "confdefs.h"
13223 #include <$ac_hdr>
13224 EOF
13225 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13226 { (eval echo configure:13227: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13227 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13228 if test -z "$ac_err"; then
13229   rm -rf conftest*
13230   eval "ac_cv_header_$ac_safe=yes"
13231 else
13232   echo "$ac_err" >&5
13233   echo "configure: failed program was:" >&5
13234   cat conftest.$ac_ext >&5
13235   rm -rf conftest*
13236   eval "ac_cv_header_$ac_safe=no"
13237 fi
13238 rm -f conftest*
13239 fi
13240 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13241   echo "$ac_t""yes" 1>&6
13242     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13243   cat >> confdefs.h <<EOF
13244 #define $ac_tr_hdr 1
13245 EOF
13246  
13247 else
13248   echo "$ac_t""no" 1>&6
13249 fi
13250 done
13251
13252
13253         if test $ac_cv_header_sasl_h = yes ; then
13254                 echo $ac_n "checking for sasl_client_init in -lsasl""... $ac_c" 1>&6
13255 echo "configure:13256: checking for sasl_client_init in -lsasl" >&5
13256 ac_lib_var=`echo sasl'_'sasl_client_init | sed 'y%./+-:%__p__%'`
13257 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13258   echo $ac_n "(cached) $ac_c" 1>&6
13259 else
13260   ac_save_LIBS="$LIBS"
13261 LIBS="-lsasl  $LIBS"
13262 cat > conftest.$ac_ext <<EOF
13263 #line 13264 "configure"
13264 #include "confdefs.h"
13265 /* Override any gcc2 internal prototype to avoid an error.  */
13266 /* We use char because int might match the return type of a gcc2
13267     builtin and then its argument prototype would still apply.  */
13268 char sasl_client_init();
13269
13270 int main() {
13271 sasl_client_init()
13272 ; return 0; }
13273 EOF
13274 if { (eval echo configure:13275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13275   rm -rf conftest*
13276   eval "ac_cv_lib_$ac_lib_var=yes"
13277 else
13278   echo "configure: failed program was:" >&5
13279   cat conftest.$ac_ext >&5
13280   rm -rf conftest*
13281   eval "ac_cv_lib_$ac_lib_var=no"
13282 fi
13283 rm -f conftest*
13284 LIBS="$ac_save_LIBS"
13285
13286 fi
13287 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13288   echo "$ac_t""yes" 1>&6
13289   have_cyrus_sasl=yes
13290 else
13291   echo "$ac_t""no" 1>&6
13292 have_cyrus_sasl=no
13293 fi
13294
13295
13296                 if test $have_cyrus_sasl != no ; then
13297                         SASL_LIBS="-lsasl"
13298                         cat >> confdefs.h <<\EOF
13299 #define HAVE_CYRUS_SASL 1
13300 EOF
13301
13302                         ol_link_sasl=yes
13303                 fi
13304         fi
13305
13306         if test $ol_link_sasl = no ; then
13307                 if test $ol_with_cyrus_sasl != auto ; then
13308                         { echo "configure: error: Could not locate Cyrus SASL" 1>&2; exit 1; }
13309                 else
13310                         echo "configure: warning: Could not locate Cyrus SASL" 1>&2
13311                         echo "configure: warning: SASL authentication not supported!" 1>&2
13312                         if test $ol_link_tls = no ; then
13313                                 echo "configure: warning: Strong authentication not supported!" 1>&2
13314                         fi
13315                 fi
13316
13317         elif test $ol_enable_spasswd != no ; then
13318                 ol_link_spasswd=yes
13319         fi
13320
13321 else
13322         echo "configure: warning: SASL authentication not supported!" 1>&2
13323         if test $ol_link_tls = no ; then
13324                 echo "configure: warning: Strong authentication not supported!" 1>&2
13325         fi
13326 fi
13327
13328 if test $cross_compiling != yes ; then
13329         dev=no
13330         if test -r /dev/urandom ; then
13331                 dev="/dev/urandom";
13332         elif test -r /idev/urandom ; then
13333                 dev="/idev/urandom";
13334         elif test -r /dev/srandom ; then
13335                 dev="/dev/srandom";
13336         elif test -r /dev/random ; then
13337                 dev="/dev/random";
13338         elif test -r /idev/random ; then
13339                 dev="/idev/random";
13340         fi
13341
13342         if test $dev != no ; then
13343                 cat >> confdefs.h <<EOF
13344 #define URANDOM_DEVICE "$dev"
13345 EOF
13346
13347         fi
13348 fi
13349
13350 ol_link_fetch=no
13351 if test $ol_with_fetch != no ; then
13352         ol_LIBS=$LIBS
13353 LIBS="-lfetch -lcom_err $LIBS"
13354 echo $ac_n "checking fetch(3) library""... $ac_c" 1>&6
13355 echo "configure:13356: checking fetch(3) library" >&5
13356 if eval "test \"\${ol_cv_lib_fetch+set}\" = set"; then
13357   echo $ac_n "(cached) $ac_c" 1>&6
13358 else
13359   
13360         cat > conftest.$ac_ext <<EOF
13361 #line 13362 "configure"
13362 #include "confdefs.h"
13363
13364 #include <sys/param.h>
13365 #include <stdio.h>
13366 #include <fetch.h>
13367 int main() {
13368 struct url *u = fetchParseURL("file:///"); 
13369 ; return 0; }
13370 EOF
13371 if { (eval echo configure:13372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13372   rm -rf conftest*
13373   ol_cv_lib_fetch=yes
13374 else
13375   echo "configure: failed program was:" >&5
13376   cat conftest.$ac_ext >&5
13377   rm -rf conftest*
13378   ol_cv_lib_fetch=no
13379 fi
13380 rm -f conftest*
13381 fi
13382
13383 echo "$ac_t""$ol_cv_lib_fetch" 1>&6
13384 LIBS=$ol_LIBS
13385 if test $ol_cv_lib_fetch != no ; then
13386         ol_link_fetch="-lfetch -lcom_err"
13387         cat >> confdefs.h <<\EOF
13388 #define HAVE_FETCH 1
13389 EOF
13390
13391 fi
13392
13393
13394         if test $ol_cv_lib_fetch != no ; then
13395                 LDIF_LIBS="$LDIF_LIBS $ol_link_fetch"
13396                 ol_link_fetch=freebsd
13397
13398         elif test $ol_with_fetch != auto ; then
13399                 { echo "configure: error: no suitable API for --with-fetch=$ol_with_fetch" 1>&2; exit 1; }
13400         fi 
13401 fi
13402
13403 ol_link_readline=no
13404 if test $ol_with_readline != no ; then
13405         for ac_hdr in readline/readline.h readline/history.h
13406 do
13407 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
13408 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
13409 echo "configure:13410: checking for $ac_hdr" >&5
13410 if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
13411   echo $ac_n "(cached) $ac_c" 1>&6
13412 else
13413   cat > conftest.$ac_ext <<EOF
13414 #line 13415 "configure"
13415 #include "confdefs.h"
13416 #include <$ac_hdr>
13417 EOF
13418 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13419 { (eval echo configure:13420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13420 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13421 if test -z "$ac_err"; then
13422   rm -rf conftest*
13423   eval "ac_cv_header_$ac_safe=yes"
13424 else
13425   echo "$ac_err" >&5
13426   echo "configure: failed program was:" >&5
13427   cat conftest.$ac_ext >&5
13428   rm -rf conftest*
13429   eval "ac_cv_header_$ac_safe=no"
13430 fi
13431 rm -f conftest*
13432 fi
13433 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
13434   echo "$ac_t""yes" 1>&6
13435     ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
13436   cat >> confdefs.h <<EOF
13437 #define $ac_tr_hdr 1
13438 EOF
13439  
13440 else
13441   echo "$ac_t""no" 1>&6
13442 fi
13443 done
13444
13445
13446         if test $ac_cv_header_readline_readline_h = yes ; then
13447                 save_LIBS="$LIBS"
13448                 LIBS="$TERMCAP_LIBS $LIBS"
13449                 echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
13450 echo "configure:13451: checking for readline in -lreadline" >&5
13451 ac_lib_var=`echo readline'_'readline | sed 'y%./+-:%__p__%'`
13452 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13453   echo $ac_n "(cached) $ac_c" 1>&6
13454 else
13455   ac_save_LIBS="$LIBS"
13456 LIBS="-lreadline  $LIBS"
13457 cat > conftest.$ac_ext <<EOF
13458 #line 13459 "configure"
13459 #include "confdefs.h"
13460 /* Override any gcc2 internal prototype to avoid an error.  */
13461 /* We use char because int might match the return type of a gcc2
13462     builtin and then its argument prototype would still apply.  */
13463 char readline();
13464
13465 int main() {
13466 readline()
13467 ; return 0; }
13468 EOF
13469 if { (eval echo configure:13470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13470   rm -rf conftest*
13471   eval "ac_cv_lib_$ac_lib_var=yes"
13472 else
13473   echo "configure: failed program was:" >&5
13474   cat conftest.$ac_ext >&5
13475   rm -rf conftest*
13476   eval "ac_cv_lib_$ac_lib_var=no"
13477 fi
13478 rm -f conftest*
13479 LIBS="$ac_save_LIBS"
13480
13481 fi
13482 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13483   echo "$ac_t""yes" 1>&6
13484   have_readline=yes
13485 else
13486   echo "$ac_t""no" 1>&6
13487 have_readline=no
13488 fi
13489
13490                 LIBS="$save_LIBS"
13491                         
13492                 if test $have_readline = yes ; then
13493                         ol_with_readline=found
13494                         ol_link_readline=yes
13495
13496                         READLINE_LIBS="-lreadline"
13497                 fi
13498         fi
13499 fi
13500
13501 if test $ol_link_readline = yes ; then
13502         cat >> confdefs.h <<\EOF
13503 #define HAVE_READLINE 1
13504 EOF
13505
13506 fi
13507
13508
13509 if test $ol_enable_crypt != no ; then
13510         echo $ac_n "checking for crypt""... $ac_c" 1>&6
13511 echo "configure:13512: checking for crypt" >&5
13512 if eval "test \"\${ac_cv_func_crypt+set}\" = set"; then
13513   echo $ac_n "(cached) $ac_c" 1>&6
13514 else
13515   cat > conftest.$ac_ext <<EOF
13516 #line 13517 "configure"
13517 #include "confdefs.h"
13518 /* System header to define __stub macros and hopefully few prototypes,
13519     which can conflict with char crypt(); below.  */
13520 #include <assert.h>
13521 /* Override any gcc2 internal prototype to avoid an error.  */
13522 /* We use char because int might match the return type of a gcc2
13523     builtin and then its argument prototype would still apply.  */
13524 char crypt();
13525 char (*f)();
13526
13527 int main() {
13528
13529 /* The GNU C library defines this for functions which it implements
13530     to always fail with ENOSYS.  Some functions are actually named
13531     something starting with __ and the normal name is an alias.  */
13532 #if defined (__stub_crypt) || defined (__stub___crypt)
13533 choke me
13534 #else
13535 f = crypt;
13536 #endif
13537
13538 ; return 0; }
13539 EOF
13540 if { (eval echo configure:13541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13541   rm -rf conftest*
13542   eval "ac_cv_func_crypt=yes"
13543 else
13544   echo "configure: failed program was:" >&5
13545   cat conftest.$ac_ext >&5
13546   rm -rf conftest*
13547   eval "ac_cv_func_crypt=no"
13548 fi
13549 rm -f conftest*
13550 fi
13551
13552 if eval "test \"`echo '$ac_cv_func_'crypt`\" = yes"; then
13553   echo "$ac_t""yes" 1>&6
13554   have_crypt=yes
13555 else
13556   echo "$ac_t""no" 1>&6
13557
13558                 echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
13559 echo "configure:13560: checking for crypt in -lcrypt" >&5
13560 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-:%__p__%'`
13561 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13562   echo $ac_n "(cached) $ac_c" 1>&6
13563 else
13564   ac_save_LIBS="$LIBS"
13565 LIBS="-lcrypt  $LIBS"
13566 cat > conftest.$ac_ext <<EOF
13567 #line 13568 "configure"
13568 #include "confdefs.h"
13569 /* Override any gcc2 internal prototype to avoid an error.  */
13570 /* We use char because int might match the return type of a gcc2
13571     builtin and then its argument prototype would still apply.  */
13572 char crypt();
13573
13574 int main() {
13575 crypt()
13576 ; return 0; }
13577 EOF
13578 if { (eval echo configure:13579: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13579   rm -rf conftest*
13580   eval "ac_cv_lib_$ac_lib_var=yes"
13581 else
13582   echo "configure: failed program was:" >&5
13583   cat conftest.$ac_ext >&5
13584   rm -rf conftest*
13585   eval "ac_cv_lib_$ac_lib_var=no"
13586 fi
13587 rm -f conftest*
13588 LIBS="$ac_save_LIBS"
13589
13590 fi
13591 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13592   echo "$ac_t""yes" 1>&6
13593   LUTIL_LIBS="$LUTIL_LIBS -lcrypt"
13594                         have_crypt=yes
13595 else
13596   echo "$ac_t""no" 1>&6
13597 have_crypt=no
13598 fi
13599
13600 fi
13601
13602
13603         if test $have_crypt = yes ; then
13604                 cat >> confdefs.h <<\EOF
13605 #define HAVE_CRYPT 1
13606 EOF
13607
13608         else
13609                 echo "configure: warning: could not find crypt" 1>&2
13610                 if test $ol_enable_crypt = yes ; then
13611                         { echo "configure: error: could not find crypt" 1>&2; exit 1; }
13612                 fi
13613
13614                 echo "configure: warning: disabling crypt support" 1>&2
13615                 ol_enable_crypt=no
13616         fi
13617 fi
13618
13619 if test $ol_enable_proctitle != no ; then
13620         echo $ac_n "checking for setproctitle""... $ac_c" 1>&6
13621 echo "configure:13622: checking for setproctitle" >&5
13622 if eval "test \"\${ac_cv_func_setproctitle+set}\" = set"; then
13623   echo $ac_n "(cached) $ac_c" 1>&6
13624 else
13625   cat > conftest.$ac_ext <<EOF
13626 #line 13627 "configure"
13627 #include "confdefs.h"
13628 /* System header to define __stub macros and hopefully few prototypes,
13629     which can conflict with char setproctitle(); below.  */
13630 #include <assert.h>
13631 /* Override any gcc2 internal prototype to avoid an error.  */
13632 /* We use char because int might match the return type of a gcc2
13633     builtin and then its argument prototype would still apply.  */
13634 char setproctitle();
13635 char (*f)();
13636
13637 int main() {
13638
13639 /* The GNU C library defines this for functions which it implements
13640     to always fail with ENOSYS.  Some functions are actually named
13641     something starting with __ and the normal name is an alias.  */
13642 #if defined (__stub_setproctitle) || defined (__stub___setproctitle)
13643 choke me
13644 #else
13645 f = setproctitle;
13646 #endif
13647
13648 ; return 0; }
13649 EOF
13650 if { (eval echo configure:13651: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13651   rm -rf conftest*
13652   eval "ac_cv_func_setproctitle=yes"
13653 else
13654   echo "configure: failed program was:" >&5
13655   cat conftest.$ac_ext >&5
13656   rm -rf conftest*
13657   eval "ac_cv_func_setproctitle=no"
13658 fi
13659 rm -f conftest*
13660 fi
13661
13662 if eval "test \"`echo '$ac_cv_func_'setproctitle`\" = yes"; then
13663   echo "$ac_t""yes" 1>&6
13664   have_setproctitle=yes
13665 else
13666   echo "$ac_t""no" 1>&6
13667
13668                 echo $ac_n "checking for setproctitle in -lutil""... $ac_c" 1>&6
13669 echo "configure:13670: checking for setproctitle in -lutil" >&5
13670 ac_lib_var=`echo util'_'setproctitle | sed 'y%./+-:%__p__%'`
13671 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
13672   echo $ac_n "(cached) $ac_c" 1>&6
13673 else
13674   ac_save_LIBS="$LIBS"
13675 LIBS="-lutil  $LIBS"
13676 cat > conftest.$ac_ext <<EOF
13677 #line 13678 "configure"
13678 #include "confdefs.h"
13679 /* Override any gcc2 internal prototype to avoid an error.  */
13680 /* We use char because int might match the return type of a gcc2
13681     builtin and then its argument prototype would still apply.  */
13682 char setproctitle();
13683
13684 int main() {
13685 setproctitle()
13686 ; return 0; }
13687 EOF
13688 if { (eval echo configure:13689: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
13689   rm -rf conftest*
13690   eval "ac_cv_lib_$ac_lib_var=yes"
13691 else
13692   echo "configure: failed program was:" >&5
13693   cat conftest.$ac_ext >&5
13694   rm -rf conftest*
13695   eval "ac_cv_lib_$ac_lib_var=no"
13696 fi
13697 rm -f conftest*
13698 LIBS="$ac_save_LIBS"
13699
13700 fi
13701 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
13702   echo "$ac_t""yes" 1>&6
13703   have_setproctitle=yes
13704                         LUTIL_LIBS="$LUTIL_LIBS -lutil"
13705 else
13706   echo "$ac_t""no" 1>&6
13707 have_setproctitle=no
13708                         LIBOBJS="$LIBOBJS setproctitle.o"
13709                         LIBSRCS="$LIBSRCS setproctitle.c"
13710 fi
13711
13712 fi
13713
13714
13715         if test $have_setproctitle = yes ; then
13716                 cat >> confdefs.h <<\EOF
13717 #define HAVE_SETPROCTITLE 1
13718 EOF
13719
13720         fi
13721 fi
13722
13723 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
13724 echo "configure:13725: checking for ANSI C header files" >&5
13725 if eval "test \"\${ac_cv_header_stdc+set}\" = set"; then
13726   echo $ac_n "(cached) $ac_c" 1>&6
13727 else
13728   cat > conftest.$ac_ext <<EOF
13729 #line 13730 "configure"
13730 #include "confdefs.h"
13731 #include <stdlib.h>
13732 #include <stdarg.h>
13733 #include <string.h>
13734 #include <float.h>
13735 EOF
13736 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
13737 { (eval echo configure:13738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
13738 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
13739 if test -z "$ac_err"; then
13740   rm -rf conftest*
13741   ac_cv_header_stdc=yes
13742 else
13743   echo "$ac_err" >&5
13744   echo "configure: failed program was:" >&5
13745   cat conftest.$ac_ext >&5
13746   rm -rf conftest*
13747   ac_cv_header_stdc=no
13748 fi
13749 rm -f conftest*
13750
13751 if test $ac_cv_header_stdc = yes; then
13752   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13753 cat > conftest.$ac_ext <<EOF
13754 #line 13755 "configure"
13755 #include "confdefs.h"
13756 #include <string.h>
13757 EOF
13758 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13759   egrep "memchr" >/dev/null 2>&1; then
13760   :
13761 else
13762   rm -rf conftest*
13763   ac_cv_header_stdc=no
13764 fi
13765 rm -f conftest*
13766
13767 fi
13768
13769 if test $ac_cv_header_stdc = yes; then
13770   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13771 cat > conftest.$ac_ext <<EOF
13772 #line 13773 "configure"
13773 #include "confdefs.h"
13774 #include <stdlib.h>
13775 EOF
13776 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13777   egrep "free" >/dev/null 2>&1; then
13778   :
13779 else
13780   rm -rf conftest*
13781   ac_cv_header_stdc=no
13782 fi
13783 rm -f conftest*
13784
13785 fi
13786
13787 if test $ac_cv_header_stdc = yes; then
13788   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13789 if test "$cross_compiling" = yes; then
13790   :
13791 else
13792   cat > conftest.$ac_ext <<EOF
13793 #line 13794 "configure"
13794 #include "confdefs.h"
13795 #include <ctype.h>
13796 #if ((' ' & 0x0FF) == 0x020)
13797 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13798 #define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13799 #else
13800 #define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13801  || ('j' <= (c) && (c) <= 'r') \
13802  || ('s' <= (c) && (c) <= 'z'))
13803 #define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13804 #endif
13805 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13806 int main () { int i; for (i = 0; i < 256; i++)
13807 if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
13808 exit (0); }
13809
13810 EOF
13811 if { (eval echo configure:13812: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
13812 then
13813   :
13814 else
13815   echo "configure: failed program was:" >&5
13816   cat conftest.$ac_ext >&5
13817   rm -fr conftest*
13818   ac_cv_header_stdc=no
13819 fi
13820 rm -fr conftest*
13821 fi
13822
13823 fi
13824 fi
13825
13826 echo "$ac_t""$ac_cv_header_stdc" 1>&6
13827 if test $ac_cv_header_stdc = yes; then
13828   cat >> confdefs.h <<\EOF
13829 #define STDC_HEADERS 1
13830 EOF
13831
13832 fi
13833
13834 echo $ac_n "checking for mode_t""... $ac_c" 1>&6
13835 echo "configure:13836: checking for mode_t" >&5
13836 if eval "test \"\${ac_cv_type_mode_t+set}\" = set"; then
13837   echo $ac_n "(cached) $ac_c" 1>&6
13838 else
13839   cat > conftest.$ac_ext <<EOF
13840 #line 13841 "configure"
13841 #include "confdefs.h"
13842 #include <sys/types.h>
13843 #if STDC_HEADERS
13844 #include <stdlib.h>
13845 #include <stddef.h>
13846 #endif
13847
13848 EOF
13849 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13850   egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13851   rm -rf conftest*
13852   eval "ac_cv_type_mode_t=yes"
13853 else
13854   rm -rf conftest*
13855   eval "ac_cv_type_mode_t=no"
13856 fi
13857 rm -f conftest*
13858
13859 fi
13860 if eval "test \"`echo '$ac_cv_type_'mode_t`\" = yes"; then
13861   echo "$ac_t""yes" 1>&6
13862 else
13863   echo "$ac_t""no" 1>&6
13864   cat >> confdefs.h <<EOF
13865 #define mode_t int
13866 EOF
13867
13868 fi
13869
13870 echo $ac_n "checking for off_t""... $ac_c" 1>&6
13871 echo "configure:13872: checking for off_t" >&5
13872 if eval "test \"\${ac_cv_type_off_t+set}\" = set"; then
13873   echo $ac_n "(cached) $ac_c" 1>&6
13874 else
13875   cat > conftest.$ac_ext <<EOF
13876 #line 13877 "configure"
13877 #include "confdefs.h"
13878 #include <sys/types.h>
13879 #if STDC_HEADERS
13880 #include <stdlib.h>
13881 #include <stddef.h>
13882 #endif
13883
13884 EOF
13885 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13886   egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13887   rm -rf conftest*
13888   eval "ac_cv_type_off_t=yes"
13889 else
13890   rm -rf conftest*
13891   eval "ac_cv_type_off_t=no"
13892 fi
13893 rm -f conftest*
13894
13895 fi
13896 if eval "test \"`echo '$ac_cv_type_'off_t`\" = yes"; then
13897   echo "$ac_t""yes" 1>&6
13898 else
13899   echo "$ac_t""no" 1>&6
13900   cat >> confdefs.h <<EOF
13901 #define off_t long
13902 EOF
13903
13904 fi
13905
13906 echo $ac_n "checking for pid_t""... $ac_c" 1>&6
13907 echo "configure:13908: checking for pid_t" >&5
13908 if eval "test \"\${ac_cv_type_pid_t+set}\" = set"; then
13909   echo $ac_n "(cached) $ac_c" 1>&6
13910 else
13911   cat > conftest.$ac_ext <<EOF
13912 #line 13913 "configure"
13913 #include "confdefs.h"
13914 #include <sys/types.h>
13915 #if STDC_HEADERS
13916 #include <stdlib.h>
13917 #include <stddef.h>
13918 #endif
13919
13920 EOF
13921 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13922   egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
13923   rm -rf conftest*
13924   eval "ac_cv_type_pid_t=yes"
13925 else
13926   rm -rf conftest*
13927   eval "ac_cv_type_pid_t=no"
13928 fi
13929 rm -f conftest*
13930
13931 fi
13932 if eval "test \"`echo '$ac_cv_type_'pid_t`\" = yes"; then
13933   echo "$ac_t""yes" 1>&6
13934 else
13935   echo "$ac_t""no" 1>&6
13936   cat >> confdefs.h <<EOF
13937 #define pid_t int
13938 EOF
13939
13940 fi
13941
13942 echo $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6
13943 echo "configure:13944: checking for ptrdiff_t" >&5
13944 if eval "test \"\${am_cv_type_ptrdiff_t+set}\" = set"; then
13945   echo $ac_n "(cached) $ac_c" 1>&6
13946 else
13947   cat > conftest.$ac_ext <<EOF
13948 #line 13949 "configure"
13949 #include "confdefs.h"
13950 #include <stddef.h>
13951 int main() {
13952 ptrdiff_t p
13953 ; return 0; }
13954 EOF
13955 if { (eval echo configure:13956: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13956   rm -rf conftest*
13957   am_cv_type_ptrdiff_t=yes
13958 else
13959   echo "configure: failed program was:" >&5
13960   cat conftest.$ac_ext >&5
13961   rm -rf conftest*
13962   am_cv_type_ptrdiff_t=no
13963 fi
13964 rm -f conftest*
13965 fi
13966
13967 echo "$ac_t""$am_cv_type_ptrdiff_t" 1>&6
13968    if test $am_cv_type_ptrdiff_t = yes; then
13969      cat >> confdefs.h <<\EOF
13970 #define HAVE_PTRDIFF_T 1
13971 EOF
13972
13973    fi
13974
13975 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
13976 echo "configure:13977: checking return type of signal handlers" >&5
13977 if eval "test \"\${ac_cv_type_signal+set}\" = set"; then
13978   echo $ac_n "(cached) $ac_c" 1>&6
13979 else
13980   cat > conftest.$ac_ext <<EOF
13981 #line 13982 "configure"
13982 #include "confdefs.h"
13983 #include <sys/types.h>
13984 #include <signal.h>
13985 #ifdef signal
13986 #undef signal
13987 #endif
13988 #ifdef __cplusplus
13989 extern "C" void (*signal (int, void (*)(int)))(int);
13990 #else
13991 void (*signal ()) ();
13992 #endif
13993
13994 int main() {
13995 int i;
13996 ; return 0; }
13997 EOF
13998 if { (eval echo configure:13999: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
13999   rm -rf conftest*
14000   ac_cv_type_signal=void
14001 else
14002   echo "configure: failed program was:" >&5
14003   cat conftest.$ac_ext >&5
14004   rm -rf conftest*
14005   ac_cv_type_signal=int
14006 fi
14007 rm -f conftest*
14008 fi
14009
14010 echo "$ac_t""$ac_cv_type_signal" 1>&6
14011 cat >> confdefs.h <<EOF
14012 #define RETSIGTYPE $ac_cv_type_signal
14013 EOF
14014
14015
14016 echo $ac_n "checking for size_t""... $ac_c" 1>&6
14017 echo "configure:14018: checking for size_t" >&5
14018 if eval "test \"\${ac_cv_type_size_t+set}\" = set"; then
14019   echo $ac_n "(cached) $ac_c" 1>&6
14020 else
14021   cat > conftest.$ac_ext <<EOF
14022 #line 14023 "configure"
14023 #include "confdefs.h"
14024 #include <sys/types.h>
14025 #if STDC_HEADERS
14026 #include <stdlib.h>
14027 #include <stddef.h>
14028 #endif
14029
14030 EOF
14031 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14032   egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14033   rm -rf conftest*
14034   eval "ac_cv_type_size_t=yes"
14035 else
14036   rm -rf conftest*
14037   eval "ac_cv_type_size_t=no"
14038 fi
14039 rm -f conftest*
14040
14041 fi
14042 if eval "test \"`echo '$ac_cv_type_'size_t`\" = yes"; then
14043   echo "$ac_t""yes" 1>&6
14044 else
14045   echo "$ac_t""no" 1>&6
14046   cat >> confdefs.h <<EOF
14047 #define size_t unsigned
14048 EOF
14049
14050 fi
14051
14052
14053 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
14054 echo "configure:14055: checking for ssize_t" >&5
14055 if eval "test \"\${ac_cv_type_ssize_t+set}\" = set"; then
14056   echo $ac_n "(cached) $ac_c" 1>&6
14057 else
14058   cat > conftest.$ac_ext <<EOF
14059 #line 14060 "configure"
14060 #include "confdefs.h"
14061 #include <sys/types.h>
14062 #if STDC_HEADERS
14063 #include <stdlib.h>
14064 #include <stddef.h>
14065 #endif
14066
14067 EOF
14068 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14069   egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14070   rm -rf conftest*
14071   eval "ac_cv_type_ssize_t=yes"
14072 else
14073   rm -rf conftest*
14074   eval "ac_cv_type_ssize_t=no"
14075 fi
14076 rm -f conftest*
14077
14078 fi
14079 if eval "test \"`echo '$ac_cv_type_'ssize_t`\" = yes"; then
14080   echo "$ac_t""yes" 1>&6
14081 else
14082   echo "$ac_t""no" 1>&6
14083   cat >> confdefs.h <<EOF
14084 #define ssize_t signed int
14085 EOF
14086
14087 fi
14088
14089 echo $ac_n "checking for caddr_t""... $ac_c" 1>&6
14090 echo "configure:14091: checking for caddr_t" >&5
14091 if eval "test \"\${ac_cv_type_caddr_t+set}\" = set"; then
14092   echo $ac_n "(cached) $ac_c" 1>&6
14093 else
14094   cat > conftest.$ac_ext <<EOF
14095 #line 14096 "configure"
14096 #include "confdefs.h"
14097 #include <sys/types.h>
14098 #if STDC_HEADERS
14099 #include <stdlib.h>
14100 #include <stddef.h>
14101 #endif
14102
14103 EOF
14104 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14105   egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then
14106   rm -rf conftest*
14107   eval "ac_cv_type_caddr_t=yes"
14108 else
14109   rm -rf conftest*
14110   eval "ac_cv_type_caddr_t=no"
14111 fi
14112 rm -f conftest*
14113
14114 fi
14115 if eval "test \"`echo '$ac_cv_type_'caddr_t`\" = yes"; then
14116   echo "$ac_t""yes" 1>&6
14117 else
14118   echo "$ac_t""no" 1>&6
14119   cat >> confdefs.h <<EOF
14120 #define caddr_t char *
14121 EOF
14122
14123 fi
14124
14125
14126 echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
14127 echo "configure:14128: checking for socklen_t" >&5
14128 if eval "test \"\${ol_cv_type_socklen_t+set}\" = set"; then
14129   echo $ac_n "(cached) $ac_c" 1>&6
14130 else
14131   cat > conftest.$ac_ext <<EOF
14132 #line 14133 "configure"
14133 #include "confdefs.h"
14134
14135 #ifdef HAVE_SYS_TYPES_H
14136 #include <sys/types.h>
14137 #endif
14138 #ifdef HAVE_SYS_SOCKET_H
14139 #include <sys/socket.h>
14140 #endif
14141
14142 int main() {
14143 socklen_t len;
14144 ; return 0; }
14145 EOF
14146 if { (eval echo configure:14147: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14147   rm -rf conftest*
14148   ol_cv_type_socklen_t=yes
14149 else
14150   echo "configure: failed program was:" >&5
14151   cat conftest.$ac_ext >&5
14152   rm -rf conftest*
14153   ol_cv_type_socklen_t=no
14154 fi
14155 rm -f conftest*
14156 fi
14157
14158 echo "$ac_t""$ol_cv_type_socklen_t" 1>&6
14159   if test $ol_cv_type_socklen_t = no; then
14160     cat >> confdefs.h <<\EOF
14161 #define socklen_t int
14162 EOF
14163
14164   fi
14165  
14166 echo $ac_n "checking for member st_blksize in aggregate type struct stat""... $ac_c" 1>&6
14167 echo "configure:14168: checking for member st_blksize in aggregate type struct stat" >&5
14168 if eval "test \"\${ac_cv_c_struct_member_st_blksize+set}\" = set"; then
14169   echo $ac_n "(cached) $ac_c" 1>&6
14170 else
14171   cat > conftest.$ac_ext <<EOF
14172 #line 14173 "configure"
14173 #include "confdefs.h"
14174 #include <sys/types.h>
14175 #include <sys/stat.h>
14176 int main() {
14177 struct stat foo; foo.st_blksize;
14178 ; return 0; }
14179 EOF
14180 if { (eval echo configure:14181: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14181   rm -rf conftest*
14182   ac_cv_c_struct_member_st_blksize=yes
14183 else
14184   echo "configure: failed program was:" >&5
14185   cat conftest.$ac_ext >&5
14186   rm -rf conftest*
14187   ac_cv_c_struct_member_st_blksize=no
14188 fi
14189 rm -f conftest*
14190 fi
14191
14192 echo "$ac_t""$ac_cv_c_struct_member_st_blksize" 1>&6
14193 st_blksize="$ac_cv_c_struct_member_st_blksize"
14194 if test $ac_cv_c_struct_member_st_blksize = yes; then
14195   cat >> confdefs.h <<\EOF
14196 #define HAVE_ST_BLKSIZE 1
14197 EOF
14198
14199 fi
14200
14201 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
14202 echo "configure:14203: checking whether time.h and sys/time.h may both be included" >&5
14203 if eval "test \"\${ac_cv_header_time+set}\" = set"; then
14204   echo $ac_n "(cached) $ac_c" 1>&6
14205 else
14206   cat > conftest.$ac_ext <<EOF
14207 #line 14208 "configure"
14208 #include "confdefs.h"
14209 #include <sys/types.h>
14210 #include <sys/time.h>
14211 #include <time.h>
14212 int main() {
14213 struct tm *tp;
14214 ; return 0; }
14215 EOF
14216 if { (eval echo configure:14217: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14217   rm -rf conftest*
14218   ac_cv_header_time=yes
14219 else
14220   echo "configure: failed program was:" >&5
14221   cat conftest.$ac_ext >&5
14222   rm -rf conftest*
14223   ac_cv_header_time=no
14224 fi
14225 rm -f conftest*
14226 fi
14227
14228 echo "$ac_t""$ac_cv_header_time" 1>&6
14229 if test $ac_cv_header_time = yes; then
14230   cat >> confdefs.h <<\EOF
14231 #define TIME_WITH_SYS_TIME 1
14232 EOF
14233
14234 fi
14235
14236 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
14237 echo "configure:14238: checking whether struct tm is in sys/time.h or time.h" >&5
14238 if eval "test \"\${ac_cv_struct_tm+set}\" = set"; then
14239   echo $ac_n "(cached) $ac_c" 1>&6
14240 else
14241   cat > conftest.$ac_ext <<EOF
14242 #line 14243 "configure"
14243 #include "confdefs.h"
14244 #include <sys/types.h>
14245 #include <time.h>
14246 int main() {
14247 struct tm *tp; tp->tm_sec;
14248 ; return 0; }
14249 EOF
14250 if { (eval echo configure:14251: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14251   rm -rf conftest*
14252   ac_cv_struct_tm=time.h
14253 else
14254   echo "configure: failed program was:" >&5
14255   cat conftest.$ac_ext >&5
14256   rm -rf conftest*
14257   ac_cv_struct_tm=sys/time.h
14258 fi
14259 rm -f conftest*
14260 fi
14261
14262 echo "$ac_t""$ac_cv_struct_tm" 1>&6
14263 if test $ac_cv_struct_tm = sys/time.h; then
14264   cat >> confdefs.h <<\EOF
14265 #define TM_IN_SYS_TIME 1
14266 EOF
14267
14268 fi
14269
14270 echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
14271 echo "configure:14272: checking for uid_t in sys/types.h" >&5
14272 if eval "test \"\${ac_cv_type_uid_t+set}\" = set"; then
14273   echo $ac_n "(cached) $ac_c" 1>&6
14274 else
14275   cat > conftest.$ac_ext <<EOF
14276 #line 14277 "configure"
14277 #include "confdefs.h"
14278 #include <sys/types.h>
14279 EOF
14280 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14281   egrep "uid_t" >/dev/null 2>&1; then
14282   rm -rf conftest*
14283   ac_cv_type_uid_t=yes
14284 else
14285   rm -rf conftest*
14286   ac_cv_type_uid_t=no
14287 fi
14288 rm -f conftest*
14289
14290 fi
14291
14292 echo "$ac_t""$ac_cv_type_uid_t" 1>&6
14293 if test $ac_cv_type_uid_t = no; then
14294   cat >> confdefs.h <<\EOF
14295 #define uid_t int
14296 EOF
14297
14298   cat >> confdefs.h <<\EOF
14299 #define gid_t int
14300 EOF
14301
14302 fi
14303
14304 echo $ac_n "checking for sig_atomic_t""... $ac_c" 1>&6
14305 echo "configure:14306: checking for sig_atomic_t" >&5
14306 if eval "test \"\${ol_cv_type_sig_atomic_t+set}\" = set"; then
14307   echo $ac_n "(cached) $ac_c" 1>&6
14308 else
14309   cat > conftest.$ac_ext <<EOF
14310 #line 14311 "configure"
14311 #include "confdefs.h"
14312 #include <signal.h>
14313 int main() {
14314 sig_atomic_t atomic;
14315 ; return 0; }
14316 EOF
14317 if { (eval echo configure:14318: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14318   rm -rf conftest*
14319   ol_cv_type_sig_atomic_t=yes
14320 else
14321   echo "configure: failed program was:" >&5
14322   cat conftest.$ac_ext >&5
14323   rm -rf conftest*
14324   ol_cv_type_sig_atomic_t=no
14325 fi
14326 rm -f conftest*
14327 fi
14328
14329 echo "$ac_t""$ol_cv_type_sig_atomic_t" 1>&6
14330   if test $ol_cv_type_sig_atomic_t = no; then
14331     cat >> confdefs.h <<\EOF
14332 #define sig_atomic_t int
14333 EOF
14334
14335   fi
14336  
14337
14338
14339 # test for pw_gecos in struct passwd
14340 echo $ac_n "checking struct passwd for pw_gecos""... $ac_c" 1>&6
14341 echo "configure:14342: checking struct passwd for pw_gecos" >&5
14342 if eval "test \"\${ol_cv_struct_passwd_pw_gecos+set}\" = set"; then
14343   echo $ac_n "(cached) $ac_c" 1>&6
14344 else
14345   
14346         cat > conftest.$ac_ext <<EOF
14347 #line 14348 "configure"
14348 #include "confdefs.h"
14349 #include <pwd.h>
14350 int main() {
14351
14352         struct passwd pwd;
14353         pwd.pw_gecos = pwd.pw_name;
14354
14355 ; return 0; }
14356 EOF
14357 if { (eval echo configure:14358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14358   rm -rf conftest*
14359   ol_cv_struct_passwd_pw_gecos=yes
14360 else
14361   echo "configure: failed program was:" >&5
14362   cat conftest.$ac_ext >&5
14363   rm -rf conftest*
14364   ol_cv_struct_passwd_pw_gecos=no
14365 fi
14366 rm -f conftest*
14367 fi
14368
14369 echo "$ac_t""$ol_cv_struct_passwd_pw_gecos" 1>&6
14370 if test $ol_cv_struct_passwd_pw_gecos = yes ; then
14371         cat >> confdefs.h <<\EOF
14372 #define HAVE_PW_GECOS 1
14373 EOF
14374
14375 fi
14376
14377 # test for pw_passwd in struct passwd
14378 echo $ac_n "checking struct passwd for pw_passwd""... $ac_c" 1>&6
14379 echo "configure:14380: checking struct passwd for pw_passwd" >&5
14380 if eval "test \"\${ol_cv_struct_passwd_pw_passwd+set}\" = set"; then
14381   echo $ac_n "(cached) $ac_c" 1>&6
14382 else
14383   
14384         cat > conftest.$ac_ext <<EOF
14385 #line 14386 "configure"
14386 #include "confdefs.h"
14387 #include <pwd.h>
14388 int main() {
14389
14390         struct passwd pwd;
14391         pwd.pw_passwd = pwd.pw_name;
14392
14393 ; return 0; }
14394 EOF
14395 if { (eval echo configure:14396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14396   rm -rf conftest*
14397   ol_cv_struct_passwd_pw_passwd=yes
14398 else
14399   echo "configure: failed program was:" >&5
14400   cat conftest.$ac_ext >&5
14401   rm -rf conftest*
14402   ol_cv_struct_passwd_pw_passwd=no
14403 fi
14404 rm -f conftest*
14405 fi
14406
14407 echo "$ac_t""$ol_cv_struct_passwd_pw_passwd" 1>&6
14408 if test $ol_cv_struct_passwd_pw_passwd = yes ; then
14409         cat >> confdefs.h <<\EOF
14410 #define HAVE_PW_PASSWD 1
14411 EOF
14412
14413 fi
14414
14415
14416 echo $ac_n "checking if toupper() requires islower()""... $ac_c" 1>&6
14417 echo "configure:14418: checking if toupper() requires islower()" >&5
14418 if eval "test \"\${ol_cv_c_upper_lower+set}\" = set"; then
14419   echo $ac_n "(cached) $ac_c" 1>&6
14420 else
14421   
14422         if test "$cross_compiling" = yes; then
14423   ol_cv_c_upper_lower=safe
14424 else
14425   cat > conftest.$ac_ext <<EOF
14426 #line 14427 "configure"
14427 #include "confdefs.h"
14428
14429 #include <ctype.h>
14430 main()
14431 {
14432         if ('C' == toupper('C'))
14433                 exit(0);
14434         else
14435                 exit(1);
14436 }
14437 EOF
14438 if { (eval echo configure:14439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14439 then
14440   ol_cv_c_upper_lower=no
14441 else
14442   echo "configure: failed program was:" >&5
14443   cat conftest.$ac_ext >&5
14444   rm -fr conftest*
14445   ol_cv_c_upper_lower=yes
14446 fi
14447 rm -fr conftest*
14448 fi
14449
14450 fi
14451
14452 echo "$ac_t""$ol_cv_c_upper_lower" 1>&6
14453 if test $ol_cv_c_upper_lower != no ; then
14454         cat >> confdefs.h <<\EOF
14455 #define C_UPPER_LOWER 1
14456 EOF
14457
14458 fi
14459
14460 echo $ac_n "checking for working const""... $ac_c" 1>&6
14461 echo "configure:14462: checking for working const" >&5
14462 if eval "test \"\${ac_cv_c_const+set}\" = set"; then
14463   echo $ac_n "(cached) $ac_c" 1>&6
14464 else
14465   cat > conftest.$ac_ext <<EOF
14466 #line 14467 "configure"
14467 #include "confdefs.h"
14468
14469 int main() {
14470
14471 /* Ultrix mips cc rejects this.  */
14472 typedef int charset[2]; const charset x;
14473 /* SunOS 4.1.1 cc rejects this.  */
14474 char const *const *ccp;
14475 char **p;
14476 /* NEC SVR4.0.2 mips cc rejects this.  */
14477 struct point {int x, y;};
14478 static struct point const zero = {0,0};
14479 /* AIX XL C 1.02.0.0 rejects this.
14480    It does not let you subtract one const X* pointer from another in an arm
14481    of an if-expression whose if-part is not a constant expression */
14482 const char *g = "string";
14483 ccp = &g + (g ? g-g : 0);
14484 /* HPUX 7.0 cc rejects these. */
14485 ++ccp;
14486 p = (char**) ccp;
14487 ccp = (char const *const *) p;
14488 { /* SCO 3.2v4 cc rejects this.  */
14489   char *t;
14490   char const *s = 0 ? (char *) 0 : (char const *) 0;
14491
14492   *t++ = 0;
14493 }
14494 { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
14495   int x[] = {25, 17};
14496   const int *foo = &x[0];
14497   ++foo;
14498 }
14499 { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
14500   typedef const int *iptr;
14501   iptr p = 0;
14502   ++p;
14503 }
14504 { /* AIX XL C 1.02.0.0 rejects this saying
14505      "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
14506   struct s { int j; const int *ap[3]; };
14507   struct s *b; b->j = 5;
14508 }
14509 { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
14510   const int foo = 10;
14511 }
14512
14513 ; return 0; }
14514 EOF
14515 if { (eval echo configure:14516: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14516   rm -rf conftest*
14517   ac_cv_c_const=yes
14518 else
14519   echo "configure: failed program was:" >&5
14520   cat conftest.$ac_ext >&5
14521   rm -rf conftest*
14522   ac_cv_c_const=no
14523 fi
14524 rm -f conftest*
14525 fi
14526
14527 echo "$ac_t""$ac_cv_c_const" 1>&6
14528 if test $ac_cv_c_const = no; then
14529   cat >> confdefs.h <<\EOF
14530 #define const 
14531 EOF
14532
14533 fi
14534
14535 echo $ac_n "checking if compiler understands volatile""... $ac_c" 1>&6
14536 echo "configure:14537: checking if compiler understands volatile" >&5
14537 if eval "test \"\${ol_cv_c_volatile+set}\" = set"; then
14538   echo $ac_n "(cached) $ac_c" 1>&6
14539 else
14540   cat > conftest.$ac_ext <<EOF
14541 #line 14542 "configure"
14542 #include "confdefs.h"
14543 int x, y, z;
14544 int main() {
14545 volatile int a; int * volatile b = x ? &y : &z;
14546       /* Older MIPS compilers (eg., in Ultrix 4.2) don't like *b = 0 */
14547       *b = 0;
14548 ; return 0; }
14549 EOF
14550 if { (eval echo configure:14551: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14551   rm -rf conftest*
14552   ol_cv_c_volatile=yes
14553 else
14554   echo "configure: failed program was:" >&5
14555   cat conftest.$ac_ext >&5
14556   rm -rf conftest*
14557   ol_cv_c_volatile=no
14558 fi
14559 rm -f conftest*
14560 fi
14561
14562 echo "$ac_t""$ol_cv_c_volatile" 1>&6
14563   if test $ol_cv_c_volatile = yes; then
14564     : 
14565   else
14566     cat >> confdefs.h <<\EOF
14567 #define volatile 
14568 EOF
14569
14570   fi
14571  
14572
14573 if test $cross_compiling = yes ; then
14574         cat >> confdefs.h <<\EOF
14575 #define CROSS_COMPILING 1
14576 EOF
14577
14578 else
14579         echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
14580 echo "configure:14581: checking whether byte ordering is bigendian" >&5
14581 if eval "test \"\${ac_cv_c_bigendian+set}\" = set"; then
14582   echo $ac_n "(cached) $ac_c" 1>&6
14583 else
14584   ac_cv_c_bigendian=unknown
14585 # See if sys/param.h defines the BYTE_ORDER macro.
14586 cat > conftest.$ac_ext <<EOF
14587 #line 14588 "configure"
14588 #include "confdefs.h"
14589 #include <sys/types.h>
14590 #include <sys/param.h>
14591 int main() {
14592
14593 #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
14594  bogus endian macros
14595 #endif
14596 ; return 0; }
14597 EOF
14598 if { (eval echo configure:14599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14599   rm -rf conftest*
14600   # It does; now see whether it defined to BIG_ENDIAN or not.
14601 cat > conftest.$ac_ext <<EOF
14602 #line 14603 "configure"
14603 #include "confdefs.h"
14604 #include <sys/types.h>
14605 #include <sys/param.h>
14606 int main() {
14607
14608 #if BYTE_ORDER != BIG_ENDIAN
14609  not big endian
14610 #endif
14611 ; return 0; }
14612 EOF
14613 if { (eval echo configure:14614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14614   rm -rf conftest*
14615   ac_cv_c_bigendian=yes
14616 else
14617   echo "configure: failed program was:" >&5
14618   cat conftest.$ac_ext >&5
14619   rm -rf conftest*
14620   ac_cv_c_bigendian=no
14621 fi
14622 rm -f conftest*
14623 else
14624   echo "configure: failed program was:" >&5
14625   cat conftest.$ac_ext >&5
14626 fi
14627 rm -f conftest*
14628 if test $ac_cv_c_bigendian = unknown; then
14629 if test "$cross_compiling" = yes; then
14630     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
14631 else
14632   cat > conftest.$ac_ext <<EOF
14633 #line 14634 "configure"
14634 #include "confdefs.h"
14635 main () {
14636   /* Are we little or big endian?  From Harbison&Steele.  */
14637   union
14638   {
14639     long l;
14640     char c[sizeof (long)];
14641   } u;
14642   u.l = 1;
14643   exit (u.c[sizeof (long) - 1] == 1);
14644 }
14645 EOF
14646 if { (eval echo configure:14647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14647 then
14648   ac_cv_c_bigendian=no
14649 else
14650   echo "configure: failed program was:" >&5
14651   cat conftest.$ac_ext >&5
14652   rm -fr conftest*
14653   ac_cv_c_bigendian=yes
14654 fi
14655 rm -fr conftest*
14656 fi
14657
14658 fi
14659 fi
14660
14661 echo "$ac_t""$ac_cv_c_bigendian" 1>&6
14662 if test $ac_cv_c_bigendian = yes; then
14663   cat >> confdefs.h <<\EOF
14664 #define WORDS_BIGENDIAN 1
14665 EOF
14666
14667 fi
14668
14669 fi
14670
14671 echo $ac_n "checking size of short""... $ac_c" 1>&6
14672 echo "configure:14673: checking size of short" >&5 
14673 if eval "test \"\${ac_cv_sizeof_short+set}\" = set"; then
14674   echo $ac_n "(cached) $ac_c" 1>&6
14675 else
14676   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14677   cat > conftest.$ac_ext <<EOF
14678 #line 14679 "configure"
14679 #include "confdefs.h"
14680 #include "confdefs.h" 
14681 #include <sys/types.h> 
14682  
14683
14684 int main() {
14685 switch (0) case 0: case (sizeof (short) == $ac_size):;
14686 ; return 0; }
14687 EOF
14688 if { (eval echo configure:14689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14689   rm -rf conftest*
14690   ac_cv_sizeof_short=$ac_size
14691 else
14692   echo "configure: failed program was:" >&5
14693   cat conftest.$ac_ext >&5
14694 fi
14695 rm -f conftest* 
14696   if test x$ac_cv_sizeof_short != x ; then break; fi 
14697 done 
14698
14699 fi
14700  
14701 if test x$ac_cv_sizeof_short = x ; then 
14702   { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; } 
14703 fi 
14704 echo "$ac_t""$ac_cv_sizeof_short" 1>&6 
14705 cat >> confdefs.h <<EOF
14706 #define SIZEOF_SHORT $ac_cv_sizeof_short
14707 EOF
14708  
14709  
14710 echo $ac_n "checking size of int""... $ac_c" 1>&6
14711 echo "configure:14712: checking size of int" >&5 
14712 if eval "test \"\${ac_cv_sizeof_int+set}\" = set"; then
14713   echo $ac_n "(cached) $ac_c" 1>&6
14714 else
14715   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14716   cat > conftest.$ac_ext <<EOF
14717 #line 14718 "configure"
14718 #include "confdefs.h"
14719 #include "confdefs.h" 
14720 #include <sys/types.h> 
14721  
14722
14723 int main() {
14724 switch (0) case 0: case (sizeof (int) == $ac_size):;
14725 ; return 0; }
14726 EOF
14727 if { (eval echo configure:14728: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14728   rm -rf conftest*
14729   ac_cv_sizeof_int=$ac_size
14730 else
14731   echo "configure: failed program was:" >&5
14732   cat conftest.$ac_ext >&5
14733 fi
14734 rm -f conftest* 
14735   if test x$ac_cv_sizeof_int != x ; then break; fi 
14736 done 
14737
14738 fi
14739  
14740 if test x$ac_cv_sizeof_int = x ; then 
14741   { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; } 
14742 fi 
14743 echo "$ac_t""$ac_cv_sizeof_int" 1>&6 
14744 cat >> confdefs.h <<EOF
14745 #define SIZEOF_INT $ac_cv_sizeof_int
14746 EOF
14747  
14748  
14749 echo $ac_n "checking size of long""... $ac_c" 1>&6
14750 echo "configure:14751: checking size of long" >&5 
14751 if eval "test \"\${ac_cv_sizeof_long+set}\" = set"; then
14752   echo $ac_n "(cached) $ac_c" 1>&6
14753 else
14754   for ac_size in 4 8 1 2 16  ; do # List sizes in rough order of prevalence. 
14755   cat > conftest.$ac_ext <<EOF
14756 #line 14757 "configure"
14757 #include "confdefs.h"
14758 #include "confdefs.h" 
14759 #include <sys/types.h> 
14760  
14761
14762 int main() {
14763 switch (0) case 0: case (sizeof (long) == $ac_size):;
14764 ; return 0; }
14765 EOF
14766 if { (eval echo configure:14767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
14767   rm -rf conftest*
14768   ac_cv_sizeof_long=$ac_size
14769 else
14770   echo "configure: failed program was:" >&5
14771   cat conftest.$ac_ext >&5
14772 fi
14773 rm -f conftest* 
14774   if test x$ac_cv_sizeof_long != x ; then break; fi 
14775 done 
14776
14777 fi
14778  
14779 if test x$ac_cv_sizeof_long = x ; then 
14780   { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } 
14781 fi 
14782 echo "$ac_t""$ac_cv_sizeof_long" 1>&6 
14783 cat >> confdefs.h <<EOF
14784 #define SIZEOF_LONG $ac_cv_sizeof_long
14785 EOF
14786  
14787
14788
14789 if test "$ac_cv_sizeof_int" -lt 4 ; then
14790         echo "configure: warning: OpenLDAP requires 'int' to be 32 bits or greater." 1>&2
14791
14792         cat >> confdefs.h <<\EOF
14793 #define LBER_INT_T long
14794 EOF
14795
14796 else
14797         cat >> confdefs.h <<\EOF
14798 #define LBER_INT_T int
14799 EOF
14800
14801 fi
14802
14803 cat >> confdefs.h <<\EOF
14804 #define LBER_LEN_T long
14805 EOF
14806
14807 cat >> confdefs.h <<\EOF
14808 #define LBER_SOCKET_T int
14809 EOF
14810
14811 cat >> confdefs.h <<\EOF
14812 #define LBER_TAG_T long
14813 EOF
14814
14815
14816 echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6
14817 echo "configure:14818: checking for 8-bit clean memcmp" >&5
14818 if eval "test \"\${ac_cv_func_memcmp_clean+set}\" = set"; then
14819   echo $ac_n "(cached) $ac_c" 1>&6
14820 else
14821   if test "$cross_compiling" = yes; then
14822   ac_cv_func_memcmp_clean=no
14823 else
14824   cat > conftest.$ac_ext <<EOF
14825 #line 14826 "configure"
14826 #include "confdefs.h"
14827
14828 main()
14829 {
14830   char c0 = 0x40, c1 = 0x80, c2 = 0x81;
14831   exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1);
14832 }
14833
14834 EOF
14835 if { (eval echo configure:14836: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
14836 then
14837   ac_cv_func_memcmp_clean=yes
14838 else
14839   echo "configure: failed program was:" >&5
14840   cat conftest.$ac_ext >&5
14841   rm -fr conftest*
14842   ac_cv_func_memcmp_clean=no
14843 fi
14844 rm -fr conftest*
14845 fi
14846
14847 fi
14848
14849 echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6
14850 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}"
14851
14852 echo $ac_n "checking for strftime""... $ac_c" 1>&6
14853 echo "configure:14854: checking for strftime" >&5
14854 if eval "test \"\${ac_cv_func_strftime+set}\" = set"; then
14855   echo $ac_n "(cached) $ac_c" 1>&6
14856 else
14857   cat > conftest.$ac_ext <<EOF
14858 #line 14859 "configure"
14859 #include "confdefs.h"
14860 /* System header to define __stub macros and hopefully few prototypes,
14861     which can conflict with char strftime(); below.  */
14862 #include <assert.h>
14863 /* Override any gcc2 internal prototype to avoid an error.  */
14864 /* We use char because int might match the return type of a gcc2
14865     builtin and then its argument prototype would still apply.  */
14866 char strftime();
14867 char (*f)();
14868
14869 int main() {
14870
14871 /* The GNU C library defines this for functions which it implements
14872     to always fail with ENOSYS.  Some functions are actually named
14873     something starting with __ and the normal name is an alias.  */
14874 #if defined (__stub_strftime) || defined (__stub___strftime)
14875 choke me
14876 #else
14877 f = strftime;
14878 #endif
14879
14880 ; return 0; }
14881 EOF
14882 if { (eval echo configure:14883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14883   rm -rf conftest*
14884   eval "ac_cv_func_strftime=yes"
14885 else
14886   echo "configure: failed program was:" >&5
14887   cat conftest.$ac_ext >&5
14888   rm -rf conftest*
14889   eval "ac_cv_func_strftime=no"
14890 fi
14891 rm -f conftest*
14892 fi
14893
14894 if eval "test \"`echo '$ac_cv_func_'strftime`\" = yes"; then
14895   echo "$ac_t""yes" 1>&6
14896   cat >> confdefs.h <<\EOF
14897 #define HAVE_STRFTIME 1
14898 EOF
14899
14900 else
14901   echo "$ac_t""no" 1>&6
14902 # strftime is in -lintl on SCO UNIX.
14903 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
14904 echo "configure:14905: checking for strftime in -lintl" >&5
14905 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-:%__p__%'`
14906 if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
14907   echo $ac_n "(cached) $ac_c" 1>&6
14908 else
14909   ac_save_LIBS="$LIBS"
14910 LIBS="-lintl  $LIBS"
14911 cat > conftest.$ac_ext <<EOF
14912 #line 14913 "configure"
14913 #include "confdefs.h"
14914 /* Override any gcc2 internal prototype to avoid an error.  */
14915 /* We use char because int might match the return type of a gcc2
14916     builtin and then its argument prototype would still apply.  */
14917 char strftime();
14918
14919 int main() {
14920 strftime()
14921 ; return 0; }
14922 EOF
14923 if { (eval echo configure:14924: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14924   rm -rf conftest*
14925   eval "ac_cv_lib_$ac_lib_var=yes"
14926 else
14927   echo "configure: failed program was:" >&5
14928   cat conftest.$ac_ext >&5
14929   rm -rf conftest*
14930   eval "ac_cv_lib_$ac_lib_var=no"
14931 fi
14932 rm -f conftest*
14933 LIBS="$ac_save_LIBS"
14934
14935 fi
14936 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
14937   echo "$ac_t""yes" 1>&6
14938   cat >> confdefs.h <<\EOF
14939 #define HAVE_STRFTIME 1
14940 EOF
14941
14942 LIBS="-lintl $LIBS"
14943 else
14944   echo "$ac_t""no" 1>&6
14945 fi
14946
14947 fi
14948
14949
14950 echo $ac_n "checking for inet_aton()""... $ac_c" 1>&6
14951 echo "configure:14952: checking for inet_aton()" >&5
14952 if eval "test \"\${ol_cv_func_inet_aton+set}\" = set"; then
14953   echo $ac_n "(cached) $ac_c" 1>&6
14954 else
14955   cat > conftest.$ac_ext <<EOF
14956 #line 14957 "configure"
14957 #include "confdefs.h"
14958
14959 #ifdef HAVE_SYS_TYPES_H
14960 #       include <sys/types.h>
14961 #endif
14962 #ifdef HAVE_SYS_SOCKET_H
14963 #       include <sys/socket.h>
14964 #       ifdef HAVE_SYS_SELECT_H
14965 #               include <sys/select.h>
14966 #       endif
14967 #       include <netinet/in.h>
14968 #       ifdef HAVE_ARPA_INET_H
14969 #               include <arpa/inet.h>
14970 #       endif
14971 #endif
14972
14973 int main() {
14974 struct in_addr in;
14975 int rc = inet_aton( "255.255.255.255", &in );
14976 ; return 0; }
14977 EOF
14978 if { (eval echo configure:14979: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
14979   rm -rf conftest*
14980   ol_cv_func_inet_aton=yes
14981 else
14982   echo "configure: failed program was:" >&5
14983   cat conftest.$ac_ext >&5
14984   rm -rf conftest*
14985   ol_cv_func_inet_aton=no
14986 fi
14987 rm -f conftest*
14988 fi
14989
14990 echo "$ac_t""$ol_cv_func_inet_aton" 1>&6
14991   if test $ol_cv_func_inet_aton != no; then
14992     cat >> confdefs.h <<\EOF
14993 #define HAVE_INET_ATON 1
14994 EOF
14995
14996   fi
14997  
14998
14999 echo $ac_n "checking for _spawnlp""... $ac_c" 1>&6
15000 echo "configure:15001: checking for _spawnlp" >&5
15001 if eval "test \"\${ac_cv_func__spawnlp+set}\" = set"; then
15002   echo $ac_n "(cached) $ac_c" 1>&6
15003 else
15004   cat > conftest.$ac_ext <<EOF
15005 #line 15006 "configure"
15006 #include "confdefs.h"
15007 /* System header to define __stub macros and hopefully few prototypes,
15008     which can conflict with char _spawnlp(); below.  */
15009 #include <assert.h>
15010 /* Override any gcc2 internal prototype to avoid an error.  */
15011 /* We use char because int might match the return type of a gcc2
15012     builtin and then its argument prototype would still apply.  */
15013 char _spawnlp();
15014 char (*f)();
15015
15016 int main() {
15017
15018 /* The GNU C library defines this for functions which it implements
15019     to always fail with ENOSYS.  Some functions are actually named
15020     something starting with __ and the normal name is an alias.  */
15021 #if defined (__stub__spawnlp) || defined (__stub____spawnlp)
15022 choke me
15023 #else
15024 f = _spawnlp;
15025 #endif
15026
15027 ; return 0; }
15028 EOF
15029 if { (eval echo configure:15030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15030   rm -rf conftest*
15031   eval "ac_cv_func__spawnlp=yes"
15032 else
15033   echo "configure: failed program was:" >&5
15034   cat conftest.$ac_ext >&5
15035   rm -rf conftest*
15036   eval "ac_cv_func__spawnlp=no"
15037 fi
15038 rm -f conftest*
15039 fi
15040
15041 if eval "test \"`echo '$ac_cv_func_'_spawnlp`\" = yes"; then
15042   echo "$ac_t""yes" 1>&6
15043   cat >> confdefs.h <<\EOF
15044 #define HAVE_SPAWNLP 1
15045 EOF
15046
15047 else
15048   echo "$ac_t""no" 1>&6
15049 fi
15050
15051
15052 echo $ac_n "checking for _snprintf""... $ac_c" 1>&6
15053 echo "configure:15054: checking for _snprintf" >&5
15054 if eval "test \"\${ac_cv_func__snprintf+set}\" = set"; then
15055   echo $ac_n "(cached) $ac_c" 1>&6
15056 else
15057   cat > conftest.$ac_ext <<EOF
15058 #line 15059 "configure"
15059 #include "confdefs.h"
15060 /* System header to define __stub macros and hopefully few prototypes,
15061     which can conflict with char _snprintf(); below.  */
15062 #include <assert.h>
15063 /* Override any gcc2 internal prototype to avoid an error.  */
15064 /* We use char because int might match the return type of a gcc2
15065     builtin and then its argument prototype would still apply.  */
15066 char _snprintf();
15067 char (*f)();
15068
15069 int main() {
15070
15071 /* The GNU C library defines this for functions which it implements
15072     to always fail with ENOSYS.  Some functions are actually named
15073     something starting with __ and the normal name is an alias.  */
15074 #if defined (__stub__snprintf) || defined (__stub____snprintf)
15075 choke me
15076 #else
15077 f = _snprintf;
15078 #endif
15079
15080 ; return 0; }
15081 EOF
15082 if { (eval echo configure:15083: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15083   rm -rf conftest*
15084   eval "ac_cv_func__snprintf=yes"
15085 else
15086   echo "configure: failed program was:" >&5
15087   cat conftest.$ac_ext >&5
15088   rm -rf conftest*
15089   eval "ac_cv_func__snprintf=no"
15090 fi
15091 rm -f conftest*
15092 fi
15093
15094 if eval "test \"`echo '$ac_cv_func_'_snprintf`\" = yes"; then
15095   echo "$ac_t""yes" 1>&6
15096   ac_cv_func_snprintf=yes
15097         cat >> confdefs.h <<\EOF
15098 #define snprintf _snprintf
15099 EOF
15100
15101
15102 else
15103   echo "$ac_t""no" 1>&6
15104 fi
15105
15106
15107 echo $ac_n "checking for _vsnprintf""... $ac_c" 1>&6
15108 echo "configure:15109: checking for _vsnprintf" >&5
15109 if eval "test \"\${ac_cv_func__vsnprintf+set}\" = set"; then
15110   echo $ac_n "(cached) $ac_c" 1>&6
15111 else
15112   cat > conftest.$ac_ext <<EOF
15113 #line 15114 "configure"
15114 #include "confdefs.h"
15115 /* System header to define __stub macros and hopefully few prototypes,
15116     which can conflict with char _vsnprintf(); below.  */
15117 #include <assert.h>
15118 /* Override any gcc2 internal prototype to avoid an error.  */
15119 /* We use char because int might match the return type of a gcc2
15120     builtin and then its argument prototype would still apply.  */
15121 char _vsnprintf();
15122 char (*f)();
15123
15124 int main() {
15125
15126 /* The GNU C library defines this for functions which it implements
15127     to always fail with ENOSYS.  Some functions are actually named
15128     something starting with __ and the normal name is an alias.  */
15129 #if defined (__stub__vsnprintf) || defined (__stub____vsnprintf)
15130 choke me
15131 #else
15132 f = _vsnprintf;
15133 #endif
15134
15135 ; return 0; }
15136 EOF
15137 if { (eval echo configure:15138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15138   rm -rf conftest*
15139   eval "ac_cv_func__vsnprintf=yes"
15140 else
15141   echo "configure: failed program was:" >&5
15142   cat conftest.$ac_ext >&5
15143   rm -rf conftest*
15144   eval "ac_cv_func__vsnprintf=no"
15145 fi
15146 rm -f conftest*
15147 fi
15148
15149 if eval "test \"`echo '$ac_cv_func_'_vsnprintf`\" = yes"; then
15150   echo "$ac_t""yes" 1>&6
15151   ac_cv_func_vsnprintf=yes
15152         cat >> confdefs.h <<\EOF
15153 #define vsnprintf _vsnprintf
15154 EOF
15155
15156
15157 else
15158   echo "$ac_t""no" 1>&6
15159 fi
15160
15161
15162 echo $ac_n "checking for vprintf""... $ac_c" 1>&6
15163 echo "configure:15164: checking for vprintf" >&5
15164 if eval "test \"\${ac_cv_func_vprintf+set}\" = set"; then
15165   echo $ac_n "(cached) $ac_c" 1>&6
15166 else
15167   cat > conftest.$ac_ext <<EOF
15168 #line 15169 "configure"
15169 #include "confdefs.h"
15170 /* System header to define __stub macros and hopefully few prototypes,
15171     which can conflict with char vprintf(); below.  */
15172 #include <assert.h>
15173 /* Override any gcc2 internal prototype to avoid an error.  */
15174 /* We use char because int might match the return type of a gcc2
15175     builtin and then its argument prototype would still apply.  */
15176 char vprintf();
15177 char (*f)();
15178
15179 int main() {
15180
15181 /* The GNU C library defines this for functions which it implements
15182     to always fail with ENOSYS.  Some functions are actually named
15183     something starting with __ and the normal name is an alias.  */
15184 #if defined (__stub_vprintf) || defined (__stub___vprintf)
15185 choke me
15186 #else
15187 f = vprintf;
15188 #endif
15189
15190 ; return 0; }
15191 EOF
15192 if { (eval echo configure:15193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15193   rm -rf conftest*
15194   eval "ac_cv_func_vprintf=yes"
15195 else
15196   echo "configure: failed program was:" >&5
15197   cat conftest.$ac_ext >&5
15198   rm -rf conftest*
15199   eval "ac_cv_func_vprintf=no"
15200 fi
15201 rm -f conftest*
15202 fi
15203
15204 if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
15205   echo "$ac_t""yes" 1>&6
15206   cat >> confdefs.h <<\EOF
15207 #define HAVE_VPRINTF 1
15208 EOF
15209
15210 else
15211   echo "$ac_t""no" 1>&6
15212 fi
15213
15214 if test "$ac_cv_func_vprintf" != yes; then
15215 echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
15216 echo "configure:15217: checking for _doprnt" >&5
15217 if eval "test \"\${ac_cv_func__doprnt+set}\" = set"; then
15218   echo $ac_n "(cached) $ac_c" 1>&6
15219 else
15220   cat > conftest.$ac_ext <<EOF
15221 #line 15222 "configure"
15222 #include "confdefs.h"
15223 /* System header to define __stub macros and hopefully few prototypes,
15224     which can conflict with char _doprnt(); below.  */
15225 #include <assert.h>
15226 /* Override any gcc2 internal prototype to avoid an error.  */
15227 /* We use char because int might match the return type of a gcc2
15228     builtin and then its argument prototype would still apply.  */
15229 char _doprnt();
15230 char (*f)();
15231
15232 int main() {
15233
15234 /* The GNU C library defines this for functions which it implements
15235     to always fail with ENOSYS.  Some functions are actually named
15236     something starting with __ and the normal name is an alias.  */
15237 #if defined (__stub__doprnt) || defined (__stub____doprnt)
15238 choke me
15239 #else
15240 f = _doprnt;
15241 #endif
15242
15243 ; return 0; }
15244 EOF
15245 if { (eval echo configure:15246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15246   rm -rf conftest*
15247   eval "ac_cv_func__doprnt=yes"
15248 else
15249   echo "configure: failed program was:" >&5
15250   cat conftest.$ac_ext >&5
15251   rm -rf conftest*
15252   eval "ac_cv_func__doprnt=no"
15253 fi
15254 rm -f conftest*
15255 fi
15256
15257 if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
15258   echo "$ac_t""yes" 1>&6
15259   cat >> confdefs.h <<\EOF
15260 #define HAVE_DOPRNT 1
15261 EOF
15262
15263 else
15264   echo "$ac_t""no" 1>&6
15265 fi
15266
15267 fi
15268
15269
15270 if test $ac_cv_func_vprintf = yes ; then
15271                 for ac_func in vsnprintf vsprintf
15272 do
15273 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15274 echo "configure:15275: checking for $ac_func" >&5
15275 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15276   echo $ac_n "(cached) $ac_c" 1>&6
15277 else
15278   cat > conftest.$ac_ext <<EOF
15279 #line 15280 "configure"
15280 #include "confdefs.h"
15281 /* System header to define __stub macros and hopefully few prototypes,
15282     which can conflict with char $ac_func(); below.  */
15283 #include <assert.h>
15284 /* Override any gcc2 internal prototype to avoid an error.  */
15285 /* We use char because int might match the return type of a gcc2
15286     builtin and then its argument prototype would still apply.  */
15287 char $ac_func();
15288 char (*f)();
15289
15290 int main() {
15291
15292 /* The GNU C library defines this for functions which it implements
15293     to always fail with ENOSYS.  Some functions are actually named
15294     something starting with __ and the normal name is an alias.  */
15295 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15296 choke me
15297 #else
15298 f = $ac_func;
15299 #endif
15300
15301 ; return 0; }
15302 EOF
15303 if { (eval echo configure:15304: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15304   rm -rf conftest*
15305   eval "ac_cv_func_$ac_func=yes"
15306 else
15307   echo "configure: failed program was:" >&5
15308   cat conftest.$ac_ext >&5
15309   rm -rf conftest*
15310   eval "ac_cv_func_$ac_func=no"
15311 fi
15312 rm -f conftest*
15313 fi
15314
15315 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15316   echo "$ac_t""yes" 1>&6
15317     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15318   cat >> confdefs.h <<EOF
15319 #define $ac_tr_func 1
15320 EOF
15321  
15322 else
15323   echo "$ac_t""no" 1>&6
15324 fi
15325 done
15326
15327 fi
15328
15329 for ac_func in \
15330         bcopy                   \
15331         closesocket             \
15332         chroot                  \
15333         endgrent                \
15334         endpwent                \
15335         flock                   \
15336         getdtablesize   \
15337         getgrgid                \
15338         gethostname             \
15339         getpass                 \
15340         getpassphrase   \
15341         getpwuid                \
15342         getpwnam                \
15343         getspnam                \
15344         gettimeofday    \
15345         initgroups              \
15346         lockf                   \
15347         memcpy                  \
15348         memmove                 \
15349         mkstemp                 \
15350         pipe                    \
15351         read                    \
15352         recv                    \
15353         recvfrom                \
15354         setpwfile               \
15355         setgid                  \
15356         setegid                 \
15357         setsid                  \
15358         setuid                  \
15359         seteuid                 \
15360         sigaction               \
15361         signal                  \
15362         sigset                  \
15363         snprintf                \
15364         strdup                  \
15365         strerror                \
15366         strpbrk                 \
15367         strrchr                 \
15368         strsep                  \
15369         strstr                  \
15370         strtol                  \
15371         strtoul                 \
15372         strspn                  \
15373         sysconf                 \
15374         waitpid                 \
15375         wait4                   \
15376         write                   \
15377         send                    \
15378         sendto                  \
15379
15380 do
15381 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15382 echo "configure:15383: checking for $ac_func" >&5
15383 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15384   echo $ac_n "(cached) $ac_c" 1>&6
15385 else
15386   cat > conftest.$ac_ext <<EOF
15387 #line 15388 "configure"
15388 #include "confdefs.h"
15389 /* System header to define __stub macros and hopefully few prototypes,
15390     which can conflict with char $ac_func(); below.  */
15391 #include <assert.h>
15392 /* Override any gcc2 internal prototype to avoid an error.  */
15393 /* We use char because int might match the return type of a gcc2
15394     builtin and then its argument prototype would still apply.  */
15395 char $ac_func();
15396 char (*f)();
15397
15398 int main() {
15399
15400 /* The GNU C library defines this for functions which it implements
15401     to always fail with ENOSYS.  Some functions are actually named
15402     something starting with __ and the normal name is an alias.  */
15403 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15404 choke me
15405 #else
15406 f = $ac_func;
15407 #endif
15408
15409 ; return 0; }
15410 EOF
15411 if { (eval echo configure:15412: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15412   rm -rf conftest*
15413   eval "ac_cv_func_$ac_func=yes"
15414 else
15415   echo "configure: failed program was:" >&5
15416   cat conftest.$ac_ext >&5
15417   rm -rf conftest*
15418   eval "ac_cv_func_$ac_func=no"
15419 fi
15420 rm -f conftest*
15421 fi
15422
15423 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15424   echo "$ac_t""yes" 1>&6
15425     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15426   cat >> confdefs.h <<EOF
15427 #define $ac_tr_func 1
15428 EOF
15429  
15430 else
15431   echo "$ac_t""no" 1>&6
15432 fi
15433 done
15434
15435
15436 for ac_func in getopt tempnam
15437 do
15438 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
15439 echo "configure:15440: checking for $ac_func" >&5
15440 if eval "test \"\${ac_cv_func_$ac_func+set}\" = set"; then
15441   echo $ac_n "(cached) $ac_c" 1>&6
15442 else
15443   cat > conftest.$ac_ext <<EOF
15444 #line 15445 "configure"
15445 #include "confdefs.h"
15446 /* System header to define __stub macros and hopefully few prototypes,
15447     which can conflict with char $ac_func(); below.  */
15448 #include <assert.h>
15449 /* Override any gcc2 internal prototype to avoid an error.  */
15450 /* We use char because int might match the return type of a gcc2
15451     builtin and then its argument prototype would still apply.  */
15452 char $ac_func();
15453 char (*f)();
15454
15455 int main() {
15456
15457 /* The GNU C library defines this for functions which it implements
15458     to always fail with ENOSYS.  Some functions are actually named
15459     something starting with __ and the normal name is an alias.  */
15460 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
15461 choke me
15462 #else
15463 f = $ac_func;
15464 #endif
15465
15466 ; return 0; }
15467 EOF
15468 if { (eval echo configure:15469: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15469   rm -rf conftest*
15470   eval "ac_cv_func_$ac_func=yes"
15471 else
15472   echo "configure: failed program was:" >&5
15473   cat conftest.$ac_ext >&5
15474   rm -rf conftest*
15475   eval "ac_cv_func_$ac_func=no"
15476 fi
15477 rm -f conftest*
15478 fi
15479
15480 if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
15481   echo "$ac_t""yes" 1>&6
15482     ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
15483   cat >> confdefs.h <<EOF
15484 #define $ac_tr_func 1
15485 EOF
15486  
15487 else
15488   echo "$ac_t""no" 1>&6
15489 LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"
15490 fi
15491 done
15492
15493
15494
15495 if test "$ac_cv_func_getopt" != yes; then
15496     LIBSRCS="$LIBSRCS getopt.c"
15497 fi
15498
15499 if test "$ac_cv_func_tempnam" != yes; then
15500     LIBSRCS="$LIBSRCS tempnam.c"
15501 fi
15502
15503 # Check Configuration
15504 echo $ac_n "checking declaration of sys_errlist""... $ac_c" 1>&6
15505 echo "configure:15506: checking declaration of sys_errlist" >&5
15506 if eval "test \"\${ol_cv_dcl_sys_errlist+set}\" = set"; then
15507   echo $ac_n "(cached) $ac_c" 1>&6
15508 else
15509   
15510         cat > conftest.$ac_ext <<EOF
15511 #line 15512 "configure"
15512 #include "confdefs.h"
15513
15514 #include <stdio.h>
15515 #include <sys/types.h>
15516 #include <errno.h>
15517 #ifdef WINNT
15518 #include <stdlib.h>
15519 #endif 
15520 int main() {
15521 char *c = (char *) *sys_errlist
15522 ; return 0; }
15523 EOF
15524 if { (eval echo configure:15525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
15525   rm -rf conftest*
15526   ol_cv_dcl_sys_errlist=yes
15527         ol_cv_have_sys_errlist=yes
15528 else
15529   echo "configure: failed program was:" >&5
15530   cat conftest.$ac_ext >&5
15531   rm -rf conftest*
15532   ol_cv_dcl_sys_errlist=no
15533 fi
15534 rm -f conftest*
15535 fi
15536
15537 echo "$ac_t""$ol_cv_dcl_sys_errlist" 1>&6
15538 #
15539 # It's possible (for near-UNIX clones) that sys_errlist doesn't exist
15540 if test $ol_cv_dcl_sys_errlist = no ; then
15541         cat >> confdefs.h <<\EOF
15542 #define DECL_SYS_ERRLIST 1
15543 EOF
15544
15545
15546         echo $ac_n "checking existence of sys_errlist""... $ac_c" 1>&6
15547 echo "configure:15548: checking existence of sys_errlist" >&5
15548 if eval "test \"\${ol_cv_have_sys_errlist+set}\" = set"; then
15549   echo $ac_n "(cached) $ac_c" 1>&6
15550 else
15551   
15552                 cat > conftest.$ac_ext <<EOF
15553 #line 15554 "configure"
15554 #include "confdefs.h"
15555 #include <errno.h>
15556 int main() {
15557 char *c = (char *) *sys_errlist
15558 ; return 0; }
15559 EOF
15560 if { (eval echo configure:15561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
15561   rm -rf conftest*
15562   ol_cv_have_sys_errlist=yes
15563 else
15564   echo "configure: failed program was:" >&5
15565   cat conftest.$ac_ext >&5
15566   rm -rf conftest*
15567   ol_cv_have_sys_errlist=no
15568 fi
15569 rm -f conftest*
15570 fi
15571
15572 echo "$ac_t""$ol_cv_have_sys_errlist" 1>&6
15573 fi
15574 if test $ol_cv_have_sys_errlist = yes ; then
15575         cat >> confdefs.h <<\EOF
15576 #define HAVE_SYS_ERRLIST 1
15577 EOF
15578
15579 fi
15580
15581
15582
15583 if test "$ol_enable_debug" != no ; then
15584         cat >> confdefs.h <<\EOF
15585 #define LDAP_DEBUG 1
15586 EOF
15587
15588 fi
15589 if test "$ol_enable_syslog" = yes ; then
15590         cat >> confdefs.h <<\EOF
15591 #define LDAP_SYSLOG 1
15592 EOF
15593
15594 fi
15595 if test "$ol_enable_libui" = yes ; then
15596         cat >> confdefs.h <<\EOF
15597 #define LDAP_LIBUI 1
15598 EOF
15599
15600 fi
15601 if test "$ol_enable_cache" = no ; then
15602         cat >> confdefs.h <<\EOF
15603 #define LDAP_NOCACHE 1
15604 EOF
15605
15606 fi
15607 if test "$ol_link_kbind" != no ; then
15608         cat >> confdefs.h <<\EOF
15609 #define LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND LDAP_VENDOR_VERSION
15610 EOF
15611
15612 fi
15613 if test "$ol_enable_proctitle" != no ; then
15614         cat >> confdefs.h <<\EOF
15615 #define LDAP_PROCTITLE 1
15616 EOF
15617
15618 fi
15619 if test "$ol_enable_referrals" != no ; then
15620         cat >> confdefs.h <<\EOF
15621 #define LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS LDAP_VENDOR_VERSION
15622 EOF
15623
15624 fi
15625 if test "$ol_enable_local" != no; then
15626         cat >> confdefs.h <<\EOF
15627 #define LDAP_PF_LOCAL 1
15628 EOF
15629
15630 fi
15631 if test "$ol_link_ipv6" != no; then
15632         cat >> confdefs.h <<\EOF
15633 #define LDAP_PF_INET6 1
15634 EOF
15635
15636 fi
15637 if test "$ol_enable_cleartext" != no ; then
15638         cat >> confdefs.h <<\EOF
15639 #define SLAPD_CLEARTEXT 1
15640 EOF
15641
15642 fi
15643 if test "$ol_enable_crypt" != no ; then
15644         cat >> confdefs.h <<\EOF
15645 #define SLAPD_CRYPT 1
15646 EOF
15647
15648 fi
15649 if test "$ol_link_kpasswd" != no ; then
15650         cat >> confdefs.h <<\EOF
15651 #define SLAPD_KPASSWD 1
15652 EOF
15653
15654 fi
15655 if test "$ol_link_spasswd" != no ; then
15656         cat >> confdefs.h <<\EOF
15657 #define SLAPD_SPASSWD 1
15658 EOF
15659
15660 fi
15661 if test "$ol_enable_multimaster" != no ; then
15662         cat >> confdefs.h <<\EOF
15663 #define SLAPD_MULTIMASTER 1
15664 EOF
15665
15666 fi
15667 if test "$ol_enable_phonetic" != no ; then
15668         cat >> confdefs.h <<\EOF
15669 #define SLAPD_PHONETIC 1
15670 EOF
15671
15672 fi
15673 if test "$ol_enable_rlookups" != no ; then
15674         cat >> confdefs.h <<\EOF
15675 #define SLAPD_RLOOKUPS 1
15676 EOF
15677
15678 fi
15679 if test "$ol_enable_aci" != no ; then
15680         cat >> confdefs.h <<\EOF
15681 #define SLAPD_ACI_ENABLED 1
15682 EOF
15683
15684 fi
15685
15686 if test "$ol_link_modules" != no ; then
15687         cat >> confdefs.h <<\EOF
15688 #define SLAPD_MODULES 1
15689 EOF
15690
15691         BUILD_SLAPD=yes
15692         SLAPD_MODULES_LDFLAGS="-dlopen self"
15693 fi
15694
15695 if test "$ol_link_dnssrv" != no ; then
15696         cat >> confdefs.h <<\EOF
15697 #define SLAPD_DNSSRV 1
15698 EOF
15699
15700         BUILD_SLAPD=yes
15701         BUILD_DNSSRV=yes
15702         if test "$ol_with_dnssrv_module" != static ; then
15703                 cat >> confdefs.h <<\EOF
15704 #define SLAPD_DNSSRV_DYNAMIC 1
15705 EOF
15706
15707                 BUILD_DNSSRV=mod
15708                 BUILD_DNSSRV_DYNAMIC=shared
15709                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-dnssrv/back_dnssrv.la"
15710         fi
15711 fi
15712
15713 if test "$ol_enable_ldap" != no ; then
15714         cat >> confdefs.h <<\EOF
15715 #define SLAPD_LDAP 1
15716 EOF
15717
15718         BUILD_SLAPD=yes
15719         BUILD_LDAP=yes
15720         if test "$ol_with_ldap_module" != static ; then
15721                 cat >> confdefs.h <<\EOF
15722 #define SLAPD_LDAP_DYNAMIC 1
15723 EOF
15724
15725                 BUILD_LDAP=mod
15726                 BUILD_LDAP_DYNAMIC=shared
15727                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldap/back_ldap.la"
15728         fi
15729 fi
15730
15731 if test "$ol_link_ldbm" != no ; then
15732         cat >> confdefs.h <<\EOF
15733 #define SLAPD_LDBM 1
15734 EOF
15735
15736         BUILD_SLAPD=yes
15737         BUILD_LDBM=yes
15738         if test "$ol_with_ldbm_module" != static ; then
15739                 cat >> confdefs.h <<\EOF
15740 #define SLAPD_LDBM_DYNAMIC 1
15741 EOF
15742
15743                 BUILD_LDBM=mod
15744                 BUILD_LDBM_DYNAMIC=shared
15745                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-ldbm/back_ldbm.la"
15746         fi
15747 fi
15748
15749 if test "$ol_enable_passwd" != no ; then
15750         cat >> confdefs.h <<\EOF
15751 #define SLAPD_PASSWD 1
15752 EOF
15753
15754         BUILD_SLAPD=yes
15755         BUILD_PASSWD=yes
15756         if test "$ol_with_passwd_module" != static ; then
15757                 cat >> confdefs.h <<\EOF
15758 #define SLAPD_PASSWD_DYNAMIC 1
15759 EOF
15760
15761                 BUILD_PASSWD=mod
15762                 BUILD_PASSWD_DYNAMIC=shared
15763                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-passwd/back_passwd.la"
15764         fi
15765 fi
15766
15767 if test "$ol_enable_shell" != no ; then
15768         cat >> confdefs.h <<\EOF
15769 #define SLAPD_SHELL 1
15770 EOF
15771
15772         BUILD_SLAPD=yes
15773         BUILD_SHELL=yes
15774         if test "$ol_with_shell_module" != static ; then
15775                 cat >> confdefs.h <<\EOF
15776 #define SLAPD_SHELL_DYNAMIC 1
15777 EOF
15778
15779                 BUILD_SHELL=mod
15780                 BUILD_SHELL_DYNAMIC=shared
15781                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-shell/back_shell.la"
15782         fi
15783 fi
15784
15785 if test "$ol_enable_sql" != no ; then
15786         cat >> confdefs.h <<\EOF
15787 #define SLAPD_SQL 1
15788 EOF
15789
15790         BUILD_SLAPD=yes
15791         BUILD_SQL=yes
15792         if test "$ol_with_sql_module" != static; then
15793                 cat >> confdefs.h <<\EOF
15794 #define SLAPD_SQL_DYNAMIC 1
15795 EOF
15796
15797                 BUILD_SQL=mod
15798                 BUILD_SQL_DYNAMIC=shared
15799                 SLAPD_MODULES_LIST="$SLAPD_MODULES_LIST -dlopen \$(SLAP_DIR)back-sql/back_sql.la"
15800         fi
15801 fi
15802
15803 if test "$ol_enable_slurpd" != no -a "$ol_link_threads" != no -a \
15804         $BUILD_SLAPD = yes ; then
15805         BUILD_SLURPD=yes
15806 fi
15807
15808
15809 if test "$LINK_BINS_DYNAMIC" = yes; then
15810     LIB_LINKAGE=DYN
15811     LT_LIB_LINKAGE=shared
15812 else
15813     LIB_LINKAGE=STAT
15814     LT_LIB_LINKAGE=static
15815 fi
15816
15817 if test "$ac_cv_mingw32" = yes ; then
15818     PLAT=NT
15819     DYN_EXT=dll
15820 else
15821     PLAT=UNIX
15822     DYN_EXT=so
15823 fi
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833   
15834   
15835   
15836   
15837   
15838   
15839   
15840   
15841   
15842   
15843   
15844   
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875 trap '' 1 2 15
15876
15877 trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
15878
15879 test "x$prefix" = xNONE && prefix=$ac_default_prefix
15880 # Let make expand exec_prefix.
15881 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
15882
15883 # Any assignment to VPATH causes Sun make to only execute
15884 # the first set of double-colon rules, so remove it if not needed.
15885 # If there is a colon in the path, we need to keep it.
15886 if test "x$srcdir" = x.; then
15887   ac_vpsub='/^[         ]*VPATH[        ]*=[^:]*$/d'
15888 fi
15889
15890 trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
15891
15892 DEFS=-DHAVE_CONFIG_H
15893
15894 # Without the "./", some shells look in PATH for config.status.
15895 : ${CONFIG_STATUS=./config.status}
15896
15897 echo creating $CONFIG_STATUS
15898 rm -f $CONFIG_STATUS
15899 cat > $CONFIG_STATUS <<EOF
15900 #! /bin/sh
15901 # Generated automatically by configure.
15902 # Run this file to recreate the current configuration.
15903 # This directory was configured as follows,
15904 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
15905 #
15906 # $0 $ac_configure_args
15907 #
15908 # Compiler output produced by configure, useful for debugging
15909 # configure, is in ./config.log if it exists.
15910
15911 ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
15912 for ac_option
15913 do
15914   case "\$ac_option" in
15915   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
15916     echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
15917     exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
15918   -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
15919     echo "$CONFIG_STATUS generated by autoconf version 2.13.1"
15920     exit 0 ;;
15921   -help | --help | --hel | --he | --h)
15922     echo "\$ac_cs_usage"; exit 0 ;;
15923   *) echo "\$ac_cs_usage"; exit 1 ;;
15924   esac
15925 done
15926
15927 ac_given_srcdir=$srcdir
15928 ac_given_INSTALL="$INSTALL"
15929
15930 trap 'rm -fr `echo "\
15931 Makefile:build/top.mk:Makefile.in:build/dir.mk \
15932 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
15933 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
15934 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
15935 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
15936 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
15937 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
15938 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
15939 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
15940 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
15941 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
15942 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
15943 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
15944 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
15945 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
15946 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
15947 include/Makefile:build/top.mk:include/Makefile.in \
15948 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
15949 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
15950 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15951 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
15952 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
15953 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
15954 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
15955 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
15956 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
15957 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
15958 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
15959 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
15960 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
15961 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
15962 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
15963 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
15964 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
15965 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
15966 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
15967 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
15968 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
15969 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
15970 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
15971 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
15972  include/portable.h include/ldap_features.h include/lber_types.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
15973 EOF
15974 cat >> $CONFIG_STATUS <<EOF
15975
15976 # Protect against being on the right side of a sed subst in config.status.
15977 sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
15978  s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
15979 $ac_vpsub
15980 $extrasub
15981 s%@SHELL@%$SHELL%g
15982 s%@CFLAGS@%$CFLAGS%g
15983 s%@CPPFLAGS@%$CPPFLAGS%g
15984 s%@CXXFLAGS@%$CXXFLAGS%g
15985 s%@FFLAGS@%$FFLAGS%g
15986 s%@DEFS@%$DEFS%g
15987 s%@LDFLAGS@%$LDFLAGS%g
15988 s%@LIBS@%$LIBS%g
15989 s%@exec_prefix@%$exec_prefix%g
15990 s%@prefix@%$prefix%g
15991 s%@program_transform_name@%$program_transform_name%g
15992 s%@bindir@%$bindir%g
15993 s%@sbindir@%$sbindir%g
15994 s%@libexecdir@%$libexecdir%g
15995 s%@datadir@%$datadir%g
15996 s%@sysconfdir@%$sysconfdir%g
15997 s%@sharedstatedir@%$sharedstatedir%g
15998 s%@localstatedir@%$localstatedir%g
15999 s%@libdir@%$libdir%g
16000 s%@includedir@%$includedir%g
16001 s%@oldincludedir@%$oldincludedir%g
16002 s%@infodir@%$infodir%g
16003 s%@mandir@%$mandir%g
16004 s%@host@%$host%g
16005 s%@host_alias@%$host_alias%g
16006 s%@host_cpu@%$host_cpu%g
16007 s%@host_vendor@%$host_vendor%g
16008 s%@host_os@%$host_os%g
16009 s%@target@%$target%g
16010 s%@target_alias@%$target_alias%g
16011 s%@target_cpu@%$target_cpu%g
16012 s%@target_vendor@%$target_vendor%g
16013 s%@target_os@%$target_os%g
16014 s%@build@%$build%g
16015 s%@build_alias@%$build_alias%g
16016 s%@build_cpu@%$build_cpu%g
16017 s%@build_vendor@%$build_vendor%g
16018 s%@build_os@%$build_os%g
16019 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
16020 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
16021 s%@INSTALL_DATA@%$INSTALL_DATA%g
16022 s%@PACKAGE@%$PACKAGE%g
16023 s%@VERSION@%$VERSION%g
16024 s%@ACLOCAL@%$ACLOCAL%g
16025 s%@AUTOCONF@%$AUTOCONF%g
16026 s%@AUTOMAKE@%$AUTOMAKE%g
16027 s%@AUTOHEADER@%$AUTOHEADER%g
16028 s%@MAKEINFO@%$MAKEINFO%g
16029 s%@install_sh@%$install_sh%g
16030 s%@AMTAR@%$AMTAR%g
16031 s%@AWK@%$AWK%g
16032 s%@AMTARFLAGS@%$AMTARFLAGS%g
16033 s%@SET_MAKE@%$SET_MAKE%g
16034 s%@top_builddir@%$top_builddir%g
16035 s%@ldap_subdir@%$ldap_subdir%g
16036 s%@CC@%$CC%g
16037 s%@RANLIB@%$RANLIB%g
16038 s%@LN_S@%$LN_S%g
16039 s%@DLLTOOL@%$DLLTOOL%g
16040 s%@AS@%$AS%g
16041 s%@OBJDUMP@%$OBJDUMP%g
16042 s%@LIBTOOL@%$LIBTOOL%g
16043 s%@LN_H@%$LN_H%g
16044 s%@SENDMAIL@%$SENDMAIL%g
16045 s%@EDITOR@%$EDITOR%g
16046 s%@FINGER@%$FINGER%g
16047 s%@CPP@%$CPP%g
16048 s%@EXEEXT@%$EXEEXT%g
16049 s%@OBJEXT@%$OBJEXT%g
16050 s%@OL_MKDEP@%$OL_MKDEP%g
16051 s%@OL_MKDEP_FLAGS@%$OL_MKDEP_FLAGS%g
16052 s%@LIBOBJS@%$LIBOBJS%g
16053 s%@LIBSRCS@%$LIBSRCS%g
16054 s%@PLAT@%$PLAT%g
16055 s%@LIB_LINKAGE@%$LIB_LINKAGE%g
16056 s%@LT_LIB_LINKAGE@%$LT_LIB_LINKAGE%g
16057 s%@DYN_EXT@%$DYN_EXT%g
16058 s%@BUILD_SLAPD@%$BUILD_SLAPD%g
16059 s%@BUILD_DNSSRV@%$BUILD_DNSSRV%g
16060 s%@BUILD_LDAP@%$BUILD_LDAP%g
16061 s%@BUILD_LDBM@%$BUILD_LDBM%g
16062 s%@BUILD_PASSWD@%$BUILD_PASSWD%g
16063 s%@BUILD_SHELL@%$BUILD_SHELL%g
16064 s%@BUILD_SQL@%$BUILD_SQL%g
16065 s%@BUILD_DNSSRV_DYNAMIC@%$BUILD_DNSSRV_DYNAMIC%g
16066 s%@BUILD_LDAP_DYNAMIC@%$BUILD_LDAP_DYNAMIC%g
16067 s%@BUILD_LDBM_DYNAMIC@%$BUILD_LDBM_DYNAMIC%g
16068 s%@BUILD_PASSWD_DYNAMIC@%$BUILD_PASSWD_DYNAMIC%g
16069 s%@BUILD_SHELL_DYNAMIC@%$BUILD_SHELL_DYNAMIC%g
16070 s%@BUILD_SQL_DYNAMIC@%$BUILD_SQL_DYNAMIC%g
16071 s%@BUILD_SLURPD@%$BUILD_SLURPD%g
16072 s%@LDAP_LIBS@%$LDAP_LIBS%g
16073 s%@LDIF_LIBS@%$LDIF_LIBS%g
16074 s%@SLAPD_LIBS@%$SLAPD_LIBS%g
16075 s%@SLURPD_LIBS@%$SLURPD_LIBS%g
16076 s%@LDBM_LIBS@%$LDBM_LIBS%g
16077 s%@LTHREAD_LIBS@%$LTHREAD_LIBS%g
16078 s%@LUTIL_LIBS@%$LUTIL_LIBS%g
16079 s%@WRAP_LIBS@%$WRAP_LIBS%g
16080 s%@LINK_BINS_DYNAMIC@%$LINK_BINS_DYNAMIC%g
16081 s%@SLAPD_MODULES_CPPFLAGS@%$SLAPD_MODULES_CPPFLAGS%g
16082 s%@SLAPD_MODULES_LDFLAGS@%$SLAPD_MODULES_LDFLAGS%g
16083 s%@SLAPD_MODULES_LIST@%$SLAPD_MODULES_LIST%g
16084 s%@KRB4_LIBS@%$KRB4_LIBS%g
16085 s%@KRB5_LIBS@%$KRB5_LIBS%g
16086 s%@READLINE_LIBS@%$READLINE_LIBS%g
16087 s%@SASL_LIBS@%$SASL_LIBS%g
16088 s%@TERMCAP_LIBS@%$TERMCAP_LIBS%g
16089 s%@TLS_LIBS@%$TLS_LIBS%g
16090 s%@MODULES_LIBS@%$MODULES_LIBS%g
16091 s%@AUTH_LIBS@%$AUTH_LIBS%g
16092 s%@SLAPD_SQL_LDFLAGS@%$SLAPD_SQL_LDFLAGS%g
16093 s%@SLAPD_SQL_LIBS@%$SLAPD_SQL_LIBS%g
16094 s%@SLAPD_SQL_INCLUDES@%$SLAPD_SQL_INCLUDES%g
16095
16096 CEOF
16097 EOF
16098
16099 cat >> $CONFIG_STATUS <<\EOF
16100
16101 # Split the substitutions into bite-sized pieces for seds with
16102 # small command number limits, like on Digital OSF/1 and HP-UX.
16103 ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
16104 ac_file=1 # Number of current file.
16105 ac_beg=1 # First line for current file.
16106 ac_end=$ac_max_sed_cmds # Line after last line for current file.
16107 ac_more_lines=:
16108 ac_sed_cmds=""
16109 while $ac_more_lines; do
16110   if test $ac_beg -gt 1; then
16111     sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
16112   else
16113     sed "${ac_end}q" conftest.subs > conftest.s$ac_file
16114   fi
16115   if test ! -s conftest.s$ac_file; then
16116     ac_more_lines=false
16117     rm -f conftest.s$ac_file
16118   else
16119     if test -z "$ac_sed_cmds"; then
16120       ac_sed_cmds="sed -f conftest.s$ac_file"
16121     else
16122       ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
16123     fi
16124     ac_file=`expr $ac_file + 1`
16125     ac_beg=$ac_end
16126     ac_end=`expr $ac_end + $ac_max_sed_cmds`
16127   fi
16128 done
16129 if test -z "$ac_sed_cmds"; then
16130   ac_sed_cmds=cat
16131 fi
16132 EOF
16133
16134 cat >> $CONFIG_STATUS <<EOF
16135
16136 CONFIG_FILES=\${CONFIG_FILES-"\
16137 Makefile:build/top.mk:Makefile.in:build/dir.mk \
16138 doc/Makefile:build/top.mk:doc/Makefile.in:build/dir.mk \
16139 doc/man/Makefile:build/top.mk:doc/man/Makefile.in:build/dir.mk \
16140 doc/man/man1/Makefile:build/top.mk:doc/man/man1/Makefile.in:build/man.mk \
16141 doc/man/man3/Makefile:build/top.mk:doc/man/man3/Makefile.in:build/man.mk \
16142 doc/man/man5/Makefile:build/top.mk:doc/man/man5/Makefile.in:build/man.mk \
16143 doc/man/man8/Makefile:build/top.mk:doc/man/man8/Makefile.in:build/man.mk \
16144 clients/Makefile:build/top.mk:clients/Makefile.in:build/dir.mk \
16145 clients/finger/Makefile:build/top.mk:clients/finger/Makefile.in:build/rules.mk \
16146 clients/fax500/Makefile:build/top.mk:clients/fax500/Makefile.in:build/rules.mk \
16147 clients/gopher/Makefile:build/top.mk:clients/gopher/Makefile.in:build/rules.mk \
16148 clients/mail500/Makefile:build/top.mk:clients/mail500/Makefile.in:build/rules.mk \
16149 clients/rcpt500/Makefile:build/top.mk:clients/rcpt500/Makefile.in:build/rules.mk \
16150 clients/ud/Makefile:build/top.mk:clients/ud/Makefile.in:build/rules.mk \
16151 clients/maildap/Makefile:build/top.mk:clients/maildap/Makefile.in:build/rules.mk \
16152 clients/tools/Makefile:build/top.mk:clients/tools/Makefile.in:build/rules.mk \
16153 include/Makefile:build/top.mk:include/Makefile.in \
16154 libraries/Makefile:build/top.mk:libraries/Makefile.in:build/dir.mk      \
16155 libraries/libavl/Makefile:build/top.mk:libraries/libavl/Makefile.in:build/lib.mk:build/lib-static.mk    \
16156 libraries/liblber/Makefile:build/top.mk:libraries/liblber/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16157 libraries/libldap/Makefile:build/top.mk:libraries/libldap/Makefile.in:build/lib.mk:build/lib-shared.mk  \
16158 libraries/libldap_r/Makefile:build/top.mk:libraries/libldap_r/Makefile.in:build/lib.mk:build/lib-shared.mk      \
16159 libraries/libldbm/Makefile:build/top.mk:libraries/libldbm/Makefile.in:build/lib.mk:build/lib-static.mk  \
16160 libraries/libldif/Makefile:build/top.mk:libraries/libldif/Makefile.in:build/lib.mk:build/lib-static.mk  \
16161 libraries/liblunicode/Makefile:build/top.mk:libraries/liblunicode/Makefile.in:build/lib.mk:build/lib-static.mk  \
16162 libraries/liblutil/Makefile:build/top.mk:libraries/liblutil/Makefile.in:build/lib.mk:build/lib-static.mk        \
16163 servers/Makefile:build/top.mk:servers/Makefile.in:build/dir.mk \
16164 servers/slapd/Makefile:build/top.mk:servers/slapd/Makefile.in:build/srv.mk \
16165 servers/slapd/back-dnssrv/Makefile:build/top.mk:servers/slapd/back-dnssrv/Makefile.in:build/mod.mk \
16166 servers/slapd/back-ldap/Makefile:build/top.mk:servers/slapd/back-ldap/Makefile.in:build/mod.mk \
16167 servers/slapd/back-ldbm/Makefile:build/top.mk:servers/slapd/back-ldbm/Makefile.in:build/mod.mk \
16168 servers/slapd/back-passwd/Makefile:build/top.mk:servers/slapd/back-passwd/Makefile.in:build/mod.mk \
16169 servers/slapd/back-shell/Makefile:build/top.mk:servers/slapd/back-shell/Makefile.in:build/mod.mk \
16170 servers/slapd/back-sql/Makefile:build/top.mk:servers/slapd/back-sql/Makefile.in:build/mod.mk \
16171 servers/slapd/shell-backends/Makefile:build/top.mk:servers/slapd/shell-backends/Makefile.in:build/srv.mk \
16172 servers/slapd/tools/Makefile:build/top.mk:servers/slapd/tools/Makefile.in \
16173 servers/slurpd/Makefile:build/top.mk:servers/slurpd/Makefile.in:build/srv.mk \
16174 tests/Makefile:build/top.mk:tests/Makefile.in:build/dir.mk \
16175 tests/progs/Makefile:build/top.mk:tests/progs/Makefile.in:build/rules.mk \
16176 contrib/Makefile:build/top.mk:contrib/Makefile.in:build/dir.mk \
16177 contrib/saucer/Makefile:build/top.mk:contrib/saucer/Makefile.in:build/rules.mk \
16178 "}
16179 EOF
16180 cat >> $CONFIG_STATUS <<\EOF
16181 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
16182   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16183   case "$ac_file" in
16184   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16185        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16186   *) ac_file_in="${ac_file}.in" ;;
16187   esac
16188
16189   # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
16190
16191   # Remove last slash and all that follows it.  Not all systems have dirname.
16192   ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16193   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16194     # The file is in a subdirectory.
16195     test ! -d "$ac_dir" && mkdir "$ac_dir"
16196     ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
16197     # A "../" for each directory in $ac_dir_suffix.
16198     ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
16199   else
16200     ac_dir_suffix= ac_dots=
16201   fi
16202
16203   case "$ac_given_srcdir" in
16204   .)  srcdir=.
16205       if test -z "$ac_dots"; then top_srcdir=.
16206       else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
16207   /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
16208   *) # Relative path.
16209     srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
16210     top_srcdir="$ac_dots$ac_given_srcdir" ;;
16211   esac
16212
16213   case "$ac_given_INSTALL" in
16214   [/$]*) INSTALL="$ac_given_INSTALL" ;;
16215   *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
16216   esac
16217
16218   echo creating "$ac_file"
16219   rm -f "$ac_file"
16220   configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
16221   case "$ac_file" in
16222   *[Mm]akefile*) ac_comsub="1i\\
16223 # $configure_input" ;;
16224   *) ac_comsub= ;;
16225   esac
16226
16227   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16228   sed -e "$ac_comsub
16229 s%@configure_input@%$configure_input%g
16230 s%@srcdir@%$srcdir%g
16231 s%@top_srcdir@%$top_srcdir%g
16232 s%@INSTALL@%$INSTALL%g
16233 " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
16234 fi; done
16235 rm -f conftest.s*
16236
16237 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16238 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16239 #
16240 # ac_d sets the value in "#define NAME VALUE" lines.
16241 ac_dA='s%^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16242 ac_dB='\([      ][      ]*\)[^  ]*%\1#\2'
16243 ac_dC='\3'
16244 ac_dD='%g'
16245 # ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16246 ac_uA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16247 ac_uB='\([      ]\)%\1#\2define\3'
16248 ac_uC=' '
16249 ac_uD='\4%g'
16250 # ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16251 ac_eA='s%^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16252 ac_eB='$%\1#\2define\3'
16253 ac_eC=' '
16254 ac_eD='%g'
16255
16256 if test "${CONFIG_HEADERS+set}" != set; then
16257 EOF
16258 cat >> $CONFIG_STATUS <<EOF
16259   CONFIG_HEADERS="include/portable.h include/ldap_features.h include/lber_types.h"
16260 EOF
16261 cat >> $CONFIG_STATUS <<\EOF
16262 fi
16263 for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
16264   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16265   case "$ac_file" in
16266   *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
16267        ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
16268   *) ac_file_in="${ac_file}.in" ;;
16269   esac
16270
16271   echo creating $ac_file
16272
16273   rm -f conftest.frag conftest.in conftest.out
16274   ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
16275   cat $ac_file_inputs > conftest.in
16276
16277 EOF
16278
16279 # Transform confdefs.h into a sed script conftest.vals that substitutes
16280 # the proper values into config.h.in to produce config.h.  And first:
16281 # Protect against being on the right side of a sed subst in config.status.
16282 # Protect against being in an unquoted here document in config.status.
16283 rm -f conftest.vals
16284 cat > conftest.hdr <<\EOF
16285 s/[\\&%]/\\&/g
16286 s%[\\$`]%\\&%g
16287 s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
16288 s%ac_d%ac_u%gp
16289 s%ac_u%ac_e%gp
16290 EOF
16291 sed -n -f conftest.hdr confdefs.h > conftest.vals
16292 rm -f conftest.hdr
16293
16294 # This sed command replaces #undef with comments.  This is necessary, for
16295 # example, in the case of _POSIX_SOURCE, which is predefined and required
16296 # on some systems where configure will not decide to define it.
16297 cat >> conftest.vals <<\EOF
16298 s%^[    ]*#[    ]*undef[        ][      ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
16299 EOF
16300
16301 # Break up conftest.vals because some shells have a limit on
16302 # the size of here documents, and old seds have small limits too.
16303
16304 rm -f conftest.tail
16305 while :
16306 do
16307   ac_lines=`grep -c . conftest.vals`
16308   # grep -c gives empty output for an empty file on some AIX systems.
16309   if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
16310   # Write a limited-size here document to conftest.frag.
16311   echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
16312   sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
16313   echo 'CEOF
16314   sed -f conftest.frag conftest.in > conftest.out
16315   rm -f conftest.in
16316   mv conftest.out conftest.in
16317 ' >> $CONFIG_STATUS
16318   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
16319   rm -f conftest.vals
16320   mv conftest.tail conftest.vals
16321 done
16322 rm -f conftest.vals
16323
16324 cat >> $CONFIG_STATUS <<\EOF
16325   rm -f conftest.frag conftest.h
16326   echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
16327   cat conftest.in >> conftest.h
16328   rm -f conftest.in
16329   if cmp -s $ac_file conftest.h 2>/dev/null; then
16330     echo "$ac_file is unchanged"
16331     rm -f conftest.h
16332   else
16333     # Remove last slash and all that follows it.  Not all systems have dirname.
16334       ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
16335       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16336       # The file is in a subdirectory.
16337       test ! -d "$ac_dir" && mkdir "$ac_dir"
16338     fi
16339     rm -f $ac_file
16340     mv conftest.h $ac_file
16341   fi
16342 fi; done
16343
16344 EOF
16345 cat >> $CONFIG_STATUS <<EOF
16346
16347 EOF
16348 cat >> $CONFIG_STATUS <<\EOF
16349
16350 date > stamp-h
16351 echo Please \"make depend\" to build dependencies
16352
16353 exit 0
16354 EOF
16355 chmod +x $CONFIG_STATUS
16356 rm -fr confdefs* $ac_clean_files
16357 test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
16358